⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 language-bindings.html

📁 按照官方的说法:Cairo is a vector graphics library with cross-device output support. 翻译过来
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"><title>Appendix&#160;A.&#160;Creating a language binding for cairo</title><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="Cairo: A Vector Graphics Library"><link rel="up" href="index.html" title="Cairo: A Vector Graphics Library"><link rel="prev" href="ix01.html" title="Index"><link rel="next" href="bindings-memory.html" title="Memory Management"><meta name="generator" content="GTK-Doc V1.6 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="part" href="pt01.html" title="Part&#160;I.&#160;Tutorial"><link rel="part" href="pt02.html" title="Part&#160;II.&#160;Reference"><link rel="chapter" href="Drawing.html" title="Drawing"><link rel="chapter" href="Fonts.html" title="Fonts"><link rel="chapter" href="Surfaces.html" title="Surfaces"><link rel="chapter" href="Support.html" title="Utilities"><link rel="index" href="ix01.html" title="Index"><link rel="appendix" href="language-bindings.html" title="Appendix&#160;A.&#160;Creating a language binding for cairo"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="ix01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td>&#160;</td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">Cairo: A Vector Graphics Library</th><td><a accesskey="n" href="bindings-memory.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="language-bindings"></a>Appendix&#160;A.&#160;Creating a language binding for cairo</h2></div></div></div><p>    While cairo is implemented and C, and has a C API, it is expected    that many users of cairo will be using it from languages other    than C. The glue that connects the core cairo library to another    language is known as a <em class="firstterm">language    binding</em>. This appendix attempts to collect together    issues that come up when creating a language bindings for cairo    and present standardized solutions to promote consistency among    the different language bindings.  </p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="bindings-general"></a>General considerations</h2></div></div></div><p>      The naming of the central <a href="cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> type is a      special exception. The object is &#8220;a cairo context&#8221; not &#8220;a      cairo&#8221;, and names such as <span class="type">cairo_t</span> rather than      <span class="type">cairo_context_t</span> and      <code class="function">cairo_set_source()</code> rather than      <code class="function">cairo_context_set_source()</code> are simply      abbreviations to make the C API more palatable. In languages      which have object-oriented syntax, this abbreviation is much      less useful. In fact, if &#8216;Cairo&#8217; is used as a namespace, then      in many languages, you'd end up with a ridiculous type name      like &#8216;Cairo.Cairo&#8217;. For this reason, and for inter-language      consistency all object-oriented languages should name this      type as if it were <span class="type">cairo_context_t</span>.    </p><p>      The punctuation and casing of the type names and      method names of cairo should be changed to match the general      convention of the language. In Java, where type names are written      in StudlyCaps and method names in javaCaps, cairo_font_extents_t      will become FontExtents and      <code class="literal">cairo_set_source(cr,source)</code>,      <code class="literal">cr.setSource(source)</code>.      As compared to changing the punctuation, and casing, much      more reluctance should be used in changing the method names      themselves. Even if get is usually omitted from getters in      your language, you shouldn't bind cairo_get_source() as      cr.source().    </p></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -