Introducing "Deobjectivizer"

Charles Davis cdavis at
Sun Apr 10 20:22:22 CDT 2011


I've been working on a secret Clang-based project for a while, and now
I'm ready to share it with the world.

Introducing the "Deobjectivizer".

This is a program that scans framework bundle headers for Objective-C
constructs, and generates procedural C wrappers around them, so you can
call them from C. It uses Clang's libraries to parse, analyze, and
rewrite Objective-C headers into pure C headers, and then generate
corresponding source files containing the wrapper implementations. The
implementation of this tool is a little hackish at the moment, but it
suffices to generate a wrapper around the entire Foundation framework
(at least).

With this, we don't have to use Objective-C just to use Cocoa anymore.
The Mac OS X Quartz driver can go forward now! The QuickTime decoder can
use QTKit now instead of the 32-bit only Carbon QuickTime interface,
allowing it to work on 64-bit (if and when Wine supports it on Mac). It
might even be possible to integrate Win32 screen-savers with Mac OS X
using this (the ScreenSaver framework is Objective-C based).

I've attached the source so you can play with my newest creation. At the
moment, it can only be built on Mac OS X (only one of two platforms, the
other being iOS, where a program like this makes sense anyway). Feel
free to make changes; the sources are licensed under the same license as
Clang itself. We can't incorporate it into Wine directly because it is
written in C++ (and maybe because of the license), but we can detect its
presence at compile time (in configure) and use it to generate pure C
wrappers that Wine can use.

Comments welcome. What do you think?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: deobjectivizer.tar.gz
Type: application/x-gzip
Size: 27540 bytes
Desc: not available
URL: <>

More information about the wine-devel mailing list