├── FastCommander.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── FastCommander ├── AppDelegate.h ├── AppDelegate.m ├── FastCommander-Info.plist ├── FastCommander-Prefix.pch ├── en.lproj │ ├── Credits.rtf │ ├── InfoPlist.strings │ └── MainMenu.xib ├── gfx │ ├── icon_combo_close.pdf │ ├── icon_combo_open.pdf │ ├── icon_dirup.pdf │ ├── icon_item_selected.png │ ├── icon_item_selected@2x.png │ ├── icon_selection.pdf │ ├── license │ │ ├── button_license_activate.png │ │ ├── button_license_activate@2x.png │ │ ├── button_license_buy.png │ │ ├── button_license_buy@2x.png │ │ ├── button_license_resend.png │ │ └── button_license_resend@2x.png │ ├── message-icon-collision.pdf │ ├── message-icon-error.pdf │ ├── operationAnalyzingTemplate.pdf │ ├── operationSearchTemplate.pdf │ └── toolbar │ │ ├── toolbarCompressTemplate.pdf │ │ ├── toolbarConsoleTemplate.pdf │ │ ├── toolbarCopyTemplate.pdf │ │ ├── toolbarDeleteTemplate.pdf │ │ ├── toolbarEditTemplate.pdf │ │ ├── toolbarFinderTemplate.pdf │ │ ├── toolbarFolderTemplate.pdf │ │ ├── toolbarHiddenTemplate.pdf │ │ ├── toolbarMoveTemplate.pdf │ │ ├── toolbarPermissionsTemplate.pdf │ │ └── toolbarViewTemplate.pdf ├── main.m └── src │ ├── FMAdvancedCombo.h │ ├── FMAdvancedCombo.m │ ├── FMAdvancedComboEvents.h │ ├── FMAdvancedComboSheet.h │ ├── FMAdvancedComboSheet.m │ ├── FMAdvancedComboSheetController.h │ ├── FMAdvancedComboSheetController.m │ ├── FMAdvancedComboSheetController.xib │ ├── FMAdvancedComboSheetItem.h │ ├── FMAdvancedComboSheetItem.m │ ├── FMBookmarksManager.h │ ├── FMBookmarksManager.m │ ├── FMBufferFinder.h │ ├── FMBufferFinder.m │ ├── FMBufferFinderText.h │ ├── FMBufferFinderText.m │ ├── FMCommand.h │ ├── FMCommand.m │ ├── FMCommandManager.h │ ├── FMCommandManager.m │ ├── FMConsts.h │ ├── FMConsts.m │ ├── FMContextMenu.h │ ├── FMContextMenu.m │ ├── FMCustomTypes.h │ ├── FMCustomTypes.m │ ├── FMDefaultWindow.h │ ├── FMDefaultWindow.m │ ├── FMDirectoryViewController.h │ ├── FMDirectoryViewController.m │ ├── FMDirectoryViewControllerContent.h │ ├── FMDirectoryViewControllerContent.m │ ├── FMDirectoryWatcher.h │ ├── FMDirectoryWatcher.m │ ├── FMDockInfoView.h │ ├── FMDockInfoView.m │ ├── FMFileAnalyzingOperation.h │ ├── FMFileAnalyzingOperation.m │ ├── FMFileCalcSizeOperation.h │ ├── FMFileCalcSizeOperation.m │ ├── FMFileCompressOperation.h │ ├── FMFileCompressOperation.m │ ├── FMFileCopyOperation.h │ ├── FMFileCopyOperation.m │ ├── FMFileDeleteOperation.h │ ├── FMFileDeleteOperation.m │ ├── FMFileEditOperation.h │ ├── FMFileEditOperation.m │ ├── FMFileFilter.h │ ├── FMFileFilter.m │ ├── FMFileFolderOperation.h │ ├── FMFileFolderOperation.m │ ├── FMFileItem.h │ ├── FMFileItem.m │ ├── FMFileManager.h │ ├── FMFileManager.m │ ├── FMFileOperation.h │ ├── FMFileOperation.m │ ├── FMFileOperationProgress.h │ ├── FMFileOperationUserData.h │ ├── FMFileOperationUserData.m │ ├── FMFileOperationValidator.h │ ├── FMFileOperationValidator.m │ ├── FMFilePermissionsOperation.h │ ├── FMFilePermissionsOperation.m │ ├── FMFileProcessingResolver.h │ ├── FMFileProcessingResolver.m │ ├── FMFileRenameOperation.h │ ├── FMFileRenameOperation.m │ ├── FMFileSearchOperation.h │ ├── FMFileSearchOperation.m │ ├── FMFileViewOperation.h │ ├── FMFileViewOperation.m │ ├── FMFilesTableView+Commands.h │ ├── FMFilesTableView+Commands.m │ ├── FMFilesTableView.h │ ├── FMFilesTableView.m │ ├── FMFilesTableViewDrawRow.h │ ├── FMFilesTableViewDrawRow.m │ ├── FMLeftDirectoryViewController.h │ ├── FMLeftDirectoryViewController.m │ ├── FMLeftFilesTableView.h │ ├── FMLeftFilesTableView.m │ ├── FMLightProgressBar.h │ ├── FMLightProgressBar.m │ ├── FMLocalPanelListProvider.h │ ├── FMLocalPanelListProvider.m │ ├── FMMainViewController.h │ ├── FMMainViewController.m │ ├── FMOSTools.h │ ├── FMOSTools.m │ ├── FMOpCopyProgressViewController.h │ ├── FMOpCopyProgressViewController.m │ ├── FMOpFileErrorViewController.h │ ├── FMOpFileErrorViewController.m │ ├── FMOpFileExistsViewController.h │ ├── FMOpFileExistsViewController.m │ ├── FMOperationAnalyzingWindow.h │ ├── FMOperationAnalyzingWindow.m │ ├── FMOperationCommandSupport.h │ ├── FMOperationCommandSupport.m │ ├── FMOperationCompressWindow.h │ ├── FMOperationCompressWindow.m │ ├── FMOperationCopyWindow.h │ ├── FMOperationCopyWindow.m │ ├── FMOperationDeleteWindow.h │ ├── FMOperationDeleteWindow.m │ ├── FMOperationFolderWindow.h │ ├── FMOperationFolderWindow.m │ ├── FMOperationImageViewWindow.h │ ├── FMOperationImageViewWindow.m │ ├── FMOperationPermissionsWindow.h │ ├── FMOperationPermissionsWindow.m │ ├── FMOperationRenameWindow.h │ ├── FMOperationRenameWindow.m │ ├── FMOperationSearchWindow.h │ ├── FMOperationSearchWindow.m │ ├── FMOperationStats.h │ ├── FMOperationStats.m │ ├── FMOperationTextViewWindow.h │ ├── FMOperationTextViewWindow.m │ ├── FMOperationUserAction.h │ ├── FMOperationUserAction.m │ ├── FMOperationWindow.h │ ├── FMOperationWindow.m │ ├── FMPanelListItem.h │ ├── FMPanelListItem.m │ ├── FMPanelListProvider.h │ ├── FMPanelListProvider.m │ ├── FMPanelListProviderManager.h │ ├── FMPanelListProviderManager.m │ ├── FMPanelModeIndicator.h │ ├── FMPanelModeIndicator.m │ ├── FMPanelSortIndicator.h │ ├── FMPanelSortIndicator.m │ ├── FMPosixPermissions.h │ ├── FMPosixPermissions.m │ ├── FMPreferencesWindow.h │ ├── FMPreferencesWindow.m │ ├── FMProcessCopyFile.h │ ├── FMProcessCopyFile.m │ ├── FMProcessGetFile.h │ ├── FMProcessGetFile.m │ ├── FMProcessMoveFile.h │ ├── FMProcessMoveFile.m │ ├── FMProcessSearchFile.h │ ├── FMProcessSearchFile.m │ ├── FMProcessTargetFile.h │ ├── FMProcessTargetFile.m │ ├── FMProviderFileItem.h │ ├── FMProviderFileItem.m │ ├── FMReloadData.h │ ├── FMReloadData.m │ ├── FMResources.h │ ├── FMResources.m │ ├── FMRightDirectoryViewController.h │ ├── FMRightDirectoryViewController.m │ ├── FMRightFilesTableView.h │ ├── FMRightFilesTableView.m │ ├── FMScrollAnimation.h │ ├── FMScrollAnimation.m │ ├── FMScrollIndicator.h │ ├── FMScrollIndicator.m │ ├── FMSearchPanelListProvider.h │ ├── FMSearchPanelListProvider.m │ ├── FMSelectionViewController.h │ ├── FMSelectionViewController.m │ ├── FMSettings.h │ ├── FMSettings.m │ ├── FMSummaryInformation.h │ ├── FMSummaryInformation.m │ ├── FMTheme.h │ ├── FMTheme.m │ ├── FMThemeChocolate.h │ ├── FMThemeChocolate.m │ ├── FMThemeChocolate1.h │ ├── FMThemeChocolate1.m │ ├── FMThemeCustom1.h │ ├── FMThemeCustom1.m │ ├── FMThemeCustom2.h │ ├── FMThemeCustom2.m │ ├── FMThemeMac.h │ ├── FMThemeMac.m │ ├── FMThemeManager.h │ ├── FMThemeManager.m │ ├── FMThemeMatrix.h │ ├── FMThemeMatrix.m │ ├── FMThemeNorton.h │ ├── FMThemeNorton.m │ ├── FMThemeSolarizedDark.h │ ├── FMThemeSolarizedDark.m │ ├── FMThemeSolarizedDarkColor1.h │ ├── FMThemeSolarizedDarkColor1.m │ ├── FMThemeSolarizedLight.h │ ├── FMThemeSolarizedLight.m │ ├── FMThemeSolarizedLightColor1.h │ ├── FMThemeSolarizedLightColor1.m │ ├── FMThemeSublime.h │ ├── FMThemeSublime.m │ ├── FMWorkDirectory.h │ ├── FMWorkDirectory.m │ ├── FMZipPanelListProvider.h │ ├── FMZipPanelListProvider.m │ ├── NSColor+Hex.h │ ├── NSColor+Hex.m │ ├── NSPanelTextFieldCell.h │ ├── NSPanelTextFieldCell.m │ ├── NSString+Utils.h │ ├── NSString+Utils.m │ └── zipzap │ ├── ZZArchive.h │ ├── ZZArchive.mm │ ├── ZZArchiveEntry.h │ ├── ZZArchiveEntry.m │ ├── ZZArchiveEntryWriter.h │ ├── ZZChannel.h │ ├── ZZChannelOutput.h │ ├── ZZDataChannel.h │ ├── ZZDataChannel.m │ ├── ZZDataChannelOutput.h │ ├── ZZDataChannelOutput.m │ ├── ZZDeflateOutputStream.h │ ├── ZZDeflateOutputStream.m │ ├── ZZError.h │ ├── ZZError.m │ ├── ZZFileChannel.h │ ├── ZZFileChannel.m │ ├── ZZFileChannelOutput.h │ ├── ZZFileChannelOutput.m │ ├── ZZHeaders.h │ ├── ZZInflateInputStream.h │ ├── ZZInflateInputStream.m │ ├── ZZNewArchiveEntry.h │ ├── ZZNewArchiveEntry.mm │ ├── ZZNewArchiveEntryWriter.h │ ├── ZZNewArchiveEntryWriter.mm │ ├── ZZOldArchiveEntry.h │ ├── ZZOldArchiveEntry.mm │ ├── ZZOldArchiveEntryWriter.h │ ├── ZZOldArchiveEntryWriter.mm │ ├── ZZStoreOutputStream.h │ ├── ZZStoreOutputStream.m │ ├── zipzap-Prefix.pch │ └── zipzap.h ├── LICENSE.md ├── README.md ├── gfx-prj ├── icon.icns ├── icon.iconset │ ├── icon_128x128.png │ ├── icon_128x128@2x.png │ ├── icon_16x16.png │ ├── icon_16x16@2x.png │ ├── icon_256x256.png │ ├── icon_256x256@2x.png │ ├── icon_32x32.png │ ├── icon_32x32@2x.png │ ├── icon_512x512.png │ └── icon_512x512@2x.png ├── icon_item_selected.pdf ├── main │ ├── icon_128.ai │ ├── icon_16.ai │ ├── icon_256.ai │ ├── icon_32.ai │ └── icon_512.ai ├── message-icon.ai ├── panel_mode_icons.svg └── toolbar_svg │ ├── compress.svg │ ├── console.svg │ ├── copy.svg │ ├── delete.svg │ ├── edit.svg │ ├── finder.svg │ ├── folder.svg │ ├── hidden.svg │ ├── move.svg │ ├── permissions.svg │ └── view.svg ├── icon.icns └── zipzap ├── LICENSE.text ├── README.markdown ├── zipzap.podspec └── zipzapTests ├── ZZTasks.h ├── ZZTasks.m ├── ZZUnzipTests.h ├── ZZUnzipTests.m ├── ZZZipTests.h ├── ZZZipTests.m ├── en.lproj └── InfoPlist.strings ├── li-europan-lingues.txt ├── lorem-ipsum.txt ├── pangram.txt ├── zipzapTests-Info.plist └── 拉链.txt /FastCommander.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /FastCommander/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 13.04.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMMainViewController.h" 11 | #import "FMRightDirectoryViewController.h" 12 | #import "FMLeftDirectoryViewController.h" 13 | #import "FMPanelListProviderManager.h" 14 | #import "FMFileProcessingResolver.h" 15 | 16 | @interface AppDelegate : NSObject 17 | 18 | @property (readonly) FMFileProcessingResolver *fileProcessingResolver; 19 | 20 | @property (weak) IBOutlet FMMainViewController *mainViewController; 21 | 22 | @property (weak) IBOutlet FMRightDirectoryViewController *rightViewController; 23 | @property (weak) IBOutlet FMLeftDirectoryViewController *leftViewController; 24 | 25 | @property (readonly) FMPanelListProviderManager *rightListProviderManager; 26 | @property (readonly) FMPanelListProviderManager *leftListProviderManager; 27 | 28 | @property (readonly) FMPanelSide sourcePanelSide; 29 | @property (readonly) FMPanelSide targetPanelSide; 30 | 31 | @property (readonly) FMPanelListProvider *sourcePanelListProvider; 32 | @property (readonly) FMPanelListProvider *targetPanelListProvider; 33 | 34 | @property (readonly) FMDirectoryViewController *sourceViewController; 35 | @property (readonly) FMDirectoryViewController *targetViewController; 36 | 37 | + (AppDelegate *)this; 38 | 39 | - (FMPanelListProvider *)panelListProvider:(FMPanelSide)panelSide; 40 | - (FMPanelListProviderManager *)panelListProviderManager:(FMPanelSide)panelSide; 41 | 42 | - (FMDirectoryViewController *)viewController:(FMPanelSide)panelSide; 43 | - (FMDirectoryViewController *)viewControllerForProvider:(FMPanelListProvider *)provider; 44 | 45 | - (void)setPanelMode:(FMPanelMode)mode forPanelSide:(FMPanelSide)side; 46 | 47 | - (void)setSameDirectoryOnTarget; 48 | 49 | - (void)reloadSourcePanel:(OnReloadBlock)onReloadFinish; 50 | - (void)reloadTargetPanel:(OnReloadBlock)onReloadFinish; 51 | - (void)reloadBothPanels; 52 | 53 | - (void)setSearchProviderWithData:(NSMutableArray *)fileItems andTitle:(NSString *)providerTitle; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /FastCommander/FastCommander-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | icon 11 | CFBundleIdentifier 12 | pl.piotr.zagawa.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 2.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSApplicationCategoryType 26 | public.app-category.utilities 27 | LSMinimumSystemVersion 28 | ${MACOSX_DEPLOYMENT_TARGET} 29 | NSHighResolutionCapable 30 | 31 | NSHumanReadableCopyright 32 | Copyright © 2013 Piotr Zagawa. All rights reserved. 33 | NSMainNibFile 34 | MainMenu 35 | NSPrincipalClass 36 | NSApplication 37 | 38 | 39 | -------------------------------------------------------------------------------- /FastCommander/FastCommander-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'FastCommander' target in the 'FastCommander' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /FastCommander/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390 2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Menlo-Bold;\f2\fnil\fcharset0 Menlo-Regular; 3 | } 4 | {\colortbl;\red255\green255\blue255;\red102\green102\blue102;} 5 | \paperw11900\paperh16840\vieww9600\viewh8400\viewkind0 6 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 7 | 8 | \f0\b\fs24 \cf0 DEVELOPMENT AND DESIGN\ 9 | \ 10 | \pard\tx577\pardeftab577\pardirnatural 11 | 12 | \f1 \cf0 \CocoaLigature0 Piotr Zagawa 13 | \f2\b0 \ 14 | {\field{\*\fldinst{HYPERLINK "http://www.fastcommander.com"}}{\fldrslt http://www.fastcommander.com}}\ 15 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 16 | 17 | \f0 \cf0 \CocoaLigature1 \ 18 | 19 | \b THANKS TO\ 20 | \pard\tx577\pardeftab577\pardirnatural 21 | 22 | \f2\b0 \cf0 \CocoaLigature0 \ 23 | 24 | \f1\b Glen Low 25 | \f2\b0 \ 26 | \cf2 for zipzap library\cf0 \ 27 | {\field{\*\fldinst{HYPERLINK "https://github.com/pixelglow/zipzap"}}{\fldrslt https://github.com/pixelglow/zipzap}}\ 28 | \ 29 | 30 | \f1\b Ethan Schoonover 31 | \f2\b0 \ 32 | \cf2 for Solarized colors\cf0 \ 33 | {\field{\*\fldinst{HYPERLINK "http://ethanschoonover.com/solarized"}}{\fldrslt http://ethanschoonover.com/solarized}}\ 34 | } -------------------------------------------------------------------------------- /FastCommander/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /FastCommander/gfx/icon_combo_close.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/icon_combo_close.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/icon_combo_open.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/icon_combo_open.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/icon_dirup.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/icon_dirup.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/icon_item_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/icon_item_selected.png -------------------------------------------------------------------------------- /FastCommander/gfx/icon_item_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/icon_item_selected@2x.png -------------------------------------------------------------------------------- /FastCommander/gfx/icon_selection.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/icon_selection.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/license/button_license_activate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/license/button_license_activate.png -------------------------------------------------------------------------------- /FastCommander/gfx/license/button_license_activate@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/license/button_license_activate@2x.png -------------------------------------------------------------------------------- /FastCommander/gfx/license/button_license_buy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/license/button_license_buy.png -------------------------------------------------------------------------------- /FastCommander/gfx/license/button_license_buy@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/license/button_license_buy@2x.png -------------------------------------------------------------------------------- /FastCommander/gfx/license/button_license_resend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/license/button_license_resend.png -------------------------------------------------------------------------------- /FastCommander/gfx/license/button_license_resend@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/license/button_license_resend@2x.png -------------------------------------------------------------------------------- /FastCommander/gfx/message-icon-collision.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/message-icon-collision.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/message-icon-error.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/message-icon-error.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/operationAnalyzingTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/operationAnalyzingTemplate.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/operationSearchTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/operationSearchTemplate.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/toolbar/toolbarCompressTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/toolbar/toolbarCompressTemplate.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/toolbar/toolbarConsoleTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/toolbar/toolbarConsoleTemplate.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/toolbar/toolbarCopyTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/toolbar/toolbarCopyTemplate.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/toolbar/toolbarDeleteTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/toolbar/toolbarDeleteTemplate.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/toolbar/toolbarEditTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/toolbar/toolbarEditTemplate.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/toolbar/toolbarFinderTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/toolbar/toolbarFinderTemplate.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/toolbar/toolbarFolderTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/toolbar/toolbarFolderTemplate.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/toolbar/toolbarHiddenTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/toolbar/toolbarHiddenTemplate.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/toolbar/toolbarMoveTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/toolbar/toolbarMoveTemplate.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/toolbar/toolbarPermissionsTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/toolbar/toolbarPermissionsTemplate.pdf -------------------------------------------------------------------------------- /FastCommander/gfx/toolbar/toolbarViewTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/FastCommander/gfx/toolbar/toolbarViewTemplate.pdf -------------------------------------------------------------------------------- /FastCommander/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 13.04.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /FastCommander/src/FMAdvancedCombo.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMAdvancedCombo.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 18.09.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMAdvancedComboSheetController.h" 11 | #import "FMAdvancedComboEvents.h" 12 | 13 | @interface FMAdvancedCombo : NSTextField 14 | 15 | @property NSArray *listItems; 16 | 17 | @property (readonly) BOOL isListVisible; 18 | 19 | @property (weak) id eventsDelegate; 20 | 21 | @property (weak) NSWindow *parentWindow; 22 | 23 | - (void)showList; 24 | - (void)closeList; 25 | 26 | - (void)acceptSelectedItem; 27 | - (BOOL)isSelection; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /FastCommander/src/FMAdvancedComboEvents.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMAdvancedComboEvents.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 28.09.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMAdvancedCombo; 12 | 13 | @protocol FMAdvancedComboEvents 14 | 15 | - (void)onAdvancedComboListWillOpen:(FMAdvancedCombo *)combo; 16 | - (void)onAdvancedComboListDidOpen:(FMAdvancedCombo *)combo; 17 | - (void)onAdvancedComboListDidClose:(FMAdvancedCombo *)combo; 18 | - (void)onAdvancedComboListItemSelected:(FMAdvancedCombo *)combo item:(NSString *)itemText; 19 | - (void)onAdvancedComboTextAccepted:(FMAdvancedCombo *)combo item:(NSString *)itemText; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /FastCommander/src/FMAdvancedComboSheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMAdvancedComboSheet.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 28.09.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMAdvancedCombo; 12 | 13 | @interface FMAdvancedComboSheet : NSWindow 14 | 15 | @property (weak) FMAdvancedCombo *linkedCombo; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FastCommander/src/FMAdvancedComboSheet.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMAdvancedComboSheet.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 28.09.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMAdvancedComboSheet.h" 10 | #import "FMCustomTypes.h" 11 | #import "FMAdvancedCombo.h" 12 | 13 | @implementation FMAdvancedComboSheet 14 | 15 | - (void)keyDown:(NSEvent *)theEvent 16 | { 17 | if (theEvent.keyCode == FMKeyCode_ESCAPE) 18 | { 19 | //key handling forwarded to keyUp 20 | return; 21 | } 22 | 23 | if (theEvent.keyCode == FMKeyCode_ENTER) 24 | { 25 | if (self.linkedCombo.isSelection) 26 | { 27 | //key handling forwarded to keyUp 28 | return; 29 | } 30 | } 31 | 32 | [super keyDown:theEvent]; 33 | } 34 | 35 | - (void)keyUp:(NSEvent *)theEvent 36 | { 37 | if (theEvent.keyCode == FMKeyCode_ESCAPE) 38 | { 39 | [self closeList]; 40 | return; 41 | } 42 | 43 | if (theEvent.keyCode == FMKeyCode_ENTER) 44 | { 45 | if (self.linkedCombo.isSelection) 46 | { 47 | [self.linkedCombo acceptSelectedItem]; 48 | 49 | [self closeList]; 50 | 51 | return; 52 | } 53 | } 54 | 55 | [super keyUp:theEvent]; 56 | } 57 | 58 | - (void)closeList 59 | { 60 | __weak FMAdvancedCombo *combo = self.linkedCombo; 61 | 62 | NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^ 63 | { 64 | [combo closeList]; 65 | }]; 66 | 67 | [NSOperationQueue.mainQueue addOperation:operation]; 68 | } 69 | 70 | - (BOOL)acceptsFirstResponder 71 | { 72 | return YES; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /FastCommander/src/FMAdvancedComboSheetController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMAdvancedComboSheetController.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 18.09.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMAdvancedCombo; 12 | 13 | @interface FMAdvancedComboSheetController : NSWindowController 14 | 15 | @property NSArray *listItems; 16 | 17 | @property (weak) FMAdvancedCombo *linkedCombo; 18 | 19 | @property (readonly) int maxListItemsCount; 20 | 21 | @property (readonly) int listContentHeight; 22 | @property (readonly) int totalSheetHeight; 23 | 24 | @property int selectedItemIndex; 25 | 26 | @property (readonly) BOOL isSelection; 27 | 28 | @property (readonly) NSString *selectedItem; 29 | 30 | @property (weak) IBOutlet NSScrollView *scrollView; 31 | @property (weak) IBOutlet NSView *scrollViewContainer; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /FastCommander/src/FMAdvancedComboSheetItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMAdvancedComboSheetItem.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 20.09.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMAdvancedComboSheetController; 12 | 13 | @interface FMAdvancedComboSheetItem : NSView 14 | 15 | @property (weak) FMAdvancedComboSheetController *controller; 16 | 17 | @property (readonly) NSString *text; 18 | 19 | @property (readonly) NSString *title; 20 | 21 | @property NSString *description; 22 | 23 | @property NSImage *icon; 24 | 25 | @property BOOL isSelected; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /FastCommander/src/FMBookmarksManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMBookmarksManager.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 07.09.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMCustomTypes.h" 11 | 12 | //ITEM 13 | @interface FMBookmarkItem : NSObject 14 | 15 | typedef enum 16 | { 17 | FMBookmarkItemTypeVolume = 1, 18 | FMBookmarkItemTypeUserPath = 2, 19 | FMBookmarkItemTypeSearchProvider = 3, 20 | FMBookmarkItemTypeCustom = 4, 21 | 22 | } FMBookmarkItemType; 23 | 24 | @property (readonly) NSString *path; 25 | @property (readonly) FMBookmarkItemType type; 26 | 27 | @property BOOL isVisible; 28 | 29 | + (FMBookmarkItem *)searchBookmarkForPanel:(FMPanelSide)panelSide; 30 | 31 | + (FMBookmarkItem *)fromPath:(NSString *)path visible:(BOOL)isVisible itemType:(FMBookmarkItemType)type; 32 | + (FMBookmarkItem *)fromURL:(NSURL *)url visible:(BOOL)isVisible itemType:(FMBookmarkItemType)type; 33 | 34 | - (BOOL)isBookmarkAvailable; 35 | - (BOOL)isBookmarkAvailableForPanel:(FMPanelSide)panelSide; 36 | 37 | - (NSString *)pathForPanel:(FMPanelSide)panelSide; 38 | 39 | - (NSString *)toString; 40 | 41 | @end 42 | 43 | //MANAGER 44 | @interface FMBookmarksManager : NSObject 45 | 46 | - (NSArray *)loadBookmarks; 47 | - (void)saveBookmarks:(NSArray *)bookmarks; 48 | 49 | - (void)update; 50 | - (void)updateInBackground; 51 | 52 | - (BOOL)addBookmark:(NSString *)directory; 53 | - (BOOL)removeBookmark:(FMBookmarkItem *)bookmark; 54 | 55 | + (NSArray *)bookmarksStringsForPanel:(FMPanelSide)panelSide; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /FastCommander/src/FMBufferFinder.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMBufferFinder.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 22.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMBufferFinder : NSObject 12 | 13 | @property (readonly) NSString *text; 14 | @property (readonly) BOOL isPatternMatch; 15 | @property (readonly) long long matchPosition; 16 | 17 | - (id)initWithText:(NSString *)text; 18 | 19 | - (void)reset; 20 | - (BOOL)process:(uint8_t *)buffer withSize:(NSInteger)size; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /FastCommander/src/FMBufferFinder.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMBufferFinder.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 22.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMBufferFinder.h" 10 | #import "FMBufferFinderText.h" 11 | 12 | @implementation FMBufferFinder 13 | { 14 | NSString *_text; 15 | NSMutableArray *_finderTextList; 16 | } 17 | 18 | - (id)initWithText:(NSString *)text 19 | { 20 | self = [super init]; 21 | 22 | if (self) 23 | { 24 | self->_text = text; 25 | 26 | self->_finderTextList = [FMBufferFinderText encodedTextList:text]; 27 | } 28 | 29 | return self; 30 | } 31 | 32 | - (void)reset 33 | { 34 | for (FMBufferFinderText *finderText in self->_finderTextList) 35 | { 36 | [finderText reset]; 37 | } 38 | 39 | self->_isPatternMatch = NO; 40 | self->_matchPosition = -1; 41 | } 42 | 43 | - (BOOL)process:(uint8_t *)buffer withSize:(NSInteger)size 44 | { 45 | if (self->_finderTextList.count == 0) 46 | { 47 | return NO; 48 | } 49 | 50 | for (FMBufferFinderText *finderText in self->_finderTextList) 51 | { 52 | [finderText testPatternMatch:buffer withSize:size]; 53 | 54 | if (finderText.isPatternMatch) 55 | { 56 | self->_isPatternMatch = YES; 57 | self->_matchPosition = finderText.matchPosition; 58 | break; 59 | } 60 | } 61 | 62 | return YES; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /FastCommander/src/FMBufferFinderText.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMBufferFinderText.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 22.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMBufferFinderText : NSObject 12 | 13 | @property (readonly) BOOL isPatternMatch; 14 | @property (readonly) long long matchPosition; 15 | 16 | + (NSMutableArray *)encodedTextList:(NSString *)text; 17 | 18 | - (void)reset; 19 | - (void)testPatternMatch:(uint8_t *)buffer withSize:(NSInteger)size; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /FastCommander/src/FMCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMCommand.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 09.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMCustomTypes.h" 11 | #import "FMPanelListItem.h" 12 | #import "FMPanelListProvider.h" 13 | 14 | @interface FMCommand : NSObject 15 | 16 | @property NSString *path; 17 | @property FMPanelListItem *listItem; 18 | 19 | @property FMCommandId commandId; 20 | @property NSString *commandName; 21 | 22 | @property BOOL isSinglePanel; 23 | @property BOOL isSelectionRequired; 24 | 25 | @property (weak) id sourceObject; 26 | @property FMPanelSide panelSide; 27 | @property FMPanelMode panelMode; 28 | @property FMSelectionMode selectionMode; 29 | @property (copy) NSString *selectionPattern; 30 | @property (copy) NSString *text; 31 | @property (copy) NSString *message; 32 | 33 | @property (weak) FMPanelListProvider *operationSource; 34 | @property (weak) FMPanelListProvider *operationTarget; 35 | 36 | - (void)execute; 37 | 38 | + (FMCommand *)directoryUp:(NSString *)value; 39 | + (FMCommand *)directoryDown:(FMPanelListItem *)listItem; 40 | + (FMCommand *)processFile:(FMPanelListItem *)listItem; 41 | + (FMCommand *)selectItem:(NSString *)value; 42 | + (FMCommand *)selectItems; 43 | + (FMCommand *)updateSummary; 44 | + (FMCommand *)showDirectories; 45 | + (FMCommand *)setPanelMode:(FMPanelMode)mode; 46 | + (FMCommand *)setSameDirectoryOnTarget; 47 | + (FMCommand *)showSelectionPanel:(FMSelectionMode)mode withPattern:(NSString *)pattern; 48 | + (FMCommand *)updateItemsSelection:(FMSelectionMode)mode withPattern:(NSString *)pattern; 49 | + (FMCommand *)updateBottomStatusText:(NSString *)value; 50 | 51 | + (FMCommand *)showAlert:(NSString *)message withTitle:(NSString *)title; 52 | + (FMCommand *)showPreferences; 53 | 54 | + (FMCommand *)fileOperationView; 55 | + (FMCommand *)fileOperationEdit; 56 | + (FMCommand *)fileOperationCopy; 57 | + (FMCommand *)fileOperationMove; 58 | + (FMCommand *)fileOperationDelete; 59 | + (FMCommand *)fileOperationRename; 60 | + (FMCommand *)fileOperationFolder; 61 | 62 | + (FMCommand *)fileOperationCompress; 63 | + (FMCommand *)fileOperationPermissions; 64 | 65 | + (FMCommand *)fileOperationSearch; 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /FastCommander/src/FMCommandManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMCommandManager.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 09.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMCommand.h" 11 | 12 | @interface FMCommandManager : NSObject 13 | 14 | + (void)executeCommand:(FMCommand *)command; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FastCommander/src/FMConsts.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMConsts.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 17.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMConsts : NSObject 12 | 13 | @property (readonly) BOOL isCopyrightUnchanged; 14 | 15 | @property (readonly) NSString *applicationTitle; 16 | @property (readonly) NSString *applicationTitleWithVersion; 17 | @property (readonly) NSString *applicationFullTitle; 18 | 19 | @property (readonly) NSString *applicationAuthor; 20 | @property (readonly) NSString *copyrightText; 21 | 22 | @property (readonly) NSString *applicationHomepage; 23 | @property (readonly) NSURL *applicationHomepageUrl; 24 | 25 | @property (readonly) NSString *applicationHelpPage; 26 | @property (readonly) NSURL *applicationHelpPageUrl; 27 | 28 | + (FMConsts *)instance; 29 | 30 | - (id)init; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /FastCommander/src/FMConsts.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMConsts.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 17.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMConsts.h" 10 | 11 | @implementation FMConsts 12 | 13 | + (FMConsts *)instance 14 | { 15 | static FMConsts *singleton = nil; 16 | 17 | @synchronized(self) 18 | { 19 | if (!singleton) 20 | { 21 | singleton = [[FMConsts alloc] init]; 22 | } 23 | 24 | return singleton; 25 | } 26 | } 27 | 28 | - (id)init 29 | { 30 | self = [super init]; 31 | 32 | if (self) 33 | { 34 | } 35 | 36 | return self; 37 | } 38 | 39 | - (NSString *)applicationTitle 40 | { 41 | return @"FastCommander"; 42 | } 43 | 44 | - (NSString *)applicationAuthor 45 | { 46 | return @"PIOTR ZAGAWA"; 47 | } 48 | 49 | - (NSString *)applicationHomepage 50 | { 51 | return @"http://www.fastcommander.com"; 52 | } 53 | 54 | - (NSURL *)applicationHelpPageUrl 55 | { 56 | return [NSURL URLWithString:self.applicationHelpPage]; 57 | } 58 | 59 | - (NSString *)applicationFullTitle 60 | { 61 | NSMutableString *text = [[NSMutableString alloc] init]; 62 | 63 | [text appendString:self.applicationTitle]; 64 | [text appendString:@" "]; 65 | [text appendString:@"©"]; 66 | [text appendString:@" "]; 67 | [text appendString:self.applicationAuthor]; 68 | 69 | return text; 70 | } 71 | 72 | - (NSString *)applicationTitleWithVersion 73 | { 74 | NSMutableString *text = [[NSMutableString alloc] init]; 75 | 76 | [text appendString:self.applicationTitle]; 77 | [text appendString:@" "]; 78 | 79 | NSBundle *bundle = [NSBundle mainBundle]; 80 | 81 | if (bundle != nil) 82 | { 83 | NSString *version = [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; 84 | 85 | [text appendString:version]; 86 | } 87 | 88 | return text; 89 | } 90 | 91 | - (NSURL *)applicationHomepageUrl 92 | { 93 | return [NSURL URLWithString:self.applicationHomepage]; 94 | } 95 | 96 | - (NSString *)copyrightText 97 | { 98 | NSMutableString *text = [[NSMutableString alloc] init]; 99 | 100 | [text appendString:@"COPYRIGHT ©"]; 101 | [text appendString:@" "]; 102 | [text appendString:@"2013 – 2015"]; 103 | [text appendString:@" "]; 104 | [text appendString:self.applicationAuthor]; 105 | 106 | return text; 107 | } 108 | 109 | @end 110 | 111 | -------------------------------------------------------------------------------- /FastCommander/src/FMContextMenu.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMContextMenu.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 27.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMPanelListItem; 12 | @class FMPanelListProvider; 13 | 14 | @interface FMContextMenuAppItem : NSObject 15 | 16 | @property NSURL *fileUrl; 17 | @property NSURL *appUrl; 18 | 19 | @end 20 | 21 | @interface FMContextMenu : NSObject 22 | 23 | - (NSMenu *)menuForItem:(FMPanelListItem *)listItem; 24 | 25 | - (void)actionOpenWith:(id)sender; 26 | - (void)actionCheckSize:(id)sender; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /FastCommander/src/FMCustomTypes.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMCustomTypes.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 08.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMCustomTypes.h" 10 | 11 | @implementation FMCustomTypes 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /FastCommander/src/FMDefaultWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMDefaultWindow.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 25.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMDefaultWindow : NSWindow 12 | 13 | @property (weak) NSTextField *textTitle; 14 | @property (weak) NSButton *btnCancel; 15 | @property (weak) NSButton *btnAccept; 16 | 17 | @property (readonly) NSPoint buttonOrigin; 18 | @property (readonly) CGFloat buttonSpacing; 19 | 20 | @property (readonly) BOOL isSheetOpen; 21 | 22 | @property (readonly) NSString *acceptTitle; 23 | 24 | - (void)actionCancel:(id)sender; 25 | - (void)actionAccept:(id)sender; 26 | 27 | - (void)initKeyEventsMonitor; 28 | - (void)closeKeyEventsMonitor; 29 | 30 | - (void)reset; 31 | 32 | - (void)closeSheet; 33 | 34 | + (void)showSheetWith:(FMDefaultWindow *)window; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /FastCommander/src/FMDirectoryViewControllerContent.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMDirectoryViewControllerContent.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 07.04.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMPanelListProvider.h" 11 | #import "FMFilesTableView.h" 12 | 13 | @interface FMDirectoryViewControllerContent : NSObject 14 | 15 | @property (weak) FMPanelListProvider *listProvider; 16 | @property (weak) FMFilesTableView *tableView; 17 | 18 | - (id)init; 19 | 20 | - (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView; 21 | - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row; 22 | 23 | - (FMSortedListItemsBy)sortModeFromSortDescriptor:(NSSortDescriptor *)descriptor; 24 | 25 | - (void)sortPanelListItemsByColumn:(FMSortedListItemsBy)sortBy directionASC:(BOOL)dirASC; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /FastCommander/src/FMDirectoryWatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMDirectoryWatcher.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 04.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMDirectoryWatcher : NSObject 12 | 13 | @property BOOL directoryContentChanged; 14 | 15 | - (id)initWithPath:(NSString *)path; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FastCommander/src/FMDockInfoView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMDockInfoView.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 08.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMDockInfoView : NSView 12 | 13 | @property (nonatomic) long progressValue; 14 | @property (nonatomic) BOOL isErrorColor; 15 | 16 | + (FMDockInfoView *)createDockInfoView; 17 | 18 | - (void)showDefault; 19 | - (void)showIndeterminate; 20 | 21 | - (void)hide; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileAnalyzingOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileAnalyzingOperation.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 03.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFileOperation.h" 10 | 11 | @interface FMFileAnalyzingOperation : FMFileOperation 12 | 13 | + (void)executeOn:(FMPanelListProvider *)provider andFinishWithBlock:(OnOperationFinish)onFinish; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileAnalyzingOperation.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileAnalyzingOperation.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 03.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFileAnalyzingOperation.h" 10 | #import "FMOperationAnalyzingWindow.h" 11 | #import "FMDirectoryViewController.h" 12 | #import "FMFileItem.h" 13 | 14 | @implementation FMFileAnalyzingOperation 15 | 16 | - (void)run:(OnOperationFinish)onFinish 17 | { 18 | //show analyzing sheet if any directory selected 19 | if (self.inputDirectoryItemsCount > 0) 20 | { 21 | [FMOperationAnalyzingWindow showSheet:self]; 22 | } 23 | 24 | [super run:onFinish]; 25 | } 26 | 27 | - (void)runOnNewThread 28 | { 29 | dispatch_async(dispatch_get_main_queue(), ^ 30 | { 31 | [self.progressDelegate beforeStart]; 32 | }); 33 | 34 | self.fileItems = [self.sourceProvider createFileItemsForOperation:self withDeepIteration:YES]; 35 | } 36 | 37 | - (void)finishOnUiThread 38 | { 39 | [FMOperationAnalyzingWindow close]; 40 | } 41 | 42 | + (void)executeOn:(FMPanelListProvider *)provider andFinishWithBlock:(OnOperationFinish)onFinish 43 | { 44 | FMFileAnalyzingOperation *fileOperation = [[FMFileAnalyzingOperation alloc] initWithProvider:provider andTarget:nil]; 45 | 46 | [fileOperation run:onFinish]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileCalcSizeOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileCalcSizeOperation.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 03.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFileOperation.h" 10 | 11 | @interface FMFileCalcSizeOperation : FMFileOperation 12 | 13 | + (void)executeOn:(FMPanelListProvider *)provider andFinishWithBlock:(OnOperationFinish)onFinish; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileCompressOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileCompressOperation.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 24.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFileOperation.h" 10 | 11 | @interface FMFileCompressOperation : FMFileOperation 12 | 13 | @property (readonly) long fileIndex; 14 | @property (readonly) long long totalProgressSize; 15 | @property (readonly) int totalProgressPercentBySize; 16 | 17 | - (id)initWithProvider:(FMPanelListProvider *)source andTarget:(FMPanelListProvider *)target; 18 | 19 | + (void)executeFrom:(FMPanelListProvider *)source to:(FMPanelListProvider *)target; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileCopyOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileCopyOperation.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 31.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFileOperation.h" 10 | 11 | @interface FMFileCopyOperation : FMFileOperation 12 | 13 | typedef enum 14 | { 15 | FMFileCopyOperationMode_COPY = 1, 16 | FMFileCopyOperationMode_MOVE = 2, 17 | 18 | } FMFileCopyOperationMode; 19 | 20 | @property (readonly) FMFileCopyOperationMode mode; 21 | 22 | @property (readonly) long fileIndex; 23 | @property long long fileProgressSize; 24 | @property (readonly) long long totalProgressSize; 25 | 26 | @property (readonly) int fileProgressPercentBySize; 27 | @property (readonly) int totalProgressPercentBySize; 28 | 29 | @property (readonly) long fileProcessingTimeMiliseconds; 30 | @property (readonly) long long fileSpeedBytesPerSecond; 31 | 32 | - (id)initWithProvider:(FMPanelListProvider *)source andTarget:(FMPanelListProvider *)target; 33 | 34 | - (void)removeIncompleteFile:(FMFileItem *)fileItem inPath:(NSString *)targetFilePath; 35 | 36 | + (void)executeFrom:(FMPanelListProvider *)source to:(FMPanelListProvider *)target withMode:(FMFileCopyOperationMode)mode; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileDeleteOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileDeleteOperation.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 17.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFileOperation.h" 10 | 11 | @interface FMFileDeleteOperation : FMFileOperation 12 | 13 | - (id)initWithProvider:(FMPanelListProvider *)source andTarget:(FMPanelListProvider *)target; 14 | 15 | + (void)executeFrom:(FMPanelListProvider *)source to:(FMPanelListProvider *)target; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileEditOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileEditOperation.h 3 | // FastCommander 4 | // 5 | // Created by Piotr on 21.04.2014. 6 | // Copyright (c) 2014 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFileOperation.h" 10 | 11 | @interface FMFileEditOperation : FMFileOperation 12 | 13 | - (id)initWithProvider:(FMPanelListProvider *)source andTarget:(FMPanelListProvider *)target; 14 | 15 | + (void)executeOn:(FMPanelListProvider *)provider; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileEditOperation.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileEditOperation.m 3 | // FastCommander 4 | // 5 | // Created by Piotr on 21.04.2014. 6 | // Copyright (c) 2014 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFileEditOperation.h" 10 | #import "FMPanelListProvider.h" 11 | #import "FMFileCalcSizeOperation.h" 12 | #import "FMFileItem.h" 13 | 14 | @implementation FMFileEditOperation 15 | 16 | - (id)initWithProvider:(FMPanelListProvider *)source andTarget:(FMPanelListProvider *)target 17 | { 18 | self = [super initWithProvider:source andTarget:target]; 19 | 20 | if (self) 21 | { 22 | 23 | } 24 | 25 | return self; 26 | } 27 | 28 | - (void)run:(OnOperationFinish)onFinish 29 | { 30 | //TODO: open file in editor 31 | //NSLog(@"running edit operation.. %@", self.filesTotalCount); 32 | 33 | [super run:onFinish]; 34 | } 35 | 36 | - (void)runOnNewThread 37 | { 38 | 39 | } 40 | 41 | - (void)finishOnUiThread 42 | { 43 | } 44 | 45 | + (void)executeOn:(FMPanelListProvider *)provider 46 | { 47 | //analyze source operation 48 | FMFileCalcSizeOperation *calcSizeOperation = [[FMFileCalcSizeOperation alloc] initWithProvider:provider andTarget:nil]; 49 | 50 | //process directories calc size if selected 51 | if (calcSizeOperation.inputFileItemsCount == 1) 52 | { 53 | //get selected file 54 | NSMutableArray *fileItems = [calcSizeOperation.sourceProvider createFileItemsForOperation:calcSizeOperation withDeepIteration:NO]; 55 | 56 | if (fileItems.count == 1) 57 | { 58 | FMFileItem *fileItem = [fileItems lastObject]; 59 | 60 | FMFileViewType fileViewType = fileItem.fileViewType; 61 | 62 | if (fileViewType == FMFileViewType_TEXT) 63 | { 64 | //Edit operation 65 | FMFileEditOperation *editOperation = [[FMFileEditOperation alloc] initWithProvider:provider andTarget:nil]; 66 | 67 | //block after finishing 68 | OnOperationFinish onEditFinish = ^(FMFileOperation *operation) 69 | { 70 | }; 71 | 72 | //start operation 73 | [editOperation run:onEditFinish]; 74 | } 75 | } 76 | } 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileFilter.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 12.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMFileFilter : NSObject 12 | 13 | - (id)initWithDirectory:(NSString *)directoryPath; 14 | 15 | - (BOOL)isFirstLevelFile:(NSString *)filePath; 16 | - (BOOL)isInsideFile:(NSString *)filePath; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileFolderOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileFolderOperation.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 25.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFileOperation.h" 10 | 11 | @interface FMFileFolderOperation : FMFileOperation 12 | 13 | - (id)initWithProvider:(FMPanelListProvider *)source andTarget:(FMPanelListProvider *)target; 14 | 15 | + (void)executeFrom:(FMPanelListProvider *)source to:(FMPanelListProvider *)target; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileItem.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 03.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMCustomTypes.h" 11 | #import "FMOperationUserAction.h" 12 | 13 | @class FMPanelListItem; 14 | @class FMProviderFileItem; 15 | @class FMPanelListProvider; 16 | 17 | @interface FMFileItem : NSObject 18 | 19 | typedef enum 20 | { 21 | FMFileViewType_NONE = 0, 22 | FMFileViewType_TEXT = 1, 23 | FMFileViewType_IMAGE = 2, 24 | 25 | } FMFileViewType; 26 | 27 | @property (readonly) NSString *filePath; 28 | @property (readonly) long long fileSize; 29 | @property (readonly) NSString *fileSizeText; 30 | @property (readonly) NSDate *modificationDate; 31 | 32 | @property (readonly) NSString *fileName; 33 | 34 | @property (readonly) BOOL isDirectory; 35 | @property (readonly) BOOL isSymbolicLink; 36 | @property (readonly) BOOL isHidden; 37 | 38 | @property (readonly) id volumeId; 39 | 40 | @property (readonly) FMFileItemStatus status; 41 | @property (readonly) NSString *statusText; 42 | 43 | @property FMOperationUserActionType userActionType; 44 | 45 | @property (readonly) BOOL isError; 46 | @property (readonly) BOOL isCanceled; 47 | @property (readonly) BOOL isDone; 48 | @property (readonly) BOOL isTargetExists; 49 | 50 | @property (readonly) FMFileViewType fileViewType; 51 | 52 | @property NSString *targetFilePath; 53 | 54 | @property FMFileItem *referenceFileItem; 55 | 56 | - (BOOL)isTheSameVolume:(FMFileItem *)fileItem; 57 | 58 | + (FMFileItem *)fromListItem:(FMPanelListItem *)listItem; 59 | + (FMFileItem *)fromUrl:(NSURL *)url; 60 | + (FMFileItem *)fromProviderFileItem:(FMProviderFileItem *)providerFileItem; 61 | + (FMFileItem *)fromFilePath:(NSString *)filePath; 62 | 63 | - (void)updatePath:(NSString *)path; 64 | 65 | - (void)setAsFinished; 66 | - (void)setStatus:(FMFileItemStatus)status; 67 | - (void)setStatus:(FMFileItemStatus)status withError:(NSError *)error; 68 | - (void)setStatus:(FMFileItemStatus)status withException:(NSException *)exception; 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // FileManager.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 24.03.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMWorkDirectory.h" 11 | 12 | @interface FMFileManager : NSObject 13 | 14 | @property FMWorkDirectory *directory; 15 | @property NSArray *urlItems; 16 | @property BOOL isLoadingData; 17 | 18 | - (id)init; 19 | - (void)reset; 20 | - (void)reload; 21 | - (void)reload:(NSString *)value; 22 | 23 | - (NSString *)getVolumeNameForPath:(NSString *)value; 24 | - (NSNumber *)getVolumeTotalSizeForPath:(NSString *)value; 25 | - (NSNumber *)getVolumeAvailableSizeForPath:(NSString *)value; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileOperation.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 31.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMFileOperationProgress.h" 11 | #import "FMOperationUserAction.h" 12 | #import "FMReloadData.h" 13 | #import "FMCustomTypes.h" 14 | 15 | @class FMFileItem; 16 | @class FMDockInfoView; 17 | @class FMPanelListProvider; 18 | @class FMFileOperationUserData; 19 | 20 | @interface FMFileOperation : NSObject 21 | 22 | typedef void (^OnOperationFinish)(FMFileOperation *operation); 23 | 24 | @property BOOL isDataChanged; 25 | 26 | @property NSMutableArray *inputListItems; 27 | @property NSMutableArray *fileItems; 28 | 29 | @property (readonly) int inputDirectoryItemsCount; 30 | @property (readonly) int inputFileItemsCount; 31 | @property (readonly) NSString *inputListItemsSummaryText; 32 | 33 | @property (readonly) NSNumber *filesTotalCount; 34 | @property (readonly) NSNumber *filesTotalSize; 35 | @property (readonly) NSString *filesTotalSizeText; 36 | 37 | @property (readonly) BOOL filesTotalCountIsOne; 38 | 39 | @property (readonly) NSNumber *directoriesTotalCount; 40 | 41 | @property (weak) FMPanelListProvider *sourceProvider; 42 | @property (weak) FMPanelListProvider *targetProvider; 43 | 44 | @property (readonly) BOOL isCanceled; 45 | @property (readonly) BOOL isInProgress; 46 | @property (readonly) BOOL isPaused; 47 | 48 | @property (readonly) BOOL isSkipRequest; 49 | @property (readonly) BOOL isRetryRequest; 50 | @property (readonly) BOOL isOverwriteRequest; 51 | 52 | @property (readonly) FMOperationUserAction *userAction; 53 | @property (readonly) FMFileOperationUserData *userData; 54 | 55 | @property (weak) id progressDelegate; 56 | 57 | @property (readonly) FMDockInfoView *dockInfoView; 58 | 59 | - (id)initWithProvider:(FMPanelListProvider *)source andTarget:(FMPanelListProvider *)target; 60 | 61 | - (void)run:(OnOperationFinish)onFinish; 62 | - (void)runOnNewThread; 63 | 64 | - (void)requestCancel; 65 | - (void)requestPause; 66 | - (void)requestResume; 67 | - (void)waitOnResume; 68 | 69 | - (void)requestSkip; 70 | - (void)requestRetry; 71 | - (void)requestOverwrite; 72 | 73 | - (void)resetUserActionRequests; 74 | 75 | - (long)secsFromKernelTime:(uint64_t)time; 76 | - (long)milisFromKernelTime:(uint64_t)time; 77 | 78 | - (void)reloadSourcePanel:(OnReloadBlock)onReloadFinish; 79 | - (void)reloadTargetPanel:(OnReloadBlock)onReloadFinish; 80 | - (void)reloadBothPanels; 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileOperationProgress.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileOperationProgress.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 06.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMFileItem; 12 | @class FMFileOperationUserData; 13 | 14 | @protocol FMFileOperationProgress 15 | 16 | - (void)reset; 17 | - (void)beforeStart; 18 | - (void)updateFileItemBeforeStart:(FMFileItem *)fileItem; 19 | - (void)updateUserInterfaceStateWithUserData:(FMFileOperationUserData *)userData; 20 | - (void)updateUserDataWithUserInterfaceState:(FMFileOperationUserData *)userData; 21 | - (void)itemStart:(FMFileItem *)fileItem; 22 | - (void)itemStart:(FMFileItem *)fileItem withData:(NSData *)fileData; 23 | - (void)itemStart:(FMFileItem *)fileItem withStream:(NSInputStream *)fileStream; 24 | - (void)itemProgress:(FMFileItem *)fileItem; 25 | - (void)itemFinish:(FMFileItem *)fileItem; 26 | - (void)itemError:(FMFileItem *)fileItem; 27 | - (void)afterFinish; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileOperationUserData.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileOperationUserData.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 22.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMFileOperationUserData : NSObject 12 | 13 | @property BOOL isProcessSubdirectories; 14 | @property NSUInteger aggregatedPermissionsToSet; 15 | @property NSUInteger aggregatedPermissionsToClear; 16 | 17 | @property NSString *archiveFileName; 18 | 19 | @property NSArray *globFilePatterns; 20 | @property (readonly) NSString *globFilePatternsText; 21 | 22 | @property NSString *searchText; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileOperationUserData.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileOperationUserData.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 22.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFileOperationUserData.h" 10 | #import "NSString+Utils.h" 11 | 12 | @implementation FMFileOperationUserData 13 | { 14 | NSArray *_globFilePatterns; 15 | } 16 | 17 | - (id)init 18 | { 19 | self = [super init]; 20 | 21 | if (self) 22 | { 23 | self.isProcessSubdirectories = NO; 24 | self.aggregatedPermissionsToSet = 0; 25 | self.aggregatedPermissionsToClear = 0; 26 | 27 | self.archiveFileName = @""; 28 | 29 | self.globFilePatterns = @[]; 30 | self.searchText = @""; 31 | } 32 | 33 | return self; 34 | } 35 | 36 | - (NSArray *)globFilePatterns 37 | { 38 | return _globFilePatterns; 39 | } 40 | 41 | - (void)setGlobFilePatterns:(NSArray *)globFilePatterns 42 | { 43 | NSMutableArray *list = [[NSMutableArray alloc] initWithCapacity:self.globFilePatterns.count]; 44 | 45 | for (NSString *item in globFilePatterns) 46 | { 47 | NSString *newItem = [item copy]; 48 | 49 | if ([item hasPrefix:@"*"] == NO) 50 | { 51 | newItem = [NSString stringWithFormat:@"*%@", newItem]; 52 | } 53 | 54 | if ([item hasSuffix:@"*"] == NO) 55 | { 56 | newItem = [NSString stringWithFormat:@"%@*", newItem]; 57 | } 58 | 59 | [list addObject:newItem]; 60 | } 61 | 62 | self->_globFilePatterns = [NSArray arrayWithArray:list]; 63 | } 64 | 65 | - (NSString *)globFilePatternsText 66 | { 67 | if (self.globFilePatterns == nil) 68 | { 69 | return @""; 70 | } 71 | 72 | NSMutableString *list = [[NSMutableString alloc] initWithCapacity:self.globFilePatterns.count]; 73 | 74 | for (NSString *item in self.globFilePatterns) 75 | { 76 | [list appendString:item]; 77 | [list appendString:@" "]; 78 | } 79 | 80 | return list.trim; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileOperationValidator.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileOperationValidator.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 01.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMCustomTypes.h" 11 | 12 | @class FMCommand; 13 | @class FMPanelListProvider; 14 | 15 | @interface FMFileOperationValidator : NSObject 16 | 17 | @property (weak) FMPanelListProvider *sourceProvider; 18 | @property (weak) FMPanelListProvider *targetProvider; 19 | 20 | - (id)init; 21 | 22 | - (BOOL)validate:(FMCommand *)command; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /FastCommander/src/FMFilePermissionsOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFilePermissionsOperation.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 21.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFileOperation.h" 10 | 11 | @interface FMFilePermissionsOperation : FMFileOperation 12 | 13 | - (id)initWithProvider:(FMPanelListProvider *)source andTarget:(FMPanelListProvider *)target; 14 | 15 | + (void)executeOn:(FMPanelListProvider *)provider; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileProcessingResolver.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileProcessingResolver.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 28.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMPanelListItem.h" 11 | 12 | @interface FMFileProcessingResolver : NSObject 13 | 14 | - (id)init; 15 | 16 | - (BOOL)onFileItemSelected:(FMPanelListItem *)listItem forPanelSide:(FMPanelSide)panelSide; 17 | - (BOOL)onPathSet:(NSString *)value forPanelSide:(FMPanelSide)panelSide; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileProcessingResolver.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileProcessingResolver.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 28.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFileProcessingResolver.h" 10 | #import "AppDelegate.h" 11 | 12 | @implementation FMFileProcessingResolver 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | 18 | if (self) 19 | { 20 | } 21 | 22 | return self; 23 | } 24 | 25 | - (BOOL)onFileItemSelected:(FMPanelListItem *)listItem forPanelSide:(FMPanelSide)panelSide 26 | { 27 | NSString *path = listItem.unifiedFilePath; 28 | 29 | FMPanelListProviderManager *panelListProviderManager = [AppDelegate.this panelListProviderManager:panelSide]; 30 | 31 | if ([panelListProviderManager setProviderForPath:[path copy]]) 32 | { 33 | return YES; 34 | } 35 | else 36 | { 37 | [self openFileWithFinder:listItem]; 38 | 39 | return NO; 40 | } 41 | } 42 | 43 | - (void)openFileWithFinder:(FMPanelListItem *)listItem 44 | { 45 | NSString *path = listItem.unifiedFilePath; 46 | 47 | if (listItem.isSymbolicLink) 48 | { 49 | NSString *resultPath = listItem.symbolicLinkPath; 50 | 51 | if (resultPath != nil) 52 | { 53 | path = resultPath; 54 | } 55 | } 56 | 57 | [[NSWorkspace sharedWorkspace] openFile:path]; 58 | } 59 | 60 | - (BOOL)onPathSet:(NSString *)value forPanelSide:(FMPanelSide)panelSide 61 | { 62 | NSString *path = [value copy]; 63 | 64 | FMPanelListProviderManager *panelListProviderManager = [AppDelegate.this panelListProviderManager:panelSide]; 65 | 66 | if ([panelListProviderManager setProviderForPath:path]) 67 | { 68 | return YES; 69 | } 70 | else 71 | { 72 | return NO; 73 | } 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileRenameOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileRenameOperation.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 24.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFileOperation.h" 10 | 11 | @interface FMFileRenameOperation : FMFileOperation 12 | 13 | - (id)initWithProvider:(FMPanelListProvider *)source andTarget:(FMPanelListProvider *)target; 14 | 15 | + (void)executeFrom:(FMPanelListProvider *)source to:(FMPanelListProvider *)target; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileSearchOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileSearchOperation.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 19.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFileOperation.h" 10 | 11 | @interface FMFileSearchOperation : FMFileOperation 12 | 13 | @property BOOL cancelAndShow; 14 | 15 | - (id)initWithProvider:(FMPanelListProvider *)source andTarget:(FMPanelListProvider *)target; 16 | 17 | + (void)executeOn:(FMPanelListProvider *)provider; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FastCommander/src/FMFileViewOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileViewOperation.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 18.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFileOperation.h" 10 | 11 | @interface FMFileViewOperation : FMFileOperation 12 | 13 | - (id)initWithProvider:(FMPanelListProvider *)source andTarget:(FMPanelListProvider *)target; 14 | 15 | + (void)executeOn:(FMPanelListProvider *)provider; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FastCommander/src/FMFilesTableView+Commands.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFilesTableView+Commands.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 22.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMFilesTableView.h" 11 | 12 | @interface FMFilesTableView (Commands) 13 | 14 | - (BOOL)processSwitchPanelCommmand; 15 | - (BOOL)processSelectionCommmand; 16 | - (BOOL)processEnterCommmand; 17 | - (BOOL)processDirectoryUpCommmand; 18 | - (BOOL)processShowDirectoriesCommmandForPanel:(FMPanelSide)side; 19 | 20 | - (void)processAllItemsSelectCommand; 21 | - (void)processAllItemsUnselectCommand; 22 | - (void)processAllItemsInvertCommand; 23 | - (void)processItemsSelectionCommand:(FMSelectionMode)mode withPattern:(NSString *)pattern; 24 | - (BOOL)processShowSelectionPanelCommmand:(FMSelectionMode)mode withPattern:(NSString *)pattern; 25 | - (BOOL)processSameDirectoryOnTarget; 26 | - (BOOL)processFileOperationDelete; 27 | 28 | - (BOOL)validateMenuItemInCategory:(NSMenuItem *)item; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /FastCommander/src/FMFilesTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFilesTableView.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 09.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMCustomTypes.h" 11 | 12 | @class FMReloadData; 13 | @class FMPanelListItem; 14 | @class FMPanelListProvider; 15 | 16 | @interface FMFilesTableView : NSTableView 17 | 18 | typedef void(^FMSelectionBlock)(int row, FMPanelListItem *listItem); 19 | 20 | @property FMPanelSide panelSide; 21 | @property FMPanelMode panelMode; 22 | 23 | @property (weak) FMPanelListProvider *listProvider; 24 | 25 | - (FMPanelListItem *)getSelectedPanelListItem; 26 | 27 | - (void)highlightTableRow:(NSInteger)row; 28 | - (void)selectFirstItem; 29 | - (void)selectListItemByName:(NSString *)value; 30 | 31 | - (void)saveListHighlightState; 32 | - (void)restoreListHighlightState:(FMReloadData *)data; 33 | 34 | - (void)toggleItemSelection; 35 | - (void)processAllItemsSelection:(FMSelectionBlock)selectionBlock; 36 | - (void)updateListItemByFileName:(NSString *)fileName withDirectorySize:(long long)size; 37 | 38 | - (BOOL)validateMenuItem:(NSMenuItem *)item; 39 | 40 | - (void)focusView; 41 | 42 | - (NSString *)getDefaultGlobPattern; 43 | 44 | - (void)updateBottomStatusTextWithCurrentlySelectedListItem; 45 | 46 | - (void)initializeSorting; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /FastCommander/src/FMFilesTableViewDrawRow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMFileTableViewDrawRow.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 27.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMFilesTableView.h" 10 | 11 | @interface FMFilesTableViewDrawRow : NSObject 12 | 13 | @property (weak) FMFilesTableView *tableView; 14 | 15 | - (void)draw:(NSInteger)rowIndex clipRect:(NSRect)clipRect listItem:(FMPanelListItem *)listItem; 16 | 17 | - (void)updateTheme; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FastCommander/src/FMLeftDirectoryViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMLeftDirectoryViewController.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 07.04.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMDirectoryViewController.h" 11 | #import "FMLeftFilesTableView.h" 12 | 13 | @interface FMLeftDirectoryViewController : FMDirectoryViewController 14 | 15 | - (IBAction)onDirectoryUp:(id)sender; 16 | - (IBAction)onSelectItemsPopover:(id)sender; 17 | - (IBAction)actionOpenDirectoryList:(id)sender; 18 | - (IBAction)onResetSortMode:(id)sender; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /FastCommander/src/FMLeftDirectoryViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMLeftDirectoryViewController.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 07.04.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMLeftDirectoryViewController.h" 10 | #import "FMPanelListItem.h" 11 | 12 | @implementation FMLeftDirectoryViewController 13 | 14 | - (id)initWithCoder:(NSCoder *)aDecoder 15 | { 16 | self = [super initWithCoder:aDecoder]; 17 | 18 | if (self) 19 | { 20 | self.panelSide = FMPanelSideL; 21 | } 22 | 23 | return self; 24 | } 25 | 26 | - (IBAction)onDirectoryUp:(id)sender 27 | { 28 | [self commandDirectoryUp]; 29 | } 30 | 31 | - (IBAction)onSelectItemsPopover:(id)sender 32 | { 33 | [self commandShowSelectionPanel:FMSelectionMode_SELECT withPattern:self.tableView.getDefaultGlobPattern]; 34 | } 35 | 36 | - (IBAction)actionOpenDirectoryList:(id)sender 37 | { 38 | [super actionOpenDirectoryList:sender]; 39 | } 40 | 41 | - (IBAction)onResetSortMode:(id)sender 42 | { 43 | [super resetSortMode]; 44 | } 45 | 46 | //FMAdvancedCombo delegates 47 | - (void)onAdvancedComboListDidClose:(FMAdvancedCombo *)combo 48 | { 49 | [super onAdvancedComboListDidClose:combo]; 50 | 51 | [self.tableView setNeedsDisplay:YES]; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /FastCommander/src/FMLeftFilesTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMLeftFilesTableView.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 18.04.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMFilesTableView.h" 11 | 12 | @interface FMLeftFilesTableView : FMFilesTableView 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /FastCommander/src/FMLeftFilesTableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMLeftFilesTableView.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 18.04.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMLeftFilesTableView.h" 10 | #import "FMSettings.h" 11 | 12 | @implementation FMLeftFilesTableView 13 | 14 | - (id)initWithCoder:(NSCoder *)aDecoder 15 | { 16 | self = [super initWithCoder:aDecoder]; 17 | 18 | if (self) 19 | { 20 | self.panelSide = FMPanelSideL; 21 | } 22 | 23 | return self; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FastCommander/src/FMLightProgressBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMLightProgressBar.h 3 | // TestCustomTopHeader 4 | // 5 | // Created by Piotr Zagawa on 13.09.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMLightProgressBar : NSView 12 | 13 | @property long long progressValue; 14 | @property long long progressMin; 15 | @property long long progressMax; 16 | 17 | @property NSString *progressText; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FastCommander/src/FMLocalPanelListProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMLocalPanelListProvider.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 26.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMPanelListProvider.h" 10 | 11 | @interface FMLocalPanelListProvider : FMPanelListProvider 12 | 13 | - (id)init; 14 | 15 | - (void)reset; 16 | 17 | - (BOOL)isPathValid:(NSString *)path; 18 | - (void)reload; 19 | - (void)reload:(NSString *)path; 20 | - (BOOL)isLoadingData; 21 | 22 | - (NSString *)getNameToSelect; 23 | - (NSString *)getInitNameToSelect; 24 | - (NSString *)getParentDirectory; 25 | 26 | - (NSString *)getVolumeNameForPath:(NSString *)path; 27 | - (NSNumber *)getVolumeTotalSizeForPath:(NSString *)path; 28 | - (NSNumber *)getVolumeAvailableSizeForPath:(NSString *)path; 29 | 30 | - (void)addFileItemsTo:(NSMutableArray *)fileItems fromDirectoryItem:(FMPanelListItem *)listItem forOperation:(FMFileOperation *)fileOperation andTestBlock:(OnTestFileItem)onTestFileItem; 31 | - (void)validateFileItems:(NSMutableArray *)fileItems forOperation:(FMFileOperation *)fileOperation; 32 | - (int)filesCountForPath:(NSString *)directoryPath; 33 | 34 | - (NSInputStream *)getInputStream:(NSString *)filePath; 35 | - (NSOutputStream *)getOutputStream:(NSString *)filePath; 36 | 37 | - (NSString *)getTargetFileName:(FMFileItem *)fileItem withTargetPath:(NSString *)targetPath; 38 | - (NSString *)getRelativeTargetFileName:(FMFileItem *)fileItem withTargetPath:(NSString *)targetPath; 39 | 40 | - (FMFileItem *)fileNameToFileItem:(NSString *)filePath; 41 | 42 | - (BOOL)removeFile:(NSString *)filePath; 43 | - (BOOL)fileExists:(NSString *)filePath; 44 | - (BOOL)directoryExists:(NSString *)directoryPath; 45 | - (BOOL)removeDirectory:(NSString *)filePath; 46 | - (BOOL)createDirectory:(NSString *)filePath; 47 | - (BOOL)renameFile:(NSString *)oldFilePath to:(NSString *)newFilePath; 48 | - (BOOL)moveFile:(NSString *)oldFilePath to:(NSString *)newFilePath error:(NSError **)error; 49 | 50 | - (NSUInteger)posixPermissionsForPath:(NSString *)filePath; 51 | - (BOOL)setPosixPermissions:(NSUInteger)permissions forPath:(NSString *)filePath; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /FastCommander/src/FMOSTools.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOSTools.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 20.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMOSTools : NSObject 12 | 13 | + (void)openConsole:(NSString *)path; 14 | + (void)openFinder:(NSString *)path; 15 | + (void)openFinderDirectly:(NSString *)path; 16 | 17 | + (NSURL *)defaultApplicationURlForFileURL:(NSURL *)fileUrl; 18 | + (NSArray *)applicationsURLsForFileURL:(NSURL *)fileUrl; 19 | 20 | + (void) newAppInstance; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /FastCommander/src/FMOpCopyProgressViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOpCopyProgressViewController.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 05.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMFileItem; 12 | @class FMFileCopyOperation; 13 | 14 | @interface FMOpCopyProgressViewController : NSViewController 15 | 16 | @property (weak) FMFileCopyOperation *fileOperation; 17 | 18 | @property (weak) IBOutlet NSTextField *textSourceFile; 19 | @property (weak) IBOutlet NSTextField *textSourceFileName; 20 | @property (weak) IBOutlet NSTextField *textTargetPath; 21 | @property (weak) IBOutlet NSProgressIndicator *progressSourceFile; 22 | @property (weak) IBOutlet NSTextField *textSourceFileStatus; 23 | @property (weak) IBOutlet NSTextField *editTargetPath; 24 | @property (weak) IBOutlet NSTextField *textTargetLabel; 25 | 26 | @property (weak) IBOutlet NSTextField *textTotalFiles; 27 | @property (weak) IBOutlet NSProgressIndicator *progressTotalFiles; 28 | @property (weak) IBOutlet NSTextField *textTotalFilesStatus; 29 | 30 | @property (readonly) NSString *targetPath; 31 | 32 | - (void)reset; 33 | - (void)beforeStart; 34 | - (void)itemStart:(FMFileItem *)fileItem; 35 | - (void)updateFileItemBeforeStart:(FMFileItem *)fileItem; 36 | - (void)itemProgress:(FMFileItem *)fileItem; 37 | - (void)itemFinish:(FMFileItem *)fileItem; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /FastCommander/src/FMOpFileErrorViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOpFileErrorViewController.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 06.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMFileItem; 12 | @class FMFileCopyOperation; 13 | 14 | @interface FMOpFileErrorViewController : NSViewController 15 | 16 | @property (weak) IBOutlet NSTextField *textFileLabel; 17 | @property (weak) IBOutlet NSTextField *textFileName; 18 | 19 | @property (weak) IBOutlet NSTextField *textMessage; 20 | @property (weak) IBOutlet NSTextField *textMessageDetails; 21 | 22 | - (void)beforeStart; 23 | - (void)itemError:(FMFileItem *)fileItem; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FastCommander/src/FMOpFileErrorViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMOpFileErrorViewController.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 06.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMOpFileErrorViewController.h" 10 | #import "FMFileOperation.h" 11 | #import "FMFileCopyOperation.h" 12 | #import "FMPanelListProvider.h" 13 | #import "FMFileItem.h" 14 | 15 | @implementation FMOpFileErrorViewController 16 | 17 | - (void)beforeStart 18 | { 19 | } 20 | 21 | - (void)itemError:(FMFileItem *)fileItem 22 | { 23 | self.textFileName.stringValue = fileItem.filePath; 24 | 25 | self.textMessage.stringValue = @"FILE ERROR"; 26 | 27 | self.textMessageDetails.stringValue = fileItem.statusText; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /FastCommander/src/FMOpFileExistsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOpFileExistsViewController.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 05.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMFileItem; 12 | @class FMFileCopyOperation; 13 | 14 | @interface FMOpFileExistsViewController : NSViewController 15 | 16 | @property (weak) IBOutlet NSTextField *textFileLabel; 17 | @property (weak) IBOutlet NSTextField *textFileName; 18 | 19 | @property (weak) IBOutlet NSTextField *textMessage; 20 | @property (weak) IBOutlet NSTextField *textMessageDetails; 21 | 22 | @property (weak) IBOutlet NSTextField *textNewSize; 23 | @property (weak) IBOutlet NSTextField *textNewDate; 24 | 25 | @property (weak) IBOutlet NSTextField *textExistingSize; 26 | @property (weak) IBOutlet NSTextField *textExistingDate; 27 | 28 | - (void)beforeStart; 29 | - (void)itemError:(FMFileItem *)fileItem; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationAnalyzingWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationAnalyzingWindow.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 02.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMOperationWindow.h" 11 | 12 | @interface FMOperationAnalyzingWindow : FMOperationWindow 13 | 14 | @property (weak) IBOutlet NSProgressIndicator *operationProgress; 15 | 16 | - (IBAction)actionCancel:(id)sender; 17 | 18 | + (void)showSheet:(FMFileOperation *)fileOperation; 19 | + (void)close; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationAnalyzingWindow.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationAnalyzingWindow.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 02.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMOperationAnalyzingWindow.h" 10 | #import "AppDelegate.h" 11 | #import "FMFileOperation.h" 12 | #import "FMDockInfoView.h" 13 | 14 | @implementation FMOperationAnalyzingWindow 15 | 16 | - (void)actionCancel:(id)sender 17 | { 18 | [super actionCancel:sender]; 19 | } 20 | 21 | - (void)actionAccept:(id)sender 22 | { 23 | [super actionAccept:sender]; 24 | } 25 | 26 | - (void)enableProgress:(BOOL)enabled 27 | { 28 | if (enabled) 29 | { 30 | [self.operationProgress startAnimation:self]; 31 | [self.operationProgress displayIfNeeded]; 32 | } 33 | else 34 | { 35 | [self.operationProgress stopAnimation:self]; 36 | } 37 | } 38 | 39 | - (void)reset 40 | { 41 | [super reset]; 42 | 43 | self.textTitle.stringValue = @"ANALYZING FILES"; 44 | 45 | [self enableProgress:NO]; 46 | } 47 | 48 | - (void)beforeStart 49 | { 50 | [super beforeStart]; 51 | 52 | [self enableProgress:YES]; 53 | 54 | [self.fileOperation.dockInfoView showIndeterminate]; 55 | } 56 | 57 | - (void)closeSheet 58 | { 59 | [super closeSheet]; 60 | 61 | [self.fileOperation.dockInfoView hide]; 62 | } 63 | 64 | + (void)showSheet:(FMFileOperation *)fileOperation 65 | { 66 | FMOperationWindow *window = AppDelegate.this.mainViewController.sheetOperationAnalyzing; 67 | 68 | [super showSheetWith:window forOperation:fileOperation]; 69 | } 70 | 71 | + (void)close 72 | { 73 | FMOperationWindow *window = AppDelegate.this.mainViewController.sheetOperationAnalyzing; 74 | 75 | [window closeSheet]; 76 | } 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationCommandSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationCommandSupport.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 20.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMCustomTypes.h" 11 | 12 | @interface FMOperationCommandSupport : NSObject 13 | 14 | - (void)set:(FMCommandId)commandId modeSource:(BOOL)modeSource modeTarget:(BOOL)modeTarget; 15 | - (BOOL)isOperationCommand:(FMCommandId)commandId withMode:(FMPanelMode)panelMode; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationCommandSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationCommandSupport.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 20.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMOperationCommandSupport.h" 10 | 11 | @implementation FMOperationCommandSupport 12 | { 13 | NSMutableDictionary *_map; 14 | } 15 | 16 | static const long value_source = 0x00ff; 17 | static const long value_target = 0xff00; 18 | 19 | - (id)init 20 | { 21 | self = [super init]; 22 | 23 | if (self) 24 | { 25 | self->_map = [[NSMutableDictionary alloc] init]; 26 | } 27 | 28 | return self; 29 | } 30 | 31 | - (NSNumber *)encodeModeSource:(BOOL)modeSource andModeTarget:(BOOL)modeTarget 32 | { 33 | long valueSource = modeSource ? value_source : 0; 34 | long valueTarget = modeTarget ? value_target : 0; 35 | 36 | return [NSNumber numberWithLong:(valueSource | valueTarget)]; 37 | } 38 | 39 | - (BOOL)isModeSource:(NSNumber *)value 40 | { 41 | if ((value.longValue & value_source) == value_source) 42 | { 43 | return YES; 44 | } 45 | 46 | return NO; 47 | } 48 | 49 | - (BOOL)isModeTarget:(NSNumber *)value 50 | { 51 | if ((value.longValue & value_target) == value_target) 52 | { 53 | return YES; 54 | } 55 | 56 | return NO; 57 | } 58 | 59 | - (void)set:(FMCommandId)commandId modeSource:(BOOL)modeSource modeTarget:(BOOL)modeTarget 60 | { 61 | NSNumber *key = [NSNumber numberWithLong:commandId]; 62 | 63 | NSNumber *value = [self encodeModeSource:modeSource andModeTarget:modeTarget]; 64 | 65 | [self->_map setObject:value forKey:key]; 66 | } 67 | 68 | - (BOOL)isOperationCommand:(FMCommandId)commandId withMode:(FMPanelMode)panelMode 69 | { 70 | NSNumber *key = [NSNumber numberWithLong:commandId]; 71 | 72 | NSNumber *value = [self->_map objectForKey:key]; 73 | 74 | if (value != nil) 75 | { 76 | if (panelMode == FMPanelModeSource) 77 | { 78 | return [self isModeSource:value]; 79 | } 80 | 81 | if (panelMode == FMPanelModeTarget) 82 | { 83 | return [self isModeTarget:value]; 84 | } 85 | } 86 | 87 | return NO; 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationCompressWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationCompressWindow.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 24.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMOperationWindow.h" 10 | 11 | @interface FMOperationCompressWindow : FMOperationWindow 12 | 13 | @property (weak) IBOutlet NSTextField *textTotalFilesInfo; 14 | @property (weak) IBOutlet NSTextField *textTotalSizeInfo; 15 | @property (weak) IBOutlet NSProgressIndicator *operationProgress; 16 | 17 | @property (weak) IBOutlet NSTextField *editFileName; 18 | 19 | - (IBAction)actionCancel:(id)sender; 20 | - (IBAction)actionAccept:(id)sender; 21 | 22 | + (void)showSheet:(FMFileOperation *)fileOperation; 23 | + (void)close; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationCopyWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationCopyWindow.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 02.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMOperationWindow.h" 11 | #import "FMOpCopyProgressViewController.h" 12 | #import "FMOpFileExistsViewController.h" 13 | #import "FMOpFileErrorViewController.h" 14 | 15 | @interface FMOperationCopyWindow : FMOperationWindow 16 | 17 | typedef enum 18 | { 19 | FMOperationCopyViewNone = 0, 20 | FMOperationCopyViewProgress = 1, 21 | FMOperationCopyViewFileExists = 2, 22 | FMOperationCopyViewFileError = 3, 23 | FMOperationCopyViewSourceTargetEqual = 4, 24 | 25 | } FMOperationCopyView; 26 | 27 | @property (weak) IBOutlet NSImageView *iconTitle; 28 | 29 | @property (weak) IBOutlet NSButton *btnSkip; 30 | @property (weak) IBOutlet NSButton *btnOverwrite; 31 | @property (weak) IBOutlet NSButton *btnRetry; 32 | 33 | @property (weak) IBOutlet NSButton *checkApplyToAllFiles; 34 | @property (weak) IBOutlet NSTextField *textStatusInfo; 35 | 36 | @property (unsafe_unretained) IBOutlet FMOpCopyProgressViewController *viewProgressController; 37 | @property (unsafe_unretained) IBOutlet FMOpFileExistsViewController *viewFileExistsController; 38 | @property (unsafe_unretained) IBOutlet FMOpFileErrorViewController *viewFileErrorController; 39 | 40 | @property (weak) IBOutlet NSScrollView *viewScrollContent; 41 | @property (weak) IBOutlet NSView *viewContent; 42 | 43 | - (IBAction)actionCancel:(id)sender; 44 | - (IBAction)actionAccept:(id)sender; 45 | - (IBAction)actionSkip:(id)sender; 46 | - (IBAction)actionOverwrite:(id)sender; 47 | - (IBAction)actionRetry:(id)sender; 48 | 49 | - (IBAction)changeApplyToAllFiles:(id)sender; 50 | 51 | + (void)showSheet:(FMFileOperation *)fileOperation; 52 | + (void)close; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationDeleteWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationDeleteWindow.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 17.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMOperationWindow.h" 11 | 12 | @interface FMOperationDeleteWindow : FMOperationWindow 13 | 14 | @property (weak) IBOutlet NSTextField *textTotalFilesInfo; 15 | @property (weak) IBOutlet NSTextField *textTotalSizeInfo; 16 | @property (weak) IBOutlet NSProgressIndicator *operationProgress; 17 | 18 | - (IBAction)actionCancel:(id)sender; 19 | - (IBAction)actionAccept:(id)sender; 20 | 21 | + (void)showSheet:(FMFileOperation *)fileOperation; 22 | + (void)close; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationFolderWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationFolderWindow.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 24.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMOperationWindow.h" 11 | 12 | @interface FMOperationFolderWindow : FMOperationWindow 13 | 14 | @property (weak) IBOutlet NSTextField *editDirectory; 15 | @property (weak) IBOutlet NSView *viewError; 16 | 17 | - (IBAction)actionCancel:(id)sender; 18 | - (IBAction)actionAccept:(id)sender; 19 | 20 | + (void)showSheet:(FMFileOperation *)fileOperation; 21 | + (void)close; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationImageViewWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationImageViewWindow.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 23.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMOperationWindow.h" 11 | 12 | @interface FMOperationImageViewWindow : FMOperationWindow 13 | 14 | @property (weak) IBOutlet NSTextField *textStatus; 15 | @property (weak) IBOutlet NSImageView *imageMain; 16 | @property (weak) IBOutlet NSTextField *textImageProperties; 17 | 18 | @property (weak) NSData *fileData; 19 | 20 | - (IBAction)actionCancel:(id)sender; 21 | - (IBAction)actionAccept:(id)sender; 22 | 23 | + (void)showSheet:(FMFileOperation *)fileOperation; 24 | + (void)close; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationPermissionsWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationPermissionsWindow.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 21.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMOperationWindow.h" 11 | 12 | @interface FMOperationPermissionsWindow : FMOperationWindow 13 | 14 | @property (weak) IBOutlet NSTextField *textTotalFilesInfo; 15 | @property (weak) IBOutlet NSTextField *textTotalDirectoriesInfo; 16 | @property (weak) IBOutlet NSProgressIndicator *operationProgress; 17 | 18 | @property (weak) IBOutlet NSButton *checkUserR; 19 | @property (weak) IBOutlet NSButton *checkUserW; 20 | @property (weak) IBOutlet NSButton *checkUserX; 21 | 22 | @property (weak) IBOutlet NSButton *checkGroupR; 23 | @property (weak) IBOutlet NSButton *checkGroupW; 24 | @property (weak) IBOutlet NSButton *checkGroupX; 25 | 26 | @property (weak) IBOutlet NSButton *checkOtherR; 27 | @property (weak) IBOutlet NSButton *checkOtherW; 28 | @property (weak) IBOutlet NSButton *checkOtherX; 29 | 30 | @property (weak) IBOutlet NSTextField *textOctal; 31 | 32 | @property (weak) IBOutlet NSButton *checkProcessSubdirectories; 33 | 34 | - (IBAction)actionCancel:(id)sender; 35 | - (IBAction)actionAccept:(id)sender; 36 | 37 | - (IBAction)actionChangeBit:(id)sender; 38 | - (IBAction)actionChangeOctalText:(id)sender; 39 | 40 | + (void)showSheet:(FMFileOperation *)fileOperation; 41 | + (void)close; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationRenameWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationRenameWindow.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 24.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMOperationWindow.h" 11 | 12 | @interface FMOperationRenameWindow : FMOperationWindow 13 | 14 | @property (weak) IBOutlet NSButton *btnSkip; 15 | 16 | @property (weak) IBOutlet NSTextField *editFileName; 17 | @property (weak) IBOutlet NSView *viewError; 18 | 19 | - (IBAction)actionCancel:(id)sender; 20 | - (IBAction)actionAccept:(id)sender; 21 | - (IBAction)actionSkip:(id)sender; 22 | 23 | + (void)showSheet:(FMFileOperation *)fileOperation; 24 | + (void)close; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationSearchWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationSearchWindow.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 19.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMOperationWindow.h" 11 | 12 | @interface FMOperationSearchWindow : FMOperationWindow 13 | 14 | @property (weak) IBOutlet NSButton *btnShow; 15 | @property (weak) IBOutlet NSButton *btnClose; 16 | 17 | @property (weak) IBOutlet NSProgressIndicator *operationProgress; 18 | 19 | @property (weak) IBOutlet NSTextField *textSearchIn; 20 | @property (weak) IBOutlet NSTokenField *editFilePatterns; 21 | @property (weak) IBOutlet NSTextField *editSearchText; 22 | 23 | @property (weak) IBOutlet NSTextField *textSearchStatus; 24 | 25 | - (IBAction)actionCancel:(id)sender; 26 | - (IBAction)actionAccept:(id)sender; 27 | - (IBAction)actionShow:(id)sender; 28 | - (IBAction)actionClose:(id)sender; 29 | 30 | + (void)showSheet:(FMFileOperation *)fileOperation; 31 | + (void)close; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationStats.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationStats.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 05.10.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMFileCopyOperation; 12 | 13 | @interface FMOperationStats : NSObject 14 | 15 | @property (readonly) NSString *info; 16 | 17 | - (void)reset; 18 | 19 | - (void)updateOnItemStart:(FMFileCopyOperation *)fileCopyOperation; 20 | - (void)updateOnItemProgress:(FMFileCopyOperation *)fileCopyOperation; 21 | - (void)updateOnItemFinish:(FMFileCopyOperation *)fileCopyOperation; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationTextViewWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationTextViewWindow.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 20.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMOperationWindow.h" 11 | 12 | @interface FMOperationTextViewWindow : FMOperationWindow 13 | 14 | @property (weak) IBOutlet NSTextField *textStatus; 15 | 16 | @property (unsafe_unretained) IBOutlet NSTextView *textView; 17 | @property (weak) IBOutlet NSScrollView *scrollTextView; 18 | 19 | @property (weak) IBOutlet NSPopUpButton *popupEncoding; 20 | 21 | @property (weak) NSData *fileData; 22 | @property NSStringEncoding currentEncoding; 23 | 24 | - (IBAction)actionCancel:(id)sender; 25 | - (IBAction)actionAccept:(id)sender; 26 | - (IBAction)actionEncodingChanged:(id)sender; 27 | 28 | + (void)showSheet:(FMFileOperation *)fileOperation; 29 | + (void)close; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationUserAction.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationUserAction.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 17.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMCustomTypes.h" 11 | 12 | @interface FMOperationUserAction : NSObject 13 | 14 | typedef enum 15 | { 16 | FMOperationUserActionType_NONE = 0, 17 | FMOperationUserActionType_SKIP = 1, 18 | FMOperationUserActionType_OVERWRITE = 2, 19 | FMOperationUserActionType_RETRY = 3, 20 | 21 | } FMOperationUserActionType; 22 | 23 | @property (readonly) FMOperationUserActionType actionType; 24 | 25 | @property (readonly) BOOL isActionSet; 26 | 27 | - (void)reset; 28 | 29 | - (void)setAction:(FMOperationUserActionType)action forStatus:(FMFileItemStatus)status; 30 | - (void)setApplyToAll:(BOOL)applyToAll forStatus:(FMFileItemStatus)status; 31 | 32 | - (FMOperationUserActionType)actionValueForStatus:(FMFileItemStatus)status; 33 | - (BOOL)applyToAllValueForStatus:(FMFileItemStatus)status; 34 | 35 | - (void)resetActionType; 36 | - (void)updateActionTypeForStatus:(FMFileItemStatus)status; 37 | 38 | - (NSString *)actionName; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /FastCommander/src/FMOperationWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMOperationWindow.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 02.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMFileOperationProgress.h" 11 | 12 | @class FMOperationWindow; 13 | @class FMFileOperation; 14 | @class FMFileOperationUserData; 15 | 16 | @interface FMOperationWindow : NSWindow 17 | 18 | @property (weak) NSTextField *textTitle; 19 | @property (weak) NSButton *btnCancel; 20 | @property (weak) NSButton *btnAccept; 21 | 22 | @property (readonly) NSPoint buttonOrigin; 23 | @property (readonly) CGFloat buttonSpacing; 24 | 25 | @property (weak) FMFileOperation *fileOperation; 26 | 27 | @property (readonly) BOOL isSheetOpen; 28 | 29 | @property (readonly) NSString *acceptTitle; 30 | 31 | - (void)actionCancel:(id)sender; 32 | - (void)actionAccept:(id)sender; 33 | 34 | - (void)initKeyEventsMonitor; 35 | - (void)closeKeyEventsMonitor; 36 | 37 | //FMFileOperationProgress protocol 38 | - (void)reset; 39 | - (void)beforeStart; 40 | - (void)updateFileItemBeforeStart:(FMFileItem *)fileItem; 41 | - (void)updateUserInterfaceStateWithUserData:(FMFileOperationUserData *)userData; 42 | - (void)updateUserDataWithUserInterfaceState:(FMFileOperationUserData *)userData; 43 | - (void)itemStart:(FMFileItem *)fileItem; 44 | - (void)itemStart:(FMFileItem *)fileItem withData:(NSData *)fileData; 45 | - (void)itemStart:(FMFileItem *)fileItem withStream:(NSInputStream *)fileStream; 46 | - (void)itemProgress:(FMFileItem *)fileItem; 47 | - (void)itemFinish:(FMFileItem *)fileItem; 48 | - (void)itemError:(FMFileItem *)fileItem; 49 | - (void)afterFinish; 50 | 51 | - (void)onOperationPause:(BOOL)pauseState; 52 | 53 | - (void)closeSheet; 54 | 55 | + (void)showSheetWith:(FMOperationWindow *)window forOperation:(FMFileOperation *)fileOperation; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /FastCommander/src/FMPanelListItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // PanelListItem.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 24.03.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMCustomTypes.h" 11 | 12 | @class FMProviderFileItem; 13 | 14 | @interface FMPanelListItem : NSObject 15 | 16 | @property (readonly) FMPanelListItemType itemType; 17 | @property (readonly) NSURL *url; 18 | @property (readonly) NSString *resourcePath; 19 | @property (readonly) BOOL isSelected; 20 | 21 | @property (readonly) NSString *fileName; 22 | @property (readonly) NSString *fileExtension; 23 | @property (readonly) NSNumber *fileSize; 24 | @property (readonly) NSDate *modificationDate; 25 | 26 | @property (readonly) id volumeId; 27 | 28 | @property (readonly) BOOL isDirectory; 29 | @property (readonly) BOOL isSymbolicLink; 30 | @property (readonly) BOOL isReadable; 31 | @property (readonly) BOOL isWritable; 32 | @property (readonly) BOOL isExecutable; 33 | @property (readonly) BOOL isHidden; 34 | @property (readonly) BOOL isLooksBetterHidden; 35 | 36 | @property (readonly) BOOL isArchive; 37 | @property (readonly) BOOL isDirectorySize; 38 | 39 | @property (readonly) NSString *unifiedFilePath; 40 | 41 | @property (readonly) NSString *displayFileName; 42 | @property (readonly) NSString *attributesText; 43 | @property (readonly) NSString *fileSizeText; 44 | 45 | @property (readonly) NSString *symbolicLinkPath; 46 | 47 | - (id)initWithURL:(NSURL *)value itemType:(FMPanelListItemType)itemType; 48 | - (id)initWithResource:(NSString *)value providerFileItem:(FMProviderFileItem *)providerFileItem itemType:(FMPanelListItemType)itemType; 49 | 50 | - (id)copyWithZone:(NSZone *)zone; 51 | 52 | - (NSString *)description; 53 | 54 | - (BOOL)isItemsSelectionMatch:(NSString *)pattern; 55 | 56 | - (void)setItemTypeDirUp; 57 | - (void)setSelected:(BOOL)value; 58 | - (void)setDirectorySize:(long long)value; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /FastCommander/src/FMPanelListProviderManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMPanelListProviderManager.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 26.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMCustomTypes.h" 11 | #import "FMPanelListProvider.h" 12 | 13 | @class FMSearchPanelListProvider; 14 | 15 | @interface FMPanelListProviderManager : NSObject 16 | 17 | @property (readonly) FMPanelSide panelSide; 18 | 19 | @property (readonly) FMPanelListProvider *currentProvider; 20 | @property (readonly) FMProviderType currentProviderType; 21 | 22 | @property (readonly) FMSearchPanelListProvider *searchProvider; 23 | 24 | - (id)initForPanelSide:(FMPanelSide)panelSide; 25 | 26 | - (BOOL)setProviderByType:(FMProviderType)providerType withInitBasePath:(NSString *)path; 27 | - (BOOL)setProviderForPath:(NSString *)path; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /FastCommander/src/FMPanelModeIndicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMPanelModeIndicator.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 13.09.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMPanelModeIndicator : NSView 12 | 13 | @property BOOL isSource; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /FastCommander/src/FMPanelSortIndicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMPanelSortIndicator.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 03.01.2014. 6 | // Copyright (c) 2014 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMPanelSortIndicator : NSButton 12 | 13 | @property BOOL isSortMode; 14 | 15 | @property BOOL isDirectionASC; 16 | @property (copy) NSString *sortKey; 17 | 18 | - (void)redraw; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /FastCommander/src/FMPosixPermissions.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMPosixPermissions.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 22.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMPanelListProvider; 12 | 13 | @interface FMPosixPermissions : NSObject 14 | 15 | @property (readonly) NSUInteger bitsToSet; 16 | @property (readonly) NSUInteger bitsToClear; 17 | 18 | - (void)aggregateFileItemsPermissions:(NSMutableArray *)fileItems withProvider:(FMPanelListProvider *)provider; 19 | 20 | + (NSString *)octalTextFromBits:(NSUInteger)bitsToSet; 21 | + (NSUInteger)bitsFromOctalText:(NSString *)octalText; 22 | 23 | + (NSCellStateValue)state:(NSUInteger)mask withBitsToSet:(NSUInteger)bitsToSet andBitsToClear:(NSUInteger)bitsToClear; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FastCommander/src/FMPreferencesWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMPreferencesWindow.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 25.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMDefaultWindow.h" 10 | 11 | @interface FMPreferencesWindow : FMDefaultWindow 12 | 13 | typedef enum 14 | { 15 | FMShowPreferencesTabDefault = 1, 16 | FMShowPreferencesTabBookmarks = 2, 17 | 18 | } FMShowPreferencesTab; 19 | 20 | @property FMShowPreferencesTab selectTab; 21 | 22 | @property (weak) IBOutlet NSTabView *tabView; 23 | 24 | @property (weak) IBOutlet NSTableView *tableThemes; 25 | @property (weak) IBOutlet NSTableView *tableBookmarks; 26 | 27 | @property (weak) IBOutlet NSTextField *editBookmarkDirectory; 28 | @property (weak) IBOutlet NSButton *btnAddBookmark; 29 | 30 | @property (weak) IBOutlet NSButton *checkUseTrash; 31 | 32 | - (IBAction)actionAccept:(id)sender; 33 | - (IBAction)actionAddBookmark:(id)sender; 34 | - (IBAction)actionDeleteBookmark:(id)sender; 35 | - (IBAction)actionChangeUseTrash:(id)sender; 36 | 37 | + (void)showSheet:(FMShowPreferencesTab)tab; 38 | + (void)close; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /FastCommander/src/FMProcessCopyFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMProcessCopyFile.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 15.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMFileItem; 12 | @class FMFileCopyOperation; 13 | 14 | @interface FMProcessCopyFile : NSObject 15 | 16 | @property (weak) FMFileCopyOperation *fileOperation; 17 | 18 | - (id)initWithFileOperation:(FMFileCopyOperation *)fileOperation; 19 | 20 | - (void)copyFileItem:(FMFileItem *)fileItem toPath:(NSString *)targetFilePath; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /FastCommander/src/FMProcessGetFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMProcessGetFile.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 20.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMFileItem; 12 | @class FMFileOperation; 13 | 14 | @interface FMProcessGetFile : NSObject 15 | 16 | @property (weak) FMFileOperation *fileOperation; 17 | 18 | - (id)initWithFileOperation:(FMFileOperation *)fileOperation; 19 | 20 | - (NSData *)fileItemAsData:(FMFileItem *)fileItem; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /FastCommander/src/FMProcessMoveFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMProcessMoveFile.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 30.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMFileItem; 12 | @class FMFileCopyOperation; 13 | 14 | @interface FMProcessMoveFile : NSObject 15 | 16 | @property (weak) FMFileCopyOperation *fileOperation; 17 | 18 | - (id)initWithFileOperation:(FMFileCopyOperation *)fileOperation; 19 | 20 | - (void)moveFileItem:(FMFileItem *)fileItem toPath:(NSString *)targetFilePath; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /FastCommander/src/FMProcessMoveFile.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMProcessMoveFile.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 30.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMProcessMoveFile.h" 10 | #import "FMPanelListProvider.h" 11 | #import "FMFileItem.h" 12 | #import "FMFileOperation.h" 13 | #import "FMFileCopyOperation.h" 14 | #import "FMCommand.h" 15 | 16 | @implementation FMProcessMoveFile 17 | 18 | - (id)initWithFileOperation:(FMFileCopyOperation *)fileOperation 19 | { 20 | self = [super init]; 21 | 22 | if (self) 23 | { 24 | self.fileOperation = fileOperation; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | - (void)moveFileItem:(FMFileItem *)fileItem toPath:(NSString *)targetFilePath 31 | { 32 | @try 33 | { 34 | //process file item 35 | NSError *error = nil; 36 | 37 | if ([self.fileOperation.sourceProvider moveFile:fileItem.filePath to:targetFilePath error:&error] == YES) 38 | { 39 | //set TODO item as done 40 | [fileItem setAsFinished]; 41 | } 42 | else 43 | { 44 | //set item error status 45 | [fileItem setStatus:FMFileItemStatus_SOURCE_MOVE_ERROR withError:error]; 46 | } 47 | } 48 | @catch (NSException *exception) 49 | { 50 | //set item error status 51 | [fileItem setStatus:FMFileItemStatus_ERROR withException:exception]; 52 | } 53 | @finally 54 | { 55 | //remove unfinished file 56 | [self.fileOperation removeIncompleteFile:fileItem inPath:targetFilePath]; 57 | } 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /FastCommander/src/FMProcessSearchFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMProcessSearchFile.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 22.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMFileItem; 12 | @class FMFileSearchOperation; 13 | 14 | @interface FMProcessSearchFile : NSObject 15 | 16 | @property (weak) FMFileSearchOperation *fileOperation; 17 | 18 | @property BOOL matchFound; 19 | @property NSUInteger matchPosition; 20 | 21 | - (id)initWithFileOperation:(FMFileSearchOperation *)fileOperation andText:(NSString *)text; 22 | 23 | - (void)searchTextInFileItem:(FMFileItem *)fileItem; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FastCommander/src/FMProcessTargetFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMProcessTargetFile.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 19.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMFileItem; 12 | @class FMFileCopyOperation; 13 | 14 | @interface FMProcessTargetFile : NSObject 15 | 16 | @property (weak) FMFileCopyOperation *fileOperation; 17 | 18 | - (id)initWithFileOperation:(FMFileCopyOperation *)fileOperation; 19 | 20 | - (NSString *)createAndValidatePathForItem:(FMFileItem *)fileItem; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /FastCommander/src/FMProviderFileItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMProviderFileItem.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 10.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | // Proxy item for preparing list items collecion for virtual providers, like zip 9 | // 10 | 11 | #import 12 | 13 | @class ZZArchiveEntry; 14 | 15 | @interface FMProviderFileItem : NSObject 16 | 17 | @property (readonly, weak) ZZArchiveEntry *archiveEntry; 18 | 19 | @property (readonly) NSString *filePath; 20 | @property (readonly) long long fileSize; 21 | @property (readonly) long long fileSizeCompressed; 22 | @property (readonly) NSDate *modificationDate; 23 | @property (readonly) BOOL isDirectory; 24 | @property (readonly) BOOL isSymbolicLink; 25 | @property (readonly) BOOL isHidden; 26 | 27 | @property id volumeId; 28 | 29 | - (id)initWithArchiveEntry:(ZZArchiveEntry *)entry; 30 | - (id)initWithFileItem:(FMProviderFileItem *)item; 31 | - (id)initDirectoryItem:(FMProviderFileItem *)item withPath:(NSString *)path; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /FastCommander/src/FMProviderFileItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMProviderFileItem.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 10.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "zipzap.h" 10 | #import "FMProviderFileItem.h" 11 | #import "NSString+Utils.h" 12 | 13 | @implementation FMProviderFileItem 14 | 15 | - (id)initWithArchiveEntry:(ZZArchiveEntry *)entry 16 | { 17 | self = [super init]; 18 | 19 | if (self) 20 | { 21 | self->_archiveEntry = entry; 22 | 23 | self->_filePath = [[entry.fileName stringByAppendingSlashPrefix] stringByDeletingSlashSuffix]; 24 | self->_fileSize = entry.uncompressedSize; 25 | self->_fileSizeCompressed = entry.compressedSize; 26 | self->_isDirectory = [entry.fileName hasSuffix:@"/"]; 27 | self->_isSymbolicLink = NO; 28 | } 29 | 30 | return self; 31 | } 32 | 33 | - (id)initWithFileItem:(FMProviderFileItem *)item 34 | { 35 | self = [super init]; 36 | 37 | if (self) 38 | { 39 | self->_archiveEntry = item.archiveEntry; 40 | 41 | self->_filePath = [[item.filePath stringByAppendingSlashPrefix] stringByDeletingSlashSuffix]; 42 | self->_fileSize = item.fileSize; 43 | self->_fileSizeCompressed = item.fileSizeCompressed; 44 | self->_isDirectory = [item.filePath hasSuffix:@"/"]; 45 | self->_isSymbolicLink = item.isSymbolicLink; 46 | self->_volumeId = [item.volumeId copy]; 47 | } 48 | 49 | return self; 50 | } 51 | 52 | - (id)initDirectoryItem:(FMProviderFileItem *)item withPath:(NSString *)path 53 | { 54 | self = [super init]; 55 | 56 | if (self) 57 | { 58 | self->_archiveEntry = item.archiveEntry; 59 | 60 | self->_filePath = [[path stringByAppendingSlashPrefix] stringByDeletingSlashSuffix]; 61 | self->_fileSize = 0; 62 | self->_fileSizeCompressed = 0; 63 | self->_isDirectory = YES; 64 | self->_isSymbolicLink = NO; 65 | self->_volumeId = [item.volumeId copy]; 66 | } 67 | 68 | return self; 69 | } 70 | 71 | - (NSDate *)modificationDate 72 | { 73 | if (self->_archiveEntry != nil) 74 | { 75 | return [self->_archiveEntry.lastModified copy]; 76 | } 77 | 78 | return [self.modificationDate copy]; 79 | } 80 | 81 | - (BOOL)isHidden 82 | { 83 | return [[self->_filePath lastPathComponent] hasPrefix:@"."]; 84 | } 85 | 86 | - (NSString *)description 87 | { 88 | return self.filePath; 89 | } 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /FastCommander/src/FMReloadData.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMReloadData.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 25.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMReloadData : NSObject 12 | 13 | typedef void (^OnReloadBlock)(FMReloadData *data); 14 | 15 | @property (copy) NSString *nameToSelectOnList; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FastCommander/src/FMReloadData.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMReloadData.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 25.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMReloadData.h" 10 | 11 | @implementation FMReloadData 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /FastCommander/src/FMResources.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMResources.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 21.04.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMResources : NSObject 12 | 13 | @property NSImage *imageItemSelected; 14 | @property NSImage *imageItemSelectedInverted; 15 | 16 | @property NSImage *imageModeSource; 17 | @property NSImage *imageModeTarget; 18 | 19 | @property NSImage *imageOperationCopy; 20 | @property NSImage *imageOperationMove; 21 | 22 | @property NSShadow *shadowBtnDown; 23 | @property NSShadow *shadowBtnUp; 24 | 25 | + (FMResources *)instance; 26 | 27 | - (id)init; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /FastCommander/src/FMRightDirectoryViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMRightDirectoryViewController.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 07.04.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMDirectoryViewController.h" 11 | #import "FMRightFilesTableView.h" 12 | 13 | @interface FMRightDirectoryViewController : FMDirectoryViewController 14 | 15 | - (IBAction)onDirectoryUp:(id)sender; 16 | - (IBAction)onSelectItemsPopover:(id)sender; 17 | - (IBAction)actionOpenDirectoryList:(id)sender; 18 | - (IBAction)onResetSortMode:(id)sender; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /FastCommander/src/FMRightDirectoryViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMRightDirectoryViewController.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 07.04.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMRightDirectoryViewController.h" 10 | #import "FMPanelListItem.h" 11 | 12 | @implementation FMRightDirectoryViewController 13 | 14 | - (id)initWithCoder:(NSCoder *)aDecoder 15 | { 16 | self = [super initWithCoder:aDecoder]; 17 | 18 | if (self) 19 | { 20 | self.panelSide = FMPanelSideR; 21 | } 22 | 23 | return self; 24 | } 25 | 26 | - (IBAction)onDirectoryUp:(id)sender 27 | { 28 | [self commandDirectoryUp]; 29 | } 30 | 31 | - (IBAction)onSelectItemsPopover:(id)sender 32 | { 33 | [self commandShowSelectionPanel:FMSelectionMode_SELECT withPattern:self.tableView.getDefaultGlobPattern]; 34 | } 35 | 36 | - (IBAction)actionOpenDirectoryList:(id)sender 37 | { 38 | [super actionOpenDirectoryList:sender]; 39 | } 40 | 41 | - (IBAction)onResetSortMode:(id)sender 42 | { 43 | [super resetSortMode]; 44 | } 45 | 46 | //FMAdvancedCombo delegates 47 | - (void)onAdvancedComboListDidClose:(FMAdvancedCombo *)combo 48 | { 49 | [super onAdvancedComboListDidClose:combo]; 50 | 51 | [self.tableView setNeedsDisplay:YES]; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /FastCommander/src/FMRightFilesTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMRightFilesTableView.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 18.04.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMFilesTableView.h" 11 | 12 | @interface FMRightFilesTableView : FMFilesTableView 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /FastCommander/src/FMRightFilesTableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMRightFilesTableView.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 18.04.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMRightFilesTableView.h" 10 | #import "FMSettings.h" 11 | 12 | @implementation FMRightFilesTableView 13 | 14 | - (id)initWithCoder:(NSCoder *)aDecoder 15 | { 16 | self = [super initWithCoder:aDecoder]; 17 | 18 | if (self) 19 | { 20 | self.panelSide = FMPanelSideR; 21 | } 22 | 23 | return self; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FastCommander/src/FMScrollAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMScrollAnimation.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 05.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMScrollAnimation : NSAnimation 12 | 13 | typedef void (^OnScrollAnimFinishBlock)(void); 14 | 15 | @property (weak) NSScrollView *scrollView; 16 | 17 | @property (strong) OnScrollAnimFinishBlock onFinish; 18 | 19 | + (void)scroll:(NSScrollView *)scrollView toPoint:(NSPoint)targetPoint withBlockOnFinish:(OnScrollAnimFinishBlock)onFinish; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /FastCommander/src/FMScrollAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMScrollAnimation.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 05.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMScrollAnimation.h" 10 | 11 | @implementation FMScrollAnimation 12 | { 13 | NSPoint _originPoint; 14 | NSPoint _targetPoint; 15 | } 16 | 17 | + (void)scroll:(NSScrollView *)scrollView toPoint:(NSPoint)targetPoint withBlockOnFinish:(OnScrollAnimFinishBlock)onFinish 18 | { 19 | [scrollView setNeedsDisplay:YES]; 20 | 21 | FMScrollAnimation *animation = [[FMScrollAnimation alloc] initWithDuration:0.15 animationCurve:NSAnimationEaseInOut]; 22 | 23 | animation.scrollView = scrollView; 24 | animation.onFinish = onFinish; 25 | 26 | animation->_originPoint = scrollView.documentVisibleRect.origin; 27 | animation->_targetPoint = targetPoint; 28 | 29 | animation.frameRate = 60; 30 | animation.delegate = animation; 31 | 32 | animation.animationBlockingMode = NSAnimationNonblockingThreaded; 33 | 34 | [[NSOperationQueue mainQueue] addOperation:[NSBlockOperation blockOperationWithBlock:^ 35 | { 36 | [animation startAnimation]; 37 | }]]; 38 | } 39 | 40 | - (void)animationDidEnd:(NSAnimation *)animation 41 | { 42 | [self.scrollView.documentView setNeedsLayout:YES]; 43 | [self.scrollView setNeedsDisplay:YES]; 44 | 45 | [self processUiMessages]; 46 | 47 | if (self.onFinish != nil) 48 | { 49 | self.onFinish(); 50 | } 51 | } 52 | 53 | - (void)processUiMessages 54 | { 55 | NSDate *dtr = [[NSDate alloc] initWithTimeIntervalSinceNow:0.2]; 56 | 57 | [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:dtr]; 58 | } 59 | 60 | - (void)setCurrentProgress:(NSAnimationProgress)progress 61 | { 62 | [super setCurrentProgress:progress]; 63 | 64 | NSPoint progressPoint = self->_originPoint; 65 | 66 | progressPoint.x += progress * (self->_targetPoint.x - self->_originPoint.x); 67 | progressPoint.y += progress * (self->_targetPoint.y - self->_originPoint.y); 68 | 69 | [self.scrollView.documentView scrollPoint:progressPoint]; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /FastCommander/src/FMScrollIndicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMScrollIndicator.h 3 | // FMScrollIndicator 4 | // 5 | // Created by Piotr Zagawa on 11.10.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMScrollIndicator : NSView 12 | 13 | @property NSColor *backgroundColor; 14 | @property NSColor *barColor; 15 | 16 | @property CGFloat documentViewHeight; 17 | @property CGFloat documentHeight; 18 | @property CGFloat documentPosition; 19 | 20 | - (void)registerScrollEventsFor:(NSClipView *)contentView; 21 | - (void)unregisterScrollEventsFor:(NSClipView *)contentView; 22 | 23 | - (void)updateWith:(NSClipView *)contentView; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FastCommander/src/FMSearchPanelListProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMSearchPanelListProvider.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 24.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMPanelListProvider.h" 10 | 11 | @interface FMSearchPanelListProvider : FMPanelListProvider 12 | 13 | - (id)init; 14 | 15 | - (void)reset; 16 | 17 | - (BOOL)isPathValid:(NSString *)path; 18 | - (void)reload; 19 | - (void)reload:(NSString *)path; 20 | - (BOOL)isLoadingData; 21 | 22 | - (NSString *)getNameToSelect; 23 | - (NSString *)getInitNameToSelect; 24 | - (NSString *)getParentDirectory; 25 | 26 | - (NSString *)getVolumeNameForPath:(NSString *)path; 27 | - (NSNumber *)getVolumeTotalSizeForPath:(NSString *)path; 28 | - (NSNumber *)getVolumeAvailableSizeForPath:(NSString *)path; 29 | 30 | - (void)addFileItemsTo:(NSMutableArray *)fileItems fromDirectoryItem:(FMPanelListItem *)listItem forOperation:(FMFileOperation *)fileOperation andTestBlock:(OnTestFileItem)onTestFileItem; 31 | - (void)validateFileItems:(NSMutableArray *)fileItems forOperation:(FMFileOperation *)fileOperation; 32 | - (int)filesCountForPath:(NSString *)directoryPath; 33 | 34 | - (NSInputStream *)getInputStream:(NSString *)filePath; 35 | - (NSOutputStream *)getOutputStream:(NSString *)filePath; 36 | 37 | - (NSString *)getTargetFileName:(FMFileItem *)fileItem withTargetPath:(NSString *)targetPath; 38 | - (NSString *)getRelativeTargetFileName:(FMFileItem *)fileItem withTargetPath:(NSString *)targetPath; 39 | 40 | - (FMFileItem *)fileNameToFileItem:(NSString *)filePath; 41 | 42 | - (BOOL)removeFile:(NSString *)filePath; 43 | - (BOOL)fileExists:(NSString *)filePath; 44 | - (BOOL)directoryExists:(NSString *)directoryPath; 45 | - (BOOL)removeDirectory:(NSString *)filePath; 46 | - (BOOL)createDirectory:(NSString *)filePath; 47 | - (BOOL)renameFile:(NSString *)oldFilePath to:(NSString *)newFilePath; 48 | - (BOOL)moveFile:(NSString *)oldFilePath to:(NSString *)newFilePath error:(NSError **)error; 49 | 50 | - (NSUInteger)posixPermissionsForPath:(NSString *)filePath; 51 | - (BOOL)setPosixPermissions:(NSUInteger)permissions forPath:(NSString *)filePath; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /FastCommander/src/FMSelectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMSelectionViewController.h 3 | // 4 | // Created by Piotr Zagawa on 20.05.2013. 5 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "FMCustomTypes.h" 10 | 11 | @interface FMSelectionViewController : NSViewController 12 | 13 | @property (weak) IBOutlet NSSegmentedControl *btnSelectionMode; 14 | @property (weak) IBOutlet NSTokenField *editPattern; 15 | 16 | @property (weak) NSPopover *popOver; 17 | @property FMPanelSide panelSide; 18 | @property FMSelectionMode mode; 19 | @property NSString *pattern; 20 | 21 | - (IBAction)actionOnPatternChange:(id)sender; 22 | 23 | - (void)showPopover:(NSPopover *)popOver sender:(id)sender panelSide:(FMPanelSide)panelSide selectionMode:(FMSelectionMode)mode pattern:(NSString *)pattern; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FastCommander/src/FMSettings.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMSettings.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 18.04.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FMSettings : NSObject 12 | 13 | @property (readonly) NSString *installUUID; 14 | 15 | @property BOOL isHiddenFilesVisible; 16 | @property NSString *selectedThemeName; 17 | 18 | @property NSArray *bookmarks; 19 | 20 | @property (readonly) BOOL isStartMessageForNewAppVersion; 21 | 22 | @property BOOL isUseTrash; 23 | 24 | + (FMSettings *)instance; 25 | 26 | - (void)saveNewAppVersionForStartMessage; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /FastCommander/src/FMSummaryInformation.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMSummaryInformation.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 10.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMPanelListProvider.h" 11 | 12 | @interface FMSummaryInformation : NSObject 13 | 14 | @property (copy) NSNumber *count; 15 | @property (copy) NSNumber *size; 16 | 17 | - (id)init; 18 | 19 | + (FMSummaryInformation *)getSummaryInformation:(FMPanelListProvider *)listProvider; 20 | + (FMSummaryInformation *)getSelectionInformation:(FMPanelListProvider *)listProvider; 21 | 22 | + (NSString *)getInformationText:(FMSummaryInformation *)information emptyText:(NSString *)emptyText; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeChocolate.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeChocolate.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 15.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMTheme.h" 11 | 12 | @interface FMThemeChocolate : FMTheme 13 | 14 | - (id)init; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeChocolate.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeChocolate.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 15.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMThemeChocolate.h" 10 | #import "NSColor+Hex.h" 11 | 12 | @implementation FMThemeChocolate 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | 18 | if (self) 19 | { 20 | self.themeName = @"Black Mesa"; 21 | 22 | self.listBackground = [NSColor colorWithHexRGB:0x292421]; 23 | self.listHighlightedRow = [NSColor colorWithHexRGB:0xFF7F24]; 24 | self.listSelectedRow = [NSColor colorWithHexRGB:0x393431]; 25 | self.iconSelectedRow = [NSColor colorWithHexRGB:0xFF6103]; 26 | self.iconSelectedRowInv = [NSColor whiteColor]; 27 | 28 | //default row text color set 29 | self.rowDefaultText = [NSColor colorWithHexRGB:0xF4A460]; 30 | self.rowDirectoryText = [NSColor colorWithHexRGB:0xFFDAB9]; 31 | self.rowHiddenText = [NSColor colorWithHexRGB:0x8B4513]; 32 | self.rowArchiveText = [NSColor colorWithHexRGB:0xff6655]; 33 | 34 | //selected row text color set 35 | self.rowDefaultSelectedText = [NSColor colorWithHexRGB:0xF4b470]; 36 | self.rowDirectorySelectedText = [NSColor colorWithHexRGB:0xFFeAc9]; 37 | self.rowHiddenSelectedText = [NSColor colorWithHexRGB:0x8B4513]; 38 | self.rowArchiveSelectedText = [NSColor colorWithHexRGB:0xff8877]; 39 | 40 | //highlighted row text color set 41 | self.rowDefaultHighlightText = [NSColor whiteColor]; 42 | self.rowDirectoryHighlightText = [NSColor whiteColor]; 43 | self.rowHiddenHighlightText = [NSColor whiteColor]; 44 | self.rowArchiveHighlightText = [NSColor whiteColor]; 45 | self.rowHighlightTextShadow = [NSColor colorWithHexRGB:0x292421]; 46 | } 47 | 48 | return self; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeChocolate1.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeChocolate1.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 02.11.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMTheme.h" 11 | 12 | @interface FMThemeChocolate1 : FMTheme 13 | 14 | - (id)init; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeChocolate1.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeChocolate1.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 02.11.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMThemeChocolate1.h" 10 | #import "NSColor+Hex.h" 11 | 12 | @implementation FMThemeChocolate1 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | 18 | if (self) 19 | { 20 | self.themeName = @"Black Mesa Low"; 21 | 22 | self.listBackground = [NSColor colorWithHexRGB:0x181412]; 23 | self.listHighlightedRow = [NSColor colorWithHexRGB:0xaa4400]; 24 | self.listSelectedRow = [NSColor colorWithHexRGB:0x080402]; 25 | self.iconSelectedRow = [NSColor colorWithHexRGB:0xcc6600]; 26 | self.iconSelectedRowInv = [NSColor whiteColor]; 27 | 28 | //default row text color set 29 | self.rowDefaultText = [NSColor colorWithHexRGB:0xbb9977]; 30 | self.rowDirectoryText = [NSColor colorWithHexRGB:0xddccbb]; 31 | self.rowHiddenText = [NSColor colorWithHexRGB:0x554433]; 32 | self.rowArchiveText = [NSColor colorWithHexRGB:0xdd5555]; 33 | 34 | //selected row text color set 35 | self.rowDefaultSelectedText = [NSColor colorWithHexRGB:0xcc8866]; 36 | self.rowDirectorySelectedText = [NSColor colorWithHexRGB:0xeeddcc]; 37 | self.rowHiddenSelectedText = [NSColor colorWithHexRGB:0x554433]; 38 | self.rowArchiveSelectedText = [NSColor colorWithHexRGB:0xee5555]; 39 | 40 | //highlighted row text color set 41 | self.rowDefaultHighlightText = [NSColor whiteColor]; 42 | self.rowDirectoryHighlightText = [NSColor whiteColor]; 43 | self.rowHiddenHighlightText = [NSColor whiteColor]; 44 | self.rowArchiveHighlightText = [NSColor whiteColor]; 45 | self.rowHighlightTextShadow = [NSColor blackColor]; 46 | } 47 | 48 | return self; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeCustom1.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeCustom1.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 24.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMTheme.h" 11 | 12 | @interface FMThemeCustom1 : FMTheme 13 | 14 | - (id)init; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeCustom1.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeCustom1.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 24.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMThemeCustom1.h" 10 | #import "NSColor+Hex.h" 11 | 12 | @implementation FMThemeCustom1 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | 18 | if (self) 19 | { 20 | self.themeName = @"Mono"; 21 | 22 | self.listBackground = [NSColor colorWithHexRGB:0x1E1E1E]; 23 | self.listHighlightedRow = [NSColor colorWithHexRGB:0x606060]; 24 | self.listSelectedRow = [NSColor colorWithHexRGB:0x101010]; 25 | self.iconSelectedRow = [NSColor colorWithHexRGB:0x035D20]; 26 | self.iconSelectedRowInv = [NSColor colorWithHexRGB:0xa0a0a0]; 27 | 28 | //default row text color set 29 | self.rowDefaultText = [NSColor colorWithHexRGB:0xa0a0a0]; 30 | self.rowDirectoryText = [NSColor colorWithHexRGB:0xe8e8e8]; 31 | self.rowHiddenText = [NSColor colorWithHexRGB:0x585858]; 32 | self.rowArchiveText = [NSColor colorWithHexRGB:0x587868]; 33 | 34 | //selected row text color set 35 | self.rowDefaultSelectedText = [NSColor colorWithHexRGB:0x43bD80]; 36 | self.rowDirectorySelectedText = [NSColor colorWithHexRGB:0x63eDb0]; 37 | self.rowHiddenSelectedText = [NSColor colorWithHexRGB:0x239D60]; 38 | self.rowArchiveSelectedText = [NSColor colorWithHexRGB:0x43bD80]; 39 | 40 | //highlighted row text color set 41 | self.rowDefaultHighlightText = [NSColor whiteColor]; 42 | self.rowDirectoryHighlightText = [NSColor whiteColor]; 43 | self.rowHiddenHighlightText = [NSColor whiteColor]; 44 | self.rowArchiveHighlightText = [NSColor whiteColor]; 45 | self.rowHighlightTextShadow = [NSColor blackColor]; 46 | } 47 | 48 | return self; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeCustom2.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeCustom2.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 24.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMTheme.h" 11 | 12 | @interface FMThemeCustom2 : FMTheme 13 | 14 | - (id)init; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeCustom2.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeCustom2.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 24.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMThemeCustom2.h" 10 | #import "NSColor+Hex.h" 11 | 12 | @implementation FMThemeCustom2 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | 18 | if (self) 19 | { 20 | self.themeName = @"Black"; 21 | 22 | self.listBackground = [NSColor blackColor]; 23 | self.listHighlightedRow = [NSColor colorWithHexRGB:0x80629D]; 24 | self.listSelectedRow = [NSColor blackColor]; 25 | self.iconSelectedRow = [NSColor colorWithHexRGB:0x678CB1]; 26 | self.iconSelectedRowInv = [NSColor colorWithHexRGB:0xa7cCf1]; 27 | 28 | //default row text color set 29 | self.rowDefaultText = [NSColor colorWithHexRGB:0xC0C0C0]; 30 | self.rowDirectoryText = [NSColor colorWithHexRGB:0x7D8C93]; 31 | self.rowHiddenText = [NSColor colorWithHexRGB:0x2F393C]; 32 | self.rowArchiveText = [NSColor colorWithHexRGB:0xa57b61]; 33 | 34 | //selected row text color set 35 | self.rowDefaultSelectedText = [NSColor colorWithHexRGB:0xe0e0e0]; 36 | self.rowDirectorySelectedText = [NSColor colorWithHexRGB:0x9DaCb3]; 37 | self.rowHiddenSelectedText = [NSColor colorWithHexRGB:0x4F595C]; 38 | self.rowArchiveSelectedText = [NSColor colorWithHexRGB:0xc59b81]; 39 | 40 | //highlighted row text color set 41 | self.rowDefaultHighlightText = [NSColor whiteColor]; 42 | self.rowDirectoryHighlightText = [NSColor whiteColor]; 43 | self.rowHiddenHighlightText = [NSColor whiteColor]; 44 | self.rowArchiveHighlightText = [NSColor whiteColor]; 45 | self.rowHighlightTextShadow = [NSColor blackColor]; 46 | } 47 | 48 | return self; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeMac.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeMac.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 15.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMTheme.h" 11 | 12 | @interface FMThemeMac : FMTheme 13 | 14 | - (id)init; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeMac.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeMac.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 15.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMThemeMac.h" 10 | #import "NSColor+Hex.h" 11 | 12 | @implementation FMThemeMac 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | 18 | if (self) 19 | { 20 | self.themeName = @"Mac"; 21 | 22 | self.listBackground = [NSColor whiteColor]; 23 | self.listHighlightedRow = [NSColor colorWithHexRGB:0xff9944]; 24 | self.listSelectedRow = [NSColor colorWithHexRGB:0xf4f4f4]; 25 | self.iconSelectedRow = [NSColor colorWithHexRGB:0x1C86EE]; 26 | self.iconSelectedRowInv = [NSColor whiteColor]; 27 | 28 | //default row text color set 29 | self.rowDefaultText = [NSColor colorWithHexRGB:0x666666]; 30 | self.rowDirectoryText = [NSColor colorWithHexRGB:0x2a2a2a]; 31 | self.rowHiddenText = [NSColor colorWithHexRGB:0xa6a6a6]; 32 | self.rowArchiveText = [NSColor colorWithHexRGB:0xff4466]; 33 | 34 | //selected row text color set 35 | self.rowDefaultSelectedText = [NSColor colorWithHexRGB:0x4b6b9b]; 36 | self.rowDirectorySelectedText = [NSColor colorWithHexRGB:0x2b4b7b]; 37 | self.rowHiddenSelectedText = [NSColor colorWithHexRGB:0x7babdb]; 38 | self.rowArchiveSelectedText = [NSColor colorWithHexRGB:0xff4488]; 39 | 40 | //highlighted row text color set 41 | self.rowDefaultHighlightText = [NSColor whiteColor]; 42 | self.rowDirectoryHighlightText = [NSColor whiteColor]; 43 | self.rowHiddenHighlightText = [NSColor whiteColor]; 44 | self.rowArchiveHighlightText = [NSColor whiteColor]; 45 | self.rowHighlightTextShadow = [NSColor colorWithHexRGB:0x884400]; 46 | } 47 | 48 | return self; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeManager.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 15.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMTheme.h" 11 | 12 | @interface FMThemeManager : NSObject 13 | 14 | @property FMTheme *theme; 15 | @property (readonly) NSUInteger themesCount; 16 | 17 | + (FMThemeManager *)instance; 18 | 19 | - (id)init; 20 | 21 | - (FMTheme *)themeByIndex:(NSUInteger)index; 22 | - (FMTheme *)themeByName:(NSString *)name; 23 | - (NSUInteger)themeIndexByName:(NSString *)name; 24 | 25 | - (void)selectThemeByName:(NSString *)name; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeMatrix.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeMatrix.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 15.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMTheme.h" 11 | 12 | @interface FMThemeMatrix : FMTheme 13 | 14 | - (id)init; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeMatrix.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeMatrix.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 15.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMThemeMatrix.h" 10 | #import "NSColor+Hex.h" 11 | 12 | @implementation FMThemeMatrix 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | 18 | if (self) 19 | { 20 | self.themeName = @"Matrix"; 21 | 22 | self.listBackground = [NSColor colorWithHexRGB:0x002200]; 23 | self.listHighlightedRow = [NSColor colorWithHexRGB:0x00CD00]; 24 | self.listSelectedRow = [NSColor colorWithHexRGB:0x002a00]; 25 | self.iconSelectedRow = [NSColor colorWithHexRGB:0x3D9140]; 26 | self.iconSelectedRowInv = [NSColor colorWithHexRGB:0x010101]; 27 | 28 | //default row text color set 29 | self.rowDefaultText = [NSColor colorWithHexRGB:0x3D9140]; 30 | self.rowDirectoryText = [NSColor colorWithHexRGB:0x43CD80]; 31 | self.rowHiddenText = [NSColor colorWithHexRGB:0x256B54]; 32 | self.rowArchiveText = [NSColor colorWithHexRGB:0x44cc99]; 33 | 34 | //selected row text color set 35 | self.rowDefaultSelectedText = [NSColor colorWithHexRGB:0x2D8130]; 36 | self.rowDirectorySelectedText = [NSColor colorWithHexRGB:0x33bD70]; 37 | self.rowHiddenSelectedText = [NSColor colorWithHexRGB:0x155B44]; 38 | self.rowArchiveSelectedText = [NSColor colorWithHexRGB:0x34bc89]; 39 | 40 | //highlighted row text color set 41 | self.rowDefaultHighlightText = [NSColor colorWithHexRGB:0x010101]; 42 | self.rowDirectoryHighlightText = [NSColor colorWithHexRGB:0x010101]; 43 | self.rowHiddenHighlightText = [NSColor colorWithHexRGB:0x010101]; 44 | self.rowArchiveHighlightText = [NSColor colorWithHexRGB:0x010101]; 45 | self.rowHighlightTextShadow = [NSColor colorWithHexRGB:0x008800]; 46 | } 47 | 48 | return self; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeNorton.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeNorton.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 15.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMTheme.h" 11 | 12 | @interface FMThemeNorton : FMTheme 13 | 14 | - (id)init; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeNorton.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeNorton.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 15.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMThemeNorton.h" 10 | #import "NSColor+Hex.h" 11 | 12 | @implementation FMThemeNorton 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | 18 | if (self) 19 | { 20 | self.themeName = @"Norton"; 21 | 22 | self.listBackground = [NSColor colorWithHexRGB:0x24246A]; 23 | self.listHighlightedRow = [NSColor colorWithHexRGB:0x0099cc]; 24 | self.listSelectedRow = [NSColor colorWithHexRGB:0x34347A]; 25 | self.iconSelectedRow = [NSColor colorWithHexRGB:0x0099cc]; 26 | self.iconSelectedRowInv = [NSColor whiteColor]; 27 | 28 | //default row text color set 29 | self.rowDefaultText = [NSColor colorWithHexRGB:0x43CD80]; 30 | self.rowDirectoryText = [NSColor colorWithHexRGB:0xf0f0f0]; 31 | self.rowHiddenText = [NSColor colorWithHexRGB:0x606060]; 32 | self.rowArchiveText = [NSColor colorWithHexRGB:0xff7799]; 33 | 34 | //selected row text color set 35 | self.rowDefaultSelectedText = [NSColor colorWithHexRGB:0x63eDb0]; 36 | self.rowDirectorySelectedText = [NSColor colorWithHexRGB:0xf8f8ff]; 37 | self.rowHiddenSelectedText = [NSColor colorWithHexRGB:0x9090a0]; 38 | self.rowArchiveSelectedText = [NSColor colorWithHexRGB:0xff99bb]; 39 | 40 | //highlighted row text color set 41 | self.rowDefaultHighlightText = [NSColor whiteColor]; 42 | self.rowDirectoryHighlightText = [NSColor whiteColor]; 43 | self.rowHiddenHighlightText = [NSColor whiteColor]; 44 | self.rowArchiveHighlightText = [NSColor whiteColor]; 45 | self.rowHighlightTextShadow = [NSColor colorWithHexRGB:0x080855]; 46 | } 47 | 48 | return self; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeSolarizedDark.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeSolarizedDark.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 26.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMTheme.h" 11 | 12 | @interface FMThemeSolarizedDark : FMTheme 13 | 14 | - (id)init; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeSolarizedDark.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeSolarizedDark.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 26.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMThemeSolarizedDark.h" 10 | #import "NSColor+Hex.h" 11 | 12 | @implementation FMThemeSolarizedDark 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | 18 | if (self) 19 | { 20 | self.themeName = @"Solarized Dark"; 21 | 22 | self.listBackground = [NSColor colorWithHexRGB:0x002b36]; 23 | self.listHighlightedRow = [NSColor colorWithHexRGB:0x268bd2]; 24 | self.listSelectedRow = [NSColor colorWithHexRGB:0x073642]; 25 | self.iconSelectedRow = [NSColor colorWithHexRGB:0x268bd2]; 26 | self.iconSelectedRowInv = [NSColor colorWithHexRGB:0xfdf6e3]; 27 | 28 | //default row text color set 29 | self.rowDefaultText = [NSColor colorWithHexRGB:0x839496]; 30 | self.rowDirectoryText = [NSColor colorWithHexRGB:0x93a1a1]; 31 | self.rowHiddenText = [NSColor colorWithHexRGB:0x586e75]; 32 | self.rowArchiveText = [NSColor colorWithHexRGB:0xcb4b16]; 33 | 34 | //selected row text color set 35 | self.rowDefaultSelectedText = [NSColor colorWithHexRGB:0x839496]; 36 | self.rowDirectorySelectedText = [NSColor colorWithHexRGB:0x93a1a1]; 37 | self.rowHiddenSelectedText = [NSColor colorWithHexRGB:0x586e75]; 38 | self.rowArchiveSelectedText = [NSColor colorWithHexRGB:0xcb4b16]; 39 | 40 | //highlighted row text color set 41 | self.rowDefaultHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 42 | self.rowDirectoryHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 43 | self.rowHiddenHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 44 | self.rowArchiveHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 45 | self.rowHighlightTextShadow = [NSColor colorWithHexRGB:0x060b62]; 46 | } 47 | 48 | return self; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeSolarizedDarkColor1.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeSolarizedDarkColor1.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 26.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMTheme.h" 11 | 12 | @interface FMThemeSolarizedDarkColor1 : FMTheme 13 | 14 | - (id)init; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeSolarizedDarkColor1.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeSolarizedDarkColor1.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 26.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMThemeSolarizedDarkColor1.h" 10 | #import "NSColor+Hex.h" 11 | 12 | @implementation FMThemeSolarizedDarkColor1 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | 18 | if (self) 19 | { 20 | self.themeName = @"Solarized Dark Color"; 21 | 22 | self.listBackground = [NSColor colorWithHexRGB:0x002b36]; 23 | self.listHighlightedRow = [NSColor colorWithHexRGB:0xcb4b16]; 24 | self.listSelectedRow = [NSColor colorWithHexRGB:0x073642]; 25 | self.iconSelectedRow = [NSColor colorWithHexRGB:0x268bd2]; 26 | self.iconSelectedRowInv = [NSColor colorWithHexRGB:0xfdf6e3]; 27 | 28 | //default row text color set 29 | self.rowDefaultText = [NSColor colorWithHexRGB:0xcb4b16]; 30 | self.rowDirectoryText = [NSColor colorWithHexRGB:0x268bd2]; 31 | self.rowHiddenText = [NSColor colorWithHexRGB:0x586e75]; 32 | self.rowArchiveText = [NSColor colorWithHexRGB:0xd33682]; 33 | 34 | //selected row text color set 35 | self.rowDefaultSelectedText = [NSColor colorWithHexRGB:0xcb4b16]; 36 | self.rowDirectorySelectedText = [NSColor colorWithHexRGB:0x268bd2]; 37 | self.rowHiddenSelectedText = [NSColor colorWithHexRGB:0x586e75]; 38 | self.rowArchiveSelectedText = [NSColor colorWithHexRGB:0xd33682]; 39 | 40 | //highlighted row text color set 41 | self.rowDefaultHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 42 | self.rowDirectoryHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 43 | self.rowHiddenHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 44 | self.rowArchiveHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 45 | self.rowHighlightTextShadow = [NSColor colorWithHexRGB:0x060b62]; 46 | } 47 | 48 | return self; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeSolarizedLight.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeSolarizedLight.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 26.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMTheme.h" 11 | 12 | @interface FMThemeSolarizedLight : FMTheme 13 | 14 | - (id)init; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeSolarizedLight.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeSolarizedLight.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 26.07.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMThemeSolarizedLight.h" 10 | #import "NSColor+Hex.h" 11 | 12 | @implementation FMThemeSolarizedLight 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | 18 | if (self) 19 | { 20 | self.themeName = @"Solarized Light"; 21 | 22 | self.listBackground = [NSColor colorWithHexRGB:0xfdf6e3]; 23 | self.listHighlightedRow = [NSColor colorWithHexRGB:0x268bd2]; 24 | self.listSelectedRow = [NSColor colorWithHexRGB:0xeee8d5]; 25 | self.iconSelectedRow = [NSColor colorWithHexRGB:0x268bd2]; 26 | self.iconSelectedRowInv = [NSColor colorWithHexRGB:0xfdf6e3]; 27 | 28 | //default row text color set 29 | self.rowDefaultText = [NSColor colorWithHexRGB:0x657b83]; 30 | self.rowDirectoryText = [NSColor colorWithHexRGB:0x586e75]; 31 | self.rowHiddenText = [NSColor colorWithHexRGB:0x93a1a1]; 32 | self.rowArchiveText = [NSColor colorWithHexRGB:0xcb4b16]; 33 | 34 | //selected row text color set 35 | self.rowDefaultSelectedText = [NSColor colorWithHexRGB:0x657b83]; 36 | self.rowDirectorySelectedText = [NSColor colorWithHexRGB:0x586e75]; 37 | self.rowHiddenSelectedText = [NSColor colorWithHexRGB:0x93a1a1]; 38 | self.rowArchiveSelectedText = [NSColor colorWithHexRGB:0xcb4b16]; 39 | 40 | //highlighted row text color set 41 | self.rowDefaultHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 42 | self.rowDirectoryHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 43 | self.rowHiddenHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 44 | self.rowArchiveHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 45 | self.rowHighlightTextShadow = [NSColor colorWithHexRGB:0x060b62]; 46 | } 47 | 48 | return self; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeSolarizedLightColor1.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeSolarizedLightColor1.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 26.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMTheme.h" 11 | 12 | @interface FMThemeSolarizedLightColor1 : FMTheme 13 | 14 | - (id)init; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeSolarizedLightColor1.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeSolarizedLightColor1.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 26.08.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMThemeSolarizedLightColor1.h" 10 | #import "NSColor+Hex.h" 11 | 12 | @implementation FMThemeSolarizedLightColor1 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | 18 | if (self) 19 | { 20 | self.themeName = @"Solarized Light Color"; 21 | 22 | self.listBackground = [NSColor colorWithHexRGB:0xfdf6e3]; 23 | self.listHighlightedRow = [NSColor colorWithHexRGB:0x268bd2]; 24 | self.listSelectedRow = [NSColor colorWithHexRGB:0xeee8d5]; 25 | self.iconSelectedRow = [NSColor colorWithHexRGB:0x268bd2]; 26 | self.iconSelectedRowInv = [NSColor colorWithHexRGB:0xfdf6e3]; 27 | 28 | //default row text color set 29 | self.rowDefaultText = [NSColor colorWithHexRGB:0xcb4b16]; 30 | self.rowDirectoryText = [NSColor colorWithHexRGB:0x268bd2]; 31 | self.rowHiddenText = [NSColor colorWithHexRGB:0x93a1a1]; 32 | self.rowArchiveText = [NSColor colorWithHexRGB:0xd33682]; 33 | 34 | //selected row text color set 35 | self.rowDefaultSelectedText = [NSColor colorWithHexRGB:0xcb4b16]; 36 | self.rowDirectorySelectedText = [NSColor colorWithHexRGB:0x268bd2]; 37 | self.rowHiddenSelectedText = [NSColor colorWithHexRGB:0x93a1a1]; 38 | self.rowArchiveSelectedText = [NSColor colorWithHexRGB:0xd33682]; 39 | 40 | //highlighted row text color set 41 | self.rowDefaultHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 42 | self.rowDirectoryHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 43 | self.rowHiddenHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 44 | self.rowArchiveHighlightText = [NSColor colorWithHexRGB:0xfdf6e3]; 45 | self.rowHighlightTextShadow = [NSColor colorWithHexRGB:0x060b62]; 46 | } 47 | 48 | return self; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeSublime.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeSublime.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 29.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMTheme.h" 11 | 12 | @interface FMThemeSublime : FMTheme 13 | 14 | - (id)init; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FastCommander/src/FMThemeSublime.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMThemeSublime.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 29.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMThemeSublime.h" 10 | #import "NSColor+Hex.h" 11 | 12 | @implementation FMThemeSublime 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | 18 | if (self) 19 | { 20 | self.themeName = @"Sublime"; 21 | 22 | self.listBackground = [NSColor colorWithHexRGB:0x272823]; 23 | self.listHighlightedRow = [NSColor colorWithHexRGB:0xffe792]; 24 | self.listSelectedRow = [NSColor colorWithHexRGB:0x383730]; 25 | self.iconSelectedRow = [NSColor colorWithHexRGB:0xfd9720]; 26 | self.iconSelectedRowInv = [NSColor colorWithHexRGB:0x272823]; 27 | 28 | //default row text color set 29 | self.rowDefaultText = [NSColor colorWithHexRGB:0x8f908a]; 30 | self.rowDirectoryText = [NSColor colorWithHexRGB:0xf8f8f2]; 31 | self.rowHiddenText = [NSColor colorWithHexRGB:0x75715c]; 32 | self.rowArchiveText = [NSColor colorWithHexRGB:0xfd9720]; 33 | 34 | //selected row text color set 35 | self.rowDefaultSelectedText = [NSColor colorWithHexRGB:0xe6db74]; 36 | self.rowDirectorySelectedText = [NSColor colorWithHexRGB:0x66d9e7]; 37 | self.rowHiddenSelectedText = [NSColor colorWithHexRGB:0xf9285d]; 38 | self.rowArchiveSelectedText = [NSColor colorWithHexRGB:0xa6de28]; 39 | 40 | //highlighted row text color set 41 | self.rowDefaultHighlightText = [NSColor colorWithHexRGB:0x000000];; 42 | self.rowDirectoryHighlightText = [NSColor colorWithHexRGB:0x000000]; 43 | self.rowHiddenHighlightText = [NSColor colorWithHexRGB:0x000000]; 44 | self.rowArchiveHighlightText = [NSColor colorWithHexRGB:0x000000]; 45 | self.rowHighlightTextShadow = [NSColor colorWithHexRGB:0xaf9732]; 46 | } 47 | 48 | return self; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /FastCommander/src/FMWorkDirectory.h: -------------------------------------------------------------------------------- 1 | // 2 | // WorkDirectory.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 24.03.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMPanelListItem.h" 11 | 12 | @interface FMWorkDirectory : NSObject 13 | 14 | @property NSURL *directory; 15 | @property NSError *error; 16 | 17 | - (NSDirectoryEnumerationOptions)getOptions; 18 | 19 | - (id)initWithDirectory:(NSString *)value; 20 | - (void)setWorkDirectory:(NSString *)value; 21 | - (NSArray *)loadUrlItems; 22 | 23 | - (NSString *)getUpDirectoryName; 24 | - (NSURL *)getUpDirectory; 25 | - (NSURL *)getDownDirectory:(NSString *)value; 26 | 27 | + (BOOL)isRootDirectory:(NSString *)path; 28 | + (BOOL)isLocalDirectory:(NSString *)path; 29 | + (BOOL)isPathAccessible:(NSString *)path; 30 | + (NSString *)getPreviousName:(NSString *)previousPath currPath:(NSString *)currentPath; 31 | 32 | + (NSArray *)getMountedVolumes; 33 | 34 | + (NSURL *)getUserDirectory; 35 | + (NSURL *)getUsersDirectory; 36 | + (NSURL *)getDocumentsDirectory; 37 | + (NSURL *)getDownloadsDirectory; 38 | + (NSURL *)getPublicDirectory; 39 | + (NSURL *)getDesktopDirectory; 40 | + (NSURL *)getMoviesDirectory; 41 | + (NSURL *)getMusicDirectory; 42 | + (NSURL *)getPicturesDirectory; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /FastCommander/src/FMZipPanelListProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMZipPanelListProvider.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 26.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "FMPanelListProvider.h" 10 | 11 | @interface FMZipPanelListProvider : FMPanelListProvider 12 | 13 | - (id)init; 14 | 15 | - (void)reset; 16 | 17 | - (BOOL)isPathValid:(NSString *)path; 18 | - (void)reload; 19 | - (void)reload:(NSString *)path; 20 | - (BOOL)isLoadingData; 21 | 22 | - (NSString *)getNameToSelect; 23 | - (NSString *)getInitNameToSelect; 24 | - (NSString *)getParentDirectory; 25 | 26 | - (NSString *)getVolumeNameForPath:(NSString *)path; 27 | - (NSNumber *)getVolumeTotalSizeForPath:(NSString *)path; 28 | - (NSNumber *)getVolumeAvailableSizeForPath:(NSString *)path; 29 | 30 | - (void)addFileItemsTo:(NSMutableArray *)fileItems fromDirectoryItem:(FMPanelListItem *)listItem forOperation:(FMFileOperation *)fileOperation andTestBlock:(OnTestFileItem)onTestFileItem; 31 | - (void)validateFileItems:(NSMutableArray *)fileItems forOperation:(FMFileOperation *)fileOperation; 32 | - (int)filesCountForPath:(NSString *)directoryPath; 33 | 34 | - (NSInputStream *)getInputStream:(NSString *)filePath; 35 | - (NSOutputStream *)getOutputStream:(NSString *)filePath; 36 | 37 | - (NSString *)getTargetFileName:(FMFileItem *)fileItem withTargetPath:(NSString *)targetPath; 38 | - (NSString *)getRelativeTargetFileName:(FMFileItem *)fileItem withTargetPath:(NSString *)targetPath; 39 | 40 | - (FMFileItem *)fileNameToFileItem:(NSString *)filePath; 41 | 42 | - (BOOL)removeFile:(NSString *)filePath; 43 | - (BOOL)fileExists:(NSString *)filePath; 44 | - (BOOL)directoryExists:(NSString *)directoryPath; 45 | - (BOOL)removeDirectory:(NSString *)filePath; 46 | - (BOOL)createDirectory:(NSString *)filePath; 47 | - (BOOL)renameFile:(NSString *)oldFilePath to:(NSString *)newFilePath; 48 | - (BOOL)moveFile:(NSString *)oldFilePath to:(NSString *)newFilePath error:(NSError **)error; 49 | 50 | - (NSUInteger)posixPermissionsForPath:(NSString *)filePath; 51 | - (BOOL)setPosixPermissions:(NSUInteger)permissions forPath:(NSString *)filePath; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /FastCommander/src/NSColor+Hex.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSColor.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 15.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSColor (Hex) 12 | 13 | + (NSColor *)colorWithHexRGB:(unsigned int)value; 14 | 15 | - (NSString *)hexValue; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FastCommander/src/NSColor+Hex.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSColor.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 15.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "NSColor+Hex.h" 10 | 11 | @implementation NSColor (Hex) 12 | 13 | + (NSColor *)colorWithHexRGB:(unsigned int)value 14 | { 15 | unsigned int byteR = (value & 0x00ff0000) >> 16; 16 | unsigned int byteG = (value & 0x0000ff00) >> 8; 17 | unsigned int byteB = (value & 0x000000ff); 18 | 19 | float valueR = (float)byteR / (float)255; 20 | float valueG = (float)byteG / (float)255; 21 | float valueB = (float)byteB / (float)255; 22 | 23 | return [NSColor colorWithDeviceRed:valueR green:valueG blue:valueB alpha:1.0]; 24 | } 25 | 26 | - (NSString *)hexValue 27 | { 28 | NSColor *rgbColor = [self colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; 29 | 30 | if (rgbColor == nil) 31 | { 32 | return nil; 33 | } 34 | 35 | double floatR; 36 | double floatG; 37 | double floatB; 38 | 39 | [rgbColor getRed:&floatR green:&floatG blue:&floatB alpha:NULL]; 40 | 41 | int intR; 42 | int intG; 43 | int intB; 44 | 45 | intR = floatR*255.99999f; 46 | intG = floatG*255.99999f; 47 | intB = floatB*255.99999f; 48 | 49 | NSString *hexR; 50 | NSString *hexG; 51 | NSString *hexB; 52 | 53 | hexR = [NSString stringWithFormat:@"%02x", intR]; 54 | hexG = [NSString stringWithFormat:@"%02x", intG]; 55 | hexB = [NSString stringWithFormat:@"%02x", intB]; 56 | 57 | return [NSString stringWithFormat:@"#%@%@%@", hexR, hexG, hexB]; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /FastCommander/src/NSPanelTextFieldCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSPanelTextFieldCell.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 15.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMFilesTableView.h" 11 | 12 | @interface NSPanelTextFieldCell : NSTextFieldCell 13 | 14 | @property (weak) FMFilesTableView *tableView; 15 | 16 | - (id)init; 17 | - (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FastCommander/src/NSPanelTextFieldCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSPanelTextFieldCell.m 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 15.05.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import "NSPanelTextFieldCell.h" 10 | 11 | @implementation NSPanelTextFieldCell 12 | 13 | @synthesize tableView; 14 | 15 | - (id)init 16 | { 17 | self = [super init]; 18 | 19 | if (self) 20 | { 21 | } 22 | 23 | return self; 24 | } 25 | 26 | - (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView 27 | { 28 | return nil; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /FastCommander/src/NSString+Utils.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+NSString.h 3 | // FastCommander 4 | // 5 | // Created by Piotr Zagawa on 10.06.2013. 6 | // Copyright (c) 2013 Piotr Zagawa. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (Utils) 12 | 13 | - (NSString *)stringByDeletingSlashPrefix; 14 | - (NSString *)stringByDeletingSlashSuffix; 15 | 16 | - (NSString *)stringByAppendingSlashPrefix; 17 | - (NSString *)stringByAppendingSlashSuffix; 18 | 19 | - (NSString *)pathExtensionLowerCase; 20 | 21 | + (NSArray *)getStringEncodingArray; 22 | + (NSArray *)getStringEncodingNamesArray; 23 | + (NSStringEncoding)encodingFromName:(NSString *)name; 24 | + (NSString *)nameFromEncoding:(NSStringEncoding)value; 25 | 26 | - (BOOL)isValidEmail; 27 | - (NSString *)trim; 28 | 29 | //custom date time format: "yyyy-MM-dd HH:mm:ss" 30 | + (NSString *)textValueFromDate:(NSDate *)date; 31 | - (NSDate *)dateFromTextValue; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZArchiveEntryWriter.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZZipEntryWriter.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 6/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZZChannelOutput; 12 | 13 | @protocol ZZArchiveEntryWriter 14 | 15 | - (uint32_t)offsetToLocalFileEnd; 16 | - (BOOL)writeLocalFileToChannelOutput:(id)channelOutput 17 | error:(NSError**)error; 18 | - (BOOL)writeCentralFileHeaderToChannelOutput:(id)channelOutput 19 | error:(NSError**)error; 20 | @end 21 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZChannel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZChannel.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @protocol ZZChannelOutput; 12 | 13 | @protocol ZZChannel 14 | 15 | @property (readonly, nonatomic) NSURL* URL; 16 | 17 | - (instancetype)temporaryChannel:(NSError**)error; 18 | - (BOOL)replaceWithChannel:(id)channel 19 | error:(NSError**)error; 20 | - (void)removeAsTemporary; 21 | 22 | - (NSData*)openInput:(NSError**)error; 23 | - (id)openOutputWithOffsetBias:(uint32_t)offsetBias 24 | error:(NSError**)error; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZChannelOutput.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZChannelOutput.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @protocol ZZChannelOutput 12 | 13 | - (uint32_t)offset; 14 | - (BOOL)seekToOffset:(uint32_t)offset 15 | error:(NSError**)error; 16 | 17 | - (BOOL)writeData:(NSData*)data 18 | error:(NSError**)error; 19 | - (BOOL)truncateAtOffset:(uint32_t)offset 20 | error:(NSError**)error; 21 | - (void)close; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZDataChannel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZDataChannel.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | #import "ZZChannel.h" 12 | 13 | @interface ZZDataChannel : NSObject 14 | 15 | @property (readonly, nonatomic) NSURL* URL; 16 | 17 | - (id)initWithData:(NSData*)data; 18 | 19 | - (instancetype)temporaryChannel:(NSError**)error; 20 | - (BOOL)replaceWithChannel:(id)channel 21 | error:(NSError**)error; 22 | - (void)removeAsTemporary; 23 | 24 | - (NSData*)openInput:(NSError**)error; 25 | - (id)openOutputWithOffsetBias:(uint32_t)offsetBias 26 | error:(NSError**)error; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZDataChannel.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZZDataChannel.m 3 | // zipzap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // 7 | // 8 | 9 | #import "ZZDataChannel.h" 10 | #import "ZZDataChannelOutput.h" 11 | 12 | @implementation ZZDataChannel 13 | { 14 | NSData* _allData; 15 | } 16 | 17 | - (id)initWithData:(NSData*)data 18 | { 19 | if ((self = [super init])) 20 | _allData = data; 21 | return self; 22 | } 23 | 24 | - (NSURL*)URL 25 | { 26 | return nil; 27 | } 28 | 29 | - (instancetype)temporaryChannel:(NSError**)error 30 | { 31 | return [[ZZDataChannel alloc] initWithData:[NSMutableData data]]; 32 | } 33 | 34 | - (BOOL)replaceWithChannel:(id)channel 35 | error:(NSError**)error 36 | { 37 | [(NSMutableData*)_allData setData:((ZZDataChannel*)channel)->_allData]; 38 | return YES; 39 | } 40 | 41 | - (void)removeAsTemporary 42 | { 43 | _allData = nil; 44 | } 45 | 46 | - (NSData*)openInput:(NSError**)error 47 | { 48 | return _allData; 49 | } 50 | 51 | - (id)openOutputWithOffsetBias:(uint32_t)offsetBias 52 | error:(NSError**)error 53 | { 54 | return [[ZZDataChannelOutput alloc] initWithData:(NSMutableData*)_allData 55 | offsetBias:offsetBias]; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZDataChannelOutput.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZDataChannelOutput.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | #import "ZZChannelOutput.h" 12 | 13 | @interface ZZDataChannelOutput : NSObject 14 | 15 | - (id)initWithData:(NSMutableData*)data 16 | offsetBias:(uint32_t)offsetBias; 17 | 18 | - (uint32_t)offset; 19 | - (BOOL)seekToOffset:(uint32_t)offset 20 | error:(NSError**)error; 21 | 22 | - (BOOL)writeData:(NSData*)data 23 | error:(NSError**)error; 24 | - (BOOL)truncateAtOffset:(uint32_t)offset 25 | error:(NSError**)error; 26 | - (void)close; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZDataChannelOutput.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZZDataChannelOutput.m 3 | // zipzap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // 7 | // 8 | 9 | #import "ZZDataChannelOutput.h" 10 | 11 | @implementation ZZDataChannelOutput 12 | { 13 | NSMutableData* _allData; 14 | uint32_t _offsetBias; 15 | uint32_t _offset; 16 | } 17 | 18 | - (id)initWithData:(NSMutableData*)data 19 | offsetBias:(uint32_t)offsetBias 20 | { 21 | if ((self = [super init])) 22 | { 23 | _allData = data; 24 | _offsetBias = offsetBias; 25 | _offset = 0U; 26 | } 27 | return self; 28 | } 29 | 30 | - (uint32_t)offset 31 | { 32 | return _offset + _offsetBias; 33 | } 34 | 35 | - (BOOL)seekToOffset:(uint32_t)offset 36 | error:(NSError**)error 37 | { 38 | _offset = offset - _offsetBias; 39 | return YES; 40 | } 41 | 42 | - (BOOL)writeData:(NSData*)data 43 | error:(NSError**)error 44 | { 45 | NSUInteger allDataLength = _allData.length; 46 | NSUInteger dataLength = data.length; 47 | uint32_t newOffset = _offset + (uint32_t)dataLength; 48 | 49 | if (_offset == allDataLength) 50 | // write at the end: just append 51 | [_allData appendData:data]; 52 | else 53 | { 54 | // write in the middle: ensure enough space and copy over bytes 55 | if (allDataLength < newOffset) 56 | _allData.length = newOffset; 57 | memcpy(_allData.mutableBytes + _offset, data.bytes, dataLength); 58 | } 59 | 60 | _offset = newOffset; 61 | return YES; 62 | } 63 | 64 | - (BOOL)truncateAtOffset:(uint32_t)offset 65 | error:(NSError**)error 66 | { 67 | _allData.length = offset; 68 | return YES; 69 | } 70 | 71 | - (void)close 72 | { 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZDeflateOutputStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZDeflateOutputStream.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 9/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZZChannelOutput; 12 | 13 | @interface ZZDeflateOutputStream : NSOutputStream 14 | 15 | @property (readonly, nonatomic) uint32_t crc32; 16 | @property (readonly, nonatomic) uint32_t compressedSize; 17 | @property (readonly, nonatomic) uint32_t uncompressedSize; 18 | 19 | - (id)initWithChannelOutput:(id)channelOutput 20 | compressionLevel:(NSUInteger)compressionLevel; 21 | 22 | - (NSStreamStatus)streamStatus; 23 | - (NSError*)streamError; 24 | 25 | - (void)open; 26 | - (void)close; 27 | 28 | - (NSInteger)write:(const uint8_t*)buffer maxLength:(NSUInteger)length; 29 | - (BOOL)hasSpaceAvailable; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZError.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZError.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 25/01/13. 6 | // Copyright (c) 2013, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | // 10 | // Redistribution and use in source and binary forms, with or without modification, 11 | // are permitted provided that the following conditions are met: 12 | // 13 | // * Redistributions of source code must retain the above copyright notice, 14 | // this list of conditions and the following disclaimer. 15 | // 16 | // * Redistributions in binary form must reproduce the above copyright notice, 17 | // this list of conditions and the following disclaimer in the documentation 18 | // and/or other materials provided with the distribution. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 24 | // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 25 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 | // THE POSSIBILITY OF SUCH DAMAGE. 31 | // 32 | 33 | #import 34 | 35 | extern NSString* const ZZErrorDomain; 36 | 37 | extern NSString* const ZZEntryIndexKey; 38 | 39 | typedef enum 40 | { 41 | ZZOpenReadErrorCode, 42 | ZZEndOfCentralDirectoryReadErrorCode, 43 | ZZCentralFileHeaderReadErrorCode, 44 | ZZLocalFileReadErrorCode, 45 | ZZOpenWriteErrorCode, 46 | ZZLocalFileWriteErrorCode, 47 | ZZCentralFileHeaderWriteErrorCode, 48 | ZZEndOfCentralDirectoryWriteErrorCode, 49 | ZZReplaceWriteErrorCode 50 | } ZZErrorCode; 51 | 52 | static inline BOOL ZZRaiseError(NSError** error, ZZErrorCode errorCode, NSDictionary* userInfo) 53 | { 54 | if (error) 55 | *error = [NSError errorWithDomain:ZZErrorDomain 56 | code:errorCode 57 | userInfo:userInfo]; 58 | return NO; 59 | } 60 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZError.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZZError.m 3 | // zipzap 4 | // 5 | // Created by Glen Low on 25/01/13. 6 | // 7 | // 8 | 9 | #import "ZZError.h" 10 | 11 | NSString* const ZZErrorDomain = @"com.pixelglow.zipzap"; 12 | 13 | NSString* const ZZEntryIndexKey = @"ZZEntryIndexKey"; 14 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZFileChannel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZFileChannel.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | #import "ZZChannel.h" 12 | 13 | @interface ZZFileChannel : NSObject 14 | 15 | @property (readonly, nonatomic) NSURL* URL; 16 | 17 | - (id)initWithURL:(NSURL*)URL; 18 | 19 | - (instancetype)temporaryChannel:(NSError**)error; 20 | - (BOOL)replaceWithChannel:(id)channel 21 | error:(NSError**)error; 22 | - (void)removeAsTemporary; 23 | 24 | - (NSData*)openInput:(NSError**)error; 25 | - (id)openOutputWithOffsetBias:(uint32_t)offsetBias 26 | error:(NSError**)error; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZFileChannel.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZZFileChannel.m 3 | // zipzap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // 7 | // 8 | 9 | #import "ZZError.h" 10 | #import "ZZFileChannel.h" 11 | #import "ZZFileChannelOutput.h" 12 | 13 | @implementation ZZFileChannel 14 | { 15 | NSURL* _URL; 16 | } 17 | 18 | - (id)initWithURL:(NSURL*)URL 19 | { 20 | if ((self = [super init])) 21 | _URL = URL; 22 | return self; 23 | } 24 | 25 | - (NSURL*)URL 26 | { 27 | return _URL; 28 | } 29 | 30 | - (instancetype)temporaryChannel:(NSError**)error 31 | { 32 | NSURL* temporaryDirectory = [[NSFileManager defaultManager] URLForDirectory:NSItemReplacementDirectory 33 | inDomain:NSUserDomainMask 34 | appropriateForURL:_URL 35 | create:NO 36 | error:error]; 37 | 38 | return temporaryDirectory ? [[ZZFileChannel alloc] initWithURL:[temporaryDirectory URLByAppendingPathComponent:_URL.lastPathComponent]] : nil; 39 | } 40 | 41 | - (BOOL)replaceWithChannel:(id)channel 42 | error:(NSError**)error 43 | { 44 | NSURL* __autoreleasing resultingURL; 45 | return [[NSFileManager defaultManager] replaceItemAtURL:_URL 46 | withItemAtURL:channel.URL 47 | backupItemName:nil 48 | options:0 49 | resultingItemURL:&resultingURL 50 | error:error]; 51 | } 52 | 53 | - (void)removeAsTemporary 54 | { 55 | [[NSFileManager defaultManager] removeItemAtURL:[_URL URLByDeletingLastPathComponent] 56 | error:nil]; 57 | } 58 | 59 | - (NSData*)openInput:(NSError**)error 60 | { 61 | return [NSData dataWithContentsOfURL:_URL 62 | options:NSDataReadingMappedAlways 63 | error:error]; 64 | } 65 | 66 | - (id)openOutputWithOffsetBias:(uint32_t)offsetBias 67 | error:(NSError**)error 68 | { 69 | int fileDescriptor = open(_URL.path.fileSystemRepresentation, 70 | O_WRONLY | O_CREAT, 71 | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); 72 | if (fileDescriptor == -1) 73 | { 74 | if (error) 75 | *error = [NSError errorWithDomain:NSPOSIXErrorDomain 76 | code:errno 77 | userInfo:nil]; 78 | return nil; 79 | } 80 | else 81 | return [[ZZFileChannelOutput alloc] initWithFileDescriptor:fileDescriptor 82 | offsetBias:offsetBias]; 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZFileChannelOutput.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZFileChannelOutput.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | #import "ZZChannelOutput.h" 12 | 13 | @interface ZZFileChannelOutput : NSObject 14 | 15 | @property (nonatomic) uint32_t offset; 16 | 17 | - (id)initWithFileDescriptor:(int)fileDescriptor 18 | offsetBias:(uint32_t)offsetBias; 19 | 20 | - (uint32_t)offset; 21 | - (BOOL)seekToOffset:(uint32_t)offset 22 | error:(NSError**)error; 23 | 24 | - (BOOL)writeData:(NSData*)data 25 | error:(NSError**)error; 26 | - (BOOL)truncateAtOffset:(uint32_t)offset 27 | error:(NSError**)error; 28 | 29 | - (void)close; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZFileChannelOutput.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZZFileChannelOutput.m 3 | // zipzap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // 7 | // 8 | 9 | #import "ZZFileChannelOutput.h" 10 | 11 | @implementation ZZFileChannelOutput 12 | { 13 | int _fileDescriptor; 14 | uint32_t _offsetBias; 15 | } 16 | 17 | - (id)initWithFileDescriptor:(int)fileDescriptor 18 | offsetBias:(uint32_t)offsetBias 19 | { 20 | if ((self = [super init])) 21 | { 22 | _fileDescriptor = fileDescriptor; 23 | _offsetBias = offsetBias; 24 | } 25 | return self; 26 | } 27 | 28 | - (uint32_t)offset 29 | { 30 | return (uint32_t)lseek(_fileDescriptor, 0, SEEK_CUR) + _offsetBias; 31 | } 32 | 33 | - (BOOL)seekToOffset:(uint32_t)offset 34 | error:(NSError**)error 35 | { 36 | if (lseek(_fileDescriptor, offset - _offsetBias, SEEK_SET) == -1) 37 | { 38 | if (error) 39 | *error = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:nil]; 40 | return NO; 41 | } 42 | else 43 | return YES; 44 | } 45 | 46 | - (BOOL)writeData:(NSData*)data 47 | error:(NSError**)error 48 | { 49 | if (write(_fileDescriptor, data.bytes, data.length) == -1) 50 | { 51 | if (error) 52 | *error = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:nil]; 53 | return NO; 54 | } 55 | else 56 | return YES; 57 | 58 | } 59 | 60 | - (BOOL)truncateAtOffset:(uint32_t)offset 61 | error:(NSError**)error 62 | { 63 | if (ftruncate(_fileDescriptor, offset) == -1) 64 | { 65 | if (error) 66 | *error = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:nil]; 67 | return NO; 68 | } 69 | else 70 | return YES; 71 | } 72 | 73 | - (void)close 74 | { 75 | close(_fileDescriptor); 76 | } 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZInflateInputStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZInflateInputStream.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 29/09/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZZInflateInputStream : NSInputStream 12 | 13 | - (id)initWithData:(NSData*)data; 14 | 15 | - (void)open; 16 | - (void)close; 17 | 18 | - (NSInteger)read:(uint8_t*)buffer maxLength:(NSUInteger)len; 19 | - (BOOL)getBuffer:(uint8_t**)buffer length:(NSUInteger*)len; 20 | - (BOOL)hasBytesAvailable; 21 | 22 | - (void)rewind; 23 | - (off_t)skipForward:(off_t)count; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZNewArchiveEntry.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZNewArchiveEntry.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 8/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 10 | #include 11 | #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 12 | #include 13 | #endif 14 | 15 | #import 16 | 17 | #import "ZZArchiveEntry.h" 18 | 19 | @interface ZZNewArchiveEntry : ZZArchiveEntry 20 | 21 | @property (readonly, nonatomic) BOOL compressed; 22 | @property (readonly, nonatomic) NSDate* lastModified; 23 | @property (readonly, nonatomic) mode_t fileMode; 24 | @property (readonly, nonatomic) NSString* fileName; 25 | 26 | - (id)initWithFileName:(NSString*)fileName 27 | fileMode:(mode_t)fileMode 28 | lastModified:(NSDate*)lastModified 29 | compressionLevel:(NSInteger)compressionLevel 30 | dataBlock:(NSData*(^)(NSError** error))dataBlock 31 | streamBlock:(BOOL(^)(NSOutputStream* stream, NSError** error))streamBlock 32 | dataConsumerBlock:(BOOL(^)(CGDataConsumerRef dataConsumer, NSError** error))dataConsumerBlock; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZNewArchiveEntry.mm: -------------------------------------------------------------------------------- 1 | // 2 | // ZZNewArchiveEntry.m 3 | // zipzap 4 | // 5 | // Created by Glen Low on 8/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import "ZZNewArchiveEntry.h" 10 | #import "ZZNewArchiveEntryWriter.h" 11 | 12 | @implementation ZZNewArchiveEntry 13 | { 14 | NSString* _fileName; 15 | mode_t _fileMode; 16 | NSDate* _lastModified; 17 | NSInteger _compressionLevel; 18 | NSData* (^_dataBlock)(NSError** error); 19 | BOOL (^_streamBlock)(NSOutputStream* stream, NSError** error); 20 | BOOL (^_dataConsumerBlock)(CGDataConsumerRef dataConsumer, NSError** error); 21 | } 22 | 23 | - (id)initWithFileName:(NSString*)fileName 24 | fileMode:(mode_t)fileMode 25 | lastModified:(NSDate*)lastModified 26 | compressionLevel:(NSInteger)compressionLevel 27 | dataBlock:(NSData*(^)(NSError** error))dataBlock 28 | streamBlock:(BOOL(^)(NSOutputStream* stream, NSError** error))streamBlock 29 | dataConsumerBlock:(BOOL(^)(CGDataConsumerRef dataConsumer, NSError** error))dataConsumerBlock; 30 | { 31 | if ((self = [super init])) 32 | { 33 | _fileName = fileName; 34 | _fileMode = fileMode; 35 | _lastModified = lastModified; 36 | _compressionLevel = compressionLevel; 37 | _dataBlock = dataBlock; 38 | _streamBlock = streamBlock; 39 | _dataConsumerBlock = dataConsumerBlock; 40 | } 41 | return self; 42 | } 43 | 44 | - (BOOL)compressed 45 | { 46 | return _compressionLevel != 0; 47 | } 48 | 49 | - (NSDate*)lastModified 50 | { 51 | return _lastModified; 52 | } 53 | 54 | - (mode_t)fileMode 55 | { 56 | return _fileMode; 57 | } 58 | 59 | - (NSString*)fileName 60 | { 61 | return _fileName; 62 | } 63 | 64 | - (id)writerCanSkipLocalFile:(BOOL)canSkipLocalFile 65 | { 66 | return [[ZZNewArchiveEntryWriter alloc] initWithFileName:_fileName 67 | fileMode:_fileMode 68 | lastModified:_lastModified 69 | compressionLevel:_compressionLevel 70 | dataBlock:_dataBlock 71 | streamBlock:_streamBlock 72 | dataConsumerBlock:_dataConsumerBlock]; 73 | } 74 | 75 | @end 76 | 77 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZNewArchiveEntryWriter.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZNewArchiveEntryWriter.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 9/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ZZArchiveEntryWriter.h" 12 | 13 | @interface ZZNewArchiveEntryWriter : NSObject 14 | 15 | - (id)initWithFileName:(NSString*)fileName 16 | fileMode:(mode_t)fileMode 17 | lastModified:(NSDate*)lastModified 18 | compressionLevel:(NSInteger)compressionLevel 19 | dataBlock:(NSData*(^)(NSError** error))dataBlock 20 | streamBlock:(BOOL(^)(NSOutputStream* stream, NSError** error))streamBlock 21 | dataConsumerBlock:(BOOL(^)(CGDataConsumerRef dataConsumer, NSError** error))dataConsumerBlock; 22 | 23 | - (uint32_t)offsetToLocalFileEnd; 24 | - (BOOL)writeLocalFileToChannelOutput:(id)channelOutput 25 | error:(NSError**)error; 26 | - (BOOL)writeCentralFileHeaderToChannelOutput:(id)channelOutput 27 | error:(NSError**)error; 28 | 29 | @end 30 | 31 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZOldArchiveEntry.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZOldArchiveEntry.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 24/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | // 9 | 10 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 11 | #include 12 | #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 13 | #include 14 | #endif 15 | 16 | #import 17 | 18 | #import "ZZArchiveEntry.h" 19 | 20 | @interface ZZOldArchiveEntry : ZZArchiveEntry 21 | 22 | @property (readonly, nonatomic) BOOL compressed; 23 | @property (readonly, nonatomic) NSDate* lastModified; 24 | @property (readonly, nonatomic) NSUInteger crc32; 25 | @property (readonly, nonatomic) NSUInteger compressedSize; 26 | @property (readonly, nonatomic) NSUInteger uncompressedSize; 27 | @property (readonly, nonatomic) mode_t fileMode; 28 | @property (readonly, nonatomic) NSString* fileName; 29 | 30 | - (id)initWithCentralFileHeader:(struct ZZCentralFileHeader*)centralFileHeader 31 | localFileHeader:(struct ZZLocalFileHeader*)localFileHeader 32 | encoding:(NSStringEncoding)encoding; 33 | 34 | - (BOOL)check:(NSError **)error; 35 | 36 | - (NSInputStream*)stream; 37 | - (NSData*)data; 38 | - (CGDataProviderRef)newDataProvider; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZOldArchiveEntryWriter.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZOldArchiveEntryWriter.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 9/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ZZArchiveEntryWriter.h" 12 | 13 | @interface ZZOldArchiveEntryWriter : NSObject 14 | 15 | - (id)initWithCentralFileHeader:(struct ZZCentralFileHeader*)centralFileHeader 16 | localFileHeader:(struct ZZLocalFileHeader*)localFileHeader 17 | shouldSkipLocalFile:(BOOL)shouldSkipLocalFile; 18 | 19 | - (uint32_t)offsetToLocalFileEnd; 20 | - (BOOL)writeLocalFileToChannelOutput:(id)channelOutput 21 | error:(NSError**)error; 22 | - (BOOL)writeCentralFileHeaderToChannelOutput:(id)channelOutput 23 | error:(NSError**)error; 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZOldArchiveEntryWriter.mm: -------------------------------------------------------------------------------- 1 | // 2 | // ZZZipEntryWriter.m 3 | // zipzap 4 | // 5 | // Created by Glen Low on 9/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import "ZZChannelOutput.h" 10 | #import "ZZOldArchiveEntryWriter.h" 11 | #import "ZZHeaders.h" 12 | 13 | @interface ZZOldArchiveEntryWriter () 14 | 15 | - (ZZCentralFileHeader*)centralFileHeader; 16 | 17 | @end; 18 | 19 | @implementation ZZOldArchiveEntryWriter 20 | { 21 | NSMutableData* _centralFileHeader; 22 | uint32_t _localFileLength; 23 | NSData* _localFile; 24 | } 25 | 26 | - (id)initWithCentralFileHeader:(struct ZZCentralFileHeader*)centralFileHeader 27 | localFileHeader:(struct ZZLocalFileHeader*)localFileHeader 28 | shouldSkipLocalFile:(BOOL)shouldSkipLocalFile 29 | { 30 | if ((self = [super init])) 31 | { 32 | // copy the central header bytes 33 | _centralFileHeader = [NSMutableData dataWithBytes:centralFileHeader 34 | length:(uint8_t*)centralFileHeader->nextCentralFileHeader() - (uint8_t*)centralFileHeader]; 35 | 36 | _localFileLength = (uint32_t)((const uint8_t*)localFileHeader->nextLocalFileHeader(centralFileHeader->compressedSize) - (const uint8_t*)localFileHeader); 37 | 38 | // if we can skip local file i.e. because this old entry has not changed position in the zip file entries 39 | // don't copy the local file bytes 40 | _localFile = shouldSkipLocalFile ? nil : [NSData dataWithBytes:localFileHeader length:_localFileLength]; 41 | } 42 | return self; 43 | } 44 | 45 | - (ZZCentralFileHeader*)centralFileHeader 46 | { 47 | return (ZZCentralFileHeader*)_centralFileHeader.mutableBytes; 48 | } 49 | 50 | - (uint32_t)offsetToLocalFileEnd 51 | { 52 | if (_localFile) 53 | return 0; 54 | else 55 | return [self centralFileHeader]->relativeOffsetOfLocalHeader + _localFileLength; 56 | } 57 | 58 | - (BOOL)writeLocalFileToChannelOutput:(id)channelOutput 59 | error:(NSError**)error 60 | { 61 | if (_localFile) 62 | { 63 | // can't skip: save the offset, then write out the local file bytes 64 | [self centralFileHeader]->relativeOffsetOfLocalHeader = [channelOutput offset]; 65 | return [channelOutput writeData:_localFile 66 | error:error]; 67 | } 68 | else 69 | return YES; 70 | } 71 | 72 | - (BOOL)writeCentralFileHeaderToChannelOutput:(id)channelOutput 73 | error:(NSError**)error 74 | { 75 | return [channelOutput writeData:_centralFileHeader 76 | error:error]; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZStoreOutputStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZStoreOutputStream.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 13/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZZChannelOutput; 12 | 13 | @interface ZZStoreOutputStream : NSOutputStream 14 | 15 | @property (readonly, nonatomic) uint32_t crc32; 16 | @property (readonly, nonatomic) uint32_t size; 17 | 18 | - (id)initWithChannelOutput:(id)channelOutput; 19 | 20 | - (NSStreamStatus)streamStatus; 21 | - (NSError*)streamError; 22 | 23 | - (void)open; 24 | - (void)close; 25 | 26 | - (NSInteger)write:(const uint8_t*)buffer maxLength:(NSUInteger)length; 27 | - (BOOL)hasSpaceAvailable; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/ZZStoreOutputStream.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZZStoreOutputStream.m 3 | // zipzap 4 | // 5 | // Created by Glen Low on 13/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #include 10 | 11 | #import "ZZChannelOutput.h" 12 | #import "ZZStoreOutputStream.h" 13 | 14 | @implementation ZZStoreOutputStream 15 | { 16 | id _channelOutput; 17 | NSStreamStatus _status; 18 | NSError* _error; 19 | uint32_t _crc32; 20 | uint32_t _size; 21 | } 22 | 23 | @synthesize crc32 = _crc32; 24 | @synthesize size = _size; 25 | 26 | - (id)initWithChannelOutput:(id)channelOutput 27 | { 28 | if ((self = [super init])) 29 | { 30 | _channelOutput = channelOutput; 31 | 32 | _status = NSStreamStatusNotOpen; 33 | _error = nil; 34 | _crc32 = 0; 35 | _size = 0; 36 | } 37 | return self; 38 | } 39 | 40 | - (NSStreamStatus)streamStatus 41 | { 42 | return _status; 43 | } 44 | 45 | - (NSError*)streamError 46 | { 47 | return _error; 48 | } 49 | 50 | - (void)open 51 | { 52 | _status = NSStreamStatusOpen; 53 | } 54 | 55 | - (void)close 56 | { 57 | _status = NSStreamStatusClosed; 58 | } 59 | 60 | - (NSInteger)write:(const uint8_t*)buffer maxLength:(NSUInteger)length 61 | { 62 | NSError* __autoreleasing writeError; 63 | if (![_channelOutput writeData:[NSData dataWithBytesNoCopy:(void*)buffer 64 | length:length 65 | freeWhenDone:NO] 66 | error:&writeError]) 67 | { 68 | _status = NSStreamStatusError; 69 | _error = writeError; 70 | return -1; 71 | } 72 | 73 | // accumulate checksum and size from written bytes 74 | _crc32 = (uint32_t)crc32(_crc32, buffer, (uInt)length); 75 | _size += length; 76 | 77 | return length; 78 | } 79 | 80 | - (BOOL)hasSpaceAvailable 81 | { 82 | return YES; 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/zipzap-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'zipzap' target in the 'zipzap' project 3 | // 4 | 5 | #include 6 | 7 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 8 | #include 9 | #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 10 | #include 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /FastCommander/src/zipzap/zipzap.h: -------------------------------------------------------------------------------- 1 | // 2 | // zipzap.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 31/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | // 10 | // Redistribution and use in source and binary forms, with or without modification, 11 | // are permitted provided that the following conditions are met: 12 | // 13 | // * Redistributions of source code must retain the above copyright notice, 14 | // this list of conditions and the following disclaimer. 15 | // 16 | // * Redistributions in binary form must reproduce the above copyright notice, 17 | // this list of conditions and the following disclaimer in the documentation 18 | // and/or other materials provided with the distribution. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 24 | // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 25 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 | // THE POSSIBILITY OF SUCH DAMAGE. 31 | // 32 | 33 | #import "ZZArchive.h" 34 | #import "ZZArchiveEntry.h" 35 | #import "ZZError.h" 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## FastCommander 2 | A a dual panel, native, fast, lightweight file manager for OS X. 3 | 4 | Created in 2013, as a personal learning project for Objective-C and OS X platform. 5 | 6 | ![fc-main-small](https://user-images.githubusercontent.com/3949132/176720148-6eeee502-ca54-4663-8b03-5d03a64eb0e6.png) 7 | ![clean-ui-2](https://user-images.githubusercontent.com/3949132/176720203-4f601123-d019-4b3a-9928-37de717e244f.png) 8 | ![theme-sublime](https://user-images.githubusercontent.com/3949132/176720223-e530ff8b-a597-47af-a2ff-70113af90304.png) 9 | ![theme-norton](https://user-images.githubusercontent.com/3949132/176720261-f625e34b-18c0-45b9-85de-44c968618576.png) 10 | ![theme-blackmesa](https://user-images.githubusercontent.com/3949132/176720275-b348c817-9a85-4215-9eba-434e674fce22.png) 11 | ![theme-solarized-light](https://user-images.githubusercontent.com/3949132/176720300-ec01aa24-9a5a-4e1a-a14d-41b911e2ce51.png) 12 | -------------------------------------------------------------------------------- /gfx-prj/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/icon.icns -------------------------------------------------------------------------------- /gfx-prj/icon.iconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/icon.iconset/icon_128x128.png -------------------------------------------------------------------------------- /gfx-prj/icon.iconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/icon.iconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /gfx-prj/icon.iconset/icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/icon.iconset/icon_16x16.png -------------------------------------------------------------------------------- /gfx-prj/icon.iconset/icon_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/icon.iconset/icon_16x16@2x.png -------------------------------------------------------------------------------- /gfx-prj/icon.iconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/icon.iconset/icon_256x256.png -------------------------------------------------------------------------------- /gfx-prj/icon.iconset/icon_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/icon.iconset/icon_256x256@2x.png -------------------------------------------------------------------------------- /gfx-prj/icon.iconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/icon.iconset/icon_32x32.png -------------------------------------------------------------------------------- /gfx-prj/icon.iconset/icon_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/icon.iconset/icon_32x32@2x.png -------------------------------------------------------------------------------- /gfx-prj/icon.iconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/icon.iconset/icon_512x512.png -------------------------------------------------------------------------------- /gfx-prj/icon.iconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/icon.iconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /gfx-prj/icon_item_selected.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/icon_item_selected.pdf -------------------------------------------------------------------------------- /gfx-prj/main/icon_128.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/main/icon_128.ai -------------------------------------------------------------------------------- /gfx-prj/main/icon_16.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/main/icon_16.ai -------------------------------------------------------------------------------- /gfx-prj/main/icon_256.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/main/icon_256.ai -------------------------------------------------------------------------------- /gfx-prj/main/icon_32.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/main/icon_32.ai -------------------------------------------------------------------------------- /gfx-prj/main/icon_512.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/main/icon_512.ai -------------------------------------------------------------------------------- /gfx-prj/message-icon.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/gfx-prj/message-icon.ai -------------------------------------------------------------------------------- /gfx-prj/toolbar_svg/compress.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /gfx-prj/toolbar_svg/console.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /gfx-prj/toolbar_svg/copy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 10 | 11 | -------------------------------------------------------------------------------- /gfx-prj/toolbar_svg/delete.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /gfx-prj/toolbar_svg/edit.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 10 | 11 | -------------------------------------------------------------------------------- /gfx-prj/toolbar_svg/finder.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /gfx-prj/toolbar_svg/folder.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 10 | 11 | -------------------------------------------------------------------------------- /gfx-prj/toolbar_svg/hidden.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 15 | 16 | -------------------------------------------------------------------------------- /gfx-prj/toolbar_svg/move.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /gfx-prj/toolbar_svg/permissions.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 15 | 16 | -------------------------------------------------------------------------------- /gfx-prj/toolbar_svg/view.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzagawa/FastCommanderCE/06af5c72a4b5856b93fb18faaea689b410a5f7f1/icon.icns -------------------------------------------------------------------------------- /zipzap/LICENSE.text: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Pixelglow Software. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | * 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. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT HOLDER OR CONTRIBUTORS 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. -------------------------------------------------------------------------------- /zipzap/zipzap.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "zipzap" 3 | s.version = "4.0" 4 | s.summary = "zipzap is a zip file I/O library for Mac OS X and iOS." 5 | s.description = <<-DESC 6 | The zip file is an ideal container for compound Objective-C documents. Zip files are widely used and well understood. You can randomly access their parts. The format compresses decently and has extensive operating system and tool support. So we want to make this format an even easier choice for you. Thus, the library features: 7 | 8 | - Easy-to-use interface: The public API offers just three classes! Yet you can look through zip files using familiar NSArray collections and properties. And you can zip, unzip and rezip zip files through familiar NSData, NSStream and Image I/O classes. 9 | - Efficient implementation: We've optimized zip file reading and writing to reduce virtual memory pressure and disk file thrashing. Depending on how your compound document is organized, updating a single entry can be faster than writing the same data to a separate file. 10 | - File format compatibility: Since zipzap closely follows the zip file format specification, it is works with most Mac, Linux and Windows zip tools. 11 | DESC 12 | s.homepage = 'https://github.com/pixelglow/zipzap' 13 | 14 | s.author = 'Pixelglow Software' 15 | s.source = { :git => 'https://github.com/pixelglow/zipzap.git', :tag => '4.0' } 16 | s.license = 'BSD' 17 | 18 | s.platform = :ios, '5.1' 19 | s.source_files = 'Classes', 'zipzap/**/*.{h,m,mm}' 20 | s.public_header_files = 'zipzap/**/*.h' 21 | s.frameworks = 'Foundation' 22 | s.libraries = 'c++', 'z' 23 | s.requires_arc = true 24 | s.xcconfig = { 'OTHER_CPLUSPLUSFLAGS' => '-std=gnu++11 -stdlib=libc++' } 25 | end 26 | -------------------------------------------------------------------------------- /zipzap/zipzapTests/ZZTasks.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZTestUtil.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 19/10/12. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface ZZTasks : NSObject 12 | 13 | + (void)zipFiles:(NSArray*)filePaths toPath:(NSString*)zipPath; 14 | + (BOOL)testZipAtPath:(NSString*)path; 15 | + (NSData*)unzipFile:(NSString*)filePath fromPath:(NSString*)zipPath; 16 | + (NSArray*)zipInfoAtPath:(NSString*)path; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /zipzap/zipzapTests/ZZUnzipTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZUnzipTests.h 3 | // zipzap 4 | // 5 | // Created by Glen Low on 16/10/12. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface ZZUnzipTests : SenTestCase 12 | 13 | - (void)setUp; 14 | - (void)tearDown; 15 | 16 | - (void)testZipEntryMetadata; 17 | - (void)testZipEntryConsistentWithOriginalFile; 18 | - (void)testZipFromDataConsistentWithZipFromURL; 19 | 20 | - (void)testExtractingZipEntryData; 21 | - (void)testExtractingZipEntryStreamInSmallChunks; 22 | - (void)testExtractingZipEntryStreamInLargeChunks; 23 | - (void)testExtractingZipEntryDataProvider; 24 | - (void)testExtractingZipEntryDataProviderImage; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /zipzap/zipzapTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /zipzap/zipzapTests/li-europan-lingues.txt: -------------------------------------------------------------------------------- 1 | Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores. 2 | At solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles. Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent lingues. Li nov lingua franca va esser plu simplic e regulari quam li existent Europan lingues. It va esser tam simplic quam Occidental in fact, it va esser Occidental. A un Angleso it va semblar un simplificat Angles, quam un skeptic Cambridge amico dit me que Occidental es. 3 | -------------------------------------------------------------------------------- /zipzap/zipzapTests/lorem-ipsum.txt: -------------------------------------------------------------------------------- 1 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 2 | -------------------------------------------------------------------------------- /zipzap/zipzapTests/pangram.txt: -------------------------------------------------------------------------------- 1 | The quick brown fox jumped over the lazy dog. 2 | -------------------------------------------------------------------------------- /zipzap/zipzapTests/zipzapTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.pixelglow.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | ZZTestFiles 22 | 23 | li-europan-lingues.txt 24 | lorem-ipsum.txt 25 | pangram.txt 26 | 拉链.txt 27 | dog.png 28 | dog.jpg 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /zipzap/zipzapTests/拉链.txt: -------------------------------------------------------------------------------- 1 | zipper --------------------------------------------------------------------------------