Compare commits
291 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cdd2bba2cc | |||
| f64cbde808 | |||
| 88291b8bda | |||
| 57e3af4583 | |||
| db26ffe28a | |||
| 1d33808cb9 | |||
| b570903bce | |||
| 5411d094ff | |||
| 1d534b1e07 | |||
| ad75161d07 | |||
| 4dc5130995 | |||
| d9f935e76f | |||
| 1d3eaf94b1 | |||
| b2bf822f76 | |||
| 63adfdb342 | |||
| fa0764e04b | |||
| e0c342c291 | |||
| 200c323225 | |||
| dc5974b1e5 | |||
| e1268114a9 | |||
| 835d860546 | |||
| ca2a0134d1 | |||
| 1a5286d567 | |||
| c78b363aed | |||
| 830628bb70 | |||
| 2e7b01e5d7 | |||
| 46d8ce7c57 | |||
| 2bae6bfa00 | |||
| 3a6af2920d | |||
| cbb87fa0e0 | |||
| 52162699c3 | |||
| 746e1b02a5 | |||
| 5b548b9507 | |||
| a3fd1e3023 | |||
| 3368d64376 | |||
| 1948bff0f5 | |||
| e30572a7f1 | |||
| 6ce1490fa9 | |||
| 4aadd80fe8 | |||
| aec4a42363 | |||
| a68912d9b2 | |||
| 2aa38d60cc | |||
| e23797f70a | |||
| 7a9daedc0e | |||
| 88bf570d9b | |||
| 5e432efcf8 | |||
| 23674e6143 | |||
| 6aa869ed43 | |||
| 0d82cd04c8 | |||
| 1178ffd32e | |||
| 1cf5830161 | |||
| a34578a3b9 | |||
| 900313eb22 | |||
| 8107a5a0f8 | |||
| 3ca8dbf5da | |||
| 64b67ec1aa | |||
| be0d63e84d | |||
| 84ca1342c2 | |||
| 57d5c3a78c | |||
| 32f1d18ba8 | |||
| f3fdaad3be | |||
| 992044c873 | |||
| b3f56427d9 | |||
| e7b5fe8d03 | |||
| b1a5d8ca54 | |||
| bb25a10604 | |||
| e46da350ca | |||
| 413703dc28 | |||
| 9f136aa868 | |||
| 77f34d1c8d | |||
| bf48139233 | |||
| fc19c53f67 | |||
| ccb0d1accd | |||
| 0e6ff0ae60 | |||
| 342eb22fe6 | |||
| b100f54047 | |||
| fd0600e50c | |||
| 4d42f5bbae | |||
| 5587633781 | |||
| 34094c4af0 | |||
| 2ad863d68e | |||
| 853cc7fda6 | |||
| 9db7efa62b | |||
| 3ad80359ed | |||
| d14d6ee9e8 | |||
| 1ab51f8772 | |||
| 04395327f7 | |||
| dacddf5073 | |||
| 3d23b7eeaa | |||
| c70acec3c9 | |||
| 3068192e71 | |||
| f64866ade1 | |||
| be978be6a2 | |||
| e1e4019666 | |||
| ede09a0d75 | |||
| 3388e323a1 | |||
| 850926d703 | |||
| 58dabb398d | |||
| f52c1c6a75 | |||
| 841768db52 | |||
| dc7dc481bf | |||
| 6d0a380446 | |||
| b7099afc70 | |||
| 46b000a884 | |||
| e96e06b4f7 | |||
| 2affa1c58e | |||
| 51e8fac9d5 | |||
| 09954c40b9 | |||
| 1387af7fa3 | |||
| 91edae4ad0 | |||
| b898b62917 | |||
| acf11018ea | |||
| c68021a972 | |||
| 3418740504 | |||
| 2d198be181 | |||
| e7dc0293f2 | |||
| 563be20d2a | |||
| 8d34a82d21 | |||
| 1a31be93d0 | |||
| d3397878d3 | |||
| 6e387daae7 | |||
| 8f64d3c9b7 | |||
| ed060272a1 | |||
| dd6f844319 | |||
| eb24d1eeb1 | |||
| 3e18a4e798 | |||
| 655c9065e6 | |||
| 585d4c09d4 | |||
| 42a61192e2 | |||
| f3c08457d9 | |||
| b9f5bde38c | |||
| 7c7afb495b | |||
| b13740318e | |||
| b5c5549d5f | |||
| 88aa1e5400 | |||
| 01e199b106 | |||
| 0bab67d694 | |||
| ba7e903f53 | |||
| 6f859fd576 | |||
| 9a8dfb04a3 | |||
| e17bc7fc62 | |||
| b5e8622ab8 | |||
| eceeefe3e6 | |||
| ae320a1505 | |||
| 4201b666e8 | |||
| 9363cce71f | |||
| a054c6889e | |||
| 19846a9cd5 | |||
| 3f5f811493 | |||
| dfe8cf8275 | |||
| 4c1233483b | |||
| 10435d4600 | |||
| cfa5729df8 | |||
| 7798dd8f08 | |||
| 8b552a85fb | |||
| 9c8774671d | |||
| 37afc5f590 | |||
| 2897088494 | |||
| 34100867f3 | |||
| 1549efdabd | |||
| 722323ed9d | |||
| 478a0b7854 | |||
| 027266bd8a | |||
| d13e9aaf4a | |||
| afbd49b99e | |||
| 5da72d5115 | |||
| c88abba14e | |||
| b2bd6b2d8b | |||
| 607bdc537b | |||
| b7e10cfa5a | |||
| 67281750cf | |||
| ed0dfd052a | |||
| c2806a8304 | |||
| 6a3be3760f | |||
| 7a20759734 | |||
| 69d464f260 | |||
| f3c67f75d5 | |||
| 596361abee | |||
| eebf178a5e | |||
| f79427f1d7 | |||
| a458a29086 | |||
| b2ffbb46fa | |||
| 0a21c09e5f | |||
| f03eb7c966 | |||
| 67ed22c712 | |||
| 5d98b43f47 | |||
| 71e3adf5b8 | |||
| f62c58aaab | |||
| 5a95e24fba | |||
| 4cfb16776f | |||
| 7c2ca245b9 | |||
| 04a8966e1a | |||
| 6cf2eb6337 | |||
| a0316a6f63 | |||
| e07cf979f3 | |||
| 899f753add | |||
| ef9851ea0c | |||
| cb2099f285 | |||
| 71367e4178 | |||
| 6abfa0a736 | |||
| 6a10142e2f | |||
| acf4dce056 | |||
| 7adadaa47f | |||
| f212365517 | |||
| 861fdfc646 | |||
| 621994220e | |||
| 3247e2cbb8 | |||
| 4b57b33890 | |||
| 503f627edd | |||
| 5906fc9b0b | |||
| c8506d25dd | |||
| 233d21c97c | |||
| 1069e45825 | |||
| 30497f809b | |||
| 22bfd54555 | |||
| 37f4397202 | |||
| 3194cdc05d | |||
| b531ccf7d9 | |||
| c3df2502bb | |||
| 5163f4709f | |||
| 8ed13fdfbd | |||
| d42b20a425 | |||
| 5f004c33d0 | |||
| ff82851b46 | |||
| 95cdfee037 | |||
| b01f203f91 | |||
| 26bd60311e | |||
| b91864bb5d | |||
| c1495c8eb3 | |||
| 4312a808e7 | |||
| 25db7d1950 | |||
| b4a0d31b9d | |||
| 5d44e0280d | |||
| d7d4f9d11c | |||
| c5b7e96226 | |||
| a0ac5729e3 | |||
| 57357b9629 | |||
| 361e348006 | |||
| 99881a5042 | |||
| 523ed4a25c | |||
| dddd2dece1 | |||
| d39c437f87 | |||
| 6ed9554846 | |||
| 4072edaa6c | |||
| b45cc2540d | |||
| 073fe0d1da | |||
| f735b127be | |||
| 3549893d3c | |||
| eb6aa1a9b4 | |||
| 67c6e08d1e | |||
| f2aef4906a | |||
| 0b24d73e43 | |||
| 5aaaa1db68 | |||
| 1ae999aa12 | |||
| 88fe4c828e | |||
| 01fe16455a | |||
| 265d2cdc28 | |||
| f2c9b449b1 | |||
| ba15970f26 | |||
| 8d162b08ee | |||
| a9c5144536 | |||
| bac703378a | |||
| 3605904709 | |||
| a0a2a81d82 | |||
| ca41ac6070 | |||
| c7c919f466 | |||
| 30f36d95fe | |||
| 6472428735 | |||
| 587a3d5af3 | |||
| facf4209d7 | |||
| a176c4700b | |||
| 5faee760c1 | |||
| 670873021d | |||
| 2c62ca7ab3 | |||
| 189c11a90c | |||
| 73ee3a6d0e | |||
| f8b0a19fd0 | |||
| a3120681e4 | |||
| 46c6b98dc5 | |||
| 9d2f4fa7b3 | |||
| cc296af677 | |||
| 239c044aca | |||
| 48aa941e2c | |||
| c8670b8495 | |||
| 9e39d372b9 | |||
| 07cf88a7fc | |||
| d9501d6b64 | |||
| 1bc9b60a8a | |||
| ab2f9d7739 | |||
| 913b92aabb | |||
| d0d2ae0da0 |
@@ -1,18 +1 @@
|
||||
# .gitignore in use by Joris Kluivers
|
||||
|
||||
*.DS_Store
|
||||
|
||||
# Xcode
|
||||
*.pbxuser
|
||||
*.mode1v3
|
||||
*.move2v3
|
||||
*.perspectivev3
|
||||
*.xcuserstate
|
||||
project.xcworkspace/
|
||||
xcuserdata/
|
||||
|
||||
build/
|
||||
|
||||
# Generated
|
||||
*.o
|
||||
*.pyc
|
||||
WorkspaceSettings.xcsettings
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
[submodule "Mousecape/Mousecape/external/Sparkle"]
|
||||
path = Mousecape/Mousecape/external/Sparkle
|
||||
url = https://github.com/sparkle-project/Sparkle.git
|
||||
@@ -0,0 +1,10 @@
|
||||
Copyright (c) 2013-2014, Alex Zielenski
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* Any redistribution, use, or modification is done solely for personal benefit and not for any commercial purpose or for monetary gain
|
||||
|
||||
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.
|
||||
@@ -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,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,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,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,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>
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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 it–but 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
|
||||
@@ -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
|
||||
@@ -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,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
|
||||
@@ -2,6 +2,6 @@
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:Magic Mouse.xcodeproj">
|
||||
location = "self:Mousecape.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?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>IDESourceControlProjectFavoriteDictionaryKey</key>
|
||||
<false/>
|
||||
<key>IDESourceControlProjectIdentifier</key>
|
||||
<string>BF07C3E0-6EFD-4BF5-8AB0-F3D236F6FEEA</string>
|
||||
<key>IDESourceControlProjectName</key>
|
||||
<string>Mousecape</string>
|
||||
<key>IDESourceControlProjectOriginsDictionary</key>
|
||||
<dict>
|
||||
<key>FC2A2851-1AE3-4D52-8AFC-6A9D2EF109B1</key>
|
||||
<string>ssh://github.com/alexzielenski/Mousecape.git</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectPath</key>
|
||||
<string>Mousecape/Mousecape.xcodeproj/project.xcworkspace</string>
|
||||
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
||||
<dict>
|
||||
<key>FC2A2851-1AE3-4D52-8AFC-6A9D2EF109B1</key>
|
||||
<string>../../..</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectURL</key>
|
||||
<string>ssh://github.com/alexzielenski/Mousecape.git</string>
|
||||
<key>IDESourceControlProjectVersion</key>
|
||||
<integer>110</integer>
|
||||
<key>IDESourceControlProjectWCCIdentifier</key>
|
||||
<string>FC2A2851-1AE3-4D52-8AFC-6A9D2EF109B1</string>
|
||||
<key>IDESourceControlProjectWCConfigurations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
|
||||
<string>public.vcs.git</string>
|
||||
<key>IDESourceControlWCCIdentifierKey</key>
|
||||
<string>FC2A2851-1AE3-4D52-8AFC-6A9D2EF109B1</string>
|
||||
<key>IDESourceControlWCCName</key>
|
||||
<string>Mousecape</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Bucket
|
||||
type = "1"
|
||||
version = "1.0">
|
||||
version = "2.0">
|
||||
</Bucket>
|
||||
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0500"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FAC69F60189D603C00BC829D"
|
||||
BuildableName = "Mousecape.app"
|
||||
BlueprintName = "Mousecape"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FAC69F81189D603C00BC829D"
|
||||
BuildableName = "MousecapeTests.xctest"
|
||||
BlueprintName = "MousecapeTests"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FAC69F60189D603C00BC829D"
|
||||
BuildableName = "Mousecape.app"
|
||||
BlueprintName = "Mousecape"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FAC69F60189D603C00BC829D"
|
||||
BuildableName = "Mousecape.app"
|
||||
BlueprintName = "Mousecape"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FAC69F60189D603C00BC829D"
|
||||
BuildableName = "Mousecape.app"
|
||||
BlueprintName = "Mousecape"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0500"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FAC69F60189D603C00BC829D"
|
||||
BuildableName = "Mousecape.app"
|
||||
BlueprintName = "Mousecape"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FAC69F81189D603C00BC829D"
|
||||
BuildableName = "MousecapeTests.xctest"
|
||||
BlueprintName = "MousecapeTests"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FAC69F60189D603C00BC829D"
|
||||
BuildableName = "Mousecape.app"
|
||||
BlueprintName = "Mousecape"
|
||||
ReferencedContainer = "container:Mousecape.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 = "FAC69F60189D603C00BC829D"
|
||||
BuildableName = "Mousecape.app"
|
||||
BlueprintName = "Mousecape"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FAC69F60189D603C00BC829D"
|
||||
BuildableName = "Mousecape.app"
|
||||
BlueprintName = "Mousecape"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0500"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -13,10 +14,10 @@
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
|
||||
BuildableName = "magicmouse"
|
||||
BlueprintName = "magicmouse"
|
||||
ReferencedContainer = "container:Magic Mouse.xcodeproj">
|
||||
BlueprintIdentifier = "FAC69FAC189D608900BC829D"
|
||||
BuildableName = "mousecloak"
|
||||
BlueprintName = "mousecloak"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
@@ -31,10 +32,10 @@
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
|
||||
BuildableName = "magicmouse"
|
||||
BlueprintName = "magicmouse"
|
||||
ReferencedContainer = "container:Magic Mouse.xcodeproj">
|
||||
BlueprintIdentifier = "FAC69FAC189D608900BC829D"
|
||||
BuildableName = "mousecloak"
|
||||
BlueprintName = "mousecloak"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</TestAction>
|
||||
@@ -50,10 +51,10 @@
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
|
||||
BuildableName = "magicmouse"
|
||||
BlueprintName = "magicmouse"
|
||||
ReferencedContainer = "container:Magic Mouse.xcodeproj">
|
||||
BlueprintIdentifier = "FAC69FAC189D608900BC829D"
|
||||
BuildableName = "mousecloak"
|
||||
BlueprintName = "mousecloak"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
@@ -68,10 +69,10 @@
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
|
||||
BuildableName = "magicmouse"
|
||||
BlueprintName = "magicmouse"
|
||||
ReferencedContainer = "container:Magic Mouse.xcodeproj">
|
||||
BlueprintIdentifier = "FAC69FAC189D608900BC829D"
|
||||
BuildableName = "mousecloak"
|
||||
BlueprintName = "mousecloak"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0440"
|
||||
LastUpgradeVersion = "0600"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -14,17 +14,17 @@
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
|
||||
BuildableName = "magicmouse"
|
||||
BlueprintName = "magicmouse"
|
||||
ReferencedContainer = "container:Magic Mouse.xcodeproj">
|
||||
BlueprintIdentifier = "FAE5D54819526F82007620DE"
|
||||
BuildableName = "com.alexzielenski.mousecloakhelper.app"
|
||||
BlueprintName = "com.alexzielenski.mousecloakhelper"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
@@ -32,10 +32,10 @@
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
|
||||
BuildableName = "magicmouse"
|
||||
BlueprintName = "magicmouse"
|
||||
ReferencedContainer = "container:Magic Mouse.xcodeproj">
|
||||
BlueprintIdentifier = "FAE5D54819526F82007620DE"
|
||||
BuildableName = "com.alexzielenski.mousecloakhelper.app"
|
||||
BlueprintName = "com.alexzielenski.mousecloakhelper"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</TestAction>
|
||||
@@ -51,18 +51,12 @@
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
|
||||
BuildableName = "magicmouse"
|
||||
BlueprintName = "magicmouse"
|
||||
ReferencedContainer = "container:Magic Mouse.xcodeproj">
|
||||
BlueprintIdentifier = "FAE5D54819526F82007620DE"
|
||||
BuildableName = "com.alexzielenski.mousecloakhelper.app"
|
||||
BlueprintName = "com.alexzielenski.mousecloakhelper"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<CommandLineArguments>
|
||||
<CommandLineArgument
|
||||
argument = "/Users/Alex/Desktop/svanslos.plist"
|
||||
isEnabled = "YES">
|
||||
</CommandLineArgument>
|
||||
</CommandLineArguments>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
@@ -75,10 +69,10 @@
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FA6F2D1D14F3150E0098AE57"
|
||||
BuildableName = "magicmouse"
|
||||
BlueprintName = "magicmouse"
|
||||
ReferencedContainer = "container:Magic Mouse.xcodeproj">
|
||||
BlueprintIdentifier = "FAE5D54819526F82007620DE"
|
||||
BuildableName = "com.alexzielenski.mousecloakhelper.app"
|
||||
BlueprintName = "com.alexzielenski.mousecloakhelper"
|
||||
ReferencedContainer = "container:Mousecape.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
@@ -4,35 +4,55 @@
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>Magic Mouse.xcscheme</key>
|
||||
<key>Mousecape Release.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
<key>magicmouse.xcscheme</key>
|
||||
<key>Mousecape.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
<key>mousecloak.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>2</integer>
|
||||
</dict>
|
||||
<key>mousecloakHelper.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>3</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>FA67E4B614FAD1E300F1D69E</key>
|
||||
<key>FAC69F60189D603C00BC829D</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>FA6F2CF814F315000098AE57</key>
|
||||
<key>FAC69F81189D603C00BC829D</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>FA6F2D1D14F3150E0098AE57</key>
|
||||
<key>FAC69F9B189D605300BC829D</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>FAD37AFD14F9836E00B7F09C</key>
|
||||
<key>FAC69FAC189D608900BC829D</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>FAE5D54819526F82007620DE</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>FAE5D55A19526F82007620DE</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
@@ -0,0 +1,693 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="MCEditWindowController">
|
||||
<connections>
|
||||
<outlet property="detailView" destination="fzz-Li-KC6" id="o4X-5d-9UA"/>
|
||||
<outlet property="editCapeController" destination="Bu6-lg-x1j" id="K0b-fF-JHE"/>
|
||||
<outlet property="editDetailController" destination="tMj-cQ-hK0" id="i1B-Pa-vlp"/>
|
||||
<outlet property="editListController" destination="oUs-Nv-PHw" id="C2e-6f-Mpe"/>
|
||||
<outlet property="window" destination="1" id="3"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="1" customClass="NSPanel">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="525" height="297"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
|
||||
<value key="minSize" type="size" width="500" height="310"/>
|
||||
<view key="contentView" id="2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="525" height="297"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<splitView canDrawConcurrently="YES" dividerStyle="thin" vertical="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3cj-R9-WKK">
|
||||
<rect key="frame" x="0.0" y="0.0" width="525" height="297"/>
|
||||
<subviews>
|
||||
<customView id="IHY-vi-Wpr">
|
||||
<rect key="frame" x="0.0" y="0.0" width="135" height="297"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<scrollView canDrawConcurrently="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="34" horizontalPageScroll="10" verticalLineScroll="34" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2UQ-R4-qJn">
|
||||
<rect key="frame" x="0.0" y="22" width="135" height="275"/>
|
||||
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="ame-2S-JV7">
|
||||
<rect key="frame" x="0.0" y="0.0" width="135" height="275"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnResizing="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="32" rowSizeStyle="automatic" viewBased="YES" id="MU4-Yh-0PJ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="135" height="275"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<size key="intercellSpacing" width="3" height="2"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
||||
<tableColumns>
|
||||
<tableColumn editable="NO" width="132" minWidth="40" maxWidth="1000" id="B1d-Yp-OOR">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" white="0.33333298560000002" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</tableHeaderCell>
|
||||
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="EOd-L3-If3">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES"/>
|
||||
<prototypeCellViews>
|
||||
<tableCellView identifier="MCCursorLibrary" id="ti0-Bq-1rU">
|
||||
<rect key="frame" x="1" y="1" width="132" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="tn7-kB-Fvu">
|
||||
<rect key="frame" x="6" y="8" width="120" height="17"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="8we-kW-bNk">
|
||||
<font key="font" metaFont="systemBold"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="backgroundStyle">
|
||||
<integer key="value" value="2"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="ti0-Bq-1rU" name="value" keyPath="objectValue.name" id="t1G-Uv-n0y"/>
|
||||
</connections>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="tn7-kB-Fvu" secondAttribute="trailing" constant="8" id="ilO-BE-fhh"/>
|
||||
<constraint firstAttribute="centerY" secondItem="tn7-kB-Fvu" secondAttribute="centerY" id="xFa-kX-vgG"/>
|
||||
<constraint firstItem="tn7-kB-Fvu" firstAttribute="leading" secondItem="ti0-Bq-1rU" secondAttribute="leading" constant="8" id="zRO-gF-Fjk"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="textField" destination="tn7-kB-Fvu" id="EIu-dF-vgX"/>
|
||||
</connections>
|
||||
</tableCellView>
|
||||
<tableCellView identifier="MCCursor" id="ldl-Zk-KLa">
|
||||
<rect key="frame" x="1" y="35" width="132" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="W6i-Uv-3TI">
|
||||
<rect key="frame" x="6" y="0.0" width="120" height="17"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="8bB-Ws-20v">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="ldl-Zk-KLa" name="value" keyPath="objectValue.name" id="OuH-uQ-nFp"/>
|
||||
</connections>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="centerY" secondItem="W6i-Uv-3TI" secondAttribute="centerY" id="JPw-Qf-DNs"/>
|
||||
<constraint firstItem="W6i-Uv-3TI" firstAttribute="leading" secondItem="ldl-Zk-KLa" secondAttribute="leading" constant="8" id="WvV-tP-TPf"/>
|
||||
<constraint firstAttribute="trailing" secondItem="W6i-Uv-3TI" secondAttribute="trailing" constant="8" id="zV0-3Z-fAD"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="textField" destination="W6i-Uv-3TI" id="rCr-ZD-nty"/>
|
||||
</connections>
|
||||
</tableCellView>
|
||||
</prototypeCellViews>
|
||||
</tableColumn>
|
||||
</tableColumns>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="oUs-Nv-PHw" id="ur0-Pm-oqJ"/>
|
||||
<outlet property="delegate" destination="oUs-Nv-PHw" id="GMA-yd-uCn"/>
|
||||
<outlet property="menu" destination="vy8-Pj-2Jg" id="4S4-YC-adi"/>
|
||||
<outlet property="nextKeyView" destination="fzz-Li-KC6" id="Mg7-QD-IZj"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<nil key="backgroundColor"/>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="ARR-bd-5zK">
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="3rZ-7d-Mro">
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
<button translatesAutoresizingMaskIntoConstraints="NO" id="0ps-WH-ASN">
|
||||
<rect key="frame" x="0.0" y="0.0" width="22" height="22"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="22" id="Fdb-xA-sn9"/>
|
||||
<constraint firstAttribute="height" constant="22" id="iNY-lh-RsQ"/>
|
||||
</constraints>
|
||||
<buttonCell key="cell" type="smallSquare" bezelStyle="smallSquare" image="NSAddTemplate" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="xv7-ZP-O2C">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="addAction:" target="oUs-Nv-PHw" id="QeK-Mq-YfI"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button translatesAutoresizingMaskIntoConstraints="NO" id="w4h-lB-jLi">
|
||||
<rect key="frame" x="22" y="0.0" width="22" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="22" id="L21-Ci-myo"/>
|
||||
<constraint firstAttribute="height" constant="20" id="M80-94-gpJ"/>
|
||||
</constraints>
|
||||
<buttonCell key="cell" type="smallSquare" bezelStyle="smallSquare" image="NSRemoveTemplate" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="HjH-hq-TxT">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="removeAction:" target="oUs-Nv-PHw" id="JjR-lV-zwz"/>
|
||||
</connections>
|
||||
</button>
|
||||
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="UJO-Hw-fRK">
|
||||
<rect key="frame" x="0.0" y="19" width="135" height="5"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="NYz-xn-F0g"/>
|
||||
</constraints>
|
||||
</box>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="UJO-Hw-fRK" secondAttribute="trailing" id="1nr-pf-XFQ"/>
|
||||
<constraint firstAttribute="bottom" secondItem="UJO-Hw-fRK" secondAttribute="bottom" constant="21" id="6Ak-tM-Cac"/>
|
||||
<constraint firstItem="0ps-WH-ASN" firstAttribute="width" secondItem="w4h-lB-jLi" secondAttribute="width" id="97v-Rq-d09"/>
|
||||
<constraint firstAttribute="bottom" secondItem="0ps-WH-ASN" secondAttribute="bottom" id="Afn-3d-zKF"/>
|
||||
<constraint firstItem="UJO-Hw-fRK" firstAttribute="leading" secondItem="IHY-vi-Wpr" secondAttribute="leading" id="C8U-9e-Hyh"/>
|
||||
<constraint firstAttribute="trailing" secondItem="2UQ-R4-qJn" secondAttribute="trailing" id="LC4-J4-2bn"/>
|
||||
<constraint firstItem="2UQ-R4-qJn" firstAttribute="top" secondItem="IHY-vi-Wpr" secondAttribute="top" id="NyE-Z9-XCc"/>
|
||||
<constraint firstItem="0ps-WH-ASN" firstAttribute="leading" secondItem="IHY-vi-Wpr" secondAttribute="leading" id="kvW-tW-AQF"/>
|
||||
<constraint firstItem="w4h-lB-jLi" firstAttribute="leading" secondItem="0ps-WH-ASN" secondAttribute="trailing" id="oqH-vB-hO8"/>
|
||||
<constraint firstItem="0ps-WH-ASN" firstAttribute="bottom" secondItem="w4h-lB-jLi" secondAttribute="bottom" id="sWe-gf-GX0"/>
|
||||
<constraint firstItem="2UQ-R4-qJn" firstAttribute="leading" secondItem="IHY-vi-Wpr" secondAttribute="leading" id="thB-tX-fKx"/>
|
||||
<constraint firstItem="0ps-WH-ASN" firstAttribute="height" secondItem="w4h-lB-jLi" secondAttribute="height" constant="2" id="uJj-nv-0fc"/>
|
||||
<constraint firstAttribute="bottom" secondItem="2UQ-R4-qJn" secondAttribute="bottom" constant="22" id="vLX-hs-yVP"/>
|
||||
</constraints>
|
||||
</customView>
|
||||
<customView fixedFrame="YES" id="fzz-Li-KC6">
|
||||
<rect key="frame" x="136" y="0.0" width="389" height="297"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</customView>
|
||||
</subviews>
|
||||
<holdingPriorities>
|
||||
<real value="250"/>
|
||||
<real value="250"/>
|
||||
</holdingPriorities>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-2" id="lwv-X3-bDm"/>
|
||||
</connections>
|
||||
</splitView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="3cj-R9-WKK" firstAttribute="leading" secondItem="2" secondAttribute="leading" id="4E6-iP-FpE"/>
|
||||
<constraint firstItem="3cj-R9-WKK" firstAttribute="top" secondItem="2" secondAttribute="top" id="Eam-bF-EPz"/>
|
||||
<constraint firstAttribute="trailing" secondItem="3cj-R9-WKK" secondAttribute="trailing" id="IT0-Rw-fmh"/>
|
||||
<constraint firstAttribute="bottom" secondItem="3cj-R9-WKK" secondAttribute="bottom" id="znR-CB-aDB"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<binding destination="oUs-Nv-PHw" name="title" keyPath="cursorLibrary.name" id="RKE-nQ-CzI"/>
|
||||
<outlet property="delegate" destination="-2" id="4"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="139.5" y="555.5"/>
|
||||
</window>
|
||||
<viewController title="List" id="oUs-Nv-PHw" customClass="MCEditListController">
|
||||
<connections>
|
||||
<outlet property="tableView" destination="MU4-Yh-0PJ" id="TRg-C6-MaW"/>
|
||||
<outlet property="view" destination="MU4-Yh-0PJ" id="xHm-2x-mvT"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<viewController title="Detail" id="tMj-cQ-hK0" customClass="MCEditDetailController">
|
||||
<connections>
|
||||
<outlet property="rep1000View" destination="4hN-Nm-B7Z" id="8iU-1v-yGH"/>
|
||||
<outlet property="rep100View" destination="j7v-U4-eMe" id="X5D-KB-JVI"/>
|
||||
<outlet property="rep200View" destination="ggE-Pd-aWo" id="oJ3-3i-3SZ"/>
|
||||
<outlet property="rep500View" destination="G3t-wd-E5Y" id="u1Y-3n-iRc"/>
|
||||
<outlet property="typePopUpButton" destination="yz7-y5-TxE" id="0Lj-Ty-Oea"/>
|
||||
<outlet property="view" destination="o0X-1i-ZgL" id="fn8-Is-pBo"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<viewController title="Cape" id="Bu6-lg-x1j" customClass="MCEditCapeController">
|
||||
<connections>
|
||||
<outlet property="view" destination="WMR-Vn-IHF" id="tlm-o5-run"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<customView id="WMR-Vn-IHF" userLabel="Cape">
|
||||
<rect key="frame" x="0.0" y="0.0" width="504" height="321"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="X2i-rg-HDg">
|
||||
<rect key="frame" x="18" y="259" width="62" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Author:" id="Oyi-AW-60U">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="yyn-IO-TkO">
|
||||
<rect key="frame" x="18" y="209" width="62" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Version:" id="98i-gH-tf4">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ELX-ej-rTb">
|
||||
<rect key="frame" x="18" y="234" width="62" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Identifier:" id="Xzj-Uq-4bW">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="CTE-6h-rbf">
|
||||
<rect key="frame" x="18" y="284" width="62" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Name:" id="oMS-dL-nZj">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bim-1a-xuh">
|
||||
<rect key="frame" x="86" y="281" width="398" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="07X-ce-vmv">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="Bu6-lg-x1j" name="value" keyPath="cursorLibrary.name" id="QlS-r9-svX"/>
|
||||
<outlet property="nextKeyView" destination="xy3-2B-C0h" id="kJW-OZ-1NO"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xy3-2B-C0h">
|
||||
<rect key="frame" x="86" y="256" width="398" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="fmY-Bj-OnI">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="Bu6-lg-x1j" name="value" keyPath="cursorLibrary.author" id="CfA-df-u6f"/>
|
||||
<outlet property="nextKeyView" destination="XYx-UL-WbM" id="74w-oc-ff2"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="XYx-UL-WbM">
|
||||
<rect key="frame" x="86" y="231" width="398" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="sjK-hK-kfo">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="Bu6-lg-x1j" name="value" keyPath="cursorLibrary.identifier" id="Vdx-1W-Guz">
|
||||
<dictionary key="options">
|
||||
<bool key="NSValidatesImmediately" value="YES"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
<outlet property="nextKeyView" destination="car-it-RsL" id="uaw-jj-8AW"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="car-it-RsL">
|
||||
<rect key="frame" x="86" y="206" width="398" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="qW0-CC-89l">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="oUs-Nv-PHw" name="value" keyPath="cursorLibrary.version" id="pHV-5a-ce5"/>
|
||||
<outlet property="nextKeyView" destination="MJr-Jz-5Cq" id="sfZ-oa-g3c"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="i5v-yD-weq">
|
||||
<rect key="frame" x="18" y="184" width="62" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Retina:" id="HFS-GR-guB">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button translatesAutoresizingMaskIntoConstraints="NO" id="MJr-Jz-5Cq">
|
||||
<rect key="frame" x="84" y="182" width="18" height="18"/>
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="overlaps" state="on" inset="2" id="Ma9-Ke-hYa">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="Bu6-lg-x1j" name="value" keyPath="cursorLibrary.hiDPI" id="jnk-dy-w9m"/>
|
||||
<outlet property="nextKeyView" destination="bim-1a-xuh" id="flN-6L-Vpz"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="car-it-RsL" firstAttribute="leading" secondItem="bim-1a-xuh" secondAttribute="leading" id="0xF-zq-ScD"/>
|
||||
<constraint firstAttribute="trailing" secondItem="XYx-UL-WbM" secondAttribute="trailing" constant="20" id="2FH-UV-gN8"/>
|
||||
<constraint firstItem="car-it-RsL" firstAttribute="width" secondItem="xy3-2B-C0h" secondAttribute="width" id="5Ga-DV-3Po"/>
|
||||
<constraint firstItem="car-it-RsL" firstAttribute="width" secondItem="XYx-UL-WbM" secondAttribute="width" id="78w-Rp-5Kn"/>
|
||||
<constraint firstItem="bim-1a-xuh" firstAttribute="top" secondItem="WMR-Vn-IHF" secondAttribute="top" constant="18" id="7md-u2-mQL"/>
|
||||
<constraint firstAttribute="trailing" secondItem="car-it-RsL" secondAttribute="trailing" constant="20" id="8og-5G-f3t"/>
|
||||
<constraint firstItem="CTE-6h-rbf" firstAttribute="leading" secondItem="yyn-IO-TkO" secondAttribute="leading" id="A71-62-pAd"/>
|
||||
<constraint firstItem="CTE-6h-rbf" firstAttribute="trailing" secondItem="X2i-rg-HDg" secondAttribute="trailing" id="B5V-w4-E4R"/>
|
||||
<constraint firstItem="xy3-2B-C0h" firstAttribute="top" secondItem="bim-1a-xuh" secondAttribute="bottom" constant="3" id="Ba8-n2-AJY"/>
|
||||
<constraint firstItem="CTE-6h-rbf" firstAttribute="trailing" secondItem="ELX-ej-rTb" secondAttribute="trailing" id="CUf-rI-rpu"/>
|
||||
<constraint firstItem="CTE-6h-rbf" firstAttribute="width" secondItem="X2i-rg-HDg" secondAttribute="width" id="D9Z-q0-phl"/>
|
||||
<constraint firstItem="ELX-ej-rTb" firstAttribute="top" secondItem="X2i-rg-HDg" secondAttribute="bottom" constant="8" id="DLd-62-Iep"/>
|
||||
<constraint firstItem="CTE-6h-rbf" firstAttribute="width" secondItem="ELX-ej-rTb" secondAttribute="width" id="DNc-Oi-qtL"/>
|
||||
<constraint firstItem="CTE-6h-rbf" firstAttribute="leading" secondItem="X2i-rg-HDg" secondAttribute="leading" id="Dzm-RT-QGr"/>
|
||||
<constraint firstItem="CTE-6h-rbf" firstAttribute="leading" secondItem="ELX-ej-rTb" secondAttribute="leading" id="H6H-IO-OIS"/>
|
||||
<constraint firstItem="CTE-6h-rbf" firstAttribute="trailing" secondItem="yyn-IO-TkO" secondAttribute="trailing" id="Iox-22-dSy"/>
|
||||
<constraint firstItem="yyn-IO-TkO" firstAttribute="top" secondItem="ELX-ej-rTb" secondAttribute="bottom" constant="8" id="IxV-Aj-Agw"/>
|
||||
<constraint firstItem="yyn-IO-TkO" firstAttribute="trailing" secondItem="i5v-yD-weq" secondAttribute="trailing" id="JJ3-CQ-MYe"/>
|
||||
<constraint firstItem="CTE-6h-rbf" firstAttribute="top" secondItem="WMR-Vn-IHF" secondAttribute="top" constant="20" symbolic="YES" id="Nav-P8-ewc"/>
|
||||
<constraint firstItem="car-it-RsL" firstAttribute="leading" secondItem="xy3-2B-C0h" secondAttribute="leading" id="Ofe-x8-Iz6"/>
|
||||
<constraint firstItem="yyn-IO-TkO" firstAttribute="width" secondItem="i5v-yD-weq" secondAttribute="width" id="Pbq-09-PEz"/>
|
||||
<constraint firstAttribute="trailing" secondItem="xy3-2B-C0h" secondAttribute="trailing" constant="20" id="QaY-Yd-7ki"/>
|
||||
<constraint firstAttribute="trailing" secondItem="bim-1a-xuh" secondAttribute="trailing" constant="20" id="Qgd-dL-t4L"/>
|
||||
<constraint firstItem="XYx-UL-WbM" firstAttribute="top" secondItem="xy3-2B-C0h" secondAttribute="bottom" constant="3" id="S7k-zO-aLb"/>
|
||||
<constraint firstItem="car-it-RsL" firstAttribute="width" secondItem="bim-1a-xuh" secondAttribute="width" id="Scq-gg-9Mp"/>
|
||||
<constraint firstItem="bim-1a-xuh" firstAttribute="leading" secondItem="CTE-6h-rbf" secondAttribute="trailing" constant="8" symbolic="YES" id="V76-cY-GEg"/>
|
||||
<constraint firstItem="car-it-RsL" firstAttribute="trailing" secondItem="XYx-UL-WbM" secondAttribute="trailing" id="YTL-Eq-h2J"/>
|
||||
<constraint firstItem="X2i-rg-HDg" firstAttribute="top" secondItem="CTE-6h-rbf" secondAttribute="bottom" constant="8" id="b3A-aW-7fb"/>
|
||||
<constraint firstItem="i5v-yD-weq" firstAttribute="top" secondItem="yyn-IO-TkO" secondAttribute="bottom" constant="8" id="dGT-5B-B1c"/>
|
||||
<constraint firstItem="car-it-RsL" firstAttribute="leading" secondItem="MJr-Jz-5Cq" secondAttribute="leading" id="e2s-Um-zcp"/>
|
||||
<constraint firstItem="CTE-6h-rbf" firstAttribute="leading" secondItem="WMR-Vn-IHF" secondAttribute="leading" constant="20" symbolic="YES" id="g0a-i4-KIf"/>
|
||||
<constraint firstItem="car-it-RsL" firstAttribute="top" secondItem="XYx-UL-WbM" secondAttribute="bottom" constant="3" id="ol9-vF-CGP"/>
|
||||
<constraint firstItem="MJr-Jz-5Cq" firstAttribute="top" secondItem="car-it-RsL" secondAttribute="bottom" constant="8" id="rTY-Fr-65b"/>
|
||||
<constraint firstItem="CTE-6h-rbf" firstAttribute="width" secondItem="yyn-IO-TkO" secondAttribute="width" id="sb9-dg-qOh"/>
|
||||
<constraint firstItem="car-it-RsL" firstAttribute="trailing" secondItem="xy3-2B-C0h" secondAttribute="trailing" id="wpN-fF-mXb"/>
|
||||
<constraint firstItem="car-it-RsL" firstAttribute="trailing" secondItem="bim-1a-xuh" secondAttribute="trailing" id="wtJ-Bc-d9Z"/>
|
||||
<constraint firstItem="car-it-RsL" firstAttribute="leading" secondItem="XYx-UL-WbM" secondAttribute="leading" id="yFH-4V-CiS"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="nextKeyView" destination="bim-1a-xuh" id="YxQ-sZ-TFh"/>
|
||||
</connections>
|
||||
</customView>
|
||||
<customView id="o0X-1i-ZgL" userLabel="Detail">
|
||||
<rect key="frame" x="0.0" y="0.0" width="509" height="321"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Dm8-Mj-s5f">
|
||||
<rect key="frame" x="18" y="284" width="103" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Type:" id="dy9-JM-4d7">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="D5V-CV-BuE">
|
||||
<rect key="frame" x="18" y="259" width="103" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Frames:" id="G4c-OI-avP">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zEj-zS-uzh">
|
||||
<rect key="frame" x="18" y="234" width="103" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Frame Duration:" id="5Wb-pc-8jV">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="aso-MD-Alm">
|
||||
<rect key="frame" x="18" y="209" width="103" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Hot Spot:" id="dcq-3r-2DB">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yz7-y5-TxE">
|
||||
<rect key="frame" x="127" y="277" width="362" height="25"/>
|
||||
<popUpButtonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="gKl-8J-X0X">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
<menu key="menu" title="OtherViews" id="j3S-Me-3x5"/>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<binding destination="tMj-cQ-hK0" name="selectedValue" keyPath="cursor.identifier" id="2aq-Lm-1Lm">
|
||||
<dictionary key="options">
|
||||
<string key="NSMultipleValuesPlaceholder">Unknown</string>
|
||||
<string key="NSNoSelectionPlaceholder">Unknown</string>
|
||||
<string key="NSNotApplicablePlaceholder">Unknown</string>
|
||||
<string key="NSNullPlaceholder">Unknown</string>
|
||||
<string key="NSValueTransformerName">MCCursorTypeValueTransformer</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
<outlet property="nextKeyView" destination="rms-zC-s1M" id="yfu-3L-R4w"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="rms-zC-s1M">
|
||||
<rect key="frame" x="127" y="254" width="362" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="1" drawsBackground="YES" id="tKY-dX-ibT">
|
||||
<numberFormatter key="formatter" formatterBehavior="default10_4" positiveFormat="#" negativeFormat="#" usesGroupingSeparator="NO" paddingCharacter="*" groupingSize="0" minimumIntegerDigits="0" maximumIntegerDigits="42" decimalSeparator="." groupingSeparator="," currencyDecimalSeparator="." plusSign="+" minusSign="-" notANumberSymbol="NaN" perMillSymbol="‰" percentSymbol="%" exponentSymbol="E" positivePrefix="" positiveSuffix="" negativePrefix="-" negativeSuffix="" id="JEt-qW-Py5">
|
||||
<real key="minimum" value="1"/>
|
||||
<real key="maximum" value="24"/>
|
||||
</numberFormatter>
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="tMj-cQ-hK0" name="value" keyPath="cursor.frameCount" id="05V-RH-y2o">
|
||||
<dictionary key="options">
|
||||
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
<outlet property="nextKeyView" destination="VbK-WJ-M0L" id="y5I-kM-hNq"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VbK-WJ-M0L">
|
||||
<rect key="frame" x="127" y="229" width="362" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="0.0" drawsBackground="YES" id="pqX-MB-QME">
|
||||
<numberFormatter key="formatter" formatterBehavior="custom10_4" positiveFormat="#.################" negativeFormat="#.################" usesGroupingSeparator="NO" paddingCharacter="*" groupingSize="0" minimumIntegerDigits="0" maximumIntegerDigits="42" maximumFractionDigits="16" decimalSeparator="." groupingSeparator="," currencyDecimalSeparator="." plusSign="+" minusSign="-" notANumberSymbol="NaN" perMillSymbol="‰" percentSymbol="%" exponentSymbol="E" positivePrefix="" positiveSuffix="" negativePrefix="-" negativeSuffix="" id="QTS-o7-aVO">
|
||||
<real key="minimum" value="0.0"/>
|
||||
</numberFormatter>
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="tMj-cQ-hK0" name="value" keyPath="cursor.frameDuration" id="pBC-y0-ehq">
|
||||
<dictionary key="options">
|
||||
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
<outlet property="nextKeyView" destination="Qcr-83-Tz0" id="gYj-Hj-Txi"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Qcr-83-Tz0">
|
||||
<rect key="frame" x="127" y="204" width="362" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="{0,0}" drawsBackground="YES" id="BWu-hw-sDX">
|
||||
<customFormatter key="formatter" id="hAv-1z-0Jg" customClass="MCPointFormatter"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="tMj-cQ-hK0" name="value" keyPath="cursor.hotSpot" id="7E7-XS-E4D">
|
||||
<dictionary key="options">
|
||||
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
<outlet property="nextKeyView" destination="wdB-yr-r6Y" id="Smn-hK-iP2"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="75v-aw-FbU">
|
||||
<rect key="frame" x="140" y="98" width="23" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="1x" id="FZ3-qB-kDI">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Hoi-Pr-5wz">
|
||||
<rect key="frame" x="196" y="98" width="23" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="2x" id="WI8-sV-4D6">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="CWo-oD-OZX">
|
||||
<rect key="frame" x="253" y="98" width="23" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="5x" id="4fS-Q1-prn">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ryz-mP-wNx">
|
||||
<rect key="frame" x="306" y="98" width="31" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="10x" id="8fp-Ws-ruA">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<customView misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ggE-Pd-aWo" customClass="MMAnimatingImageView">
|
||||
<rect key="frame" x="183" y="123" width="49" height="48"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="shouldShowHotSpot" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="shouldAllowDragging" value="YES"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="tMj-cQ-hK0" id="Q6h-vm-kaw"/>
|
||||
</connections>
|
||||
</customView>
|
||||
<customView misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="G3t-wd-E5Y" customClass="MMAnimatingImageView">
|
||||
<rect key="frame" x="240" y="123" width="49" height="48"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="shouldShowHotSpot" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="shouldAllowDragging" value="YES"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="tMj-cQ-hK0" id="VPL-GA-4fS"/>
|
||||
</connections>
|
||||
</customView>
|
||||
<customView misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4hN-Nm-B7Z" customClass="MMAnimatingImageView">
|
||||
<rect key="frame" x="297" y="123" width="49" height="48"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="shouldShowHotSpot" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="shouldAllowDragging" value="YES"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="tMj-cQ-hK0" id="fp1-eX-JUN"/>
|
||||
</connections>
|
||||
</customView>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OAt-gN-EX5">
|
||||
<rect key="frame" x="18" y="184" width="103" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Size:" id="FrC-7p-0Bq">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wdB-yr-r6Y">
|
||||
<rect key="frame" x="127" y="179" width="362" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="{0,0}" drawsBackground="YES" id="OmM-g8-Kyd">
|
||||
<customFormatter key="formatter" id="wEf-m3-oYM" customClass="MCSizeFormatter"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="tMj-cQ-hK0" name="value" keyPath="cursor.size" id="dXp-5z-YR6"/>
|
||||
<outlet property="nextKeyView" destination="yz7-y5-TxE" id="9Cb-FK-ium"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<customView misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="j7v-U4-eMe" customClass="MMAnimatingImageView">
|
||||
<rect key="frame" x="127" y="123" width="48" height="48"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="48" id="MeC-cf-abQ"/>
|
||||
<constraint firstAttribute="height" constant="48" id="VAO-nl-ZmQ"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="shouldShowHotSpot" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="shouldAllowDragging" value="YES"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="tMj-cQ-hK0" id="YBU-cQ-gUX"/>
|
||||
</connections>
|
||||
</customView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="CWo-oD-OZX" firstAttribute="top" secondItem="G3t-wd-E5Y" secondAttribute="bottom" constant="8" id="3wX-8h-O6z"/>
|
||||
<constraint firstItem="D5V-CV-BuE" firstAttribute="top" secondItem="rms-zC-s1M" secondAttribute="top" id="43J-XT-GHl"/>
|
||||
<constraint firstItem="Dm8-Mj-s5f" firstAttribute="top" secondItem="yz7-y5-TxE" secondAttribute="top" id="4iw-ff-qi7"/>
|
||||
<constraint firstItem="aso-MD-Alm" firstAttribute="top" secondItem="zEj-zS-uzh" secondAttribute="bottom" constant="8" symbolic="YES" id="5Wt-dl-pef"/>
|
||||
<constraint firstItem="rms-zC-s1M" firstAttribute="leading" secondItem="VbK-WJ-M0L" secondAttribute="leading" id="5dM-sY-h4p"/>
|
||||
<constraint firstItem="j7v-U4-eMe" firstAttribute="leading" secondItem="wdB-yr-r6Y" secondAttribute="leading" id="7xA-ei-9JR"/>
|
||||
<constraint firstItem="zEj-zS-uzh" firstAttribute="leading" secondItem="D5V-CV-BuE" secondAttribute="leading" id="8Cv-6e-Tzx"/>
|
||||
<constraint firstItem="G3t-wd-E5Y" firstAttribute="height" secondItem="4hN-Nm-B7Z" secondAttribute="height" id="8qD-iY-MRu"/>
|
||||
<constraint firstItem="G3t-wd-E5Y" firstAttribute="width" secondItem="ggE-Pd-aWo" secondAttribute="width" id="ASq-Gp-wuC"/>
|
||||
<constraint firstItem="OAt-gN-EX5" firstAttribute="top" secondItem="wdB-yr-r6Y" secondAttribute="top" id="Adr-uG-x9t"/>
|
||||
<constraint firstItem="4hN-Nm-B7Z" firstAttribute="leading" secondItem="G3t-wd-E5Y" secondAttribute="trailing" constant="8" id="AlK-6b-Sni"/>
|
||||
<constraint firstItem="j7v-U4-eMe" firstAttribute="top" secondItem="wdB-yr-r6Y" secondAttribute="bottom" constant="8" id="BW4-UU-kQB"/>
|
||||
<constraint firstItem="75v-aw-FbU" firstAttribute="centerX" secondItem="j7v-U4-eMe" secondAttribute="centerX" id="ClP-It-NEr"/>
|
||||
<constraint firstItem="D5V-CV-BuE" firstAttribute="top" secondItem="Dm8-Mj-s5f" secondAttribute="bottom" constant="8" symbolic="YES" id="EWh-4Q-i3w"/>
|
||||
<constraint firstItem="rms-zC-s1M" firstAttribute="leading" secondItem="D5V-CV-BuE" secondAttribute="trailing" constant="8" symbolic="YES" id="JaG-3Y-FgQ"/>
|
||||
<constraint firstItem="Hoi-Pr-5wz" firstAttribute="centerX" secondItem="ggE-Pd-aWo" secondAttribute="centerX" id="Lm2-Ms-dVL"/>
|
||||
<constraint firstItem="rms-zC-s1M" firstAttribute="trailing" secondItem="yz7-y5-TxE" secondAttribute="trailing" id="MKf-wc-NLL"/>
|
||||
<constraint firstItem="G3t-wd-E5Y" firstAttribute="top" secondItem="ggE-Pd-aWo" secondAttribute="top" id="NM5-rE-34J"/>
|
||||
<constraint firstItem="Qcr-83-Tz0" firstAttribute="leading" secondItem="aso-MD-Alm" secondAttribute="trailing" constant="8" symbolic="YES" id="NO1-Yp-z3e"/>
|
||||
<constraint firstItem="G3t-wd-E5Y" firstAttribute="width" secondItem="j7v-U4-eMe" secondAttribute="width" id="NvM-wM-1NF"/>
|
||||
<constraint firstItem="OAt-gN-EX5" firstAttribute="width" secondItem="aso-MD-Alm" secondAttribute="width" id="PX5-Da-w21"/>
|
||||
<constraint firstItem="Dm8-Mj-s5f" firstAttribute="top" secondItem="o0X-1i-ZgL" secondAttribute="top" constant="20" symbolic="YES" id="R6W-ih-OYh"/>
|
||||
<constraint firstItem="zEj-zS-uzh" firstAttribute="leading" secondItem="aso-MD-Alm" secondAttribute="leading" id="RsR-Ul-Ou2"/>
|
||||
<constraint firstItem="D5V-CV-BuE" firstAttribute="leading" secondItem="Dm8-Mj-s5f" secondAttribute="leading" id="S08-SQ-GJR"/>
|
||||
<constraint firstItem="Qcr-83-Tz0" firstAttribute="top" secondItem="aso-MD-Alm" secondAttribute="top" id="SxH-Ps-hpM"/>
|
||||
<constraint firstItem="VbK-WJ-M0L" firstAttribute="leading" secondItem="zEj-zS-uzh" secondAttribute="trailing" constant="8" symbolic="YES" id="UXO-ZW-ccB"/>
|
||||
<constraint firstItem="ggE-Pd-aWo" firstAttribute="leading" secondItem="j7v-U4-eMe" secondAttribute="trailing" constant="8" id="VHK-Y8-lMy"/>
|
||||
<constraint firstItem="VbK-WJ-M0L" firstAttribute="trailing" secondItem="rms-zC-s1M" secondAttribute="trailing" id="Vxm-cc-Nuz"/>
|
||||
<constraint firstItem="wdB-yr-r6Y" firstAttribute="leading" secondItem="OAt-gN-EX5" secondAttribute="trailing" constant="8" symbolic="YES" id="WLf-wT-t5d"/>
|
||||
<constraint firstItem="zEj-zS-uzh" firstAttribute="top" secondItem="D5V-CV-BuE" secondAttribute="bottom" constant="8" symbolic="YES" id="X0Y-Zf-ilJ"/>
|
||||
<constraint firstItem="wdB-yr-r6Y" firstAttribute="trailing" secondItem="Qcr-83-Tz0" secondAttribute="trailing" id="Yac-TY-Rux"/>
|
||||
<constraint firstItem="75v-aw-FbU" firstAttribute="top" secondItem="j7v-U4-eMe" secondAttribute="bottom" constant="8" id="Yah-L4-Jlp"/>
|
||||
<constraint firstItem="Dm8-Mj-s5f" firstAttribute="leading" secondItem="o0X-1i-ZgL" secondAttribute="leading" constant="20" symbolic="YES" id="ZQi-nH-fRj"/>
|
||||
<constraint firstItem="CWo-oD-OZX" firstAttribute="centerX" secondItem="G3t-wd-E5Y" secondAttribute="centerX" id="ZcC-5o-S4M"/>
|
||||
<constraint firstItem="G3t-wd-E5Y" firstAttribute="width" secondItem="4hN-Nm-B7Z" secondAttribute="width" id="bMf-aA-2io"/>
|
||||
<constraint firstItem="Qcr-83-Tz0" firstAttribute="trailing" secondItem="VbK-WJ-M0L" secondAttribute="trailing" id="e7u-an-cyO"/>
|
||||
<constraint firstItem="Ryz-mP-wNx" firstAttribute="top" secondItem="4hN-Nm-B7Z" secondAttribute="bottom" constant="8" id="eDV-Li-crv"/>
|
||||
<constraint firstItem="yz7-y5-TxE" firstAttribute="leading" secondItem="Dm8-Mj-s5f" secondAttribute="trailing" constant="8" symbolic="YES" id="etw-9O-zNS"/>
|
||||
<constraint firstItem="VbK-WJ-M0L" firstAttribute="leading" secondItem="Qcr-83-Tz0" secondAttribute="leading" id="gnA-Qx-Vmj"/>
|
||||
<constraint firstItem="G3t-wd-E5Y" firstAttribute="height" secondItem="ggE-Pd-aWo" secondAttribute="height" id="huK-Kq-0Iu"/>
|
||||
<constraint firstItem="G3t-wd-E5Y" firstAttribute="leading" secondItem="ggE-Pd-aWo" secondAttribute="trailing" constant="8" id="i75-6i-VPd"/>
|
||||
<constraint firstItem="OAt-gN-EX5" firstAttribute="top" secondItem="aso-MD-Alm" secondAttribute="bottom" constant="8" id="itU-V0-MaU"/>
|
||||
<constraint firstItem="Ryz-mP-wNx" firstAttribute="centerX" secondItem="4hN-Nm-B7Z" secondAttribute="centerX" id="jGh-SC-Nxg"/>
|
||||
<constraint firstItem="zEj-zS-uzh" firstAttribute="top" secondItem="VbK-WJ-M0L" secondAttribute="top" id="k7D-La-IeE"/>
|
||||
<constraint firstItem="wdB-yr-r6Y" firstAttribute="top" secondItem="Qcr-83-Tz0" secondAttribute="bottom" constant="3" id="kIE-fx-9LE"/>
|
||||
<constraint firstItem="G3t-wd-E5Y" firstAttribute="height" secondItem="j7v-U4-eMe" secondAttribute="height" id="kyf-78-kT0"/>
|
||||
<constraint firstItem="G3t-wd-E5Y" firstAttribute="top" secondItem="j7v-U4-eMe" secondAttribute="top" id="lhV-oy-6Mm"/>
|
||||
<constraint firstItem="OAt-gN-EX5" firstAttribute="leading" secondItem="aso-MD-Alm" secondAttribute="leading" id="lp9-nD-Nnz"/>
|
||||
<constraint firstItem="wdB-yr-r6Y" firstAttribute="width" secondItem="Qcr-83-Tz0" secondAttribute="width" id="lyT-KO-eXf"/>
|
||||
<constraint firstItem="yz7-y5-TxE" firstAttribute="leading" secondItem="rms-zC-s1M" secondAttribute="leading" id="thH-qo-cIr"/>
|
||||
<constraint firstItem="G3t-wd-E5Y" firstAttribute="top" secondItem="4hN-Nm-B7Z" secondAttribute="top" id="tvs-VW-0YR"/>
|
||||
<constraint firstAttribute="trailing" secondItem="yz7-y5-TxE" secondAttribute="trailing" constant="20" symbolic="YES" id="wma-6s-J2b"/>
|
||||
<constraint firstItem="Hoi-Pr-5wz" firstAttribute="top" secondItem="ggE-Pd-aWo" secondAttribute="bottom" constant="8" id="wr2-0t-CVH"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="nextKeyView" destination="yz7-y5-TxE" id="WHy-Vl-LGY"/>
|
||||
</connections>
|
||||
</customView>
|
||||
<menu id="vy8-Pj-2Jg">
|
||||
<items>
|
||||
<menuItem title="New Cursor" tag="-1" id="KQs-oD-CRg">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="addAction:" target="oUs-Nv-PHw" id="Vbo-8k-sGO"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Remove Cursor" tag="-1" id="gnE-s8-eO8">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="removeAction:" target="oUs-Nv-PHw" id="QmX-eg-rb3"/>
|
||||
<binding destination="oUs-Nv-PHw" name="enabled" keyPath="selectedObject" id="v5P-WH-Wea">
|
||||
<dictionary key="options">
|
||||
<string key="NSValueTransformerName">NSIsNotNil</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Duplicate" tag="-1" id="swO-bv-qRE">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="duplicateAction:" target="oUs-Nv-PHw" id="z4d-84-N6g"/>
|
||||
<binding destination="oUs-Nv-PHw" name="enabled" keyPath="selectedObject" id="Q5o-HW-cMv">
|
||||
<dictionary key="options">
|
||||
<string key="NSValueTransformerName">NSIsNotNil</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSAddTemplate" width="11" height="11"/>
|
||||
<image name="NSRemoveTemplate" width="11" height="11"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -0,0 +1,290 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="MCLibraryWindowController">
|
||||
<connections>
|
||||
<outlet property="appliedAccessory" destination="3Ui-b0-Yod" id="2Ik-Bo-djE"/>
|
||||
<outlet property="libraryViewController" destination="zL4-Ay-t4Q" id="DE1-rb-MWQ"/>
|
||||
<outlet property="progressBar" destination="F5l-qD-fvC" id="VNK-If-Tfi"/>
|
||||
<outlet property="progressField" destination="Ui8-vk-7P8" id="Esy-lZ-9RN"/>
|
||||
<outlet property="window" destination="1" id="3"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="Mousecape" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" frameAutosaveName="LibraryWindow" animationBehavior="default" id="1">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="711" height="311"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
|
||||
<value key="minSize" type="size" width="502" height="310"/>
|
||||
<view key="contentView" id="2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="711" height="311"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<scrollView canDrawConcurrently="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="84" horizontalPageScroll="10" verticalLineScroll="84" verticalPageScroll="10" translatesAutoresizingMaskIntoConstraints="NO" id="2Io-MC-n6O" customClass="BTRScrollView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="711" height="311"/>
|
||||
<clipView key="contentView" copiesOnScroll="NO" id="VhH-tn-4Sf" customClass="BTRClipView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="711" height="311"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" columnResizing="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="72" rowSizeStyle="automatic" viewBased="YES" id="dPn-85-uPK">
|
||||
<rect key="frame" x="0.0" y="0.0" width="711" height="311"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<size key="intercellSpacing" width="3" height="12"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
||||
<tableColumns>
|
||||
<tableColumn width="708" minWidth="40" maxWidth="9999" id="CBK-sD-upn">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" white="0.33333298560000002" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</tableHeaderCell>
|
||||
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="bXC-ob-CUQ">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES"/>
|
||||
<prototypeCellViews>
|
||||
<tableCellView id="syZ-Eq-Lt2" customClass="MCCapeCellView">
|
||||
<rect key="frame" x="1" y="6" width="708" height="72"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Hfe-RO-hVE">
|
||||
<rect key="frame" x="18" y="55" width="97" height="17"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="0kt-g0-cQb">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="syZ-Eq-Lt2" name="value" keyPath="objectValue.name" id="YHc-x9-wXk"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bEa-BS-ghQ">
|
||||
<rect key="frame" x="115" y="55" width="48" height="14"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Subtitle" id="NXa-Ze-OX2">
|
||||
<font key="font" metaFont="smallSystemBold"/>
|
||||
<color key="textColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="syZ-Eq-Lt2" name="value" keyPath="objectValue.author" id="D3x-S0-YIW"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="jdV-zx-iTs">
|
||||
<rect key="frame" x="634" y="52" width="16" height="16"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="applied" id="bwh-k2-aAS"/>
|
||||
</imageView>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="QMa-EX-Son">
|
||||
<rect key="frame" x="658" y="51" width="30" height="18"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="HDTemplate" id="LsJ-S8-jwy"/>
|
||||
<connections>
|
||||
<binding destination="syZ-Eq-Lt2" name="value" keyPath="objectValue.hiDPI" id="LcB-QZ-MhG">
|
||||
<dictionary key="options">
|
||||
<string key="NSValueTransformerName">MCHDValueTransformer</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</imageView>
|
||||
<scrollView canDrawConcurrently="YES" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasVerticalScroller="NO" verticalScrollElasticity="none" translatesAutoresizingMaskIntoConstraints="NO" id="odP-lr-hJH" customClass="DTScrollView">
|
||||
<rect key="frame" x="20" y="3" width="668" height="44"/>
|
||||
<clipView key="contentView" copiesOnScroll="NO" id="pc3-Zb-Oqk">
|
||||
<rect key="frame" x="1" y="1" width="666" height="42"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<collectionView id="dyM-T9-60O">
|
||||
<rect key="frame" x="0.0" y="0.0" width="666" height="42"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="primaryBackgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</collectionView>
|
||||
</subviews>
|
||||
</clipView>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="44" id="KzC-9x-FvO"/>
|
||||
</constraints>
|
||||
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="mwj-HT-8PV">
|
||||
<rect key="frame" x="1" y="144" width="233" height="15"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="cCy-Hj-b5W">
|
||||
<rect key="frame" x="-100" y="-100" width="15" height="143"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="Hfe-RO-hVE" firstAttribute="leading" secondItem="syZ-Eq-Lt2" secondAttribute="leading" constant="20" symbolic="YES" id="OHp-3c-ujO"/>
|
||||
<constraint firstItem="QMa-EX-Son" firstAttribute="leading" secondItem="jdV-zx-iTs" secondAttribute="trailing" constant="8" symbolic="YES" id="QfE-A7-Oc8"/>
|
||||
<constraint firstItem="bEa-BS-ghQ" firstAttribute="leading" secondItem="Hfe-RO-hVE" secondAttribute="trailing" constant="4" id="WVM-Wd-XXI"/>
|
||||
<constraint firstItem="jdV-zx-iTs" firstAttribute="centerY" secondItem="QMa-EX-Son" secondAttribute="centerY" id="YLI-IS-v1N"/>
|
||||
<constraint firstItem="bEa-BS-ghQ" firstAttribute="baseline" secondItem="Hfe-RO-hVE" secondAttribute="baseline" id="bCc-gQ-FVG"/>
|
||||
<constraint firstAttribute="trailing" secondItem="odP-lr-hJH" secondAttribute="trailing" constant="20" symbolic="YES" id="fnI-G1-FZh"/>
|
||||
<constraint firstItem="odP-lr-hJH" firstAttribute="leading" secondItem="syZ-Eq-Lt2" secondAttribute="leading" constant="20" symbolic="YES" id="joq-b0-pEr"/>
|
||||
<constraint firstAttribute="trailing" secondItem="QMa-EX-Son" secondAttribute="trailing" constant="20" symbolic="YES" id="oL8-Zy-vvE"/>
|
||||
<constraint firstItem="QMa-EX-Son" firstAttribute="top" secondItem="syZ-Eq-Lt2" secondAttribute="top" constant="3" id="oPR-SR-Gh8"/>
|
||||
<constraint firstItem="odP-lr-hJH" firstAttribute="top" secondItem="Hfe-RO-hVE" secondAttribute="bottom" constant="8" symbolic="YES" id="r5F-n8-O3W"/>
|
||||
<constraint firstItem="Hfe-RO-hVE" firstAttribute="top" secondItem="syZ-Eq-Lt2" secondAttribute="top" id="wWd-7q-n1a"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="appliedImageView" destination="jdV-zx-iTs" id="4DM-pV-X1T"/>
|
||||
<outlet property="collectionView" destination="dyM-T9-60O" id="eOd-8D-OEK"/>
|
||||
<outlet property="resolutionImageView" destination="QMa-EX-Son" id="Tr1-E9-rir"/>
|
||||
<outlet property="subtitleField" destination="bEa-BS-ghQ" id="yeA-RV-Aoi"/>
|
||||
<outlet property="textField" destination="Hfe-RO-hVE" id="LWw-Ls-hnr"/>
|
||||
<outlet property="titleField" destination="Hfe-RO-hVE" id="y7O-VO-62y"/>
|
||||
</connections>
|
||||
</tableCellView>
|
||||
</prototypeCellViews>
|
||||
</tableColumn>
|
||||
</tableColumns>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="zL4-Ay-t4Q" id="0iM-HK-P70"/>
|
||||
<outlet property="delegate" destination="zL4-Ay-t4Q" id="riV-4x-e3X"/>
|
||||
<outlet property="menu" destination="zpf-M9-Nd1" id="lfG-VA-TTS"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
</subviews>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="uK0-YP-77b">
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="q1a-eU-6AV">
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="2Io-MC-n6O" secondAttribute="bottom" id="Cbd-gK-nbr"/>
|
||||
<constraint firstItem="2Io-MC-n6O" firstAttribute="top" secondItem="2" secondAttribute="top" id="GZN-yG-wKe"/>
|
||||
<constraint firstAttribute="trailing" secondItem="2Io-MC-n6O" secondAttribute="trailing" id="Nej-8C-Hrd"/>
|
||||
<constraint firstItem="2Io-MC-n6O" firstAttribute="leading" secondItem="2" secondAttribute="leading" id="chC-8B-nJc"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-2" id="4"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-37" y="181"/>
|
||||
</window>
|
||||
<viewController title="Library" id="zL4-Ay-t4Q" customClass="MCLibraryViewController">
|
||||
<connections>
|
||||
<outlet property="contextMenu" destination="zpf-M9-Nd1" id="jgh-ez-9dF"/>
|
||||
<outlet property="tableView" destination="dPn-85-uPK" id="Gbg-WA-ju6"/>
|
||||
<outlet property="view" destination="2" id="zf4-7d-uPj"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<menu id="zpf-M9-Nd1">
|
||||
<items>
|
||||
<menuItem title="Apply" tag="-1" id="aI1-E0-bnW">
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
DQ
|
||||
</string>
|
||||
<connections>
|
||||
<action selector="applyCapeAction:" target="-1" id="KHK-0n-gS3"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Edit" tag="-1" keyEquivalent="e" id="HJc-SX-JjZ">
|
||||
<connections>
|
||||
<action selector="editCapeAction:" target="-1" id="xUA-Zj-ToX"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Duplicate" tag="-1" keyEquivalent="S" id="PhG-Ll-nqz">
|
||||
<connections>
|
||||
<action selector="duplicateCapeAction:" target="-1" id="3xf-LP-P1p"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Remove" tag="-1" id="Aig-wl-ivn">
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
CA
|
||||
</string>
|
||||
<connections>
|
||||
<action selector="removeCapeAction:" target="-1" id="Psf-74-zsG"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="A7P-y0-FBc"/>
|
||||
<menuItem title="Show in Finder" tag="-1" id="2WM-EN-kiI">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="showCapeAction:" target="-1" id="iF0-eu-Du4"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<customView id="3Ui-b0-Yod" userLabel="Accessory">
|
||||
<rect key="frame" x="0.0" y="0.0" width="251" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cSP-XN-7we">
|
||||
<rect key="frame" x="-2" y="4" width="245" height="14"/>
|
||||
<textFieldCell key="cell" controlSize="small" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="right" title="Applied Cursor: None" usesSingleLineMode="YES" id="vZ3-2R-psO">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="backgroundStyle">
|
||||
<integer key="value" value="2"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="zL4-Ay-t4Q" name="value" keyPath="libraryController.appliedCape.name" id="tSr-qw-vw1">
|
||||
<dictionary key="options">
|
||||
<string key="NSValueTransformerName">MCAppliedCapeValueTransformer</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="cSP-XN-7we" secondAttribute="trailing" constant="10" id="OsL-1s-qgU"/>
|
||||
<constraint firstItem="cSP-XN-7we" firstAttribute="centerY" secondItem="3Ui-b0-Yod" secondAttribute="centerY" id="U7A-WI-2JG"/>
|
||||
<constraint firstItem="cSP-XN-7we" firstAttribute="leading" secondItem="3Ui-b0-Yod" secondAttribute="leading" id="eoA-bD-pz5"/>
|
||||
</constraints>
|
||||
</customView>
|
||||
<view id="smV-Cs-4aH">
|
||||
<rect key="frame" x="0.0" y="0.0" width="100" height="100"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</view>
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="DeD-dq-yBF" customClass="NSPanel">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" utility="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="272" y="172" width="452" height="58"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
|
||||
<view key="contentView" id="me1-hA-pTT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="452" height="58"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<progressIndicator maxValue="100" indeterminate="YES" style="bar" translatesAutoresizingMaskIntoConstraints="NO" id="F5l-qD-fvC">
|
||||
<rect key="frame" x="15" y="19" width="348" height="20"/>
|
||||
</progressIndicator>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Ui8-vk-7P8">
|
||||
<rect key="frame" x="369" y="21" width="70" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="000 of 129" id="sq0-HM-mp6">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="F5l-qD-fvC" firstAttribute="leading" secondItem="me1-hA-pTT" secondAttribute="leading" constant="15" id="1rr-uN-NwK"/>
|
||||
<constraint firstItem="F5l-qD-fvC" firstAttribute="centerY" secondItem="Ui8-vk-7P8" secondAttribute="centerY" constant="0.5" id="FgD-90-fQk"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Ui8-vk-7P8" secondAttribute="trailing" constant="15" id="OgP-qZ-5ss"/>
|
||||
<constraint firstItem="Ui8-vk-7P8" firstAttribute="leading" secondItem="F5l-qD-fvC" secondAttribute="trailing" constant="8" id="Q6O-6O-84O"/>
|
||||
<constraint firstAttribute="centerY" secondItem="F5l-qD-fvC" secondAttribute="centerY" id="yZk-CB-OJj"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<point key="canvasLocation" x="499" y="-470"/>
|
||||
</window>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="HDTemplate" width="30" height="18"/>
|
||||
<image name="applied" width="16" height="16"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -0,0 +1,431 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6185.11" systemVersion="13E28" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6185.11"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="494" id="495"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<menu title="AMainMenu" systemMenu="main" id="29">
|
||||
<items>
|
||||
<menuItem title="Mousecape" id="56">
|
||||
<menu key="submenu" title="Mousecape" systemMenu="apple" id="57">
|
||||
<items>
|
||||
<menuItem title="About Mousecape" id="58">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="236">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Preferences…" keyEquivalent="," id="129">
|
||||
<connections>
|
||||
<action selector="showPreferences:" target="-1" id="lNW-tH-IKS"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check for Updates..." id="igk-i0-oH0">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="checkForUpdates:" target="1HC-av-0d2" id="TKL-G4-NhR"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Install Helper Tool" id="Ui2-VN-tbP">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleInstall:" target="-1" id="Ppc-Jw-bxU"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="143">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Services" id="131">
|
||||
<menu key="submenu" title="Services" systemMenu="services" id="130"/>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="144">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Mousecape" keyEquivalent="h" id="134">
|
||||
<connections>
|
||||
<action selector="hide:" target="-1" id="367"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Others" keyEquivalent="h" id="145">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="hideOtherApplications:" target="-1" id="368"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show All" id="150">
|
||||
<connections>
|
||||
<action selector="unhideAllApplications:" target="-1" id="370"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="149">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Quit Mousecape" keyEquivalent="q" id="136">
|
||||
<connections>
|
||||
<action selector="terminate:" target="-3" id="449"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="File" id="83">
|
||||
<menu key="submenu" title="File" id="81">
|
||||
<items>
|
||||
<menuItem title="New Cape" keyEquivalent="n" id="82">
|
||||
<connections>
|
||||
<action selector="newDocument:" target="-1" id="I3c-Gd-Cqc"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Import Cape" keyEquivalent="o" id="kdx-d9-Lek">
|
||||
<connections>
|
||||
<action selector="openDocument:" target="-1" id="2Qd-t2-zEv"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Import MightyMouse" keyEquivalent="i" id="l3B-n8-21Z">
|
||||
<connections>
|
||||
<action selector="convertCape:" target="494" id="vs2-8F-92y"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="79">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Close" keyEquivalent="w" id="73">
|
||||
<connections>
|
||||
<action selector="performClose:" target="-1" id="193"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Save…" keyEquivalent="s" id="75">
|
||||
<connections>
|
||||
<action selector="saveDocument:" target="-1" id="362"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Revert to Saved" id="112">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="revertDocumentToSaved:" target="-1" id="364"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Edit" id="217">
|
||||
<menu key="submenu" title="Edit" id="205">
|
||||
<items>
|
||||
<menuItem title="Undo" keyEquivalent="z" id="207">
|
||||
<connections>
|
||||
<action selector="undo:" target="-1" id="223"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Redo" keyEquivalent="Z" id="215">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="redo:" target="-1" id="231"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="206">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Cut" keyEquivalent="x" id="199">
|
||||
<connections>
|
||||
<action selector="cut:" target="-1" id="228"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy" keyEquivalent="c" id="197">
|
||||
<connections>
|
||||
<action selector="copy:" target="-1" id="224"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste" keyEquivalent="v" id="203">
|
||||
<connections>
|
||||
<action selector="paste:" target="-1" id="226"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste and Match Style" keyEquivalent="V" id="485">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteAsPlainText:" target="-1" id="486"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Delete" id="202">
|
||||
<connections>
|
||||
<action selector="delete:" target="-1" id="235"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Select All" keyEquivalent="a" id="198">
|
||||
<connections>
|
||||
<action selector="selectAll:" target="-1" id="232"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="214">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Find" id="218">
|
||||
<menu key="submenu" title="Find" id="220">
|
||||
<items>
|
||||
<menuItem title="Find…" tag="1" keyEquivalent="f" id="209">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="241"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="534">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="535"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="208">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="487"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="213">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="488"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use Selection for Find" tag="7" id="221">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="489"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Jump to Selection" keyEquivalent="j" id="210">
|
||||
<connections>
|
||||
<action selector="centerSelectionInVisibleArea:" target="-1" id="245"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Spelling and Grammar" id="216">
|
||||
<menu key="submenu" title="Spelling and Grammar" id="200">
|
||||
<items>
|
||||
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="204">
|
||||
<connections>
|
||||
<action selector="showGuessPanel:" target="-1" id="230"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Document Now" keyEquivalent=";" id="201">
|
||||
<connections>
|
||||
<action selector="checkSpelling:" target="-1" id="225"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="453"/>
|
||||
<menuItem title="Check Spelling While Typing" id="219">
|
||||
<connections>
|
||||
<action selector="toggleContinuousSpellChecking:" target="-1" id="222"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Grammar With Spelling" id="346">
|
||||
<connections>
|
||||
<action selector="toggleGrammarChecking:" target="-1" id="347"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Correct Spelling Automatically" id="454">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticSpellingCorrection:" target="-1" id="456"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Substitutions" id="348">
|
||||
<menu key="submenu" title="Substitutions" id="349">
|
||||
<items>
|
||||
<menuItem title="Show Substitutions" id="457">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontSubstitutionsPanel:" target="-1" id="458"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="459"/>
|
||||
<menuItem title="Smart Copy/Paste" tag="1" keyEquivalent="f" id="350">
|
||||
<connections>
|
||||
<action selector="toggleSmartInsertDelete:" target="-1" id="355"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Quotes" tag="2" keyEquivalent="g" id="351">
|
||||
<connections>
|
||||
<action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="356"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Dashes" id="460">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticDashSubstitution:" target="-1" id="461"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Links" tag="3" keyEquivalent="G" id="354">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticLinkDetection:" target="-1" id="357"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Text Replacement" id="462">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticTextReplacement:" target="-1" id="463"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Transformations" id="450">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Transformations" id="451">
|
||||
<items>
|
||||
<menuItem title="Make Upper Case" id="452">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="uppercaseWord:" target="-1" id="464"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Make Lower Case" id="465">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="lowercaseWord:" target="-1" id="468"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Capitalize" id="466">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="capitalizeWord:" target="-1" id="467"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Speech" id="211">
|
||||
<menu key="submenu" title="Speech" id="212">
|
||||
<items>
|
||||
<menuItem title="Start Speaking" id="196">
|
||||
<connections>
|
||||
<action selector="startSpeaking:" target="-1" id="233"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Stop Speaking" id="195">
|
||||
<connections>
|
||||
<action selector="stopSpeaking:" target="-1" id="227"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Capes" id="g8O-f8-aKi">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Capes" id="ttR-pS-Pk1">
|
||||
<items>
|
||||
<menuItem title="Apply Cape" id="ieJ-T1-eH7">
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
DQ
|
||||
</string>
|
||||
<connections>
|
||||
<action selector="applyCapeAction:" target="-1" id="RAI-pM-j7M"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Edit Cape" keyEquivalent="e" id="5qb-Dw-38q">
|
||||
<connections>
|
||||
<action selector="editCapeAction:" target="-1" id="E2d-D2-Hj9"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Remove Cape" id="LHh-1u-bK8">
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
CA
|
||||
</string>
|
||||
<connections>
|
||||
<action selector="removeCapeAction:" target="-1" id="RE5-YE-iAt"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Duplicate Cape" keyEquivalent="S" id="d9b-6w-ubr">
|
||||
<connections>
|
||||
<action selector="duplicateCapeAction:" target="-1" id="Nj7-Uf-gOO"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check for Updates" hidden="YES" keyEquivalent="u" id="XTi-86-ese">
|
||||
<connections>
|
||||
<action selector="checkCapeAction:" target="-1" id="q4O-FG-Rle"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="EOT-Rk-oU3"/>
|
||||
<menuItem title="Show in Finder" id="PAd-kz-Eoi">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="showCapeAction:" target="-1" id="9mC-pd-eiq"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Restore Defaults" keyEquivalent="r" id="uCE-YB-8VL">
|
||||
<connections>
|
||||
<action selector="restoreCape:" target="494" id="2ve-Ez-ktd"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Dump Cursors…" id="CYY-iE-0bP">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="dumpCapeAction:" target="-1" id="B89-Hc-T1C"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Window" id="19">
|
||||
<menu key="submenu" title="Window" systemMenu="window" id="24">
|
||||
<items>
|
||||
<menuItem title="Minimize" keyEquivalent="m" id="23">
|
||||
<connections>
|
||||
<action selector="performMiniaturize:" target="-1" id="37"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Zoom" id="239">
|
||||
<connections>
|
||||
<action selector="performZoom:" target="-1" id="240"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="92">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Bring All to Front" id="5">
|
||||
<connections>
|
||||
<action selector="arrangeInFront:" target="-1" id="39"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Help" id="490">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Help" systemMenu="help" id="491">
|
||||
<items>
|
||||
<menuItem title="Mousecape Help" keyEquivalent="?" id="492">
|
||||
<connections>
|
||||
<action selector="showHelp:" target="-1" id="493"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<customObject id="494" customClass="MCAppDelegate">
|
||||
<connections>
|
||||
<outlet property="toggleHelperItem" destination="Ui2-VN-tbP" id="31d-Xd-wNX"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="420" customClass="NSFontManager"/>
|
||||
<customObject id="1HC-av-0d2" customClass="SUUpdater"/>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "16x16",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "16x16",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "32x32",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "32x32",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "128x128",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "128x128",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "256x256",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "256x256",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "512x512",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "512x512",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "HDTemplate.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "HDTemplate@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "SDTemplate.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "SDTemplate@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "applied.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "applied@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dz.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dz@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// MCAppDelegate.h
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/1/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MCLibraryWindowController.h"
|
||||
@interface MCAppDelegate : NSObject <NSApplicationDelegate>
|
||||
@property (assign) IBOutlet NSMenuItem *toggleHelperItem;
|
||||
@property (strong) MCLibraryWindowController *libraryWindowController;
|
||||
@end
|
||||
@@ -0,0 +1,150 @@
|
||||
//
|
||||
// MCAppDelegate.m
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/1/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MCAppDelegate.h"
|
||||
#import <Security/Security.h>
|
||||
#import <ServiceManagement/ServiceManagement.h>
|
||||
#import "MCCursorLibrary.h"
|
||||
#import "create.h"
|
||||
#import "MASPreferencesWindowController.h"
|
||||
#import "MCGeneralPreferencesController.h"
|
||||
|
||||
@interface MCAppDelegate () {
|
||||
MASPreferencesWindowController *_preferencesWindowController;
|
||||
}
|
||||
@property (readonly) MASPreferencesWindowController *preferencesWindowController;
|
||||
- (void)configureHelperToolMenuItem;
|
||||
@end
|
||||
|
||||
@implementation MCAppDelegate
|
||||
@dynamic preferencesWindowController;
|
||||
|
||||
- (void)applicationWillFinishLaunching:(NSNotification *)notification {
|
||||
self.libraryWindowController = [[MCLibraryWindowController alloc] initWithWindowNibName:@"Library"];
|
||||
[self.libraryWindowController loadWindow];
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
|
||||
[self configureHelperToolMenuItem];
|
||||
[self.libraryWindowController showWindow:self];
|
||||
|
||||
// Re-apply currently applied cape
|
||||
if (self.libraryWindowController.libraryViewController.libraryController.appliedCape != NULL) {
|
||||
[self.libraryWindowController.libraryViewController.libraryController applyCape:self.libraryWindowController.libraryViewController.libraryController.appliedCape];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename {
|
||||
BOOL open = [filename.pathExtension.lowercaseString isEqualToString:@"cape"];
|
||||
NSURL *url = [NSURL fileURLWithPath:filename];
|
||||
if (open) {
|
||||
[self.libraryWindowController.libraryViewController.libraryController importCapeAtURL:url];
|
||||
}
|
||||
return open;
|
||||
}
|
||||
|
||||
- (void)configureHelperToolMenuItem {
|
||||
CFDictionaryRef dict = SMJobCopyDictionary(kSMDomainUserLaunchd, CFSTR("com.alexzielenski.mousecloakhelper"));
|
||||
|
||||
[self.toggleHelperItem setTag: dict ? 1 : 0];
|
||||
[self.toggleHelperItem setTitle:self.toggleHelperItem.tag ? @"Uninstall Helper Tool" : @"Install Helper Tool"];
|
||||
|
||||
if (dict)
|
||||
CFRelease(dict);
|
||||
}
|
||||
|
||||
- (IBAction)toggleInstall:(NSMenuItem *)sender {
|
||||
BOOL success = NO;
|
||||
|
||||
if (self.toggleHelperItem.tag != 0) { // Uninstall
|
||||
success = SMLoginItemSetEnabled(CFSTR("com.alexzielenski.mousecloakhelper"), false);
|
||||
} else {
|
||||
success = SMLoginItemSetEnabled(CFSTR("com.alexzielenski.mousecloakhelper"), true);
|
||||
}
|
||||
|
||||
// ServiceManagement.framework takes a while to actually register the job dictionary so if the return value is all good we
|
||||
// can be on our merry way
|
||||
if (success && self.toggleHelperItem.tag == 0) {
|
||||
// Successfully Installed
|
||||
[self.toggleHelperItem setTag: 1];
|
||||
[self.toggleHelperItem setTitle:@"Uninstall Helper Tool"];
|
||||
|
||||
NSRunAlertPanel(@"Sucess", @"The Mousecape helper was successfully installed", @"Sweet", @"Thanks", nil);
|
||||
} else if (success) {
|
||||
// Successfully Uninstalled
|
||||
[self.toggleHelperItem setTag: 0];
|
||||
[self.toggleHelperItem setTitle:@"Install Helper Tool"];
|
||||
|
||||
NSRunAlertPanel(@"Sucess", @"The Mousecape helper was successfully uninstalled", @"Sweet", @"Thanks", nil);
|
||||
} else {
|
||||
NSRunAlertPanel(@"Failure", @"The action did not complete successfully", @"Fuck", nil, nil);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (MASPreferencesWindowController *)preferencesWindowController {
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
NSViewController *general = [[MCGeneralPreferencesController alloc] init];
|
||||
_preferencesWindowController = [[MASPreferencesWindowController alloc] initWithViewControllers:@[ general ] title:NSLocalizedString(@"Preferences", nil)];
|
||||
});
|
||||
|
||||
return _preferencesWindowController;
|
||||
}
|
||||
|
||||
#pragma mark - Interface Actions
|
||||
|
||||
- (IBAction)restoreCape:(id)sender {
|
||||
[self.libraryWindowController.libraryViewController.libraryController restoreCape];
|
||||
}
|
||||
|
||||
- (IBAction)convertCape:(id)sender {
|
||||
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
||||
panel.allowedFileTypes = @[ @"MightyMouse" ];
|
||||
panel.title = @"Import";
|
||||
panel.message = @"Choose a MightyMouse file to import";
|
||||
panel.prompt = @"Import";
|
||||
if ([panel runModal] == NSFileHandlingPanelOKButton) {
|
||||
NSString *name = panel.URL.lastPathComponent.stringByDeletingPathExtension;
|
||||
NSDictionary *metadata = @{
|
||||
@"name": name,
|
||||
@"version": @1.0,
|
||||
@"author": @"Unknown",
|
||||
@"identifier": [NSString stringWithFormat:@"local.import.%@.%f", name, [NSDate timeIntervalSinceReferenceDate]]
|
||||
};
|
||||
|
||||
NSDictionary *cape = createCapeFromMightyMouse([NSDictionary dictionaryWithContentsOfURL:panel.URL], metadata);
|
||||
MCCursorLibrary *library = [MCCursorLibrary cursorLibraryWithDictionary:cape];
|
||||
[self.libraryWindowController.libraryViewController.libraryController importCape:library];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)newDocument:(id)sender {
|
||||
[self.libraryWindowController.libraryViewController.libraryController importCape:[[MCCursorLibrary alloc] init]];
|
||||
}
|
||||
|
||||
- (IBAction)openDocument:(id)sender {
|
||||
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
||||
panel.allowedFileTypes = @[ @"cape" ];
|
||||
panel.title = @"Import";
|
||||
panel.message = @"Choose a Mousecape to import";
|
||||
panel.prompt = @"Import";
|
||||
if ([panel runModal] == NSFileHandlingPanelOKButton) {
|
||||
[self.libraryWindowController.libraryViewController.libraryController importCapeAtURL:panel.URL];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)showPreferences:(id)sender {
|
||||
[self.preferencesWindowController showWindow:sender];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,84 @@
|
||||
<?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>en</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>cape</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Mouse Cape</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>com.alexzielenski.mousecape.cape</string>
|
||||
</array>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.alexzielenski.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.0.6</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1656</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2014-2019 Alex Zielenski. All rights reserved.</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>SUEnableAutomaticChecks</key>
|
||||
<true/>
|
||||
<key>SUFeedURL</key>
|
||||
<string>https://raw.githubusercontent.com/alexzielenski/Mousecape/master/appcast.xml</string>
|
||||
<key>UTExportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.xml</string>
|
||||
<string>com.apple.property-list</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Mouse Cape</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.alexzielenski.mousecape.cape</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>com.apple.ostype</key>
|
||||
<array>
|
||||
<string>CAPE</string>
|
||||
</array>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>cape</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// Prefix header
|
||||
//
|
||||
// The contents of this file are implicitly included at the beginning of every source file.
|
||||
//
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MCDefs.h"
|
||||
#import "MCPrefs.h"
|
||||
#endif
|
||||
@@ -0,0 +1,22 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf200
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\vieww9600\viewh8400\viewkind0
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
|
||||
|
||||
\f0\b\fs24 \cf0 Engineering:
|
||||
\b0 \
|
||||
Alex Zielenski\
|
||||
{\field{\*\fldinst{HYPERLINK "http://alexzielenski.com"}}{\fldrslt http://alexzielenski.com}}\
|
||||
\
|
||||
|
||||
\b Testing:
|
||||
\b0 \
|
||||
Justin Ayles\
|
||||
\
|
||||
|
||||
\b With special thanks to:
|
||||
\b0 \
|
||||
{\field{\*\fldinst{HYPERLINK "http://maxrudberg.com"}}{\fldrslt Max Rudberg}}\
|
||||
Mom & Dad\
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
Created by Jonathan Willing on 8/28/13.
|
||||
Copyright (c) 2013, ButterKit. All rights reserved.
|
||||
Licensed under the MIT license <http://opensource.org/licenses/MIT>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
||||
to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
||||
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
// A NSClipView subclass with a buttery -scrollToRect: animation.
|
||||
@interface BTRClipView : NSClipView
|
||||
|
||||
// Calls -scrollRectToVisible:, optionally animated.
|
||||
//
|
||||
// If animated, the animation will be performed with an ease-out timing function.
|
||||
// Any calls to this method while an animation is still in flight will update the
|
||||
// current animation and adjust the deceleration as needed.
|
||||
//
|
||||
// Any input to the scroll view that would cause an adjustment to the bounds (such as
|
||||
// a trackpad scroll) will cancel any animations in progress.
|
||||
- (BOOL)scrollRectToVisible:(CGRect)rect animated:(BOOL)animated;
|
||||
|
||||
// Calls -scrollRectToVisible:animated: with an optional completion block. The scrolled
|
||||
// completion parameter is whether any scrolling was performed.
|
||||
- (BOOL)scrollRectToVisible:(CGRect)rect animated:(BOOL)animated completion:(void (^)(BOOL scrolled))completion;
|
||||
|
||||
// Any time the origin changes with an animation as discussed above, the deceleration
|
||||
// rate will be used to create an ease-out animation.
|
||||
//
|
||||
// Values should range from (0, 1]. Smaller deceleration rates will provide
|
||||
// generally fast animations, whereas larger rates will create lengthy animations.
|
||||
//
|
||||
// Defaults to 0.78.
|
||||
@property (nonatomic, assign) CGFloat decelerationRate;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,221 @@
|
||||
/*
|
||||
Created by Jonathan Willing on 8/28/13.
|
||||
Copyright (c) 2013, ButterKit. All rights reserved.
|
||||
Licensed under the MIT license <http://opensource.org/licenses/MIT>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
||||
to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
||||
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#import "BTRClipView.h"
|
||||
|
||||
// The default deceleration constant used for the ease-out curve in the animation.
|
||||
static const CGFloat BTRClipViewDecelerationRate = 0.78;
|
||||
|
||||
@interface BTRClipView ()
|
||||
// Used to drive the animation through repeated callbacks.
|
||||
// A display link is used instead of a timer so that we don't get dropped frames and tearing.
|
||||
// Lazily created when needed, released in dealloc. Stopped automatically when scrolling is not occurring.
|
||||
@property (nonatomic, assign) CVDisplayLinkRef displayLink;
|
||||
|
||||
// Used to determine whether to animate in `scrollToPoint:`.
|
||||
@property (nonatomic, assign) BOOL shouldAnimateOriginChange;
|
||||
|
||||
// Used when animating with the display link as the final origin for the animation.
|
||||
@property (nonatomic, assign) CGPoint destinationOrigin;
|
||||
|
||||
// The scroll view which has this clip view set as the content view.
|
||||
@property (nonatomic, assign) NSScrollView *containingScrollView;
|
||||
|
||||
// The optional completion block which is called at the end of the scroll animation.
|
||||
@property (nonatomic, copy) void (^scrollCompletion)(BOOL success);
|
||||
@end
|
||||
|
||||
|
||||
@implementation BTRClipView
|
||||
|
||||
- (instancetype)initWithFrame:(NSRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self == nil) return nil;
|
||||
|
||||
self.wantsLayer = YES;
|
||||
self.decelerationRate = BTRClipViewDecelerationRate;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
CVDisplayLinkRelease(_displayLink);
|
||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
||||
}
|
||||
|
||||
#pragma mark View Heirarchy
|
||||
|
||||
- (void)viewWillMoveToWindow:(NSWindow *)newWindow {
|
||||
if (self.window != nil) {
|
||||
[NSNotificationCenter.defaultCenter removeObserver:self name:NSWindowDidChangeScreenNotification object:self.window];
|
||||
}
|
||||
|
||||
[super viewWillMoveToWindow:newWindow];
|
||||
|
||||
if (newWindow != nil) {
|
||||
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(updateCVDisplay:) name:NSWindowDidChangeScreenNotification object:newWindow];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Display link
|
||||
|
||||
static CVReturn BTRScrollingCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *now, const CVTimeStamp *outputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext) {
|
||||
@autoreleasepool {
|
||||
BTRClipView *clipView = (__bridge id)displayLinkContext;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[clipView updateOrigin];
|
||||
});
|
||||
}
|
||||
|
||||
return kCVReturnSuccess;
|
||||
}
|
||||
|
||||
- (CVDisplayLinkRef)displayLink {
|
||||
if (_displayLink == NULL) {
|
||||
CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink);
|
||||
CVDisplayLinkSetOutputCallback(_displayLink, &BTRScrollingCallback, (__bridge void *)self);
|
||||
[self updateCVDisplay:nil];
|
||||
}
|
||||
|
||||
return _displayLink;
|
||||
}
|
||||
|
||||
- (void)updateCVDisplay:(NSNotification *)note {
|
||||
NSScreen *screen = self.window.screen;
|
||||
if (screen == nil) {
|
||||
NSDictionary *screenDictionary = NSScreen.mainScreen.deviceDescription;
|
||||
NSNumber *screenID = screenDictionary[@"NSScreenNumber"];
|
||||
CGDirectDisplayID displayID = screenID.unsignedIntValue;
|
||||
CVDisplayLinkSetCurrentCGDisplay(_displayLink, displayID);
|
||||
} else {
|
||||
CVDisplayLinkSetCurrentCGDisplay(_displayLink, kCGDirectMainDisplay);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Scrolling
|
||||
|
||||
- (void)scrollToPoint:(NSPoint)newOrigin {
|
||||
// We should only attempt to animate ourselves if we know this point we're scrolling to
|
||||
// was the point determined from a -scrollToRect:animated: call.
|
||||
if (self.shouldAnimateOriginChange) {
|
||||
self.shouldAnimateOriginChange = NO;
|
||||
self.destinationOrigin = newOrigin;
|
||||
[self beginScrolling];
|
||||
} else {
|
||||
// Otherwise, we stop any scrolling that is currently occurring (if needed) and let
|
||||
// super's implementation handle a normal scroll.
|
||||
[self endScrolling];
|
||||
[super scrollToPoint:newOrigin];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)scrollRectToVisible:(NSRect)aRect animated:(BOOL)animated {
|
||||
self.shouldAnimateOriginChange = animated;
|
||||
return [super scrollRectToVisible:aRect];
|
||||
}
|
||||
|
||||
- (BOOL)scrollRectToVisible:(CGRect)rect animated:(BOOL)animated completion:(void (^)(BOOL sucess))completion {
|
||||
self.scrollCompletion = completion;
|
||||
BOOL success = [self scrollRectToVisible:rect animated:animated];
|
||||
|
||||
if (!animated || !success) {
|
||||
[self handleCompletionIfNeededWithSuccess:success];
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
- (void)beginScrolling {
|
||||
if (CVDisplayLinkIsRunning(self.displayLink)) {
|
||||
return;
|
||||
}
|
||||
|
||||
CVDisplayLinkStart(self.displayLink);
|
||||
}
|
||||
|
||||
- (void)endScrolling {
|
||||
if (!CVDisplayLinkIsRunning(self.displayLink)) {
|
||||
return;
|
||||
}
|
||||
|
||||
CVDisplayLinkStop(self.displayLink);
|
||||
}
|
||||
|
||||
// Sanitize the deceleration rate to [0, 1] so nothing unexpected happens.
|
||||
- (void)setDecelerationRate:(CGFloat)decelerationRate {
|
||||
if (decelerationRate > 1) {
|
||||
decelerationRate = 1;
|
||||
}
|
||||
else if (decelerationRate < 0) {
|
||||
decelerationRate = 0;
|
||||
}
|
||||
_decelerationRate = decelerationRate;
|
||||
}
|
||||
|
||||
- (NSScrollView *)containingScrollView {
|
||||
if (_containingScrollView == nil) {
|
||||
_containingScrollView = self.enclosingScrollView;
|
||||
if (_containingScrollView == nil && [self.superview isKindOfClass:NSScrollView.class]) {
|
||||
_containingScrollView = (NSScrollView *)self.superview;
|
||||
}
|
||||
}
|
||||
|
||||
return _containingScrollView;
|
||||
}
|
||||
|
||||
- (void)updateOrigin {
|
||||
if (self.window == nil) {
|
||||
[self endScrolling];
|
||||
return;
|
||||
}
|
||||
|
||||
CGPoint o = self.bounds.origin;
|
||||
CGPoint lastOrigin = o;
|
||||
CGFloat deceleration = self.decelerationRate;
|
||||
|
||||
// Calculate the next origin on a basic ease-out curve.
|
||||
o.x = o.x * deceleration + self.destinationOrigin.x * (1 - self.decelerationRate);
|
||||
o.y = o.y * deceleration + self.destinationOrigin.y * (1 - self.decelerationRate);
|
||||
|
||||
// Calling -scrollToPoint: instead of manually adjusting the bounds lets us get the expected
|
||||
// overlay scroller behavior for free.
|
||||
[super scrollToPoint:o];
|
||||
|
||||
// Make this call so that we can force an update of the scroller positions.
|
||||
[self.containingScrollView reflectScrolledClipView:self];
|
||||
|
||||
if ((fabs(o.x - lastOrigin.x) < 0.1 && fabs(o.y - lastOrigin.y) < 0.1)) {
|
||||
[self endScrolling];
|
||||
|
||||
// Make sure we always finish out the animation with the actual coordinates
|
||||
[super scrollToPoint:o];
|
||||
[self handleCompletionIfNeededWithSuccess:YES];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Completion handling
|
||||
|
||||
- (void)handleCompletionIfNeededWithSuccess:(BOOL)success {
|
||||
if (self.scrollCompletion != nil) {
|
||||
self.scrollCompletion(success);
|
||||
self.scrollCompletion = nil;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
Created by Jonathan Willing on 8/28/13.
|
||||
Copyright (c) 2013, ButterKit. All rights reserved.
|
||||
Licensed under the MIT license <http://opensource.org/licenses/MIT>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
||||
to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
||||
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "BTRClipView.h"
|
||||
|
||||
// A NSScrollView subclass which uses an instance of BTRClipView
|
||||
// as the clip view instead of NSClipView.
|
||||
//
|
||||
// Layer-backed by default.
|
||||
@interface BTRScrollView : NSScrollView
|
||||
|
||||
// Returns the scroll view's content view that is an instance of BTRClipView, or
|
||||
// nil if it does not exist.
|
||||
- (BTRClipView *)clipView;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
Created by Jonathan Willing on 8/28/13.
|
||||
Copyright (c) 2013, ButterKit. All rights reserved.
|
||||
Licensed under the MIT license <http://opensource.org/licenses/MIT>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
||||
to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
||||
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#import "BTRScrollView.h"
|
||||
#import "BTRClipView.h"
|
||||
|
||||
@implementation BTRScrollView
|
||||
|
||||
#pragma mark Lifecycle
|
||||
|
||||
- (id)initWithFrame:(NSRect)frameRect {
|
||||
self = [super initWithFrame:frameRect];
|
||||
if (self == nil) return nil;
|
||||
|
||||
[self swapClipView];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
|
||||
if (![self.contentView isKindOfClass:BTRClipView.class]) {
|
||||
[self swapClipView];
|
||||
}
|
||||
}
|
||||
|
||||
- (BTRClipView *)clipView {
|
||||
if ([self.contentView isKindOfClass:BTRClipView.class]) {
|
||||
return (BTRClipView *)self.contentView;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
#pragma mark Clip view swapping
|
||||
|
||||
- (void)swapClipView {
|
||||
self.wantsLayer = YES;
|
||||
id documentView = self.documentView;
|
||||
BTRClipView *clipView = [[BTRClipView alloc] initWithFrame:self.contentView.frame];
|
||||
self.contentView = clipView;
|
||||
self.documentView = documentView;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// DTScrollView.h
|
||||
// iCatalogEditor
|
||||
//
|
||||
// Created by Oliver Drobnik on 10/23/12.
|
||||
// Copyright (c) 2012 Cocoanetics. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RBLScrollView.h"
|
||||
|
||||
/**
|
||||
A scroll view that forwards scroll events up the responder chain if scrolling is along an axis that no scroll bar is shown for. This is useful to have a horizontal scroll view contained in a vertical one. To enable, set usesPredominantAxisScrolling to YES and hide the scroll bar for the axis you don't want to support.
|
||||
*/
|
||||
@interface DTScrollView : RBLScrollView
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// DTScrollView.m
|
||||
// iCatalogEditor
|
||||
//
|
||||
// Created by Oliver Drobnik on 10/23/12.
|
||||
// Copyright (c) 2012 Cocoanetics. All rights reserved.
|
||||
//
|
||||
|
||||
#import "DTScrollView.h"
|
||||
|
||||
@implementation DTScrollView
|
||||
|
||||
- (void)scrollWheel:(NSEvent *)theEvent {
|
||||
|
||||
BOOL shouldForwardScroll = NO;
|
||||
|
||||
if (self.usesPredominantAxisScrolling) {
|
||||
if (fabs(theEvent.deltaX) < fabs(theEvent.deltaY)) {
|
||||
// vertical scroll
|
||||
if (!self.hasVerticalScroller) {
|
||||
shouldForwardScroll = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldForwardScroll) {
|
||||
[[self nextResponder] scrollWheel:theEvent];
|
||||
} else {
|
||||
[super scrollWheel:theEvent];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// Any controller providing preference pane view must support this protocol
|
||||
//
|
||||
|
||||
@protocol MASPreferencesViewController <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
- (void)viewWillAppear;
|
||||
- (void)viewDidDisappear;
|
||||
- (NSView *)initialKeyView;
|
||||
|
||||
@property (nonatomic, readonly) BOOL hasResizableWidth;
|
||||
@property (nonatomic, readonly) BOOL hasResizableHeight;
|
||||
|
||||
@required
|
||||
|
||||
@property (nonatomic, readonly) NSString *identifier;
|
||||
@property (nonatomic, readonly) NSImage *toolbarItemImage;
|
||||
@property (nonatomic, readonly) NSString *toolbarItemLabel;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,271 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1090</int>
|
||||
<string key="IBDocument.SystemVersion">14A261i</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">6154.17</string>
|
||||
<string key="IBDocument.AppKitVersion">1321.11</string>
|
||||
<string key="IBDocument.HIToolboxVersion">737.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">6154.17</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>NSCustomObject</string>
|
||||
<string>NSToolbar</string>
|
||||
<string>NSView</string>
|
||||
<string>NSWindowTemplate</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">MASPreferencesWindowController</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">11</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{540, 400}, {360, 270}}</string>
|
||||
<int key="NSWTFlags">1618478080</int>
|
||||
<string key="NSWindowTitle"/>
|
||||
<string key="NSWindowClass">NSPanel</string>
|
||||
<object class="NSToolbar" key="NSViewClass" id="693562270">
|
||||
<string key="NSToolbarIdentifier">45E11247-C0D1-4D0A-A5E9-F1307B14CEF7</string>
|
||||
<nil key="NSToolbarDelegate"/>
|
||||
<bool key="NSToolbarPrefersToBeShown">YES</bool>
|
||||
<bool key="NSToolbarShowsBaselineSeparator">YES</bool>
|
||||
<bool key="NSToolbarAllowsUserCustomization">NO</bool>
|
||||
<bool key="NSToolbarAutosavesConfiguration">NO</bool>
|
||||
<int key="NSToolbarDisplayMode">1</int>
|
||||
<int key="NSToolbarSizeMode">1</int>
|
||||
<dictionary class="NSMutableDictionary" key="NSToolbarIBIdentifiedItems"/>
|
||||
<array key="NSToolbarIBAllowedItems" id="0"/>
|
||||
<reference key="NSToolbarIBDefaultItems" ref="0"/>
|
||||
<reference key="NSToolbarIBSelectableItems" ref="0"/>
|
||||
</object>
|
||||
<nil key="NSUserInterfaceItemIdentifier"/>
|
||||
<object class="NSView" key="NSWindowView" id="1006">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<string key="NSFrameSize">{360, 270}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {2560, 1417}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<string key="NSFrameAutosaveName"/>
|
||||
<bool key="NSWindowIsRestorable">YES</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">toolbar</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="693562270"/>
|
||||
</object>
|
||||
<int key="connectionID">23</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">20</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="693562270"/>
|
||||
<reference key="destination" ref="1001"/>
|
||||
</object>
|
||||
<int key="connectionID">22</int>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<reference key="object" ref="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"/>
|
||||
<reference ref="693562270"/>
|
||||
</array>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">2</int>
|
||||
<reference key="object" ref="1006"/>
|
||||
<reference key="parent" ref="1005"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="693562270"/>
|
||||
<reference key="parent" ref="1005"/>
|
||||
</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="NO" key="1.IBNSWindowAutoPositionCentersHorizontal"/>
|
||||
<boolean value="NO" key="1.IBNSWindowAutoPositionCentersVertical"/>
|
||||
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1.IBWindowTemplateEditedContentRect">{{484, 402}, {360, 270}}</string>
|
||||
<boolean value="NO" key="1.NSWindowTemplate.visibleAtLaunch"/>
|
||||
<string key="2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="4.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">27</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">FirstResponder</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBUserSource</string>
|
||||
<string key="minorKey"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">MASPreferencesWindowController</string>
|
||||
<string key="superclassName">NSWindowController</string>
|
||||
<dictionary class="NSMutableDictionary" key="actions">
|
||||
<string key="goNextTab:">id</string>
|
||||
<string key="goPreviousTab:">id</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="actionInfosByName">
|
||||
<object class="IBActionInfo" key="goNextTab:" id="26850041">
|
||||
<string key="name">goNextTab:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo" key="goPreviousTab:" id="235845889">
|
||||
<string key="name">goPreviousTab:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</dictionary>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">toolbar</string>
|
||||
<string key="NS.object.0">NSToolbar</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">toolbar</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0" id="206441091">
|
||||
<string key="name">toolbar</string>
|
||||
<string key="candidateClassName">NSToolbar</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">../Mousecape/external/MASPreferences/MASPreferencesWindowController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">MASPreferencesWindowController</string>
|
||||
<dictionary class="NSMutableDictionary" key="actions">
|
||||
<string key="goNextTab:">id</string>
|
||||
<string key="goPreviousTab:">id</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="actionInfosByName">
|
||||
<object class="IBActionInfo" key="goNextTab:">
|
||||
<string key="name">goNextTab:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo" key="goPreviousTab:">
|
||||
<string key="name">goPreviousTab:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</dictionary>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">../Mousecape/external/MASPreferences/MASPreferencesWindowController.m</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">MASPreferencesWindowController</string>
|
||||
<string key="superclassName">NSWindowController</string>
|
||||
<dictionary class="NSMutableDictionary" key="actions">
|
||||
<string key="goNextTab:">id</string>
|
||||
<string key="goPreviousTab:">id</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="actionInfosByName">
|
||||
<reference key="goNextTab:" ref="26850041"/>
|
||||
<reference key="goPreviousTab:" ref="235845889"/>
|
||||
</dictionary>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">toolbar</string>
|
||||
<string key="NS.object.0">NSToolbar</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">toolbar</string>
|
||||
<reference key="NS.object.0" ref="206441091"/>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/MASPreferencesWindowController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
|
||||
<bool key="IBDocument.previouslyAttemptedUpgradeToXcode5">NO</bool>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
|
||||
<integer value="4600" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
</data>
|
||||
</archive>
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// You create an application Preferences window using code like this:
|
||||
// _preferencesWindowController = [[MASPreferencesWindowController alloc] initWithViewControllers:controllers
|
||||
// title:title]
|
||||
//
|
||||
// To open the Preferences window:
|
||||
// [_preferencesWindowController showWindow:sender]
|
||||
//
|
||||
|
||||
#import "MASPreferencesViewController.h"
|
||||
|
||||
extern NSString *const kMASPreferencesWindowControllerDidChangeViewNotification;
|
||||
|
||||
__attribute__((__visibility__("default")))
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
|
||||
@interface MASPreferencesWindowController : NSWindowController <NSToolbarDelegate, NSWindowDelegate>
|
||||
#else
|
||||
@interface MASPreferencesWindowController : NSWindowController
|
||||
#endif
|
||||
{
|
||||
@private
|
||||
NSMutableArray *_viewControllers;
|
||||
NSMutableDictionary *_minimumViewRects;
|
||||
NSString *_title;
|
||||
NSViewController <MASPreferencesViewController> *_selectedViewController;
|
||||
IBOutlet NSToolbar *toolbar;
|
||||
}
|
||||
|
||||
@property (nonatomic, readonly) NSMutableArray *viewControllers;
|
||||
@property (nonatomic, readonly) NSUInteger indexOfSelectedController;
|
||||
@property (nonatomic, readonly, retain) NSViewController <MASPreferencesViewController> *selectedViewController;
|
||||
@property (nonatomic, readonly) NSString *title;
|
||||
@property (nonatomic, retain) IBOutlet NSToolbar *toolbar;
|
||||
|
||||
- (id)initWithViewControllers:(NSArray *)viewControllers;
|
||||
- (id)initWithViewControllers:(NSArray *)viewControllers title:(NSString *)title;
|
||||
- (void)addViewController:(NSViewController <MASPreferencesViewController> *) viewController;
|
||||
|
||||
- (void)selectControllerAtIndex:(NSUInteger)controllerIndex;
|
||||
|
||||
- (IBAction)goNextTab:(id)sender;
|
||||
- (IBAction)goPreviousTab:(id)sender;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,359 @@
|
||||
#import "MASPreferencesWindowController.h"
|
||||
|
||||
NSString *const kMASPreferencesWindowControllerDidChangeViewNotification = @"MASPreferencesWindowControllerDidChangeViewNotification";
|
||||
|
||||
static NSString *const kMASPreferencesFrameTopLeftKey = @"MASPreferences Frame Top Left";
|
||||
static NSString *const kMASPreferencesSelectedViewKey = @"MASPreferences Selected Identifier View";
|
||||
|
||||
static NSString *const PreferencesKeyForViewBounds (NSString *identifier)
|
||||
{
|
||||
return [NSString stringWithFormat:@"MASPreferences %@ Frame", identifier];
|
||||
}
|
||||
|
||||
@interface MASPreferencesWindowController () // Private
|
||||
|
||||
- (NSViewController <MASPreferencesViewController> *)viewControllerForIdentifier:(NSString *)identifier;
|
||||
|
||||
@property (readonly) NSArray *toolbarItemIdentifiers;
|
||||
@property (nonatomic, retain) NSViewController <MASPreferencesViewController> *selectedViewController;
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark -
|
||||
|
||||
@implementation MASPreferencesWindowController
|
||||
|
||||
@synthesize viewControllers = _viewControllers;
|
||||
@synthesize selectedViewController = _selectedViewController;
|
||||
@synthesize title = _title;
|
||||
@synthesize toolbar = _toolbar;
|
||||
#pragma mark -
|
||||
|
||||
- (id)initWithViewControllers:(NSArray *)viewControllers
|
||||
{
|
||||
return [self initWithViewControllers:viewControllers title:nil];
|
||||
}
|
||||
|
||||
- (id)initWithViewControllers:(NSArray *)viewControllers title:(NSString *)title
|
||||
{
|
||||
if ((self = [super initWithWindowNibName:@"MASPreferencesWindow"]))
|
||||
{
|
||||
_viewControllers = [NSMutableArray arrayWithArray: viewControllers];
|
||||
#if !__has_feature(objc_arc)
|
||||
_viewControllers = [_viewControllers retain];
|
||||
#endif
|
||||
_minimumViewRects = [[NSMutableDictionary alloc] init];
|
||||
_title = [title copy];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[[self window] setDelegate:nil];
|
||||
#if !__has_feature(objc_arc)
|
||||
[_viewControllers release];
|
||||
[_selectedViewController release];
|
||||
[_minimumViewRects release];
|
||||
[_title release];
|
||||
[super dealloc];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)addViewController: (NSViewController <MASPreferencesViewController> *) viewController
|
||||
{
|
||||
[_viewControllers addObject: viewController];
|
||||
[_toolbar insertItemWithItemIdentifier: [viewController identifier] atIndex: ([_viewControllers count] - 1)];
|
||||
[_toolbar validateVisibleItems];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)windowDidLoad
|
||||
{
|
||||
if ([self.title length] > 0)
|
||||
[[self window] setTitle:self.title];
|
||||
|
||||
if ([self.viewControllers count])
|
||||
self.selectedViewController = [self viewControllerForIdentifier:[[NSUserDefaults standardUserDefaults] stringForKey:kMASPreferencesSelectedViewKey]] ?: [self firstViewController];
|
||||
|
||||
NSString *origin = [[NSUserDefaults standardUserDefaults] stringForKey:kMASPreferencesFrameTopLeftKey];
|
||||
if (origin)
|
||||
[self.window setFrameTopLeftPoint:NSPointFromString(origin)];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidMove:) name:NSWindowDidMoveNotification object:self.window];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidResize:) name:NSWindowDidResizeNotification object:self.window];
|
||||
}
|
||||
|
||||
- (NSViewController <MASPreferencesViewController> *)firstViewController {
|
||||
for (id viewController in self.viewControllers)
|
||||
if ([viewController isKindOfClass:[NSViewController class]])
|
||||
return viewController;
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark NSWindowDelegate
|
||||
|
||||
- (BOOL)windowShouldClose:(id)sender
|
||||
{
|
||||
return !self.selectedViewController || [self.selectedViewController commitEditing];
|
||||
}
|
||||
|
||||
- (void)windowDidMove:(NSNotification*)aNotification
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:NSStringFromPoint(NSMakePoint(NSMinX([self.window frame]), NSMaxY([self.window frame]))) forKey:kMASPreferencesFrameTopLeftKey];
|
||||
}
|
||||
|
||||
- (void)windowDidResize:(NSNotification*)aNotification
|
||||
{
|
||||
NSViewController <MASPreferencesViewController> *viewController = self.selectedViewController;
|
||||
if (viewController)
|
||||
[[NSUserDefaults standardUserDefaults] setObject:NSStringFromRect([viewController.view bounds]) forKey:PreferencesKeyForViewBounds(viewController.identifier)];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Accessors
|
||||
|
||||
- (NSArray *)toolbarItemIdentifiers
|
||||
{
|
||||
NSMutableArray *identifiers = [NSMutableArray arrayWithCapacity:_viewControllers.count];
|
||||
for (id viewController in _viewControllers)
|
||||
if (viewController == [NSNull null])
|
||||
[identifiers addObject:NSToolbarFlexibleSpaceItemIdentifier];
|
||||
else
|
||||
[identifiers addObject:[viewController identifier]];
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (NSUInteger)indexOfSelectedController
|
||||
{
|
||||
NSUInteger index = [self.toolbarItemIdentifiers indexOfObject:self.selectedViewController.identifier];
|
||||
return index;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark NSToolbarDelegate
|
||||
|
||||
- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar
|
||||
{
|
||||
NSArray *identifiers = self.toolbarItemIdentifiers;
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar
|
||||
{
|
||||
NSArray *identifiers = self.toolbarItemIdentifiers;
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar
|
||||
{
|
||||
NSArray *identifiers = self.toolbarItemIdentifiers;
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag
|
||||
{
|
||||
NSToolbarItem *toolbarItem = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier];
|
||||
NSArray *identifiers = self.toolbarItemIdentifiers;
|
||||
NSUInteger controllerIndex = [identifiers indexOfObject:itemIdentifier];
|
||||
if (controllerIndex != NSNotFound)
|
||||
{
|
||||
id <MASPreferencesViewController> controller = [_viewControllers objectAtIndex:controllerIndex];
|
||||
toolbarItem.image = controller.toolbarItemImage;
|
||||
toolbarItem.label = controller.toolbarItemLabel;
|
||||
toolbarItem.target = self;
|
||||
toolbarItem.action = @selector(toolbarItemDidClick:);
|
||||
}
|
||||
#if !__has_feature(objc_arc)
|
||||
[toolbarItem autorelease];
|
||||
#endif
|
||||
return toolbarItem;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Private methods
|
||||
|
||||
- (void)clearResponderChain
|
||||
{
|
||||
// Remove view controller from the responder chain
|
||||
NSResponder *chainedController = self.window.nextResponder;
|
||||
if ([self.viewControllers indexOfObject:chainedController] == NSNotFound)
|
||||
return;
|
||||
self.window.nextResponder = chainedController.nextResponder;
|
||||
chainedController.nextResponder = nil;
|
||||
}
|
||||
|
||||
- (void)patchResponderChain
|
||||
{
|
||||
[self clearResponderChain];
|
||||
|
||||
NSViewController *selectedController = self.selectedViewController;
|
||||
if (!selectedController)
|
||||
return;
|
||||
|
||||
// Add current controller to the responder chain
|
||||
NSResponder *nextResponder = self.window.nextResponder;
|
||||
self.window.nextResponder = selectedController;
|
||||
selectedController.nextResponder = nextResponder;
|
||||
}
|
||||
|
||||
- (NSViewController <MASPreferencesViewController> *)viewControllerForIdentifier:(NSString *)identifier
|
||||
{
|
||||
for (id viewController in self.viewControllers) {
|
||||
if (viewController == [NSNull null]) continue;
|
||||
if ([[viewController identifier] isEqualToString:identifier])
|
||||
return viewController;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)setSelectedViewController:(NSViewController <MASPreferencesViewController> *)controller
|
||||
{
|
||||
if (_selectedViewController == controller)
|
||||
return;
|
||||
|
||||
if (_selectedViewController)
|
||||
{
|
||||
// Check if we can commit changes for old controller
|
||||
if (![_selectedViewController commitEditing])
|
||||
{
|
||||
[[self.window toolbar] setSelectedItemIdentifier:_selectedViewController.identifier];
|
||||
return;
|
||||
}
|
||||
|
||||
#if __has_feature(objc_arc)
|
||||
[self.window setContentView:[[NSView alloc] init]];
|
||||
#else
|
||||
[self.window setContentView:[[[NSView alloc] init] autorelease]];
|
||||
#endif
|
||||
if ([_selectedViewController respondsToSelector:@selector(viewDidDisappear)])
|
||||
[_selectedViewController viewDidDisappear];
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
[_selectedViewController release];
|
||||
#endif
|
||||
_selectedViewController = nil;
|
||||
}
|
||||
|
||||
if (!controller)
|
||||
return;
|
||||
|
||||
// Retrieve the new window tile from the controller view
|
||||
if ([self.title length] == 0)
|
||||
{
|
||||
NSString *label = controller.toolbarItemLabel;
|
||||
self.window.title = label;
|
||||
}
|
||||
|
||||
[[self.window toolbar] setSelectedItemIdentifier:controller.identifier];
|
||||
|
||||
// Record new selected controller in user defaults
|
||||
[[NSUserDefaults standardUserDefaults] setObject:controller.identifier forKey:kMASPreferencesSelectedViewKey];
|
||||
|
||||
NSView *controllerView = controller.view;
|
||||
|
||||
// Retrieve current and minimum frame size for the view
|
||||
NSString *oldViewRectString = [[NSUserDefaults standardUserDefaults] stringForKey:PreferencesKeyForViewBounds(controller.identifier)];
|
||||
NSString *minViewRectString = [_minimumViewRects objectForKey:controller.identifier];
|
||||
if (!minViewRectString)
|
||||
[_minimumViewRects setObject:NSStringFromRect(controllerView.bounds) forKey:controller.identifier];
|
||||
|
||||
BOOL sizableWidth = ([controller respondsToSelector:@selector(hasResizableWidth)]
|
||||
? controller.hasResizableWidth
|
||||
: controllerView.autoresizingMask & NSViewWidthSizable);
|
||||
BOOL sizableHeight = ([controller respondsToSelector:@selector(hasResizableHeight)]
|
||||
? controller.hasResizableHeight
|
||||
: controllerView.autoresizingMask & NSViewHeightSizable);
|
||||
|
||||
NSRect oldViewRect = oldViewRectString ? NSRectFromString(oldViewRectString) : controllerView.bounds;
|
||||
NSRect minViewRect = minViewRectString ? NSRectFromString(minViewRectString) : controllerView.bounds;
|
||||
oldViewRect.size.width = NSWidth(oldViewRect) < NSWidth(minViewRect) || !sizableWidth ? NSWidth(minViewRect) : NSWidth(oldViewRect);
|
||||
oldViewRect.size.height = NSHeight(oldViewRect) < NSHeight(minViewRect) || !sizableHeight ? NSHeight(minViewRect) : NSHeight(oldViewRect);
|
||||
|
||||
[controllerView setFrame:oldViewRect];
|
||||
|
||||
// Calculate new window size and position
|
||||
NSRect oldFrame = [self.window frame];
|
||||
NSRect newFrame = [self.window frameRectForContentRect:oldViewRect];
|
||||
newFrame = NSOffsetRect(newFrame, NSMinX(oldFrame), NSMaxY(oldFrame) - NSMaxY(newFrame));
|
||||
|
||||
// Setup min/max sizes and show/hide resize indicator
|
||||
[self.window setContentMinSize:minViewRect.size];
|
||||
[self.window setContentMaxSize:NSMakeSize(sizableWidth ? CGFLOAT_MAX : NSWidth(oldViewRect), sizableHeight ? CGFLOAT_MAX : NSHeight(oldViewRect))];
|
||||
[self.window setShowsResizeIndicator:sizableWidth || sizableHeight];
|
||||
[[self.window standardWindowButton:NSWindowZoomButton] setEnabled:sizableWidth || sizableHeight];
|
||||
|
||||
[self.window setFrame:newFrame display:YES animate:[self.window isVisible]];
|
||||
|
||||
#if __has_feature(objc_arc)
|
||||
_selectedViewController = controller;
|
||||
#else
|
||||
_selectedViewController = [controller retain];
|
||||
#endif
|
||||
if ([controller respondsToSelector:@selector(viewWillAppear)])
|
||||
[controller viewWillAppear];
|
||||
|
||||
[self.window setContentView:controllerView];
|
||||
[self.window recalculateKeyViewLoop];
|
||||
if ([self.window firstResponder] == self.window) {
|
||||
if ([controller respondsToSelector:@selector(initialKeyView)])
|
||||
[self.window makeFirstResponder:[controller initialKeyView]];
|
||||
else
|
||||
[self.window selectKeyViewFollowingView:controllerView];
|
||||
}
|
||||
|
||||
// Insert view controller into responder chain
|
||||
[self patchResponderChain];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kMASPreferencesWindowControllerDidChangeViewNotification object:self];
|
||||
}
|
||||
|
||||
- (void)toolbarItemDidClick:(id)sender
|
||||
{
|
||||
if ([sender respondsToSelector:@selector(itemIdentifier)])
|
||||
self.selectedViewController = [self viewControllerForIdentifier:[sender itemIdentifier]];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Public methods
|
||||
|
||||
- (void)selectControllerAtIndex:(NSUInteger)controllerIndex
|
||||
{
|
||||
if (NSLocationInRange(controllerIndex, NSMakeRange(0, _viewControllers.count)))
|
||||
self.selectedViewController = [self.viewControllers objectAtIndex:controllerIndex];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Actions
|
||||
|
||||
- (IBAction)goNextTab:(id)sender
|
||||
{
|
||||
NSUInteger selectedIndex = self.indexOfSelectedController;
|
||||
NSUInteger numberOfControllers = [_viewControllers count];
|
||||
|
||||
do { selectedIndex = (selectedIndex + 1) % numberOfControllers; }
|
||||
while ([_viewControllers objectAtIndex:selectedIndex] == [NSNull null]);
|
||||
|
||||
[self selectControllerAtIndex:selectedIndex];
|
||||
}
|
||||
|
||||
- (IBAction)goPreviousTab:(id)sender
|
||||
{
|
||||
NSUInteger selectedIndex = self.indexOfSelectedController;
|
||||
NSUInteger numberOfControllers = [_viewControllers count];
|
||||
|
||||
do { selectedIndex = (selectedIndex + numberOfControllers - 1) % numberOfControllers; }
|
||||
while ([_viewControllers objectAtIndex:selectedIndex] == [NSNull null]);
|
||||
|
||||
[self selectControllerAtIndex:selectedIndex];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// NSColor+RBLCGColorAdditions.h
|
||||
// Rebel
|
||||
//
|
||||
// Created by Justin Spahr-Summers on 01.12.11.
|
||||
// Copyright (c) 2012 GitHub. All rights reserved.
|
||||
//
|
||||
// Portions copyright (c) 2011 Bitswift. All rights reserved.
|
||||
// See the LICENSE file for more information.
|
||||
//
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
// Extensions to NSColor for interoperability with CGColor.
|
||||
@interface NSColor (RBLCGColorAdditions)
|
||||
|
||||
// The CGColor corresponding to the receiver.
|
||||
@property (nonatomic, readonly) CGColorRef rbl_CGColor;
|
||||
|
||||
// Returns an NSColor corresponding to the given CGColor.
|
||||
//
|
||||
// This currently does not handle pattern colors.
|
||||
+ (NSColor *)rbl_colorWithCGColor:(CGColorRef)color;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,92 @@
|
||||
//
|
||||
// NSColor+RBLCGColorAdditions.m
|
||||
// Rebel
|
||||
//
|
||||
// Created by Justin Spahr-Summers on 01.12.11.
|
||||
// Copyright (c) 2012 GitHub. All rights reserved.
|
||||
//
|
||||
// Portions copyright (c) 2011 Bitswift. All rights reserved.
|
||||
// See the LICENSE file for more information.
|
||||
//
|
||||
|
||||
#import "NSColor+RBLCGColorAdditions.h"
|
||||
|
||||
static void drawCGImagePattern (void *info, CGContextRef context) {
|
||||
CGImageRef image = info;
|
||||
|
||||
size_t width = CGImageGetWidth(image);
|
||||
size_t height = CGImageGetHeight(image);
|
||||
|
||||
CGContextDrawImage(context, CGRectMake(0, 0, width, height), image);
|
||||
}
|
||||
|
||||
static void releasePatternInfo (void *info) {
|
||||
CFRelease(info);
|
||||
}
|
||||
|
||||
@implementation NSColor (RBLCGColorAdditions)
|
||||
|
||||
+ (NSColor *)rbl_colorWithCGColor:(CGColorRef)color {
|
||||
if (color == nil) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
CGColorSpaceRef colorSpaceRef = CGColorGetColorSpace(color);
|
||||
|
||||
NSColorSpace *colorSpace = [[NSColorSpace alloc] initWithCGColorSpace:colorSpaceRef];
|
||||
NSColor *result = [self colorWithColorSpace:colorSpace components:CGColorGetComponents(color) count:(size_t)CGColorGetNumberOfComponents(color)];
|
||||
[colorSpace release];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (CGColorRef)rbl_CGColor {
|
||||
if ([self.colorSpaceName isEqualToString:NSPatternColorSpace]) {
|
||||
CGImageRef patternImage = [self.patternImage CGImageForProposedRect:NULL context:nil hints:nil];
|
||||
if (patternImage == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t width = CGImageGetWidth(patternImage);
|
||||
size_t height = CGImageGetHeight(patternImage);
|
||||
|
||||
CGRect patternBounds = CGRectMake(0, 0, width, height);
|
||||
CGPatternRef pattern = CGPatternCreate(
|
||||
// Released in releasePatternInfo().
|
||||
(void *)CFRetain(patternImage),
|
||||
patternBounds,
|
||||
CGAffineTransformIdentity,
|
||||
width,
|
||||
height,
|
||||
kCGPatternTilingConstantSpacingMinimalDistortion,
|
||||
YES,
|
||||
&(CGPatternCallbacks){
|
||||
.version = 0,
|
||||
.drawPattern = &drawCGImagePattern,
|
||||
.releaseInfo = &releasePatternInfo
|
||||
}
|
||||
);
|
||||
|
||||
CGColorSpaceRef colorSpaceRef = CGColorSpaceCreatePattern(NULL);
|
||||
|
||||
CGColorRef result = CGColorCreateWithPattern(colorSpaceRef, pattern, (CGFloat[]){ 1.0 });
|
||||
|
||||
CGColorSpaceRelease(colorSpaceRef);
|
||||
CGPatternRelease(pattern);
|
||||
|
||||
return (CGColorRef)[(id)result autorelease];
|
||||
}
|
||||
|
||||
NSColorSpace *colorSpace = NSColorSpace.genericRGBColorSpace;
|
||||
NSColor *color = [self colorUsingColorSpace:colorSpace];
|
||||
|
||||
CGFloat components[color.numberOfComponents];
|
||||
[color getComponents:components];
|
||||
|
||||
CGColorSpaceRef colorSpaceRef = colorSpace.CGColorSpace;
|
||||
CGColorRef result = CGColorCreate(colorSpaceRef, components);
|
||||
|
||||
return (CGColorRef)[(id)result autorelease];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// RBLClipView.h
|
||||
// Rebel
|
||||
//
|
||||
// Created by Justin Spahr-Summers on 2012-09-14.
|
||||
// Copyright (c) 2012 GitHub. All rights reserved.
|
||||
//
|
||||
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
// A faster NSClipView based on CAScrollLayer.
|
||||
//
|
||||
// This view should be set as the scroll view's contentView as soon as possible
|
||||
// after the scroll view is initialized. For some reason, scroll bars will
|
||||
// disappear on 10.7 (but not 10.8) unless hasHorizontalScroller and
|
||||
// hasVerticalScroller are set _after_ the contentView.
|
||||
@interface RBLClipView : NSClipView
|
||||
|
||||
// The backing layer for this view.
|
||||
@property (nonatomic, strong) CAScrollLayer *layer;
|
||||
|
||||
// Whether the content in this view is opaque.
|
||||
//
|
||||
// Defaults to NO.
|
||||
@property (nonatomic, getter = isOpaque) BOOL opaque;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// RBLClipView.m
|
||||
// Rebel
|
||||
//
|
||||
// Created by Justin Spahr-Summers on 2012-09-14.
|
||||
// Copyright (c) 2012 GitHub. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RBLClipView.h"
|
||||
#import "NSColor+RBLCGColorAdditions.h"
|
||||
|
||||
@implementation RBLClipView
|
||||
|
||||
#pragma mark Properties
|
||||
|
||||
@dynamic layer;
|
||||
|
||||
- (NSColor *)backgroundColor {
|
||||
return [NSColor rbl_colorWithCGColor:self.layer.backgroundColor];
|
||||
}
|
||||
|
||||
- (void)setBackgroundColor:(NSColor *)color {
|
||||
self.layer.backgroundColor = color.rbl_CGColor;
|
||||
}
|
||||
|
||||
- (BOOL)isOpaque {
|
||||
return self.layer.opaque;
|
||||
}
|
||||
|
||||
- (void)setOpaque:(BOOL)opaque {
|
||||
self.layer.opaque = opaque;
|
||||
}
|
||||
|
||||
#pragma mark Lifecycle
|
||||
|
||||
- (id)initWithFrame:(NSRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self == nil) return nil;
|
||||
|
||||
self.layer = [CAScrollLayer layer];
|
||||
self.wantsLayer = YES;
|
||||
|
||||
self.layerContentsRedrawPolicy = NSViewLayerContentsRedrawNever;
|
||||
|
||||
// Matches default NSClipView settings.
|
||||
self.backgroundColor = NSColor.clearColor;
|
||||
self.opaque = NO;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// RBLScrollView.h
|
||||
// Rebel
|
||||
//
|
||||
// Created by Jonathan Willing on 12/4/12.
|
||||
// Copyright (c) 2012 GitHub. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
// A NSScrollView subclass which uses an instance of RBLClipView
|
||||
// as the clip view instead of NSClipView.
|
||||
//
|
||||
// Layer-backed by default.
|
||||
@interface RBLScrollView : NSScrollView
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// RBLScrollView.m
|
||||
// Rebel
|
||||
//
|
||||
// Created by Jonathan Willing on 12/4/12.
|
||||
// Copyright (c) 2012 GitHub. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RBLScrollView.h"
|
||||
#import "RBLClipView.h"
|
||||
|
||||
@implementation RBLScrollView
|
||||
|
||||
#pragma mark Lifecycle
|
||||
|
||||
- (id)initWithFrame:(NSRect)frameRect {
|
||||
self = [super initWithFrame:frameRect];
|
||||
if (self == nil) return nil;
|
||||
|
||||
[self swapClipView];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
|
||||
if (![self.contentView isKindOfClass:RBLClipView.class] ) {
|
||||
[self swapClipView];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Clip view swapping
|
||||
|
||||
- (void)swapClipView {
|
||||
self.wantsLayer = YES;
|
||||
id documentView = self.documentView;
|
||||
RBLClipView *clipView = [[RBLClipView alloc] initWithFrame:self.contentView.frame];
|
||||
self.contentView = clipView;
|
||||
self.documentView = documentView;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// main.m
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/1/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
int main(int argc, const char * argv[]) {
|
||||
@autoreleasepool {
|
||||
return NSApplicationMain(argc, argv);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// NSFileManager+DirectoryLocations.h
|
||||
//
|
||||
// Created by Matt Gallagher on 06 May 2010
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
//
|
||||
// DirectoryLocations is a set of global methods for finding the fixed location
|
||||
// directoriess.
|
||||
//
|
||||
@interface NSFileManager (DirectoryLocations)
|
||||
|
||||
- (NSString *)findOrCreateDirectory:(NSSearchPathDirectory)searchPathDirectory
|
||||
inDomain:(NSSearchPathDomainMask)domainMask
|
||||
appendPathComponent:(NSString *)appendComponent
|
||||
error:(NSError **)errorOut;
|
||||
- (NSString *)applicationSupportDirectory;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,155 @@
|
||||
//
|
||||
// NSFileManager+DirectoryLocations.m
|
||||
//
|
||||
// Created by Matt Gallagher on 06 May 2010
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
|
||||
#import "NSFileManager+DirectoryLocations.h"
|
||||
|
||||
enum
|
||||
{
|
||||
DirectoryLocationErrorNoPathFound,
|
||||
DirectoryLocationErrorFileExistsAtLocation
|
||||
};
|
||||
|
||||
NSString * const DirectoryLocationDomain = @"DirectoryLocationDomain";
|
||||
|
||||
@implementation NSFileManager (DirectoryLocations)
|
||||
|
||||
//
|
||||
// findOrCreateDirectory:inDomain:appendPathComponent:error:
|
||||
//
|
||||
// Method to tie together the steps of:
|
||||
// 1) Locate a standard directory by search path and domain mask
|
||||
// 2) Select the first path in the results
|
||||
// 3) Append a subdirectory to that path
|
||||
// 4) Create the directory and intermediate directories if needed
|
||||
// 5) Handle errors by emitting a proper NSError object
|
||||
//
|
||||
// Parameters:
|
||||
// searchPathDirectory - the search path passed to NSSearchPathForDirectoriesInDomains
|
||||
// domainMask - the domain mask passed to NSSearchPathForDirectoriesInDomains
|
||||
// appendComponent - the subdirectory appended
|
||||
// errorOut - any error from file operations
|
||||
//
|
||||
// returns the path to the directory (if path found and exists), nil otherwise
|
||||
//
|
||||
- (NSString *)findOrCreateDirectory:(NSSearchPathDirectory)searchPathDirectory
|
||||
inDomain:(NSSearchPathDomainMask)domainMask
|
||||
appendPathComponent:(NSString *)appendComponent
|
||||
error:(NSError **)errorOut
|
||||
{
|
||||
//
|
||||
// Search for the path
|
||||
//
|
||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(
|
||||
searchPathDirectory,
|
||||
domainMask,
|
||||
YES);
|
||||
if ([paths count] == 0)
|
||||
{
|
||||
if (errorOut)
|
||||
{
|
||||
NSDictionary *userInfo =
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
NSLocalizedStringFromTable(
|
||||
@"No path found for directory in domain.",
|
||||
@"Errors",
|
||||
nil),
|
||||
NSLocalizedDescriptionKey,
|
||||
[NSNumber numberWithInteger:searchPathDirectory],
|
||||
@"NSSearchPathDirectory",
|
||||
[NSNumber numberWithInteger:domainMask],
|
||||
@"NSSearchPathDomainMask",
|
||||
nil];
|
||||
*errorOut =
|
||||
[NSError
|
||||
errorWithDomain:DirectoryLocationDomain
|
||||
code:DirectoryLocationErrorNoPathFound
|
||||
userInfo:userInfo];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
//
|
||||
// Normally only need the first path returned
|
||||
//
|
||||
NSString *resolvedPath = [paths objectAtIndex:0];
|
||||
|
||||
//
|
||||
// Append the extra path component
|
||||
//
|
||||
if (appendComponent)
|
||||
{
|
||||
resolvedPath = [resolvedPath
|
||||
stringByAppendingPathComponent:appendComponent];
|
||||
}
|
||||
|
||||
//
|
||||
// Create the path if it doesn't exist
|
||||
//
|
||||
NSError *error = nil;
|
||||
BOOL success = [self
|
||||
createDirectoryAtPath:resolvedPath
|
||||
withIntermediateDirectories:YES
|
||||
attributes:nil
|
||||
error:&error];
|
||||
if (!success)
|
||||
{
|
||||
if (errorOut)
|
||||
{
|
||||
*errorOut = error;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
//
|
||||
// If we've made it this far, we have a success
|
||||
//
|
||||
if (errorOut)
|
||||
{
|
||||
*errorOut = nil;
|
||||
}
|
||||
return resolvedPath;
|
||||
}
|
||||
|
||||
//
|
||||
// applicationSupportDirectory
|
||||
//
|
||||
// Returns the path to the applicationSupportDirectory (creating it if it doesn't
|
||||
// exist).
|
||||
//
|
||||
- (NSString *)applicationSupportDirectory
|
||||
{
|
||||
NSString *executableName =
|
||||
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleExecutable"];
|
||||
NSError *error;
|
||||
NSString *result =
|
||||
[self
|
||||
findOrCreateDirectory:NSApplicationSupportDirectory
|
||||
inDomain:NSUserDomainMask
|
||||
appendPathComponent:executableName
|
||||
error:&error];
|
||||
if (!result)
|
||||
{
|
||||
NSLog(@"Unable to find or create application support directory:\n%@", error);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// NSOrderedSet+AZSortedInsert.h
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 6/26/13.
|
||||
// Copyright (c) 2013 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
// Adapted from NSArray+CWSortedInsert
|
||||
@interface NSOrderedSet (AZSortedInsert)
|
||||
|
||||
- (NSUInteger)indexForInsertingObject:(id)anObject sortedUsingfunction:(NSInteger (*)(id, id, void *))compare context:(void *)context;
|
||||
- (NSUInteger)indexForInsertingObject:(id)anObject sortedUsingComparator:(NSComparator)comparator;
|
||||
- (NSUInteger)indexForInsertingObject:(id)anObject sortedUsingSelector:(SEL)aSelector;
|
||||
- (NSUInteger)indexForInsertingObject:(id)anObject sortedUsingDescriptors:(NSArray *)descriptors;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSMutableOrderedSet (AZSortedInsert)
|
||||
|
||||
- (void)insertObject:(id)anObject sortedUsingfunction:(NSInteger (*)(id, id, void *))compare context:(void *)context;
|
||||
- (void)insertObject:(id)anObject sortedUsingSelector:(SEL)aSelector;
|
||||
- (void)insertObject:(id)anObject sortedUsingDescriptors:(NSArray *)descriptors;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,89 @@
|
||||
//
|
||||
// NSOrderedSet+AZSortedInsert.m
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 6/26/13.
|
||||
// Copyright (c) 2013 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSOrderedSet+AZSortedInsert.h"
|
||||
#import <objc/message.h>
|
||||
|
||||
@implementation NSOrderedSet (AZSortedInsert)
|
||||
|
||||
- (NSUInteger)indexForInsertingObject:(id)anObject sortedUsingfunction:(NSInteger (*)(id, id, void *))compare context:(void *)context; {
|
||||
NSUInteger index = 0;
|
||||
NSUInteger topIndex = [self count];
|
||||
IMP objectAtIndexImp = [self methodForSelector:@selector(objectAtIndex:)];
|
||||
while (index < topIndex) {
|
||||
NSUInteger midIndex = (index + topIndex) / 2;
|
||||
id testObject = objectAtIndexImp(self, @selector(objectAtIndex:), midIndex);
|
||||
if (compare(anObject, testObject, context) > 0) {
|
||||
index = midIndex + 1;
|
||||
} else {
|
||||
topIndex = midIndex;
|
||||
}
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
static NSComparisonResult cw_SelectorCompare(id a, id b, void* aSelector) {
|
||||
return (NSComparisonResult)objc_msgSend(a, (SEL)aSelector, b);
|
||||
}
|
||||
|
||||
static NSComparisonResult az_comparatorCompare(id a, id b, NSComparator comparator) {
|
||||
return comparator(a, b);
|
||||
}
|
||||
|
||||
- (NSUInteger)indexForInsertingObject:(id)anObject sortedUsingSelector:(SEL)aSelector; {
|
||||
return [self indexForInsertingObject:anObject sortedUsingfunction:&cw_SelectorCompare context:aSelector];
|
||||
}
|
||||
|
||||
- (NSUInteger)indexForInsertingObject:(id)anObject sortedUsingComparator:(NSComparator)comparator {
|
||||
return [self indexForInsertingObject:anObject sortedUsingfunction:(NSInteger (*)(id, id, void *))&az_comparatorCompare context:comparator];
|
||||
}
|
||||
|
||||
static IMP cw_compareObjectToObjectImp = NULL;
|
||||
static IMP cw_ascendingImp = NULL;
|
||||
|
||||
+ (void)initialize; {
|
||||
cw_compareObjectToObjectImp = [NSSortDescriptor instanceMethodForSelector:@selector(compareObject:toObject:)];
|
||||
cw_ascendingImp = [NSSortDescriptor instanceMethodForSelector:@selector(ascending)];
|
||||
}
|
||||
|
||||
static NSComparisonResult cw_DescriptorCompare(id a, id b, void* descriptors) {
|
||||
NSComparisonResult result = NSOrderedSame;
|
||||
for (NSSortDescriptor* sortDescriptor in (NSArray *)descriptors) {
|
||||
result = (NSComparisonResult)cw_compareObjectToObjectImp(sortDescriptor, @selector(compareObject:toObject:), a, b);
|
||||
if (result != NSOrderedSame) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
- (NSUInteger)indexForInsertingObject:(id)anObject sortedUsingDescriptors:(NSArray *)descriptors;
|
||||
{
|
||||
return [self indexForInsertingObject:anObject sortedUsingfunction:&cw_DescriptorCompare context:descriptors];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSMutableOrderedSet (AZSortedInsert)
|
||||
|
||||
- (void)insertObject:(id)anObject sortedUsingfunction:(NSInteger (*)(id, id, void *))compare context:(void *)context; {
|
||||
NSUInteger index = [self indexForInsertingObject:anObject sortedUsingfunction:compare context:context];
|
||||
[self insertObject:anObject atIndex:index];
|
||||
}
|
||||
|
||||
- (void)insertObject:(id)anObject sortedUsingSelector:(SEL)aSelector; {
|
||||
NSUInteger index = [self indexForInsertingObject:anObject sortedUsingfunction:&cw_SelectorCompare context:aSelector];
|
||||
[self insertObject:anObject atIndex:index];
|
||||
}
|
||||
|
||||
- (void)insertObject:(id)anObject sortedUsingDescriptors:(NSArray *)descriptors; {
|
||||
NSUInteger index = [self indexForInsertingObject:anObject sortedUsingDescriptors:descriptors];
|
||||
[self insertObject:anObject atIndex:index];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// MCEditCapeController.h
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/3/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MCCursorLibrary.h"
|
||||
|
||||
@interface MCEditCapeController : NSViewController
|
||||
@property (strong) MCCursorLibrary *cursorLibrary;
|
||||
@end
|
||||
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// MCEditCapeController.m
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/3/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MCEditCapeController.h"
|
||||
#import "MCLibraryController.h"
|
||||
|
||||
@interface MCEditCapeController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation MCEditCapeController
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
|
||||
// Initialization code here.
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)validateValue:(inout __autoreleasing id *)ioValue forKeyPath:(NSString *)inKeyPath error:(out NSError *__autoreleasing *)outError {
|
||||
if ([inKeyPath isEqualToString:@"cursorLibrary.identifier"]) {
|
||||
BOOL valid = [self.cursorLibrary.library capesWithIdentifier:*ioValue].count == 0;
|
||||
if (!valid) {
|
||||
*outError = [NSError errorWithDomain:MCErrorDomain code:MCErrorMultipleCursorIdentifiersCode userInfo:@{ NSLocalizedDescriptionKey: @"A cape with this identifier already exists" }];
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// MCEditDetailController.h
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/2/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MCCursor.h"
|
||||
#import "MMAnimatingImageView.h"
|
||||
|
||||
@interface MCEditDetailController : NSViewController <MMAnimatingImageViewDelegate>
|
||||
@property (strong) MCCursor *cursor;
|
||||
@property (assign) IBOutlet NSPopUpButton *typePopUpButton;
|
||||
@property (assign) IBOutlet MMAnimatingImageView *rep100View;
|
||||
@property (assign) IBOutlet MMAnimatingImageView *rep200View;
|
||||
@property (assign) IBOutlet MMAnimatingImageView *rep500View;
|
||||
@property (assign) IBOutlet MMAnimatingImageView *rep1000View;
|
||||
@end
|
||||
|
||||
@interface MCCursorTypeValueTransformer : NSValueTransformer
|
||||
@end
|
||||
@@ -0,0 +1,103 @@
|
||||
//
|
||||
// MCEditDetailController.m
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/2/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MCEditDetailController.h"
|
||||
|
||||
@interface MCEditDetailController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation MCEditDetailController
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[self.typePopUpButton addItemsWithTitles:[cursorMap().allValues sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)]];
|
||||
|
||||
NSImage *dropzone = [NSImage imageNamed:@"dropzone"];
|
||||
self.rep100View.placeholderImage = dropzone;
|
||||
self.rep200View.placeholderImage = dropzone;
|
||||
self.rep500View.placeholderImage = dropzone;
|
||||
self.rep1000View.placeholderImage = dropzone;
|
||||
|
||||
self.rep100View.scale = 1.0;
|
||||
self.rep200View.scale = 2.0;
|
||||
self.rep500View.scale = 5.0;
|
||||
self.rep1000View.scale = 10.0;
|
||||
|
||||
[self.rep100View bind:@"image" toObject:self withKeyPath:@"cursor.cursorImage100" options:nil];
|
||||
[self.rep100View bind:@"frameCount" toObject:self withKeyPath:@"cursor.frameCount" options:nil];
|
||||
[self.rep100View bind:@"frameDuration" toObject:self withKeyPath:@"cursor.frameDuration" options:nil];
|
||||
[self.rep100View bind:@"hotSpot" toObject:self withKeyPath:@"cursor.hotSpot" options:nil];
|
||||
|
||||
[self.rep200View bind:@"image" toObject:self withKeyPath:@"cursor.cursorImage200" options:nil];
|
||||
[self.rep200View bind:@"frameCount" toObject:self withKeyPath:@"cursor.frameCount" options:nil];
|
||||
[self.rep200View bind:@"frameDuration" toObject:self withKeyPath:@"cursor.frameDuration" options:nil];
|
||||
[self.rep200View bind:@"hotSpot" toObject:self withKeyPath:@"cursor.hotSpot" options:nil];
|
||||
|
||||
[self.rep500View bind:@"image" toObject:self withKeyPath:@"cursor.cursorImage500" options:nil];
|
||||
[self.rep500View bind:@"frameCount" toObject:self withKeyPath:@"cursor.frameCount" options:nil];
|
||||
[self.rep500View bind:@"frameDuration" toObject:self withKeyPath:@"cursor.frameDuration" options:nil];
|
||||
[self.rep500View bind:@"hotSpot" toObject:self withKeyPath:@"cursor.hotSpot" options:nil];
|
||||
|
||||
[self.rep1000View bind:@"image" toObject:self withKeyPath:@"cursor.cursorImage1000" options:nil];
|
||||
[self.rep1000View bind:@"frameCount" toObject:self withKeyPath:@"cursor.frameCount" options:nil];
|
||||
[self.rep1000View bind:@"frameDuration" toObject:self withKeyPath:@"cursor.frameDuration" options:nil];
|
||||
[self.rep1000View bind:@"hotSpot" toObject:self withKeyPath:@"cursor.hotSpot" options:nil];
|
||||
}
|
||||
|
||||
#pragma mark - MMAnimatingImageView
|
||||
|
||||
- (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 {
|
||||
MCCursorScale scale = cursorScaleForScale(imageView.scale);
|
||||
|
||||
if (NSEvent.modifierFlags == NSAlternateKeyMask) {
|
||||
[self.cursor addFrame:[MCCursor composeRepresentationWithFrames:images] forScale:scale];
|
||||
} else {
|
||||
[self.cursor setRepresentation:[MCCursor composeRepresentationWithFrames:images] forScale:scale];
|
||||
self.cursor.frameCount = images.count;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)imageView:(MMAnimatingImageView *)imageView didDragOutImage:(NSImage *)image {
|
||||
CGFloat scale = imageView.scale;
|
||||
[self.cursor setRepresentation:nil forScale:cursorScaleForScale(scale)];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation MCCursorTypeValueTransformer
|
||||
|
||||
+ (Class)transformedValueClass {
|
||||
return [NSString class];
|
||||
}
|
||||
|
||||
+ (BOOL)allowsReverseTransformation {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (id)transformedValue:(id)value {
|
||||
return nameForCursorIdentifier(value);
|
||||
}
|
||||
|
||||
- (id)reverseTransformedValue:(id)value {
|
||||
return cursorIdentifierForName(value);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// MCEditListController.h
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/2/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MCCursorLibrary.h"
|
||||
@interface MCEditListController : NSViewController <NSTableViewDataSource, NSTableViewDelegate>
|
||||
@property (strong) MCCursorLibrary *cursorLibrary;
|
||||
@property (weak) id selectedObject;
|
||||
@property (assign) IBOutlet NSTableView *tableView;
|
||||
|
||||
- (IBAction)addAction:(id)sender;
|
||||
- (IBAction)removeAction:(id)sender;
|
||||
- (IBAction)duplicateAction:(id)sender;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,201 @@
|
||||
//
|
||||
// MCEditListController.m
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/2/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MCEditListController.h"
|
||||
#import "NSOrderedSet+AZSortedInsert.h"
|
||||
|
||||
const char MCEditCursorsContext;
|
||||
const char MCCursorNameContext;
|
||||
|
||||
@interface MCEditListController ()
|
||||
@property (nonatomic, strong) NSMutableOrderedSet *cursors;
|
||||
+ (NSComparator)sortComparator;
|
||||
- (void)startObservingCursor:(MCCursor *)cursor;
|
||||
- (void)stopObservingCursor:(MCCursor *)cursor;
|
||||
@end
|
||||
|
||||
@implementation MCEditListController
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
[self addObserver:self forKeyPath:@"cursorLibrary.cursors" options:0 context:NULL];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(NSCoder *)coder {
|
||||
if ((self = [super initWithCoder:coder])) {
|
||||
[self addObserver:self forKeyPath:@"cursorLibrary.cursors" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:(void*)&MCEditCursorsContext];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[self removeObserver:self forKeyPath:@"cursorLibrary.cursors" context:(void *)&MCEditCursorsContext];
|
||||
|
||||
for (MCCursor *cursor in self.cursors) {
|
||||
[self stopObservingCursor:cursor];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)startObservingCursor:(MCCursor *)cursor {
|
||||
[cursor addObserver:self forKeyPath:@"name" options:0 context:(void *)&MCCursorNameContext];
|
||||
}
|
||||
|
||||
- (void)stopObservingCursor:(MCCursor *)cursor {
|
||||
[cursor removeObserver:self forKeyPath:@"name" context:(void *)&MCCursorNameContext];
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
||||
if (context == &MCEditCursorsContext) {
|
||||
NSKeyValueChange kind = [change[NSKeyValueChangeKindKey] integerValue];
|
||||
[self.tableView beginUpdates];
|
||||
|
||||
if (kind == NSKeyValueChangeSetting) {
|
||||
id nextSet = change[NSKeyValueChangeNewKey];
|
||||
if ([nextSet isKindOfClass:[NSNull class]]) {
|
||||
self.cursors = [NSMutableOrderedSet orderedSet];
|
||||
} else {
|
||||
self.cursors = [NSMutableOrderedSet orderedSetWithSet:nextSet copyItems:NO];
|
||||
[self.cursors sortUsingComparator:self.class.sortComparator];
|
||||
for (MCCursor *cursor in self.cursors) {
|
||||
[self startObservingCursor:cursor];
|
||||
}
|
||||
}
|
||||
|
||||
[self.tableView reloadData];
|
||||
[self.tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
|
||||
} else if (kind == NSKeyValueChangeInsertion) {
|
||||
for (MCCursor *lib in change[NSKeyValueChangeNewKey]) {
|
||||
NSUInteger index = [self.cursors indexForInsertingObject:lib sortedUsingComparator:self.class.sortComparator];
|
||||
NSIndexSet *indices = [NSIndexSet indexSetWithIndex:index];
|
||||
|
||||
[self willChange:NSKeyValueChangeInsertion valuesAtIndexes:indices forKey:@"cursors"];
|
||||
[self.cursors insertObject:lib atIndex:index];
|
||||
[self startObservingCursor:lib];
|
||||
[self didChange:NSKeyValueChangeInsertion valuesAtIndexes:indices forKey:@"cursors"];
|
||||
[self.tableView insertRowsAtIndexes:[NSIndexSet indexSetWithIndex:index + 1] withAnimation:NSTableViewAnimationSlideUp];
|
||||
}
|
||||
} else if (kind == NSKeyValueChangeRemoval) {
|
||||
for (MCCursor *lib in change[NSKeyValueChangeOldKey]) {
|
||||
NSUInteger index = [self.cursors indexOfObject:lib];
|
||||
|
||||
if (index != NSNotFound) {
|
||||
NSIndexSet *indices = [NSIndexSet indexSetWithIndex:index];
|
||||
[self willChange:NSKeyValueChangeRemoval valuesAtIndexes:indices forKey:@"cursors"];
|
||||
[self stopObservingCursor:lib];
|
||||
[self.cursors removeObjectAtIndex:index];
|
||||
[self didChange:NSKeyValueChangeRemoval valuesAtIndexes:indices forKey:@"cursors"];
|
||||
[self.tableView removeRowsAtIndexes:[NSIndexSet indexSetWithIndex:index + 1] withAnimation:NSTableViewAnimationSlideUp | NSTableViewAnimationEffectFade];
|
||||
}
|
||||
}
|
||||
}
|
||||
[self.tableView endUpdates];
|
||||
} else if (context == &MCCursorNameContext) {
|
||||
// Reorder it
|
||||
MCCursorLibrary *cape = object;
|
||||
NSUInteger oldIndex = [self.cursors indexOfObject:cape];
|
||||
if (oldIndex != NSNotFound) {
|
||||
[self.cursors removeObjectAtIndex:oldIndex];
|
||||
NSUInteger newIndex = [self.cursors indexForInsertingObject:cape sortedUsingComparator:self.class.sortComparator];
|
||||
|
||||
[self.cursors insertObject:cape atIndex:newIndex];
|
||||
[self.tableView moveRowAtIndex:oldIndex + 1 toIndex:newIndex + 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSComparator)sortComparator {
|
||||
static NSComparator sortComparator = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
sortComparator = ^NSComparisonResult(id obj1, id obj2) {
|
||||
return [[obj1 valueForKey:@"name"] localizedCaseInsensitiveCompare:[obj2 valueForKey:@"name"]];
|
||||
};
|
||||
});
|
||||
|
||||
return sortComparator;
|
||||
}
|
||||
|
||||
- (IBAction)addAction:(id)sender {
|
||||
[self.cursorLibrary addCursor:[[MCCursor alloc] init]];
|
||||
}
|
||||
|
||||
- (IBAction)removeAction:(NSMenuItem *)sender {
|
||||
NSInteger row = NSNotFound;
|
||||
if (sender.tag == -1)
|
||||
row = self.tableView.clickedRow;
|
||||
else
|
||||
row = self.tableView.selectedRow;
|
||||
|
||||
if (row > 0)
|
||||
[self.cursorLibrary removeCursor:[[self.tableView viewAtColumn:0 row:row makeIfNecessary:NO] objectValue]];
|
||||
}
|
||||
|
||||
- (IBAction)duplicateAction:(NSMenuItem *)sender {
|
||||
NSUInteger row = NSNotFound;
|
||||
if (sender.tag == -1)
|
||||
row = self.tableView.clickedRow;
|
||||
else
|
||||
row = self.tableView.selectedRow;
|
||||
|
||||
if (row > 0) {
|
||||
MCCursor *cursor = [[[self.tableView viewAtColumn:0 row:row makeIfNecessary:NO] objectValue] copy];
|
||||
cursor.identifier = UUID();
|
||||
[self.cursorLibrary addCursor:cursor];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - NSTableViewDelegate
|
||||
|
||||
- (void)tableViewSelectionDidChange:(NSNotification *)notification {
|
||||
NSInteger selectedRow = [(NSTableView *)self.view selectedRow];
|
||||
if (selectedRow == NSNotFound || selectedRow >= self.cursors.count + 1)
|
||||
return;
|
||||
|
||||
if (selectedRow == 0)
|
||||
self.selectedObject = self.cursorLibrary;
|
||||
else
|
||||
self.selectedObject = [self.cursors objectAtIndex:selectedRow - 1];
|
||||
}
|
||||
|
||||
- (BOOL)tableView:(NSTableView *)tableView isGroupRow:(NSInteger)row {
|
||||
return row == 0;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row {
|
||||
if (row == 0)
|
||||
return 32.0;
|
||||
return 22.0;
|
||||
}
|
||||
|
||||
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
|
||||
NSView *view;
|
||||
if (row == 0)
|
||||
view = [tableView makeViewWithIdentifier:@"MCCursorLibrary" owner:self];
|
||||
else
|
||||
view = [tableView makeViewWithIdentifier:@"MCCursor" owner:self];
|
||||
return view;
|
||||
}
|
||||
|
||||
#pragma mark - NSTableViewDataSource
|
||||
|
||||
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
|
||||
return self.cursors.count + 1;
|
||||
}
|
||||
|
||||
- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
|
||||
if (row == 0)
|
||||
return self.cursorLibrary;
|
||||
return [self.cursors objectAtIndex: row - 1];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// MCEditWindowController.h
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/2/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MCEditDetailController.h"
|
||||
#import "MCEditListController.h"
|
||||
#import "MCEditCapeController.h"
|
||||
#import "MCCursorLibrary.h"
|
||||
|
||||
@interface MCEditWindowController : NSWindowController <NSWindowDelegate, NSSplitViewDelegate>
|
||||
@property (assign) IBOutlet MCEditListController *editListController; // List of cursors in the library
|
||||
@property (assign) IBOutlet MCEditDetailController *editDetailController; // Detail view of the selected cursor
|
||||
@property (assign) IBOutlet MCEditCapeController *editCapeController; // Detail view of the entire library
|
||||
@property (assign) IBOutlet NSView *detailView;
|
||||
@property (assign) MCCursorLibrary *cursorLibrary;
|
||||
@end
|
||||
@@ -0,0 +1,188 @@
|
||||
//
|
||||
// MCEditWindowController.m
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/2/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MCEditWindowController.h"
|
||||
#import "MCLibraryController.h"
|
||||
|
||||
@interface MCEditWindowController ()
|
||||
- (void)_setCurrentViewController:(NSViewController *)vc;
|
||||
- (BOOL)promptSaveForLibrary:(MCCursorLibrary *)nextLibrary;
|
||||
@end
|
||||
|
||||
@implementation MCEditWindowController
|
||||
@dynamic cursorLibrary;
|
||||
|
||||
- (id)initWithWindow:(NSWindow *)window {
|
||||
if ((self = [super initWithWindow:window])) {
|
||||
// Initialization code here.
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)loadWindow {
|
||||
[super loadWindow];
|
||||
[self windowDidLoad];
|
||||
}
|
||||
|
||||
+ (NSSet *)keyPathsForValuesAffectingCursorLibrary {
|
||||
return [NSSet setWithObject:@"editListController.cursorLibrary"];
|
||||
}
|
||||
|
||||
- (MCCursorLibrary *)cursorLibrary {
|
||||
return self.editListController.cursorLibrary;
|
||||
}
|
||||
|
||||
- (void)setCursorLibrary:(MCCursorLibrary *)cursorLibrary {
|
||||
[self promptSaveForLibrary:cursorLibrary];
|
||||
}
|
||||
|
||||
- (BOOL)promptSaveForLibrary:(MCCursorLibrary *)nextLibrary {
|
||||
if (!self.window.isDocumentEdited) {
|
||||
self.editListController.cursorLibrary = nextLibrary;
|
||||
return NO;
|
||||
}
|
||||
|
||||
NSBeginAlertSheet(@"Do you want to save your changes?", @"Save", @"Cancel", @"Discard Changes", self.window, self, NULL, @selector(sheetDidDismiss:returnCode:contextInfo:), (__bridge void *)nextLibrary, @"Your changes will be discarded if you don't save them.");
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)windowDidLoad {
|
||||
[super windowDidLoad];
|
||||
[self.editListController addObserver:self forKeyPath:@"selectedObject" options:0 context:nil];
|
||||
[self _setCurrentViewController:self.editCapeController];
|
||||
|
||||
[self.window bind:@"documentEdited" toObject:self withKeyPath:@"cursorLibrary.dirty" options:nil];
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[self.editListController removeObserver:self forKeyPath:@"selectedObject"];
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
||||
if ([keyPath isEqualToString:@"selectedObject"]) {
|
||||
[self _changeEditViewsForSelection];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)windowShouldClose:(NSWindow *)window {
|
||||
return ![self promptSaveForLibrary:nil];
|
||||
}
|
||||
|
||||
- (NSUndoManager *)windowWillReturnUndoManager:(NSWindow *)window {
|
||||
return self.cursorLibrary.undoManager;
|
||||
}
|
||||
|
||||
- (void)sheetDidDismiss:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(MCCursorLibrary *)contextInfo {
|
||||
if (returnCode == 0) { // cancel
|
||||
// do nothing
|
||||
} else if (returnCode == 1) { // save
|
||||
NSError *error = [self.cursorLibrary save];
|
||||
if (!error) {
|
||||
self.editListController.cursorLibrary = contextInfo;
|
||||
|
||||
if (!contextInfo)
|
||||
[self.window close];
|
||||
} else {
|
||||
[NSApp presentError:error modalForWindow:self.window delegate:nil didPresentSelector:NULL contextInfo:nil];
|
||||
}
|
||||
} else if (returnCode == -1) { // discard changes
|
||||
[self.cursorLibrary revertToSaved];
|
||||
self.editListController.cursorLibrary = contextInfo;
|
||||
|
||||
if (!contextInfo)
|
||||
[self.window close];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Menu Actions
|
||||
|
||||
- (IBAction)applyCape:(id)sender {
|
||||
[self.cursorLibrary.library applyCape:self.cursorLibrary];
|
||||
}
|
||||
|
||||
- (IBAction)duplicateCape:(id)sender {
|
||||
[self.cursorLibrary.library importCape:self.cursorLibrary.copy];
|
||||
}
|
||||
|
||||
- (IBAction)checkCape:(id)sender {
|
||||
|
||||
}
|
||||
|
||||
- (IBAction)saveDocument:(id)sender {
|
||||
NSError *error = [self.cursorLibrary save];
|
||||
if (error)
|
||||
[self presentError:error modalForWindow:self.window delegate:nil didPresentSelector:NULL contextInfo:NULL];
|
||||
}
|
||||
|
||||
- (IBAction)revertDocumentToSaved:(id)sender {
|
||||
[self.cursorLibrary revertToSaved];
|
||||
}
|
||||
|
||||
- (IBAction)showCape:(id)sender {
|
||||
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[ self.cursorLibrary.fileURL ]];
|
||||
}
|
||||
|
||||
- (NSError *)willPresentError:(NSError *)error {
|
||||
return [NSError errorWithDomain:error.domain code:error.code userInfo:@{
|
||||
NSLocalizedDescriptionKey: error.localizedDescription ?: @"",
|
||||
NSLocalizedRecoverySuggestionErrorKey: error.localizedFailureReason ?: @""
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - View Changing
|
||||
|
||||
- (void)_changeEditViewsForSelection {
|
||||
BOOL capeEditor = [self.editListController.selectedObject isKindOfClass:[MCCursorLibrary class]];
|
||||
if (capeEditor) {
|
||||
[self _setCurrentViewController:self.editCapeController];
|
||||
self.editCapeController.cursorLibrary = self.editListController.selectedObject;
|
||||
} else {
|
||||
[self _setCurrentViewController:self.editDetailController];
|
||||
self.editDetailController.cursor = self.editListController.selectedObject;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_setCurrentViewController:(NSViewController *)vc {
|
||||
if ([self.detailView.subviews containsObject:vc.view])
|
||||
return;
|
||||
|
||||
[self.detailView setSubviews:@[]];
|
||||
[self.detailView removeConstraints:self.detailView.constraints];
|
||||
|
||||
NSRect frame = self.detailView.bounds;
|
||||
vc.view.frame = frame;
|
||||
|
||||
// Fill superview with subview
|
||||
[vc.view setTranslatesAutoresizingMaskIntoConstraints:YES];
|
||||
[vc.view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable | NSViewMinYMargin | NSViewMinXMargin];
|
||||
|
||||
[self.detailView addSubview:vc.view];
|
||||
}
|
||||
|
||||
#pragma mark - NSSplitViewDelegate
|
||||
|
||||
- (BOOL)splitView:(NSSplitView *)splitView canCollapseSubview:(NSView *)subview {
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex {
|
||||
if (dividerIndex == 0) {
|
||||
return 120.0f;
|
||||
}
|
||||
|
||||
return proposedMin;
|
||||
}
|
||||
|
||||
- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex {
|
||||
if (dividerIndex == 0) {
|
||||
return splitView.frame.size.width - 380.0;
|
||||
}
|
||||
return proposedMax;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// MCLibraryController.h
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/2/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MCCursorLibrary.h"
|
||||
|
||||
@interface MCLibraryController : NSObject
|
||||
@property (readonly, weak) MCCursorLibrary *appliedCape;
|
||||
@property (nonatomic, readonly) NSUndoManager *undoManager;
|
||||
@property (readonly, copy) NSURL *libraryURL;
|
||||
|
||||
- (instancetype)initWithURL:(NSURL *)url;
|
||||
|
||||
- (void)importCapeAtURL:(NSURL *)url;
|
||||
- (void)importCape:(MCCursorLibrary *)cape;
|
||||
|
||||
- (void)addCape:(MCCursorLibrary *)cape;
|
||||
- (void)removeCape:(MCCursorLibrary *)cape;
|
||||
|
||||
- (void)applyCape:(MCCursorLibrary *)cape;
|
||||
- (void)restoreCape;
|
||||
|
||||
- (NSURL *)URLForCape:(MCCursorLibrary *)cape;
|
||||
|
||||
- (NSSet *)capesWithIdentifier:(NSString *)identifier;
|
||||
- (BOOL)dumpCursorsWithProgressBlock:(BOOL (^)(NSUInteger current, NSUInteger total))block;
|
||||
|
||||
@end
|
||||
|
||||
@interface MCLibraryController (Capes)
|
||||
@property (nonatomic, readonly) NSSet *capes;
|
||||
@end
|
||||
@@ -0,0 +1,181 @@
|
||||
//
|
||||
// MCLibraryController.m
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/2/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MCLibraryController.h"
|
||||
#import "NSOrderedSet+AZSortedInsert.h"
|
||||
#import "apply.h"
|
||||
#import "restore.h"
|
||||
#import "create.h"
|
||||
|
||||
@interface MCLibraryController ()
|
||||
@property (nonatomic, readwrite, strong) NSUndoManager *undoManager;
|
||||
@property (nonatomic, retain) NSMutableSet *capes;
|
||||
@property (readwrite, copy) NSURL *libraryURL;
|
||||
@property (readwrite, weak) MCCursorLibrary *appliedCape;
|
||||
- (void)loadLibrary;
|
||||
- (void)willSaveNotification:(NSNotification *)note;
|
||||
@end
|
||||
|
||||
@implementation MCLibraryController
|
||||
|
||||
- (NSURL *)URLForCape:(MCCursorLibrary *)cape {
|
||||
return [NSURL fileURLWithPathComponents:@[ self.libraryURL.path, [cape.identifier stringByAppendingPathExtension:@"cape"] ]];;
|
||||
}
|
||||
|
||||
- (instancetype)initWithURL:(NSURL *)url {
|
||||
if ((self = [self init])) {
|
||||
self.libraryURL = url;
|
||||
self.undoManager = [[NSUndoManager alloc] init];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willSaveNotification:) name:MCLibraryWillSaveNotificationName object:nil];
|
||||
[self loadLibrary];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)loadLibrary {
|
||||
[self.undoManager disableUndoRegistration];
|
||||
|
||||
self.capes = [NSMutableSet set];
|
||||
NSString *capesPath = self.libraryURL.path;
|
||||
NSArray *contents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:capesPath error:NULL];
|
||||
NSString *applied = [NSUserDefaults.standardUserDefaults stringForKey:MCPreferencesAppliedCursorKey];
|
||||
|
||||
for (NSString *filename in contents) {
|
||||
// Ignore hidden files like .DS_Store
|
||||
if ([filename hasPrefix:@"."])
|
||||
continue;
|
||||
|
||||
NSURL *fileURL = [NSURL fileURLWithPathComponents:@[ capesPath, filename ]];
|
||||
MCCursorLibrary *library = [MCCursorLibrary cursorLibraryWithContentsOfURL:fileURL];
|
||||
|
||||
if ([library.identifier isEqualToString:applied]) {
|
||||
self.appliedCape = library;
|
||||
}
|
||||
|
||||
[self addCape:library];
|
||||
}
|
||||
|
||||
[self.undoManager enableUndoRegistration];
|
||||
}
|
||||
|
||||
- (void)importCapeAtURL:(NSURL *)url {
|
||||
[self importCape:[MCCursorLibrary cursorLibraryWithContentsOfURL:url]];
|
||||
}
|
||||
|
||||
- (void)importCape:(MCCursorLibrary *)lib {
|
||||
if ([[self.capes valueForKeyPath:@"identifier"] containsObject:lib.identifier]) {
|
||||
lib.identifier = [lib.identifier stringByAppendingFormat:@".%@", UUID()];
|
||||
}
|
||||
|
||||
lib.fileURL = [self URLForCape:lib];
|
||||
[lib writeToFile:lib.fileURL.path atomically:NO];
|
||||
|
||||
[self addCape:lib];
|
||||
}
|
||||
|
||||
|
||||
- (void)addCape:(MCCursorLibrary *)cape {
|
||||
if ([self.capes containsObject:cape] || [[self.capes valueForKeyPath:@"identifier"] containsObject:cape.identifier]) {
|
||||
NSLog(@"Not adding %@ to the library because an object with that identifier already exists", cape.identifier);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cape) {
|
||||
NSLog(@"Cannot add nil cape");
|
||||
return;
|
||||
}
|
||||
|
||||
NSSet *change = [NSSet setWithObject:cape];
|
||||
[self willChangeValueForKey:@"capes" withSetMutation:NSKeyValueUnionSetMutation usingObjects:change];
|
||||
|
||||
cape.library = self;
|
||||
[self.capes addObject:cape];
|
||||
|
||||
[[self.undoManager prepareWithInvocationTarget:self] removeCape:cape];
|
||||
if (!self.undoManager.isUndoing) {
|
||||
[self.undoManager setActionName:[@"Add " stringByAppendingString:cape.name]];
|
||||
}
|
||||
|
||||
[self didChangeValueForKey:@"capes" withSetMutation:NSKeyValueUnionSetMutation usingObjects:change];
|
||||
|
||||
[cape.undoManager removeAllActions];
|
||||
}
|
||||
|
||||
|
||||
- (void)removeCape:(MCCursorLibrary *)cape {
|
||||
NSSet *change = [NSSet setWithObject:cape];
|
||||
|
||||
[self willChangeValueForKey:@"capes" withSetMutation:NSKeyValueMinusSetMutation usingObjects:change];
|
||||
if (cape == self.appliedCape)
|
||||
[self restoreCape];
|
||||
|
||||
if (cape.library == self)
|
||||
cape.library = nil;
|
||||
|
||||
[self.capes removeObject:cape];
|
||||
|
||||
// Move the file to the trash
|
||||
NSFileManager *manager = [NSFileManager defaultManager];
|
||||
NSURL *destinationURL = [NSURL fileURLWithPath:[[@"~/.Trash" stringByExpandingTildeInPath] stringByAppendingPathComponent:cape.fileURL.lastPathComponent] isDirectory:NO];
|
||||
|
||||
[manager removeItemAtURL:destinationURL error:NULL];
|
||||
[manager moveItemAtURL:cape.fileURL toURL:destinationURL error:NULL];
|
||||
|
||||
[[self.undoManager prepareWithInvocationTarget:self] importCapeAtURL:destinationURL];
|
||||
if (!self.undoManager.isUndoing) {
|
||||
[self.undoManager setActionName:[@"Remove " stringByAppendingString:cape.name]];
|
||||
}
|
||||
|
||||
[self didChangeValueForKey:@"capes" withSetMutation:NSKeyValueMinusSetMutation usingObjects:change];
|
||||
}
|
||||
|
||||
- (void)applyCape:(MCCursorLibrary *)cape {
|
||||
if (applyCapeAtPath(cape.fileURL.path)) {
|
||||
self.appliedCape = cape;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)restoreCape {
|
||||
resetAllCursors();
|
||||
self.appliedCape = nil;
|
||||
}
|
||||
|
||||
- (NSSet *)capesWithIdentifier:(NSString *)identifier {
|
||||
NSPredicate *pred = [NSPredicate predicateWithFormat:@"identifier == %@", identifier];
|
||||
return [self.capes filteredSetUsingPredicate:pred];
|
||||
}
|
||||
|
||||
- (void)willSaveNotification:(NSNotification *)note {
|
||||
MCCursorLibrary *cape = note.object;
|
||||
NSURL *oldURL = cape.fileURL;
|
||||
[cape setFileURL:[self URLForCape:cape]];
|
||||
NSError *error = nil;
|
||||
[[NSFileManager defaultManager] removeItemAtURL:oldURL error:&error];
|
||||
|
||||
if (error) {
|
||||
NSLog(@"error removing cape after rename: %@", error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (BOOL)dumpCursorsWithProgressBlock:(BOOL (^)(NSUInteger current, NSUInteger total))block {
|
||||
NSString *path = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat: @"Mousecape Dump (%f).cape", NSDate.date.timeIntervalSince1970]];
|
||||
if (dumpCursorsToFile(path, block)) {
|
||||
__weak MCLibraryController *weakSelf = self;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[weakSelf importCapeAtURL:[NSURL fileURLWithPath:path]];
|
||||
});
|
||||
return YES;
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// MCLibraryViewController.h
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/2/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MCLibraryController.h"
|
||||
|
||||
@interface MCLibraryViewController : NSViewController <NSTableViewDelegate, NSTableViewDataSource>
|
||||
@property (assign) IBOutlet NSMenu *contextMenu;
|
||||
@property (assign) IBOutlet NSTableView *tableView;
|
||||
@property (strong, readonly) MCLibraryController *libraryController;
|
||||
@property (weak) MCCursorLibrary *editingCape;
|
||||
@property (weak) MCCursorLibrary *selectedCape;
|
||||
@property (weak) MCCursorLibrary *clickedCape;
|
||||
|
||||
- (void)editCape:(MCCursorLibrary *)library;
|
||||
@end
|
||||
|
||||
@interface MCLibraryController (Properties)
|
||||
@property (readonly, strong) NSOrderedSet *capes;
|
||||
@end
|
||||
@@ -0,0 +1,212 @@
|
||||
//
|
||||
// MCLibraryViewController.m
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/2/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MCLibraryViewController.h"
|
||||
#import "MCCapeCellView.h"
|
||||
#import "NSFileManager+DirectoryLocations.h"
|
||||
#import "MCEditWindowController.h"
|
||||
#import "NSOrderedSet+AZSortedInsert.h"
|
||||
|
||||
const char MCLibraryCapesContext;
|
||||
const char MCLibraryNameContext;
|
||||
|
||||
@interface MCLibraryViewController ()
|
||||
@property (strong) MCEditWindowController *editWindowController;
|
||||
@property (readwrite, strong) NSMutableOrderedSet *capes;
|
||||
@property (strong, readwrite) MCLibraryController *libraryController;
|
||||
- (void)setupEnvironment;
|
||||
- (void)doubleClick:(id)sender;
|
||||
+ (NSString *)capesPath;
|
||||
+ (NSComparator)sortComparator;
|
||||
@end
|
||||
|
||||
@implementation MCLibraryViewController
|
||||
@dynamic clickedCape, selectedCape, editingCape;
|
||||
|
||||
+ (NSComparator)sortComparator {
|
||||
static NSComparator sortComparator = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
sortComparator = ^NSComparisonResult(id obj1, id obj2) {
|
||||
NSComparisonResult result = [[obj1 valueForKey:@"name"] localizedCaseInsensitiveCompare:[obj2 valueForKey:@"name"]];
|
||||
if (result == NSOrderedSame)
|
||||
result = [[obj1 valueForKey:@"author"] localizedCaseInsensitiveCompare:[obj2 valueForKey:@"author"]];
|
||||
return result;
|
||||
};
|
||||
});
|
||||
|
||||
return sortComparator;
|
||||
}
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
|
||||
[self setupEnvironment];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(NSCoder *)coder {
|
||||
if ((self = [super initWithCoder:coder])) {
|
||||
[self setupEnvironment];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[self.libraryController removeObserver:self forKeyPath:@"appliedCape"];
|
||||
|
||||
for (MCCursorLibrary *library in self.capes) {
|
||||
[library removeObserver:self forKeyPath:@"name" context:(void *)&MCLibraryNameContext];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+ (NSString *)capesPath {
|
||||
return [[NSFileManager defaultManager] findOrCreateDirectory:NSApplicationSupportDirectory inDomain:NSUserDomainMask appendPathComponent:@"Mousecape/capes" error:NULL];
|
||||
}
|
||||
|
||||
- (void)awakeFromNib {
|
||||
self.tableView.doubleAction = @selector(doubleClick:);
|
||||
self.tableView.target = self;
|
||||
}
|
||||
|
||||
- (void)setupEnvironment {
|
||||
[self addObserver:self forKeyPath:@"libraryController.capes" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:(void *)&MCLibraryCapesContext];
|
||||
self.libraryController = [[MCLibraryController alloc] initWithURL:[NSURL fileURLWithPath:self.class.capesPath]];
|
||||
|
||||
[self setRepresentedObject:self.libraryController];
|
||||
[self.libraryController addObserver:self forKeyPath:NSStringFromSelector(@selector(appliedCape)) options:0 context:NULL];
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
||||
if ([keyPath isEqualToString:NSStringFromSelector(@selector(appliedCape))]) {
|
||||
for (NSUInteger x = 0; x < self.tableView.numberOfRows; x++) {
|
||||
MCCapeCellView *cv = [self.tableView viewAtColumn:0 row:x makeIfNecessary:NO];
|
||||
cv.appliedImageView.hidden = !(cv.objectValue == [self.libraryController appliedCape]);
|
||||
}
|
||||
|
||||
} else if (context == &MCLibraryCapesContext) {
|
||||
NSKeyValueChange kind = [change[NSKeyValueChangeKindKey] integerValue];
|
||||
[self.tableView beginUpdates];
|
||||
|
||||
if (kind == NSKeyValueChangeInsertion || kind == NSKeyValueChangeSetting) {
|
||||
|
||||
if (kind == NSKeyValueChangeSetting) {
|
||||
self.capes = [NSMutableOrderedSet orderedSet];
|
||||
}
|
||||
|
||||
for (MCCursorLibrary *lib in change[NSKeyValueChangeNewKey]) {
|
||||
NSUInteger index = [self.capes indexForInsertingObject:lib sortedUsingComparator:self.class.sortComparator];
|
||||
NSIndexSet *indices = [NSIndexSet indexSetWithIndex:index];
|
||||
|
||||
[self willChange:NSKeyValueChangeInsertion valuesAtIndexes:indices forKey:@"capes"];
|
||||
[lib addObserver:self forKeyPath:@"name" options:0 context:(void *)&MCLibraryNameContext];
|
||||
[self.capes insertObject:lib atIndex:index];
|
||||
[self didChange:NSKeyValueChangeInsertion valuesAtIndexes:indices forKey:@"capes"];
|
||||
[self.tableView insertRowsAtIndexes:indices withAnimation:NSTableViewAnimationSlideUp];
|
||||
}
|
||||
|
||||
} else if (kind == NSKeyValueChangeRemoval) {
|
||||
for (MCCursorLibrary *lib in change[NSKeyValueChangeOldKey]) {
|
||||
NSUInteger index = [self.capes indexOfObject:lib];
|
||||
NSIndexSet *indices = [NSIndexSet indexSetWithIndex:index];
|
||||
[self willChange:NSKeyValueChangeRemoval valuesAtIndexes:indices forKey:@"capes"];
|
||||
[lib removeObserver:self forKeyPath:@"name" context:(void *)&MCLibraryNameContext];
|
||||
[self.capes removeObjectAtIndex:index];
|
||||
[self didChange:NSKeyValueChangeRemoval valuesAtIndexes:indices forKey:@"capes"];
|
||||
|
||||
[self.tableView removeRowsAtIndexes:indices withAnimation:NSTableViewAnimationSlideUp | NSTableViewAnimationEffectFade];
|
||||
|
||||
if (self.editWindowController.cursorLibrary == lib) {
|
||||
self.editWindowController.cursorLibrary = nil;
|
||||
[self.editWindowController close];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[self.tableView endUpdates];
|
||||
|
||||
} else if (context == &MCLibraryNameContext) {
|
||||
// Reoder it
|
||||
MCCursorLibrary *cape = object;
|
||||
NSUInteger oldIndex = [self.capes indexOfObject:cape];
|
||||
if (oldIndex != NSNotFound) {
|
||||
[self.capes removeObjectAtIndex:oldIndex];
|
||||
NSUInteger newIndex = [self.capes indexForInsertingObject:cape sortedUsingComparator:self.class.sortComparator];
|
||||
[self.capes insertObject:cape atIndex:newIndex];
|
||||
[self.tableView moveRowAtIndex:oldIndex toIndex:newIndex];
|
||||
}
|
||||
} else
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
|
||||
}
|
||||
|
||||
- (void)doubleClick:(NSTableView *)sender {
|
||||
NSUInteger row = sender.clickedRow;
|
||||
MCCursorLibrary *library = [[sender viewAtColumn:0 row:row makeIfNecessary:NO] objectValue];
|
||||
if ([[NSUserDefaults standardUserDefaults] integerForKey:MCPreferencesDoubleActionKey] == 0)
|
||||
[self.libraryController applyCape:library];
|
||||
else {
|
||||
[self editCape:library];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Editing
|
||||
|
||||
+ (NSSet *)keyPathsForValuesAffectingEditingCape {
|
||||
return [NSSet setWithObject:@"editWindowController.cursorLibrary"];
|
||||
}
|
||||
|
||||
- (MCCursorLibrary *)selectedCape {
|
||||
return [[self.tableView viewAtColumn:0 row:self.tableView.selectedRow makeIfNecessary:NO] objectValue];
|
||||
}
|
||||
|
||||
- (MCCursorLibrary *)clickedCape {
|
||||
return [[self.tableView viewAtColumn:0 row:self.tableView.clickedRow makeIfNecessary:NO] objectValue];
|
||||
}
|
||||
|
||||
- (MCCursorLibrary *)editingCape {
|
||||
return self.editWindowController.cursorLibrary;
|
||||
}
|
||||
|
||||
- (void)editCape:(MCCursorLibrary *)library {
|
||||
if (!library)
|
||||
return;
|
||||
|
||||
if (!self.editWindowController) {
|
||||
self.editWindowController = [[MCEditWindowController alloc] initWithWindowNibName:@"Edit"];
|
||||
[self.editWindowController loadWindow];
|
||||
}
|
||||
self.editWindowController.cursorLibrary = library;
|
||||
[self.editWindowController showWindow:self];
|
||||
}
|
||||
|
||||
#pragma mark - NSTableViewDelegate
|
||||
|
||||
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
|
||||
return self.capes.count;
|
||||
}
|
||||
|
||||
- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
|
||||
return self.capes[row];
|
||||
}
|
||||
|
||||
#pragma mark - NSTableViewDelegate
|
||||
|
||||
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
|
||||
MCCapeCellView *cellView = (MCCapeCellView *)[tableView makeViewWithIdentifier:tableColumn.identifier owner:self];
|
||||
cellView.appliedImageView.hidden = !([self.capes objectAtIndex:row] == self.libraryController.appliedCape);
|
||||
return cellView;
|
||||
}
|
||||
|
||||
//- (NSTableRowView *)tableView:(NSTableView *)tableView rowViewForRow:(NSInteger)row {
|
||||
// return nil;
|
||||
//}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// MCLbraryWindowController.h
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/2/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MCLibraryViewController.h"
|
||||
|
||||
@interface MCLibraryWindowController : NSWindowController <NSWindowDelegate>
|
||||
@property (weak) IBOutlet MCLibraryViewController *libraryViewController;
|
||||
@property (weak) IBOutlet NSView *appliedAccessory;
|
||||
@property (weak) IBOutlet NSProgressIndicator *progressBar;
|
||||
@property (weak) IBOutlet NSTextField *progressField;
|
||||
@end
|
||||
|
||||
@interface MCAppliedCapeValueTransformer : NSValueTransformer
|
||||
@end
|
||||
@@ -0,0 +1,167 @@
|
||||
//
|
||||
// MCLbraryWindowController.m
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/2/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MCLibraryWindowController.h"
|
||||
|
||||
@interface MCLibraryWindowController ()
|
||||
- (void)composeAccessory;
|
||||
@end
|
||||
|
||||
@implementation MCLibraryWindowController
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[self composeAccessory];
|
||||
}
|
||||
|
||||
- (id)initWithWindow:(NSWindow *)window {
|
||||
if ((self = [super initWithWindow:window])) {
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)windowDidLoad {
|
||||
NSLog(@"window load");
|
||||
[super windowDidLoad];
|
||||
[self composeAccessory];
|
||||
}
|
||||
|
||||
- (NSString *)windowNibName {
|
||||
return @"Library";
|
||||
}
|
||||
|
||||
- (void)composeAccessory {
|
||||
NSView *themeFrame = [self.window.contentView superview];
|
||||
NSView *accessory = self.appliedAccessory;
|
||||
[accessory setTranslatesAutoresizingMaskIntoConstraints:NO];
|
||||
|
||||
NSRect c = themeFrame.frame;
|
||||
NSRect aV = accessory.frame;
|
||||
NSRect newFrame = NSMakeRect(
|
||||
c.size.width - aV.size.width, // x position
|
||||
c.size.height - aV.size.height, // y position
|
||||
aV.size.width, // width
|
||||
aV.size.height); // height
|
||||
|
||||
[accessory setFrame:newFrame];
|
||||
[themeFrame addSubview:accessory];
|
||||
|
||||
[themeFrame addConstraints:[NSLayoutConstraint
|
||||
constraintsWithVisualFormat:@"H:|-(>=100)-[accessory(245)]-(0)-|"
|
||||
options:0
|
||||
metrics:nil
|
||||
views:NSDictionaryOfVariableBindings(accessory)]];
|
||||
[themeFrame addConstraints:[NSLayoutConstraint
|
||||
constraintsWithVisualFormat:@"V:|-(0)-[accessory(20)]-(>=22)-|"
|
||||
options:0
|
||||
metrics:nil
|
||||
views:NSDictionaryOfVariableBindings(accessory)]];
|
||||
}
|
||||
|
||||
- (NSUndoManager *)windowWillReturnUndoManager:(NSWindow *)window {
|
||||
return self.libraryViewController.libraryController.undoManager;
|
||||
}
|
||||
|
||||
#pragma mark - Menu Actions
|
||||
|
||||
- (IBAction)applyCapeAction:(NSMenuItem *)sender {
|
||||
MCCursorLibrary *cape = nil;
|
||||
if (sender.tag == -1)
|
||||
cape = self.libraryViewController.clickedCape;
|
||||
else
|
||||
cape = self.libraryViewController.selectedCape;
|
||||
|
||||
[self.libraryViewController.libraryController applyCape:cape];
|
||||
}
|
||||
|
||||
- (IBAction)editCapeAction:(NSMenuItem *)sender {
|
||||
MCCursorLibrary *cape = nil;
|
||||
if (sender.tag == -1)
|
||||
cape = self.libraryViewController.clickedCape;
|
||||
else
|
||||
cape = self.libraryViewController.selectedCape;
|
||||
|
||||
[self.libraryViewController editCape:cape];
|
||||
}
|
||||
|
||||
- (IBAction)removeCapeAction:(NSMenuItem *)sender {
|
||||
MCCursorLibrary *cape = nil;
|
||||
if (sender.tag == -1)
|
||||
cape = self.libraryViewController.clickedCape;
|
||||
else
|
||||
cape = self.libraryViewController.selectedCape;
|
||||
|
||||
if (cape != self.libraryViewController.editingCape) {
|
||||
[self.libraryViewController.libraryController removeCape:cape];
|
||||
} else {
|
||||
[[NSSound soundNamed:@"Funk"] play];
|
||||
[self.libraryViewController editCape:self.libraryViewController.editingCape];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)duplicateCapeAction:(NSMenuItem *)sender {
|
||||
MCCursorLibrary *cape = nil;
|
||||
if (sender.tag == -1)
|
||||
cape = self.libraryViewController.clickedCape;
|
||||
else
|
||||
cape = self.libraryViewController.selectedCape;
|
||||
|
||||
[self.libraryViewController.libraryController importCape:cape.copy];
|
||||
}
|
||||
|
||||
- (IBAction)checkCapeAction:(NSMenuItem *)sender {
|
||||
|
||||
}
|
||||
|
||||
- (IBAction)showCapeAction:(NSMenuItem *)sender {
|
||||
MCCursorLibrary *cape = nil;
|
||||
if (sender.tag == -1)
|
||||
cape = self.libraryViewController.clickedCape;
|
||||
else
|
||||
cape = self.libraryViewController.selectedCape;
|
||||
|
||||
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[ cape.fileURL ]];
|
||||
}
|
||||
|
||||
- (IBAction)dumpCapeAction:(NSMenuItem *)sender {
|
||||
[self.window beginSheet:self.progressBar.window completionHandler:nil];
|
||||
__weak MCLibraryWindowController *weakSelf = self;
|
||||
self.progressBar.doubleValue = 0.0;
|
||||
[self.progressBar setIndeterminate:NO];
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
|
||||
[weakSelf.libraryViewController.libraryController dumpCursorsWithProgressBlock:^BOOL (NSUInteger current, NSUInteger total) {
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
weakSelf.progressField.stringValue = [NSString stringWithFormat:@"%lu of %lu", (unsigned long)current, (unsigned long)total];
|
||||
weakSelf.progressBar.minValue = 0;
|
||||
weakSelf.progressBar.maxValue = total;
|
||||
weakSelf.progressBar.doubleValue = current;
|
||||
});
|
||||
return YES;
|
||||
}];
|
||||
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
[weakSelf.window endSheet:self.progressBar.window];
|
||||
[[NSCursor arrowCursor] set];
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation MCAppliedCapeValueTransformer
|
||||
|
||||
+ (Class)transformedValueClass {
|
||||
return [NSString class];
|
||||
}
|
||||
|
||||
- (id)transformedValue:(id)value {
|
||||
return [NSLocalizedString(@"Applied Cape: ", @"Accessory label for applied cape") stringByAppendingString:value ? value : NSLocalizedString(@"None", @"Accessory label for when no cape is applied")];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,151 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6205" systemVersion="13E28" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment version="1070" identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6205"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="MCGeneralPreferencesController">
|
||||
<connections>
|
||||
<outlet property="view" destination="1" id="2"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="1">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="143"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Ndv-TL-Pur">
|
||||
<rect key="frame" x="18" y="106" width="48" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="I am... " id="a3X-1e-eOG">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8pe-9P-fa1">
|
||||
<rect key="frame" x="68" y="102" width="94" height="25"/>
|
||||
<segmentedCell key="cell" borderStyle="border" alignment="left" style="texturedSquare" trackingMode="selectOne" id="Hdu-Yg-F0d">
|
||||
<font key="font" metaFont="system"/>
|
||||
<segments>
|
||||
<segment label="right" selected="YES"/>
|
||||
<segment label="left" tag="1"/>
|
||||
</segments>
|
||||
</segmentedCell>
|
||||
<connections>
|
||||
<binding destination="Dw0-Gt-5ak" name="selectedIndex" keyPath="values.MCHandedness" id="ZqA-zg-dh2">
|
||||
<dictionary key="options">
|
||||
<integer key="NSMultipleValuesPlaceholder" value="0"/>
|
||||
<integer key="NSNoSelectionPlaceholder" value="0"/>
|
||||
<integer key="NSNotApplicablePlaceholder" value="0"/>
|
||||
<integer key="NSNullPlaceholder" value="0"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</segmentedControl>
|
||||
<slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="JRx-YT-ae7">
|
||||
<rect key="frame" x="18" y="15" width="392" height="25"/>
|
||||
<sliderCell key="cell" continuous="YES" state="on" alignment="left" minValue="0.5" maxValue="16" doubleValue="1" tickMarkPosition="below" numberOfTickMarks="16" sliderType="linear" id="osm-63-Q66"/>
|
||||
<connections>
|
||||
<binding destination="-2" name="value" keyPath="cursorScale" id="PlF-RW-V9z"/>
|
||||
</connections>
|
||||
</slider>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hg4-8F-fVE">
|
||||
<rect key="frame" x="20" y="48" width="82" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Cursor Scale" id="gxo-nh-UCg">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="yjb-oM-v3t">
|
||||
<rect key="frame" x="18" y="77" width="90" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Double Clicks" id="mFs-6l-Guo">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZYi-xB-wBd">
|
||||
<rect key="frame" x="114" y="72" width="111" height="25"/>
|
||||
<segmentedCell key="cell" borderStyle="border" alignment="left" style="texturedSquare" trackingMode="selectOne" id="oXj-Hj-PSJ">
|
||||
<font key="font" metaFont="system"/>
|
||||
<segments>
|
||||
<segment label="apply" width="54"/>
|
||||
<segment label="edit" width="54" selected="YES" tag="1"/>
|
||||
</segments>
|
||||
</segmentedCell>
|
||||
<connections>
|
||||
<binding destination="Dw0-Gt-5ak" name="selectedIndex" keyPath="values.MCDoubleAction" id="GuD-im-CgM">
|
||||
<dictionary key="options">
|
||||
<integer key="NSMultipleValuesPlaceholder" value="0"/>
|
||||
<integer key="NSNoSelectionPlaceholder" value="0"/>
|
||||
<integer key="NSNotApplicablePlaceholder" value="0"/>
|
||||
<integer key="NSNullPlaceholder" value="0"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</segmentedControl>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="QBy-dj-wZ4">
|
||||
<rect key="frame" x="416" y="21" width="44" height="19"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="44" id="6CD-yu-I0l"/>
|
||||
</constraints>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="nlB-rR-gpk">
|
||||
<numberFormatter key="formatter" formatterBehavior="custom10_4" positiveFormat="#0.00" negativeFormat="#0.00" usesGroupingSeparator="NO" paddingCharacter="*" groupingSize="0" minimumIntegerDigits="1" maximumIntegerDigits="2" minimumFractionDigits="2" maximumFractionDigits="2" decimalSeparator="." groupingSeparator="," currencyDecimalSeparator="." plusSign="+" minusSign="-" notANumberSymbol="NaN" perMillSymbol="‰" percentSymbol="%" exponentSymbol="E" positivePrefix="" positiveSuffix="" negativePrefix="-" negativeSuffix="" id="ZjS-1g-txf">
|
||||
<real key="minimum" value="0.5"/>
|
||||
<real key="maximum" value="16"/>
|
||||
</numberFormatter>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="value" keyPath="cursorScale" id="ffZ-zU-mYh"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="BrD-CT-ISu">
|
||||
<rect key="frame" x="168" y="106" width="51" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="handed" id="L0R-Jd-0pF">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Mx2-2f-xxz">
|
||||
<rect key="frame" x="231" y="77" width="40" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="capes" id="PAA-Qd-rHg">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="ZYi-xB-wBd" firstAttribute="leading" secondItem="yjb-oM-v3t" secondAttribute="trailing" constant="8" id="75E-3R-Wci"/>
|
||||
<constraint firstItem="yjb-oM-v3t" firstAttribute="top" secondItem="Ndv-TL-Pur" secondAttribute="bottom" constant="12" id="8sY-OX-BJr"/>
|
||||
<constraint firstAttribute="trailing" secondItem="QBy-dj-wZ4" secondAttribute="trailing" constant="20" id="AzN-Bd-09M"/>
|
||||
<constraint firstItem="yjb-oM-v3t" firstAttribute="leading" secondItem="Ndv-TL-Pur" secondAttribute="leading" id="BbZ-Ge-lTF"/>
|
||||
<constraint firstItem="hg4-8F-fVE" firstAttribute="leading" secondItem="JRx-YT-ae7" secondAttribute="leading" constant="2" id="Fc0-NM-Trw"/>
|
||||
<constraint firstItem="BrD-CT-ISu" firstAttribute="centerY" secondItem="8pe-9P-fa1" secondAttribute="centerY" id="Hg2-I1-obt"/>
|
||||
<constraint firstItem="QBy-dj-wZ4" firstAttribute="leading" secondItem="JRx-YT-ae7" secondAttribute="trailing" constant="8" id="JVR-o1-2YY"/>
|
||||
<constraint firstItem="Mx2-2f-xxz" firstAttribute="centerY" secondItem="ZYi-xB-wBd" secondAttribute="centerY" constant="-0.5" id="M1O-2Z-BQG"/>
|
||||
<constraint firstItem="ZYi-xB-wBd" firstAttribute="top" secondItem="8pe-9P-fa1" secondAttribute="bottom" constant="8" symbolic="YES" id="MxX-Qk-iHu"/>
|
||||
<constraint firstItem="Mx2-2f-xxz" firstAttribute="leading" secondItem="ZYi-xB-wBd" secondAttribute="trailing" constant="8" id="Ocg-tR-hZA"/>
|
||||
<constraint firstItem="hg4-8F-fVE" firstAttribute="top" secondItem="yjb-oM-v3t" secondAttribute="bottom" constant="12" id="P7d-eI-p1C"/>
|
||||
<constraint firstItem="BrD-CT-ISu" firstAttribute="leading" secondItem="8pe-9P-fa1" secondAttribute="trailing" constant="8" id="Rb5-Nu-xUh"/>
|
||||
<constraint firstItem="8pe-9P-fa1" firstAttribute="leading" secondItem="Ndv-TL-Pur" secondAttribute="trailing" constant="4" id="UkQ-8L-CRg"/>
|
||||
<constraint firstItem="Ndv-TL-Pur" firstAttribute="leading" secondItem="1" secondAttribute="leading" constant="20" id="Z9v-C6-xzG"/>
|
||||
<constraint firstItem="Ndv-TL-Pur" firstAttribute="top" secondItem="1" secondAttribute="top" constant="20" id="c2R-ME-mbU"/>
|
||||
<constraint firstItem="yjb-oM-v3t" firstAttribute="centerY" secondItem="ZYi-xB-wBd" secondAttribute="centerY" constant="-0.5" id="eQr-KJ-ljI"/>
|
||||
<constraint firstAttribute="bottom" secondItem="JRx-YT-ae7" secondAttribute="bottom" constant="16" id="eeD-OM-YJ7"/>
|
||||
<constraint firstItem="Ndv-TL-Pur" firstAttribute="centerY" secondItem="8pe-9P-fa1" secondAttribute="centerY" id="gJN-ub-C95"/>
|
||||
<constraint firstItem="yjb-oM-v3t" firstAttribute="leading" secondItem="hg4-8F-fVE" secondAttribute="leading" constant="-2" id="jMe-as-UYa"/>
|
||||
<constraint firstItem="QBy-dj-wZ4" firstAttribute="centerY" secondItem="JRx-YT-ae7" secondAttribute="centerY" constant="-3.5" id="mBD-l8-aHL"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="311" y="408.5"/>
|
||||
</customView>
|
||||
<userDefaultsController representsSharedInstance="YES" id="Dw0-Gt-5ak"/>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// MCGeneralPreferencesController.h
|
||||
// Mousecape
|
||||
//
|
||||
// Created by Alex Zielenski on 2/9/14.
|
||||
// Copyright (c) 2014 Alex Zielenski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MASPreferencesViewController.h"
|
||||
|
||||
@interface MCGeneralPreferencesController : NSViewController <MASPreferencesViewController>
|
||||
@property (assign) float cursorScale;
|
||||
@end
|
||||