<s>
Carbon	O
was	O
one	O
of	O
two	O
primary	O
C-based	B-Language
application	B-Application
programming	I-Application
interfaces	I-Application
(	O
APIs	B-General_Concept
)	O
developed	O
by	O
Apple	O
for	O
the	O
macOS	B-Application
(	O
formerly	O
Mac	B-Application
OS	I-Application
X	I-Application
and	O
OS	O
X	O
)	O
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
<s>
Carbon	O
provided	O
a	O
good	O
degree	O
of	O
backward	B-General_Concept
compatibility	I-General_Concept
for	O
programs	O
that	O
ran	O
on	O
Mac	B-Operating_System
OS	I-Operating_System
8	I-Operating_System
and	O
9	B-Operating_System
.	O
</s>
<s>
Developers	O
could	O
use	O
the	O
Carbon	B-Operating_System
APIs	I-Operating_System
to	O
port	O
(	O
“	O
carbonize	O
”	O
)	O
their	O
“	B-Application
classic	I-Application
”	I-Application
Mac	I-Application
applications	O
and	O
software	O
to	O
the	O
Mac	B-Application
OS	I-Application
X	I-Application
platform	O
with	O
little	O
effort	O
,	O
compared	O
to	O
porting	O
the	O
app	O
to	O
the	O
entirely	O
different	O
Cocoa	B-Operating_System
system	O
,	O
which	O
originated	O
in	O
OPENSTEP	B-Operating_System
.	O
</s>
<s>
With	O
the	O
release	O
of	O
macOS	B-Device
10.15	I-Device
Catalina	I-Device
,	O
the	O
Carbon	B-Operating_System
API	I-Operating_System
was	O
officially	O
discontinued	O
and	O
removed	O
,	O
leaving	O
Cocoa	B-Operating_System
as	O
the	O
sole	O
primary	O
API	B-General_Concept
for	O
developing	O
macOS	B-Application
applications	O
.	O
</s>
<s>
Carbon	O
was	O
an	O
important	O
part	O
of	O
Apple	O
's	O
strategy	O
for	O
bringing	O
Mac	B-Application
OS	I-Application
X	I-Application
to	O
market	O
,	O
offering	O
a	O
path	O
for	O
quick	O
porting	O
of	O
existing	O
software	O
applications	O
,	O
as	O
well	O
as	O
a	O
means	O
of	O
shipping	O
applications	O
that	O
would	O
run	O
on	O
either	O
Mac	B-Application
OS	I-Application
X	I-Application
or	O
the	O
classic	B-Application
Mac	I-Application
OS	I-Application
.	O
</s>
<s>
As	O
the	O
market	O
has	O
increasingly	O
moved	O
to	O
the	O
Cocoa-based	O
frameworks	O
,	O
especially	O
after	O
the	O
release	O
of	O
iOS	B-Application
,	O
the	O
need	O
for	O
a	O
porting	O
library	O
was	O
diluted	O
.	O
</s>
<s>
Apple	O
did	O
not	O
create	O
a	O
64-bit	B-Device
version	O
of	O
Carbon	O
while	O
updating	O
their	O
other	O
frameworks	O
in	O
the	O
2007	O
time-frame	O
,	O
and	O
eventually	O
deprecated	B-General_Concept
the	O
entire	O
API	B-General_Concept
in	O
OS	B-Operating_System
X	I-Operating_System
10.8	I-Operating_System
Mountain	I-Operating_System
Lion	I-Operating_System
,	O
which	O
was	O
released	O
on	O
July	O
24	O
,	O
2012	O
.	O
</s>
<s>
The	O
original	B-Application
Mac	I-Application
OS	I-Application
used	O
Pascal	B-Application
as	O
its	O
primary	O
development	O
platform	O
,	O
and	O
the	O
APIs	B-General_Concept
were	O
heavily	O
based	O
on	O
Pascal	B-Application
's	O
call	B-General_Concept
semantics	I-General_Concept
.	O
</s>
<s>
Much	O
of	O
the	O
Macintosh	B-Device
Toolbox	I-Device
consisted	O
of	O
procedure	O
calls	O
,	O
passing	O
information	O
back	O
and	O
forth	O
between	O
the	O
API	B-General_Concept
and	O
program	B-Application
using	O
a	O
variety	O
of	O
data	B-General_Concept
structures	I-General_Concept
based	O
on	O
Pascal	B-Application
's	O
variant	B-Language
record	I-Language
concept	O
.	O
</s>
<s>
Over	O
time	O
,	O
a	O
number	O
of	O
object	O
libraries	O
evolved	O
on	O
the	O
Mac	O
,	O
notably	O
the	O
Object	B-Language
Pascal	I-Language
library	O
MacApp	B-Operating_System
and	O
the	O
Think	B-Operating_System
Class	I-Operating_System
Library	I-Operating_System
(	O
TCL	O
)	O
in	O
Pascal	B-Application
,	O
and	O
later	O
versions	O
of	O
MacApp	B-Operating_System
and	O
CodeWarrior	B-Operating_System
's	O
PowerPlant	O
in	O
C++	B-Language
.	O
</s>
<s>
By	O
the	O
mid-1990s	O
,	O
most	O
Mac	O
software	O
was	O
written	O
in	O
C++	B-Language
using	O
CodeWarrior	B-Operating_System
.	O
</s>
<s>
With	O
the	O
purchase	O
of	O
NeXT	O
in	O
late	O
1996	O
,	O
Apple	O
developed	O
a	O
new	O
operating	B-General_Concept
system	I-General_Concept
strategy	O
based	O
largely	O
on	O
the	O
existing	O
OpenStep	B-Operating_System
platform	O
.	O
</s>
<s>
The	O
new	O
Rhapsody	B-Operating_System
was	O
relatively	O
simple	O
;	O
it	O
retained	O
most	O
of	O
OpenStep	B-Operating_System
's	O
existing	O
object	O
libraries	O
under	O
the	O
name	O
"	O
Yellow	O
Box	O
"	O
,	O
ported	O
OpenStep	B-Operating_System
's	O
existing	O
GUI	B-Application
and	O
made	O
it	O
look	O
more	O
Mac-like	O
,	O
ported	O
several	O
major	O
APIs	B-General_Concept
from	O
the	O
Mac	B-Application
OS	I-Application
to	O
Rhapsody	B-Operating_System
's	O
underlying	O
Unix-like	B-Operating_System
system	I-Operating_System
(	O
notably	O
QuickTime	B-Application
and	O
AppleSearch	B-Operating_System
)	O
,	O
and	O
added	O
an	O
emulator	O
known	O
as	O
the	O
"	O
Blue	O
Box	O
"	O
that	O
ran	O
existing	O
Mac	B-Application
OS	I-Application
software	O
.	O
</s>
<s>
When	O
this	O
plan	O
was	O
revealed	O
at	O
the	O
Worldwide	O
Developers	O
Conference	O
in	O
1997	O
there	O
was	O
some	O
push-back	O
from	O
existing	O
Mac	B-Application
OS	I-Application
developers	O
,	O
who	O
were	O
upset	O
that	O
their	O
code	O
bases	O
would	O
effectively	O
be	O
locked	O
into	O
an	O
emulator	O
that	O
was	O
unlikely	O
to	O
ever	O
be	O
updated	O
.	O
</s>
<s>
Larger	O
developers	O
like	O
Microsoft	O
and	O
Adobe	O
balked	O
outright	O
,	O
and	O
refused	O
to	O
consider	O
porting	O
to	O
OpenStep	B-Operating_System
,	O
which	O
was	O
so	O
different	O
from	O
the	O
existing	O
Mac	B-Application
OS	I-Application
that	O
there	O
was	O
little	O
or	O
no	O
compatibility	O
.	O
</s>
<s>
When	O
Steve	O
Jobs	O
announced	O
this	O
change	O
in	O
direction	O
at	O
the	O
1998	O
WWDC	O
,	O
he	O
stated	O
that	O
"	O
what	O
developers	O
really	O
wanted	O
was	O
a	O
modern	O
version	O
of	O
the	O
Mac	B-Application
OS	I-Application
,	O
and	O
Apple	O
 [ was ] 	O
going	O
to	O
deliver	O
it	O
"	O
.	O
</s>
<s>
The	O
original	O
Rhapsody	B-Operating_System
concept	O
,	O
with	O
only	O
the	O
Blue	O
Box	O
for	O
running	O
existing	O
Mac	B-Application
OS	I-Application
software	O
,	O
was	O
eventually	O
released	O
in	O
1999	O
as	O
Mac	B-Operating_System
OS	I-Operating_System
X	I-Operating_System
Server	I-Operating_System
1.0	I-Operating_System
.	O
</s>
<s>
This	O
was	O
the	O
only	O
release	O
based	O
on	O
the	O
original	O
Rhapsody	B-Operating_System
concept	O
.	O
</s>
<s>
In	O
order	O
to	O
offer	O
a	O
real	O
and	O
well	O
supported	O
upgrade	O
path	O
for	O
existing	O
Mac	B-Application
OS	I-Application
code	O
bases	O
,	O
Apple	O
introduced	O
the	O
Carbon	O
system	O
.	O
</s>
<s>
Carbon	O
consists	O
of	O
many	O
libraries	O
and	O
functions	O
that	O
offer	O
a	O
Mac-like	O
API	B-General_Concept
,	O
but	O
running	O
on	O
top	O
of	O
the	O
underlying	O
Unix-like	B-Operating_System
OS	I-Operating_System
,	O
rather	O
than	O
a	O
copy	O
of	O
the	O
Mac	B-Application
OS	I-Application
running	O
in	O
emulation	O
.	O
</s>
<s>
While	O
the	O
Mac	B-Application
OS	I-Application
was	O
filled	O
with	O
APIs	B-General_Concept
that	O
shared	O
memory	O
to	O
pass	O
data	O
,	O
under	O
Carbon	O
all	O
such	O
access	O
was	O
re-implemented	O
using	O
accessor	O
subroutines	O
on	O
opaque	B-General_Concept
data	I-General_Concept
types	I-General_Concept
.	O
</s>
<s>
This	O
allowed	O
Carbon	O
to	O
support	O
true	O
multitasking	B-Operating_System
and	O
memory	B-General_Concept
protection	I-General_Concept
,	O
features	O
Mac	O
developers	O
had	O
been	O
requesting	O
for	O
a	O
decade	O
.	O
</s>
<s>
Other	O
changes	O
from	O
the	O
pre-existing	O
API	B-General_Concept
removed	O
features	O
which	O
were	O
conceptually	O
incompatible	O
with	O
Mac	B-Application
OS	I-Application
X	I-Application
,	O
or	O
simply	O
obsolete	O
.	O
</s>
<s>
For	O
example	O
,	O
applications	O
could	O
no	O
longer	O
install	O
interrupt	B-General_Concept
handlers	I-General_Concept
or	O
device	B-Application
drivers	I-Application
.	O
</s>
<s>
In	O
order	O
to	O
support	O
Carbon	O
,	O
the	O
entire	O
Rhapsody	B-Operating_System
model	O
changed	O
.	O
</s>
<s>
Whereas	O
Rhapsody	B-Operating_System
would	O
effectively	O
be	O
OpenStep	B-Operating_System
with	O
an	O
emulator	O
,	O
under	O
the	O
new	O
system	O
both	O
the	O
OpenStep	B-Operating_System
and	O
Carbon	B-Operating_System
API	I-Operating_System
would	O
,	O
where	O
possible	O
,	O
share	O
common	O
code	O
.	O
</s>
<s>
To	O
do	O
this	O
,	O
many	O
of	O
the	O
useful	O
bits	O
of	O
code	O
from	O
the	O
lower-levels	O
of	O
the	O
OpenStep	B-Operating_System
system	O
,	O
written	O
in	O
Objective-C	B-Language
and	O
known	O
as	O
Foundation	O
,	O
were	O
re-implemented	O
in	O
pure	O
C	B-Language
.	O
This	O
code	O
became	O
known	O
as	O
Core	B-Operating_System
Foundation	I-Operating_System
,	O
or	O
CF	O
for	O
short	O
.	O
</s>
<s>
A	O
version	O
of	O
the	O
Yellow	O
Box	O
ported	O
to	O
call	O
CF	O
became	O
the	O
new	O
Cocoa	B-Operating_System
API	I-Operating_System
,	O
and	O
the	O
Mac-like	O
calls	O
of	O
Carbon	O
also	O
called	O
the	O
same	O
functions	O
.	O
</s>
<s>
Under	O
the	O
new	O
system	O
,	O
Carbon	O
and	O
Cocoa	B-Operating_System
were	O
peers	O
.	O
</s>
<s>
This	O
conversion	O
would	O
normally	O
have	O
slowed	O
the	O
performance	O
of	O
Cocoa	B-Operating_System
as	O
the	O
object	O
methods	O
called	O
into	O
the	O
underlying	O
C	B-Language
libraries	O
,	O
but	O
Apple	O
used	O
a	O
technique	O
they	O
called	O
toll-free	O
bridging	O
to	O
reduce	O
this	O
impact	O
.	O
</s>
<s>
As	O
part	O
of	O
this	O
conversion	O
,	O
Apple	O
also	O
ported	O
the	O
graphics	O
engine	O
from	O
the	O
licence-encumbered	O
Display	O
PostScript	O
to	O
the	O
licence-free	O
Quartz	B-Operating_System
(	O
which	O
has	O
been	O
called	O
"	O
Display	O
PDF	O
"	O
)	O
.	O
</s>
<s>
Quartz	B-Operating_System
provided	O
native	O
calls	O
that	O
could	O
be	O
used	O
from	O
either	O
Carbon	O
or	O
Cocoa	B-Operating_System
,	O
as	O
well	O
as	O
offering	O
Java	O
2D-like	O
interfaces	O
as	O
well	O
.	O
</s>
<s>
The	O
underlying	O
operating	B-General_Concept
system	I-General_Concept
itself	O
was	O
further	O
isolated	O
and	O
released	O
as	O
Darwin	B-Operating_System
.	O
</s>
<s>
Carbon	O
was	O
introduced	O
in	O
incomplete	O
form	O
in	O
2000	O
,	O
as	O
a	O
shared	B-Library
library	I-Library
backward-compatible	B-General_Concept
with	O
1997	O
's	O
Mac	O
OS	O
8.1	O
.	O
</s>
<s>
This	O
version	O
allowed	O
developers	O
to	O
port	O
their	O
code	O
to	O
Carbon	O
without	O
losing	O
the	O
ability	O
for	O
those	O
programs	O
to	O
run	O
on	O
existing	O
Mac	B-Application
OS	I-Application
machines	O
.	O
</s>
<s>
Official	O
Mac	B-Application
OS	I-Application
X	I-Application
support	O
arrived	O
in	O
2001	O
with	O
the	O
release	O
of	O
Mac	B-Operating_System
OS	I-Operating_System
X	I-Operating_System
v10.0	I-Operating_System
,	O
the	O
first	O
public	O
version	O
of	O
the	O
new	O
OS	O
.	O
</s>
<s>
Carbon	O
was	O
very	O
widely	O
used	O
in	O
early	O
versions	O
of	O
Mac	B-Application
OS	I-Application
X	I-Application
by	O
almost	O
all	O
major	O
software	O
houses	O
,	O
even	O
by	O
Apple	O
.	O
</s>
<s>
The	O
Finder	B-Application
,	O
for	O
instance	O
,	O
remained	O
a	O
Carbon	O
application	O
for	O
many	O
years	O
,	O
only	O
being	O
ported	O
to	O
Cocoa	B-Operating_System
with	O
the	O
release	O
of	O
Mac	B-Application
OS	I-Application
X	I-Application
10.6	O
in	O
2009	O
.	O
</s>
<s>
The	O
transition	O
to	O
64-bit	B-Device
Macintosh	O
applications	O
beginning	O
with	O
Mac	B-Application
OS	I-Application
X	I-Application
v10.5	I-Application
,	O
released	O
October	O
26	O
,	O
2007	O
,	O
brought	O
the	O
first	O
major	O
limitations	O
to	O
Carbon	O
.	O
</s>
<s>
Apple	O
does	O
not	O
provide	O
compatibility	O
between	O
the	O
Macintosh	O
graphical	B-Application
user	I-Application
interface	I-Application
and	O
the	O
C	B-Language
programming	I-Language
language	I-Language
in	O
the	O
64-bit	B-Device
environment	O
,	O
instead	O
requiring	O
the	O
use	O
of	O
the	O
Objective-C	B-Language
dialect	O
with	O
the	O
Cocoa	B-Operating_System
API	I-Operating_System
.	O
</s>
<s>
Many	O
commentaries	O
took	O
this	O
to	O
be	O
the	O
first	O
sign	O
of	O
Carbon	O
's	O
eventual	O
disappearance	O
,	O
a	O
position	O
that	O
was	O
re-enforced	O
when	O
Apple	O
stated	O
no	O
new	O
major	O
additions	O
would	O
be	O
added	O
to	O
the	O
Carbon	O
system	O
,	O
and	O
further	O
reinforced	O
with	O
its	O
deprecation	B-General_Concept
in	O
2012	O
.	O
</s>
<s>
Despite	O
the	O
purported	O
advantages	O
of	O
Cocoa	B-Operating_System
,	O
the	O
need	O
to	O
rewrite	O
large	O
amounts	O
of	O
legacy	O
code	O
slowed	O
the	O
transition	O
of	O
Carbon-based	O
applications	O
,	O
famously	O
with	O
Adobe	B-Operating_System
Photoshop	I-Operating_System
,	O
which	O
was	O
eventually	O
updated	O
to	O
Cocoa	B-Operating_System
in	O
April	O
2010	O
.	O
</s>
<s>
This	O
also	O
extended	O
to	O
Apple	O
's	O
own	O
flagship	O
software	O
packages	O
,	O
as	O
iTunes	B-Operating_System
and	O
Final	B-Application
Cut	I-Application
Pro	I-Application
(	O
as	O
well	O
as	O
the	O
features	O
in	O
the	O
QuickTime	B-Application
engine	O
that	O
powers	O
it	O
)	O
remained	O
written	O
in	O
Carbon	O
for	O
many	O
years	O
.	O
</s>
<s>
Both	O
iTunes	B-Operating_System
and	O
Final	B-Application
Cut	I-Application
Pro	I-Application
X	O
have	O
since	O
been	O
released	O
in	O
Cocoa	B-Operating_System
versions	O
.	O
</s>
<s>
In	O
2012	O
,	O
with	O
the	O
release	O
of	O
OS	B-Operating_System
X	I-Operating_System
10.8	I-Operating_System
Mountain	I-Operating_System
Lion	I-Operating_System
,	O
most	O
Carbon	B-Operating_System
APIs	I-Operating_System
were	O
considered	O
deprecated	B-General_Concept
.	O
</s>
<s>
The	O
APIs	B-General_Concept
were	O
still	O
accessible	O
to	O
developers	O
and	O
all	O
Carbon	O
applications	O
still	O
ran	O
,	O
but	O
the	O
APIs	B-General_Concept
would	O
no	O
longer	O
be	O
updated	O
.	O
</s>
<s>
On	O
June	O
28	O
,	O
2017	O
,	O
Apple	O
announced	O
that	O
32-bit	O
software	O
for	O
macOS	B-Application
,	O
such	O
as	O
all	O
Carbon	O
applications	O
,	O
would	O
no	O
longer	O
be	O
supported	O
“	O
without	O
compromise	O
”	O
on	O
versions	O
of	O
macOS	B-Application
after	O
macOS	B-Operating_System
10.13	I-Operating_System
High	I-Operating_System
Sierra	I-Operating_System
.	O
</s>
<s>
macOS	B-Device
10.15	I-Device
Catalina	I-Device
officially	O
removed	O
support	O
for	O
32-bit	O
applications	O
,	O
including	O
all	O
Carbon	O
applications	O
.	O
</s>
<s>
Carbon	O
descends	O
from	O
the	O
Toolbox	B-Device
,	O
and	O
as	O
such	O
,	O
is	O
composed	O
of	O
"	O
Managers	O
"	O
.	O
</s>
<s>
Each	O
Manager	O
is	O
a	O
functionally	O
related	O
API	B-General_Concept
,	O
defining	O
sets	O
of	O
data	B-General_Concept
structures	I-General_Concept
and	O
functions	O
to	O
manipulate	O
them	O
.	O
</s>
<s>
It	O
is	O
implemented	O
as	O
any	O
other	O
API	B-General_Concept
:	O
in	O
macOS	B-Application
,	O
it	O
is	O
spread	O
over	O
several	O
frameworks	O
(	O
each	O
a	O
structure	O
built	O
around	O
a	O
shared	B-Library
library	I-Library
)	O
,	O
principally	O
Carbon.framework	O
,	O
ApplicationServices.framework	O
,	O
and	O
CoreServices.framework	O
,	O
and	O
in	O
classic	B-Application
Mac	I-Application
OS	I-Application
,	O
it	O
resides	O
in	O
a	O
single	O
shared	B-Library
library	I-Library
named	O
CarbonLib	B-Operating_System
.	O
</s>
<s>
As	O
an	O
umbrella	O
term	O
encompassing	O
all	O
C-language	O
API	B-General_Concept
procedures	O
accessing	O
Mac-specific	O
functionality	O
,	O
Carbon	O
is	O
not	O
designed	O
as	O
a	O
discrete	O
system	O
.	O
</s>
<s>
Rather	O
,	O
it	O
opens	O
nearly	O
all	O
the	O
functionality	O
of	O
macOS	B-Application
to	O
developers	O
who	O
do	O
not	O
know	O
the	O
Objective-C	B-Language
language	O
required	O
for	O
the	O
broadly	O
equivalent	O
Cocoa	B-Operating_System
API	I-Operating_System
.	O
</s>
<s>
Carbon	O
is	O
compatible	O
with	O
all	O
of	O
the	O
several	O
executable	B-Application
formats	I-Application
available	O
for	O
PowerPC	O
Mac	B-Application
OS	I-Application
.	O
</s>
<s>
Binary	O
compatibility	O
between	O
Mac	B-Application
OS	I-Application
X	I-Application
and	O
previous	O
versions	O
requires	O
use	O
of	O
a	O
Preferred	B-Application
Executable	I-Application
Format	I-Application
file	O
,	O
which	O
Apple	O
never	O
supported	O
in	O
their	O
Xcode	B-Operating_System
IDE	B-Application
.	O
</s>
<s>
Newer	O
parts	O
of	O
Carbon	O
tend	O
to	O
be	O
much	O
more	O
object-oriented	B-Language
in	O
their	O
conception	O
,	O
most	O
of	O
them	O
based	O
on	O
Core	B-Operating_System
Foundation	I-Operating_System
.	O
</s>
<s>
Some	O
Managers	O
,	O
such	O
as	O
the	O
HIView	O
Manager	O
(	O
a	O
superset	O
of	O
the	O
Control	O
Manager	O
)	O
,	O
are	O
implemented	O
in	O
C++	B-Language
,	O
but	O
Carbon	O
remains	O
a	O
C	B-Language
API	B-General_Concept
.	O
</s>
<s>
Resource	O
Manager	O
manages	O
access	O
to	O
resources	O
,	O
which	O
are	O
predefined	O
chunks	O
of	O
data	O
a	O
program	B-Application
may	O
require	O
.	O
</s>
<s>
Deprecated	B-General_Concept
(	O
as	O
part	O
of	O
QuickDraw	B-Operating_System
)	O
since	O
Mac	B-Application
OS	I-Application
X	I-Application
v10.4	I-Application
,	O
in	O
favor	O
of	O
Apple	B-Operating_System
Type	I-Operating_System
Services	I-Operating_System
(	O
ATS	O
)	O
.	O
</s>
<s>
QuickDraw	B-Operating_System
2D	O
graphics	O
primitives	O
.	O
</s>
<s>
Deprecated	B-General_Concept
since	O
Mac	B-Application
OS	I-Application
X	I-Application
v10.4	I-Application
,	O
in	O
favor	O
of	O
Quartz	B-Operating_System
2D	O
.	O
</s>
<s>
HIObject	O
a	O
completely	O
new	O
object-oriented	B-Language
API	B-General_Concept
which	O
brings	O
to	O
Carbon	O
an	O
OO	B-Language
model	O
for	O
building	O
GUIs	B-Application
.	O
</s>
<s>
HIToolbox	O
in	O
Mac	B-Application
OS	I-Application
Classic	I-Application
and	O
Copland	B-Application
relied	O
on	O
abandoned	O
IBM	B-Device
System	I-Device
Object	I-Device
Model	I-Device
,	O
so	O
Carbon	O
had	O
to	O
provide	O
quick-and-dirty	O
replacement	O
to	O
enable	O
porting	O
of	O
legacy	O
code	O
.	O
</s>
<s>
This	O
is	O
available	O
in	O
Mac	B-Operating_System
OS	I-Operating_System
X	I-Operating_System
v10.2	I-Operating_System
or	O
later	O
,	O
and	O
gives	O
Carbon	O
programmers	O
some	O
of	O
the	O
tools	O
that	O
Cocoa	B-Operating_System
developers	O
have	O
long	O
been	O
familiar	O
with	O
.	O
</s>
<s>
Starting	O
with	O
Mac	B-Operating_System
OS	I-Operating_System
X	I-Operating_System
v10.2	I-Operating_System
,	O
HIObject	O
is	O
the	O
base	O
class	O
for	O
all	O
GUI	B-Application
elements	O
in	O
Carbon	O
.	O
</s>
<s>
Traditionally	O
GUI	B-Application
architectures	O
of	O
this	O
sort	O
have	O
been	O
left	O
to	O
third-party	O
application	O
frameworks	O
to	O
provide	O
.	O
</s>
<s>
Starting	O
with	O
Mac	B-Application
OS	I-Application
X	I-Application
v10.4	I-Application
,	O
HIObjects	O
are	O
NSObjects	O
and	O
inherit	O
the	O
ability	O
to	O
be	O
serialized	O
into	O
data	O
streams	O
for	O
transport	O
or	O
saving	O
to	O
disk	O
.	O
</s>
<s>
HITheme	O
uses	O
QuickDraw	B-Operating_System
and	O
Quartz	B-Operating_System
to	O
render	O
graphical	B-Application
user	I-Application
interface	I-Application
(	O
GUI	B-Application
)	O
elements	O
to	O
the	O
screen	O
.	O
</s>
<s>
HITheme	O
was	O
introduced	O
in	O
Mac	B-Operating_System
OS	I-Operating_System
X	I-Operating_System
v10.3	I-Operating_System
,	O
and	O
Appearance	O
Manager	O
is	O
a	O
compatibility	O
layer	O
on	O
top	O
of	O
HITheme	O
since	O
that	O
version	O
.	O
</s>
<s>
Since	O
Mac	B-Operating_System
OS	I-Operating_System
X	I-Operating_System
v10.2	I-Operating_System
,	O
all	O
controls	O
are	O
HIViews	O
.	O
</s>
<s>
In	O
Mac	B-Application
OS	I-Application
X	I-Application
v10.4	I-Application
,	O
the	O
Control	O
Manager	O
was	O
renamed	O
HIView	O
Manager	O
.	O
</s>
<s>
Since	O
Mac	B-Operating_System
OS	I-Operating_System
X	I-Operating_System
v10.2	I-Operating_System
,	O
windows	O
have	O
a	O
root	O
HIView	O
.	O
</s>
<s>
Since	O
Mac	B-Operating_System
OS	I-Operating_System
X	I-Operating_System
v10.2	I-Operating_System
,	O
menus	O
are	O
HIObjects	O
.	O
</s>
<s>
Since	O
Mac	B-Operating_System
OS	I-Operating_System
X	I-Operating_System
v10.3	I-Operating_System
,	O
menu	O
content	O
may	O
be	O
drawn	O
using	O
HIViews	O
,	O
and	O
all	O
standard	O
menus	O
use	O
HIViews	O
to	O
draw	O
.	O
</s>
<s>
The	O
Mac	O
Toolbox	B-Device
's	O
Event	O
Manager	O
originally	O
used	O
a	O
polling	B-General_Concept
model	O
for	O
application	O
design	O
.	O
</s>
<s>
The	O
application	O
's	O
main	O
event	B-General_Concept
loop	I-General_Concept
asks	O
the	O
Event	O
Manager	O
for	O
an	O
event	O
using	O
GetNextEvent	O
.	O
</s>
<s>
This	O
behavior	O
is	O
called	O
"	O
busy-waiting	B-Operating_System
"	O
,	O
running	O
the	O
event	B-General_Concept
loop	I-General_Concept
unnecessarily	O
.	O
</s>
<s>
Busy-waiting	B-Operating_System
reduces	O
the	O
amount	O
of	O
CPU	O
time	O
available	O
for	O
other	O
applications	O
and	O
decreases	O
battery	O
power	O
on	O
laptops	O
.	O
</s>
<s>
The	O
classic	O
Event	O
Manager	O
dates	O
from	O
the	O
original	B-Application
Mac	I-Application
OS	I-Application
in	O
1984	O
,	O
when	O
whatever	O
application	O
was	O
running	O
was	O
guaranteed	O
to	O
be	O
the	O
only	O
application	O
running	O
,	O
and	O
where	O
power	O
management	O
was	O
not	O
a	O
concern	O
.	O
</s>
<s>
One	O
easy	O
trick	O
for	O
legacy	O
code	O
to	O
adopt	O
a	O
more	O
efficient	O
model	O
without	O
major	O
changes	O
to	O
its	O
source	O
code	O
is	O
simply	O
to	O
set	O
the	O
sleep	O
parameter	O
passed	O
to	O
WaitNextEvent	O
to	O
a	O
very	O
large	O
value	O
—	O
on	O
macOS	B-Application
,	O
this	O
puts	O
the	O
thread	O
to	O
sleep	O
whenever	O
there	O
is	O
nothing	O
to	O
do	O
,	O
and	O
only	O
returns	O
an	O
event	O
when	O
there	O
is	O
one	O
to	O
process	O
.	O
</s>
<s>
In	O
this	O
way	O
,	O
the	O
polling	B-General_Concept
model	O
is	O
quickly	O
inverted	O
to	O
become	O
equivalent	O
to	O
the	O
callback	O
model	O
,	O
with	O
the	O
application	O
performing	O
its	O
own	O
event	O
dispatching	O
in	O
the	O
original	O
manner	O
.	O
</s>
<s>
For	O
one	O
,	O
the	O
legacy	O
toolbox	B-Device
call	O
ModalDialog	O
,	O
for	O
example	O
,	O
calls	O
the	O
older	O
GetNextEvent	O
function	O
internally	O
,	O
resulting	O
in	O
polling	B-General_Concept
in	O
a	O
tight	O
loop	O
without	O
blocking	O
.	O
</s>
<s>
Carbon	O
Event	O
Manager	O
provides	O
the	O
event	B-General_Concept
loop	I-General_Concept
for	O
the	O
developer	O
(	O
based	O
on	O
Core	B-Operating_System
Foundation	I-Operating_System
's	O
CFRunLoop	O
in	O
the	O
current	O
implementation	O
)	O
;	O
the	O
developer	O
sets	O
up	O
event	O
handlers	O
and	O
enters	O
the	O
event	B-General_Concept
loop	I-General_Concept
in	O
the	O
main	O
function	O
,	O
and	O
waits	O
for	O
Carbon	O
Event	O
Manager	O
to	O
dispatch	O
events	O
to	O
the	O
application	O
.	O
</s>
<s>
In	O
the	O
classic	B-Application
Mac	I-Application
OS	I-Application
,	O
there	O
was	O
no	O
operating	B-General_Concept
system	I-General_Concept
support	O
for	O
application	O
level	O
timers	O
(	O
the	O
lower	O
level	O
Time	O
Manager	O
was	O
available	O
,	O
but	O
it	O
executed	O
timer	O
callbacks	O
at	O
interrupt	O
time	O
,	O
during	O
which	O
calls	O
could	O
not	O
be	O
safely	O
made	O
to	O
most	O
Toolbox	B-Device
routines	O
)	O
.	O
</s>
<s>
GNUstep	B-Application
contains	O
an	O
implementation	O
of	O
the	O
Carbon	B-Operating_System
API	I-Operating_System
called	O
Boron	O
.	O
</s>
<s>
It	O
aims	O
to	O
be	O
compatible	O
with	O
non-deprecated	O
parts	O
of	O
ApplicationServices	O
and	O
CoreServices	O
.	O
</s>
<s>
Darling	B-Language
also	O
contains	O
a	O
Carbon	O
implementation	O
.	O
</s>
