summaryrefslogtreecommitdiff
path: root/doc/public/xml/cairo-quartz.xml
blob: e31f74380fbd5c595c91c0beb9ce60262ced4988 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?xml version='1.0' encoding='UTF-8'?> 
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
                "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="cairo-quartz-surface">
<refmeta>
<refentrytitle role="top_of_page" id="cairo-quartz-surface.top_of_page">Quartz Surfaces</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CAIRO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Quartz Surfaces</refname>
<refpurpose>Rendering to Quartz surfaces</refpurpose>
</refnamediv>

<refsynopsisdiv id="cairo-quartz-surface.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
#define             <link linkend="CAIRO-HAS-QUARTZ-SURFACE--CAPS">CAIRO_HAS_QUARTZ_SURFACE</link>
<link linkend="cairo-surface-t">cairo_surface_t</link> *   <link linkend="cairo-quartz-surface-create">cairo_quartz_surface_create</link>         (<link linkend="cairo-format-t">cairo_format_t</link> format,
                                                         unsigned <link linkend="int">int</link> width,
                                                         unsigned <link linkend="int">int</link> height);
<link linkend="cairo-surface-t">cairo_surface_t</link> *   <link linkend="cairo-quartz-surface-create-for-cg-context">cairo_quartz_surface_create_for_cg_context</link>
                                                        (<link linkend="CGContextRef">CGContextRef</link> cgContext,
                                                         unsigned <link linkend="int">int</link> width,
                                                         unsigned <link linkend="int">int</link> height);
<link linkend="CGContextRef">CGContextRef</link>        <link linkend="cairo-quartz-surface-get-cg-context">cairo_quartz_surface_get_cg_context</link> (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);
</synopsis>
</refsynopsisdiv>









<refsect1 id="cairo-quartz-surface.description" role="desc">
<title role="desc.title">Description</title>
<para>
The Quartz surface is used to render cairo graphics targeting the
Apple OS X Quartz rendering system.
</para>
</refsect1>

<refsect1 id="cairo-quartz-surface.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="CAIRO-HAS-QUARTZ-SURFACE--CAPS" role="macro">
<title>CAIRO_HAS_QUARTZ_SURFACE</title>
<indexterm zone="CAIRO-HAS-QUARTZ-SURFACE--CAPS"><primary sortas="CAIRO_HAS_QUARTZ_SURFACE">CAIRO_HAS_QUARTZ_SURFACE</primary></indexterm><programlisting>#define             CAIRO_HAS_QUARTZ_SURFACE</programlisting>
<para>
Defined if the Quartz surface backend is available.
This macro can be used to conditionally compile backend-specific code.
</para></refsect2>
<refsect2 id="cairo-quartz-surface-create" role="function" condition="since:1.4">
<title>cairo_quartz_surface_create ()</title>
<indexterm zone="cairo-quartz-surface-create" role="1.4"><primary sortas="cairo_quartz_surface_create">cairo_quartz_surface_create</primary></indexterm><programlisting><link linkend="cairo-surface-t">cairo_surface_t</link> *   cairo_quartz_surface_create         (<link linkend="cairo-format-t">cairo_format_t</link> format,
                                                         unsigned <link linkend="int">int</link> width,
                                                         unsigned <link linkend="int">int</link> height);</programlisting>
<para>
Creates a Quartz surface backed by a CGBitmap.  The surface is
created using the Device RGB (or Device Gray, for A8) color space.
All Cairo operations, including those that require software
rendering, will succeed on this surface.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara> format of pixels in the surface to create
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara> width of the surface, in pixels
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&#160;:</term>
<listitem><simpara> height of the surface, in pixels
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the newly created surface.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.4</para></refsect2>
<refsect2 id="cairo-quartz-surface-create-for-cg-context" role="function" condition="since:1.4">
<title>cairo_quartz_surface_create_for_cg_context ()</title>
<indexterm zone="cairo-quartz-surface-create-for-cg-context" role="1.4"><primary sortas="cairo_quartz_surface_create_for_cg_context">cairo_quartz_surface_create_for_cg_context</primary></indexterm><programlisting><link linkend="cairo-surface-t">cairo_surface_t</link> *   cairo_quartz_surface_create_for_cg_context
                                                        (<link linkend="CGContextRef">CGContextRef</link> cgContext,
                                                         unsigned <link linkend="int">int</link> width,
                                                         unsigned <link linkend="int">int</link> height);</programlisting>
<para>
Creates a Quartz surface that wraps the given CGContext.  The
CGContext is assumed to be in the standard Cairo coordinate space
(that is, with the origin at the upper left and the Y axis
increasing downward).  If the CGContext is in the Quartz coordinate
space (with the origin at the bottom left), then it should be
flipped before this function is called.  The flip can be accomplished
using a translate and a scale; for example:
</para>
<para>
<informalexample><programlisting>
CGContextTranslateCTM (cgContext, 0.0, height);
CGContextScaleCTM (cgContext, 1.0, -1.0);
</programlisting></informalexample>
</para>
<para>
All Cairo operations are implemented in terms of Quartz operations,
as long as Quartz-compatible elements are used (such as Quartz fonts).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cgContext</parameter>&#160;:</term>
<listitem><simpara> the existing CGContext for which to create the surface
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara> width of the surface, in pixels
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&#160;:</term>
<listitem><simpara> height of the surface, in pixels
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the newly created Cairo surface.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.4</para></refsect2>
<refsect2 id="cairo-quartz-surface-get-cg-context" role="function" condition="since:1.4">
<title>cairo_quartz_surface_get_cg_context ()</title>
<indexterm zone="cairo-quartz-surface-get-cg-context" role="1.4"><primary sortas="cairo_quartz_surface_get_cg_context">cairo_quartz_surface_get_cg_context</primary></indexterm><programlisting><link linkend="CGContextRef">CGContextRef</link>        cairo_quartz_surface_get_cg_context (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);</programlisting>
<para>
Returns the CGContextRef that the given Quartz surface is backed
by.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>surface</parameter>&#160;:</term>
<listitem><simpara> the Cairo Quartz surface
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the CGContextRef for the given surface.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.4</para></refsect2>

</refsect1>



<refsect1 id="cairo-quartz-surface.see-also">
<title>See Also</title>
<para>
<itemizedlist>
<listitem><link linkend="cairo-surface-t"><type>cairo_surface_t</type></link></listitem>
</itemizedlist>
</para>
</refsect1>

</refentry>