Show
Ignore:
Timestamp:
11/03/07 22:54:06 (5 years ago)
Author:
DRK
Message:

* Updated the bindings to support cairo 1.2 and cairo 1.4. Support for these can be enabled with the cairo_1_2 and cairo_1_4 version identifiers.
* Added pdf, ps and svg support.
* Updated the build script appropriately.
* Note that cairooo is not likely to receive any further updates in its current form. It is being forked and rewritten for Tango's graphics package, although a port back to Phobos isn't out of the question.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cairo/README.html

    r119 r228  
    44<head> 
    55<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    6 <meta name="generator" content="Docutils 0.3.8: http://docutils.sourceforge.net/" /> 
     6<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" /> 
    77<title>cairo bindings for D</title> 
    8 <link rel="stylesheet" href="default.css" type="text/css" /> 
     8<style type="text/css"> 
     9 
     10/* 
     11:Author: David Goodger 
     12:Contact: goodger@python.org 
     13:Date: $Date: 2006-05-21 22:44:42 +0200 (Sun, 21 May 2006) $ 
     14:Revision: $Revision: 4564 $ 
     15:Copyright: This stylesheet has been placed in the public domain. 
     16 
     17Default cascading style sheet for the HTML output of Docutils. 
     18 
     19See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to 
     20customize this style sheet. 
     21*/ 
     22 
     23/* used to remove borders from tables and images */ 
     24.borderless, table.borderless td, table.borderless th { 
     25  border: 0 } 
     26 
     27table.borderless td, table.borderless th { 
     28  /* Override padding for "table.docutils td" with "! important". 
     29     The right padding separates the table cells. */ 
     30  padding: 0 0.5em 0 0 ! important } 
     31 
     32.first { 
     33  /* Override more specific margin styles with "! important". */ 
     34  margin-top: 0 ! important } 
     35 
     36.last, .with-subtitle { 
     37  margin-bottom: 0 ! important } 
     38 
     39.hidden { 
     40  display: none } 
     41 
     42a.toc-backref { 
     43  text-decoration: none ; 
     44  color: black } 
     45 
     46blockquote.epigraph { 
     47  margin: 2em 5em ; } 
     48 
     49dl.docutils dd { 
     50  margin-bottom: 0.5em } 
     51 
     52/* Uncomment (and remove this text!) to get bold-faced definition list terms 
     53dl.docutils dt { 
     54  font-weight: bold } 
     55*/ 
     56 
     57div.abstract { 
     58  margin: 2em 5em } 
     59 
     60div.abstract p.topic-title { 
     61  font-weight: bold ; 
     62  text-align: center } 
     63 
     64div.admonition, div.attention, div.caution, div.danger, div.error, 
     65div.hint, div.important, div.note, div.tip, div.warning { 
     66  margin: 2em ; 
     67  border: medium outset ; 
     68  padding: 1em } 
     69 
     70div.admonition p.admonition-title, div.hint p.admonition-title, 
     71div.important p.admonition-title, div.note p.admonition-title, 
     72div.tip p.admonition-title { 
     73  font-weight: bold ; 
     74  font-family: sans-serif } 
     75 
     76div.attention p.admonition-title, div.caution p.admonition-title, 
     77div.danger p.admonition-title, div.error p.admonition-title, 
     78div.warning p.admonition-title { 
     79  color: red ; 
     80  font-weight: bold ; 
     81  font-family: sans-serif } 
     82 
     83/* Uncomment (and remove this text!) to get reduced vertical space in 
     84   compound paragraphs. 
     85div.compound .compound-first, div.compound .compound-middle { 
     86  margin-bottom: 0.5em } 
     87 
     88div.compound .compound-last, div.compound .compound-middle { 
     89  margin-top: 0.5em } 
     90*/ 
     91 
     92div.dedication { 
     93  margin: 2em 5em ; 
     94  text-align: center ; 
     95  font-style: italic } 
     96 
     97div.dedication p.topic-title { 
     98  font-weight: bold ; 
     99  font-style: normal } 
     100 
     101div.figure { 
     102  margin-left: 2em ; 
     103  margin-right: 2em } 
     104 
     105div.footer, div.header { 
     106  clear: both; 
     107  font-size: smaller } 
     108 
     109div.line-block { 
     110  display: block ; 
     111  margin-top: 1em ; 
     112  margin-bottom: 1em } 
     113 
     114div.line-block div.line-block { 
     115  margin-top: 0 ; 
     116  margin-bottom: 0 ; 
     117  margin-left: 1.5em } 
     118 
     119div.sidebar { 
     120  margin-left: 1em ; 
     121  border: medium outset ; 
     122  padding: 1em ; 
     123  background-color: #ffffee ; 
     124  width: 40% ; 
     125  float: right ; 
     126  clear: right } 
     127 
     128div.sidebar p.rubric { 
     129  font-family: sans-serif ; 
     130  font-size: medium } 
     131 
     132div.system-messages { 
     133  margin: 5em } 
     134 
     135div.system-messages h1 { 
     136  color: red } 
     137 
     138div.system-message { 
     139  border: medium outset ; 
     140  padding: 1em } 
     141 
     142div.system-message p.system-message-title { 
     143  color: red ; 
     144  font-weight: bold } 
     145 
     146div.topic { 
     147  margin: 2em } 
     148 
     149h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, 
     150h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { 
     151  margin-top: 0.4em } 
     152 
     153h1.title { 
     154  text-align: center } 
     155 
     156h2.subtitle { 
     157  text-align: center } 
     158 
     159hr.docutils { 
     160  width: 75% } 
     161 
     162img.align-left { 
     163  clear: left } 
     164 
     165img.align-right { 
     166  clear: right } 
     167 
     168ol.simple, ul.simple { 
     169  margin-bottom: 1em } 
     170 
     171ol.arabic { 
     172  list-style: decimal } 
     173 
     174ol.loweralpha { 
     175  list-style: lower-alpha } 
     176 
     177ol.upperalpha { 
     178  list-style: upper-alpha } 
     179 
     180ol.lowerroman { 
     181  list-style: lower-roman } 
     182 
     183ol.upperroman { 
     184  list-style: upper-roman } 
     185 
     186p.attribution { 
     187  text-align: right ; 
     188  margin-left: 50% } 
     189 
     190p.caption { 
     191  font-style: italic } 
     192 
     193p.credits { 
     194  font-style: italic ; 
     195  font-size: smaller } 
     196 
     197p.label { 
     198  white-space: nowrap } 
     199 
     200p.rubric { 
     201  font-weight: bold ; 
     202  font-size: larger ; 
     203  color: maroon ; 
     204  text-align: center } 
     205 
     206p.sidebar-title { 
     207  font-family: sans-serif ; 
     208  font-weight: bold ; 
     209  font-size: larger } 
     210 
     211p.sidebar-subtitle { 
     212  font-family: sans-serif ; 
     213  font-weight: bold } 
     214 
     215p.topic-title { 
     216  font-weight: bold } 
     217 
     218pre.address { 
     219  margin-bottom: 0 ; 
     220  margin-top: 0 ; 
     221  font-family: serif ; 
     222  font-size: 100% } 
     223 
     224pre.literal-block, pre.doctest-block { 
     225  margin-left: 2em ; 
     226  margin-right: 2em } 
     227 
     228span.classifier { 
     229  font-family: sans-serif ; 
     230  font-style: oblique } 
     231 
     232span.classifier-delimiter { 
     233  font-family: sans-serif ; 
     234  font-weight: bold } 
     235 
     236span.interpreted { 
     237  font-family: sans-serif } 
     238 
     239span.option { 
     240  white-space: nowrap } 
     241 
     242span.pre { 
     243  white-space: pre } 
     244 
     245span.problematic { 
     246  color: red } 
     247 
     248span.section-subtitle { 
     249  /* font-size relative to parent (h1..h6 element) */ 
     250  font-size: 80% } 
     251 
     252table.citation { 
     253  border-left: solid 1px gray; 
     254  margin-left: 1px } 
     255 
     256table.docinfo { 
     257  margin: 2em 4em } 
     258 
     259table.docutils { 
     260  margin-top: 0.5em ; 
     261  margin-bottom: 0.5em } 
     262 
     263table.footnote { 
     264  border-left: solid 1px black; 
     265  margin-left: 1px } 
     266 
     267table.docutils td, table.docutils th, 
     268table.docinfo td, table.docinfo th { 
     269  padding-left: 0.5em ; 
     270  padding-right: 0.5em ; 
     271  vertical-align: top } 
     272 
     273table.docutils th.field-name, table.docinfo th.docinfo-name { 
     274  font-weight: bold ; 
     275  text-align: left ; 
     276  white-space: nowrap ; 
     277  padding-left: 0 } 
     278 
     279h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, 
     280h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { 
     281  font-size: 100% } 
     282 
     283ul.auto-toc { 
     284  list-style-type: none } 
     285 
     286</style> 
    9287</head> 
    10288<body> 
    11289<div class="document" id="cairo-bindings-for-d"> 
    12290<h1 class="title">cairo bindings for D</h1> 
     291 
    13292<!-- This document is written in reStructuredText. --> 
    14293<!-- Build command: 
    15294rst2html.py - -date - -time README.rst README.html --> 
    16 <div class="contents topic" id="contents"
    17 <p class="topic-title first"><a name="contents">Contents</a></p> 
     295<div class="contents topic"
     296<p class="topic-title first"><a id="contents" name="contents">Contents</a></p> 
    18297<ul class="simple"> 
    19298<li><a class="reference" href="#introduction" id="id3" name="id3">Introduction</a></li> 
     
    38317</ul> 
    39318</div> 
    40 <div class="section" id="introduction"
    41 <h1><a class="toc-backref" href="#id3" name="introduction">Introduction</a></h1> 
     319<div class="section"
     320<h1><a class="toc-backref" href="#id3" id="introduction" name="introduction">Introduction</a></h1> 
    42321<p>This project's aim is to provide a complete, up-to-date D binding for the 
    43322<a class="reference" href="http://cairographics.org/">cairo</a> 2D drawing API.  Currently, the binding supports the base cairo 
     
    49328provide a library of additional, high-level functionality with this layer.</p> 
    50329</div> 
    51 <div class="section" id="installation"
    52 <h1><a class="toc-backref" href="#id4" name="installation">Installation</a></h1> 
    53 <div class="section" id="cairo-binding"
    54 <h2><a class="toc-backref" href="#id5" name="cairo-binding">cairo binding</a></h2> 
     330<div class="section"
     331<h1><a class="toc-backref" href="#id4" id="installation" name="installation">Installation</a></h1> 
     332<div class="section"
     333<h2><a class="toc-backref" href="#id5" id="cairo-binding" name="cairo-binding">cairo binding</a></h2> 
    55334<p>To install, simply copy the <tt class="docutils literal"><span class="pre">cairo</span></tt> directory to a place in your D 
    56335compiler's import path.  That's all there is to it.</p> 
     
    71350libraries with debug symbols <a class="footnote-reference" href="#debuglibs" id="id1" name="id1">[1]</a>.</p> 
    72351<p>Use the <tt class="docutils literal"><span class="pre">--help</span></tt> switch for full usage information.</p> 
    73 </div> 
    74 <div class="section" id="cairooo-binding"> 
    75 <h2><a class="toc-backref" href="#id6" name="cairooo-binding">cairooo binding</a></h2> 
     352<p>Also, please note that if you are building static libraries that these 
     353libraries only compile for one particular version of cairo at a time.  To 
     354select which version of the cairo API you want to compile for, you need to use 
     355the following additional arguments to the build script:</p> 
     356<ul class="simple"> 
     357<li>cairo 1.0: no arguments needed.</li> 
     358<li>cairo 1.2: <tt class="docutils literal"><span class="pre">+--version=cairo_1_2</span></tt></li> 
     359<li>cairo 1.4: <tt class="docutils literal"><span class="pre">+--version=cairo_1_4</span></tt></li> 
     360</ul> 
     361<p>You will also need to specify the same version identifier when you compile 
     362your programs.</p> 
     363</div> 
     364<div class="section"> 
     365<h2><a class="toc-backref" href="#id6" id="cairooo-binding" name="cairooo-binding">cairooo binding</a></h2> 
    76366<p>To install the cairooo binding, simply copy both the <tt class="docutils literal"><span class="pre">cairo</span></tt> and <tt class="docutils literal"><span class="pre">cairooo</span></tt> 
    77367directories to a place on your D compiler's import path.</p> 
     
    79369<tt class="docutils literal"><span class="pre">cairooo-build.d</span></tt> script, which will build them to the <tt class="docutils literal"><span class="pre">lib</span></tt> directory. 
    80370Usage is mostly the same as using <tt class="docutils literal"><span class="pre">cairo-build.d</span></tt> (see above).</p> 
    81 </div> 
    82 <div class="section" id="cairo-snippets"> 
    83 <h2><a class="toc-backref" href="#id7" name="cairo-snippets">cairo snippets</a></h2> 
     371<p>Note that cairooo currently does not support cairo 1.2 or 1.4.</p> 
     372</div> 
     373<div class="section"> 
     374<h2><a class="toc-backref" href="#id7" id="cairo-snippets" name="cairo-snippets">cairo snippets</a></h2> 
    84375<p>The <tt class="docutils literal"><span class="pre">cairo_snippets</span></tt> and <tt class="docutils literal"><span class="pre">cairooo_snippets</span></tt> directories contain the 
    85376&quot;snippets&quot; example programs provided by the cairo developers ported to D. 
     
    94385<p>Just be sure to create the <tt class="docutils literal"><span class="pre">output</span></tt> directory if it does not exist first.</p> 
    95386</div> 
    96 <div class="section" id="cairooo-tutorial"
    97 <h2><a class="toc-backref" href="#id8" name="cairooo-tutorial">cairooo tutorial</a></h2> 
     387<div class="section"
     388<h2><a class="toc-backref" href="#id8" id="cairooo-tutorial" name="cairooo-tutorial">cairooo tutorial</a></h2> 
    98389<p>The <tt class="docutils literal"><span class="pre">cairooo_tutorial</span></tt> contains the beginnings of a very simple introductory 
    99390tutorial to programming image programs in D using the cairooo binding.  It is 
    100391pathetically incomplete; however, it may be a useful starting point.</p> 
    101392</div> 
    102 <div class="section" id="demos"
    103 <h2><a class="toc-backref" href="#id9" name="demos">demos</a></h2> 
     393<div class="section"
     394<h2><a class="toc-backref" href="#id9" id="demos" name="demos">demos</a></h2> 
    104395<p>The <tt class="docutils literal"><span class="pre">demos</span></tt> directory will contain a few small demo programs to showcase the 
    105396binding.  Currently, it only has one demo, so the plural is prehaps 
    106397misleading.  Hopefully this will change :)</p> 
    107398</div> 
    108 <div class="section" id="documentation"
    109 <h2><a class="toc-backref" href="#id10" name="documentation">documentation</a></h2> 
     399<div class="section"
     400<h2><a class="toc-backref" href="#id10" id="documentation" name="documentation">documentation</a></h2> 
    110401<p>Whilst this project hopes to eventually have full DDoc documentation for the 
    111402cairooo binding, we will not be providing anything other than minimal 
     
    130421</pre> 
    131422</div> 
    132 <div class="section" id="cairo-for-windows"
    133 <h2><a class="toc-backref" href="#id11" name="cairo-for-windows">cairo for Windows</a></h2> 
     423<div class="section"
     424<h2><a class="toc-backref" href="#id11" id="cairo-for-windows" name="cairo-for-windows">cairo for Windows</a></h2> 
    134425<p>If you are using Windows, you will also probably want to grab the cairo 
    135426library itself.  The best version I have found is on <a class="reference" href="http://www.iki.fi/tml/index.html">Tor Lillqvist</a>'s 
     
    147438</div> 
    148439</div> 
    149 <div class="section" id="usage"
    150 <h1><a class="toc-backref" href="#id12" name="usage">Usage</a></h1> 
    151 <div class="section" id="cairo"
    152 <h2><a class="toc-backref" href="#id13" name="cairo">cairo</a></h2> 
     440<div class="section"
     441<h1><a class="toc-backref" href="#id12" id="usage" name="usage">Usage</a></h1> 
     442<div class="section"
     443<h2><a class="toc-backref" href="#id13" id="cairo" name="cairo">cairo</a></h2> 
    153444<p>To use the binding, simply import <tt class="docutils literal"><span class="pre">cairo.cairo</span></tt>, along with any other 
    154445parts of the library you need.  For example, if you wanted the base cairo 
     
    167458<p>If some part of the library fails to load, these functions will thrown an 
    168459exception which can be caught and dealt with.</p> 
     460<p>To select a particular version of the cairo library, make sure you compile 
     461with an appropriate version flag:</p> 
     462<ul class="simple"> 
     463<li>cairo 1.0: no version flag necessary.</li> 
     464<li>cairo 1.2: --version=cairo_1_2.</li> 
     465<li>cairo 1.4: --version=cairo_1_4.</li> 
     466</ul> 
    169467<p>From there, just start using the cairo API as you would from C.  The cairo 
    170468website contains a collection of <a class="reference" href="http://cairographics.org/samples/">example snippets</a> in C, and this binding 
     
    172470look in the <tt class="docutils literal"><span class="pre">cairo_snippets</span></tt> directory.</p> 
    173471</div> 
    174 <div class="section" id="cairooo"
    175 <h2><a class="toc-backref" href="#id14" name="cairooo">cairooo</a></h2> 
     472<div class="section"
     473<h2><a class="toc-backref" href="#id14" id="cairooo" name="cairooo">cairooo</a></h2> 
    176474<p>To use the cairooo binding instead, import <tt class="docutils literal"><span class="pre">cairooo.all</span></tt>, along with any 
    177475other parts of the library that you need.  To copy the above example, to 
     
    219517</div> 
    220518</div> 
    221 <div class="section" id="contributing"
    222 <h1><a class="toc-backref" href="#id15" name="contributing">Contributing</a></h1> 
     519<div class="section"
     520<h1><a class="toc-backref" href="#id15" id="contributing" name="contributing">Contributing</a></h1> 
    223521<p>The cairo api has a functionality in it that this binding does not 
    224522yet cover: PDF abd PS for example.  However, the only binary version of cairo 
     
    231529In addition to being fun, you get to make pretty pictures in the process!</p> 
    232530</div> 
    233 <div class="section" id="thanks"
    234 <h1><a class="toc-backref" href="#id16" name="thanks">Thanks</a></h1> 
     531<div class="section"
     532<h1><a class="toc-backref" href="#id16" id="thanks" name="thanks">Thanks</a></h1> 
    235533<ul class="simple"> 
    236534<li>Many thanks for the hard work by the people behind the cairo library.</li> 
     
    239537</ul> 
    240538</div> 
    241 <div class="section" id="credits"
    242 <h1><a class="toc-backref" href="#id17" name="credits">Credits</a></h1> 
     539<div class="section"
     540<h1><a class="toc-backref" href="#id17" id="credits" name="credits">Credits</a></h1> 
    243541<p>cairo bindings for D Copyright © 2006 Daniel Keep.  Portions Copyright © 
    2445422006 Michael Parker.</p> 
     
    258556<div class="footer"> 
    259557<hr class="footer" /> 
    260 Generated on: 2006-05-19 02:45 UTC. 
     558Generated on: 2007-11-04 02:51 UTC. 
    261559 
    262560</div>