Re: Right-to-Left / Bidi / Arabic / Hebrew support in my app

2009-08-31 Thread Ken Ferry
On Aug 31, 2009, at 8:51 AM, Marc Wandschneider > wrote: Thanks for the feedback. In general, I've found that while the controls do, indeed, seem to align the text correctly for input in bidi locales, there is little support in things like IB for putting the label on a box at the top righ

Re: CGImageDestinationFinalize image destination does not have enough images ?

2009-09-01 Thread Ken Ferry
Hi, -[NSBitmapImageRep representationOfImageRepsInArray:usingType:properties:] requires an array of NSBitmapImageReps, not arbitrary NSImageReps. -Ken On Tue, Sep 1, 2009 at 3:26 AM, DairyKnight wrote: > Hi, > I'm trying to extract pages from PDF files and save them to jpg. But keep > getting th

Re: bad behavior from unlockFocus on 10.6

2009-09-03 Thread Ken Ferry
Hi Bob, > This all worked fine until 10.6. The original NSImage object was left unmolested. Nope. :-) Clearly you're seeing behavior change somewhere, but this attribution is not correct. -[NSImage lockFocus] is a commonly misunderstood method. It is and always has been lossy. Lock/unlock focu

Re: NSImage with multiple representation sizes

2009-09-03 Thread Ken Ferry
Hi Benjamin, I think there's some confusion here between size and pixel size. The "size" of an image is the default size of the rect in which it's drawn when the person drawing it doesn't have any more specific information. That's a concept that there can only be one of for the entire image, so i

Re: bad behavior from unlockFocus on 10.6

2009-09-03 Thread Ken Ferry
Well, please file a bug with a test case that shows the behavior change. I still think there's something else going on. -Ken Cocoa Frameworks NSImage owner On Thu, Sep 3, 2009 at 11:53 AM, Robert Clair wrote: > Hi Ken - > > >> > This all worked fine until 10.6. The original NSImage object was

Re: NSImage rotation regression?

2009-09-07 Thread Ken Ferry
Hi Marco, I dropped the code below in a test app, and it seemed to work fine on 10.6 with 90 as the number of degrees. Perhaps you could make a full test app that demonstrates the issue? -Ken On Mon, Sep 7, 2009 at 4:21 PM, Marco S Hyman wrote: > This image rotation code works when compiled wi

Re: NSImage with multiple representation sizes

2009-09-08 Thread Ken Ferry
On Tue, Sep 8, 2009 at 10:30 AM, Benjamin Rister wrote: > Hi Ken, > > Thanks for your response. > > The "size" of an image is the default size of the rect in which it's drawn >> when the person drawing it doesn't have any more specific information. >> That's a concept that there can only be one

Re: NSImage with multiple representation sizes

2009-09-08 Thread Ken Ferry
On Tue, Sep 8, 2009 at 11:42 AM, Benjamin Rister wrote: > So to be clear: if I create a TIFF image, with tiffutil -cat, that has >> 9x...@72dpi, 16x1...@72dpi, 32x3...@72dpi: >> - This is an entirely supported configuration, despite what man tiffutil >> says and the warning it generates. >> > > N

Re: NSUserDefaults synchronization in Foundation tools

2009-09-08 Thread Ken Ferry
Hi Jens, On Tue, Sep 8, 2009 at 4:24 PM, Jens Alfke wrote: > > On Sep 8, 2009, at 4:13 PM, Sidney San Martín wrote: > > "Because this method is automatically invoked at periodic intervals, use >> this method only if you cannot wait for the automatic synchronization (for >> example, if your appl

Re: KVO can be unsafe in -init?

2009-09-08 Thread Ken Ferry
Hi John, Since you're passing NSKeyValueObservingOptionInitial, -observeValueForKeyPath: is going to be invoked on your object immediately, before the method even returns. Is your -observeValueForKeyPath: safe to be called with a partially set up object? Do you have any subclasses of your object?

Re: NSImage - drawInRect SnowLeopard issue

2009-09-10 Thread Ken Ferry
Hi Tresa, This isn't enough information to tell what might be going wrong. Please file a bug, and give steps to reproduce in your app. (Or a reduction, but it sounds like you don't know how to make a reduction here.) I'm not aware of any problem that would cause this. You might try replacing yo

Re: Adding an associated reference is memory expensive (was: Adding an observer is memory expensive)

2009-09-11 Thread Ken Ferry
Hi Torsten, Please file as a bug if you haven't already. That clearly needs to be looked into. For your KVO issue, you can probably work around it by implementing - (void)setObservationInfo:(id)observationInfo; - (id)observationInfo; on the object that you are observing. This provides the sto

Re: Making a new "ICNS file" with NSImage

2009-09-17 Thread Ken Ferry
Hi Squ, I would recommend subclassing NSImageRep to do this. The new rep subclass should retain the original image and draw it slightly inset. It's very similar to subclassing NSView. It looks something like this: @interface MarginalImageRep : NSImageRep { NSImage *_baseImage; CGFloat

Re: Handling mouse events in NSCell's?

2009-09-18 Thread Ken Ferry
Hi Aaron, You should take a look at the NSCell docs . -Ken trackMouse:inRect:ofView:untilMouseUp: Disc

Re: bitmap caching issue (was: settings to build for 10.5 on 10.6?)

2009-09-20 Thread Ken Ferry
Hi Matt, It sounds like the bug discussed in this passage from the AppKit release notes is what's biting you: NSBitmapImageRep notable bug fix: -[NSBitmapImageRep CGImage] safer now (New since WWDC 2008) In Leopard, -[NSBitmap

Re: bitmap caching issue (was: settings to build for 10.5 on 10.6?)

2009-09-20 Thread Ken Ferry
On Sun, Sep 20, 2009 at 1:37 PM, Matt Neuburg wrote: > On or about 9/20/09 1:16 PM, thus spake "Ken Ferry" : > > > There was an ownership problem. The NSBitmapImageRep owned a raw buffer > of > > data and the CGImage. The CGImage didn't retain the NSBitmapI

Re: bitmap caching issue (was: settings to build for 10.5 on 10.6?)

2009-09-20 Thread Ken Ferry
On Sun, Sep 20, 2009 at 3:22 PM, Rob Keniger wrote: > > On 21/09/2009, at 7:22 AM, Ken Ferry wrote: > > Well, yes, but copying the data out one way or another is probably safer. >> :-) >> >> Once you've passed a CGImage to some other API, you really don't

Re: drawing/masking one image with the alpha value from another

2009-09-22 Thread Ken Ferry
On Tue, Sep 22, 2009 at 9:20 AM, David Duncan wrote: > On Sep 21, 2009, at 9:32 PM, Roland King wrote: > > I'm trying to construct an image which is colored according to the alpha >> value of a different image. I've been hunting around the Quartz Core docs >> and I can't figure out a good way to

Re: NSImage rotation regression?

2009-09-22 Thread Ken Ferry
On Tue, Sep 22, 2009 at 5:54 PM, Rob Keniger wrote: > > On 23/09/2009, at 8:46 AM, Marco S Hyman wrote: > > FYI: a while ago I asked about a possible NSImage rotation regression >> >> I didn't see any mention of this in the documentation or release >> notes. Did I miss it? >> > > > Yep. Have a

Re: Stability on Snow Leopard

2009-09-23 Thread Ken Ferry
On Wed, Sep 23, 2009 at 11:27 AM, dct wrote: > From my recent experience, Snow Leopard is a lot less forgiving of double > releases. SnowLeopard is not any more or less forgiving of double releases. There are bugs you can write that happen not to crash on 10.6 or on 10.5. There won't be any pa

Re: Background application is visible when I try to display a transparent backgrounded image into my app

2009-09-24 Thread Ken Ferry
On Wed, Sep 23, 2009 at 11:21 PM, Symadept wrote: > Hi, > I am trying to display an Image whose background is transparent as a > buttoncell. Then the application background of my app or the desktop is > visible and when I clicked on it, it focuses to the visible app. > > Why it is so happening. >

Re: CoreData Mysterious Conditional Data Loss

2009-09-24 Thread Ken Ferry
On Thu, Sep 24, 2009 at 6:59 AM, Milen Dzhumerov wrote: > > On 24 Sep 2009, at 14:20, I. Savant wrote: > > We're probably going to need a bit more information than this. You >> say the icons are "gone". I assume your entity instances are still >> there and all their other properties are present

Re: Subview drawn with reverted order

2009-09-24 Thread Ken Ferry
On Thu, Sep 24, 2009 at 5:36 PM, Jens Alfke wrote: > > On Sep 24, 2009, at 4:28 PM, gMail.com wrote: > > It seems that the Front-Back drawing order of the subviews has been >> reverted. How to fix this problem? >> > > Overlapping sibling views aren't really supported in AppKit. If you want to >

Re: NSBitmapImageRep caching behavior in Snow Leopard

2009-09-28 Thread Ken Ferry
On Mon, Sep 28, 2009 at 7:52 AM, John Horigan wrote: > I understand. Apple has changed the semantics of the NSBitmapImageRep class > in a way that is optimal for the majority of users but effectively > deprecates the way that I am using it (as a mutable pixel store). > Periodically generating new

Re: Can an app query the values in its own Info.plist?

2009-09-29 Thread Ken Ferry
On Sun, Sep 27, 2009 at 10:24 PM, Scott Anguish wrote: > > On Sep 28, 2009, at 1:16 AM, Kyle Sluder wrote: > > On Sun, Sep 27, 2009 at 10:02 PM, Scott Anguish >> wrote: >> >>> Why do it? It's easy enough to add your own. >>> >> >> It's also easy to add them to Info.plist… it seems like an appro

Re: simpleBrowser example has setCellClass setting a cell to an instance?

2009-09-29 Thread Ken Ferry
On Tue, Sep 29, 2009 at 5:35 PM, jon wrote: > oh, i was thinking that method was inherited from the NSControl class... > > great, so now i still can't figure out why my custom Cell methods are not > firing still looking for the problem.. > +cellClass is consulted whenever an NSControl nee

Re: [Enigmatic semi-solution] Re: Cannot get pixel color from NSBitmapImageRep

2009-10-01 Thread Ken Ferry
Hi David, Oh, yes, you're right. In the bitmapData, the first row is the top row. -getPixelAtX:y:, -setPixelAtX:y:, -getColorAtX:y: and setColorAtX:y: are the same. The first row is the top. Sorry that's confusing. -isFlipped: is not a property of NSBitmapImageRep, that's on NSImage. The abov

Re: 10.6 specific crash

2009-10-01 Thread Ken Ferry
On Thu, Oct 1, 2009 at 5:47 AM, Gregory Weston wrote: > Duncan Champney wrote: > > An app our company is developing is showing odd behavior and crashes >> under 10.6, but not under 10.5. >> >> I've done some digging and figured out that a major contributor to the >> crash is the following routin

Re: Making a opaque copy of an NSImage

2009-10-01 Thread Ken Ferry
Well, maybe not completely explicitly in this case. Use -drawInRect:fromRect:operation:fraction:. operation is NSCompositeSourceOver, which is "normal". The fraction is an opacity (when used with source-over). 0.75 would be 25% transparent. -Ken On Thu, Oct 1, 2009 at 1:46 PM, Kyle Sluder wrot

Re: Launching and application in 32-bit in Leopard

2009-10-06 Thread Ken Ferry
You could also use posix_spawn for this. See man posix_spawn, the spawn.h header, and in particular man posix_spawnattr_setbinpref_np. posix_spawn is a replacement for the fork/exec method of launching a process. -Ken On Tue, Oct 6, 2009 at 10:48 AM, Sean McBride wrote: > On 10/6/09 10:36 AM, J

Re: feeble anti-aliasing

2009-10-07 Thread Ken Ferry
On Wed, Oct 7, 2009 at 1:45 PM, Colin Howarth wrote: > On 7 Oct, 2009, at 22:19, Alastair Houghton wrote: > >> On 7 Oct 2009, at 21:11, Colin Howarth wrote: >> >> I'm surprised that the output on screen doesn't look better. >>> >> >> Usually Quartz does an extremely good job... >> > > I know. Th

Re: TIFFRepresentation, different TIFF format under Snow Leopard

2009-10-12 Thread Ken Ferry
On Mon, Oct 12, 2009 at 4:36 AM, Peter C wrote: > I just stumble into a feature (or a bug ?), NSImage TIFFRepresentation > produce RGB TIFF with a layer (when open under Photoshop). Previously it > produce plain RGB TIFF under OS 10.5 and below. This cause some part of my > programs interpret wro

Re: TIFFRepresentation, different TIFF format under Snow Leopard

2009-10-13 Thread Ken Ferry
I'm sure it isn't precisely the same. Take a look at IKSaveOptions. Ken Ferry Cocoa Frameworks > > Regards, > Sander > > > Actually, that occurred under 10.5 as well - what happens is that some >> operations, it would seem those involving Core Image, cause the >

Re: TIFFRepresentation, different TIFF format under Snow Leopard

2009-10-13 Thread Ken Ferry
On Tue, Oct 13, 2009 at 12:39 AM, Paul M wrote: > Note especially this quote: > "Adobe supports TIFF issues that directly relate to Adobe products. If a > TIFF file is incompatible with an Adobe product ... our goal is to isolate > and understand the problem so that it may be corrected in future

Re: Custom bitmap representation

2009-10-13 Thread Ken Ferry
On Mon, Oct 12, 2009 at 4:30 PM, Kelvin Chung wrote: > I have this "nonstandard" image format which I want to convert into a more > "standard" image format (say, PNG). I'm having difficulty on how to use > NSImageRep to do so. This "nonstandard" format can be converted into a > bitmap, so I tho

Re: Property List Format vs NSKeyedArchiver Format

2009-10-13 Thread Ken Ferry
On Tue, Oct 13, 2009 at 2:40 PM, Jens Alfke wrote: > > On Oct 13, 2009, at 1:08 PM, Bridger Maxwell wrote: > > I would like to read more on the NSKeyedArchiver XML format, but can't >> find >> documentation on it. Is it open? >> > > No. It's undocumented and could change in the future; writing c

Re: [UTI] Anyway to retrieve the UTI of a file without having to use a FSRef?

2009-10-13 Thread Ken Ferry
On Mon, Oct 12, 2009 at 3:45 PM, Jens Alfke wrote: > > On Oct 12, 2009, at 3:36 PM, Iceberg-Dev wrote: > > Wouldn't there be an API I didn't see in Foundation that lets you obtain >> the type without having to convert, at least, a NSURL to a FSRef? >> > > In 10.5 there were a bunch of mismatches

Re: Property List Format vs NSKeyedArchiver Format

2009-10-14 Thread Ken Ferry
On Wed, Oct 14, 2009 at 7:47 AM, Michael Ash wrote: > On Tue, Oct 13, 2009 at 6:24 PM, Ken Ferry wrote: > > Nor is there anything stopping you from dropping in classes written by > > someone else. You could use > > MAKeyedArchiver<http://www.mikeash.com/?page=softwa

Re: Malloc leak from ImageIO library

2009-10-15 Thread Ken Ferry
Hi Karolis, That one's a false positive. The JPEG2000 library allocates memory at pointer p, but holds onto a pointer q and constant k such that q + k is p. Leaks cannot tell that the app can still get at the pointer, so it thinks the memory has been leaked. Of course, one never wants to see fal

Re: How to detect and disable/delay sleep event in cocoa for some critical threads to complete

2009-10-15 Thread Ken Ferry
Hi Parimal, See NSWorkspace. NSWorkspaceWillSleepNotification Posted before the machine goes to sleep. An observer of this message can delay sleep for up to 30 seconds while handling this notification. -Ken On Thu, Oct 15, 2009 at 10:36 PM, Parimal Das wrote: > Hi All > > When my app is doing

Re: GC and atomic getters/setters

2009-10-17 Thread Ken Ferry
On Sat, Oct 17, 2009 at 5:52 PM, Kyle Sluder wrote: > On Sat, Oct 17, 2009 at 5:35 PM, Michael Ash > wrote: > > This just leaves the writes. I assume that the GC write barrier > > includes a memory barrier, unless someone wants to tell me otherwise. > > If so, then there's no problem at all. > >

Re: GC and atomic getters/setters

2009-10-17 Thread Ken Ferry
On Sat, Oct 17, 2009 at 6:32 PM, Kyle Sluder wrote: > On Sat, Oct 17, 2009 at 6:20 PM, Ken Ferry wrote: > > The issue concerns the order of in which changes to memory are observable > by > > other processors. > > Okay, and the read example is immune because you have to r

Re: Crash drawing image

2009-10-24 Thread Ken Ferry
If you have extracted this to a test project, does that mean you now have a reproducing case whose source you can share? If so, why don't you put it up somewhere. You could also try doing a Build and Analyze in Xcode. It is possible to make memory management mistakes in gc, and the analyzer will c

Re: Crash drawing image

2009-10-25 Thread Ken Ferry
here: > > http://dl.getdropbox.com/u/550950/gc-crash.zip > > On Sat, Oct 24, 2009 at 11:18 PM, Ken Ferry wrote: > > If you have extracted this to a test project, does that mean you now > > have a reproducing case whose source you can share? If so, why don't > > you put it

Re: incorrect bitmap date from NSBitmapImageRep from NSDate

2010-03-12 Thread Ken Ferry
Hi, Please go down to the phrase "apps are rather fond of hardcoding bitmap formats" in the AppKit release notes. http://developer.apple.com/mac/library/releasenotes/cocoa/appkit.html > If the latter I suspect that your file is not in the needed format. Does your image have alpha? format is bm

Re: Better sorting using threads?

2010-03-12 Thread Ken Ferry
No, that would mean that you tried to mutate a non-mutable dictionary. :-) You were getting lucky before in that some dictionary was passed to you that was typed as NSDictionary, but _happened_ to be of the subclass NSMutableDictionary. _That's_ what changed on you. Be aware that if you send -co

Re: Better sorting using threads?

2010-03-15 Thread Ken Ferry
standard cases you'll be getting the same behavior as with the un-subclassable CFArray and CFDictionary. -Ken > > --aj > > -- > *From:* Jeffrey Oleander > *To:* Gwynne Raskind ; Ken Ferry < > kenfe...@gmail.com>; Andrew James > &

Re: NSImage and NSBitmapImageRep

2010-03-16 Thread Ken Ferry
You'd add an NSBitmapImageRep to an NSImage with -[NSImage addRepresentation:]. However, an NSImage is not going to be any easier to draw rotated than an NSBitmapImageRep. You can draw rotated by changing the coordinate system right before you draw your image, drawing, and putting it back. See

Re: Saving jpeg data

2010-03-30 Thread Ken Ferry
Hi John, This would mean that you're assuming that a particular NSImageRep retrieved from an NSImage is an NSBitmapImageRep, and it isn't. -Ken On Tue, Mar 30, 2010 at 1:37 PM, John Nairn wrote: > My application now saves jpeg thumbnail data from an NSImage of a bit map > by using > > [NS

Re: How to get tiff from clipboard and convert to bmp?

2010-04-01 Thread Ken Ferry
On Thu, Apr 1, 2010 at 8:44 PM, Kyle Sluder wrote: > On Thu, Apr 1, 2010 at 7:35 PM, zhiy xue wrote: > > I want to support get *.tiff data from clipboard, and convert it to bmp > > format. Below is my code, but it will crash in > > GetGraphicsImporterForDataRef. Could you please help? Many thank

Re: NSImageView Will Not Alias Images

2010-04-06 Thread Ken Ferry
On Tue, Apr 6, 2010 at 2:58 PM, Jens Alfke wrote: > > On Apr 6, 2010, at 1:17 PM, Chris Tracewell wrote: > > I am trying to get NSImageView to alias dropped images, but it refuses. >> > > Nitpick: you mean "antialias". Aliasing is what creates the jaggies, > antialiasing smooths them away. > > >

Re: NSImageView Will Not Alias Images

2010-04-06 Thread Ken Ferry
On Tue, Apr 6, 2010 at 5:24 PM, Chris Tracewell wrote: > > On Apr 6, 2010, at 4:50 PM, Ken Ferry wrote: > > > On Tue, Apr 6, 2010 at 2:58 PM, Jens Alfke wrote: > >> >> On Apr 6, 2010, at 1:17 PM, Chris Tracewell wrote: >> >> I am trying to get N

Re: NSImageView Will Not Alias Images

2010-04-12 Thread Ken Ferry
On Mon, Apr 12, 2010 at 8:59 AM, Chris Tracewell wrote: > > On Apr 6, 2010, at 8:16 PM, Ken Ferry wrote: > > This was once true, but is out of date. I'd like to see a test app. For >>> example, how do you know you aren't getting antialiasing? It may be that >

Re: Blend mode 'darken' for NSImage?

2010-04-18 Thread Ken Ferry
Ah, so your problem is that not every CG blend mode is available as an NSCompositingOperation? If you would, please file a quick bug mentioning that you needed this. If you're running on 10.6, you can use -[NSImage CGImageForProposedRect:context:hints:] to get a CGImage, then draw the CGI

Re: Blend mode 'darken' for NSImage?

2010-04-18 Thread Ken Ferry
On Sun, Apr 18, 2010 at 8:30 PM, Izak van Langevelde wrote: > > On 2010-04-18, at 11:00 PM, Ken Ferry wrote: > > > Ah, so your problem is that not every CG blend mode is available as an > NSCompositingOperation? If you would, please file a quick bug mentioning > that you need

Re: Carbon is C++?

2010-04-19 Thread Ken Ferry
On Mon, Mar 1, 2010 at 4:03 AM, Greg Parker wrote: > On Feb 28, 2010, at 7:24 PM, Erik Buck wrote: > > I disagree. I have written very low latency device drivers in > Objective-C. Why do you think Objective-C has too much "latency" for audio? > When properly used, Objective-C programs are no m

Re: blocks and autorelease weirdness

2010-04-19 Thread Ken Ferry
On Mon, Apr 19, 2010 at 3:09 AM, Henk Kampman wrote: > > On 19 apr 2010, at 11:41, Jean-Daniel Dupas wrote: > > > > > > > Le 19 avr. 2010 à 11:35, Henk Kampman a écrit : > > > >> Have a look at the following code > >> > >> -(void) test > >> { > >> testString = NULL; > >> > >> dispatch_as

Re: using coregraphics with vector art from illustrator

2010-04-19 Thread Ken Ferry
On Mon, Apr 19, 2010 at 4:31 PM, Jens Alfke wrote: > > On Apr 19, 2010, at 3:54 PM, Philip Mobley wrote: > > Would that make a opaque white box around the shape? What about >> transparency... would that be retained or would it be flattened? >> > > No, there's no frame. It gets drawn as a PDF, s

Re: Why is compiler warning for +setKeys:triggerChangeNotificationsForDependentKey: ??

2010-04-20 Thread Ken Ferry
Other reasonable responses aside, what did you #import? If you #import'd Cocoa/Cocoa.h, I would be surprised to see this. If you brought in only NSObject.h, well, the declaration isn't in that file. -Ken On Tue, Apr 20, 2010 at 6:48 PM, Steve Cronin wrote: > Folks; > > Subclassed NSObject now

Re: Getting a bezier path for a character

2010-04-29 Thread Ken Ferry
On Thu, Apr 29, 2010 at 10:28 PM, Graham Cox wrote: > > On 30/04/2010, at 2:21 PM, danchik wrote: > > > mine did not, > > Did not what? > > > > so I think I might have used context incorrectly: > > > > I had a different context to draw into so the code was : > > > > [NSGraphicsContext saveGraphic

Re: Getting a bezier path for a character

2010-04-29 Thread Ken Ferry
On Thu, Apr 29, 2010 at 11:46 PM, Ken Ferry wrote: > On Thu, Apr 29, 2010 at 10:28 PM, Graham Cox wrote: > >> >> On 30/04/2010, at 2:21 PM, danchik wrote: >> >> > mine did not, >> >> Did not what? >> >> >> > so I think I might hav

Re: premultiplying alpha

2010-05-04 Thread Ken Ferry
On Tue, May 4, 2010 at 9:30 AM, David Duncan wrote: > On May 4, 2010, at 8:57 AM, Thomas Davie wrote: > > > After much searching about, I discovered (contrary to what the docs say), > that NSBitmapImageReps do not always premultiply their r/g/b by their alpha. > > I think you're misreading somet

Re: [[NSFileManager alloc] init] considered thread-safe

2010-05-04 Thread Ken Ferry
Jens is exactly right. If you are going to use the delegate, you must make your own instance of NSFileManager. Clearly - if you did that with the shared manager, you and other threads would fight over it. NSFileManager is otherwise threadsafe. There's an open bug to rev the docs. -Ken On Tue,

Re: [[NSFileManager alloc] init] considered thread-safe

2010-05-04 Thread Ken Ferry
On Tue, May 4, 2010 at 11:27 PM, Quincey Morris wrote: > On May 4, 2010, at 22:32, Ken Ferry wrote: > > > Jens is exactly right. > > > > If you are going to use the delegate, you must make your own instance of > NSFileManager. Clearly - if you did that with the shar

Re: simple CATextLayer scaling problem

2010-05-11 Thread Ken Ferry
On Mon, May 10, 2010 at 6:56 PM, douglas welton < douglas_wel...@earthlink.net> wrote: > > CALayer is not KVO-compliant for its properties. > > Kyle... Would you provide a pointer to where this is explicitly stated in > the documentation. thx > No property should be treated as KVO compliant un

Re: [[NSFileManager alloc] init] considered thread-safe

2010-05-14 Thread Ken Ferry
On Wed, May 5, 2010 at 11:33 AM, Michael Ash wrote: > On Wed, May 5, 2010 at 2:29 PM, Jens Alfke wrote: > > > > On May 5, 2010, at 8:50 AM, Michael Ash wrote: > > > >>> Delegates are the only reason the doc says anything other than "go > nuts". > >>> This is what both Jens and I were trying to

Re: [[NSFileManager alloc] init] considered thread-safe

2010-05-14 Thread Ken Ferry
On Fri, May 14, 2010 at 1:34 PM, Michael Ash wrote: > On Fri, May 14, 2010 at 1:12 PM, Ken Ferry wrote: > > On Wed, May 5, 2010 at 11:33 AM, Michael Ash > wrote: > >> > >> On Wed, May 5, 2010 at 2:29 PM, Jens Alfke wrote: > >> > > >&

Re: NSDrawThreePartImage - Strange scaling behavior, is it supposed to do that?

2010-05-14 Thread Ken Ferry
Yes, this is the intended behavior. See the header for details. You seem to be looking for the nine part draw. /* Draw an image from two end caps and a fill. The end caps are scaled proportionally to match the thickness of the destination frame. In the horizontal case, the startCap is drawn i

Re: Cracks in image using NSDrawThreePartImage

2010-05-19 Thread Ken Ferry
Hi BJ, File a bug with a test case that shows the problem. I would expect there to be seams due to rounding error if you look in pixie, but I have never seen a case where it was visible to the eye at actual scale. -Ken On Wed, May 19, 2010 at 1:41 PM, B.J. Buchalter wrote: > Hi Folks, > > I h

Re: Cracks in image using NSDrawThreePartImage

2010-05-19 Thread Ken Ferry
On Wed, May 19, 2010 at 2:46 PM, Ricky Sharp wrote: > > On May 19, 2010, at 4:30 PM, Ken Ferry wrote: > > > File a bug with a test case that shows the problem. > > > > I would expect there to be seams due to rounding error if you look in > pixie, > > but I

Re: Forcing NSImage to cache images at certain sizes

2010-05-21 Thread Ken Ferry
Hi BJ, On Fri, May 21, 2010 at 2:44 PM, B.J. Buchalter wrote: > I read the NSImage and Cocoa drawing guide docs, which tends to indicate > that calling drawInRect:fromRect:operation:fraction: on an NSImage will > cause it to create a cached image rep that matches the scaled image so that > the n

Re: Forcing NSImage to cache images at certain sizes

2010-05-22 Thread Ken Ferry
On Sat, May 22, 2010 at 12:14 AM, B.J. Buchalter wrote: > > On May 21, 2010, at 10:10 PM, Ken Ferry wrote: > > Hi BJ, >> >> On Fri, May 21, 2010 at 2:44 PM, B.J. Buchalter wrote: >> I read the NSImage and Cocoa drawing guide docs, which ten

Re: Generating PDF images (+followup question)

2010-05-27 Thread Ken Ferry
On Thu, May 27, 2010 at 8:40 PM, Graham Cox wrote: > Thanks Kyle, that seems to look like a fruitful approach. I'm doing the > following, which appears to be enough, i.e. it works. But should I be doing > anything else? > > >NSSize size = [self bounds].size; >NSRect destRect = NSZ

Re: Generating PDF images (+followup question)

2010-05-27 Thread Ken Ferry
rted). > > I've read all the documentation on flipped coordinates and now the blog > post as well. I'm afraid I'm just as confused as ever. What I need is a > clear way through this mess. Turning off all flippedness seemed to be that > but isn't. Now I ha

Re: Generating PDF images (+followup question)

2010-05-27 Thread Ken Ferry
(Also, again for others following along, on 10.6 you just pass YES for respectFlipped in -[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:]. The implementation is quite similar to the method Paul gives in the post.) On Thu, May 27, 2010 at 11:17 PM, Ken Ferry wrote: >

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Ken Ferry
Hi Bill, Thanks for the postmortem. Would you mind filing bugs for the items you think are too difficult? On Thu, May 27, 2010 at 12:43 PM, Bill Appleton < billapple...@dreamfactory.com> wrote: > hi all, > > > I just ported a huge code base to Cocoa, Core Graphics, Core Audio, and > QuickTime.

Re: Generating PDF images (+followup question)

2010-05-28 Thread Ken Ferry
Heh. Okay, glad that made sense, but as discussed in all the other resources, yes, context flippedness is a piece of _metadata_ orthogonal from the CTM. You may consult it to get the high level notion of which way should be considered "up". On Fri, May 28, 2010 at 12:22 AM, Graham Cox wrote: >

Re: Monster memory leak and I can't figure out why

2010-06-01 Thread Ken Ferry
On Tue, Jun 1, 2010 at 11:22 AM, Jens Alfke wrote: > > On May 31, 2010, at 6:41 PM, Ken Tozier wrote: > > > What's happening is that if I comment out the line that initializes a new > image, the memory leak disappears. I've tried forcibly releasing the images, > tried autoreleasing them, tried cr

Re: icon sizes

2010-06-04 Thread Ken Ferry
On Fri, Jun 4, 2010 at 2:39 PM, Jens Alfke wrote: > > On Jun 3, 2010, at 10:01 PM, Shane wrote: > > > I'm going to have some icons made for my app, and I'm wondering to > > what size they should be made. > > For app and document icons: 512x512 is the maximum icon size on 10.6. If > you make an ic

Re: Monster memory leak and I can't figure out why

2010-06-05 Thread Ken Ferry
// Option 2 NSImage *image = [[NSImage alloc] initWithContentsOfFile: inPath]; /* do some stuff */ [image release]; It seems very likely that the error is in the "do some stuff". I bui

Re: Image Value Transformer setting image alpha less than 1.0

2010-06-14 Thread Ken Ferry
On Mon, Jun 14, 2010 at 2:16 AM, Gustavo Pizano wrote: > Hello Graham. > > So this is what I did, and its drawing ok. > > I subclasses the NSConllectionViewItem, in the copyWithzone method I > weakly assigned self to its view (custom NSView also), then in the view > subclass in the draw method

Re: LightTable Sample CoreAnimation Code

2010-06-24 Thread Ken Ferry
NSImage is also mentioned in the header comment for CALayer's contents property as of 10.6. -Ken On Jun 23, 2010, at 7:13 PM, Kyle Sluder wrote: > On Wed, Jun 23, 2010 at 7:09 PM, Alexander Heinz > wrote: >> I've been attempting to make sense of Apple's "LightTable" sample code for >> Core

Re: Weak-linking a class

2010-06-27 Thread Ken Ferry
See also < http://www.sealiesoftware.com/blog/archive/2009/09/09/objc_explain_Weak-import_classes.html >. -Ken On Sun, Jun 27, 2010 at 7:02 AM, Graham Cox wrote: > > On 27/06/2010, at 11:55 PM, Andy Lee wrote: > > > NSClassFromString()? Or maybe some objc_xxx runtime function? > > > > --Andy >

Re: Text rendered in NSImage is fuzzy

2010-06-27 Thread Ken Ferry
I don't think this is likely to be the problem in this case. Text looks good no matter where you draw it. In this case, I think the problem is more likely either (1) A lack of what Quartz calls font smoothing, more popularly known as subpixel rendering

Re: NSImage drawing on 10.5 issue

2010-06-30 Thread Ken Ferry
On Mon, Jun 28, 2010 at 8:24 PM, Graham Cox wrote: > I have an NSImage which I generate by specifically creating a NSPDFImageRep > and adding that to an empty image. Later this same image rep is used to > write the image as a PDF file to disk. > > An interface displays these images, either loaded

Re: resizing window containing NSView with CALayer

2011-08-08 Thread Ken Ferry
On Mon, Aug 8, 2011 at 5:23 AM, Graham Cox wrote: > > On 08/08/2011, at 9:35 PM, julius wrote: > > > When I go and drag the resize handle to make the window as small as I can > make it, i.e. so the window's content rect has zero height then the view > misbehaves, i.e. the top of the view shifts f

Re: Keeping grayscale image grayscale

2011-10-12 Thread Ken Ferry
> If you want to create an NSImage/NSImageRep with special properties: there > is a rule of thumb: don't use lockFocus. > --> Re: bad behavior from unlockFocus on 10.6 by Ken Ferry. Another rule of thumb is: if you need -[NSImage TIFFRepresentation] you do > something wrong

Re: Keeping grayscale image grayscale

2011-10-19 Thread Ken Ferry
On Tue, Oct 18, 2011 at 6:26 AM, Jonathan Taylor wrote: > Belated thanks for the various replies to my question. I'm working through > the posted code and links now and looking at what I can learn from it. One > query though: > > On 12 Oct 2011, at 16:42, Heinrich Giesen wrote: > > Another rule of

Re: Is it possible to use Radio Group(NSMatrix) in a different way?

2011-10-19 Thread Ken Ferry
On Mon, Oct 17, 2011 at 10:26 AM, Fritz Anderson wrote: > On 15 Oct 2011, at 9:18 AM, Bill David wrote: > > > I need implement a UI as the following on my Mac OS 10.6: > > > > option 1 > >detailed configuration for option 1 > > option 2 > >detailed configuration for option 2 > > option 3 >

Re: Help with view constraints

2011-10-28 Thread Ken Ferry
Hi David, The question seems a little general to me. Where did you have problems doing what you wanted to do? On Fri, Oct 28, 2011 at 4:02 PM, Quincey Morris < quinceymor...@rivergatesoftware.com> wrote: > On Oct 28, 2011, at 14:53 , David Catmull wrote: > > > - What is the simplest way to adju

Re: How to draw over a control in an NSView

2011-10-30 Thread Ken Ferry
On Oct 30, 2011, at 2:06 PM, Jens Alfke wrote: > > On Oct 30, 2011, at 12:46 PM, Alexander Reichstadt wrote: > >> given a custom NSView using drawRect to draw, say, a blue rectangle, >> controls inside that view are always in front of the blue rectangle. Is >> there a way to draw above contro

Re: How to open CMYK TIF in Cocoa?

2012-01-25 Thread Ken Ferry
NSImage handles everything CGImage does, and this includes CMYK. NSImage loads bitmaps with ImageIO, which is what you'd do at the CG layer. If the file isn't being read correctly, I would try to investigate if the file was bad. -ken On Jan 25, 2012, at 2:47 PM, douglas welton wrote: > Wh

Re: NSLayoutManager's setDefaultAttachmentScaling: not working in custom PDF NSContexts.

2012-01-31 Thread Ken Ferry
On Jan 30, 2012, at 3:58 PM, Gus Mueller wrote: > > On Jan 30, 2012, at 2:22 PM, Michael Nickerson wrote: > >> Hmm, I don't have an answer for you, but I looked at the code. I did a >> little subclassing of NSLayoutManager, and it looks like the text attachment >> cell is just ignoring the s

Re: NSLayoutManager's setDefaultAttachmentScaling: not working in custom PDF NSContexts.

2012-01-31 Thread Ken Ferry
On Jan 31, 2012, at 5:57 AM, Ken Ferry wrote: > On Jan 30, 2012, at 3:58 PM, Gus Mueller wrote: > >> >> On Jan 30, 2012, at 2:22 PM, Michael Nickerson wrote: >> >>> Hmm, I don't have an answer for you, but I looked at the code. I did a >>>

Re: NSBitmapImageRep with floating point values

2011-02-04 Thread Ken Ferry
On Thu, Feb 3, 2011 at 2:37 PM, David Duncan wrote: > On Feb 3, 2011, at 1:32 PM, Paul Morel wrote: > > > in my application I would need to save an image where pixel intensities > are floating point values. Apparently TIFF can support that.But I don't know > I can do that in Objective-C. I saw th

Re: [NSBitmapImageRep getBitmapDataPlanes] copying data?

2011-02-21 Thread Ken Ferry
On Mon, Feb 21, 2011 at 3:49 PM, Ken Thomases wrote: > On Feb 21, 2011, at 5:07 PM, Jonathan Taylor wrote: > > > So as far as my situation goes, what I'm after is an efficient way of > starting from a path to some sort of raster image and obtaining a raw pixel > buffer I can read. [Obviously if a

Re: NSInternalInconsistencyException

2011-02-23 Thread Ken Ferry
NSCell does not itself have storage for a target or action, NSActionCell does. You can still ask for a target or action, but you'll always get nil and NULL. It's basically drawing-only. - (id)target { return nil; } - (SEL)action { return (SEL)0; } So, I suppose the question is wh

Re: Faster text drawing with configurable stroke width

2011-03-16 Thread Ken Ferry
On Sun, Mar 13, 2011 at 3:03 PM, George Nachman wrote: > Hi cocoa-dev, > > I'm currently drawing text one character at a time with > -[NSAttributedString > drawWithRect:options:], and it is really slow. I'm looking for a faster > alternative. > > I draw one character at a time because I need exac

Re: NSColorWell inside a custom NSCell

2011-04-23 Thread Ken Ferry
On Thu, Apr 21, 2011 at 5:52 PM, Graham Cox wrote: > > On 21/04/2011, at 4:17 PM, Bryan Hansen wrote: > > > Am I on the right track with this? Is there a better way to get a bunch > of movable colorwells within a custom control? > > > I'd say no, you're not on the right track and yes, there's a b

Re: finder eject images

2011-07-05 Thread Ken Ferry
, and if it isn't there, you can file a bug but should use your own artwork. (As it says in the NSImage header.) Ken Ferry Cocoa Frameworks > > For those hoping to use the CoreTypes.bundle ICNS, I have not seen any of > them disappear or change name in over 8 years with OS updates

  1   2   3   4   >