[Mono-osx] [Cocoa-sharp] Conceptual Idea: (Semi)automaticgeneration of Cocoa# wrapper classes

Richard King richard at xpro.com.au
Sun Nov 25 08:57:39 EST 2007


I have been having fun using RemObject's Chrome to build a native Mac app 
(it runs under Mono being a .Net program).  It is a simple four function 
calculator and can be downloaded from 
www.vikingcomputers.com.au/download/CocoaCalc.zip.  I am very impressed with 
Chrome and Cocoa-sharp so far.  However, the main point of this post is to 
say I have also found it very tedious hand translating Apple's header files 
for the few extra functions I wanted and have made a start on a CocoaH2CS 
conversion program which can be downloaded from 
www.vikingcomputers.com.au/download/CocoaH2CS.zip

You can see some examples of the .cs files resulting from converting the .h 
files in the bin/Debug directory.  So far, I have only cut and pasted 
selected methods from the generated code into my 'master' files when 
rebuilding my cocoa-sharp dll; but it is looking promising -- many functions 
require no touching up at all and having getter and setter methods paired up 
as properties is in keeping with the C# and Cocoa sharp spirit, I hope. 
There is much to do to make it a more robust program, however.  I also 
envisage having a file that defines the methods to convert (eg NSCell.h 
might have an associated NSCell.xlate file) until we get closer to being 
able to compile the full raw output of this program.

This is the first time I have had anything to contribute to an open source 
effort -- how do I go about submitting this program and the fixes and 
extensions I have already made to the cocoa-sharp project?

I have briefly releated my experiences over the last month with Chrome and 
Cocoa at www.vikingcomputers.com.au -- follow the bottom most link in the 
menu at the left.  (Joomla is also new for me - so please excuse the web 
pages).

Regards, Richard King


----- Original Message ----- 
From: "Russell Hind" <rhind at mac.com>
To: <mono-osx at lists.ximian.com>; <cocoa-sharp at lists.ximian.com>
Sent: Tuesday, November 13, 2007 8:18 PM
Subject: Re: [Cocoa-sharp] [Mono-osx] Conceptual Idea: 
(Semi)automaticgeneration of Cocoa# wrapper classes


> Just read a page at MacResearch.org 
> (http://macresearch.org/whats_new_on_the_leopard_command_line
> ) that mentioned a new command in Leoopard
>
> gen_bridge_metadata
>
> Maybe that would prove useful for Leopard, anyway?
>
> Cheers
>
> Russell
>
> On 10 Nov 2007, at 19:52, marc hoffman wrote:
>
>> Hi,
>>
>> this maybe (probably?) has come up before, but i couldn't find any
>> reference to it, so here it goes:
>>
>> As i've found out myself, recently, creating the wrapper classes
>> needed
>> to access the Cocoa objects from managed code is a very tedious and
>> error prone process, which in tuen explains, of course, why such a
>> small
>> portion of Cocoa is actually exposed, so far. It's mind-numbing
>> runt-work that no-one wants to do.
>>
>> has anyone ever put any thought into creating a way to *automatically*
>> or semi-automatically (ie with manual adjustments) generate these
>> wrapper classes by, for example, parsing method headers from available
>> .h files or the documentation?
>>
>> if not, does anyone think this would be a good idea and would like to
>> work with me on investigating this? (i'm very interested in this
>> myself
>> (else i wouldn't bring it up ;), but my spare time is severely limited
>> these days, so i wouldn't want to take this up all by myself - but i'd
>> certainly be happy to put effort and energy into this, if someone else
>> will help out as well).
>>
>>
>> looking forward to your thoughts on this,
>>
>> marc hoffman
>>
>> RemOjects Software
>> The Infrastructure Company
>> http://www.rembjects.com
>> _______________________________________________
>> Mono-osx mailing list
>> Mono-osx at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-osx
>
> _______________________________________________
> Cocoa-sharp mailing list
> Cocoa-sharp at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/cocoa-sharp
> 



More information about the Mono-osx mailing list