mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2025-02-07 20:58:00 +00:00
- Johannes Fortmann's Nov 8, 2007 patch and NSControllerSelectionProxy.h/.m for binding and controllers
- Rolf Jansen's fixes for r56 regression
This commit is contained in:
parent
fcda3ab7d9
commit
6ba570c3fc
@ -793,7 +793,6 @@
|
||||
FE01A9470C5D9BCB00AEA51A /* NSTextTableBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = FED167A80BE57EB300BF9889 /* NSTextTableBlock.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
FE01A9480C5D9BCB00AEA51A /* NSTextInput.h in Headers */ = {isa = PBXBuildFile; fileRef = FE27AC140BE9038000136B43 /* NSTextInput.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
FE01A9490C5D9BCB00AEA51A /* NSArrayControllerSelectionProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = FE352F680BF3998E00223FAF /* NSArrayControllerSelectionProxy.h */; };
|
||||
FE01A94A0C5D9BCB00AEA51A /* NSTableColumnBinder.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC5FF7B0BF49D5400682A70 /* NSTableColumnBinder.h */; };
|
||||
FE01A94B0C5D9BCB00AEA51A /* NSAffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = C8E4F57F0BFF7A8A0076D5E6 /* NSAffineTransform.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
FE01A94C0C5D9BCB00AEA51A /* NSTextList.h in Headers */ = {isa = PBXBuildFile; fileRef = FE7247670C06202B007CBC51 /* NSTextList.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
FE01A94D0C5D9BCB00AEA51A /* NSTextAttachmentCell.h in Headers */ = {isa = PBXBuildFile; fileRef = FE7247A40C0622F2007CBC51 /* NSTextAttachmentCell.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@ -1110,7 +1109,6 @@
|
||||
FE01AA880C5D9BCB00AEA51A /* NSTextTable.m in Sources */ = {isa = PBXBuildFile; fileRef = FED167A70BE57EB300BF9889 /* NSTextTable.m */; };
|
||||
FE01AA890C5D9BCB00AEA51A /* NSTextTableBlock.m in Sources */ = {isa = PBXBuildFile; fileRef = FED167A90BE57EB300BF9889 /* NSTextTableBlock.m */; };
|
||||
FE01AA8A0C5D9BCB00AEA51A /* NSArrayControllerSelectionProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = FE352F690BF3998E00223FAF /* NSArrayControllerSelectionProxy.m */; };
|
||||
FE01AA8B0C5D9BCB00AEA51A /* NSTableColumnBinder.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC5FF7C0BF49D5400682A70 /* NSTableColumnBinder.m */; };
|
||||
FE01AA8C0C5D9BCB00AEA51A /* NSAffineTransform.m in Sources */ = {isa = PBXBuildFile; fileRef = C8E4F5800BFF7A8A0076D5E6 /* NSAffineTransform.m */; };
|
||||
FE01AA8D0C5D9BCB00AEA51A /* NSTextList.m in Sources */ = {isa = PBXBuildFile; fileRef = FE7247680C06202B007CBC51 /* NSTextList.m */; };
|
||||
FE01AA8E0C5D9BCB00AEA51A /* NSTextAttachmentCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FE7247A50C0622F2007CBC51 /* NSTextAttachmentCell.m */; };
|
||||
@ -1278,8 +1276,6 @@
|
||||
FE57F8D30C46B68C0078FFC1 /* KGDeviceContext_gdi.m in Sources */ = {isa = PBXBuildFile; fileRef = FE57F8D10C46B68C0078FFC1 /* KGDeviceContext_gdi.m */; };
|
||||
FE57FAB70C47F2010078FFC1 /* NSPrintPanel.h in Headers */ = {isa = PBXBuildFile; fileRef = FE57FAB50C47F2010078FFC1 /* NSPrintPanel.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
FE57FAB80C47F2010078FFC1 /* NSPrintPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = FE57FAB60C47F2010078FFC1 /* NSPrintPanel.m */; };
|
||||
FE5C6E2D0CD97D2800893B56 /* StandardAboutPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = FE5C6E2C0CD97D2800893B56 /* StandardAboutPanel.nib */; };
|
||||
FE5C6E2E0CD97D2800893B56 /* StandardAboutPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = FE5C6E2C0CD97D2800893B56 /* StandardAboutPanel.nib */; };
|
||||
FE6466E30B2C611D00B302B0 /* NSMutableParagraphStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6466E10B2C611D00B302B0 /* NSMutableParagraphStyle.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
FE6466E40B2C611D00B302B0 /* NSMutableParagraphStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = FE6466E20B2C611D00B302B0 /* NSMutableParagraphStyle.m */; };
|
||||
FE64B8E10B81239D007EE513 /* KGColorSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = FE64B8A70B81239D007EE513 /* KGColorSpace.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||
@ -1367,6 +1363,14 @@
|
||||
FE8BAF280BC9EC680007FACA /* NSKVOBinder.m in Sources */ = {isa = PBXBuildFile; fileRef = FE8BAF200BC9EC680007FACA /* NSKVOBinder.m */; };
|
||||
FE8BAF290BC9EC680007FACA /* NSObject+BindingSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8BAF210BC9EC680007FACA /* NSObject+BindingSupport.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
FE8BAF2A0BC9EC680007FACA /* NSObject+BindingSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = FE8BAF220BC9EC680007FACA /* NSObject+BindingSupport.m */; };
|
||||
FE8D94AB0CE3A6C700AFB060 /* NSControllerSelectionProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8D94A90CE3A6C700AFB060 /* NSControllerSelectionProxy.h */; };
|
||||
FE8D94AC0CE3A6C700AFB060 /* NSControllerSelectionProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = FE8D94AA0CE3A6C700AFB060 /* NSControllerSelectionProxy.m */; };
|
||||
FE8D94AD0CE3A6C700AFB060 /* NSControllerSelectionProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8D94A90CE3A6C700AFB060 /* NSControllerSelectionProxy.h */; };
|
||||
FE8D94AE0CE3A6C700AFB060 /* NSControllerSelectionProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = FE8D94AA0CE3A6C700AFB060 /* NSControllerSelectionProxy.m */; };
|
||||
FE8D95200CE4057300AFB060 /* NSMultipleValueBinder.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8D951E0CE4057300AFB060 /* NSMultipleValueBinder.h */; };
|
||||
FE8D95210CE4057300AFB060 /* NSMultipleValueBinder.m in Sources */ = {isa = PBXBuildFile; fileRef = FE8D951F0CE4057300AFB060 /* NSMultipleValueBinder.m */; };
|
||||
FE8D95220CE4057300AFB060 /* NSMultipleValueBinder.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8D951E0CE4057300AFB060 /* NSMultipleValueBinder.h */; };
|
||||
FE8D95230CE4057300AFB060 /* NSMultipleValueBinder.m in Sources */ = {isa = PBXBuildFile; fileRef = FE8D951F0CE4057300AFB060 /* NSMultipleValueBinder.m */; };
|
||||
FE8F9F280C9C5D0000270AEE /* KGzlib.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8F9F260C9C5D0000270AEE /* KGzlib.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||
FE8F9F290C9C5D0000270AEE /* KGzlib.m in Sources */ = {isa = PBXBuildFile; fileRef = FE8F9F270C9C5D0000270AEE /* KGzlib.m */; };
|
||||
FE8F9F2A0C9C5D0000270AEE /* KGzlib.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8F9F260C9C5D0000270AEE /* KGzlib.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||
@ -1381,8 +1385,6 @@
|
||||
FEABD6060CB9D0C90035F828 /* KGContext_gdi.m in Sources */ = {isa = PBXBuildFile; fileRef = FEABD6040CB9D0C90035F828 /* KGContext_gdi.m */; };
|
||||
FEABD6070CB9D0C90035F828 /* KGContext_gdi.h in Headers */ = {isa = PBXBuildFile; fileRef = FEABD6030CB9D0C90035F828 /* KGContext_gdi.h */; };
|
||||
FEABD6080CB9D0C90035F828 /* KGContext_gdi.m in Sources */ = {isa = PBXBuildFile; fileRef = FEABD6040CB9D0C90035F828 /* KGContext_gdi.m */; };
|
||||
FEC5FF7D0BF49D5400682A70 /* NSTableColumnBinder.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC5FF7B0BF49D5400682A70 /* NSTableColumnBinder.h */; };
|
||||
FEC5FF7E0BF49D5400682A70 /* NSTableColumnBinder.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC5FF7C0BF49D5400682A70 /* NSTableColumnBinder.m */; };
|
||||
FED166D60BE502AD00BF9889 /* NSSegment.h in Headers */ = {isa = PBXBuildFile; fileRef = FED166D40BE502AD00BF9889 /* NSSegment.h */; };
|
||||
FED166D70BE502AD00BF9889 /* NSSegment.m in Sources */ = {isa = PBXBuildFile; fileRef = FED166D50BE502AD00BF9889 /* NSSegment.m */; };
|
||||
FED167AA0BE57EB300BF9889 /* NSTextBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = FED167A40BE57EB300BF9889 /* NSTextBlock.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@ -2078,7 +2080,6 @@
|
||||
FE57F8D10C46B68C0078FFC1 /* KGDeviceContext_gdi.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = KGDeviceContext_gdi.m; sourceTree = "<group>"; };
|
||||
FE57FAB50C47F2010078FFC1 /* NSPrintPanel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NSPrintPanel.h; sourceTree = "<group>"; };
|
||||
FE57FAB60C47F2010078FFC1 /* NSPrintPanel.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = NSPrintPanel.m; sourceTree = "<group>"; };
|
||||
FE5C6E2C0CD97D2800893B56 /* StandardAboutPanel.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = StandardAboutPanel.nib; sourceTree = "<group>"; };
|
||||
FE6466E10B2C611D00B302B0 /* NSMutableParagraphStyle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NSMutableParagraphStyle.h; sourceTree = "<group>"; };
|
||||
FE6466E20B2C611D00B302B0 /* NSMutableParagraphStyle.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = NSMutableParagraphStyle.m; sourceTree = "<group>"; };
|
||||
FE64B8A70B81239D007EE513 /* KGColorSpace.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KGColorSpace.h; sourceTree = "<group>"; };
|
||||
@ -2166,6 +2167,10 @@
|
||||
FE8BAF200BC9EC680007FACA /* NSKVOBinder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = NSKVOBinder.m; sourceTree = "<group>"; };
|
||||
FE8BAF210BC9EC680007FACA /* NSObject+BindingSupport.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "NSObject+BindingSupport.h"; sourceTree = "<group>"; };
|
||||
FE8BAF220BC9EC680007FACA /* NSObject+BindingSupport.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = "NSObject+BindingSupport.m"; sourceTree = "<group>"; };
|
||||
FE8D94A90CE3A6C700AFB060 /* NSControllerSelectionProxy.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NSControllerSelectionProxy.h; sourceTree = "<group>"; };
|
||||
FE8D94AA0CE3A6C700AFB060 /* NSControllerSelectionProxy.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = NSControllerSelectionProxy.m; sourceTree = "<group>"; };
|
||||
FE8D951E0CE4057300AFB060 /* NSMultipleValueBinder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NSMultipleValueBinder.h; sourceTree = "<group>"; };
|
||||
FE8D951F0CE4057300AFB060 /* NSMultipleValueBinder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = NSMultipleValueBinder.m; sourceTree = "<group>"; };
|
||||
FE8F9F260C9C5D0000270AEE /* KGzlib.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KGzlib.h; sourceTree = "<group>"; };
|
||||
FE8F9F270C9C5D0000270AEE /* KGzlib.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = KGzlib.m; sourceTree = "<group>"; };
|
||||
FEA8A98B0CD2CBC000E1E936 /* NSUserInterfaceValidation.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NSUserInterfaceValidation.h; sourceTree = "<group>"; };
|
||||
@ -2173,8 +2178,6 @@
|
||||
FEABD5E90CB9CEE40035F828 /* KGLayer_gdi.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = KGLayer_gdi.m; sourceTree = "<group>"; };
|
||||
FEABD6030CB9D0C90035F828 /* KGContext_gdi.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KGContext_gdi.h; sourceTree = "<group>"; };
|
||||
FEABD6040CB9D0C90035F828 /* KGContext_gdi.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = KGContext_gdi.m; sourceTree = "<group>"; };
|
||||
FEC5FF7B0BF49D5400682A70 /* NSTableColumnBinder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NSTableColumnBinder.h; sourceTree = "<group>"; };
|
||||
FEC5FF7C0BF49D5400682A70 /* NSTableColumnBinder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = NSTableColumnBinder.m; sourceTree = "<group>"; };
|
||||
FED166D40BE502AD00BF9889 /* NSSegment.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NSSegment.h; sourceTree = "<group>"; };
|
||||
FED166D50BE502AD00BF9889 /* NSSegment.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = NSSegment.m; sourceTree = "<group>"; };
|
||||
FED167A40BE57EB300BF9889 /* NSTextBlock.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NSTextBlock.h; sourceTree = "<group>"; };
|
||||
@ -2537,7 +2540,6 @@
|
||||
6E2B54DF0976075300DA0954 /* NSFontPanel.nib */,
|
||||
6E2B54E10976075300DA0954 /* NSColorPanel.nib */,
|
||||
6E2B54E30976075300DA0954 /* NSToolbarCustomizationPalette.nib */,
|
||||
FE5C6E2C0CD97D2800893B56 /* StandardAboutPanel.nib */,
|
||||
);
|
||||
name = Interfaces;
|
||||
sourceTree = "<group>";
|
||||
@ -3133,6 +3135,8 @@
|
||||
FE2A10250B44A239006C03DE /* NSController */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FE8D94A90CE3A6C700AFB060 /* NSControllerSelectionProxy.h */,
|
||||
FE8D94AA0CE3A6C700AFB060 /* NSControllerSelectionProxy.m */,
|
||||
FE352F680BF3998E00223FAF /* NSArrayControllerSelectionProxy.h */,
|
||||
FE352F690BF3998E00223FAF /* NSArrayControllerSelectionProxy.m */,
|
||||
FE2A10280B44A26B006C03DE /* NSArrayController.h */,
|
||||
@ -3182,9 +3186,9 @@
|
||||
FE8BAF1A0BC9EC0B0007FACA /* NSKeyValueBinding */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FE8D951E0CE4057300AFB060 /* NSMultipleValueBinder.h */,
|
||||
FE8D951F0CE4057300AFB060 /* NSMultipleValueBinder.m */,
|
||||
C8B239A20BF8EEB500CA33AF /* defaultBindingOptions.plist */,
|
||||
FEC5FF7B0BF49D5400682A70 /* NSTableColumnBinder.h */,
|
||||
FEC5FF7C0BF49D5400682A70 /* NSTableColumnBinder.m */,
|
||||
FE8BAF1D0BC9EC680007FACA /* NSBinder.h */,
|
||||
FE8BAF1E0BC9EC680007FACA /* NSBinder.m */,
|
||||
FE8BAF1F0BC9EC680007FACA /* NSKVOBinder.h */,
|
||||
@ -3542,7 +3546,6 @@
|
||||
FED167AE0BE57EB300BF9889 /* NSTextTableBlock.h in Headers */,
|
||||
FE27AC150BE9038000136B43 /* NSTextInput.h in Headers */,
|
||||
FE352F6A0BF3998E00223FAF /* NSArrayControllerSelectionProxy.h in Headers */,
|
||||
FEC5FF7D0BF49D5400682A70 /* NSTableColumnBinder.h in Headers */,
|
||||
C8E4F5810BFF7A8A0076D5E6 /* NSAffineTransform.h in Headers */,
|
||||
FE7247690C06202B007CBC51 /* NSTextList.h in Headers */,
|
||||
FE7247A60C0622F2007CBC51 /* NSTextAttachmentCell.h in Headers */,
|
||||
@ -3560,6 +3563,8 @@
|
||||
FEABD6050CB9D0C90035F828 /* KGContext_gdi.h in Headers */,
|
||||
FE311FA60CCC430200EBD696 /* KGFont_gdi.h in Headers */,
|
||||
FEA8A98C0CD2CBC000E1E936 /* NSUserInterfaceValidation.h in Headers */,
|
||||
FE8D94AD0CE3A6C700AFB060 /* NSControllerSelectionProxy.h in Headers */,
|
||||
FE8D95220CE4057300AFB060 /* NSMultipleValueBinder.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -3883,7 +3888,6 @@
|
||||
FE01A9470C5D9BCB00AEA51A /* NSTextTableBlock.h in Headers */,
|
||||
FE01A9480C5D9BCB00AEA51A /* NSTextInput.h in Headers */,
|
||||
FE01A9490C5D9BCB00AEA51A /* NSArrayControllerSelectionProxy.h in Headers */,
|
||||
FE01A94A0C5D9BCB00AEA51A /* NSTableColumnBinder.h in Headers */,
|
||||
FE01A94B0C5D9BCB00AEA51A /* NSAffineTransform.h in Headers */,
|
||||
FE01A94C0C5D9BCB00AEA51A /* NSTextList.h in Headers */,
|
||||
FE01A94D0C5D9BCB00AEA51A /* NSTextAttachmentCell.h in Headers */,
|
||||
@ -3901,6 +3905,8 @@
|
||||
FEABD6070CB9D0C90035F828 /* KGContext_gdi.h in Headers */,
|
||||
FE311FA80CCC430200EBD696 /* KGFont_gdi.h in Headers */,
|
||||
FEA8A98D0CD2CBC000E1E936 /* NSUserInterfaceValidation.h in Headers */,
|
||||
FE8D94AB0CE3A6C700AFB060 /* NSControllerSelectionProxy.h in Headers */,
|
||||
FE8D95200CE4057300AFB060 /* NSMultipleValueBinder.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -4062,7 +4068,6 @@
|
||||
FE8688800BC3FFA4009F515C /* NSButtonCell_disclosure_normal.tif in Resources */,
|
||||
FE8688810BC3FFA4009F515C /* NSButtonCell_disclosure_selected.tif in Resources */,
|
||||
C8B239A30BF8EEB500CA33AF /* defaultBindingOptions.plist in Resources */,
|
||||
FE5C6E2E0CD97D2800893B56 /* StandardAboutPanel.nib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -4108,7 +4113,6 @@
|
||||
FE01AAB80C5D9BCB00AEA51A /* NSButtonCell_disclosure_normal.tif in Resources */,
|
||||
FE01AAB90C5D9BCB00AEA51A /* NSButtonCell_disclosure_selected.tif in Resources */,
|
||||
FE01AABA0C5D9BCB00AEA51A /* defaultBindingOptions.plist in Resources */,
|
||||
FE5C6E2D0CD97D2800893B56 /* StandardAboutPanel.nib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -4445,7 +4449,6 @@
|
||||
FED167AD0BE57EB300BF9889 /* NSTextTable.m in Sources */,
|
||||
FED167AF0BE57EB300BF9889 /* NSTextTableBlock.m in Sources */,
|
||||
FE352F6B0BF3998E00223FAF /* NSArrayControllerSelectionProxy.m in Sources */,
|
||||
FEC5FF7E0BF49D5400682A70 /* NSTableColumnBinder.m in Sources */,
|
||||
C8E4F5820BFF7A8A0076D5E6 /* NSAffineTransform.m in Sources */,
|
||||
FE72476A0C06202B007CBC51 /* NSTextList.m in Sources */,
|
||||
FE7247A70C0622F2007CBC51 /* NSTextAttachmentCell.m in Sources */,
|
||||
@ -4462,6 +4465,8 @@
|
||||
FEABD5EB0CB9CEE40035F828 /* KGLayer_gdi.m in Sources */,
|
||||
FEABD6060CB9D0C90035F828 /* KGContext_gdi.m in Sources */,
|
||||
FE311FA70CCC430200EBD696 /* KGFont_gdi.m in Sources */,
|
||||
FE8D94AE0CE3A6C700AFB060 /* NSControllerSelectionProxy.m in Sources */,
|
||||
FE8D95230CE4057300AFB060 /* NSMultipleValueBinder.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -4778,7 +4783,6 @@
|
||||
FE01AA880C5D9BCB00AEA51A /* NSTextTable.m in Sources */,
|
||||
FE01AA890C5D9BCB00AEA51A /* NSTextTableBlock.m in Sources */,
|
||||
FE01AA8A0C5D9BCB00AEA51A /* NSArrayControllerSelectionProxy.m in Sources */,
|
||||
FE01AA8B0C5D9BCB00AEA51A /* NSTableColumnBinder.m in Sources */,
|
||||
FE01AA8C0C5D9BCB00AEA51A /* NSAffineTransform.m in Sources */,
|
||||
FE01AA8D0C5D9BCB00AEA51A /* NSTextList.m in Sources */,
|
||||
FE01AA8E0C5D9BCB00AEA51A /* NSTextAttachmentCell.m in Sources */,
|
||||
@ -4795,6 +4799,8 @@
|
||||
FEABD5ED0CB9CEE40035F828 /* KGLayer_gdi.m in Sources */,
|
||||
FEABD6080CB9D0C90035F828 /* KGContext_gdi.m in Sources */,
|
||||
FE311FA90CCC430200EBD696 /* KGFont_gdi.m in Sources */,
|
||||
FE8D94AC0CE3A6C700AFB060 /* NSControllerSelectionProxy.m in Sources */,
|
||||
FE8D95210CE4057300AFB060 /* NSMultipleValueBinder.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -51,4 +51,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(BOOL)drawInRect:(NSRect)rect {
|
||||
// FIXME: should this scale?
|
||||
return [self drawAtPoint:rect.origin];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -16,17 +16,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
{
|
||||
long avoidsEmptySelection:1;
|
||||
long clearsFilterPredicateOnInsertion:1;
|
||||
long editable:1;
|
||||
long filterRestrictsInsertion:1;
|
||||
long preservesSelection:1;
|
||||
long selectsInsertedObjects:1;
|
||||
long alwaysUsesMultipleValuesMarker:1;
|
||||
} flags;
|
||||
id _contentArray;
|
||||
} _flags;
|
||||
id _selectionIndexes;
|
||||
id _sortDescriptors;
|
||||
id _filterPredicate;
|
||||
id _selection;
|
||||
id _arrangedObjects;
|
||||
}
|
||||
|
||||
@ -37,7 +34,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
//-(BOOL)automaticallyPreparesContent;
|
||||
//-(BOOL)avoidsEmptySelection;
|
||||
//-(BOOL)selectsInsertedObjects;
|
||||
//-(BOOL)preservesSelection;
|
||||
-(BOOL)preservesSelection;
|
||||
|
||||
-(void)setSortDescriptors:(NSArray *)descriptors;
|
||||
-(void)setFilterPredicate:(NSPredicate *)predicate;
|
||||
@ -46,33 +43,32 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
//-(void)setAutomaticallyPreparesContent:(BOOL)flag;
|
||||
//-(void)setAvoidsEmptySelection:(BOOL)flag;
|
||||
//-(void)setSelectsInsertedObjects:(BOOL)flag;
|
||||
//-(void)setPreservesSelection:(BOOL)flag;
|
||||
-(void)setPreservesSelection:(BOOL)flag;
|
||||
|
||||
#if 0
|
||||
-(void)addObject:object;
|
||||
-(void)addObjects:(NSArray *)objects;
|
||||
-(void)insertObject:object atArrangedObjectIndex:(unsigned)index;
|
||||
-(void)insertObjects:(NSArray *)objects atArrangedObjectIndexes:(NSIndexSet *)indices;
|
||||
//-(void)insertObject:object atArrangedObjectIndex:(unsigned)index;
|
||||
//-(void)insertObjects:(NSArray *)objects atArrangedObjectIndexes:(NSIndexSet *)indices;
|
||||
-(void)removeObject:object;
|
||||
-(void)removeObjectAtArrangedObjectIndex:(unsigned)index;
|
||||
//-(void)removeObjectAtArrangedObjectIndex:(unsigned)index;
|
||||
|
||||
-(void)removeObjects:(NSArray *)objects;
|
||||
-(void)removeObjectsAtArrangedObjectIndexes:(NSIndexSet *)indices;
|
||||
#endif
|
||||
|
||||
-(NSIndexSet *)selectionIndexes;
|
||||
//-(unsigned)selectionIndex;
|
||||
-(NSArray *)selectedObjects;
|
||||
|
||||
//-(BOOL)canInsert;
|
||||
//-(BOOL)canSelectNext;
|
||||
//-(BOOL)canSelectPrevious;
|
||||
-(BOOL)canInsert;
|
||||
-(BOOL)canSelectNext;
|
||||
-(BOOL)canSelectPrevious;
|
||||
|
||||
//-(void)insert:sender;
|
||||
-(void)insert:sender;
|
||||
-(void)remove:sender;
|
||||
-(void)selectNext:sender;
|
||||
-(void)selectPrevious:sender;
|
||||
|
||||
//-(void)setSelectedObjects:(NSArray *)objects;
|
||||
-(BOOL)setSelectedObjects:(NSArray *)objects;
|
||||
-(BOOL)setSelectionIndex:(unsigned)index;
|
||||
-(BOOL)setSelectionIndexes:(NSIndexSet *)indices;
|
||||
|
||||
@ -83,10 +79,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
//-(BOOL)removeSelectionIndexes:(NSIndexSet *)indices;
|
||||
|
||||
-arrangedObjects;
|
||||
//-(NSArray *)arrangeObjects:(NSArray *)objects;
|
||||
//-(void)rearrangeObjects;
|
||||
|
||||
// private
|
||||
-(void)_selectionMayHaveChanged;
|
||||
-(NSArray *)arrangeObjects:(NSArray *)objects;
|
||||
-(void)rearrangeObjects;
|
||||
|
||||
@end
|
||||
|
@ -8,7 +8,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <AppKit/NSArrayController.h>
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import "NSArrayControllerSelectionProxy.h"
|
||||
#import <Foundation/NSIndexSet.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSCoder.h>
|
||||
@ -17,9 +16,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <Foundation/NSKeyValueCoding.h>
|
||||
#import <Foundation/NSString+KVCAdditions.h>
|
||||
|
||||
@interface NSArrayController(forwardRefs)
|
||||
@interface NSObjectController(private)
|
||||
-(id)_defaultNewObject;
|
||||
-(void)_selectionMayHaveChanged;
|
||||
@end
|
||||
|
||||
@interface NSArrayController(forwardRefs)
|
||||
-(void)prepareContent;
|
||||
- (void)setArrangedObjects:(id)value;
|
||||
- (void)setContentArray:(id)value;
|
||||
@end
|
||||
|
||||
|
||||
@ -40,30 +45,45 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
triggerChangeNotificationsForDependentKey:@"selection"];
|
||||
[self setKeys:[NSArray arrayWithObjects:@"contentArray", @"selectionIndexes", nil]
|
||||
triggerChangeNotificationsForDependentKey:@"selectedObjects"];
|
||||
|
||||
[self setKeys:[NSArray arrayWithObjects:@"selectionIndexes", nil]
|
||||
triggerChangeNotificationsForDependentKey:@"canRemove"];
|
||||
[self setKeys:[NSArray arrayWithObjects:@"selectionIndexes", nil]
|
||||
triggerChangeNotificationsForDependentKey:@"canSelectNext"];
|
||||
[self setKeys:[NSArray arrayWithObjects:@"selectionIndexes", nil]
|
||||
triggerChangeNotificationsForDependentKey:@"canSelectPrevious"];
|
||||
}
|
||||
|
||||
-(id)initWithCoder:(NSCoder*)coder
|
||||
{
|
||||
if(self = [super initWithCoder:coder])
|
||||
{
|
||||
flags.avoidsEmptySelection = [coder decodeBoolForKey:@"NSAvoidsEmptySelection"];
|
||||
flags.clearsFilterPredicateOnInsertion = [coder decodeBoolForKey:@"NSClearsFilterPredicateOnInsertion"];
|
||||
flags.editable = [coder decodeBoolForKey:@"NSEditable"];
|
||||
flags.filterRestrictsInsertion = [coder decodeBoolForKey:@"NSFilterRestrictsInsertion"];
|
||||
flags.preservesSelection = [coder decodeBoolForKey:@"NSPreservesSelection"];
|
||||
flags.selectsInsertedObjects = [coder decodeBoolForKey:@"NSSelectsInsertedObjects"];
|
||||
flags.alwaysUsesMultipleValuesMarker = [coder decodeBoolForKey:@"NSAlwaysUsesMultipleValuesMarker"];
|
||||
_flags.avoidsEmptySelection = [coder decodeBoolForKey:@"NSAvoidsEmptySelection"];
|
||||
_flags.clearsFilterPredicateOnInsertion = [coder decodeBoolForKey:@"NSClearsFilterPredicateOnInsertion"];
|
||||
_flags.filterRestrictsInsertion = [coder decodeBoolForKey:@"NSFilterRestrictsInsertion"];
|
||||
_flags.preservesSelection = [coder decodeBoolForKey:@"NSPreservesSelection"];
|
||||
_flags.selectsInsertedObjects = [coder decodeBoolForKey:@"NSSelectsInsertedObjects"];
|
||||
_flags.alwaysUsesMultipleValuesMarker = [coder decodeBoolForKey:@"NSAlwaysUsesMultipleValuesMarker"];
|
||||
|
||||
id declaredKeys=[coder decodeObjectForKey:@"NSDeclaredKeys"];
|
||||
|
||||
if([self automaticallyPreparesContent])
|
||||
[self prepareContent];
|
||||
else
|
||||
[self setContentArray:[NSMutableArray array]];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)prepareContent
|
||||
{
|
||||
id array=[NSMutableArray array];
|
||||
[array addObject:[[self newObject] autorelease]];
|
||||
[self setContentArray:array];
|
||||
}
|
||||
|
||||
-(void)dealloc
|
||||
{
|
||||
[_selection release];
|
||||
[_contentArray release];
|
||||
[_selectionIndexes release];
|
||||
[_sortDescriptors release];
|
||||
[_filterPredicate release];
|
||||
@ -76,15 +96,44 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
[self _selectionMayHaveChanged];
|
||||
}
|
||||
|
||||
-(void)_selectionMayHaveChanged
|
||||
- (BOOL)preservesSelection
|
||||
{
|
||||
[self willChangeValueForKey:@"selection"];
|
||||
_selection=[[NSArrayControllerSelectionProxy alloc] initWithArrayController:self];
|
||||
[self didChangeValueForKey:@"selection"];
|
||||
return _flags.preservesSelection;
|
||||
}
|
||||
|
||||
-(void)setPreservesSelection:(BOOL)value
|
||||
{
|
||||
_flags.preservesSelection=value;
|
||||
}
|
||||
|
||||
- (void)setContentArray:(id)value
|
||||
{
|
||||
id oldSelection=nil;
|
||||
id oldSelectionIndexes=[[[self selectionIndexes] copy] autorelease];
|
||||
if([self preservesSelection])
|
||||
oldSelection=[self selectedObjects];
|
||||
|
||||
[self setContent:value];
|
||||
[self rearrangeObjects];
|
||||
|
||||
|
||||
if(oldSelection)
|
||||
{
|
||||
[self setSelectedObjects:oldSelection];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self setSelectionIndexes:oldSelectionIndexes];
|
||||
|
||||
NSLog(@"setting %@", oldSelectionIndexes);
|
||||
NSLog(@"result %@", [self selectionIndexes]);
|
||||
}
|
||||
|
||||
[self _selectionMayHaveChanged];
|
||||
}
|
||||
|
||||
- (id)contentArray {
|
||||
return [[_contentArray retain] autorelease];
|
||||
return [self content];
|
||||
}
|
||||
|
||||
-(NSArray*)arrangeObjects:(NSArray*)objects
|
||||
@ -102,14 +151,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
[self setArrangedObjects:[self arrangeObjects:[self contentArray]]];
|
||||
}
|
||||
|
||||
- (void)setContentArray:(id)value {
|
||||
if (_contentArray != value) {
|
||||
[_contentArray release];
|
||||
_contentArray = [value copy];
|
||||
[self rearrangeObjects];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setArrangedObjects:(id)value {
|
||||
if (_arrangedObjects != value)
|
||||
{
|
||||
@ -123,40 +164,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return _arrangedObjects;
|
||||
}
|
||||
|
||||
-(id)selection
|
||||
{
|
||||
return _selection;
|
||||
}
|
||||
|
||||
- (NSIndexSet *)selectionIndexes {
|
||||
return [[_selectionIndexes retain] autorelease];
|
||||
}
|
||||
|
||||
-(BOOL)setSelectionIndex:(unsigned)index {
|
||||
return [self setSelectionIndexes:[NSIndexSet indexSetWithIndex:index]];
|
||||
}
|
||||
|
||||
- (BOOL)setSelectionIndexes:(NSIndexSet *)value {
|
||||
if(!value && flags.avoidsEmptySelection && [[self arrangedObjects] count])
|
||||
value=[NSIndexSet indexSetWithIndex:0];
|
||||
|
||||
// use isEqualToIndexSet: ?
|
||||
if (_selectionIndexes != value) {
|
||||
[_selectionIndexes release];
|
||||
_selectionIndexes = [value copy];
|
||||
//NSLog(@"selectionIndexes changed to %@", value);
|
||||
|
||||
[self willChangeValueForKey:@"selection"];
|
||||
|
||||
[_selection autorelease];
|
||||
_selection = nil;
|
||||
_selection=[[NSArrayControllerSelectionProxy alloc] initWithArrayController:self];
|
||||
|
||||
[self didChangeValueForKey:@"selection"];
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (NSArray *)sortDescriptors {
|
||||
return [[_sortDescriptors retain] autorelease];
|
||||
@ -184,7 +191,37 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
-(BOOL)alwaysUsesMultipleValuesMarker
|
||||
{
|
||||
return flags.alwaysUsesMultipleValuesMarker;
|
||||
return _flags.alwaysUsesMultipleValuesMarker;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Selection
|
||||
|
||||
- (NSIndexSet *)selectionIndexes {
|
||||
return [[_selectionIndexes retain] autorelease];
|
||||
}
|
||||
|
||||
-(BOOL)setSelectionIndex:(unsigned)index {
|
||||
return [self setSelectionIndexes:[NSIndexSet indexSetWithIndex:index]];
|
||||
}
|
||||
|
||||
- (BOOL)setSelectionIndexes:(NSIndexSet *)value {
|
||||
if(![value count] && _flags.avoidsEmptySelection && [[self arrangedObjects] count])
|
||||
value=[NSIndexSet indexSetWithIndex:0];
|
||||
|
||||
value=[[value mutableCopy] autorelease];
|
||||
[(NSMutableIndexSet *)value removeIndexesInRange:NSMakeRange([[self arrangedObjects] count]+1, NSNotFound)];
|
||||
|
||||
// use isEqualToIndexSet: ?
|
||||
if (_selectionIndexes != value) {
|
||||
[_selectionIndexes release];
|
||||
_selectionIndexes = [value copy];
|
||||
//NSLog(@"selectionIndexes changed to %@", value);
|
||||
|
||||
[self _selectionMayHaveChanged];
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
-(NSArray *)selectedObjects
|
||||
@ -195,46 +232,46 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return [_NSObservableArray array];
|
||||
}
|
||||
|
||||
- (void)removeObject:(id)object
|
||||
- (BOOL)setSelectedObjects:(NSArray *)objects
|
||||
{
|
||||
[[self mutableArrayValueForKey:@"contentArray"] removeObject:object];
|
||||
id set=[NSMutableIndexSet indexSet];
|
||||
int i, count=[objects count];
|
||||
for(i=0; i<[objects count]; i++)
|
||||
{
|
||||
unsigned idx=[[self arrangedObjects] indexOfObject:[objects objectAtIndex:i]];
|
||||
if(idx!=NSNotFound)
|
||||
[set addIndex:idx];
|
||||
}
|
||||
[self setSelectionIndexes:set];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)removeObjects:(id)objects
|
||||
{
|
||||
id contentArray=[[self contentArray] mutableCopy];
|
||||
int count=[objects count];
|
||||
int i;
|
||||
for(i=0; i<count; i++)
|
||||
[contentArray removeObject:[objects objectAtIndex:i]];
|
||||
[self setContentArray:contentArray];
|
||||
#pragma mark -
|
||||
#pragma mark Moving selection
|
||||
|
||||
-(BOOL)canInsert {
|
||||
//NSUnimplementedMethod();
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)addObject:(id)object
|
||||
-(BOOL)canSelectPrevious
|
||||
{
|
||||
[[self mutableArrayValueForKey:@"contentArray"] addObject:object];
|
||||
id idxs=[[[self selectionIndexes] mutableCopy] autorelease];
|
||||
|
||||
if(idxs && [idxs firstIndex]>0)
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
-(id)newObject
|
||||
-(BOOL)canSelectNext
|
||||
{
|
||||
return [[NSClassFromString(_objectClassName) alloc] init];
|
||||
}
|
||||
|
||||
-(void)add:(id)sender
|
||||
{
|
||||
[self addObject:[[self newObject] autorelease]];
|
||||
|
||||
}
|
||||
|
||||
-(void)removeObjectsAtArrangedObjectIndexes:(NSIndexSet*)indexes
|
||||
{
|
||||
[self removeObjects:[[self contentArray] objectsAtIndexes:indexes]];
|
||||
|
||||
}
|
||||
|
||||
-(void)remove:(id)sender
|
||||
{
|
||||
[self removeObjectsAtArrangedObjectIndexes:[self selectionIndexes]];
|
||||
id idxs=[[[self selectionIndexes] mutableCopy] autorelease];
|
||||
|
||||
if(idxs && [idxs lastIndex]<[[self arrangedObjects] count]-1)
|
||||
return YES;
|
||||
return NO;
|
||||
}
|
||||
|
||||
-(void)selectNext:(id)sender
|
||||
@ -254,9 +291,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
{
|
||||
id idxs=[[[self selectionIndexes] mutableCopy] autorelease];
|
||||
if(!idxs){
|
||||
[self setSelectionIndexes:[NSIndexSet indexSetWithIndex:0]];
|
||||
[self setSelectionIndexes:[NSIndexSet indexSetWithIndex:0]];
|
||||
return;
|
||||
}
|
||||
}
|
||||
if([idxs firstIndex]>0)
|
||||
{
|
||||
[idxs shiftIndexesStartingAtIndex:0 by:-1];
|
||||
@ -266,9 +303,88 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Add/Remove
|
||||
|
||||
- (void)addObject:(id)object
|
||||
{
|
||||
if(![self canAdd])
|
||||
return;
|
||||
[[self mutableArrayValueForKey:@"contentArray"] addObject:object];
|
||||
}
|
||||
|
||||
|
||||
- (void)removeObject:(id)object
|
||||
{
|
||||
if(![self canRemove])
|
||||
return;
|
||||
[[self mutableArrayValueForKey:@"contentArray"] removeObject:object];
|
||||
}
|
||||
|
||||
-(void)add:(id)sender
|
||||
{
|
||||
if(![self canAdd])
|
||||
return;
|
||||
[self insert:sender];
|
||||
}
|
||||
|
||||
-(void)insert:(id)sender
|
||||
{
|
||||
if(![self canInsert])
|
||||
return;
|
||||
id toAdd=nil;
|
||||
if([self automaticallyPreparesContent])
|
||||
toAdd=[[self newObject] autorelease];
|
||||
else
|
||||
toAdd=[[self _defaultNewObject] autorelease];
|
||||
[self addObject:toAdd];
|
||||
}
|
||||
|
||||
-(void)remove:(id)sender
|
||||
{
|
||||
[self removeObjectsAtArrangedObjectIndexes:[self selectionIndexes]];
|
||||
}
|
||||
|
||||
-(void)removeObjectsAtArrangedObjectIndexes:(NSIndexSet*)indexes
|
||||
{
|
||||
[self removeObjects:[[self contentArray] objectsAtIndexes:indexes]];
|
||||
}
|
||||
|
||||
- (void)addObjects:(NSArray *)objects
|
||||
{
|
||||
if(![self canAdd])
|
||||
return;
|
||||
id contentArray=[[[self contentArray] mutableCopy] autorelease];
|
||||
int count=[objects count];
|
||||
int i;
|
||||
for(i=0; i<count; i++)
|
||||
[contentArray addObject:[objects objectAtIndex:i]];
|
||||
[self setContentArray:contentArray];
|
||||
}
|
||||
|
||||
|
||||
- (void)removeObjects:(NSArray *)objects
|
||||
{
|
||||
if(![self canRemove])
|
||||
return;
|
||||
|
||||
id contentArray=[[[self contentArray] mutableCopy] autorelease];
|
||||
int count=[objects count];
|
||||
int i;
|
||||
|
||||
for(i=0; i<count; i++)
|
||||
[contentArray removeObject:[objects objectAtIndex:i]];
|
||||
[self setContentArray:contentArray];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark -
|
||||
#pragma mark Helper classes
|
||||
|
||||
|
||||
@interface _NSObservationProxy : NSObject
|
||||
{
|
||||
id _keyPath;
|
||||
|
19
AppKit/NSController/NSControllerSelectionProxy.h
Normal file
19
AppKit/NSController/NSControllerSelectionProxy.h
Normal file
@ -0,0 +1,19 @@
|
||||
/* Copyright (c) 2007 Johannes Fortmann
|
||||
|
||||
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 <Foundation/NSObject.h>
|
||||
#import <Foundation/NSMutableDictionary.h>
|
||||
|
||||
|
||||
@interface NSControllerSelectionProxy : NSObject
|
||||
{
|
||||
id controller;
|
||||
NSMutableDictionary *values;
|
||||
}
|
||||
-(id)initWithController:(id)cont;
|
||||
@end
|
96
AppKit/NSController/NSControllerSelectionProxy.m
Normal file
96
AppKit/NSController/NSControllerSelectionProxy.m
Normal file
@ -0,0 +1,96 @@
|
||||
/* Copyright (c) 2007 Johannes Fortmann
|
||||
|
||||
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 "NSControllerSelectionProxy.h"
|
||||
#import <AppKit/NSArrayController.h>
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSKeyValueCoding.h>
|
||||
|
||||
@implementation NSControllerSelectionProxy
|
||||
-(id)initWithController:(id)cont
|
||||
{
|
||||
if(self=[super init])
|
||||
{
|
||||
values=[NSMutableDictionary new];
|
||||
controller = [cont retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)dealloc
|
||||
{
|
||||
[values release];
|
||||
[controller release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
-(id)valueForKey:(NSString*)key
|
||||
{
|
||||
id val=[values objectForKey:key];
|
||||
if(val)
|
||||
return val;
|
||||
id allValues=[[controller selectedObjects] valueForKeyPath:key];
|
||||
|
||||
switch([allValues count])
|
||||
{
|
||||
case 0:
|
||||
val=NSNoSelectionMarker;
|
||||
break;
|
||||
case 1:
|
||||
val=[allValues lastObject];
|
||||
break;
|
||||
default:
|
||||
{
|
||||
if([controller alwaysUsesMultipleValuesMarker])
|
||||
{
|
||||
val=NSMultipleValuesMarker;
|
||||
}
|
||||
else
|
||||
{
|
||||
val=[allValues objectAtIndex:0];
|
||||
id en=[allValues objectEnumerator];
|
||||
id obj;
|
||||
while((obj=[en nextObject]) && val!=NSMultipleValuesMarker)
|
||||
{
|
||||
if(![val isEqual:obj])
|
||||
val=NSMultipleValuesMarker;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
[values setValue:val forKey:key];
|
||||
return val;
|
||||
}
|
||||
|
||||
-(int)count
|
||||
{
|
||||
return [values count];
|
||||
}
|
||||
|
||||
-(id)keyEnumerator
|
||||
{
|
||||
return [values keyEnumerator];
|
||||
}
|
||||
|
||||
-(void)setValue:(id)value forKey:(NSString *)key
|
||||
{
|
||||
[[controller selectedObjects] setValue:value forKey:key];
|
||||
}
|
||||
|
||||
-(NSString*)description
|
||||
{
|
||||
return [NSString stringWithFormat:
|
||||
@"%@ <0x%x>",
|
||||
[self className],
|
||||
self];
|
||||
}
|
||||
@end
|
@ -10,46 +10,48 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
@interface NSObjectController : NSController {
|
||||
NSString* _objectClassName;
|
||||
id _content;
|
||||
id _selection;
|
||||
BOOL _editable;
|
||||
BOOL _automaticallyPreparesContent;
|
||||
}
|
||||
|
||||
#if 0
|
||||
-initWithContent:content;
|
||||
|
||||
-content;
|
||||
-(Class)objectClass;
|
||||
-(NSString *)entityName;
|
||||
-(NSPredicate *)fetchPredicate;
|
||||
-(NSManagedObjectContext *)managedObjectContext;
|
||||
-(BOOL)isEditable;
|
||||
-(BOOL)automaticallyPreparesContent;
|
||||
|
||||
-(void)setContent:content;
|
||||
-(void)setObjectClass:(Class)class;
|
||||
-(void)setEntityName:(NSString *)name;
|
||||
-(void)setFetchPredicate:(NSPredicate *)predicate;
|
||||
-(void)setManagedObjectContext:(NSManagedObjectContext *)context;
|
||||
-(void)setEditable:(BOOL)flag;
|
||||
-(void)setAutomaticallyPreparesContent:(BOOL)flag;
|
||||
|
||||
-(void)addObject:object;
|
||||
-content;
|
||||
|
||||
-selection;
|
||||
-(NSArray *)selectedObjects;
|
||||
|
||||
//-initWithContent:content;
|
||||
|
||||
//-(Class)objectClass;
|
||||
//-(NSString *)entityName;
|
||||
//-(NSPredicate *)fetchPredicate;
|
||||
//-(NSManagedObjectContext *)managedObjectContext;
|
||||
-(BOOL)isEditable;
|
||||
-(BOOL)automaticallyPreparesContent;
|
||||
|
||||
//-(void)setObjectClass:(Class)class;
|
||||
//-(void)setEntityName:(NSString *)name;
|
||||
//-(void)setFetchPredicate:(NSPredicate *)predicate;
|
||||
//-(void)setManagedObjectContext:(NSManagedObjectContext *)context;
|
||||
-(void)setEditable:(BOOL)flag;
|
||||
-(void)setAutomaticallyPreparesContent:(BOOL)flag;
|
||||
|
||||
//-(void)addObject:object;
|
||||
|
||||
-newObject;
|
||||
|
||||
-(BOOL)canAdd;
|
||||
-(BOOL)canRemove;
|
||||
-(void)add:sender;
|
||||
-(void)fetch:sender;
|
||||
-(void)remove:sender;
|
||||
-(void)removeObject:object;
|
||||
//-(void)add:sender;
|
||||
//-(void)fetch:sender;
|
||||
//-(void)remove:sender;
|
||||
//-(void)removeObject:object;
|
||||
|
||||
-(void)prepareContent;
|
||||
//-(void)prepareContent;
|
||||
|
||||
-(BOOL)fetchWithRequest:(NSFetchRequest *)fetchRequest merge:(BOOL)merge error:(NSError **)error;
|
||||
//-(BOOL)fetchWithRequest:(NSFetchRequest *)fetchRequest merge:(BOOL)merge error:(NSError **)error;
|
||||
|
||||
-(BOOL)validateMenuItem:(NSMenuItem *)menuItem;
|
||||
#endif
|
||||
//-(BOOL)validateMenuItem:(NSMenuItem *)menuItem;
|
||||
|
||||
@end
|
||||
|
@ -8,6 +8,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <AppKit/NSObjectController.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSKeyedUnarchiver.h>
|
||||
#import <Foundation/NSKeyValueObserving.h>
|
||||
#import "NSControllerSelectionProxy.h"
|
||||
|
||||
@interface NSObjectController(forward)
|
||||
-(void)_selectionMayHaveChanged;
|
||||
@end
|
||||
|
||||
@implementation NSObjectController
|
||||
-(id)initWithCoder:(NSCoder*)coder
|
||||
@ -15,13 +21,93 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
if(self=[super init])
|
||||
{
|
||||
_objectClassName=[[coder decodeObjectForKey:@"NSObjectClassName"] retain];
|
||||
_editable = [coder decodeBoolForKey:@"NSEditable"];
|
||||
_automaticallyPreparesContent = [coder decodeBoolForKey:@"NSAutomaticallyPreparesContent"];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)content {
|
||||
return [[_content retain] autorelease];
|
||||
}
|
||||
|
||||
- (void)setContent:(id)value {
|
||||
if (_content != value) {
|
||||
[_content release];
|
||||
_content = [value copy];
|
||||
[self _selectionMayHaveChanged];
|
||||
}
|
||||
}
|
||||
|
||||
-(NSArray *)selectedObjects
|
||||
{
|
||||
return [NSArray arrayWithObject:_content];
|
||||
}
|
||||
|
||||
-(id)selection
|
||||
{
|
||||
return _selection;
|
||||
}
|
||||
|
||||
-(id)_defaultNewObject
|
||||
{
|
||||
return [[NSClassFromString(_objectClassName) alloc] init];
|
||||
|
||||
}
|
||||
|
||||
-(id)newObject
|
||||
{
|
||||
return [self _defaultNewObject];
|
||||
}
|
||||
|
||||
|
||||
-(void)_selectionMayHaveChanged
|
||||
{
|
||||
[self willChangeValueForKey:@"selection"];
|
||||
[_selection autorelease];
|
||||
_selection=[[NSControllerSelectionProxy alloc] initWithController:self];
|
||||
[self didChangeValueForKey:@"selection"];
|
||||
}
|
||||
|
||||
-(void)dealloc
|
||||
{
|
||||
[_selection release];
|
||||
[_objectClassName release];
|
||||
[_content release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
-(BOOL)canAdd;
|
||||
{
|
||||
return [self isEditable];
|
||||
}
|
||||
|
||||
-(BOOL)canInsert;
|
||||
{
|
||||
return [self isEditable];
|
||||
}
|
||||
|
||||
-(BOOL)canRemove;
|
||||
{
|
||||
return [self isEditable] && [[self selectedObjects] count];
|
||||
}
|
||||
|
||||
- (BOOL)isEditable
|
||||
{
|
||||
return _editable;
|
||||
}
|
||||
|
||||
-(void)setEditable:(BOOL)value
|
||||
{
|
||||
_editable=value;
|
||||
}
|
||||
|
||||
- (BOOL)automaticallyPreparesContent {
|
||||
return _automaticallyPreparesContent;
|
||||
}
|
||||
|
||||
- (void)setAutomaticallyPreparesContent:(BOOL)value {
|
||||
_automaticallyPreparesContent = value;
|
||||
}
|
||||
@end
|
||||
|
@ -645,6 +645,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return (_fileURL!=nil)?YES:NO;
|
||||
if([item action]==@selector(saveDocument:))
|
||||
return YES;
|
||||
if([self respondsToSelector:[item action]])
|
||||
return YES;
|
||||
|
||||
return NO;
|
||||
}
|
||||
@ -654,6 +656,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return (_fileURL!=nil)?YES:NO;
|
||||
if([item action]==@selector(saveDocument:))
|
||||
return YES;
|
||||
if([self respondsToSelector:[item action]])
|
||||
return YES;
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <AppKit/NSImageCell.h>
|
||||
#import <AppKit/NSImage.h>
|
||||
#import <AppKit/NSGraphics.h>
|
||||
#import <AppKit/CGContext.h>
|
||||
#import <AppKit/NSGraphicsContext.h>
|
||||
|
||||
@implementation NSImageCell
|
||||
|
||||
@ -100,7 +102,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
-(void)drawInteriorWithFrame:(NSRect)frame inView:(NSView *)control {
|
||||
if([self _imageValue]!=nil) {
|
||||
|
||||
CGContextRef ctx=[[NSGraphicsContext currentContext] graphicsPort];
|
||||
CGContextSaveGState(ctx);
|
||||
CGContextClipToRect(ctx,frame);
|
||||
[[self _imageValue] compositeToPoint:[self alignedOriginInFrame:frame] operation:NSCompositeSourceOver];
|
||||
CGContextRestoreGState(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <Foundation/NSObject.h>
|
||||
#import <AppKit/AppKitExport.h>
|
||||
|
||||
@class NSString,NSDictionary;
|
||||
@class NSString, NSMutableDictionary, NSValueTransformer;
|
||||
|
||||
@interface _NSBinder : NSObject {
|
||||
id source;
|
||||
@ -16,7 +16,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
NSString* keyPath;
|
||||
NSString* bindingPath;
|
||||
NSString* binding;
|
||||
NSDictionary *options;
|
||||
NSMutableDictionary *options;
|
||||
}
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <Foundation/NSMutableArray.h>
|
||||
#import <Foundation/NSKeyValueCoding.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSValueTransformer.h>
|
||||
#import <AppKit/NSController.h>
|
||||
|
||||
#pragma mark -
|
||||
@ -66,6 +67,36 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return NSNoSelectionMarker;
|
||||
return ret;
|
||||
}
|
||||
|
||||
-(id)valueTransformer
|
||||
{
|
||||
id ret=[options objectForKey:NSValueTransformerBindingOption];
|
||||
if(!ret)
|
||||
{
|
||||
ret=[options objectForKey:NSValueTransformerNameBindingOption];
|
||||
if(!ret)
|
||||
return nil;
|
||||
ret=[NSValueTransformer valueTransformerForName:ret];
|
||||
[options setObject:ret forKey:NSValueTransformerBindingOption];
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
-(id)transformedObject:(id)object
|
||||
{
|
||||
id transformer=[self valueTransformer];
|
||||
if(!transformer)
|
||||
return object;
|
||||
return [transformer transformedValue:object];
|
||||
}
|
||||
|
||||
-(id)reverseTransformedObject:(id)object
|
||||
{
|
||||
id transformer=[self valueTransformer];
|
||||
if(!transformer)
|
||||
return object;
|
||||
return [transformer reverseTransformedValue:object];
|
||||
}
|
||||
@end
|
||||
|
||||
#pragma mark -
|
||||
@ -94,7 +125,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
{
|
||||
if (destination != value)
|
||||
{
|
||||
destination = value;
|
||||
[destination release];
|
||||
destination = [value retain];
|
||||
}
|
||||
}
|
||||
|
||||
@ -158,6 +190,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
[binding release];
|
||||
[options release];
|
||||
[bindingPath release];
|
||||
[destination retain];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
id peers=[self peerBinders];
|
||||
if([peers count])
|
||||
{
|
||||
// Support for pattern binders
|
||||
// FIX: maybe this should be in subclasses.
|
||||
// however, as long as there's just booleans (enabled, hidden etc.)
|
||||
// and strings (%{value1}@...
|
||||
|
@ -9,7 +9,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
@class NSArray;
|
||||
|
||||
@interface _NSTableColumnBinder : _NSBinder
|
||||
@interface _NSMultipleValueBinder : _NSBinder
|
||||
{
|
||||
NSArray* rowValues;
|
||||
NSString* arrayKeyPath;
|
@ -5,7 +5,7 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
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 "NSTableColumnBinder.h"
|
||||
#import "NSMultipleValueBinder.h"
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSKeyValueObserving.h>
|
||||
@ -17,7 +17,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <AppKit/NSCell.h>
|
||||
#import <AppKit/NSObject+BindingSupport.h>
|
||||
|
||||
@interface _NSTableColumnWrapperArray : NSArray
|
||||
@interface _NSMultipleValueWrapperArray : NSArray
|
||||
{
|
||||
id object;
|
||||
}
|
||||
@ -26,7 +26,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
|
||||
|
||||
@implementation _NSTableColumnBinder
|
||||
@implementation _NSMultipleValueBinder
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Outside accessors
|
||||
|
||||
- (NSArray *)rowValues
|
||||
{
|
||||
return [[rowValues retain] autorelease];
|
||||
@ -41,18 +45,52 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
}
|
||||
}
|
||||
|
||||
-(void)applyToObject:(id)object inRow:(int)row keyPath:(id)path
|
||||
{
|
||||
[object setValue:[[rowValues objectAtIndex:row] valueForKeyPath:valueKeyPath] forKey:path];
|
||||
}
|
||||
|
||||
-(void)applyToObject:(id)object inRow:(int)row
|
||||
{
|
||||
[self applyToObject:object inRow:row keyPath:bindingPath];
|
||||
}
|
||||
|
||||
-(void)applyToCell:(id)cell inRow:(int)row
|
||||
{
|
||||
[cell setValue:[[rowValues objectAtIndex:row] valueForKeyPath:valueKeyPath] forKey:bindingPath];
|
||||
[self applyToObject:cell inRow:row keyPath:bindingPath];
|
||||
}
|
||||
|
||||
-(void)applyFromObject:(id)object inRow:(int)row keyPath:(id)keypath
|
||||
{
|
||||
[[rowValues objectAtIndex:row] setValue:[object valueForKeyPath:keypath]
|
||||
forKeyPath:valueKeyPath];
|
||||
}
|
||||
|
||||
-(void)applyFromObject:(id)object inRow:(int)row
|
||||
{
|
||||
[self applyFromObject:object inRow:row keyPath:bindingPath];
|
||||
}
|
||||
|
||||
-(void)applyFromCell:(id)cell inRow:(int)row
|
||||
{
|
||||
[[rowValues objectAtIndex:row] setValue:[cell valueForKeyPath:bindingPath]
|
||||
forKeyPath:valueKeyPath];
|
||||
[self applyFromObject:cell inRow:row keyPath:bindingPath];
|
||||
}
|
||||
|
||||
|
||||
-(unsigned)count
|
||||
{
|
||||
return [rowValues count];
|
||||
}
|
||||
|
||||
-(id)objectAtIndex:(unsigned)row
|
||||
{
|
||||
return [[rowValues objectAtIndex:row] valueForKeyPath:valueKeyPath];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Internal stuff
|
||||
|
||||
|
||||
-(void)cacheArrayKeyPath
|
||||
{
|
||||
/*
|
||||
@ -144,10 +182,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
[self updateRowValues];
|
||||
|
||||
if([source respondsToSelector:@selector(reloadData)])
|
||||
[source reloadData];
|
||||
if([source respondsToSelector:@selector(tableView)])
|
||||
[[source tableView] reloadData];
|
||||
if([source respondsToSelector:@selector(_boundValuesChanged)])
|
||||
[source _boundValuesChanged];
|
||||
|
||||
[self startObservingChanges];
|
||||
}
|
||||
@ -181,11 +217,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
[source setSortDescriptorPrototype:[[[NSSortDescriptor alloc] initWithKey:valueKeyPath
|
||||
ascending:NO] autorelease]];
|
||||
}
|
||||
if([source respondsToSelector:@selector(tableView)])
|
||||
if([source respondsToSelector:@selector(_establishBindingsWithDestinationIfUnbound:)])
|
||||
{
|
||||
[[source tableView] performSelector:@selector(_establishBindingsWithDestinationIfUnbound:)
|
||||
withObject:destination
|
||||
afterDelay:0.0];
|
||||
[source performSelector:@selector(_establishBindingsWithDestinationIfUnbound:)
|
||||
withObject:destination
|
||||
afterDelay:0.0];
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,15 +232,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
[self stopObservingChanges];
|
||||
}
|
||||
|
||||
-(unsigned)count
|
||||
{
|
||||
return [rowValues count];
|
||||
}
|
||||
|
||||
-(id)objectAtIndex:(unsigned)row
|
||||
{
|
||||
return [[rowValues objectAtIndex:row] valueForKeyPath:valueKeyPath];
|
||||
}
|
||||
|
||||
-(NSString*)description
|
||||
{
|
||||
@ -215,12 +242,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
{
|
||||
id value=[destination valueForKeyPath:arrayKeyPath];
|
||||
if(![value respondsToSelector:@selector(objectAtIndex:)])
|
||||
value=[[[_NSTableColumnWrapperArray alloc] initWithObject:value] autorelease];
|
||||
value=[[[_NSMultipleValueWrapperArray alloc] initWithObject:value] autorelease];
|
||||
[self setRowValues:value];
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Helper classes
|
||||
|
||||
|
||||
|
||||
@ -259,8 +288,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
if(object==destination)
|
||||
{
|
||||
[source _boundValuesChanged];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[self startObservingChanges];
|
||||
}
|
||||
|
||||
@ -281,7 +310,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation _NSTableColumnWrapperArray
|
||||
@implementation _NSMultipleValueWrapperArray
|
||||
-(id)initWithObject:(id)obj
|
||||
{
|
||||
if(self = [super init])
|
@ -39,6 +39,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
// returns all binders used by the object
|
||||
-(NSArray*)_allUsedBinders;
|
||||
|
||||
// unbinds all bindings used; should be called in -dealloc
|
||||
-(void)_unbindAllBindings;
|
||||
@end
|
||||
|
||||
APPKIT_EXPORT NSString* NSObservedObjectKey;
|
||||
@ -52,4 +55,5 @@ APPKIT_EXPORT NSString *NSCreatesSortDescriptorBindingOption;
|
||||
APPKIT_EXPORT NSString *NSRaisesForNotApplicableKeysBindingOption;
|
||||
APPKIT_EXPORT NSString *NSAllowsEditingMultipleValuesSelectionBindingOption;
|
||||
APPKIT_EXPORT NSString *NSValueTransformerNameBindingOption;
|
||||
APPKIT_EXPORT NSString *NSValueTransformerBindingOption;
|
||||
|
||||
|
@ -12,6 +12,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <AppKit/NSObject+BindingSupport.h>
|
||||
#import <Foundation/NSBundle.h>
|
||||
#import <Foundation/NSKeyValueCoding.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
|
||||
NSMutableDictionary *bindersForObjects=nil;
|
||||
NSDictionary *defaultBindingOptions;
|
||||
@ -29,6 +30,7 @@ NSString *NSCreatesSortDescriptorBindingOption=@"NSCreatesSortDescriptors";
|
||||
NSString *NSRaisesForNotApplicableKeysBindingOption=@"NSRaisesForNotApplicableKeys";
|
||||
NSString *NSAllowsEditingMultipleValuesSelectionBindingOption=@"NSAllowsEditingMultipleValuesSelection";
|
||||
NSString *NSValueTransformerNameBindingOption=@"NSValueTransformerName";
|
||||
NSString *NSValueTransformerBindingOption=@"NSValueTransformerBindingOption";
|
||||
|
||||
@implementation NSObject (BindingSupport)
|
||||
|
||||
@ -143,6 +145,20 @@ NSString *NSValueTransformerNameBindingOption=@"NSValueTransformerName";
|
||||
[bindersForObjects removeObjectForKey:key];
|
||||
}
|
||||
|
||||
-(void)_unbindAllBindings
|
||||
{
|
||||
id key = [NSValue valueWithNonretainedObject:self];
|
||||
id ownBinders = [bindersForObjects objectForKey:key];
|
||||
id binder=nil;
|
||||
id en=[ownBinders allObjects];
|
||||
while(binder=[en nextObject])
|
||||
{
|
||||
[binder unbind];
|
||||
}
|
||||
|
||||
[bindersForObjects removeObjectForKey:key];
|
||||
}
|
||||
|
||||
-(NSDictionary *)infoForBinding:(id)binding
|
||||
{
|
||||
return [[self _binderForBinding:binding create:NO] options];
|
||||
|
@ -43,3 +43,5 @@ enum {
|
||||
|
||||
APPKIT_EXPORT int NSRunAlertPanel(NSString *title,NSString *message,NSString *defaultButton,NSString *alternateButton,NSString *otherButton, ...);
|
||||
APPKIT_EXPORT void NSBeginAlertSheet(NSString *title,NSString *defaultButton,NSString *alternateButton,NSString *otherButton,NSWindow *documentWindow, id modalDelegate,SEL didEndSelector,SEL didDismissSelector,void *contextInfo,NSString *message,...);
|
||||
APPKIT_EXPORT void NSBeginCriticalAlertSheet(NSString *title,NSString *defaultButton,NSString *alternateButton,NSString *otherButton,NSWindow *documentWindow, id modalDelegate,SEL didEndSelector,SEL didDismissSelector,void *contextInfo,NSString *message,...);
|
||||
APPKIT_EXPORT void NSBeginInformationalAlertSheet(NSString *title,NSString *defaultButton,NSString *alternateButton,NSString *otherButton,NSWindow *documentWindow, id modalDelegate,SEL didEndSelector,SEL didDismissSelector,void *contextInfo,NSString *message,...);
|
||||
|
@ -95,3 +95,31 @@ void NSBeginAlertSheet(NSString *title,NSString *defaultButton,NSString *alterna
|
||||
|
||||
[NSApp beginSheet:panel modalForWindow:window modalDelegate:modalDelegate didEndSelector:didEndSelector contextInfo:contextInfo];
|
||||
}
|
||||
|
||||
void NSBeginCriticalAlertSheet(NSString *title,NSString *defaultButton,NSString *alternateButton,NSString *otherButton,NSWindow *window, id modalDelegate,SEL didEndSelector,SEL didDismissSelector,void *contextInfo,NSString *format,...)
|
||||
{
|
||||
// FIXME: should probably have different icon or so
|
||||
|
||||
va_list arguments;
|
||||
NSString *message;
|
||||
|
||||
va_start(arguments,format);
|
||||
|
||||
message=[[[NSString alloc] initWithFormat:format arguments:arguments] autorelease];
|
||||
|
||||
NSBeginAlertSheet(title, defaultButton, alternateButton,otherButton,window, modalDelegate, didEndSelector,didDismissSelector,contextInfo,message);
|
||||
}
|
||||
|
||||
void NSBeginInformationalAlertSheet(NSString *title,NSString *defaultButton,NSString *alternateButton,NSString *otherButton,NSWindow *window, id modalDelegate,SEL didEndSelector,SEL didDismissSelector,void *contextInfo,NSString *format,...)
|
||||
{
|
||||
// FIXME: should probably have different icon or so
|
||||
|
||||
va_list arguments;
|
||||
NSString *message;
|
||||
|
||||
va_start(arguments,format);
|
||||
|
||||
message=[[[NSString alloc] initWithFormat:format arguments:arguments] autorelease];
|
||||
|
||||
NSBeginAlertSheet(title, defaultButton, alternateButton,otherButton,window, modalDelegate, didEndSelector,didDismissSelector,contextInfo,message);
|
||||
}
|
||||
|
@ -12,9 +12,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <AppKit/NSNibKeyedUnarchiver.h>
|
||||
#import <AppKit/NSObject+BindingSupport.h>
|
||||
|
||||
#import "NSKeyValueBinding/NSTableColumnBinder.h"
|
||||
#import "NSKeyValueBinding/NSMultipleValueBinder.h"
|
||||
#import "NSKeyValueBinding/NSKVOBinder.h"
|
||||
|
||||
@interface NSTableView(private)
|
||||
-(void)_establishBindingsWithDestinationIfUnbound:(id)dest;
|
||||
@end
|
||||
|
||||
@implementation NSTableColumn
|
||||
|
||||
-(void)encodeWithCoder:(NSCoder *)coder {
|
||||
@ -160,7 +164,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
for(i=0; i<count; i++)
|
||||
{
|
||||
id binder=[binders objectAtIndex:i];
|
||||
if([binder isKindOfClass:[_NSTableColumnBinder class]])
|
||||
if([binder isKindOfClass:[_NSMultipleValueBinder class]])
|
||||
{
|
||||
[binder updateRowValues];
|
||||
}
|
||||
@ -175,14 +179,17 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
for(i=0; i<count; i++)
|
||||
{
|
||||
id binder=[binders objectAtIndex:i];
|
||||
if([binder isKindOfClass:[_NSTableColumnBinder class]])
|
||||
if([binder isKindOfClass:[_NSMultipleValueBinder class]])
|
||||
{
|
||||
[binder applyToCell:cell inRow:row];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-(void)_establishBindingsWithDestinationIfUnbound:(id)dest
|
||||
{
|
||||
[[self tableView] _establishBindingsWithDestinationIfUnbound:dest];
|
||||
}
|
||||
|
||||
+(Class)_binderClassForBinding:(id)binding
|
||||
{
|
||||
@ -191,7 +198,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
[binding isEqual:@"minWidth"] ||
|
||||
[binding isEqual:@"width"])
|
||||
return [_NSKVOBinder class];
|
||||
return [_NSTableColumnBinder class];
|
||||
return [_NSMultipleValueBinder class];
|
||||
}
|
||||
|
||||
- (NSSortDescriptor *)sortDescriptorPrototype {
|
||||
|
@ -10,7 +10,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <AppKit/NSTableCornerView.h>
|
||||
#import <AppKit/NSNibKeyedUnarchiver.h>
|
||||
#import "NSKeyValueBinding/NSTableColumnBinder.h"
|
||||
#import "NSKeyValueBinding/NSMultipleValueBinder.h"
|
||||
#import "NSKeyValueBinding/NSKVOBinder.h"
|
||||
|
||||
NSString *NSTableViewSelectionIsChangingNotification=@"NSTableViewSelectionIsChangingNotification";
|
||||
@ -1267,7 +1267,7 @@ toPoint:NSMakePoint(rowRect.size.width, rowRect.origin.y)];
|
||||
if(dragging)
|
||||
{
|
||||
NSIndexSet *rowIndexes = [self selectedRowIndexes];
|
||||
if([rowIndexes containsIndex: _clickedRow] == FALSE)
|
||||
if([rowIndexes containsIndex: _clickedRow] == NO)
|
||||
rowIndexes = [NSIndexSet indexSetWithIndex: _clickedRow];
|
||||
|
||||
NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName:NSDragPboard];
|
||||
|
@ -27,6 +27,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <AppKit/NSPrintInfo.h>
|
||||
#import <AppKit/NSNibKeyedUnarchiver.h>
|
||||
#import <AppKit/NSPasteboard.h>
|
||||
#import <AppKit/NSObject+BindingSupport.h>
|
||||
#import <Foundation/NSRaise.h>
|
||||
|
||||
NSString *NSViewFrameDidChangeNotification=@"NSViewFrameDidChangeNotification";
|
||||
@ -121,6 +122,7 @@ NSString *NSViewFocusDidChangeNotification=@"NSViewFocusDidChangeNotification";
|
||||
|
||||
[_subviews release];
|
||||
[_draggedTypes release];
|
||||
[self _unbindAllBindings];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
@ -11,7 +11,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <AppKit/NSFont.h>
|
||||
#import <AppKit/NSFontManager.h>
|
||||
#import <AppKit/NSAttributedString.h>
|
||||
#ifdef WIN32
|
||||
#import <malloc.h>
|
||||
#endif
|
||||
|
||||
@implementation NSRichTextWriter
|
||||
|
||||
|
@ -331,8 +331,17 @@ static NSMapTable *pathToObject=NULL;
|
||||
|
||||
-(NSArray *)pathsForResourcesOfType:(NSString *)type
|
||||
inDirectory:(NSString *)path {
|
||||
NSUnimplementedMethod();
|
||||
return nil;
|
||||
id fullPath=[[self resourcePath] stringByAppendingPathComponent:path];
|
||||
id allFiles=[[NSFileManager defaultManager] directoryContentsAtPath:fullPath];
|
||||
int i;
|
||||
id ret=[NSMutableArray array];
|
||||
for(i=0; i<[allFiles count]; i++)
|
||||
{
|
||||
id filename=[fullPath stringByAppendingPathComponent:[allFiles objectAtIndex:i]];
|
||||
if([[filename pathExtension] isEqualToString:type])
|
||||
[ret addObject:filename];
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
NSString *NSPOSIXErrorDomain=@"NSPOSIXErrorDomain";
|
||||
NSString *NSWINSOCKErrorDomain=@"NSWINSOCKErrorDomain";
|
||||
NSString *NSUnderlyingErrorKey=@"NSUnderlyingErrorKey";
|
||||
NSString *NSLocalizedDescriptionKe=@"NSLocalizedDescriptionKe";
|
||||
NSString *NSLocalizedDescriptionKey=@"NSLocalizedDescriptionKey";
|
||||
|
||||
@implementation NSError
|
||||
|
||||
|
@ -52,9 +52,9 @@ FOUNDATION_EXPORT NSUncaughtExceptionHandler *NSGetUncaughtExceptionHandler(void
|
||||
FOUNDATION_EXPORT void NSSetUncaughtExceptionHandler(NSUncaughtExceptionHandler *);
|
||||
|
||||
typedef struct NSExceptionFrame {
|
||||
jmp_buf state;
|
||||
struct NSExceptionFrame *parent;
|
||||
NSException *exception;
|
||||
jmp_buf state;
|
||||
} NSExceptionFrame;
|
||||
|
||||
FOUNDATION_EXPORT void __NSPushExceptionFrame(NSExceptionFrame *frame);
|
||||
|
@ -36,8 +36,8 @@ static BOOL CreateClassDefinition( const char * name, const char * superclassNam
|
||||
#pragma mark -
|
||||
#pragma mark KVO implementation
|
||||
|
||||
NSMutableDictionary *observationInfos=nil;
|
||||
NSLock *kvoLock=nil;
|
||||
static NSMutableDictionary *observationInfos=nil;
|
||||
static NSLock *kvoLock=nil;
|
||||
|
||||
@interface NSObject (KVOSettersForwardReferencs)
|
||||
+(void)_KVO_buildDependencyUnion;
|
||||
@ -400,7 +400,7 @@ CHANGE_DECLARATION(SEL)
|
||||
|
||||
-(id)_KVO_className
|
||||
{
|
||||
return [NSString stringWithCString:isa->name+13];
|
||||
return [NSString stringWithCString:isa->name+strlen("KVONotifying_")];
|
||||
}
|
||||
|
||||
+(void)_KVO_buildDependencyUnion
|
||||
|
@ -62,6 +62,12 @@ void NSLog(NSString *format,...) {
|
||||
const char *NSGetSizeAndAlignment(const char *type,unsigned *size,
|
||||
unsigned *alignment) {
|
||||
BOOL quit=NO;
|
||||
|
||||
unsigned ignore=0;
|
||||
if(!size)
|
||||
size=&ignore;
|
||||
if(!alignment)
|
||||
alignment=&ignore;
|
||||
|
||||
*size=0;
|
||||
*alignment=0;
|
||||
@ -209,16 +215,18 @@ const char *NSGetSizeAndAlignment(const char *type,unsigned *size,
|
||||
}
|
||||
|
||||
case '^':
|
||||
NSUnimplementedFunction();
|
||||
quit=YES;
|
||||
break;
|
||||
|
||||
case '?':
|
||||
NSUnimplementedFunction();
|
||||
quit=YES;
|
||||
break;
|
||||
{
|
||||
unsigned subsize,subalignment;
|
||||
type++;
|
||||
|
||||
type=NSGetSizeAndAlignment(type,&subsize,&subalignment);
|
||||
*size=sizeof(void*);
|
||||
quit=YES;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
NSLog(@"unimplemented for %s %c", type, *type);
|
||||
NSUnimplementedFunction();
|
||||
quit=YES;
|
||||
break;
|
||||
|
@ -35,6 +35,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
-(NSPoint)pointValue;
|
||||
-(NSSize)sizeValue;
|
||||
-(NSRect)rectValue;
|
||||
-(NSRange)rangeValue;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -163,6 +163,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
return size;
|
||||
}
|
||||
|
||||
-(NSRange)rangeValue {
|
||||
NSRange range;
|
||||
[self getValue:&range];
|
||||
return range;
|
||||
}
|
||||
|
||||
-(NSRect)rectValue {
|
||||
NSRect rect;
|
||||
[self getValue:&rect];
|
||||
|
@ -14,14 +14,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
// Calls to these functions are generated by the compiler, so we need to use these names
|
||||
|
||||
void __objc_exec_class(OBJCModule *module) {
|
||||
FOUNDATION_EXPORT void __objc_exec_class(OBJCModule *module) {
|
||||
OBJCQueueModule(module);
|
||||
}
|
||||
|
||||
id objc_get_class(const char *name) {
|
||||
FOUNDATION_EXPORT id objc_get_class(const char *name) {
|
||||
return (id)OBJCClassFromString(name);
|
||||
}
|
||||
id objc_get_meta_class(const char *name) {
|
||||
FOUNDATION_EXPORT id objc_get_meta_class(const char *name) {
|
||||
return (id)OBJCClassFromString(name)->isa;
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
#import <rpc/types.h> // for MAXHOSTNAMELEN, why is that there?
|
||||
#import <time.h>
|
||||
#import <unistd.h>
|
||||
|
||||
NSString *NSPlatformClassName=@"NSPlatform_linux";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user