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.