carbon

How can I determine the arguments for a private API function?

I want to create a replacement for the app switcher (aka 'cmd + tab'). I know that it's possible because Lite Switch X does it. What I've got achieved so far: By force quitting the dock and calling CPSRegisterForKey() (which is a private API function) I can prevent the default cmd+tab from working. The second step is two register the...

Getting error code from GetEventParameter

Here is a snippet of code I have to handle smooth scrolling. here is the output of the NSLog: 2010-06-21 16:04:10.524 PDFViewWXOSX[80161:a0f] first error: -9870 2010-06-21 16:04:10.525 PDFViewWXOSX[80161:a0f] second error: 0 2010-06-21 16:04:10.552 PDFViewWXOSX[80161:a0f] first error: 0 2010-06-21 16:04:10.553 PDFViewWXOSX[80161:a0f] se...

Unable to read a path with special characters in FSRef.

Hi All With this code I am trying to get the path in const char *pathPtr from fsRefAEDesc. It gives the correct name and path if there are no special characters in the name of file which is there in fsRefAEDesc. Now if path has some special characters /Users/XYZ/.rtf I don't get a correct fsRef from AEGetDescData(). I believe it has ...

How to find an FSRef from a directory ID and a volume number?

Given an FSRef of a directory, one can use FSGetCatalogInfo to find the volume reference number and the directory ID. Together, these two numbers should be enough to identify the directory. One way to go the other direction would be use FSMakeFSSpec( vRefNum, dirID, "\p", &fileSpec ) and then FSpMakeFSRef( &fileSpec, &dirRef ). Howeve...

Mac OS X Window Server vs. X11: the insane task.

Dedicated to all who likes low-level Window Server (CoreGraphicsPrivate.h, etc), X11 on Mac, SIMBL and other crazy stuff :) There's a simple X11-emulated application on Mac (like xterm, xeyes and so on) with one window. While running, X11 somehow creates a native Quartz window to represent this emulated application, and this window is a...

How to create an inaccessible window on Mac OS?

I mean a window which will not be accessible via Cocoa, Carbon or other CoreGraphics API for obtaining NSWindow *, WindowRef and others. Like X11 application on Mac does. Such a window that if you pass its window ID to [NSApp windowWithWindowID] or HIWindowFromCGWindowID() they both return NULL. Thanks! ...

kCFXMLParserSkipWhitespace and text element

I am using CFXMLParserCreate() with kCFXMLParserSkipWhitespace to parse some XML files. The option helps skipping the white spaces between XML tags like the space bwtween <foo> <bar> which is good. However, I just find out that it also caused text elements that contain only white space to be skipped, too. For example, the space between ...

Carbon or CF to list contents of a directory (OS X and C++)

How do I use Carbon or CoreFoundation (preferably the latter) to list the contents of a directory? ...

How to get menu item selected event in Carbon

I'm trying to handle events related to clicking on or pressing enter on a menu item using the Carbon API in OSX (Cocoa is not an option). I know about EventTypeSpec and kEventClassMenu and i've dug through the header files looking for the relevant kind constant to use, but i'm still a bit confused as to how I respond to the selection of...

Caps Lock events are not getting propogated to Qt dialog box and windows.

Hi All, I am working on the application whete I want to pass on the key strokes to a remote application. all key strokes I've done should get pass on to my remote application. The UI of this application is in Qt. all works fine if I remotely write any thing on TextEdit or any other mac native application but when I try to pass Capital l...

NSWindow that is unaffected by Expose

Is there any way to make a window completely unaffected by Expose, just like the Dock? Setting the level to NSDockWindowLevel doesn't help. I know about NSWindowCollectionBehaviorStationary, but I want the window not to fade when Expose is active. If it is not possible, is there any way to "unfade" the window after Expose fades it? ...

Window from nib in dylib

Hi, I'm quite new to the Mac but reasonably expirienced with windows. What I need is a window owned opened and closed by the library (dylib). This is very easy to do in MS Windows but seemsnto be hard under Cocoa. I used the code from apple's 'CocoaInCarbon' example with C++ Wrappers. But the 'NSApplicationLoad()' followed by 'NSBundle...

Selecting the first item in a popUpContextMenu

I work on a very keyboard intensive application. Both hands on the keyboard. No hands on the mouse. A user can, via the keyboard, popup a context menu, select an item and finally hit enter. [NSMenu popUpContextMenu] displays the menu without highlighting any item. The user will have to press arrow_down one time in order to highlight th...

Is there a library / framework that allows to program a Carbon application using C++ classes?

Is there any library that allows to create a Carbon application using C++ classes? ...

Qt or wxWidgets on Cocoa?

I was told that the newest Qt is Cocoa based, and as so, it's 64 bit. And Cocoa is Object-C based, whereas Qt is C++ based. How is that possible? I mean, how C++ based library can turn into Objective-C related one? Is this just using Objective-C++? Can any C++ library be Cocoa based using Objective-C++? ...

Set Focus to a Cocoa Window in Carbon App

Hello, I'm trying to create a Cocoa Window within an otherwise Carbon Application (it's an OpenGL API that uses AGL. Can't change it so don't comment on that). Here's a code snippit: WindowRef winref = static_cast<eq::AGLWindow*>(getOSWindow())->getCarbonWindow(); vc = [[SFAttachedViewController alloc] initWithConfig:config]; //load...

ShortcutRecorder record CMD+Tab

I'm trying to allow ShortcutRecorder to record CMD+Tab. The problem is that, even if ShortcutRecorder has the focus, if I press CMD+Tab, the application switcher appears. Is there any way of allowing ShortcutRecorder to "intercept" the CMD+Tab? Thanks! ...

Disable CMD+Tab application switcher

I'm trying to disable the CMD+Tab application switcher, so that my application can register that hotkey. I'm looking for something that applications like Witch and LiteSwitch X are able to do (i.e. allow users to use CMD+Tab as the hotkey for my application). How are they able to do that? ...

Window list ordered by recently used

I'm trying to create a window switching application. Is there any way of getting a list of the windows of other applications, ordered by recently used? ...

Window disappears when resizing in Carbon Simulator

I'm trying to build a resizable Carbon window as part of a tutorial. I am using Interface Builder 3.2.3 on Snow Leopard 10.6.4. If I create an empty Carbon project and add a window object from the Library (with Close, Minimize, Resize and Zoom buttons in the Inspector all checked), run the Carbon Simulator and then attempt to resize the...