1 Commits

Author SHA1 Message Date
Alex Zielenski 9cea801650 Create gh-pages branch via GitHub 2014-08-05 12:58:39 -04:00
72 changed files with 767 additions and 14863 deletions
-18
View File
@@ -1,18 +0,0 @@
# .gitignore in use by Joris Kluivers
*.DS_Store
# Xcode
*.pbxuser
*.mode1v3
*.move2v3
*.perspectivev3
*.xcuserstate
project.xcworkspace/
xcuserdata/
build/
# Generated
*.o
*.pyc
-594
View File
@@ -1,594 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
0E7C3CC514F9FB1A0003A5FE /* cursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 0E7C3CC414F9FB1A0003A5FE /* cursor.png */; };
FA02424614FF0993006E6FE1 /* MMAdvancedEditViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = FA02424314FF0993006E6FE1 /* MMAdvancedEditViewController.h */; };
FA02424714FF0993006E6FE1 /* MMAdvancedEditViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FA02424414FF0993006E6FE1 /* MMAdvancedEditViewController.m */; };
FA02424814FF0993006E6FE1 /* AdvancedEdit.xib in Resources */ = {isa = PBXBuildFile; fileRef = FA02424514FF0993006E6FE1 /* AdvancedEdit.xib */; };
FA05ED1115571D7800BEC0AC /* MMCursorLibrary.h in Headers */ = {isa = PBXBuildFile; fileRef = FA05ED0F15571D7800BEC0AC /* MMCursorLibrary.h */; };
FA05ED1215571D7800BEC0AC /* MMCursorLibrary.m in Sources */ = {isa = PBXBuildFile; fileRef = FA05ED1015571D7800BEC0AC /* MMCursorLibrary.m */; };
FA07748014F9A70A00A1B91B /* MMAnimatingImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = FA07746C14F9976100A1B91B /* MMAnimatingImageView.m */; };
FA07748114F9A70E00A1B91B /* MMAnimatingImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = FA07746B14F9976100A1B91B /* MMAnimatingImageView.h */; };
FA21EF981550C642002D688E /* MMCursorViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = FA21EF961550C642002D688E /* MMCursorViewController.h */; };
FA21EF991550C642002D688E /* MMCursorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FA21EF971550C642002D688E /* MMCursorViewController.m */; };
FA319D3C14F353C50064E7CC /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA319D3B14F353C50064E7CC /* Accelerate.framework */; };
FA6F2D2114F3150E0098AE57 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA6F2D2014F3150E0098AE57 /* CoreFoundation.framework */; };
FA6F2D2414F3150E0098AE57 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = FA6F2D2314F3150E0098AE57 /* main.c */; };
FA6F2D2614F3150E0098AE57 /* magicmouse.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = FA6F2D2514F3150E0098AE57 /* magicmouse.1 */; };
FA6F2D2C14F3154E0098AE57 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA6F2D2A14F315490098AE57 /* ApplicationServices.framework */; };
FAD37AFF14F9836E00B7F09C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA6F2CFD14F315000098AE57 /* Cocoa.framework */; };
FAD37B0114F9836E00B7F09C /* PreferencePanes.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAD37B0014F9836E00B7F09C /* PreferencePanes.framework */; };
FAD37B1714F983B900B7F09C /* MMPrefPane.h in Headers */ = {isa = PBXBuildFile; fileRef = FAD37B1414F983B900B7F09C /* MMPrefPane.h */; };
FAD37B1814F983B900B7F09C /* MMPrefPane.m in Sources */ = {isa = PBXBuildFile; fileRef = FAD37B1514F983B900B7F09C /* MMPrefPane.m */; };
FAD37B1914F983B900B7F09C /* Magic_Mouse.tiff in Resources */ = {isa = PBXBuildFile; fileRef = FAD37B1614F983B900B7F09C /* Magic_Mouse.tiff */; };
FAD37B2414F983D700B7F09C /* Magic_Mouse.xib in Resources */ = {isa = PBXBuildFile; fileRef = FAD37B2214F983D700B7F09C /* Magic_Mouse.xib */; };
FAD37B2C14F983E800B7F09C /* Magic Mouse-Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = FAD37B2A14F983E800B7F09C /* Magic Mouse-Prefix.pch */; };
FAD37B2F14F983F000B7F09C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = FAD37B2D14F983F000B7F09C /* InfoPlist.strings */; };
FADA4A4D14FAEA4F00517F22 /* MMAnimatingImageTableCellView.h in Headers */ = {isa = PBXBuildFile; fileRef = FADA4A4B14FAEA4F00517F22 /* MMAnimatingImageTableCellView.h */; };
FADA4A4E14FAEA4F00517F22 /* MMAnimatingImageTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = FADA4A4C14FAEA4F00517F22 /* MMAnimatingImageTableCellView.m */; };
FADA4A5414FB017400517F22 /* NSCursor_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FADA4A5314FB017400517F22 /* NSCursor_Private.h */; };
FAEBD4AD1551DBAA00F4B4D9 /* MMAdvancedEditWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = FAEBD4AA1551DBAA00F4B4D9 /* MMAdvancedEditWindowController.h */; };
FAEBD4AE1551DBAA00F4B4D9 /* MMAdvancedEditWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = FAEBD4AB1551DBAA00F4B4D9 /* MMAdvancedEditWindowController.m */; };
FAEBD4AF1551DBAA00F4B4D9 /* EditWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = FAEBD4AC1551DBAA00F4B4D9 /* EditWindow.xib */; };
FAFC6EAE14F9AD0D00379751 /* magicmouse in Copy magicmouse */ = {isa = PBXBuildFile; fileRef = FA6F2D1E14F3150E0098AE57 /* magicmouse */; };
FAFC6EB414F9C1C300379751 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAFC6EB214F9C1C300379751 /* Security.framework */; };
FAFC6EB514F9C1C300379751 /* SecurityInterface.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAFC6EB314F9C1C300379751 /* SecurityInterface.framework */; };
FAFC6EB814F9E3F500379751 /* MMCursorAggregate.h in Headers */ = {isa = PBXBuildFile; fileRef = FAFC6EB614F9E3F500379751 /* MMCursorAggregate.h */; };
FAFC6EB914F9E3F500379751 /* MMCursorAggregate.m in Sources */ = {isa = PBXBuildFile; fileRef = FAFC6EB714F9E3F500379751 /* MMCursorAggregate.m */; };
FAFC6EBA14F9EA9F00379751 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA319D3B14F353C50064E7CC /* Accelerate.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
FADA4A5514FB05C900517F22 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FA6F2CF014F314FF0098AE57 /* Project object */;
proxyType = 1;
remoteGlobalIDString = FA6F2D1D14F3150E0098AE57;
remoteInfo = magicmouse;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
FA6F2D1C14F3150E0098AE57 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
FA6F2D2614F3150E0098AE57 /* magicmouse.1 in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 1;
};
FAFC6EAD14F9ACEF00379751 /* Copy magicmouse */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 6;
files = (
FAFC6EAE14F9AD0D00379751 /* magicmouse in Copy magicmouse */,
);
name = "Copy magicmouse";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
0E7C3CC414F9FB1A0003A5FE /* cursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = cursor.png; path = ../cursor.png; sourceTree = "<group>"; };
FA02424314FF0993006E6FE1 /* MMAdvancedEditViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MMAdvancedEditViewController.h; path = src/Controllers/MMAdvancedEditViewController.h; sourceTree = "<group>"; };
FA02424414FF0993006E6FE1 /* MMAdvancedEditViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MMAdvancedEditViewController.m; path = src/Controllers/MMAdvancedEditViewController.m; sourceTree = "<group>"; };
FA02424514FF0993006E6FE1 /* AdvancedEdit.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = AdvancedEdit.xib; path = src/Controllers/AdvancedEdit.xib; sourceTree = "<group>"; };
FA05ED0F15571D7800BEC0AC /* MMCursorLibrary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MMCursorLibrary.h; path = src/Controllers/MMCursorLibrary.h; sourceTree = "<group>"; };
FA05ED1015571D7800BEC0AC /* MMCursorLibrary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MMCursorLibrary.m; path = src/Controllers/MMCursorLibrary.m; sourceTree = "<group>"; };
FA07746B14F9976100A1B91B /* MMAnimatingImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MMAnimatingImageView.h; path = src/Views/MMAnimatingImageView.h; sourceTree = "<group>"; };
FA07746C14F9976100A1B91B /* MMAnimatingImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MMAnimatingImageView.m; path = src/Views/MMAnimatingImageView.m; sourceTree = "<group>"; };
FA07747014F9A25400A1B91B /* CarbonHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CarbonHelpers.h; sourceTree = "<group>"; };
FA07747114F9A25400A1B91B /* CGSAccessibility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGSAccessibility.h; sourceTree = "<group>"; };
FA07747214F9A25400A1B91B /* CGSCIFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGSCIFilter.h; sourceTree = "<group>"; };
FA07747314F9A25400A1B91B /* CGSConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGSConnection.h; sourceTree = "<group>"; };
FA07747414F9A25400A1B91B /* CGSCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGSCursor.h; sourceTree = "<group>"; };
FA07747514F9A25400A1B91B /* CGSDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGSDebug.h; sourceTree = "<group>"; };
FA07747614F9A25400A1B91B /* CGSDisplays.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGSDisplays.h; sourceTree = "<group>"; };
FA07747714F9A25400A1B91B /* CGSHotKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGSHotKeys.h; sourceTree = "<group>"; };
FA07747814F9A25400A1B91B /* CGSInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGSInternal.h; sourceTree = "<group>"; };
FA07747914F9A25400A1B91B /* CGSMisc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGSMisc.h; sourceTree = "<group>"; };
FA07747A14F9A25400A1B91B /* CGSNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGSNotifications.h; sourceTree = "<group>"; };
FA07747B14F9A25400A1B91B /* CGSRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGSRegion.h; sourceTree = "<group>"; };
FA07747C14F9A25400A1B91B /* CGSSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGSSession.h; sourceTree = "<group>"; };
FA07747D14F9A25400A1B91B /* CGSTransitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGSTransitions.h; sourceTree = "<group>"; };
FA07747E14F9A25400A1B91B /* CGSWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGSWindow.h; sourceTree = "<group>"; };
FA07747F14F9A25400A1B91B /* CGSWorkspace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGSWorkspace.h; sourceTree = "<group>"; };
FA21EF961550C642002D688E /* MMCursorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MMCursorViewController.h; path = src/Controllers/MMCursorViewController.h; sourceTree = "<group>"; };
FA21EF971550C642002D688E /* MMCursorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MMCursorViewController.m; path = src/Controllers/MMCursorViewController.m; sourceTree = "<group>"; };
FA319D3B14F353C50064E7CC /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; };
FA6F2CFD14F315000098AE57 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
FA6F2D0014F315000098AE57 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
FA6F2D0114F315000098AE57 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
FA6F2D0214F315000098AE57 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
FA6F2D1E14F3150E0098AE57 /* magicmouse */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = magicmouse; sourceTree = BUILT_PRODUCTS_DIR; };
FA6F2D2014F3150E0098AE57 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
FA6F2D2314F3150E0098AE57 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
FA6F2D2514F3150E0098AE57 /* magicmouse.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = magicmouse.1; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.man; };
FA6F2D2A14F315490098AE57 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = System/Library/Frameworks/ApplicationServices.framework; sourceTree = SDKROOT; };
FAD37AF614F9830600B7F09C /* MMDefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMDefs.h; sourceTree = "<group>"; };
FAD37AFE14F9836E00B7F09C /* Magic Mouse.prefPane */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Magic Mouse.prefPane"; sourceTree = BUILT_PRODUCTS_DIR; };
FAD37B0014F9836E00B7F09C /* PreferencePanes.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PreferencePanes.framework; path = System/Library/Frameworks/PreferencePanes.framework; sourceTree = SDKROOT; };
FAD37B1414F983B900B7F09C /* MMPrefPane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMPrefPane.h; sourceTree = "<group>"; };
FAD37B1514F983B900B7F09C /* MMPrefPane.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMPrefPane.m; sourceTree = "<group>"; };
FAD37B1614F983B900B7F09C /* Magic_Mouse.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Magic_Mouse.tiff; sourceTree = "<group>"; };
FAD37B2314F983D700B7F09C /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/Magic_Mouse.xib; sourceTree = "<group>"; };
FAD37B2914F983E800B7F09C /* Magic Mouse-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Magic Mouse-Info.plist"; sourceTree = "<group>"; };
FAD37B2A14F983E800B7F09C /* Magic Mouse-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Magic Mouse-Prefix.pch"; sourceTree = "<group>"; };
FAD37B2E14F983F000B7F09C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
FADA4A4B14FAEA4F00517F22 /* MMAnimatingImageTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MMAnimatingImageTableCellView.h; path = src/Views/MMAnimatingImageTableCellView.h; sourceTree = "<group>"; };
FADA4A4C14FAEA4F00517F22 /* MMAnimatingImageTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MMAnimatingImageTableCellView.m; path = src/Views/MMAnimatingImageTableCellView.m; sourceTree = "<group>"; };
FADA4A5314FB017400517F22 /* NSCursor_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSCursor_Private.h; sourceTree = "<group>"; };
FAEBD4AA1551DBAA00F4B4D9 /* MMAdvancedEditWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MMAdvancedEditWindowController.h; path = src/Controllers/MMAdvancedEditWindowController.h; sourceTree = "<group>"; };
FAEBD4AB1551DBAA00F4B4D9 /* MMAdvancedEditWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MMAdvancedEditWindowController.m; path = src/Controllers/MMAdvancedEditWindowController.m; sourceTree = "<group>"; };
FAEBD4AC1551DBAA00F4B4D9 /* EditWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = EditWindow.xib; path = src/Controllers/EditWindow.xib; sourceTree = "<group>"; };
FAFC6EB214F9C1C300379751 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
FAFC6EB314F9C1C300379751 /* SecurityInterface.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SecurityInterface.framework; path = System/Library/Frameworks/SecurityInterface.framework; sourceTree = SDKROOT; };
FAFC6EB614F9E3F500379751 /* MMCursorAggregate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMCursorAggregate.h; sourceTree = "<group>"; };
FAFC6EB714F9E3F500379751 /* MMCursorAggregate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMCursorAggregate.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
FA6F2D1B14F3150E0098AE57 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FA319D3C14F353C50064E7CC /* Accelerate.framework in Frameworks */,
FA6F2D2114F3150E0098AE57 /* CoreFoundation.framework in Frameworks */,
FA6F2D2C14F3154E0098AE57 /* ApplicationServices.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FAD37AF914F9836E00B7F09C /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FAFC6EB414F9C1C300379751 /* Security.framework in Frameworks */,
FAFC6EB514F9C1C300379751 /* SecurityInterface.framework in Frameworks */,
FAD37AFF14F9836E00B7F09C /* Cocoa.framework in Frameworks */,
FAFC6EBA14F9EA9F00379751 /* Accelerate.framework in Frameworks */,
FAD37B0114F9836E00B7F09C /* PreferencePanes.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
FA05ED1A1557286500BEC0AC /* Views */ = {
isa = PBXGroup;
children = (
FA07746B14F9976100A1B91B /* MMAnimatingImageView.h */,
FA07746C14F9976100A1B91B /* MMAnimatingImageView.m */,
FADA4A4B14FAEA4F00517F22 /* MMAnimatingImageTableCellView.h */,
FADA4A4C14FAEA4F00517F22 /* MMAnimatingImageTableCellView.m */,
);
name = Views;
sourceTree = "<group>";
};
FA07746F14F9A25400A1B91B /* CGSInternal */ = {
isa = PBXGroup;
children = (
FA07747014F9A25400A1B91B /* CarbonHelpers.h */,
FA07747114F9A25400A1B91B /* CGSAccessibility.h */,
FA07747214F9A25400A1B91B /* CGSCIFilter.h */,
FA07747314F9A25400A1B91B /* CGSConnection.h */,
FA07747414F9A25400A1B91B /* CGSCursor.h */,
FA07747514F9A25400A1B91B /* CGSDebug.h */,
FA07747614F9A25400A1B91B /* CGSDisplays.h */,
FA07747714F9A25400A1B91B /* CGSHotKeys.h */,
FA07747814F9A25400A1B91B /* CGSInternal.h */,
FA07747914F9A25400A1B91B /* CGSMisc.h */,
FA07747A14F9A25400A1B91B /* CGSNotifications.h */,
FA07747B14F9A25400A1B91B /* CGSRegion.h */,
FA07747C14F9A25400A1B91B /* CGSSession.h */,
FA07747D14F9A25400A1B91B /* CGSTransitions.h */,
FA07747E14F9A25400A1B91B /* CGSWindow.h */,
FA07747F14F9A25400A1B91B /* CGSWorkspace.h */,
);
path = CGSInternal;
sourceTree = "<group>";
};
FA6F2CEE14F314FF0098AE57 = {
isa = PBXGroup;
children = (
FA6F2D2214F3150E0098AE57 /* magicmouse */,
FAD37B0214F9836E00B7F09C /* Magic Mouse */,
FA6F2CFC14F315000098AE57 /* Frameworks */,
FA6F2CFA14F315000098AE57 /* Products */,
);
sourceTree = "<group>";
};
FA6F2CFA14F315000098AE57 /* Products */ = {
isa = PBXGroup;
children = (
FA6F2D1E14F3150E0098AE57 /* magicmouse */,
FAD37AFE14F9836E00B7F09C /* Magic Mouse.prefPane */,
);
name = Products;
sourceTree = "<group>";
};
FA6F2CFC14F315000098AE57 /* Frameworks */ = {
isa = PBXGroup;
children = (
FAFC6EB214F9C1C300379751 /* Security.framework */,
FAFC6EB314F9C1C300379751 /* SecurityInterface.framework */,
FA319D3B14F353C50064E7CC /* Accelerate.framework */,
FA6F2D2A14F315490098AE57 /* ApplicationServices.framework */,
FA6F2CFD14F315000098AE57 /* Cocoa.framework */,
FA6F2D2014F3150E0098AE57 /* CoreFoundation.framework */,
FAD37B0014F9836E00B7F09C /* PreferencePanes.framework */,
FA6F2CFF14F315000098AE57 /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
FA6F2CFF14F315000098AE57 /* Other Frameworks */ = {
isa = PBXGroup;
children = (
FA6F2D0014F315000098AE57 /* AppKit.framework */,
FA6F2D0114F315000098AE57 /* CoreData.framework */,
FA6F2D0214F315000098AE57 /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
FA6F2D2214F3150E0098AE57 /* magicmouse */ = {
isa = PBXGroup;
children = (
FAD37AF614F9830600B7F09C /* MMDefs.h */,
FA07746F14F9A25400A1B91B /* CGSInternal */,
FA6F2D2314F3150E0098AE57 /* main.c */,
FA6F2D2514F3150E0098AE57 /* magicmouse.1 */,
);
path = magicmouse;
sourceTree = "<group>";
};
FAD37B0214F9836E00B7F09C /* Magic Mouse */ = {
isa = PBXGroup;
children = (
FADA4A5314FB017400517F22 /* NSCursor_Private.h */,
FAD37B1414F983B900B7F09C /* MMPrefPane.h */,
FAD37B1514F983B900B7F09C /* MMPrefPane.m */,
FA21EF961550C642002D688E /* MMCursorViewController.h */,
FA21EF971550C642002D688E /* MMCursorViewController.m */,
FAFC6EB614F9E3F500379751 /* MMCursorAggregate.h */,
FAFC6EB714F9E3F500379751 /* MMCursorAggregate.m */,
FA02424314FF0993006E6FE1 /* MMAdvancedEditViewController.h */,
FA02424414FF0993006E6FE1 /* MMAdvancedEditViewController.m */,
FAEBD4AA1551DBAA00F4B4D9 /* MMAdvancedEditWindowController.h */,
FAEBD4AB1551DBAA00F4B4D9 /* MMAdvancedEditWindowController.m */,
FA05ED0F15571D7800BEC0AC /* MMCursorLibrary.h */,
FA05ED1015571D7800BEC0AC /* MMCursorLibrary.m */,
FA05ED1A1557286500BEC0AC /* Views */,
FAD37B0314F9836E00B7F09C /* Supporting Files */,
);
path = "Magic Mouse";
sourceTree = "<group>";
};
FAD37B0314F9836E00B7F09C /* Supporting Files */ = {
isa = PBXGroup;
children = (
0E7C3CC414F9FB1A0003A5FE /* cursor.png */,
FAD37B1614F983B900B7F09C /* Magic_Mouse.tiff */,
FA02424514FF0993006E6FE1 /* AdvancedEdit.xib */,
FAEBD4AC1551DBAA00F4B4D9 /* EditWindow.xib */,
FAD37B2214F983D700B7F09C /* Magic_Mouse.xib */,
FAD37B2D14F983F000B7F09C /* InfoPlist.strings */,
FAD37B2914F983E800B7F09C /* Magic Mouse-Info.plist */,
FAD37B2A14F983E800B7F09C /* Magic Mouse-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
FAD37AFA14F9836E00B7F09C /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
FAD37B1714F983B900B7F09C /* MMPrefPane.h in Headers */,
FAD37B2C14F983E800B7F09C /* Magic Mouse-Prefix.pch in Headers */,
FA07748114F9A70E00A1B91B /* MMAnimatingImageView.h in Headers */,
FAFC6EB814F9E3F500379751 /* MMCursorAggregate.h in Headers */,
FADA4A4D14FAEA4F00517F22 /* MMAnimatingImageTableCellView.h in Headers */,
FADA4A5414FB017400517F22 /* NSCursor_Private.h in Headers */,
FA02424614FF0993006E6FE1 /* MMAdvancedEditViewController.h in Headers */,
FA21EF981550C642002D688E /* MMCursorViewController.h in Headers */,
FAEBD4AD1551DBAA00F4B4D9 /* MMAdvancedEditWindowController.h in Headers */,
FA05ED1115571D7800BEC0AC /* MMCursorLibrary.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
FA6F2D1D14F3150E0098AE57 /* magicmouse */ = {
isa = PBXNativeTarget;
buildConfigurationList = FA6F2D2714F3150E0098AE57 /* Build configuration list for PBXNativeTarget "magicmouse" */;
buildPhases = (
FA6F2D1A14F3150E0098AE57 /* Sources */,
FA6F2D1B14F3150E0098AE57 /* Frameworks */,
FA6F2D1C14F3150E0098AE57 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = magicmouse;
productName = magicmouse;
productReference = FA6F2D1E14F3150E0098AE57 /* magicmouse */;
productType = "com.apple.product-type.tool";
};
FAD37AFD14F9836E00B7F09C /* Magic Mouse */ = {
isa = PBXNativeTarget;
buildConfigurationList = FAD37B1114F9836E00B7F09C /* Build configuration list for PBXNativeTarget "Magic Mouse" */;
buildPhases = (
FAD37AF814F9836E00B7F09C /* Sources */,
FAD37AF914F9836E00B7F09C /* Frameworks */,
FAD37AFA14F9836E00B7F09C /* Headers */,
FAD37AFB14F9836E00B7F09C /* Resources */,
FAFC6EAD14F9ACEF00379751 /* Copy magicmouse */,
FA129BAC151297FF00F28572 /* ShellScript */,
);
buildRules = (
);
dependencies = (
FADA4A5614FB05C900517F22 /* PBXTargetDependency */,
);
name = "Magic Mouse";
productName = "Magic Mouse";
productReference = FAD37AFE14F9836E00B7F09C /* Magic Mouse.prefPane */;
productType = "com.apple.product-type.bundle";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
FA6F2CF014F314FF0098AE57 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0440;
ORGANIZATIONNAME = "Alex Zielenski";
};
buildConfigurationList = FA6F2CF314F314FF0098AE57 /* Build configuration list for PBXProject "Magic Mouse" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = FA6F2CEE14F314FF0098AE57;
productRefGroup = FA6F2CFA14F315000098AE57 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
FA6F2D1D14F3150E0098AE57 /* magicmouse */,
FAD37AFD14F9836E00B7F09C /* Magic Mouse */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
FAD37AFB14F9836E00B7F09C /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FAD37B1914F983B900B7F09C /* Magic_Mouse.tiff in Resources */,
FAD37B2414F983D700B7F09C /* Magic_Mouse.xib in Resources */,
FAD37B2F14F983F000B7F09C /* InfoPlist.strings in Resources */,
0E7C3CC514F9FB1A0003A5FE /* cursor.png in Resources */,
FA02424814FF0993006E6FE1 /* AdvancedEdit.xib in Resources */,
FAEBD4AF1551DBAA00F4B4D9 /* EditWindow.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
FA129BAC151297FF00F28572 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#!/bin/bash\nbuildNumber=$(/usr/libexec/PlistBuddy -c \"Print CFBundleVersion\" \"Magic Mouse/Magic Mouse-Info.plist\")\nbuildNumber=$(($buildNumber + 1))\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $buildNumber\" \"Magic Mouse/Magic Mouse-Info.plist\"";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
FA6F2D1A14F3150E0098AE57 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FA6F2D2414F3150E0098AE57 /* main.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FAD37AF814F9836E00B7F09C /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FAD37B1814F983B900B7F09C /* MMPrefPane.m in Sources */,
FA07748014F9A70A00A1B91B /* MMAnimatingImageView.m in Sources */,
FAFC6EB914F9E3F500379751 /* MMCursorAggregate.m in Sources */,
FADA4A4E14FAEA4F00517F22 /* MMAnimatingImageTableCellView.m in Sources */,
FA02424714FF0993006E6FE1 /* MMAdvancedEditViewController.m in Sources */,
FA21EF991550C642002D688E /* MMCursorViewController.m in Sources */,
FAEBD4AE1551DBAA00F4B4D9 /* MMAdvancedEditWindowController.m in Sources */,
FA05ED1215571D7800BEC0AC /* MMCursorLibrary.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
FADA4A5614FB05C900517F22 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = FA6F2D1D14F3150E0098AE57 /* magicmouse */;
targetProxy = FADA4A5514FB05C900517F22 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
FAD37B2214F983D700B7F09C /* Magic_Mouse.xib */ = {
isa = PBXVariantGroup;
children = (
FAD37B2314F983D700B7F09C /* en */,
);
name = Magic_Mouse.xib;
sourceTree = "<group>";
};
FAD37B2D14F983F000B7F09C /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
FAD37B2E14F983F000B7F09C /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
FA6F2D1514F315000098AE57 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
COPY_PHASE_STRIP = NO;
DEPLOYMENT_LOCATION = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "";
SDKROOT = macosx10.7;
};
name = Debug;
};
FA6F2D1614F315000098AE57 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEPLOYMENT_LOCATION = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
OTHER_LDFLAGS = "";
SDKROOT = macosx10.7;
};
name = Release;
};
FA6F2D2814F3150E0098AE57 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
FA6F2D2914F3150E0098AE57 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
FAD37B1214F9836E00B7F09C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
DEPLOYMENT_LOCATION = YES;
DSTROOT = /;
GCC_ENABLE_OBJC_GC = supported;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Magic Mouse/Magic Mouse-Prefix.pch";
INFOPLIST_FILE = "Magic Mouse/Magic Mouse-Info.plist";
INSTALL_PATH = "$(HOME)/Library/PreferencePanes";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = prefPane;
};
name = Debug;
};
FAD37B1314F9836E00B7F09C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
DEPLOYMENT_LOCATION = YES;
DSTROOT = /;
GCC_ENABLE_OBJC_GC = supported;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Magic Mouse/Magic Mouse-Prefix.pch";
INFOPLIST_FILE = "Magic Mouse/Magic Mouse-Info.plist";
INSTALL_PATH = "$(HOME)/Library/PreferencePanes";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = prefPane;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
FA6F2CF314F314FF0098AE57 /* Build configuration list for PBXProject "Magic Mouse" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FA6F2D1514F315000098AE57 /* Debug */,
FA6F2D1614F315000098AE57 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
FA6F2D2714F3150E0098AE57 /* Build configuration list for PBXNativeTarget "magicmouse" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FA6F2D2814F3150E0098AE57 /* Debug */,
FA6F2D2914F3150E0098AE57 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
FAD37B1114F9836E00B7F09C /* Build configuration list for PBXNativeTarget "Magic Mouse" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FAD37B1214F9836E00B7F09C /* Debug */,
FAD37B1314F9836E00B7F09C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = FA6F2CF014F314FF0098AE57 /* Project object */;
}
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Magic Mouse.xcodeproj">
</FileRef>
</Workspace>
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
<true/>
<key>SnapshotAutomaticallyBeforeSignificantChanges</key>
<false/>
</dict>
</plist>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "1.0">
</Bucket>
@@ -1,68 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0440"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FAD37AFD14F9836E00B7F09C"
BuildableName = "Magic Mouse.prefPane"
BlueprintName = "Magic Mouse"
ReferencedContainer = "container:Magic Mouse.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<PathRunnable
FilePath = "/Applications/System Preferences.app">
</PathRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "/Users/Alex/Library/PreferencePanes/Magic Mouse.prefPane"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,92 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0440"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
BuildableName = "magicmouse"
BlueprintName = "magicmouse"
ReferencedContainer = "container:Magic Mouse.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
BuildableName = "magicmouse"
BlueprintName = "magicmouse"
ReferencedContainer = "container:Magic Mouse.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
BuildableName = "magicmouse"
BlueprintName = "magicmouse"
ReferencedContainer = "container:Magic Mouse.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "/Users/Alex/Desktop/svanslos.plist"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
BuildableName = "magicmouse"
BlueprintName = "magicmouse"
ReferencedContainer = "container:Magic Mouse.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Magic Mouse.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>magicmouse.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>FA67E4B614FAD1E300F1D69E</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>FA6F2CF814F315000098AE57</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>FA6F2D1D14F3150E0098AE57</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>FAD37AFD14F9836E00B7F09C</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
@@ -1,58 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FAD37AFD14F9836E00B7F09C"
BuildableName = "Magic Mouse.prefPane"
BlueprintName = "Magic Mouse"
ReferencedContainer = "container:Magic Mouse.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,85 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
BuildableName = "magicmouse"
BlueprintName = "magicmouse"
ReferencedContainer = "container:Magic Mouse.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
BuildableName = "magicmouse"
BlueprintName = "magicmouse"
ReferencedContainer = "container:Magic Mouse.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
BuildableName = "magicmouse"
BlueprintName = "magicmouse"
ReferencedContainer = "container:Magic Mouse.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
BuildableName = "magicmouse"
BlueprintName = "magicmouse"
ReferencedContainer = "container:Magic Mouse.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Magic Mouse.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>magicmouse.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>FA6F2D1D14F3150E0098AE57</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>FAD37AFD14F9836E00B7F09C</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
-61
View File
@@ -1,61 +0,0 @@
//
// MMCursorAggregate.h
// Magic Mouse
//
// Created by Alex Zielenski on 2/25/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MMCursor : NSObject
@property (nonatomic, retain) NSBitmapImageRep *image;
@property (nonatomic, assign) CGFloat frameDuration;
@property (nonatomic, assign) NSInteger frameCount;
@property (nonatomic, assign) NSSize size;
@property (nonatomic, assign) NSPoint hotSpot;
@property (nonatomic, copy) NSString *tableIdentifier;
@property (nonatomic, copy) NSString *defaultKey;
@property (nonatomic, copy) NSString *customKey;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *cursorIdentifier;
// creating a cursor from a dictionary
+ (MMCursor *)cursorWithDictionary:(NSDictionary *)dict;
- (id)initWithCursorDictionary:(NSDictionary *)dict;
// Creating a dictionary from the cursor
- (NSDictionary *)cursorDictionary;
- (NSDictionary *)infoDictionary;
@end
@interface MMCursorAggregate : NSObject {
@private
NSMutableDictionary *_cursors;
}
@property (nonatomic, copy, readonly) NSString *path;
@property (nonatomic, retain) NSDictionary *cursors;
@property (nonatomic, retain) NSString *minimumVersion;
@property (nonatomic, retain) NSString *creatorVersion;
// creating an aggregate from a file
+ (MMCursorAggregate *)aggregateWithContentsOfFile:(NSString *)path;
- (id)initWithContentsOfFile:(NSString *)path;
+ (MMCursorAggregate *)aggregateWithDictionary:(NSDictionary *)dict;
- (id)initWithAggregateDictionary:(NSDictionary *)dict;
// A domain would be the internal reverse-dns identifier used to tag cursors like com.apple.coregraphics.Arrow
- (void)setCursor:(MMCursor *)cursor forDomain:(NSString *)domain;
- (void)removeCursorForDomain:(NSString *)domain;
// Retrieves (if it exists) a cursor in the _cursors ivar with the specified table identifier
- (MMCursor *)cursorForTableIdentifier:(NSString *)identifier;
- (NSDictionary *)dictionaryRepresentation;
@end
-320
View File
@@ -1,320 +0,0 @@
//
// MMCursorAggregate.m
// Magic Mouse
//
// Created by Alex Zielenski on 2/25/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import "MMCursorAggregate.h"
#import "MMDefs.h"
#import <Accelerate/Accelerate.h>
@interface MMCursorAggregate ()
@property (nonatomic, copy, readwrite) NSString *path;
@end
@implementation MMCursorAggregate
@synthesize path = _path;
@synthesize cursors = _cursors;
@synthesize minimumVersion = _minimumVersion;
@synthesize creatorVersion = _creatorVersion;
// creating an aggregate from a file
+ (MMCursorAggregate *)aggregateWithContentsOfFile:(NSString *)path
{
return [[[self alloc] initWithContentsOfFile:path] autorelease];
}
- (id)initWithContentsOfFile:(NSString *)path
{
if ((self = [self initWithAggregateDictionary:[NSDictionary dictionaryWithContentsOfFile:path]]))
self.path = path;
return self;
}
+ (MMCursorAggregate *)aggregateWithDictionary:(NSDictionary *)dict {
return [[[self alloc] initWithAggregateDictionary:dict] autorelease];
}
//!*****************************************************************************************************************************************//
//!** The cursor files are merely plists. They have a root dict with a minimum version, and creator version, and a child dictionary with **//
//!** an Identifiers dictionary and a Cursor data dictionary. each contain neccssary information to override the internal system cursors. **//
//!*****************************************************************************************************************************************//
- (id)initWithAggregateDictionary:(NSDictionary *)dict {
if ((self = [self init])) {
NSDictionary *cursors = [dict objectForKey:(NSString *)kCursorsKey];
NSDictionary *cursorData = [cursors objectForKey:(NSString *)kCursorDataKey];
NSDictionary *global = [cursors objectForKey:(NSString *)kCursorInfoKey];
NSDictionary *identifiers = [global objectForKey:(NSString *)kCursorInfoIdentifiersKey];
for (NSString *key in identifiers) {
NSDictionary *info = [identifiers objectForKey:key];
NSDictionary *data = [cursorData objectForKey:[info objectForKey:(NSString *)kCursorInfoCustomKey]];
MMCursor *cursor = [MMCursor cursorWithDictionary:data];
cursor.cursorIdentifier = key;
cursor.defaultKey = [info objectForKey:(NSString *)kCursorInfoDefaultKey];
cursor.customKey = [info objectForKey:(NSString *)kCursorInfoCustomKey];
cursor.name = [info objectForKey:(NSString *)kCursorInfoNameKey];
cursor.tableIdentifier = [info objectForKey:(NSString *)kCursorInfoTableIdentifierKey];
[self setCursor:cursor forDomain:key];
}
self.minimumVersion = [dict objectForKey:(NSString *)kMinimumVersionKey];
self.creatorVersion = [dict objectForKey:(NSString *)kCreatorVersionKey];
}
return self;
}
- (id)init {
if ((self = [super init])) {
_cursors = [NSMutableDictionary dictionary];
self.minimumVersion = @"1.02";
self.creatorVersion = @"1.02";
}
return self;
}
- (void)dealloc {
self.cursors = nil;
[super dealloc];
}
- (void)setCursor:(MMCursor *)cursor forDomain:(NSString *)domain {
if (!domain||!cursor)
return;
[_cursors setObject:cursor forKey:domain];
}
- (void)removeCursorForDomain:(NSString *)domain {
if (!domain)
return;
[_cursors removeObjectForKey:domain];
}
- (MMCursor *)cursorForTableIdentifier:(NSString *)identifier {
NSArray *ar = [self.cursors.allValues filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"tableIdentifier == %@", identifier]];
if (ar.count>0)
return [ar objectAtIndex:0];
return nil;
}
- (NSDictionary *)dictionaryRepresentation {
NSMutableDictionary *root = [[NSMutableDictionary alloc] init];
NSMutableDictionary *cursors = [[NSMutableDictionary alloc] initWithCapacity:2];
NSMutableDictionary *cursorData = [[NSMutableDictionary alloc] init];
NSMutableDictionary *global = [[NSMutableDictionary alloc] init];
NSMutableDictionary *identifiers = [[NSMutableDictionary alloc] init];
for (NSString *key in self.cursors) {
MMCursor *cursor = [self.cursors objectForKey:key];
[identifiers setObject:cursor.infoDictionary forKey:key];
[cursorData setObject:cursor.cursorDictionary forKey:cursor.customKey];
}
[global setObject:identifiers forKey:(NSString *)kCursorInfoIdentifiersKey];
[cursors setObject:cursorData forKey:(NSString *)kCursorDataKey];
[cursors setObject:global forKey:(NSString *)kCursorInfoKey];
[root setObject:cursors forKey:(NSString *)kCursorsKey];
[root setObject:self.minimumVersion forKey:(NSString *)kMinimumVersionKey];
[root setObject:self.creatorVersion forKey:(NSString *)kCreatorVersionKey];
[identifiers release];
[cursorData release];
[global release];
[cursors release];
return [root autorelease];
}
@end
@implementation MMCursor
@synthesize image = _image;
@synthesize frameCount = _frameCount;
@synthesize frameDuration = _frameDuration;
@synthesize size = _size;
@synthesize hotSpot = _hotSpot;
@synthesize tableIdentifier = _tableIdentifier;
@synthesize defaultKey = _defaultKey;
@synthesize customKey = _customKey;
@synthesize name = _name;
@synthesize cursorIdentifier = _cursorIdentifier;
+ (MMCursor *)cursorWithDictionary:(NSDictionary *)dict {
return [[[self alloc] initWithCursorDictionary:dict] autorelease];
}
- (id)init {
if ((self = [super init])) {
// Some default values
self.name = @"";
self.customKey = @"";
self.defaultKey = @"";
self.tableIdentifier = @"";
self.frameCount = 1;
self.frameDuration = 0.0299999993294477;
}
return self;
}
- (void)dealloc {
self.image = nil;
self.tableIdentifier = nil;
self.defaultKey = nil;
self.customKey = nil;
self.name = nil;
self.cursorIdentifier = nil;
[super dealloc];
}
//!*******************************************************************************************************************************************//
//!** The dictionary passed would be one of the subdictionaries in the cursor data field. This method retrieves all the required info for **//
//!** creating a bitmap from keys in this dictionary. Other values from the identifiers dictionary are added in the parent cursor aggregate.**//
//!*******************************************************************************************************************************************//
- (id)initWithCursorDictionary:(NSDictionary *)dict {
if ((self = [self init])) {
NSData *rawData = [dict objectForKey:(NSString *)kCursorDataDataKey];
NSNumber *width = [dict objectForKey:(NSString *)kCursorDataPixelsWideKey];
NSNumber *height = [dict objectForKey:(NSString *)kCursorDataPixelsHighKey];
NSNumber *hotSpotX = [dict objectForKey:(NSString *)kCursorDataHotspotXKey];
NSNumber *hotSpotY = [dict objectForKey:(NSString *)kCursorDataHotspotYKey];
NSNumber *bytesPerRow = [dict objectForKey:(NSString *)kCursorDataBytesPerRowKey];
NSNumber *bitsPerSample = [dict objectForKey:(NSString *)kCursorDataBitsPerSampleKey];
NSNumber *bitsPerPixel = [dict objectForKey:(NSString *)kCursorDataBitsPerPixelKey];
// NSNumber *samplesPerPixel = [dict objectForKey:(NSString *)kCursorDataSamplesPerPixelKey]; // This key is not needed
NSNumber *frameCount = [dict objectForKey:(NSString *)kCursorDataFrameCountKey];
NSNumber *frameDuration = [dict objectForKey:(NSString *)kCursorDataFrameDurationKey];
self.frameCount = frameCount.integerValue;
self.frameDuration = frameDuration.doubleValue;
self.size = NSMakeSize(width.integerValue, height.integerValue);
self.hotSpot = NSMakePoint(hotSpotX.floatValue, hotSpotY.floatValue);
// Convert the raw data into a presentable format.
// For some crazy reason, It won't let me create the image straight using the NSBitmapImageRep. (32big & Alpha first).
// I will use CGimage and convert it for now
CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData((CFDataRef)rawData);
CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
CGImageRef cursorImage = CGImageCreate(self.size.width,
self.size.height * self.frameCount,
bitsPerSample.intValue,
bitsPerPixel.intValue,
bytesPerRow.intValue,
colorspace,
kCGBitmapByteOrder32Big | kCGImageAlphaFirst,
dataProvider, NULL, false, kCGRenderingIntentDefault);
CGColorSpaceRelease(colorspace);
CGDataProviderRelease(dataProvider);
NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithCGImage:cursorImage];
self.image = rep;
CGImageRelease(cursorImage);
[rep release];
}
return self;
}
//!*****************************************************************************************************************************************//
//!** In this method the values are taken from the MMCursor properties and converted for use in the plist. Specifically, the raw pixel **//
//!** data gets reformatted to ARGB 32-big pixel format to ensure consistency among all of the cursors so that magic mouse can read it. **//
//!*****************************************************************************************************************************************//
- (NSDictionary *)cursorDictionary {
// Creates and returns a dictionary representation for use with magic mouse
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:11];
// Convert the image to raw data
unsigned char *bytePtr = [self.image bitmapData];
BOOL alphaFirst = (self.image.bitmapFormat & NSAlphaFirstBitmapFormat) == NSAlphaFirstBitmapFormat;
BOOL premultiplied = (self.image.bitmapFormat & NSAlphaNonpremultipliedBitmapFormat) == NSAlphaNonpremultipliedBitmapFormat;
BOOL littleByteOrder = (self.image.bitmapFormat & kCGBitmapByteOrder32Little) == kCGBitmapByteOrder32Little;
vImage_Buffer src;
src.data = (void*)bytePtr;
src.rowBytes = self.image.bytesPerRow;
src.width = self.image.size.width;
src.height = self.image.size.height;
uint8_t permuteMap[4];
//! Arrange the bytes to 32 big order and alpha non-premultiplied first. It is imperative that all of tha raw data follows the same format
//! (ARGB, 32-big byte order) otherwise consequences will ensue.
if (alphaFirst) {
if (littleByteOrder) {
// BGRA to ARGB
permuteMap[0] = 3;
permuteMap[1] = 2;
permuteMap[2] = 1;
permuteMap[3] = 0;
} else {
// ARGB to ARGB
permuteMap[0] = 0;
permuteMap[1] = 1;
permuteMap[2] = 2;
permuteMap[3] = 3;
}
} else {
if (littleByteOrder) {
// ABGR to ARGB
permuteMap[0] = 0;
permuteMap[1] = 3;
permuteMap[2] = 2;
permuteMap[3] = 1;
} else {
// RGBA to ARGB
permuteMap[0] = 3;
permuteMap[1] = 0;
permuteMap[2] = 1;
permuteMap[3] = 2;
}
}
// Permute the data using the "scramble" values above
vImagePermuteChannels_ARGB8888(&src, &src, permuteMap, 0);
if (premultiplied) {
// The final data must also remain unpremultiplied, so undo this if the image is unpremultiplied.
vImageUnpremultiplyData_ARGB8888(&src, &src, 0);
}
// Finally set the values to their appropriate key.
NSData *rawData = [NSData dataWithBytes:src.data length:src.rowBytes * src.height];
[dict setObject:rawData forKey:(NSString *)kCursorDataDataKey];
[dict setObject:[NSNumber numberWithInteger:self.image.bytesPerRow] forKey:(NSString *)kCursorDataBytesPerRowKey];
[dict setObject:[NSNumber numberWithInteger:self.image.samplesPerPixel] forKey:(NSString *)kCursorDataSamplesPerPixelKey];
[dict setObject:[NSNumber numberWithInteger:self.image.bitsPerPixel] forKey:(NSString *)kCursorDataBitsPerPixelKey];
[dict setObject:[NSNumber numberWithInteger:self.image.bitsPerSample] forKey:(NSString *)kCursorDataBitsPerSampleKey];
[dict setObject:[NSNumber numberWithFloat:self.frameDuration] forKey:(NSString *)kCursorDataFrameDurationKey];
[dict setObject:[NSNumber numberWithInteger:self.frameCount] forKey:(NSString *)kCursorDataFrameCountKey];
[dict setObject:[NSNumber numberWithInteger:self.size.width] forKey:(NSString *)kCursorDataPixelsWideKey];
[dict setObject:[NSNumber numberWithInteger:self.size.height] forKey:(NSString *)kCursorDataPixelsHighKey];
[dict setObject:[NSNumber numberWithInteger:self.hotSpot.x] forKey:(NSString *)kCursorDataHotspotXKey];
[dict setObject:[NSNumber numberWithInteger:self.hotSpot.y] forKey:(NSString *)kCursorDataHotspotYKey];
return dict;
}
//!*****************************************************************************************************************************************//
//!** This method creates the dictionary for use in the Identifiers dictionary. (As opposed to cursor data above). These values are **//
//!** assigned during initialization in the cursor aggregate and are used to see which cursor image replaces what and where to display it **//
//!*****************************************************************************************************************************************//
- (NSDictionary *)infoDictionary {
return [NSDictionary dictionaryWithObjectsAndKeys:
self.defaultKey, (NSString *)kCursorInfoDefaultKey,
self.customKey, (NSString*)kCursorInfoCustomKey,
self.name, (NSString *)kCursorInfoNameKey,
self.tableIdentifier, (NSString*)kCursorInfoTableIdentifierKey, nil];
}
@end
-46
View File
@@ -1,46 +0,0 @@
//
// MMPrefPane.h
// Magic Mouse
//
// Created by Alex Zielenski on 2/25/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import <PreferencePanes/PreferencePanes.h>
#import <SecurityInterface/SFAuthorizationView.h>
#import "MMCursorAggregate.h"
#import "MMCursorViewController.h"
#import "MMAdvancedEditWindowController.h"
#import "MMCursorLibrary.h"
@interface MMPrefPane : NSPreferencePane <NSTabViewDelegate, NSMenuDelegate>
@property (nonatomic, assign) IBOutlet SFAuthorizationView *authView;
@property (nonatomic, assign) IBOutlet NSPopUpButton *cursorPicker;
@property (nonatomic, assign) CGFloat cursorScale;
@property (nonatomic, retain) MMCursorAggregate *currentCursor;
@property (nonatomic, retain) IBOutlet MMCursorViewController *cursorViewController;
@property (nonatomic, retain) MMAdvancedEditWindowController *advancedEditWindowController;
@property (nonatomic, retain) MMCursorLibrary *cursorLibrary;
- (void)mainViewDidLoad;
- (void)initializeData;
- (void)initializeCursorData;
- (BOOL)isUnlocked;
// Interface actions
- (IBAction)applyCursors:(NSButton *)sender;
- (IBAction)resetCursors:(NSButton *)sender;
- (IBAction)visitWebsite:(NSButton *)sender;
- (IBAction)donate:(NSButton *)sender;
- (IBAction)uninstall:(NSButton *)sender;
- (IBAction)importCursor:(NSMenuItem *)sender;
- (IBAction)exportCursor:(NSMenuItem *)sender;
- (IBAction)advancedEdit:(NSMenuItem *)sender;
- (void)chooseCursor:(id)sender;
- (void)dumpCursorsToFile:(NSString*)filePath;
@end
-390
View File
@@ -1,390 +0,0 @@
//
// MMPrefPane.m
// Magic Mouse
//
// Created by Alex Zielenski on 2/25/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import "MMPrefPane.h"
#import "NSCursor_Private.h"
#import "MMAdvancedEditViewController.h"
@interface MMPrefPane () {
CGFloat _cursorScale;
dispatch_queue_t _actionQueue;
}
@property (nonatomic, assign) IBOutlet NSPopUpButton *_cursorThemes;
@property (nonatomic, assign) IBOutlet NSPopUpButton *_actionMenu;
@end
// Why does CFPreferences suck so much hard nuts?
@implementation MMPrefPane
#pragma mark - Private Properties
@synthesize _cursorThemes;
@synthesize _actionMenu;
#pragma mark - Public Properties
@dynamic cursorScale;
@dynamic currentCursor;
@synthesize authView = _authView;
@synthesize cursorViewController = _cursorViewController;
@synthesize advancedEditWindowController = _advancedEditWindowController;
@synthesize cursorLibrary = _cursorLibrary;
@synthesize cursorPicker = _cursorPicker;
#pragma mark - Lifecycle
- (void)dealloc {
[self.cursorViewController unbind:@"enabled"];
self.authView = nil;
self.cursorViewController = nil;
self.advancedEditWindowController = nil;
[super dealloc];
}
- (void)mainViewDidLoad {
NSArray *supports = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory,
NSUserDomainMask,
YES);
NSString *appSupport = [[supports objectAtIndex:0] stringByAppendingPathComponent:@"MagicMouse"];
NSFileManager *manager = [NSFileManager defaultManager];
[manager createDirectoryAtPath:appSupport withIntermediateDirectories:YES attributes:nil error:nil];
self.cursorLibrary = [MMCursorLibrary libraryWithPath:appSupport];
_actionQueue = dispatch_queue_create("com.alexzielenski.magicmouse.action.queue", 0);
[self initializeCursorData];
self.advancedEditWindowController = [[[MMAdvancedEditWindowController alloc] initWithWindowNibName:@"EditWindow"] autorelease];
// Gather some authorization rights for the lock.
AuthorizationItem items = {kAuthorizationRightExecute, 0, NULL, 0};
AuthorizationRights rights = {1, &items};
self.authView.authorizationRights = &rights;
self.authView.delegate = self;
self.authView.autoupdate = YES;
// Update the lock for our new rights
[self.authView updateStatus:nil];
// Action Menu Force it to have the gear
[self._actionMenu.cell setUsesItemFromMenu:NO];
NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:@"" action:NULL keyEquivalent:@""] autorelease];
item.image = [NSImage imageNamed:@"NSActionTemplate"];
item.onStateImage = nil;
item.mixedStateImage = nil;
[self._actionMenu.cell setMenuItem:item];
[self.cursorViewController bind:@"enabled" toObject:self withKeyPath:@"isUnlocked" options:nil];
self.cursorPicker.action = @selector(chooseCursor:);
self.cursorPicker.target = self;
self.cursorPicker.menu.delegate = self;
// Size to fit
[self chooseCursor:self.cursorPicker];
[self menuNeedsUpdate:self.cursorPicker.menu];
[self.cursorPicker selectItemAtIndex:0];
}
- (void)willSelect {
// Renew data every time the prefpane opens
[self initializeData];
}
- (void)initializeData {
[self willChangeValueForKey:@"cursorScale"];
// Get the current cursor scale. It needs to be synchronous so that the text field is always in sync
NSTask *task = [[NSTask alloc] init];
task.launchPath = kMMToolPath;
task.arguments = [NSArray arrayWithObject:@"-s"];
task.standardOutput = [NSPipe pipe];
[task launch];
[task waitUntilExit];
// We need a way to view the output because the tool logs the current cursor scale.
NSFileHandle *outFileHandle = [task.standardOutput fileHandleForReading];
NSData *data = [outFileHandle availableData];
NSString *output = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
_cursorScale = output.doubleValue;
[self didChangeValueForKey:@"cursorScale"];
[output release];
[task release];
// Dump the current cursors to a temporary location for the initial table view.
NSString *cursorDump = [NSTemporaryDirectory() stringByAppendingPathComponent:@"magicmousecursordump.plist"];
[self dumpCursorsToFile:cursorDump];
self.currentCursor = [MMCursorAggregate aggregateWithContentsOfFile:cursorDump];
}
- (void)initializeCursorData {
// These methods tell CoreGraphics to register the images internally. I don't know how it does itbut it does.
[[NSCursor contextualMenuCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor arrowCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor IBeamCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor pointingHandCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor closedHandCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor openHandCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor resizeLeftCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor resizeRightCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor resizeLeftRightCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor resizeUpCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor resizeDownCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor resizeUpDownCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor crosshairCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor disappearingItemCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor operationNotAllowedCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor busyButClickableCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor contextualMenuCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor IBeamCursorForVerticalLayout] _getImageAndHotSpotFromCoreCursor];
[[NSCursor dragCopyCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor dragLinkCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _genericDragCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _handCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _closedHandCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _moveCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _waitCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _crosshairCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _horizontalResizeCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _verticalResizeCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _bottomLeftResizeCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _topLeftResizeCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _bottomRightResizeCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _topRightResizeCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _resizeLeftCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _resizeRightCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _resizeLeftRightCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _zoomInCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _zoomOutCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _windowResizeEastCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _windowResizeEastWestCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _windowResizeNorthCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _windowResizeNorthEastCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _windowResizeNorthEastSouthWestCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _windowResizeNorthSouthCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _windowResizeNorthWestCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _windowResizeNorthWestSouthEastCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _windowResizeSouthCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _windowResizeSouthEastCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _windowResizeSouthWestCursor] _getImageAndHotSpotFromCoreCursor];
[[NSCursor _windowResizeWestCursor] _getImageAndHotSpotFromCoreCursor];
}
#pragma mark - Accessors
#import <objc/runtime.h>
static char MMCurrentCursor;
- (CGFloat)cursorScale {
return _cursorScale;
}
- (void)setCursorScale:(CGFloat)cursorScale {
// Tell the observers it change, write it out to prefs, and use magicmouse tool to change the scale
[self willChangeValueForKey:@"cursorScale"];
_cursorScale = cursorScale;
[self didChangeValueForKey:@"cursorScale"];
NSNumber *scaleNum = [NSNumber numberWithDouble:cursorScale];
NSTask *task = [[NSTask alloc] init];
task.launchPath = kMMToolPath;
task.arguments = [NSArray arrayWithObjects:@"-s", scaleNum.stringValue, nil];
task.standardOutput = [NSPipe pipe]; // We don't want to spam the console with the output from this
[task launch];
[task waitUntilExit];
[task release];
}
- (MMCursorAggregate *)currentCursor {
return objc_getAssociatedObject(self, &MMCurrentCursor);
}
- (void)setCurrentCursor:(MMCursorAggregate *)currentCursor {
[self willChangeValueForKey:@"currentCursor"];
objc_setAssociatedObject(self, &MMCurrentCursor, currentCursor, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
[self didChangeValueForKey:@"currentCursor"];
[self.cursorViewController.tableView reloadData];
}
- (BOOL)isUnlocked {
return YES;//([_authView authorizationState] == SFAuthorizationViewUnlockedState);
}
#pragma mark - User Interface Actions
- (IBAction)applyCursors:(NSButton *)sender {
// Save the current cursor to a temporary location and then apply it with the command line tool.
NSString *location = self.cursorViewController.cursor.path;
if (!location) {
[NSTemporaryDirectory() stringByAppendingPathComponent:@"MagicMouseTemporary.MightyMouse"];
[self.cursorViewController.cursor.dictionaryRepresentation writeToFile:location atomically:NO];
}
dispatch_async(_actionQueue, ^{
NSTask *task = [[NSTask alloc] init];
task.launchPath = kMMToolPath;
task.arguments = [NSArray arrayWithObject:location];
task.standardOutput = [NSPipe pipe];
[task launch];
[task waitUntilExit];
[task release];
// Update the cursor
//! TODO: Find some way to update the cursor live
[NSCursor _clearOverrideCursorAndSetArrow];
[NSCursor _makeCursors];
[NSCursor _clearOverrideCursorAndSetArrow];
});
}
- (IBAction)resetCursors:(NSButton *)sender {
[self initializeData];
[self.cursorViewController.tableView reloadData];
}
- (IBAction)visitWebsite:(NSButton *)sender {
[[NSWorkspace sharedWorkspace] openURL:kMMWebsiteURL];
}
- (IBAction)donate:(NSButton *)sender {
[[NSWorkspace sharedWorkspace] openURL:kMMDonateURL];
}
- (IBAction)uninstall:(NSButton *)sender {
// Delete the prefpane, remove the launch daemon, remove the preferences
}
- (IBAction)importCursor:(NSMenuItem *)sender {
NSOpenPanel *sp = [NSOpenPanel openPanel];
sp.title = @"Import Cursor";
sp.message = @"Select a cursor to import into your library.";
sp.prompt = @"Import";
sp.allowedFileTypes = [NSArray arrayWithObject:@"MightyMouse"];
[sp beginSheetModalForWindow:[NSApp mainWindow]
completionHandler:^(NSInteger result){
if (result == NSFileHandlingPanelOKButton) {
// self.currentCursor = [MMCursorAggregate aggregateWithDictionary:[NSDictionary dictionaryWithContentsOfURL:sp.URL]];
[self.cursorLibrary addCursorAtPath:sp.URL.path];
}
}];
}
- (IBAction)exportCursor:(NSMenuItem *)sender {
NSSavePanel *sp = [NSSavePanel savePanel];
sp.title = @"Export Cursor";
sp.message = @"Select where to export the cursor.";
sp.prompt = @"Export";
sp.allowedFileTypes = [NSArray arrayWithObject:@"MightyMouse"];
[sp beginSheetModalForWindow:[NSApp mainWindow]
completionHandler:^(NSInteger result){
if (result == NSFileHandlingPanelOKButton) {
[self.cursorViewController.cursor.dictionaryRepresentation writeToURL:sp.URL atomically:YES];
}
}];
}
- (void)chooseCursor:(NSPopUpButton *)sender
{
[sender sizeToFit];
sender.frameOrigin = NSMakePoint(round(NSWidth(sender.superview.bounds) / 2 - NSWidth(sender.frame) / 2), sender.frame.origin.y);
}
- (IBAction)advancedEdit:(NSMenuItem *)sender {
[self.advancedEditWindowController displayForWindow:[NSApp mainWindow] cursor:self.cursorViewController.cursor];
}
- (void)dumpCursorsToFile:(NSString*)filePath {
[[NSFileManager defaultManager] removeItemAtPath:filePath error:nil];
// Ask the tool to dump the cursors
NSTask *task = [[NSTask alloc] init];
task.launchPath = kMMToolPath;
task.arguments = [NSArray arrayWithObjects:@"-d", filePath, nil];
[task launch];
[task waitUntilExit];
[task release];
}
#pragma mark - NSMenuDelegate
- (NSInteger)numberOfItemsInMenu:(NSMenu *)menu
{
return self.cursorLibrary.cursors.count + 1; // For the currently applied cursor, of course.
}
- (void)menuNeedsUpdate:(NSMenu *)menu
{
NSInteger count = [self numberOfItemsInMenu:menu];
while ([menu numberOfItems] < count)
[menu insertItem:[[NSMenuItem new] autorelease] atIndex:0];
while ([menu numberOfItems] > count)
[menu removeItemAtIndex:0];
for (NSInteger index = 0; index < count; index++)
[self menu:menu updateItem:[menu itemAtIndex:index] atIndex:index shouldCancel:NO];
}
- (BOOL)menu:(NSMenu *)menu updateItem:(NSMenuItem *)item atIndex:(NSInteger)index shouldCancel:(BOOL)shouldCancel
{
if (shouldCancel)
return NO;
if (index == 0) {
[item setTitle:@"Current"];
return YES;
}
MMCursorAggregate *cursor = [self.cursorLibrary.cursors.allObjects objectAtIndex:0];
item.title = cursor.path.lastPathComponent.stringByDeletingPathExtension;
return YES;
}
#pragma mark - Authorization Delegate
- (void)authorizationViewDidAuthorize:(SFAuthorizationView *)view {
[self willChangeValueForKey:@"isUnlocked"];
// Let observers know.
[self didChangeValueForKey:@"isUnlocked"];
}
- (void)authorizationViewDidDeauthorize:(SFAuthorizationView *)view {
[self willChangeValueForKey:@"isUnlocked"];
// Let observers know.
[self didChangeValueForKey:@"isUnlocked"];
}
@end
-36
View File
@@ -1,36 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.alexzielenski.magicmouse-prefs</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>246</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012 Alex Zielenski. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>Magic_Mouse</string>
<key>NSPrefPaneIconFile</key>
<string>cursor.png</string>
<key>NSPrefPaneIconLabel</key>
<string>Magic Mouse</string>
<key>NSPrincipalClass</key>
<string>MMPrefPane</string>
</dict>
</plist>
-14
View File
@@ -1,14 +0,0 @@
//
// Prefix header for all source files of the 'Magic Mouse' target in the 'Magic Mouse' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#import "MMDefs.h"
#define kMMPrefsBundle [NSBundle bundleForClass:NSClassFromString(@"MMPrefPane")]
#define kMMToolPath [kMMPrefsBundle pathForAuxiliaryExecutable:@"magicmouse"]
#define kMMDonateURL [NSURL URLWithString:@"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=H6B999S6C3UX2"]
#define kMMWebsiteURL [NSURL URLWithString:@"http://alexzielenski.com"]
#define kMMCursorLibraryPath @"/Library/Application Support/Magic Mouse/"
#endif
Binary file not shown.
-97
View File
@@ -1,97 +0,0 @@
//
// NSCursor_Private.h
// CursorProject
//
// Created by Alex Zielenski on 2/19/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
@interface NSCursor (Private)
+ (void)initialize;
+ (id)_buildCursor:(id)arg1 cursorData:(struct CGPoint)arg2;
+ (id)arrowCursor;
+ (id)IBeamCursor;
+ (id)pointingHandCursor;
+ (id)closedHandCursor;
+ (id)openHandCursor;
+ (id)resizeLeftCursor;
+ (id)resizeRightCursor;
+ (id)resizeLeftRightCursor;
+ (id)resizeUpCursor;
+ (id)resizeDownCursor;
+ (id)resizeUpDownCursor;
+ (id)crosshairCursor;
+ (id)disappearingItemCursor;
+ (id)operationNotAllowedCursor;
+ (id)busyButClickableCursor;
+ (id)contextualMenuCursor;
+ (id)IBeamCursorForVerticalLayout;
+ (void)hide;
+ (void)unhide;
+ (void)setHiddenUntilMouseMoves:(BOOL)arg1;
+ (id)currentCursor;
+ (id)currentSystemCursor;
+ (void)_setOverrideCursor:(id)arg1;
+ (void)_clearOverrideCursorAndSetArrow;
+ (void)pop;
+ (id)_makeCursors;
+ (id)_setHelpCursor:(BOOL)arg1;
+ (BOOL)helpCursorShown;
+ (id)dragCopyCursor;
+ (id)_copyDragCursor;
+ (id)dragLinkCursor;
+ (id)_genericDragCursor;
+ (id)_handCursor;
+ (id)_closedHandCursor;
+ (id)_moveCursor;
+ (id)_waitCursor;
+ (id)_crosshairCursor;
+ (id)_horizontalResizeCursor;
+ (id)_verticalResizeCursor;
+ (id)_bottomLeftResizeCursor;
+ (id)_topLeftResizeCursor;
+ (id)_bottomRightResizeCursor;
+ (id)_topRightResizeCursor;
+ (id)_resizeLeftCursor;
+ (id)_resizeRightCursor;
+ (id)_resizeLeftRightCursor;
+ (id)_zoomInCursor;
+ (id)_zoomOutCursor;
+ (id)_windowResizeEastCursor;
+ (id)_windowResizeWestCursor;
+ (id)_windowResizeEastWestCursor;
+ (id)_windowResizeNorthCursor;
+ (id)_windowResizeSouthCursor;
+ (id)_windowResizeNorthSouthCursor;
+ (id)_windowResizeNorthEastCursor;
+ (id)_windowResizeNorthWestCursor;
+ (id)_windowResizeSouthEastCursor;
+ (id)_windowResizeSouthWestCursor;
+ (id)_windowResizeNorthEastSouthWestCursor;
+ (id)_windowResizeNorthWestSouthEastCursor;
- (id)initWithImage:(id)arg1 hotSpot:(struct CGPoint)arg2;
- (id)initWithImage:(id)arg1 foregroundColorHint:(id)arg2 backgroundColorHint:(id)arg3 hotSpot:(struct CGPoint)arg4;
- (void)_setImage:(id)arg1;
- (id)init;
- (void)dealloc;
- (long long)_coreCursorType;
- (void)_getImageAndHotSpotFromCoreCursor;
- (id)image;
- (struct CGPoint)hotSpot;
- (void)setOnMouseExited:(BOOL)arg1;
- (void)setOnMouseEntered:(BOOL)arg1;
- (BOOL)isSetOnMouseExited;
- (BOOL)isSetOnMouseEntered;
- (id)_premultipliedARGBBitmaps;
- (void)_reallySet;
- (void)set;
- (id)forceSet;
- (void)mouseEntered:(id)arg1;
- (void)mouseExited:(id)arg1;
- (id)initWithCoder:(id)arg1;
- (void)encodeWithCoder:(id)arg1;
- (id)awakeAfterUsingCoder:(id)arg1;
- (void)push;
- (void)pop;
@end
-2
View File
@@ -1,2 +0,0 @@
/* Localized versions of Info.plist keys */
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-502
View File
@@ -1,502 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1070</int>
<string key="IBDocument.SystemVersion">11D50b</string>
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
<string key="IBDocument.AppKitVersion">1138.32</string>
<string key="IBDocument.HIToolboxVersion">568.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">2182</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>NSView</string>
<string>NSCustomObject</string>
<string>NSScrollView</string>
<string>NSWindowTemplate</string>
<string>NSTextFieldCell</string>
<string>NSTextField</string>
<string>NSCustomView</string>
<string>NSTableCellView</string>
<string>NSTableColumn</string>
<string>NSScroller</string>
<string>NSTableView</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="NSCustomObject" id="1001">
<string key="NSClassName">MMAdvancedEditWindowController</string>
</object>
<object class="NSCustomObject" id="1003">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="1004">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="1005">
<int key="NSWindowStyleMask">1</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{878, 652}, {687, 185}}</string>
<int key="NSWTFlags">1618478080</int>
<string key="NSWindowTitle">Window</string>
<string key="NSWindowClass">NSPanel</string>
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
<object class="NSView" key="NSWindowView" id="1006">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSScrollView" id="475901191">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">276</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSClipView" id="204896890">
<reference key="NSNextResponder" ref="475901191"/>
<int key="NSvFlags">2304</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSTableView" id="512185058">
<reference key="NSNextResponder" ref="204896890"/>
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{185, 159}</string>
<reference key="NSSuperview" ref="204896890"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1009513133"/>
<string key="NSReuseIdentifierKey">_NS:13</string>
<bool key="NSEnabled">YES</bool>
<object class="_NSCornerView" key="NSCornerView">
<nil key="NSNextResponder"/>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{224, 0}, {16, 17}}</string>
<reference key="NSNextKeyView" ref="204896890"/>
<string key="NSReuseIdentifierKey">_NS:19</string>
</object>
<array class="NSMutableArray" key="NSTableColumns">
<object class="NSTableColumn" id="103963955">
<double key="NSWidth">181.6484375</double>
<double key="NSMinWidth">40</double>
<double key="NSMaxWidth">1000</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
<int key="NSCellFlags">75628096</int>
<int key="NSCellFlags2">2048</int>
<string key="NSContents"/>
<object class="NSFont" key="NSSupport">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">11</double>
<int key="NSfFlags">3100</int>
</object>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
</object>
<object class="NSColor" key="NSTextColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">headerTextColor</string>
<object class="NSColor" key="NSColor" id="737459690">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</object>
<object class="NSTextFieldCell" key="NSDataCell" id="203816845">
<int key="NSCellFlags">337772096</int>
<int key="NSCellFlags2">2048</int>
<string key="NSContents">Text Cell</string>
<object class="NSFont" key="NSSupport" id="701966091">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<reference key="NSControlView" ref="512185058"/>
<object class="NSColor" key="NSBackgroundColor" id="349783698">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlBackgroundColor</string>
<object class="NSColor" key="NSColor" id="12693693">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor" id="952723118">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
<reference key="NSColor" ref="737459690"/>
</object>
</object>
<int key="NSResizingMask">3</int>
<bool key="NSIsResizeable">YES</bool>
<bool key="NSIsEditable">YES</bool>
<reference key="NSTableView" ref="512185058"/>
</object>
</array>
<double key="NSIntercellSpacingWidth">3</double>
<double key="NSIntercellSpacingHeight">2</double>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="NSGridColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">gridColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
</object>
<double key="NSRowHeight">17</double>
<int key="NSTvFlags">1455423488</int>
<reference key="NSDelegate"/>
<reference key="NSDataSource"/>
<int key="NSColumnAutoresizingStyle">4</int>
<int key="NSDraggingSourceMaskForLocal">15</int>
<int key="NSDraggingSourceMaskForNonLocal">0</int>
<bool key="NSAllowsTypeSelect">YES</bool>
<int key="NSTableViewDraggingDestinationStyle">0</int>
<int key="NSTableViewGroupRowStyle">1</int>
</object>
</array>
<string key="NSFrame">{{1, 1}, {185, 159}}</string>
<reference key="NSSuperview" ref="475901191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="512185058"/>
<string key="NSReuseIdentifierKey">_NS:11</string>
<reference key="NSDocView" ref="512185058"/>
<reference key="NSBGColor" ref="349783698"/>
<int key="NScvFlags">4</int>
</object>
<object class="NSScroller" id="977722590">
<reference key="NSNextResponder" ref="475901191"/>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{224, 17}, {15, 102}}</string>
<reference key="NSSuperview" ref="475901191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="419371071"/>
<string key="NSReuseIdentifierKey">_NS:58</string>
<reference key="NSTarget" ref="475901191"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">0.99305555555555558</double>
</object>
<object class="NSScroller" id="419371071">
<reference key="NSNextResponder" ref="475901191"/>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{1, 295}, {185, 15}}</string>
<reference key="NSSuperview" ref="475901191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="979016753"/>
<string key="NSReuseIdentifierKey">_NS:60</string>
<int key="NSsFlags">1</int>
<reference key="NSTarget" ref="475901191"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">0.9946236559139785</double>
</object>
</array>
<string key="NSFrame">{{20, 12}, {187, 161}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="204896890"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSsFlags">133682</int>
<reference key="NSVScroller" ref="977722590"/>
<reference key="NSHScroller" ref="419371071"/>
<reference key="NSContentView" ref="204896890"/>
<bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
</object>
<object class="NSCustomView" id="979016753">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">274</int>
<string key="NSFrame">{{205, 0}, {482, 185}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSClassName">NSView</string>
</object>
</array>
<string key="NSFrameSize">{687, 185}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="475901191"/>
</object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">NO</bool>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="1005"/>
</object>
<int key="connectionID">3</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">_contentView</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="979016753"/>
</object>
<int key="connectionID">36</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">tableView</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="512185058"/>
</object>
<int key="connectionID">37</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="1005"/>
<reference key="destination" ref="1001"/>
</object>
<int key="connectionID">4</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">dataSource</string>
<reference key="source" ref="512185058"/>
<reference key="destination" ref="1001"/>
</object>
<int key="connectionID">38</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="512185058"/>
<reference key="destination" ref="1001"/>
</object>
<int key="connectionID">39</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">textField</string>
<object class="NSTableCellView" key="source" id="1009513133">
<nil key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSTextField" id="807929000">
<reference key="NSNextResponder" ref="1009513133"/>
<int key="NSvFlags">266</int>
<string key="NSFrameSize">{182, 17}</string>
<reference key="NSSuperview" ref="1009513133"/>
<reference key="NSNextKeyView" ref="977722590"/>
<string key="NSAntiCompressionPriority">{250, 750}</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="132867833">
<int key="NSCellFlags">67239488</int>
<int key="NSCellFlags2">272631808</int>
<string key="NSContents">Table View Cell</string>
<reference key="NSSupport" ref="701966091"/>
<reference key="NSControlView" ref="807929000"/>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
<reference key="NSColor" ref="12693693"/>
</object>
<reference key="NSTextColor" ref="952723118"/>
</object>
</object>
</array>
<string key="NSFrame">{{1, 1}, {182, 17}}</string>
<reference key="NSNextKeyView" ref="807929000"/>
</object>
<reference key="destination" ref="807929000"/>
</object>
<int key="connectionID">24</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="1001"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="1003"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="1004"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="1005"/>
<array class="NSMutableArray" key="children">
<reference ref="1006"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2</int>
<reference key="object" ref="1006"/>
<array class="NSMutableArray" key="children">
<reference ref="475901191"/>
<reference ref="979016753"/>
</array>
<reference key="parent" ref="1005"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">5</int>
<reference key="object" ref="475901191"/>
<array class="NSMutableArray" key="children">
<reference ref="512185058"/>
<reference ref="419371071"/>
<reference ref="977722590"/>
</array>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="512185058"/>
<array class="NSMutableArray" key="children">
<reference ref="103963955"/>
</array>
<reference key="parent" ref="475901191"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
<reference key="object" ref="419371071"/>
<reference key="parent" ref="475901191"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">9</int>
<reference key="object" ref="977722590"/>
<reference key="parent" ref="475901191"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">10</int>
<reference key="object" ref="103963955"/>
<array class="NSMutableArray" key="children">
<reference ref="203816845"/>
<reference ref="1009513133"/>
</array>
<reference key="parent" ref="512185058"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">13</int>
<reference key="object" ref="203816845"/>
<reference key="parent" ref="103963955"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="1009513133"/>
<array class="NSMutableArray" key="children">
<reference ref="807929000"/>
</array>
<reference key="parent" ref="103963955"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="807929000"/>
<array class="NSMutableArray" key="children">
<reference ref="132867833"/>
</array>
<reference key="parent" ref="1009513133"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">23</int>
<reference key="object" ref="132867833"/>
<reference key="parent" ref="807929000"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">35</int>
<reference key="object" ref="979016753"/>
<reference key="parent" ref="1006"/>
<string key="objectName">Advanced Edit</string>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="1.IBNSWindowAutoPositionCentersHorizontal"/>
<boolean value="YES" key="1.IBNSWindowAutoPositionCentersVertical"/>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="1.IBWindowTemplateEditedContentRect">{{357, 418}, {480, 270}}</string>
<boolean value="NO" key="1.NSWindowTemplate.visibleAtLaunch"/>
<string key="10.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="10.isInViewBasedMode"/>
<array key="10.prototypeCellViews">
<reference ref="1009513133"/>
</array>
<string key="13.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="21.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="21.userInterfaceItemIdentifier">AdvancedEditWindow</string>
<string key="22.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="23.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<dictionary class="NSMutableDictionary" key="35.IBAttributePlaceholdersKey"/>
<string key="35.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="6.ibExternalAutomaticallyCalculatesRowSizeFromViewHeight"/>
<string key="7.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">39</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">MMAdvancedEditWindowController</string>
<string key="superclassName">NSWindowController</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="_contentView">NSView</string>
<string key="tableView">NSTableView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="_contentView">
<string key="name">_contentView</string>
<string key="candidateClassName">NSView</string>
</object>
<object class="IBToOneOutletInfo" key="tableView">
<string key="name">tableView</string>
<string key="candidateClassName">NSTableView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/MMAdvancedEditWindowController.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
</data>
</archive>
@@ -1,48 +0,0 @@
//
// MMQuickEditViewController.h
// Magic Mouse
//
// Created by Alex Zielenski on 2/29/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "MMCursorAggregate.h"
#import "MMAnimatingImageView.h"
/*! This is the class that will be used for display the popover for quick edits after drags, and it will be used
for the advanced editing table. It is able to edit the important properties of MMCursor */
// Block for when done/cancel is clicked
typedef void(^MMAdvancedEditDidEndBlock)(BOOL doneClicked); // doneClicked = if it was done, NO if it was cancelled
@interface MMAdvancedEditViewController : NSViewController <MMAnimatingImageViewDelegate> {
MMCursor *_cursor;
}
/* Properties and outlets for the views */
@property (nonatomic, retain) IBOutlet NSTextField *nameField;
@property (nonatomic, retain) IBOutlet NSTextField *xField;
@property (nonatomic, retain) IBOutlet NSTextField *yField;
@property (nonatomic, retain) IBOutlet NSTextField *frameCountField;
@property (nonatomic, retain) IBOutlet NSTextField *frameDurationField;
@property (nonatomic, retain) IBOutlet NSTextField *identifierField;
@property (nonatomic, retain) IBOutlet MMAnimatingImageView *imageView;
@property (nonatomic, retain) IBOutlet NSButton *doneButton;
@property (nonatomic, retain) IBOutlet NSButton *cancelButton;
@property (nonatomic, retain) MMCursor *cursor;
@property (nonatomic, assign) BOOL appliesChangesImmediately;
@property (nonatomic, copy) MMAdvancedEditDidEndBlock didEndBlock;
// Actions called by the views when values are changed. I don't want to use bindings directly to have
// the power to cancel in the end.
- (IBAction)nameChange:(NSTextField *)sender;
- (IBAction)xChange:(NSTextField *)sender;
- (IBAction)yChange:(NSTextField *)sender;
- (IBAction)frameCountChange:(id)sender;
- (IBAction)frameDurationChange:(id)sender;
- (IBAction)identifierChange:(NSTextField *)sender;
- (IBAction)done:(NSButton *)sender;
- (IBAction)cancel:(NSButton *)sender;
@end
@@ -1,145 +0,0 @@
//
// MMQuickEditViewController.m
// Magic Mouse
//
// Created by Alex Zielenski on 2/29/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import "MMAdvancedEditViewController.h"
@implementation MMAdvancedEditViewController
@synthesize nameField = _nameField;
@synthesize xField = _xField;
@synthesize yField = _yField;
@synthesize frameCountField = _frameCountField;
@synthesize frameDurationField = _frameDurationField;
@synthesize identifierField = _identifierField;
@synthesize imageView = _imageView;
@synthesize doneButton = _doneButton;
@synthesize cancelButton = _cancelButton;
@synthesize appliesChangesImmediately = _appliesChangesImmediately;
@synthesize didEndBlock = _didEndBlock;
@dynamic cursor;
- (void)dealloc {
self.cursor = nil;
[super dealloc];
}
#pragma mark - Accessors
- (MMCursor *)cursor {
return _cursor;
}
- (void)setCursor:(MMCursor *)cursor {
[self willChangeValueForKey:@"cursor"];
if (_cursor)
[_cursor release];
_cursor = [cursor retain];
[self didChangeValueForKey:@"cursor"];
if (_cursor) {
// Set all of our fields to their values based upon this here cursor
self.nameField.stringValue = self.cursor.name;
self.xField.integerValue = self.cursor.hotSpot.x;
self.yField.integerValue = self.cursor.hotSpot.y;
self.frameCountField.integerValue = self.cursor.frameCount;
self.frameDurationField.doubleValue = self.cursor.frameDuration;
self.identifierField.stringValue = self.cursor.cursorIdentifier;
self.imageView.image = self.cursor.image;
self.imageView.frameCount = self.cursor.frameCount;
self.imageView.frameDuration = self.cursor.frameDuration;
} else {
self.nameField.stringValue = @"";
self.xField.integerValue = 0;
self.yField.integerValue = 0;
self.frameCountField.integerValue = 1;
self.frameDurationField.doubleValue = 1.0;
self.identifierField.stringValue = @"";
self.imageView.image = nil;
}
[self.imageView resetAnimation];
}
#pragma mark - Actions
- (IBAction)nameChange:(NSTextField *)sender {
if (self.appliesChangesImmediately) {
self.cursor.name = sender.stringValue;
}
}
- (IBAction)xChange:(NSTextField *)sender {
if (self.appliesChangesImmediately) {
self.cursor.hotSpot = NSMakePoint(sender.floatValue, self.cursor.hotSpot.y);
}
}
- (IBAction)yChange:(NSTextField *)sender {
if (self.appliesChangesImmediately) {
self.cursor.hotSpot = NSMakePoint(self.cursor.hotSpot.x, sender.floatValue);
}
}
- (IBAction)frameCountChange:(id)sender { // The image view needs to be updated when there is a a framecount/duration change
if (self.appliesChangesImmediately) {
self.cursor.frameCount = [sender integerValue];
}
self.imageView.frameCount = self.frameCountField.integerValue;
[self.imageView resetAnimation];
}
- (IBAction)frameDurationChange:(id)sender {
if (self.appliesChangesImmediately) {
self.cursor.frameDuration = [sender doubleValue];
}
self.imageView.frameDuration = self.frameDurationField.doubleValue;
[self.imageView resetAnimation];
}
- (IBAction)identifierChange:(NSTextField *)sender {
if (self.appliesChangesImmediately) {
self.cursor.cursorIdentifier = sender.stringValue;
}
}
- (IBAction)done:(NSButton *)sender {
NSAssert(self.didEndBlock != NULL, @"For done: to be called & implemented, didEndBlock must not be NULL");
self.cursor.name = self.nameField.stringValue;
self.cursor.hotSpot = NSMakePoint(self.xField.floatValue, self.yField.floatValue);
self.cursor.frameCount = self.frameCountField.integerValue;
self.cursor.frameDuration = self.frameDurationField.doubleValue;
self.cursor.cursorIdentifier = self.identifierField.stringValue;
self.cursor.image = self.imageView.image;
self.didEndBlock(YES);
}
- (IBAction)cancel:(NSButton *)sender {
NSAssert(self.didEndBlock != NULL, @"For cancel: to be called & implemented, didEndBlock must not be NULL");
self.didEndBlock(NO);
}
#pragma mark - MMAnimatedImageViewDelegate
- (NSDragOperation)imageView:(MMAnimatingImageView *)imageView draggingEntered:(id <NSDraggingInfo>)drop {
return NSDragOperationCopy;
}
- (BOOL)imageView:(MMAnimatingImageView *)imageView shouldPrepareForDragOperation:(id <NSDraggingInfo>)drop {
return YES;
}
- (BOOL)imageView:(MMAnimatingImageView *)imageView shouldPerformDragOperation:(id <NSDraggingInfo>)drop {
return YES;
}
- (void)imageView:(MMAnimatingImageView *)imageView didAcceptDroppedImages:(NSArray *)images {
if (self.appliesChangesImmediately) {
self.cursor.image = [images objectAtIndex:0];
}
[imageView resetAnimation];
}
@end
@@ -1,20 +0,0 @@
//
// MMAdvancedEditWindowController.h
// Magic Mouse
//
// Created by Alex Zielenski on 5/2/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "MMCursorAggregate.h"
@interface MMAdvancedEditWindowController : NSWindowController <NSTableViewDelegate, NSTableViewDataSource>
@property (nonatomic, retain) IBOutlet NSTableView *tableView;
@property (nonatomic, retain) MMCursorAggregate *cursor;
@property (nonatomic, assign) NSWindow *parentWindow;
- (void)displayForWindow:(NSWindow *)window cursor:(MMCursorAggregate *)cursor;;
@end
@@ -1,111 +0,0 @@
//
// MMAdvancedEditWindowController.m
// Magic Mouse
//
// Created by Alex Zielenski on 5/2/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import "MMAdvancedEditWindowController.h"
#import "MMAdvancedEditViewController.h"
@interface MMAdvancedEditWindowController ()
@property (nonatomic, assign) IBOutlet NSView *_contentView;
@property (nonatomic, retain) MMAdvancedEditViewController *_advancedEditViewController;
@end
@implementation MMAdvancedEditWindowController
#pragma mark - Private Properties
@synthesize _contentView;
@synthesize _advancedEditViewController;
#pragma mark - Public Properties
@synthesize tableView = _tableView;
@synthesize cursor = _cursor;
@synthesize parentWindow = _parentWindow;
#pragma mark - Lifecycle
- (id)initWithWindow:(NSWindow *)window {
self = [super initWithWindow:window];
if (self) {
// Initialization code here.
}
return self;
}
- (void)dealloc {
self._contentView = nil;
self.tableView = nil;
self.cursor = nil;
self._advancedEditViewController = nil;
[super dealloc];
}
- (void)windowDidLoad {
[super windowDidLoad];
self._advancedEditViewController = [[[MMAdvancedEditViewController alloc] initWithNibName:@"AdvancedEdit" bundle:kMMPrefsBundle] autorelease];
self._advancedEditViewController.view.frame = self._contentView.bounds;
self._advancedEditViewController.appliesChangesImmediately = NO;
self._advancedEditViewController.didEndBlock = ^(BOOL doneButton) {
if (doneButton) {
} else {
}
[self.window orderOut:self];
[NSApp endSheet:self.window];
};
[self._contentView addSubview:self._advancedEditViewController.view];
}
- (void)displayForWindow:(NSWindow *)window cursor:(MMCursorAggregate *)cursor {
self.cursor = cursor;
self.parentWindow = window;
[self showWindow:self];
}
- (void)showWindow:(id)sender {
[NSApp beginSheet:self.window
modalForWindow:self.parentWindow
modalDelegate:self
didEndSelector:NULL
contextInfo:nil];
if (self.cursor.cursors.count > 0)
[self.tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
}
#pragma mark - NSTableViewDataSource
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
return self.cursor.cursors.count;
}
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
NSTableCellView *cellView = [tableView makeViewWithIdentifier:@"AdvancedEditWindow" owner:self];
MMCursor *currentCursor = [self.cursor.cursors.allValues objectAtIndex:row];
cellView.textField.stringValue = currentCursor.name;
return cellView;
}
#pragma mark - NSTableViewDelegate
- (void)tableViewSelectionDidChange:(NSNotification *)notification {
MMCursor *cursor = [self.cursor.cursors.allValues objectAtIndex:self.tableView.selectedRow];
self._advancedEditViewController.cursor = cursor;
}
@end
@@ -1,23 +0,0 @@
//
// MMCursorLibrary.h
// Magic Mouse
//
// Created by Alex Zielenski on 5/6/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "MMCursorAggregate.h"
@interface MMCursorLibrary : NSObject
@property (copy, readonly) NSString *libraryPath;
@property (retain, readonly) NSMutableSet *cursors; // Yeah, don't actually modify this
+ (MMCursorLibrary *)libraryWithPath:(NSString *)path;
- (id)initWithPath:(NSString *)path;
- (BOOL)addCursorAtPath:(NSString *)path;
- (void)removeCursor:(MMCursorAggregate *)cursor;
- (void)saveCursor:(MMCursorAggregate *)cursor;
@end
@@ -1,145 +0,0 @@
//
// MMCursorLibrary.m
// Magic Mouse
//
// Created by Alex Zielenski on 5/6/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import "MMCursorLibrary.h"
@interface MMCursorLibrary () {
NSMutableSet *_cursors;
}
@property (retain, readwrite) NSMutableSet *cursors;
@property (copy, readwrite) NSString *libraryPath;
- (BOOL)_validateLibraryPath:(NSString *)path;
- (void)_addCursorAtPath:(NSString *)path;
- (void)_syncWithLibrary;
@end
@implementation MMCursorLibrary
@synthesize libraryPath = _libraryPath;
@synthesize cursors = _cursors;
+ (MMCursorLibrary *)libraryWithPath:(NSString *)path
{
return [[[self alloc] initWithPath:path] autorelease];
}
- (id)initWithPath:(NSString *)path
{
if (![self _validateLibraryPath:path]) {
NSLog(@"Invalid Library Path.");
[self release];
return nil;
}
if ((self = [super init])) {
self.cursors = [NSMutableSet set];
self.libraryPath = path;
[self _syncWithLibrary];
}
return self;
}
- (BOOL)addCursorAtPath:(NSString *)path
{
if ([[self.cursors valueForKey:path] containsObject:path])
return NO;
[self _addCursorAtPath:path];
return YES;
}
- (void)removeCursor:(MMCursorAggregate *)cursor
{
if (![self.cursors containsObject:cursor])
return;
[self willChangeValueForKey:@"cursors"];
NSError *error = nil;
[[NSFileManager defaultManager] removeItemAtPath:cursor.path error:&error];
if (!error)
[self.cursors removeObject:cursor];
else {
NSLog(@"Error Removing Cursor");
NSLog(@"%@", error);
}
[self didChangeValueForKey:@"cursors"];
}
- (void)saveCursor:(MMCursorAggregate *)cursor
{
if (![self.cursors containsObject:cursor]) {
NSLog(@"Cursor (%@) is not a member of this library", cursor);
return;
}
if (!cursor.path) {
NSLog(@"Cursor (%@) was not instantiated with its path.", cursor);
return;
}
[cursor.dictionaryRepresentation writeToFile:cursor.path atomically:NO];
}
- (BOOL)_validateLibraryPath:(NSString *)path
{
if (!path)
return NO;
NSFileManager *manager = [NSFileManager defaultManager];
BOOL isDir = NO;
BOOL exists = [manager fileExistsAtPath:path isDirectory:&isDir];
if (!exists || !isDir)
return NO;
return ([manager isReadableFileAtPath:path] && [manager isWritableFileAtPath:path]);
}
- (void)_syncWithLibrary
{
NSFileManager *manager = [NSFileManager defaultManager];
NSSet *paths = [self.cursors valueForKeyPath:@"path"];
NSError *error = nil;
NSArray *cursors = [manager contentsOfDirectoryAtPath:self.libraryPath error:&error];
if (error) {
NSLog(@"%@", error);
return;
}
for (NSString *filename in cursors) {
NSString *path = [self.libraryPath stringByAppendingPathComponent:filename];
if ([paths containsObject:path])
continue;
[self _addCursorAtPath:path];
}
}
- (void)_addCursorAtPath:(NSString *)path
{
[self willChangeValueForKey:@"cursors"];
MMCursorAggregate *agg = [MMCursorAggregate aggregateWithContentsOfFile:path];
[self.cursors addObject:agg];
[self didChangeValueForKey:@"cursors"];
}
@end
@@ -1,19 +0,0 @@
//
// MMCursorViewController.h
// Magic Mouse
//
// Created by Alex Zielenski on 5/1/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "MMAnimatingImageTableCellView.h"
#import "MMCursorAggregate.h"
@interface MMCursorViewController : NSViewController <NSTableViewDelegate, NSTableViewDataSource, MMAnimatingImageViewDelegate>
@property (nonatomic, retain) MMCursorAggregate *cursor;
@property (nonatomic, assign) IBOutlet NSTableView *tableView;
@property (nonatomic, assign, getter = isEnabled) BOOL enabled;
@end
@@ -1,171 +0,0 @@
//
// MMCursorViewController.m
// Magic Mouse
//
// Created by Alex Zielenski on 5/1/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import "MMCursorViewController.h"
#import "MMAdvancedEditViewController.h"
@interface MMCursorViewController ()
- (MMAdvancedEditViewController *)_displayPopoverForColumn:(NSInteger)column;
@end
@implementation MMCursorViewController
#pragma mark - Public Properties
@synthesize tableView = _tableView;
@synthesize cursor = _cursor;
@synthesize enabled = _enabled;
#pragma mark - Lifecycle
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Initialization code here.
}
return self;
}
- (void)dealloc {
self.cursor = nil;
[super dealloc];
}
// return the controller just incase we want to do extra things to it
- (MMAdvancedEditViewController *)_displayPopoverForColumn:(NSInteger)columnIdx {
if (columnIdx < 0 || columnIdx >= self.tableView.tableColumns.count)
return nil;
// Find the column that was dragged into
NSTableColumn *column = [self.tableView.tableColumns objectAtIndex:columnIdx];
// Get the associated MMCursor* for the cell
MMCursor *cursor = [self.cursor cursorForTableIdentifier:column.identifier];
if (!cursor) {
NSLog(@"No cursor for column (%@, %lu)?", column.identifier, (unsigned long)columnIdx);
return nil;
}
// There is guaranteed to be atleast one image and (and no more than one for now)
MMAdvancedEditViewController *advancedEdit = [[MMAdvancedEditViewController alloc] initWithNibName:@"AdvancedEdit"
bundle:kMMPrefsBundle];
// create a popover to display
NSPopover *popover = [[[NSPopover alloc] init] autorelease];
popover.contentViewController = advancedEdit;
popover.behavior = NSPopoverBehaviorApplicationDefined;
popover.appearance = NSPopoverAppearanceMinimal;
NSView *imageView = [self.tableView viewAtColumn:columnIdx row:0 makeIfNecessary:NO];
if (!imageView)
return nil;
// load the nib
[popover showRelativeToRect:imageView.bounds
ofView:imageView
preferredEdge:NSMinYEdge];
[advancedEdit release]; // decrease the retain count so that the popover is the only owner
advancedEdit.cursor = cursor;
advancedEdit.appliesChangesImmediately = NO; // we only want changes applied when the user clicks "Done"
advancedEdit.identifierField.editable = NO; // make the identifier field uneditable. (read the highlighted comment below)
advancedEdit.nameField.editable = NO; // same as above
[advancedEdit.imageView resetAnimation];
advancedEdit.didEndBlock = ^(BOOL finished) {
[self.tableView reloadData]; // reload the table for updated data
[popover close];
};
return advancedEdit;
}
#pragma mark - NSTableViewDataSource
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
// We only have 1 row, but 9 columns
return 1;
}
#pragma mark - NSTableViewDelegate
//!*****************************************************************************************************************************************//
//!** Each table column has an identifier that would correspond with an identifier built into one of the cursors ("TableIdentifier" key). **//
//!** We use that identifier to retrieve the cursor and display it accoringly. **//
//!*****************************************************************************************************************************************//
- (NSTableCellView *)tableView:(NSTableView*)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
// This identifier is set in the xib
static NSString *cellIdentifier = @"MMCursorCell";
MMAnimatingImageTableCellView *cellView = [tableView makeViewWithIdentifier:cellIdentifier owner:self];
MMCursor *cursor = [self.cursor cursorForTableIdentifier:tableColumn.identifier];
if (cursor) {
cellView.animatingImageView.image = cursor.image;
cellView.animatingImageView.frameCount = cursor.frameCount;
cellView.animatingImageView.frameDuration = cursor.frameDuration;
cellView.animatingImageView.delegate = self;
// We set our values, now we need to reset the animation to reflect our changes
[cellView.animatingImageView resetAnimation];
}
return cellView;
}
// Disable tableview selection
- (BOOL)tableView:(NSTableView *)aTableView shouldSelectRow:(NSInteger)rowIndex {
return NO;
}
#pragma mark - MMAnimatingImageCellViewDelegate
- (NSDragOperation)imageView:(MMAnimatingImageView *)imageView draggingEntered:(id <NSDraggingInfo>)drop {
return (self.isEnabled) ? NSDragOperationCopy : NSDragOperationNone;
}
- (BOOL)imageView:(MMAnimatingImageView *)imageView shouldPrepareForDragOperation:(id <NSDraggingInfo>)drop {
return self.isEnabled;
}
- (BOOL)imageView:(MMAnimatingImageView *)imageView shouldPerformDragOperation:(id <NSDraggingInfo>)drop {
return self.isEnabled;
}
//!**********************************************************************************************************************************************/
//!** When the user drops an image onto a table item, we show then a quick edit popover for them to be able to quickly customize some of **/
//!** the settings. If they click "Done" these changes are applied. We make the identifier field uneditable because we don't want the user **/
//!** changing the identifier value for any of the cursors in the table since they have preset identifier values that must stay static to work **/
//!**********************************************************************************************************************************************/
- (void)imageView:(MMAnimatingImageView *)imageView didAcceptDroppedImages:(NSArray *)images {
NSUInteger columnIdx = [_tableView columnAtPoint:imageView.superview.frame.origin];
if (columnIdx == -1) {
NSLog(@"No column found at specified point (%@) after drag operation.", NSStringFromPoint(imageView.superview.frame.origin));
return;
}
// set the dragged image to the image of the animating image view on the popover
MMAdvancedEditViewController *vc = [self _displayPopoverForColumn:columnIdx];
vc.imageView.image = [images objectAtIndex:0];
vc.imageView.frameDuration = 1;
vc.imageView.frameCount = 1;
vc.frameCountField.integerValue = 1;
vc.frameDurationField.integerValue = 1;
}
@end
@@ -1,17 +0,0 @@
//
// MMAnimatingImageTableCellView.h
// Magic Mouse
//
// Created by Alex Zielenski on 2/26/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import <AppKit/AppKit.h>
#import "MMAnimatingImageView.h"
// This is just a simple table cell subclass with an animating image view property. No big deal
@interface MMAnimatingImageTableCellView : NSTableCellView <NSDraggingDestination>
@property (nonatomic, retain) IBOutlet MMAnimatingImageView *animatingImageView;
@end
@@ -1,13 +0,0 @@
//
// MMAnimatingImageTableCellView.m
// Magic Mouse
//
// Created by Alex Zielenski on 2/26/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import "MMAnimatingImageTableCellView.h"
@implementation MMAnimatingImageTableCellView
@synthesize animatingImageView;
@end
@@ -1,57 +0,0 @@
//
// MMAnimatingImageView.h
// Magic Mouse
//
// Created by Alex Zielenski on 2/25/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import <Cocoa/Cocoa.h>
/*! Protocol for giving the delegate control over drops. */
@class MMAnimatingImageView; // Define the calss for our protocol
@protocol MMAnimatingImageViewDelegate <NSObject>
@required
- (NSDragOperation)imageView:(MMAnimatingImageView *)imageView draggingEntered:(id <NSDraggingInfo>)drop;
- (BOOL)imageView:(MMAnimatingImageView *)imageView shouldPrepareForDragOperation:(id <NSDraggingInfo>)drop;
- (BOOL)imageView:(MMAnimatingImageView *)imageView shouldPerformDragOperation:(id <NSDraggingInfo>)drop;
- (void)imageView:(MMAnimatingImageView *)imageView didAcceptDroppedImages:(NSArray *)images; // I'm making this an array because in the future we mighty allow users
// to drag multiple frames for a cursor instead of manually stacking them.
@end
//!****************************************************************************************************************************************//
//!** This is a specialized view class for animating the cursors used in magic mouse. These animated cursors have a height that is their **//
//!** frame count multiplied by the normal image height so every time the timer fires, it moves the y offset displayed by the image. **//
//!****************************************************************************************************************************************//
@interface MMAnimatingImageView : NSView {
// Image to animate
NSBitmapImageRep *_image;
// Time in seconds of each frame
CGFloat _frameDuration;
// Amount of frames
NSInteger _frameCount;
@private
// Timer fires for every frame
NSTimer *frameTimer;
// Cursor size, not image size. Size the cursor gets displayed by
NSSize imageSize;
// Current rectangle to take out of the cursor image for display
NSRect currentImageFrame;
// Current frame we are on during animation
NSInteger currentFrame;
}
@property (nonatomic, retain) NSBitmapImageRep *image;
@property (nonatomic, assign) CGFloat frameDuration;
@property (nonatomic, assign) NSInteger frameCount;
@property (nonatomic, assign) IBOutlet id <MMAnimatingImageViewDelegate> delegate;
// Resets the timer and current frame for the animation. Should be used when new parameters are specified.
// The reason this isn't called automatically when each new parameter is set because that would waste resources.
- (void)resetAnimation;
// Don't call this. Registers the valid drag types. Probably should be a private categorybut we're all developers here...
- (void)registerTypes;
@end
@@ -1,170 +0,0 @@
//
// MMAnimatingImageView.m
// Magic Mouse
//
// Created by Alex Zielenski on 2/25/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
#import "MMAnimatingImageView.h"
@interface MMAnimatingImageView (Private)
- (void)timerAction:(NSTimer*)timer;
@end
@implementation MMAnimatingImageView
@synthesize image = _image;
@synthesize frameCount = _frameCount;
@synthesize frameDuration = _frameDuration;
@synthesize delegate = _delegate;
- (id)init {
if ((self = [super init])) {
// We cannot have a frame count of 0.
_frameCount = 1;
_frameDuration = 1;
[self registerTypes];
}
return self;
}
// Assorted init methods
- (id)initWithCoder:(NSCoder *)aDecoder {
if ((self = [super initWithCoder:aDecoder])) {
_frameCount = 1;
_frameDuration = 1;
[self registerTypes];
}
return self;
}
- (id)initWithFrame:(NSRect)frameRect {
if ((self = [super initWithFrame:frameRect])) {
_frameCount = 1;
_frameDuration = 1;
[self registerTypes];
}
return self;
}
// I guess we can safely reset the animation when the view is moved to a new superview
- (void)viewDidMoveToSuperview {
[self resetAnimation];
}
- (void)dealloc {
if (frameTimer)
[frameTimer invalidate];
frameTimer = nil;
[super dealloc];
}
- (void)drawRect:(NSRect)dirtyRect {
[super drawRect:dirtyRect];
if (self.image && self.frameCount > 0) {
[self.image drawInRect:NSMakeRect(round(NSMidX(self.bounds)-imageSize.width/2), round(NSMidY(self.bounds)-imageSize.height/2), imageSize.width, imageSize.height)
fromRect:currentImageFrame
operation:NSCompositeSourceOver
fraction:1.0
respectFlipped:YES
hints:nil];
}
}
- (void)resetAnimation {
if (frameTimer)
[frameTimer invalidate];
size_t imageWidth = self.image.pixelsWide;
size_t imageHeight = self.image.pixelsHigh/self.frameCount;
// Read from bottom to top
currentFrame = self.frameCount-1;
imageSize = NSMakeSize(imageWidth, imageHeight);
[self timerAction:nil];
if (self.frameCount>1) {
frameTimer = [NSTimer timerWithTimeInterval:self.frameDuration
target:self
selector:@selector(timerAction:)
userInfo:nil
repeats:YES];
// Keep the images animating even during runloop blocking events.
[[NSRunLoop mainRunLoop] addTimer:frameTimer forMode:NSRunLoopCommonModes];
}
}
- (void)timerAction:(NSTimer *)timer {
if (currentFrame < 0)
currentFrame = self.frameCount-1;
currentImageFrame = NSMakeRect(0,
imageSize.height * currentFrame--,
imageSize.width,
imageSize.height);
[self setNeedsDisplay:YES];
}
// Tell OSX that our view can accept images to be dragged in
- (void)registerTypes {
[self registerForDraggedTypes:[NSArray arrayWithObjects:NSPasteboardTypeTIFF, NSPasteboardTypePNG, NSFilenamesPboardType, nil]];
}
#pragma mark - NSDragDestination
- (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender {
// Only thing we have to do here is confirm that the dragged file is an image. We use NSImage's +canInitWithPasteboard: and we also check to see there is only one item being dragged
if ([self.delegate conformsToProtocol:@protocol(MMAnimatingImageViewDelegate)] && // No point in accepting the drop if the delegate doesn't support it/exist
[NSImage canInitWithPasteboard:sender.draggingPasteboard] && // Only Accept Images
sender.draggingPasteboard.pasteboardItems.count == 1) { // Only accept one item
return [self.delegate imageView:self draggingEntered:sender];
}
return NSDragOperationNone;
}
// Give the delegate some more control
- (BOOL)prepareForDragOperation:(id<NSDraggingInfo>)sender {
if ([self.delegate conformsToProtocol:@protocol(MMAnimatingImageViewDelegate)]) {
return [self.delegate imageView:self shouldPerformDragOperation:sender];
}
return NO;
}
- (BOOL)performDragOperation:(id<NSDraggingInfo>)sender {
if ([self.delegate conformsToProtocol:@protocol(MMAnimatingImageViewDelegate)] && // Only do the operation if a delegate exists to actually set the image.
[self.delegate imageView:self shouldPerformDragOperation:sender]) { // Only do the operation if a delegate wants us to do the operation.
// Get the image from the pasteboard
NSImage *im = [[NSImage alloc] initWithPasteboard:sender.draggingPasteboard];
// Make an array of the valid drops (NSBitmapImageRep)
NSMutableArray *acceptedDrops = [[NSMutableArray alloc] initWithCapacity:im.representations.count];
for (NSImageRep *rep in im.representations) {
if (![rep isKindOfClass:[NSBitmapImageRep class]]) // We don't want PDFs
continue;
[acceptedDrops addObject:rep];
}
if (acceptedDrops.count > 0) {
// We already confirmed that the delegate conforms to the protocol above. Now we can let the delegate
// decide what to do with the dropped images.
[self.delegate imageView:self didAcceptDroppedImages:acceptedDrops];
}
[acceptedDrops release];
[im release];
return YES;
}
return NO;
}
@end
-26
View File
@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>com.alexzielenski.magicmouse</string>
<key>LimitLoadToSessionType</key>
<array>
<string>LoginWindow</string>
<string>Aqua</string>
</array>
<key>ProgramArguments</key>
<array>
<string>/Users/Alex/Library/Developer/Xcode/DerivedData/Magic_Mouse-cfmlqbkzatjrbbagybtffruqdozv/Build/Products/Debug/magicmouse</string>
<string>/Users/Alex/Downloads/Svanslös/Blue Blob w Cursor.MightyMouse</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WatchPaths</key>
<array>
<string>/Library/Preferences/com.alexzielenski.magicmouse.plist</string>
</array>
</dict>
</plist>
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

-51
View File
@@ -1,51 +0,0 @@
Arrow: com.apple.coregraphics.Arrow
Ibeam: com.apple.coregraphics.IBeam
IBeamXOR: com.apple.coregraphics.IBeamXOR
Alias: com.apple.coregraphics.Alias
Copy: com.apple.coregraphics.Copy
Move: com.apple.coregraphics.Move
ArrowCtx: com.apple.coregraphics.ArrowCtx
Wait: com.apple.coregraphics.Wait
Empty: com.apple.coregraphics.Empty
Drag Link: com.apple.cursor.2
Forbidden: com.apple.cursor.3
Busy but clickable: com.apple.cursor.4
Drag Copy: com.apple.cursor.5
Crosshair com.apple.cursor.7
Crosshair 2? com.apple.cursor.8
Window Selection com.apple.cursor.9
Window Selection 2? com.apple.cursor.10
Closed hand: com.apple.cursor.11
Open Hand: com.apple.cursor.12
Pointing Hand: com.apple.cursor.13
Opening Hand com.apple.cursor.14
Closing Hand com.apple.cursor.15
Opening and Closing com.apple.cursor.16
Resize Left: com.apple.cursor.17
Resize Right: com.apple.cursor.18
Resize Left Right: com.apple.cursor.19
Black Cell: com.apple.cursor.20
Resize Up: com.apple.cursor.21
Resize Down: com.apple.cursor.22
Resize Up Down: com.apple.cursor.23
Contextual menu: com.apple.cursor.24
Disappearing/Poof: com.apple.cursor.25
Horizontal IBEAM: com.apple.cursor.26
Window east: com.apple.cursor.27
Window east west: com.apple.cursor.28
Window north east: com.apple.cursor.29
Window ne sw: com.apple.cursor.30
Window north: com.apple.cursor.31
Window north south: com.apple.cursor.32
Window north west: com.apple.cursor.33
Window nw se: com.apple.cursor.34
Window south east: com.apple.cursor.35
Window south: com.apple.cursor.36
Window south west: com.apple.cursor.37
Window west: com.apple.cursor.38
Resize all directions com.apple.cursor.39
Help com.apple.cursor.40
Cell com.apple.cursor.41
Zoom in: com.apple.cursor.42
Zoom out: com.apple.cursor.43
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

+99
View File
@@ -0,0 +1,99 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>Mousecape by alexzielenski</title>
</head>
<body>
<div id="container">
<div class="inner">
<header>
<h1>Mousecape</h1>
<h2>Cursor Manager for OS X</h2>
</header>
<section id="downloads" class="clearfix">
<a href="https://github.com/alexzielenski/Mousecape/zipball/master" id="download-zip" class="button"><span>Download .zip</span></a>
<a href="https://github.com/alexzielenski/Mousecape/tarball/master" id="download-tar-gz" class="button"><span>Download .tar.gz</span></a>
<a href="https://github.com/alexzielenski/Mousecape" id="view-on-github" class="button"><span>View on GitHub</span></a>
</section>
<hr>
<section id="main_content">
<h1>
<a name="mousecape" class="anchor" href="#mousecape"><span class="octicon octicon-link"></span></a>Mousecape</h1>
<p>A free cursor manager for Mac OS 10.8+ built using private, nonintrusive CoreGraphics APIs.</p>
<h2>
<a name="how-it-works" class="anchor" href="#how-it-works"><span class="octicon octicon-link"></span></a>How it works</h2>
<p>Mousecape works by calling the API calls that Apple uses to initialize the system cursors in the system and it registers a daemon that will automatically apply the cursor on login and when cursors get unregistered.</p>
<p>It is unintrusive and works in the background. You just need to open, install the helper tool, apply your cursor and you're done!</p>
<h2>
<a name="where-do-i-get-cursors" class="anchor" href="#where-do-i-get-cursors"><span class="octicon octicon-link"></span></a>Where do I get cursors?</h2>
<p>A pack of cursors in Mousecape is called a cape, each cape contains a multiple scales of representations of many cursors. For example, the Arrow cursor can have 1x, 2x, 5x, and 10x representations while the Wait cursor can have 1x, and 2x. </p>
<p>There is an example cape file included in this Git Repo located <a href="https://github.com/alexzielenski/Mousecape/blob/master/Mousecape/com.maxrudberg.svanslosbluehazard.cape">here for download</a>. It is a remake of <a href="http://maxrudberg.com/">Max Rudberg's</a> loved Svanslös cursors generously crafted by Max for us to use. Simply double click the cape file with Mousecape on your system and it will be imported into your library.</p>
<h2>
<a name="how-can-i-create-my-own-cape" class="anchor" href="#how-can-i-create-my-own-cape"><span class="octicon octicon-link"></span></a>How can I create my own cape?</h2>
<p>You can create a new cape document in the Mousecape app by hitting ⌘N (Command-N) and editing it with ⌘E. Click the "+" button to add cursors to customize and symply drag your images into the fields provided.</p>
<h2>
<a name="how-do-animated-cursors-work" class="anchor" href="#how-do-animated-cursors-work"><span class="octicon octicon-link"></span></a>How do animated cursors work?</h2>
<p>When you want to animate a cursor, change the value in the frames field in the edit window and make sure frame duration is how you want it. Next, create an image that has all of your cursor frames stacked on top of each other vertically. Mousecape will traverse down the image for each frame, using a box the same size as whatever you put in the size field.</p>
<h2>
<a name="how-can-i-say-thanks" class="anchor" href="#how-can-i-say-thanks"><span class="octicon octicon-link"></span></a>How can I say thanks?</h2>
<p>Tell your friends.</p>
<h2>
<a name="where-can-i-get-a-copy-of-this-sweet-tool" class="anchor" href="#where-can-i-get-a-copy-of-this-sweet-tool"><span class="octicon octicon-link"></span></a>Where can I get a copy of this sweet tool?</h2>
<p>In the <a href="https://github.com/alexzielenski/Mousecape/releases">releases section</a> of this GitHub page. There are stable reases there. <strong>The current version is 0.0.5</strong>.</p>
<h2>
<a name="license" class="anchor" href="#license"><span class="octicon octicon-link"></span></a>LICENSE</h2>
<p>I worked very hard researching the private methods used in Mousecape and creating this app. Please respect me and my work by not using any of the information provided here for commercial purposes.</p>
<p>Copyright (c) 2013-2014, Alex Zielenski
All rights reserved.</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<ul>
<li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
<li>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.</li>
<li>Any redistribution, use, or modification is done solely for personal benefit and not for any commercial purpose or for monetary gain</li>
</ul><p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
</section>
<footer>
Mousecape is maintained by <a href="https://github.com/alexzielenski">alexzielenski</a><br>
This page was generated by <a href="http://pages.github.com">GitHub Pages</a>. Tactile theme by <a href="https://twitter.com/jasonlong">Jason Long</a>.
</footer>
</div>
</div>
</body>
</html>
+1
View File
@@ -0,0 +1 @@
console.log('This would be the main JS file.');
-44
View File
@@ -1,44 +0,0 @@
/*
* Copyright (C) 2007-2008 Alacatia Labs
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
*
*/
#pragma once
#include "CGSConnection.h"
/*! Gets whether the display is zoomed. I'm not sure why there's two calls that appear to do the same thing - I think CGSIsZoomed calls through to CGSDisplayIsZoomed. */
CG_EXTERN bool CGSDisplayIsZoomed(void);
CG_EXTERN CGError CGSIsZoomed(CGSConnectionID cid, bool *outIsZoomed);
/*! Gets and sets the cursor scale. The largest the Universal Access prefpane allows you to go is 4.0. */
CG_EXTERN CGError CGSGetCursorScale(CGSConnectionID cid, float *outScale);
CG_EXTERN CGError CGSSetCursorScale(CGSConnectionID cid, float scale);
/*! Gets and sets the state of screen inversion. */
CG_EXTERN bool CGDisplayUsesInvertedPolarity(void);
CG_EXTERN void CGDisplaySetInvertedPolarity(bool invertedPolarity);
/*! Gets and sets whether the screen is grayscale. */
CG_EXTERN bool CGDisplayUsesForceToGray(void);
CG_EXTERN void CGDisplayForceToGray(bool forceToGray);
/*! Sets the display's contrast. There doesn't seem to be a get version of this function. */
CG_EXTERN CGError CGSSetDisplayContrast(float contrast);
-42
View File
@@ -1,42 +0,0 @@
/*
* Copyright (C) 2007-2008 Alacatia Labs
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
*
*/
#pragma once
#include "CGSConnection.h"
#include "CGSWindow.h"
typedef int CGSCIFilterID;
/*! Creates a new CGSCIFilter from a filter name. These names are the same as you'd usually use for CIFilters. */
CG_EXTERN CGError CGSNewCIFilterByName(CGSConnectionID cid, CFStringRef filterName, CGSCIFilterID *outFilter);
/*! Adds or removes a CIFilter to a window. Flags are currently unknown (the Dock uses 0x3001).
Note: This stuff is VERY crashy under 10.4.10 - make sure to remove the filter before minimizing the window or closing it. */
CG_EXTERN CGError CGSAddWindowFilter(CGSConnectionID cid, CGSWindowID wid, CGSCIFilterID filter, int flags);
CG_EXTERN CGError CGSRemoveWindowFilter(CGSConnectionID cid, CGSWindowID wid, CGSCIFilterID filter);
/*! Loads a set of values into the CIFilter. */
CG_EXTERN CGError CGSSetCIFilterValuesFromDictionary(CGSConnectionID cid, CGSCIFilterID filter, CFDictionaryRef filterValues);
/*! Releases a CIFilter. */
CG_EXTERN CGError CGSReleaseCIFilter(CGSConnectionID cid, CGSCIFilterID filter);
-85
View File
@@ -1,85 +0,0 @@
/*
* Copyright (C) 2007-2008 Alacatia Labs
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
*
*/
#pragma once
#include <ApplicationServices/ApplicationServices.h>
typedef int CGSConnectionID;
static const CGSConnectionID kCGSNullConnectionID = 0;
/*! DOCUMENTATION PENDING - verify this is Leopard only! */
CG_EXTERN CGError CGSSetLoginwindowConnection(CGSConnectionID cid) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
CG_EXTERN CGError CGSSetLoginwindowConnectionWithOptions(CGSConnectionID cid, CFDictionaryRef options) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
/*! Enables or disables updates on a connection. The WindowServer will forcibly reenable updates after 1 second. */
CG_EXTERN CGError CGSDisableUpdate(CGSConnectionID cid);
CG_EXTERN CGError CGSReenableUpdate(CGSConnectionID cid);
/*! Is there a menubar associated with this connection? */
CG_EXTERN bool CGSMenuBarExists(CGSConnectionID cid);
#pragma mark notifications
/*! Registers or removes a function to get notified when a connection is created. Only gets notified for connections created in the current application. */
typedef void (*CGSNewConnectionNotificationProc)(CGSConnectionID cid);
CG_EXTERN CGError CGSRegisterForNewConnectionNotification(CGSNewConnectionNotificationProc proc);
CG_EXTERN CGError CGSRemoveNewConnectionNotification(CGSNewConnectionNotificationProc proc);
/*! Registers or removes a function to get notified when a connection is released. Only gets notified for connections created in the current application. */
typedef void (*CGSConnectionDeathNotificationProc)(CGSConnectionID cid);
CG_EXTERN CGError CGSRegisterForConnectionDeathNotification(CGSConnectionDeathNotificationProc proc);
CG_EXTERN CGError CGSRemoveConnectionDeathNotification(CGSConnectionDeathNotificationProc proc);
/*! Creates a new connection to the window server. */
CG_EXTERN CGError CGSNewConnection(int unused, CGSConnectionID *outConnection);
/*! Releases a CGSConnection and all CGSWindows owned by it. */
CG_EXTERN CGError CGSReleaseConnection(CGSConnectionID cid);
/*! Gets the default connection for this process. `CGSMainConnectionID` is just a more modern name. */
CG_EXTERN CGSConnectionID _CGSDefaultConnection(void);
CG_EXTERN CGSConnectionID CGSMainConnectionID(void);
/*! Gets the default connection for the current thread. */
CG_EXTERN CGSConnectionID CGSDefaultConnectionForThread(void);
/* Gets the `pid` that owns this CGSConnection. */
CG_EXTERN CGError CGSConnectionGetPID(CGSConnectionID cid, pid_t *outPID);
/*! Gets the CGSConnection for the PSN. */
CG_EXTERN CGError CGSGetConnectionIDForPSN(CGSConnectionID cid, const ProcessSerialNumber *psn, CGSConnectionID *outOwnerCID);
/*! Gets and sets a connection's property. */
CG_EXTERN CGError CGSGetConnectionProperty(CGSConnectionID cid, CGSConnectionID targetCID, CFStringRef key, CFTypeRef *outValue);
CG_EXTERN CGError CGSSetConnectionProperty(CGSConnectionID cid, CGSConnectionID targetCID, CFStringRef key, CFTypeRef value);
/*! Closes ALL connections used by the current application. Essentially, it turns it into a console application. */
CG_EXTERN CGError CGSShutdownServerConnections(void);
/*! Only the owner of a window can manipulate it. So, Apple has the concept of a universal owner that owns all windows and can manipulate them all. There can only be one universal owner at a time (the Dock). */
CG_EXTERN CGError CGSSetUniversalOwner(CGSConnectionID cid);
/*! Sets a connection to be a universal owner. This call requires `cid` be a universal connection. */
CG_EXTERN CGError CGSSetOtherUniversalConnection(CGSConnectionID cid, CGSConnectionID otherConnection);
-104
View File
@@ -1,104 +0,0 @@
/*
* Copyright (C) 2007-2008 Alacatia Labs. (C) 2011-2012 Alex Zielenski
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
* Alex Zielenski alex@alexzielenski.com
*
*/
#pragma once
#include "CGSConnection.h"
typedef int CGSCursorID;
#pragma mark - Cursor APIs reversed by Alex Zielenski on Lion 10.7.3
#pragma mark -
// Verified, stable
/*! Registers a cursor in the current CGSConnection or globally */
CG_EXTERN CGError CGSRegisterCursorWithImages(CGSConnectionID cid, char *cursorName, bool setGlobally, bool instantly, int frameCount, CFArrayRef imageArray, CGSize cursorSize, CGPoint hotspot, int *seed, CGRect bounds, CGFloat frameDuration, int repeatCount);
/*! Sets the current cursor to a system defined cursor and returns the seed */
CG_EXTERN void CGSSetSystemDefinedCursorWithSeed(CGSConnectionID connection, CGSCursorID systemCursor, CGSCursorID *cursorSeed);
/*! Flag indicating whether or not the dock can change/override the cursor */
CG_EXTERN void CGSSetDockCursorOverride(CGSConnectionID cid, bool flag);
/*! Gets size in bytes of the raw ARGB data for the indicated cursor */
CG_EXTERN CGError CGSGetRegisteredCursorDataSize(CGSConnectionID cid, char *cursorName, size_t *size);
/*! Creates and returns a CGImage representation and the hotspot of a cursor for a name. Ownership follows the Create Rule */
CG_EXTERN CGImageRef CGSCreateRegisteredCursorImage(CGSConnectionID cid, char *cursorName, CGPoint *hotSpot);
/*! Sets the current cursor to a cursorname. Returns the seed of the current cursor. */
CG_EXTERN CGError CGSSetRegisteredCursor(CGSConnectionID cid, char *cursorName, CGSCursorID *seed);
/*! Retrieves registered ARGB cursor data and some other important info for it */
CG_EXTERN CGError CGSGetRegisteredCursorData2(CGSConnectionID cid, char *cursorName, void *data, size_t *dataSize, int *bytesPerRow, CGSize *imageSize, CGSize *cursorSize, CGPoint *hotSpot, int *bitsPerPixel, int *samplesPerPixel, int *bitsPerSample, int *frameCount, float *frameDuration);
// Not fully reversed/researched. Should not be used
CG_EXTERN CGError CGSRemoveRegisteredCursor(CGSConnectionID cid, char *cursorName, bool unknownFlag);
CG_EXTERN CGError CGSGetRegisteredCursorData(CGSConnectionID cid, char *cursorName, void *data, int *dataSize, CGSize *cursorSize, CGPoint *hotSpot, int *depth, int *bitsPerPixel, int *samplesPerPixel, int *bitsPerSample, int *unknown);
CG_EXTERN CGError CGSRegisterCursorWithImage(CGSConnectionID, char *, bool, bool, int, CGImageRef, CGSize, CGPoint, int *, CGFloat, CGFloat);
CG_EXTERN CGError CGSRegisterCursorWithData(CGSConnectionID cid, char *cursorName, char, bool, bool, CGSize, CGRect, CGPoint, int, int, int, int, int, int, int, int, int, int, int);
#pragma mark - Original cursor APIs found by Joe Ranieri in 2008 probably under Leopard (10.5)
#pragma mark -
/*! Does the system support hardware cursors? */
CG_EXTERN CGError CGSSystemSupportsHardwareCursor(CGSConnectionID cid, bool *outSupportsHardwareCursor);
/*! Does the system support hardware color cursors? */
CG_EXTERN CGError CGSSystemSupportsColorHardwareCursor(CGSConnectionID cid, bool *outSupportsHardwareCursor);
/*! Shows the cursor. */
CG_EXTERN CGError CGSShowCursor(CGSConnectionID cid);
/*! Hides the cursor. */
CG_EXTERN CGError CGSHideCursor(CGSConnectionID cid);
/*! Hides the cursor until the mouse is moved. */
CG_EXTERN CGError CGSObscureCursor(CGSConnectionID cid);
/*! Gets the cursor location. */
CG_EXTERN CGError CGSGetCurrentCursorLocation(CGSConnectionID cid, CGPoint *outPos);
/*! Gets the name (in reverse DNS form) of a system cursor. */
CG_EXTERN char *CGSCursorNameForSystemCursor(CGSCursorID cursor);
/*! Gets the size of the data for the connection's cursor. */
CG_EXTERN CGError CGSGetCursorDataSize(CGSConnectionID cid, int *outDataSize);
/*! Gets the data for the connection's cursor. */
CG_EXTERN CGError CGSGetCursorData(CGSConnectionID cid, void *outData);
/*! Gets the size of the data for the current cursor. */
CG_EXTERN CGError CGSGetGlobalCursorDataSize(CGSConnectionID cid, int *outDataSize);
/*! Gets the data for the current cursor. */
CG_EXTERN CGError CGSGetGlobalCursorData(CGSConnectionID cid, void *outData, int *outDataSize, CGSize *outSize, CGPoint *outHotSpot, int *outDepth, int *outComponents, int *outBitsPerComponent, int *m);
/*! Gets the size of data for a system-defined cursor. */
CG_EXTERN CGError CGSGetSystemDefinedCursorDataSize(CGSConnectionID cid, CGSCursorID cursor, int *outDataSize);
/*! Gets the data for a system-defined cursor. */
CG_EXTERN CGError CGSGetSystemDefinedCursorData(CGSConnectionID cid, CGSCursorID cursor, void *outData, int *outRowBytes, CGRect *outRect, CGRect *outHotSpot, int *outDepth, int *outComponents, int *outBitsPerComponent, int *mystery);
/*! Gets the cursor 'seed'. Every time the cursor is updated, the seed changes. */
CG_EXTERN int CGSCurrentCursorSeed(void);
/*! Shows or hides the spinning beachball of death. */
CG_EXTERN CGError CGSForceWaitCursorActive(CGSConnectionID cid, bool showWaitCursor);
-110
View File
@@ -1,110 +0,0 @@
/*
* Routines for debugging the window server and application drawing.
*
* Copyright (C) 2007-2008 Alacatia Labs
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
*
*/
#pragma once
#include "CGSConnection.h"
typedef enum {
/*! Clears all flags. */
kCGSDebugOptionNone = 0,
/*! All screen updates are flashed in yellow. Regions under a DisableUpdate are flashed in orange. Regions that are hardware accellerated are painted green. */
kCGSDebugOptionFlashScreenUpdates = 0x4,
/*! Colors windows green if they are accellerated, otherwise red. Doesn't cause things to refresh properly - leaves excess rects cluttering the screen. */
kCGSDebugOptionColorByAccelleration = 0x20,
/*! Disables shadows on all windows. */
kCGSDebugOptionNoShadows = 0x4000,
/*! Setting this disables the pause after a flash when using FlashScreenUpdates or FlashIdenticalUpdates. */
kCGSDebugOptionNoDelayAfterFlash = 0x20000,
/*! Flushes the contents to the screen after every drawing operation. */
kCGSDebugOptionAutoflushDrawing = 0x40000,
/*! Highlights mouse tracking areas. Doesn't cause things to refresh correctly - leaves excess rectangles cluttering the screen. */
kCGSDebugOptionShowMouseTrackingAreas = 0x100000,
/*! Flashes identical updates in red. */
kCGSDebugOptionFlashIdenticalUpdates = 0x4000000,
/*! Dumps a list of windows to /tmp/WindowServer.winfo.out. This is what Quartz Debug uses to get the window list. */
kCGSDebugOptionDumpWindowListToFile = 0x80000001,
/*! Dumps a list of connections to /tmp/WindowServer.cinfo.out. */
kCGSDebugOptionDumpConnectionListToFile = 0x80000002,
/*! Dumps a very verbose debug log of the WindowServer to /tmp/CGLog_WinServer_<PID>. */
kCGSDebugOptionVerboseLogging = 0x80000006,
/*! Dumps a very verbose debug log of all processes to /tmp/CGLog_<NAME>_<PID>. */
kCGSDebugOptionVerboseLoggingAllApps = 0x80000007,
/*! Dumps a list of hotkeys to /tmp/WindowServer.keyinfo.out. */
kCGSDebugOptionDumpHotKeyListToFile = 0x8000000E,
/*! Dumps information about OpenGL extensions, etc to /tmp/WindowServer.glinfo.out. */
kCGSDebugOptionDumpOpenGLInfoToFile = 0x80000013,
/*! Dumps a list of shadows to /tmp/WindowServer.shinfo.out. */
kCGSDebugOptionDumpShadowListToFile = 0x80000014,
/*! Leopard: Dumps information about caches to `/tmp/WindowServer.scinfo.out`. */
kCGSDebugOptionDumpCacheInformationToFile = 0x80000015,
/*! Leopard: Purges some sort of cache - most likely the same caches dummped with `kCGSDebugOptionDumpCacheInformationToFile`. */
kCGSDebugOptionPurgeCaches = 0x80000016,
/*! Leopard: Dumps a list of windows to `/tmp/WindowServer.winfo.plist`. This is what Quartz Debug on 10.5 uses to get the window list. */
kCGSDebugOptionDumpWindowListToPlist = 0x80000017,
/*! Leopard: DOCUMENTATION PENDING */
kCGSDebugOptionEnableSurfacePurging = 0x8000001B,
// Leopard: 0x8000001C - invalid
/*! Leopard: DOCUMENTATION PENDING */
kCGSDebugOptionDisableSurfacePurging = 0x8000001D,
/*! Leopard: Dumps information about an application's resource usage to `/tmp/CGResources_<NAME>_<PID>`. */
kCGSDebugOptionDumpResourceUsageToFiles = 0x80000020,
// Leopard: 0x80000022 - something about QuartzGL?
// Leopard: Returns the magic mirror to its normal mode. The magic mirror is what the Dock uses to draw the screen reflection. For more information, see `CGSSetMagicMirror`. */
kCGSDebugOptionSetMagicMirrorModeNormal = 0x80000023,
/*! Leopard: Disables the magic mirror. It still appears but draws black instead of a reflection. */
kCGSDebugOptionSetMagicMirrorModeDisabled = 0x80000024,
} CGSDebugOption;
/*! Gets and sets the debug options. These options are global and are not reset when your application dies! */
CG_EXTERN CGError CGSGetDebugOptions(int *outCurrentOptions);
CG_EXTERN CGError CGSSetDebugOptions(int options);
/*! Queries the server about its performance. This is how Quartz Debug gets the FPS meter, but not the CPU meter (for that it uses host_processor_info). Quartz Debug subtracts 25 so that it is at zero with the minimum FPS. */
CG_EXTERN CGError CGSGetPerformanceData(CGSConnectionID cid, float *outFPS, float *unk, float *unk2, float *unk3);
-62
View File
@@ -1,62 +0,0 @@
/*
* Copyright (C) 2007-2008 Alacatia Labs
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
* Ryan Govostes ryan@alacatia.com
*
*/
#pragma once
/*! Begins a new display configuration transacation. */
CG_EXTERN CGDisplayErr CGSBeginDisplayConfiguration(CGDisplayConfigRef *config);
/*! Sets the origin of a display relative to the main display. The main display is at (0, 0) and contains the menubar. */
// CG_EXTERN CGDisplayErr CGSConfigureDisplayOrigin(CGDisplayConfigRef config, CGDirectDisplayID display, CGDisplayCoord x, CGDisplayCoord y);
/*! Applies the configuration changes made in this transaction. */
CG_EXTERN CGDisplayErr CGSCompleteDisplayConfiguration(CGDisplayConfigRef config);
/*! Gets the main display. */
CG_EXTERN CGDirectDisplayID CGSMainDisplayID(void);
/*! Drops the configuration changes made in this transaction. */
CG_EXTERN CGDisplayErr CGSCancelDisplayConfiguration(CGDisplayConfigRef config);
/*! Gets a list of on line displays */
CG_EXTERN CGDisplayErr CGSGetOnlineDisplayList(CGDisplayCount maxDisplays, CGDirectDisplayID *displays, CGDisplayCount *outDisplayCount);
/*! Gets a list of active displays */
CG_EXTERN CGDisplayErr CGSGetActiveDisplayList(CGDisplayCount maxDisplays, CGDirectDisplayID *displays, CGDisplayCount *outDisplayCount);
/*! Gets the depth of a display. */
CG_EXTERN CGError CGSGetDisplayDepth(CGDirectDisplayID display, int *outDepth);
/*! Gets the displays at a point. Note that multiple displays can have the same point - think mirroring. */
CG_EXTERN CGError CGSGetDisplaysWithPoint(const CGPoint *point, int maxDisplayCount, CGDirectDisplayID *outDisplays, int *outDisplayCount);
/*! Gets the displays which contain a rect. Note that multiple displays can have the same bounds - think mirroring. */
CG_EXTERN CGError CGSGetDisplaysWithRect(const CGRect *point, int maxDisplayCount, CGDirectDisplayID *outDisplays, int *outDisplayCount);
/*! Gets the bounds for the display. Note that multiple displays can have the same bounds - think mirroring. */
CG_EXTERN CGError CGSGetDisplayRegion(CGDirectDisplayID display, CGSRegionObj *outRegion);
CG_EXTERN CGError CGSGetDisplayBounds(CGDirectDisplayID display, CGRect *outRect);
/*! Gets the number of bytes per row. */
CG_EXTERN CGError CGSGetDisplayRowBytes(CGDirectDisplayID display, int *outRowBytes);
-150
View File
@@ -1,150 +0,0 @@
/*
* Copyright (C) 2007-2008 Alacatia Labs
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
*
*/
#pragma once
#include "CGSConnection.h"
// A symbolic hotkey is basically a named hotkey which is remembered between application launches.
typedef enum {
// full keyboard access hotkeys
kCGSHotKeyToggleFullKeyboardAccess = 12,
kCGSHotKeyFocusMenubar = 7,
kCGSHotKeyFocusDock = 8,
kCGSHotKeyFocusNextGlobalWindow = 9,
kCGSHotKeyFocusToolbar = 10,
kCGSHotKeyFocusFloatingWindow = 11,
kCGSHotKeyFocusApplicationWindow = 27,
kCGSHotKeyFocusNextControl = 13,
kCGSHotKeyFocusDrawer = 51,
kCGSHotKeyFocusStatusItems = 57,
// screenshot hotkeys
kCGSHotKeyScreenshot = 28,
kCGSHotKeyScreenshotToClipboard = 29,
kCGSHotKeyScreenshotRegion = 30,
kCGSHotKeyScreenshotRegionToClipboard = 31,
// universal access
kCGSHotKeyToggleZoom = 15,
kCGSHotKeyZoomOut = 19,
kCGSHotKeyZoomIn = 17,
kCGSHotKeyZoomToggleSmoothing = 23,
kCGSHotKeyIncreaseContrast = 25,
kCGSHotKeyDecreaseContrast = 26,
kCGSHotKeyInvertScreen = 21,
kCGSHotKeyToggleVoiceOver = 59,
// Dock
kCGSHotKeyToggleDockAutohide = 52,
kCGSHotKeyExposeAllWindows = 32,
kCGSHotKeyExposeAllWindowsSlow = 34,
kCGSHotKeyExposeApplicationWindows = 33,
kCGSHotKeyExposeApplicationWindowsSlow = 35,
kCGSHotKeyExposeDesktop = 36,
kCGSHotKeyExposeDesktopsSlow = 37,
kCGSHotKeyDashboard = 62,
kCGSHotKeyDashboardSlow = 63,
// spaces (Leopard and later)
kCGSHotKeySpaces = 75,
kCGSHotKeySpacesSlow = 76,
// 77 - fn F7 (disabled)
// 78 - ⇧fn F7 (disabled)
kCGSHotKeySpaceLeft = 79,
kCGSHotKeySpaceLeftSlow = 80,
kCGSHotKeySpaceRight = 81,
kCGSHotKeySpaceRightSlow = 82,
kCGSHotKeySpaceDown = 83,
kCGSHotKeySpaceDownSlow = 84,
kCGSHotKeySpaceUp = 85,
kCGSHotKeySpaceUpSlow = 86,
// input
kCGSHotKeyToggleCharacterPallette = 50,
kCGSHotKeySelectPreviousInputSource = 60,
kCGSHotKeySelectNextInputSource = 61,
// Spotlight
kCGSHotKeySpotlightSearchField = 64,
kCGSHotKeySpotlightWindow = 65,
kCGSHotKeyToggleFrontRow = 73,
kCGSHotKeyLookUpWordInDictionary = 70,
kCGSHotKeyHelp = 98, //AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
// displays - not verified
kCGSHotKeyDecreaseDisplayBrightness = 53,
kCGSHotKeyIncreaseDisplayBrightness = 54,
} CGSSymbolicHotKey;
typedef enum {
kCGSGlobalHotKeyEnable,
kCGSGlobalHotKeyDisable,
kCGSGlobalHotKeyDisableAllButUniversalAccess
} CGSGlobalHotKeyOperatingMode;
/*! Modifier flags that can be passed to the various hotkey routines. Note that these are a
subset of the Cocoa modifier flags declared in NSEvent.h.
*/
typedef enum {
kCGSAlphaLockKeyFlag = 1 << 16,
kCGSShiftKeyFlag = 1 << 17,
kCGSOptionKeyFlag = 1 << 18,
kCGSControlKeyFlag = 1 << 19,
kCGSCommandKeyFlag = 1 << 20,
} CGSHotkeyFlags;
/*! DOCUMENTATION PENDING */
CG_EXTERN CGError CGSGetSymbolicHotKeyValue(CGSSymbolicHotKey hotKey, int *unknown, int *outVirtualKeyCode, int *outModifiers);
/*! Gets and sets whether a symbolic hot key is enabled. */
CG_EXTERN bool CGSIsSymbolicHotKeyEnabled(CGSSymbolicHotKey hotKey);
CG_EXTERN CGError CGSSetSymbolicHotKeyEnabled(CGSSymbolicHotKey hotKey, bool isEnabled);
/*! Gets and sets the global hotkey operating mode. This can be used to disable all hotkeys. */
CG_EXTERN CGError CGSGetGlobalHotKeyOperatingMode(CGSConnectionID cid, CGSGlobalHotKeyOperatingMode *outMode);
CG_EXTERN CGError CGSSetGlobalHotKeyOperatingMode(CGSConnectionID cid, CGSGlobalHotKeyOperatingMode mode);
/*
Registers a hotkey with the system. `hotKeyData` is an arbitrary pointer that is used to identify
this hotkey. When the user presses the hotkey, it is sent through the standard event queue or
responder chain mechanism.
In Cocoa, it appears as an NSEvent of type NSSystemDefined. The event's data1 property contains
the value passed into `hotkeyData`.
The `hardcodedValue` parameter has no implications and MUST be 0xFFFF or the function will return
an error.
Note that 'with exclusion' means that no other process can register this hotkey until you remove
it via CGSRemoveHotkey.
*/
CG_EXTERN CGError CGSSetHotKeyWithExclusion(CGSConnectionID cid, void *hotkeyData, int hardcodedValue, UInt32 hotkeyCode, int flags);
/*! Unregisters a hotkey. You must pass the same `hotkeyData` that you passed when the hotkey was registered. */
CG_EXTERN CGError CGSRemoveHotKey(CGSConnectionID cid, void *hotkeyData);
/* Determines if a hotkey is enabled. You must pass the same `hotkeyData` that you passed when the hotkey was registered. */
CG_EXTERN CGError CGSSetHotKeyEnabled(CGSConnectionID cid, void *hotkeyData, bool isEnabled);
CG_EXTERN CGError CGSIsHotKeyEnabled(CGSConnectionID cid, void *hotkeyData, bool *isEnabled);
-49
View File
@@ -1,49 +0,0 @@
/*
* Copyright (C) 2007-2008 Alacatia Labs
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
*
*/
#pragma once
#include <Carbon/Carbon.h>
#include <ApplicationServices/ApplicationServices.h>
// #warning CGSInternal contains PRIVATE FUNCTIONS and should NOT BE USED in shipping applications!
#ifndef MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
#define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER UNAVAILABLE_ATTRIBUTE
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER
#endif
#include "CarbonHelpers.h"
#include "CGSAccessibility.h"
#include "CGSCIFilter.h"
#include "CGSConnection.h"
#include "CGSCursor.h"
#include "CGSDebug.h"
#include "CGSDisplays.h"
#include "CGSHotKeys.h"
#include "CGSNotifications.h"
#include "CGSMisc.h"
#include "CGSRegion.h"
#include "CGSSession.h"
#include "CGSTransitions.h"
#include "CGSWindow.h"
#include "CGSWorkspace.h"
-68
View File
@@ -1,68 +0,0 @@
/*
* Copyright (C) 2007-2008 Alacatia Labs
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
*
*/
#pragma once
#include "CGSInternal.h"
/*! DOCUMENTATION PENDING */
CG_EXTERN CGError CGSFetchDirtyScreenRegion(CGSConnectionID cid, CGSRegionObj *outDirtyRegion);
/*! Is someone watching this screen? Applies to Apple's remote desktop only? */
CG_EXTERN bool CGSIsScreenWatcherPresent(void);
/*! Returns `True` if the application has been deemed unresponsive for a certain amount of time. */
CG_EXTERN bool CGSEventIsAppUnresponsive(CGSConnectionID cid, const ProcessSerialNumber *psn);
/*! Sets the amount of time it takes for an application to be considered unresponsive. */
CG_EXTERN CGError CGSEventSetAppIsUnresponsiveNotificationTimeout(CGSConnectionID cid, double time);
/*! Sets the cursor position. */
CG_EXTERN CGError CGSWarpCursorPosition(CGSConnectionID cid, float x, float y);
/*! DOCUMENTATION PENDING */
CG_EXTERN CGError CGSHideBackstopMenuBar(CGSConnectionID cid);
CG_EXTERN CGError CGSShowBackstopMenuBar(CGSConnectionID cid);
/*! Determines if this computer is portable. Internally this just checks to see if it has a battery. */
CG_EXTERN bool CGSIsPortableMachine(void);
/*! Sets the area taken up by the dock. Requires the caller to be a universal owner. */
CG_EXTERN CGError CGSSetDockRect(CGSConnectionID cid, float x, float y, float width, float height);
/*! DOCUMENTATION PENDING - returns false. Perhaps related to the CGSTBE_QDACCEL env variable. */
CG_EXTERN bool CGSIsClassicBuffered(void);
#pragma mark errors
/* Logs an error and returns `err`. */
CG_EXTERN CGError CGSGlobalError(CGError err, const char *msg);
/* Logs an error and returns `err`. */
CG_EXTERN CGError CGSGlobalErrorv(CGError err, const char *msg, ...);
/*! Gets the error message for an error code. */
CG_EXTERN char *CGSErrorString(CGError error);
#pragma mark input
/*! Gets and sets the status of secure input. When secure input is enabled, keyloggers, etc are harder to do. */
CG_EXTERN bool CGSIsSecureEventInputSet(void);
CG_EXTERN CGError CGSSetSecureEventInput(CGSConnectionID cid, bool useSecureInput);
-93
View File
@@ -1,93 +0,0 @@
/*
* Copyright (C) 2007-2008 Alacatia Labs
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
*
*/
#pragma once
#include "CGSInternal.h"
#include "CGSTransitions.h"
typedef enum {
kCGSNotificationDebugOptionsChanged = 200,
kCGSNotificationMouseMoved = 715,
kCGSNotificationTrackingRegionEntered = 718,
kCGSNotificationTrackingRegionExited = 719,
// 724 - keyboard preferences changed
// 729, 730 seem to be process deactivated / activated - but only for this process
// 731 seems to be this process hidden or shown
kCGSNotificationAppUnresponsive = 750,
kCGSNotificationAppResponsive = 751,
// 761 - hotkey disabled
// 762 - hotkey enabled (do these two fire twice?)
// 763 - hotkey begins editing
// 764 - hotkey ends editing
// 765, 766 seem to be about the hotkey state (all disabled, etc)
kCGSNotificationWorkspaceChanged = 1401,
kCGSNotificationTransitionEnded = 1700,
} CGSNotificationType;
//! The data sent with kCGSNotificationAppUnresponsive and kCGSNotificationAppResponsive.
typedef struct {
#if __BIG_ENDIAN__
uint16_t majorVersion;
uint16_t minorVersion;
#else
uint16_t minorVersion;
uint16_t majorVersion;
#endif
//! The length of the entire notification.
uint32_t length;
CGSConnectionID cid;
pid_t pid;
ProcessSerialNumber psn;
} CGSProcessNotificationData;
//! The data sent with kCGSNotificationDebugOptionsChanged.
typedef struct {
int newOptions;
int unknown[2]; // these two seem to be zero
} CGSDebugNotificationData;
//! The data sent with kCGSNotificationTransitionEnded
typedef struct {
CGSTransitionID transition;
} CGSTransitionNotificationData;
typedef void (*CGSNotifyProcPtr)(CGSNotificationType type, void *data, unsigned int dataLength, void *userData);
//! Registers a function to receive notifications.
CG_EXTERN CGError CGSRegisterNotifyProc(CGSNotifyProcPtr proc, CGSNotificationType type, void *userData);
//! Unregisters a function that was registered to receive notifications.
CG_EXTERN CGError CGSRemoveNotifyProc(CGSNotifyProcPtr proc, CGSNotificationType type, void *userData);
-107
View File
@@ -1,107 +0,0 @@
/*
* Copyright (C) 2007-2008 Alacatia Labs
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
*
*/
#pragma once
#pragma mark types
#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED
// on Leopard and up these are CFTypes
typedef CFTypeRef CGSRegionObj;
typedef CFTypeRef CGSRegionEnumeratorObj;
#else
// but opaque types under 10.4
typedef int CGSRegionObj;
typedef int CGSRegionEnumeratorObj;
#endif
/*! Creates a region from a `CGRect`. */
CG_EXTERN CGError CGSNewRegionWithRect(const CGRect *rect, CGSRegionObj *outRegion);
/*! Creates a region from a list of `CGRect`s. */
CG_EXTERN CGError CGSNewRegionWithRectList(const CGRect *rects, int rectCount, CGSRegionObj *outRegion);
/*! Creates a new region from a QuickDraw region. */
CG_EXTERN CGError CGSNewRegionWithQDRgn(RgnHandle region, CGSRegionObj *outRegion);
/*! Creates an empty region. */
CG_EXTERN CGError CGSNewEmptyRegion(CGSRegionObj *outRegion);
/*! Releases a region. */
CG_EXTERN CGError CGSReleaseRegion(CGSRegionObj region);
/*! Creates a `CGRect` from a region. */
CG_EXTERN CGError CGSGetRegionBounds(CGSRegionObj region, CGRect *outRect);
/*! Determines if two regions are equal. */
CG_EXTERN bool CGSRegionsEqual(CGSRegionObj region1, CGSRegionObj region2);
/* Created a new region by changing the origin an existing one. */
CG_EXTERN CGError CGSOffsetRegion(CGSRegionObj region, float offsetLeft, float offsetTop, CGSRegionObj *outRegion);
/*! Creates a new region by copying an existing one. */
CG_EXTERN CGError CGSCopyRegion(CGSRegionObj region, CGSRegionObj *outRegion);
/*! Creates a new region by combining two regions together. */
CG_EXTERN CGError CGSUnionRegion(CGSRegionObj region1, CGSRegionObj region2, CGSRegionObj *outRegion);
/*! Creates a new region by combining a region and a rect. */
CG_EXTERN CGError CGSUnionRegionWithRect(CGSRegionObj region, CGRect *rect, CGSRegionObj *outRegion);
/*! Creates a region by XORing two regions together. */
CG_EXTERN CGError CGSXorRegion(CGSRegionObj region1, CGSRegionObj region2, CGSRegionObj *outRegion);
/*! Determines if the region is empty. */
CG_EXTERN bool CGSRegionIsEmpty(CGSRegionObj region);
/*! Determines if the region is rectangular. */
CG_EXTERN bool CGSRegionIsRectangular(CGSRegionObj region);
/*! Determines if a point in a region. */
CG_EXTERN bool CGSPointInRegion(CGSRegionObj region, const CGPoint *point);
/*! Determines if a rect is in a region. */
CG_EXTERN bool CGSRectInRegion(CGSRegionObj region, const CGRect *rect);
/*! Determines if a region is inside of a region. */
CG_EXTERN bool CGSRegionInRegion(CGSRegionObj region1, CGSRegionObj region2);
/*! Determines if a rect intersects a region. */
CG_EXTERN bool CGSRegionIntersectsRect(CGSRegionObj obj, const CGRect *rect);
/*! Determines if a region intersects a region. */
CG_EXTERN bool CGSRegionIntersectsRegion(CGSRegionObj region1, CGSRegionObj region2);
/*! Creates a rect from the difference of two regions. */
CG_EXTERN CGError CGSDiffRegion(CGSRegionObj region1, CGSRegionObj region2, CGSRegionObj *outRegion);
#pragma mark region enumerators
/*! Gets the enumerator for a region. */
CG_EXTERN CGSRegionEnumeratorObj CGSRegionEnumerator(CGSRegionObj region);
/*! Releases a region enumerator. */
CG_EXTERN void CGSReleaseRegionEnumerator(CGSRegionEnumeratorObj enumerator);
/*! Gets the next rect of a region. */
CG_EXTERN CGRect* CGSNextRect(CGSRegionEnumeratorObj enumerator);
-50
View File
@@ -1,50 +0,0 @@
/*
* Copyright (C) 2007-2008 Alacatia Labs
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
*
*/
#pragma once
#include "CGSInternal.h"
typedef int CGSSessionID;
/*! Gets information about the current login session. Keys as of 10.4:
kCGSSessionGroupIDKey
kCGSSessionOnConsoleKey
kCGSSessionIDKey
kCGSSessionUserNameKey
kCGSessionLoginDoneKey
kCGSessionLongUserNameKey
kCGSSessionSystemSafeBoot
kCGSSessionLoginwindowSafeLogin
kCGSSessionConsoleSetKey
kCGSSessionUserIDKey
*/
CG_EXTERN CFDictionaryRef CGSCopyCurrentSessionDictionary(void);
/*! Creates a new "blank" login session. Switches to the LoginWindow. This does NOT check to see if fast user switching is enabled! */
CG_EXTERN CGError CGSCreateLoginSession(CGSSessionID *outSession);
/*! Releases a session. */
CG_EXTERN CGError CGSReleaseSession(CGSSessionID session);
/*! Gets a list of sessions. Each session dictionary is in the format returned by `CGSCopyCurrentSessionDictionary`. */
CG_EXTERN CFArrayRef CGSCopySessionList(void);
-72
View File
@@ -1,72 +0,0 @@
/*
* Copyright (C) 2007-2008 Alacatia Labs
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
*
*/
#pragma once
#include "CGSConnection.h"
typedef int CGSTransitionID;
typedef enum {
kCGSTransitionNone,
kCGSTransitionFade,
kCGSTransitionZoom,
kCGSTransitionReveal,
kCGSTransitionSlide,
kCGSTransitionWarpFade,
kCGSTransitionSwap,
kCGSTransitionCube,
kCGSTransitionWarpSwitch,
kCGSTransitionFlip
} CGSTransitionType;
typedef enum {
/*! Directions for the transition. Some directions don't apply to some transitions. */
kCGSTransitionDirectionLeft = 1 << 0,
kCGSTransitionDirectionRight = 1 << 1,
kCGSTransitionDirectionDown = 1 << 2,
kCGSTransitionDirectionUp = 1 << 3,
kCGSTransitionDirectionCenter = 1 << 4,
/*! Reverses a transition. Doesn't apply for all transitions. */
kCGSTransitionFlagReversed = 1 << 5,
/*! Ignore the background color and only transition the window. */
kCGSTransitionFlagTransparent = 1 << 7,
} CGSTransitionFlags;
typedef struct {
int unknown; // always set to zero
CGSTransitionType type;
CGSTransitionFlags options;
CGSWindowID wid; /* 0 means a full screen transition. */
float *backColor; /* NULL means black. */
} CGSTransitionSpec;
/*! Creates a new transition from a `CGSTransitionSpec`. */
CG_EXTERN CGError CGSNewTransition(CGSConnectionID cid, const CGSTransitionSpec *spec, CGSTransitionID *outTransition);
/*! Invokes a transition asynchronously. Note that `duration` is in seconds. */
CG_EXTERN CGError CGSInvokeTransition(CGSConnectionID cid, CGSTransitionID transition, float duration);
/*! Releases a transition. */
CG_EXTERN CGError CGSReleaseTransition(CGSConnectionID cid, CGSTransitionID transition);
-192
View File
@@ -1,192 +0,0 @@
/*
* Copyright (C) 2007-2008 Alacatia Labs
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
*
*/
#pragma once
#include "CGSConnection.h"
#include "CGSRegion.h"
typedef int CGSWindowID;
typedef int CGSAnimationObj;
typedef struct { CGPoint localPoint; CGPoint globalPoint; } CGSWarpPoint;
typedef enum {
kCGSSharingNone,
kCGSSharingReadOnly,
kCGSSharingReadWrite
} CGSSharingState;
typedef enum {
kCGSOrderBelow = -1,
kCGSOrderOut, /* hides the window */
kCGSOrderAbove,
kCGSOrderIn /* shows the window */
} CGSWindowOrderingMode;
typedef enum {
kCGSBackingNonRetianed,
kCGSBackingRetained,
kCGSBackingBuffered,
} CGSBackingType;
/*! Switches to the next (or previous) window in the global list. */
CG_EXTERN CGError CGSCycleWindows(CGSConnectionID cid, CGSWindowOrderingMode order);
/*! Gets and sets the desktop window. Not sure what happens if more than one process sets the desktop window. */
CG_EXTERN CGError CGSDesktopWindow(CGSConnectionID cid, CGSWindowID *outWID);
CG_EXTERN CGError CGSSetDesktopWindow(CGSConnectionID cid, CGSWindowID wid);
/*! Sets the window's title. Internally this simply calls `CGSSetWindowProperty(cid, wid, kCGSWindowTitle, title)`. */
CG_EXTERN CGError CGSSetWindowTitle(CGSConnectionID cid, CGSWindowID wid, CFStringRef title);
/*! Gets and sets a property for a window. */
CG_EXTERN CGError CGSGetWindowProperty(CGSConnectionID cid, CGSWindowID wid, CFStringRef key, CFTypeRef *outValue);
CG_EXTERN CGError CGSSetWindowProperty(CGSConnectionID cid, CGSWindowID wid, CFStringRef key, CFTypeRef value);
/*! Gets and sets the window's transparency. */
CG_EXTERN CGError CGSGetWindowAlpha(CGSConnectionID cid, CGSWindowID wid, float *outAlpha);
CG_EXTERN CGError CGSSetWindowAlpha(CGSConnectionID cid, CGSWindowID wid, float alpha);
/*! Sets the alpha of a group of windows over a period of time. Note that `duration` is in seconds. */
CG_EXTERN CGError CGSSetWindowListAlpha(CGSConnectionID cid, const CGSWindowID *widList, int widCount, float alpha, float duration);
/*! Gets and sets the `CGConnectionID` that owns this window. Only the owner can change most properties of the window. */
CG_EXTERN CGError CGSGetWindowOwner(CGSConnectionID cid, CGSWindowID wid, CGSConnectionID *outOwner);
CG_EXTERN CGError CGSSetWindowOwner(CGSConnectionID cid, CGSWindowID wid, CGSConnectionID owner);
/*! Sets the background color of the window. */
CG_EXTERN CGError CGSSetWindowAutofillColor(CGSConnectionID cid, CGSWindowID wid, float red, float green, float blue);
/*! Locks a window to the cursor, so that whenever the cursor moves, the window moves with it. There doesn't seem to be a way to unlock the window from the cursor. */
CG_EXTERN CGError CGSLockWindowToCursor(CGSConnectionID cid, CGSWindowID wid, float offsetLeft, float offsetTop);
/*! Sets the warp for the window. The mesh maps a local (window) point to a point on screen. */
CG_EXTERN CGError CGSSetWindowWarp(CGSConnectionID cid, CGSWindowID wid, int warpWidth, int warpHeight, const CGSWarpPoint *warp);
/*! Gets or sets whether the window server should auto-fill the window's background. */
CG_EXTERN CGError CGSGetWindowAutofill(CGSConnectionID cid, CGSWindowID wid, bool *outShouldAutoFill);
CG_EXTERN CGError CGSSetWindowAutofill(CGSConnectionID cid, CGSWindowID wid, bool shouldAutoFill);
/*! Gets the screen rect for a window. */
CG_EXTERN CGError CGSGetScreenRectForWindow(CGSConnectionID cid, CGSWindowID wid, CGRect *outRect);
/*! Gets and sets the window level for a window. */
CG_EXTERN CGError CGSGetWindowLevel(CGSConnectionID cid, CGSWindowID wid, CGWindowLevel *outLevel);
CG_EXTERN CGError CGSSetWindowLevel(CGSConnectionID cid, CGSWindowID wid, CGWindowLevel level);
/*! Gets and sets the sharing state. This determines the level of access other applications have over this window. */
CG_EXTERN CGError CGSGetWindowSharingState(CGSConnectionID cid, CGSWindowID wid, CGSSharingState *outState);
CG_EXTERN CGError CGSSetWindowSharingState(CGSConnectionID cid, CGSWindowID wid, CGSSharingState state);
/*! Sets whether this window is ignored in the global window cycle (Control-F4 by default). There is no Get version? */
CG_EXTERN CGError CGSSetIgnoresCycle(CGSConnectionID cid, CGSWindowID wid, bool ignoresCycle);
/*! Creates a graphics context for the window. */
CG_EXTERN CGContextRef CGWindowContextCreate(CGSConnectionID cid, CGSWindowID wid, int unknown);
/*! Sets the order of a window */
CG_EXTERN CGError CGSOrderWindow(CGSConnectionID cid, CGSWindowID wid, CGSWindowOrderingMode mode, CGSWindowID relativeToWID);
/*! Sets the origin (top-left) of a window */
CG_EXTERN CGError CGSMoveWindow(CGSConnectionID cid, CGSWindowID wid, const CGPoint *origin);
/*! Sets the origin (top-left) of a window relative to another window's origin. */
CG_EXTERN CGError CGSSetWindowOriginRelativeToWindow(CGSConnectionID cid, CGSWindowID wid, CGSWindowID relativeToWID, float offsetX, float offsetY);
/* Flushes a window's buffer to the screen. */
CG_EXTERN CGError CGSFlushWindow(CGSConnectionID cid, CGSWindowID wid, CGSRegionObj flushRegion);
#pragma mark shadows
/*! Gets and sets the shadow information for a window. Values for `flags` are unknown. */
CG_EXTERN CGError CGSSetWindowShadowAndRimParameters(CGSConnectionID cid, CGSWindowID wid, float standardDeviation, float density, int offsetX, int offsetY, int flags);
CG_EXTERN CGError CGSGetWindowShadowAndRimParameters(CGSConnectionID cid, CGSWindowID wid, float *outStandardDeviation, float *outDensity, int *outOffsetX, int *outOffsetY, int *outFlags);
/*! Sets the shadow information for a window. Simply calls through to `CGSSetWindowShadowAndRimParameters` passing 1 for `flags`. */
CG_EXTERN CGError CGSSetWindowShadowParameters(CGSConnectionID cid, CGSWindowID wid, float standardDeviation, float density, int offsetX, int offsetY);
/*! Invalidates a window's shadow. */
CG_EXTERN CGError CGSInvalidateWindowShadow(CGSConnectionID cid, CGSWindowID wid);
#pragma mark window lists
/*! Gets the number of windows the `targetCID` owns. */
CG_EXTERN CGError CGSGetWindowCount(CGSConnectionID cid, CGSConnectionID targetCID, int *outCount);
/*! Gets a list of windows owned by `targetCID`. */
CG_EXTERN CGError CGSGetWindowList(CGSConnectionID cid, CGSConnectionID targetCID, int count, CGSWindowID *list, int *outCount);
/*! Gets the number of windows owned by `targetCID` that are on screen. */
CG_EXTERN CGError CGSGetOnScreenWindowCount(CGSConnectionID cid, CGSConnectionID targetCID, int *outCount);
/*! Gets a list of windows oned by `targetCID` that are on screen. */
CG_EXTERN CGError CGSGetOnScreenWindowList(CGSConnectionID cid, CGSConnectionID targetCID, int count, CGSWindowID *list, int *outCount);
#pragma mark window management
/*! Creates a new CGSWindow. The real window top/left is the sum of the region's top/left and the top/left parameters. */
CG_EXTERN CGError CGSNewWindow(CGSConnectionID cid, CGSBackingType backingType, float left, float top, CGSRegionObj region, CGSWindowID *outWID);
/*! Creates a new CGSWindow. The real window top/left is the sum of the region's top/left and the top/left parameters. */
CG_EXTERN CGError CGSNewWindowWithOpaqueShape(CGSConnectionID cid, CGSBackingType backingType, float left, float top, CGSRegionObj region, CGSRegionObj opaqueShape, int unknown, const int *tags, int tagSize, CGSWindowID *outWID);
/*! Releases a CGSWindow. */
CG_EXTERN CGError CGSReleaseWindow(CGSConnectionID cid, CGSWindowID wid);
#pragma mark animations
/*! Creates a Dock-style genie animation that goes from `wid` to `destinationWID`. */
CG_EXTERN CGError CGSCreateGenieWindowAnimation(CGSConnectionID cid, CGSWindowID wid, CGSWindowID destinationWID, CGSAnimationObj *outAnimation);
/*! Creates a sheet animation that's used when the parent window is brushed metal. Oddly enough, seems to be the only one used, even if the parent window isn't metal. */
CG_EXTERN CGError CGSCreateMetalSheetWindowAnimationWithParent(CGSConnectionID cid, CGSWindowID wid, CGSWindowID parentWID, CGSAnimationObj *outAnimation);
/*! Sets the progress of an animation. */
CG_EXTERN CGError CGSSetWindowAnimationProgress(CGSAnimationObj animation, float progress);
/*! DOCUMENTATION PENDING */
CG_EXTERN CGError CGSWindowAnimationChangeLevel(CGSAnimationObj animation, CGWindowLevel level);
/*! DOCUMENTATION PENDING */
CG_EXTERN CGError CGSWindowAnimationSetParent(CGSAnimationObj animation, CGSWindowID parent) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
/*! Releases a window animation. */
CG_EXTERN CGError CGSReleaseWindowAnimation(CGSAnimationObj animation);
#pragma mark window accelleration
/*! Gets the state of accelleration for the window. */
CG_EXTERN CGError CGSWindowIsAccelerated(CGSConnectionID cid, CGSWindowID wid, bool *outIsAccelerated);
/*! Gets and sets if this window can be accellerated. I don't know if playing with this is safe. */
CG_EXTERN CGError CGSWindowCanAccelerate(CGSConnectionID cid, CGSWindowID wid, bool *outCanAccelerate);
CG_EXTERN CGError CGSWindowSetCanAccelerate(CGSConnectionID cid, CGSWindowID wid, bool canAccelerate);
#pragma mark system status items
/*! Registers or unregisters a window as a global status item (see `NSStatusItem`, `NSMenuExtra`). Once a window is registered, the window server takes care of placing it in the apropriate location. */
CG_EXTERN CGError CGSRegisterWindowWithSystemStatusBar(CGSConnectionID cid, CGSWindowID wid, int priority);
CG_EXTERN CGError CGSUnregisterWindowWithSystemStatusBar(CGSConnectionID cid, CGSWindowID wid);
/*! Rearranges items in the system status bar. You should call this after registering or unregistering a status item or changing the window's width. */
CG_EXTERN CGError CGSAdjustSystemStatusBarWindows(CGSConnectionID cid);
-49
View File
@@ -1,49 +0,0 @@
/*
* Copyright (C) 2007-2008 Alacatia Labs
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
*
*/
#pragma once
#include "CGSConnection.h"
#include "CGSWindow.h"
#include "CGSTransitions.h"
typedef unsigned int CGSWorkspaceID;
/*! The space id given when we're switching spaces. */
static const CGSWorkspaceID kCGSTransitioningWorkspaceID = 65538;
/*! Gets and sets the current workspace. */
CG_EXTERN CGError CGSGetWorkspace(CGSConnectionID cid, CGSWorkspaceID *outWorkspace);
CG_EXTERN CGError CGSSetWorkspace(CGSConnectionID cid, CGSWorkspaceID workspace);
/*! Transitions to a workspace asynchronously. Note that `duration` is in seconds. */
CG_EXTERN CGError CGSSetWorkspaceWithTransition(CGSConnectionID cid, CGSWorkspaceID workspace, CGSTransitionType transition, CGSTransitionFlags options, float duration);
/*! Gets and sets the workspace for a window. */
CG_EXTERN CGError CGSGetWindowWorkspace(CGSConnectionID cid, CGSWindowID wid, CGSWorkspaceID *outWorkspace);
CG_EXTERN CGError CGSSetWindowWorkspace(CGSConnectionID cid, CGSWindowID wid, CGSWorkspaceID workspace);
/*! Gets the number of windows in the workspace. */
CG_EXTERN CGError CGSGetWorkspaceWindowCount(CGSConnectionID cid, int workspaceNumber, int *outCount);
CG_EXTERN CGError CGSGetWorkspaceWindowList(CGSConnectionID cid, int workspaceNumber, int count, CGSWindowID *list, int *outCount);
-36
View File
@@ -1,36 +0,0 @@
/*
* Contains utilities for using Carbon with CGS routines.
*
* Copyright (C) 2007-2008 Alacatia Labs
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Joe Ranieri joe@alacatia.com
*
*/
#pragma once
#include "CGSWindow.h"
/* Gets a CGSWindowID for a WindowRef. Implemented in Carbon.framework.
This call is deprecated in 10.5. Please use the public alternative, `HIWindowGetCGWindowID`. */
CG_EXTERN CGSWindowID GetNativeWindowFromWindowRef(WindowRef ref) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
/* Gets a WindowRef (in the current process) from a CGSWindowID. Implemented in Carbon.framework.
This call is deprecated in 10.5. Please use the public alternative, `HIWindowFromCGWindowID`. */
CG_EXTERN WindowRef GetWindowRefFromNativeWindow(CGSWindowID wid) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
-40
View File
@@ -1,40 +0,0 @@
#ifndef MMDefs
#define MMDefs
#include <stdio.h>
#define MMLog(format, ...) fprintf(stdout, format, ## __VA_ARGS__)
#define kMMPrefsLocation CFSTR("/Library/Preferences/com.alexzielenski.magicmouse.plist")
#define kMMPrefsAppID CFSTR("com.alexzielenski.magicmouse")
#define kMMVersion CFSTR("1.02")
#define kMMPrefsThemeLocationKey CFSTR("CursorLocation")
#define kMMPrefsCursorScaleKey CFSTR("CursorScale")
#define kMinimumVersionKey CFSTR("MinimumVersion")
#define kCreatorVersionKey CFSTR("Version")
#define kCursorsKey CFSTR("Cursors")
#define kCursorInfoKey CFSTR("Global")
#define kCursorDataKey CFSTR("Cursor Data")
#define kCursorInfoIdentifiersKey CFSTR("Identifiers")
#define kCursorInfoDefaultKey CFSTR("Default Key")
#define kCursorInfoCustomKey CFSTR("Custom Key")
#define kCursorInfoNameKey CFSTR("Name")
#define kCursorInfoTableIdentifierKey CFSTR("Table Identifier")
#define kCursorDataBitsPerPixelKey CFSTR("BitsPerPixel")
#define kCursorDataBitsPerSampleKey CFSTR("BitsPerSample")
#define kCursorDataBytesPerRowKey CFSTR("BytesPerRow")
#define kCursorDataDataKey CFSTR("CursorData")
#define kCursorDataFrameCountKey CFSTR("FrameCount")
#define kCursorDataFrameDurationKey CFSTR("FrameDuration")
#define kCursorDataHotspotXKey CFSTR("HotspotX")
#define kCursorDataHotspotYKey CFSTR("HotspotY")
#define kCursorDataPixelsWideKey CFSTR("PixelsWide")
#define kCursorDataPixelsHighKey CFSTR("PixelsHigh")
#define kCursorDataSamplesPerPixelKey CFSTR("SamplesPerPixel")
#endif
-38
View File
@@ -1,38 +0,0 @@
.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples.
.\"See Also:
.\"man mdoc.samples for a complete listing of options
.\"man mdoc for the short list of editing options
.\"/usr/share/misc/mdoc.template
.Dd 2/26/12
.Dt magicmouse 1
.Os MacOSX
.Sh NAME
.Nm magicmouse
.Sh SYNOPSIS
.Nm
.Op Fl hp
.Op Fl d Ar exportPath
.Op Fl r Ar path
.Op Fl s Ar scaleFactor
.Ar cursorPath
.Sh DESCRIPTION
A tool to change the cursor of Mac OS X 10.7+ to a mightymouse cursor file. Only applies until logout.
.Sh OPTIONS
.Bl -tag -width -indent
.It Fl h
Shows the help.
.It Fl p
Sets the cursor to that of the preferences. (Only used in conjunction with the Magic Mouse Preference Pane.)
.It Fl d Ar path
Dumps the a few common cursors to the path specified.
.It Fl r Ar path
Sets the cursor to original system cursors contained in the Mighty Mouse file specified.
.It Fl s Ar factor
Scales the cursor by the factor specified. (ex. '-s 0.5' shrinks the cursor to half its size.)
.It Fl s
Gets the current scale factor of the cursor.
.It Ar cursorPath
Specifying no options sets the cursor to the specified Mighty Mouse file.
.El
.Sh Author
Created by Alex Zielenski © 2012. alex@alexzielenski.com
-815
View File
@@ -1,815 +0,0 @@
//
// main.c
// magicmouse
//
// Created by Alex Zielenski on 2/20/12.
// Copyright (c) 2012 Alex Zielenski. All rights reserved.
//
/*! Perhaps it would be a good idea to store the original cursor under a different identifier
while hooking the cursors so that we don't have a need to store them in the file or even use the one in the file.
We can wheck to see if the cursor is registered first and if not, register the original cursor and leave it be afterwards.
Then, it would be trivial to reset the cursors and a lot safer. The problem here is using NSCursor methods to get cursors that aren't
registered at login (instead are registered only when used). eg. Dragging Copy. There might be a possibility the login window wouldn't let us
use these methods since we aren't allowed a GUI there. But we would get a retry at that once the user logs in so it might not be a problem.
This fix would of course involve changing the extension of this file to .m and embedding Objective-C. */
#include <CoreFoundation/CoreFoundation.h>
#include <ApplicationServices/ApplicationServices.h>
#include <Accelerate/Accelerate.h>
#include "MMDefs.h"
#include "CGSCursor.h"
#include "CGSAccessibility.h"
// Macro to quickly create a mutable dictionary for CF types
#define CFMutableDictionaryCreateEmpty() CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)
// Function prototypes
CFStringRef tableIdentifierFromInt(int x);
CFStringRef nameFromInt(int x);
CFStringRef cursorIdentifierFromInt(int x);
CFStringRef createBackupIdentifierForIdentifier(CFStringRef ident);
// Method I used for debugging
static void CGImageWriteToFile(CGImageRef image, CFStringRef path) {
CFURLRef url = CFURLCreateWithFileSystemPath(NULL, path , kCFURLPOSIXPathStyle, false);
CGImageDestinationRef destination = CGImageDestinationCreateWithURL(url, kUTTypePNG, 1, NULL);
CFRelease(url);
CGImageDestinationAddImage(destination, image, nil);
bool success = CGImageDestinationFinalize(destination);
if (!success) {
MMLog("Failed to write image.\n");
}
CFRelease(destination);
}
// This method gets the name for the cursor plist dump in the identifiers dictionary
CFStringRef nameFromInt(int x) {
CFStringRef rtn = CFSTR("");
switch (x) {
case 0:
rtn = CFSTR("Arrow");
break;
case 1:
rtn = CFSTR("I-Beam");
break;
case 2:
rtn = CFSTR("I-Beam (XOR)");
break;
case 3:
rtn = CFSTR("Alias");
break;
case 4:
rtn = CFSTR("Small Copy");
break;
case 5:
rtn = CFSTR("Small Move");
break;
case 6:
rtn = CFSTR("Arrow (Context)");
break;
case 7:
rtn = CFSTR("Wait");
break;
case 8:
rtn = CFSTR("Empty");
break;
case 9:
rtn = CFSTR("Big Alias");
break;
case 10:
rtn = CFSTR("Forbidden");
break;
case 11:
rtn = CFSTR("Big Copy");
break;
}
return rtn;
}
// Links a certain cursor to a specific table column. Used by the prefpane
CFStringRef tableIdentifierFromInt(int x) {
CFStringRef rtn = CFSTR("");
switch (x) {
case 0:
rtn = CFSTR("Global.Identifiers.Arrow");
break;
case 1:
rtn = CFSTR("Global.Identifiers.I-Beam");
break;
case 2:
rtn = CFSTR("Global.Identifiers.I-Beam (XOR)");
break;
case 3:
rtn = CFSTR("Global.Identifiers.Small Alias");
break;
case 4:
rtn = CFSTR("Global.Identifiers.Small Copy");
break;
case 5:
rtn = CFSTR("Global.Identifiers.Small Move");
break;
case 6:
rtn = CFSTR("Global.Identifiers.Arrow (Context)");
break;
case 7:
rtn = CFSTR("Global.Identifiers.Wait");
break;
case 8:
rtn = CFSTR("Global.Identifiers.Empty");
break;
case 9:
rtn = CFSTR("Global.Identifiers.Big Alias");
break;
case 10:
rtn = CFSTR("Global.Identifiers.Forbidden");
break;
case 11:
rtn = CFSTR("Global.Identifiers.Big Copy");
break;
}
return rtn;
}
// Cursor reverse-dns identifier to override with out cursor image.
// these are pre-registered cursors by apple
CFStringRef cursorIdentifierFromInt(int x) {
// System Defined
// com.apple.coregraphics.Arrow = 0
// com.apple.coregraphics.IBeam = 1
// com.apple.coregraphics.IBeamXOR = 2
// com.apple.coregraphics.Alias = 3
// com.apple.coregraphics.Copy = 4
// com.apple.coregraphics.Move = 5
// com.apple.coregraphics.ArrowCtx = 6
// com.apple.coregraphics.Wait = 7
// com.apple.coregraphics.Empty = 8
// Not system defined?
// com.apple.cursor.2 = Large Alias
// com.apple.cursor.3 = Unavailable/Forbidden
// com.apple.cursor.5 = Large Copy
CFStringRef rtn = CFSTR("");
switch (x) {
case 0:
rtn = CFSTR("com.apple.coregraphics.Arrow");
break;
case 1:
rtn = CFSTR("com.apple.coregraphics.IBeam");
break;
case 2:
rtn = CFSTR("com.apple.coregraphics.IBeamXOR");
break;
case 3:
rtn = CFSTR("com.apple.coregraphics.Alias");
break;
case 4:
rtn = CFSTR("com.apple.coregraphics.Copy");
break;
case 5:
rtn = CFSTR("com.apple.coregraphics.Move");
break;
case 6:
rtn = CFSTR("com.apple.coregraphics.ArrowCtx");
break;
case 7:
rtn = CFSTR("com.apple.coregraphics.Wait");
break;
case 8:
rtn = CFSTR("com.apple.coregraphics.Empty");
break;
case 9:
rtn = CFSTR("com.apple.cursor.2");
break;
case 10:
rtn = CFSTR("com.apple.cursor.3");
break;
case 11:
rtn = CFSTR("com.apple.cursor.5");
break;
}
return rtn;
}
CFStringRef createBackupIdentifierForIdentifier(CFStringRef ident) {
// Just take all the items after the first two and append them to com.alexzielenski.magicmouse
return CFStringCreateWithFormat(0, NULL, CFSTR("com.alexzielenski.magicmouse.%@"), ident);
}
//! Gets data from one cursor and sets it to another. Though both co-exist
static void ReplaceCursorWithName(CFStringRef originalName, CFStringRef destinationName) {
CFIndex bufferLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(originalName), kCFStringEncodingUTF8) + 1;
char *CKey = (char*)malloc(bufferLength);
CFStringGetCString(originalName, CKey, bufferLength, kCFStringEncodingUTF8);
size_t dataSize;
CGSGetRegisteredCursorDataSize(CGSMainConnectionID(),
CKey,
&dataSize);
if (dataSize <= 0) {
MMLog("Cannot swap cursors. Original one (%s) is nonexistant\n", CKey);
free(CKey);
return;
}
// Get the name we are going to register the new cursor under
bufferLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(destinationName), kCFStringEncodingUTF8);
char *BKey = (char*)malloc(bufferLength);
CFStringGetCString(destinationName, BKey, bufferLength, kCFStringEncodingUTF8);
void *data = malloc(dataSize);
CGSize imageSize, cursorSize;
CGPoint hotSpot;
int bpp, bps, bpr, frameCount, spp;
float frameDuration;
// Get the original data
CGSGetRegisteredCursorData2(CGSMainConnectionID(),
CKey,
data,
&dataSize,
&bpr,
&imageSize,
&cursorSize,
&hotSpot,
&bpp,
&spp,
&bps,
&frameCount,
&frameDuration);
if (imageSize.width == 0 || imageSize.height == 0) {
MMLog("Cannot swap cursors. Original one (%s) is nonexistant\n", CKey);
free(CKey);
free(BKey);
return;
}
CFDataRef dt = CFDataCreate(0, (UInt8*)data, dataSize);
CGDataProviderRef provider = CGDataProviderCreateWithCFData(dt);
CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
CGImageRef originalCursor = CGImageCreate(imageSize.width, imageSize.height,
bps, bpp, bpr, colorspace, kCGBitmapByteOrder32Little | kCGImageAlphaFirst,
provider, NULL, false32b, kCGRenderingIntentDefault);
int seed;
void *originalValues[1] = { originalCursor };
CFArrayRef originalArray = CFArrayCreate(0, (const void**)originalValues, 1, NULL);
// Register the original cursor under a different name
CGError err = CGSRegisterCursorWithImages(CGSMainConnectionID(),
BKey,
true, false,
frameCount,
originalArray,
cursorSize,
hotSpot,
&seed,
CGRectMake(0, 0, imageSize.width, imageSize.height),
frameDuration, 0);
if (err != kCGErrorSuccess) {
MMLog("Recieved error (%i) while swapping cursor. (%s)\n", err, CKey);
}
free(CKey);
free(BKey);
CFRelease(dt);
CGImageRelease(originalCursor);
CGDataProviderRelease(provider);
CGColorSpaceRelease(colorspace);
}
//!******************************************************************************************************************************************************************/
//! This function gets the registered data for an original cursor before magic mouse replaces it and registers it under a different name that would never be used. **/
//! This is a safe & necessary way to backup the cursor locally without distributing it with every theme. **/
//!******************************************************************************************************************************************************************/
static void BackupCursor(CFStringRef originalIdentifier) {
// Get the name we are going to register the new cursor under
CFStringRef backupIdentifier = createBackupIdentifierForIdentifier(originalIdentifier);
CFIndex bufferLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(backupIdentifier), kCFStringEncodingUTF8) + 1;
char *CKey = (char*)malloc(bufferLength);
CFStringGetCString(backupIdentifier, CKey, bufferLength, kCFStringEncodingUTF8);
size_t dataSize = 0;
CGSGetRegisteredCursorDataSize(CGSMainConnectionID(),
CKey,
&dataSize);
// We don't want to back up the cursor if it has already been backed up.
if (dataSize > 4) {
MMLog("Cursor already backed up (size %lu)\n", dataSize);
free(CKey);
CFRelease(backupIdentifier);
return;
}
MMLog("Backing up cursor to %s\n", CKey);
ReplaceCursorWithName(originalIdentifier, backupIdentifier);
CFRelease(backupIdentifier);
}
// bool used if the '-r' option is specified which uses the default cursor key rather than the custom one
// from the plist file.
static bool useDefault = false;
//!*******************************************************************************************************************************/
//! Registers out cursors over Apple's. This function is called while looping through the identifiers dictionary **/
//! so 'cci' is the dictionary for the key 'k' and 'cd' is userInfo passed which is in this case the cursor data dictionary. **/
//!*******************************************************************************************************************************/
static void HookCursor(const void* k, const void* cci, void* cd) {
// Let the compiler know the types of our variables
CFStringRef key = (CFStringRef)k;
CFDictionaryRef currentCursorInfo = (CFDictionaryRef)cci;
CFDictionaryRef cursorData = (CFDictionaryRef)cd;
CFIndex bufferLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(key), kCFStringEncodingUTF8) + 1;
char *CKey = (char*)malloc(bufferLength);
CFStringGetCString(key, CKey, bufferLength, kCFStringEncodingUTF8);
if (useDefault) {
CFStringRef backupIdentifier = createBackupIdentifierForIdentifier(key);
MMLog("Resetting cursor: %s\n", CKey);
ReplaceCursorWithName(backupIdentifier, key);
CFRelease(backupIdentifier);
free(CKey);
return;
}
/*! Get down to the cursor data in the dictionary structure. */
// Get the key for our cursor data
CFStringRef cursorKey = (CFStringRef)CFDictionaryGetValue(currentCursorInfo, kCursorInfoCustomKey);
// Dictionary that holds our cursor data
CFDictionaryRef currentCursorData = (CFDictionaryRef)CFDictionaryGetValue(cursorData, cursorKey);
// Get all of our required data to build an image representation
CFDataRef imageData = (CFDataRef)CFDictionaryGetValue(currentCursorData, kCursorDataDataKey);
CFNumberRef nbpp = (CFNumberRef)CFDictionaryGetValue(currentCursorData, kCursorDataBitsPerPixelKey);
CFNumberRef nbps = (CFNumberRef)CFDictionaryGetValue(currentCursorData, kCursorDataBitsPerSampleKey);
CFNumberRef nbpr = (CFNumberRef)CFDictionaryGetValue(currentCursorData, kCursorDataBytesPerRowKey);
CFNumberRef nframeCount = (CFNumberRef)CFDictionaryGetValue(currentCursorData, kCursorDataFrameCountKey);
CFNumberRef nframeDuration = (CFNumberRef)CFDictionaryGetValue(currentCursorData, kCursorDataFrameDurationKey);
CFNumberRef nhotSpotX = (CFNumberRef)CFDictionaryGetValue(currentCursorData, kCursorDataHotspotXKey);
CFNumberRef nhotSpotY = (CFNumberRef)CFDictionaryGetValue(currentCursorData, kCursorDataHotspotYKey);
CFNumberRef nwidth = (CFNumberRef)CFDictionaryGetValue(currentCursorData, kCursorDataPixelsWideKey);
CFNumberRef nheight = (CFNumberRef)CFDictionaryGetValue(currentCursorData, kCursorDataPixelsHighKey);
CFNumberRef nspp = (CFNumberRef)CFDictionaryGetValue(currentCursorData, kCursorDataSamplesPerPixelKey);
/*! Turn the CFNumbers into primitive types to use in the initialization of the image */
int bpp, bps, bpr, frameCount, spp;
CGFloat frameDuration, hotSpotX, hotSpotY, width, height;
CFNumberGetValue(nbpp, kCFNumberIntType, &bpp);
CFNumberGetValue(nbps, kCFNumberIntType, &bps);
CFNumberGetValue(nbpr, kCFNumberIntType, &bpr);
CFNumberGetValue(nframeCount, kCFNumberIntType, &frameCount);
CFNumberGetValue(nframeDuration, kCFNumberCGFloatType, &frameDuration);
CFNumberGetValue(nhotSpotX, kCFNumberCGFloatType, &hotSpotX);
CFNumberGetValue(nhotSpotY, kCFNumberCGFloatType, &hotSpotY);
CFNumberGetValue(nwidth, kCFNumberCGFloatType, &width);
CFNumberGetValue(nheight, kCFNumberCGFloatType, &height);
CFNumberGetValue(nspp, kCFNumberIntType, &spp);
// We need to backup the original cursor
BackupCursor(key);
// The dictionary does not hold the actual height of the image. Since the animations are the cursor height multiplied
// by the frame count. We can assume that this is how high the image will be
CGFloat animationHeight = height*frameCount;
// Create the image for replacing
CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData(imageData);
CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
CGImageRef cursorImage = CGImageCreate(width, animationHeight, bps, bpp, bpr, colorspace, kCGBitmapByteOrder32Big | kCGImageAlphaFirst, dataProvider, NULL, false, kCGRenderingIntentDefault);
CGColorSpaceRelease(colorspace);
CGDataProviderRelease(dataProvider);
if (cursorImage == NULL) {
MMLog("Invalid cursor image for %s. Skipping...\n", CKey);
return;
}
// We need to turn it into an array for use in the CoreGraphics function to register the cursor
void *arrayValues[1];
arrayValues[0] = cursorImage;
CFArrayRef ar = CFArrayCreate(NULL, (const void**)arrayValues, 1, NULL);
MMLog("Hooking cursor: %s\n", CKey);
// This is a cursor seed returned when our function comes back. It doesn't really have much uses to us.
int seed;
// Perform our replacement of Apple's cursors
CGError err = CGSRegisterCursorWithImages(CGSMainConnectionID(), CKey, true, true, frameCount, ar, CGSizeMake(width, height), CGPointMake(hotSpotX, hotSpotY), &seed, CGRectMake(hotSpotX,hotSpotY,width,height), frameDuration, 0);
if (err != kCGErrorSuccess) {
MMLog("Error number %i while hooking cursor %s", err, CKey);
}
// Prevent some leaks
CGImageRelease(cursorImage);
CFRelease(ar);
free(CKey);
}
/*! This method retrieves Apple's data and information about several cursors and saves
then to the exportPath */
static CGError dumpCursors(CFStringRef exportPath) {
if (exportPath == NULL) {
MMLog("No export path?\n");
return kCGErrorIllegalArgument;
}
// CFMutableDictionaryCreateEmpty() is a quick macro defined at the top of this file
// to quickly create a mutable CFDictionary.
CFMutableDictionaryRef mouseFile = CFMutableDictionaryCreateEmpty();
CFMutableDictionaryRef cursors = CFMutableDictionaryCreateEmpty();
CFMutableDictionaryRef global = CFMutableDictionaryCreateEmpty();
CFMutableDictionaryRef identifiers = CFMutableDictionaryCreateEmpty();
CFMutableDictionaryRef cursorData = CFMutableDictionaryCreateEmpty();
// Return error
CGError err = kCGErrorSuccess;
// There are 12 pre-defined cursors to dump.
for (int x = 0; x<=11; x++) {
// Get the cursor
CFStringRef strIdent = cursorIdentifierFromInt(x);
CFIndex bufferLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(strIdent), kCFStringEncodingUTF8) + 1;
char *ident = malloc(bufferLength);
CFStringGetCString(strIdent, ident, bufferLength, kCFStringEncodingUTF8);
MMLog("Dumping %s\n", ident);
// 2 Dictionaries. 1 for the identifiers & info (table id, data key, etc.) and one for the
// actual effective image data.
CFMutableDictionaryRef currentIdentifier = CFMutableDictionaryCreateEmpty();
CFMutableDictionaryRef currentCursorData = CFMutableDictionaryCreateEmpty();
// Get the name of the current cursor.
CFStringRef name = nameFromInt(x);
// Make a key for the cursor data based on the name of the cursor
CFStringRef dataKey = CFStringCreateWithFormat(NULL, NULL, CFSTR("Global.%@"), name);
/*! Set the values for the info dictionary */
CFDictionarySetValue(currentIdentifier, kCursorInfoNameKey, name);
CFDictionarySetValue(currentIdentifier, kCursorInfoTableIdentifierKey, tableIdentifierFromInt(x));
CFDictionarySetValue(currentIdentifier, kCursorInfoDefaultKey, dataKey);
CFDictionarySetValue(currentIdentifier, kCursorInfoCustomKey, dataKey);
// Get some data to put in the cursor data dictionary
int bpr, bpp, bps, spp;
float fd;
size_t size;
int fc;
CGSGetRegisteredCursorDataSize(CGSMainConnectionID(), ident, &size);
// Sometimes cursors with the name like "com.apple.cursor.5" are not
// registered unless they have been used. Here we skip them if so.
if (size <= 0) {
MMLog("Cursor not registered: %s. Skipping...\n", ident);
// Release currently allocated variables
free(ident);
CFRelease(dataKey);
CFRelease(currentCursorData);
CFRelease(currentIdentifier);
continue;
}
// Create some space in ram for the cursor image data
void *data = malloc(size);
if (!data) {
MMLog("Error allocating space for image data in memory.\n");
CFRelease(dataKey);
CFRelease(currentCursorData);
CFRelease(currentIdentifier);
return kCGErrorFailure;
}
CGSize cursorSize;
CGSize imageSize;
CGPoint hotSpot;
// Finally retrieve the cursor data and its information
err = CGSGetRegisteredCursorData2(CGSMainConnectionID(), // Connection
(char*)ident, // Identifier we want to retrieve
data, // Previously allocated data pointer to store the raw cursor image in
&size, // Maybe the previous size was wrong?
&bpr, // Bytes per row
&imageSize, // Size of the image. (Including its full height for the animation)
&cursorSize, // Size of the cursor displayed ons creen
&hotSpot, // Point where cursor has effective clicks
&bpp, // Bits per pixel (usually 32)
&spp, // Samples per pixel (almost definitely 4)
&bps, // Bits per sample (should be at least 8)
&fc, // Frame count
&fd); // Frame duration
if (err != kCGErrorSuccess) {
MMLog("Cursor dump received error code: %i on cursor: %s\n", err, ident);
// If an error occurred and the cursor was registered, then we probably
// don't want to continue.
free(data);
CFRelease(dataKey);
CFRelease(currentCursorData);
CFRelease(currentIdentifier);
return err;
}
/*! We need to convert whatever data we got above from little to big endian.
We know it is currently little endian because Lion requires intel processors.
It needs to be Big Endian because that is what the Mighty Mouse format originally supported
because it was made first for PPC computers which are big endian. */
vImage_Buffer buffer;
buffer.data = data;
buffer.width = imageSize.width;
buffer.height = imageSize.height;
buffer.rowBytes = bpr;
// The conversion from little to big endian (or vice versa) is a matter of flipping the values
uint8_t permuteMap[4] = {3,2,1,0};
vImagePermuteChannels_ARGB8888(&buffer,
&buffer,
permuteMap,
0);
// Create a data reference
CFDataRef imageData = CFDataCreate(0, (const UInt8*)data, size);
// Get some quick primitives for the cursor info
int wide = (int)cursorSize.width;
int high = (int)cursorSize.height;
int hx = (int)hotSpot.x;
int hy = (int)hotSpot.y;
// Create CFNumber instances from the above primitives
CFNumberRef nbpp = CFNumberCreate(0, kCFNumberIntType, &bpp);
CFNumberRef nbps = CFNumberCreate(0, kCFNumberIntType, &bps);
CFNumberRef nbpr = CFNumberCreate(0, kCFNumberIntType, &bpr);
CFNumberRef nph = CFNumberCreate(0, kCFNumberIntType, &high);
CFNumberRef npw = CFNumberCreate(0, kCFNumberIntType, &wide);
CFNumberRef nspp = CFNumberCreate(0, kCFNumberIntType, &spp);
CFNumberRef nfd = CFNumberCreate(0, kCFNumberFloatType, &fd);
CFNumberRef nfc = CFNumberCreate(0, kCFNumberIntType, &fc);
CFNumberRef nhx = CFNumberCreate(0, kCFNumberIntType, &hx);
CFNumberRef nhy = CFNumberCreate(0, kCFNumberIntType, &hy);
/*! Finally, set the values in the cursor data dictionary to required cursor data which we previously retrieved */
CFDictionarySetValue(currentCursorData, kCursorDataBitsPerPixelKey, nbpp);
CFDictionarySetValue(currentCursorData, kCursorDataBitsPerSampleKey, nbps);
CFDictionarySetValue(currentCursorData, kCursorDataBytesPerRowKey, nbpr);
CFDictionarySetValue(currentCursorData, kCursorDataPixelsHighKey, nph);
CFDictionarySetValue(currentCursorData, kCursorDataPixelsWideKey, npw);
CFDictionarySetValue(currentCursorData, kCursorDataSamplesPerPixelKey, nspp);
CFDictionarySetValue(currentCursorData, kCursorDataFrameDurationKey, nfd);
CFDictionarySetValue(currentCursorData, kCursorDataFrameCountKey, nfc);
CFDictionarySetValue(currentCursorData, kCursorDataHotspotXKey, nhx);
CFDictionarySetValue(currentCursorData, kCursorDataHotspotYKey, nhy);
CFDictionarySetValue(currentCursorData, kCursorDataDataKey, imageData);
// Set the values into the big dictionaries.
CFDictionarySetValue(cursorData, dataKey, currentCursorData);
CFDictionarySetValue(identifiers, strIdent, currentIdentifier);
// Prevent leakage
free(data);
free(ident);
CFRelease(dataKey);
CFRelease(imageData);
CFRelease(nbpp);
CFRelease(nbps);
CFRelease(nbpr);
CFRelease(nph);
CFRelease(npw);
CFRelease(nspp);
CFRelease(nfd);
CFRelease(nfc);
CFRelease(nhx);
CFRelease(nhy);
CFRelease(currentCursorData);
CFRelease(currentIdentifier);
}
// Put the cursor identifiers into its parent dictionary
CFDictionarySetValue(global, kCursorInfoIdentifiersKey, identifiers);
// and put the 2 parent dictionaries into the cursors dictionary
CFDictionarySetValue(cursors, kCursorInfoKey, global);
CFDictionarySetValue(cursors, kCursorDataKey, cursorData);
// Version (1.02) to use for the minimum compatible Mighty Mouse version for this cursor dump
CFStringRef version = kMMVersion;
// Finally, put the cursors dictionary and version numbers into the root dictionary
CFDictionarySetValue(mouseFile, kMinimumVersionKey, version);
CFDictionarySetValue(mouseFile, kCreatorVersionKey, version);
CFDictionarySetValue(mouseFile, kCursorsKey, cursors);
CFErrorRef error = NULL;
// Get XML data for our dictionaries
CFDataRef plistData = CFPropertyListCreateData(kCFAllocatorDefault,
(CFPropertyListRef)mouseFile,
kCFPropertyListXMLFormat_v1_0, // xml, not binary
0,
&error);
if (error != NULL) {
MMLog("Error writing to path.\n");
CFShow(error);
// Errors follow the create rule
CFRelease(error);
// General failure
err = kCGErrorFailure;
}
// Convert the path to a URL
CFURLRef path = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, exportPath, kCFURLPOSIXPathStyle, false);
// Write the XML data to a file
CFURLWriteDataAndPropertiesToResource(path, plistData, 0, 0);
// Prevent leakage
CFRelease(path);
CFRelease(cursorData);
CFRelease(identifiers);
CFRelease(global);
CFRelease(cursors);
CFRelease(mouseFile);
if (plistData) // Perhaps the plistData initialization failed and we received an error...
CFRelease(plistData);
MMLog("---\nFin.\n");
return err;
}
static void showUsage(void) {
MMLog("Usage:\n\tmagicmouse cursor.plist\n\tmagicmouse -r cursorReset.plist\n\tmagicmouse -d dump.plist\n\tmagicmouse -s scaleFactor\n\tmagicmouse -p\n");
}
int main (int argc, const char * argv[]) {
bool help;
bool dump;
bool scale;
bool usePrefs;
int c;
// Check for what operation we'll be performing
while ((c = getopt (argc, (char *const*)argv, "hhelpr:d:sp")) != -1) {
switch (c) {
case 'r':
useDefault = true;
break;
case 'help':
case 'h':
help = true;
break;
case 'd':
dump = true;
break;
case 's':
scale = true;
break;
case 'p':
usePrefs = true;
break;
default:
break;
}
}
if (argc < 2 || (dump && useDefault)) {
MMLog("Invalid arguments.\n");
showUsage();
return kCGErrorIllegalArgument;
}
if (help) {
showUsage();
return 0;
}
if (scale) {
if (argc == 2) { // If there are no arguments after '-s'. The user is retreiving the scale rather than setting it.
float scale;
CGSGetCursorScale(CGSMainConnectionID(), &scale);
MMLog("%f\n", scale);
return kCGErrorSuccess;
}
// Otherwise set the scale
const char *cf = argv[argc-1];
float factor = (float)atof(cf);
MMLog("Scaling cursor to %.0f%%\n", factor*100);
return (CGSSetCursorScale(CGSMainConnectionID(), factor) == kCGErrorSuccess);
}
MMLog("Magic Mouse Initialized.\n---\n");
const char *plistLocation = argv[argc-1];
CFStringRef path = CFStringCreateWithCString(kCFAllocatorDefault, plistLocation, kCFStringEncodingUTF8);
if (dump) {
CGError err = dumpCursors(path);
CFRelease(path);
return err;
}
/*! Here begins code that hooks the cursors if none of the above options were specified. */
if (usePrefs) {
// Read the prefs to find out the location of the plist
CFDataRef prefsData;
CFURLRef prefsURL = CFURLCreateWithFileSystemPath(0, kMMPrefsLocation, kCFURLPOSIXPathStyle, false);
CFURLCreateDataAndPropertiesFromResource(0,
prefsURL,
&prefsData,
NULL,
NULL,
NULL);
if (!prefsData) {
MMLog("Could not load preference file for Magic Mouse.\n");
return kCGErrorFailure;
}
CFDictionaryRef prefsDict = (CFDictionaryRef)CFPropertyListCreateWithData(0,
prefsData,
kCFPropertyListImmutable,
NULL,
NULL);
CFRelease(prefsData);
// get the location of the cursor plist
CFStringRef location = CFDictionaryGetValue(prefsDict, kMMPrefsThemeLocationKey);
plistLocation = CFStringGetCStringPtr(location, kCFStringEncodingUTF8);
CFRelease(location);
// scale the cursor
CFNumberRef scaleNumber = CFDictionaryGetValue(prefsDict, kMMPrefsCursorScaleKey);
float scaleFactor;
CFNumberGetValue(scaleNumber, kCFNumberFloatType, &scaleFactor);
CGSSetCursorScale(CGSMainConnectionID(), scaleFactor);
}
CFURLRef cursorPlist = CFURLCreateWithFileSystemPath(NULL, path, kCFURLPOSIXPathStyle, false);
CFRelease(path);
if (!path||!cursorPlist) {
MMLog("Invalid or unspecified path to plist.\n");
showUsage();
return kCGErrorIllegalArgument;
}
CFDataRef cursorPlistData = NULL;
bool success = CFURLCreateDataAndPropertiesFromResource(NULL, cursorPlist, &cursorPlistData, NULL, NULL, NULL);
CFRelease(cursorPlist);
if (success == false) {
MMLog("Invalid cursor plist. (e1)\n");
return kCGErrorFailure;
}
CFDictionaryRef rootDict = (CFDictionaryRef)CFPropertyListCreateWithData(NULL, cursorPlistData, kCFPropertyListImmutable, NULL, NULL);
CFRelease(cursorPlistData);
if (!rootDict) {
MMLog("Invalid cursor plist. (e2)\n");
return kCGErrorIllegalArgument;
}
CFDictionaryRef cursorDictionary = CFDictionaryCreateCopy(NULL, (CFDictionaryRef)CFDictionaryGetValue(rootDict, kCursorsKey));
CFRelease(rootDict);
CFDictionaryRef cursorData = (CFDictionaryRef)CFDictionaryGetValue(cursorDictionary, kCursorDataKey);
CFDictionaryRef cursorInfo = (CFDictionaryRef)CFDictionaryGetValue(cursorDictionary, kCursorInfoKey);
CFDictionaryRef cursorIdentifiers = (CFDictionaryRef)CFDictionaryGetValue(cursorInfo, kCursorInfoIdentifiersKey);
// Loop through the identifiers dictionary for cursors to hook
CFDictionaryApplyFunction(cursorIdentifiers, HookCursor, (void*)cursorData);
CFRelease(cursorDictionary);
MMLog("---\nFin.\n");
return kCGErrorSuccess;
}
+1
View File
@@ -0,0 +1 @@
{"name":"Mousecape","tagline":"Cursor Manager for OS X","body":"Mousecape\r\n===\r\n\r\nA free cursor manager for Mac OS 10.8+ built using private, nonintrusive CoreGraphics APIs.\r\n\r\n## How it works\r\n\r\nMousecape works by calling the API calls that Apple uses to initialize the system cursors in the system and it registers a daemon that will automatically apply the cursor on login and when cursors get unregistered.\r\n\r\nIt is unintrusive and works in the background. You just need to open, install the helper tool, apply your cursor and you're done!\r\n\r\n## Where do I get cursors?\r\n\r\nA pack of cursors in Mousecape is called a cape, each cape contains a multiple scales of representations of many cursors. For example, the Arrow cursor can have 1x, 2x, 5x, and 10x representations while the Wait cursor can have 1x, and 2x. \r\n\r\nThere is an example cape file included in this Git Repo located [here for download](https://github.com/alexzielenski/Mousecape/blob/master/Mousecape/com.maxrudberg.svanslosbluehazard.cape). It is a remake of [Max Rudberg's](http://maxrudberg.com/) loved Svanslös cursors generously crafted by Max for us to use. Simply double click the cape file with Mousecape on your system and it will be imported into your library.\r\n\r\n## How can I create my own cape?\r\n\r\nYou can create a new cape document in the Mousecape app by hitting &#8984;N (Command-N) and editing it with &#8984;E. Click the \"+\" button to add cursors to customize and symply drag your images into the fields provided.\r\n\r\n## How do animated cursors work?\r\n\r\nWhen you want to animate a cursor, change the value in the frames field in the edit window and make sure frame duration is how you want it. Next, create an image that has all of your cursor frames stacked on top of each other vertically. Mousecape will traverse down the image for each frame, using a box the same size as whatever you put in the size field.\r\n\r\n## How can I say thanks?\r\n\r\nTell your friends.\r\n\r\n## Where can I get a copy of this sweet tool?\r\n\r\nIn the [releases section](https://github.com/alexzielenski/Mousecape/releases) of this GitHub page. There are stable reases there. **The current version is 0.0.5**.\r\n\r\n## LICENSE\r\n\r\nI worked very hard researching the private methods used in Mousecape and creating this app. Please respect me and my work by not using any of the information provided here for commercial purposes.\r\n\r\nCopyright (c) 2013-2014, Alex Zielenski\r\nAll rights reserved.\r\n\r\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\r\n\r\n* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\r\n* 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.\r\n* Any redistribution, use, or modification is done solely for personal benefit and not for any commercial purpose or for monetary gain\r\n\r\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}
File diff suppressed because it is too large Load Diff
+226
View File
@@ -0,0 +1,226 @@
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
body {
font-size: 13px;
line-height: 1.5;
font-family: 'Helvetica Neue', Helvetica, Arial, serif;
color: #000;
}
a {
color: #d5000d;
font-weight: bold;
}
header {
padding-top: 35px;
padding-bottom: 10px;
}
header h1 {
font-weight: bold;
letter-spacing: -1px;
font-size: 48px;
color: #303030;
line-height: 1.2;
}
header h2 {
letter-spacing: -1px;
font-size: 24px;
color: #aaa;
font-weight: normal;
line-height: 1.3;
}
#downloads {
display: none;
}
#main_content {
padding-top: 20px;
}
code, pre {
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal;
color: #222;
margin-bottom: 30px;
font-size: 12px;
}
code {
padding: 0 3px;
}
pre {
border: solid 1px #ddd;
padding: 20px;
overflow: auto;
}
pre code {
padding: 0;
}
ul, ol, dl {
margin-bottom: 20px;
}
/* COMMON STYLES */
table {
width: 100%;
border: 1px solid #ebebeb;
}
th {
font-weight: 500;
}
td {
border: 1px solid #ebebeb;
text-align: center;
font-weight: 300;
}
form {
background: #f2f2f2;
padding: 20px;
}
/* GENERAL ELEMENT TYPE STYLES */
h1 {
font-size: 2.8em;
}
h2 {
font-size: 22px;
font-weight: bold;
color: #303030;
margin-bottom: 8px;
}
h3 {
color: #d5000d;
font-size: 18px;
font-weight: bold;
margin-bottom: 8px;
}
h4 {
font-size: 16px;
color: #303030;
font-weight: bold;
}
h5 {
font-size: 1em;
color: #303030;
}
h6 {
font-size: .8em;
color: #303030;
}
p {
font-weight: 300;
margin-bottom: 20px;
}
a {
text-decoration: none;
}
p a {
font-weight: 400;
}
blockquote {
font-size: 1.6em;
border-left: 10px solid #e9e9e9;
margin-bottom: 20px;
padding: 0 0 0 30px;
}
ul li {
list-style: disc inside;
padding-left: 20px;
}
ol li {
list-style: decimal inside;
padding-left: 3px;
}
dl dd {
font-style: italic;
font-weight: 100;
}
footer {
margin-top: 40px;
padding-top: 20px;
padding-bottom: 30px;
font-size: 13px;
color: #aaa;
}
footer a {
color: #666;
}
/* MISC */
.clearfix:after {
clear: both;
content: '.';
display: block;
visibility: hidden;
height: 0;
}
.clearfix {display: inline-block;}
* html .clearfix {height: 1%;}
.clearfix {display: block;}
+69
View File
@@ -0,0 +1,69 @@
.highlight { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { font-weight: bold } /* Keyword.Constant */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
.highlight .kn { font-weight: bold } /* Keyword.Namespace */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d14 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
.highlight .sc { color: #d14 } /* Literal.String.Char */
.highlight .sd { color: #d14 } /* Literal.String.Doc */
.highlight .s2 { color: #d14 } /* Literal.String.Double */
.highlight .se { color: #d14 } /* Literal.String.Escape */
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
.highlight .si { color: #d14 } /* Literal.String.Interpol */
.highlight .sx { color: #d14 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d14 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
.type-csharp .highlight .k { color: #0000FF }
.type-csharp .highlight .kt { color: #0000FF }
.type-csharp .highlight .nf { color: #000000; font-weight: normal }
.type-csharp .highlight .nc { color: #2B91AF }
.type-csharp .highlight .nn { color: #000000 }
.type-csharp .highlight .s { color: #A31515 }
.type-csharp .highlight .sc { color: #A31515 }
+371
View File
@@ -0,0 +1,371 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/* LAYOUT STYLES */
body {
font-size: 1em;
line-height: 1.5;
background: #e7e7e7 url(../images/body-bg.png) 0 0 repeat;
font-family: 'Helvetica Neue', Helvetica, Arial, serif;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
color: #6d6d6d;
}
a {
color: #d5000d;
}
a:hover {
color: #c5000c;
}
header {
padding-top: 35px;
padding-bottom: 25px;
}
header h1 {
font-family: 'Chivo', 'Helvetica Neue', Helvetica, Arial, serif; font-weight: 900;
letter-spacing: -1px;
font-size: 48px;
color: #303030;
line-height: 1.2;
}
header h2 {
letter-spacing: -1px;
font-size: 24px;
color: #aaa;
font-weight: normal;
line-height: 1.3;
}
#container {
background: transparent url(../images/highlight-bg.jpg) 50% 0 no-repeat;
min-height: 595px;
}
.inner {
width: 620px;
margin: 0 auto;
}
#container .inner img {
max-width: 100%;
}
#downloads {
margin-bottom: 40px;
}
a.button {
-moz-border-radius: 30px;
-webkit-border-radius: 30px;
border-radius: 30px;
border-top: solid 1px #cbcbcb;
border-left: solid 1px #b7b7b7;
border-right: solid 1px #b7b7b7;
border-bottom: solid 1px #b3b3b3;
color: #303030;
line-height: 25px;
font-weight: bold;
font-size: 15px;
padding: 12px 8px 12px 8px;
display: block;
float: left;
width: 179px;
margin-right: 14px;
background: #fdfdfd; /* Old browsers */
background: -moz-linear-gradient(top, #fdfdfd 0%, #f2f2f2 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fdfdfd), color-stop(100%,#f2f2f2)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* IE10+ */
background: linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fdfdfd', endColorstr='#f2f2f2',GradientType=0 ); /* IE6-9 */
-webkit-box-shadow: 10px 10px 5px #888;
-moz-box-shadow: 10px 10px 5px #888;
box-shadow: 0px 1px 5px #e8e8e8;
}
a.button:hover {
border-top: solid 1px #b7b7b7;
border-left: solid 1px #b3b3b3;
border-right: solid 1px #b3b3b3;
border-bottom: solid 1px #b3b3b3;
background: #fafafa; /* Old browsers */
background: -moz-linear-gradient(top, #fdfdfd 0%, #f6f6f6 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fdfdfd), color-stop(100%,#f6f6f6)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #fdfdfd 0%,#f6f6f6 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #fdfdfd 0%,#f6f6f6 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #fdfdfd 0%,#f6f6f6 100%); /* IE10+ */
background: linear-gradient(top, #fdfdfd 0%,#f6f6f6, 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fdfdfd', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */
}
a.button span {
padding-left: 50px;
display: block;
height: 23px;
}
#download-zip span {
background: transparent url(../images/zip-icon.png) 12px 50% no-repeat;
}
#download-tar-gz span {
background: transparent url(../images/tar-gz-icon.png) 12px 50% no-repeat;
}
#view-on-github span {
background: transparent url(../images/octocat-icon.png) 12px 50% no-repeat;
}
#view-on-github {
margin-right: 0;
}
code, pre {
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal;
color: #222;
margin-bottom: 30px;
font-size: 14px;
}
code {
background-color: #f2f2f2;
border: solid 1px #ddd;
padding: 0 3px;
}
pre {
padding: 20px;
background: #303030;
color: #f2f2f2;
text-shadow: none;
overflow: auto;
}
pre code {
color: #f2f2f2;
background-color: #303030;
border: none;
padding: 0;
}
ul, ol, dl {
margin-bottom: 20px;
}
/* COMMON STYLES */
hr {
height: 1px;
line-height: 1px;
margin-top: 1em;
padding-bottom: 1em;
border: none;
background: transparent url('../images/hr.png') 50% 0 no-repeat;
}
strong {
font-weight: bold;
}
em {
font-style: italic;
}
table {
width: 100%;
border: 1px solid #ebebeb;
}
th {
font-weight: 500;
}
td {
border: 1px solid #ebebeb;
text-align: center;
font-weight: 300;
}
form {
background: #f2f2f2;
padding: 20px;
}
/* GENERAL ELEMENT TYPE STYLES */
h1 {
font-size: 32px;
}
h2 {
font-size: 22px;
font-weight: bold;
color: #303030;
margin-bottom: 8px;
}
h3 {
color: #d5000d;
font-size: 18px;
font-weight: bold;
margin-bottom: 8px;
}
h4 {
font-size: 16px;
color: #303030;
font-weight: bold;
}
h5 {
font-size: 1em;
color: #303030;
}
h6 {
font-size: .8em;
color: #303030;
}
p {
font-weight: 300;
margin-bottom: 20px;
}
a {
text-decoration: none;
}
p a {
font-weight: 400;
}
blockquote {
font-size: 1.6em;
border-left: 10px solid #e9e9e9;
margin-bottom: 20px;
padding: 0 0 0 30px;
}
ul li {
list-style: disc inside;
padding-left: 20px;
}
ol li {
list-style: decimal inside;
padding-left: 3px;
}
dl dt {
color: #303030;
}
footer {
background: transparent url('../images/hr.png') 0 0 no-repeat;
margin-top: 40px;
padding-top: 20px;
padding-bottom: 30px;
font-size: 13px;
color: #aaa;
}
footer a {
color: #666;
}
footer a:hover {
color: #444;
}
/* MISC */
.clearfix:after {
clear: both;
content: '.';
display: block;
visibility: hidden;
height: 0;
}
.clearfix {display: inline-block;}
* html .clearfix {height: 1%;}
.clearfix {display: block;}
/* #Media Queries
================================================== */
/* Smaller than standard 960 (devices and browsers) */
@media only screen and (max-width: 959px) {}
/* Tablet Portrait size to standard 960 (devices and browsers) */
@media only screen and (min-width: 768px) and (max-width: 959px) {}
/* All Mobile Sizes (devices and browser) */
@media only screen and (max-width: 767px) {
header {
padding-top: 10px;
padding-bottom: 10px;
}
#downloads {
margin-bottom: 25px;
}
#download-zip, #download-tar-gz {
display: none;
}
.inner {
width: 94%;
margin: 0 auto;
}
}
/* Mobile Landscape Size to Tablet Portrait (devices and browsers) */
@media only screen and (min-width: 480px) and (max-width: 767px) {}
/* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */
@media only screen and (max-width: 479px) {}