carbon

migrating an application from carbon to cocoa

Hi, I am working on an application in which I need to migrate the whole code of it from carbon to cocoa.I have experience in programming of C,C++,python and Java during my college time and internship but have never touched objective C or have done any programming for Mac(Carbon and Cocoa) before this. So Can you please suggest me some ...

How to draw Truncated text with ATSUI.

Hi, How do i draw truncated text with ATSUI?? I have a legacy app which uses QuickDraw API. it uses StringWidth , TruncString and DrawString functions. I could replace the StringWidth and DrawString with ATSUI's ATSUMeasureTextImage and ATSUDrawText. However i could not find a way to truncate a string so that it fits into a rect. I use...

Programatically get hard drive info on OS X

I need a way to get complete hard drive info on OS X, meaning all hard drive model names, SATA/ATA controllers, volumes, disk identifiers, etc. I checked out diskutil, but it doesn't contain SATA controller info, system_profiler has all the information I need but its XML output is not necessarily organized as well as I'd like. Is there a...

Way to listen in on all Apple Events?

I'm looking for a way to listen in to all Apple Events send by any program to any other program. There was an app, AEMonitor, that used to do this but it is abandonware as of now. Is there a known way to do this via cocoa, carbon, etc? Any help MUCH appreciated. -- Target OS is 10.6 -- Carification: I'm looking to monitor ALL appl...

What is the correct JNA mapping for UniChar on Mac OS X?

I have a C struct like this: struct HFSUniStr255 { UInt16 length; UniChar unicode[255]; }; I have mapped this in the expected way: public class HFSUniStr255 extends Structure { public UInt16 length; // UInt16 is just an IntegerType with length 2 for convenience. public /*UniChar*/ char[] unicode = new char[255]; ...

Apple Events to Control Mouse Remotely

Hey, I'm not even sure where to begin with this question... I want to be able to send mouse-click events to another machine, as if the user had clicked on that machine. I can do it on the same machine via: CGEventSourceRef source = CGEventSourceCreate(NULL); CGEventType eventType = kCGEventLeftMouseDragged; CGPoint mouseCursorPosi...