winequartz.drv Mac OS X UI discontinued?

Adam Strzelecki ono at java.pl
Wed Jul 8 06:22:20 CDT 2009


James,

>> Well actually you can easily access all Obj-C features trough the
>> following pure C API:
>> http://developer.apple.com/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html
> Is this still true?  I would like to convert what work we do have  
> into c
> level code so that it will pass AJs 'c' scan and to avoid using ObjC  
> code.

Those functions allow pure C code call and work on Objective-C  
(shortened to Obj-C later) object pointers. While it gives you  
possibility to write an Obj-C Cocoa based pure-C extension for Wine,  
IMHO this would be a nightmare. Because of few reasons: (1) You'd need  
to write lot more code than writing Obj-C, (2) This code would be  
suboptimal (Obj-C isn't translated to C, it is separate compiler), (3)  
You can expect lot of problems with memory allocation and freeing that  
is done more less automatically with Obj-C memory pools, etc.

> In addition, if an exported Carbon/Cocoa library exists, this would  
> help
> move the project along.

As I previously mentioned Carbon is pure-C UI/graphics library for Mac  
OS X that is legacy and partial compatible with older versions such as  
Mac OS 8 & 9. Since it is legacy, all new features doesn't go into  
Carbon so Carbon doesn't expose all OSX functionality, also there's no  
64-bit Carbon.
So, Yes you can write Wine OSX support using pure-C Carbon library,  
but beware that it is LEGACY and Apple doesn't recommend you to use  
it. Moreover it can be discontinued at some 10.x release, so all your  
work will be wasted.

Cocoa is the proper Obj-C API for OSX UI & graphics. OSX is NextStep  
based objective oriented GUI & OS. And Obj-C is a basement of both  
NextStep and OSX. So if you want to write OSX GUI application properly  
you have to use Obj-C, same as C++ & KDE and so on.

So forcing constraint that all Wine source files have to be C is  
simply unreasonable in this case. You can easily achieve that only OSX  
dependent source files will be Obj-C, while having OS independent code  
to be pure-C - as C is a subset of Obj-C, and Obj-C is backwards  
compatible with C. So from the other OSes point of view Wine will be  
still pure-C program.

Cheers,
-- 
Adam



More information about the wine-devel mailing list