Questions tagged [macos-carbon]

Carbon is Apple's previous application-development framework for Mac OS X for applications that needed to remain compatible with the Classic Mac OS.

Carbon is Apple's previous application-development framework for Mac OS X (), which existed primarily for applications that needed to remain compatible with the Classic Mac OS. Most of the original Carbon APIs existed both on Mac OS X and in a dynamic library (CarbonLib) for Mac OS 9.

Much of it is now deprecated and unavailable to 64-bit applications as of Mac OS X 10.6, but not all. Core Services (including the File Manager and even the Resource Manager) and much of Application Services (including ) are 64-bit-compatible, as are a few Carbon APIs, such as some parts of the Carbon Event Manager. Be sure of your ground before you tell a questioner they need to switch to Cocoa (); the API they're using may be perfectly safe, and may even be the only API specifically designed for their task (as part of Carbon Event Manager is for hotkeys).

Note that just because an API is in the Legacy Mac OS X Reference Library doesn't mean everything in it is deprecated or doomed. Again, Carbon Event Manager is an example.

547 questions
0
votes
1 answer

Send a keystroke to OS X programmatically

How would you simulate the keystroke ö on Mac OS X programmatically? This isn't just a randomly chosen character, I know you can simulate all ASCII characters as well as some special ones like Esc, Backspace, etc using either an embedded…
lmirosevic
  • 15,787
  • 13
  • 70
  • 116
0
votes
2 answers

When are -framework and -I/System/.../Example.framework/Headers/ needed?

I am trying to compile a JNI library which uses carbon from the command line. If I don't -I/System/.../JavaVM.Framework/Headers/, It can't find any of the jni types, and gives errors. If I just -I/System/.../FlatCarbon.framework/Headers but don't…
Jeremy Salwen
  • 8,061
  • 5
  • 50
  • 73
0
votes
2 answers

Programmatically obtain font name of selected text in TextEdit

After trying for two months I find out how to obtain AttributedString from any text range of TextEdit (or any NSTextView). my code is as: AXUIElementRef systemWideElement = AXUIElementCreateSystemWide(); AXUIElementRef focussedElement =…
mh taqia
  • 3,506
  • 1
  • 24
  • 35
0
votes
2 answers

How to set volume name when converting MacOSPath to POSIX

In a Carbon app I need to convert an HFS style MacOS path into a POSIX one that can be used in an fopen() call. For example: my Vol:myFolder:myFile.jpg to something like: /my Vol/myFolder/myFile.jpg If my Vol is my sytem disk, /myFolder/myFile.jpg…
Bill
  • 305
  • 6
  • 25
0
votes
1 answer

Opening a carbon c++ program from a custom url on OSx

I have been able to set the plist for my project to open the project with a given url. However, I can't get it to pass params to the application (custom urls are built based on the user) Is there a way to pass the params as command line arguments?…
Bear
  • 486
  • 2
  • 8
  • 16
0
votes
1 answer

Getting keyboard state using GetKeys function

Does anyone know how to get any key state (pressed or no) by GetKeys function? In other words how to handle this function: bool result = isPressed(kVK_LeftArrow); Thankyou.
mh taqia
  • 3,506
  • 1
  • 24
  • 35
0
votes
4 answers

Monitor keyboard events inside process (Process Wide)

I can install system wide keyboard monitor by the below instructions: CGEventRef eventCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *userData) { } CFMachPortRef eventTap = CGEventTapCreate(kCGHIDEventTap, …
mh taqia
  • 3,506
  • 1
  • 24
  • 35
0
votes
1 answer

How to get the input source of an NSTextView

I set up a small test app that has the App Delegate set up as the delegate for the NSTextView. With that, I supply the the following NSTextView delegate method: - (BOOL)textView:(NSTextView *)aTextView…
user1464024
0
votes
1 answer

How can I copy an eps file to clipboard/pasteboard?

My program creates adobe ai or (eps) file and I want to copy it to pasteboard. I copied sample ai object in adobe illustrator and Inspect pasteboard by "pasteboard inspector": My code is below but copy nothing to pasteboard: void copyEPS(CFDataRef…
mh taqia
  • 3,506
  • 1
  • 24
  • 35
0
votes
3 answers

How do I take a screengrab of a single window using Cocoa or Carbon on OS X?

I need to be able to identify a single window on the user's screen and take a screen capture of it. The screen data is to be stored in memory and not written to disk. This is already supported through the commandline tool /usr/sbin/screencapture or…
Michael Labbé
  • 12,017
  • 4
  • 27
  • 36
0
votes
3 answers

Why is Xcode Giving Me These Errors?

The error I get is Xcode saying 3 things are un-declared (see below picture) alt text http://snapplr.com/snap/ks4h But in the Header File I have declared them (see below picture) alt text http://snapplr.com/snap/htmb Why I am getting these errors…
Joshua
  • 15,200
  • 21
  • 100
  • 172
0
votes
1 answer

CGrafPtr to WindowRef

NPAPI in MacOs gives me CGrafPtr in NPWindow structure, I need a WindowRef. Is there a way to get WindowRef from CGrafPtr ? Thanks!
user1226710
0
votes
1 answer

Replace AEAddressDesc in apple event

I have an apple event, and I need to resend this event to the other process. Can anyone tell me how? static void GetEvent(AppleEvent *event) { RgnHandle cursorRgn = NULL; Boolean gotEvent; gotEvent =…
Lexandr
  • 679
  • 1
  • 6
  • 22
0
votes
1 answer

Library insertion/injection not work with open command

I writed a dynamic library that loaded into target application by environment variable DYLD_INSERT_LIBRARIES, the dylib works fine when application executed from terminal by this commands: $ export DYLD_INSERT_LIBRARIES=/path/to/mylib.dylib $…
mh taqia
  • 3,506
  • 1
  • 24
  • 35
0
votes
1 answer

How to set the kMDItemKind of a saved document on Mac OS X?

I have a legacy app (minimally ported from Mac System 7 to Carbon to Cocoa) where users are reporting that the kMDItemKind metadata, as reported my mdls, of text files saved by the app seem to be set to "Microsoft Excel 97-2004 workbook". The…
hotpaw2
  • 70,107
  • 14
  • 90
  • 153
1 2 3
36
37