Difference between revisions of "Mac OS X Porting - Comparison to Toolkit Ports"
(→Resources) |
(→Comparison) |
||
Line 36: | Line 36: | ||
|+'''Comparison between OpenOffice.org and toolkit ports''' | |+'''Comparison between OpenOffice.org and toolkit ports''' | ||
|- | |- | ||
− | ! style="width:100px;" | !! style="background:#59e;" | OpenOffice.org !! style="background:#59e;" | GTK !! style="background:#59e;" | XUL (Mozilla) | + | ! style="width:100px;" | !! style="background:#59e;width:150px;" | OpenOffice.org !! style="background:#59e;width:150px;" | GTK !! style="background:#59e;width:150px;" | XUL (Mozilla) |
|- | |- | ||
! style="background:#abcdef;" colspan="4" | Fonts | ! style="background:#abcdef;" colspan="4" | Fonts | ||
|- | |- | ||
− | | '''Enumeration'''<br> ''Getting and showing the list of available fonts to user'' || | + | | '''Enumeration'''<br> ''Getting and showing the list of available fonts to user'' || ATS || NSFontManager<br>''The only way to get identical font (family) listing as in Mac OS X native applications and in Font Book'' || |
|- | |- | ||
− | | '''Shaping'''<br> ''text strings to glyphs'' || | + | | '''Shaping'''<br> ''text strings to glyphs'' || ATSUI<br>''not fully implemented'' || ATSUI via Pango<br>''a pango shaping engine'' || ATSUI? |
|- | |- | ||
− | | '''Rendering'''<br> ''Glyphs to screen/print'' || | + | | '''Rendering'''<br> ''Glyphs to screen/print'' || ATSUI<br>''not fully implemented'' || ATSUI via Cairo<br>''cairo_show_glyphs'' || ATSUI? |
|- | |- | ||
− | | '''Metrics'''<br> ''font analysis and information'' || | + | | '''Metrics'''<br> ''font analysis and information, also font substitution'' || ?? || ATS via Pango, font substitution not implemented || ?? |
|- | |- | ||
! style="background:#abcdef;" colspan="4" | Main Loop integration | ! style="background:#abcdef;" colspan="4" | Main Loop integration |
Revision as of 14:15, 2 January 2007
Contents
Introduction
In addition to OpenOffice.org for Mac OS X porting effort, recently also several significant open source toolkits have been ported to Mac OS X. These include GTK, XUL (Mozilla), QT and WxWidgets.
Each of these ports have chosen somewhat different approaches, due to nature of the original code and the preferences of available Mac OS X (e.g. Cocoa, Carbon) and open source technologies (e.g. Cairo). There are also many similarities also. This page aims to describe how (and possibly why) the ports differ, and in places where OpenOffice.org Mac OS X port code is not yet matured, what potential solutions exist.
Resources
- Anders Carlsson's report on GTK Mac OS X port (May 2006)
- Mozilla Mac Port pages
- GTK Mac porting pages
- OpenOffice.org Mac Porting pages
Explanations
In order to understand the different technologies, here's a short introduction to the key parts:
Low level APIs
CF* = Core Foundation functions - The Mac OS X system layer that operates e.g. the run/event loop. Both Cocoa and Carbon use these functions
CG* = Core Graphics functions i.e. Quartz The Mac OS X graphics rendering layer. Both Cocoa and Carbon use these functions
ATS = Apple Type Services API - The Mac OS X api for font enumeration (finding available fonts)
Cairo - open source, cross-platform PDF-like graphics rendering API. Implementations include X11, Windows, Mac OS X. The Mac OS X implementation uses mainly CG* functions with some Carbon added in.
High level APIs
ATSUI = Apple Type Services for Unicode Imaging - the Mac OS X API for laying out (shaping) and drawing (rendering) Unicode text in correct manner.
Carbon = C language based API for creating GUI applications in Mac OS X. This older API is closer to Win32 and X11 API than Cocoa API. Carbon cannot include Cocoa code.
NS* = Cocoa = Objective C based API for creating GUI applications in Mac OS X. This NextStep derived fully object oriented, and uses messages to pass commands between functions. The API that Mac OS X itself uses for the system and applications. Cocoa can include/mix with Carbon code.
NOTE: currently (Jan 2007) Cairo includes two Mac OS X backends: cairo-quartz and cairo-nquartz. The cairo-quartz is the older one and used in GTK port. The other nquartz/"Native Quartz" is used by new Mozilla XUL code. It is expected that native quartz backend will replace the older backend and become the default backend for Mac OS X.
Comparison
OpenOffice.org | GTK | XUL (Mozilla) | |
---|---|---|---|
Fonts | |||
Enumeration Getting and showing the list of available fonts to user |
ATS | NSFontManager The only way to get identical font (family) listing as in Mac OS X native applications and in Font Book |
|
Shaping text strings to glyphs |
ATSUI not fully implemented |
ATSUI via Pango a pango shaping engine |
ATSUI? |
Rendering Glyphs to screen/print |
ATSUI not fully implemented |
ATSUI via Cairo cairo_show_glyphs |
ATSUI? |
Metrics font analysis and information, also font substitution |
?? | ATS via Pango, font substitution not implemented | ?? |
Main Loop integration |