📄 cairo-types.xml
字号:
<?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-Types"><refmeta><refentrytitle id="top_of_page">Types</refentrytitle><manvolnum>3</manvolnum><refmiscinfo>CAIRO Library</refmiscinfo></refmeta><refnamediv><refname>Types</refname><refpurpose>Generic data types used in the cairo API</refpurpose><!--[<xref linkend="desc" endterm="desc.title"/>]--></refnamediv><refsynopsisdiv id="synopsis"><title id="synopsis.title">Synopsis</title><synopsis>typedef <link linkend="cairo-bool-t">cairo_bool_t</link>; <link linkend="cairo-user-data-key-t">cairo_user_data_key_t</link>;<link linkend="void">void</link> (<link linkend="cairo-destroy-func-t">*cairo_destroy_func_t</link>) (<link linkend="void">void</link> *data);</synopsis></refsynopsisdiv><refsect1 id="desc"><title id="desc.title">Description</title><para></para></refsect1><refsect1 id="details"><title id="details.title">Details</title><refsect2><title><anchor id="cairo-bool-t" role="typedef"/>cairo_bool_t</title><indexterm><primary>cairo_bool_t</primary></indexterm><programlisting>typedef int cairo_bool_t;</programlisting><para><link linkend="cairo-bool-t"><type>cairo_bool_t</type></link> is used for boolean values. Returns of type<link linkend="cairo-bool-t"><type>cairo_bool_t</type></link> will always be either 0 or 1, but testing againstthese values explicitly is not encouraged; just use thevalue as a boolean condition.</para><para><informalexample><programlisting> if (cairo_in_stroke (cr, x, y)) { /<!-- -->* do something *<!-- -->/ }</programlisting></informalexample></para><para></para></refsect2><refsect2><title><anchor id="cairo-user-data-key-t" role="struct"/>cairo_user_data_key_t</title><indexterm><primary>cairo_user_data_key_t</primary></indexterm><programlisting>typedef struct { int unused;} cairo_user_data_key_t;</programlisting><para><link linkend="cairo-user-data-key-t"><type>cairo_user_data_key_t</type></link> is used for attaching user data to cairodata structures. The actual contents of the struct is never used,and there is no need to initialize the object; only the uniqueaddress of a <link linkend="cairo-data-key-t"><type>cairo_data_key_t</type></link> object is used. Typically, youwould just use the address of a static <link linkend="cairo-data-key-t"><type>cairo_data_key_t</type></link> object.</para><para></para><variablelist role="struct"><varlistentry><term><link linkend="int">int</link> <structfield>unused</structfield>;</term><listitem><simpara> not used; ignore.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="cairo-destroy-func-t" role="function"/>cairo_destroy_func_t ()</title><indexterm><primary>cairo_destroy_func_t</primary></indexterm><programlisting><link linkend="void">void</link> (*cairo_destroy_func_t) (<link linkend="void">void</link> *data);</programlisting><para><link linkend="cairo-destroy-func-t"><type>cairo_destroy_func_t</type></link> the type of function which is called when adata element is destroyed. It is passed the pointer to the dataelement and should free any memory and resources allocated for it.</para><para></para><variablelist role="params"><varlistentry><term><parameter>data</parameter> :</term><listitem><simpara> The data element being destroyed.</simpara></listitem></varlistentry></variablelist></refsect2></refsect1></refentry>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -