diff options
author | sanine <sanine.not@pm.me> | 2022-10-12 12:03:23 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-10-12 12:03:23 -0500 |
commit | 530ffd0b7d3c39757b20f00716e486b5caf89aff (patch) | |
tree | 76b35fdf57317038acf6b828871f6ae25fce2ebe /libs/cairo-1.16.0/doc/public/html/language-bindings.html | |
parent | 3dbe9332e47c143a237db12440f134caebd1cfbe (diff) |
add cairo
Diffstat (limited to 'libs/cairo-1.16.0/doc/public/html/language-bindings.html')
-rw-r--r-- | libs/cairo-1.16.0/doc/public/html/language-bindings.html | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/libs/cairo-1.16.0/doc/public/html/language-bindings.html b/libs/cairo-1.16.0/doc/public/html/language-bindings.html new file mode 100644 index 0000000..82643db --- /dev/null +++ b/libs/cairo-1.16.0/doc/public/html/language-bindings.html @@ -0,0 +1,72 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<title>Appendix A. Creating a language binding for cairo: Cairo: A Vector Graphics Library</title> +<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> +<link rel="home" 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="index-1.16.html" title="Index of new symbols in 1.16"> +<link rel="next" href="bindings-memory.html" title="Memory management"> +<meta name="generator" content="GTK-Doc V1.27 (XML mode)"> +<link rel="stylesheet" href="style.css" type="text/css"> +</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="5"><tr valign="middle"> +<td width="100%" align="left" class="shortcuts"></td> +<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> +<td><img src="up-insensitive.png" width="16" height="16" border="0"></td> +<td><a accesskey="p" href="index-1.16.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> +<td><a accesskey="n" href="bindings-memory.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> +</tr></table> +<div class="appendix"> +<div class="titlepage"><div><div><h1 class="title"> +<a name="language-bindings"></a>Appendix A. Creating a language binding for cairo</h1></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"> +<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 class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> type is a + special exception. The object is “a cairo context” not “a + cairo”, 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 ‘Cairo’ is used as a namespace, then + in many languages, you'd end up with a ridiculous type name + like ‘Cairo.Cairo’. 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> +<div class="footer"> +<hr>Generated by GTK-Doc V1.27</div> +</body> +</html>
\ No newline at end of file |