« Mozilla Summit | Main | New Quartz Graphics Book Is Out »
December 16, 2005
Why Cocoa Widgets?
I have been asked quite a few times why we're going to move all Mozilla Mac OS X projects to Cocoa widgets. I explained why in a talk I gave recently at the Mozilla Summit, but I haven't really written it down anywhere. So here goes.
We need to settle on a single set of widgets. Right now we maintain both Carbon and Cocoa widget implementations for Mac OS X, which is a serious strain on our resources. Moving towards a single widget implementation on Mac OS X is definitely the right way to go as it means we have less code to maintain and improve. Also, Cocoa widgets are probably a better road to go down for all projects, so we should be using them regardless of efficiency concerns. We intend to move all Mozilla Mac OS X products to Cocoa widgets.
First, Cocoa widgets can use both the Cocoa API and the Carbon API. Carbon widgets cannot easily use the Cocoa API. Since both APIs have their strengths, being able to use either is really helpful. The more tools in our toolbox the better.
Second, Cocoa widgets are going to make our Quartz drawing transition much easier. Drawing into a Cocoa NSView with Quartz is fairly straightforward the way we have things set up.
Third, Camino is highly dependent upon Cocoa widgets, whereas Firefox is not highly dependent upon Carbon widgets. Cocoa widgets have been designed with embedders in mind since the start, and moving Camino away from that to Carbon widgets would be *extremely* painful. Firefox already runs (albeit buggily) under Cocoa widgets.
Fourth, Cocoa is a more popular and accessible API. Since we need to attract developers, this is important. New developers tend to feel more comfortable with and less intimidated by the Cocoa API.
Fifth, Cocoa is simply a better API for object-oriented software development. Carbon is a pretty good API if you have to use C or you can't use Objective-C in your project, but since Mozilla's widgets are object-oriented and we can use Objective-C, Cocoa is the better choice.
Posted by josh at December 16, 2005 5:52 AM
Comments
Very interesting, now... when will we see something on the trunk? :)
Posted by: giandrea at December 17, 2005 12:07 PM
You can see it on the trunk now - Firefox with Cocoa widgets builds right from CVS. You need to specify that it should build with Cocoa widgets in your mozconfig file - they are not turned on by default. I hope to make them default around the end of January.
Posted by: Josh Aas at December 17, 2005 3:34 PM
sure would be nice if the move to cocoa widgets corresponded with a move away from nsquickdrawview and to nsview . . . or is that the plan with cairo?
Posted by: at December 27, 2005 9:17 PM
Josh, what flag do we need to add to our mozconfig to build Firefox with cocoa widgets? I did some searching but I couldn't find this information...
Posted by: Neil at January 1, 2006 2:55 PM
Neil:
ac_add_options --enable-default-toolkit=cocoa
Posted by: Josh Aas at January 1, 2006 11:50 PM
Hello all
Posted by: hydrocodone at October 9, 2006 6:07 AM
There are a number of payday loan companies saying that they are the best in payday loan industry, we say nothing, we just get you APPROVED for a payday loan.
Posted by: no fax payday loan at October 30, 2006 5:36 AM
It seems to be the final reversal of how Netscape went about things.
They started developing the mozilla > firefox line with the aim of getting rid of the separate UIs for diferent platforms.
Posted by: Gavin at December 24, 2006 4:20 AM