diff --git a/.gitignore b/.gitignore index ef33704..42cb04d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,15 @@ + *.DS_Store + __MACOSX/ *.xcworkspacedata -*.xcuserstate - *.xcscheme -CMIV_CTA_TOOLS/CMIV_CTA_TOOLS.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist - -DefaultDefaults/DefaultDefaults.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist - *.xcbkptlist -HelloWorld/HelloWorld.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist +DiscPublishing/Libs/* + +*.xcuserstate -OSIDemoPlugin/OSIDemoPlugin.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/ASOC/ASOC.h b/ASOC/ASOC.h new file mode 100755 index 0000000..6a8170d --- /dev/null +++ b/ASOC/ASOC.h @@ -0,0 +1,9 @@ +#import + +@interface ASOC : PluginFilter +{ +} + +- (long) filterImage:(NSString*) menuName; + +@end diff --git a/ASOC/ASOC.m b/ASOC/ASOC.m new file mode 100755 index 0000000..2578f52 --- /dev/null +++ b/ASOC/ASOC.m @@ -0,0 +1,40 @@ +#import "ASOC.h" + +#import +@protocol ASOCprotocol +- (void)sayHello;//simple call +- (NSString *)getFinderVersion;//return value +- (void)say:(NSString*)phrase;//call with direct parameter. (the applescript handler with direct parameter is ended by underscore, which shouldn´t be copied into the protocol definition) +@end + +@implementation ASOC + +static Class ASOCclass; +static id ASOCinstance; + +- (void) initPlugin +{ + [[NSBundle bundleForClass:[self class]] loadAppleScriptObjectiveCScripts]; + ASOCclass = NSClassFromString(@"ASOCscript"); + if (!ASOCclass) NSLog(@"INFO [ASOC] ASOCclass not found"); + else + { + [ASOCclass retain]; + ASOCinstance = [[ASOCclass alloc] init]; + if (!ASOCinstance) NSLog(@"INFO [ASOC] ASOCinstance not initialized"); + else NSLog(@"INFO [ASOC] ASOCinstance initialized"); + } +} + +- (long) filterImage:(NSString*) menuName +{ + //calls to the class based in the Applescript + + if ([menuName hasPrefix:@"[a]"]) [ASOCinstance sayHello]; + else if ([menuName hasPrefix:@"[b]"]) NSLog(@"Finder version = %@", [ASOCinstance getFinderVersion]); + else if ([menuName hasPrefix:@"[c]"]) [ASOCinstance say:@"you are a genius"]; + + return 0; // No Errors +} + +@end diff --git a/ASOC/ASOC.xcodeproj/project.pbxproj b/ASOC/ASOC.xcodeproj/project.pbxproj new file mode 100755 index 0000000..2794a37 --- /dev/null +++ b/ASOC/ASOC.xcodeproj/project.pbxproj @@ -0,0 +1,249 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 4A173D1E1590AA5600DD8F17 /* html in Resources */ = {isa = PBXBuildFile; fileRef = 4A173D1D1590AA5600DD8F17 /* html */; }; + 4A173D2E1591676500DD8F17 /* ASOC.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A173D2C1591676500DD8F17 /* ASOC.h */; }; + 4A173D2F1591676500DD8F17 /* ASOC.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A173D2D1591676500DD8F17 /* ASOC.m */; }; + 4A8A872A1771E7A700B3FA10 /* AppleScriptObjC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A8A87291771E7A700B3FA10 /* AppleScriptObjC.framework */; }; + 4A8A87581772154500B3FA10 /* ASOCscript.applescript in Sources */ = {isa = PBXBuildFile; fileRef = 4A8A87571772154500B3FA10 /* ASOCscript.applescript */; }; + 4A8A875C177224F400B3FA10 /* SERunScriptApplicationImage.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 4A8A875B177224F400B3FA10 /* SERunScriptApplicationImage.tiff */; }; + 4A8A876517722B9B00B3FA10 /* OsiriXAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A8A876417722B9B00B3FA10 /* OsiriXAPI.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 4A173D1D1590AA5600DD8F17 /* html */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = html; sourceTree = ""; }; + 4A173D2C1591676500DD8F17 /* ASOC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASOC.h; sourceTree = ""; }; + 4A173D2D1591676500DD8F17 /* ASOC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASOC.m; sourceTree = ""; }; + 4A8A87291771E7A700B3FA10 /* AppleScriptObjC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppleScriptObjC.framework; path = System/Library/Frameworks/AppleScriptObjC.framework; sourceTree = SDKROOT; }; + 4A8A87571772154500B3FA10 /* ASOCscript.applescript */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.applescript; path = ASOCscript.applescript; sourceTree = ""; }; + 4A8A87591772163300B3FA10 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.txt; sourceTree = ""; }; + 4A8A875B177224F400B3FA10 /* SERunScriptApplicationImage.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = SERunScriptApplicationImage.tiff; sourceTree = ""; }; + 4A8A876417722B9B00B3FA10 /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = /Library/Frameworks/OsiriXAPI.framework; sourceTree = ""; }; + 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + AB5D36050680E57E00F4007A /* ASOC.osirixplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ASOC.osirixplugin; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D5B49B3048680CD000E48DA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4A8A876517722B9B00B3FA10 /* OsiriXAPI.framework in Frameworks */, + 4A8A872A1771E7A700B3FA10 /* AppleScriptObjC.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* EpsonCD */ = { + isa = PBXGroup; + children = ( + 4A8A87591772163300B3FA10 /* README.txt */, + 08FB77AFFE84173DC02AAC07 /* Classes */, + 089C167CFE841241C02AAC07 /* Resources */, + 089C1671FE841209C02AAC07 /* Frameworks and Libraries */, + 19C28FB8FE9D52D311CA2CBB /* Products */, + ); + name = EpsonCD; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 4A8A876417722B9B00B3FA10 /* OsiriXAPI.framework */, + 4A8A87291771E7A700B3FA10 /* AppleScriptObjC.framework */, + ); + name = "Frameworks and Libraries"; + sourceTree = ""; + }; + 089C167CFE841241C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + 4A8A875B177224F400B3FA10 /* SERunScriptApplicationImage.tiff */, + 4A8A87571772154500B3FA10 /* ASOCscript.applescript */, + 4A173D1D1590AA5600DD8F17 /* html */, + 8D5B49B7048680CD000E48DA /* Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 08FB77AFFE84173DC02AAC07 /* Classes */ = { + isa = PBXGroup; + children = ( + 4A173D2C1591676500DD8F17 /* ASOC.h */, + 4A173D2D1591676500DD8F17 /* ASOC.m */, + ); + name = Classes; + sourceTree = ""; + }; + 19C28FB8FE9D52D311CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + AB5D36050680E57E00F4007A /* ASOC.osirixplugin */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8D5B49AD048680CD000E48DA /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 4A173D2E1591676500DD8F17 /* ASOC.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8D5B49AC048680CD000E48DA /* ASOC */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE6A9A9008AC841300D0C1EE /* Build configuration list for PBXNativeTarget "ASOC" */; + buildPhases = ( + 8D5B49AD048680CD000E48DA /* Headers */, + 8D5B49AF048680CD000E48DA /* Resources */, + 8D5B49B1048680CD000E48DA /* Sources */, + 8D5B49B3048680CD000E48DA /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ASOC; + productInstallPath = "$(HOME)/Library/Bundles"; + productName = Invert; + productReference = AB5D36050680E57E00F4007A /* ASOC.osirixplugin */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0430; + }; + buildConfigurationList = CE6A9A9408AC841300D0C1EE /* Build configuration list for PBXProject "ASOC" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + en, + ); + mainGroup = 089C166AFE841209C02AAC07 /* EpsonCD */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8D5B49AC048680CD000E48DA /* ASOC */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D5B49AF048680CD000E48DA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4A173D1E1590AA5600DD8F17 /* html in Resources */, + 4A8A875C177224F400B3FA10 /* SERunScriptApplicationImage.tiff in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D5B49B1048680CD000E48DA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4A173D2F1591676500DD8F17 /* ASOC.m in Sources */, + 4A8A87581772154500B3FA10 /* ASOCscript.applescript in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + CE6A9A9308AC841300D0C1EE /* Plugins */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + /Library/Frameworks, + "$(inherited)", + ); + GCC_ENABLE_TRIGRAPHS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_PREFIX_HEADER = ""; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + HEADER_SEARCH_PATHS = ""; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "/Users/jacques/Library/Application Support/OsiriX/Plugins"; + LIBRARY_SEARCH_PATHS = ""; + LIBRARY_STYLE = Bundle; + MACOSX_DEPLOYMENT_TARGET = 10.6; + ONLY_ACTIVE_ARCH = NO; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ( + "-undefined", + dynamic_lookup, + ); + OTHER_REZFLAGS = ""; + PRODUCT_NAME = ASOC; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = osirixplugin; + }; + name = Plugins; + }; + CE6A9A9708AC841300D0C1EE /* Plugins */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALTERNATE_OWNER = OsiriXUser; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CONFIGURATION_BUILD_DIR = "/Users/$(INSTALL_OWNER)/Library/Application Support/OsiriX/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; + MACOSX_DEPLOYMENT_TARGET = 10.7; + ONLY_ACTIVE_ARCH = NO; + SDKROOT = macosx10.7; + SYMROOT = "/Users/$(INSTALL_OWNER)/build"; + VALID_ARCHS = "i386 x86_64"; + }; + name = Plugins; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE6A9A9008AC841300D0C1EE /* Build configuration list for PBXNativeTarget "ASOC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE6A9A9308AC841300D0C1EE /* Plugins */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Plugins; + }; + CE6A9A9408AC841300D0C1EE /* Build configuration list for PBXProject "ASOC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE6A9A9708AC841300D0C1EE /* Plugins */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Plugins; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/KiOP/Plugin/KiOP.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ASOC/ASOC.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 73% rename from KiOP/Plugin/KiOP.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to ASOC/ASOC.xcodeproj/project.xcworkspace/contents.xcworkspacedata index b82adbd..ce490af 100644 --- a/KiOP/Plugin/KiOP.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/ASOC/ASOC.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:ASOC.xcodeproj"> diff --git a/ASOC/ASOCscript.applescript b/ASOC/ASOCscript.applescript new file mode 100755 index 0000000..e495deb --- /dev/null +++ b/ASOC/ASOCscript.applescript @@ -0,0 +1,16 @@ +script ASOCscript + property parent : class "NSObject" + + on sayHello() + say "\"Hello\"" + end sayHello + + on getFinderVersion() + return version of application "Finder" + end getFinderVersion + + on say_(phrase) + say "\"" & phrase & "\"" + end say_ + +end script diff --git a/KiOP/Plugin/English.lproj/locversion.plist b/ASOC/English.lproj/locversion.plist old mode 100644 new mode 100755 similarity index 100% rename from KiOP/Plugin/English.lproj/locversion.plist rename to ASOC/English.lproj/locversion.plist diff --git a/ASOC/Info.plist b/ASOC/Info.plist new file mode 100755 index 0000000..f192191 --- /dev/null +++ b/ASOC/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ASOC + CFBundleIconFile + + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MenuTitles + + [a] sayHello() + [b] FinderVersion() + [c] say(@"You are a genius") + + NSHumanReadableCopyright + jacquesfauquex@gmail.com + NSPrincipalClass + ASOC + ToolbarIcon + SERunScriptApplicationImage.tiff + allowToolbarIcon + YES + pluginType + Database + + diff --git a/ASOC/README.txt b/ASOC/README.txt new file mode 100644 index 0000000..33466d6 --- /dev/null +++ b/ASOC/README.txt @@ -0,0 +1,31 @@ +ASOC (AppleScript Objective-C) +============================== + +This is a level of integration between AppleScript and Objective-C available since Mac OS X 10.6 onwards. + +Scripts are transformed into Objective-C subclasses of NSObject (or of any other class defined in the property parent: of the script) at runtime, during the execution of the method loadAppleScriptObjectiveCScripts. + +In the objective-C app code following that call, it is possible to create a reference to the dynamically created class and an instance of it, to which messages can be sent. + +At compile time, the compiler just needs an objective-c protocol description of the handlers of the applescript. By the way, it also transforms the textual applescript of the project into a script object. + + +* * * + + +We designed this example of ASOC osirixplugin to demonstrate the bare functionality. All the magics is performed in ASOC.m. We use the initPlugin method, which is called only once at the start of OsiriX, to create the class, a reference to it and finally to instantiate it. We keep the pointers into static variables, which are available at any time during OsiriX execution. + +ASOC osirixplugin is meant to be extended and modified to do something useful from OsiriX based on applescripts. For instance, inter application communication with Mail.app, iPhoto.app, Pages.app. We believe that it organizes better the code and simplifies the transmission of variables between objective-c and applescript. + +Hopefully, it might also offer speed improvement in comparison to the use of NSApplescript class. + +Jacques + + +* * * + +References: +=========== +http://developer.apple.com/library/mac/#releasenotes/ScriptingAutomation/RN-AppleScriptObjC/index.html +http://macscripter.net/viewtopic.php?id=37691 +https://github.com/CraigWilliams/HelloThere \ No newline at end of file diff --git a/ASOC/SERunScriptApplicationImage.tiff b/ASOC/SERunScriptApplicationImage.tiff new file mode 100644 index 0000000..7c6b3ae Binary files /dev/null and b/ASOC/SERunScriptApplicationImage.tiff differ diff --git a/ASOC/html/SEPlugin.icns b/ASOC/html/SEPlugin.icns new file mode 100644 index 0000000..d3735d3 Binary files /dev/null and b/ASOC/html/SEPlugin.icns differ diff --git a/ASOC/html/index.html b/ASOC/html/index.html new file mode 100644 index 0000000..2444a1b --- /dev/null +++ b/ASOC/html/index.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+

ASOC plugin

+
+

Description: ASOC means "AppleScript Objective-C". This is a technology new in OS X 10.6, which integrates Applescript with Objective-C. Our ASOC plugin demonstrates this technology with a very simple example of communication between OsiriX and scriptable apps by means of applescript

+

Usage:

+

This plugin only says "hello", writes the version of the Finder to the Console and says "you are a genius". Nothing really usefull. Except for developpers, who can modify a copy of it in order to improve the interaction of OsiriX with scriptable apps. You can look for more information within the README.txt file of the XCode project

+

Distribution licence: GNU - LGPL

+

This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

+

Author: jacquesfauquex@gmail.com

+

Copyright: (c) Jacques Fauquex + OsiriX Team

+

Price: free

+

Version: 1.0 (for platform intel OS X 10.6+)

+
+ + \ No newline at end of file diff --git a/ASOC/html/style.css b/ASOC/html/style.css new file mode 100644 index 0000000..5a6aff5 --- /dev/null +++ b/ASOC/html/style.css @@ -0,0 +1,32 @@ +body { + font: 12px "Lucida Grande"; +} + +#plugin_icon { + float: none; + margin-right: 20px; + position: fixed; + z-index: -1; + top: -15px; + left: -30px; + opacity: 0.75; +} + +h1 { + margin-left: 20px; + margin-top: 40px; +} + +#text { + float: none; + margin-left: 20px; + margin-right: 20px; +} + +.title { + font-weight: bold; +} + +#screenshot { + text-align: center; +} \ No newline at end of file diff --git a/Ejection Fraction/Ejection Fraction II.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist b/CMIV_CTA_TOOLS/CMIV_CTA_TOOLS.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist similarity index 91% rename from Ejection Fraction/Ejection Fraction II.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist rename to CMIV_CTA_TOOLS/CMIV_CTA_TOOLS.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist index 11493ad..920cd61 100644 --- a/Ejection Fraction/Ejection Fraction II.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/CMIV_CTA_TOOLS/CMIV_CTA_TOOLS.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist @@ -4,7 +4,7 @@ SchemeUserState - Ejection Fraction II.xcscheme + CMIV_CTA_TOOLS.xcscheme orderHint 0 diff --git a/DefaultDefaults/DefaultDefaults.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist b/DefaultDefaults/DefaultDefaults.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..d11d042 --- /dev/null +++ b/DefaultDefaults/DefaultDefaults.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + DefaultDefaults.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8D5B49AC048680CD000E48DA + + primary + + + + + diff --git a/DicomUnEnhancer/.DS_Store b/DicomUnEnhancer/.DS_Store new file mode 100644 index 0000000..7e633ae Binary files /dev/null and b/DicomUnEnhancer/.DS_Store differ diff --git a/DicomUnEnhancer/DicomUnEnhancer.xcodeproj/project.pbxproj b/DicomUnEnhancer/DicomUnEnhancer.xcodeproj/project.pbxproj index ea0b9f6..8087b9c 100644 --- a/DicomUnEnhancer/DicomUnEnhancer.xcodeproj/project.pbxproj +++ b/DicomUnEnhancer/DicomUnEnhancer.xcodeproj/project.pbxproj @@ -157,7 +157,8 @@ }; /* End PBXGroup section */ -/* Begin PBXHeadersBuildPhase section */ +/* Begin PBXhead +ersBuildPhase section */ 8D5B49AD048680CD000E48DA /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; diff --git a/DicomUnEnhancer/DicomUnEnhancer.xcodeproj/xcshareddata/xcschemes/DicomUnEnhancer.xcscheme b/DicomUnEnhancer/DicomUnEnhancer.xcodeproj/xcshareddata/xcschemes/DicomUnEnhancer.xcscheme index 218b27e..692c0ce 100644 --- a/DicomUnEnhancer/DicomUnEnhancer.xcodeproj/xcshareddata/xcschemes/DicomUnEnhancer.xcscheme +++ b/DicomUnEnhancer/DicomUnEnhancer.xcodeproj/xcshareddata/xcschemes/DicomUnEnhancer.xcscheme @@ -48,7 +48,7 @@ debugDocumentVersioning = "YES" allowLocationSimulation = "YES"> + FilePath = "/Users/ale/Work/osirix/build/Development/OsiriX.app"> diff --git a/DicomUnEnhancer/Info.plist b/DicomUnEnhancer/Info.plist index dba0e5e..27722e2 100644 --- a/DicomUnEnhancer/Info.plist +++ b/DicomUnEnhancer/Info.plist @@ -14,7 +14,7 @@ BNDL CFBundleSignature ???? - CFBundleVersion + CFBundleShortVersionString 1.0.2 NSPrincipalClass DicomUnEnhancer diff --git a/DicomUnEnhancer/Sources/DicomUnEnhancerDCMTK.mm b/DicomUnEnhancer/Sources/DicomUnEnhancerDCMTK.mm index dfcf7d0..1195eb8 100644 --- a/DicomUnEnhancer/Sources/DicomUnEnhancerDCMTK.mm +++ b/DicomUnEnhancer/Sources/DicomUnEnhancerDCMTK.mm @@ -9,9 +9,9 @@ #import "DicomUnEnhancerDCMTK.h" #import #import -#import -#import -#import +#import "dcmimage.h" +#import "dcfilefo.h" +#import "dcuid.h" /*void describe(DcmSequenceOfItems* items) { for (unsigned int i = 0; i < items->card(); ++i) { @@ -173,6 +173,14 @@ +(NSString*)processFileAtPath:(NSString*)path intoDirInPath:(NSString*)outputDir _copyItem(tmpItem, DcmTagKey(0x0018,0x0093), outdataset); _copyItem(tmpItem, DcmTagKey(0x0018,0x0094), outdataset); _copyItem(tmpItem, DcmTagKey(0x0018,0x1312), outdataset); + + // request from Brainlab: 0018,1312 from "COLUMN" to "COL" + if (outdataset->findAndGetElement(DcmTagKey(0x0018,0x1312), tmpElement).good()) { + OFString s; + if (tmpElement->ident() == EVR_CS && tmpElement->getOFString(s,0).good() && s.compare("COLUMN") == 0) + tmpElement->DcmElement::putString("COL"); + } + // (0018,9058), (0018,9231) and (0018,9232) should go in sequence (2005,140f), but we don't } diff --git a/DiscPublishing/Classes/DiscPublishingFilesManager.mm b/DiscPublishing/Classes/DiscPublishingFilesManager.mm index 5327cac..db82bb5 100644 --- a/DiscPublishing/Classes/DiscPublishingFilesManager.mm +++ b/DiscPublishing/Classes/DiscPublishingFilesManager.mm @@ -267,7 +267,7 @@ -(void)observeDatabaseAddition:(NSNotification*)notification { if ([image managedObjectContext] == [[DicomDatabase defaultDatabase] managedObjectContext]) { DiscPublishingPatientStack* dpps = [self stackForImage:image serviceId:sid]; if (![dpps.images containsObject:image]) - if (image.modality && ![image.modality isEqual:@"SR"]) // TODO: why? + if (image.modality /*&& ![image.modality isEqual:@"SR"]*/) // TODO: why? [dpps addImage:image]; } } @catch (NSException* e) { diff --git a/DiscPublishing/Classes/DiscPublishingPatientDisc.mm b/DiscPublishing/Classes/DiscPublishingPatientDisc.mm index 200424e..ee8c614 100644 --- a/DiscPublishing/Classes/DiscPublishingPatientDisc.mm +++ b/DiscPublishing/Classes/DiscPublishingPatientDisc.mm @@ -68,11 +68,19 @@ -(id)initWithImages:(NSArray*)images options:(DiscPublishingOptions*)options { self.name = [NSString stringWithFormat:@"Preparing disc data for %@", [[images objectAtIndex:0] valueForKeyPath:@"series.study.name"]]; _options = [options retain]; - - _icontext = [[NSManagedObjectContext alloc] init]; + + if( [[[images objectAtIndex:0] managedObjectContext] isKindOfClass: [N2ManagedObjectContext class]] && [N2ManagedObjectContext instancesRespondToSelector: @selector( initWithDatabase:)]) + { + N2ManagedDatabase *database = [[[images objectAtIndex:0] managedObjectContext] database]; + _icontext = [[N2ManagedObjectContext alloc] initWithDatabase: database]; + } + else + { + _icontext = [[NSManagedObjectContext alloc] init]; + } _icontext.undoManager = nil; _icontext.persistentStoreCoordinator = [[[images objectAtIndex:0] managedObjectContext] persistentStoreCoordinator]; - + _images = [[NSMutableArray alloc] init]; for (DicomImage* image in images) { DicomImage* iimage = (DicomImage*)[_icontext objectWithID:image.objectID]; diff --git a/DiscPublishing/DiscPublishing.xcodeproj/project.pbxproj b/DiscPublishing/DiscPublishing.xcodeproj/project.pbxproj index 1a5ae73..e92f277 100644 --- a/DiscPublishing/DiscPublishing.xcodeproj/project.pbxproj +++ b/DiscPublishing/DiscPublishing.xcodeproj/project.pbxproj @@ -53,13 +53,11 @@ 5973458F1185E6AF00DA86F3 /* DiscPublishingPreferencesController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5973458E1185E6AF00DA86F3 /* DiscPublishingPreferencesController.mm */; }; 597345941185E70300DA86F3 /* Warning.png in Resources */ = {isa = PBXBuildFile; fileRef = 5994EBBB114921F4006E0DF7 /* Warning.png */; }; 5973465D1185F2FD00DA86F3 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 5973465C1185F2FD00DA86F3 /* Icon.png */; }; - 598C9AE61153C4BA007B7524 /* OsiriXAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 598C9AE51153C4BA007B7524 /* OsiriXAPI.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 5994E8CF114690E6006E0DF7 /* OsiriX.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5994E8CE114690E6006E0DF7 /* OsiriX.framework */; }; 59BDEF6A117DA5C7007F1F2C /* NSUserDefaultsController+DiscPublishing.h in Headers */ = {isa = PBXBuildFile; fileRef = 59BDEF68117DA5C7007F1F2C /* NSUserDefaultsController+DiscPublishing.h */; }; 59BDEF6B117DA5C7007F1F2C /* NSUserDefaultsController+DiscPublishing.mm in Sources */ = {isa = PBXBuildFile; fileRef = 59BDEF69117DA5C7007F1F2C /* NSUserDefaultsController+DiscPublishing.mm */; }; 59BDFB9C1185B7DF007F1F2C /* PreferencePanes.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59BDFB9B1185B7DF007F1F2C /* PreferencePanes.framework */; }; 59BDFBC01185BB75007F1F2C /* DiscPublishingPreferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 59BDFBBE1185BB75007F1F2C /* DiscPublishingPreferences.xib */; }; - 59BDFBC51185BE46007F1F2C /* OsiriXAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 598C9AE51153C4BA007B7524 /* OsiriXAPI.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 59BDFC271185C496007F1F2C /* DiscPublishingPreferences.prefPane in Resources */ = {isa = PBXBuildFile; fileRef = 59BDFB901185B794007F1F2C /* DiscPublishingPreferences.prefPane */; }; 59DC28BA11C613E000DAD5B4 /* NSString+DiscPublishing.h in Headers */ = {isa = PBXBuildFile; fileRef = 59DC28B811C613E000DAD5B4 /* NSString+DiscPublishing.h */; }; 59DC28BB11C613E000DAD5B4 /* NSString+DiscPublishing.mm in Sources */ = {isa = PBXBuildFile; fileRef = 59DC28B911C613E000DAD5B4 /* NSString+DiscPublishing.mm */; }; @@ -72,8 +70,6 @@ 59E37D3A117457D900E84FE3 /* DiscPublishing.mm in Sources */ = {isa = PBXBuildFile; fileRef = 59E37D38117457D900E84FE3 /* DiscPublishing.mm */; }; 59E37E73117466F700E84FE3 /* Standard.dcover in Resources */ = {isa = PBXBuildFile; fileRef = 59E37E70117466F700E84FE3 /* Standard.dcover */; }; 59E381CA1177177900E84FE3 /* DiscPublishingJob.h in Headers */ = {isa = PBXBuildFile; fileRef = 59E381C81177177900E84FE3 /* DiscPublishingJob.h */; }; - 59E3EFCD121A684500DD4552 /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59E3EFCC121A684500DD4552 /* Growl.framework */; }; - 59E3EFEE121A6FC300DD4552 /* Growl.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 59E3EFCC121A684500DD4552 /* Growl.framework */; }; 59F0D251131F8A2400E3F979 /* Nitrogen.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59F0D250131F8A2400E3F979 /* Nitrogen.framework */; }; 59F0D29F131F8A3D00E3F979 /* Nitrogen.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 59F0D250131F8A2400E3F979 /* Nitrogen.framework */; }; 7124006D14C573F70023BD31 /* DiscPublishingTool.h in Headers */ = {isa = PBXBuildFile; fileRef = 7124006C14C573F70023BD31 /* DiscPublishingTool.h */; }; @@ -83,6 +79,10 @@ 7195995115DD3ED0009126E1 /* NSUserDefaults+DiscPublishing.h in Headers */ = {isa = PBXBuildFile; fileRef = 7195994F15DD3ED0009126E1 /* NSUserDefaults+DiscPublishing.h */; }; 7195995215DD3ED0009126E1 /* NSUserDefaults+DiscPublishing.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7195995015DD3ED0009126E1 /* NSUserDefaults+DiscPublishing.mm */; }; 71E2F68E15F09C88004DDC99 /* Disc Cover 3 PE.app in Copy Executables */ = {isa = PBXBuildFile; fileRef = 71E2F68A15F09B9B004DDC99 /* Disc Cover 3 PE.app */; }; + 8454B59117C396F000CC14BE /* OsiriXAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8454B59017C396F000CC14BE /* OsiriXAPI.framework */; }; + 8454B59517C3973300CC14BE /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8454B59417C3973300CC14BE /* Growl.framework */; }; + 8454B59617C3973300CC14BE /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8454B59417C3973300CC14BE /* Growl.framework */; }; + 84629F2D17CE26B4007E6C26 /* Growl.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 8454B59417C3973300CC14BE /* Growl.framework */; }; 8D5B49AE048680CD000E48DA /* Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32DBCF630370AF2F00C91783 /* Prefix.pch */; }; /* End PBXBuildFile section */ @@ -124,8 +124,8 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( + 84629F2D17CE26B4007E6C26 /* Growl.framework in Copy Frameworks */, 59F0D29F131F8A3D00E3F979 /* Nitrogen.framework in Copy Frameworks */, - 59E3EFEE121A6FC300DD4552 /* Growl.framework in Copy Frameworks */, 5900F90F11916356001E899B /* JobManager.framework in Copy Frameworks */, 5900F91011916356001E899B /* JobProcessor.framework in Copy Frameworks */, 5900F91111916356001E899B /* PTRobot.framework in Copy Frameworks */, @@ -202,8 +202,7 @@ 5973458D1185E6AF00DA86F3 /* DiscPublishingPreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DiscPublishingPreferencesController.h; path = Classes/DiscPublishingPreferencesController.h; sourceTree = ""; }; 5973458E1185E6AF00DA86F3 /* DiscPublishingPreferencesController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DiscPublishingPreferencesController.mm; path = Classes/DiscPublishingPreferencesController.mm; sourceTree = ""; }; 5973465C1185F2FD00DA86F3 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = Resources/Icon.png; sourceTree = ""; }; - 598C9AE51153C4BA007B7524 /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = "../../osirix-trunk/build/Development/OsiriXAPI.framework"; sourceTree = SOURCE_ROOT; }; - 5994E8CE114690E6006E0DF7 /* OsiriX.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriX.framework; path = "../../osirix-trunk/build/Development/OsiriX.framework"; sourceTree = SOURCE_ROOT; }; + 5994E8CE114690E6006E0DF7 /* OsiriX.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriX.framework; path = ../../osirix/build/Development/OsiriX.framework; sourceTree = SOURCE_ROOT; }; 5994EBBB114921F4006E0DF7 /* Warning.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Warning.png; path = Resources/Warning.png; sourceTree = ""; }; 59B3FC05117C38330027B0DB /* Weird.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Weird.txt; sourceTree = ""; }; 59BDEF68117DA5C7007F1F2C /* NSUserDefaultsController+DiscPublishing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSUserDefaultsController+DiscPublishing.h"; path = "Classes/NSUserDefaultsController+DiscPublishing.h"; sourceTree = ""; }; @@ -228,8 +227,7 @@ 59E384241178868500E84FE3 /* JobManager.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JobManager.framework; path = Libs/JobManager.framework; sourceTree = ""; }; 59E384251178868500E84FE3 /* JobProcessor.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JobProcessor.framework; path = Libs/JobProcessor.framework; sourceTree = ""; }; 59E384261178868500E84FE3 /* PTRobot.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PTRobot.framework; path = Libs/PTRobot.framework; sourceTree = ""; }; - 59E3EFCC121A684500DD4552 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = "../../osirix-trunk/Binaries/Growl.framework"; sourceTree = SOURCE_ROOT; }; - 59F0D250131F8A2400E3F979 /* Nitrogen.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nitrogen.framework; path = "../../osirix-trunk/nitrogen/build/Development/Nitrogen.framework"; sourceTree = SOURCE_ROOT; }; + 59F0D250131F8A2400E3F979 /* Nitrogen.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nitrogen.framework; path = Resources/Nitrogen.framework; sourceTree = SOURCE_ROOT; }; 59FCD7AD11905E56007B28E0 /* DiscPublishingToolAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DiscPublishingToolAppDelegate.h; path = Classes/DiscPublishingToolAppDelegate.h; sourceTree = ""; }; 59FCD7B011905E78007B28E0 /* DiscPublishingToolAppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DiscPublishingToolAppDelegate.mm; path = Classes/DiscPublishingToolAppDelegate.mm; sourceTree = ""; }; 7124006C14C573F70023BD31 /* DiscPublishingTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DiscPublishingTool.h; path = Classes/DiscPublishingTool.h; sourceTree = ""; }; @@ -238,6 +236,8 @@ 7195994F15DD3ED0009126E1 /* NSUserDefaults+DiscPublishing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSUserDefaults+DiscPublishing.h"; path = "Classes/NSUserDefaults+DiscPublishing.h"; sourceTree = ""; }; 7195995015DD3ED0009126E1 /* NSUserDefaults+DiscPublishing.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "NSUserDefaults+DiscPublishing.mm"; path = "Classes/NSUserDefaults+DiscPublishing.mm"; sourceTree = ""; }; 71E2F68A15F09B9B004DDC99 /* Disc Cover 3 PE.app */ = {isa = PBXFileReference; lastKnownFileType = wrapper.application; name = "Disc Cover 3 PE.app"; path = "Libs/Disc Cover 3 PE.app"; sourceTree = ""; }; + 8454B59017C396F000CC14BE /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = ../../osirix/build/Development/OsiriXAPI.framework; sourceTree = ""; }; + 8454B59417C3973300CC14BE /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = Resources/Growl.framework; sourceTree = ""; }; AB5D36050680E57E00F4007A /* DiscPublishing.osirixplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DiscPublishing.osirixplugin; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -251,8 +251,8 @@ 5900F6701190677F001E899B /* PTRobot.framework in Frameworks */, 5900F68011906784001E899B /* as_storage.framework in Frameworks */, 59DEC7B511995E7800E0343A /* Carbon.framework in Frameworks */, - 59E3EFCD121A684500DD4552 /* Growl.framework in Frameworks */, 59F0D251131F8A2400E3F979 /* Nitrogen.framework in Frameworks */, + 8454B59617C3973300CC14BE /* Growl.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -261,7 +261,6 @@ buildActionMask = 2147483647; files = ( 59BDFB9C1185B7DF007F1F2C /* PreferencePanes.framework in Frameworks */, - 59BDFBC51185BE46007F1F2C /* OsiriXAPI.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -270,8 +269,9 @@ buildActionMask = 2147483647; files = ( 5994E8CF114690E6006E0DF7 /* OsiriX.framework in Frameworks */, - 598C9AE61153C4BA007B7524 /* OsiriXAPI.framework in Frameworks */, 59DEC7B411995E7800E0343A /* Carbon.framework in Frameworks */, + 8454B59117C396F000CC14BE /* OsiriXAPI.framework in Frameworks */, + 8454B59517C3973300CC14BE /* Growl.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -298,13 +298,13 @@ isa = PBXGroup; children = ( 59F0D250131F8A2400E3F979 /* Nitrogen.framework */, - 59E3EFCC121A684500DD4552 /* Growl.framework */, + 8454B59417C3973300CC14BE /* Growl.framework */, 59E384241178868500E84FE3 /* JobManager.framework */, 59E384251178868500E84FE3 /* JobProcessor.framework */, 59E384261178868500E84FE3 /* PTRobot.framework */, 59E384231178868500E84FE3 /* as_storage.framework */, + 8454B59017C396F000CC14BE /* OsiriXAPI.framework */, 5994E8CE114690E6006E0DF7 /* OsiriX.framework */, - 598C9AE51153C4BA007B7524 /* OsiriXAPI.framework */, 59BDFB9B1185B7DF007F1F2C /* PreferencePanes.framework */, 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */, 59DEC7B311995E7800E0343A /* Carbon.framework */, @@ -743,6 +743,8 @@ "$(inherited)", "$(SRCROOT)/../../osirix-trunk/nitrogen/build/Development", "$(SRCROOT)/../../osirix-trunk/Binaries", + "\"$(SRCROOT)/../../osirix/build/Development\"", + "\"$(SRCROOT)/Resources\"", ); GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; @@ -769,6 +771,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/Libs\"", + "\"$(SRCROOT)/../../osirix/build/Development\"", ); GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_CPP_RTTI = YES; @@ -806,6 +809,8 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/Libs\"", + "\"$(SRCROOT)/../../osirix/build/Development\"", + "\"$(SRCROOT)/Resources\"", ); GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_TRIGRAPHS = NO; @@ -843,7 +848,6 @@ FRAMEWORK_SEARCH_PATHS = ( "\"$(SDKROOT)/System/Library/Frameworks\"", "\"$(SRCROOT)/Libs\"", - "\"$(SRCROOT)/../../osirix-trunk/build/Development\"", ); GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = macosx10.7; diff --git a/DiscPublishing/DiscPublishing.xcodeproj/xcshareddata/xcschemes/DiscPublishing.xcscheme b/DiscPublishing/DiscPublishing.xcodeproj/xcshareddata/xcschemes/DiscPublishing.xcscheme index 6dd80cc..ffabb2c 100644 --- a/DiscPublishing/DiscPublishing.xcodeproj/xcshareddata/xcschemes/DiscPublishing.xcscheme +++ b/DiscPublishing/DiscPublishing.xcodeproj/xcshareddata/xcschemes/DiscPublishing.xcscheme @@ -48,7 +48,7 @@ debugDocumentVersioning = "YES" allowLocationSimulation = "YES"> + FilePath = "/Users/admin/osirix/build/Development/OsiriX.app"> - - diff --git a/DiscPublishing/DiscPublishing.xcodeproj/xcuserdata/admin.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/DiscPublishing/DiscPublishing.xcodeproj/xcuserdata/admin.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..182378e --- /dev/null +++ b/DiscPublishing/DiscPublishing.xcodeproj/xcuserdata/admin.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,29 @@ + + + + + + + + + + + diff --git a/DiscPublishing/DiscPublishing.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/DiscPublishingPreferences.xcscheme b/DiscPublishing/DiscPublishing.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/DiscPublishingPreferences.xcscheme new file mode 100644 index 0000000..7db98ce --- /dev/null +++ b/DiscPublishing/DiscPublishing.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/DiscPublishingPreferences.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DiscPublishing/DiscPublishing.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist b/DiscPublishing/DiscPublishing.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..5b68f8b --- /dev/null +++ b/DiscPublishing/DiscPublishing.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,52 @@ + + + + + SchemeUserState + + DiscPublishing.xcscheme_^#shared#^_ + + orderHint + 0 + + DiscPublishingPreferences.xcscheme + + orderHint + 3 + + DiscPublishingTool.xcscheme_^#shared#^_ + + orderHint + 1 + + Unzip Libs.xcscheme_^#shared#^_ + + orderHint + 2 + + + SuppressBuildableAutocreation + + 5900F64A11906667001E899B + + primary + + + 59BDFB8F1185B794007F1F2C + + primary + + + 59EBE42112B8A8B500809C61 + + primary + + + 8D5B49AC048680CD000E48DA + + primary + + + + + diff --git a/DiscPublishing/Resources/Growl.framework/Growl b/DiscPublishing/Resources/Growl.framework/Growl new file mode 120000 index 0000000..85956e2 --- /dev/null +++ b/DiscPublishing/Resources/Growl.framework/Growl @@ -0,0 +1 @@ +Versions/Current/Growl \ No newline at end of file diff --git a/DiscPublishing/Resources/Growl.framework/Headers b/DiscPublishing/Resources/Growl.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/DiscPublishing/Resources/Growl.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/DiscPublishing/Resources/Growl.framework/Resources b/DiscPublishing/Resources/Growl.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/DiscPublishing/Resources/Growl.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/DiscPublishing/Resources/Growl.framework/Versions/A/Growl b/DiscPublishing/Resources/Growl.framework/Versions/A/Growl new file mode 100755 index 0000000..f1f1944 Binary files /dev/null and b/DiscPublishing/Resources/Growl.framework/Versions/A/Growl differ diff --git a/DiscPublishing/Resources/Growl.framework/Versions/A/Headers/Growl.h b/DiscPublishing/Resources/Growl.framework/Versions/A/Headers/Growl.h new file mode 100644 index 0000000..e2a4425 --- /dev/null +++ b/DiscPublishing/Resources/Growl.framework/Versions/A/Headers/Growl.h @@ -0,0 +1,6 @@ +#include "GrowlDefines.h" + +#ifdef __OBJC__ +# include "GrowlApplicationBridge.h" +#endif +#include "GrowlApplicationBridge-Carbon.h" diff --git a/DiscPublishing/Resources/Growl.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h b/DiscPublishing/Resources/Growl.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h new file mode 100644 index 0000000..e7213db --- /dev/null +++ b/DiscPublishing/Resources/Growl.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h @@ -0,0 +1,780 @@ +// +// GrowlApplicationBridge-Carbon.h +// Growl +// +// Created by Peter Hosey on Wed Jun 18 2004. +// Based on GrowlApplicationBridge.h by Evan Schoenberg. +// This source code is in the public domain. You may freely link it into any +// program. +// + +#ifndef _GROWLAPPLICATIONBRIDGE_CARBON_H_ +#define _GROWLAPPLICATIONBRIDGE_CARBON_H_ + +#include +#include + +#ifndef GROWL_EXPORT +#define GROWL_EXPORT __attribute__((visibility("default"))) DEPRECATED_ATTRIBUTE +#endif + +/*! @header GrowlApplicationBridge-Carbon.h + * @abstract Declares an API that Carbon applications can use to interact with Growl. + * @discussion GrowlApplicationBridge uses a delegate to provide information //XXX + * to Growl (such as your application's name and what notifications it may + * post) and to provide information to your application (such as that Growl + * is listening for notifications or that a notification has been clicked). + * + * You can set the Growldelegate with Growl_SetDelegate and find out the + * current delegate with Growl_GetDelegate. See struct Growl_Delegate for more + * information about the delegate. + */ + +__BEGIN_DECLS + +/*! @struct Growl_Delegate + * @abstract Delegate to supply GrowlApplicationBridge with information and respond to events. + * @discussion The Growl delegate provides your interface to + * GrowlApplicationBridge. When GrowlApplicationBridge needs information about + * your application, it looks for it in the delegate; when Growl or the user + * does something that you might be interested in, GrowlApplicationBridge + * looks for a callback in the delegate and calls it if present + * (meaning, if it is not NULL). + * XXX on all of that + * @field size The size of the delegate structure. + * @field applicationName The name of your application. + * @field registrationDictionary A dictionary describing your application and the notifications it can send out. + * @field applicationIconData Your application's icon. + * @field growlInstallationWindowTitle The title of the installation window. + * @field growlInstallationInformation Text to display in the installation window. + * @field growlUpdateWindowTitle The title of the update window. + * @field growlUpdateInformation Text to display in the update window. + * @field referenceCount A count of owners of the delegate. + * @field retain Called when GrowlApplicationBridge receives this delegate. + * @field release Called when GrowlApplicationBridge no longer needs this delegate. + * @field growlIsReady Called when GrowlHelperApp is listening for notifications. + * @field growlNotificationWasClicked Called when a Growl notification is clicked. + * @field growlNotificationTimedOut Called when a Growl notification timed out. + */ +struct Growl_Delegate { + /* @discussion This should be sizeof(struct Growl_Delegate). + */ + size_t size; + + /*All of these attributes are optional. + *Optional attributes can be NULL; required attributes that + * are NULL cause setting the Growl delegate to fail. + *XXX - move optional/required status into the discussion for each field + */ + + /* This name is used both internally and in the Growl preferences. + * + * This should remain stable between different versions and incarnations of + * your application. + * For example, "SurfWriter" is a good app name, whereas "SurfWriter 2.0" and + * "SurfWriter Lite" are not. + * + * This can be NULL if it is provided elsewhere, namely in an + * auto-discoverable plist file in your app bundle + * (XXX refer to more information on that) or in registrationDictionary. + */ + CFStringRef applicationName; + + /* + * Must contain at least these keys: + * GROWL_NOTIFICATIONS_ALL (CFArray): + * Contains the names of all notifications your application may post. + * + * Can also contain these keys: + * GROWL_NOTIFICATIONS_DEFAULT (CFArray): + * Names of notifications that should be enabled by default. + * If omitted, GROWL_NOTIFICATIONS_ALL will be used. + * GROWL_APP_NAME (CFString): + * Same as the applicationName member of this structure. + * If both are present, the applicationName member shall prevail. + * If this key is present, you may omit applicationName (set it to NULL). + * GROWL_APP_ICON (CFData): + * Same as the iconData member of this structure. + * If both are present, the iconData member shall prevail. + * If this key is present, you may omit iconData (set it to NULL). + * + * If you change the contents of this dictionary after setting the delegate, + * be sure to call Growl_Reregister. + * + * This can be NULL if you have an auto-discoverable plist file in your app + * bundle. (XXX refer to more information on that) + */ + CFDictionaryRef registrationDictionary; + + /* The data can be in any format supported by NSImage. As of + * Mac OS X 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and + * PICT formats. + * + * If this is not supplied, Growl will look up your application's icon by + * its application name. + */ + CFDataRef applicationIconData; + + /* Installer display attributes + * + * These four attributes are used by the Growl installer, if this framework + * supports it. + * For any of these being NULL, a localised default will be + * supplied. + */ + + /* If this is NULL, Growl will use a default, + * localized title. + * + * Only used if you're using Growl-WithInstaller.framework. Otherwise, + * this member is ignored. + */ + CFStringRef growlInstallationWindowTitle; + /* This information may be as long or short as desired (the + * window will be sized to fit it). If Growl is not installed, it will + * be displayed to the user as an explanation of what Growl is and what + * it can do in your application. + * It should probably note that no download is required to install. + * + * If this is NULL, Growl will use a default, localized + * explanation. + * + * Only used if you're using Growl-WithInstaller.framework. Otherwise, + * this member is ignored. + */ + CFStringRef growlInstallationInformation; + /* If this is NULL, Growl will use a default, + * localized title. + * + * Only used if you're using Growl-WithInstaller.framework. Otherwise, + * this member is ignored. + */ + CFStringRef growlUpdateWindowTitle; + /* This information may be as long or short as desired (the + * window will be sized to fit it). If an older version of Growl is + * installed, it will be displayed to the user as an explanation that an + * updated version of Growl is included in your application and + * no download is required. + * + * If this is NULL, Growl will use a default, localized + * explanation. + * + * Only used if you're using Growl-WithInstaller.framework. Otherwise, + * this member is ignored. + */ + CFStringRef growlUpdateInformation; + + /* This member is provided for use by your retain and release + * callbacks (see below). + * + * GrowlApplicationBridge never directly uses this member. Instead, it + * calls your retain callback (if non-NULL) and your release + * callback (if non-NULL). + */ + unsigned referenceCount; + + //Functions. Currently all of these are optional (any of them can be NULL). + + /* When you call Growl_SetDelegate(newDelegate), it will call + * oldDelegate->release(oldDelegate), and then it will call + * newDelegate->retain(newDelegate), and the return value from retain + * is what will be set as the delegate. + * (This means that this member works like CFRetain and -[NSObject retain].) + * This member is optional (it can be NULL). + * For a delegate allocated with malloc, this member would be + * NULL. + * @result A delegate to which GrowlApplicationBridge holds a reference. + */ + void *(*retain)(void *); + /* When you call Growl_SetDelegate(newDelegate), it will call + * oldDelegate->release(oldDelegate), and then it will call + * newDelegate->retain(newDelegate), and the return value from retain + * is what will be set as the delegate. + * (This means that this member works like CFRelease and + * -[NSObject release].) + * This member is optional (it can be NULL). + * For a delegate allocated with malloc, this member might be + * free(3). + */ + void (*release)(void *); + + /* Informs the delegate that Growl (specifically, the GrowlHelperApp) was + * launched successfully (or was already running). The application can + * take actions with the knowledge that Growl is installed and functional. + */ + void (*growlIsReady)(void); + + /* Informs the delegate that a Growl notification was clicked. It is only + * sent for notifications sent with a non-NULL clickContext, + * so if you want to receive a message when a notification is clicked, + * clickContext must not be NULL when calling + * Growl_PostNotification or + * Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext. + */ + void (*growlNotificationWasClicked)(CFPropertyListRef clickContext); + + /* Informs the delegate that a Growl notification timed out. It is only + * sent for notifications sent with a non-NULL clickContext, + * so if you want to receive a message when a notification is clicked, + * clickContext must not be NULL when calling + * Growl_PostNotification or + * Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext. + */ + void (*growlNotificationTimedOut)(CFPropertyListRef clickContext); +}; + +/*! @struct Growl_Notification + * @abstract Structure describing a Growl notification. + * @discussion XXX + * @field size The size of the notification structure. + * @field name Identifies the notification. + * @field title Short synopsis of the notification. + * @field description Additional text. + * @field iconData An icon for the notification. + * @field priority An indicator of the notification's importance. + * @field reserved Bits reserved for future usage. + * @field isSticky Requests that a notification stay on-screen until dismissed explicitly. + * @field clickContext An identifier to be passed to your click callback when a notification is clicked. + * @field clickCallback A callback to call when the notification is clicked. + */ +struct Growl_Notification { + /* This should be sizeof(struct Growl_Notification). + */ + size_t size; + + /* The notification name distinguishes one type of + * notification from another. The name should be human-readable, as it + * will be displayed in the Growl preference pane. + * + * The name is used in the GROWL_NOTIFICATIONS_ALL and + * GROWL_NOTIFICATIONS_DEFAULT arrays in the registration dictionary, and + * in this member of the Growl_Notification structure. + */ + CFStringRef name; + + /* A notification's title describes the notification briefly. + * It should be easy to read quickly by the user. + */ + CFStringRef title; + + /* The description supplements the title with more + * information. It is usually longer and sometimes involves a list of + * subjects. For example, for a 'Download complete' notification, the + * description might have one filename per line. GrowlMail in Growl 0.6 + * uses a description of '%d new mail(s)' (formatted with the number of + * messages). + */ + CFStringRef description; + + /* The notification icon usually indicates either what + * happened (it may have the same icon as e.g. a toolbar item that + * started the process that led to the notification), or what it happened + * to (e.g. a document icon). + * + * The icon data is optional, so it can be NULL. In that + * case, the application icon is used alone. Not all displays support + * icons. + * + * The data can be in any format supported by NSImage. As of Mac OS X + * 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and PICT form + * ats. + */ + CFDataRef iconData; + + /* Priority is new in Growl 0.6, and is represented as a + * signed integer from -2 to +2. 0 is Normal priority, -2 is Very Low + * priority, and +2 is Very High priority. + * + * Not all displays support priority. If you do not wish to assign a + * priority to your notification, assign 0. + */ + signed int priority; + + /* These bits are not used in Growl 0.6. Set them to 0. + */ + unsigned reserved: 31; + + /* When the sticky bit is clear, in most displays, + * notifications disappear after a certain amount of time. Sticky + * notifications, however, remain on-screen until the user dismisses them + * explicitly, usually by clicking them. + * + * Sticky notifications were introduced in Growl 0.6. Most notifications + * should not be sticky. Not all displays support sticky notifications, + * and the user may choose in Growl's preference pane to force the + * notification to be sticky or non-sticky, in which case the sticky bit + * in the notification will be ignored. + */ + unsigned isSticky: 1; + + /* If this is not NULL, and your click callback + * is not NULL either, this will be passed to the callback + * when your notification is clicked by the user. + * + * Click feedback was introduced in Growl 0.6, and it is optional. Not + * all displays support click feedback. + */ + CFPropertyListRef clickContext; + + /* If this is not NULL, it will be called instead + * of the Growl delegate's click callback when clickContext is + * non-NULL and the notification is clicked on by the user. + * + * Click feedback was introduced in Growl 0.6, and it is optional. Not + * all displays support click feedback. + * + * The per-notification click callback is not yet supported as of Growl + * 0.7. + */ + void (*clickCallback)(CFPropertyListRef clickContext); + + CFStringRef identifier; +}; + +#pragma mark - +#pragma mark Easy initialisers + +/*! @defined InitGrowlDelegate + * @abstract Callable macro. Initializes a Growl delegate structure to defaults. + * @discussion Call with a pointer to a struct Growl_Delegate. All of the + * members of the structure will be set to 0 or NULL, except for + * size (which will be set to sizeof(struct Growl_Delegate)) and + * referenceCount (which will be set to 1). + */ +#define InitGrowlDelegate(delegate) \ + do { \ + if (delegate) { \ + (delegate)->size = sizeof(struct Growl_Delegate); \ + (delegate)->applicationName = NULL; \ + (delegate)->registrationDictionary = NULL; \ + (delegate)->applicationIconData = NULL; \ + (delegate)->growlInstallationWindowTitle = NULL; \ + (delegate)->growlInstallationInformation = NULL; \ + (delegate)->growlUpdateWindowTitle = NULL; \ + (delegate)->growlUpdateInformation = NULL; \ + (delegate)->referenceCount = 1U; \ + (delegate)->retain = NULL; \ + (delegate)->release = NULL; \ + (delegate)->growlIsReady = NULL; \ + (delegate)->growlNotificationWasClicked = NULL; \ + (delegate)->growlNotificationTimedOut = NULL; \ + } \ + } while(0) + +/*! @defined InitGrowlNotification + * @abstract Callable macro. Initializes a Growl notification structure to defaults. + * @discussion Call with a pointer to a struct Growl_Notification. All of + * the members of the structure will be set to 0 or NULL, except + * for size (which will be set to + * sizeof(struct Growl_Notification)). + */ +#define InitGrowlNotification(notification) \ + do { \ + if (notification) { \ + (notification)->size = sizeof(struct Growl_Notification); \ + (notification)->name = NULL; \ + (notification)->title = NULL; \ + (notification)->description = NULL; \ + (notification)->iconData = NULL; \ + (notification)->priority = 0; \ + (notification)->reserved = 0U; \ + (notification)->isSticky = false; \ + (notification)->clickContext = NULL; \ + (notification)->clickCallback = NULL; \ + (notification)->identifier = NULL; \ + } \ + } while(0) + +#pragma mark - +#pragma mark Public API + +// @functiongroup Managing the Growl delegate + +/*! @function Growl_SetDelegate + * @abstract Replaces the current Growl delegate with a new one, or removes + * the Growl delegate. + * @param newDelegate + * @result Returns false and does nothing else if a pointer that was passed in + * is unsatisfactory (because it is non-NULL, but at least one + * required member of it is NULL). Otherwise, sets or unsets the + * delegate and returns true. + * @discussion When newDelegate is non-NULL, sets + * the delegate to newDelegate. When it is NULL, + * the current delegate will be unset, and no delegate will be in place. + * + * It is legal for newDelegate to be the current delegate; + * nothing will happen, and Growl_SetDelegate will return true. It is also + * legal for it to be NULL, as described above; again, it will + * return true. + * + * If there was a delegate in place before the call, Growl_SetDelegate will + * call the old delegate's release member if it was non-NULL. If + * newDelegate is non-NULL, Growl_SetDelegate will + * call newDelegate->retain, and set the delegate to its return + * value. + * + * If you are using Growl-WithInstaller.framework, and an older version of + * Growl is installed on the user's system, the user will automatically be + * prompted to update. + * + * GrowlApplicationBridge currently does not copy this structure, nor does it + * retain any of the CF objects in the structure (it regards the structure as + * a container that retains the objects when they are added and releases them + * when they are removed or the structure is destroyed). Also, + * GrowlApplicationBridge currently does not modify any member of the + * structure, except possibly the referenceCount by calling the retain and + * release members. + */ +GROWL_EXPORT Boolean Growl_SetDelegate(struct Growl_Delegate *newDelegate); + +/*! @function Growl_GetDelegate + * @abstract Returns the current Growl delegate, if any. + * @result The current Growl delegate. + * @discussion Returns the last pointer passed into Growl_SetDelegate, or + * NULL if no such call has been made. + * + * This function follows standard Core Foundation reference-counting rules. + * Because it is a Get function, not a Copy function, it will not retain the + * delegate on your behalf. You are responsible for retaining and releasing + * the delegate as needed. + */ +GROWL_EXPORT struct Growl_Delegate *Growl_GetDelegate(void); + +#pragma mark - + +// @functiongroup Posting Growl notifications + +/*! @function Growl_PostNotification + * @abstract Posts a Growl notification. + * @param notification The notification to post. + * @discussion This is the preferred means for sending a Growl notification. + * The notification name and at least one of the title and description are + * required (all three are preferred). All other parameters may be + * NULL (or 0 or false as appropriate) to accept default values. + * + * If using the Growl-WithInstaller framework, if Growl is not installed the + * user will be prompted to install Growl. + * If the user cancels, this function will have no effect until the next + * application session, at which time when it is called the user will be + * prompted again. The user is also given the option to not be prompted again. + * If the user does choose to install Growl, the requested notification will + * be displayed once Growl is installed and running. + */ +GROWL_EXPORT void Growl_PostNotification(const struct Growl_Notification *notification); + +/*! @function Growl_PostNotificationWithDictionary +* @abstract Notifies using a userInfo dictionary suitable for passing to +* CFDistributedNotificationCenter. +* @param userInfo The dictionary to notify with. +* @discussion Before Growl 0.6, your application would have posted +* notifications using CFDistributedNotificationCenter by creating a userInfo +* dictionary with the notification data. This had the advantage of allowing +* you to add other data to the dictionary for programs besides Growl that +* might be listening. +* +* This function allows you to use such dictionaries without being restricted +* to using CFDistributedNotificationCenter. The keys for this dictionary + * can be found in GrowlDefines.h. +*/ +GROWL_EXPORT void Growl_PostNotificationWithDictionary(CFDictionaryRef userInfo); + +/*! @function Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext + * @abstract Posts a Growl notification using parameter values. + * @param title The title of the notification. + * @param description The description of the notification. + * @param notificationName The name of the notification as listed in the + * registration dictionary. + * @param iconData Data representing a notification icon. Can be NULL. + * @param priority The priority of the notification (-2 to +2, with -2 + * being Very Low and +2 being Very High). + * @param isSticky If true, requests that this notification wait for a + * response from the user. + * @param clickContext An object to pass to the clickCallback, if any. Can + * be NULL, in which case the clickCallback is not called. + * @discussion Creates a temporary Growl_Notification, fills it out with the + * supplied information, and calls Growl_PostNotification on it. + * See struct Growl_Notification and Growl_PostNotification for more + * information. + * + * The icon data can be in any format supported by NSImage. As of Mac OS X + * 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and PICT formats. + */ +GROWL_EXPORT void Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext( + /*inhale*/ + CFStringRef title, + CFStringRef description, + CFStringRef notificationName, + CFDataRef iconData, + signed int priority, + Boolean isSticky, + CFPropertyListRef clickContext); + +#pragma mark - + +// @functiongroup Registering + +/*! @function Growl_RegisterWithDictionary + * @abstract Register your application with Growl without setting a delegate. + * @discussion When you call this function with a dictionary, + * GrowlApplicationBridge registers your application using that dictionary. + * If you pass NULL, GrowlApplicationBridge will ask the delegate + * (if there is one) for a dictionary, and if that doesn't work, it will look + * in your application's bundle for an auto-discoverable plist. + * (XXX refer to more information on that) + * + * If you pass a dictionary to this function, it must include the + * GROWL_APP_NAME key, unless a delegate is set. + * + * This function is mainly an alternative to the delegate system introduced + * with Growl 0.6. Without a delegate, you cannot receive callbacks such as + * growlIsReady (since they are sent to the delegate). You can, + * however, set a delegate after registering without one. + * + * This function was introduced in Growl.framework 0.7. + * @result false if registration failed (e.g. if Growl isn't installed). + */ +GROWL_EXPORT Boolean Growl_RegisterWithDictionary(CFDictionaryRef regDict); + +/*! @function Growl_Reregister + * @abstract Updates your registration with Growl. + * @discussion If your application changes the contents of the + * GROWL_NOTIFICATIONS_ALL key in the registrationDictionary member of the + * Growl delegate, or if it changes the value of that member, or if it + * changes the contents of its auto-discoverable plist, call this function + * to have Growl update its registration information for your application. + * + * Otherwise, this function does not normally need to be called. If you're + * using a delegate, your application will be registered when you set the + * delegate if both the delegate and its registrationDictionary member are + * non-NULL. + * + * This function is now implemented using + * Growl_RegisterWithDictionary. + */ +GROWL_EXPORT void Growl_Reregister(void); + +#pragma mark - + +/*! @function Growl_SetWillRegisterWhenGrowlIsReady + * @abstract Tells GrowlApplicationBridge to register with Growl when Growl + * launches (or not). + * @discussion When Growl has started listening for notifications, it posts a + * GROWL_IS_READY notification on the Distributed Notification + * Center. GrowlApplicationBridge listens for this notification, using it to + * perform various tasks (such as calling your delegate's + * growlIsReady callback, if it has one). If this function is + * called with true, one of those tasks will be to reregister + * with Growl (in the manner of Growl_Reregister). + * + * This attribute is automatically set back to false + * (the default) after every GROWL_IS_READY notification. + * @param flag true if you want GrowlApplicationBridge to register with + * Growl when next it is ready; false if not. + */ +GROWL_EXPORT void Growl_SetWillRegisterWhenGrowlIsReady(Boolean flag); +/*! @function Growl_WillRegisterWhenGrowlIsReady + * @abstract Reports whether GrowlApplicationBridge will register with Growl + * when Growl next launches. + * @result true if GrowlApplicationBridge will register with + * Growl when next it posts GROWL_IS_READY; false if not. + */ +GROWL_EXPORT Boolean Growl_WillRegisterWhenGrowlIsReady(void); + +#pragma mark - + +// @functiongroup Obtaining registration dictionaries + +/*! @function Growl_CopyRegistrationDictionaryFromDelegate + * @abstract Asks the delegate for a registration dictionary. + * @discussion If no delegate is set, or if the delegate's + * registrationDictionary member is NULL, this + * function returns NULL. + * + * This function does not attempt to clean up the dictionary in any way - for + * example, if it is missing the GROWL_APP_NAME key, the result + * will be missing it too. Use + * Growl_CreateRegistrationDictionaryByFillingInDictionary or + * Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys + * to try to fill in missing keys. + * + * This function was introduced in Growl.framework 0.7. + * @result A registration dictionary. + */ +GROWL_EXPORT CFDictionaryRef Growl_CopyRegistrationDictionaryFromDelegate(void); + +/*! @function Growl_CopyRegistrationDictionaryFromBundle + * @abstract Looks in a bundle for a registration dictionary. + * @discussion This function looks in a bundle for an auto-discoverable + * registration dictionary file using CFBundleCopyResourceURL. + * If it finds one, it loads the file using CFPropertyList and + * returns the result. + * + * If you pass NULL as the bundle, the main bundle is examined. + * + * This function does not attempt to clean up the dictionary in any way - for + * example, if it is missing the GROWL_APP_NAME key, the result + * will be missing it too. Use + * Growl_CreateRegistrationDictionaryByFillingInDictionary: or + * Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys + * to try to fill in missing keys. + * + * This function was introduced in Growl.framework 0.7. + * @result A registration dictionary. + */ +GROWL_EXPORT CFDictionaryRef Growl_CopyRegistrationDictionaryFromBundle(CFBundleRef bundle); + +/*! @function Growl_CreateBestRegistrationDictionary + * @abstract Obtains a registration dictionary, filled out to the best of + * GrowlApplicationBridge's knowledge. + * @discussion This function creates a registration dictionary as best + * GrowlApplicationBridge knows how. + * + * First, GrowlApplicationBridge examines the Growl delegate (if there is + * one) and gets the registration dictionary from that. If no such dictionary + * was obtained, GrowlApplicationBridge looks in your application's main + * bundle for an auto-discoverable registration dictionary file. If that + * doesn't exist either, this function returns NULL. + * + * Second, GrowlApplicationBridge calls + * Growl_CreateRegistrationDictionaryByFillingInDictionary with + * whatever dictionary was obtained. The result of that function is the + * result of this function. + * + * GrowlApplicationBridge uses this function when you call + * Growl_SetDelegate, or when you call + * Growl_RegisterWithDictionary with NULL. + * + * This function was introduced in Growl.framework 0.7. + * @result A registration dictionary. + */ +GROWL_EXPORT CFDictionaryRef Growl_CreateBestRegistrationDictionary(void); + +#pragma mark - + +// @functiongroup Filling in registration dictionaries + +/*! @function Growl_CreateRegistrationDictionaryByFillingInDictionary + * @abstract Tries to fill in missing keys in a registration dictionary. + * @param regDict The dictionary to fill in. + * @result The dictionary with the keys filled in. + * @discussion This function examines the passed-in dictionary for missing keys, + * and tries to work out correct values for them. As of 0.7, it uses: + * + * Key Value + * --- ----- + * GROWL_APP_NAME CFBundleExecutableName + * GROWL_APP_ICON The icon of the application. + * GROWL_APP_LOCATION The location of the application. + * GROWL_NOTIFICATIONS_DEFAULT GROWL_NOTIFICATIONS_ALL + * + * Keys are only filled in if missing; if a key is present in the dictionary, + * its value will not be changed. + * + * This function was introduced in Growl.framework 0.7. + */ +GROWL_EXPORT CFDictionaryRef Growl_CreateRegistrationDictionaryByFillingInDictionary(CFDictionaryRef regDict); +/*! @function Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys + * @abstract Tries to fill in missing keys in a registration dictionary. + * @param regDict The dictionary to fill in. + * @param keys The keys to fill in. If NULL, any missing keys are filled in. + * @result The dictionary with the keys filled in. + * @discussion This function examines the passed-in dictionary for missing keys, + * and tries to work out correct values for them. As of 0.7, it uses: + * + * Key Value + * --- ----- + * GROWL_APP_NAME CFBundleExecutableName + * GROWL_APP_ICON The icon of the application. + * GROWL_APP_LOCATION The location of the application. + * GROWL_NOTIFICATIONS_DEFAULT GROWL_NOTIFICATIONS_ALL + * + * Only those keys that are listed in keys will be filled in. + * Other missing keys are ignored. Also, keys are only filled in if missing; + * if a key is present in the dictionary, its value will not be changed. + * + * This function was introduced in Growl.framework 0.7. + */ +GROWL_EXPORT CFDictionaryRef Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys(CFDictionaryRef regDict, CFSetRef keys); + +/*! @brief Tries to fill in missing keys in a notification dictionary. + * @param notifDict The dictionary to fill in. + * @return The dictionary with the keys filled in. This will be a separate instance from \a notifDict. + * @discussion This function examines the \a notifDict for missing keys, and + * tries to get them from the last known registration dictionary. As of 1.1, + * the keys that it will look for are: + * + * \li GROWL_APP_NAME + * \li GROWL_APP_ICON + * + * @since Growl.framework 1.1 + */ +GROWL_EXPORT CFDictionaryRef Growl_CreateNotificationDictionaryByFillingInDictionary(CFDictionaryRef notifDict); + +#pragma mark - + +// @functiongroup Querying Growl's status + +/*! @function Growl_IsInstalled + * @abstract Determines whether the Growl prefpane and its helper app are + * installed. + * @result Returns true if Growl is installed, false otherwise. + */ +GROWL_EXPORT Boolean Growl_IsInstalled(void); + +/*! @function Growl_IsRunning + * @abstract Cycles through the process list to find whether GrowlHelperApp + * is running. + * @result Returns true if Growl is running, false otherwise. + */ +GROWL_EXPORT Boolean Growl_IsRunning(void); + +#pragma mark - + +// @functiongroup Launching Growl + +/*! @typedef GrowlLaunchCallback + * @abstract Callback to notify you that Growl is running. + * @param context The context pointer passed to Growl_LaunchIfInstalled. + * @discussion Growl_LaunchIfInstalled calls this callback function if Growl + * was already running or if it launched Growl successfully. + */ +typedef void (*GrowlLaunchCallback)(void *context); + +/*! @function Growl_LaunchIfInstalled + * @abstract Launches GrowlHelperApp if it is not already running. + * @param callback A callback function which will be called if Growl was successfully + * launched or was already running. Can be NULL. + * @param context The context pointer to pass to the callback. Can be NULL. + * @result Returns true if Growl was successfully launched or was already + * running; returns false and does not call the callback otherwise. + * @discussion Returns true and calls the callback (if the callback is not + * NULL) if the Growl helper app began launching or was already + * running. Returns false and performs no other action if Growl could not be + * launched (e.g. because the Growl preference pane is not properly installed). + * + * If Growl_CreateBestRegistrationDictionary returns + * non-NULL, this function will register with Growl atomically. + * + * The callback should take a single argument; this is to allow applications + * to have context-relevant information passed back. It is perfectly + * acceptable for context to be NULL. The callback itself can be + * NULL if you don't want one. + */ +GROWL_EXPORT Boolean Growl_LaunchIfInstalled(GrowlLaunchCallback callback, void *context); + +#pragma mark - +#pragma mark Constants + +/*! @defined GROWL_PREFPANE_BUNDLE_IDENTIFIER + * @abstract The CFBundleIdentifier of the Growl preference pane bundle. + * @discussion GrowlApplicationBridge uses this to determine whether Growl is + * currently installed, by searching for the Growl preference pane. Your + * application probably does not need to use this macro itself. + */ +#ifndef GROWL_PREFPANE_BUNDLE_IDENTIFIER +#define GROWL_PREFPANE_BUNDLE_IDENTIFIER CFSTR("com.growl.prefpanel") +#endif + +__END_DECLS + +#endif /* _GROWLAPPLICATIONBRIDGE_CARBON_H_ */ diff --git a/DiscPublishing/Resources/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h b/DiscPublishing/Resources/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h new file mode 100644 index 0000000..1e39f8d --- /dev/null +++ b/DiscPublishing/Resources/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h @@ -0,0 +1,575 @@ +// +// GrowlApplicationBridge.h +// Growl +// +// Created by Evan Schoenberg on Wed Jun 16 2004. +// Copyright 2004-2006 The Growl Project. All rights reserved. +// + +/*! + * @header GrowlApplicationBridge.h + * @abstract Defines the GrowlApplicationBridge class. + * @discussion This header defines the GrowlApplicationBridge class as well as + * the GROWL_PREFPANE_BUNDLE_IDENTIFIER constant. + */ + +#ifndef __GrowlApplicationBridge_h__ +#define __GrowlApplicationBridge_h__ + +#import +#import +#import "GrowlDefines.h" + +//Forward declarations +@protocol GrowlApplicationBridgeDelegate; + +//Internal notification when the user chooses not to install (to avoid continuing to cache notifications awaiting installation) +#define GROWL_USER_CHOSE_NOT_TO_INSTALL_NOTIFICATION @"User chose not to install" + +//------------------------------------------------------------------------------ +#pragma mark - + +/*! + * @class GrowlApplicationBridge + * @abstract A class used to interface with Growl. + * @discussion This class provides a means to interface with Growl. + * + * Currently it provides a way to detect if Growl is installed and launch the + * GrowlHelperApp if it's not already running. + */ +@interface GrowlApplicationBridge : NSObject { + +} + +/*! + * @method isGrowlInstalled + * @abstract Detects whether Growl is installed. + * @discussion Determines if the Growl prefpane and its helper app are installed. + * @result Returns YES if Growl is installed, NO otherwise. + */ ++ (BOOL) isGrowlInstalled; + +/*! + * @method isGrowlRunning + * @abstract Detects whether GrowlHelperApp is currently running. + * @discussion Cycles through the process list to find whether GrowlHelperApp is running and returns its findings. + * @result Returns YES if GrowlHelperApp is running, NO otherwise. + */ ++ (BOOL) isGrowlRunning; + +#pragma mark - + +/*! + * @method setGrowlDelegate: + * @abstract Set the object which will be responsible for providing and receiving Growl information. + * @discussion This must be called before using GrowlApplicationBridge. + * + * The methods in the GrowlApplicationBridgeDelegate protocol are required + * and return the basic information needed to register with Growl. + * + * The methods in the GrowlApplicationBridgeDelegate_InformalProtocol + * informal protocol are individually optional. They provide a greater + * degree of interaction between the application and growl such as informing + * the application when one of its Growl notifications is clicked by the user. + * + * The methods in the GrowlApplicationBridgeDelegate_Installation_InformalProtocol + * informal protocol are individually optional and are only applicable when + * using the Growl-WithInstaller.framework which allows for automated Growl + * installation. + * + * When this method is called, data will be collected from inDelegate, Growl + * will be launched if it is not already running, and the application will be + * registered with Growl. + * + * If using the Growl-WithInstaller framework, if Growl is already installed + * but this copy of the framework has an updated version of Growl, the user + * will be prompted to update automatically. + * + * @param inDelegate The delegate for the GrowlApplicationBridge. It must conform to the GrowlApplicationBridgeDelegate protocol. + */ ++ (void) setGrowlDelegate:(NSObject *)inDelegate; + +/*! + * @method growlDelegate + * @abstract Return the object responsible for providing and receiving Growl information. + * @discussion See setGrowlDelegate: for details. + * @result The Growl delegate. + */ ++ (NSObject *) growlDelegate; + +#pragma mark - + +/*! + * @method notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext: + * @abstract Send a Growl notification. + * @discussion This is the preferred means for sending a Growl notification. + * The notification name and at least one of the title and description are + * required (all three are preferred). All other parameters may be + * nil (or 0 or NO as appropriate) to accept default values. + * + * If using the Growl-WithInstaller framework, if Growl is not installed the + * user will be prompted to install Growl. If the user cancels, this method + * will have no effect until the next application session, at which time when + * it is called the user will be prompted again. The user is also given the + * option to not be prompted again. If the user does choose to install Growl, + * the requested notification will be displayed once Growl is installed and + * running. + * + * @param title The title of the notification displayed to the user. + * @param description The full description of the notification displayed to the user. + * @param notifName The internal name of the notification. Should be human-readable, as it will be displayed in the Growl preference pane. + * @param iconData NSData object to show with the notification as its icon. If nil, the application's icon will be used instead. + * @param priority The priority of the notification. The default value is 0; positive values are higher priority and negative values are lower priority. Not all Growl displays support priority. + * @param isSticky If YES, the notification will remain on screen until clicked. Not all Growl displays support sticky notifications. + * @param clickContext A context passed back to the Growl delegate if it implements -(void)growlNotificationWasClicked: and the notification is clicked. Not all display plugins support clicking. The clickContext must be plist-encodable (completely of NSString, NSArray, NSNumber, NSDictionary, and NSData types). + */ ++ (void) notifyWithTitle:(NSString *)title + description:(NSString *)description + notificationName:(NSString *)notifName + iconData:(NSData *)iconData + priority:(signed int)priority + isSticky:(BOOL)isSticky + clickContext:(id)clickContext; + +/*! + * @method notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:identifier: + * @abstract Send a Growl notification. + * @discussion This is the preferred means for sending a Growl notification. + * The notification name and at least one of the title and description are + * required (all three are preferred). All other parameters may be + * nil (or 0 or NO as appropriate) to accept default values. + * + * If using the Growl-WithInstaller framework, if Growl is not installed the + * user will be prompted to install Growl. If the user cancels, this method + * will have no effect until the next application session, at which time when + * it is called the user will be prompted again. The user is also given the + * option to not be prompted again. If the user does choose to install Growl, + * the requested notification will be displayed once Growl is installed and + * running. + * + * @param title The title of the notification displayed to the user. + * @param description The full description of the notification displayed to the user. + * @param notifName The internal name of the notification. Should be human-readable, as it will be displayed in the Growl preference pane. + * @param iconData NSData object to show with the notification as its icon. If nil, the application's icon will be used instead. + * @param priority The priority of the notification. The default value is 0; positive values are higher priority and negative values are lower priority. Not all Growl displays support priority. + * @param isSticky If YES, the notification will remain on screen until clicked. Not all Growl displays support sticky notifications. + * @param clickContext A context passed back to the Growl delegate if it implements -(void)growlNotificationWasClicked: and the notification is clicked. Not all display plugins support clicking. The clickContext must be plist-encodable (completely of NSString, NSArray, NSNumber, NSDictionary, and NSData types). + * @param identifier An identifier for this notification. Notifications with equal identifiers are coalesced. + */ ++ (void) notifyWithTitle:(NSString *)title + description:(NSString *)description + notificationName:(NSString *)notifName + iconData:(NSData *)iconData + priority:(signed int)priority + isSticky:(BOOL)isSticky + clickContext:(id)clickContext + identifier:(NSString *)identifier; + +/*! @method notifyWithDictionary: + * @abstract Notifies using a userInfo dictionary suitable for passing to + * NSDistributedNotificationCenter. + * @param userInfo The dictionary to notify with. + * @discussion Before Growl 0.6, your application would have posted + * notifications using NSDistributedNotificationCenter by + * creating a userInfo dictionary with the notification data. This had the + * advantage of allowing you to add other data to the dictionary for programs + * besides Growl that might be listening. + * + * This method allows you to use such dictionaries without being restricted + * to using NSDistributedNotificationCenter. The keys for this dictionary + * can be found in GrowlDefines.h. + */ ++ (void) notifyWithDictionary:(NSDictionary *)userInfo; + +#pragma mark - + +/*! @method registerWithDictionary: + * @abstract Register your application with Growl without setting a delegate. + * @discussion When you call this method with a dictionary, + * GrowlApplicationBridge registers your application using that dictionary. + * If you pass nil, GrowlApplicationBridge will ask the delegate + * (if there is one) for a dictionary, and if that doesn't work, it will look + * in your application's bundle for an auto-discoverable plist. + * (XXX refer to more information on that) + * + * If you pass a dictionary to this method, it must include the + * GROWL_APP_NAME key, unless a delegate is set. + * + * This method is mainly an alternative to the delegate system introduced + * with Growl 0.6. Without a delegate, you cannot receive callbacks such as + * -growlIsReady (since they are sent to the delegate). You can, + * however, set a delegate after registering without one. + * + * This method was introduced in Growl.framework 0.7. + */ ++ (BOOL) registerWithDictionary:(NSDictionary *)regDict; + +/*! @method reregisterGrowlNotifications + * @abstract Reregister the notifications for this application. + * @discussion This method does not normally need to be called. If your + * application changes what notifications it is registering with Growl, call + * this method to have the Growl delegate's + * -registrationDictionaryForGrowl method called again and the + * Growl registration information updated. + * + * This method is now implemented using -registerWithDictionary:. + */ ++ (void) reregisterGrowlNotifications; + +#pragma mark - + +/*! @method setWillRegisterWhenGrowlIsReady: + * @abstract Tells GrowlApplicationBridge to register with Growl when Growl + * launches (or not). + * @discussion When Growl has started listening for notifications, it posts a + * GROWL_IS_READY notification on the Distributed Notification + * Center. GrowlApplicationBridge listens for this notification, using it to + * perform various tasks (such as calling your delegate's + * -growlIsReady method, if it has one). If this method is + * called with YES, one of those tasks will be to reregister + * with Growl (in the manner of -reregisterGrowlNotifications). + * + * This attribute is automatically set back to NO (the default) + * after every GROWL_IS_READY notification. + * @param flag YES if you want GrowlApplicationBridge to register with + * Growl when next it is ready; NO if not. + */ ++ (void) setWillRegisterWhenGrowlIsReady:(BOOL)flag; +/*! @method willRegisterWhenGrowlIsReady + * @abstract Reports whether GrowlApplicationBridge will register with Growl + * when Growl next launches. + * @result YES if GrowlApplicationBridge will register with Growl + * when next it posts GROWL_IS_READY; NO if not. + */ ++ (BOOL) willRegisterWhenGrowlIsReady; + +#pragma mark - + +/*! @method registrationDictionaryFromDelegate + * @abstract Asks the delegate for a registration dictionary. + * @discussion If no delegate is set, or if the delegate's + * -registrationDictionaryForGrowl method returns + * nil, this method returns nil. + * + * This method does not attempt to clean up the dictionary in any way - for + * example, if it is missing the GROWL_APP_NAME key, the result + * will be missing it too. Use +[GrowlApplicationBridge + * registrationDictionaryByFillingInDictionary:] or + * +[GrowlApplicationBridge + * registrationDictionaryByFillingInDictionary:restrictToKeys:] to try + * to fill in missing keys. + * + * This method was introduced in Growl.framework 0.7. + * @result A registration dictionary. + */ ++ (NSDictionary *) registrationDictionaryFromDelegate; + +/*! @method registrationDictionaryFromBundle: + * @abstract Looks in a bundle for a registration dictionary. + * @discussion This method looks in a bundle for an auto-discoverable + * registration dictionary file using -[NSBundle + * pathForResource:ofType:]. If it finds one, it loads the file using + * +[NSDictionary dictionaryWithContentsOfFile:] and returns the + * result. + * + * If you pass nil as the bundle, the main bundle is examined. + * + * This method does not attempt to clean up the dictionary in any way - for + * example, if it is missing the GROWL_APP_NAME key, the result + * will be missing it too. Use +[GrowlApplicationBridge + * registrationDictionaryByFillingInDictionary:] or + * +[GrowlApplicationBridge + * registrationDictionaryByFillingInDictionary:restrictToKeys:] to try + * to fill in missing keys. + * + * This method was introduced in Growl.framework 0.7. + * @result A registration dictionary. + */ ++ (NSDictionary *) registrationDictionaryFromBundle:(NSBundle *)bundle; + +/*! @method bestRegistrationDictionary + * @abstract Obtains a registration dictionary, filled out to the best of + * GrowlApplicationBridge's knowledge. + * @discussion This method creates a registration dictionary as best + * GrowlApplicationBridge knows how. + * + * First, GrowlApplicationBridge contacts the Growl delegate (if there is + * one) and gets the registration dictionary from that. If no such dictionary + * was obtained, GrowlApplicationBridge looks in your application's main + * bundle for an auto-discoverable registration dictionary file. If that + * doesn't exist either, this method returns nil. + * + * Second, GrowlApplicationBridge calls + * +registrationDictionaryByFillingInDictionary: with whatever + * dictionary was obtained. The result of that method is the result of this + * method. + * + * GrowlApplicationBridge uses this method when you call + * +setGrowlDelegate:, or when you call + * +registerWithDictionary: with nil. + * + * This method was introduced in Growl.framework 0.7. + * @result A registration dictionary. + */ ++ (NSDictionary *) bestRegistrationDictionary; + +#pragma mark - + +/*! @method registrationDictionaryByFillingInDictionary: + * @abstract Tries to fill in missing keys in a registration dictionary. + * @discussion This method examines the passed-in dictionary for missing keys, + * and tries to work out correct values for them. As of 0.7, it uses: + * + * Key Value + * --- ----- + * GROWL_APP_NAME CFBundleExecutableName + * GROWL_APP_ICON The icon of the application. + * GROWL_APP_LOCATION The location of the application. + * GROWL_NOTIFICATIONS_DEFAULT GROWL_NOTIFICATIONS_ALL + * + * Keys are only filled in if missing; if a key is present in the dictionary, + * its value will not be changed. + * + * This method was introduced in Growl.framework 0.7. + * @param regDict The dictionary to fill in. + * @result The dictionary with the keys filled in. This is an autoreleased + * copy of regDict. + */ ++ (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict; +/*! @method registrationDictionaryByFillingInDictionary:restrictToKeys: + * @abstract Tries to fill in missing keys in a registration dictionary. + * @discussion This method examines the passed-in dictionary for missing keys, + * and tries to work out correct values for them. As of 0.7, it uses: + * + * Key Value + * --- ----- + * GROWL_APP_NAME CFBundleExecutableName + * GROWL_APP_ICON The icon of the application. + * GROWL_APP_LOCATION The location of the application. + * GROWL_NOTIFICATIONS_DEFAULT GROWL_NOTIFICATIONS_ALL + * + * Only those keys that are listed in keys will be filled in. + * Other missing keys are ignored. Also, keys are only filled in if missing; + * if a key is present in the dictionary, its value will not be changed. + * + * This method was introduced in Growl.framework 0.7. + * @param regDict The dictionary to fill in. + * @param keys The keys to fill in. If nil, any missing keys are filled in. + * @result The dictionary with the keys filled in. This is an autoreleased + * copy of regDict. + */ ++ (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict restrictToKeys:(NSSet *)keys; + +/*! @brief Tries to fill in missing keys in a notification dictionary. + * @param notifDict The dictionary to fill in. + * @return The dictionary with the keys filled in. This will be a separate instance from \a notifDict. + * @discussion This function examines the \a notifDict for missing keys, and + * tries to get them from the last known registration dictionary. As of 1.1, + * the keys that it will look for are: + * + * \li GROWL_APP_NAME + * \li GROWL_APP_ICON + * + * @since Growl.framework 1.1 + */ ++ (NSDictionary *) notificationDictionaryByFillingInDictionary:(NSDictionary *)regDict; + ++ (NSDictionary *) frameworkInfoDictionary; +@end + +//------------------------------------------------------------------------------ +#pragma mark - + +/*! + * @protocol GrowlApplicationBridgeDelegate + * @abstract Required protocol for the Growl delegate. + * @discussion The methods in this protocol are required and are called + * automatically as needed by GrowlApplicationBridge. See + * +[GrowlApplicationBridge setGrowlDelegate:]. + * See also GrowlApplicationBridgeDelegate_InformalProtocol. + */ + +@protocol GrowlApplicationBridgeDelegate + +// -registrationDictionaryForGrowl has moved to the informal protocol as of 0.7. + +@end + +//------------------------------------------------------------------------------ +#pragma mark - + +/*! + * @category NSObject(GrowlApplicationBridgeDelegate_InformalProtocol) + * @abstract Methods which may be optionally implemented by the GrowlDelegate. + * @discussion The methods in this informal protocol will only be called if implemented by the delegate. + */ +@interface NSObject (GrowlApplicationBridgeDelegate_InformalProtocol) + +/*! + * @method registrationDictionaryForGrowl + * @abstract Return the dictionary used to register this application with Growl. + * @discussion The returned dictionary gives Growl the complete list of + * notifications this application will ever send, and it also specifies which + * notifications should be enabled by default. Each is specified by an array + * of NSString objects. + * + * For most applications, these two arrays can be the same (if all sent + * notifications should be displayed by default). + * + * The NSString objects of these arrays will correspond to the + * notificationName: parameter passed in + * +[GrowlApplicationBridge + * notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:] calls. + * + * The dictionary should have the required key object pairs: + * key: GROWL_NOTIFICATIONS_ALL object: NSArray of NSString objects + * key: GROWL_NOTIFICATIONS_DEFAULT object: NSArray of NSString objects + * + * The dictionary may have the following key object pairs: + * key: GROWL_NOTIFICATIONS_HUMAN_READABLE_NAMES object: NSDictionary of key: notification name object: human-readable notification name + * + * You do not need to implement this method if you have an auto-discoverable + * plist file in your app bundle. (XXX refer to more information on that) + * + * @result The NSDictionary to use for registration. + */ +- (NSDictionary *) registrationDictionaryForGrowl; + +/*! + * @method applicationNameForGrowl + * @abstract Return the name of this application which will be used for Growl bookkeeping. + * @discussion This name is used both internally and in the Growl preferences. + * + * This should remain stable between different versions and incarnations of + * your application. + * For example, "SurfWriter" is a good app name, whereas "SurfWriter 2.0" and + * "SurfWriter Lite" are not. + * + * You do not need to implement this method if you are providing the + * application name elsewhere, meaning in an auto-discoverable plist file in + * your app bundle (XXX refer to more information on that) or in the result + * of -registrationDictionaryForGrowl. + * + * @result The name of the application using Growl. + */ +- (NSString *) applicationNameForGrowl; + +/*! + * @method applicationIconForGrowl + * @abstract Return the NSImage to treat as the application icon. + * @discussion The delegate may optionally return an NSImage + * object to use as the application icon. If this method is not implemented, + * {{{-applicationIconDataForGrowl}}} is tried. If that method is not + * implemented, the application's own icon is used. Neither method is + * generally needed. + * @result The NSImage to treat as the application icon. + */ +- (NSImage *) applicationIconForGrowl; + +/*! + * @method applicationIconDataForGrowl + * @abstract Return the NSData to treat as the application icon. + * @discussion The delegate may optionally return an NSData + * object to use as the application icon; if this is not implemented, the + * application's own icon is used. This is not generally needed. + * @result The NSData to treat as the application icon. + * @deprecated In version 1.1, in favor of {{{-applicationIconForGrowl}}}. + */ +- (NSData *) applicationIconDataForGrowl; + +/*! + * @method growlIsReady + * @abstract Informs the delegate that Growl has launched. + * @discussion Informs the delegate that Growl (specifically, the + * GrowlHelperApp) was launched successfully. The application can take actions + * with the knowledge that Growl is installed and functional. + */ +- (void) growlIsReady; + +/*! + * @method growlNotificationWasClicked: + * @abstract Informs the delegate that a Growl notification was clicked. + * @discussion Informs the delegate that a Growl notification was clicked. It + * is only sent for notifications sent with a non-nil + * clickContext, so if you want to receive a message when a notification is + * clicked, clickContext must not be nil when calling + * +[GrowlApplicationBridge notifyWithTitle: description:notificationName:iconData:priority:isSticky:clickContext:]. + * @param clickContext The clickContext passed when displaying the notification originally via +[GrowlApplicationBridge notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:]. + */ +- (void) growlNotificationWasClicked:(id)clickContext; + +/*! + * @method growlNotificationTimedOut: + * @abstract Informs the delegate that a Growl notification timed out. + * @discussion Informs the delegate that a Growl notification timed out. It + * is only sent for notifications sent with a non-nil + * clickContext, so if you want to receive a message when a notification is + * clicked, clickContext must not be nil when calling + * +[GrowlApplicationBridge notifyWithTitle: description:notificationName:iconData:priority:isSticky:clickContext:]. + * @param clickContext The clickContext passed when displaying the notification originally via +[GrowlApplicationBridge notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:]. + */ +- (void) growlNotificationTimedOut:(id)clickContext; + +@end + +#pragma mark - +/*! + * @category NSObject(GrowlApplicationBridgeDelegate_Installation_InformalProtocol) + * @abstract Methods which may be optionally implemented by the Growl delegate when used with Growl-WithInstaller.framework. + * @discussion The methods in this informal protocol will only be called if + * implemented by the delegate. They allow greater control of the information + * presented to the user when installing or upgrading Growl from within your + * application when using Growl-WithInstaller.framework. + */ +@interface NSObject (GrowlApplicationBridgeDelegate_Installation_InformalProtocol) + +/*! + * @method growlInstallationWindowTitle + * @abstract Return the title of the installation window. + * @discussion If not implemented, Growl will use a default, localized title. + * @result An NSString object to use as the title. + */ +- (NSString *)growlInstallationWindowTitle; + +/*! + * @method growlUpdateWindowTitle + * @abstract Return the title of the upgrade window. + * @discussion If not implemented, Growl will use a default, localized title. + * @result An NSString object to use as the title. + */ +- (NSString *)growlUpdateWindowTitle; + +/*! + * @method growlInstallationInformation + * @abstract Return the information to display when installing. + * @discussion This information may be as long or short as desired (the window + * will be sized to fit it). It will be displayed to the user as an + * explanation of what Growl is and what it can do in your application. It + * should probably note that no download is required to install. + * + * If this is not implemented, Growl will use a default, localized explanation. + * @result An NSAttributedString object to display. + */ +- (NSAttributedString *)growlInstallationInformation; + +/*! + * @method growlUpdateInformation + * @abstract Return the information to display when upgrading. + * @discussion This information may be as long or short as desired (the window + * will be sized to fit it). It will be displayed to the user as an + * explanation that an updated version of Growl is included in your + * application and no download is required. + * + * If this is not implemented, Growl will use a default, localized explanation. + * @result An NSAttributedString object to display. + */ +- (NSAttributedString *)growlUpdateInformation; + +@end + +//private +@interface GrowlApplicationBridge (GrowlInstallationPrompt_private) ++ (void) _userChoseNotToInstallGrowl; +@end + +#endif /* __GrowlApplicationBridge_h__ */ diff --git a/DiscPublishing/Resources/Growl.framework/Versions/A/Headers/GrowlDefines.h b/DiscPublishing/Resources/Growl.framework/Versions/A/Headers/GrowlDefines.h new file mode 100644 index 0000000..2b971cf --- /dev/null +++ b/DiscPublishing/Resources/Growl.framework/Versions/A/Headers/GrowlDefines.h @@ -0,0 +1,348 @@ +// +// GrowlDefines.h +// + +#ifndef _GROWLDEFINES_H +#define _GROWLDEFINES_H + +#ifdef __OBJC__ +#define XSTR(x) (@x) +#define STRING_TYPE NSString * +#else +#define XSTR CFSTR +#define STRING_TYPE CFStringRef +#endif + +/*! @header GrowlDefines.h + * @abstract Defines all the notification keys. + * @discussion Defines all the keys used for registration with Growl and for + * Growl notifications. + * + * Most applications should use the functions or methods of Growl.framework + * instead of posting notifications such as those described here. + * @updated 2004-01-25 + */ + +// UserInfo Keys for Registration +#pragma mark UserInfo Keys for Registration + +/*! @group Registration userInfo keys */ +/* @abstract Keys for the userInfo dictionary of a GROWL_APP_REGISTRATION distributed notification. + * @discussion The values of these keys describe the application and the + * notifications it may post. + * + * Your application must register with Growl before it can post Growl + * notifications (and have them not be ignored). However, as of Growl 0.6, + * posting GROWL_APP_REGISTRATION notifications directly is no longer the + * preferred way to register your application. Your application should instead + * use Growl.framework's delegate system. + * See +[GrowlApplicationBridge setGrowlDelegate:] or Growl_SetDelegate for + * more information. + */ + +/*! @defined GROWL_APP_NAME + * @abstract The name of your application. + * @discussion The name of your application. This should remain stable between + * different versions and incarnations of your application. + * For example, "SurfWriter" is a good app name, whereas "SurfWriter 2.0" and + * "SurfWriter Lite" are not. + */ +#define GROWL_APP_NAME XSTR("ApplicationName") +/*! @defined GROWL_APP_ID + * @abstract The bundle identifier of your application. + * @discussion The bundle identifier of your application. This key should + * be unique for your application while there may be several applications + * with the same GROWL_APP_NAME. + * This key is optional. + */ +#define GROWL_APP_ID XSTR("ApplicationId") +/*! @defined GROWL_APP_ICON + * @abstract The image data for your application's icon. + * @discussion Image data representing your application's icon. This may be + * superimposed on a notification icon as a badge, used as the notification + * icon when a notification-specific icon is not supplied, or ignored + * altogether, depending on the display. Must be in a format supported by + * NSImage, such as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF. + * + * Optional. Not supported by all display plugins. + */ +#define GROWL_APP_ICON XSTR("ApplicationIcon") +/*! @defined GROWL_NOTIFICATIONS_DEFAULT + * @abstract The array of notifications to turn on by default. + * @discussion These are the names of the notifications that should be enabled + * by default when your application registers for the first time. If your + * application reregisters, Growl will look here for any new notification + * names found in GROWL_NOTIFICATIONS_ALL, but ignore any others. + */ +#define GROWL_NOTIFICATIONS_DEFAULT XSTR("DefaultNotifications") +/*! @defined GROWL_NOTIFICATIONS_ALL + * @abstract The array of all notifications your application can send. + * @discussion These are the names of all of the notifications that your + * application may post. See GROWL_NOTIFICATION_NAME for a discussion of good + * notification names. + */ +#define GROWL_NOTIFICATIONS_ALL XSTR("AllNotifications") +/*! @defined GROWL_NOTIFICATIONS_HUMAN_READABLE_DESCRIPTIONS + * @abstract A dictionary of human-readable names for your notifications. + * @discussion By default, the Growl UI will display notifications by the names given in GROWL_NOTIFICATIONS_ALL + * which correspond to the GROWL_NOTIFICATION_NAME. This dictionary specifies the human-readable name to display. + * The keys of the dictionary are GROWL_NOTIFICATION_NAME strings; the objects are the human-readable versions. + * For any GROWL_NOTIFICATION_NAME not specific in this dictionary, the GROWL_NOTIFICATION_NAME will be displayed. + * + * This key is optional. + */ +#define GROWL_NOTIFICATIONS_HUMAN_READABLE_NAMES XSTR("HumanReadableNames") +/*! @defined GROWL_NOTIFICATIONS_DESCRIPTIONS +* @abstract A dictionary of descriptions of _when_ each notification occurs +* @discussion This is an NSDictionary whose keys are GROWL_NOTIFICATION_NAME strings and whose objects are +* descriptions of _when_ each notification occurs, such as "You received a new mail message" or +* "A file finished downloading". +* +* This key is optional. +*/ +#define GROWL_NOTIFICATIONS_DESCRIPTIONS XSTR("NotificationDescriptions") + +/*! @defined GROWL_TICKET_VERSION + * @abstract The version of your registration ticket. + * @discussion Include this key in a ticket plist file that you put in your + * application bundle for auto-discovery. The current ticket version is 1. + */ +#define GROWL_TICKET_VERSION XSTR("TicketVersion") +// UserInfo Keys for Notifications +#pragma mark UserInfo Keys for Notifications + +/*! @group Notification userInfo keys */ +/* @abstract Keys for the userInfo dictionary of a GROWL_NOTIFICATION distributed notification. + * @discussion The values of these keys describe the content of a Growl + * notification. + * + * Not all of these keys are supported by all displays. Only the name, title, + * and description of a notification are universal. Most of the built-in + * displays do support all of these keys, and most other visual displays + * probably will also. But, as of 0.6, the Log, MailMe, and Speech displays + * support only textual data. + */ + +/*! @defined GROWL_NOTIFICATION_NAME + * @abstract The name of the notification. + * @discussion The name of the notification. Note that if you do not define + * GROWL_NOTIFICATIONS_HUMAN_READABLE_NAMES when registering your ticket originally this name + * will the one displayed within the Growl preference pane and should be human-readable. + */ +#define GROWL_NOTIFICATION_NAME XSTR("NotificationName") +/*! @defined GROWL_NOTIFICATION_TITLE + * @abstract The title to display in the notification. + * @discussion The title of the notification. Should be very brief. + * The title usually says what happened, e.g. "Download complete". + */ +#define GROWL_NOTIFICATION_TITLE XSTR("NotificationTitle") +/*! @defined GROWL_NOTIFICATION_DESCRIPTION + * @abstract The description to display in the notification. + * @discussion The description should be longer and more verbose than the title. + * The description usually tells the subject of the action, + * e.g. "Growl-0.6.dmg downloaded in 5.02 minutes". + */ +#define GROWL_NOTIFICATION_DESCRIPTION XSTR("NotificationDescription") +/*! @defined GROWL_NOTIFICATION_ICON + * @discussion Image data for the notification icon. Must be in a format + * supported by NSImage, such as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF. + * + * Optional. Not supported by all display plugins. + */ +#define GROWL_NOTIFICATION_ICON XSTR("NotificationIcon") +/*! @defined GROWL_NOTIFICATION_APP_ICON + * @discussion Image data for the application icon, in case GROWL_APP_ICON does + * not apply for some reason. Must be in a format supported by NSImage, such + * as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF. + * + * Optional. Not supported by all display plugins. + */ +#define GROWL_NOTIFICATION_APP_ICON XSTR("NotificationAppIcon") +/*! @defined GROWL_NOTIFICATION_PRIORITY + * @discussion The priority of the notification as an integer number from + * -2 to +2 (+2 being highest). + * + * Optional. Not supported by all display plugins. + */ +#define GROWL_NOTIFICATION_PRIORITY XSTR("NotificationPriority") +/*! @defined GROWL_NOTIFICATION_STICKY + * @discussion A Boolean number controlling whether the notification is sticky. + * + * Optional. Not supported by all display plugins. + */ +#define GROWL_NOTIFICATION_STICKY XSTR("NotificationSticky") +/*! @defined GROWL_NOTIFICATION_CLICK_CONTEXT + * @abstract Identifies which notification was clicked. + * @discussion An identifier for the notification for clicking purposes. + * + * This will be passed back to the application when the notification is + * clicked. It must be plist-encodable (a data, dictionary, array, number, or + * string object), and it should be unique for each notification you post. + * A good click context would be a UUID string returned by NSProcessInfo or + * CFUUID. + * + * Optional. Not supported by all display plugins. + */ +#define GROWL_NOTIFICATION_CLICK_CONTEXT XSTR("NotificationClickContext") + +/*! @defined GROWL_DISPLAY_PLUGIN + * @discussion The name of a display plugin which should be used for this notification. + * Optional. If this key is not set or the specified display plugin does not + * exist, the display plugin stored in the application ticket is used. This key + * allows applications to use different default display plugins for their + * notifications. The user can still override those settings in the preference + * pane. + */ +#define GROWL_DISPLAY_PLUGIN XSTR("NotificationDisplayPlugin") + +/*! @defined GROWL_NOTIFICATION_IDENTIFIER + * @abstract An identifier for the notification for coalescing purposes. + * Notifications with the same identifier fall into the same class; only + * the last notification of a class is displayed on the screen. If a + * notification of the same class is currently being displayed, it is + * replaced by this notification. + * + * Optional. Not supported by all display plugins. + */ +#define GROWL_NOTIFICATION_IDENTIFIER XSTR("GrowlNotificationIdentifier") + +/*! @defined GROWL_APP_PID + * @abstract The process identifier of the process which sends this + * notification. If this field is set, the application will only receive + * clicked and timed out notifications which originate from this process. + * + * Optional. + */ +#define GROWL_APP_PID XSTR("ApplicationPID") + +/*! @defined GROWL_NOTIFICATION_PROGRESS +* @abstract If this key is set, it should contain a double value wrapped +* in a NSNumber which describes some sort of progress (from 0.0 to 100.0). +* If this is key is not set, no progress bar is shown. +* +* Optional. Not supported by all display plugins. +*/ +#define GROWL_NOTIFICATION_PROGRESS XSTR("NotificationProgress") + +// Notifications +#pragma mark Notifications + +/*! @group Notification names */ +/* @abstract Names of distributed notifications used by Growl. + * @discussion These are notifications used by applications (directly or + * indirectly) to interact with Growl, and by Growl for interaction between + * its components. + * + * Most of these should no longer be used in Growl 0.6 and later, in favor of + * Growl.framework's GrowlApplicationBridge APIs. + */ + +/*! @defined GROWL_APP_REGISTRATION + * @abstract The distributed notification for registering your application. + * @discussion This is the name of the distributed notification that can be + * used to register applications with Growl. + * + * The userInfo dictionary for this notification can contain these keys: + *
    + *
  • GROWL_APP_NAME
  • + *
  • GROWL_APP_ICON
  • + *
  • GROWL_NOTIFICATIONS_ALL
  • + *
  • GROWL_NOTIFICATIONS_DEFAULT
  • + *
+ * + * No longer recommended as of Growl 0.6. An alternate method of registering + * is to use Growl.framework's delegate system. + * See +[GrowlApplicationBridge setGrowlDelegate:] or Growl_SetDelegate for + * more information. + */ +#define GROWL_APP_REGISTRATION XSTR("GrowlApplicationRegistrationNotification") +/*! @defined GROWL_APP_REGISTRATION_CONF + * @abstract The distributed notification for confirming registration. + * @discussion The name of the distributed notification sent to confirm the + * registration. Used by the Growl preference pane. Your application probably + * does not need to use this notification. + */ +#define GROWL_APP_REGISTRATION_CONF XSTR("GrowlApplicationRegistrationConfirmationNotification") +/*! @defined GROWL_NOTIFICATION + * @abstract The distributed notification for Growl notifications. + * @discussion This is what it all comes down to. This is the name of the + * distributed notification that your application posts to actually send a + * Growl notification. + * + * The userInfo dictionary for this notification can contain these keys: + *
    + *
  • GROWL_NOTIFICATION_NAME (required)
  • + *
  • GROWL_NOTIFICATION_TITLE (required)
  • + *
  • GROWL_NOTIFICATION_DESCRIPTION (required)
  • + *
  • GROWL_NOTIFICATION_ICON
  • + *
  • GROWL_NOTIFICATION_APP_ICON
  • + *
  • GROWL_NOTIFICATION_PRIORITY
  • + *
  • GROWL_NOTIFICATION_STICKY
  • + *
  • GROWL_NOTIFICATION_CLICK_CONTEXT
  • + *
  • GROWL_APP_NAME (required)
  • + *
+ * + * No longer recommended as of Growl 0.6. Three alternate methods of posting + * notifications are +[GrowlApplicationBridge notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:], + * Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext, and + * Growl_PostNotification. + */ +#define GROWL_NOTIFICATION XSTR("GrowlNotification") +/*! @defined GROWL_SHUTDOWN +* @abstract The distributed notification name that tells Growl to shutdown. +* @discussion The Growl preference pane posts this notification when the +* "Stop Growl" button is clicked. +*/ +#define GROWL_SHUTDOWN XSTR("GrowlShutdown") +/*! @defined GROWL_PING + * @abstract A distributed notification to check whether Growl is running. + * @discussion This is used by the Growl preference pane. If it receives a + * GROWL_PONG, the preference pane takes this to mean that Growl is running. + */ +#define GROWL_PING XSTR("Honey, Mind Taking Out The Trash") +/*! @defined GROWL_PONG + * @abstract The distributed notification sent in reply to GROWL_PING. + * @discussion GrowlHelperApp posts this in reply to GROWL_PING. + */ +#define GROWL_PONG XSTR("What Do You Want From Me, Woman") +/*! @defined GROWL_IS_READY + * @abstract The distributed notification sent when Growl starts up. + * @discussion GrowlHelperApp posts this when it has begin listening on all of + * its sources for new notifications. GrowlApplicationBridge (in + * Growl.framework), upon receiving this notification, reregisters using the + * registration dictionary supplied by its delegate. + */ +#define GROWL_IS_READY XSTR("Lend Me Some Sugar; I Am Your Neighbor!") +/*! @defined GROWL_NOTIFICATION_CLICKED + * @abstract The distributed notification sent when a supported notification is clicked. + * @discussion When a Growl notification with a click context is clicked on by + * the user, Growl posts this distributed notification. + * The GrowlApplicationBridge responds to this notification by calling a + * callback in its delegate. + */ +#define GROWL_NOTIFICATION_CLICKED XSTR("GrowlClicked!") +#define GROWL_NOTIFICATION_TIMED_OUT XSTR("GrowlTimedOut!") + +/*! @group Other symbols */ +/* Symbols which don't fit into any of the other categories. */ + +/*! @defined GROWL_KEY_CLICKED_CONTEXT + * @abstract Used internally as the key for the clickedContext passed over DNC. + * @discussion This key is used in GROWL_NOTIFICATION_CLICKED, and contains the + * click context that was supplied in the original notification. + */ +#define GROWL_KEY_CLICKED_CONTEXT XSTR("ClickedContext") +/*! @defined GROWL_REG_DICT_EXTENSION + * @abstract The filename extension for registration dictionaries. + * @discussion The GrowlApplicationBridge in Growl.framework registers with + * Growl by creating a file with the extension of .(GROWL_REG_DICT_EXTENSION) + * and opening it in the GrowlHelperApp. This happens whether or not Growl is + * running; if it was stopped, it quits immediately without listening for + * notifications. + */ +#define GROWL_REG_DICT_EXTENSION XSTR("growlRegDict") + + +#define GROWL_POSITION_PREFERENCE_KEY @"GrowlSelectedPosition" + +#endif //ndef _GROWLDEFINES_H diff --git a/DiscPublishing/Resources/Growl.framework/Versions/A/Resources/Info.plist b/DiscPublishing/Resources/Growl.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..ed72359 --- /dev/null +++ b/DiscPublishing/Resources/Growl.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,40 @@ + + + + + BuildMachineOSBuild + 10J869 + CFBundleDevelopmentRegion + English + CFBundleExecutable + Growl + CFBundleIdentifier + com.growl.growlframework + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.2.2 + CFBundleSignature + GRRR + CFBundleVersion + 1.2.2 + DTCompiler + 4.0 + DTPlatformBuild + 10M2518 + DTPlatformVersion + PG + DTSDKBuild + 9L31a + DTSDKName + macosx10.5 + DTXcode + 0400 + DTXcodeBuild + 10M2518 + NSPrincipalClass + GrowlApplicationBridge + + diff --git a/DiscPublishing/Resources/Growl.framework/Versions/Current b/DiscPublishing/Resources/Growl.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/DiscPublishing/Resources/Growl.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/DiscPublishing/Resources/Info.plist b/DiscPublishing/Resources/Info.plist index d82bdaa..18d4df7 100644 --- a/DiscPublishing/Resources/Info.plist +++ b/DiscPublishing/Resources/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.3.1 + 1.3.3 CFBundleIdentifier com.osirix.discpublishing CFBundleSignature @@ -23,7 +23,7 @@ Publish NSHumanReadableCopyright - © 2010-2012 OsiriX Team + © 2010-2013 OsiriX Team NSPrincipalClass DiscPublishing ToolbarIcon diff --git a/DiscPublishing/Resources/Nitrogen.framework/Headers b/DiscPublishing/Resources/Nitrogen.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/DiscPublishing/Resources/Nitrogen.framework/Nitrogen b/DiscPublishing/Resources/Nitrogen.framework/Nitrogen new file mode 120000 index 0000000..e564cc7 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Nitrogen @@ -0,0 +1 @@ +Versions/Current/Nitrogen \ No newline at end of file diff --git a/DiscPublishing/Resources/Nitrogen.framework/Resources b/DiscPublishing/Resources/Nitrogen.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/ISO8601DateFormatter.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/ISO8601DateFormatter.h new file mode 100644 index 0000000..073e3ca --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/ISO8601DateFormatter.h @@ -0,0 +1,71 @@ +/*ISO8601DateFormatter.h + * + *Created by Peter Hosey on 2009-04-11. + *Copyright 2009 Peter Hosey. All rights reserved. + */ + +#import + +/*This class converts dates to and from ISO 8601 strings. A good introduction to ISO 8601: + * + *Parsing can be done strictly, or not. When you parse loosely, leading whitespace is ignored, as is anything after the date. + *The loose parser will return an NSDate for this string: @" \t\r\n\f\t 2006-03-02!!!" + *Leading non-whitespace will not be ignored; the string will be rejected, and nil returned. See the README that came with this addition. + * + *The strict parser will only accept a string if the date is the entire string. The above string would be rejected immediately, solely on these grounds. + *Also, the loose parser provides some extensions that the strict parser doesn't. + *For example, the standard says for "-DDD" (an ordinal date in the implied year) that the logical representation (meaning, hierarchically) would be "--DDD", but because that extra hyphen is "superfluous", it was omitted. + *The loose parser will accept the extra hyphen; the strict parser will not. + *A full list of these extensions is in the README file. + */ + +/*The format to either expect or produce. + *Calendar format is YYYY-MM-DD. + *Ordinal format is YYYY-DDD, where DDD ranges from 1 to 366; for example, 2009-32 is 2009-02-01. + *Week format is YYYY-Www-D, where ww ranges from 1 to 53 (the 'W' is literal) and D ranges from 1 to 7; for example, 2009-W05-07. + */ +enum { + ISO8601DateFormatCalendar, + ISO8601DateFormatOrdinal, + ISO8601DateFormatWeek, +}; +typedef NSUInteger ISO8601DateFormat; + +//The default separator for time values. Currently, this is ':'. +extern unichar ISO8601DefaultTimeSeparatorCharacter; + +@interface ISO8601DateFormatter: NSFormatter +{ + NSTimeZone *defaultTimeZone; + ISO8601DateFormat format; + unichar timeSeparator; + BOOL includeTime; + BOOL parsesStrictly; +} + +@property(retain) NSTimeZone *defaultTimeZone; + +#pragma mark Parsing + +//As a formatter, this object converts strings to dates. + +@property BOOL parsesStrictly; + +- (NSDateComponents *) dateComponentsFromString:(NSString *)string; +- (NSDateComponents *) dateComponentsFromString:(NSString *)string timeZone:(out NSTimeZone **)outTimeZone; +- (NSDateComponents *) dateComponentsFromString:(NSString *)string timeZone:(out NSTimeZone **)outTimeZone range:(out NSRange *)outRange; + +- (NSDate *) dateFromString:(NSString *)string; +- (NSDate *) dateFromString:(NSString *)string timeZone:(out NSTimeZone **)outTimeZone; +- (NSDate *) dateFromString:(NSString *)string timeZone:(out NSTimeZone **)outTimeZone range:(out NSRange *)outRange; + +#pragma mark Unparsing + +@property ISO8601DateFormat format; +@property BOOL includeTime; +@property unichar timeSeparator; + +- (NSString *) stringFromDate:(NSDate *)date; +- (NSString *) stringFromDate:(NSDate *)date timeZone:(NSTimeZone *)timeZone; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/JSON.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/JSON.h new file mode 100644 index 0000000..1e58c9a --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/JSON.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2009 Stig Brautaset. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * 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. + + * Neither the name of the author nor the names of its contributors may be used + to endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE 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 OWNER 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. + */ + +/** + @mainpage A strict JSON parser and generator for Objective-C + + JSON (JavaScript Object Notation) is a lightweight data-interchange + format. This framework provides two apis for parsing and generating + JSON. One standard object-based and a higher level api consisting of + categories added to existing Objective-C classes. + + Learn more on the http://code.google.com/p/json-framework project site. + + This framework does its best to be as strict as possible, both in what it + accepts and what it generates. For example, it does not support trailing commas + in arrays or objects. Nor does it support embedded comments, or + anything else not in the JSON specification. This is considered a feature. + +*/ + +#import "SBJSON.h" +#import "NSObject+SBJSON.h" +#import "NSString+SBJSON.h" + diff --git a/Reporter/Sources/KBPopUpToolbarItem.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/KBPopUpToolbarItem.h similarity index 72% rename from Reporter/Sources/KBPopUpToolbarItem.h rename to DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/KBPopUpToolbarItem.h index 9d4d733..8552559 100644 --- a/Reporter/Sources/KBPopUpToolbarItem.h +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/KBPopUpToolbarItem.h @@ -13,12 +13,22 @@ @class KBDelayedPopUpButton; -@interface ReporterKBPopUpToolbarItem : NSToolbarItem +@interface KBPopUpToolbarItem : NSToolbarItem { KBDelayedPopUpButton *button; NSImage *smallImage; NSImage *regularImage; } + - (void)setMenu:(NSMenu *)menu; - (NSMenu *)menu; + @end + +@interface KBDelayedPopUpButtonCell : NSButtonCell { + NSBezierPath* arrowPath; +} + +@property (nonatomic,retain) NSBezierPath* arrowPath; + +@end \ No newline at end of file diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2AdaptiveBox.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2AdaptiveBox.h new file mode 100644 index 0000000..aa78f7d --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2AdaptiveBox.h @@ -0,0 +1,33 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface N2AdaptiveBox : NSBox { + NSSize idealContentSize; +} + +-(void)setContentView:(NSView*)view; +-(NSAnimation*)adaptContainersToIdealSize:(NSSize)size; +-(NSAnimation*)adaptContainersToIdealSize; + +@end + + +@interface NSWindowController (N2AdaptiveBox) + +-(NSAnimation*)synchronizeSizeWithContent; + +@end \ No newline at end of file diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Alignment.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Alignment.h new file mode 100644 index 0000000..37a75ed --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Alignment.h @@ -0,0 +1,25 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + + +#import + +typedef uint8_t N2Alignment; + +extern const N2Alignment N2Top; +extern const N2Alignment N2Bottom; +extern const N2Alignment N2Left; +extern const N2Alignment N2Right; + +extern NSRect NSRectCenteredInRect(NSRect r, NSRect r2); diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Button.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Button.h new file mode 100644 index 0000000..02e3278 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Button.h @@ -0,0 +1,24 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface N2Button : NSButton { + id _representedObject; +} + +@property(retain) id representedObject; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ButtonCell.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ButtonCell.h new file mode 100644 index 0000000..a4bb5c0 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ButtonCell.h @@ -0,0 +1,22 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface N2ButtonCell : NSButtonCell { +// NSString* _keyEq; +} + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2CSV.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2CSV.h new file mode 100644 index 0000000..b2487d6 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2CSV.h @@ -0,0 +1,24 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import + + +@interface N2CSV : NSObject { +} + ++(NSString*)quote:(NSString*)str; ++(NSString*)stringFromArray:(NSArray*)array; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2CellDescriptor.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2CellDescriptor.h new file mode 100644 index 0000000..bd13807 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2CellDescriptor.h @@ -0,0 +1,60 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import +#import "N2MinMax.h" +#import "N2Alignment.h" + +@interface N2CellDescriptor : NSObject { + NSView* _view; + N2Alignment _alignment; + N2MinMax _widthConstraints; + CGFloat _invasivity; +// NSUInteger _rowSpan; + NSUInteger _colSpan; + BOOL _filled; +} + +@property(retain) NSView* view; +@property N2Alignment alignment; +@property N2MinMax widthConstraints; +//@property NSUInteger rowSpan; +@property NSUInteger colSpan; +@property CGFloat invasivity; +@property BOOL filled; + ++(N2CellDescriptor*)descriptor; ++(N2CellDescriptor*)descriptorWithView:(NSView*)view; ++(N2CellDescriptor*)descriptorWithWidthConstraints:(const N2MinMax&)widthConstraints; ++(N2CellDescriptor*)descriptorWithWidthConstraints:(const N2MinMax&)widthConstraints alignment:(N2Alignment)alignment; + +-(N2CellDescriptor*)view:(NSView*)view; +-(N2CellDescriptor*)alignment:(N2Alignment)alignment; +-(N2CellDescriptor*)widthConstraints:(const N2MinMax&)widthConstraints; +//-(N2CellDescriptor*)rowSpan:(NSUInteger)rowSpan; +-(N2CellDescriptor*)colSpan:(NSUInteger)colSpan; +-(N2CellDescriptor*)invasivity:(CGFloat)invasivity; +-(N2CellDescriptor*)filled:(BOOL)filled; + +-(NSSize)optimalSize; +-(NSSize)optimalSizeForWidth:(CGFloat)width; +-(NSRect)sizeAdjust; + +#pragma mark Deprecated +-(N2CellDescriptor*)initWithWidthConstraints:(const N2MinMax&)widthConstraints alignment:(N2Alignment)alignment DEPRECATED_ATTRIBUTE; + +@end + +@interface N2ColumnDescriptor : N2CellDescriptor +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ColorWell.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ColorWell.h new file mode 100644 index 0000000..c8e4c70 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ColorWell.h @@ -0,0 +1,24 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import "N2Button.h" + + +@interface N2ColorWell : N2Button { + NSColor* _color; +} + +@property(nonatomic, retain) NSColor* color; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ColumnLayout.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ColumnLayout.h new file mode 100644 index 0000000..6363830 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ColumnLayout.h @@ -0,0 +1,40 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + + +#import "N2Layout.h" + + +@interface N2ColumnLayout : N2Layout { + NSArray* _columnDescriptors; + NSMutableArray* _rows; +} + +-(id)initForView:(N2View*)view columnDescriptors:(NSArray*)columnDescriptors controlSize:(NSControlSize)controlSize; + +-(NSArray*)rowAtIndex:(NSUInteger)index; +-(NSUInteger)appendRow:(NSArray*)row; +-(void)insertRow:(NSArray*)row atIndex:(NSUInteger)index; +-(void)removeRowAtIndex:(NSUInteger)index; +-(void)removeAllRows; + +#pragma mark Deprecated + +-(NSArray*)lineAtIndex:(NSUInteger)index DEPRECATED_ATTRIBUTE; +-(NSUInteger)appendLine:(NSArray*)line DEPRECATED_ATTRIBUTE; +-(void)insertLine:(NSArray*)line atIndex:(NSUInteger)index DEPRECATED_ATTRIBUTE; +-(void)removeLineAtIndex:(NSUInteger)index DEPRECATED_ATTRIBUTE; +-(void)removeAllLines DEPRECATED_ATTRIBUTE; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Connection.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Connection.h new file mode 100644 index 0000000..c572e3f --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Connection.h @@ -0,0 +1,93 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + +extern NSString* N2ConnectionStatusDidChangeNotification; + +enum N2ConnectionStatus { + N2ConnectionStatusClosed = 0, + N2ConnectionStatusConnecting, + N2ConnectionStatusOpening, + N2ConnectionStatusOk +}; + +@interface N2Connection : NSObject +#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5) + +#endif +{ + id _address; + NSInteger _port; + NSInputStream* _inputStream; + NSOutputStream* _outputStream; + NSMutableData *_inputBuffer, *_outputBuffer; + //BOOL _hasBytesAvailable, _hasSpaceAvailable, _handleConnectionClose; + NSUInteger _handleOpenCompleted, _maximumReadSizePerEvent, _handleHasSpaceAvailable, _outputBufferIndex; + NSInteger _status; + BOOL _tlsFlag; + BOOL _closeOnRemoteClose, _closeWhenDoneSending, _closeOnNextSpaceAvailable, _handlingData; + NSError* _error; + NSTimeInterval lastEventTimeInterval; +} + +@property(readonly) NSString* address; +@property(readonly) NSTimeInterval lastEventTimeInterval; +@property(nonatomic) NSInteger status; +@property NSUInteger maximumReadSizePerEvent; +@property BOOL closeOnRemoteClose; +@property BOOL closeWhenDoneSending; +@property BOOL closeOnNextSpaceAvailable; +@property(readonly,retain) NSError* error; + +// non-tls ++(NSData*)sendSynchronousRequest:(NSData*)request toAddress:(id)address port:(NSInteger)port; ++(NSData*)sendSynchronousRequest:(NSData*)request toAddress:(id)address port:(NSInteger)port dataHandlerTarget:(id)target selector:(SEL)selector context:(void*)context; // -(NSInteger)connection:(N2Connection*)connection dummyDataHandler:(NSData*)data context:(void*)context +-(id)initWithAddress:(id)address port:(NSInteger)port; +-(id)initWithAddress:(id)address port:(NSInteger)port is:(NSInputStream*)is os:(NSOutputStream*)os; + +// generic ++(NSData*)sendSynchronousRequest:(NSData*)request toAddress:(id)address port:(NSInteger)port tls:(BOOL)tlsFlag; ++(NSData*)sendSynchronousRequest:(NSData*)request toAddress:(id)address port:(NSInteger)port tls:(BOOL)tlsFlag dataHandlerTarget:(id)target selector:(SEL)selector context:(void*)context; // -(NSInteger)connection:(N2Connection*)connection dummyDataHandler:(NSData*)data context:(void*)context +-(id)initWithAddress:(id)address port:(NSInteger)port tls:(BOOL)tlsFlag; +-(id)initWithAddress:(id)address port:(NSInteger)port tls:(BOOL)tlsFlag is:(NSInputStream*)is os:(NSOutputStream*)os; + +-(void)reconnect; +-(void)close; +-(void)open; // declared for overloading only +// -(void)invalidate; // TODO: why? + +-(void)startTLS; +-(BOOL)isSecure; + +-(void)reconnectToAddress:(id)address port:(NSInteger)port; + +-(void)writeData:(NSData*)data; +-(NSInteger)writeBufferSize; +-(void)handleData:(NSMutableData*)data; // overload on subclasses +-(NSInteger)availableSize; +-(NSData*)readData:(NSInteger)size; +-(NSInteger)readData:(NSInteger)size toBuffer:(void*)buffer; + +- (NSData*)readBuffer; + +-(void)connectionFinishedSendingData; // overload on subclasses + +-(void)trySendingDataNow; //... + +//+(BOOL)host:(NSString*)host1 isEqualToHost:(NSString*)host2; + +@end + + diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ConnectionListener.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ConnectionListener.h new file mode 100644 index 0000000..84393b7 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ConnectionListener.h @@ -0,0 +1,38 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + + +#import + +extern NSString* N2ConnectionListenerOpenedConnectionNotification; +extern NSString* N2ConnectionListenerOpenedConnection; + +@class N2Connection; + +@interface N2ConnectionListener : NSObject { + Class _class; + CFSocketRef ipv4socket; + CFSocketRef ipv6socket; + NSMutableArray* _clients; + BOOL _threadPerConnection; +} + +@property BOOL threadPerConnection; + +- (id)initWithPort:(NSInteger)port connectionClass:(Class)classs; +- (id)initWithPath:(NSString*)path connectionClass:(Class)classs; + +- (in_port_t)port; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2CustomTitledPopUpButtonCell.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2CustomTitledPopUpButtonCell.h new file mode 100644 index 0000000..5d745ef --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2CustomTitledPopUpButtonCell.h @@ -0,0 +1,25 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface N2CustomTitledPopUpButtonCell : NSPopUpButtonCell { + NSString* displayedTitle; +} + +@property(retain) NSString* displayedTitle; + + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Debug.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Debug.h new file mode 100644 index 0000000..be080f4 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Debug.h @@ -0,0 +1,50 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import + +@interface N2Debug : NSObject { +} + ++(BOOL)isActive; ++(void)setActive:(BOOL)active; + +@end + +#ifdef DEBUG +#define DLog NSLog +#else +#define DLog(args...) { if ([N2Debug isActive]) NSLog(args); } +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +extern NSString* RectString(NSRect r) __deprecated; // use NSStringFromRect +extern NSString* PointString(NSPoint p) __deprecated; // use NSStringFromPoint + +extern void _N2LogErrorImpl(const char* pf, const char* fileName, int lineNumber, id arg, ...); +extern void _N2LogExceptionImpl(NSException* e, BOOL logStack, const char* pf); + +#define N2LogError(...) _N2LogErrorImpl(__PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) +#define N2LogDeprecatedCall(...) _N2LogErrorImpl(__PRETTY_FUNCTION__, __FILE__, __LINE__, @"deprecated API usage") +#define N2LogException(e, ...) _N2LogExceptionImpl(e, NO, __PRETTY_FUNCTION__, ## __VA_ARGS__) +#define N2LogExceptionWithStackTrace(e, ...) _N2LogExceptionImpl(e, YES, __PRETTY_FUNCTION__, ## __VA_ARGS__) + +extern void N2LogStackTrace(NSString* format, ...); + +#ifdef __cplusplus +} +#endif diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2DirectoryEnumerator.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2DirectoryEnumerator.h new file mode 100644 index 0000000..d5ed882 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2DirectoryEnumerator.h @@ -0,0 +1,36 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import +#include + + +@interface N2DirectoryEnumerator : NSDirectoryEnumerator { +@private + NSString* basepath; + NSString* currpath; + NSMutableArray* DIRs; + NSUInteger counter, max; + BOOL _filesOnly; + BOOL _recursive; +} + +@property BOOL filesOnly; +@property BOOL recursive; + +-(id)initWithPath:(NSString*)path maxNumberOfFiles:(NSInteger)n; + +- (int)stat:(struct stat*)s; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2DisclosureBox.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2DisclosureBox.h new file mode 100644 index 0000000..5bb4d01 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2DisclosureBox.h @@ -0,0 +1,41 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + + +#import + +@class N2DisclosureButtonCell; + +extern NSString* N2DisclosureBoxDidToggleNotification; +extern NSString* N2DisclosureBoxWillExpandNotification; +extern NSString* N2DisclosureBoxDidExpandNotification; +extern NSString* N2DisclosureBoxWillCollapseNotification; +extern NSString* N2DisclosureBoxDidCollapseNotification; + +@interface N2DisclosureBox : NSBox { + BOOL _showingExpanded; + IBOutlet NSView* _content; + CGFloat _contentHeight; +} + +@property BOOL enabled; +@property(readonly) N2DisclosureButtonCell* titleCell; + +-(id)initWithTitle:(NSString*)title content:(NSView*)view; +-(void)toggle:(id)sender; +-(void)expand:(id)sender; +-(void)collapse:(id)sender; +-(BOOL)isExpanded; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2DisclosureButtonCell.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2DisclosureButtonCell.h new file mode 100644 index 0000000..e3dcccf --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2DisclosureButtonCell.h @@ -0,0 +1,25 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + +@interface N2DisclosureButtonCell : NSButtonCell { + NSMutableDictionary* _attributes; +} + +@property(readonly) NSMutableDictionary* attributes; + +-(NSSize)textSize; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Exceptions.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Exceptions.h new file mode 100644 index 0000000..26161fb --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Exceptions.h @@ -0,0 +1,17 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + +extern NSString* N2VirtualMethodException; diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2FlippedView.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2FlippedView.h new file mode 100644 index 0000000..93389d6 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2FlippedView.h @@ -0,0 +1,21 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface N2FlippedView : NSView { +} + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2HexadecimalNumberFormatter.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2HexadecimalNumberFormatter.h new file mode 100644 index 0000000..2593b34 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2HexadecimalNumberFormatter.h @@ -0,0 +1,19 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface N2HexadecimalNumberFormatter : NSNumberFormatter +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2HighlightImageButtonCell.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2HighlightImageButtonCell.h new file mode 100644 index 0000000..b99193d --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2HighlightImageButtonCell.h @@ -0,0 +1,22 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import "N2ImageButtonCell.h" + + +@interface N2HighlightImageButtonCell : N2ImageButtonCell + +-(id)initWithImage:(NSImage*)image; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ImageButtonCell.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ImageButtonCell.h new file mode 100644 index 0000000..7e43193 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ImageButtonCell.h @@ -0,0 +1,26 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import + + +@interface N2ImageButtonCell : NSButtonCell { + NSImage* altImage; +} + +@property(retain) NSImage* altImage; + +-(id)initWithImage:(NSImage*)image altImage:(NSImage*)altImage; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ImageView.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ImageView.h new file mode 100644 index 0000000..0c34d02 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ImageView.h @@ -0,0 +1,24 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface N2ImageView : NSImageView { + //BOOL interceptsMouse; +} + +//@property BOOL interceptsMouse; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Layout.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Layout.h new file mode 100644 index 0000000..b7de8df --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Layout.h @@ -0,0 +1,42 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + + +#import +#import "NSView+N2.h" + +@class N2View; + +@interface N2Layout : NSObject { + N2View* _view; + NSControlSize _controlSize; + BOOL _forcesSuperviewHeight, _forcesSuperviewWidth; +// private: + NSRect _margin; + NSSize _separation; + BOOL _layingOut, _enabled; +} + +@property(readonly) N2View* view; +@property NSControlSize controlSize; +@property BOOL forcesSuperviewHeight; +@property BOOL forcesSuperviewWidth; +@property NSRect margin; +@property NSSize separation; +@property BOOL enabled; + +-(id)initWithView:(N2View*)view controlSize:(NSControlSize)size; +-(void)layOut; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Locker.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Locker.h new file mode 100644 index 0000000..a38d01d --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Locker.h @@ -0,0 +1,17 @@ +// +// N2Locker.h +// OsiriX_Lion +// +// Created by Alessandro Volz on 25.03.13. +// Copyright (c) 2013 OsiriX Team. All rights reserved. +// + +#import + +@interface N2Locker : NSObject { + id _lockedObject; +} + ++ (id)lock:(id)lockedObject; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ManagedDatabase.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ManagedDatabase.h new file mode 100644 index 0000000..c196c86 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2ManagedDatabase.h @@ -0,0 +1,103 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import + + +@interface N2ManagedDatabase : NSObject { + @protected + NSString* _sqlFilePath; + @private + NSManagedObjectContext* _managedObjectContext; + id _mainDatabase; + volatile BOOL _isDeallocating; + +#ifndef NDEBUG + NSThread *associatedThread; +#endif +} + +#ifndef NDEBUG +@property(readonly) NSThread* associatedThread; +#endif + +@property(readonly,retain) NSString* sqlFilePath; +@property(readonly) NSManagedObjectModel* managedObjectModel; +@property(readwrite,retain) NSManagedObjectContext* managedObjectContext; // only change this value if you know what you're doing + +@property(readonly,retain) id mainDatabase; // for independentDatabases +-(BOOL)isMainDatabase; + +// locking actually locks the context +-(void)lock; +-(BOOL)lockBeforeDate:(NSDate*) date; +-(BOOL)tryLock; +-(void)unlock; +#ifndef NDEBUG +-(void) checkForCorrectContextThread; +-(void) checkForCorrectContextThread: (NSManagedObjectContext*) c; +#endif +// write locking uses writeLock member +//-(void)writeLock; +//-(BOOL)tryWriteLock; +//-(void)writeUnlock; + ++(NSString*) modelName; +-(BOOL) deleteSQLFileIfOpeningFailed; +-(NSManagedObjectModel*)managedObjectModel; +//-(NSMutableDictionary*)persistentStoreCoordinatorsDictionary; +-(BOOL)migratePersistentStoresAutomatically; // default implementation returns YES + +-(id)initWithPath:(NSString*)sqlFilePath; +-(id)initWithPath:(NSString*)sqlFilePath context:(NSManagedObjectContext*)context; +-(id)initWithPath:(NSString*)sqlFilePath context:(NSManagedObjectContext*)context mainDatabase:(N2ManagedDatabase*)mainDbReference; + +- (void) renewManagedObjectContext; +-(NSManagedObjectContext*)independentContext:(BOOL)independent; +-(NSManagedObjectContext*)independentContext; +-(id)independentDatabase; + +-(NSEntityDescription*)entityForName:(NSString*)name; + +-(id)objectWithID:(id)oid; +-(NSArray*)objectsWithIDs:(NSArray*)objectIDs; + +// in these methods, e can be an NSEntityDescription* or an NSString* +-(NSArray*)objectsForEntity:(id)e; +-(NSArray*)objectsForEntity:(id)e predicate:(NSPredicate*)p; +-(NSArray*)objectsForEntity:(id)e predicate:(NSPredicate*)p error:(NSError**)err; +-(NSArray*)objectsForEntity:(id)e predicate:(NSPredicate*)p error:(NSError**)error fetchLimit:(NSUInteger)fetchLimit sortDescriptors:(NSArray*)sortDescriptors; +-(NSUInteger)countObjectsForEntity:(id)e; +-(NSUInteger)countObjectsForEntity:(id)e predicate:(NSPredicate*)p; +-(NSUInteger)countObjectsForEntity:(id)e predicate:(NSPredicate*)p error:(NSError**)err; +-(id)newObjectForEntity:(id)e; + +-(BOOL)save; +-(BOOL)save:(NSError**)err; + +@end + +@interface N2ManagedDatabase (Protected) + +-(NSManagedObjectContext*)contextAtPath:(NSString*)sqlFilePath; + +@end + +@interface N2ManagedObjectContext : NSManagedObjectContext { + + N2ManagedDatabase* _database; +} + +@property(readonly) N2ManagedDatabase* database; +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2MinMax.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2MinMax.h new file mode 100644 index 0000000..ce1d89b --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2MinMax.h @@ -0,0 +1,32 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + +extern const CGFloat N2NoMin, N2NoMax; + +typedef struct N2MinMax { + CGFloat min, max; +} N2MinMax; + +N2MinMax N2MakeMinMax(CGFloat min, CGFloat max); +N2MinMax N2MakeMinMax(CGFloat val); +N2MinMax N2MakeMinMax(); +N2MinMax N2MakeMin(CGFloat min); +N2MinMax N2MakeMax(CGFloat max); +CGFloat N2MinMaxConstrainedValue(const N2MinMax& mm, CGFloat val); +void N2ExtendMinMax(N2MinMax& n2minmax, CGFloat value); +N2MinMax N2ComposeMinMax(const N2MinMax& mm1, const N2MinMax& mm2); +N2MinMax operator+(const N2MinMax& mm1, const N2MinMax& mm2); +N2MinMax operator+(const N2MinMax& mm, const CGFloat& f); diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2MutableUInteger.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2MutableUInteger.h new file mode 100644 index 0000000..bf2a3ca --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2MutableUInteger.h @@ -0,0 +1,31 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import + + +@interface N2MutableUInteger : NSObject { + NSUInteger _value; +} + ++(id)mutableUIntegerWithUInteger:(NSUInteger)value; + +@property NSUInteger unsignedIntegerValue; + +-(id)initWithUInteger:(NSUInteger)value; + +-(void)increment; +-(void)decrement; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2OpenGLViewWithSplitsWindow.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2OpenGLViewWithSplitsWindow.h new file mode 100644 index 0000000..b6b6a98 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2OpenGLViewWithSplitsWindow.h @@ -0,0 +1,26 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + +@interface N2OpenGLViewWithSplitsWindow : NSWindow +{ + BOOL needsEnableUpdate; +} + +@property BOOL needsEnableUpdate; + +- (void) disableUpdatesUntilFlush; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Operators.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Operators.h new file mode 100644 index 0000000..b4e4383 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Operators.h @@ -0,0 +1,143 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + +#ifdef __cplusplus +extern "C" { +#endif + +extern NSString* N2LinesDontInterceptException; + +CGFloat NSSign(const CGFloat f); +CGFloat NSLimit(const CGFloat v, const CGFloat min, const CGFloat max); + +extern const NSNumber* const N2Yes; +extern const NSNumber* const N2No; + +NSSize NSRoundSize(NSSize s) DEPRECATED_ATTRIBUTE; +NSSize N2ProportionallyScaleSize(NSSize s, NSSize t); + +NSRect N2FlipRect(NSRect frame, NSRect bounds); + +#ifdef __cplusplus +} + +namespace n2 { + NSSize floor(const NSSize& s); + NSSize ceil(const NSSize& s); + NSSize round(const NSSize& s); +} + +NSSize NSMakeSize(CGFloat wh); +NSSize operator-(const NSSize& s); // -[x,y] = [-x,-y] +NSSize operator+(const NSSize& s1, const NSSize& s2); // [x,y]+[X,Y] = [x+X,y+Y] +NSSize operator+=(NSSize& s1, const NSSize& s2); +NSSize operator-(const NSSize& s1, const NSSize& s2); // [x,y]-[X,Y] = -[X,Y]+[x,y] = [x-X,y-Y] +NSSize operator-=(NSSize& s1, const NSSize& s2); +NSSize operator*(const NSSize& s1, const NSSize& s2); +NSSize operator*=(NSSize& s1, const NSSize& s2); +NSSize operator/(const NSSize& s1, const NSSize& s2); +NSSize operator/=(NSSize& s1, const NSSize& s2); +BOOL operator==(const NSSize& s1, const NSSize& s2); +BOOL operator!=(const NSSize& s1, const NSSize& s2); + +NSSize operator+(const NSSize& s, const CGFloat f); +NSSize operator+=(NSSize& s, const CGFloat f); +NSSize operator-(const NSSize& s, const CGFloat f); +NSSize operator-=(NSSize& s, const CGFloat f); +NSSize operator*(const CGFloat f, const NSSize& s); // [x,y]*d = [x*d,y*d] +NSSize operator/(const CGFloat f, const NSSize& s); +NSSize operator*(const NSSize& s, const CGFloat f); +NSSize operator*=(NSSize& s, const CGFloat f); +NSSize operator/(const NSSize& s, const CGFloat f); +NSSize operator/=(NSSize& s, const CGFloat f); + +NSPoint operator-(const NSPoint& p); // -[x,y] = [-x,-y] +NSPoint operator+(const NSPoint& p1, const NSPoint& p2); // [x,y]+[X,Y] = [x+X,y+Y] +NSPoint operator+=(NSPoint& p1, const NSPoint& p2); +NSPoint operator-(const NSPoint& p1, const NSPoint& p2); // [x,y]-[X,Y] = -[X,Y]+[x,y] = [x-X,y-Y] +NSPoint operator-=(NSPoint& p1, const NSPoint& p2); +NSPoint operator*(const NSPoint& p1, const NSPoint& p2); +NSPoint operator*=(NSPoint& p1, const NSPoint& p2); +NSPoint operator/(const NSPoint& p1, const NSPoint& p2); +NSPoint operator/=(NSPoint& p1, const NSPoint& p2); +BOOL operator==(const NSPoint& p1, const NSPoint& p2); +BOOL operator!=(const NSPoint& p1, const NSPoint& p2); + +NSPoint operator+(const NSPoint& p, const CGFloat f); +NSPoint operator+=(NSPoint& p, const CGFloat f); +NSPoint operator-(const NSPoint& p, const CGFloat f); +NSPoint operator-=(NSPoint& p, const CGFloat f); +NSPoint operator*(const CGFloat f, const NSPoint& p); +NSPoint operator/(const CGFloat f, const NSPoint& p); +NSPoint operator*(const NSPoint& p, const CGFloat f); // [x,y]*d = [x*d,y*d] +NSPoint operator*=(NSPoint& p, const CGFloat f); +NSPoint operator/(const NSPoint& p, const CGFloat f); // [x,y]/d = [x/d,y/d] +NSPoint operator/=(NSPoint& p, const CGFloat f); + +NSPoint NSMakePoint(const NSSize& s); +NSSize operator+(const NSSize& s, const NSPoint& p); +NSSize operator+=(NSSize& s, const NSPoint& p); +NSPoint operator+(const NSPoint& p, const NSSize& s); +NSPoint operator+=(NSPoint& p, const NSSize& s); +NSSize operator-(const NSSize& s, const NSPoint& p); +NSPoint operator-(const NSPoint& p, const NSSize& s); +NSSize operator*(const NSSize& s, const NSPoint& p); +NSPoint operator*(const NSPoint& p, const NSSize& s); +NSSize operator/(const NSSize& s, const NSPoint& p); +NSPoint operator/(const NSPoint& p, const NSSize& s); + +CGFloat NSDistance(const NSPoint& p1, const NSPoint& p2); +CGFloat NSAngle(const NSPoint& p1, const NSPoint& p2); +NSPoint NSMiddle(const NSPoint& p1, const NSPoint& p2); + +typedef struct _NSVector : NSPoint { +} NSVector; + +NSVector NSMakeVector(CGFloat x, CGFloat y); +NSVector NSMakeVector(const NSPoint& from, const NSPoint& to); +NSVector NSMakeVector(const NSPoint& p); +NSPoint NSMakePoint(const NSVector& p); + +NSVector operator!(const NSVector& v); + +CGFloat NSLength(const NSVector& v); +CGFloat NSAngle(const NSVector& v); + +typedef struct _NSLine { + NSPoint origin; + NSVector direction; +} NSLine; + +NSLine NSMakeLine(const NSPoint& origin, const NSVector& direction); +NSLine NSMakeLine(const NSPoint& p1, const NSPoint& p2); + +CGFloat NSAngle(const NSLine& l); +BOOL NSParallel(const NSLine& l1, const NSLine& l2); +CGFloat NSLineInterceptionValue(const NSLine& l1, const NSLine& l2); +NSPoint NSLineAtValue(const NSLine& l, CGFloat u); +NSPoint operator*(const NSLine& l1, const NSLine& l2); // intersection of lines +CGFloat NSLineYAtX(const NSLine& l1, CGFloat x); + +NSRect NSMakeRect(const NSPoint& o, const NSSize& s); +NSRect NSInsetRect(const NSRect& r, const NSSize& s); +NSRect operator+(const NSRect& r, const NSSize& s); +NSRect operator-(const NSRect& r, const NSSize& s); +BOOL operator==(const NSRect& r1, const NSRect& r2); +BOOL operator!=(const NSRect& r1, const NSRect& r2); +NSPoint RectBR(const NSRect& r); + +#endif + diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Pair.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Pair.h new file mode 100644 index 0000000..9e4eea8 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Pair.h @@ -0,0 +1,25 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + +@interface N2Pair : NSObject { + id _first, _second; +} + +@property(retain) id first, second; + +-(id)initWith:(id)first and:(id)second; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Panel.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Panel.h new file mode 100644 index 0000000..e414069 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Panel.h @@ -0,0 +1,25 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + + +#import +@class N2View; + +@interface N2Panel : NSPanel { + BOOL _canBecomeKeyWindow; +} + +@property BOOL canBecomeKeyWindow; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2PopUpButton.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2PopUpButton.h new file mode 100644 index 0000000..bc88a95 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2PopUpButton.h @@ -0,0 +1,22 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface N2PopUpButton : NSPopUpButton + + + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2PopUpMenu.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2PopUpMenu.h new file mode 100644 index 0000000..10e09fd --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2PopUpMenu.h @@ -0,0 +1,16 @@ +// +// N2PopUpMenu.h +// Predicator +// +// Created by Alessandro Volz on 06.02.13. +// Copyright (c) 2013 Alessandro Volz. All rights reserved. +// + +#import + +@interface N2PopUpMenu : NSObject + +// when popping up menus using this method, you should make sure the clicked vied forwards mouseup and mousedragged events to the returned NSWindow, as done in O2DicomPredicateEditorPopUpButton.m ++ (NSWindow*)popUpContextMenu:(NSMenu*)menu withEvent:(NSEvent*)event forView:(NSPopUpButton*)view withFont:(NSFont*)font; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2RedundantWebServiceClient.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2RedundantWebServiceClient.h new file mode 100644 index 0000000..00d791a --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2RedundantWebServiceClient.h @@ -0,0 +1,25 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + + +#import "N2WebServiceClient.h" + + +@interface N2RedundantWebServiceClient : N2WebServiceClient { + NSArray* _urls; +} + +@property(retain) NSArray* urls; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Resizer.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Resizer.h new file mode 100644 index 0000000..2307370 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Resizer.h @@ -0,0 +1,29 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface N2Resizer : NSObject { + NSView* _observed; + NSView* _affected; + BOOL _resizing; +} + +@property(retain) NSView* observed; +@property(retain) NSView* affected; + +-(id)initByObservingView:(NSView*)observed affecting:(NSView*)affected; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2SOAPWebServiceClient.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2SOAPWebServiceClient.h new file mode 100644 index 0000000..6d90b27 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2SOAPWebServiceClient.h @@ -0,0 +1,29 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import "N2RedundantWebServiceClient.h" + +@class N2WSDL; + +@interface N2SOAPWebServiceClient : N2RedundantWebServiceClient { + N2WSDL* _wsdl; +} + +@property(readonly) N2WSDL* wsdl; + +-(id)initWithWSDL:(N2WSDL*)wsdl; +-(id)execute:(NSString*)method; +-(id)execute:(NSString*)function params:(NSArray*)params; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Shell.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Shell.h new file mode 100644 index 0000000..e883d4a --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Shell.h @@ -0,0 +1,30 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface N2Shell : NSObject + ++(NSString*)execute:(NSString*)path; ++(NSString*)execute:(NSString*)path arguments:(NSArray*)arguments; ++(NSString*)execute:(NSString*)path arguments:(NSArray*)arguments outStatus:(int*)outStatus; ++(NSString*)execute:(NSString*)path arguments:(NSArray*)arguments expectedStatus:(int)expectedStatus; ++(NSString*)hostname; ++(NSString*)ip; ++(NSString*)mac; ++(NSString*)serialNumber; ++(int)userId __deprecated; // getuid() + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2SingletonObject.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2SingletonObject.h new file mode 100644 index 0000000..753fa88 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2SingletonObject.h @@ -0,0 +1,22 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + +@interface N2SingletonObject : NSObject { + @protected + BOOL _hasInited; +} + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Step.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Step.h new file mode 100644 index 0000000..253299a --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Step.h @@ -0,0 +1,41 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + +extern NSString* N2StepDidBecomeActiveNotification; +extern NSString* N2StepDidBecomeInactiveNotification; +extern NSString* N2StepDidBecomeEnabledNotification; +extern NSString* N2StepDidBecomeDisabledNotification; +extern NSString* N2StepTitleDidChangeNotification; + +@interface N2Step : NSObject { + NSString* _title; + NSView* _enclosedView; + NSButton* defaultButton; + BOOL _necessary, _active, _enabled, _done, _shouldStayVisibleWhenInactive; +} + +@property(nonatomic, retain) NSString* title; +@property(readonly) NSView* enclosedView; +@property(retain) NSButton* defaultButton; +@property(getter=isNecessary) BOOL necessary; +@property(nonatomic, getter=isActive) BOOL active; +@property(nonatomic, getter=isEnabled) BOOL enabled; +@property(getter=isDone) BOOL done; +@property BOOL shouldStayVisibleWhenInactive; + +-(id)initWithTitle:(NSString*)title enclosedView:(NSView*)view; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2StepView.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2StepView.h new file mode 100644 index 0000000..e80fe7e --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2StepView.h @@ -0,0 +1,26 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import "N2DisclosureBox.h" +@class N2Step; + +@interface N2StepView : N2DisclosureBox { + N2Step* _step; +} + +@property(readonly) N2Step* step; + +-(id)initWithStep:(N2Step*)step; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Steps.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Steps.h new file mode 100644 index 0000000..e3cba04 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Steps.h @@ -0,0 +1,56 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + +@class N2Step; //, N2StepsView; + +extern NSString* N2StepsDidAddStepNotification; +extern NSString* N2StepsWillRemoveStepNotification; +extern NSString* N2StepsNotificationStep; + +@interface N2Steps : NSArrayController { +// IBOutlet N2StepsView* _view; + N2Step* _currentStep; + IBOutlet id _delegate; +} + +@property(retain) id delegate; +@property(nonatomic, assign) N2Step* currentStep; +// @property(readonly) N2StepsView* view; + +-(void)enableDisableSteps; + +-(BOOL)hasNextStep; +-(BOOL)hasPreviousStep; + +-(IBAction)stepDone:(id)sender; +-(IBAction)nextStep:(id)sender; +-(IBAction)previousStep:(id)sender; +-(IBAction)skipStep:(id)sender; +-(IBAction)stepValueChanged:(id)sender; +-(IBAction)reset:(id)sender; + +-(void)setCurrentStep:(N2Step*)step; + +@end + +@interface NSObject (N2StepsDelegate) + +-(void)steps:(N2Steps*)steps willBeginStep:(N2Step*)step; +-(void)steps:(N2Steps*)steps valueChanged:(id)sender; +-(BOOL)steps:(N2Steps*)steps shouldValidateStep:(N2Step*)step; +-(void)steps:(N2Steps*)steps validateStep:(N2Step*)step; + +@end \ No newline at end of file diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2StepsView.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2StepsView.h new file mode 100644 index 0000000..70e39fe --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2StepsView.h @@ -0,0 +1,27 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + + +#import "N2View.h" +@class N2Steps, N2Step, N2StepView, N2ColumnLayout; + +@interface N2StepsView : N2View { + IBOutlet N2Steps* _steps; +} + +-(void)stepsDidAddStep:(NSNotification*)notification; +-(N2StepView*)stepViewForStep:(N2Step*)step; +-(void)layOut; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Stuff.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Stuff.h new file mode 100644 index 0000000..9275b07 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Stuff.h @@ -0,0 +1,20 @@ +// +// N2Stuff.h +// OsiriX_Lion +// +// Created by Alessandro Volz on 16.02.12. +// Copyright (c) 2012 OsiriX Team. All rights reserved. +// + +#ifndef OsiriX_Lion_N2Localization_h +#define OsiriX_Lion_N2Localization_h + +#define N2SingularPlural(c, s, p) (c == 1? s : p) +#define N2LocalizedSingularPlural(c, s, p) (c == 1? NSLocalizedString(s, @"Singular") : NSLocalizedString(p, @"Plural") + +#define N2SingularPluralCount(c, s, p) [NSString stringWithFormat:@"%d %@", (int)c, (c == 1? s : p)] +#define N2LocalizedSingularPluralCount(c, s, p) [NSString stringWithFormat:@"%@ %@", [NSNumberFormatter localizedStringFromNumber:[NSNumber numberWithInteger:(NSInteger)c] numberStyle:NSNumberFormatterDecimalStyle], (c == 1? s : p)] + +#define N2LocalizedDecimal(c) [NSNumberFormatter localizedStringFromNumber:[NSNumber numberWithInteger:(NSInteger)c] numberStyle:NSNumberFormatterDecimalStyle] + +#endif diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Task.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Task.h new file mode 100644 index 0000000..202ea0c --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Task.h @@ -0,0 +1,43 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import +#include + +@interface N2Task : NSTask { + NSString* _launchPath; + NSArray* _arguments; + pid_t _pid; + uid_t _uid; + NSTimeInterval _launchTime; + NSDictionary* _environment; + NSString* _currentDirectoryPath; + id _standardError, _standardInput, _standardOutput; +} + +@property(retain) NSArray* arguments; +@property(retain) NSString* currentDirectoryPath; +@property(retain) NSDictionary* environment; +@property(retain) NSString* launchPath; +@property(retain) id standardError; +@property(retain) id standardInput; +@property(retain) id standardOutput; + +@property(readonly) NSTimeInterval launchTime; +@property(assign) uid_t uid; + + +//-(void)setEnv:(NSString*)name to:(NSString*)value; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2TextField.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2TextField.h new file mode 100644 index 0000000..ae794f8 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2TextField.h @@ -0,0 +1,26 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import + + +@interface N2TextField : NSTextField { +// NSColor* invalidContentBackgroundColor; + BOOL formatIsOk; +} + +//@property(retain) NSColor* invalidContentBackgroundColor; +@property(nonatomic, readonly) BOOL formatIsOk; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2UnclickableSplitView.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2UnclickableSplitView.h new file mode 100644 index 0000000..6779c26 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2UnclickableSplitView.h @@ -0,0 +1,25 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import + +@interface N2UnclickableSplitView : NSSplitView { +// NSSplitView* _otherSplitView; +} + +//@property(readonly) IBOutlet NSSplitView* otherSplitView; + + + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2UserDefaults.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2UserDefaults.h new file mode 100644 index 0000000..8ff7052 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2UserDefaults.h @@ -0,0 +1,58 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface N2UserDefaults : NSObject { + NSMutableDictionary* _dictionary; + NSString* _identifier; + BOOL _autosave, _needsAutosave; +} + +@property(readonly, retain) NSString* identifier; +@property(nonatomic) BOOL autosave; + ++(N2UserDefaults*)defaultsForObject:(id)o __deprecated; ++(N2UserDefaults*)defaultsForClass:(Class)c __deprecated; ++(N2UserDefaults*)defaultsForIdentifier:(NSString*)identifier __deprecated; + +-(id)initWithIdentifier:(NSString*)identifier __deprecated; + +-(id)objectForKey:(NSString*)key __deprecated; +-(BOOL)hasObjectForKey:(NSString*)key __deprecated; +-(void)setObject:(id)obj forKey:(NSString*)key __deprecated; + +-(id)unarchiveObjectForKey:(NSString*)key default:(id)def class:(Class)c __deprecated; +-(void)archiveAndSetObject:(id)value forKey:(NSString*)key __deprecated; + +-(NSInteger)integerForKey:(NSString*)key default:(NSInteger)def __deprecated; +-(void)setInteger:(NSInteger)value forKey:(NSString*)key __deprecated; + +-(float)floatForKey:(NSString*)key default:(float)def __deprecated; +-(void)setFloat:(float)value forKey:(NSString*)key __deprecated; + +-(double)doubleForKey:(NSString*)key default:(double)def __deprecated; +-(void)setDouble:(double)value forKey:(NSString*)key __deprecated; + +-(BOOL)boolForKey:(NSString*)key default:(BOOL)def __deprecated; +-(void)setBool:(BOOL)value forKey:(NSString*)key __deprecated; + +-(NSColor*)colorForKey:(NSString*)key default:(NSColor*)def __deprecated; +-(void)setColor:(NSColor*)value forKey:(NSString*)key __deprecated; + +-(NSRect)rectForKey:(NSString*)key default:(NSRect)def __deprecated; +-(void)setRect:(NSRect)value forKey:(NSString*)key __deprecated; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2View.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2View.h new file mode 100644 index 0000000..c309cfe --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2View.h @@ -0,0 +1,41 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + + +#import + +@class N2Layout; + +extern NSString* N2ViewBoundsSizeDidChangeNotification; +extern NSString* N2ViewBoundsSizeDidChangeNotificationOldBoundsSize; + +@interface N2View : NSView { + NSControlSize _controlSize; + NSSize _minSize, _maxSize; + N2Layout* _layout; + NSColor* _foreColor; + NSColor* _backColor; +} + +@property NSControlSize controlSize; +@property NSSize minSize, maxSize; +@property(retain) N2Layout* layout; +@property(nonatomic, retain) NSColor* foreColor; +@property(nonatomic, retain) NSColor* backColor; + +-(void)formatSubview:(NSView*)view; +-(void)resizeSubviews; + +@end + diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2WSDL.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2WSDL.h new file mode 100644 index 0000000..58879ec --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2WSDL.h @@ -0,0 +1,30 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import + + +@interface N2WSDL : NSObject { + NSMutableArray* _types; + NSMutableArray* _messages; + NSMutableArray* _operations; + NSMutableArray* _portTypes; + NSMutableArray* _bindings; + NSMutableArray* _ports; + NSMutableArray* _services; +} + +-(id)initWithContentsOfURL:(NSURL*)url; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2WebServiceClient.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2WebServiceClient.h new file mode 100644 index 0000000..91fb952 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2WebServiceClient.h @@ -0,0 +1,40 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import + +enum HTTPMethod { + HTTPGet, + HTTPPost +}; + +@interface N2WebServiceClient : NSObject { + NSURL* _url; +} + +@property(retain) NSURL* url; + +-(id)initWithURL:(NSURL*)url; + +-(NSData*)requestWithURL:(NSURL*)url method:(HTTPMethod)method content:(NSData*)content headers:(NSDictionary*)headers context:(id)context; +-(NSData*)requestWithMethod:(HTTPMethod)method content:(NSData*)content headers:(NSDictionary*)headers; +-(NSData*)requestWithMethod:(HTTPMethod)method content:(NSData*)content headers:(NSDictionary*)headers context:(id)context; +-(NSData*)getWithParameters:(NSDictionary*)params; +-(NSData*)postWithContent:(NSData*)content; +-(NSData*)postWithParameters:(NSDictionary*)params; + +-(NSURL*)processUrl:(NSURL*)url context:(id)context; +-(BOOL)validateResult:(NSData*)result; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Window.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Window.h new file mode 100644 index 0000000..8cb9108 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2Window.h @@ -0,0 +1,20 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import +@class N2View; + +@interface N2Window : NSWindow + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2XMLRPC.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2XMLRPC.h new file mode 100644 index 0000000..da552b0 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2XMLRPC.h @@ -0,0 +1,33 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import + + +@interface N2XMLRPC : NSObject { +} + +enum N2XMLRPCOptionMasks { + N2XMLRPCDontSpecifyStringTypeOptionMask = 1<<0 +}; + ++(NSObject*)ParseElement:(NSXMLNode*)n; ++(NSString*)FormatElement:(NSObject*)o; ++(NSString*)FormatElement:(NSObject*)o options:(NSUInteger)options; + ++(NSString*)requestWithMethodName:(NSString*)methodName arguments:(NSArray*)args; ++(NSString*)responseWithValue:(id)value; ++(NSString*)responseWithValue:(id)value options:(NSUInteger)options; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2XMLRPCConnection.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2XMLRPCConnection.h new file mode 100644 index 0000000..6a840cd --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2XMLRPCConnection.h @@ -0,0 +1,43 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import +#import "N2Connection.h" + +@protocol N2XMLRPCConnectionDelegate + +@optional +-(NSString*)selectorStringForXMLRPCRequestMethodName:(NSString*)name; +-(BOOL)isSelectorAvailableToXMLRPC:(NSString*)selectorString; + +@end + +@interface N2XMLRPCConnection : N2Connection { + NSObject* _delegate; + BOOL _executed, _waitingToClose, _dontSpecifyStringType; + NSTimer* _timeout; + NSXMLDocument* _doc; +} + +@property(retain) NSObject* delegate; +@property BOOL dontSpecifyStringType; + +-(void)handleRequest:(CFHTTPMessageRef)request; +-(id)methodCall:(NSString*)methodName params:(NSArray*)params error:(NSError**)error; +-(void)writeAndReleaseResponse:(CFHTTPMessageRef)response; + +-(NSUInteger)N2XMLRPCOptions; + +@end + diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2XMLRPCWebServiceClient.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2XMLRPCWebServiceClient.h new file mode 100644 index 0000000..2152b16 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N2XMLRPCWebServiceClient.h @@ -0,0 +1,23 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import "N2RedundantWebServiceClient.h" + + +@interface N2XMLRPCWebServiceClient : N2RedundantWebServiceClient { +} + +-(id)execute:(NSString*)methodName arguments:(NSArray*)args; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N3BezierCore.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N3BezierCore.h new file mode 100644 index 0000000..71add99 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N3BezierCore.h @@ -0,0 +1,113 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#ifndef _N3BEZIERCORE_H_ +#define _N3BEZIERCORE_H_ + +#include + +#include "N3Geometry.h" + +/* look in N3BezierCoreAdditions.h for additional functions that could be of interest */ + +CF_EXTERN_C_BEGIN + +enum N3BezierCoreSegmentType { + N3MoveToBezierCoreSegmentType, + N3LineToBezierCoreSegmentType, + N3CurveToBezierCoreSegmentType, + N3CloseBezierCoreSegmentType, + N3EndBezierCoreSegmentType = 0xFFFFFFFF +}; +typedef enum N3BezierCoreSegmentType N3BezierCoreSegmentType; + +extern const CFDictionaryValueCallBacks kN3BezierCoreDictionaryValueCallBacks; +extern const CFArrayCallBacks kN3BezierCoreArrayCallBacks; + +extern const CGFloat N3BezierDefaultFlatness; +extern const CGFloat N3BezierDefaultSubdivideSegmentLength; + +typedef const struct N3BezierCore *N3BezierCoreRef; +typedef struct N3BezierCore *N3MutableBezierCoreRef; +typedef struct N3BezierCoreIterator *N3BezierCoreIteratorRef; +typedef const struct N3BezierCoreRandomAccessor *N3BezierCoreRandomAccessorRef; + +N3BezierCoreRef N3BezierCoreCreate(); +N3MutableBezierCoreRef N3BezierCoreCreateMutable(); +void *N3BezierCoreRetain(N3BezierCoreRef bezierCore); +void N3BezierCoreRelease(N3BezierCoreRef bezierCore); +bool N3BezierCoreEqualToBezierCore(N3BezierCoreRef bezierCore1, N3BezierCoreRef bezierCore2); +CFStringRef N3BezierCoreCopyDescription(N3BezierCoreRef bezierCore); +bool N3BezierCoreHasCurve(N3BezierCoreRef bezierCore); + +N3BezierCoreRef N3BezierCoreCreateCopy(N3BezierCoreRef bezierCore); +N3MutableBezierCoreRef N3BezierCoreCreateMutableCopy(N3BezierCoreRef bezierCore); + +CFDictionaryRef N3BezierCoreCreateDictionaryRepresentation(N3BezierCoreRef bezierCore); +N3BezierCoreRef N3BezierCoreCreateWithDictionaryRepresentation(CFDictionaryRef dict); +N3MutableBezierCoreRef N3BezierCoreCreateMutableWithDictionaryRepresentation(CFDictionaryRef dict); + +void N3BezierCoreAddSegment(N3MutableBezierCoreRef bezierCore, N3BezierCoreSegmentType segmentType, N3Vector control1, N3Vector control2, N3Vector endpoint); +void N3BezierCoreSetVectorsForSegementAtIndex(N3MutableBezierCoreRef bezierCore, CFIndex index, N3Vector control1, N3Vector control2, N3Vector endpoint); +void N3BezierCoreFlatten(N3MutableBezierCoreRef bezierCore, CGFloat flatness); +void N3BezierCoreSubdivide(N3MutableBezierCoreRef bezierCore, CGFloat maxSegementLength); +void N3BezierCoreApplyTransform(N3MutableBezierCoreRef bezierCore, N3AffineTransform transform); +void N3BezierCoreAppendBezierCore(N3MutableBezierCoreRef bezierCore, N3BezierCoreRef appenedBezier, bool connectPaths); + +N3BezierCoreRef N3BezierCoreCreateFlattenedCopy(N3BezierCoreRef bezierCore, CGFloat flatness); +N3MutableBezierCoreRef N3BezierCoreCreateFlattenedMutableCopy(N3BezierCoreRef bezierCore, CGFloat flatness); +N3BezierCoreRef N3BezierCoreCreateSubdividedCopy(N3BezierCoreRef bezierCore, CGFloat maxSegementLength); +N3MutableBezierCoreRef N3BezierCoreCreateSubdividedMutableCopy(N3BezierCoreRef bezierCore, CGFloat maxSegementLength); +N3BezierCoreRef N3BezierCoreCreateTransformedCopy(N3BezierCoreRef bezierCore, N3AffineTransform transform); +N3MutableBezierCoreRef N3BezierCoreCreateTransformedMutableCopy(N3BezierCoreRef bezierCore, N3AffineTransform transform); + +CFIndex N3BezierCoreSegmentCount(N3BezierCoreRef bezierCore); +CFIndex N3BezierCoreSubpathCount(N3BezierCoreRef bezierCore); +CGFloat N3BezierCoreLength(N3BezierCoreRef bezierCore); + +/* This requires a traverse though a linked list on every call, if you care for speed use a BezierCoreIterator or a BezierCoreRandomAccessor */ +N3BezierCoreSegmentType N3BezierCoreGetSegmentAtIndex(N3BezierCoreRef bezierCore, CFIndex index, N3VectorPointer control1, N3VectorPointer control2, N3VectorPointer endpoint); + +/* Debug */ +void N3BezierCoreCheckDebug(N3BezierCoreRef bezierCore); + +/* BezierCoreIterator */ + +N3BezierCoreIteratorRef N3BezierCoreIteratorCreateWithBezierCore(N3BezierCoreRef bezierCore); +N3BezierCoreIteratorRef N3BezierCoreIteratorRetain(N3BezierCoreIteratorRef bezierCoreIterator); +void N3BezierCoreIteratorRelease(N3BezierCoreIteratorRef bezierCoreIterator); + +N3BezierCoreSegmentType N3BezierCoreIteratorGetNextSegment(N3BezierCoreIteratorRef bezierCoreIterator, N3VectorPointer control1, N3VectorPointer control2, N3VectorPointer endpoint); + +bool N3BezierCoreIteratorIsAtEnd(N3BezierCoreIteratorRef bezierCoreIterator); +CFIndex N3BezierCoreIteratorIndex(N3BezierCoreIteratorRef bezierCoreIterator); +void N3BezierCoreIteratorSetIndex(N3BezierCoreIteratorRef bezierCoreIterator, CFIndex index); +CFIndex N3BezierCoreIteratorSegmentCount(N3BezierCoreIteratorRef bezierCoreIterator); + + +/* BezierCoreRandomAccessor */ +/* Caches pointers to each element of the linked list so iterating is O(n) not O(n^2) */ + +N3BezierCoreRandomAccessorRef N3BezierCoreRandomAccessorCreateWithBezierCore(N3BezierCoreRef bezierCore); +N3BezierCoreRandomAccessorRef N3BezierCoreRandomAccessorCreateWithMutableBezierCore(N3MutableBezierCoreRef bezierCore); +N3BezierCoreRandomAccessorRef N3BezierCoreRandomAccessorRetain(N3BezierCoreRandomAccessorRef bezierCoreRandomAccessor); +void N3BezierCoreRandomAccessorRelease(N3BezierCoreRandomAccessorRef bezierCoreRandomAccessor); + +N3BezierCoreSegmentType N3BezierCoreRandomAccessorGetSegmentAtIndex(N3BezierCoreRandomAccessorRef bezierCoreRandomAccessor, CFIndex index, N3VectorPointer control1, N3VectorPointer control2, N3VectorPointer endpoint); +void N3BezierCoreRandomAccessorSetVectorsForSegementAtIndex(N3BezierCoreRandomAccessorRef bezierCoreRandomAccessor, CFIndex index, N3Vector control1, N3Vector control2, N3Vector endpoint); // the random accessor must have been created with the mutable beziercore +CFIndex N3BezierCoreRandomAccessorSegmentCount(N3BezierCoreRandomAccessorRef bezierCoreRandomAccessor); + +CF_EXTERN_C_END + +#endif /* _N3BEZIERCORE_H_ */ diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N3BezierCoreAdditions.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N3BezierCoreAdditions.h new file mode 100644 index 0000000..0e7812c --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N3BezierCoreAdditions.h @@ -0,0 +1,80 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#ifndef _N3BEZIERCORE_ADDITIONS_H_ +#define _N3BEZIERCORE_ADDITIONS_H_ + +#include "N3BezierCore.h" + +// N3BezierCore functions that don't need any access to the actual implementation details of the N3BezierCore + +CF_EXTERN_C_BEGIN + +enum N3BezierNodeStyle { + N3BezierNodeOpenEndsStyle, // the direction of the end segements point out. this is the style used by the CPR View + N3BezierNodeEndsMeetStyle, // the direction of the end segements point to each other. this is the style that mimics what open ROIs do +}; +typedef enum N3BezierNodeStyle N3BezierNodeStyle; + +N3BezierCoreRef N3BezierCoreCreateCurveWithNodes(N3VectorArray vectors, CFIndex numVectors, N3BezierNodeStyle style); +N3MutableBezierCoreRef N3BezierCoreCreateMutableCurveWithNodes(N3VectorArray vectors, CFIndex numVectors, N3BezierNodeStyle style); + +N3Vector N3BezierCoreVectorAtStart(N3BezierCoreRef bezierCore); +N3Vector N3BezierCoreVectorAtEnd(N3BezierCoreRef bezierCore); + +N3Vector N3BezierCoreTangentAtStart(N3BezierCoreRef bezierCore); +N3Vector N3BezierCoreTangentAtEnd(N3BezierCoreRef bezierCore); +N3Vector N3BezierCoreNormalAtEndWithInitialNormal(N3BezierCoreRef bezierCore, N3Vector initialNormal); + +CGFloat N3BezierCoreRelativePositionClosestToVector(N3BezierCoreRef bezierCore, N3Vector vector, N3VectorPointer closestVector, CGFloat *distance); // a relative position is a value between [0, 1] +CGFloat N3BezierCoreRelativePositionClosestToLine(N3BezierCoreRef bezierCore, N3Line line, N3VectorPointer closestVector, CGFloat *distance); + +CFIndex N3BezierCoreGetVectorInfo(N3BezierCoreRef bezierCore, CGFloat spacing, CGFloat startingPoint, N3Vector initialNormal, // returns evenly spaced vectors, tangents and normals starting at startingPoint + N3VectorArray vectors, N3VectorArray tangents, N3VectorArray normals, CFIndex numVectors); // fills numVectors in the vector arrays, returns the actual number of vectors that were set in the arrays + +// for stretched CPR +CFIndex N3BezierCoreGetProjectedVectorInfo(N3BezierCoreRef bezierCore, CGFloat spacing, CGFloat startingDistance, N3Vector projectionDirection, + N3VectorArray vectors, N3VectorArray tangents, N3VectorArray normals, CGFloat *relativePositions, CFIndex numVectors); + +N3BezierCoreRef N3BezierCoreCreateOutline(N3BezierCoreRef bezierCore, CGFloat distance, CGFloat spacing, N3Vector initialNormal); // distance from the center, spacing is the distance between ponts on the curve that are sampled to generate the outline +N3MutableBezierCoreRef N3BezierCoreCreateMutableOutline(N3BezierCoreRef bezierCore, CGFloat distance, CGFloat spacing, N3Vector initialNormal); + +N3BezierCoreRef N3BezierCoreCreateOutlineWithNormal(N3BezierCoreRef bezierCore, CGFloat distance, CGFloat spacing, N3Vector projectionNormal); +N3MutableBezierCoreRef N3BezierCoreCreateMutableOutlineWithNormal(N3BezierCoreRef bezierCore, CGFloat distance, CGFloat spacing, N3Vector projectionNormal); + + +CGFloat N3BezierCoreLengthToSegmentAtIndex(N3BezierCoreRef bezierCore, CFIndex index, CGFloat flatness); // the length up to and including the segment at index +CFIndex N3BezierCoreSegmentLengths(N3BezierCoreRef bezierCore, CGFloat *lengths, CFIndex numLengths, CGFloat flatness); // returns the number of lengths set + +CFIndex N3BezierCoreCountIntersectionsWithPlane(N3BezierCoreRef bezierCore, N3Plane plane); +CFIndex N3BezierCoreIntersectionsWithPlane(N3BezierCoreRef bezierCore, N3Plane plane, N3VectorArray intersections, CGFloat *relativePositions, CFIndex numVectors); + +N3MutableBezierCoreRef N3BezierCoreCreateMutableCopyWithEndpointsAtPlaneIntersections(N3BezierCoreRef bezierCore, N3Plane plane); // creates a N3BezierCore that is sure to have an endpoint every time the bezier core intersects the plane. If the input bezier is not already flattened, this routine will flatten it first + +N3BezierCoreRef N3BezierCoreCreateCopyProjectedToPlane(N3BezierCoreRef bezierCore, N3Plane plane); +N3MutableBezierCoreRef N3BezierCoreCreateMutableCopyProjectedToPlane(N3BezierCoreRef bezierCore, N3Plane plane); + +N3Plane N3BezierCoreLeastSquaresPlane(N3BezierCoreRef bezierCore); +CGFloat N3BezierCoreMeanDistanceToPlane(N3BezierCoreRef bezierCore, N3Plane plane); +bool N3BezierCoreIsPlanar(N3BezierCoreRef bezierCore, N3PlanePointer bezierCorePlane); // pass NULL for bezierCorePlane if you don't care + +bool N3BezierCoreGetBoundingPlanesForNormal(N3BezierCoreRef bezierCore, N3Vector normal, N3PlanePointer topPlanePtr, N3PlanePointer bottomPlanePtr); // returns true on success + +N3BezierCoreRef N3BezierCoreCreateCopyByReversing(N3BezierCoreRef bezierCore); +N3MutableBezierCoreRef N3BezierCoreCreateMutableCopyByReversing(N3BezierCoreRef bezierCore); + + +CF_EXTERN_C_END + +#endif // _N3BEZIERCORE_ADDITIONS_H_ \ No newline at end of file diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N3BezierPath.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N3BezierPath.h new file mode 100644 index 0000000..87a9c4e --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N3BezierPath.h @@ -0,0 +1,115 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import "N3Geometry.h" +#import "N3BezierCore.h" +#import "N3BezierCoreAdditions.h" + +// N3BezierDefaultFlatness and N3BezierDefaultSubdivideSegmentLength are defined in N3BezierCore.h +// N3BezierNodeStyle is defined in N3BezierCoreAdditions.h + +@class NSBezierPath; + +enum _N3BezierPathElement { + N3MoveToBezierPathElement, + N3LineToBezierPathElement, + N3CurveToBezierPathElement, + N3CloseBezierPathElement +}; +typedef NSInteger N3BezierPathElement; + +@interface N3BezierPath : NSObject // fast enumeration returns NSValues of the endpoints +{ + N3MutableBezierCoreRef _bezierCore; + CGFloat _length; + N3BezierCoreRandomAccessorRef _bezierCoreRandomAccessor; +} + +- (id)init; +- (id)initWithBezierPath:(N3BezierPath *)bezierPath; +- (id)initWithDictionaryRepresentation:(NSDictionary *)dict; +- (id)initWithN3BezierCore:(N3BezierCoreRef)bezierCore; +- (id)initWithNodeArray:(NSArray *)nodes style:(N3BezierNodeStyle)style; // array of N3Vectors in NSValues; + ++ (id)bezierPath; ++ (id)bezierPathWithBezierPath:(N3BezierPath *)bezierPath; ++ (id)bezierPathN3BezierCore:(N3BezierCoreRef)bezierCore; ++ (id)bezierPathCircleWithCenter:(N3Vector)center radius:(CGFloat)radius normal:(N3Vector)normal; + +- (BOOL)isEqualToBezierPath:(N3BezierPath *)bezierPath; + +- (N3BezierPath *)bezierPathByFlattening:(CGFloat)flatness; +- (N3BezierPath *)bezierPathBySubdividing:(CGFloat)maxSegmentLength; +- (N3BezierPath *)bezierPathByApplyingTransform:(N3AffineTransform)transform; +- (N3BezierPath *)bezierPathByAppendingBezierPath:(N3BezierPath *)bezierPath connectPaths:(BOOL)connectPaths; +- (N3BezierPath *)bezierPathByAddingEndpointsAtIntersectionsWithPlane:(N3Plane)plane; // will flatten the path if it is not already flattened +- (N3BezierPath *)bezierPathByProjectingToPlane:(N3Plane)plane; +- (N3BezierPath *)outlineBezierPathAtDistance:(CGFloat)distance initialNormal:(N3Vector)initalNormal spacing:(CGFloat)spacing; +- (N3BezierPath *)outlineBezierPathAtDistance:(CGFloat)distance projectionNormal:(N3Vector)projectionNormal spacing:(CGFloat)spacing; + +- (NSInteger)elementCount; +- (CGFloat)length; +- (CGFloat)lengthThroughElementAtIndex:(NSInteger)element; // the length of the curve up to and including the element at index +- (N3BezierCoreRef)N3BezierCore; +- (NSDictionary *)dictionaryRepresentation; +- (N3Vector)vectorAtStart; +- (N3Vector)vectorAtEnd; +- (N3Vector)tangentAtStart; +- (N3Vector)tangentAtEnd; +- (N3Vector)normalAtEndWithInitialNormal:(N3Vector)initialNormal; +- (BOOL)isPlanar; +- (N3Plane)leastSquaresPlane; +- (N3Plane)topBoundingPlaneForNormal:(N3Vector)normal; +- (N3Plane)bottomBoundingPlaneForNormal:(N3Vector)normal; +- (N3BezierPathElement)elementAtIndex:(NSInteger)index; +- (N3BezierPathElement)elementAtIndex:(NSInteger)index control1:(N3VectorPointer)control1 control2:(N3VectorPointer)control2 endpoint:(N3VectorPointer)endpoint; // Warning: differs from NSBezierPath in that controlVector2 is is not always the end + +// extra functions to help with rendering and such +- (N3Vector)vectorAtRelativePosition:(CGFloat)relativePosition; // RelativePosition is in [0, 1] +- (N3Vector)tangentAtRelativePosition:(CGFloat)relativePosition; +- (N3Vector)normalAtRelativePosition:(CGFloat)relativePosition initialNormal:(N3Vector)initialNormal; + +- (CGFloat)relativePositionClosestToVector:(N3Vector)vector; +- (CGFloat)relativePositionClosestToLine:(N3Line)line; +- (CGFloat)relativePositionClosestToLine:(N3Line)line closestVector:(N3VectorPointer)vectorPointer; +- (N3BezierPath *)bezierPathByCollapsingZ; +- (N3BezierPath *)bezierPathByReversing; + +- (NSArray*)intersectionsWithPlane:(N3Plane)plane; // returns NSValues containing N3Vectors of the intersections. +- (NSArray*)intersectionsWithPlane:(N3Plane)plane relativePositions:(NSArray **)returnedRelativePositions; + +@end + + +@interface N3MutableBezierPath : N3BezierPath +{ +} + +- (void)moveToVector:(N3Vector)vector; +- (void)lineToVector:(N3Vector)vector; +- (void)curveToVector:(N3Vector)vector controlVector1:(N3Vector)controlVector1 controlVector2:(N3Vector)controlVector2; +- (void)close; + +- (void)flatten:(CGFloat)flatness; +- (void)subdivide:(CGFloat)maxSegmentLength; +- (void)applyAffineTransform:(N3AffineTransform)transform; +- (void)projectToPlane:(N3Plane)plane; +- (void)appendBezierPath:(N3BezierPath *)bezierPath connectPaths:(BOOL)connectPaths; +- (void)addEndpointsAtIntersectionsWithPlane:(N3Plane)plane; // will flatten the path if it is not already flattened +- (void)setVectorsForElementAtIndex:(NSInteger)index control1:(N3Vector)control1 control2:(N3Vector)control2 endpoint:(N3Vector)endpoint; + +@end + + + diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N3Geometry.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N3Geometry.h new file mode 100644 index 0000000..ec6f457 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/N3Geometry.h @@ -0,0 +1,215 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#ifndef _N3GEOMETRY_H_ +#define _N3GEOMETRY_H_ + +#include + +#ifdef __OBJC__ +#import +@class NSString; +#endif + +CF_EXTERN_C_BEGIN + +struct N3Vector { + CGFloat x; + CGFloat y; + CGFloat z; +}; +typedef struct N3Vector N3Vector; + +// A N3Line is an infinite line throught space +struct N3Line { + N3Vector point; // the line goes through this point + N3Vector vector; // this is the direction of the line, the line is not valid if this is N3VectorZero, try to keep this of unit length... I wish I would have called this direction... +}; +typedef struct N3Line N3Line; + +extern const N3Line N3LineXAxis; +extern const N3Line N3LineYAxis; +extern const N3Line N3LineZAxis; +extern const N3Line N3LineInvalid; + +struct N3Plane { + N3Vector point; + N3Vector normal; +}; +typedef struct N3Plane N3Plane; + +extern const N3Plane N3PlaneXZero; +extern const N3Plane N3PlaneYZero; +extern const N3Plane N3PlaneZZero; +extern const N3Plane N3PlaneInvalid; + +typedef N3Vector *N3VectorPointer; +typedef N3Vector *N3VectorArray; + +typedef N3Line *N3LinePointer; +typedef N3Line *N3LineArray; + +typedef N3Plane *N3PlanePointer; +typedef N3Plane *N3PlaneArray; + +typedef CATransform3D N3AffineTransform; + +typedef N3AffineTransform *N3AffineTransformPointer; +typedef N3AffineTransform *N3AffineTransformArray; + +extern const N3Vector N3VectorZero; + +N3Vector N3VectorMake(CGFloat x, CGFloat y, CGFloat z); + +bool N3VectorEqualToVector(N3Vector vector1, N3Vector vector2); +bool N3VectorIsCoincidentToVector(N3Vector vector1, N3Vector vector2); // coincident to an arbitratry tolerance +bool N3VectorIsZero(N3Vector vector); + +N3Vector N3VectorAdd(N3Vector vector1, N3Vector vector2); +N3Vector N3VectorSubtract(N3Vector vector1, N3Vector vector2); +N3Vector N3VectorScalarMultiply(N3Vector vector1, CGFloat scalar); + +N3Vector N3VectorANormalVector(N3Vector vector); // returns a vector that is normal to the given vector + +CGFloat N3VectorDistance(N3Vector vector1, N3Vector vector2); + +CGFloat N3VectorDotProduct(N3Vector vector1, N3Vector vector2); +N3Vector N3VectorCrossProduct(N3Vector vector1, N3Vector vector2); +N3Vector N3VectorLerp(N3Vector vector1, N3Vector vector2, CGFloat t); // when t == 0.0 the result is vector 1, when t == 1.0 the result is vector2 +CGFloat N3VectorAngleBetweenVectorsAroundVector(N3Vector vector1, N3Vector vector2, N3Vector aroundVector); // returns [0, 2*M_PI) + +CGFloat N3VectorLength(N3Vector vector); +N3Vector N3VectorNormalize(N3Vector vector); +N3Vector N3VectorProject(N3Vector vector1, N3Vector vector2); // project vector1 onto vector2 + +N3Vector N3VectorInvert(N3Vector vector); +N3Vector N3VectorApplyTransform(N3Vector vector, N3AffineTransform transform); +N3Vector N3VectorApplyTransformToDirectionalVector(N3Vector vector, N3AffineTransform transform); // this will not apply the translation to the vector, this is to be used when the vector does not coorespond to a point in space, but instead to a direction + +N3Vector N3VectorBend(N3Vector vectorToBend, N3Vector originalDirection, N3Vector newDirection); // applies the rotation that would be needed to turn originalDirection into newDirection, to vectorToBend +bool N3VectorIsOnLine(N3Vector vector, N3Line line); +bool N3VectorIsOnPlane(N3Vector vector, N3Plane plane); +CGFloat N3VectorDistanceToLine(N3Vector vector, N3Line line); +CGFloat N3VectorDistanceToPlane(N3Vector vector, N3Plane plane); + +N3Line N3LineMake(N3Vector point, N3Vector vector); +N3Line N3LineMakeFromPoints(N3Vector point1, N3Vector point2); +bool N3LineEqualToLine(N3Line line1, N3Line line2); +bool N3LineIsCoincidentToLine(N3Line line2, N3Line line1); // do the two lines represent the same line in space, to a small amount of round-off slop +bool N3LineIsOnPlane(N3Line line, N3Plane plane); +bool N3LineIsParallelToLine(N3Line line1, N3Line line2); +bool N3LineIsValid(N3Line line); +bool N3LineIntersectsPlane(N3Line line, N3Plane plane); +N3Vector N3LineIntersectionWithPlane(N3Line line, N3Plane plane); +N3Vector N3LinePointClosestToVector(N3Line line, N3Vector vector); +N3Line N3LineApplyTransform(N3Line line, N3AffineTransform transform); +CGFloat N3LineClosestPoints(N3Line line1, N3Line line2, N3VectorPointer line1PointPtr, N3VectorPointer line2PointPtr); // given two lines, find points on each line that are the closest to each other. Returns the distance between these two points. Note that the line that goes through these two points will be normal to both lines + +N3Plane N3PlaneMake(N3Vector point, N3Vector normal); +bool N3PlaneEqualToPlane(N3Plane plane1, N3Plane plane2); +bool N3PlaneIsCoincidentToPlane(N3Plane plane1, N3Plane plane2); +bool N3PlaneIsValid(N3Plane plane); +N3Vector N3PlanePointClosestToVector(N3Plane plane, N3Vector vector); +bool N3PlaneIsParallelToPlane(N3Plane plane1, N3Plane plane2); +bool N3PlaneIsBetweenVectors(N3Plane plane, N3Vector vector1, N3Vector vector2); +N3Line N3PlaneIntersectionWithPlane(N3Plane plane1, N3Plane plane2); +N3Plane N3PlaneLeastSquaresPlaneFromPoints(N3VectorArray vectors, CFIndex numVectors); // BOGUS TODO not written yet, will give a plane, but it won't be the least squares plane +N3Plane N3PlaneApplyTransform(N3Plane plane, N3AffineTransform transform); + +void N3VectorScalarMultiplyVectors(CGFloat scalar, N3VectorArray vectors, CFIndex numVectors); +void N3VectorCrossProductVectors(N3Vector vector, N3VectorArray vectors, CFIndex numVectors); +void N3VectorAddVectors(N3VectorArray vectors1, const N3VectorArray vectors2, CFIndex numVectors); +void N3VectorApplyTransformToVectors(N3AffineTransform transform, N3VectorArray vectors, CFIndex numVectors); +void N3VectorCrossProductWithVectors(N3VectorArray vectors1, const N3VectorArray vectors2, CFIndex numVectors); +void N3VectorNormalizeVectors(N3VectorArray vectors, CFIndex numVectors); + +CG_INLINE NSPoint NSPointFromN3Vector(N3Vector vector) {return NSMakePoint(vector.x, vector.y);} +CG_INLINE N3Vector N3VectorMakeFromNSPoint(NSPoint point) {return N3VectorMake(point.x, point.y, 0);} + +extern const N3AffineTransform N3AffineTransformIdentity; + +bool N3AffineTransformIsRectilinear(N3AffineTransform t); // this is not the right term, but what is a transform that only includes scale and translation called? +N3AffineTransform N3AffineTransformTranspose(N3AffineTransform t); +CGFloat N3AffineTransformDeterminant(N3AffineTransform t); +N3AffineTransform N3AffineTransformInvert (N3AffineTransform t); +N3AffineTransform N3AffineTransformConcat (N3AffineTransform a, N3AffineTransform b); + +CG_INLINE bool N3AffineTransformIsIdentity(N3AffineTransform t) {return CATransform3DIsIdentity(t);} +CG_INLINE bool N3AffineTransformIsAffine(N3AffineTransform t) {return (t.m14 == 0.0 && t.m24 == 0.0 && t.m34 == 0.0 && t.m44 == 1.0);} +CG_INLINE bool N3AffineTransformEqualToTransform(N3AffineTransform a, N3AffineTransform b) {return CATransform3DEqualToTransform(a, b);} +CG_INLINE N3AffineTransform N3AffineTransformMakeTranslation(CGFloat tx, CGFloat ty, CGFloat tz) {return CATransform3DMakeTranslation(tx, ty, tz);} +CG_INLINE N3AffineTransform N3AffineTransformMakeTranslationWithVector(N3Vector vector) {return CATransform3DMakeTranslation(vector.x, vector.y, vector.z);} +CG_INLINE N3AffineTransform N3AffineTransformMakeScale(CGFloat sx, CGFloat sy, CGFloat sz) {return CATransform3DMakeScale(sx, sy, sz);} +CG_INLINE N3AffineTransform N3AffineTransformMakeRotation(CGFloat angle, CGFloat x, CGFloat y, CGFloat z) {return CATransform3DMakeRotation(angle, x, y, z);} +CG_INLINE N3AffineTransform N3AffineTransformMakeRotationAroundVector(CGFloat angle, N3Vector vector) {return CATransform3DMakeRotation(angle, vector.x, vector.y, vector.z);} +CG_INLINE N3AffineTransform N3AffineTransformTranslate(N3AffineTransform t, CGFloat tx, CGFloat ty, CGFloat tz) {return CATransform3DTranslate(t, tx, ty, tz);} +CG_INLINE N3AffineTransform N3AffineTransformTranslateWithVector(N3AffineTransform t, N3Vector vector) {return CATransform3DTranslate(t, vector.x, vector.y, vector.z);} +CG_INLINE N3AffineTransform N3AffineTransformScale(N3AffineTransform t, CGFloat sx, CGFloat sy, CGFloat sz) {return CATransform3DScale(t, sx, sy, sz);} +CG_INLINE N3AffineTransform N3AffineTransformRotate(N3AffineTransform t, CGFloat angle, CGFloat x, CGFloat y, CGFloat z) {return CATransform3DRotate(t, angle, x, y, z);} +CG_INLINE N3AffineTransform N3AffineTransformRotateAroundVector(N3AffineTransform t, CGFloat angle, N3Vector vector) {return CATransform3DRotate(t, angle, vector.x, vector.y, vector.z);} + +CFDictionaryRef N3VectorCreateDictionaryRepresentation(N3Vector vector); +CFDictionaryRef N3LineCreateDictionaryRepresentation(N3Line line); +CFDictionaryRef N3PlaneCreateDictionaryRepresentation(N3Plane plane); + +bool N3VectorMakeWithDictionaryRepresentation(CFDictionaryRef dict, N3Vector *vector); +bool N3LineMakeWithDictionaryRepresentation(CFDictionaryRef dict, N3Line *line); +bool N3PlaneMakeWithDictionaryRepresentation(CFDictionaryRef dict, N3Plane *plane); + +void N3AffineTransformGetOpenGLMatrixd(N3AffineTransform transform, double *d); // d better be 16 elements long +void N3AffineTransformGetOpenGLMatrixf(N3AffineTransform transform, float *f); // f better be 16 elements long + +// returns the real numbered roots of ax+b +CFIndex findRealLinearRoot(CGFloat a, CGFloat b, CGFloat *root); // returns the number of roots set +// returns the real numbered roots of ax^2+bx+c +CFIndex findRealQuadraticRoots(CGFloat a, CGFloat b, CGFloat c, CGFloat *root1, CGFloat *root2); // returns the number of roots set + // returns the real numbered roots of ax^3+bx^2+cx+d +CFIndex findRealCubicRoots(CGFloat a, CGFloat b, CGFloat c, CGFloat d, CGFloat *root1, CGFloat *root2, CGFloat *root3); // returns the number of roots set + +CF_EXTERN_C_END + + +#ifdef __OBJC__ + +NSString *NSStringFromN3AffineTransform(N3AffineTransform transform); +NSString *NSStringFromN3Vector(N3Vector vector); +NSString *NSStringFromN3Line(N3Line line); +NSString *NSStringFromN3Plane(N3Plane plane); + +/** NSValue support. **/ + +@interface NSValue (N3GeometryAdditions) + ++ (NSValue *)valueWithN3Vector:(N3Vector)vector; +- (N3Vector)N3VectorValue; + ++ (NSValue *)valueWithN3Line:(N3Line)line; +- (N3Line)N3LineValue; + ++ (NSValue *)valueWithN3Plane:(N3Plane)plane; +- (N3Plane)N3PlaneValue; + ++ (NSValue *)valueWithN3AffineTransform:(N3AffineTransform)transform; +- (N3AffineTransform)N3AffineTransformValue; + +@end + + + +#endif /* __OBJC__ */ + +#endif /* _N3GEOMETRY_H_ */ + + + diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NS(Attributed)String+Geometrics.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NS(Attributed)String+Geometrics.h new file mode 100644 index 0000000..1208bf9 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NS(Attributed)String+Geometrics.h @@ -0,0 +1,158 @@ +/* + + * SUMMARY + + The methods in these @interfaces are typically used to dynamically size + an NSTextView or NSTextField to fit their strings. They return the + ^used^ size, width or height of the given string/attributes, constrained + by the maximum dimensions passed in the 'width' and 'height' arguments. + + * RENDERING IN NSTextView VS. NSTextField + + Text rendered in a multiline line-wrapped NSTextField leaves much more + space between lines than text rendered in an NSTextView. The total points + per line is typically 10-20% higher. + + Because most apps use NSTextView to render multiline text, using a + line-wrapped NSTextField looks funny, and obviously it wastes useful + screen area. But there are more subtle disadavantages if you wish to + estimate the size of the rendered text, typically done in + order to size the view. + + First of all, you cannot get a perfect estimate of the height. + Although using the proper typesetterBehavior in the NSLayoutManager + providing the estimate fixes the severe 10-20% underestimation which + you'd get from using the default NSTypesetterLatestBehavior, + it still usually gives results that are a little inaccurate. + The error depends on the font and the size. + For Arial and Helvetica, the calculated height is usually underestimated + by the measure of one glyph descender; i.e. the measurement extends + only to the baseline of the last line. + For Lucida Grande smaller-sized fonts (9-10 pt), and for most sizes of + Goudy Old Style, the calculated height is overestimated, by about one line. + For Stencil, the calculated height is accurate. + For Zapfino, the calculated height is usually underrestimated by 1-3 pixels. + These are the only fonts that I looked at the results for. + + Finally, although the typesetterBehavior seems to be, at this time, + equal to NSTypesetterBehavior_10_2_WithCompatibility, I suppose that + this could change in the future. This will change the vertical + size of the rendered text. + + For these reasons, using a wrapped NSTextField to render multiline text is + therefore discouraged in favor of using an NSTextView. + + * THE GLOBAL VARIABLE gNSStringGeometricsTypesetterBehavior + + The estimate of line spacing is controlled by the NSTypesetterBehavior + setting in NSLayoutManager used in these methods. Therefore, you must + specify the NSTypsetterBehavior you desire when using one of these methods + to get a measurement. + + Rather than providing a 'typsetterBehavior' argument in each of the methods in + this category, which would make them really messy just to support a + discouraged usage, a global variable, gNSStringGeometricsTypesetterBehavior, is + initialized with the value NSTypesetterLatestBehavior. This value is + appropriate to estimating height of text to be rendered in an NSTextView. + This is also the default behavior in NSLayoutManager. + + Therefore, if you want to get measurements for text to be rendered in an + NSTextView, these methods will "just work". + + Also, if you want to get the dimensions for text which will render in a + single line, even in NSTextField, these methods will "just work". + + However, if you want to get dimensions of a string as rendered in the + discouraged NSTextField with line wrapping, set the global variable + gNSStringGeometricsTypesetterBehavior to + NSTypesetterBehavior_10_2_WithCompatibility before invoking these methods. + Invoking any of these methods will automatically set it back to the + default value of NSTypesetterLatestBehavior. + + * ARGUMENTS width and height + + In the sizeFor... methods, pass either a width or height which is known to + be larger than the width or height that is required. Usually, one of these + should be the "unlimited" value of FLT_MAX. + If text will be drawn on one line, you may pass FLT_MAX for width. + + * ARGUMENT attributes, NSAttributedString attributes + + The dictionary 'attributes', or for NSAttributedString (Geometrics), the + attributes of the receiver, must contain at least one key: + NSFontAttributeName, with value an NSFont object. + Other keys in 'attributes' are ignored. + + * DEGENERATE ARGUMENT CASES + + If the receiver has 0 -length, all of these methods will return 0.0. + If 'font' argument is nil, will log error to console and return 0.0 x 0.0. + + It is sometimes useful to know that, according to Douglas Davidson, + http://www.cocoabuilder.com/archive/message/cocoa/2002/2/13/66379, + "The default font for text that has no font attribute set is 12-pt Helvetica." + Can't find any official documentation on this, but it seems to be still + true today, as of Mac OS 10.5.2, for NSTextView. For NSTextField, however, + the default font is 12-pt Lucida Grande. + + If you pass a nil 'font' argument, these methods will log an error and + return 0.0. But if you pass an NSAttributedString with no font attribute + for a run, these methods will calculate assuming 12-pt regular Helvetica. + + * INTERNAL DESIGN + + -[NSAttributedString sizeForWidth:height] is the primitive workhorse method. + All other methods in these @interfaces invoke this method under the hood. + Basically, it stuffs your string into an NSTextContainer, stuffs this into + an NSLayout Manager, and then gets the answer by invoking + -[NSLayoutManager usedRectForTextContainer:]. The idea is copied from here: + http://developer.apple.com/documentation/Cocoa/Conceptual/TextLayout/Tasks/StringHeight.html + + * AUTHOR + + Please send bug reports or other comments to Jerry Krinock, jerry@ieee.org + Updates may be available at http://sheepsystems.com/sourceCode + + * ACKNOWLEDGEMENTS + + Thanks very much to Steve Nygard for taking the project one night, + recognizing the importance of the line fragment padding and hyphenation + factor, and the idea of generalizing to support NSAttributedString. + + */ + +#import + +extern int gNSStringGeometricsTypesetterBehavior ; + +@interface NSAttributedString (Geometrics) + +// Measuring Attributed Strings +- (NSSize)sizeForWidth:(float)width + height:(float)height ; +- (float)heightForWidth:(float)width ; +- (float)widthForHeight:(float)height ; + +@end + +@interface NSString (Geometrics) + +// Measuring a String With Attributes +- (NSSize)sizeForWidth:(float)width + height:(float)height + attributes:(NSDictionary*)attributes ; +- (float)heightForWidth:(float)width + attributes:(NSDictionary*)attributes ; +- (float)widthForHeight:(float)height + attributes:(NSDictionary*)attributes ; + +// Measuring a String with a constant Font +- (NSSize)sizeForWidth:(float)width + height:(float)height + font:(NSFont*)font ; +- (float)heightForWidth:(float)width + font:(NSFont*)font ; +- (float)widthForHeight:(float)height + font:(NSFont*)font ; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSAppleEventDescriptor+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSAppleEventDescriptor+N2.h new file mode 100644 index 0000000..eec69aa --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSAppleEventDescriptor+N2.h @@ -0,0 +1,31 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + + +#import + + +@interface NSObject (Scripting) + +-(NSAppleEventDescriptor*)appleEventDescriptor; + +@end + + +@interface NSAppleEventDescriptor (Scripting) + +-(id)object; ++(NSDictionary*)dictionaryWithArray:(NSArray*)array; + +@end \ No newline at end of file diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSAppleScript+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSAppleScript+N2.h new file mode 100644 index 0000000..8f9b50a --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSAppleScript+N2.h @@ -0,0 +1,15 @@ +// +// NSAppleScript+N2.h +// OsiriX_Lion +// +// Created by Alessandro Volz on 03.10.11. +// Copyright 2011 OsiriX Team. All rights reserved. +// + +#import + +@interface NSAppleScript (N2) + +-(NSAppleEventDescriptor*)runWithArguments:(NSArray*)args error:(NSDictionary**)errs; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSArray+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSArray+N2.h new file mode 100644 index 0000000..7480a4b --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSArray+N2.h @@ -0,0 +1,31 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + +#import + + +@interface NSArray (N2) + +- (NSArray*)splitArrayIntoArraysOfMinSize:(NSUInteger)chunkSize maxArrays:(NSUInteger)maxArrays; +- (NSArray*)splitArrayIntoChunksOfMinSize:(NSUInteger)chunkSize maxChunks:(NSUInteger)maxChunks; +- (id) deepMutableCopy; + +@end + + +@interface NSMutableArray (N2) + +-(void)addUniqueObjectsFromArray:(NSArray*)array; + +@end \ No newline at end of file diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSBitmapImageRep+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSBitmapImageRep+N2.h new file mode 100644 index 0000000..cb34e3b --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSBitmapImageRep+N2.h @@ -0,0 +1,29 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface NSBitmapImageRep (N2) + +-(void)setColor:(NSColor*)color __deprecated; // buggy in Retina... +-(NSImage*)image; +-(NSBitmapImageRep*)repUsingColorSpaceName:(NSString*)colorSpaceName; + +-(void)ATMask:(float)level DEPRECATED_ATTRIBUTE; +-(NSBitmapImageRep*)smoothen:(NSUInteger)margin; +//-(NSBitmapImageRep*)convolveWithFilter:(const boost::numeric::ublas::matrix&)filter fillPixel:(NSUInteger[])fillPixel; +//-(NSBitmapImageRep*)fftConvolveWithFilter:(const boost::numeric::ublas::matrix&)filter fillPixel:(NSUInteger[])fillPixel; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSButton+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSButton+N2.h new file mode 100644 index 0000000..97e5ddf --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSButton+N2.h @@ -0,0 +1,25 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface NSButton (N2) + +-(id)initWithOrigin:(NSPoint)origin title:(NSString*)title font:(NSFont*)font; + +-(NSSize)optimalSizeForWidth:(CGFloat)width; +-(NSSize)optimalSize; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSColor+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSColor+N2.h new file mode 100644 index 0000000..941213a --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSColor+N2.h @@ -0,0 +1,23 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface NSColor (N2) + +-(BOOL)isEqualToColor:(NSColor*)color; +-(BOOL)isEqualToColor:(NSColor*)color alphaThreshold:(CGFloat)alphaThreshold; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSData+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSData+N2.h new file mode 100644 index 0000000..9eaba43 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSData+N2.h @@ -0,0 +1,28 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface NSData (N2) + ++(NSData*)dataWithHex:(NSString*)hex; +-(NSData*)initWithHex:(NSString*)hex; ++(NSData*)dataWithBase64:(NSString*)base64; +-(NSData*)initWithBase64:(NSString*)base64; +-(NSString*)base64; +-(NSString*)hex; +-(NSData*)md5; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSDate+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSDate+N2.h new file mode 100644 index 0000000..7303c4a --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSDate+N2.h @@ -0,0 +1,22 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface NSDate (N2) + ++(id)dateWithYYYYMMDD:(NSString*)datestr HHMMss:(NSString*)timestr; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSDictionary+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSDictionary+N2.h new file mode 100644 index 0000000..a0b3aad --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSDictionary+N2.h @@ -0,0 +1,24 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface NSDictionary (N2) + +-(id)objectForKey:(id)k ofClass:(Class)cl; +-(id)keyForObject:(id)obj; +-(id)deepMutableCopy; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSException+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSException+N2.h new file mode 100644 index 0000000..b36a005 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSException+N2.h @@ -0,0 +1,26 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +extern NSString* const N2ErrorDomain; + + +@interface NSException (N2) + +-(NSString*)stackTrace; +-(NSString*)printStackTrace; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSFileManager+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSFileManager+N2.h new file mode 100644 index 0000000..152f945 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSFileManager+N2.h @@ -0,0 +1,43 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import +#import "N2DirectoryEnumerator.h" + + +@interface NSFileManager (N2) + +-(void) moveItemAtPathToTrash: (NSString*) path; +-(NSString*)findSystemFolderOfType:(int)folderType forDomain:(int)domain; +-(NSString*)userApplicationSupportFolderForApp; +-(NSString*)tmpFilePathInDir:(NSString*)dirPath; +-(NSString*)tmpDirPath; +-(NSString*)tmpFilePathInTmp; +-(NSString*)confirmDirectoryAtPath:(NSString*)dirPath; +-(NSString*)confirmNoIndexDirectoryAtPath:(NSString*)path; +-(NSUInteger)sizeAtPath:(NSString*)path; +-(NSUInteger)sizeAtFSRef:(FSRef*)theFileRef; +-(BOOL)copyItemAtPath:(NSString*)srcPath toPath:(NSString*)dstPath byReplacingExisting:(BOOL)replace error:(NSError**)err; + +-(BOOL)applyFileModeOfParentToItemAtPath:(NSString*)path; + +-(NSString*)destinationOfAliasAtPath:(NSString*)path; +-(NSString*)destinationOfAliasOrSymlinkAtPath:(NSString*)path; +-(NSString*)destinationOfAliasOrSymlinkAtPath:(NSString*)path resolved:(BOOL*)r; + +-(N2DirectoryEnumerator*)enumeratorAtPath:(NSString*)path limitTo:(NSInteger)maxNumberOfFiles; +-(N2DirectoryEnumerator*)enumeratorAtPath:(NSString*)path filesOnly:(BOOL)filesOnly; +-(N2DirectoryEnumerator*)enumeratorAtPath:(NSString*)path filesOnly:(BOOL)filesOnly recursive:(BOOL)recursive; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSHost+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSHost+N2.h new file mode 100644 index 0000000..f8583bc --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSHost+N2.h @@ -0,0 +1,23 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import +//#include + +@interface NSHost (N2) + ++(NSHost*)hostWithAddressOrName:(NSString*)str; + +@end + diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSImage+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSImage+N2.h new file mode 100644 index 0000000..f5518f0 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSImage+N2.h @@ -0,0 +1,48 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import +//#include + +@interface NSImage (N2) + +-(void)flipImageHorizontally; +-(NSRect)boundingBoxSkippingColor:(NSColor*)color inRect:(NSRect)box; +-(NSRect)boundingBoxSkippingColor:(NSColor*)color; + +-(NSImage*)shadowImage; +-(NSImage*)imageWithHue:(CGFloat)hue; + +-(NSSize)sizeByScalingProportionallyToSize:(NSSize)targetSize; +-(NSSize)sizeByScalingDownProportionallyToSize:(NSSize)targetSize; +-(NSImage*)imageByScalingProportionallyToSize:(NSSize)targetSize; + +@end + +@interface N2Image : NSImage { + NSRect _portion; + NSSize _inchSize; +} + +@property NSSize inchSize; +@property NSRect portion; + +-(id)initWithSize:(NSSize)size inches:(NSSize)inches; +-(id)initWithSize:(NSSize)size inches:(NSSize)inches portion:(NSRect)portion; +-(N2Image*)crop:(NSRect)rect; +-(NSPoint)convertPointFromPageInches:(NSPoint)p; +-(NSSize)originalInchSize; +-(float)resolution; + +@end \ No newline at end of file diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSImageView+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSImageView+N2.h new file mode 100644 index 0000000..11ee148 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSImageView+N2.h @@ -0,0 +1,23 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface NSImageView (N2) + ++(id)createWithImage:(NSImage*)image; + +@end + diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSInvocation+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSInvocation+N2.h new file mode 100644 index 0000000..a0bb37b --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSInvocation+N2.h @@ -0,0 +1,24 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + +@interface NSInvocation (N2) + ++(NSInvocation*)invocationWithSelector:(SEL)sel target:(id)target; ++(NSInvocation*)invocationWithSelector:(SEL)sel target:(id)target argument:(id)arg; +-(void)setArgumentObject:(id)o atIndex:(NSUInteger)i; +-(id)returnValue; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSManagedObject+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSManagedObject+N2.h new file mode 100644 index 0000000..c22a530 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSManagedObject+N2.h @@ -0,0 +1,25 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface NSManagedObject (N2) + ++(NSString*)UidForXid:(NSString*)xid; ++(NSURL*)UrlForXid:(NSString*)xid; + +-(NSString*)XID; +-(NSString*)XIDFilename; +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSMutableDictionary+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSMutableDictionary+N2.h new file mode 100644 index 0000000..1685927 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSMutableDictionary+N2.h @@ -0,0 +1,24 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface NSMutableDictionary (N2) + +-(void)removeObject:(id)obj; + +-(void)setBool:(BOOL)b forKey:(NSString*)key; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSMutableString+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSMutableString+N2.h new file mode 100644 index 0000000..fd590a4 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSMutableString+N2.h @@ -0,0 +1,23 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + + +#import + + +@interface NSMutableString (N2) + +-(NSUInteger)replaceOccurrencesOfString:(NSString *)target withString:(NSString *)replacement; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSNotificationCenter+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSNotificationCenter+N2.h new file mode 100644 index 0000000..1e193cd --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSNotificationCenter+N2.h @@ -0,0 +1,24 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface NSNotificationCenter (N2) + +- (void)postNotificationOnMainThread:(NSNotification *)notification; +- (void)postNotificationOnMainThreadName:(NSString *)aName object:(id)anObject; +- (void)postNotificationOnMainThreadName:(NSString *)aName object:(id)anObject userInfo:(NSDictionary *)aUserInfo; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSObject+SBJSON.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSObject+SBJSON.h new file mode 100644 index 0000000..ecf0ee4 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSObject+SBJSON.h @@ -0,0 +1,68 @@ +/* + Copyright (C) 2009 Stig Brautaset. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * 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. + + * Neither the name of the author nor the names of its contributors may be used + to endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE 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 OWNER 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. + */ + +#import + + +/** + @brief Adds JSON generation to Foundation classes + + This is a category on NSObject that adds methods for returning JSON representations + of standard objects to the objects themselves. This means you can call the + -JSONRepresentation method on an NSArray object and it'll do what you want. + */ +@interface NSObject (NSObject_SBJSON) + +/** + @brief Returns a string containing the receiver encoded as a JSON fragment. + + This method is added as a category on NSObject but is only actually + supported for the following objects: + @li NSDictionary + @li NSArray + @li NSString + @li NSNumber (also used for booleans) + @li NSNull + + @deprecated Given we bill ourselves as a "strict" JSON library, this method should be removed. + */ +- (NSString *)JSONFragment; + +/** + @brief Returns a string containing the receiver encoded in JSON. + + This method is added as a category on NSObject but is only actually + supported for the following objects: + @li NSDictionary + @li NSArray + */ +- (NSString *)JSONRepresentation; + +@end + diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSPanel+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSPanel+N2.h new file mode 100644 index 0000000..7da4987 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSPanel+N2.h @@ -0,0 +1,23 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface NSPanel (N2) + ++(NSPanel*)alertWithTitle:(NSString*)title message:(NSString*)message defaultButton:(NSString*)defaultButton alternateButton:(NSString*)alternateButton icon:(NSImage*)icon; ++(NSPanel*)alertWithTitle:(NSString*)title message:(NSString*)message defaultButton:(NSString*)defaultButton alternateButton:(NSString*)alternateButton icon:(NSImage*)icon sheet:(BOOL)sheet; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSScreen+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSScreen+N2.h new file mode 100644 index 0000000..0251c51 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSScreen+N2.h @@ -0,0 +1,17 @@ +// +// NSScreen+N2.h +// OsiriX_Lion +// +// Created by Alessandro Volz on 03.04.12. +// Copyright (c) 2012 OsiriX Team. All rights reserved. +// + +#import + +@interface NSScreen (N2) + +-(NSUInteger)screenNumber; +-(NSString*)displayName; +-(NSNumber*)serialNumber; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSString+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSString+N2.h new file mode 100644 index 0000000..84f72e5 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSString+N2.h @@ -0,0 +1,61 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +extern NSString* N2NonNullString(NSString* s); + +@interface NSString (N2) + +-(NSString*)markedString; +-(NSString *)stringByTruncatingToLength:(NSInteger)theWidth; ++(NSString*)sizeString:(unsigned long long)size; ++(NSString*)timeString:(NSTimeInterval)time; ++(NSString*)timeString:(NSTimeInterval)time maxUnits:(NSInteger)maxUnits; ++(NSString*)dateString:(NSTimeInterval)date; +-(NSString*)stringByTrimmingStartAndEnd; + +-(NSString*)urlEncodedString __deprecated; // use +-(NSString*)xmlEscapedString; +-(NSString*)xmlUnescapedString; + +-(NSString*)ASCIIString; + +-(BOOL)contains:(NSString*)str; + +-(NSString*)stringByPrefixingLinesWithString:(NSString*)prefix; ++(NSString*)stringByRepeatingString:(NSString*)string times:(NSUInteger)times; +-(NSString*)suspendedString; + +-(NSRange)range; + +//-(NSString*)resolvedPathString; +-(NSString*)stringByComposingPathWithString:(NSString*)rel; + +-(NSArray*)componentsWithLength:(NSUInteger)len; + +-(BOOL)isEmail; + +-(void)splitStringAtCharacterFromSet:(NSCharacterSet*)charset intoChunks:(NSString**)part1 :(NSString**)part2 separator:(unichar*)separator; + +-(NSString*)md5; + +@end + +@interface NSAttributedString (N2) + +-(NSRange)range; + +@end; \ No newline at end of file diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSString+SBJSON.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSString+SBJSON.h new file mode 100644 index 0000000..fad7179 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSString+SBJSON.h @@ -0,0 +1,58 @@ +/* + Copyright (C) 2009 Stig Brautaset. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * 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. + + * Neither the name of the author nor the names of its contributors may be used + to endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE 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 OWNER 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. + */ + +#import + +/** + @brief Adds JSON parsing methods to NSString + +This is a category on NSString that adds methods for parsing the target string. +*/ +@interface NSString (NSString_SBJSON) + + +/** + @brief Returns the object represented in the receiver, or nil on error. + + Returns a a scalar object represented by the string's JSON fragment representation. + + @deprecated Given we bill ourselves as a "strict" JSON library, this method should be removed. + */ +- (id)JSONFragmentValue; + +/** + @brief Returns the NSDictionary or NSArray represented by the current string's JSON representation. + + Returns the dictionary or array represented in the receiver, or nil on error. + + Returns the NSDictionary or NSArray represented by the current string's JSON representation. + */ +- (id)JSONValue; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSTextView+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSTextView+N2.h new file mode 100644 index 0000000..f844cb7 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSTextView+N2.h @@ -0,0 +1,29 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface NSTextView (N2) + ++(NSTextView*)labelWithText:(NSString*)string; ++(NSTextView*)labelWithText:(NSString*)string alignment:(NSTextAlignment)alignment; + +-(NSSize)adaptToContent; +-(NSSize)adaptToContent:(CGFloat)maxWidth; + +-(NSSize)optimalSizeForWidth:(CGFloat)width; +-(NSSize)optimalSize; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSThread+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSThread+N2.h new file mode 100644 index 0000000..2d55ec6 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSThread+N2.h @@ -0,0 +1,63 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + + +#import + +@interface NSThread (N2) + ++(NSThread*)performBlockInBackground:(void(^)())block; + +extern NSString* const NSThreadNameKey; + +extern NSString* const NSThreadUniqueIdKey; +-(NSString*)uniqueId; +-(void)setUniqueId:(NSString*)uniqueId; + +extern NSString* const NSThreadIsCancelledKey; +//-(BOOL)isCancelled; +-(void)setIsCancelled:(BOOL)isCancelled; + +-(void)enterOperation; +-(void)enterOperationIgnoringLowerLevels; +-(void)enterOperationWithRange:(CGFloat)rangeLoc :(CGFloat)rangeLen; +-(void)exitOperation; +-(void)enterSubthreadWithRange:(CGFloat)rangeLoc :(CGFloat)rangeLen __deprecated; +-(void)exitSubthread __deprecated; + +extern NSString* const NSThreadSupportsCancelKey; +-(BOOL)supportsCancel; +-(void)setSupportsCancel:(BOOL)supportsCancel; + +extern NSString* const NSThreadSupportsBackgroundingKey; +-(BOOL)supportsBackgrounding; +-(void)setSupportsBackgrounding:(BOOL)supportsBackgrounding; + +extern NSString* const NSThreadStatusKey; +-(NSString*)status; +-(void)setStatus:(NSString*)status; + +extern NSString* const NSThreadProgressKey; +-(CGFloat)progress; +-(void)setProgress:(CGFloat)progress; + +extern NSString* const NSThreadProgressDetailsKey; +-(NSString*)progressDetails; +-(void)setProgressDetails:(NSString*)progressDetails; + +extern NSString* const NSThreadSubthreadsAwareProgressKey; +-(CGFloat)subthreadsAwareProgress; + +@end + diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSURL+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSURL+N2.h new file mode 100644 index 0000000..5ff8fa5 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSURL+N2.h @@ -0,0 +1,33 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface N2URLParts : NSObject { + NSString *_protocol, *_address, *_port, *_path, *_params; +} + +@property(retain) NSString *protocol, *address, *port, *path, *params; +@property(readonly) NSString* pathAndParams; + +@end + + +@interface NSURL (N2) + +-(N2URLParts*)parts; ++(NSURL*)URLWithParts:(N2URLParts*)parts; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSUserDefaultsController+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSUserDefaultsController+N2.h new file mode 100644 index 0000000..068dc5a --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSUserDefaultsController+N2.h @@ -0,0 +1,57 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface NSUserDefaultsController (N2) + +-(NSString*)stringForKey:(NSString*)defaultName; +-(NSArray*)arrayForKey:(NSString*)defaultName; +-(NSDictionary*)dictionaryForKey:(NSString*)defaultName; +-(NSData*)dataForKey:(NSString*)defaultName; +//-(NSArray*)stringArrayForKey:(NSString*)defaultName; +-(NSInteger)integerForKey:(NSString*)defaultName; +-(float)floatForKey:(NSString*)defaultName; +-(double)doubleForKey:(NSString*)defaultName; +-(BOOL)boolForKey:(NSString*)defaultName; + +-(void)setString:(NSString*)str forKey:(NSString*)defaultName; +-(void)setArray:(NSArray*)arr forKey:(NSString*)defaultName; +-(void)setDictionary:(NSDictionary*)dic forKey:(NSString*)defaultName; +-(void)setData:(NSData*)dat forKey:(NSString*)defaultName; +//-(void)setStringArray:(NSArray*)arr forKey:(NSString*)defaultName; +-(void)setInteger:(NSInteger)i forKey:(NSString*)defaultName; +-(void)setFloat:(float)f forKey:(NSString*)defaultName; +-(void)setDouble:(double)d forKey:(NSString*)defaultName; +-(void)setBool:(BOOL)flag forKey:(NSString*)defaultName; + + +@end + +CF_EXTERN_C_BEGIN +// we often need to compose the string constants declared earlier in this file with a values key path - these functions/methods make that easier +extern NSString* valuesKeyPath(NSString* key); +CF_EXTERN_C_END + +@interface NSObject (N2ValuesBinding) + +-(id)valueForValuesKey:(NSString*)keyPath; +-(void)setValue:(id)value forValuesKey:(NSString*)keyPath; +-(void)bind:(NSString*)binding toObject:(id)observable withValuesKey:(NSString*)key options:(NSDictionary*)options; +-(void)addObserver:(NSObject*)observer forValuesKey:(NSString*)key options:(NSKeyValueObservingOptions)options context:(void*)context; +-(void)removeObserver:(NSObject*)observer forValuesKey:(NSString*)key; + +@end; + diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSView+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSView+N2.h new file mode 100644 index 0000000..1e04be6 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSView+N2.h @@ -0,0 +1,32 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface NSView (N2) + +// Shortcut to [NSView initWithFrame:NSMakeRect(NSZeroPoint, size)] +-(id)initWithSize:(NSSize)size; +-(NSRect)sizeAdjust; +-(NSImage *) screenshotByCreatingPDF; + +@end + +@protocol OptimalSize + +-(NSSize)optimalSize; +-(NSSize)optimalSizeForWidth:(CGFloat)width; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSWindow+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSWindow+N2.h new file mode 100644 index 0000000..9d945b4 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSWindow+N2.h @@ -0,0 +1,28 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + + +@interface NSWindow (N2) + +-(NSSize)contentSizeForFrameSize:(NSSize)frameSize; +-(NSSize)frameSizeForContentSize:(NSSize)contentSize; + +-(CGFloat)toolbarHeight; + +-(void)safelySetMovable:(BOOL)flag; +-(void)safelySetUsesLightBottomGradient:(BOOL)flag; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSXMLNode+N2.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSXMLNode+N2.h new file mode 100644 index 0000000..b9e6229 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/NSXMLNode+N2.h @@ -0,0 +1,26 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. + =========================================================================*/ + + +#import + + +@interface NSXMLNode (N2) + ++(id)elementWithName:(NSString*)name text:(NSString*)text; ++(id)elementWithName:(NSString*)name unsignedInt:(NSUInteger)value; ++(id)elementWithName:(NSString*)name bool:(BOOL)value; +-(NSXMLNode*)childNamed:(NSString*)childName; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/Nitrogen.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/Nitrogen.h new file mode 100644 index 0000000..5c8d5db --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/Nitrogen.h @@ -0,0 +1,102 @@ +#ifndef __Nitrogen +#define __Nitrogen + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/SBJSON.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/SBJSON.h new file mode 100644 index 0000000..43d63c3 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/SBJSON.h @@ -0,0 +1,75 @@ +/* + Copyright (C) 2007-2009 Stig Brautaset. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * 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. + + * Neither the name of the author nor the names of its contributors may be used + to endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE 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 OWNER 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. + */ + +#import +#import "SBJsonParser.h" +#import "SBJsonWriter.h" + +/** + @brief Facade for SBJsonWriter/SBJsonParser. + + Requests are forwarded to instances of SBJsonWriter and SBJsonParser. + */ +@interface SBJSON : SBJsonBase { + +@private + SBJsonParser *jsonParser; + SBJsonWriter *jsonWriter; +} + + +/// Return the fragment represented by the given string +- (id)fragmentWithString:(NSString*)jsonrep + error:(NSError**)error; + +/// Return the object represented by the given string +- (id)objectWithString:(NSString*)jsonrep + error:(NSError**)error; + +/// Parse the string and return the represented object (or scalar) +- (id)objectWithString:(id)value + allowScalar:(BOOL)x + error:(NSError**)error; + + +/// Return JSON representation of an array or dictionary +- (NSString*)stringWithObject:(id)value + error:(NSError**)error; + +/// Return JSON representation of any legal JSON value +- (NSString*)stringWithFragment:(id)value + error:(NSError**)error; + +/// Return JSON representation (or fragment) for the given object +- (NSString*)stringWithObject:(id)value + allowScalar:(BOOL)x + error:(NSError**)error; + + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/SBJsonBase.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/SBJsonBase.h new file mode 100644 index 0000000..7b10844 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/SBJsonBase.h @@ -0,0 +1,86 @@ +/* + Copyright (C) 2009 Stig Brautaset. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * 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. + + * Neither the name of the author nor the names of its contributors may be used + to endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE 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 OWNER 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. + */ + +#import + +extern NSString * SBJSONErrorDomain; + + +enum { + EUNSUPPORTED = 1, + EPARSENUM, + EPARSE, + EFRAGMENT, + ECTRL, + EUNICODE, + EDEPTH, + EESCAPE, + ETRAILCOMMA, + ETRAILGARBAGE, + EEOF, + EINPUT +}; + +/** + @brief Common base class for parsing & writing. + + This class contains the common error-handling code and option between the parser/writer. + */ +@interface SBJsonBase : NSObject { + NSMutableArray *errorTrace; + +@protected + NSUInteger depth, maxDepth; +} + +/** + @brief The maximum recursing depth. + + Defaults to 512. If the input is nested deeper than this the input will be deemed to be + malicious and the parser returns nil, signalling an error. ("Nested too deep".) You can + turn off this security feature by setting the maxDepth value to 0. + */ +@property NSUInteger maxDepth; + +/** + @brief Return an error trace, or nil if there was no errors. + + Note that this method returns the trace of the last method that failed. + You need to check the return value of the call you're making to figure out + if the call actually failed, before you know call this method. + */ + @property(copy,readonly) NSArray* errorTrace; + +/// @internal for use in subclasses to add errors to the stack trace +- (void)addErrorWithCode:(NSUInteger)code description:(NSString*)str; + +/// @internal for use in subclasess to clear the error before a new parsing attempt +- (void)clearErrorTrace; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/SBJsonParser.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/SBJsonParser.h new file mode 100644 index 0000000..e95304d --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/SBJsonParser.h @@ -0,0 +1,87 @@ +/* + Copyright (C) 2009 Stig Brautaset. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * 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. + + * Neither the name of the author nor the names of its contributors may be used + to endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE 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 OWNER 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. + */ + +#import +#import "SBJsonBase.h" + +/** + @brief Options for the parser class. + + This exists so the SBJSON facade can implement the options in the parser without having to re-declare them. + */ +@protocol SBJsonParser + +/** + @brief Return the object represented by the given string. + + Returns the object represented by the passed-in string or nil on error. The returned object can be + a string, number, boolean, null, array or dictionary. + + @param repr the json string to parse + */ +- (id)objectWithString:(NSString *)repr; + +@end + + +/** + @brief The JSON parser class. + + JSON is mapped to Objective-C types in the following way: + + @li Null -> NSNull + @li String -> NSMutableString + @li Array -> NSMutableArray + @li Object -> NSMutableDictionary + @li Boolean -> NSNumber (initialised with -initWithBool:) + @li Number -> NSDecimalNumber + + Since Objective-C doesn't have a dedicated class for boolean values, these turns into NSNumber + instances. These are initialised with the -initWithBool: method, and + round-trip back to JSON properly. (They won't silently suddenly become 0 or 1; they'll be + represented as 'true' and 'false' again.) + + JSON numbers turn into NSDecimalNumber instances, + as we can thus avoid any loss of precision. (JSON allows ridiculously large numbers.) + + */ +@interface SBJsonParser : SBJsonBase { + +@private + const char *c; +} + +@end + +// don't use - exists for backwards compatibility with 2.1.x only. Will be removed in 2.3. +@interface SBJsonParser (Private) +- (id)fragmentWithString:(id)repr; +@end + + diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/SBJsonWriter.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/SBJsonWriter.h new file mode 100644 index 0000000..f6f5e17 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/SBJsonWriter.h @@ -0,0 +1,129 @@ +/* + Copyright (C) 2009 Stig Brautaset. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * 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. + + * Neither the name of the author nor the names of its contributors may be used + to endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE 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 OWNER 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. + */ + +#import +#import "SBJsonBase.h" + +/** + @brief Options for the writer class. + + This exists so the SBJSON facade can implement the options in the writer without having to re-declare them. + */ +@protocol SBJsonWriter + +/** + @brief Whether we are generating human-readable (multiline) JSON. + + Set whether or not to generate human-readable JSON. The default is NO, which produces + JSON without any whitespace. (Except inside strings.) If set to YES, generates human-readable + JSON with linebreaks after each array value and dictionary key/value pair, indented two + spaces per nesting level. + */ +@property BOOL humanReadable; + +/** + @brief Whether or not to sort the dictionary keys in the output. + + If this is set to YES, the dictionary keys in the JSON output will be in sorted order. + (This is useful if you need to compare two structures, for example.) The default is NO. + */ +@property BOOL sortKeys; + +/** + @brief Return JSON representation (or fragment) for the given object. + + Returns a string containing JSON representation of the passed in value, or nil on error. + If nil is returned and @p error is not NULL, @p *error can be interrogated to find the cause of the error. + + @param value any instance that can be represented as a JSON fragment + + */ +- (NSString*)stringWithObject:(id)value; + +@end + + +/** + @brief The JSON writer class. + + Objective-C types are mapped to JSON types in the following way: + + @li NSNull -> Null + @li NSString -> String + @li NSArray -> Array + @li NSDictionary -> Object + @li NSNumber (-initWithBool:) -> Boolean + @li NSNumber -> Number + + In JSON the keys of an object must be strings. NSDictionary keys need + not be, but attempting to convert an NSDictionary with non-string keys + into JSON will throw an exception. + + NSNumber instances created with the +initWithBool: method are + converted into the JSON boolean "true" and "false" values, and vice + versa. Any other NSNumber instances are converted to a JSON number the + way you would expect. + + */ +@interface SBJsonWriter : SBJsonBase { + +@private + BOOL sortKeys, humanReadable; +} + +@end + +// don't use - exists for backwards compatibility. Will be removed in 2.3. +@interface SBJsonWriter (Private) +- (NSString*)stringWithFragment:(id)value; +@end + +/** + @brief Allows generation of JSON for otherwise unsupported classes. + + If you have a custom class that you want to create a JSON representation for you can implement + this method in your class. It should return a representation of your object defined + in terms of objects that can be translated into JSON. For example, a Person + object might implement it like this: + + @code + - (id)jsonProxyObject { + return [NSDictionary dictionaryWithObjectsAndKeys: + name, @"name", + phone, @"phone", + email, @"email", + nil]; + } + @endcode + + */ +@interface NSObject (SBProxyForJson) +- (id)proxyForJson; +@end + diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/SMTPClient.h b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/SMTPClient.h new file mode 100644 index 0000000..78f1476 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Headers/SMTPClient.h @@ -0,0 +1,54 @@ +// +// SMTPClient.h +// +// Created by Alessandro Volz on 08.06.11. +// Copyright 2011 Alessandro Volz. All rights reserved. +// + +#import + + +extern NSString* const SMTPServerAddressKey; +extern NSString* const SMTPServerPortsKey; +extern NSString* const SMTPServerTLSModeKey; +extern NSString* const SMTPFromKey; +extern NSString* const SMTPServerAuthFlagKey; +extern NSString* const SMTPServerAuthUsernameKey; +extern NSString* const SMTPServerAuthPasswordKey; +extern NSString* const SMTPToKey; +extern NSString* const SMTPSubjectKey; +extern NSString* const SMTPMessageKey; + +enum { + SMTPClientTLSModeNone = 0, + SMTPClientTLSModeTLSIfPossible = 1, + SMTPClientTLSModeTLSOrClose = 2 +}; +typedef NSInteger SMTPClientTLSMode; + +@interface SMTPClient : NSObject { + NSString* _address; + NSArray* _ports; + SMTPClientTLSMode _tlsMode; + NSString* _authUsername; + NSString* _authPassword; +} + +@property(readonly,retain) NSString* address; +@property(readonly,retain) NSArray* ports; +@property(readonly,assign) SMTPClientTLSMode tlsMode; +@property(readonly,retain) NSString* username; +@property(readonly,retain) NSString* password; + ++(void)send:(NSDictionary*)params; + ++(SMTPClient*)clientWithServerAddress:(NSString*)address ports:(NSArray*)ports tlsMode:(SMTPClientTLSMode)tlsMode username:(NSString*)authUsername password:(NSString*)authPassword; + ++(void)splitAddress:(NSString*)address intoEmail:(NSString**)email description:(NSString**)desc; + +-(id)initWithServerAddress:(NSString*)address ports:(NSArray*)ports tlsMode:(SMTPClientTLSMode)tlsMode username:(NSString*)authUsername password:(NSString*)authPassword; + +-(void)sendMessage:(NSString*)message withSubject:(NSString*)subject from:(NSString*)from to:(NSString*)to; +-(void)sendMessage:(NSString*)message withSubject:(NSString*)subject from:(NSString*)from to:(NSString*)to headers:(NSDictionary*)headers; + +@end diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Nitrogen b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Nitrogen new file mode 100755 index 0000000..36ebf9b Binary files /dev/null and b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Nitrogen differ diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Resources/Info.plist b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..7039c1c --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,42 @@ + + + + + BuildMachineOSBuild + 12E55 + CFBundleDevelopmentRegion + English + CFBundleExecutable + Nitrogen + CFBundleIdentifier + com.osirix.Nitrogen + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Nitrogen + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 b+xported + CFBundleSignature + ???? + CFBundleVersion + 1.0 b+xported + DTCompiler + + DTPlatformBuild + 4H1503 + DTPlatformVersion + GM + DTSDKBuild + 11E52 + DTSDKName + macosx10.7 + DTXcode + 0463 + DTXcodeBuild + 4H1503 + NSHumanReadableCopyright + © 2009 OsiriX Team + + diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Resources/PopUpArrows.png b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Resources/PopUpArrows.png new file mode 100644 index 0000000..b7770f8 Binary files /dev/null and b/DiscPublishing/Resources/Nitrogen.framework/Versions/A/Resources/PopUpArrows.png differ diff --git a/DiscPublishing/Resources/Nitrogen.framework/Versions/Current b/DiscPublishing/Resources/Nitrogen.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/DiscPublishing/Resources/Nitrogen.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/DiscPublishing/Versions.txt b/DiscPublishing/Versions.txt index 29bf413..94731d2 100644 --- a/DiscPublishing/Versions.txt +++ b/DiscPublishing/Versions.txt @@ -1,3 +1,6 @@ +1.3.3 +- Compatible with OsiriX 5.7. + 1.3.1 - Compatible with OsiriX 5.5: [DicomDatabase addFilesAtPaths] returns NSObjectIDs, and we behave accordingly diff --git a/Ejection Fraction/Ejection Fraction II.xcodeproj/project.xcworkspace/xcuserdata/antoinerosset.xcuserdatad/UserInterfaceState.xcuserstate b/Ejection Fraction/Ejection Fraction II.xcodeproj/project.xcworkspace/xcuserdata/antoinerosset.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 3cf8651..0000000 Binary files a/Ejection Fraction/Ejection Fraction II.xcodeproj/project.xcworkspace/xcuserdata/antoinerosset.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/Ejection Fraction/Ejection Fraction II.xcodeproj/project.pbxproj b/Ejection Fraction/Ejection Fraction.xcodeproj/project.pbxproj similarity index 96% rename from Ejection Fraction/Ejection Fraction II.xcodeproj/project.pbxproj rename to Ejection Fraction/Ejection Fraction.xcodeproj/project.pbxproj index c801738..7e5affe 100644 --- a/Ejection Fraction/Ejection Fraction II.xcodeproj/project.pbxproj +++ b/Ejection Fraction/Ejection Fraction.xcodeproj/project.pbxproj @@ -93,7 +93,11 @@ 59FB4F7610A2D68800283D52 /* TeichholzEjectionFractionAlgorithm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TeichholzEjectionFractionAlgorithm.h; path = Sources/Algorithms/TeichholzEjectionFractionAlgorithm.h; sourceTree = ""; }; 59FB4F7710A2D68800283D52 /* TeichholzEjectionFractionAlgorithm.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TeichholzEjectionFractionAlgorithm.mm; path = Sources/Algorithms/TeichholzEjectionFractionAlgorithm.mm; sourceTree = ""; }; AB5D36050680E57E00F4007A /* Ejection Fraction.osirixplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Ejection Fraction.osirixplugin"; sourceTree = BUILT_PRODUCTS_DIR; }; +<<<<<<< HEAD:Ejection Fraction/Ejection Fraction II.xcodeproj/project.pbxproj CEB6E5BB172D126500826F3F /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = ../../osirix/build/Development/OsiriXAPI.framework; sourceTree = ""; }; +======= + CE7FC25E16CB7D00003E9474 /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = ../../osirix/build/Development/OsiriXAPI.framework; sourceTree = ""; }; +>>>>>>> master:Ejection Fraction/Ejection Fraction.xcodeproj/project.pbxproj /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -228,9 +232,9 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 8D5B49AC048680CD000E48DA /* Ejection Fraction II */ = { + 8D5B49AC048680CD000E48DA /* Ejection Fraction */ = { isa = PBXNativeTarget; - buildConfigurationList = CE6A9A9008AC841300D0C1EE /* Build configuration list for PBXNativeTarget "Ejection Fraction II" */; + buildConfigurationList = CE6A9A9008AC841300D0C1EE /* Build configuration list for PBXNativeTarget "Ejection Fraction" */; buildPhases = ( 8D5B49AD048680CD000E48DA /* Headers */, 8D5B49AF048680CD000E48DA /* Resources */, @@ -242,7 +246,7 @@ ); dependencies = ( ); - name = "Ejection Fraction II"; + name = "Ejection Fraction"; productInstallPath = "$(HOME)/Library/Bundles"; productName = Invert; productReference = AB5D36050680E57E00F4007A /* Ejection Fraction.osirixplugin */; @@ -253,7 +257,7 @@ /* Begin PBXProject section */ 089C1669FE841209C02AAC07 /* Project object */ = { isa = PBXProject; - buildConfigurationList = CE6A9A9408AC841300D0C1EE /* Build configuration list for PBXProject "Ejection Fraction II" */; + buildConfigurationList = CE6A9A9408AC841300D0C1EE /* Build configuration list for PBXProject "Ejection Fraction" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; @@ -267,7 +271,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 8D5B49AC048680CD000E48DA /* Ejection Fraction II */, + 8D5B49AC048680CD000E48DA /* Ejection Fraction */, ); }; /* End PBXProject section */ @@ -332,12 +336,16 @@ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = NO; DEBUGGING_SYMBOLS = YES; +<<<<<<< HEAD:Ejection Fraction/Ejection Fraction II.xcodeproj/project.pbxproj FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/../../osirix-trunk/build/Development/\"", "\"$(SRCROOT)/../../osirix/osirix/build/Development\"", "\"$(SRCROOT)/../../osirix/build/Development\"", ); +======= + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; +>>>>>>> master:Ejection Fraction/Ejection Fraction.xcodeproj/project.pbxproj GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; @@ -381,6 +389,7 @@ ppc64, x86_64, ); + FRAMEWORK_SEARCH_PATHS = ../../osirix/build/Development/; MACOSX_DEPLOYMENT_TARGET = 10.7; SDKROOT = macosx10.7; }; @@ -389,7 +398,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - CE6A9A9008AC841300D0C1EE /* Build configuration list for PBXNativeTarget "Ejection Fraction II" */ = { + CE6A9A9008AC841300D0C1EE /* Build configuration list for PBXNativeTarget "Ejection Fraction" */ = { isa = XCConfigurationList; buildConfigurations = ( CE6A9A9108AC841300D0C1EE /* Development */, @@ -397,7 +406,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Development; }; - CE6A9A9408AC841300D0C1EE /* Build configuration list for PBXProject "Ejection Fraction II" */ = { + CE6A9A9408AC841300D0C1EE /* Build configuration list for PBXProject "Ejection Fraction" */ = { isa = XCConfigurationList; buildConfigurations = ( CE6A9A9508AC841300D0C1EE /* Development */, diff --git a/Ejection Fraction/Resources/Info.plist b/Ejection Fraction/Resources/Info.plist index 30ea104..c616d4a 100644 --- a/Ejection Fraction/Resources/Info.plist +++ b/Ejection Fraction/Resources/Info.plist @@ -25,9 +25,9 @@ pluginType roiTool CFBundleName - Ejection Fraction II + Ejection Fraction CFBundleShortVersionString - 2.5.2 + 2.5.3 NSHumanReadableCopyright © 2009-2013 OsiriX Team CFBundleIdentifier diff --git a/ExportROIs/ExportROIs.xcodeproj/project.pbxproj b/ExportROIs/ExportROIs.xcodeproj/project.pbxproj index f7738df..ea902c7 100644 --- a/ExportROIs/ExportROIs.xcodeproj/project.pbxproj +++ b/ExportROIs/ExportROIs.xcodeproj/project.pbxproj @@ -7,10 +7,10 @@ objects = { /* Begin PBXBuildFile section */ - 71BD46A7157DF6CE009802C2 /* OsiriXAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 71BD46A6157DF6CE009802C2 /* OsiriXAPI.framework */; }; 8202B233092EC3930013789F /* FileTypeSelector.nib in Resources */ = {isa = PBXBuildFile; fileRef = 8202B232092EC3930013789F /* FileTypeSelector.nib */; }; 82128236092EBCE20093B432 /* FileTypeSelector.h in Headers */ = {isa = PBXBuildFile; fileRef = 82128235092EBCE20093B432 /* FileTypeSelector.h */; }; 82128238092EBD0A0093B432 /* FileTypeSelector.m in Sources */ = {isa = PBXBuildFile; fileRef = 82128237092EBD0A0093B432 /* FileTypeSelector.m */; }; + 84DC787F176A23EC00997A56 /* OsiriXAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84DC787E176A23EC00997A56 /* OsiriXAPI.framework */; }; 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; DB38E3AA08CDCFCB00E80768 /* ExportROIsPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = DB38E3A808CDCFCB00E80768 /* ExportROIsPlugin.h */; }; @@ -23,11 +23,11 @@ 089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 71BD46A6157DF6CE009802C2 /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = "../../osirix-trunk/build/Development/OsiriXAPI.framework"; sourceTree = ""; }; 8202B232092EC3930013789F /* FileTypeSelector.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = FileTypeSelector.nib; sourceTree = ""; }; 82128235092EBCE20093B432 /* FileTypeSelector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FileTypeSelector.h; sourceTree = ""; }; 82128237092EBD0A0093B432 /* FileTypeSelector.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = FileTypeSelector.m; sourceTree = ""; }; 82CD775408DDAB9100BDF92A /* ExportROIs.osirixplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExportROIs.osirixplugin; sourceTree = BUILT_PRODUCTS_DIR; }; + 84DC787E176A23EC00997A56 /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = ../../osirix/build/Development/OsiriXAPI.framework; sourceTree = ""; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; DB38E3A808CDCFCB00E80768 /* ExportROIsPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ExportROIsPlugin.h; sourceTree = ""; }; DB38E3A908CDCFCB00E80768 /* ExportROIsPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ExportROIsPlugin.m; sourceTree = ""; }; @@ -40,7 +40,7 @@ buildActionMask = 2147483647; files = ( 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */, - 71BD46A7157DF6CE009802C2 /* OsiriXAPI.framework in Frameworks */, + 84DC787F176A23EC00997A56 /* OsiriXAPI.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -63,7 +63,7 @@ 089C1671FE841209C02AAC07 /* Frameworks and Libraries */ = { isa = PBXGroup; children = ( - 71BD46A6157DF6CE009802C2 /* OsiriXAPI.framework */, + 84DC787E176A23EC00997A56 /* OsiriXAPI.framework */, 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */, 1058C7AEFEA557BF11CA2CBB /* Other Frameworks */, ); @@ -253,8 +253,10 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", ); FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../osirix-trunk/build/Development\""; + FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)/../../osirix/build/Development\""; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_ENABLE_TRIGRAPHS = NO; @@ -293,7 +295,6 @@ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)"; ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc"; MACOSX_DEPLOYMENT_TARGET = 10.6; - SDKROOT = macosx10.6; }; name = Development; }; diff --git a/Ejection Fraction/Ejection Fraction II.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ExportROIs/ExportROIs.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 66% rename from Ejection Fraction/Ejection Fraction II.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to ExportROIs/ExportROIs.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 02c9261..b193a3f 100644 --- a/Ejection Fraction/Ejection Fraction II.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/ExportROIs/ExportROIs.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:ExportROIs.xcodeproj"> diff --git a/ExportROIs/ExportROIs.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate b/ExportROIs/ExportROIs.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..5c2eba1 Binary files /dev/null and b/ExportROIs/ExportROIs.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ExportROIs/ExportROIs.xcodeproj/xcuserdata/admin.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/ExportROIs/ExportROIs.xcodeproj/xcuserdata/admin.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/ExportROIs/ExportROIs.xcodeproj/xcuserdata/admin.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/ExportROIs/ExportROIs.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/ExportROIs.xcscheme b/ExportROIs/ExportROIs.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/ExportROIs.xcscheme new file mode 100644 index 0000000..0f555de --- /dev/null +++ b/ExportROIs/ExportROIs.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/ExportROIs.xcscheme @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExportROIs/ExportROIs.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist b/ExportROIs/ExportROIs.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..1e466b7 --- /dev/null +++ b/ExportROIs/ExportROIs.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + ExportROIs.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8D5B49AC048680CD000E48DA + + primary + + + + + diff --git a/ExportROIs/ExportROIsPlugin.m b/ExportROIs/ExportROIsPlugin.m index 0179d7c..ce9d274 100644 --- a/ExportROIs/ExportROIsPlugin.m +++ b/ExportROIs/ExportROIsPlugin.m @@ -72,7 +72,7 @@ - (void) endSavePanel: (NSSavePanel *) sheet returnCode: (int) retCode contextIn for ( i = 0; i < [ roiSeriesList count ]; i++ ) { // current DICOM pix - DCMPix *pix = [ pixList objectAtIndex: i ]; + DCMPix *pix = [pixList objectAtIndex: i]; // array of ROI in current pix NSArray *roiImageList = [ roiSeriesList objectAtIndex: i ]; @@ -82,10 +82,12 @@ - (void) endSavePanel: (NSSavePanel *) sheet returnCode: (int) retCode contextIn // walk through each ROI in current pix numROIs = [ roiImageList count ]; - for ( j = 0; j < numROIs; j++ ) { - - ROI *roi = [ roiImageList objectAtIndex: j ]; + for ( j = 0; j < numROIs; j++ ) + { + ROI *roi = [roiImageList objectAtIndex: j ]; + [roi setPix: pix]; + NSString *roiName = [ roi name ]; float mean = 0, min = 0, max = 0, total = 0, dev = 0; @@ -132,7 +134,7 @@ - (void) endSavePanel: (NSSavePanel *) sheet returnCode: (int) retCode contextIn [ pix convertPixX: pt.x pixY: pt.y toDICOMCoords: locs ]; [ mmXYZ addObject: [ NSString stringWithFormat: @"(%f, %f, %f)", locs[0], locs[1], locs[2] ] ]; - NSLog( @"ROI %d - %d (%@): %f, %f, %f", (int)i, (int)j, roiName, locs[0], locs[1], locs[2] ); +// NSLog( @"ROI %d - %d (%@): %f, %f, %f", (int)i, (int)j, roiName, locs[0], locs[1], locs[2] ); //NSArray *pxXY = [ NSArray arrayWithObjects: [ NSNumber numberWithFloat: pt.x ], [ NSNumber numberWithFloat: pt.y ] ]; //[ xyzInRoi addObject: xyz ]; @@ -148,7 +150,7 @@ - (void) endSavePanel: (NSSavePanel *) sheet returnCode: (int) retCode contextIn if ( fileType == FT_CSV ) { [ csvText appendFormat: @"%d,%d,%f,%f,%f,%f,%f,%c%@%c,%f,%f,%f,%f,%f,%d,%d,%@%c", - i, j, mean, min, max, total, dev, DQUOTE, roiName, DQUOTE, clocs[0], clocs[1], clocs[2], length, area, [ roi type ], numCsvPoints, csvRoiPoints, LF ]; + (int)i, (int)j, mean, min, max, total, dev, DQUOTE, roiName, DQUOTE, clocs[0], clocs[1], clocs[2], length, area, (int)[roi type], (int)numCsvPoints, csvRoiPoints, LF ]; } // roiInfo stands for a ROI @@ -223,12 +225,11 @@ - (void) endSavePanel: (NSSavePanel *) sheet returnCode: (int) retCode contextIn - (void) initPlugin { - NSLog( @"Init ExportROIsPlugin"); } - (long) filterImage:(NSString*) menuName { - long ret; + long ret = 0; if ( [ menuName isEqualToString: @"Export ROIs" ] ) { diff --git a/ExportROIs/Info.plist b/ExportROIs/Info.plist index e699286..68345d7 100644 --- a/ExportROIs/Info.plist +++ b/ExportROIs/Info.plist @@ -15,9 +15,9 @@ CFBundleSignature ???? CFBundleVersion - 1.3.1 + 1.3.2 CFBundleShortVersionString - 1.3.1 + 1.3.2 MenuTitles Export ROIs diff --git a/HelloWorld/HelloWorld.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist b/HelloWorld/HelloWorld.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..ad2e235 --- /dev/null +++ b/HelloWorld/HelloWorld.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,32 @@ + + + + + SchemeUserState + + HelloWorld.xcscheme + + orderHint + 0 + + HelloWorldPreferences.xcscheme + + orderHint + 1 + + + SuppressBuildableAutocreation + + 592685AF11D204D100CFA81F + + primary + + + 8D5B49AC048680CD000E48DA + + primary + + + + + diff --git a/HipArthroplastyTemplating/HipArthroplastyTemplating.xcodeproj/project.pbxproj b/HipArthroplastyTemplating/HipArthroplastyTemplating.xcodeproj/project.pbxproj index 02a8ec2..f47f8d7 100644 --- a/HipArthroplastyTemplating/HipArthroplastyTemplating.xcodeproj/project.pbxproj +++ b/HipArthroplastyTemplating/HipArthroplastyTemplating.xcodeproj/project.pbxproj @@ -106,7 +106,7 @@ 59F6A17010564067008585F5 /* ArthroplastyTemplatingWindowController+OsiriX.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "ArthroplastyTemplatingWindowController+OsiriX.mm"; sourceTree = ""; }; 59F6A17410564159008585F5 /* ArthroplastyTemplatingWindowController+Templates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ArthroplastyTemplatingWindowController+Templates.h"; sourceTree = ""; }; 59F6A17510564159008585F5 /* ArthroplastyTemplatingWindowController+Templates.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "ArthroplastyTemplatingWindowController+Templates.mm"; sourceTree = ""; }; - 712BC55D15871807005460E6 /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = "../../osirix-trunk/build/Development/OsiriXAPI.framework"; sourceTree = ""; }; + 712BC55D15871807005460E6 /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = ../../osirix/build/Development/OsiriXAPI.framework; sourceTree = ""; }; 713D45E115AD861000B392E0 /* Versions.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Versions.txt; sourceTree = ""; }; 718D0AE8159C8E9A00F27CE9 /* HipAT2D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HipAT2D.h; sourceTree = ""; }; 718D0AE9159C8E9A00F27CE9 /* HipAT2D.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HipAT2D.mm; sourceTree = ""; }; @@ -419,7 +419,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - "\"$(SRCROOT)/../../osirix-trunk/build/Development\"", + "\"$(SRCROOT)/../../osirix/build/Development\"", ); FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/Accelerate.framework/Versions/A/Frameworks\""; GCC_C_LANGUAGE_STANDARD = gnu99; diff --git a/HipArthroplastyTemplating/Versions.txt b/HipArthroplastyTemplating/Versions.txt index 2bfb32e..fceb6f8 100644 --- a/HipArthroplastyTemplating/Versions.txt +++ b/HipArthroplastyTemplating/Versions.txt @@ -6,7 +6,7 @@ - fixed bug: if /Library/Application Support/OsiriX doesn't exist, don't try to create it 2.4.1 -- 1-click calibration also possible with non-think reference objects thanks to better flood threshold computation +- 1-click calibration also possible with non-thick reference objects thanks to better flood threshold computation 2.4 - Added Medacta miniMAX stems diff --git a/KeyObjectSelection/KeyObjectSelection.xcodeproj/project.pbxproj b/KeyObjectSelection/KeyObjectSelection.xcodeproj/project.pbxproj index 0b4f3d2..b184b6b 100644 --- a/KeyObjectSelection/KeyObjectSelection.xcodeproj/project.pbxproj +++ b/KeyObjectSelection/KeyObjectSelection.xcodeproj/project.pbxproj @@ -40,7 +40,7 @@ 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 32DBCF630370AF2F00C91783 /* KeyObjectSelection_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KeyObjectSelection_Prefix.pch; path = Sources/KeyObjectSelection_Prefix.pch; sourceTree = ""; }; - 7116D7391574A91300FA293A /* OsiriX.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriX.framework; path = "../../osirix-trunk/build/Development/OsiriX.framework"; sourceTree = ""; }; + 7116D7391574A91300FA293A /* OsiriX.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriX.framework; path = ../../osirix/build/Development/OsiriX.framework; sourceTree = ""; }; 7116D74515751B9A00FA293A /* KeyObjectSelectionPrefs.prefPane */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = KeyObjectSelectionPrefs.prefPane; sourceTree = BUILT_PRODUCTS_DIR; }; 7116D74715751B9A00FA293A /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 7116D74915751B9A00FA293A /* PreferencePanes.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PreferencePanes.framework; path = System/Library/Frameworks/PreferencePanes.framework; sourceTree = SDKROOT; }; @@ -53,7 +53,7 @@ 7116D76615751C5800FA293A /* KeyObjectSelectionPrefs.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = KeyObjectSelectionPrefs.xib; path = Resources/KeyObjectSelectionPrefs.xib; sourceTree = ""; }; 71E2C42E1576657800EB8B95 /* NSUserDefaults+KOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSUserDefaults+KOS.h"; path = "Sources/NSUserDefaults+KOS.h"; sourceTree = ""; }; 71E2C42F1576657800EB8B95 /* NSUserDefaults+KOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSUserDefaults+KOS.m"; path = "Sources/NSUserDefaults+KOS.m"; sourceTree = ""; }; - 8420023112E829A200E1E9CE /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = "../../osirix-trunk/build/Development/OsiriXAPI.framework"; sourceTree = ""; }; + 8420023112E829A200E1E9CE /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = ../../osirix/build/Development/OsiriXAPI.framework; sourceTree = ""; }; 8D5B49B7048680CD000E48DA /* Plugin-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "Plugin-Info.plist"; path = "Resources/Plugin-Info.plist"; sourceTree = ""; }; AB5D36050680E57E00F4007A /* KeyObjectSelection.osirixplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = KeyObjectSelection.osirixplugin; sourceTree = BUILT_PRODUCTS_DIR; }; ABA48A640680BB600089EB4F /* KeyObjectSelectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = KeyObjectSelectionFilter.h; path = Sources/KeyObjectSelectionFilter.h; sourceTree = ""; }; @@ -412,7 +412,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", - "\"../../osirix-trunk/build/Development\"", + "\"../../osirix/build/Development\"", ); GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_TRIGRAPHS = NO; @@ -434,7 +434,7 @@ OTHER_REZFLAGS = ""; PRODUCT_NAME = KeyObjectSelection; SECTORDER_FLAGS = ""; - USER_HEADER_SEARCH_PATHS = "\"../../osirix-trunk/build/Development/OsiriXAPI.framework/Versions/A/Headers\""; + USER_HEADER_SEARCH_PATHS = "\"../../osirix/build/Development/OsiriXAPI.framework/Versions/A/Headers\""; WARNING_CFLAGS = ( "-Wmost", "-Wno-four-char-constants", @@ -452,7 +452,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", - "\"../../osirix-trunk/build/Development\"", + "\"../../osirix/build/Development\"", ); GCC_ENABLE_TRIGRAPHS = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -471,7 +471,7 @@ OTHER_REZFLAGS = ""; PRODUCT_NAME = KeyObjectSelection; SECTORDER_FLAGS = ""; - USER_HEADER_SEARCH_PATHS = "\"../../osirix-trunk/build/Development/OsiriXAPI.framework/Versions/A/Headers\""; + USER_HEADER_SEARCH_PATHS = "\"../../osirix/build/Development/OsiriXAPI.framework/Versions/A/Headers\""; WARNING_CFLAGS = ( "-Wmost", "-Wno-four-char-constants", diff --git a/KeyObjectSelection/Resources/Plugin-Info.plist b/KeyObjectSelection/Resources/Plugin-Info.plist index 7086e6a..f007f1b 100644 --- a/KeyObjectSelection/Resources/Plugin-Info.plist +++ b/KeyObjectSelection/Resources/Plugin-Info.plist @@ -15,7 +15,7 @@ CFBundleSignature ???? CFBundleShortVersionString - 1.0.2 + 1.0.3 NSPrincipalClass KeyObjectSelectionFilter
diff --git a/KeyObjectSelection/Sources/KeyObjectSelectionFilter.mm b/KeyObjectSelection/Sources/KeyObjectSelectionFilter.mm index 45c17ce..f0e5b46 100644 --- a/KeyObjectSelection/Sources/KeyObjectSelectionFilter.mm +++ b/KeyObjectSelection/Sources/KeyObjectSelectionFilter.mm @@ -656,11 +656,11 @@ -(void)_ViewerController_setKeyImage:(id)sender { // import the file into our DB DicomDatabase* database = [DicomDatabase databaseForContext:study.managedObjectContext]; - NSArray* images = [database addFilesAtPaths:[NSArray arrayWithObject:path] - postNotifications:YES - dicomOnly:YES - rereadExistingItems:YES - generatedByOsiriX:YES]; + NSArray* imageIDs = [database addFilesAtPaths:[NSArray arrayWithObject:path] + postNotifications:YES + dicomOnly:YES + rereadExistingItems:YES + generatedByOsiriX:YES]; // upload the new file to the DICOM node if ([NSUserDefaults.standardUserDefaults boolForKey:KOSSynchronizeKey]) // plugin is active @@ -687,8 +687,8 @@ -(void)_ViewerController_setKeyImage:(id)sender { }]; // set the new images as key images - for (DicomImage* image in images) - [image setIsKeyImage:[NSNumber numberWithBool:YES]]; + for (DicomImage* imageID in imageIDs) + [[database objectWithID:imageID] setIsKeyImage:[NSNumber numberWithBool:YES]]; } else [self _ViewerController_setKeyImage:sender]; diff --git a/KiOP/KiOP/inc/Control_Cursor_Qt.h b/KiOP/KiOP/inc/Control_Cursor_Qt.h deleted file mode 100644 index 68f13f1..0000000 --- a/KiOP/KiOP/inc/Control_Cursor_Qt.h +++ /dev/null @@ -1,132 +0,0 @@ - -#ifndef __CONTROL_CURSOR_QT_H__ -#define __CONTROL_CURSOR_QT_H__ - - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -#include "Parametres.h" -#include "Point_3D.h" - -#ifdef _OS_WIN_ - #include - #include "Gestion_Curseurs.h" -#endif - - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -//==========================================================================// -//=============================== CONSTANTES ===============================// - -#define STEADY_TYPE 1 -#define HAND_CLOSED_TYPE 2 -#define POINTER_TYPE 3 - -#define CORRECTION_DISTANCE_LINEAIRE 0 - -#if (1)//(SCRSZW >= SCRSZH) - #define MAXDX 45 - #define MAXDY ( (int)((double)MAXDX * ((double)SCRSZH/(double)SCRSZW)) ) -#else - #define MAXDY 45 - #define MAXDX ( (int)((double)MAXDY * ((double)SCRSZW/(double)SCRSZH)) ) -#endif - -#define COEFF_A -0.2502 -#define COEFF_B 483.99 -#define COEFF_C 654.98 -#define COEFF_D -0.001 - -#define COEFF_LIN_1X ((40*SCRSZW)/(MAXDX*COEFF_A)) -#define COEFF_LIN_1Y ((40*SCRSZH)/(MAXDY*COEFF_A)) -#define COEFF_LIN_2 (COEFF_B/COEFF_A) - -#define COEFF_EXP_X ((40*SCRSZW)/(MAXDX*COEFF_C)) -#define COEFF_EXP_Y ((40*SCRSZH)/(MAXDY*COEFF_C)) - - -//==========================================================================// -//================================ CLASSES =================================// - -class CursorQt -{ -public : - - // ---------------- Constructeur(s) ------------------ // - CursorQt(short type=STEADY_TYPE); - - // ---------------- Setter(s) ------------------ // - void SetPos(unsigned int x, unsigned int y); - void SetPos(QPoint newPos); - - void IncrementPos(int dx, int dy); - void IncrementPos(QPoint deltaPos); - - void SetMoveEnable(void); - void SetMoveDisable(void); - - void SetClicEnable(void); - void SetClicDisable(void); - - // ---------------- Getter(s) ------------------ // - short CursorType(void) const; - - QPoint Pos(void) const; - QPoint PreviousPos(void) const; - QPoint DeltaPos(void) const; - bool MoveEnable(void) const; - - bool ClicEnable(void) const; - bool LeftClicPressed() const; - - bool InCursorSession() const; - - void PressLeftClic(bool force=false); - void ReleaseLeftClic(bool force=false); - - void NewCursorSession(Point3D handPt); - void EndCursorSession(void); - - void MoveCursor(Point3D handPt); - -protected : - - short m_type; - - QCursor m_cursor; - QPoint m_previousPos; - - QPoint m_virtualPosPrev; - - bool m_moveEnable; - bool m_clicEnable; - - bool m_inCursorSession; - bool m_leftClicPressed; - - double m_courbeDeplacement[1001]; - -}; - - -#endif //========================== FIN ====================================// - - - - - - - diff --git a/KiOP/KiOP/inc/Gestion_Curseurs.h b/KiOP/KiOP/inc/Gestion_Curseurs.h deleted file mode 100644 index 8bccfb9..0000000 --- a/KiOP/KiOP/inc/Gestion_Curseurs.h +++ /dev/null @@ -1,36 +0,0 @@ - -#ifndef Gestion_Curseurs_h -#define Gestion_Curseurs_h - - -/***************************************************************************** -****************************** FICHIERS INCLUS ******************************/ - -#include "Parametres.h" - -#include -#ifdef _OS_WIN_ - #include -#endif -#include - - -#define CURSOR_FOLDER_PATH "kinect/Cursors" - - -/***************************************************************************** -************************** PROTOTYPES DE FONCTIONS **************************/ - -void InitGestionCurseurs(void); -BOOL LoadCursorFromCURFile(LPTSTR szFileName, HCURSOR *phCursor, unsigned int dimX, unsigned int dimY); -void ChangeCursor(unsigned short val); - - -#endif //========================== FIN ====================================// - - - - - - - diff --git a/KiOP/KiOP/inc/Gestion_GLUT.h b/KiOP/KiOP/inc/Gestion_GLUT.h deleted file mode 100644 index daf0813..0000000 --- a/KiOP/KiOP/inc/Gestion_GLUT.h +++ /dev/null @@ -1,33 +0,0 @@ - -#ifndef __GESTION_GLUT_H__ -#define __GESTION_GLUT_H__ - - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -#include "Parametres.h" - -#include -#ifdef _OS_WIN_ - #include -#endif -//#include -#include - - -//==========================================================================// -//============================== PROTOTYPES ================================// - -void RepositionnementFenetre(unsigned int val); -void RepositionnementFenetre(unsigned int x, unsigned int y); - - -#endif //========================== FIN ====================================// - - - - - - - diff --git a/KiOP/KiOP/inc/Hand_Closed_Detection.h b/KiOP/KiOP/inc/Hand_Closed_Detection.h deleted file mode 100644 index bff05c4..0000000 --- a/KiOP/KiOP/inc/Hand_Closed_Detection.h +++ /dev/null @@ -1,109 +0,0 @@ - -#ifndef __HAND_CLOSED_DETECTION__ -#define __HAND_CLOSED_DETECTION__ - - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -#include - -#include "Point_3D.h" -#include "Parametres.h" -#include "Region_Of_Interest.h" - -#include -#include -#include - -#include "XnCppWrapper.h" -#include "opencv2/imgproc/imgproc.hpp" -#include "opencv2/highgui/highgui.hpp" -//#include "cap_openni.cpp" - -using namespace std; -using namespace cv; - - -//==========================================================================// -//=============================== CONSTANTES ===============================// - -#define DISTANCE_MAX_DETECTION 1800 -#define INTERVALLE_PROFONDEUR_DETECTION 200 -#define RAPPORT_DIM_ROI 0.6 -#define NB_CASE_HAND_CLOSED_PREV 20 - -#define SEUIL_BAS 0.85 -#define SEUIL_HAUT (1/SEUIL_BAS) - - -//==========================================================================// -//================================ CLASSES =================================// - -class HandClosedDetection -{ -public : - - HandClosedDetection(); - void Update(unsigned int methode, const xn::DepthMetaData& dpmd, const Point3D handPt); - - //void ExtractionROI(const xn::DepthMetaData& dpmd); - void UpdateROI_Data(const xn::DepthMetaData& dpmd); - void Display_ROI(Mat& ROI); - - void UpdateDepthLimits(void); - void UpdateDepthLimits(unsigned int handPtZ); - - void UpdateHandPt(Point3D handPoint); - void UpdateHandPtInROI(void); - - void UpdateROI_Pt(void); - void UpdateROI_Size(void); - - QPoint ROI_Pt(void) const; - QSize ROI_Size(void) const; - - void DefinitionPointsCadrage(Mat& ROI, QPoint& haut, QPoint& bas, QPoint& gauche, QPoint& droite); - - void MethodeAireMain(const xn::DepthMetaData& dpmd); - void MethodeSurfaceRect(const xn::DepthMetaData& dpmd); - - void IncrementCompteurFrame(void); - void ResetCompteurFrame(void); - int CompteurFrame(void) const; - - void UpdateHandClosedPrev(void); - - bool HandClosed(void) const; - bool HandClosedPrev(unsigned int val) const; - bool HandClosedFlancMont(void) const; - bool HandClosedFlancDesc(void) const; - bool HandClosedClic(unsigned int val) const; - bool HandClosedStateChanged() const; - -private : - - RegionOfInterrest m_ROI; - Mat m_ROI_Data; - Mat m_ROI_Data2; - - bool m_handClosed; - bool m_handClosedPrev[NB_CASE_HAND_CLOSED_PREV]; - bool m_ROI_OutOfCamera; - - unsigned int m_depthLimitMin, m_depthLimitMax; - Point3D m_handPt; - QPoint m_handPtInROI; - - unsigned int m_compteurFrame; -}; - - -#endif //========================== FIN ====================================// - - - - - - - diff --git a/KiOP/KiOP/inc/Hand_Point.h b/KiOP/KiOP/inc/Hand_Point.h deleted file mode 100644 index 8ab3791..0000000 --- a/KiOP/KiOP/inc/Hand_Point.h +++ /dev/null @@ -1,107 +0,0 @@ - -#ifndef __HAND_POINT__ -#define __HAND_POINT__ - - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -#include -#include -#include -using namespace std; - -#include "Parametres.h" -#include "Point_3D.h" -#include "Steady_Class.h" -#include -#include - - -//==========================================================================// -//=============================== CONSTANTES ===============================// - -#define MIN_SMOOTH_VALUE 0 -#define MAX_SMOOTH_VALUE 40 - -#define SEUIL_BRUIT 2 -#define NB_CASE 4 - - -//==========================================================================// -//================================ CLASSES =================================// - -class HandPoint -{ -public : - - HandPoint(void); - - void Update(XnPoint3D handPt); - - Point3D HandPt(void) const; - Point3D HandPtBrut(void) const; - Point3D HandPtBrutFiltre(void) const; - Point3D LastHandPt(void) const; - Point3D DeltaHandPt(void) const; - Point3D HandVirtualPt(void) const; - - Point3D Speed(void) const; - - void FiltreBruit(void); - - void FiltreSmooth(void); - void SetSmooth(Point3D smooth); - void SetSmooth(unsigned int smoothX, unsigned int smoothY, unsigned int smoothZ); - void IncrementSmooth(Point3D increment); - void IncrementSmooth(int x, int y, int z); - Point3D Smooth(void) const; - - bool Steady2(void) const; - bool Steady5(void) const; - bool Steady10(void) const; - bool Steady15(void) const; - bool Steady20(void) const; - bool NotSteady(void) const; - void SignalResetSteadies(void); - - void IncrementCompteurFrame(void); - unsigned int CompteurFrame(void) const; - - bool DetectLeft(void); - bool DetectRight(void); - bool DetectUp(void); - bool DetectDown(void); - bool DetectForward(void); - bool DetectBackward(void); - bool DetectStatic(void); - -private : - - unsigned int m_compteurFrame; - - Point3D m_handPt; - Point3D m_handPtBrut; - Point3D m_handPtBrutFiltre; - Point3D m_lastHandPt; - Point3D m_lastHandPtBrut[NB_CASE]; - Point3D m_diffHandPt; - - Point3D m_handVirtualPt; - - Point3D m_smooth; - - SteadyClass m_sTD; -}; - - - - -#endif //========================== FIN ====================================// - - - - - - - diff --git a/KiOP/KiOP/inc/Parametres.h b/KiOP/KiOP/inc/Parametres.h deleted file mode 100644 index bfb4151..0000000 --- a/KiOP/KiOP/inc/Parametres.h +++ /dev/null @@ -1,107 +0,0 @@ - -#ifndef __PARAMETRES_H__ -#define __PARAMETRES_H__ - - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -#include - -#include -#include -#include - -// Définition du systčme d'exploitation -#if defined (_WIN32) - #define _OS_WIN_ -#elif defined (__APPLE__) - #define _OS_MAC_ -#endif - -#ifdef _OS_WIN_ - #include -#endif - -using namespace std; - - -//==========================================================================// -//============================== CONSTANTES ================================// - -#if defined _OS_WIN_ - #define SCRSZW (SCRSZWidth()) - #define SCRSZH (SCRSZHeight()) -#elif defined _OS_MAC_ - #define SCRSZW (SCRSZWidth()) - #define SCRSZH (SCRSZHeight()) -#endif - -#if defined _OS_WIN_ - #define RESETALL 0 - #define LAYOUT 1 - #define MOVE 2 - #define CONTRAST 3 - #define ZOOM 4 - #define SCROLL 5 - #define POINTER 6 - #define MOUSE 7 - #define CROSS 8 -#elif defined _OS_MAC_ - #define MOVE 0 - #define CONTRAST 1 - #define ZOOM 2 - #define SCROLL 3 - #define POINTER 4 - #define MOUSE 5 - #define CROSS 6 -#endif - -#define INACTIVE_SESSION_STATE -1 -#define NO_ACTION_STATE 0 -#define CALIBRATE_HAND_STATE 1 -#define TOOLS_MENU_STATE 2 -#define NORMAL_TOOLS_STATE 3 -#define LAYOUT_STATE 4 -#define POINTER_STATE 5 -#define MOUSE_STATE 6 -#define BACK_TO_MENU_STATE 9 - - -//==========================================================================// -//============================== PARAMETRES ================================// - -#define RAPPORT_SCRSZW_WINSZW 5 // Rapport de la largeur de l'écran sur la largeur de la fenętre -#define RES_WINDOW_GLUT 4 -#define INIT_POS_WINDOW 1 // Position initiale de la fenętre - -#if 1 - #define RES_X 640 - #define RES_Y 480 -#else - #define RES_X 480 - #define RES_Y 320 -#endif - -#define INIT_WIDTH_WINDOW (SCRSZW/RAPPORT_SCRSZW_WINSZW) -#define INIT_HEIGHT_WINDOW (INIT_WIDTH_WINDOW*((float)RES_Y/(float)RES_X)) - -#define MAX_STD_DEV_FOR_STEADY 0.002 -#define MAX_STD_DEV_FOR_NOT_STEADY 0.006 - - -//==========================================================================// -//============================== PROTOTYPES ================================// - -unsigned int SCRSZWidth(void); -unsigned int SCRSZHeight(void); - - -#endif //========================== FIN ====================================// - - - - - - - diff --git a/KiOP/KiOP/inc/Point_2D.h b/KiOP/KiOP/inc/Point_2D.h deleted file mode 100644 index e0b565f..0000000 --- a/KiOP/KiOP/inc/Point_2D.h +++ /dev/null @@ -1,53 +0,0 @@ - -#ifndef __POINT_2D__ -#define __POINT_2D__ - - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -#include "Point_3D.h" - - -//==========================================================================// -//=============================== CONSTANTES ===============================// - - - - -//==========================================================================// -//================================ CLASSES =================================// - -class Point2D : public Point3D -{ -public : - - Point2D(); - Point2D(short x, short y); - Point2D(string name); - Point2D(short x, short y, string name); - - void SetCoordinate(const Point2D &pt); - void SetCoordinate(const Point3D &pt); - void SetCoordinate(short x, short y); - void SetCoordinate(const XnPoint3D xnPt); - - void Afficher(ostream &flux) const; - void Print(void) const; - void Print(unsigned short nbEndLine) const; - -protected : - -}; - -ostream &operator<<(ostream &flux, const Point2D &pt); - - -#endif //========================== FIN ====================================// - - - - - - - diff --git a/KiOP/KiOP/inc/Point_3D.h b/KiOP/KiOP/inc/Point_3D.h deleted file mode 100644 index cba070b..0000000 --- a/KiOP/KiOP/inc/Point_3D.h +++ /dev/null @@ -1,115 +0,0 @@ - -#ifndef __POINT_3D__ -#define __POINT_3D__ - - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -#include -#include -using namespace std; - -#include -#include "math.h" - - -//==========================================================================// -//=============================== CONSTANTES ===============================// - - - - -//==========================================================================// -//================================ CLASSES =================================// - -class Point3D -{ -public : - - // -------------- Constructeur(s) ---------------- // - Point3D(); - Point3D(short x, short y, short z); - Point3D(const Point3D &pt); - Point3D(string name); - Point3D(short x, short y, short z, string name); - Point3D(const Point3D &pt, string name); - - // ---------------- Setter(s) ------------------ // - void SetX(short x); - void SetY(short y); - void SetZ(short z); - void IcrX(short x); - void IcrY(short y); - void IcrZ(short z); - void Rename(string newName); - - // ---------------- Accesseur(s) ------------------ // - short X(void) const; - short Y(void) const; - short Z(void) const; - string Name(void) const; - - // ---------------- Afficheur(s) ------------------ // - void Afficher(ostream &flux) const; - void Print(void) const; - void Print(unsigned short nbEndLine) const; - - // --------------- Setters secondaires -------------- // - void SetToZero(void); - void SetCoordinate(const Point3D &pt); - void SetCoordinate(short x, short y, short z); - void SetCoordinate(const XnPoint3D xnPt); - void IcrCoordinate(const Point3D &pt); - void IcrCoordinate(short x, short y, short z); - void IcrCoordinate(const XnPoint3D xnPt); - - // ----------- AAAAA ------------ // - float Norme(void) const; - Point3D Sgn(void) const; - - // ----------- Opérateurs Arithmétiques ------------ // - Point3D& operator+=(const Point3D &pt); - Point3D& operator-=(const Point3D &pt); - Point3D& operator*=(const int nb); - Point3D& operator/=(const int nb); - -protected : - short m_x, m_y, m_z; - string m_name; - -}; - -// ----------- Opérateurs Arithmétiques ------------ // -Point3D operator+(const Point3D &pt1, const Point3D &pt2); -Point3D operator-(const Point3D &pt1, const Point3D &pt2); -Point3D operator*(const Point3D &pt, const int nb); -Point3D operator/(const Point3D &pt, const int nb); - -// ----------- Opérateurs de Comparaison ------------ // -bool operator==(const Point3D &pt1, const Point3D &pt2); -bool operator!=(const Point3D &pt1, const Point3D &pt2); -Point3D operator<(const Point3D &pt1, const Point3D &pt2); -Point3D operator<=(const Point3D &pt1, const Point3D &pt2); -Point3D operator>(const Point3D &pt1, const Point3D &pt2); -Point3D operator>=(const Point3D &pt1, const Point3D &pt2); - -// ----------- Opérateurs de Flux ------------ // -ostream &operator<<(ostream &flux, const Point3D &pt); - -bool EstDansZone(const Point3D& pt, const Point3D& ptLim1, const Point3D& ptLim2); - -// ----------- Fonctions pour listes ------------ // -Point3D MeanListPt3D(const Point3D list[], unsigned short size); -void PushListPt3D(const Point3D &pt, Point3D list[], unsigned short size); -void PrintListPt3D(const Point3D list[], unsigned short size); - - -#endif //========================== FIN ====================================// - - - - - - - diff --git a/KiOP/KiOP/inc/Region_Of_Interest.h b/KiOP/KiOP/inc/Region_Of_Interest.h deleted file mode 100644 index f3ec1db..0000000 --- a/KiOP/KiOP/inc/Region_Of_Interest.h +++ /dev/null @@ -1,66 +0,0 @@ - -#ifndef __REGION_OF_INTEREST__ -#define __REGION_OF_INTEREST__ - - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -#include - -#include "Parametres.h" -#include -#include - -#include -#include "XnCppWrapper.h" -#include "opencv2/imgproc/imgproc.hpp" -#include "opencv2/highgui/highgui.hpp" - -using namespace std; -using namespace cv; - - -//==========================================================================// -//=============================== CONSTANTES ===============================// - -#define MAX_ROI_SIZE 250 - - -//==========================================================================// -//================================ CLASSES =================================// - - - -class RegionOfInterrest -{ -public : - - // Constructeurs // - RegionOfInterrest(); - RegionOfInterrest(QPoint pt, QSize size); - - void SetPt(QPoint newPoint); - void SetPt(unsigned int x, unsigned int y); - void SetSize(QSize newSize); - void SetSize(unsigned int width, unsigned int height); - - QPoint Pt(void) const; - QSize Size(void) const; - -private : - - QSize m_size; - QPoint m_pt; - -}; - - -#endif //========================== FIN ====================================// - - - - - - - diff --git a/KiOP/KiOP/inc/Steady_Class.h b/KiOP/KiOP/inc/Steady_Class.h deleted file mode 100644 index 5c87060..0000000 --- a/KiOP/KiOP/inc/Steady_Class.h +++ /dev/null @@ -1,87 +0,0 @@ - -#ifndef __STEADY_CLASS__ -#define __STEADY_CLASS__ - - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -#include -using namespace std; - -#include -//#include -#include - -#include "Point_3D.h" - - -//==========================================================================// -//=============================== CONSTANTES ===============================// - -#define MAX_TOC_FRAME_VALUE 1000000 - - -//==========================================================================// -//================================ CLASSES =================================// - -class SteadyClass -{ -public : - - SteadyClass(void); - - void SteadyCheck(const Point3D& handPt, const Point3D& lastHandPt); - - void ResetSteadies(void); - void SignalResetSteadies(void); - bool Steady2(void) const; - bool Steady5(void) const; - bool Steady10(void) const; - bool Steady15(void) const; - bool Steady20(void) const; - bool NotSteady(void) const; - - void IncrementCompteurTimer(void); - -private : - - unsigned int m_compteurTimer; - -}; - - -//==========================================================================// -//============================== PROTOTYPES ================================// - -void SetTocFrame(unsigned int tocFrame); - -void EnclenchementTimer(unsigned int ticFrame); -void Steady2(int ticFrame); -void Steady5(int ticFrame); -void Steady10(int ticFrame); -void Steady15(int ticFrame); -void Steady20(int ticFrame); - -void SteadyAllEnable(void); -void Steady2Enable(void); -void Steady5Enable(void); -void Steady10Enable(void); -void Steady15Enable(void); -void Steady20Enable(void); - -void SteadyAllDisable(void); -void Steady2Disable(void); -void Steady5Disable(void); -void Steady10Disable(void); -void Steady15Disable(void); -void Steady20Disable(void); - -#endif //========================== FIN ====================================// - - - - - - - diff --git a/KiOP/KiOP/inc/graphicsview.h b/KiOP/KiOP/inc/graphicsview.h deleted file mode 100644 index 0c70ab2..0000000 --- a/KiOP/KiOP/inc/graphicsview.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef GRAPHICSVIEW_H -#define GRAPHICSVIEW_H - -#include "Parametres.h" - -#ifdef _OS_WIN_ - #include -#endif - -#include -#include -#include -#include - - -class GraphicsView : public QGraphicsView -{ - Q_OBJECT - -public: - explicit GraphicsView(QGraphicsScene *scene, QWidget *parent = 0); - virtual void resizeEvent(QResizeEvent *event); - int getResX(); - int getResY(); - void setSize(int width, int height); - QPoint Size(void); - void setPosition(int x, int y); - -signals: - -public slots: - -private: - void createUI(); - void moveBottom(GraphicsView* widget); - int WIDTH; - int HEIGHT; - -protected: - void keyPressEvent(QKeyEvent * event); - /*void paintEvent(QPaintEvent * event);*/ - -}; - - -#endif //========================== FIN ====================================// - - - - - - - diff --git a/KiOP/KiOP/inc/main.h b/KiOP/KiOP/inc/main.h deleted file mode 100644 index d11434b..0000000 --- a/KiOP/KiOP/inc/main.h +++ /dev/null @@ -1,201 +0,0 @@ - -#ifndef __MAIN_H__ -#define __MAIN_H__ - - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -// Local headers -#include "Parametres.h" -#include "Gestion_GLUT.h" -#include "Control_Cursor_Qt.h" -#include "Hand_Point.h" -#include "Point_3D.h" -#include "Point_2D.h" - -#ifdef _OS_WIN_ - #include "Gestion_Curseurs.h" -#endif -#include "graphicsview.h" -#include "pixmap.h" -#include "telnetclient.h" -#include "tooldock.h" - -// Headers de base -#include -#include -#include -#include -#include -#include - -// Headers for OpenGL -//#include -//#include -//#include -#include - -// Headers for OpenNI -#include -#include -#include -#include - -// Headers for NITE -#include -#include -#include -#include -#include "XnVDepthMessage.h" -#include -#include - -// Headers for OpenCV -#include "opencv2/imgproc/imgproc.hpp" -#include "opencv2/highgui/highgui.hpp" - -// Headers for Qt -#include -#include -#include -#include - -// Namespaces -using namespace std; -using namespace cv; - - -//==========================================================================// -//============================== CONSTANTES ================================// - -#define TITLE "KiOP v1.0.0-beta" - -#define DP_FAR 5000 -#define DP_CLOSE 0 -#define MAX_COLOR 255 -#define COLORS 20 - -#if 1 - #define DISTANCE_MIN 800 - #define DISTANCE_MAX 2500 -#else - #define DISTANCE_MIN 1200 - #define DISTANCE_MAX 1600 -#endif - -#if defined _OS_WIN_ - #define SENSIBILITE_MOVE 2 - #define SENSIBILITE_MOVE_X (SENSIBILITE_MOVE) - #define SENSIBILITE_MOVE_Y (SENSIBILITE_MOVE) - #define SENSIBILITE_CONTRAST 2 - #define SENSIBILITE_CONTRAST_X (SENSIBILITE_CONTRAST) - #define SENSIBILITE_CONTRAST_Y (SENSIBILITE_CONTRAST) - #define SENSIBILITE_ZOOM 1 - #define SENSIBILITE_SCROLL 1 - #define SENSIBILITE_ZOOM_CPT 1 - #define SENSIBILITE_SCROLL_CPT 4 -#elif defined _OS_MAC_ - #define SENSIBILITE_MOVE 5 - #define SENSIBILITE_MOVE_X (SENSIBILITE_MOVE) - #define SENSIBILITE_MOVE_Y (SENSIBILITE_MOVE) - #define SENSIBILITE_CONTRAST -3 - #define SENSIBILITE_CONTRAST_X (SENSIBILITE_CONTRAST) - #define SENSIBILITE_CONTRAST_Y (SENSIBILITE_CONTRAST) - #define SENSIBILITE_ZOOM 1 - #define SENSIBILITE_SCROLL 1 - #define SENSIBILITE_ZOOM_CPT 1 - #define SENSIBILITE_SCROLL_CPT 4 -#endif - -#define DIR_LEFT -1 -#define DIR_RIGHT 1 -#define DIR_UP 2 -#define DIR_DOWN -2 - -struct cptTools -{ - int scroll; - int zoom; - int dir; //direction (Right = 1; Left = -1; Up = 2; Down = -2) -}; - -#define nullifyHandPoint() \ -{ \ - g_handPt.X = -1; \ - g_handPt.Y = -1; \ - g_handPt.Z = -1; \ -} - -#define CHECK_STATUS(rc, what) \ -if (rc != XN_STATUS_OK) \ -{ \ - cout << what << " failed: " << xnGetStatusString(rc) << endl; \ - return rc; \ -} - -#define CHECK_ERRORS(rc, errors, what) \ -if (rc == XN_STATUS_NO_NODE_PRESENT) \ -{ \ - XnChar strError[1024]; \ - errors.ToString(strError, 1024); \ - cout << strError << endl; \ - return (rc); \ -} - - -//==========================================================================// -//============================== PROTOTYPES ================================// - -void Initialisation(void); -void CleanupExit(); - -void IcrWithLimits(int &val, int icr, int limUp, int limDown); - -inline bool isHandPointNull(); - -void chooseTool(int ¤tTool, int &lastTool, int &totalTools); -//void browse(int currentTool, int lastTool, vector pix); -void browse(int currentTool, int lastTool, ToolDock &tools); - -void CheckHandDown(); -void CheckBaffe(); - -bool SelectionDansUnMenu(short currentIcon); - -bool ConditionActiveTool(); -bool ConditionExitTool(); - -bool ConditionLeftClicPress(); -bool ConditionLeftClicRelease(); - -ToolDock& UploadMainTools(ToolDock &mainTools, bool write); - -void ChangeState(int newState); -void handleState(); - -void glutKeyboard (unsigned char key, int x, int y); -void glutDisplay(); -void initGL(int argc, char *argv[]); - -void XN_CALLBACK_TYPE sessionStart(const XnPoint3D& ptPosition, void* UserCxt); -void XN_CALLBACK_TYPE sessionEnd(void* UserCxt); -void XN_CALLBACK_TYPE pointCreate(const XnVHandPointContext *pContext, const XnPoint3D &ptFocus, void *cxt); -void XN_CALLBACK_TYPE pointUpdate(const XnVHandPointContext *pContext, void *cxt); -void XN_CALLBACK_TYPE pointDestroy(XnUInt32 nID, void *cxt); -void XN_CALLBACK_TYPE NoHands(void* UserCxt); -void XN_CALLBACK_TYPE FocusProgress(const XnChar* strFocus, const XnPoint3D& ptPosition, XnFloat fProgress, void* UserCxt); -void XN_CALLBACK_TYPE Wave_Detected(void *pUserCxt); -void SimulateCtrlBar(void); - -#endif //========================== FIN ====================================// - - - - - - - - - - diff --git a/KiOP/KiOP/inc/pixmap.h b/KiOP/KiOP/inc/pixmap.h deleted file mode 100644 index 8dcbb61..0000000 --- a/KiOP/KiOP/inc/pixmap.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef PIXMAP_H -#define PIXMAP_H - -#include -#include -#include -#include - - -class Pixmap : public QGraphicsWidget -{ - Q_OBJECT -public: - explicit Pixmap(const QPixmap &pix, QGraphicsItem *parent = 0); - void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *); - virtual void mousePressEvent(QGraphicsSceneMouseEvent * ); - virtual void setGeometry(const QRectF &rect); - virtual void load(const QPixmap &pix); - int getWidth(); - -Q_SIGNALS: - void clicked(); - -private: - QPixmap orig; - QPixmap p; - -signals: - -public slots: - -}; - - -#endif //========================== FIN ====================================// - - - - - - - diff --git a/KiOP/KiOP/inc/telnetclient.h b/KiOP/KiOP/inc/telnetclient.h deleted file mode 100644 index ba7bcf3..0000000 --- a/KiOP/KiOP/inc/telnetclient.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef TELNETCLIENT_H -#define TELNETCLIENT_H - -#include -#include -//#include "ui_testsocket.h" -#include -#include -#include -#include - -using namespace std; - -QT_BEGIN_NAMESPACE -class QTcpSocket; -QT_END_NAMESPACE - -class TelnetClient : public QMainWindow -{ - Q_OBJECT - -public: - TelnetClient(QWidget *parent = 0, Qt::WFlags flags = 0); - void sendCommand(QString cmd);//char cmd[]); - void connexion(); - void deconnexion(); - -protected: - - -private slots: - void socketConnected(); - void socketDisconnected(); - void displayError(QAbstractSocket::SocketError socketError); - -private: - QTcpSocket *tcpSocket; - QString message; - quint16 bufferSize; -}; - - -#endif //========================== FIN ====================================// - - - - - - - diff --git a/KiOP/KiOP/inc/tooldock.h b/KiOP/KiOP/inc/tooldock.h deleted file mode 100644 index 01cd9d9..0000000 --- a/KiOP/KiOP/inc/tooldock.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef TOOLDOCK_H -#define TOOLDOCK_H - -#include "Parametres.h" - -#ifdef _OS_WIN_ - #include -#endif - -#include -#include -#include -#include -#include "qapplication.h" -#include "graphicsview.h" -#include "pixmap.h" - - - -class ToolDock : public QGraphicsWidget -{ - -public: - explicit ToolDock(int nItems, QGraphicsItem *parent = 0); - void addItem(QString name, QString resource); - GraphicsView* getWindow(); - QGraphicsScene* getScene(); - vector getItems(); - int getItemSizeActive(); - int getItemSize(); - - void setItemSize(int size); - void setItemIdlePt(int pos); - void setItemActivePt(int pos); - void setItemActive(int item); - void setItemIdle(int item); - void createView(); - - void setToolsBackgroundTransparent(void); - void setToolsBackgroundRed(void); - -//signals: -// -//public slots: - -private: - -protected: - int itemSize; - int itemSizeActive; - //float itemSizeF; - float itemSizeAlpha; - float itemIdlePt; - float itemActivePt; - int nItems; - int resX; - int resY; - int minItemSize; - int maxItemSize; - vector items; - GraphicsView *window; - QGraphicsScene *scene; -}; - - -#endif // TOOLDOCK_H - - - - - - - diff --git a/KiOP/KiOP/res/contrast.png b/KiOP/KiOP/res/contrast.png deleted file mode 100644 index a44d74d..0000000 Binary files a/KiOP/KiOP/res/contrast.png and /dev/null differ diff --git a/KiOP/KiOP/res/cursor.png b/KiOP/KiOP/res/cursor.png deleted file mode 100644 index 22a4ceb..0000000 Binary files a/KiOP/KiOP/res/cursor.png and /dev/null differ diff --git a/KiOP/KiOP/res/cursors/aero_arrow.cur b/KiOP/KiOP/res/cursors/aero_arrow.cur deleted file mode 100644 index d37f2f1..0000000 Binary files a/KiOP/KiOP/res/cursors/aero_arrow.cur and /dev/null differ diff --git a/KiOP/KiOP/res/cursors/aero_arrow_xl.cur b/KiOP/KiOP/res/cursors/aero_arrow_xl.cur deleted file mode 100644 index 6005b56..0000000 Binary files a/KiOP/KiOP/res/cursors/aero_arrow_xl.cur and /dev/null differ diff --git a/KiOP/KiOP/res/cursors/main_fermee.cur b/KiOP/KiOP/res/cursors/main_fermee.cur deleted file mode 100644 index a7efee8..0000000 Binary files a/KiOP/KiOP/res/cursors/main_fermee.cur and /dev/null differ diff --git a/KiOP/KiOP/res/cursors/main_ouverte.cur b/KiOP/KiOP/res/cursors/main_ouverte.cur deleted file mode 100644 index 8b16705..0000000 Binary files a/KiOP/KiOP/res/cursors/main_ouverte.cur and /dev/null differ diff --git a/KiOP/KiOP/res/cursors/pointeur_jaune.cur b/KiOP/KiOP/res/cursors/pointeur_jaune.cur deleted file mode 100644 index 7f4bd20..0000000 Binary files a/KiOP/KiOP/res/cursors/pointeur_jaune.cur and /dev/null differ diff --git a/KiOP/KiOP/res/cursors/pointeur_rouge.cur b/KiOP/KiOP/res/cursors/pointeur_rouge.cur deleted file mode 100644 index 1b942d9..0000000 Binary files a/KiOP/KiOP/res/cursors/pointeur_rouge.cur and /dev/null differ diff --git a/KiOP/KiOP/res/images.qrc b/KiOP/KiOP/res/images.qrc deleted file mode 100644 index 60e0dac..0000000 --- a/KiOP/KiOP/res/images.qrc +++ /dev/null @@ -1,21 +0,0 @@ - - - contrast.png - move.png - cursor.png - reset.png - scroll.png - stop.png - layout.png - layouts/_1x1.png - layouts/_1x2.png - layouts/_2x1.png - layouts/_2x2.png - layouts/_3a.png - layouts/_3b.png - zoom.png - mouse.png - mouse_fermee.png - pointer.png - - diff --git a/KiOP/KiOP/res/kiop.ico b/KiOP/KiOP/res/kiop.ico deleted file mode 100644 index a9778bb..0000000 Binary files a/KiOP/KiOP/res/kiop.ico and /dev/null differ diff --git a/KiOP/KiOP/res/layout.png b/KiOP/KiOP/res/layout.png deleted file mode 100644 index 03904e8..0000000 Binary files a/KiOP/KiOP/res/layout.png and /dev/null differ diff --git a/KiOP/KiOP/res/layouts/_1x1.png b/KiOP/KiOP/res/layouts/_1x1.png deleted file mode 100644 index e45567a..0000000 Binary files a/KiOP/KiOP/res/layouts/_1x1.png and /dev/null differ diff --git a/KiOP/KiOP/res/layouts/_1x2.png b/KiOP/KiOP/res/layouts/_1x2.png deleted file mode 100644 index 610e67e..0000000 Binary files a/KiOP/KiOP/res/layouts/_1x2.png and /dev/null differ diff --git a/KiOP/KiOP/res/layouts/_2x1.png b/KiOP/KiOP/res/layouts/_2x1.png deleted file mode 100644 index 53dd971..0000000 Binary files a/KiOP/KiOP/res/layouts/_2x1.png and /dev/null differ diff --git a/KiOP/KiOP/res/layouts/_2x2.png b/KiOP/KiOP/res/layouts/_2x2.png deleted file mode 100644 index 03d47a1..0000000 Binary files a/KiOP/KiOP/res/layouts/_2x2.png and /dev/null differ diff --git a/KiOP/KiOP/res/layouts/_3a.png b/KiOP/KiOP/res/layouts/_3a.png deleted file mode 100644 index 9ac921e..0000000 Binary files a/KiOP/KiOP/res/layouts/_3a.png and /dev/null differ diff --git a/KiOP/KiOP/res/layouts/_3b.png b/KiOP/KiOP/res/layouts/_3b.png deleted file mode 100644 index 03904e8..0000000 Binary files a/KiOP/KiOP/res/layouts/_3b.png and /dev/null differ diff --git a/KiOP/KiOP/res/mouse.png b/KiOP/KiOP/res/mouse.png deleted file mode 100644 index 6a33f9d..0000000 Binary files a/KiOP/KiOP/res/mouse.png and /dev/null differ diff --git a/KiOP/KiOP/res/mouse_fermee.png b/KiOP/KiOP/res/mouse_fermee.png deleted file mode 100644 index a7147e4..0000000 Binary files a/KiOP/KiOP/res/mouse_fermee.png and /dev/null differ diff --git a/KiOP/KiOP/res/move.png b/KiOP/KiOP/res/move.png deleted file mode 100644 index af3b932..0000000 Binary files a/KiOP/KiOP/res/move.png and /dev/null differ diff --git a/KiOP/KiOP/res/openni.xml b/KiOP/KiOP/res/openni.xml deleted file mode 100755 index 9687778..0000000 --- a/KiOP/KiOP/res/openni.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/KiOP/KiOP/res/pointer.png b/KiOP/KiOP/res/pointer.png deleted file mode 100644 index 85f3aea..0000000 Binary files a/KiOP/KiOP/res/pointer.png and /dev/null differ diff --git a/KiOP/KiOP/res/reset.png b/KiOP/KiOP/res/reset.png deleted file mode 100644 index 13f74a4..0000000 Binary files a/KiOP/KiOP/res/reset.png and /dev/null differ diff --git a/KiOP/KiOP/res/scroll.png b/KiOP/KiOP/res/scroll.png deleted file mode 100644 index 1b75c75..0000000 Binary files a/KiOP/KiOP/res/scroll.png and /dev/null differ diff --git a/KiOP/KiOP/res/stop.png b/KiOP/KiOP/res/stop.png deleted file mode 100644 index c1e0390..0000000 Binary files a/KiOP/KiOP/res/stop.png and /dev/null differ diff --git a/KiOP/KiOP/res/zoom.png b/KiOP/KiOP/res/zoom.png deleted file mode 100644 index 3f0b19d..0000000 Binary files a/KiOP/KiOP/res/zoom.png and /dev/null differ diff --git a/KiOP/KiOP/src/Control_Cursor_Qt.cpp b/KiOP/KiOP/src/Control_Cursor_Qt.cpp deleted file mode 100644 index 07cde08..0000000 --- a/KiOP/KiOP/src/Control_Cursor_Qt.cpp +++ /dev/null @@ -1,250 +0,0 @@ - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -#include "Control_Cursor_Qt.h" - - -//==========================================================================// -//=============================== MÉTHODES =================================// - - -// Constructeur -CursorQt::CursorQt(short type) -{ - m_type = type; - m_moveEnable = false; - m_clicEnable = false; - m_inCursorSession = false; - m_leftClicPressed = false; - - m_previousPos = QPoint(SCRSZW/2,SCRSZH/2); - m_virtualPosPrev = QPoint(0,0); - - unsigned int x1 = 70, y1 = 30; - unsigned int x2 = 110, y2 = 80; - - double a = (double)(y2-y1)/(double)(x2-x1); - double b = (double)y2-a*(double)x2; - - double courbe[7] = - { - 0, - 0, - 7.8227E-07, - -0.00022224, - 0.020132, - -0.029578, - 0.92355 - }; - - for (int i = 1; i=0?1:-1); - - if (dys) - dyt = m_courbeDeplacement[abs(dys)] * (dys>=0?1:-1); - - IncrementPos(dxt,dyt); - cout << "dt : " << dxt << ";" << dyt << endl; -} - - - - - - - diff --git a/KiOP/KiOP/src/Gestion_Curseurs.cpp b/KiOP/KiOP/src/Gestion_Curseurs.cpp deleted file mode 100644 index 67286d3..0000000 --- a/KiOP/KiOP/src/Gestion_Curseurs.cpp +++ /dev/null @@ -1,115 +0,0 @@ - -/***************************************************************************** -****************************** FICHIERS INCLUS ******************************/ - -#include "Gestion_Curseurs.h" - - -/***************************************************************************** -**************************** VARIABLES GLOBALES *****************************/ - -// Curseurs -HCURSOR hCurDefault = NULL, - hCurBlue = NULL, - hCurGreen = NULL, - hCurRed = NULL, - hCurYellow = NULL, - hCurWhite = NULL, - hCurStd = NULL, - hCurTest1 = NULL, - hCurTest2 = NULL, - hCurWindows = NULL, - hCurHandOpen = NULL, - hCurHandClose = NULL, - hCurHaloRed = NULL, - hCurHaloBlue = NULL, - hCurYellowPointer = NULL, - hCurRedPointer = NULL; -HCURSOR hc0, hc1, hc2, hc3, hc4, hc5, hc6, hc7, hc8; -HCURSOR hCurAnime[9]; - -int test[2] = {1,2}; - -/***************************************************************************** -******************************** FONCTIONS **********************************/ - -void InitGestionCurseurs(void) -{ - hCurDefault = CopyCursor(GetCursor()); // Ne marche pas ?!? - BOOL btest = 0; - int i; - - LoadCursorFromCURFile(TEXT("res/cursors/aero_arrow.cur"),&hCurDefault,32,32); - LoadCursorFromCURFile(TEXT("res/cursors/aero_arrow.cur"),&hCurWindows,32,32); - LoadCursorFromCURFile(TEXT("res/cursors/aero_arrow_xl.cur"),&hCurWhite,32,32); - LoadCursorFromCURFile(TEXT("res/cursors/main_ouverte.cur"),&hCurHandOpen,64,64); - LoadCursorFromCURFile(TEXT("res/cursors/main_fermee.cur"),&hCurHandClose,64,64); - LoadCursorFromCURFile(TEXT("res/cursors/pointeur_jaune.cur"),&hCurYellowPointer,64,64); - LoadCursorFromCURFile(TEXT("res/cursors/pointeur_rouge.cur"),&hCurRedPointer,64,64); - -} - - -// Charge un curseur ŕ partir d'un fichier .cur -BOOL LoadCursorFromCURFile(LPTSTR szFileName, HCURSOR *phCursor, unsigned int dimX, unsigned int dimY) -{ - *phCursor = NULL; - *phCursor = (HCURSOR)LoadImage( NULL, szFileName, IMAGE_CURSOR, dimX, dimY, LR_LOADFROMFILE | LR_SHARED); - if(*phCursor == NULL) - return FALSE; - return TRUE; -} - - -// Change le type de curseur actuel -void ChangeCursor(unsigned short val) -{ - HCURSOR hCurTemp; - BOOL testInt = 0; - static unsigned short valPrev; - - if (val != valPrev) - { - switch (val) - { - case 0 : - hCurTemp = CopyCursor(hCurWindows); - break; - case 1 : - hCurTemp = CopyCursor(hCurRedPointer); - break; - case 2 : - hCurTemp = CopyCursor(hCurHaloBlue); - break; - case 3 : - hCurTemp = CopyCursor(hCurYellowPointer); - break; - case 4 : - hCurTemp = CopyCursor(hCurHandOpen); - break; - case 5 : - hCurTemp = CopyCursor(hCurHandClose); - break; - - case 6 : - hCurTemp = CopyCursor(hCurWindows); - break; - default : - cout << "\n*** ERREUR : parametre de ChangeCursor(" << val << ") invalide. ***\n\n" << endl; - return; - } - - testInt = SetSystemCursor(hCurTemp, 32512); - valPrev = val; - } -} - - - - - - - - - - diff --git a/KiOP/KiOP/src/Gestion_GLUT.cpp b/KiOP/KiOP/src/Gestion_GLUT.cpp deleted file mode 100644 index 76e69d3..0000000 --- a/KiOP/KiOP/src/Gestion_GLUT.cpp +++ /dev/null @@ -1,42 +0,0 @@ - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -#include "Gestion_GLUT.h" - - -//==========================================================================// -//=============================== FONCTIONS ================================// - -void RepositionnementFenetre(unsigned int val) -{ - unsigned int posWindowX = 0, posWindowY = 0; - int dimWindowW = (INIT_WIDTH_WINDOW), dimWindowH = (INIT_HEIGHT_WINDOW); - unsigned int bordFenetreHaut = 30, bordFenetre = 8; - - switch(val) - { - case 1 : - glutPositionWindow(SCRSZW-dimWindowW-bordFenetre,bordFenetreHaut); - break; - case 2 : - glutPositionWindow(bordFenetre,bordFenetreHaut); - break; - case 3 : - glutPositionWindow(bordFenetre,SCRSZH-dimWindowH-bordFenetre); - break; - case 4 : - glutPositionWindow(SCRSZW-dimWindowW-bordFenetre,SCRSZH-dimWindowH-bordFenetre); - break; - default : - return; - } -} - -void RepositionnementFenetre(unsigned int x, unsigned int y) -{ - glutPositionWindow(x,y); -} - - - diff --git a/KiOP/KiOP/src/Hand_Closed_Detection.cpp b/KiOP/KiOP/src/Hand_Closed_Detection.cpp deleted file mode 100644 index 5edf7f7..0000000 --- a/KiOP/KiOP/src/Hand_Closed_Detection.cpp +++ /dev/null @@ -1,434 +0,0 @@ - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -#include "Hand_Closed_Detection.h" - - -//==========================================================================// -//================================ MÉTHODES ================================// - -// Constructeur(s) -HandClosedDetection::HandClosedDetection() -{ - m_compteurFrame = 0; - m_handClosed = false; - for (unsigned int i=0;i10) ? 1.0 : float(aireS1)/float(aireSPrec) ); - //cout << "deltaZ : " << deltaZ << "\trapport : " << rapport << endl; - //cout << "rapport : " << rapport << endl; - - // Détection de main fermée - if ((rapport < SEUIL_BAS )) - m_handClosed = true; - else if ((rapport > SEUIL_HAUT)) - m_handClosed = false; -} - -void HandClosedDetection::MethodeSurfaceRect(const xn::DepthMetaData& dpmd) -{ - QPoint haut, bas, gauche, droite; - DefinitionPointsCadrage(m_ROI_Data,haut,bas,gauche,droite); - - int largeurSurface = (droite.x() - gauche.x()); - int hauteurSurface = (bas.y() - haut.y()); - //cout << "Largeur : " << largeurSurface << "\tHauteur : " << hauteurSurface << endl; - - static int surface1 = 0, surface2 = 0, surface3 = 0, surface4 = 0, surfacePrec = 0, surfaceMoy = 0, surfaceMoyPrec = 0; - surfacePrec = surface4; - surface4 = surface3; - surface3 = surface2; - surface2 = surface1; - surface1 = largeurSurface * hauteurSurface; - - if (!(m_compteurFrame%4)) - { - surfaceMoyPrec = surfaceMoy; - surfaceMoy = (surface1+surface2+surface3+surface4)/4; - } - //cout << "SurfMoy : " << surfaceMoy; - - static int profS1 = 0, profS2 = 0, profS3 = 0, profS4 = 0, profSPrec = 0; - profSPrec = profS4; - profS4 = profS3; - profS3 = profS2; - profS2 = profS1; - profS1 = m_handPt.Z(); - int deltaZ = profS1 - profSPrec; - //cout << "DeltaZ : " << deltaZ; - - float rapport = ( (abs(deltaZ)>20) ? 1.0 : float(surfaceMoy)/float(surfaceMoyPrec) ); - static const float seuilBas = 0.5, seuilHaut = 1/seuilBas; - //cout << "Z : " << handPt.Z << "\taire : " << aireS1 << endl; - - // Détection de main fermée - if ((rapport < seuilBas )) - m_handClosed = true; - else if ((rapport > seuilHaut)) - m_handClosed = false; -} - - -// Défini l'intervalle de distances dans lequel il faut regarder -void HandClosedDetection::UpdateDepthLimits(void) -{ - m_depthLimitMin = m_handPt.Z() - INTERVALLE_PROFONDEUR_DETECTION/2; - m_depthLimitMax = m_handPt.Z() + INTERVALLE_PROFONDEUR_DETECTION/2; -} -void HandClosedDetection::UpdateDepthLimits(unsigned int handPtZ) -{ - m_depthLimitMin = handPtZ - INTERVALLE_PROFONDEUR_DETECTION/2; - m_depthLimitMax = handPtZ + INTERVALLE_PROFONDEUR_DETECTION/2; -} - -// Récupčre les coordonnées 3D du handPoint -void HandClosedDetection::UpdateHandPt(Point3D handPt) -{ - m_handPt = handPt; -} - -// Défini les coordonnées de handPointInROI -void HandClosedDetection::UpdateHandPtInROI(void) -{ - m_handPtInROI.setX(m_handPt.X() - m_ROI.Pt().x()); - m_handPtInROI.setY(m_handPt.Y() - m_ROI.Pt().y()); -} - -// Défini les dimensions du ROI -void HandClosedDetection::UpdateROI_Size(void) -{ - static const float x1 = 500, x2 = 2500; - static const float y1 = 250, y2 = 50; - - static const int ROI_SizeOffset = 60; - static const float ROI_SizeCoeffA = (x1*x2) * (y1-y2)/(x2-x1); - static const float ROI_SizeCoeffB = y1 - ROI_SizeCoeffA/x1 + ROI_SizeOffset; - int val = (ROI_SizeCoeffA/m_handPt.Z()) + ROI_SizeCoeffB; - - m_ROI.SetSize(val,RAPPORT_DIM_ROI*val); // Un peu moins haut que large - - //cout << "NWidth : " << m_ROI.Size().width() << "\tNHeight : " << m_ROI.Size().height() << endl; -} - -// Défini les coordonnées haut-gauche du ROI -void HandClosedDetection::UpdateROI_Pt(void) -{ - m_ROI.SetPt(m_handPt.X() - m_ROI.Size().width() /2, - m_handPt.Y() - m_ROI.Size().height()/2); - - // Si le ROI est hors de la résolution de la caméra - if ( (m_ROI.Pt().x() <= 0) || (m_ROI.Pt().y() <= 0) - || ((m_ROI.Pt().x()+m_ROI.Size().width()) >= RES_X) || ((m_ROI.Pt().y()+m_ROI.Size().height()) >= RES_Y) ) - m_ROI_OutOfCamera = true; - else - m_ROI_OutOfCamera = false; - - //cout << "N_x : " << m_ROI.Pt().x() << "\tN_y : " << m_ROI.Pt().y() << endl; -} - -////== A EFFACER ==// -//// Extrait les données de l'image de profondeur de la zone ROI -//void HandClosedDetection::ExtractionROI(const xn::DepthMetaData& dpmd) -//{ -// unsigned int i, j; -// unsigned char imBin[MAX_ROI_SIZE][MAX_ROI_SIZE] = {0}; -// unsigned int im2[MAX_ROI_SIZE][MAX_ROI_SIZE] = {0}; -// unsigned int depth = 0; -// -// //for (i=0; i<=m_ROI.Size().height(); i++) -// // for (j=0; j<=m_ROI.Size().width(); j++) -// // { -// // depth = dpmd(j+m_ROI.Pt().x(),i+m_ROI.Pt().y()); -// // imBin[i][j] = 255*(int)((depth > m_depthLimitMin) && (depth < m_depthLimitMax)); -// // } -// -// for (i=0; i<=m_ROI.Size().height(); i++) -// for (j=0; j<=m_ROI.Size().width(); j++) -// { -// depth = dpmd(j+m_ROI.Pt().x(),i+m_ROI.Pt().y()); -// imBin[i][j] = 255*(int)((depth > m_depthLimitMin) && (depth < m_depthLimitMax)); -// //im2[i][j] = depth; -// -// } -// -// //ROI = Mat(MAX_ROI_SIZE,MAX_ROI_SIZE,CV_8UC1,imBin); -// m_ROI_Data = Mat(MAX_ROI_SIZE,MAX_ROI_SIZE,CV_8UC1,imBin); -// //m_ROI_Data2 = Mat(MAX_ROI_SIZE,MAX_ROI_SIZE,CV_8UC1,im2); -// -// //Mat test; -// //UpdateROI_Data(dpmd,test); -// //UpdateROI_Data(dpmd); -// -// //Display_ROI(ROI); -// //namedWindow("1234m_ROI_Data"); -// //imshow("1234dst1", m_ROI_Data); -// //namedWindow("1234test",CV_WINDOW_AUTOSIZE); -// //imshow("1234test", test); -// -// -//} - -// Extrait les données de l'image de profondeur de la zone ROI -void HandClosedDetection::UpdateROI_Data(const xn::DepthMetaData& dpmd) -{ - int i, j; - int cols = dpmd.XRes(); - int rows = dpmd.YRes(); - - // Acquisition de l'image de profondeur - Mat depthMap; - depthMap.create(rows, cols, CV_16UC1); - const XnDepthPixel* pDepthMap = dpmd.Data(); - CV_Assert(sizeof(unsigned short) == sizeof(XnDepthPixel)); - memcpy(depthMap.data, pDepthMap, cols*rows*sizeof(XnDepthPixel)); - - // Définition de la ROI - Mat depthMapROI (depthMap, Rect(m_ROI.Pt().x(), m_ROI.Pt().y(), m_ROI.Size().width(), m_ROI.Size().height())); - - // Binarisation de la ROI (MAJ de m_ROI_Data) - m_ROI_Data = (depthMapROI > m_depthLimitMin) & (depthMapROI < m_depthLimitMax); - - //// Collage de la ROI binaire sur l'image de profondeur - //depthMapROI.setTo(Scalar::all(255*256), m_ROI_Data); - //depthMapROI.setTo(Scalar::all(0), (m_ROI_Data==0)); - - //// Collage du cadre de la ROI sur l'image de profondeur - //for (i=-1; i(j*m_ROI.Size().height()-1,i) = 255*256; - //for (i=0; i<=1; i++) - // for (j=-1; j(j,i*m_ROI.Size().width()-1) = 255*256; - - //// Affichage de l'image de profondeur - //namedWindow("1234depthMap",CV_WINDOW_AUTOSIZE); - //imshow("1234depthMap", depthMap); -} - - -void HandClosedDetection::Display_ROI(Mat& ROI) -{ - //int i, j; - unsigned int color = 127; - - QPoint haut, bas, gauche, droite; - DefinitionPointsCadrage(ROI,haut,bas,gauche,droite); - - // Affichage des 3 points - if (0) - { - unsigned int taille = 8; - for (unsigned int i=0; i(gauche.y()+j,gauche.x()+i) = color; - ROI.at(droite.y()+j,droite.x()+i) = color; - ROI.at(haut.y()+j ,haut.x()+i ) = color; - ROI.at(bas.y()+j ,bas.x()+i ) = color; - } - } - - // Affichage du cadre - if (1) - { - for (int i=gauche.x(); i<=droite.x(); i++) - for (int j=haut.y(); j<=bas.y(); j++) - { - if ( (j==haut.y()) || (j==bas.y()) || (i==gauche.x()) || (i==droite.x()) ) - ROI.at(j,i) = color; - } - } - - namedWindow("123456789"); - imshow("123456789", ROI); - -} - - -QPoint HandClosedDetection::ROI_Pt(void) const -{ - return m_ROI.Pt(); -} - -QSize HandClosedDetection::ROI_Size(void) const -{ - return m_ROI.Size(); -} - - -void HandClosedDetection::DefinitionPointsCadrage(Mat& ROI, QPoint& haut, QPoint& bas, QPoint& gauche, QPoint& droite) -{ - //unsigned int i, j; - droite.setX(m_handPtInROI.x()); droite.setY(m_handPtInROI.y()); - - // Point Haut // - haut.setX(0); haut.setY(0); - for (int j=0; j(j,i) && !haut.y()) - { - haut.setX(i); haut.setY(j); - } - - // Point Bas // - bas.setX(haut.x()); bas.setY(0.6*(m_ROI.Size().height() + haut.y())); - - // Point Gauche // - gauche.setX(0); gauche.setY(0); - for (int i=0; i(j,i) && !gauche.x()) - { - gauche.setX(i); gauche.setY(j); - } - - // Point Droite // - droite.setX(0); droite.setY(0); - for (int i=m_ROI.Size().width(); i>m_handPtInROI.x(); i--) - for (int j=haut.y(); j(j,i) && !droite.x()) - { - droite.setX(i); droite.setY(j); - } - - -} - - - -void HandClosedDetection::IncrementCompteurFrame(void) -{ - m_compteurFrame++; -} - -void HandClosedDetection::ResetCompteurFrame(void) -{ - m_compteurFrame = 0; -} - -int HandClosedDetection::CompteurFrame(void) const -{ - return m_compteurFrame; -} - - -void HandClosedDetection::UpdateHandClosedPrev(void) -{ - unsigned int i; - for (i=(NB_CASE_HAND_CLOSED_PREV-1); i>0; i--) - m_handClosedPrev[i] = m_handClosedPrev[i-1]; - m_handClosedPrev[0] = m_handClosed; - - //cout << endl << "handPrev : "; - //for (i=0; i m_smooth.X() ? m_handPtBrutFiltre.X() - sgn.X()*(m_smooth.X()) : m_handPt.X()); - m_handPt.SetY(abs(m_diffHandPt.Y()) > m_smooth.Y() ? m_handPtBrutFiltre.Y() - sgn.Y()*(m_smooth.Y()) : m_handPt.Y()); - m_handPt.SetZ(abs(m_diffHandPt.Z()) > m_smooth.Z() ? m_handPtBrutFiltre.Z() - sgn.Z()*(m_smooth.Z()) : m_handPt.Z()); - - //m_handPt.Print(); -} - -// ------------------- Smooth -------------------- // - -void HandPoint::SetSmooth(Point3D smooth) -{ - m_smooth.SetCoordinate(smooth); -} -void HandPoint::SetSmooth(unsigned int smoothX, unsigned int smoothY, unsigned int smoothZ) -{ - Point3D temp(smoothX,smoothY,smoothZ,"temp"); - SetSmooth(temp); -} - -void HandPoint::IncrementSmooth(Point3D increment) -{ - m_smooth += increment; - if (m_smooth.X() < MIN_SMOOTH_VALUE) m_smooth.SetX(MIN_SMOOTH_VALUE); - if (m_smooth.X() > MAX_SMOOTH_VALUE) m_smooth.SetX(MAX_SMOOTH_VALUE); - if (m_smooth.Y() < MIN_SMOOTH_VALUE) m_smooth.SetY(MIN_SMOOTH_VALUE); - if (m_smooth.Y() > MAX_SMOOTH_VALUE) m_smooth.SetY(MAX_SMOOTH_VALUE); - if (m_smooth.Z() < MIN_SMOOTH_VALUE) m_smooth.SetZ(MIN_SMOOTH_VALUE); - if (m_smooth.Z() > MAX_SMOOTH_VALUE) m_smooth.SetZ(MAX_SMOOTH_VALUE); -} -void HandPoint::IncrementSmooth(int x, int y, int z) -{ - Point3D temp(x,y,z,"temp"); - IncrementSmooth(temp); -} - -Point3D HandPoint::Smooth(void) const -{ - return m_smooth; -} - - -// ------------------ Steadies ------------------- // - -bool HandPoint::Steady2(void) const -{ - return m_sTD.Steady2(); -} -bool HandPoint::Steady5(void) const -{ - return m_sTD.Steady5(); -} -bool HandPoint::Steady10(void) const -{ - return m_sTD.Steady10(); -} -bool HandPoint::Steady15(void) const -{ - return m_sTD.Steady15(); -} -bool HandPoint::Steady20(void) const -{ - return m_sTD.Steady20(); -} -bool HandPoint::NotSteady(void) const -{ - return m_sTD.NotSteady(); -} - -void HandPoint::SignalResetSteadies(void) -{ - m_sTD.SignalResetSteadies(); -} - -// ------------------ Compteur ------------------- // - -void HandPoint::IncrementCompteurFrame(void) -{ - if (m_compteurFrame++ > 1000000) - m_compteurFrame = 0; -} -unsigned int HandPoint::CompteurFrame(void) const -{ - return m_compteurFrame; -} - - -bool HandPoint::DetectLeft(void) -{ - return (m_lastHandPt.X() > m_handPt.X()); -} - -bool HandPoint::DetectRight(void) -{ - return (m_lastHandPt.X() < m_handPt.X()); -} - -bool HandPoint::DetectUp(void) -{ - return (m_lastHandPt.Y() > m_handPt.Y()); -} - -bool HandPoint::DetectDown(void) -{ - return (m_lastHandPt.Y() < m_handPt.Y()); -} - -bool HandPoint::DetectForward(void) -{ - return (m_lastHandPt.Z() > m_handPt.Z()); -} - -bool HandPoint::DetectBackward(void) -{ - return (m_lastHandPt.Z() < m_handPt.Z()); -} - -bool HandPoint::DetectStatic(void) -{ - return (m_lastHandPt == m_handPt); -} - - -//================================= FIN ====================================// - - - - - - - diff --git a/KiOP/KiOP/src/Parametres.cpp b/KiOP/KiOP/src/Parametres.cpp deleted file mode 100644 index b375702..0000000 --- a/KiOP/KiOP/src/Parametres.cpp +++ /dev/null @@ -1,54 +0,0 @@ - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -#include "Parametres.h" - - -#if defined _OS_WIN_ -//==========================================================================// -//=========================== VARIABLES GLOBALES ===========================// - -QDesktopWidget *desktop2 = QApplication::desktop(); -QRect rect = desktop2->screenGeometry(0); - -//#include -//RECT rc; -//bool temp = GetWindowRect(GetDesktopWindow(), &rc); -//unsigned int scrszw = rc.right; -//unsigned int scrszh = rc.bottom; - - -//==========================================================================// -//============================== FONCTIONS =================================// - -unsigned int SCRSZWidth(void) -{ - return rect.width(); -} - -unsigned int SCRSZHeight(void) -{ - return rect.height(); -} - - -//================================= FIN ====================================// -#endif - - -#if defined _OS_MAC_ -unsigned int SCRSZWidth(void) -{ - return glutGet(GLUT_SCREEN_WIDTH); -} - -unsigned int SCRSZHeight(void) -{ - return glutGet(GLUT_SCREEN_HEIGHT); -} -#endif - - - - diff --git a/KiOP/KiOP/src/Point_2D.cpp b/KiOP/KiOP/src/Point_2D.cpp deleted file mode 100644 index 0e1810c..0000000 --- a/KiOP/KiOP/src/Point_2D.cpp +++ /dev/null @@ -1,83 +0,0 @@ - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -#include "Point_2D.h" - - -//==========================================================================// -//================================ MÉTHODES ================================// - -// -------------- Constructeur(s) ---------------- // -Point2D::Point2D() : Point3D() -{ -} -Point2D::Point2D(short x, short y) : Point3D(x,y,0) -{ -} -Point2D::Point2D(string name) : Point3D(name) -{ -} -Point2D::Point2D(short x, short y, string name) : Point3D(x,y,0,name) -{ -} - - -void Point2D::SetCoordinate(const Point2D &pt) -{ - SetX(pt.X()); - SetY(pt.Y()); - SetZ(0); -} -void Point2D::SetCoordinate(const Point3D &pt) -{ - SetX(pt.X()); - SetY(pt.Y()); - SetZ(0); -} -void Point2D::SetCoordinate(short x, short y) -{ - SetX(x); - SetY(y); - SetZ(0); -} -void Point2D::SetCoordinate(const XnPoint3D xnPt) -{ - SetX(xnPt.X); - SetY(xnPt.Y); - SetZ(0); -} - - -void Point2D::Afficher(ostream &flux) const -{ - flux << "(" << X() << " ; " << Y() << ")"; -} - -void Point2D::Print(void) const -{ - cout << m_name << " : "; - Afficher(cout); - cout << endl; -} -void Point2D::Print(unsigned short nbEndLine) const -{ - Print(); - for (int i=0; i= 0 ? 1 : -1); - temp.SetY(Y() >= 0 ? 1 : -1); - temp.SetZ(Z() >= 0 ? 1 : -1); - return temp; -} - - -// ----------- Opérateurs Arithmétiques ------------ // - -// Operateur addition (+) -Point3D& Point3D::operator+=(const Point3D &pt) -{ - IcrX(pt.X()); - IcrY(pt.Y()); - IcrZ(pt.Z()); - return *this; -} -Point3D operator+(const Point3D &pt1, const Point3D &pt2) -{ - Point3D copie(pt1); - copie += pt2; - return copie; -} - -// Operateur soustraction (-) -Point3D& Point3D::operator-=(const Point3D &pt) -{ - IcrX(-pt.X()); - IcrY(-pt.Y()); - IcrZ(-pt.Z()); - return *this; -} -Point3D operator-(const Point3D &pt1, const Point3D &pt2) -{ - Point3D copie(pt1); - copie -= pt2; - return copie; -} - -// Operateur multiplication (*) -Point3D& Point3D::operator*=(const int nb) -{ - SetX(this->X()*nb); - SetY(this->Y()*nb); - SetZ(this->Z()*nb); - return *this; -} -Point3D operator*(const Point3D &pt, const int nb) -{ - Point3D copie(pt); - copie *= nb; - return copie; -} - -// Operateur division (/) -Point3D& Point3D::operator/=(const int nb) -{ - SetX(this->X()/nb); - SetY(this->Y()/nb); - SetZ(this->Z()/nb); - return *this; -} -Point3D operator/(const Point3D &pt, const int nb) -{ - Point3D copie(pt); - copie /= nb; - return copie; -} - - -// ----------- Opérateurs de Comparaison ------------ // - -// Operateur d'égalité (==) -bool operator==(const Point3D &pt1, const Point3D &pt2) -{ - return (pt1.X() == pt2.X() && pt1.Y() == pt2.Y() && pt1.Z() == pt2.Z()); -} - -// Operateur de différence (!=) -bool operator!=(const Point3D &pt1, const Point3D &pt2) -{ - return !(pt1 == pt2); -} - -// Operateur < -Point3D operator<(const Point3D &pt1, const Point3D &pt2) -{ - Point3D temp(pt1.X() < pt2.X(), pt1.Y() < pt2.Y(), pt1.Z() < pt2.Z()); - return temp; -} - -// Operateur <= -Point3D operator<=(const Point3D &pt1, const Point3D &pt2) -{ - Point3D temp(pt1.X() <= pt2.X(), pt1.Y() <= pt2.Y(), pt1.Z() <= pt2.Z()); - return temp; -} - -// Operateur > -Point3D operator>(const Point3D &pt1, const Point3D &pt2) -{ - Point3D temp(pt1.X() > pt2.X(), pt1.Y() > pt2.Y(), pt1.Z() > pt2.Z()); - return temp; -} - -// Operateur >= -Point3D operator>=(const Point3D &pt1, const Point3D &pt2) -{ - Point3D temp(pt1.X() >= pt2.X(), pt1.Y() >= pt2.Y(), pt1.Z() >= pt2.Z()); - return temp; -} - - -// ----------- Opérateurs de Flux ------------ // -ostream &operator<<(ostream &flux, const Point3D &pt) -{ - pt.Afficher(flux); - return flux; -} - - -// ----------- AAAAAA ------------ // -// Renvoie true si le point pt est situé ŕ l'intérieur de la zone formée par les points ptLim1 et ptLim2. -bool EstDansZone(const Point3D& pt, const Point3D& ptLim1, const Point3D& ptLim2) -{ - Point3D temp(ptLim1.X() <= ptLim2.X(), ptLim1.Y() <= ptLim2.Y(), ptLim1.Z() <= ptLim2.Z(), "temp"); - - if ( pt.X() < (temp.X() ? ptLim1.X() : ptLim2.X()) || pt.X() > (temp.X() ? ptLim2.X() : ptLim1.X()) - || pt.Y() < (temp.Y() ? ptLim1.Y() : ptLim2.Y()) || pt.Y() > (temp.Y() ? ptLim2.Y() : ptLim1.Y()) - || pt.Z() < (temp.Z() ? ptLim1.Z() : ptLim2.Z()) || pt.Z() > (temp.Z() ? ptLim2.Z() : ptLim1.Z()) ) - return false; - - return true; -} - - -// ----------- Fonctions pour listes ------------ // -Point3D MeanListPt3D(const Point3D list[], unsigned short size) -{ - Point3D somme("somme"); - for (int i=0; i0; i--) - list[i].SetCoordinate(list[i-1]); - list[0].SetCoordinate(pt); -} - -void PrintListPt3D(const Point3D list[], unsigned short size) -{ - for (int i=0; i 2000) - seuil*=2; - - Point3D lim1(lastHandPt-seuil/2,"lim1"); - Point3D lim2(lastHandPt+seuil/2,"lim2"); - - //lim1.Print(); - //lim2.Print(); - //handPt.Print(); - //cout << endl; - - // Si le handPoint n'a pas bougé (sur une frame) - if (EstDansZone(handPt,lim1,lim2) && !g_signalResetSteadies) - { - g_notSteady = false; - EnclenchementTimer(m_compteurTimer); - } - else - { - g_notSteady = true; - ResetSteadies(); - IncrementCompteurTimer(); - g_signalResetSteadies = false; - } - SetTocFrame(m_compteurTimer); -} - - -// ------------------ Steadies ------------------- // - -void SteadyClass::ResetSteadies(void) -{ - g_steady2 = false; - g_steady5 = false; - g_steady10 = false; - g_steady15 = false; - g_steady20 = false; -} - -void SteadyClass::SignalResetSteadies() -{ - g_signalResetSteadies = true; - ResetSteadies(); -} - -bool SteadyClass::Steady2(void) const -{ - return g_steady2; -} -bool SteadyClass::Steady5(void) const -{ - return g_steady5; -} -bool SteadyClass::Steady10(void) const -{ - return g_steady10; -} -bool SteadyClass::Steady15(void) const -{ - return g_steady15; -} -bool SteadyClass::Steady20(void) const -{ - return g_steady20; -} -bool SteadyClass::NotSteady(void) const -{ - return g_notSteady; -} - - -// ------------------ Compteur ------------------- // - -void SteadyClass::IncrementCompteurTimer(void) -{ - if (m_compteurTimer++ >= MAX_TOC_FRAME_VALUE) - m_compteurTimer = 0; -} - - -//==========================================================================// -//============================== FONCTIONS =================================// - -void SetTocFrame(unsigned int tocFrame) -{ - g_tocFrame = tocFrame; -} - -void EnclenchementTimer(unsigned int ticFrame) -{ - if (g_steady2Enable) - glutTimerFunc( 200, Steady2,ticFrame); - - if (g_steady5Enable) - glutTimerFunc( 500, Steady5,ticFrame); - - if (g_steady10Enable) - glutTimerFunc(1000,Steady10,ticFrame); - - if (g_steady15Enable) - glutTimerFunc(1500,Steady15,ticFrame); - - if (g_steady20Enable) - glutTimerFunc(2000,Steady20,ticFrame); -} - -void Steady2(int ticFrame) -{ - if (ticFrame == g_tocFrame) - g_steady2 = true; - if (!g_steady2Enable) - g_steady2 = false; -} -void Steady5(int ticFrame) -{ - if (ticFrame == g_tocFrame) - g_steady5 = true; - if (!g_steady5Enable) - g_steady5 = false; -} -void Steady10(int ticFrame) -{ - if (ticFrame == g_tocFrame) - g_steady10 = true; - if (!g_steady10Enable) - g_steady10 = false; -} -void Steady15(int ticFrame) -{ - if (ticFrame == g_tocFrame) - g_steady15 = true; - if (!g_steady15Enable) - g_steady15 = false; -} -void Steady20(int ticFrame) -{ - if (ticFrame == g_tocFrame) - g_steady20 = true; - if (!g_steady20Enable) - g_steady20 = false; -} - - -void SteadyAllEnable(void) -{ - g_steady2Enable = true; - g_steady5Enable = true; - g_steady10Enable = true; - g_steady15Enable = true; - g_steady20Enable = true; - cout << "Steady 2, 5, 10, 15, 20 Enable" << endl; -} -void Steady2Enable(void) -{ - if (!g_steady2Enable) - { - g_steady2Enable = true; - cout << "Steady 2 Enable" << endl; - } -} -void Steady5Enable(void) -{ - if (!g_steady5Enable) - { - g_steady5Enable = true; - cout << "Steady 5 Enable" << endl; - } -} -void Steady10Enable(void) -{ - if (!g_steady10Enable) - { - g_steady10Enable = true; - cout << "Steady 10 Enable" << endl; - } -} -void Steady15Enable(void) -{ - if (!g_steady15Enable) - { - g_steady15Enable = true; - cout << "Steady 15 Enable" << endl; - } -} -void Steady20Enable(void) -{ - if (!g_steady20Enable) - { - g_steady20Enable = true; - cout << "Steady 20 Enable" << endl; - } -} - - -void SteadyAllDisable(void) -{ - g_steady2Enable = false; - g_steady5Enable = false; - g_steady10Enable = false; - g_steady15Enable = false; - g_steady20Enable = false; - cout << "Steady 2, 5, 10, 15, 20 Disable" << endl; -} -void Steady2Disable(void) -{ - if (g_steady2Enable) - { - g_steady2Enable = false; - cout << "Steady 2 Disable" << endl; - } -} -void Steady5Disable(void) -{ - if (g_steady5Enable) - { - g_steady5Enable = false; - cout << "Steady 5 Disable" << endl; - } -} -void Steady10Disable(void) -{ - if (g_steady10Enable) - { - g_steady10Enable = false; - cout << "Steady 10 Disable" << endl; - } -} -void Steady15Disable(void) -{ - if (g_steady15Enable) - { - g_steady15Enable = false; - cout << "Steady 15 Disable" << endl; - } -} -void Steady20Disable(void) -{ - if (g_steady20Enable) - { - g_steady20Enable = false; - cout << "Steady 20 Disable" << endl; - } -} - - -//================================= FIN ====================================// - - - - - - - diff --git a/KiOP/KiOP/src/graphicsview.cpp b/KiOP/KiOP/src/graphicsview.cpp deleted file mode 100644 index 795b983..0000000 --- a/KiOP/KiOP/src/graphicsview.cpp +++ /dev/null @@ -1,114 +0,0 @@ - -#include "graphicsview.h" - - -GraphicsView::GraphicsView(QGraphicsScene *scene, QWidget *parent) : QGraphicsView(scene, parent) -{ - Q_INIT_RESOURCE(images); - - this->setWindowOpacity(1.0); - this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); - this->setAttribute(Qt::WA_TranslucentBackground); - this->setStyleSheet("background: transparent"); - //this->setStyleSheet("background: green"); - //this->setStyleSheet("background-color: rgba(139,137,137,0.5);"); - //this->setStyleSheet("background-image: url(:/images/Resources/background.png)"); - this->setFrameStyle(0); - this->setAlignment(Qt::AlignLeft | Qt::AlignTop); - this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - //QColor bgColor = palette().light().color(); - //bgColor.setAlpha(50); - -} - -void GraphicsView::createUI() -{ - //this->show(); -} - -void GraphicsView::keyPressEvent(QKeyEvent *event) -{ - if (event->key() == Qt::Key_Escape) - { - qApp->quit(); - } -} -void GraphicsView::resizeEvent(QResizeEvent *event) -{ - fitInView(sceneRect(), Qt::KeepAspectRatio); -} - -//void GraphicsView::paintEvent(QPaintEvent *event) -//{ -// QColor backgroundColor = palette().light().color(); -// backgroundColor.setAlpha(50); -// QPainter customPainter(this); -// customPainter.fillRect(rect(),backgroundColor); -//} - - -void GraphicsView::moveBottom(GraphicsView* widget) -{ - //int cx = GetSystemMetrics(SM_CXSCREEN); - //int cy = GetSystemMetrics(SM_CYSCREEN); - int cx = getResX(); - int cy = getResY(); - - - int x, y; - int screenWidth; - int screenHeight; - - //int WIDTH = 768; - //int HEIGHT = 256; - - - QDesktopWidget *desktop = QApplication::desktop(); - - screenWidth = desktop->width(); - screenHeight = desktop->height(); - - x = (cx - WIDTH)/2; - y = (cy - HEIGHT); - /*x = (cx - WIDTH - 8); - y = (cy - HEIGHT + 40)/2;*/ - /*x = ((cx - WIDTH)); - y = ((cy - HEIGHT-40));*/ - - widget->setGeometry(x, y-40, WIDTH, HEIGHT); - widget->setFixedSize(WIDTH, HEIGHT); -} - -int GraphicsView::getResX() -{ - //return GetSystemMetrics(SM_CXSCREEN); - return SCRSZW; -} -int GraphicsView::getResY() -{ - //return GetSystemMetrics(SM_CYSCREEN); - return SCRSZH; -} - -void GraphicsView::setSize(int width, int height) -{ - this->WIDTH = width; - this->HEIGHT = height; - - this->createUI(); - this->moveBottom(this); -} - -QPoint GraphicsView::Size(void) -{ - QPoint temp; - temp.setX(WIDTH); - temp.setY(HEIGHT); - return temp; -} - -void GraphicsView::setPosition(int x, int y) -{ - -} \ No newline at end of file diff --git a/KiOP/KiOP/src/main.cpp b/KiOP/KiOP/src/main.cpp deleted file mode 100644 index bd5d63e..0000000 --- a/KiOP/KiOP/src/main.cpp +++ /dev/null @@ -1,1305 +0,0 @@ - -//==========================================================================// -//============================ FICHIERS INCLUS =============================// - -#include "Parametres.h" -#include "main.h" - -//==========================================================================// -//=========================== VARIABLES GLOBALES ===========================// - -// 0: Inactive; 1: Hand calibrating; 2: Main menu; 3: Normal tool mode; 4: Layout mode; 5: Mouse mode; 9: Return to main menu. -int g_currentState = 0; -int g_lastState = 0; -int g_stateBackup = 0; -int g_moveCounter = 0; - -// 0: Layout; 1: Move; 2: Contrast; 3: Zoom; 4: Scroll; 5: Mouse; 6: RedCross. -int g_currentTool = 3; -int g_lastTool = 3; -int g_toolToChoose = -1; - -// compteur pour sensibilite outils -struct cptTools g_cpt; - -#if defined _OS_WIN_ -int g_totalTools = 8; -#elif defined _OS_MAC_ -int g_totalTools = 6; -#endif -//int g_positionTool[7]; //position des outils dans le menu - -// Layout -int g_totalLayoutTools = 6; //+1 -int g_currentLayoutTool = 0; -int g_lastLayoutTool = 0; -bool g_layoutSelected = false; - -float g_iconIdlePt = 192.0; -//float g_iconActivePt = 64.0; // ? -xn::Context g_context; -xn::DepthGenerator g_dpGen; -xn::DepthMetaData g_dpMD; -xn::HandsGenerator g_myHandsGenerator; -XnStatus g_status; - -bool g_toolSelectable = false; -bool g_methodeMainFermeeSwitch = false; - -// NITE -bool g_activeSession = false; -XnVSessionManager *gp_sessionManager; -XnVPointControl *gp_pointControl; -XnPoint3D g_handPt; -XnPoint3D g_lastPt; -XnVFlowRouter* g_pFlowRouter; -XnFloat g_fSmoothing = 0.0f; - -// Qt -#ifdef _OS_WIN_ - int qargc = 0; - char **qargv = NULL; - QApplication app(qargc,qargv); -#endif -GraphicsView *gp_window; -GraphicsView *gp_windowActiveTool; -QGraphicsScene *gp_sceneActiveTool; -GraphicsView *gp_viewLayouts; -vector g_pix; //for main tools -vector g_pixL; //for layouts -Pixmap* gp_pixActive; //for activeTool -QColor g_toolColorActive = Qt::green; -QColor g_toolColorInactive = Qt::gray; - -#if defined _OS_WIN_ -ToolDock mainTools(g_totalTools+1); -ToolDock layoutTools(g_totalLayoutTools+1); -#endif -int g_pixSize = 0; -int g_pixSizeActive = 0; - -#ifdef _OS_WIN_ - TelnetClient g_telnet; -#endif - -// KiOP // -CursorQt g_cursorQt; -CursorQt g_pointerQt; -//HandClosedDetection g_hCD; -HandPoint g_hP; - -string g_openNi_XML_FilePath; - - -unsigned int g_handDepthAtToolSelection = 0; -const unsigned int g_handDepthThreshold = 40; -const unsigned int g_handDepthMarge = 300; - -bool g_tropPres = false; -bool g_tropLoin = false; -bool g_depthIntervalOK = true; - - -//==========================================================================// -//============================== FONCTIONS =================================// - -// Fonction d'initialisation -void Initialisation(void) -{ - ostringstream oss; - const int nb(4); - Point3D liste[nb]; - for (int i=0; i limUp) val = limUp; - if (val < limDown) val = limDown; -} - - -inline bool isHandPointNull() -{ - return ((g_handPt.X == -1) ? true : false); -} - - -void chooseTool(int ¤tTool, int &lastTool, int &totalTools) -{ - if (g_hP.DetectLeft()) - { - if (g_moveCounter > 0) - g_moveCounter = 0; - g_moveCounter += g_hP.DeltaHandPt().X(); - } - else if (g_hP.DetectRight()) - { - if (g_moveCounter < 0) - g_moveCounter = 0; - g_moveCounter += g_hP.DeltaHandPt().X(); - } - - //vitesse dans le menu en fonction de la distance - int seuil = 20 - (abs(g_hP.Speed().X())+(g_hP.HandPt().Z()/300))/3; - - //cout << "Seuil : " << seuil << endl; - if (g_moveCounter <= -seuil) - { - // Go left in the menu - lastTool = currentTool; - IcrWithLimits(currentTool,-1,0,totalTools); - g_moveCounter = 0; - - g_toolSelectable = true; - //g_pix[g_totalTools]->setOpacity(1.0); - g_pix[CROSS]->setOpacity(1.0); - } - else if (g_moveCounter >= seuil) - { - // Go right in the menu - lastTool = currentTool; - IcrWithLimits(currentTool,1,0,totalTools); - g_moveCounter = 0; - } -} - - - -//void browse(int currentTool, int lastTool, vector pix) -void browse(int currentTool, int lastTool, ToolDock &tools) -{ - //only set the pixmap geometry when needed - if (lastTool != currentTool) - { - // On réduit l'outil précédent - //pix.operator[](lastTool)->setGeometry(QRectF(lastTool*128.0, g_iconIdlePt, 64.0, 64.0)); - tools.setItemIdle(lastTool); - - // On aggrandi l'outil courant - //pix.operator[](currentTool)->setGeometry(QRectF( (currentTool*128.0)-(currentTool==0?0:32), g_iconIdlePt-64, 128.0, 128.0)); - tools.setItemActive(currentTool); - } -} - - -void CheckHandDown() -{ - if (g_currentState >= 2) - { - if (g_hP.Speed().Y() > 24) - { - cout << "-- Main baissee, vitesse : " << g_hP.Speed().Y() << endl; - gp_sessionManager->EndSession(); - } - } -} - -void CheckBaffe() -{ - if (g_currentState >= 2) - { - int vitesseBaffe = abs(g_hP.Speed().X()) + abs(g_hP.HandPt().Z()/300); - if (vitesseBaffe > 34) - { - cout << "-- Baffe detectee, vitesse : " << vitesseBaffe << endl; - gp_sessionManager->EndSession(); - } - } -} - -void CheckDepthIntervals() -{ - - unsigned int dMin = DISTANCE_MIN, dMax = DISTANCE_MAX; - - if (g_handDepthAtToolSelection + g_handDepthMarge > DISTANCE_MAX) - dMax = g_handDepthAtToolSelection + g_handDepthMarge; - - if (g_handDepthAtToolSelection - g_handDepthMarge < DISTANCE_MIN) - dMin = g_handDepthAtToolSelection - g_handDepthMarge; - - g_tropPres = (g_hP.HandPt().Z() < dMin); - g_tropLoin = (g_hP.HandPt().Z() > dMax); - g_depthIntervalOK = !(g_tropPres || g_tropLoin); - - - - - if (!g_depthIntervalOK && g_toolSelectable && g_currentState!=0) - { - cout << endl << "-- Main en dehors de l'intervalle" << " distance : " << g_hP.HandPt().Z() << endl << endl; - g_stateBackup = g_currentState; - ChangeState(NO_ACTION_STATE); - } -} - - - -bool SelectionDansUnMenu(short currentIcon) -{ - bool temp = false; - - if (g_hP.Steady10()) - { - temp = true; - g_hP.SignalResetSteadies(); - } - - return temp; -} - - - -bool ConditionActiveTool() -{ - return (g_hP.HandPt().Z() < g_handDepthAtToolSelection + g_handDepthThreshold); -} - -bool ConditionExitTool() -{ - return (g_hP.Steady15() && g_hP.HandPt().Z() > g_handDepthAtToolSelection + g_handDepthThreshold); -} - - -bool ConditionLeftClicPress() -{ - return (g_hP.Steady15()); -} -bool ConditionLeftClicRelease() -{ - return (g_hP.Steady10()); -} - - -ToolDock& UploadMainTools(ToolDock &mainTools, bool write) -{ - static ToolDock *s_mainTools = new ToolDock(NULL); - - if (write) - s_mainTools = &mainTools; - - return *s_mainTools; -} - - - -void ChangeState(int newState) -{ - if (newState != g_currentState) - { - g_lastState = g_currentState; - g_currentState = newState; - - cout << "- Entree dans l'etat no" << g_currentState << endl; - } -} - - -void handleState() -{ -#ifdef _OS_MAC_ - static TelnetClient g_telnet; - - ToolDock temp(NULL); - ToolDock *mainTools = new ToolDock(NULL); - mainTools = &UploadMainTools(temp,false); - -#endif - - CheckHandDown(); - CheckBaffe(); - CheckDepthIntervals(); - - switch (g_currentState) - { - // Session inactive - case INACTIVE_SESSION_STATE: - - break; // case INACTIVE_SESSION_STATE - - // Aucune action possible - case NO_ACTION_STATE: - - if (g_depthIntervalOK) - { - ChangeState(g_stateBackup); - -#if defined _OS_WIN_ - mainTools.setToolsBackgroundTransparent(); - layoutTools.setToolsBackgroundTransparent(); -#elif defined _OS_MAC_ - mainTools->setToolsBackgroundTransparent(); -#endif - } - else - { - gp_windowActiveTool->setWindowOpacity(0.7); - gp_windowActiveTool->setBackgroundBrush(QBrush(Qt::red, Qt::SolidPattern)); - - -#if defined _OS_WIN_ - mainTools.setToolsBackgroundRed(); - layoutTools.setToolsBackgroundRed(); -#elif defined _OS_MAC_ - mainTools->setToolsBackgroundRed(); -#endif - } - - break; // case NO_ACTION_STATE - - // Coucou effectué, passage par sessionStart, calibrage de la main (200ms) - case CALIBRATE_HAND_STATE: - - if (g_depthIntervalOK) - { - gp_window->setBackgroundBrush(Qt::NoBrush); - } - else - { - gp_window->setBackgroundBrush(QBrush(Qt::red, Qt::SolidPattern)); - } - - if (g_hP.Steady2() && g_depthIntervalOK) - { - ChangeState(TOOLS_MENU_STATE); - - gp_window->setWindowOpacity(qreal(1.0)); - g_pix[CROSS]->setOpacity(0.4); - } - break; // case CALIBRATE_HAND_STATE - - // Aprčs le calibrage de la main, menu des outils - case TOOLS_MENU_STATE: - - chooseTool(g_currentTool, g_lastTool, g_totalTools); - -#if defined _OS_WIN_ - browse(g_currentTool, g_lastTool, mainTools); -#elif defined _OS_MAC_ - browse(g_currentTool, g_lastTool, *mainTools); -#endif - - g_handDepthAtToolSelection = 0; - - if (SelectionDansUnMenu(g_currentTool) && g_toolSelectable) - { - g_telnet.connexion(); - switch(g_currentTool) - { -#ifdef _OS_WIN_ - case RESETALL: - g_telnet.sendCommand(QString("\r\ndcmview2d:reset all\r\n")); - g_telnet.sendCommand(QString("\r\ndcmview2d:mouseLeftAction resetall\r\n")); - break; - case LAYOUT: - g_telnet.sendCommand(QString("\r\ndcmview2d:mouseLeftAction layoutTool\r\n")); - break; -#endif - case MOVE: - g_telnet.sendCommand(QString("\r\ndcmview2d:mouseLeftAction pan\r\n")); - break; - case CONTRAST: - g_telnet.sendCommand(QString("\r\ndcmview2d:mouseLeftAction winLevel\r\n")); - break; - case ZOOM: - g_telnet.sendCommand(QString("\r\ndcmview2d:mouseLeftAction zoom\r\n")); - break; - case SCROLL: - g_telnet.sendCommand(QString("\r\ndcmview2d:mouseLeftAction sequence\r\n")); - break; - case POINTER: - g_telnet.sendCommand(QString("\r\ndcmview2d:mouseLeftAction pointerTool\r\n")); - break; - case MOUSE: - g_telnet.sendCommand(QString("\r\ndcmview2d:mouseLeftAction cursorTool\r\n")); - break; - case CROSS: - g_telnet.sendCommand(QString("\r\ndcmview2d:mouseLeftAction exit\r\n")); - break; - } - - // Si un des outils "normaux" a été selectionné - if ( (g_currentTool == MOVE) || (g_currentTool == CONTRAST) || (g_currentTool == ZOOM) || (g_currentTool == SCROLL) ) - { - ChangeState(NORMAL_TOOLS_STATE); - cout << "--- Selection de l'outil : " << g_currentTool << endl; - - g_handDepthAtToolSelection = g_hP.HandPt().Z(); - cout << "\nhandDepthAtToolSelection : " << g_handDepthAtToolSelection << endl << endl; - - gp_window->hide(); - gp_windowActiveTool->show(); - gp_windowActiveTool->setBackgroundBrush(QBrush(g_toolColorInactive, Qt::SolidPattern)); - gp_pixActive->load(QPixmap(":/images/"+g_pix.operator[](g_currentTool)->objectName()+".png").scaled(g_pixSizeActive,g_pixSizeActive)); - } - - // Si l'outil pointeur a été selectionné - else if (g_currentTool == POINTER) - { - ChangeState(POINTER_STATE); - g_pointerQt.NewCursorSession(g_hP.HandPt()); - - g_handDepthAtToolSelection = g_hP.HandPt().Z(); - - gp_window->hide(); - gp_windowActiveTool->show(); - gp_pixActive->load(QPixmap(":/images/pointer.png").scaled(g_pixSizeActive,g_pixSizeActive)); - } - - // Si l'outil souris a été selectionné - else if (g_currentTool == MOUSE) - { - ChangeState(MOUSE_STATE); - g_cursorQt.NewCursorSession(g_hP.HandPt()); - - g_handDepthAtToolSelection = g_hP.HandPt().Z(); - - gp_window->hide(); - gp_windowActiveTool->show(); - gp_pixActive->load(QPixmap(":/images/mouse.png").scaled(g_pixSizeActive,g_pixSizeActive)); - } - - // Si la croix a été selectionnée - else if (g_currentTool == CROSS) - { - cout << "-- Croix selectionnee" << endl; - gp_sessionManager->EndSession(); - } - -#ifdef _OS_WIN_ - // Si le bouton ResetAll a été selectionné - else if (g_currentTool == RESETALL) - { - ChangeState(BACK_TO_MENU_STATE); - } - - // Si l'outil layout a été selectionné - else if (g_currentTool == LAYOUT) - { - ChangeState(LAYOUT_STATE); - g_currentLayoutTool = 0; - g_lastLayoutTool = 6; - - gp_window->hide(); - gp_windowActiveTool->hide(); - gp_viewLayouts->show(); - - layoutTools.setToolsBackgroundTransparent(); // Ne pas enlever - } -#endif - } - - break; // case TOOLS_MENU_STATE - - // Outil "normal" selectionné - case NORMAL_TOOLS_STATE: - - if (ConditionActiveTool()) - { - gp_windowActiveTool->setBackgroundBrush(QBrush(g_toolColorActive, Qt::SolidPattern)); - gp_windowActiveTool->setWindowOpacity(1.0); - - switch (g_currentTool) - { - case MOVE : - g_telnet.sendCommand(QString("\r\ndcmview2d:move -- %1 %2\r\n") - .arg(-SENSIBILITE_MOVE_X*g_hP.DeltaHandPt().X()).arg(-SENSIBILITE_MOVE_Y*g_hP.DeltaHandPt().Y())); - break; - - case CONTRAST : - g_telnet.sendCommand(QString("\r\ndcmview2d:wl -- %1 %2\r\n") - .arg(-SENSIBILITE_CONTRAST_X*g_hP.DeltaHandPt().X()).arg(-SENSIBILITE_CONTRAST_Y*g_hP.DeltaHandPt().Y())); - break; - - case ZOOM : - if (g_hP.DetectRight()) - g_telnet.sendCommand(QString("\r\ndcmview2d:zoom -i %1\r\n").arg(SENSIBILITE_ZOOM)); - if (g_hP.DetectLeft()) - g_telnet.sendCommand(QString("\r\ndcmview2d:zoom -d %1\r\n").arg(SENSIBILITE_ZOOM)); - break; - - case SCROLL : - int scrollSpeed = abs(g_hP.Speed().X())/2; - int cptSpeed = 0; - if (scrollSpeed < 1){ - scrollSpeed = 1; - } - else if(scrollSpeed > 4){ - cptSpeed = scrollSpeed; - scrollSpeed = 4; - } - - if (g_hP.DetectRight()){ - if (g_cpt.dir != DIR_RIGHT) - g_cpt.scroll = 0; - - g_cpt.scroll = g_cpt.scroll+scrollSpeed; - if (g_cpt.scroll >= SENSIBILITE_SCROLL_CPT){ - if (scrollSpeed<4){ - g_telnet.sendCommand(QString("\r\ndcmview2d:scroll -i %1\r\n").arg(SENSIBILITE_SCROLL)); - } - else if (scrollSpeed >= 4){ - g_telnet.sendCommand(QString("\r\ndcmview2d:scroll -i %1\r\n").arg(SENSIBILITE_SCROLL+(cptSpeed/4))); - } - g_cpt.scroll = 0; - } - g_cpt.dir = DIR_RIGHT; - - } - if (g_hP.DetectLeft()){ - if (g_cpt.dir != DIR_LEFT) - g_cpt.scroll = 0; - - g_cpt.scroll = g_cpt.scroll+scrollSpeed; - if (g_cpt.scroll >= SENSIBILITE_SCROLL_CPT){ - if (scrollSpeed<4){ - g_telnet.sendCommand(QString("\r\ndcmview2d:scroll -d %1\r\n").arg(SENSIBILITE_SCROLL)); - } - else if (scrollSpeed >= 4){ - g_telnet.sendCommand(QString("\r\ndcmview2d:scroll -d %1\r\n").arg(SENSIBILITE_SCROLL+(cptSpeed/4))); - } - g_cpt.scroll = 0; - } - g_cpt.dir = DIR_LEFT; - - } - break; - - } // end switch (g_currentTool) - } - - // Si l'outil est désactivé - else - { - gp_windowActiveTool->setBackgroundBrush(QBrush(g_toolColorInactive, Qt::SolidPattern)); - gp_windowActiveTool->setWindowOpacity(0.7); - } - - if (ConditionExitTool()) - { - ChangeState(BACK_TO_MENU_STATE); // Préparation pour le retour au menu - } - - break; // case NORMAL_TOOLS_STATE - -#ifdef _OS_WIN_ - // Outil layout selectionné - case LAYOUT_STATE: - - chooseTool(g_currentLayoutTool, g_lastLayoutTool, g_totalLayoutTools); - browse(g_currentLayoutTool,g_lastLayoutTool, layoutTools); - - if (SelectionDansUnMenu(g_currentLayoutTool)) - { - switch(g_currentLayoutTool) - { - case 0 : - g_telnet.sendCommand(QString("\r\ndcmview2d:layout -i 1x1\r\n")); - break; - case 1 : - g_telnet.sendCommand(QString("\r\ndcmview2d:layout -i 1x2\r\n")); - break; - case 2 : - g_telnet.sendCommand(QString("\r\ndcmview2d:layout -i 2x1\r\n")); - break; - case 3 : - g_telnet.sendCommand(QString("\r\ndcmview2d:layout -i layout_c1x2\r\n")); - break; - case 4 : - g_telnet.sendCommand(QString("\r\ndcmview2d:layout -i layout_c2x1\r\n")); - break; - case 5 : - g_telnet.sendCommand(QString("\r\ndcmview2d:layout -i 2x2\r\n")); - break; - case 6 : - ChangeState(BACK_TO_MENU_STATE); - break; - } - } - - break; // case LAYOUT_STATE -#endif - - // Outil pointeur selectionné - case POINTER_STATE: - - if (g_pointerQt.InCursorSession()) - { - // Distance limite de la main au capteur - if (g_hP.HandPt().Z() < (g_handDepthAtToolSelection + g_handDepthThreshold)) - { - g_pointerQt.SetMoveEnable(); - gp_windowActiveTool->setBackgroundBrush(QBrush(g_toolColorActive, Qt::SolidPattern)); - gp_windowActiveTool->setWindowOpacity(1.0); - } - else - { - g_pointerQt.SetMoveDisable(); - gp_windowActiveTool->setBackgroundBrush(QBrush(g_toolColorInactive, Qt::SolidPattern)); - gp_windowActiveTool->setWindowOpacity(0.7); - - if (g_hP.Steady20()) - g_pointerQt.EndCursorSession(); - } - - // Appel de la méthode pour déplacer le curseur - g_pointerQt.MoveCursor(g_hP.HandPt()); - } - - // Sortie du mode pointeur - else - { - ChangeState(BACK_TO_MENU_STATE); - } - - break; // case POINTER_STATE - - // Outil souris selectionné - case MOUSE_STATE: - - if (g_cursorQt.InCursorSession()) - { - // Distance limite de la main au capteur - if (g_hP.HandPt().Z() < (g_handDepthAtToolSelection + g_handDepthThreshold)) - { - g_cursorQt.SetMoveEnable(); - g_cursorQt.SetClicEnable(); - gp_windowActiveTool->setBackgroundBrush(QBrush(g_toolColorActive, Qt::SolidPattern)); - gp_windowActiveTool->setWindowOpacity(1.0); - - if (ConditionLeftClicPress()) - { - if (!g_cursorQt.LeftClicPressed()) - { - g_hP.SignalResetSteadies(); - g_cursorQt.PressLeftClic(); - gp_pixActive->load(QPixmap(":/images/mouse_fermee.png").scaled(g_pixSizeActive,g_pixSizeActive)); - } - } - if (ConditionLeftClicRelease()) - { - if (g_cursorQt.LeftClicPressed()) - { - g_hP.SignalResetSteadies(); - g_cursorQt.ReleaseLeftClic(); - gp_pixActive->load(QPixmap(":/images/mouse.png").scaled(g_pixSizeActive,g_pixSizeActive)); - } - } - } - else - { - g_cursorQt.SetMoveDisable(); - g_cursorQt.SetClicDisable(); - gp_windowActiveTool->setBackgroundBrush(QBrush(g_toolColorInactive, Qt::SolidPattern)); - gp_windowActiveTool->setWindowOpacity(0.7); - - if (g_hP.Steady20()) - g_cursorQt.EndCursorSession(); - } - - // Appel de la méthode pour déplacer le curseur - g_cursorQt.MoveCursor(g_hP.HandPt()); - } - - // Sortie du mode souris - else - { - ChangeState(BACK_TO_MENU_STATE); - } - - break; // case MOUSE_STATE - - // Préparation pour le retour au menu - case BACK_TO_MENU_STATE : - - ChangeState(TOOLS_MENU_STATE); - g_telnet.deconnexion(); - - g_hP.SignalResetSteadies(); - - g_lastTool = g_currentTool; - g_currentTool = g_totalTools; - -#if defined _OS_WIN_ - browse(g_currentTool, g_lastTool, mainTools); -#elif defined _OS_MAC_ - browse(g_currentTool, g_lastTool, *mainTools); -#endif - - gp_window->show(); - gp_viewLayouts->hide(); - gp_windowActiveTool->hide(); - - g_toolSelectable = false; - g_pix[CROSS]->setOpacity(0.4); - - break; // case BACK_TO_MENU_STATE - - } // end switch (g_currentState) -} - - -void glutKeyboard (unsigned char key, int x, int y) -{ - static int test = 0; - - switch (key) - { - - case 27 : // Esc - #ifdef _OS_WIN_ - ChangeCursor(0); - #endif - CleanupExit(); - break; - - case 'e' : - // end current session - gp_sessionManager->EndSession(); - break; - - ////////////////////////////////////// - -#if 0 - case 'i' : - g_hP.IncrementSmooth(1,1,1); - //g_hP.Smooth().Print(); - //g_hP.HandPt().Print(); - IcrWithLimits(test,3,0,10); - cout << "-- test : " << test << endl; - break; - - case 'o' : - g_hP.IncrementSmooth(-1,-1,-1); - //g_hP.Smooth().Print(); - IcrWithLimits(test,-3,0,10); - cout << "-- test : " << test << endl; - break; - - case 's' : - // Toggle smoothing - if (g_fSmoothing == 0) - g_fSmoothing = 0.1; - else - g_fSmoothing = 0; - g_myHandsGenerator.SetSmoothing(g_fSmoothing); - break; - - case 'a' : - //show some data for debugging purposes - cout << "x= " << g_hP.HandPt().X() << " ; y= " << g_hP.HandPt().Y() << " ; z= " << g_hP.HandPt().Z() << " ; " << g_fSmoothing << " ; " << g_currentState << endl; - break; - - case 'y' : - //show tools position - for (int i=0; i<=g_totalTools; i++) - { - cout << "tool" << i << " : " << g_positionTool[i] << endl; - } - break; - - case 'q' : - g_pix[0]->setScale(0.9); - mainTools.setItemActive(0); - break; - case 'w' : - g_pix[1]->setScale(0.9); - break; - //case 't' : - // g_methodeMainFermeeSwitch = !g_methodeMainFermeeSwitch; - // cout << "-- Switch Methode main fermee (" << (g_methodeMainFermeeSwitch?2:1) << ")" << endl; - // break; - - case '1' : - RepositionnementFenetre(1); - break; - case '2' : - RepositionnementFenetre(2); - break; - case '3' : - RepositionnementFenetre(3); - break; - case '4' : - RepositionnementFenetre(4); - break; -#endif - - } -} - - - -void glutDisplay() -{ - static unsigned compteurFrame = 0; compteurFrame++; - - glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the gl buffers - g_status = g_context.WaitAnyUpdateAll(); //first update the g_context - refresh the depth/image data coming from the sensor - - // if the update failed, i.e. couldn't be read - if(g_status != XN_STATUS_OK) - { - cout << "\nERROR:Read failed... Quitting!\n" << endl; //print error message - exit(0); //exit the program - } - else - { - if(g_activeSession) - gp_sessionManager->Update(&g_context); - g_dpGen.GetMetaData(g_dpMD); - long xSize = g_dpMD.XRes(); - long ySize = g_dpMD.YRes(); - long totalSize = xSize * ySize; - - const XnDepthPixel* depthMapData; - depthMapData = g_dpMD.Data(); - - int i, j, colorToSet; - int depth; - - glLoadIdentity(); - glOrtho(0, xSize, ySize, 0, -1, 1); - - glBegin(GL_POINTS); - for (i=0;i DP_CLOSE)) - { - if (g_activeSession) - glColor3ub(0,colorToSet,0); - else - glColor3ub(colorToSet,colorToSet,colorToSet); - glVertex2i(i,j); - } - } - } - glEnd(); // End drawing sequence - - if ( g_activeSession && (isHandPointNull() == false)) - { - int size = 5; // Size of the box - glColor3f(255,255,255); // Set the color to white - glBegin(GL_QUADS); - glVertex2i(g_hP.HandPtBrut().X()-size,g_hP.HandPtBrut().Y()-size); - glVertex2i(g_hP.HandPtBrut().X()+size,g_hP.HandPtBrut().Y()-size); - glVertex2i(g_hP.HandPtBrut().X()+size,g_hP.HandPtBrut().Y()+size); - glVertex2i(g_hP.HandPtBrut().X()-size,g_hP.HandPtBrut().Y()+size); - glEnd(); - - size = 4; - glColor3f(0,0,255); - glBegin(GL_QUADS); - glVertex2i(g_hP.HandPtBrutFiltre().X()-size,g_hP.HandPtBrutFiltre().Y()-size); - glVertex2i(g_hP.HandPtBrutFiltre().X()+size,g_hP.HandPtBrutFiltre().Y()-size); - glVertex2i(g_hP.HandPtBrutFiltre().X()+size,g_hP.HandPtBrutFiltre().Y()+size); - glVertex2i(g_hP.HandPtBrutFiltre().X()-size,g_hP.HandPtBrutFiltre().Y()+size); - glEnd(); - - size = 5; - glColor3f(255,0,0); - glBegin(GL_QUADS); - glVertex2i(g_hP.HandPt().X()-size,g_hP.HandPt().Y()-size); - glVertex2i(g_hP.HandPt().X()+size,g_hP.HandPt().Y()-size); - glVertex2i(g_hP.HandPt().X()+size,g_hP.HandPt().Y()+size); - glVertex2i(g_hP.HandPt().X()-size,g_hP.HandPt().Y()+size); - glEnd(); - } - - ////========== HAND POINT ==========// - //if ( g_activeSession && (isHandPointNull() == false) - // && (g_hCD.ROI_Pt().x() >= 0) - // && (g_hCD.ROI_Pt().y() >= 0) - // && (g_hCD.ROI_Pt().x() <= (RES_X - g_hCD.ROI_Size().width())) - // && (g_hCD.ROI_Pt().y() <= (RES_Y - g_hCD.ROI_Size().height())) ) - //{ - // // Cadre de la main - // glColor3f(255,255,255); - // glBegin(GL_LINE_LOOP); - // glVertex2i(g_hCD.ROI_Pt().x(), g_hCD.ROI_Pt().y()); - // glVertex2i(g_hCD.ROI_Pt().x()+g_hCD.ROI_Size().width(), g_hCD.ROI_Pt().y()); - // glVertex2i(g_hCD.ROI_Pt().x()+g_hCD.ROI_Size().width(), g_hCD.ROI_Pt().y()+g_hCD.ROI_Size().height()); - // glVertex2i(g_hCD.ROI_Pt().x(), g_hCD.ROI_Pt().y()+g_hCD.ROI_Size().height()); - // glEnd(); - - //} - } - glutSwapBuffers(); - - // Gestion des états - handleState(); -} - - -void initGL(int argc, char *argv[]) -{ - glutInit(&argc,argv); - glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); - glutInitWindowSize(INIT_WIDTH_WINDOW, INIT_HEIGHT_WINDOW); - -#if defined _OS_WIN_ - string titre = TITLE; - titre += " | "; - titre += __DATE__; - titre += " ŕ "; - titre += __TIME__; - - const char *windowName; - windowName = titre.c_str(); - - // Fenętre de données source - glutCreateWindow(windowName); -#endif -#if defined _OS_MAC_ - // Fenętre de données source - glutCreateWindow(TITLE); -#endif - - RepositionnementFenetre(INIT_POS_WINDOW); - glutKeyboardFunc(glutKeyboard); - glutDisplayFunc(glutDisplay); - - // Idle callback (pour toutes les fenętres) - glutIdleFunc(glutDisplay); - glDisable(GL_DEPTH_TEST); - glEnable(GL_TEXTURE_2D); -} - - -//==========================================================================// -//================================= MAIN ===================================// - -int main(int argc, char *argv[]) -{ - Initialisation(); - - g_openNi_XML_FilePath = argv[0]; -#if defined _OS_WIN_ - int p = g_openNi_XML_FilePath.find(".exe"); - g_openNi_XML_FilePath = g_openNi_XML_FilePath.substr(0,p-4).append("openni.xml"); -#elif defined _OS_MAC_ - int p = g_openNi_XML_FilePath.find(".app"); - g_openNi_XML_FilePath = g_openNi_XML_FilePath.substr(0,p+4).append("/Contents/Resources/openni.xml"); -#endif - - cout << "Chemin de openni.xml : " << g_openNi_XML_FilePath << endl << endl; - - //------ OPEN_NI / NITE / OPENGL ------// - xn::EnumerationErrors errors; - - g_status = g_context.InitFromXmlFile(g_openNi_XML_FilePath.c_str()); - CHECK_ERRORS(g_status, errors, "InitFromXmlFile"); - CHECK_STATUS(g_status, "InitFromXml"); - - //si le g_context a été initialisé correctement - g_status = g_context.FindExistingNode(XN_NODE_TYPE_DEPTH, g_dpGen); - CHECK_STATUS(g_status, "Find depth generator"); - g_status = g_context.FindExistingNode(XN_NODE_TYPE_HANDS, g_myHandsGenerator); - CHECK_STATUS(g_status, "Find hands generator"); - - // NITE - gp_sessionManager = new XnVSessionManager(); - - //Focus avec un coucou et Refocus avec "RaiseHand" - g_status = gp_sessionManager->Initialize(&g_context,"Wave","Wave,RaiseHand"); - CHECK_STATUS(g_status,"Session manager"); - - gp_sessionManager->RegisterSession(&g_context,sessionStart,sessionEnd,FocusProgress); - gp_sessionManager->SetQuickRefocusTimeout(3000); - - g_pFlowRouter = new XnVFlowRouter; - - gp_pointControl = new XnVPointControl("Point Tracker"); - gp_pointControl->RegisterPrimaryPointCreate(&g_context,pointCreate); - gp_pointControl->RegisterPrimaryPointDestroy(&g_context,pointDestroy); - gp_pointControl->RegisterPrimaryPointUpdate(&g_context,pointUpdate); - - // Wave detector - XnVWaveDetector waveDetect; - waveDetect.RegisterWave(&g_context,&Wave_Detected); - //waveDetect.SetFlipCount(10); - //waveDetect.SetMaxDeviation(1); - //waveDetect.SetMinLength(100); - - // Add Listener - gp_sessionManager->AddListener(gp_pointControl); - gp_sessionManager->AddListener(g_pFlowRouter); - gp_sessionManager->AddListener(&waveDetect); - - nullifyHandPoint(); - g_myHandsGenerator.SetSmoothing(g_fSmoothing); - - // Initialization done. Start generating - g_status = g_context.StartGeneratingAll(); - CHECK_STATUS(g_status, "StartGenerating"); - - initGL(argc,argv); - - - // Qt -#ifdef _OS_MAC_ - int qargc = 0; - char **qargv = NULL; - QApplication app(qargc,qargv); - - ToolDock mainTools(g_totalTools+1); - UploadMainTools(mainTools,true); -#endif - - g_pixSize = mainTools.getItemSize(); - g_pixSizeActive = mainTools.getItemSizeActive(); - - g_cursorQt = CursorQt(STEADY_TYPE); - g_pointerQt = CursorQt(POINTER_TYPE); - gp_window = new GraphicsView(NULL); - gp_windowActiveTool = new GraphicsView(NULL); - gp_sceneActiveTool = new QGraphicsScene(0,0,g_pixSizeActive,g_pixSizeActive); - gp_viewLayouts = new GraphicsView(NULL); - gp_pixActive = new Pixmap(QPixmap()); //for activeTool - //mainTools.init(g_totalTools+1); - //layoutTools.init(g_totalLayoutTools+1); - - - - //================== QT ===================// - - // Initialisation des ressources et création de la fenętre avec les icônes - Q_INIT_RESOURCE(images); - -#ifdef _OS_WIN_ - mainTools.addItem("reset", ":/images/reset.png"); - mainTools.addItem("layout", ":/images/layout.png"); -#endif - mainTools.addItem("move", ":/images/move.png"); - mainTools.addItem("contrast", ":/images/contrast.png"); - mainTools.addItem("zoom", ":/images/zoom.png"); - mainTools.addItem("scroll", ":/images/scroll.png"); - mainTools.addItem("pointer", ":/images/pointer.png"); - mainTools.addItem("mouse", ":/images/mouse.png"); - mainTools.addItem("stop", ":/images/stop.png"); - - mainTools.createView(); - gp_window = mainTools.getWindow(); - g_pix = mainTools.getItems(); - - gp_sceneActiveTool->addItem(gp_pixActive); - //gp_windowActiveTool->setSize(126,126); - gp_windowActiveTool->setScene(gp_sceneActiveTool); - gp_windowActiveTool->setGeometry(gp_window->getResX()-g_pixSizeActive,gp_window->getResY()-g_pixSizeActive-40,g_pixSizeActive,g_pixSizeActive); - - -#ifdef _OS_WIN_ - ////////////// LAYOUT - layoutTools.addItem("1x1", ":/images/layouts/_1x1.png"); - layoutTools.addItem("1x2", ":/images/layouts/_1x2.png"); - layoutTools.addItem("2x1", ":/images/layouts/_2x1.png"); - layoutTools.addItem("3a", ":/images/layouts/_3a.png"); - layoutTools.addItem("3b", ":/images/layouts/_3b.png"); - layoutTools.addItem("2x2", ":/images/layouts/_2x2.png"); - layoutTools.addItem("stop", ":/images/stop.png"); - - layoutTools.createView(); - gp_viewLayouts = layoutTools.getWindow();//////////////////////////////////////////////////////////////////// - g_pixL = layoutTools.getItems(); -#endif - - - // Boucle principale - glutMainLoop(); - - return app.exec(); -} - - - -/**** CALLBACK DEFINITIONS ****/ - -/********************************************************************************** -Session started event handler. Session manager calls this when the session begins -**********************************************************************************/ -void XN_CALLBACK_TYPE sessionStart(const XnPoint3D& ptPosition, void* UserCxt) -{ - ChangeState(CALIBRATE_HAND_STATE); - - g_activeSession = true; - g_toolSelectable = false; - - g_currentTool = g_totalTools; - g_lastTool = 0; - -#ifdef _OS_WIN_ - for (int i=0; ishow(); - gp_window->setWindowOpacity(qreal(0.4)); - gp_viewLayouts->hide(); - gp_windowActiveTool->hide(); - - SteadyAllEnable(); - - //g_hCD.ResetCompteurFrame(); - - static int compteurSession = 1; - cout << endl << "Debut de la session : " << compteurSession++ - << "e" << (compteurSession==1?"re":"") << " fois" << endl << endl; - -#if defined _OS_WIN_ - g_telnet.connexion(); - g_telnet.sendCommand(QString("\r\ndcmview2d:mouseLeftAction sessionStart\r\n")); - g_telnet.deconnexion(); -#endif -} - -/********************************************************************************** -session end event handler. Session manager calls this when session ends -**********************************************************************************/ -void XN_CALLBACK_TYPE sessionEnd(void* UserCxt) -{ -#if defined _OS_WIN_ - g_telnet.connexion(); - g_telnet.sendCommand(QString("\r\ndcmview2d:mouseLeftAction sessionStop\r\n")); - g_telnet.deconnexion(); -#endif - - ChangeState(INACTIVE_SESSION_STATE); - - g_activeSession = false; - g_toolSelectable = false; - - g_currentTool = g_totalTools; - g_lastTool = 0; - -#ifdef _OS_WIN_ - // On réduit tous les outils et layouts - for (int i=0; i<=g_totalTools; i++) - mainTools.setItemIdle(i); - for (int i=0; i<=g_totalLayoutTools; i++) - layoutTools.setItemIdle(i); -#endif - - gp_window->hide(); - gp_viewLayouts->hide(); - gp_windowActiveTool->hide(); - - SteadyAllDisable(); - - XnPoint3D ptTemp; - ptTemp.X = g_hP.HandPt().X(); - ptTemp.Y = g_hP.HandPt().Y(); - ptTemp.Z = g_hP.HandPt().Z(); - g_lastPt = ptTemp; - - cout << endl << "Fin de la session" << endl << endl; -} - - -/********************************************************************************** -point created event handler. this is called when the gp_pointControl detects the creation -of the hand point. This is called only once when the hand point is detected -**********************************************************************************/ -void XN_CALLBACK_TYPE pointCreate(const XnVHandPointContext *pContext, const XnPoint3D &ptFocus, void *cxt) -{ - XnPoint3D coords(pContext->ptPosition); - g_dpGen.ConvertRealWorldToProjective(1,&coords,&g_handPt); - g_lastPt = g_handPt; - - g_hP.Update(g_handPt); -} -/********************************************************************************** -Following the point created method, any update in the hand point coordinates are -reflected through this event handler -**********************************************************************************/ -void XN_CALLBACK_TYPE pointUpdate(const XnVHandPointContext *pContext, void *cxt) -{ - XnPoint3D coords(pContext->ptPosition); - g_dpGen.ConvertRealWorldToProjective(1,&coords,&g_handPt); - - g_hP.Update(g_handPt); -} -/********************************************************************************** -when the point can no longer be tracked, this event handler is invoked. Here we -nullify the hand point variable -**********************************************************************************/ -void XN_CALLBACK_TYPE pointDestroy(XnUInt32 nID, void *cxt) -{ - SteadyAllDisable(); - cout << "\nPoint detruit -------------------------------------------------" - << endl << endl; - - nullifyHandPoint(); - //gp_sessionManager->EndSession(); -} - - -// Callback for no hand detected -void XN_CALLBACK_TYPE NoHands(void* UserCxt) -{ - cout << "No Hands" << endl; - g_cursorQt.EndCursorSession(); - g_pointerQt.EndCursorSession(); -} - -// Callback for when the focus is in progress -void XN_CALLBACK_TYPE FocusProgress(const XnChar* strFocus, - const XnPoint3D& ptPosition, XnFloat fProgress, void* UserCxt) -{ - //cout << "Focus progress: " << strFocus << " @(" << ptPosition.X << "," - // << ptPosition.Y << "," << ptPosition.Z << "): " << fProgress << "\n" << endl; - - /// Pour réafficher l'écran s'il s'est éteint - SimulateCtrlBar(); -} - - -// Callback for wave -void XN_CALLBACK_TYPE Wave_Detected(void *pUserCxt) -{ - cout << "-- Wave detected" << endl; -} - - -void SimulateCtrlBar(void) -{ -#if defined _OS_WIN_ - // Simulate a key press - keybd_event(VK_LCONTROL,0x45,KEYEVENTF_EXTENDEDKEY | 0,0); - // Simulate a key release - keybd_event(VK_LCONTROL,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0); -#endif -} - - diff --git a/KiOP/KiOP/src/pixmap.cpp b/KiOP/KiOP/src/pixmap.cpp deleted file mode 100644 index 9cd4268..0000000 --- a/KiOP/KiOP/src/pixmap.cpp +++ /dev/null @@ -1,39 +0,0 @@ - -#include "pixmap.h" - - -Pixmap::Pixmap(const QPixmap &pix, QGraphicsItem *parent) - : QGraphicsWidget(parent), orig(pix), p(pix) -{ -} - -void Pixmap::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) -{ - painter->drawPixmap(QPointF(), p); -} - -void Pixmap::mousePressEvent(QGraphicsSceneMouseEvent * ) -{ - emit clicked(); -} - -void Pixmap::setGeometry(const QRectF &rect) -{ - QGraphicsWidget::setGeometry(rect); - - if (rect.size().width() > orig.size().width()) - p = orig.scaled(rect.size().toSize()); - else - p = orig; -} - - -void Pixmap::load(const QPixmap &pix){ - p = pix; -} - -int Pixmap::getWidth(){ - return this->p.width(); -} - - diff --git a/KiOP/KiOP/src/telnetclient.cpp b/KiOP/KiOP/src/telnetclient.cpp deleted file mode 100644 index f658b24..0000000 --- a/KiOP/KiOP/src/telnetclient.cpp +++ /dev/null @@ -1,61 +0,0 @@ - -#include "telnetclient.h" - -//#include -//#include -//#include -//#include -//#include - -using namespace std; - -TelnetClient::TelnetClient(QWidget *parent, Qt::WFlags flags) - : QMainWindow(parent, flags) -{ - - tcpSocket = new QTcpSocket(this); - connect(tcpSocket, SIGNAL(connected()), this, SLOT(socketConnected())); - connect(tcpSocket, SIGNAL(disconnected()), this, SLOT(socketDisconnected())); - connect(tcpSocket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(displayError(QAbstractSocket::SocketError))); - bufferSize = 0; - - tcpSocket->abort(); - //tcpSocket->connectToHost("localhost",17179); -} - -void TelnetClient::connexion(){ - //if (!this->tcpSocket->isValid()){ - tcpSocket->connectToHost("localhost",17179); - cout << "connexion!" << endl; - //this->sendCommand(QString("\r\ndcmview2d:mouseLeftAction sessionStart\r\n")); - //this->sendCommand(QString("\r\ndcmview2d:mouseLeftAction sessionStop\r\n")); - //this->sendCommand(QString("\r\ndcmview2d:mouseLeftAction sessionStart\r\n")); - //} -} - -void TelnetClient::deconnexion(){ - //tcpSocket->write(QString("\r\ndcmview2d:mouseLeftAction sessionStop\r\n").toAscii()); - cout << "deconnexion!" << endl; - //tcpSocket->disconnectFromHost(); -} - -void TelnetClient::sendCommand(QString cmd){//char cmd[]){ - //cout << "command: " << cmd.toStdString() << endl; - QByteArray paquet = cmd.toAscii(); - //QDataStream out(&paquet, QIODevice::WriteOnly); - - //out << cmd; - - tcpSocket->write(paquet); // On envoie le paquet -} - -void TelnetClient::socketConnected(){ - cout << "-- Connected to the server!" << endl; -} - -void TelnetClient::socketDisconnected(){ - cout << "-- Disconnected!! ._. " << endl; -} - -void TelnetClient::displayError(QAbstractSocket::SocketError socketError){ -} \ No newline at end of file diff --git a/KiOP/KiOP/src/tooldock.cpp b/KiOP/KiOP/src/tooldock.cpp deleted file mode 100644 index 9c82424..0000000 --- a/KiOP/KiOP/src/tooldock.cpp +++ /dev/null @@ -1,181 +0,0 @@ - -#include "tooldock.h" - - -ToolDock::ToolDock(int nItems, QGraphicsItem *parent) : QGraphicsWidget(parent) -{ - //this->resX = QApplication::desktop()->width(); - //this->resY = QApplication::desktop()->height(); - - QDesktopWidget screen; - QRect screenGeom = screen.screenGeometry(); - - this->resX = screenGeom.width(); - this->resY = screenGeom.height(); - - this->minItemSize = 64; - this->maxItemSize = 160; - - this->itemSizeAlpha = 1.5; - - this->window = new GraphicsView(NULL); - this->scene = new QGraphicsScene(NULL); - - //calculate the itemSize - this->itemSize = (float)(this->resX)/(float)(nItems)/this->itemSizeAlpha; - if (itemSize > this->maxItemSize){ - itemSize = this->maxItemSize; - } - else if (itemSize < this->minItemSize){ - itemSize = this->minItemSize; - } - - this->itemIdlePt = itemSize*(itemSizeAlpha-1); - this->itemActivePt = 0; - this->itemSizeActive = (int)(itemSize + itemSize/2); - - this->nItems = 0; - - setToolsBackgroundTransparent(); - - //cout << "itemSize: " << itemSize << endl; - //cout << "itemActiveSize: " << itemSizeActive << endl; -} - -void ToolDock::addItem(QString name, QString resource) -{ - Pixmap *p = new Pixmap(QPixmap(QString(resource)).scaled(itemSize,itemSize)); - p->setObjectName(name); - - this->items.push_back(p); - this->scene->addItem(p); - nItems++; -} - -//Creates the GraphicsView -void ToolDock::createView(){ - - //place the items in the window - for (int i=0; inItems; i++){ - this->items[i]->setGeometry(QRectF((this->itemSizeAlpha*i*itemSize)+(itemSize/2), itemIdlePt, itemSize, itemSize)); - } - - //Calculate our GraphicsView size knowing number of items - // and screen resolution - int width = (int)((itemSize*this->itemSizeAlpha*((float)(this->nItems)))+(this->itemSize/2)); - int height = itemSize*itemSizeAlpha; - - cout << "window: " << width << "," << height << endl; - this->scene->setSceneRect(0,0,width,height); - this->window->setSize(width,height); - this->window->setScene(this->scene); -} - -GraphicsView* ToolDock::getWindow() -{ - return this->window; -} - - -QGraphicsScene* ToolDock::getScene() -{ - return this->scene; -} - -vector ToolDock::getItems() -{ - return this->items; -} - -int ToolDock::getItemSize() -{ - return this->itemSize; -} - -int ToolDock::getItemSizeActive() -{ - return this->itemSizeActive; -} - -void ToolDock::setItemSize(int size) -{ - this->itemSize = size; -} - -void ToolDock::setItemIdlePt(int pos) -{ - this->itemIdlePt = pos; -} - -void ToolDock::setItemActivePt(int pos) -{ - this->itemActivePt = pos; -} - - -void ToolDock::setItemActive(int item){ - //this->items[item]->hide(); - //this->items[item]->setGeometry(QRectF((itemSizeAlpha*item*itemSize)+(itemSize/4), itemActivePt, itemSizeActive+5, itemSizeActive+5)); - //this->items[item]->setScale(itemSizeActive/(float)this->items[item]->getWidth()); - //QString itemName = this->items[item]->objectName(); - //this->items[item] = new Pixmap(QPixmap(":/images/"+itemName+".png").scaled(itemSizeActive, itemSizeActive)); - //this->items.at(item) = new Pixmap(QPixmap(":/images/"+itemName+".png").scaled(itemSizeActive, itemSizeActive)); - //this->items[item]->setGeometry(QRectF((itemSizeAlpha*item*itemSize)+(itemSize/4), itemActivePt, itemSizeActive, itemSizeActive)); - //this->items[item]->load(QPixmap(":/images/"+itemName+".png").scaled(itemSizeActive, itemSizeActive)); - this->items[item]->setGeometry(QRectF((itemSizeAlpha*item*itemSize)+(itemSize/4), itemActivePt, itemSizeActive, itemSizeActive)); - //this->items[item]->setScale(itemSizeActive/(float)this->items[item]->getWidth()); - /*cout << "aleft: " << itemSizeAlpha*item*itemSize << "; atop:" << itemActivePt << endl; - cout << "setScale: " << itemSizeActive/(float)this->items[item]->getWidth() << endl;*/ - //this->items[item]->show(); -} - -void ToolDock::setItemIdle(int item){ - //this->items[item]->setScale(itemSize/this->items[item]->getWidth()); - //this->items[item]->setScale(0.3); - //this->items[item]->setGeometry(QRectF((itemSizeAlpha*item*itemSize)+(itemSize/2), itemIdlePt, itemSize, itemSize)); - //this->items[item]->setGeometry(QRectF((itemSizeAlpha*item*itemSize)+(itemSize/2), this->window->size().height() - itemIdlePt, itemSize, itemSize)); - this->items[item]->setGeometry(QRectF((itemSizeAlpha*item*itemSize)+(itemSize/2), itemIdlePt, itemSize, itemSize)); - //this->items[item]->setScale(itemSize/(float)this->items[item]->getWidth()); - //this->items[item]->setScale(itemSize/this->items[item]->getWidth()); - -} - - -void ToolDock::setToolsBackgroundTransparent(void) -{ - window->setBackgroundBrush(Qt::NoBrush); - //window->setBackgroundBrush(QBrush(Qt::blue, Qt::SolidPattern)); - window->setWindowOpacity(qreal(1.0)); -} -void ToolDock::setToolsBackgroundRed(void) -{ - window->setBackgroundBrush(QBrush(Qt::red, Qt::SolidPattern)); - window->setWindowOpacity(qreal(0.7)); -} - - - - - -//ToolDock& ToolDock::operator=(const ToolDock &pt) -//{ -// -// return *this; -//} - - - - - - - - - - - - - - - - - diff --git a/KiOP/Plugin/KiOPFilter.h b/KiOP/Plugin/KiOPFilter.h deleted file mode 100644 index 62ec143..0000000 --- a/KiOP/Plugin/KiOPFilter.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// KiOPFilter.h -// KiOP -// -// Copyright (c) 2012 KiOP. All rights reserved. -// - -#import -#import - -@interface KiOPFilter : PluginFilter { - NSPoint origin; -} - -- (long) filterImage:(NSString*) menuName; - -@end diff --git a/KiOP/Plugin/KiOPFilter.mm b/KiOP/Plugin/KiOPFilter.mm deleted file mode 100644 index a842008..0000000 --- a/KiOP/Plugin/KiOPFilter.mm +++ /dev/null @@ -1,290 +0,0 @@ -// -// KiOPFilter.m -// KiOP -// -// Copyright (c) 2012 KiOP. All rights reserved. -// - -#import "KiOPFilter.h" -#import -#import -#import -#import -#import - - - -//@implementation KiOPFilter -// -//- (void) initPlugin -//{ -//} -// -//- (long) filterImage:(NSString*) menuName -//{ -// ViewerController *new2DViewer; -// -// // In this plugin, we will simply duplicate the current 2D window! -// -// new2DViewer = [self duplicateCurrent2DViewerWindow]; -// -// if( new2DViewer) return 0; // No Errors -// else return -1; -//} -// -//@end - - -@interface MyConn : N2Connection{ - - NSPoint origin; -} - -@end - -@implementation MyConn - - --(id)initWithAddress:(NSString *)address port:(NSInteger)port is:(NSInputStream *)is os:(NSOutputStream *)os { - if ((self = [super initWithAddress:address port:port is:is os:os])) { - NSLog(@"Client connected"); - } - - return self; -} - --(void)handleCommand:(NSString*)cmd{ - ViewerController* v = [ViewerController frontMostDisplayed2DViewer]; - - // [v setScaleValue:[v scaleValue]*1.2]; // Zoom - // [v setImageIndex:[v imageIndex]+1]; // scroll - - - // - (void)setWL:(float)wl WW:(float)ww; //window/level - // - (void)setOrigin:(NSPoint) o; //move - // - (void) setImageIndex:(long) i - NSLog(@"%@ \n",cmd); - - if ([cmd hasPrefix:@"zoom"]){ - int value = 0; - NSRange r = [cmd rangeOfString:@"-i"]; - if (r.location != NSNotFound){ - value = [[cmd substringWithRange:NSMakeRange(r.location+3, [cmd length] - r.location-3)] intValue]; - NSLog(@"i: %d",value); - [v setScaleValue:[v scaleValue]*(1+((float)value/50.0))]; -// NSLog(@"%f",(1-(((float)value/10)))); - } - else{ - NSRange r2 = [cmd rangeOfString:@"-d"]; - if (r2.location != NSNotFound){ - value = [[cmd substringWithRange:NSMakeRange(r2.location+3, [cmd length] - r2.location-3)] intValue]; - NSLog(@"d: %d",value); - [v setScaleValue:[v scaleValue]*(1-((float)value/50.0))]; -// NSLog(@"%f",(1-((float)value/10))); - } - } - - } - - if ([cmd hasPrefix:@"wl"]){ - - NSRange r = [cmd rangeOfString:@"--"]; - - if (r.location != NSNotFound){ - - NSString *values = [cmd substringWithRange:NSMakeRange(r.location+3, [cmd length] - r.location-3)]; - NSLog(@"values: [%@]",values); // values = X_Y - NSArray *tokens = [values componentsSeparatedByString: @" "]; //seperate X , Y - - float valueX = [(NSString*)[tokens objectAtIndex:0] floatValue]; - float valueY = [(NSString*)[tokens objectAtIndex:1] floatValue]; - - NSLog(@"valueX: [%f]",valueX); - NSLog(@"valueY: [%f]",valueY); - - [v setWL:([v curWL]+valueX) WW:([v curWW]+valueY)]; - //NSLog(@"i: %d",value); - // NSLog(@"%f",(1-(((float)value/10)))); - } - else{ - NSLog(@"No values for \"wl\""); - } - - } - - if ([cmd hasPrefix:@"move"]){ - - NSRange r = [cmd rangeOfString:@"--"]; - - if (r.location != NSNotFound){ - - NSString *values = [cmd substringWithRange:NSMakeRange(r.location+3, [cmd length] - r.location-3)]; - NSLog(@"values: [%@]",values); // values = X_Y - NSArray *tokens = [values componentsSeparatedByString: @" "]; //seperate X , Y - - float valueX = [(NSString*)[tokens objectAtIndex:0] floatValue]; - float valueY = [(NSString*)[tokens objectAtIndex:1] floatValue]; - - NSLog(@"valueX: [%f]",valueX); - NSLog(@"valueY: [%f]",valueY); - - origin.x = origin.x - valueX; - origin.y = origin.y + valueY; - // NSPoint pt; - // pt.x = valueX; - // pt.y = valueY; - [v setOrigin:origin]; - } - else{ - NSLog(@"No values for \"move\""); - } - - } - - - // [v setImageIndex:[v imageIndex]+1]; //scroll - if ([cmd hasPrefix:@"scroll"]){ - int value = 0; - NSRange r = [cmd rangeOfString:@"-i"]; - if (r.location != NSNotFound){ - value = [[cmd substringWithRange:NSMakeRange(r.location+3, [cmd length] - r.location-3)] intValue]; - NSLog(@"i: %d",value); - [v setImageIndex:[v imageIndex]+value]; - } - else{ - NSRange r2 = [cmd rangeOfString:@"-d"]; - if (r2.location != NSNotFound){ - value = [[cmd substringWithRange:NSMakeRange(r2.location+3, [cmd length] - r2.location-3)] intValue]; - NSLog(@"d: %d",value); - [v setImageIndex:[v imageIndex]-value]; - } - - } - - } - -} - --(void)handleLine:(NSString*)line { - - NSLog(@"line: %@", line); - - NSRange r = [line rangeOfCharacterFromSet:[NSCharacterSet punctuationCharacterSet]]; - //if (r.location == NSNotFound) - // break; - - NSString* cmd = [line substringToIndex:r.location]; - NSArray *tokens = [line componentsSeparatedByString: @":"]; - NSLog(@"%d",(int)[tokens count]); - for (int i = 0; i<[tokens count]; i++) { - - [self handleCommand:[tokens objectAtIndex:i]]; - } - - if (cmd.length){ - @try { - NSLog(@"viewer: %@", cmd); - } @catch (NSException* e) { - NSLog(@"%@", e); - } - } - - -} - --(void)handleData:(NSMutableData*)data { - while (data.length) { - NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - @try { - NSString* str = [[[NSString alloc] initWithBytesNoCopy:(void*)data.bytes length:data.length encoding:NSUTF8StringEncoding freeWhenDone:NO] autorelease]; - - NSRange r = [str rangeOfCharacterFromSet:[NSCharacterSet newlineCharacterSet]]; - if (r.location == NSNotFound) - break; - - NSString* line = [str substringToIndex:r.location]; - [data replaceBytesInRange:NSMakeRange(0, r.location+r.length) withBytes:nil length:0]; - - if (line.length) - @try { - [self handleLine:line]; - } @catch (NSException* e) { - NSLog(@"%@", e); - } - } @catch (NSException* e) { - NSLog(@"%@", e); - break; - } @finally { - [pool release]; - } - } -} - - - -@end - - - -@implementation KiOPFilter - -- (void) initPlugin -{ - origin.x = 0.0; - origin.y = 0.0; - N2ConnectionListener* cl = [[N2ConnectionListener alloc] initWithPort:17179 connectionClass:[MyConn class]]; - - [N2Shell execute:@"/usr/bin/open" arguments:[NSArray arrayWithObjects: @"-a", [[NSBundle bundleForClass:[self class]] pathForAuxiliaryExecutable:@"KiOP.app"], nil]]; - - - /*ViewerController *new2DViewer; - - // In this plugin, we will simply duplicate the current 2D window! - - new2DViewer = [self duplicateCurrent2DViewerWindow]; - - NSAlert *myAlert = [NSAlert alertWithMessageText:@"KinectOP" - defaultButton:@"launched" - alternateButton:nil - otherButton:nil - informativeTextWithFormat:@"Plugin launched"]; - [myAlert runModal];*/ -} - - - -- (long) filterImage:(NSString*) menuName -{ - //ViewerController *new2DViewer; - - // In this plugin, we will simply duplicate the current 2D window! - - //new2DViewer = [self duplicateCurrent2DViewerWindow]; - - /*NSAlert *myAlert = [NSAlert alertWithMessageText:@"KinectOP" - defaultButton:@"launched" - alternateButton:nil - otherButton:nil - informativeTextWithFormat:@"Plugin launched"]; - [myAlert runModal];*/ - //if( new2DViewer) return 0; // No Errors - //else return -1; - - - - - // pour lancer un binaire externe: - // NSTask // N2Task - - - - // - // MyConn* conn = [[MyConn alloc] initWithAddress:@"localhost" port:17179]; - // [conn reconnect]; - - - - return 0; -} - -@end diff --git a/OSIDemoPlugin/OSIDemoPlugin.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist b/OSIDemoPlugin/OSIDemoPlugin.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..509a9cd --- /dev/null +++ b/OSIDemoPlugin/OSIDemoPlugin.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SuppressBuildableAutocreation + + 4F24E942142E290400A8F60A + + primary + + + + + diff --git a/PDF to DICOM/DCMPDFImportFilter.h b/PDF to DICOM/DCMPDFImportFilter.h index 5a5fab2..265b2cc 100644 --- a/PDF to DICOM/DCMPDFImportFilter.h +++ b/PDF to DICOM/DCMPDFImportFilter.h @@ -4,7 +4,7 @@ // #import -#import "OsiriXAPI/PluginFilter.h" +#import @class DCMCalendarDate; diff --git a/PDF to DICOM/DCMPDFImportFilter.m b/PDF to DICOM/DCMPDFImportFilter.m index f11dbc5..13bc2a9 100644 --- a/PDF to DICOM/DCMPDFImportFilter.m +++ b/PDF to DICOM/DCMPDFImportFilter.m @@ -8,6 +8,7 @@ #import "OsiriXAPI/browserController.h" #import "OsiriXAPI/DicomFile.h" +#import "OsiriXAPI/DicomDatabase.h" @implementation DCMPDFImportFilter @@ -47,8 +48,7 @@ - (long) filterImage:(NSString*) menuName NSDirectoryEnumerator *dirEnumerator = [[NSFileManager defaultManager] enumeratorAtPath:fpath]; NSString *path; while (path = [dirEnumerator nextObject]) - if ([[NSImage imageFileTypes] containsObject:[path pathExtension]] - || [[NSImage imageFileTypes] containsObject:NSFileTypeForHFSTypeCode([[[[NSFileManager defaultManager] fileSystemAttributesAtPath:path] objectForKey:NSFileHFSTypeCode] longValue])]) + if ([[NSImage imageFileTypes] containsObject:[path pathExtension]]) [self convertImageToDICOM:[fpath stringByAppendingPathComponent:path] source: source]; } else @@ -65,122 +65,133 @@ - (long) filterImage:(NSString*) menuName - (void)convertImageToDICOM:(NSString *)path source:(NSString *) source { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - NSMutableData *pdf = nil; - if ([[path pathExtension] isEqualToString:@"pdf"]) - pdf = [NSMutableData dataWithContentsOfFile:path]; - - //if we have an image get the info we need from the imageRep. - if( pdf) - { - id patientName = nil, patientID = nil, studyDescription = nil, studyUID = nil, studyID = nil, studyDate = nil; - id studyTime = nil, seriesDate = nil, seriesTime = nil, acquisitionDate = nil, acquisitionTime = nil; - id contentDate = nil, contentTime = nil, charSet = nil, patientSex = nil, accessionNumber = nil, patientsBirthDate = nil, referringPhysiciansName = nil; - - if ([DicomFile isDICOMFile: source]) - { - DCMObject *dcmObject = [DCMObject objectWithContentsOfFile: source decodingPixelData:NO]; - - patientName = [dcmObject attributeValueWithName:@"PatientsName"]; - patientID = [dcmObject attributeValueWithName:@"PatientID"]; - studyDescription = [dcmObject attributeValueWithName:@"StudyDescription"]; - studyUID = [dcmObject attributeValueWithName:@"StudyInstanceUID"]; - studyID = [dcmObject attributeValueWithName:@"StudyID"]; - studyDate = [dcmObject attributeValueWithName:@"StudyDate"]; - studyTime = [dcmObject attributeValueWithName:@"StudyTime"]; - seriesDate = [dcmObject attributeValueWithName:@"SeriesDate"]; - seriesTime = [dcmObject attributeValueWithName:@"SeriesTime"]; - acquisitionDate = [dcmObject attributeValueWithName:@"AcquisitionDate"]; - acquisitionTime = [dcmObject attributeValueWithName:@"AcquisitionTime"]; - contentDate = [dcmObject attributeValueWithName:@"ContentDate"]; - contentTime = [dcmObject attributeValueWithName:@"ContentTime"]; - charSet = [dcmObject attributeValueWithName:@"SpecificCharacterSet"]; - patientSex = [dcmObject attributeValueWithName:@"PatientsSex"]; - accessionNumber = [dcmObject attributeValueWithName:@"AccessionNumber"]; - patientsBirthDate = [dcmObject attributeValueWithName:@"PatientsBirthDate"]; - - referringPhysiciansName = [dcmObject attributeValueWithName:@"ReferringPhysiciansName"]; - } - - // pad data - if ([pdf length] % 2 != 0) - [pdf increaseLengthBy:1]; - // create DICOM OBJECT - DCMObject *dcmObject = [DCMObject encapsulatedPDF:pdf]; - - if( charSet) - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: charSet] forName:@"SpecificCharacterSet"]; - - [dcmObject setAttributeValues:[NSArray arrayWithObject: studyUID] forName:@"StudyInstanceUID"]; - [dcmObject setAttributeValues:[NSArray arrayWithObject: [[path lastPathComponent] stringByDeletingPathExtension]] forName:@"SeriesDescription"]; - - if (patientName) - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: patientName] forName:@"PatientsName"]; - else - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: @""] forName:@"PatientsName"]; - - if (patientID) - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: patientID] forName:@"PatientID"]; - else - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: @"0"] forName:@"PatientID"]; - - if (patientsBirthDate) - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: patientsBirthDate] forName:@"PatientsBirthDate"]; - - if (accessionNumber) - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: accessionNumber] forName:@"AccessionNumber"]; - - if( referringPhysiciansName) - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: referringPhysiciansName] forName:@"ReferringPhysiciansName"]; - - if (patientSex) - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: patientSex] forName:@"PatientsSex"]; - else - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: @""] forName:@"PatientsSex"]; - - if (patientsBirthDate) - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: patientsBirthDate] forName:@"PatientsBirthDate"]; - - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: [[path lastPathComponent] stringByDeletingPathExtension]] forName:@"DocumentTitle"]; - - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:[NSString stringWithFormat:@"%d", imageNumber]] forName:@"InstanceNumber"]; - - if ( studyID) - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:[NSString stringWithFormat:@"%d", studyID]] forName:@"StudyID"]; - else - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:[NSString stringWithFormat:@"%d", 0001]] forName:@"StudyID"]; - - if (studyDate) - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:studyDate] forName:@"StudyDate"]; - else - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:[DCMCalendarDate dicomDateWithDate:[NSDate date]]] forName:@"StudyDate"]; - - if (studyTime) - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:studyTime] forName:@"StudyTime"]; - else - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:[DCMCalendarDate dicomTimeWithDate:[NSDate date]]] forName:@"StudyTime"]; + @autoreleasepool + { + NSMutableData *pdf = nil; + if ([[path pathExtension] isEqualToString:@"pdf"]) + pdf = [NSMutableData dataWithContentsOfFile:path]; + + //if we have an image get the info we need from the imageRep. + if( pdf) + { + id patientName = nil, patientID = nil, studyDescription = nil, studyUID = nil, studyID = nil, studyDate = nil; + id studyTime = nil, seriesDate = nil, seriesTime = nil, acquisitionDate = nil, acquisitionTime = nil; + id contentDate = nil, contentTime = nil, charSet = nil, patientSex = nil, accessionNumber = nil, patientsBirthDate = nil, referringPhysiciansName = nil, institutionName = nil; + + if ([DicomFile isDICOMFile: source]) + { + DCMObject *dcmObject = [DCMObject objectWithContentsOfFile: source decodingPixelData:NO]; + + patientName = [dcmObject attributeValueWithName:@"PatientsName"]; + patientID = [dcmObject attributeValueWithName:@"PatientID"]; + studyDescription = [dcmObject attributeValueWithName:@"StudyDescription"]; + studyUID = [dcmObject attributeValueWithName:@"StudyInstanceUID"]; + studyID = [dcmObject attributeValueWithName:@"StudyID"]; + studyDate = [dcmObject attributeValueWithName:@"StudyDate"]; + studyTime = [dcmObject attributeValueWithName:@"StudyTime"]; + seriesDate = [dcmObject attributeValueWithName:@"SeriesDate"]; + seriesTime = [dcmObject attributeValueWithName:@"SeriesTime"]; + acquisitionDate = [dcmObject attributeValueWithName:@"AcquisitionDate"]; + acquisitionTime = [dcmObject attributeValueWithName:@"AcquisitionTime"]; + contentDate = [dcmObject attributeValueWithName:@"ContentDate"]; + contentTime = [dcmObject attributeValueWithName:@"ContentTime"]; + charSet = [dcmObject attributeValueWithName:@"SpecificCharacterSet"]; + patientSex = [dcmObject attributeValueWithName:@"PatientsSex"]; + accessionNumber = [dcmObject attributeValueWithName:@"AccessionNumber"]; + patientsBirthDate = [dcmObject attributeValueWithName:@"PatientsBirthDate"]; + institutionName = [dcmObject attributeValueWithName:@"InstitutionName"]; + + referringPhysiciansName = [dcmObject attributeValueWithName:@"ReferringPhysiciansName"]; + } + + // pad data + if ([pdf length] % 2 != 0) + [pdf increaseLengthBy:1]; + // create DICOM OBJECT + DCMObject *dcmObject = [DCMObject encapsulatedPDF:pdf]; + + if( charSet) + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: charSet] forName:@"SpecificCharacterSet"]; + + [dcmObject setAttributeValues:[NSArray arrayWithObject: studyUID] forName:@"StudyInstanceUID"]; + [dcmObject setAttributeValues:[NSArray arrayWithObject: [[path lastPathComponent] stringByDeletingPathExtension]] forName:@"SeriesDescription"]; + + if (patientName) + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: patientName] forName:@"PatientsName"]; + else + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: @""] forName:@"PatientsName"]; + + if (patientID) + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: patientID] forName:@"PatientID"]; + else + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: @"0"] forName:@"PatientID"]; + + if (patientsBirthDate) + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: patientsBirthDate] forName:@"PatientsBirthDate"]; + + if (accessionNumber) + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: accessionNumber] forName:@"AccessionNumber"]; + + if( referringPhysiciansName) + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: referringPhysiciansName] forName:@"ReferringPhysiciansName"]; + + if( institutionName) + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: institutionName] forName:@"InstitutionName"]; + + if (patientSex) + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: patientSex] forName:@"PatientsSex"]; + else + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: @""] forName:@"PatientsSex"]; + + if (patientsBirthDate) + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: patientsBirthDate] forName:@"PatientsBirthDate"]; + + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject: [[path lastPathComponent] stringByDeletingPathExtension]] forName:@"DocumentTitle"]; + + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:[NSString stringWithFormat:@"%d", imageNumber]] forName:@"InstanceNumber"]; + + if ( studyID) + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:[NSString stringWithFormat:@"%d", (int) studyID]] forName:@"StudyID"]; + else + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:[NSString stringWithFormat:@"%d", 0001]] forName:@"StudyID"]; + + if (studyDate) + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:studyDate] forName:@"StudyDate"]; + else + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:[DCMCalendarDate dicomDateWithDate:[NSDate date]]] forName:@"StudyDate"]; + + if (studyTime) + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:studyTime] forName:@"StudyTime"]; + else + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:[DCMCalendarDate dicomTimeWithDate:[NSDate date]]] forName:@"StudyTime"]; - if (seriesDate) - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:seriesDate] forName:@"SeriesDate"]; - else - - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:[DCMCalendarDate dicomTimeWithDate:[NSDate date]]] forName:@"SeriesDate"]; - - if (seriesTime) - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:seriesTime] forName:@"SeriesTime"]; - else - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:[DCMCalendarDate dicomTimeWithDate:[NSDate date]]] forName:@"SeriesTime"]; - - [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:@"9997"] forName:@"SeriesNumber"]; - - //get Incoming Folder Path; - NSString *destination = [NSString stringWithFormat: @"%@/INCOMING.noindex/PDF%d%d.dcm", [[BrowserController currentBrowser] documentsDirectory], studyID, imageNumber++]; - - if ([dcmObject writeToFile:destination withTransferSyntax:[DCMTransferSyntax ExplicitVRLittleEndianTransferSyntax] quality:DCMLosslessQuality atomically:YES]) - NSLog(@"Wrote PDF to %@", destination); - } - - [pool release]; + if (seriesDate) + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:seriesDate] forName:@"SeriesDate"]; + else + + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:[DCMCalendarDate dicomTimeWithDate:[NSDate date]]] forName:@"SeriesDate"]; + + if (seriesTime) + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:seriesTime] forName:@"SeriesTime"]; + else + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:[DCMCalendarDate dicomTimeWithDate:[NSDate date]]] forName:@"SeriesTime"]; + + [dcmObject setAttributeValues:[NSMutableArray arrayWithObject:@"9997"] forName:@"SeriesNumber"]; + + NSString *filePath = [BrowserController.currentBrowser.database uniquePathForNewDataFileWithExtension: @"dcm"]; + + if( [dcmObject writeToFile:filePath withTransferSyntax:[DCMTransferSyntax ExplicitVRLittleEndianTransferSyntax] quality:DCMLosslessQuality atomically:YES]) + NSLog(@"Wrote PDF to %@", filePath); + + if( [[NSFileManager defaultManager] fileExistsAtPath: filePath]) + [BrowserController.currentBrowser.database addFilesAtPaths: [NSArray arrayWithObject: filePath] + postNotifications: YES + dicomOnly: YES + rereadExistingItems: YES + generatedByOsiriX: YES]; + + + } + } } @end diff --git a/PDF to DICOM/English.lproj/InfoPlist.strings b/PDF to DICOM/English.lproj/InfoPlist.strings index 24ff0be..daa8d9e 100644 Binary files a/PDF to DICOM/English.lproj/InfoPlist.strings and b/PDF to DICOM/English.lproj/InfoPlist.strings differ diff --git a/PDF to DICOM/Info.plist b/PDF to DICOM/Info.plist index 74724f8..67728a0 100644 --- a/PDF to DICOM/Info.plist +++ b/PDF to DICOM/Info.plist @@ -19,7 +19,7 @@ CFBundleSignature ???? CFBundleVersion - 1.7 + 1.8 MenuTitles PDF to DICOM diff --git a/PDF to DICOM/PDFToDicom.xcodeproj/project.pbxproj b/PDF to DICOM/PDFToDicom.xcodeproj/project.pbxproj index 8d1f6c6..9f09863 100644 --- a/PDF to DICOM/PDFToDicom.xcodeproj/project.pbxproj +++ b/PDF to DICOM/PDFToDicom.xcodeproj/project.pbxproj @@ -8,7 +8,7 @@ /* Begin PBXBuildFile section */ 8465D07711060DA1007ACA1E /* PDF2DICOM.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8465D07611060DA1007ACA1E /* PDF2DICOM.icns */; }; - 8465D2B711060F65007ACA1E /* OsiriXAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8465D2B611060F65007ACA1E /* OsiriXAPI.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + 84F59F9F17D7604D00E1A2DC /* OsiriXAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84F59F9E17D7604D00E1A2DC /* OsiriXAPI.framework */; }; 8D5B49AE048680CD000E48DA /* Duplicate_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32DBCF630370AF2F00C91783 /* Duplicate_Prefix.pch */; }; 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; @@ -35,7 +35,7 @@ 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 32DBCF630370AF2F00C91783 /* Duplicate_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Duplicate_Prefix.pch; sourceTree = ""; }; 8465D07611060DA1007ACA1E /* PDF2DICOM.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = PDF2DICOM.icns; sourceTree = ""; }; - 8465D2B611060F65007ACA1E /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = ../../osirix/osirix/build/Development/OsiriXAPI.framework; sourceTree = SOURCE_ROOT; }; + 84F59F9E17D7604D00E1A2DC /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = ../../osirix/build/Development/OsiriXAPI.framework; sourceTree = ""; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; AB5D36050680E57E00F4007A /* PDFtoDICOM.osirixplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PDFtoDICOM.osirixplugin; sourceTree = BUILT_PRODUCTS_DIR; }; ABA48A640680BB600089EB4F /* DCMPDFImportFilter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DCMPDFImportFilter.h; sourceTree = ""; }; @@ -48,7 +48,7 @@ buildActionMask = 2147483647; files = ( 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */, - 8465D2B711060F65007ACA1E /* OsiriXAPI.framework in Frameworks */, + 84F59F9F17D7604D00E1A2DC /* OsiriXAPI.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -98,7 +98,7 @@ 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( - 8465D2B611060F65007ACA1E /* OsiriXAPI.framework */, + 84F59F9E17D7604D00E1A2DC /* OsiriXAPI.framework */, 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */, ); name = "Linked Frameworks"; @@ -240,7 +240,10 @@ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = NO; DEBUGGING_SYMBOLS = YES; - FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/../../osirix/osirix/build/Development\""; + FRAMEWORK_SEARCH_PATHS = ( + "\"$(SRCROOT)/../../osirix/osirix/build/Development\"", + "\"$(SRCROOT)/../../osirix/build/Development\"", + ); GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_ENABLE_TRIGRAPHS = NO; @@ -274,13 +277,9 @@ BF90E90F088F520B0078E0EC /* Development */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - i386, - ppc, - x86_64, - ); + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; MACOSX_DEPLOYMENT_TARGET = 10.5; - SDKROOT = macosx10.5; + SDKROOT = macosx10.7; }; name = Development; }; diff --git a/Reporter/Reporter.xcodeproj/project.pbxproj b/Reporter/Reporter.xcodeproj/project.pbxproj index 2b552d9..00a8f2f 100644 --- a/Reporter/Reporter.xcodeproj/project.pbxproj +++ b/Reporter/Reporter.xcodeproj/project.pbxproj @@ -13,8 +13,6 @@ 717FD97716C4E69900CE8222 /* ReporterPrefsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 717FD97616C4E69900CE8222 /* ReporterPrefsController.m */; }; 717FD97916C4E71200CE8222 /* PreferencePanes.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 717FD97816C4E71200CE8222 /* PreferencePanes.framework */; }; 717FD97A16C4EA4800CE8222 /* ReporterPrefs.prefPane in Resources */ = {isa = PBXBuildFile; fileRef = 717FD95F16C4E06B00CE8222 /* ReporterPrefs.prefPane */; }; - 71CD3888151B7657008B5E86 /* KBPopUpToolbarItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 71CD3886151B7657008B5E86 /* KBPopUpToolbarItem.h */; }; - 71CD3889151B7657008B5E86 /* KBPopUpToolbarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 71CD3887151B7657008B5E86 /* KBPopUpToolbarItem.m */; }; 71FD07B8151B5FA5001DA7FE /* Reporter.png in Resources */ = {isa = PBXBuildFile; fileRef = 71FD07B7151B5FA5001DA7FE /* Reporter.png */; }; 8420023212E829A200E1E9CE /* OsiriXAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8420023112E829A200E1E9CE /* OsiriXAPI.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 8D5B49AE048680CD000E48DA /* Reporter_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32DBCF630370AF2F00C91783 /* Reporter_Prefix.pch */; }; @@ -44,15 +42,13 @@ 717FD96416C4E06B00CE8222 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 717FD96516C4E06B00CE8222 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 717FD96616C4E06B00CE8222 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 717FD96916C4E06B00CE8222 /* ReporterPrefs-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "ReporterPrefs-Info.plist"; path = "../Resources/ReporterPrefs-Info.plist"; sourceTree = ""; }; + 717FD96916C4E06B00CE8222 /* ReporterPrefs-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = "ReporterPrefs-Info.plist"; path = "Resources/ReporterPrefs-Info.plist"; sourceTree = ""; }; 717FD97316C4E67B00CE8222 /* ReporterPrefs.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = ReporterPrefs.xib; path = Resources/ReporterPrefs.xib; sourceTree = SOURCE_ROOT; }; 717FD97516C4E69900CE8222 /* ReporterPrefsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ReporterPrefsController.h; path = Sources/ReporterPrefsController.h; sourceTree = SOURCE_ROOT; }; 717FD97616C4E69900CE8222 /* ReporterPrefsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ReporterPrefsController.m; path = Sources/ReporterPrefsController.m; sourceTree = SOURCE_ROOT; }; 717FD97816C4E71200CE8222 /* PreferencePanes.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PreferencePanes.framework; path = ../../../../../../System/Library/Frameworks/PreferencePanes.framework; sourceTree = ""; }; - 71CD3886151B7657008B5E86 /* KBPopUpToolbarItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KBPopUpToolbarItem.h; path = Sources/KBPopUpToolbarItem.h; sourceTree = ""; }; - 71CD3887151B7657008B5E86 /* KBPopUpToolbarItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KBPopUpToolbarItem.m; path = Sources/KBPopUpToolbarItem.m; sourceTree = ""; }; 71FD07B7151B5FA5001DA7FE /* Reporter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Reporter.png; path = Resources/Reporter.png; sourceTree = ""; }; - 8420023112E829A200E1E9CE /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = "../../osirix-trunk/build/Development/OsiriXAPI.framework"; sourceTree = ""; }; + 8420023112E829A200E1E9CE /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = ../../osirix/build/Development/OsiriXAPI.framework; sourceTree = ""; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Resources/Info.plist; sourceTree = ""; }; AB5D36050680E57E00F4007A /* Reporter.osirixplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Reporter.osirixplugin; sourceTree = BUILT_PRODUCTS_DIR; }; ABA48A640680BB600089EB4F /* ReporterFilter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ReporterFilter.h; path = Sources/ReporterFilter.h; sourceTree = ""; }; @@ -154,8 +150,6 @@ isa = PBXGroup; children = ( 32DBCF630370AF2F00C91783 /* Reporter_Prefix.pch */, - 71CD3886151B7657008B5E86 /* KBPopUpToolbarItem.h */, - 71CD3887151B7657008B5E86 /* KBPopUpToolbarItem.m */, ); name = "Other Sources"; sourceTree = ""; @@ -200,7 +194,6 @@ files = ( 8D5B49AE048680CD000E48DA /* Reporter_Prefix.pch in Headers */, ABA48A650680BB600089EB4F /* ReporterFilter.h in Headers */, - 71CD3888151B7657008B5E86 /* KBPopUpToolbarItem.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -319,7 +312,6 @@ files = ( ABA48A670680BB690089EB4F /* ReporterFilter.mm in Sources */, 7170F8F6151A010100DC48DF /* Reporter.applescript in Sources */, - 71CD3889151B7657008B5E86 /* KBPopUpToolbarItem.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -411,11 +403,6 @@ buildSettings = { COPY_PHASE_STRIP = NO; DEBUGGING_SYMBOLS = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)\"", - "../../osirix-trunk/build/Development/", - ); GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_TRIGRAPHS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -452,11 +439,6 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)\"", - "../../osirix-trunk/build/Development/", - ); GCC_ENABLE_TRIGRAPHS = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Sources/Reporter_Prefix.pch; @@ -490,6 +472,7 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + FRAMEWORK_SEARCH_PATHS = ../../osirix/build/Development/; MACOSX_DEPLOYMENT_TARGET = 10.7; SDKROOT = macosx10.7; }; @@ -499,6 +482,7 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + FRAMEWORK_SEARCH_PATHS = ../../osirix/build/Development/; MACOSX_DEPLOYMENT_TARGET = 10.7; SDKROOT = macosx10.7; }; @@ -514,6 +498,7 @@ 717FD97016C4E06B00CE8222 /* Deployment */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Development; }; CE6A9A9008AC841300D0C1EE /* Build configuration list for PBXNativeTarget "Reporter" */ = { isa = XCConfigurationList; diff --git a/Reporter/Resources/Info.plist b/Reporter/Resources/Info.plist index 50ba9bd..da5b725 100644 --- a/Reporter/Resources/Info.plist +++ b/Reporter/Resources/Info.plist @@ -15,7 +15,7 @@ CFBundleSignature ???? CFBundleShortVersionString - 1.1.0 + 1.2.1 NSPrincipalClass ReporterFilter MenuTitles diff --git a/Reporter/Resources/Reporter.applescript b/Reporter/Resources/Reporter.applescript index bf26292..50f1cc6 100644 --- a/Reporter/Resources/Reporter.applescript +++ b/Reporter/Resources/Reporter.applescript @@ -25,76 +25,95 @@ on run argv -- insert the image as a text box in a paragraph with style Caption tell front document - -- make sure the Caption style exists -- yes, in english... - try - set sc to paragraph style "Caption" - -- the Caption style often has 0 spacing when unused… fix this, or our insertions will be confusing - if space before of sc is 0 and space after of sc is 0 then - set space before of sc to 5 - set space after of sc to 5 - end if - on error errmsg number errnbr - make new paragraph style with properties {name:"Caption", alignment:center, space before:5, space after:5, keep lines together:true, keep with next paragraph:false, font name:"Helvetica", font size:11, italic:true} - end try - - (* - -- is there already a text box with the current uid for name? - set tb to 0 - if replaceFlag is equal to 1 then - repeat with itb in text boxes - if name of itb as Unicode text is equal to uid as Unicode text then - set tb to itb - exit repeat - end if - end repeat - end if - - if tb is not equal to 0 then - set image data of tb to imageFilePath - else - *) - - -- append a new paragraph that will represent image's caption - set p to make new paragraph at after last paragraph - set text of p to (text of p & caption as Unicode text) -- TODO: it would be great to insert a shift-newline: (text of p & shift-newline & caption as Unicode text) - returns are captured as "next paragraph", we just want a newline - -- insert a text box to include the image. this is the only way Pages.app officially allows us to insert images - make new text box at after p with properties {fill type:plain image, image data:imageFilePath, stroke type:none, extra space:1, placement:moving, name:uid, width:iwidth, height:iheight} - -- apply some styling to the newly created text box (the image) and paragraph - set paragraph style of last paragraph to paragraph style "Caption" + -- is there a replaceable image? + set replaceIndex to 0 + set counter to 0 + repeat with theImage in images + set counter to counter + 1 + if replaceable of theImage is true then + set replaceIndex to counter + exit repeat + end if + end repeat - -- set the text box to take the whole width of teh page, or the caption will show at its right - set width of last text box to "100%" - set nwidth to width of last text box - -- if the image width won't fit, adapt the height - if nwidth < iwidth then - set height of last text box to iheight / iwidth * nwidth - end if - - -- if the image is very vertical, it'll cover an entire page.. leave at least the space for the caption - set nheight to height of last text box - set mheight to height of containing page of last text box - top margin - bottom margin - 0.035277778*2 -- 2 points --- display dialog the "ssfsf " & nheight & " " & mheight - if nheight > mheight then - set pc to page count - repeat while (page count) is equal to pc - set height of last text box to height of last text box - 0.2 - end repeat - --set height of last text box to mheight - end if - - -- if the image is much smaller than the page width, force the caption text to be centered - --if nwidth - iwidth > nwidth / 3 then - set alignment of last paragraph to center -- TODO: do we want to modify the Caption style instead? - --end if + if replaceIndex is not 0 then -- there is a replaceable image object, replace it + + set image data of image replaceIndex to imageFilePath + set replaceable of image replaceIndex to false + + else -- there are no replaceable image objects + + -- make sure the Caption style exists -- yes, in english... + try + set sc to paragraph style "Caption" + -- the Caption style often has 0 spacing when unused… fix this, or our insertions will be confusing + if space before of sc is 0 and space after of sc is 0 then + set space before of sc to 5 + set space after of sc to 5 + end if + on error errmsg number errnbr + make new paragraph style with properties {name:"Caption", alignment:center, space before:5, space after:5, keep lines together:true, keep with next paragraph:false, font name:"Helvetica", font size:11, italic:true} + end try + + (* + -- is there already a text box with the current uid for name? + set tb to 0 + if replaceFlag is equal to 1 then + repeat with itb in text boxes + if name of itb as Unicode text is equal to uid as Unicode text then + set tb to itb + exit repeat + end if + end repeat + end if + + if tb is not equal to 0 then + set image data of tb to imageFilePath + else + *) + + -- append a new paragraph that will represent image's caption + set p to make new paragraph at after last paragraph + set text of p to (text of p & caption as Unicode text) -- TODO: it would be great to insert a shift-newline: (text of p & shift-newline & caption as Unicode text) - returns are captured as "next paragraph", we just want a newline + -- insert a text box to include the image. this is the only way Pages.app officially allows us to insert images + make new text box at after p with properties {fill type:plain image, image data:imageFilePath, stroke type:none, extra space:1, placement:moving, name:uid, width:iwidth, height:iheight} + -- apply some styling to the newly created text box (the image) and paragraph + set paragraph style of last paragraph to paragraph style "Caption" + + -- set the text box to take the whole width of teh page, or the caption will show at its right + set width of last text box to "100%" + set nwidth to width of last text box + -- if the image width won't fit, adapt the height + if nwidth < iwidth then + set height of last text box to iheight / iwidth * nwidth + end if + + -- if the image is very vertical, it'll cover an entire page.. leave at least the space for the caption + set nheight to height of last text box + set mheight to height of containing page of last text box - top margin - bottom margin - 0.035277778*2 -- 2 points + -- display dialog the "ssfsf " & nheight & " " & mheight + if nheight > mheight then + set pc to page count + repeat while (page count) is equal to pc + set height of last text box to height of last text box - 0.2 + end repeat + --set height of last text box to mheight + end if + + -- if the image is much smaller than the page width, force the caption text to be centered + --if nwidth - iwidth > nwidth / 3 then + set alignment of last paragraph to center -- TODO: do we want to modify the Caption style instead? + --end if - -- because of a bug in Pages, we need to re-enter the text box height, or the text box size won't be properly saved - set nheight to height of last text box - set height of last text box to 1 - set height of last text box to nheight - - (* - end if - *) + -- because of a bug in Pages, we need to re-enter the text box height, or the text box size won't be properly saved + set nheight to height of last text box + set height of last text box to 1 + set height of last text box to nheight + + (* + end if + *) + end if end tell end tell end run \ No newline at end of file diff --git a/Reporter/Sources/KBPopUpToolbarItem.m b/Reporter/Sources/KBPopUpToolbarItem.m deleted file mode 100644 index 46817bf..0000000 --- a/Reporter/Sources/KBPopUpToolbarItem.m +++ /dev/null @@ -1,283 +0,0 @@ -// -// KBPopUpToolbarItem.m -// -------------------- -// -// Created by Keith Blount on 14/05/2006. -// Copyright 2006 Keith Blount. All rights reserved. -// - -#import "KBPopUpToolbarItem.h" - -@interface KBDelayedPopUpButtonCell : NSButtonCell -@end - -@implementation KBDelayedPopUpButtonCell - -- (NSPoint)menuPositionForFrame:(NSRect)cellFrame inView:(NSView *)controlView -{ - NSPoint result = [controlView convertPoint:cellFrame.origin toView:nil]; - result.x += 1.0; - result.y -= cellFrame.size.height + 5.5; - return result; -} - -- (void)showMenuForEvent:(NSEvent *)theEvent controlView:(NSView *)controlView cellFrame:(NSRect)cellFrame -{ - NSPoint menuPosition = [self menuPositionForFrame:cellFrame inView:controlView]; - - // Create event for pop up menu with adjusted mouse position - NSEvent *menuEvent = [NSEvent mouseEventWithType:[theEvent type] - location:menuPosition - modifierFlags:[theEvent modifierFlags] - timestamp:[theEvent timestamp] - windowNumber:[theEvent windowNumber] - context:[theEvent context] - eventNumber:[theEvent eventNumber] - clickCount:[theEvent clickCount] - pressure:[theEvent pressure]]; - - [NSMenu popUpContextMenu:[self menu] withEvent:menuEvent forView:controlView]; -} - -- (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView untilMouseUp:(BOOL)untilMouseUp -{ - - BOOL result = NO; - NSDate *endDate; - NSPoint currentPoint = [theEvent locationInWindow]; - BOOL done = NO; - BOOL trackContinously = [self startTrackingAt:currentPoint inView:controlView]; - - // Catch next mouse-dragged or mouse-up event until timeout - BOOL mouseIsUp = NO; - NSEvent *event; - while (!done) - { - NSPoint lastPoint = currentPoint; - - // Set up timer for pop-up menu if we have one - if ([self menu]) - endDate = [NSDate dateWithTimeIntervalSinceNow:0.5]; - else - endDate = [NSDate distantFuture]; - - event = [NSApp nextEventMatchingMask:(NSLeftMouseUpMask|NSLeftMouseDraggedMask) - untilDate:endDate - inMode:NSEventTrackingRunLoopMode - dequeue:YES]; - - if (event) // Mouse event - { - currentPoint = [event locationInWindow]; - - // Send continueTracking.../stopTracking... - if (trackContinously) - { - if (![self continueTracking:lastPoint at:currentPoint inView:controlView]) - { - done = YES; - [self stopTracking:lastPoint at:currentPoint inView:controlView mouseIsUp:mouseIsUp]; - } - if ([self isContinuous]) - { - [NSApp sendAction:[self action] to:[self target] from:controlView]; - } - } - - mouseIsUp = ([event type] == NSLeftMouseUp); - done = done || mouseIsUp; - - if (untilMouseUp) - { - result = mouseIsUp; - } - else - { - // Check if the mouse left our cell rect - result = NSPointInRect([controlView convertPoint:currentPoint fromView:nil], cellFrame); - if (!result) - done = YES; - } - - if (done && result && ![self isContinuous]) - [NSApp sendAction:[self action] to:[self target] from:controlView]; - - } - else // Show menu - { - done = YES; - result = YES; - [self showMenuForEvent:theEvent controlView:controlView cellFrame:cellFrame]; - } - } - return result; -} - -@end - -@interface KBDelayedPopUpButton : NSButton -@end - -@implementation KBDelayedPopUpButton - -- (id)initWithFrame:(NSRect)frameRect -{ - if (self = [super initWithFrame:frameRect]) - { - if (![[self cell] isKindOfClass:[KBDelayedPopUpButtonCell class]]) - { - NSString *title = [self title]; - if (title == nil) title = @""; - [self setCell:[[[KBDelayedPopUpButtonCell alloc] initTextCell:title] autorelease]]; - [[self cell] setControlSize:NSRegularControlSize]; - } - } - return self; -} - -@end - - -@implementation ReporterKBPopUpToolbarItem - -- (id)initWithItemIdentifier:(NSString *)ident -{ - if (self = [super initWithItemIdentifier:ident]) - { - button = [[KBDelayedPopUpButton alloc] initWithFrame:NSMakeRect(0,0,32,32)]; - [button setButtonType:NSMomentaryChangeButton]; - [button setBordered:NO]; - [self setView:button]; - [self setMinSize:NSMakeSize(32,32)]; - [self setMaxSize:NSMakeSize(32,32)]; - } - return self; -} - -// Note that we make no assumptions about the retain/release of the toolbar item's view, just to be sure - -// we therefore retain our button view until we are dealloc'd. -- (void)dealloc -{ - [button release]; - [regularImage release]; - [smallImage release]; - [super dealloc]; -} - -- (KBDelayedPopUpButtonCell *)popupCell -{ - return [(KBDelayedPopUpButton *)[self view] cell]; -} - -- (void)setMenu:(NSMenu *)menu -{ - [[self popupCell] setMenu:menu]; - - // Also set menu form representation - this is used in the toolbar overflow menu but also, more importantly, to display - // a menu in text-only mode. - NSMenuItem *menuFormRep = [[NSMenuItem alloc] initWithTitle:[self label] action:nil keyEquivalent:@""]; - [menuFormRep setSubmenu:menu]; - [self setMenuFormRepresentation:menuFormRep]; - [menuFormRep release]; -} - -- (NSMenu *)menu -{ - return [[self popupCell] menu]; -} - -- (void)setAction:(SEL)aSelector -{ - [[self popupCell] setAction:aSelector]; -} - -- (SEL)action -{ - return [[self popupCell] action]; -} - -- (void)setTarget:(id)anObject -{ - [[self popupCell] setTarget:anObject]; -} - -- (id)target -{ - return [[self popupCell] target]; -} - -- (void)setImage:(NSImage *)anImage -{ - [regularImage autorelease]; - [smallImage autorelease]; - - regularImage = [anImage retain]; - smallImage = [anImage copy]; - [smallImage setScalesWhenResized:YES]; - [smallImage setSize:NSMakeSize(24,24)]; - - if ([[self toolbar] sizeMode] == NSToolbarSizeModeSmall) anImage = smallImage; - - [[self popupCell] setImage:anImage]; -} - -- (NSImage *)image -{ - return [[self popupCell] image]; -} - -- (void)setToolTip:(NSString *)theToolTip -{ - [[self view] setToolTip:theToolTip]; -} - -- (NSString *)toolTip -{ - return [[self view] toolTip]; -} - -- (void)validate -{ - // First, make sure the toolbar image size fits the toolbar size mode; there must be a better place to do this! - NSToolbarSizeMode sizeMode = [[self toolbar] sizeMode]; - float imgWidth = [[self image] size].width; - - if (sizeMode == NSToolbarSizeModeSmall && imgWidth != 24) - { - [[self popupCell] setImage:smallImage]; - } - else if (sizeMode == NSToolbarSizeModeRegular && imgWidth == 24) - { - [[self popupCell] setImage:regularImage]; - } - - if ([self action]) - { - if (![self target]) - [self setEnabled:[[[[self view] window] firstResponder] respondsToSelector:[self action]]]; - - else { - if ([[self target] respondsToSelector:@selector(validateToolbarItem:)]) - [self setEnabled:[[self target] validateToolbarItem:self]]; - else - [self setEnabled:[[self target] respondsToSelector:[self action]]]; - } - } - else - if ([[self toolbar] delegate]) - { - BOOL enabled = YES; - - if ([[[self toolbar] delegate] respondsToSelector:@selector(validateToolbarItem:)]) - enabled = [(id)[[self toolbar] delegate] validateToolbarItem:self]; - - else if ([[[self toolbar] delegate] respondsToSelector:@selector(validateUserInterfaceItem:)]) - enabled = [(id)[[self toolbar] delegate] validateUserInterfaceItem:self]; - - [self setEnabled:enabled]; - } - else - [super validate]; -} - -@end diff --git a/Reporter/Sources/ReporterFilter.mm b/Reporter/Sources/ReporterFilter.mm index 719b025..7d91f75 100644 --- a/Reporter/Sources/ReporterFilter.mm +++ b/Reporter/Sources/ReporterFilter.mm @@ -17,12 +17,12 @@ #import #import #import +#import #import //#import #import #import -#import "KBPopUpToolbarItem.h" @interface ReporterFilter () @@ -234,7 +234,7 @@ -(NSToolbarItem*)_ReporterToolbar:(NSToolbar*)toolbar itemForItemIdentifier:(NSS // static NSString* ReporterIconFilePath = [[[NSBundle bundleForClass:[ReporterFilter class]] pathForImageResource:@"Reporter"] retain]; if ([itemIdentifier isEqualToString:ReporterViewerToolbarItemIdentifier]) { - ReporterKBPopUpToolbarItem* item = [[[ReporterKBPopUpToolbarItem alloc] initWithItemIdentifier:ReporterViewerToolbarItemIdentifier] autorelease]; + KBPopUpToolbarItem* item = [[[KBPopUpToolbarItem alloc] initWithItemIdentifier:ReporterViewerToolbarItemIdentifier] autorelease]; item.label = item.paletteLabel = NSLocalizedString(@"Reporter", @"Name of toolbar item"); item.image = [[[NSImage alloc] initWithContentsOfURL:[[NSBundle bundleForClass:[self class]] URLForResource:@"Reporter" withExtension:@"png"]] autorelease]; [item.image setSize:NSMakeSize(33,33)]; diff --git a/Reporter/html/Reporter.osirixplugin.zip b/Reporter/html/Reporter.osirixplugin.zip index 50d37b1..93a50ac 100644 Binary files a/Reporter/html/Reporter.osirixplugin.zip and b/Reporter/html/Reporter.osirixplugin.zip differ diff --git a/Reporter/html/index.html b/Reporter/html/index.html index 672f6a3..4d92d7d 100644 --- a/Reporter/html/index.html +++ b/Reporter/html/index.html @@ -19,6 +19,10 @@

Reporter

Hold the toolbar button to list all the available features. +
+

Version History

+
+ Versions 1.2.1 inserts images in existing replaceable image objects (available in the template) before adding them at the end of the document, the old way.
Versions 1.1 allows you to include the study date in the images' captions. diff --git a/Reporter/html/style.css b/Reporter/html/style.css index 0b546ad..8d357d8 100644 --- a/Reporter/html/style.css +++ b/Reporter/html/style.css @@ -34,6 +34,11 @@ h1 { margin-top: 40px; } +h2 { + margin-left: 20px; + margin-top: 20px; +} + .text { margin: 5px 20px 5px 20px; } diff --git a/KiOP/Plugin/English.lproj/InfoPlist.strings b/SandBox/English.lproj/InfoPlist.strings similarity index 100% rename from KiOP/Plugin/English.lproj/InfoPlist.strings rename to SandBox/English.lproj/InfoPlist.strings diff --git a/SandBox/English.lproj/S_BurnViewer.xib b/SandBox/English.lproj/S_BurnViewer.xib new file mode 100644 index 0000000..af5b982 --- /dev/null +++ b/SandBox/English.lproj/S_BurnViewer.xib @@ -0,0 +1,2257 @@ + + + + 1080 + 12D78 + 3084 + 1187.37 + 626.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 3084 + + + NSButton + NSButtonCell + NSCustomObject + NSMatrix + NSMenu + NSMenuItem + NSPopUpButton + NSPopUpButtonCell + NSTextField + NSTextFieldCell + NSUserDefaultsController + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + BurnerWindowController + + + FirstResponder + + + NSApplication + + + 7 + 2 + {{0, 0}, {506, 408}} + 544735232 + SandBox + NSWindow + + View + + + {213, 107} + + + 256 + + + + 264 + {{17, 366}, {94, 20}} + + + + YES + + 67108864 + 71303168 + Name: + + LucidaGrande + 13 + 1044 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + NO + + + + 266 + {{116, 366}, {362, 22}} + + + + YES + + -1804599231 + 1024 + DICOMCD + + + YES + 1 + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + NO + + + + 258 + {{259, -65}, {135, 14}} + + + + YES + + 67108864 + 4194304 + + + LucidaGrande + 11 + 3100 + + + + + + NO + + + + 257 + {{435, 245}, {44, 46}} + + + + YES + + 67108864 + 134217728 + Burn + + + 138690560 + 32 + + NSImage + burn_iris01 + + + DQ + 200 + 25 + + NO + + + + 256 + {{114, 231}, {316, 58}} + + + + YES + NO + 3 + 1 + + + -2080374784 + 0 + Don't modify the files + + + 1211912448 + 0 + + NSRadioButton + + + + 400 + 75 + + + 67108864 + 0 + Compress all DICOM files in JPEG + + + 1 + 1211912448 + 0 + + + + + + 200 + 25 + + + 67108864 + 0 + Decompress all DICOM files + + + 2 + 1211912448 + 0 + + + + 200 + 25 + + + {316, 18} + {4, 2} + 1143472128 + NSActionCell + + 67108864 + 0 + Radio + + 1211912448 + 0 + + 549453824 + {18, 18} + + + + + + TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw +IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/ +29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5 +dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA +AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG +AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/ +0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/ +7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/ +5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/ +3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD +AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns +AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/ +6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/ +/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/ +///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl +YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA +AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD +AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu +AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQEAAAMAAAABABIAAAEB +AAMAAAABABIAAAECAAMAAAAEAAAFugEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES +AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS +AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA + + + + + + 3 + MCAwAA + + + + 400 + 75 + + + + + + + + + 256 + {{114, 165}, {316, 58}} + + + + YES + NO + 3 + 1 + + + 67108864 + 0 + CD/DVD Media + + + 1211912448 + 0 + + + + 400 + 75 + + + -2080374784 + 0 + Save as DMG file + + + 2 + 1211912448 + 0 + + + + + + 200 + 25 + + + 67108864 + 0 + USB Key: + + + 1 + 1211912448 + 0 + + + + 200 + 25 + + + {316, 18} + {4, 2} + 1143472128 + NSActionCell + + 67108864 + 0 + Save as DMG file + + 2 + 1211912448 + 0 + + + + + + 200 + 25 + + + + + + + + + 256 + {{-3, 272}, {114, 17}} + + + + YES + + 67108864 + 71303168 + Compression: + + + + + + NO + + + + 256 + {{-3, 206}, {114, 17}} + + + + YES + + 67108864 + 71303168 + Destination: + + + + + + NO + + + + 256 + {{113, 349}, {350, 14}} + + + + YES + + 67108864 + 138412032 + aaa + + + + + + NO + + + + 256 + {{113, 331}, {350, 14}} + + + + YES + + 67108864 + 138412032 + + + + + + + NO + + + + 256 + {{-3, 297}, {114, 17}} + + + + YES + + 67108864 + 71303168 + Anonymize: + + + + + + NO + + + + 256 + {{114, 296}, {357, 18}} + + + + YES + + -2080374784 + 0 + Anonymize the DICOM files before burning + + + 1211912448 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + NO + + + + 256 + {{-3, 140}, {114, 17}} + + + + YES + + 67108864 + 71303168 + Misc: + + + + + + NO + + + + 256 + {{114, 139}, {374, 18}} + + + + YES + + 67108864 + 0 + Include Weasis viewer (multi-platform, about 17MB) + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 256 + {{114, 119}, {374, 18}} + + + + YES + + 67108864 + 0 + Include OsiriX Lite viewer (mac only, about 8MB) + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 256 + {{114, 99}, {366, 18}} + + + + YES + + 67108864 + 0 + Copy an html/Quicktime version of the images + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 256 + {{114, 59}, {366, 18}} + + + + YES + + 67108864 + 0 + Encrypt Data in ZIP file, password protected + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 256 + {{114, 37}, {366, 18}} + + + + YES + + 67108864 + 0 + Copy the auxiliary folder (see CD/DVD Preferences) : + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 256 + {{113, 20}, {348, 11}} + + + + YES + + 67108864 + 138412032 + Mini System Font Text + + LucidaGrande + 9 + 3614 + + + + + + NO + + + + 256 + {{114, 79}, {366, 18}} + + + + YES + + 67108864 + 0 + Copy the associated Report(s), if available + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 268 + {{241, 162}, {170, 26}} + + + + _NS:9 + YES + + -2076180416 + 2048 + + _NS:9 + + 109199360 + 129 + + + 400 + 75 + + + Item 1 + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + YES + + OtherViews + + + + + Item 2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item 3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + 1 + YES + YES + 2 + + NO + + + {506, 408} + + + + + {{0, 0}, {1440, 878}} + {213, 129} + {10000000000000, 10000000000000} + YES + + + YES + + + 1 + 2 + {{157, 361}, {373, 100}} + 880279552 + Window + NSWindow + + + + + 256 + + + + 268 + {{116, 58}, {237, 22}} + + YES + + -1804599231 + 272630784 + + + + YES + + + + NO + + + + 256 + {{165, 7}, {97, 32}} + + YES + + 67108864 + 134217728 + Cancel + + + -2038284288 + 1 + + + Gw + 200 + 25 + + NO + + + + 256 + {{262, 7}, {97, 32}} + + YES + + 67108864 + 134217728 + OK + + + -2038284288 + 1 + + + DQ + 200 + 25 + + NO + + + + 268 + {{-3, 60}, {114, 17}} + + YES + + 68157504 + 71304192 + Password: + + + + + + NO + + + + 268 + {{113, 42}, {239, 14}} + + YES + + 68157504 + 138544128 + (8 or more characters) + + + + + + NO + + + {373, 100} + + + {{0, 0}, {1440, 878}} + {10000000000000, 10000000000000} + YES + + + + + + + nameField + + + + 16 + + + + burnButton + + + + 19 + + + + burn: + + + + 23 + + + + setCDName: + + + + 24 + + + + compressionMode + + + + 30 + + + + window + + + + 31 + + + + sizeField + + + + 33 + + + + finalSizeField + + + + 35 + + + + setAnonymizedCheck: + + + + 42 + + + + anonymizedCheckButton + + + + 44 + + + + estimateFolderSize: + + + + 78 + + + + estimateFolderSize: + + + + 79 + + + + cancel: + + + + 109 + + + + ok: + + + + 110 + + + + passwordWindow + + + + 111 + + + + estimateFolderSize: + + + + 150 + + + + enabled: buttonsDisabled + + + + + + enabled: buttonsDisabled + enabled + buttonsDisabled + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 131 + + + + enabled: buttonsDisabled + + + + + + enabled: buttonsDisabled + enabled + buttonsDisabled + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 133 + + + + value: values.anonymizedBeforeBurning + + + + + + value: values.anonymizedBeforeBurning + value + values.anonymizedBeforeBurning + 2 + + + 40 + + + + enabled: buttonsDisabled + + + + + + enabled: buttonsDisabled + enabled + buttonsDisabled + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 132 + + + + enabled: buttonsDisabled + + + + + + enabled: buttonsDisabled + enabled + buttonsDisabled + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 134 + + + + value: values.BurnWeasis + + + + + + value: values.BurnWeasis + value + values.BurnWeasis + 2 + + + 151 + + + + value: values.BurnHtml + + + + + + value: values.BurnHtml + value + values.BurnHtml + 2 + + + 80 + + + + enabled: buttonsDisabled + + + + + + enabled: buttonsDisabled + enabled + buttonsDisabled + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 135 + + + + hidden: values.anonymizedBeforeBurning + + + + + + hidden: values.anonymizedBeforeBurning + hidden + values.anonymizedBeforeBurning + + 2 + + + 136 + + + + value: values.BurnSupplementaryFolder + + + + + + value: values.BurnSupplementaryFolder + value + values.BurnSupplementaryFolder + 2 + + + 82 + + + + enabled: values.SupplementaryBurnPath + + + + + + enabled: values.SupplementaryBurnPath + enabled + values.SupplementaryBurnPath + + NSValueTransformerName + NSIsNotNil + + 2 + + + 119 + + + + enabled2: buttonsDisabled + + + + + + enabled2: buttonsDisabled + enabled2 + buttonsDisabled + + + + + + NSNegateBoolean + + + 2 + + + 141 + + + + value: values.SupplementaryBurnPath + + + + + + value: values.SupplementaryBurnPath + value + values.SupplementaryBurnPath + 2 + + + 117 + + + + value: values.copyReportsToCD + + + + + + value: values.copyReportsToCD + value + values.copyReportsToCD + 2 + + + 76 + + + + enabled: buttonsDisabled + + + + + + enabled: buttonsDisabled + enabled + buttonsDisabled + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 137 + + + + hidden: values.anonymizedBeforeBurning + + + + + + hidden: values.anonymizedBeforeBurning + hidden + values.anonymizedBeforeBurning + + 2 + + + 138 + + + + value: values.EncryptCD + + + + + + value: values.EncryptCD + value + values.EncryptCD + 2 + + + 94 + + + + enabled: buttonsDisabled + + + + + + enabled: buttonsDisabled + enabled + buttonsDisabled + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 139 + + + + enabled2: values.hasMacOSXSnowLeopard + + + + + + enabled2: values.hasMacOSXSnowLeopard + enabled2 + values.hasMacOSXSnowLeopard + + + + + + + + 2 + + + 145 + + + + value: password + + + + + + value: password + value + password + 2 + + + 142 + + + + value: values.BurnOsirixApplication + + + + + + value: values.BurnOsirixApplication + value + values.BurnOsirixApplication + 2 + + + 148 + + + + enabled: buttonsDisabled + + + + + + enabled: buttonsDisabled + enabled + buttonsDisabled + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 149 + + + + enabled: buttonsDisabled + + + + + + enabled: buttonsDisabled + enabled + buttonsDisabled + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 164 + + + + selectedTag: values.burnDestination + + + + + + selectedTag: values.burnDestination + selectedTag + values.burnDestination + 2 + + + 165 + + + + enabled: self.volumes.@count + + + + + + enabled: self.volumes.@count + enabled + self.volumes.@count + 2 + + + 178 + + + + contentValues: self.volumes + + + + + + contentValues: self.volumes + contentValues + self.volumes + 2 + + + 176 + + + + enabled: self.buttonsDisabled + + + + + + enabled: self.buttonsDisabled + enabled + self.buttonsDisabled + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 181 + + + + selectedIndex: self.selectedUSB + + + + + + selectedIndex: self.selectedUSB + selectedIndex + self.selectedUSB + + 2 + + + 182 + + + + enabled2: self.volumes.@count + + + + + + enabled2: self.volumes.@count + enabled2 + self.volumes.@count + + + + + + + + 2 + + + 184 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 6 + + + + + + Window + + + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 9 + + + + + + + + 10 + + + + + + + + 13 + + + + + + + + 14 + + + + + + + + 25 + + + + + + + + + + + 26 + + + + + 27 + + + + + 28 + + + + + 29 + + + + + + + + 32 + + + + + + + + 34 + + + + + + + + 36 + + + + + + + + 37 + + + + + + + + 45 + + + + + + + + 46 + + + + + + + + 47 + + + + + + + + 48 + + + + + + + + 49 + + + + + + + + 38 + + + Shared Defaults + + + 58 + + + + + 59 + + + + + 60 + + + + + 61 + + + + + 62 + + + + + 63 + + + + + 64 + + + + + 65 + + + + + 66 + + + + + 67 + + + + + 68 + + + + + 69 + + + + + 70 + + + + + 71 + + + + + 72 + + + + + -3 + + + Application + + + 73 + + + + + + + + 74 + + + + + 90 + + + + + + + + 91 + + + + + 95 + + + + + + Encrypt + + + 96 + + + + + + + + + + + + 101 + + + + + + + + 102 + + + + + 103 + + + + + + + + 104 + + + + + + + + 105 + + + + + 106 + + + + + 107 + + + + + + + + 108 + + + + + 143 + + + + + + + + 144 + + + + + 146 + + + + + + + + 147 + + + + + 157 + + + + + + + + 158 + + + + + 159 + + + + + + + + + + + 161 + + + + + 162 + + + + + 163 + + + + + 169 + + + + + 170 + + + + + + + + 171 + + + + + + + + 172 + + + + + + + + + + 173 + + + + + 174 + + + + + 175 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + {{613, 684}, {498, 350}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{312, 745}, {373, 100}} + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 184 + + + + + BurnerWindowController + NSWindowController + + id + id + id + id + id + id + + + + burn: + id + + + cancel: + id + + + estimateFolderSize: + id + + + ok: + id + + + setAnonymizedCheck: + id + + + setCDName: + id + + + + NSButton + NSButton + NSMatrix + NSTextField + NSTextField + NSWindow + NSTextField + + + + anonymizedCheckButton + NSButton + + + burnButton + NSButton + + + compressionMode + NSMatrix + + + finalSizeField + NSTextField + + + nameField + NSTextField + + + passwordWindow + NSWindow + + + sizeField + NSTextField + + + + IBProjectSource + ./Classes/BurnerWindowController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + {11, 11} + {10, 3} + {15, 15} + {39, 39} + + + diff --git a/SandBox/English.lproj/locversion.plist b/SandBox/English.lproj/locversion.plist new file mode 100644 index 0000000..c56e3cf --- /dev/null +++ b/SandBox/English.lproj/locversion.plist @@ -0,0 +1,14 @@ + + + + + LprojCompatibleVersion + 220.2 + LprojLocale + en + LprojRevisionLevel + 1 + LprojVersion + 307 + + diff --git a/KiOP/Plugin/Info.plist b/SandBox/Info.plist similarity index 71% rename from KiOP/Plugin/Info.plist rename to SandBox/Info.plist index 5af733a..7daf77c 100644 --- a/KiOP/Plugin/Info.plist +++ b/SandBox/Info.plist @@ -1,11 +1,11 @@ - + CFBundleDevelopmentRegion English CFBundleExecutable - KiOP + SandBox CFBundleIconFile CFBundleInfoDictionaryVersion @@ -16,13 +16,13 @@ ???? CFBundleVersion 1.0 - NSPrincipalClass - KiOPFilter MenuTitles - KiOP + SandBox + NSPrincipalClass + SandBoxFilter pluginType - imageFilter + Database diff --git a/SandBox/S_BurnerWindowController.h b/SandBox/S_BurnerWindowController.h new file mode 100644 index 0000000..30c817d --- /dev/null +++ b/SandBox/S_BurnerWindowController.h @@ -0,0 +1,86 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import + +enum burnerDestination +{ + CDDVD = 0, + USBKey = 1, + DMGFile = 2 +}; + +@class DRTrack; +@class DicomDatabase; + +/** \brief Window Controller for DICOM disk burning */ +@interface S_BurnerWindowController : NSWindowController +{ + volatile BOOL burning; + NSMutableArray *files, *anonymizedFiles, *dbObjectsID, *originalDbObjectsID; + float burnSize; + IBOutlet NSTextField *nameField; + IBOutlet NSTextField *sizeField, *finalSizeField; + IBOutlet NSMatrix *compressionMode; + IBOutlet NSButton *burnButton; + IBOutlet NSButton *anonymizedCheckButton; + NSString *cdName; + NSTimer *burnAnimationTimer; + volatile BOOL runBurnAnimation, isExtracting, isSettingUpBurn, isThrobbing, windowWillClose; + NSArray *filesToBurn; + BOOL _multiplePatients; + BOOL cancelled; + NSString *writeDMGPath, *writeVolumePath; + NSUInteger selectedUSB; + NSArray *anonymizationTags; + int sizeInMb; + NSString *password; + IBOutlet NSWindow *passwordWindow; + + BOOL buttonsDisabled; + BOOL burnSuppFolder, burnOsiriX, burnHtml, burnWeasis; + + int burnAnimationIndex; + int irisAnimationIndex; + NSTimer *irisAnimationTimer; +} + +@property BOOL buttonsDisabled; +@property NSUInteger selectedUSB; +@property (retain) NSString *password; + +- (NSArray*) volumes; +- (IBAction) ok:(id)sender; +- (IBAction) cancel:(id)sender; +- (IBAction) setAnonymizedCheck: (id) sender; +- (id) initWithFiles:(NSArray *)theFiles; +- (id)initWithFiles:(NSArray *)theFiles managedObjects:(NSArray *)managedObjects; +- (IBAction)burn:(id)sender; +- (void)setCDTitle: (NSString *)title; +//- (IBAction)setCDName:(id)sender; +- (NSString *)folderToBurn; +//- (void)setFilesToBurn:(NSArray *)theFiles; +- (void)burnCD:(id)object; +- (NSArray *)extractFileNames:(NSArray *)filenames; +- (BOOL)dicomCheck:(NSString *)filename; +- (void)importFiles:(NSArray *)fileNames; +- (void)setup:(id)sender; +- (void) prepareCDContent: (NSMutableArray*) dbObjects :(NSMutableArray*) originalDbObjects; +- (IBAction)estimateFolderSize:(id)object; +- (void)performBurn:(id)object; +- (void)irisAnimation:(NSTimer*)object; +- (NSNumber*)getSizeOfDirectory:(NSString*)path; +- (NSString*) defaultTitle; +- (void)saveOnVolume; +@end diff --git a/SandBox/S_BurnerWindowController.m b/SandBox/S_BurnerWindowController.m new file mode 100644 index 0000000..015efd8 --- /dev/null +++ b/SandBox/S_BurnerWindowController.m @@ -0,0 +1,1070 @@ +/*========================================================================= + Program: OsiriX + + Copyright (c) OsiriX Team + All rights reserved. + Distributed under GNU - LGPL + + See http://www.osirix-viewer.com/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. +=========================================================================*/ + +#import "AppController.h" +#import "WaitRendering.h" +#import "S_BurnerWindowController.h" +#import +#import "MutableArrayCategory.h" +#import +#import +#import +#import "BrowserController.h" +#import "DicomStudy.h" +#import "DicomSeries.h" +#import "DicomImage.h" +#import "DicomStudy+Report.h" +#import "Anonymization.h" +#import "AnonymizationPanelController.h" +#import "AnonymizationViewController.h" +#import "ThreadsManager.h" +#import "NSThread+N2.h" +#import "NSFileManager+N2.h" +#import "N2Debug.h" +#import "NSImage+N2.h" +#import "DicomDir.h" +#import "DicomDatabase.h" +#import + +#import "XMLGenerator.h" + + + + + + + + +@interface NSImage(saveAsJpegWithName) +- (void) saveAsJpegWithName:(NSString*) fileName; +@end + +@implementation NSImage(saveAsJpegWithName) + +- (void) saveAsJpegWithName:(NSString*) fileName +{ + // Cache the reduced image + NSData *imageData = [self TIFFRepresentation]; + NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:imageData]; + NSDictionary *imageProps = [NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:1.0] forKey:NSImageCompressionFactor]; + imageData = [imageRep representationUsingType:NSJPEGFileType properties:imageProps]; + [imageData writeToFile:fileName atomically:NO]; +} + +@end + + + + + + + + + + +@implementation S_BurnerWindowController + +@synthesize password, buttonsDisabled, selectedUSB; + + + +- (NSArray*) volumes +{ + NSArray *removeableMedia = [[NSWorkspace sharedWorkspace] mountedRemovableMedia]; + NSMutableArray *array = [NSMutableArray array]; + + for( NSString *mediaPath in removeableMedia) + { + BOOL isWritable, isUnmountable, isRemovable, hasDICOMDIR = NO; + NSString *description, *type; + + [[NSWorkspace sharedWorkspace] getFileSystemInfoForPath: mediaPath isRemovable:&isRemovable isWritable:&isWritable isUnmountable:&isUnmountable description:&description type:&type]; + + if( isRemovable && isWritable && isUnmountable) + [array addObject: mediaPath]; + } + + return array; +} + +- (IBAction) ok:(id)sender +{ + [NSApp stopModal]; +} + +- (IBAction) cancel:(id)sender +{ + [NSApp abortModal]; +} + + +- (void) createDMG:(NSString*) imagePath withSource:(NSString*) directoryPath +{ + [[NSFileManager defaultManager] removeFileAtPath:imagePath handler:nil]; + + NSTask* makeImageTask = [[[NSTask alloc] init] autorelease]; + + [makeImageTask setLaunchPath: @"/bin/sh"]; + + imagePath = [imagePath stringByReplacingOccurrencesOfString: @"\"" withString: @"\\\""]; + directoryPath = [directoryPath stringByReplacingOccurrencesOfString: @"\"" withString: @"\\\""]; + + NSString* cmdString = [NSString stringWithFormat: @"hdiutil create \"%@\" -srcfolder \"%@\"", + imagePath, + directoryPath]; + + NSArray *args = [NSArray arrayWithObjects: @"-c", cmdString, nil]; + + [makeImageTask setArguments:args]; + [makeImageTask launch]; + while( [makeImageTask isRunning]) + [NSThread sleepForTimeInterval: 0.1]; + + //[aTask waitUntilExit]; // <- This is VERY DANGEROUS : the main runloop is continuing... +} + + +-(id) initWithFiles:(NSArray *)theFiles +{ + if( self = [super initWithWindowNibName:@"S_BurnViewer"]) + { + [[NSFileManager defaultManager] removeFileAtPath:[self folderToBurn] handler:nil]; + + files = [theFiles mutableCopy]; + burning = NO; + + [[self window] center]; + + NSLog( @"Burner allocated"); + } + return self; +} + +- (id)initWithFiles:(NSArray *)theFiles managedObjects:(NSArray *)managedObjects +{ + if( self = [super initWithWindowNibName:@"S_BurnViewer"]) + { + [[NSFileManager defaultManager] removeFileAtPath:[self folderToBurn] handler:nil]; + + files = [theFiles mutableCopy]; // file paths + dbObjectsID = [managedObjects mutableCopy]; // DicomImage + originalDbObjectsID = [dbObjectsID mutableCopy]; + + + + + + DicomImage *im = [dbObjectsID lastObject]; + + NSImage *image = [im thumbnail]; + + DicomSeries *series = [im series]; + + NSData *imageSeries = [series thumbnail]; + + NSData *tiffData = [image TIFFRepresentation]; + + + + + + + + [files removeDuplicatedStringsInSyncWithThisArray: dbObjectsID]; + + id managedObject; + id patient = nil; + _multiplePatients = NO; + + for (managedObject in [[[BrowserController currentBrowser] database] objectsWithIDs: dbObjectsID]) + { + NSString *newPatient = [managedObject valueForKeyPath:@"series.study.patientUID"]; + + if( patient == nil) + patient = newPatient; + else if( [patient compare: newPatient options: NSCaseInsensitiveSearch | NSDiacriticInsensitiveSearch | NSWidthInsensitiveSearch] != NSOrderedSame) + { + _multiplePatients = YES; + break; + } + patient = newPatient; + } + + burning = NO; + + [[self window] center]; + + [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(_observeVolumeNotification:) name:NSWorkspaceDidMountNotification object:nil]; + [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(_observeVolumeNotification:) name:NSWorkspaceDidUnmountNotification object:nil]; + [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(_observeVolumeNotification:) name:NSWorkspaceDidRenameVolumeNotification object:nil]; + + NSLog( @"Burner allocated"); + } + return self; +} + +- (void)_observeVolumeNotification:(NSNotification*)notification +{ + [self willChangeValueForKey: @"volumes"]; + [self didChangeValueForKey:@"volumes"]; +} + +- (void)windowDidLoad +{ + NSLog(@"BurnViewer did load"); + + [[self window] setDelegate:self]; + [self setup:nil]; + + [compressionMode selectCellWithTag: [[NSUserDefaults standardUserDefaults] integerForKey: @"Compression Mode for Burning"]]; +} + +- (void)dealloc +{ + windowWillClose = YES; + + runBurnAnimation = NO; + + [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self]; + + [anonymizedFiles release]; + [filesToBurn release]; + [dbObjectsID release]; + [originalDbObjectsID release]; + [cdName release]; + [password release]; + [writeDMGPath release]; + [writeVolumePath release]; + [anonymizationTags release]; + [files release]; + + NSLog(@"Burner dealloc"); + [super dealloc]; +} + + +//------------------------------------------------------------------------------------------------------------------------------------ +#pragma mark• + +- (NSArray *)filesToBurn +{ + return filesToBurn; +} + +//- (void)setFilesToBurn:(NSArray *)theFiles +//{ +// [filesToBurn release]; +// filesToBurn = [theFiles retain]; +//} + +- (NSArray *)extractFileNames:(NSArray *)filenames +{ + NSString *pname; + NSString *fname; + NSString *pathName; + BOOL isDir; + + NSMutableArray *fileNames = [[[NSMutableArray alloc] init] autorelease]; + //NSLog(@"Extract"); + for (fname in filenames) + { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + //NSLog(@"fname %@", fname); + NSFileManager *manager = [NSFileManager defaultManager]; + if( [manager fileExistsAtPath:fname isDirectory:&isDir] && isDir) + { + NSDirectoryEnumerator *direnum = [manager enumeratorAtPath:fname]; + //Loop Through directories + while (pname = [direnum nextObject]) + { + pathName = [fname stringByAppendingPathComponent:pname]; //make pathanme + if( [manager fileExistsAtPath:pathName isDirectory:&isDir] && !isDir) + { //check for directory + if( [DCMObject objectWithContentsOfFile:pathName decodingPixelData:NO]) + { + [fileNames addObject:pathName]; + } + } + } //while pname + + } //if + //else if( [dicomDecoder dicomCheckForFile:fname] > 0) { + else if( [DCMObject objectWithContentsOfFile:fname decodingPixelData:NO]) { //Pathname + [fileNames addObject:fname]; + } + [pool release]; + } //while + return fileNames; +} + +//Actions +-(IBAction) burn: (id)sender +{ + if( !(isExtracting || isSettingUpBurn || burning)) + { + cancelled = NO; + + [sizeField setStringValue: @""]; + + [cdName release]; + cdName = [[nameField stringValue] retain]; + + if( [cdName length] <= 0) + { + [cdName release]; + cdName = [@"UNTITLED" retain]; + } + + [[NSFileManager defaultManager] removeFileAtPath:[self folderToBurn] handler:nil]; + [[NSFileManager defaultManager] removeFileAtPath:[NSString stringWithFormat:@"/tmp/burnAnonymized"] handler:nil]; + + [writeVolumePath release]; + writeVolumePath = nil; + + [writeDMGPath release]; + writeDMGPath = nil; + + [anonymizationTags release]; + anonymizationTags = nil; + + if( [[NSUserDefaults standardUserDefaults] boolForKey:@"anonymizedBeforeBurning"]) + { + AnonymizationPanelController* panelController = [Anonymization showPanelForDefaultsKey:@"AnonymizationFields" modalForWindow:self.window modalDelegate:NULL didEndSelector:NULL representedObject:NULL]; + + if( panelController.end == AnonymizationPanelCancel) + return; + + anonymizationTags = [panelController.anonymizationViewController.tagsValues retain]; + } + else + { + [anonymizedFiles release]; + anonymizedFiles = nil; + } + + self.buttonsDisabled = YES; + + @try + { + if( cdName != nil && [cdName length] > 0) + { + runBurnAnimation = YES; + + if( [[NSUserDefaults standardUserDefaults] integerForKey: @"burnDestination"] == USBKey) + { + [writeVolumePath release]; + writeVolumePath = nil; + if( selectedUSB != NSNotFound && selectedUSB < [self volumes].count) + writeVolumePath = [[[self volumes] objectAtIndex: selectedUSB] retain]; + + if( writeVolumePath == nil) + { + NSInteger result = NSRunCriticalAlertPanel( NSLocalizedString( @"USB Writing", nil), NSLocalizedString( @"No destination selected.", nil), NSLocalizedString( @"OK", nil), nil, nil); + + self.buttonsDisabled = NO; + runBurnAnimation = NO; + burning = NO; + return; + } + + NSInteger result = NSRunCriticalAlertPanel( NSLocalizedString( @"USB Writing", nil), NSLocalizedString( @"The ENTIRE content of the selected media (%@) will be deleted, before writing the new data. Do you confirm?", nil), NSLocalizedString( @"OK", nil), NSLocalizedString( @"Cancel", nil), nil, writeVolumePath, nil); + + if( result != NSAlertDefaultReturn) + { + self.buttonsDisabled = NO; + runBurnAnimation = NO; + burning = NO; + return; + } + + [[BrowserController currentBrowser] removePathFromSources: writeVolumePath]; + } + + if( [[NSUserDefaults standardUserDefaults] integerForKey: @"burnDestination"] == DMGFile) + { + NSSavePanel *savePanel = [NSSavePanel savePanel]; + [savePanel setCanSelectHiddenExtension:YES]; + [savePanel setRequiredFileType:@"dmg"]; + [savePanel setTitle:@"Save as DMG"]; + + if( [savePanel runModalForDirectory:nil file: cdName] == NSFileHandlingPanelOKButton) + { + [writeDMGPath release]; + writeDMGPath = [[[savePanel URL] path] retain]; + [[NSFileManager defaultManager] removeItemAtPath: writeDMGPath error: nil]; + } + else + { + self.buttonsDisabled = NO; + runBurnAnimation = NO; + burning = NO; + return; + } + } + + self.password = @""; + + if( [[NSUserDefaults standardUserDefaults] boolForKey: @"EncryptCD"]) + { + int result = 0; + do + { + [NSApp beginSheet: passwordWindow + modalForWindow: self.window + modalDelegate: nil + didEndSelector: nil + contextInfo: nil]; + + result = [NSApp runModalForWindow: passwordWindow]; + [passwordWindow makeFirstResponder: nil]; + + [NSApp endSheet: passwordWindow]; + [passwordWindow orderOut: self]; + } + while( [self.password length] < 8 && result == NSRunStoppedResponse); + + if( result == NSRunStoppedResponse) + { + + } + else + { + self.buttonsDisabled = NO; + runBurnAnimation = NO; + burning = NO; + return; + } + } + + NSThread* t = [[[NSThread alloc] initWithTarget:self selector:@selector(performBurn:) object: nil] autorelease]; + t.name = NSLocalizedString( @"Burning...", nil); + [[ThreadsManager defaultManager] addThreadAndStart: t]; + } + else + { + NSBeginAlertSheet( NSLocalizedString( @"Burn Warning", nil) , NSLocalizedString( @"OK", nil), nil, nil, nil, nil, nil, nil, nil, NSLocalizedString( @"Please add CD name", nil)); + + self.buttonsDisabled = NO; + runBurnAnimation = NO; + burning = NO; + return; + } + } + @catch (NSException *exception) + { + NSLog( @"*** exception: %@", exception); + } + } +} + +- (void)performBurn: (id) object +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + DicomDatabase *idatabase = [[[[BrowserController currentBrowser] database] independentDatabase] retain]; + + NSMutableArray *dbObjects = [[[idatabase objectsWithIDs: dbObjectsID] mutableCopy] autorelease]; + NSMutableArray *originalDbObjects = [[[idatabase objectsWithIDs: originalDbObjectsID] mutableCopy] autorelease]; + + @try + { + isSettingUpBurn = YES; + + if( anonymizationTags) + { + NSDictionary* anonOut = [Anonymization anonymizeFiles:files dicomImages: dbObjects toPath:@"/tmp/burnAnonymized" withTags: anonymizationTags]; + + [anonymizedFiles release]; + anonymizedFiles = [[anonOut allValues] mutableCopy]; + } + + [self prepareCDContent: dbObjects :originalDbObjects]; + + isSettingUpBurn = NO; + + int no = 0; + + if( anonymizedFiles) no = [anonymizedFiles count]; + else no = [files count]; + + burning = YES; + + if( [[NSFileManager defaultManager] fileExistsAtPath: [self folderToBurn]] && cancelled == NO) + { + if( no) + { + switch( [[NSUserDefaults standardUserDefaults] integerForKey: @"burnDestination"]) + { + case DMGFile: + [self createDMG: writeDMGPath withSource:[self folderToBurn]]; + break; + + case CDDVD: + [self performSelectorOnMainThread:@selector(burnCD:) withObject:nil waitUntilDone:NO]; + return; + break; + + case USBKey: + [self saveOnVolume]; + break; + } + } + } + + self.buttonsDisabled = NO; + runBurnAnimation = NO; + burning = NO; + + if( cancelled == NO) + { + // Finished ! Close the window.... + + [[NSSound soundNamed: @"Glass.aiff"] play]; + [self.window performSelectorOnMainThread: @selector(performClose:) withObject: self waitUntilDone: NO]; + } + } + @catch (NSException *exception) + { + NSLog( @"*** exception: %@", exception); + } + @finally + { + [pool release]; + } +} + +- (IBAction) setAnonymizedCheck: (id) sender +{ + if( [anonymizedCheckButton state] == NSOnState) + { + if( [[nameField stringValue] isEqualToString: [self defaultTitle]]) + { + NSDate *date = [NSDate date]; + [self setCDTitle: [NSString stringWithFormat:@"Archive-%@", [date descriptionWithCalendarFormat:@"%Y%m%d" timeZone:nil locale:nil]]]; + } + } +} + +- (void)setCDTitle: (NSString *)title +{ + if( title) + { + [cdName release]; + //if( [title length] > 8) + // title = [title substringToIndex:8]; + cdName = [[[title uppercaseString] filenameString] retain]; + [nameField setStringValue: cdName]; + } +} + +//-(IBAction)setCDName:(id)sender +//{ +// NSString *name = [[nameField stringValue] uppercaseString]; +// [self setCDTitle:name]; +//} + +-(NSString *)folderToBurn +{ + return [NSString stringWithFormat:@"/tmp/%@",cdName]; +} + +- (void) saveOnVolume +{ + NSLog( @"Erase volume : %@", writeVolumePath); + + for( NSString *path in [[NSFileManager defaultManager] contentsOfDirectoryAtPath: writeVolumePath error: nil]) + [[NSFileManager defaultManager] removeItemAtPath: [writeVolumePath stringByAppendingPathComponent: path] error: nil]; + + + [[NSFileManager defaultManager] copyItemAtPath: [self folderToBurn] toPath: writeVolumePath byReplacingExisting: YES error: nil]; + + NSString *newName = cdName; + + NSTask *t = [NSTask launchedTaskWithLaunchPath: @"/usr/sbin/diskutil" arguments: [NSArray arrayWithObjects: @"rename", writeVolumePath, newName, nil]]; + + while( [t isRunning]) + [NSThread sleepForTimeInterval: 0.1]; + + //[aTask waitUntilExit]; // <- This is VERY DANGEROUS : the main runloop is continuing... + + [NSThread sleepForTimeInterval: 1]; + + //Did we succeed? Basic MS-DOS FAT support only CAPITAL letters and maximum of 10 characters... + if( [[NSFileManager defaultManager] fileExistsAtPath: [[writeVolumePath stringByDeletingLastPathComponent] stringByAppendingPathComponent: newName]] == NO) + { + if( newName.length > 10) + newName = [newName substringToIndex: 10]; + + NSTask *t = [NSTask launchedTaskWithLaunchPath: @"/usr/sbin/diskutil" arguments: [NSArray arrayWithObjects: @"rename", writeVolumePath, [newName uppercaseString], nil]]; + + while( [t isRunning]) + [NSThread sleepForTimeInterval: 0.1]; + + //[t waitUntilExit]; // <- This is VERY DANGEROUS : the main runloop is continuing... + + [NSThread sleepForTimeInterval: 1]; + + if( [[NSFileManager defaultManager] fileExistsAtPath: [[writeVolumePath stringByDeletingLastPathComponent] stringByAppendingPathComponent: newName]] == NO) + { + newName = @"DICOM"; + + NSTask *t = [NSTask launchedTaskWithLaunchPath: @"/usr/sbin/diskutil" arguments: [NSArray arrayWithObjects: @"rename", writeVolumePath, newName, nil]]; + + while( [t isRunning]) + [NSThread sleepForTimeInterval: 0.1]; + + //[aTask waitUntilExit]; // <- This is VERY DANGEROUS : the main runloop is continuing... + + [NSThread sleepForTimeInterval: 1]; + } + } + + [[NSWorkspace sharedWorkspace] unmountAndEjectDeviceAtPath: [[writeVolumePath stringByDeletingLastPathComponent] stringByAppendingPathComponent: newName]]; + + NSLog( @"Ejecting new DICOM Volume: %@", newName); +} + +- (void)burnCD:(id)object +{ + if( [NSThread isMainThread] == NO) + { + NSLog( @"******* THIS SHOULD BE ON THE MAIN THREAD: burnCD"); + } + + sizeInMb = [[self getSizeOfDirectory: [self folderToBurn]] intValue] / 1024; + + DRTrack* track = [DRTrack trackForRootFolder: [DRFolder folderWithPath: [self folderToBurn]]]; + + if( track) + { + DRBurnSetupPanel *bsp = [DRBurnSetupPanel setupPanel]; + + [bsp setDelegate: self]; + + if( [bsp runSetupPanel] == NSOKButton) + { + DRBurnProgressPanel *bpp = [DRBurnProgressPanel progressPanel]; + [bpp setDelegate: self]; + [bpp beginProgressSheetForBurn:[bsp burnObject] layout:track modalForWindow: [self window]]; + + return; + } + } + + self.buttonsDisabled = NO; + runBurnAnimation = NO; + burning = NO; +} + +//------------------------------------------------------------------------------------------------------------------------------------ +#pragma mark• + +- (BOOL) validateMenuItem:(id)sender +{ + if( [sender action] == @selector(terminate:)) + return (burning == NO); // No quitting while a burn is going on + + return YES; +} + +- (BOOL) setupPanel:(DRSetupPanel*)aPanel deviceContainsSuitableMedia:(DRDevice*)device promptString:(NSString**)prompt; +{ + NSDictionary *status = [device status]; + + int freeSpace = [[[status objectForKey: DRDeviceMediaInfoKey] objectForKey: DRDeviceMediaBlocksFreeKey] longLongValue] * 2UL / 1024UL; + + if( freeSpace > 0 && sizeInMb >= freeSpace) + { + *prompt = [NSString stringWithFormat: NSLocalizedString(@"The data to burn is larger than a media size (%d MB), you need a DVD to burn this amount of data (%d MB).", nil), freeSpace, sizeInMb]; + cancelled = YES; + return NO; + } + else if( freeSpace > 0) + { + *prompt = [NSString stringWithFormat: NSLocalizedString(@"Data to burn: %d MB (Media size: %d MB), representing %2.2f %%.", nil), sizeInMb, freeSpace, (float) sizeInMb * 100. / (float) freeSpace]; + } + + return YES; + +} + +- (void) burnProgressPanelWillBegin:(NSNotification*)aNotification +{ + burnAnimationIndex = 0; + runBurnAnimation = YES; +} + +- (void) burnProgressPanelDidFinish:(NSNotification*)aNotification +{ + +} + +- (BOOL) burnProgressPanel:(DRBurnProgressPanel*)theBurnPanel burnDidFinish:(DRBurn*)burn +{ + NSDictionary* burnStatus = [burn status]; + NSString* state = [burnStatus objectForKey:DRStatusStateKey]; + BOOL succeed = NO; + + if( [state isEqualToString:DRStatusStateFailed]) + { + NSDictionary* errorStatus = [burnStatus objectForKey:DRErrorStatusKey]; + NSString* errorString = [errorStatus objectForKey:DRErrorStatusErrorStringKey]; + + NSRunCriticalAlertPanel( NSLocalizedString( @"Burning failed", nil), errorString, NSLocalizedString( @"OK", nil), nil, nil); + } + else + { + succeed = YES; + [sizeField setStringValue: NSLocalizedString( @"Burning is finished !", nil)]; + } + + self.buttonsDisabled = NO; + runBurnAnimation = NO; + burning = NO; + + if( succeed) + [[self window] performSelector: @selector(performClose:) withObject: nil afterDelay: 1]; + + return YES; +} + +- (void)windowWillClose:(NSNotification *)notification +{ + [irisAnimationTimer invalidate]; + [irisAnimationTimer release]; + irisAnimationTimer = nil; + + [burnAnimationTimer invalidate]; + [burnAnimationTimer release]; + burnAnimationTimer = nil; + + windowWillClose = YES; + + [[NSUserDefaults standardUserDefaults] setInteger: [compressionMode selectedTag] forKey:@"Compression Mode for Burning"]; + + NSLog(@"Burner windowWillClose"); + + [[self window] setDelegate: nil]; + + isExtracting = NO; + isSettingUpBurn = NO; + burning = NO; + runBurnAnimation = NO; + + [self autorelease]; +} + +- (BOOL)windowShouldClose:(id)sender +{ + NSLog(@"Burner windowShouldClose"); + + if( (isExtracting || isSettingUpBurn || burning)) + return NO; + else + { + [[NSFileManager defaultManager] removeFileAtPath: [self folderToBurn] handler:nil]; + [[NSFileManager defaultManager] removeFileAtPath: [NSString stringWithFormat:@"/tmp/burnAnonymized"] handler:nil]; + + [filesToBurn release]; + filesToBurn = nil; + [files release]; + files = nil; + [anonymizedFiles release]; + anonymizedFiles = nil; + + NSLog(@"Burner windowShouldClose YES"); + + return YES; + } +} + + +//------------------------------------------------------------------------------------------------------------------------------------ +#pragma mark• + +- (BOOL)dicomCheck:(NSString *)filename +{ + //DicomDecoder *dicomDecoder = [[[DicomDecoder alloc] init] autorelease]; + DCMObject *dcmObject = [DCMObject objectWithContentsOfFile:filename decodingPixelData:NO]; + return (dcmObject) ? YES : NO; +} + +- (void)importFiles:(NSArray *)filenames +{} + +- (NSString*) defaultTitle +{ + NSString *title = nil; + + if( [files count] > 0) + { + NSString *file = [files objectAtIndex:0]; + DCMObject *dcmObject = [DCMObject objectWithContentsOfFile:file decodingPixelData:NO]; + title = [dcmObject attributeValueWithName:@"PatientsName"]; + } + else title = @"UNTITLED"; + + return [[title uppercaseString] filenameString]; +} + +- (void)setup:(id)sender +{ + //NSLog(@"Set up burn"); + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + runBurnAnimation = NO; + [burnButton setEnabled:NO]; + isExtracting = YES; + + [self performSelectorOnMainThread:@selector(estimateFolderSize:) withObject:nil waitUntilDone:YES]; + isExtracting = NO; + + irisAnimationTimer = [[NSTimer timerWithTimeInterval: 0.07 target: self selector: @selector(irisAnimation:) userInfo: NO repeats: YES] retain]; + [[NSRunLoop currentRunLoop] addTimer: irisAnimationTimer forMode: NSModalPanelRunLoopMode]; + [[NSRunLoop currentRunLoop] addTimer: irisAnimationTimer forMode: NSDefaultRunLoopMode]; + + burnAnimationTimer = [[NSTimer timerWithTimeInterval: 0.07 target: self selector: @selector(burnAnimation:) userInfo: NO repeats: YES] retain]; + [[NSRunLoop currentRunLoop] addTimer: burnAnimationTimer forMode: NSModalPanelRunLoopMode]; + [[NSRunLoop currentRunLoop] addTimer: burnAnimationTimer forMode: NSDefaultRunLoopMode]; + + [burnButton setEnabled:YES]; + + NSString *title = nil; + + if( _multiplePatients || [[NSUserDefaults standardUserDefaults] boolForKey:@"anonymizedBeforeBurning"]) + { + NSDate *date = [NSDate date]; + title = [NSString stringWithFormat:@"Archive-%@", [date descriptionWithCalendarFormat:@"%Y%m%d" timeZone:nil locale:nil]]; + } + else title = [[self defaultTitle] uppercaseString]; + + [self setCDTitle: title]; + [pool release]; +} + + +//------------------------------------------------------------------------------------------------------------------------------------ +#pragma mark• + +/*+(void)image:(NSImage*)image writePGMToPath:(NSString*)ppmpath { + NSSize scaledDownSize = [image sizeByScalingDownProportionallyToSize:NSMakeSize(128,128)]; + NSInteger width = scaledDownSize.width, height = scaledDownSize.height; + + static CGColorSpaceRef grayColorSpace = nil; + if( !grayColorSpace) grayColorSpace = CGColorSpaceCreateDeviceGray(); + + CGContextRef cgContext = CGBitmapContextCreate(NULL, width, height, 8, width, grayColorSpace, 0); + uint8* data = CGBitmapContextGetData(cgContext); + + NSGraphicsContext* nsContext = [NSGraphicsContext graphicsContextWithGraphicsPort:cgContext flipped:NO]; + + NSGraphicsContext* savedContext = [NSGraphicsContext currentContext]; + [NSGraphicsContext setCurrentContext:nsContext]; + [image drawInRect:NSMakeRect(0,0,width,height) fromRect:NSMakeRect(0,0,image.size.width,image.size.height) operation:NSCompositeCopy fraction:1]; + [NSGraphicsContext setCurrentContext:savedContext]; + + NSMutableData* out = [NSMutableData data]; + + [out appendData:[[NSString stringWithFormat:@"P5\n%d %d\n255\n", width, height] dataUsingEncoding:NSUTF8StringEncoding]]; + [out appendBytes:data length:width*height]; + + [[NSFileManager defaultManager] confirmDirectoryAtPath:[ppmpath stringByDeletingLastPathComponent]]; + [out writeToFile:ppmpath atomically:YES]; + + CGContextRelease(cgContext); +}*/ + +- (void)addDICOMDIRUsingDCMTK_forFilesAtPaths:(NSArray*/*NSString*/)paths dicomImages:(NSArray*/*DicomImage*/)dimages +{ + [DicomDir createDicomDirAtDir:[self folderToBurn]]; +} + +- (void) produceHtml:(NSString*) burnFolder dicomObjects: (NSMutableArray*) originalDbObjects +{ + //We want to create html only for the images, not for PR, and hidden DICOM SR + NSMutableArray *images = [NSMutableArray arrayWithCapacity: [originalDbObjects count]]; + + for( id obj in originalDbObjects) + { + if( [DicomStudy displaySeriesWithSOPClassUID: [obj valueForKeyPath:@"series.seriesSOPClassUID"] andSeriesDescription: [obj valueForKeyPath:@"series.name"]]) + [images addObject: obj]; + } + + [[BrowserController currentBrowser] exportQuicktimeInt: images :burnFolder :YES]; +} + +- (NSNumber*) getSizeOfDirectory: (NSString*) path +{ + if( [[NSFileManager defaultManager] fileExistsAtPath: path] == NO) return [NSNumber numberWithLong: 0]; + + if( [[[NSFileManager defaultManager] fileAttributesAtPath:path traverseLink:NO]fileType]!=NSFileTypeSymbolicLink || [[[NSFileManager defaultManager] fileAttributesAtPath:path traverseLink:NO]fileType]!=NSFileTypeUnknown) + { + NSArray *args = nil; + NSPipe *fromPipe = nil; + NSFileHandle *fromDu = nil; + NSData *duOutput = nil; + NSString *size = nil; + NSArray *stringComponents = nil; + char aBuffer[ 300]; + + args = [NSArray arrayWithObjects:@"-ks",path,nil]; + fromPipe =[NSPipe pipe]; + fromDu = [fromPipe fileHandleForWriting]; + NSTask *duTool = [[[NSTask alloc] init] autorelease]; + + [duTool setLaunchPath:@"/usr/bin/du"]; + [duTool setStandardOutput:fromDu]; + [duTool setArguments:args]; + [duTool launch]; + + while( [duTool isRunning]) + [NSThread sleepForTimeInterval: 0.1]; + + //[duTool waitUntilExit]; // <- This is VERY DANGEROUS : the main runloop is continuing... + + duOutput = [[fromPipe fileHandleForReading] availableData]; + [duOutput getBytes:aBuffer]; + + size = [NSString stringWithCString:aBuffer]; + stringComponents = [size pathComponents]; + + size = [stringComponents objectAtIndex:0]; + size = [size substringToIndex:[size length]-1]; + + return [NSNumber numberWithUnsignedLongLong:(unsigned long long)[size doubleValue]]; + } + else return [NSNumber numberWithUnsignedLongLong:(unsigned long long)0]; +} + +- (NSString*) cleanStringForFile: (NSString*) s +{ + s = [s stringByReplacingOccurrencesOfString:@"/" withString:@"-"]; + s = [s stringByReplacingOccurrencesOfString:@":" withString:@"-"]; + + return s; +} + +- (void) prepareCDContent: (NSMutableArray*) dbObjects :(NSMutableArray*) originalDbObjects +{ + //NSLog(@"========================="); + + [finalSizeField performSelectorOnMainThread:@selector(setStringValue:) withObject:@"" waitUntilDone:YES]; + + @try + { + NSEnumerator *enumerator; + if( anonymizedFiles) enumerator = [anonymizedFiles objectEnumerator]; + else enumerator = [files objectEnumerator]; + + NSString *burnFolder = [self folderToBurn]; + NSFileManager *manager = [NSFileManager defaultManager]; + + if( ![manager fileExistsAtPath:burnFolder]) + [manager createDirectoryAtPath:burnFolder attributes:nil]; + + NSString *dicomFolder = [burnFolder stringByAppendingPathComponent:cdName]; + [manager createDirectoryAtPath:dicomFolder withIntermediateDirectories:FALSE attributes:nil error:nil]; + + NSMutableArray *dicomImages = [DicomImage dicomImagesInObjects:dbObjects]; + [XMLGenerator createDicomStructureAtPath:dicomFolder withFiles:files withCorrespondingImages:dicomImages]; + + // Test call [DicomImage image] + + //NSLog(@"[dicomImages lastObject] class name : %@", [[dicomImages lastObject] className]); + //NSSize size; + //size = NSMakeSize(70, 70); + //NSImage* test = [[dicomImages lastObject] imageByScalingProportionallyToSize:size]; + + //NSImage* test2 = [[dicomImages lastObject] image]; + + //[test2 saveAsJpegWithName:[dicomFolder stringByAppendingPathComponent:@"thumbnail_2.jpg"]]; + + } + @catch( NSException * e) + { + N2LogException( e); + } + + //NSLog(@"--------------------------"); +} + +- (IBAction) estimateFolderSize: (id) sender +{ + NSString *file; + long size = 0; + NSFileManager *manager = [NSFileManager defaultManager]; + NSDictionary *fattrs; + + for (file in files) + { + fattrs = [manager fileAttributesAtPath:file traverseLink:YES]; + size += [fattrs fileSize]/1024; + } + + if( [[NSUserDefaults standardUserDefaults] boolForKey: @"BurnWeasis"]) + { + size += 17 * 1024; // About 17MB + } + + if( [[NSUserDefaults standardUserDefaults] boolForKey: @"BurnOsirixApplication"]) + { + size += 8 * 1024; // About 8MB + } + + if( [[NSUserDefaults standardUserDefaults] stringForKey: @"SupplementaryBurnPath"].length <= 1) + [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"BurnSupplementaryFolder"]; + + if( [[NSFileManager defaultManager] fileExistsAtPath: [[[NSUserDefaults standardUserDefaults] stringForKey: @"SupplementaryBurnPath"] stringByExpandingTildeInPath]] == NO) + [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"BurnSupplementaryFolder"]; + + if( [[NSUserDefaults standardUserDefaults] boolForKey: @"BurnSupplementaryFolder"]) + { + size += [[self getSizeOfDirectory: [[NSUserDefaults standardUserDefaults] stringForKey: @"SupplementaryBurnPath"]] longLongValue]; + } + + [sizeField setStringValue:[NSString stringWithFormat:@"%@ %d %@ %3.2fMB", NSLocalizedString(@"No of files:", nil), (int) [files count], NSLocalizedString(@"Files size (without compression):", nil), size/1024.0]]; +} + + +//------------------------------------------------------------------------------------------------------------------------------------ +#pragma mark• + +- (void)burnAnimation:(NSTimer *)timer +{ + if( windowWillClose) + return; + + if( runBurnAnimation == NO) + return; + + if( burnAnimationIndex > 11) + burnAnimationIndex = 0; + + NSString *animation = [NSString stringWithFormat:@"burn_anim%02d.tif", burnAnimationIndex++]; + NSImage *image = [NSImage imageNamed: animation]; + [burnButton setImage:image]; +} + +-(void)irisAnimation:(NSTimer*) timer +{ + if( runBurnAnimation) + return; + + if( irisAnimationIndex > 17) + irisAnimationIndex = 0; + + NSString *animation = [NSString stringWithFormat:@"burn_iris%02d.tif", irisAnimationIndex++]; + NSImage *image = [NSImage imageNamed: animation]; + [burnButton setImage:image]; +} +@end diff --git a/SandBox/SandBox.xcodeproj/aless.mode1v3 b/SandBox/SandBox.xcodeproj/aless.mode1v3 new file mode 100644 index 0000000..42f8036 --- /dev/null +++ b/SandBox/SandBox.xcodeproj/aless.mode1v3 @@ -0,0 +1,1372 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Volumes/Colossus/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + 596AEB041326850800D77F23 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + toggle-editor + debugger-enable-breakpoints + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 089C166AFE841209C02AAC07 + 08FB77AFFE84173DC02AAC07 + AB2C26750677B0C400A08910 + 089C1671FE841209C02AAC07 + 1C37FBAC04509CD000000102 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 13 + 12 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 683}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 701}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 69 137 1091 742 0 0 1920 1178 + + Module + PBXSmartGroupTreeModule + Proportion + 203pt + + + Dock + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + SandBoxTestFilter.m + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + SandBoxTestFilter.m + _historyCapacity + 0 + bookmark + 59B6948B13374B57009356ED + history + + 596AEC8E1326858000D77F23 + 596AEC911326858F00D77F23 + + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {883, 510}} + RubberWindowFrame + 69 137 1091 742 0 0 1920 1178 + + Module + PBXNavigatorGroup + Proportion + 510pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 515}, {883, 186}} + RubberWindowFrame + 69 137 1091 742 0 0 1920 1178 + + Module + XCDetailModule + Proportion + 186pt + + + Proportion + 883pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + 59B6948813374B54009356ED + 1CE0B1FE06471DED0097A5F4 + 59B6948913374B54009356ED + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Volumes/Colossus/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 1 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + 596AEB051326850800D77F23 + /Users/aless/Development/Projects/osirix-plugins/_help/Osirix Plugin Generator.app/Contents/Resources/SandBoxTest/SandBoxTest.xcodeproj + + WindowString + 69 137 1091 742 0 0 1920 1178 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {500, 218}} + RubberWindowFrame + 338 632 500 500 0 0 1920 1178 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 223}, {500, 236}} + RubberWindowFrame + 338 632 500 500 0 0 1920 1178 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 459pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + 596AEB051326850800D77F23 + 59B6948A13374B54009356ED + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + 338 632 500 500 0 0 1920 1178 + WindowToolGUID + 596AEB051326850800D77F23 + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/SandBox/SandBox.xcodeproj/aless.pbxuser b/SandBox/SandBox.xcodeproj/aless.pbxuser new file mode 100644 index 0000000..cb6bd6b --- /dev/null +++ b/SandBox/SandBox.xcodeproj/aless.pbxuser @@ -0,0 +1,125 @@ +// !$*UTF8*$! +{ + 089C1669FE841209C02AAC07 /* Project object */ = { + activeBuildConfigurationName = Development; + activeTarget = 8D5B49AC048680CD000E48DA /* SandBoxTest */; + codeSenseManager = 596AEB081326850800D77F23 /* Code sense */; + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 644, + 20, + 48.16259765625, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 604, + 60, + 20, + 48, + 43, + 43, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXTargetDataSource_PrimaryAttribute, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 322390861; + PBXWorkspaceStateSaveDate = 322390861; + }; + perUserProjectItems = { + 596AEC8E1326858000D77F23 /* PBXTextBookmark */ = 596AEC8E1326858000D77F23 /* PBXTextBookmark */; + 596AEC911326858F00D77F23 /* PBXTextBookmark */ = 596AEC911326858F00D77F23 /* PBXTextBookmark */; + 59B6948B13374B57009356ED /* PBXTextBookmark */ = 59B6948B13374B57009356ED /* PBXTextBookmark */; + }; + sourceControlManager = 596AEB071326850800D77F23 /* Source Control */; + userBuildSettings = { + }; + }; + 596AEB071326850800D77F23 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + 596AEB081326850800D77F23 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + 596AEC8E1326858000D77F23 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = ABA48A640680BB600089EB4F /* SandBoxTestFilter.h */; + name = "SandBoxTestFilter.h: 9"; + rLen = 0; + rLoc = 171; + rType = 0; + vrLen = 291; + vrLoc = 0; + }; + 596AEC911326858F00D77F23 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = ABA48A660680BB690089EB4F /* SandBoxTestFilter.m */; + name = "SandBoxTestFilter.m: 12"; + rLen = 0; + rLoc = 210; + rType = 0; + vrLen = 486; + vrLoc = 0; + }; + 59B6948B13374B57009356ED /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = ABA48A660680BB690089EB4F /* SandBoxTestFilter.m */; + name = "SandBoxTestFilter.m: 12"; + rLen = 0; + rLoc = 210; + rType = 0; + vrLen = 486; + vrLoc = 0; + }; + 8D5B49AC048680CD000E48DA /* SandBoxTest */ = { + activeExec = 0; + }; + ABA48A640680BB600089EB4F /* SandBoxTestFilter.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {822, 483}}"; + sepNavSelRange = "{171, 0}"; + sepNavVisRange = "{0, 291}"; + }; + }; + ABA48A660680BB690089EB4F /* SandBoxTestFilter.m */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {822, 478}}"; + sepNavSelRange = "{210, 0}"; + sepNavVisRange = "{0, 486}"; + }; + }; +} diff --git a/KiOP/Plugin/KiOP.xcodeproj/project.pbxproj b/SandBox/SandBox.xcodeproj/project.pbxproj similarity index 60% rename from KiOP/Plugin/KiOP.xcodeproj/project.pbxproj rename to SandBox/SandBox.xcodeproj/project.pbxproj index e219a9e..ae3a9b0 100644 --- a/KiOP/Plugin/KiOP.xcodeproj/project.pbxproj +++ b/SandBox/SandBox.xcodeproj/project.pbxproj @@ -8,41 +8,36 @@ /* Begin PBXBuildFile section */ 8420023212E829A200E1E9CE /* OsiriXAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8420023112E829A200E1E9CE /* OsiriXAPI.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - 85D3209515FE274D00788A33 /* KiOP.app in Resources */ = {isa = PBXBuildFile; fileRef = 85D3209415FE274D00788A33 /* KiOP.app */; }; - 85D3209615FE275000788A33 /* KiOP.app in Copy Executables */ = {isa = PBXBuildFile; fileRef = 85D3209415FE274D00788A33 /* KiOP.app */; }; - 8D5B49AE048680CD000E48DA /* KiOP_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32DBCF630370AF2F00C91783 /* KiOP_Prefix.pch */; }; 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; - ABA48A650680BB600089EB4F /* KiOPFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = ABA48A640680BB600089EB4F /* KiOPFilter.h */; }; - ABA48A670680BB690089EB4F /* KiOPFilter.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABA48A660680BB690089EB4F /* KiOPFilter.mm */; }; + E90CDBA7173A755200580756 /* SandBoxFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = E90CDBA5173A755200580756 /* SandBoxFilter.h */; }; + E90CDBA8173A755200580756 /* SandBoxFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = E90CDBA6173A755200580756 /* SandBoxFilter.m */; }; + E90CDBAA173A760600580756 /* OsiriX.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E90CDBA9173A760600580756 /* OsiriX.framework */; }; + E91D91DD173A7332002A6669 /* SandBox_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = E91D91DC173A7332002A6669 /* SandBox_Prefix.pch */; }; + E93A79E4174B6A4800BC4F42 /* XMLGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = E93A79E2174B6A4800BC4F42 /* XMLGenerator.h */; }; + E93A79E5174B6A4800BC4F42 /* XMLGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = E93A79E3174B6A4800BC4F42 /* XMLGenerator.m */; }; + E95C223F173A955D002771EE /* S_BurnViewer.xib in Resources */ = {isa = PBXBuildFile; fileRef = E95C223D173A955D002771EE /* S_BurnViewer.xib */; }; + E98246E1173A8172003C0B2B /* S_BurnerWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = E98246DF173A8172003C0B2B /* S_BurnerWindowController.h */; }; + E98246E2173A8172003C0B2B /* S_BurnerWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = E98246E0173A8172003C0B2B /* S_BurnerWindowController.m */; }; /* End PBXBuildFile section */ -/* Begin PBXCopyFilesBuildPhase section */ - 85D3209015FE271600788A33 /* Copy Executables */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 6; - files = ( - 85D3209615FE275000788A33 /* KiOP.app in Copy Executables */, - ); - name = "Copy Executables"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ 089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 32DBCF630370AF2F00C91783 /* KiOP_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KiOP_Prefix.pch; sourceTree = ""; }; - 8420023112E829A200E1E9CE /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = "../../osirix-trunk/build/Development/OsiriXAPI.framework"; sourceTree = ""; }; - 85D3209415FE274D00788A33 /* KiOP.app */ = {isa = PBXFileReference; lastKnownFileType = wrapper.application; name = KiOP.app; path = ../KiOP/build/KiOP/Build/Products/Release/KiOP.app; sourceTree = ""; }; + 8420023112E829A200E1E9CE /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = OsiriXAPI.framework; sourceTree = ""; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - AB5D36050680E57E00F4007A /* KiOP.osirixplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = KiOP.osirixplugin; sourceTree = BUILT_PRODUCTS_DIR; }; - ABA48A640680BB600089EB4F /* KiOPFilter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KiOPFilter.h; sourceTree = ""; }; - ABA48A660680BB690089EB4F /* KiOPFilter.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KiOPFilter.mm; sourceTree = ""; }; + AB5D36050680E57E00F4007A /* SandBox.osirixplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SandBox.osirixplugin; sourceTree = BUILT_PRODUCTS_DIR; }; + E90CDBA5173A755200580756 /* SandBoxFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SandBoxFilter.h; sourceTree = ""; }; + E90CDBA6173A755200580756 /* SandBoxFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SandBoxFilter.m; sourceTree = ""; }; + E90CDBA9173A760600580756 /* OsiriX.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriX.framework; path = "../../osirix-trunk/build/Development/OsiriX.framework"; sourceTree = ""; }; + E91D91DC173A7332002A6669 /* SandBox_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SandBox_Prefix.pch; sourceTree = ""; }; + E93A79E2174B6A4800BC4F42 /* XMLGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLGenerator.h; sourceTree = ""; }; + E93A79E3174B6A4800BC4F42 /* XMLGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLGenerator.m; sourceTree = ""; }; + E95C223E173A955D002771EE /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/S_BurnViewer.xib; sourceTree = ""; }; + E98246DF173A8172003C0B2B /* S_BurnerWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = S_BurnerWindowController.h; sourceTree = ""; }; + E98246E0173A8172003C0B2B /* S_BurnerWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = S_BurnerWindowController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -52,13 +47,14 @@ files = ( 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */, 8420023212E829A200E1E9CE /* OsiriXAPI.framework in Frameworks */, + E90CDBAA173A760600580756 /* OsiriX.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 089C166AFE841209C02AAC07 /* KiOP */ = { + 089C166AFE841209C02AAC07 /* SandBoxTest */ = { isa = PBXGroup; children = ( 08FB77AFFE84173DC02AAC07 /* Classes */, @@ -67,12 +63,13 @@ 089C1671FE841209C02AAC07 /* Frameworks and Libraries */, 19C28FB8FE9D52D311CA2CBB /* Products */, ); - name = KiOP; + name = SandBoxTest; sourceTree = ""; }; 089C1671FE841209C02AAC07 /* Frameworks and Libraries */ = { isa = PBXGroup; children = ( + E90CDBA9173A760600580756 /* OsiriX.framework */, 8420023112E829A200E1E9CE /* OsiriXAPI.framework */, 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */, 1058C7AEFEA557BF11CA2CBB /* Other Frameworks */, @@ -83,7 +80,7 @@ 089C167CFE841241C02AAC07 /* Resources */ = { isa = PBXGroup; children = ( - 85D3209415FE274D00788A33 /* KiOP.app */, + E95C223D173A955D002771EE /* S_BurnViewer.xib */, 8D5B49B7048680CD000E48DA /* Info.plist */, 089C167DFE841241C02AAC07 /* InfoPlist.strings */, ); @@ -93,7 +90,7 @@ 08FB77AFFE84173DC02AAC07 /* Classes */ = { isa = PBXGroup; children = ( - AB2C26750677B0C400A08910 /* KiOPFilter */, + AB2C26750677B0C400A08910 /* SandBoxFilter */, ); name = Classes; sourceTree = ""; @@ -118,7 +115,7 @@ 19C28FB8FE9D52D311CA2CBB /* Products */ = { isa = PBXGroup; children = ( - AB5D36050680E57E00F4007A /* KiOP.osirixplugin */, + AB5D36050680E57E00F4007A /* SandBox.osirixplugin */, ); name = Products; sourceTree = ""; @@ -126,18 +123,22 @@ 32C88E010371C26100C91783 /* Other Sources */ = { isa = PBXGroup; children = ( - 32DBCF630370AF2F00C91783 /* KiOP_Prefix.pch */, + E91D91DC173A7332002A6669 /* SandBox_Prefix.pch */, ); name = "Other Sources"; sourceTree = ""; }; - AB2C26750677B0C400A08910 /* KiOPFilter */ = { + AB2C26750677B0C400A08910 /* SandBoxFilter */ = { isa = PBXGroup; children = ( - ABA48A640680BB600089EB4F /* KiOPFilter.h */, - ABA48A660680BB690089EB4F /* KiOPFilter.mm */, + E98246DF173A8172003C0B2B /* S_BurnerWindowController.h */, + E98246E0173A8172003C0B2B /* S_BurnerWindowController.m */, + E90CDBA5173A755200580756 /* SandBoxFilter.h */, + E90CDBA6173A755200580756 /* SandBoxFilter.m */, + E93A79E2174B6A4800BC4F42 /* XMLGenerator.h */, + E93A79E3174B6A4800BC4F42 /* XMLGenerator.m */, ); - name = KiOPFilter; + name = SandBoxFilter; sourceTree = ""; }; /* End PBXGroup section */ @@ -147,21 +148,22 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 8D5B49AE048680CD000E48DA /* KiOP_Prefix.pch in Headers */, - ABA48A650680BB600089EB4F /* KiOPFilter.h in Headers */, + E91D91DD173A7332002A6669 /* SandBox_Prefix.pch in Headers */, + E90CDBA7173A755200580756 /* SandBoxFilter.h in Headers */, + E98246E1173A8172003C0B2B /* S_BurnerWindowController.h in Headers */, + E93A79E4174B6A4800BC4F42 /* XMLGenerator.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 8D5B49AC048680CD000E48DA /* KiOP */ = { + 8D5B49AC048680CD000E48DA /* SandBox */ = { isa = PBXNativeTarget; - buildConfigurationList = CE6A9A9008AC841300D0C1EE /* Build configuration list for PBXNativeTarget "KiOP" */; + buildConfigurationList = CE6A9A9008AC841300D0C1EE /* Build configuration list for PBXNativeTarget "SandBox" */; buildPhases = ( 8D5B49AD048680CD000E48DA /* Headers */, 8D5B49AF048680CD000E48DA /* Resources */, - 85D3209015FE271600788A33 /* Copy Executables */, 8D5B49B1048680CD000E48DA /* Sources */, 8D5B49B3048680CD000E48DA /* Frameworks */, 8D5B49B5048680CD000E48DA /* Rez */, @@ -170,10 +172,10 @@ ); dependencies = ( ); - name = KiOP; + name = SandBox; productInstallPath = "$(HOME)/Library/Bundles"; productName = Invert; - productReference = AB5D36050680E57E00F4007A /* KiOP.osirixplugin */; + productReference = AB5D36050680E57E00F4007A /* SandBox.osirixplugin */; productType = "com.apple.product-type.bundle"; }; /* End PBXNativeTarget section */ @@ -182,9 +184,9 @@ 089C1669FE841209C02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0430; + LastUpgradeCheck = 0460; }; - buildConfigurationList = CE6A9A9408AC841300D0C1EE /* Build configuration list for PBXProject "KiOP" */; + buildConfigurationList = CE6A9A9408AC841300D0C1EE /* Build configuration list for PBXProject "SandBox" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; @@ -194,11 +196,11 @@ French, German, ); - mainGroup = 089C166AFE841209C02AAC07 /* KiOP */; + mainGroup = 089C166AFE841209C02AAC07 /* SandBoxTest */; projectDirPath = ""; projectRoot = ""; targets = ( - 8D5B49AC048680CD000E48DA /* KiOP */, + 8D5B49AC048680CD000E48DA /* SandBox */, ); }; /* End PBXProject section */ @@ -209,7 +211,7 @@ buildActionMask = 2147483647; files = ( 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */, - 85D3209515FE274D00788A33 /* KiOP.app in Resources */, + E95C223F173A955D002771EE /* S_BurnViewer.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -230,7 +232,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - ABA48A670680BB690089EB4F /* KiOPFilter.mm in Sources */, + E90CDBA8173A755200580756 /* SandBoxFilter.m in Sources */, + E98246E2173A8172003C0B2B /* S_BurnerWindowController.m in Sources */, + E93A79E5174B6A4800BC4F42 /* XMLGenerator.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -245,41 +249,55 @@ name = InfoPlist.strings; sourceTree = ""; }; + E95C223D173A955D002771EE /* S_BurnViewer.xib */ = { + isa = PBXVariantGroup; + children = ( + E95C223E173A955D002771EE /* English */, + ); + name = S_BurnViewer.xib; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ CE6A9A9108AC841300D0C1EE /* Development */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; DEBUGGING_SYMBOLS = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", - "../../osirix-trunk/build/Development", + "\"$(SRCROOT)/../../../osirix-trunk/build/Development\"", + "\"$(SRCROOT)/../../osirix-trunk/build/Development\"", ); GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_TRIGRAPHS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = KiOP_Prefix.pch; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_PREFIX_HEADER = SandBox_Prefix.pch; + GCC_VERSION = ""; GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; GCC_WARN_UNKNOWN_PRAGMAS = NO; - HEADER_SEARCH_PATHS = ""; + HEADER_SEARCH_PATHS = ( + "/Users/Thomas/osirix-trunk", + "/Users/Thomas/osirix-trunk/nitrogen/Sources", + ); INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@executable_path/../Plug-ins"; LIBRARY_SEARCH_PATHS = ""; LIBRARY_STYLE = Bundle; - MACOSX_DEPLOYMENT_TARGET = 10.5; + MACOSX_DEPLOYMENT_TARGET = 10.8; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ( "-undefined", dynamic_lookup, ); OTHER_REZFLAGS = ""; - PRODUCT_NAME = KiOP; + PRODUCT_NAME = SandBox; + SDKROOT = macosx; SECTORDER_FLAGS = ""; WARNING_CFLAGS = ( "-Wmost", @@ -294,31 +312,37 @@ CE6A9A9208AC841300D0C1EE /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", - "../../osirix-trunk/build/Development", + "\"$(SRCROOT)/../../../osirix-trunk/build/Development\"", + "\"$(SRCROOT)/../../osirix-trunk/build/Development\"", ); GCC_ENABLE_TRIGRAPHS = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = KiOP_Prefix.pch; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_PREFIX_HEADER = SandBox_Prefix.pch; + GCC_VERSION = ""; GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; GCC_WARN_UNKNOWN_PRAGMAS = NO; - HEADER_SEARCH_PATHS = ""; + HEADER_SEARCH_PATHS = ( + "/Users/Thomas/osirix-trunk", + "/Users/Thomas/osirix-trunk/nitrogen/Sources", + ); INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@executable_path/../Plug-ins"; LIBRARY_SEARCH_PATHS = ""; LIBRARY_STYLE = Bundle; - MACOSX_DEPLOYMENT_TARGET = 10.5; + MACOSX_DEPLOYMENT_TARGET = 10.8; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ( "-undefined", dynamic_lookup, ); OTHER_REZFLAGS = ""; - PRODUCT_NAME = KiOP; + PRODUCT_NAME = SandBox; + SDKROOT = macosx; SECTORDER_FLAGS = ""; WARNING_CFLAGS = ( "-Wmost", @@ -333,46 +357,35 @@ CE6A9A9508AC841300D0C1EE /* Development */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - FRAMEWORK_SEARCH_PATHS = ( - "\"$(SRCROOT)\"", - "$(inherited)", + ARCHS = ( + i386, + x86_64, ); - INSTALL_PATH = "@executable_path/../Plug-ins"; - MACH_O_TYPE = mh_bundle; - MACOSX_DEPLOYMENT_TARGET = 10.5; - PRODUCT_NAME = KiOP; - SDKROOT = macosx10.7; - STRIP_STYLE = "non-global"; - WRAPPER_EXTENSION = osirixplugin; + GCC_VERSION = ""; + HEADER_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.8; + SDKROOT = macosx; }; name = Development; }; CE6A9A9608AC841300D0C1EE /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - DEBUG_INFORMATION_FORMAT = dwarf; - FRAMEWORK_SEARCH_PATHS = ( - "\"$(SRCROOT)\"", - "$(inherited)", + ARCHS = ( + x86_64, + i386, ); - INSTALL_PATH = "@executable_path/../Plug-ins"; - MACH_O_TYPE = mh_bundle; - MACOSX_DEPLOYMENT_TARGET = 10.5; - PRODUCT_NAME = KiOP; - SDKROOT = macosx10.7; - STRIP_STYLE = "non-global"; - WRAPPER_EXTENSION = osirixplugin; + GCC_VERSION = ""; + HEADER_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.8; + SDKROOT = macosx; }; name = Deployment; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - CE6A9A9008AC841300D0C1EE /* Build configuration list for PBXNativeTarget "KiOP" */ = { + CE6A9A9008AC841300D0C1EE /* Build configuration list for PBXNativeTarget "SandBox" */ = { isa = XCConfigurationList; buildConfigurations = ( CE6A9A9108AC841300D0C1EE /* Development */, @@ -381,7 +394,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Development; }; - CE6A9A9408AC841300D0C1EE /* Build configuration list for PBXProject "KiOP" */ = { + CE6A9A9408AC841300D0C1EE /* Build configuration list for PBXProject "SandBox" */ = { isa = XCConfigurationList; buildConfigurations = ( CE6A9A9508AC841300D0C1EE /* Development */, diff --git a/SandBox/SandBox.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SandBox/SandBox.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..557656a --- /dev/null +++ b/SandBox/SandBox.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SandBox/SandBox.xcodeproj/project.xcworkspace/xcuserdata/Thomas.xcuserdatad/UserInterfaceState.xcuserstate b/SandBox/SandBox.xcodeproj/project.xcworkspace/xcuserdata/Thomas.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..c2d2685 Binary files /dev/null and b/SandBox/SandBox.xcodeproj/project.xcworkspace/xcuserdata/Thomas.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/SandBox/SandBox.xcodeproj/project.xcworkspace/xcuserdata/Thomas.xcuserdatad/WorkspaceSettings.xcsettings b/SandBox/SandBox.xcodeproj/project.xcworkspace/xcuserdata/Thomas.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/SandBox/SandBox.xcodeproj/project.xcworkspace/xcuserdata/Thomas.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/SandBox/SandBox.xcodeproj/xcuserdata/Thomas.xcuserdatad/xcschemes/SandBox.xcscheme b/SandBox/SandBox.xcodeproj/xcuserdata/Thomas.xcuserdatad/xcschemes/SandBox.xcscheme new file mode 100644 index 0000000..a5dd0c6 --- /dev/null +++ b/SandBox/SandBox.xcodeproj/xcuserdata/Thomas.xcuserdatad/xcschemes/SandBox.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SandBox/SandBox.xcodeproj/xcuserdata/Thomas.xcuserdatad/xcschemes/xcschememanagement.plist b/SandBox/SandBox.xcodeproj/xcuserdata/Thomas.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..fded68c --- /dev/null +++ b/SandBox/SandBox.xcodeproj/xcuserdata/Thomas.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + SandBox.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8D5B49AC048680CD000E48DA + + primary + + + + + diff --git a/SandBox/SandBoxFilter.h b/SandBox/SandBoxFilter.h new file mode 100644 index 0000000..c9790be --- /dev/null +++ b/SandBox/SandBoxFilter.h @@ -0,0 +1,40 @@ +// +// SandBoxTestFilter.h +// SandBoxTest +// +// Copyright (c) 2013 Thomas. All rights reserved. +// + +#import +#import +#import +#import +#import +#import + +#import + +#import + +@class DRTrack; +@class DicomDatabase; + + + +@interface SandBoxFilter : PluginFilter +{ + S_BurnerWindowController *m_window; + +} + +- (long) filterImage:(NSString*) menuName; + +@end + + + + + + + + diff --git a/SandBox/SandBoxFilter.m b/SandBox/SandBoxFilter.m new file mode 100644 index 0000000..c8aebab --- /dev/null +++ b/SandBox/SandBoxFilter.m @@ -0,0 +1,43 @@ +// +// SandBoxTestFilter.m +// SandBoxTest +// +// Copyright (c) 2013 Thomas. All rights reserved. +// + +#import "SandBoxFilter.h" + + +@implementation SandBoxFilter + +- (void) initPlugin +{ + + + +} + +- (long) filterImage:(NSString*) menuName +{ + BrowserController *currentBrowser = [BrowserController currentBrowser]; + + NSMutableArray *managedObjects = [NSMutableArray array]; + NSMutableArray *filesToBurn; + + if (1) + filesToBurn = [currentBrowser filesForDatabaseMatrixSelection:managedObjects onlyImages:NO]; + else + filesToBurn = [currentBrowser filesForDatabaseOutlineSelection:managedObjects onlyImages:NO]; + + m_window = [[S_BurnerWindowController alloc] initWithFiles:filesToBurn managedObjects:managedObjects]; + [m_window showWindow:self]; + + return 0; +} + +@end + + + + + diff --git a/KiOP/Plugin/KiOP_Prefix.pch b/SandBox/SandBox_Prefix.pch similarity index 50% rename from KiOP/Plugin/KiOP_Prefix.pch rename to SandBox/SandBox_Prefix.pch index 809ccd3..9ee6635 100644 --- a/KiOP/Plugin/KiOP_Prefix.pch +++ b/SandBox/SandBox_Prefix.pch @@ -1,5 +1,5 @@ // -// Prefix header for all source files of the 'KiOP' target in the 'KiOP' project. +// Prefix header for all source files of the 'SandBoxTest' target in the 'SandBoxTest' project. // #ifdef __OBJC__ diff --git a/SandBox/XMLGenerator.h b/SandBox/XMLGenerator.h new file mode 100644 index 0000000..233d91f --- /dev/null +++ b/SandBox/XMLGenerator.h @@ -0,0 +1,62 @@ +// +// SandBoxTestFilter.h +// SandBoxTest +// +// Copyright (c) 2013 Thomas. All rights reserved. +// + +#import +#import + +#import +#import + +#import + +#import + + +@interface S_DicomNode : NSObject +{ + DCMObject* dcmObject; + S_DicomNode* parent; + NSMutableArray* children; +} + +@property (retain) DCMObject* dcmObject; +@property (retain) S_DicomNode* parent; +@property (retain) NSMutableArray* children; + +- (id) initWithDCMObject:(DCMObject*)object; + +- (void) setParent:(S_DicomNode*)newParent; +- (void) addChild:(S_DicomNode*)newChild; + +@end + + + +@interface XMLGenerator : NSObject +{ + +} + ++ (void) createDicomStructureAtPath:(NSString*)path withFiles:(NSMutableArray*)files withCorrespondingImages:(NSMutableArray*)images; ++ (void) generateXMLFile:(NSString*)fileName atPath:(NSString*)path withContent:(NSXMLElement*)content; + ++ (NSArray*) patientAttributes:(DCMObject*)object; ++ (NSArray*) studyAttributes:(DCMObject*)object; ++ (NSArray*) seriesAttributes:(DCMObject*)object; ++ (NSArray*) instanceAttributes:(DCMObject*)object; + +@end + + + + + + + + + + diff --git a/SandBox/XMLGenerator.m b/SandBox/XMLGenerator.m new file mode 100644 index 0000000..21d097d --- /dev/null +++ b/SandBox/XMLGenerator.m @@ -0,0 +1,349 @@ +// +// SandBoxTestFilter.m +// SandBoxTest +// +// Copyright (c) 2013 Thomas. All rights reserved. +// + +#import "XMLGenerator.h" + +#import "AppController.h" +#import "WaitRendering.h" +#import "S_BurnerWindowController.h" +#import +#import "MutableArrayCategory.h" +#import +#import +#import +#import "BrowserController.h" +#import "DicomStudy.h" +#import "DicomSeries.h" +#import "DicomImage.h" +#import "DicomStudy+Report.h" +#import "Anonymization.h" +#import "AnonymizationPanelController.h" +#import "AnonymizationViewController.h" +#import "ThreadsManager.h" +#import "NSThread+N2.h" +#import "NSFileManager+N2.h" +#import "N2Debug.h" +#import "NSImage+N2.h" +#import "DicomDir.h" +#import "DicomDatabase.h" +#import + + +@interface NSImage(saveAsJpegWithName) +- (void) saveAsJpegWithName:(NSString*) fileName; +@end + +@implementation NSImage(saveAsJpegWithName) + +- (void) saveAsJpegWithName:(NSString*) fileName +{ + // Cache the reduced image + NSData *imageData = [self TIFFRepresentation]; + NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:imageData]; + NSDictionary *imageProps = [NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:1.0] forKey:NSImageCompressionFactor]; + imageData = [imageRep representationUsingType:NSJPEGFileType properties:imageProps]; + [imageData writeToFile:fileName atomically:NO]; +} + +@end + + + + +@implementation S_DicomNode + +@synthesize parent; +@synthesize children; +@synthesize dcmObject; + +- (id) initWithDCMObject:(DCMObject*)object +{ + if (self = [super init]) + { + [self setDcmObject:object]; + [self setParent:nil]; + [self setChildren:[NSMutableArray array]]; + } + return self; +} + +- (void) setParent:(S_DicomNode*)newParent +{ + parent = newParent; + [newParent addChild:self]; +} + +- (void) addChild:(S_DicomNode*)newChild +{ + [children addObject:newChild]; + if ([newChild parent] != self) + [newChild setParent:self]; +} + +- (void) dealloc +{ + [dcmObject release]; + [parent release]; + [children release]; + [super dealloc]; +} + +@end + + + + + +@implementation XMLGenerator + ++ (void) createDicomStructureAtPath:(NSString*)path withFiles:(NSMutableArray*)files withCorrespondingImages:(NSMutableArray*)images +{ + NSFileManager *manager = [NSFileManager defaultManager]; // For create folders + + NSString *patientPath = path; + NSString *studyPath = path; + NSString *seriesPath = path; + + NSString *patientID = @""; + NSString *studyInstanceUID = @""; + NSString *seriesInstanceUID = @""; + NSString *SOPInstanceUID = @""; + + S_DicomNode *patient; + S_DicomNode *study; + S_DicomNode *series; + S_DicomNode *instance; + + NSMutableArray *patientsList = [NSMutableArray array]; + + for (id file in files) + { + DCMObject *dcmObject = [DCMObject objectWithContentsOfFile:file decodingPixelData:NO]; + if (dcmObject) // <- it's a DICOM file + { + // New patient + if (![patientID isEqualToString:[dcmObject attributeValueWithName:@"PatientID"]]) + { + patientID = (NSString*)[dcmObject attributeValueWithName:@"PatientID"]; + patient = [[S_DicomNode alloc] initWithDCMObject:dcmObject]; + [patientsList addObject:patient]; + } + + // New study + if (![studyInstanceUID isEqualToString:[dcmObject attributeValueWithName:@"StudyInstanceUID"]]) + { + studyInstanceUID = (NSString*)[dcmObject attributeValueWithName:@"StudyInstanceUID"]; + study = [[S_DicomNode alloc] initWithDCMObject:dcmObject]; + [study setParent:patient]; + } + + // New series + if (![seriesInstanceUID isEqualToString:[dcmObject attributeValueWithName:@"SeriesInstanceUID"]]) + { + seriesInstanceUID = (NSString*)[dcmObject attributeValueWithName:@"SeriesInstanceUID"]; + series = [[S_DicomNode alloc] initWithDCMObject:dcmObject]; + [series setParent:study]; + } + + // New instance + if (![SOPInstanceUID isEqualToString:[dcmObject attributeValueWithName:@"SOPInstanceUID"]]) + { + SOPInstanceUID = (NSString*)[dcmObject attributeValueWithName:@"SOPInstanceUID"]; + instance = [[S_DicomNode alloc] initWithDCMObject:dcmObject]; + [instance setParent:series]; + } + } + } + +// NSLog(@"************ Check 1"); +// +// DCMObject *object = [[patientsList lastObject] dcmObject]; +// NSXMLDocument *doc = [object xmlDocument]; +// +// NSData *xmlData = [doc XMLDataWithOptions:NSXMLNodePrettyPrint]; +// NSString* outputPath = [[NSString alloc] initWithString:[path stringByAppendingPathComponent:@"test.xml"]]; +// +// NSLog(@"************ Check 2"); +// +// if (![xmlData writeToFile:outputPath atomically:YES]) +// { +// NSLog(@"Could not write document out AAAAAAA"); +// } +// [doc release]; +// +// NSLog(@"************ Check 7"); + + NSXMLElement *rootXML = (NSXMLElement*)[NSXMLNode elementWithName:@"dicom"]; + int compteur = 0; + + for (id patient in patientsList) + { + patientID = (NSString*)[[patient dcmObject] attributeValueWithName:@"PatientID"]; + patientPath = [path stringByAppendingPathComponent:patientID]; + [manager createDirectoryAtPath:patientPath withIntermediateDirectories:FALSE attributes:nil error:nil]; + + NSXMLElement *patientXML = (NSXMLElement *)[NSXMLNode elementWithName:@"dicom"]; + NSXMLElement *patientNode = (NSXMLElement *)[NSXMLNode elementWithName:@"Patient"]; + [patientNode setAttributes:[self patientAttributes:[patient dcmObject]]]; + [patientXML addChild:patientNode]; + [self generateXMLFile:@"index.xml" atPath:patientPath withContent:patientXML]; + [patientNode detach]; + [rootXML addChild:patientNode]; + + for (id study in [patient children]) + { + studyInstanceUID = (NSString*)[[study dcmObject] attributeValueWithName:@"StudyInstanceUID"]; + studyPath = [patientPath stringByAppendingPathComponent:studyInstanceUID]; + [manager createDirectoryAtPath:studyPath withIntermediateDirectories:FALSE attributes:nil error:nil]; + + NSXMLElement *studyXML = (NSXMLElement *)[NSXMLNode elementWithName:@"dicom"]; + NSXMLElement *studyNode = (NSXMLElement *)[NSXMLNode elementWithName:@"Study"]; + [studyNode setAttributes:[self studyAttributes:[study dcmObject]]]; + [studyXML addChild:studyNode]; + [self generateXMLFile:@"index.xml" atPath:studyPath withContent:studyXML]; + [studyNode detach]; + [patientNode addChild:studyNode]; + + for (id series in [study children]) + { + seriesInstanceUID = (NSString*)[[series dcmObject] attributeValueWithName:@"SeriesInstanceUID"]; + seriesPath = [studyPath stringByAppendingPathComponent:seriesInstanceUID]; + [manager createDirectoryAtPath:seriesPath withIntermediateDirectories:FALSE attributes:nil error:nil]; + + NSXMLElement *seriesXML = (NSXMLElement *)[NSXMLNode elementWithName:@"dicom"]; + NSXMLElement *seriesNode = (NSXMLElement *)[NSXMLNode elementWithName:@"Series"]; + [seriesNode setAttributes:[self seriesAttributes:[series dcmObject]]]; + [seriesXML addChild:seriesNode]; + + for (id instance in [series children]) + { + DCMObject *instanceDicomObject = [instance dcmObject]; + NSString *fileName = [NSString stringWithFormat:@"%@/%05d", seriesPath, compteur]; + + // Write dicom file + [instanceDicomObject writeToFile:fileName withTransferSyntax:[DCMTransferSyntax ImplicitVRLittleEndianTransferSyntax] quality:DCMLosslessQuality atomically:YES]; + + // Add instances to xml file + NSXMLElement *instanceNode = (NSXMLElement*)[NSXMLNode elementWithName:@"Instance"]; + [instanceNode setAttributes:[NSArray arrayWithObjects: + [NSXMLNode attributeWithName:@"SOPInstanceUID" stringValue:[NSString stringWithFormat:@"%05d", compteur]], + [NSXMLNode attributeWithName:@"InstanceNumber" stringValue:[NSString stringWithFormat:@"%i", compteur]], + [NSXMLNode attributeWithName:@"DirectDownloadFile" stringValue:@""], + nil]]; + [seriesNode addChild:instanceNode]; + + compteur++; + } + + [self generateXMLFile:@"index.xml" atPath:seriesPath withContent:seriesXML]; + [seriesNode detach]; + [studyNode addChild:seriesNode]; + + // Create thumbnail + DicomImage *dicomImage = [images objectAtIndex:(compteur-1)]; + NSData *imageSeries = [[dicomImage series] thumbnail]; + NSImage *im = [[NSImage alloc] initWithData:imageSeries]; + [im saveAsJpegWithName:[seriesPath stringByAppendingPathComponent:@"thumbnail.jpg"]]; + + NSLog(@"dicomImage class name : %@", [dicomImage className]); + + + + // Test bigger thumbnails + + //NSImage *testimage = [dicomImage image]; + //NSData *test = [[dicomImage series] images]; + +// NSSize size; +// size = NSMakeSize(70, 70); +// +// NSImage* test2 = [(NSImage*)dicomImage imageByScalingProportionallyToSize:size]; +// [test2 saveAsJpegWithName:[seriesPath stringByAppendingPathComponent:@"thumbnail_2.jpg"]]; + + } + } + } + [self generateXMLFile:@"dicom_structure.xml" atPath:path withContent:rootXML]; +} + + + ++ (void) generateXMLFile:(NSString*)fileName atPath:(NSString*)path withContent:(NSXMLElement*)content +{ + NSXMLDocument *xmlDoc; + if (content != nil) + xmlDoc = [[NSXMLDocument alloc] initWithRootElement:content]; + else + xmlDoc = [[NSXMLDocument alloc] initWithRootElement:[NSXMLElement elementWithName:@"root"]]; + + [xmlDoc setVersion:@"1.0"]; + [xmlDoc setCharacterEncoding:@"UTF-8"]; + + NSString* outputPath = [[NSString alloc] initWithString:[path stringByAppendingPathComponent:fileName]]; + + NSData *xmlData = [xmlDoc XMLDataWithOptions:NSXMLNodePrettyPrint]; + if (![xmlData writeToFile:outputPath atomically:YES]) + { + NSLog(@"Could not write document out..."); + } + + [xmlDoc release]; +} + + ++ (NSArray*) patientAttributes:(DCMObject*)object +{ + NSArray *patientAttributes = [NSArray arrayWithObjects: + [NSXMLNode attributeWithName:@"PatientID" stringValue:[object attributeValueWithName:@"PatientID"]], + [NSXMLNode attributeWithName:@"PatientName" stringValue:[object attributeValueWithName:@"PatientsName"]], + [NSXMLNode attributeWithName:@"PatientBirthDate" stringValue:[object attributeValueWithName:@"PatientsBirthDate"]], + [NSXMLNode attributeWithName:@"PatientSex" stringValue:[object attributeValueWithName:@"patientSex"]], + nil]; + return patientAttributes; +} + ++ (NSArray*) studyAttributes:(DCMObject*)object +{ + NSArray *studyAttributes = [NSArray arrayWithObjects: + [NSXMLNode attributeWithName:@"StudyInstanceUID" stringValue:[object attributeValueWithName:@"StudyInstanceUID"]], + [NSXMLNode attributeWithName:@"StudyDescription" stringValue:[object attributeValueWithName:@"StudyDescription"]], + [NSXMLNode attributeWithName:@"StudyDate" stringValue:[object attributeValueWithName:@"StudyDate"]], + [NSXMLNode attributeWithName:@"StudyTime" stringValue:[object attributeValueWithName:@"StudyTime"]], + nil]; + return studyAttributes; +} + ++ (NSArray*) seriesAttributes:(DCMObject*)object +{ + NSArray *seriesAttributes = [NSArray arrayWithObjects: + [NSXMLNode attributeWithName:@"SeriesInstanceUID" stringValue:[object attributeValueWithName:@"SeriesInstanceUID"]], + [NSXMLNode attributeWithName:@"SeriesDescription" stringValue:[object attributeValueWithName:@"SeriesDescription"]], + [NSXMLNode attributeWithName:@"SeriesNumber" stringValue:[object attributeValueWithName:@"SeriesNumber"]], + [NSXMLNode attributeWithName:@"Modality" stringValue:[object attributeValueWithName:@"Modality"]], + [NSXMLNode attributeWithName:@"DirectDownloadThumbnail" stringValue:@"thumbnail.jpg"], + nil]; + return seriesAttributes; +} + +// Obsolète ++ (NSArray*) instanceAttributes:(DCMObject*)object +{ + NSArray *instanceAttributes = [NSArray arrayWithObjects: + [NSXMLNode attributeWithName:@"SOPInstanceUID" stringValue:[object attributeValueWithName:@""]], + [NSXMLNode attributeWithName:@"InstanceNumber" stringValue:[object attributeValueWithName:@""]], + [NSXMLNode attributeWithName:@"DirectDownloadFile" stringValue:[object attributeValueWithName:@""]], + nil]; + return instanceAttributes; +} + + +@end + + + + + diff --git a/KiOP/Plugin/version.plist b/SandBox/version.plist similarity index 100% rename from KiOP/Plugin/version.plist rename to SandBox/version.plist diff --git a/Worklists/Resources/Info.plist b/Worklists/Resources/Info.plist index 568cc03..d43aa51 100644 --- a/Worklists/Resources/Info.plist +++ b/Worklists/Resources/Info.plist @@ -15,10 +15,14 @@ CFBundleSignature ???? CFBundleShortVersionString - 1.0.5 + 1.1.0 NSPrincipalClass WorklistsPlugin pluginType - Other + Database + MenuTitles + + Temporarily disable Worklists refresh + diff --git a/Worklists/Sources/Worklist.mm b/Worklists/Sources/Worklist.mm index 45f7d3c..8190c74 100644 --- a/Worklists/Sources/Worklist.mm +++ b/Worklists/Sources/Worklist.mm @@ -180,7 +180,7 @@ - (void)setProperties:(NSDictionary*)properties { if (ti != -1) { if (!self.refreshTimer || _refreshTimer.timeInterval != ti) - self.refreshTimer = [NSTimer scheduledTimerWithTimeInterval:ti target:[WorklistsNonretainingTimerInvoker invokerWithTarget:self selector:@selector(initiateRefresh)] selector:@selector(fire:) userInfo:nil repeats:YES]; + self.refreshTimer = [NSTimer scheduledTimerWithTimeInterval:ti target:[WorklistsNonretainingTimerInvoker invokerWithTarget:self selector:@selector(_timedInitiateRefresh:)] selector:@selector(fire:) userInfo:nil repeats:YES]; [_refreshTimer fire]; } else { self.refreshTimer = nil; @@ -541,6 +541,12 @@ - (void)_threadRefresh { } } +- (void)_timedInitiateRefresh:(NSTimer*)timer { + if ([[WorklistsPlugin instance] refreshDisabled]) + return; + [self initiateRefresh]; +} + - (void)initiateRefresh { [self performSelectorInBackground:@selector(_threadRefresh) withObject:nil]; } diff --git a/Worklists/Sources/WorklistsPlugin.h b/Worklists/Sources/WorklistsPlugin.h index d627e87..00a52df 100644 --- a/Worklists/Sources/WorklistsPlugin.h +++ b/Worklists/Sources/WorklistsPlugin.h @@ -23,10 +23,14 @@ extern NSString* const WorklistAlbumIDsDefaultsKey; NSMutableDictionary* _worklistObjs; NSMutableDictionary* _errors; NSTimer* _urlSyncTimer; + NSMenuItem* _pluginMenuItem; + BOOL _refreshDisabled; + NSTimer* _refreshReenableTimer; } @property(readonly,retain) NSArrayController* worklists; @property(readonly,retain) NSTimer* urlSyncTimer; +@property(readonly) BOOL refreshDisabled; + (WorklistsPlugin*)instance; diff --git a/Worklists/Sources/WorklistsPlugin.mm b/Worklists/Sources/WorklistsPlugin.mm index ccc4bf4..8c82ffc 100644 --- a/Worklists/Sources/WorklistsPlugin.mm +++ b/Worklists/Sources/WorklistsPlugin.mm @@ -20,6 +20,7 @@ #import #import #import +#import @interface WorklistsArrayController : NSArrayController @@ -36,6 +37,7 @@ @implementation WorklistsPlugin @synthesize worklists = _worklists; @synthesize urlSyncTimer = _urlSyncTimer; +@synthesize refreshDisabled = _refreshDisabled; static WorklistsPlugin* WorklistsPluginInstance = nil; static NSString* const Worklists = @"Worklists"; @@ -83,7 +85,9 @@ - (void)dealloc { [NSUserDefaultsController.sharedUserDefaultsController removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self]; + self.urlSyncTimer = nil; + [_refreshReenableTimer release]; [_cachePath release]; [_worklistObjs release]; @@ -99,43 +103,42 @@ - (void)initPlugin { [PreferencesWindowController addPluginPaneWithResourceNamed:@"WorklistsPreferences" inBundle:[NSBundle bundleForClass:[self class]] withTitle:Worklists image:image]; Method method; - IMP imp; + //IMP imp; Class BrowserControllerClass = [BrowserController class]; method = class_getInstanceMethod(BrowserControllerClass, @selector(tableView:willDisplayCell:forTableColumn:row:)); if (!method) [NSException raise:NSGenericException format:@"bad OsiriX version"]; - imp = method_getImplementation(method); - class_addMethod(BrowserControllerClass, @selector(_Worklists_BrowserController_tableView:willDisplayCell:forTableColumn:row:), imp, method_getTypeEncoding(method)); + class_addMethod(BrowserControllerClass, @selector(_Worklists_BrowserController_tableView:willDisplayCell:forTableColumn:row:), method_getImplementation(method), method_getTypeEncoding(method)); method_setImplementation(method, class_getMethodImplementation([self class], @selector(_Worklists_BrowserController_tableView:willDisplayCell:forTableColumn:row:))); method = class_getInstanceMethod(BrowserControllerClass, @selector(tableView:validateDrop:proposedRow:proposedDropOperation:)); if (!method) [NSException raise:NSGenericException format:@"bad OsiriX version"]; - imp = method_getImplementation(method); - class_addMethod(BrowserControllerClass, @selector(_Worklists_BrowserController_tableView:validateDrop:proposedRow:proposedDropOperation:), imp, method_getTypeEncoding(method)); + class_addMethod(BrowserControllerClass, @selector(_Worklists_BrowserController_tableView:validateDrop:proposedRow:proposedDropOperation:), method_getImplementation(method), method_getTypeEncoding(method)); method_setImplementation(method, class_getMethodImplementation([self class], @selector(_Worklists_BrowserController_tableView:validateDrop:proposedRow:proposedDropOperation:))); method = class_getInstanceMethod(BrowserControllerClass, @selector(tableView:toolTipForCell:rect:tableColumn:row:mouseLocation:)); if (!method) [NSException raise:NSGenericException format:@"bad OsiriX version"]; - imp = method_getImplementation(method); - class_addMethod(BrowserControllerClass, @selector(_Worklists_BrowserController_tableView:toolTipForCell:rect:tableColumn:row:mouseLocation:), imp, method_getTypeEncoding(method)); + class_addMethod(BrowserControllerClass, @selector(_Worklists_BrowserController_tableView:toolTipForCell:rect:tableColumn:row:mouseLocation:), method_getImplementation(method), method_getTypeEncoding(method)); method_setImplementation(method, class_getMethodImplementation([self class], @selector(_Worklists_BrowserController_tableView:toolTipForCell:rect:tableColumn:row:mouseLocation:))); method = class_getInstanceMethod(BrowserControllerClass, @selector(menuWillOpen:)); if (!method) [NSException raise:NSGenericException format:@"bad OsiriX version"]; - imp = method_getImplementation(method); - class_addMethod(BrowserControllerClass, @selector(_Worklists_BrowserController_menuWillOpen:), imp, method_getTypeEncoding(method)); + class_addMethod(BrowserControllerClass, @selector(_Worklists_BrowserController_menuWillOpen:), method_getImplementation(method), method_getTypeEncoding(method)); method_setImplementation(method, class_getMethodImplementation([self class], @selector(_Worklists_BrowserController_menuWillOpen:))); method = class_getInstanceMethod(BrowserControllerClass, @selector(outlineView:willDisplayCell:forTableColumn:item:)); if (!method) [NSException raise:NSGenericException format:@"bad OsiriX version"]; - imp = method_getImplementation(method); - class_addMethod(BrowserControllerClass, @selector(_Worklists_BrowserController_outlineView:willDisplayCell:forTableColumn:item:), imp, method_getTypeEncoding(method)); + class_addMethod(BrowserControllerClass, @selector(_Worklists_BrowserController_outlineView:willDisplayCell:forTableColumn:item:), method_getImplementation(method), method_getTypeEncoding(method)); method_setImplementation(method, class_getMethodImplementation([self class], @selector(_Worklists_BrowserController_outlineView:willDisplayCell:forTableColumn:item:))); -} - -- (long)filterImage:(NSString*)menuName { - return 0; + + Class PluginManagerClass = [PluginManager class]; + + method = class_getClassMethod(PluginManagerClass, @selector(setMenus::::)); + if (!method) [NSException raise:NSGenericException format:@"bad OsiriX version"]; + class_addMethod(object_getClass(PluginManagerClass), @selector(_Worklists_PluginManager_setMenus::::), method_getImplementation(method), method_getTypeEncoding(method)); + method_setImplementation(method, method_getImplementation(class_getClassMethod([self class], @selector(_Worklists_PluginManager_setMenus::::)))); + } - (void)observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object change:(NSDictionary*)change context:(void*)context { @@ -285,6 +288,38 @@ + (void)refreshAlbumsForDatabase:(DicomDatabase*)db { [BrowserController.currentBrowser refreshAlbums]; } +- (void)updateMenuItem { + [_pluginMenuItem setState:(_refreshDisabled? NSOnState : NSOffState)]; +} + +- (long)filterImage:(NSString*)menuName { + if (_refreshDisabled) { + [_refreshReenableTimer invalidate]; + _refreshReenableTimer = nil; + _refreshDisabled = NO; + [self updateMenuItem]; + } else { + NSAlert* alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Worklists won't be refreshed for the next 60 minutes.", nil) defaultButton:nil alternateButton:NSLocalizedString(@"Cancel", nil) otherButton:nil informativeTextWithFormat:NSLocalizedString(@"After 60 minutes, worklists will automatically start refreshing again, but you can use this menu item to re-enable worklists when you're done.", nil)]; + [alert beginSheetModalForWindow:nil modalDelegate:self didEndSelector:@selector(_disableRefreshSheetDidEnd:returnCode:contextInfo:) contextInfo:nil]; + } + + return 0; +} + +- (void)_disableRefreshSheetDidEnd:(NSAlert*)alert returnCode:(NSInteger)returnCode contextInfo:(void*)contextInfo { + if (returnCode == NSOKButton) { + _refreshDisabled = YES; + [self updateMenuItem]; + _refreshReenableTimer = [NSTimer scheduledTimerWithTimeInterval:3600 target:[WorklistsNonretainingTimerInvoker invokerWithTarget:self selector:@selector(_timedReenableRefresh:)] selector:@selector(fire:) userInfo:nil repeats:NO]; + } +} + +- (void)_timedReenableRefresh:(NSTimer*)timer { + _refreshReenableTimer = nil; + _refreshDisabled = NO; + [self updateMenuItem]; +} + #pragma mark BrowserController - (void)_BrowserController:(BrowserController*)bc tableView:(NSTableView*)table willDisplayCell:(PrettyCell*)cell forTableColumn:(NSTableColumn*)column row:(NSInteger)row { @@ -456,6 +491,33 @@ - (void)_Worklists_BrowserController_outlineView:(NSOutlineView*)outlineView wil [WorklistsPluginInstance _BrowserController:(id)self outlineView:outlineView willDisplayCell:cell forTableColumn:column item:item]; } +- (void)_PluginManager_setMenus:(NSMenu*)filtersMenu :(NSMenu*)roisMenu :(NSMenu*)othersMenu :(NSMenu*)dbMenu { + NSBundle* bundle = [NSBundle bundleForClass:[self class]]; + + _pluginMenuItem = nil; + + for (NSMenuItem* mi in dbMenu.itemArray) { + if (mi.representedObject) { // we recently started setting the NSMenuItem's representedObject to the plugin's NSBundle instance + if (mi.representedObject != bundle) + continue; + } else // previously, the only way to identify the menus was by their title + if (![mi.title isEqualToString:@"Temporarily disable Worklists refresh"]) + continue; + + // mi is our menu item + _pluginMenuItem = mi; + + break; // we don't have other menu items + } + + [self updateMenuItem]; +} + ++ (void)_Worklists_PluginManager_setMenus:(NSMenu*)filtersMenu :(NSMenu*)roisMenu :(NSMenu*)othersMenu :(NSMenu*)dbMenu { + [self _Worklists_PluginManager_setMenus:filtersMenu :roisMenu :othersMenu :dbMenu]; + [WorklistsPluginInstance _PluginManager_setMenus:filtersMenu :roisMenu :othersMenu :dbMenu]; +} + @end diff --git a/XML-RPC-Plugin/xmlrpc.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate b/XML-RPC-Plugin/xmlrpc.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..36b6e6a Binary files /dev/null and b/XML-RPC-Plugin/xmlrpc.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/XML-RPC-Plugin/xmlrpc.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist b/XML-RPC-Plugin/xmlrpc.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..ac706f8 --- /dev/null +++ b/XML-RPC-Plugin/xmlrpc.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + xmlrpc.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8D5B49AC048680CD000E48DA + + primary + + + + + diff --git a/Ejection Fraction/Ejection Fraction II.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/Ejection Fraction II.xcscheme b/XML-RPC-Plugin/xmlrpc.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xmlrpc.xcscheme similarity index 90% rename from Ejection Fraction/Ejection Fraction II.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/Ejection Fraction II.xcscheme rename to XML-RPC-Plugin/xmlrpc.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xmlrpc.xcscheme index 3881a08..479ba58 100644 --- a/Ejection Fraction/Ejection Fraction II.xcodeproj/xcuserdata/antoinerosset.xcuserdatad/xcschemes/Ejection Fraction II.xcscheme +++ b/XML-RPC-Plugin/xmlrpc.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xmlrpc.xcscheme @@ -15,9 +15,9 @@ + BuildableName = "xmlrpc.osirixplugin" + BlueprintName = "xmlrpc" + ReferencedContainer = "container:xmlrpc.xcodeproj"> diff --git a/XML-RPC-Plugin/xmlrpcFilter.m b/XML-RPC-Plugin/xmlrpcFilter.m index 6025c78..987de15 100644 --- a/XML-RPC-Plugin/xmlrpcFilter.m +++ b/XML-RPC-Plugin/xmlrpcFilter.m @@ -35,6 +35,8 @@ - (void) OsiriXXMLRPCMessage: (NSNotification*) note { NSMutableDictionary *httpServerMessage = [note object]; + NSLog( @"%@", httpServerMessage); + // You will also receive this notification when XMLRPC methods are called through an osirix:// URL // In this case, the notification dictionary won't contain an NSXMLDocument and request parameters will be available directly in the dictionary. // The following code shows you how to obtain the parameters, no matter if XMLRPC or osirix:// diff --git a/contextualDictionary/ContextualDictionary.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/contextualDictionary/ContextualDictionary.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..a9e15aa --- /dev/null +++ b/contextualDictionary/ContextualDictionary.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/contextualDictionary/ContextualDictionary.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate b/contextualDictionary/ContextualDictionary.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..23ff9c6 Binary files /dev/null and b/contextualDictionary/ContextualDictionary.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/contextualDictionary/ContextualDictionary.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/ContextualDictionary.xcscheme b/contextualDictionary/ContextualDictionary.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/ContextualDictionary.xcscheme new file mode 100644 index 0000000..3258da5 --- /dev/null +++ b/contextualDictionary/ContextualDictionary.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/ContextualDictionary.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/contextualDictionary/ContextualDictionary.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist b/contextualDictionary/ContextualDictionary.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..50b1b7a --- /dev/null +++ b/contextualDictionary/ContextualDictionary.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + ContextualDictionary.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8D5B49AC048680CD000E48DA + + primary + + + + +