carbon

Mac sample code using USB and CFRunLoopSource

I'm trying to (re-)write a program that uses USB controlled scanners. I've got my USBIOInterfaceInterface set up, so I can send and receive messages over the pipes. I am successfully calling WritePipeTO and ReadPipeTO synchronously but I want to read from the scanner asynchronously. I've tried using ReadPipeAsyncTO, but the callback nev...

How do I find working examples of Cocoa/Carbon API?

I find it hard to find some working examples of Cocoa/Carbon framework functions, whereas there are well documented function prototypes from Apple. For example, LSOpenItemsWithRole function has well defined prototype, but I guess some examples would be a great help for a mac programming beginners like me. How can I find some working ...

On Mac OS X, how to create multi-touch event and send to another application?

I want to "simulate" a multi-touch event for another application, e.g., simulate a zoom-in gesture on iPhoto. I searched many sources but can't find an answer for that. It seems the most common way to sending an event to other application is with script bridge, getting a SBApplication and then send an AppleEvent. But it seems the genera...

Overlay for 3rd party application

Hi, I'm looking for a way to display an overlay (hud) for a third party application on MacOSX. It should look like this. My working steps would be: find window by title get resolution of window create own invisible window check for moving events of target window I'm not very familiar with MacOS programming with Carbon and Cocoa and...

Access Cocoa and/or Carbon to automatically start on boot on OS X (on C++ also using QT)

I have a C++ application using the QT framework. I'm trying to add an option for the user to be able to set the program to start automatically on startup. My development machine is running OS X 10.6. As my main Mac reference, I'm using this Apple documentation. According to the documentation, there are two recommended ways of doing thi...

How do i print a image in images tiles in Cocoa printing

I had Carbon code which prints image as tiles in . But now for 64 bit i want to change that into carbon. I have a CGContext which i need to print and which holds the new tile every time. I cant find a suitable workflow. Any help would appreciated ...

How do i handle dock icon click using Apple Carbon

Hi folks! Is there a way to handle running application dock icon click using apple carbon? Found nearly nothing on web, so asking here. Any help or code appreciated ...

How to use multiple Help Books in a Cocoa Application

I managed to setup the the online help system for the main application help which is using the CFBundleHelpBookFolder and CFBundleHelpBookName from the bundle Info.plist. But i can't display other help files. I use the following AHRegisterHelpBook code which gets called with the help bundle path like "/Users/llothar/Python.help". The ...

Getting notified when a VPN connection disconnects

How can I, within my Cocoa app, get a notification when the currently running VPN connection disconnects? I'm running Snow Leopard. ...

Formatting usb flash drive on Mac OS X

Good Day, How can I format an USB flash drive using cocoa frameworks or carbon? Is there any functions to make it? Thanks, Vlad ...

How to get default volume on Mac OS X 64-bit?

Hi everyone, What's the way to get default volume on Mac 64-bit? I have a code like that: GetVolParmsInfoBuffer buf_64 = { 0 }; status = FSGetVolumeParms(vol_ref, // use default volume The problem is that I can't pass 0 in vol_ref. On Mac 32-bit I could write: GetVolParmsInfoBuffer buf_...

Detect if user presses button on a Wacom tablet

Hi, I was wondering if it is possible in Cocoa/Carbon to detect whether a key combination (e. g. Ctrl + Z) comes from a Wacom button or the keyboard itself. Thanks best xonic ...

EMKeyChain Problems

I want to store the FTP Password in a Keychain rather than in the NSUserDefaults. So I used a wrapper called EMKeyChain to store the problem. The problem being is that it won't load the password when the Preference Window is loaded: Note: FTPPassword is a IBOutlet for NSTextField in PreferenceController.h -(void)windowDidLoad { //Check...

How can I stop HIToolbox from catching my exceptions?

This question follows on from my other question on why my app isn't being brought down by exceptions. The Problem When an exception is thrown on the main thread via an Action, the app still doesn't crash. As per Dave's answer to my original question, I've implemented the reportException category on NSApplication and set the uncaught e...

Extracting information from a MAC OS X application

Hi :-) I have a simple problem, I will be straighforward. Suppose I have a third-party cocoa application running that has a chat box inside. Well, I need to capture the text inside that chat-box in real time from another application and write a logfile in real time with that information. I am sure there is a way, I just don't know whe...

CFMessagePort name conflict

I have created a worker thread that uses a CFRunLoop to receive messages from a CFSocket. Now I need to send other messages to the worker thread so a CFMessagePort looked ideal. However its entirely non obvious to use: The documentation states that the name parameter is needed when communicating between processes. In my worker thread I...

Displaying file copy progress using FSCopyObjectAsync

It appears after much searching that there seems to be a common problem when trying to do a file copy and show a progress indicator relative to the amount of the file that has been copied. After spending some considerable time trying to resolve this issue, I find myself at the mercy of the StackOverflow Gods once again :-) - Hopefully on...

How do I find the display size using Carbon

How do I adjust the height and width returned by CGDisplayBounds by the menu bar height and the dock height (or width if it attached to the side)? I need to do this using only Carbon calls. ...

Cocoa alternative for Carbon events for global hotkeys

I just read this article on how to create global hotkeys using Carbon events. In the comments the author mentioned, that he wouldn't probably use this technology anymore because it's the 'way to deprecation'. So far, so good. Now I'm looking for the Cocoa pendant. Does anyone have a hint where to search for it? I tried to google it for ...

Unable to start Flash Builder or any Eclipse Carbon version on Snow Leopard

I'm trying to load Adobe Flash Builder 4 on Snow Leopard 10.6.4, but got this crash message: Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000 Crashed Thread: 0 Dispatch queue: com.apple.main-thread Application Specific Information: Java information: Version: Java HotSpot(TM) Cl...