Commit Graph
48 Commits
Author SHA1 Message Date
Didier KorthoudtandMartin Carlberg 20be4a40ea NEW: Add CSS theming support (#2613) 2018-04-27 09:27:01 +02:00
Antoine Mercadal f9275a70af FIXED: New warnings reveleaded by ivar type checking
This patch fixes all new warnings
2014-11-06 10:17:05 -08:00
RoosterDragon 7db488cdfb Fixed: CPImageView no longer leaks due to image load notification.
Previously, CPImageView would sometimes attach a notification to CPImageDidLoadNotification when the image was set, but would never remove this notification. The view could then leak memory as the notification center would be keeping a reference even if the view was no longer being used.

This commit fixes that issue by removing the observation once the image has loaded.

Fixes #2198.
2014-09-24 13:45:49 +01:00
Martin Carlberg bb58a206a8 Fixed: Removed all warnings of conflicting return and parameter types caused by the new compiler 2013-08-12 16:46:14 +02:00
Aparajita Fishman 54d13c8fc9 Fixed: CPImageView's _DOMImageElement was not created during initWithCoder.
Previously, _createDOMImageElement was not called until after [super initWithCoder] was called. But that call would end up in CPImageView -setObjectValue, which would attempt to access _DOMImageElement before it had been created.

Now _DOMImageElement is checked before being accessed or created.
2013-07-14 17:46:22 -04:00
Alexander Ljungberg e8b2f2e39f Fixed: previous CPImageView revision not compiling with Rhino. 2013-07-08 17:28:48 +01:00
Alexander Ljungberg b258b1a164 New: appkit_tag_dom_elements now tags with UIDs too.
Tagging with UIDs can make it much easier to debug encoding/decoding related bugs where it's not clear that the right view ended up in the right spot.

The new data attribute is called "data-cappuccino-uid".

Also collect and simplify appkit_tag_dom_elements code a little.
2013-07-08 17:05:22 +01:00
Alexander Ljungberg 0badf30763 Simplify CPImageView code. 2013-07-08 17:02:41 +01:00
Alexander Ljungberg c68b174be5 Fixed: appkit_tag_dom_elements support by CPImageView.
Without this fix, the `appkit_tag_dom_elements` flag would only affect CPImageViews unarchived from a coder (e.g. in a collection view, from a cib). It would have no effect on a CPImageView created in code.

This change refactors the _DOMImageElement code to a shared method, reducing redundancy while fixing the bug.
2013-07-08 14:31:06 +01:00
Andrew Hankinson 011c3c9c5b Fixed: Typo in CPImageView Category
The category name for CPImage (CachedImage) was spelled wrong. This commit fixes the typo.
2013-03-24 16:15:50 -04:00
Aparajita Fishman afd5925499 Fixed: _CG and _CP macros were confusing and could degrade performance
Previously, Cappuccino was using preprocessor macros internally for the CGPoint/Size/Rect/Inset/Affine functions, as well as for CPRange. These macros had the same name as the corresponding function, but began with _. The functions were actually defined using the macros.

The motivation behind using macros was to increase performance by reducing function calls. However, there were a number of problems with this approach:

- There was an artificial dichotomy between _CG macros and the corresponding CG functions. We never completely replaced CG function calls with _CG macros. In fact, they were often mixed up in the same file. There was an extra burden on the programmer to remember to use the macro instead of the function.
- If a method call was passed as an argument to a macro, performance could actually be significantly *worse* than a function call. For example, _CGGetRectMakeCopy([view frame]) would expand to `{ origin:{ x:[view frame].origin.x, y:[view frame].origin.y }, size:{ width:[view frame].size.width, height:[view frame].size.height } }`. So instead of a single objj_msgSend and a single simple function call, we ended up with 4 objj_msgSend calls, which are way more expensive than simple function calls.
- Because of this expansion problem, to use macros efficiently required us to remember to use variables for all macro parameters. This didn't happen, and shouldn't have to happen.
- Finally, with modern Javascript engines, function call overhead is so small that it really isn't worth using the macros.

This commit eliminates the _CGGeometry, CGAffineTransformation and CPRange macros and replaces them with function calls.

BREAKING CHANGE:
The macros are no longer available. They could only be used with compiled code, but if there is any user code that used them, they will have to be replaced with the corresponding functions.
2013-03-13 12:22:10 -04:00
cacaodev 3591ba0f89 CPImageView bindings improvements
Cache image for the CPValue(URL|Path)Binding.
Support for reverse bindings CPValueBinding, CPValue(URL|Path)Binding,
CPDataBinding.
2013-02-22 22:11:42 +01:00
Aparajita Fishman abaa1e81f2 Support for multiple-value bindings
- CPView and subclasses support multiple-value hidden bindings.
- CPControl and subclasses support multiple-value enabled bindings.
- CPWindow and CPBox support multiple-value title with pattern bindings.
- CPButton supports multiple argument + target bindings.
- CPImageView and CPTextField support multiple-value editable bindings.
- CPMenuItem supports multiple-value enabled bindings.
- Fixed bugs in CPObjectController with simple collection operators.
- CPColorWell uses black as the placeholder color.
- Runtime object attributes from a cib are applied as they are read, not deferred.
- NSNumberFormatter now reads the number style from the xib.
- Normalized some parameter names.
- Formatting.
- Test app for all binding types.
2013-02-15 12:21:13 -05:00
Martin Carlberg 458fa9d02e Fixed a lot of small bugs found by new warning message from compiler 2013-01-18 14:24:37 +01:00
Aparajita Fishman cae5486ec6 Added missing class checks in +initialize, regularized checking code 2012-06-28 12:05:18 -07:00
cacaodev d1dd177bfd CPImageView: support for CPDataBinding. Test. 2012-04-28 17:12:22 +02:00
Aparajita Fishman 36bfc7c675 Fixed decode methods to return the correct defaults, removed unnecessary containsValueForKey and || with defaults 2012-04-24 10:15:19 +02:00
cacaodev 487d38fd21 Merge remote-tracking branch 'upstream/master' into CPImageView-bindings 2012-04-12 23:12:09 +02:00
Aparajita Fishman aeb2671fc0 CPImageView enhancements
- Changed from deprecated image scaling constants to new ones.
- Added support for CPImageScaleProportionallyUpOrDown (thanks BlairDuncan).
- Cleaned up image layout code.
2012-04-12 14:55:46 -04:00
cacaodev c989c30e00 Use new CPBinder methods from #1495 2012-04-10 22:57:20 +02:00
cacaodev 1e9958c4c7 Handle CPValueBinding in the custom binder. Added a CPImageView with CPValueBinding to the test app.
Removed setBackgroundColor:gray for placeholders because it's a bad idea (non cocoa and need to restore bg when the value != placeholder).
2012-04-08 10:01:04 +02:00
cacaodev b6a173cc0c CPImageView: support CPValueURLBinding and CPValuePathBinding. Readonly. With test. 2012-04-07 13:16:16 +02:00
Luc Vauvillier b18fbd685b CPImageView : Remove shadow vars dependency 2012-03-08 12:49:31 +01:00
Francisco Ryan Tolmasky I ff60125183 Some capp_linting.
Reviewed by me.
2010-12-01 11:04:17 -08: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
Aparajita FishmanandRoss Boucher 1002f80617 Another fix for issue #782, uses class variable for the empty image placeholder. 2010-07-28 16:27:56 -07:00
Aparajita FishmanandRoss Boucher fc51bead8e Another try at fixing issue #782 2010-07-28 16:27:56 -07:00
Ross Boucher 1e6595fca7 Slight switch statement change so that nil/0 are treated equivalently. 2010-06-10 13:29:47 -07:00
Aparajita FishmanandRoss Boucher 9ab446b790 Added image alignment support to CPImageView, CPWindowController always loads a cib from the main bundle for consistency with Cocoa, CPApplication modified to explicitly load the About panel cib from the Framework bundle 2010-06-09 14:24:00 -07:00
Scott KyleandRoss Boucher 9eab2071dc In CPImageView, performDragOperation: should return a BOOL 2010-05-12 16:51:28 -07:00
Scott KyleandRoss Boucher bb0835e2f3 CPImageView should send action on drop, as in Cocoa 2010-03-22 16:15:02 -07:00
Ross Boucher 7d1c7b2907 Add missing accessor to CPImageView, and fix nib2cib support for image scaling.
Closes #523.
2010-03-05 13:46:41 -08:00
Francisco Ryan Tolmasky I e8dd56bda7 Added HTML 5 drag and drop support for WebKit/Safari.
Reviewed by me.
2009-08-17 03:50:52 -07:00
lowell vizonandFrancisco Ryan Tolmasky I 377f331b47 Documentation Edits: Replaced <code> and <pre> tags with \c; this allows monospaced text to be displayed with formatted text without needing a new line. See AppKit/CPView after generating documentation for examples. Also added - and + signs to the above changes when referring to either an -instanceMethod or a +classMethod. --lowell@cocoastep
Signed-off-by: Francisco Ryan Tolmasky I <francisco@280north.com>
2009-08-08 03:50:50 +08:00
Francisco Ryan Tolmasky I 90fe0d64f5 Fix for dragged types not working on decoded views.
Reviewed by me.
2009-06-09 16:45:27 -07:00
Francisco Ryan Tolmasky I eab4f4bf78 Made CPImageView accept image drag and drop.
Reviewed by me.
2009-06-09 15:36:53 -07:00
Ross Boucher 850125b8ab Add documentation groups 2009-05-18 15:43:36 -07:00
Francisco Tolmasky 862af9cbae First stab at fixing Themeing API.
Reviewed by me.
2009-05-10 13:04:02 -07:00
Francisco Tolmasky 50baf5fd50 Further improvements.
Reviewed by me.
2009-02-10 01:12:34 -08:00
Francisco Tolmasky abd86c676b Theming for CPScroller.
Reviewed by me.
2009-02-07 18:38:34 -08:00
Francisco Ryan Tolmasky I 815e12be66 Added support for new tracking in CPTextField and CPImageView.
Reviewed by me.
2009-01-21 15:07:41 -08:00
Francisco Ryan Tolmasky I 32372c68cd A few minor adjustments to CPImageView nib support.
Reviewed by me.
2009-01-09 05:33:45 -08:00
Francisco Ryan Tolmasky I fb3c43ef6a Made CPImageView nib2cib compliant.
Reviewed by me.
2009-01-09 04:38:35 -08:00
Francisco Ryan Tolmasky I 5144a5a579 Added @accessor support, @import, and fixed spacing bug with @selector.
Reviewed by ross.
2008-10-26 00:48:49 -07:00
Ross Boucher f228934e54 Initial conversion to Doxygen style comments. 2008-10-12 15:57:01 -07:00
Ross Boucher 334776df12 Various fixes to support creating images with specifying the size upfront.
[#41 milestone:0.5.2 state:resolved];
[#20 milestone:0.5.2 state:resolved];
2008-09-17 22:45:32 -07:00
Ross Boucher a40fbd7961 Add the first draft of documentation inline. 2008-09-10 15:11:37 -07:00
Francisco Ryan Tolmasky I a97bb72800 Initial commit.
Reviewed by francisco, ross and tom.
2008-09-04 03:52:20 -07:00