Stefan has released
an alpha version of his GNUstep port of WebCore, the KHTML-based renderer used by Apple’s Safari web browser. The code includes a simple browser program.
Stefan has released
an alpha version of his GNUstep port of WebCore, the KHTML-based renderer used by Apple’s Safari web browser. The code includes a simple browser program.
Since WebCore is written in C++, and Gnustep does not yet have Objective C++, did he have to create a C wrapper around it to make it work with Objective C?
I believe that actually Apple had already done that little bit of work. From what I remember when Safari was first announced as using KHTML, I read that Apple had created a wrapper around the native QT C++ functions of KHTML, and exported them as Cocoa Objective C functions.
first, yay! I’m glad to see GNUstep is going to have at least a few applications. secondly, i wonder what they’ll call the browser…GNUfari? heh.
http://www.cenon.info
It has a very good DTP module (vector graphic stuff).
Its manual is very nice and more descriptive than screen shots.
Apple has written the Objective-C++ KWQ Library to interact with the C++ written KHTML. WebCore itself sits on top of KWQ prividing a standard Objective-C programming interface.
http://developer.apple.com/darwin/projects/webcore/
——
WebCore is a framework for Mac OS X that takes the cross-platform KHTML library (part of the KDE project) and combines it with an adapter library specific to WebCore called KWQ that makes it work with Mac OS X technologies. KHTML is written in C++ and KWQ is written in Objective C++, but WebCore presents an Objective C programming interface.
——
however, KWQ is written in objective c++ and there is no objective c++ compiler for linux. gcc does NOT include objective c++ support. apple patches gcc themselves to support this for macos and their version of gcc refuses to compile under anything other than darwin last i checked (i think due to changes they made for mach-o?)
the FSF didn’t include support for this language because it was a hack that increased maintenance effort needlessly. as a result, much work has been done to make objc++ less of a bother, the first step of which is included in gcc 3.4 (not yet to be released as a stable compiler). dont expect the FSF version of gcc to include objc++ until after 3.4 and possibly not even in 3.5… (tho there is a cvs branch for bringing apple’s objc enhancements to gcc proper)
so, in summary, this port is done entirely without the aid of objc++ glue between objc and c++. so it HAD to have been done entirely with c wrappers. painfull.
http://mac.wms-network.de/gnustep/WebCore/blog/osnews.jpg
😉
examining objc i wonder myself wheres the difference to c++ ?
objc looks very confusing to me i must admit.
doesnt apple offer c bindings, as well as c++ bindings? last i checked xcode i have to say yes.
If you know C, then Objective-C is much simpler than C++. It just looks a bit odd because of the method call/message passing syntax, which is borrowed from SmallTalk. Of course, to delimit these, they’re wrapped up in brackets, which C uses sparsely and in no conflicting way.
I personally find Objective-C quite expressive, particularly for complex methods. The use of factory methods vs. overloaded constructors makes code quite a bit more understandable.
It’s nice to see another project adopting khtml. Good luck on this to the GNUStep guys.
GNUStep’s native language is Objective-C. Mozilla is written in C++ and has no Objective-C wrappers. KHTML has Objective-C wrappers available (i.e. WebCore). GNUStep and Cocoa (the OSX API) are both based on the OPENSTEP API (or is it the OpenStep API? I can never remember); indeed, many programs written for GNUStep should run fine on Cocoa (though they’ll almost certainly want changes to the UI).
Anyone have some news about yT progress on that port? It was announced here sometime ago <http://www.osnews.com/story.php?news_id=4057> and we never heard about it again…
Thanx,
François
What does Mozilla have to do with this?
One presumes that because Mozilla is a webbrowser, it has something to do with webbrowsers. It was a ligitimate question.
Remember why Apple chose KHTML? Add to that the fact that it’s proven good combo.
first, yay! I’m glad to see GNUstep is going to have at least a few applications. secondly, i wonder what they’ll call the browser…GNUfari? heh.
Hem, there is already more than “a few” applications :
http://wiki.gnustep.org/index.php/All%20GNUstep%20Applicati…
… in fact, I’m basically using a gnustep-only desktop, the only two apps I use regularly beside are a jabber client and mozilla. I guess that I won’t have to use mozilla in the coming months 😉
Big thanks to stephan, because it sure was a painfull thing to rewrap KHTML in C function for the glue !
Hopefully next gcc versions will have ObjC++ which will help us for others ObjC++ apps or C++ libs, but anyway, stephan did a wonderful job.
Isn’t that KHTML itself already has Objective-C binding somewhere?
http://dot.kde.org/1041971213/1041983392/1042003371/
Because you know, there is a whole set of nicely done C wrappers for khtml at KDE´s kdebindings package 😉
Hell, there´s even Obj-C wrappers already.
Ha ha, that’s funny. Actually, Gnustep seems to have picked up a lot of steam since OSX came out. And it’s always been an active community. I’d probably prefer it over Knome if it was a bit more mature.