Announcement: Starting work on EiffelVision for Mac OS X
by Daniel Furrer (modified: 2009 Mar 17)
I started working on a new port of EiffelVision for Mac OS X.
My plan is to use Cocoa (instead of Carbon as with the unfinished "vision4mac" port) and I'll be working on it 100% during the next 6 months. If you're interested in hearing more about it feel free to leave your comment here so that I know I should keep you updated :)
I'm mostly planning out the details now but I do have a small proof-of-concept application running already that creates a Cocoa window from an Eiffel application by using embedded Objective-C calls.
Definitely interested, Daniel!
Is this made possible by changes in the Eiffel compiler to allow it to call Objective-C?
Objective-C
At the moment the only thing I am doing is inlining Objective-C in Eiffel features just like with regular C code (there's also no special keyword as you can see). E.g. I can write:
frozen menu_insert_item (a_menu: POINTER; a_menu_item: POINTER; an_index: INTEGER) is external "C inline use <Cocoa/Cocoa.h>" alias "[ { NSLog(@"NSMenu %x insertItem: %x atIndex: %i", (int)$a_menu, (int)$a_menu_item, $an_index); [(NSMenu*)$a_menu insertItem: $a_menu_item atIndex: $an_index]; } ]" end
I'm not sure yet if any more support is needed and what it will look like.Ideally, it would be better to have something like objective-C instead of just C. I mean it is necessary because I'm sure you need to pass a special option to the C compiler and EiffelStudio is not providing it to you. So if you put `objective-C' rather than C, EiffelStudio will know that it needs to pass that C compiler option to compile objective-C code.
Huh! I'd never tried that! I assumed gcc would just complain if a *.c file was found to using Objective-C code. I was going to look into having the compiler generate .m files but I guess there is no need :)
Daniel, I very, very much look forward to the port. If I can offer some assistance then I let me know, although I probably cannot help you with the port efforts because I have other priorities.
cool
There is a flag for gcc that allows ObjC code in a .c file :)
Glad to hear that you're looking forward to it.
We need that Cocoa Vision2!
Just to emphasise how Vision2 for Cocoa would help us, we've just had a problem reported by a user trying to run our application. This is at the end of the log that they sent us:
dyld: Library not loaded: /opt/local/lib/libgtk-x11-2.0.0.dylib
I suspect they didn't read our installation instructions:
The following prerequisite software is needed for the Mac version of ADL Workbench:
It will be so nice not to have to worry about any of that!
Daniel, I was thinking about this project late last night and wondered how you were going to address a few things without compiler support. Cocoa use selectors which are a unbound Objective-C message, this might cause an issue. Also Cocoa relies on delegates and implemented informal/formal protocols to achieve some fundamental tasks. Have you managed to utilize use of selectors or delegates without the use if generated or hand-crafted Objective-C classes?
For instance, how/where would you implement the
applicationShouldTerminate:
delegated message for theNSApplication
object?Delegates ...
Thanks for this interesting question and sorry for only getting back to you now. (It would be nice if the system could send messages if a new comment is posted...)
It is indeed something that I have spent quite a bit of time on because I hoped there would be a nice solution but it turns out that writing a couple of pure Objective-C files is the proper solution IMO. I currently have a pure Objective-C file for all the classes whose delegates I need. This file only contains a very thin wrapper, i.e. a class with the delegate methods that call the appropriate Eiffel methods (whose locations are passed in the constructor). (Only 15 out of the around 170 classes in the Cocoa UI use Delegates and then there are a couple of DataSources so it's not too bad. For more see Cocoa Fundamentals)
Please feel free to add your suggestions if you see a better solution!
Simply subscribe to the RSS feed at the bottom of http://www.eiffelroom.org/recent_changes. This is the best way to keep updated from new things happening on eiffelroom.
Access denied
You are not authorized to access this page. :)
Now, the recent changes should be accessible by anyone. Could you confirm?
nope, still the same message.
You really mean http://www.eiffelroom.org/recent_changes is not accessible for you? Can you paste the exact message?
Can you try again. ... Previously I checked it was available for anonymous visitor. It seems that for standard user, it may not be accessible. Now it should be...
Ah, I really have no clue what was wrong but it is indeed working now. thanks
It was a matter of configuration on the web site. Thank you for the confirmation.