carbon

List of all users and groups

I'm trying to get a list of all users and all groups on Mac OS X 10.5+. How can I do this? For example, the list of all users on my machine should return: _amavisd, _appowner, _appserver, _ard, _atsserver, _calendar, _carddav, _clamav, _coreaudiod, _cvmsroot, _cvs, _cyrus, _devdocs, _dovecot, _eppc, _installer, _jabber, _lda, _locatio...

Deleting non-empty folders and specific file types.

What is the best way to remove a folder, deleting all subfolders and files? What is the best way to remove files with a specific extension; e.g., if I want to remove only files with '.txt' extension? Cocoa or carbon. ...

Is it safe to call CFRunLoopStop from another thread?

Hi all, The Mac build of my (mainly POSIX) application spawns a child thread that calls CFRunLoopRun() to do an event loop (to get network configuration change events from MacOS). When it's time to pack things up and go away, the main thread calls CFRunLoopStop() on the child thread's run-loop, at which point CFRunLoopRun() returns in...

Strategies for porting Carbon code to Cocoa

I'm looking for strategies and articles on making Carbon code 64-bit ready. Carbon for 64-bit does not and will not exist. It's pretty much a dead end. So in order to bring Carbon application and toolkits to 64-bit their GUI part will have to be re-written in Cocoa and Objective-C, right? How can I minimize the effort I have to put in...

Which API can be used to _capture_ the mouse when moving OS X "Carbon" windows?

On request I have implemented support for moving an OS X window by dragging it using an area within the content part of the window, i.e replicating the drag and move functionality of the title bar but in another area. The problem I have yet to resolve is the fact that if the user drags the mouse quickly it can leave the window area and...

Carbon development on intel based mac

Hi, I am trying to make an application on mac.i am trying to develop a user authentication module that uses the OS authorization dialog and use its functionality in my application. i have two questions regarding the mac development; 1) Is there a possibility to port the carbon applications to cocoa? (i don't have any concern with ...

Carbon VS Objective-C & intel-based mac

Is it possible to develop carbon application in objective-C, moreover what if i don't have a power PC based mac and i have an intel-based mac, can i still develop applications for Carbon? Regards. ...

Globally hide mouse cursor in Cocoa/Carbon?

Is there a way to globally hide the mouse cursor for all apps in Cocoa (or Carbon)? Or at least replace it with something else? EDIT: Thanks for the input guys, but turns out Daniel Jalkut found the solution a while ago :) http://lists.apple.com/archives/carbon-dev/2006/Jan/msg00555.html ...

Get the current working directory of process with a pid programmatically on OS X

Is there a way to get the current working directory of a process using it's PID programmatically on OS X? Cocoa, Carbon, or AppleScript are all acceptable. It is not acceptable to send "pwd" to the current terminal window/tab (Do not want to affect the workspace). The linux command "pwdx" also is also unacceptable (just in case you re...

Equivalent of GetCursorPos() in Mac's Carbon

Background We're porting our PythonOgre-based games to Mac, and the publishers demand ability for mouse to leave the window. On Windows, we're going around OIS (Object-oriented Input System) for the purposes of mouse control; that is, we don't let OIS keep the mouse captured inside window borders, and then track the mouse cursor in scree...

Is there a programmatic way to refresh / reset a preview icon in Finder?

I noticed that while this applescript: tell application "Finder" {...} update itm with necessity {...} end tell refreshes normal Finder icons, on the other hand, it doesn't refresh the Preview icons under Leopard. I'm wondering if there's an AppleScript / Carbon / Cocoa / C way to refresh or reset a preview icon of a Finder file...

Carbon, LSUIElement, and showing a window

I have a Carbon LSUIElement application, which runs in the background (possibly with an icon in the menubar, depending on a pref) and occasionally needs to show a dialog to the user - sometimes in response to a user event, but sometimes in response to a background task failing or similar. (I'm using Qt 4.5, so the application is Carbon ...

How to monitor global modifier key state (in any application)?

I'm using some Carbon code in my Cocoa project for handling global key events (shortcuts) from other applications. Currently I have setup a kEventHotKeyReleased event handler and I can successfully obtain hot keys when my application is not active. That triggers some operation in my application. The problem I have with the behavior of k...

Creating a CFString object with JNA

I'm trying to get the hang of using JNA with Mac OS X. I want to access a Carbon library, for which there is no Cocoa equivalent, so Rococoa can't help me (I think...) I'm stuck when trying to call a Carbon function that requires CFStringRef as a parameter. How can I create a CFStringRef from a Java String? Here's my attempt so far: ...

What's the best way to find if the processor type is PPC or Intel in Cocoa? (Do I have to use Carbon?)

I need to get it as a string to use elsewhere in the program, I'm not worried about compiler settings. I found HowToGetHardwareAndNetworkInfo on CocoaDev, but it seemed a little intense when all I wanted to know is PPC vs. Intel. ...

Starting programming Mac OS X

I'm starting a Mac OS X app that will connect to a small website I'm currently developing. The idea is that the app will store a number of snippets on a local database and then sync with the website whenever it can. So my questions are: Carbon or Cocoa? SQLite for local storage / another solution? Is there any decent free text-edito...

Global Mouse Moved Events in Cocoa

Is there a way to register for global mouse moved events in Cocoa? I was able to register for the events using Carbon's InstallEventHandler(), but would prefer a Cocoa equivalent. I have looked for NSNotificationCenter events, but there doesn't seem to be any public event names (are there private ones?) Alternatively, is there a way to ...

Finding a word's frame (position and size) on the screen using Cocoa or Carbon

Here's a tough one: I need to be able to find a word's position and size (its frame) on the screen (its first occurence is enough, from there I should be able to get the next ones). For example, I would like to be able to detect word positions in (but not limited to) Word, Excel and PowerPoint for Mac, as well as Safari and others. Th...

Compiling Bochs on Mac os x Snow Leopard

Hi there, Was someone able to compile the Bochs simulator under Snow Leopard. Leopard worked fine for me but under Snow Leopard I get alot of problems related to the Carbon library... Ok, some more information was request. I compile with make on the shell; stanard build process coming with the bochs sources I was successfully able to ...

Carbon in Cocoa Crashing: EXC_BAD_ACCESS after NSAutoreleasePool is released

I'm developing a Cocoa user interface for a Photoshop CS3 plugin using Bindings. (Carbon in Cocoa, since PS is a Carbon app) I'm getting a EXC_BAD_ACCESS error when I close my modal NSWindow and the NSAutoreleasePool releases. I believe it has something to do with bindings and the control views I have in my nib file, because when I re...