507 Commits
Author SHA1 Message Date
Francisco Ryan Tolmasky I 80097ea2a2 Merge branch 'master' into @each 2010-11-03 21:28:10 -07:00
Francisco Ryan Tolmasky I 52f7844aee Made it so .h files are automatically included in AppKit (avoiding needing to manually include Platform.h, etc.).
Also changed a bunch of <AppKit/*> imports to "*" imports.

Reviewed by me.
2010-11-01 11:10:01 -07:00
Alexander Ljungberg a80732f13a Whitespace and style cleanup. 2010-10-27 20:44:55 -03:00
Alexander Ljungberg 923d7c63b5 Fixed an accidental global. 2010-10-27 20:24:05 -03:00
Alexander Ljungberg 7626af00e7 Apply Cappuccino code style. 2010-10-27 20:16:14 -03:00
cacaodev 2a95523577 CPPredicate & CPExpression changes:
Parsing: fixed typos in built-in function names, fixed support for [FIRST], [LAST], [INDEX]
	Fixed aggregates {exp1,exp2}
Fixed -expressionForFunction:selectorName:arguments:
built-in functions are now class methods
Cleaned a lot of code in built-in functions
EvaluatedObjectExpression is now a singleton
Merged inserset/minus/union Set into one file
Deleted unused expression subclasses : expression_operator and expression_assignement
Added CPCoding methods and changed key names to match Cocoa
Made KeyPathExpresion a subclass of FunctionExpression like in Cocoa
Tests
2010-10-27 00:57:31 +02:00
cacaodev c735399ca5 CPPredicate: Fix for fail when parsing empty quotes. With Tests. 2010-10-23 09:26:12 +02:00
cacaodev 275f89a340 CPPredicate: parsing 'BETWEEN' or 'CONTAINS' keywords now generates predicates with their corresponding operators. Some code style.
CPComparisonPredicate: fixed typo in 'between' operator evaluation, simplified 'contains' and 'in'  evaluation.
Added tests in CPPredicateTest for theses fixes.
2010-10-22 22:13:57 +02:00
cacaodevandRoss Boucher 678563a970 Accidental globals in CPNotificationCenter and Runtime.js 2010-10-18 10:15:40 -07:00
Alexander Ljungberg 6b37bae2c2 Fixed: removed the previous CPTimer DOM check - it doesn't work in Foundation. 2010-10-15 16:03:00 -03:00
Alexander Ljungberg 612e8c3f0b Add DOM checks to CPTimer's window.setTimeout bridge code. 2010-10-14 20:20:20 -03:00
Brian DonovanandRoss Boucher b5d0054f94 -[CPIndexSet shiftIndexesStartingAtIndex:by:] did not properly adjust count.
When clipping a range (i.e. some or all of it went below the lower bound) as a result of
calling shiftIndexesStartingAtIndex:by: with a negative delta, the CPIndexSet did not adjust
the index count, which caused calls to -lastIndex to fail.

This caused -[CPArrayController removeObject:] to fail when the object removed was at index 0.
2010-10-13 18:20:20 -07:00
Alexander Ljungberg e62af384ea Merge branch 'fix-imports' of http://github.com/paulbaumgart/cappuccino into paulbaumgart-fix-imports 2010-10-09 21:32:58 -04:00
Klaas Pieter Annema 5074938437 implement KVO dependent key path support 2010-10-07 21:17:28 +02:00
Klaas Pieter Annema 5b82417698 Merge branch 'CPKeyValueObservingOptionInitial-fix' of http://github.com/eventualbuddha/cappuccino into eventualbuddha-CPKeyValueObservingOptionInitial-fix 2010-10-07 10:37:50 +02:00
Ross Boucher ff2aa51a68 Fix accidental global in CPObject. 2010-10-06 19:41:45 -07:00
Paul Baumgart 01852d8075 Fix a bunch of missing @imports.
All classes (excluding the ones prefixed with underscores) in Foundation
and AppKit can now be loaded individually except CPOpenPanel and
CPSavePanel. These two classes have some sort of dependency cycle
that seems impossible to resolve without forward declarations (which
we don't have).
2010-10-05 15:54:25 -07:00
Brian Donovan 0ce115bc9c Ensure observeValueForKeyPath:ofObject:change:context is called consistently.
During the "normal" callback for new and old values, the ofObject:
parameter passed to the observer is the original receiver of the
addObserver:forKeyPath:options:context: call, but that isn't the case
with the call caused by the CPKeyValueObservingOptionInitial option.
This commit uses _targetObject, the receiver of the addObserver:...
call, rather than self, the _CPKVOProxy.
2010-10-05 07:45:43 -07:00
Paul Baumgart ca2ae22f15 Fix non-ASCII characters in CPDictionary.j and CPFormatter.j 2010-09-29 18:21:10 -07:00
Ross Boucher 32a0e950fe Allow comparators to return any value > 1 to indicate CPOrderedDescending. 2010-09-28 16:46:39 +05:30
Francisco Ryan Tolmasky I 2f0de57c92 Merge branch 'master' into @each
Conflicts:
	Foundation/CPArray.j
2010-09-19 15:06:16 -07:00
Francisco Ryan Tolmasky I d3c86aeefd Cleanup for previous undo patch and added a few test cases.
Reviewed by me.
2010-09-18 21:47:43 -07:00
Blair DuncanandFrancisco Ryan Tolmasky I 212feff636 CPUndoManager -added support for setActionName to enable the undo/redo menu to automatically update with the value passed as the action name. Test file included. 2010-09-18 20:30:43 -07:00
Alexander Ljungberg 7692f80f64 Additional fixes of inadvertent globals. 2010-09-17 16:48:00 -04:00
Nicholas Small d59d141302 Fix a bool that's supposed to be an int in CPUndoManager -groupingLevel. 2010-09-16 13:26:17 -04:00
Tom Robinson 1220555936 Fix for CPProxy not returning the return value 2010-09-13 16:44:45 -07:00
Alexander Ljungberg 4e4cc65645 Style and whitespace cleanup. 2010-09-10 19:07:48 -04:00
Arkadiusz MłynarczykandAlexander Ljungberg ddfac8d717 - moved componentsSeparatedByCharactersInSet: into CPCharacterSetAdditions CPString category
- added tests for componentsSeparatedByCharactersInSet:
- ensured Cocoa compatibility of componentsSeparatedByCharactersInSet:
- added new test for CPString boolValue
- fixed CPString boolValue (" ++01" should return NO as in Cocoa, previously it returned YES)
2010-09-10 18:58:18 -04:00
Arkadiusz MłynarczykandAlexander Ljungberg 009683ddd4 - Exception raising in componentsSeparatedByCharactersInSet: when separator parameter is nil
- Added support for edge cases (string is empty or string doesn't contain characters from separator set).
2010-09-10 18:58:10 -04:00
Arkadiusz MłynarczykandAlexander Ljungberg 8eefb90944 - implemented componentsSeparatedByCharactersInSet: 2010-09-10 18:58:02 -04:00
Klaas Pieter Annema 2dd1a1b54d always return a boolean from CPKeyedUnarchiver decodeBoolForKey: 2010-09-08 13:28:40 +02:00
Klaas Pieter Annema 213fde04fe fix CPArray+KVO addObjects inserting objects at beginning of array one by one 2010-08-27 12:06:40 +02:00
Klaas Pieter Annema ddad10b615 fix CPPredicate predicateWithFormat: throwing exception (in WebKit)
I believe the exception was caused because WebKit thought arguments was the function.Arguments.
Issue was resolved by renaming the local arguments variable to args
2010-08-26 16:55:05 +02:00
Klaas Pieter Annema b21eab1bf1 Improved KVC mutable indexed accessors
Refactored everything away into insertObjects:atIndexes: so all the logic is in the same place
and made it so that the _insertManySEL is the preferred selector to use. If it doesn't exist it will fall back to the _insertSEL.
2010-08-25 15:50:24 +02:00
Alexander Ljungberg febdf4092e New implementation of change notifications from CPArrayController.
It is crucial that we send notification only before and after complete changes. In the middle notifications might cause observers to see or react to inconsistent data (e.g. selection indexes pointing to rows no longer present). Added some unit tests - more might be needed in the future. Fixed: before and after values when observing array controller key paths during content changes or rearranges were wrong. Fixed: the array controller sent out multiple redundant change notifications.
2010-08-23 18:53:29 -04:00
Tom Robinson 4eaf560ee6 Fixes two bugs in compareObjectsUsingDescriptors causing test to fail: extra semi-colon after while() and uninitized "result" variable.
The former masked the latter when a single sort descriptor was used.
2010-08-13 15:34:28 -07:00
Alexander Ljungberg 6afe22f351 Merge remote branch 'klaaspieter/fix/784-cparraycontroller-selection' 2010-08-13 14:00:27 -04:00
Randall Luecke 22c481ff27 Implemented allKeysForObject: in CPDictionary with tests. 2010-08-12 14:18:45 -05:00
Randall Luecke 14fb769582 Removed ambiguity in CPDictionary keys type. Closes #700 2010-08-12 13:29:17 -05:00
Randall Luecke dd9c085ae3 Fix for new sort being unstable with a huge thanks to Shon Frazier. Reviewed by Me and Alexander Ljungberg. 2010-08-11 22:33:14 -05:00
cacaodevandRandall Luecke b7d1dfa75f CPArray sorting: improve performance by 40% (JSC) replacing native js sort() with the merge-sort algorithm.
Test with ojunit CPArrayPerformance.j
2010-08-10 18:16:03 -05:00
Alexander Ljungberg 271bb00147 Marginally faster filter and sort in CPArrayController's arrangeObjects (4% in the performance tester.) Reduced memory usage when both a filter and a sort order are applied. Cleanup of the tester and a filter only test run. 2010-08-09 17:31:36 -04:00
cacaodevandAlexander Ljungberg 750cd3c258 CPComparisonPredicate :
Fixed a bug where *lhs custom_selector: nil* was always returning false.
Test nil on left and/or right with some operators.
2010-08-05 16:18:18 -04:00
Alexander Ljungberg df358ccc42 Fix failing CPPredicate unit tests: comment out test for unimplemented expressionForSubquery, finish CPExpression_unionset and fix typo in CPExpression expressionForIntersectSet. 2010-08-04 21:27:01 -04:00
Alexander Ljungberg 63dfb8a227 CPPredicate optimization: early out in failing AND expression. 2010-08-04 20:50:36 -04:00
Alexander Ljungberg a3c0590218 Fixed with CPPredicate: [CPArray arrayWithObjects:...] should no longer be terminated with a nil in Cappuccino. 2010-08-04 20:50:07 -04:00
cacaodevandAlexander Ljungberg c694c96a32 CPPredicate & co style cleaning 2010-08-04 20:45:06 -04:00
Alexander Ljungberg 30bc304a20 Whitespace and style fixes. 2010-08-04 20:23:35 -04:00
cacaodevandAlexander Ljungberg 974cf64e1d CPPredicate &al implementation. OJUnit test. 2010-08-04 19:53:44 -04:00
cacaodevandAlexander Ljungberg fce726a031 CPScanner implementation 2010-08-04 19:48:51 -04:00