Changeset 228
- Timestamp:
- 11/03/07 22:54:06 (4 years ago)
- Files:
-
- trunk/cairo/README.html (modified) (14 diffs)
- trunk/cairo/README.rst (modified) (3 diffs)
- trunk/cairo/cairo-build.d (modified) (6 diffs)
- trunk/cairo/cairo/cairo.d (modified) (2 diffs)
- trunk/cairo/cairo/cairofuncs.d (modified) (5 diffs)
- trunk/cairo/cairo/cairotypes.d (modified) (2 diffs)
- trunk/cairo/cairo/loader.d (modified) (1 diff)
- trunk/cairo/cairo/pdf (added)
- trunk/cairo/cairo/pdf/cairo_pdf.d (added)
- trunk/cairo/cairo/pdf/cairofuncs_pdf.d (added)
- trunk/cairo/cairo/pdf/cairotypes_pdf.d (added)
- trunk/cairo/cairo/png/cairofuncs_png.d (modified) (1 diff)
- trunk/cairo/cairo/ps (added)
- trunk/cairo/cairo/ps/cairo_ps.d (added)
- trunk/cairo/cairo/ps/cairofuncs_ps.d (added)
- trunk/cairo/cairo/ps/cairotypes_ps.d (added)
- trunk/cairo/cairo/svg (added)
- trunk/cairo/cairo/svg/cairo_svg.d (added)
- trunk/cairo/cairo/svg/cairofuncs_svg.d (added)
- trunk/cairo/cairo/svg/cairotypes_svg.d (added)
- trunk/cairo/cairo/win32/cairotypes_win32.d (modified) (1 diff)
- trunk/cairo/cairo_snippets/cairo_snippets_png_run.bat (modified) (1 diff)
- trunk/cairo/cairooo-build.d (modified) (2 diffs)
- trunk/cairo/util/script.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cairo/README.html
r119 r228 4 4 <head> 5 5 <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/" /> 7 7 <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 17 Default cascading style sheet for the HTML output of Docutils. 18 19 See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to 20 customize 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 27 table.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 42 a.toc-backref { 43 text-decoration: none ; 44 color: black } 45 46 blockquote.epigraph { 47 margin: 2em 5em ; } 48 49 dl.docutils dd { 50 margin-bottom: 0.5em } 51 52 /* Uncomment (and remove this text!) to get bold-faced definition list terms 53 dl.docutils dt { 54 font-weight: bold } 55 */ 56 57 div.abstract { 58 margin: 2em 5em } 59 60 div.abstract p.topic-title { 61 font-weight: bold ; 62 text-align: center } 63 64 div.admonition, div.attention, div.caution, div.danger, div.error, 65 div.hint, div.important, div.note, div.tip, div.warning { 66 margin: 2em ; 67 border: medium outset ; 68 padding: 1em } 69 70 div.admonition p.admonition-title, div.hint p.admonition-title, 71 div.important p.admonition-title, div.note p.admonition-title, 72 div.tip p.admonition-title { 73 font-weight: bold ; 74 font-family: sans-serif } 75 76 div.attention p.admonition-title, div.caution p.admonition-title, 77 div.danger p.admonition-title, div.error p.admonition-title, 78 div.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. 85 div.compound .compound-first, div.compound .compound-middle { 86 margin-bottom: 0.5em } 87 88 div.compound .compound-last, div.compound .compound-middle { 89 margin-top: 0.5em } 90 */ 91 92 div.dedication { 93 margin: 2em 5em ; 94 text-align: center ; 95 font-style: italic } 96 97 div.dedication p.topic-title { 98 font-weight: bold ; 99 font-style: normal } 100 101 div.figure { 102 margin-left: 2em ; 103 margin-right: 2em } 104 105 div.footer, div.header { 106 clear: both; 107 font-size: smaller } 108 109 div.line-block { 110 display: block ; 111 margin-top: 1em ; 112 margin-bottom: 1em } 113 114 div.line-block div.line-block { 115 margin-top: 0 ; 116 margin-bottom: 0 ; 117 margin-left: 1.5em } 118 119 div.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 128 div.sidebar p.rubric { 129 font-family: sans-serif ; 130 font-size: medium } 131 132 div.system-messages { 133 margin: 5em } 134 135 div.system-messages h1 { 136 color: red } 137 138 div.system-message { 139 border: medium outset ; 140 padding: 1em } 141 142 div.system-message p.system-message-title { 143 color: red ; 144 font-weight: bold } 145 146 div.topic { 147 margin: 2em } 148 149 h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, 150 h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { 151 margin-top: 0.4em } 152 153 h1.title { 154 text-align: center } 155 156 h2.subtitle { 157 text-align: center } 158 159 hr.docutils { 160 width: 75% } 161 162 img.align-left { 163 clear: left } 164 165 img.align-right { 166 clear: right } 167 168 ol.simple, ul.simple { 169 margin-bottom: 1em } 170 171 ol.arabic { 172 list-style: decimal } 173 174 ol.loweralpha { 175 list-style: lower-alpha } 176 177 ol.upperalpha { 178 list-style: upper-alpha } 179 180 ol.lowerroman { 181 list-style: lower-roman } 182 183 ol.upperroman { 184 list-style: upper-roman } 185 186 p.attribution { 187 text-align: right ; 188 margin-left: 50% } 189 190 p.caption { 191 font-style: italic } 192 193 p.credits { 194 font-style: italic ; 195 font-size: smaller } 196 197 p.label { 198 white-space: nowrap } 199 200 p.rubric { 201 font-weight: bold ; 202 font-size: larger ; 203 color: maroon ; 204 text-align: center } 205 206 p.sidebar-title { 207 font-family: sans-serif ; 208 font-weight: bold ; 209 font-size: larger } 210 211 p.sidebar-subtitle { 212 font-family: sans-serif ; 213 font-weight: bold } 214 215 p.topic-title { 216 font-weight: bold } 217 218 pre.address { 219 margin-bottom: 0 ; 220 margin-top: 0 ; 221 font-family: serif ; 222 font-size: 100% } 223 224 pre.literal-block, pre.doctest-block { 225 margin-left: 2em ; 226 margin-right: 2em } 227 228 span.classifier { 229 font-family: sans-serif ; 230 font-style: oblique } 231 232 span.classifier-delimiter { 233 font-family: sans-serif ; 234 font-weight: bold } 235 236 span.interpreted { 237 font-family: sans-serif } 238 239 span.option { 240 white-space: nowrap } 241 242 span.pre { 243 white-space: pre } 244 245 span.problematic { 246 color: red } 247 248 span.section-subtitle { 249 /* font-size relative to parent (h1..h6 element) */ 250 font-size: 80% } 251 252 table.citation { 253 border-left: solid 1px gray; 254 margin-left: 1px } 255 256 table.docinfo { 257 margin: 2em 4em } 258 259 table.docutils { 260 margin-top: 0.5em ; 261 margin-bottom: 0.5em } 262 263 table.footnote { 264 border-left: solid 1px black; 265 margin-left: 1px } 266 267 table.docutils td, table.docutils th, 268 table.docinfo td, table.docinfo th { 269 padding-left: 0.5em ; 270 padding-right: 0.5em ; 271 vertical-align: top } 272 273 table.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 279 h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, 280 h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { 281 font-size: 100% } 282 283 ul.auto-toc { 284 list-style-type: none } 285 286 </style> 9 287 </head> 10 288 <body> 11 289 <div class="document" id="cairo-bindings-for-d"> 12 290 <h1 class="title">cairo bindings for D</h1> 291 13 292 <!-- This document is written in reStructuredText. --> 14 293 <!-- Build command: 15 294 rst2html.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> 18 297 <ul class="simple"> 19 298 <li><a class="reference" href="#introduction" id="id3" name="id3">Introduction</a></li> … … 38 317 </ul> 39 318 </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> 42 321 <p>This project's aim is to provide a complete, up-to-date D binding for the 43 322 <a class="reference" href="http://cairographics.org/">cairo</a> 2D drawing API. Currently, the binding supports the base cairo … … 49 328 provide a library of additional, high-level functionality with this layer.</p> 50 329 </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> 55 334 <p>To install, simply copy the <tt class="docutils literal"><span class="pre">cairo</span></tt> directory to a place in your D 56 335 compiler's import path. That's all there is to it.</p> … … 71 350 libraries with debug symbols <a class="footnote-reference" href="#debuglibs" id="id1" name="id1">[1]</a>.</p> 72 351 <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 353 libraries only compile for one particular version of cairo at a time. To 354 select which version of the cairo API you want to compile for, you need to use 355 the 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 362 your 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> 76 366 <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> 77 367 directories to a place on your D compiler's import path.</p> … … 79 369 <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. 80 370 Usage 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> 84 375 <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 85 376 "snippets" example programs provided by the cairo developers ported to D. … … 94 385 <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> 95 386 </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> 98 389 <p>The <tt class="docutils literal"><span class="pre">cairooo_tutorial</span></tt> contains the beginnings of a very simple introductory 99 390 tutorial to programming image programs in D using the cairooo binding. It is 100 391 pathetically incomplete; however, it may be a useful starting point.</p> 101 392 </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> 104 395 <p>The <tt class="docutils literal"><span class="pre">demos</span></tt> directory will contain a few small demo programs to showcase the 105 396 binding. Currently, it only has one demo, so the plural is prehaps 106 397 misleading. Hopefully this will change :)</p> 107 398 </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> 110 401 <p>Whilst this project hopes to eventually have full DDoc documentation for the 111 402 cairooo binding, we will not be providing anything other than minimal … … 130 421 </pre> 131 422 </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> 134 425 <p>If you are using Windows, you will also probably want to grab the cairo 135 426 library itself. The best version I have found is on <a class="reference" href="http://www.iki.fi/tml/index.html">Tor Lillqvist</a>'s … … 147 438 </div> 148 439 </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> 153 444 <p>To use the binding, simply import <tt class="docutils literal"><span class="pre">cairo.cairo</span></tt>, along with any other 154 445 parts of the library you need. For example, if you wanted the base cairo … … 167 458 <p>If some part of the library fails to load, these functions will thrown an 168 459 exception which can be caught and dealt with.</p> 460 <p>To select a particular version of the cairo library, make sure you compile 461 with 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> 169 467 <p>From there, just start using the cairo API as you would from C. The cairo 170 468 website contains a collection of <a class="reference" href="http://cairographics.org/samples/">example snippets</a> in C, and this binding … … 172 470 look in the <tt class="docutils literal"><span class="pre">cairo_snippets</span></tt> directory.</p> 173 471 </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> 176 474 <p>To use the cairooo binding instead, import <tt class="docutils literal"><span class="pre">cairooo.all</span></tt>, along with any 177 475 other parts of the library that you need. To copy the above example, to … … 219 517 </div> 220 518 </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> 223 521 <p>The cairo api has a functionality in it that this binding does not 224 522 yet cover: PDF abd PS for example. However, the only binary version of cairo … … 231 529 In addition to being fun, you get to make pretty pictures in the process!</p> 232 530 </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> 235 533 <ul class="simple"> 236 534 <li>Many thanks for the hard work by the people behind the cairo library.</li> … … 239 537 </ul> 240 538 </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> 243 541 <p>cairo bindings for D Copyright © 2006 Daniel Keep. Portions Copyright © 244 542 2006 Michael Parker.</p> … … 258 556 <div class="footer"> 259 557 <hr class="footer" /> 260 Generated on: 200 6-05-19 02:45UTC.558 Generated on: 2007-11-04 02:51 UTC. 261 559 262 560 </div> trunk/cairo/README.rst
r119 r228 50 50 Use the ``--help`` switch for full usage information. 51 51 52 Also, please note that if you are building static libraries that these 53 libraries only compile for one particular version of cairo at a time. To 54 select which version of the cairo API you want to compile for, you need to use 55 the following additional arguments to the build script: 56 57 * cairo 1.0: no arguments needed. 58 * cairo 1.2: ``+--version=cairo_1_2`` 59 * cairo 1.4: ``+--version=cairo_1_4`` 60 61 You will also need to specify the same version identifier when you compile 62 your programs. 63 52 64 cairooo binding 53 65 --------------- … … 59 71 ``cairooo-build.d`` script, which will build them to the ``lib`` directory. 60 72 Usage is mostly the same as using ``cairo-build.d`` (see above). 73 74 Note that cairooo currently does not support cairo 1.2 or 1.4. 61 75 62 76 cairo snippets … … 159 173 exception which can be caught and dealt with. 160 174 175 To select a particular version of the cairo library, make sure you compile 176 with an appropriate version flag: 177 178 * cairo 1.0: no version flag necessary. 179 * cairo 1.2: --version=cairo_1_2. 180 * cairo 1.4: --version=cairo_1_4. 181 161 182 From there, just start using the cairo API as you would from C. The cairo 162 183 website contains a collection of `example snippets`_ in C, and this binding trunk/cairo/cairo-build.d
r119 r228 61 61 TARGET_GLITZ = {name:"glitz", type:"lib", target:"lib/cairo_glitz", 62 62 sources:["cairo/glitz/cairo_glitz.d"]}, 63 TARGET_PDF = {name:"pdf", type:"lib", target:"lib/cairo_pdf", 64 sources:["cairo/pdf/cairo_pdf.d"]}, 63 65 TARGET_PNG = {name:"png", type:"lib", target:"lib/cairo_png", 64 66 sources:["cairo/png/cairo_png.d"]}, 67 TARGET_PS = {name:"ps", type:"lib", target:"lib/cairo_ps", 68 sources:["cairo/ps/cairo_ps.d"]}, 69 TARGET_SVG = {name:"svg", type:"lib", target:"lib/cairo_svg", 70 sources:["cairo/svg/cairo_svg.d"]}, 65 71 TARGET_WIN32 = {name:"win32", type:"lib", target:"lib/cairo_win32", 66 72 flags:["-Xwin32"], sources:["cairo/win32/cairo_win32.d"]}, 73 TARGET_WIN32_DFL = {name:"win32-dfl", type:"lib", 74 target:"lib/cairo_win32_dfl", 75 flags:["-Xwin32","-Xdfl","-version=cairo_dfl"], 76 sources:["cairo/win32/cairo_win32.d"]}, 67 77 TARGET_XLIB = {name:"xlib", type:"lib", target:"lib/cairo_xlib", 68 78 sources:["cairo/xlib/cairo_xlib.d"]}; … … 71 81 const Target 72 82 TARGET_ALL = {name:"all", type:"dummy", 73 deps:[&TARGET_CAIRO, &TARGET_GLITZ, &TARGET_PNG, &TARGET_WIN32]}; 83 deps:[&TARGET_CAIRO, &TARGET_GLITZ, &TARGET_PDF, 84 &TARGET_PNG, &TARGET_PS, &TARGET_SVG, 85 &TARGET_WIN32]}; 74 86 version(linux) 75 87 const Target 76 88 TARGET_ALL = {name:"all", type:"dummy", 77 deps:[&TARGET_CAIRO, &TARGET_GLITZ, &TARGET_PNG, &TARGET_XLIB]}; 89 deps:[&TARGET_CAIRO, &TARGET_GLITZ, &TARGET_PDF, 90 &TARGET_PNG, &TARGET_PS, &TARGET_SVG, 91 &TARGET_XLIB]}; 78 92 79 93 const Target[] TARGETS = 80 94 [TARGET_ALL, TARGET_PNG, TARGET_CAIRO, TARGET_GLITZ, TARGET_WIN32, 81 TARGET_ XLIB];95 TARGET_WIN32_DFL, TARGET_XLIB, TARGET_PDF, TARGET_PS, TARGET_SVG]; 82 96 const DEFAULT_TARGET = &TARGET_ALL; 83 97 const DEBUG_TARGET_SUFFIX = "_debug"; 84 98 85 99 const char[][] FLAGS = ["-allobj","-cleanup"]; 86 const char[][] FLAGS_DEBUG = ["-debug","-unittest","- g"];100 const char[][] FLAGS_DEBUG = ["-debug","-unittest","-version=Unittest","-g"]; 87 101 const char[][] FLAGS_RELEASE = ["-release","-inline","-O"]; 88 102 … … 148 162 --very-verbose Verbose script AND toolchain commands. 149 163 --help This message. 164 +arg "arg" is passed on to the compiler verbatim. 150 165 151 166 Supported targets: … … 184 199 bool veryVerbose = false; 185 200 char[][] targetNames; 201 char[][] extraFlags; 186 202 187 203 // Check for flags … … 201 217 return 0; 202 218 } 219 else if( arg[0] == '+' ) 220 { 221 extraFlags.pushBack(arg[1..$]); 222 } 203 223 else if( arg[0..2] == "--" ) 204 224 { … … 269 289 270 290 // Do the build 271 build(flags ~ target.flags ~ target.sources);291 build(flags ~ target.flags ~ extraFlags ~ target.sources); 272 292 } 273 293 trunk/cairo/cairo/cairo.d
r179 r228 54 54 55 55 libCairo = loadSharedLib(libName); 56 57 /* Try to find out what version of cairo we've got. If it's too old, 58 * throw an exception explaining this. 59 */ 60 auto versionnum = (cast(pf_cairo_version) 61 getProc(libCairo,"cairo_version"))(); 62 63 version( cairo_1_4 ) 64 auto expected_version = CAIRO_VERSION_ENCODE(1,4,0); 65 66 else version( cairo_1_2 ) 67 auto expected_version = CAIRO_VERSION_ENCODE(1,2,0); 68 69 else 70 auto expected_version = CAIRO_VERSION_ENCODE(1,0,0); 71 72 if( versionnum < expected_version ) 73 throw new CairoVersionException(versionnum, expected_version); 74 75 // Now we can actually load the functions. 56 76 cairo_loadprocs(libCairo); 57 77 } … … 90 110 } 91 111 112 version( Tango ) 113 { 114 import tango.text.convert.Integer : toUtf8; 115 alias toUtf8 intToString; 116 } 117 else 118 { 119 import std.string : toString; 120 alias toString intToString; 121 } 122 123 private char[] verToString(int ver) 124 { 125 return intToString(ver/100_00) 126 ~ "." ~ intToString((ver/100)%100) 127 ~ "." ~ intToString(ver%100); 128 } 129 130 private class CairoVersionException : Exception 131 { 132 this(int got, int expected) 133 { 134 this("expected cairo version "~verToString(expected) 135 ~", got version "~verToString(got)~"."); 136 } 137 138 this(char[] msg) 139 { 140 super(msg); 141 } 142 } 143 92 144 static ~this() 93 145 { trunk/cairo/cairo/cairofuncs.d
r119 r228 1 1 /** 2 * This module contains all the "standard" cairo function calls, 3 * as well as functions relating to PNG functionality. 2 * This module contains all the "standard" cairo function calls. 4 3 * 5 4 * This file is automatically generated; do not directly modify. … … 42 41 module cairo.cairofuncs; 43 42 43 version( cairo_1_4 ) { version = cairo_1_2; } 44 44 45 private 45 46 { 46 47 import cairo.cairotypes; 47 48 import cairo.loader; 49 } 50 51 /** 52 * This function encodes the given cairo version into an integer. The numbers 53 * returned by cairo_version() are encoded using this function. Two encoded 54 * version numbers can be compared as integers. The encoding ensures that 55 * later versions compare greater than earlier versions. 56 */ 57 int CAIRO_VERSION_ENCODE(int major, int minor, int micro) 58 { 59 return major*10_000 + minor*100 + micro; 48 60 } 49 61 … … 213 225 cairo_scale = cast(pf_cairo_scale)getProc(lib, "cairo_scale"); 214 226 cairo_matrix_init_translate = cast(pf_cairo_matrix_init_translate)getProc(lib, "cairo_matrix_init_translate"); 227 version( cairo_1_2 ) 228 { 229 cairo_scaled_font_get_ctm = cast(pf_cairo_scaled_font_get_ctm)getProc(lib, "cairo_scaled_font_get_ctm"); 230 cairo_image_surface_get_format = cast(pf_cairo_image_surface_get_format)getProc(lib, "cairo_image_surface_get_format"); 231 cairo_surface_get_content = cast(pf_cairo_surface_get_content)getProc(lib, "cairo_surface_get_content"); 232 cairo_set_scaled_font = cast(pf_cairo_set_scaled_font)getProc(lib, "cairo_set_scaled_font"); 233 cairo_surface_get_device_offset = cast(pf_cairo_surface_get_device_offset)getProc(lib, "cairo_surface_get_device_offset"); 234 cairo_scaled_font_get_font_options = cast(pf_cairo_scaled_font_get_font_options)getProc(lib, "cairo_scaled_font_get_font_options"); 235 cairo_pop_group_to_source = cast(pf_cairo_pop_group_to_source)getProc(lib, "cairo_pop_group_to_source"); 236 cairo_scaled_font_text_extents = cast(pf_cairo_scaled_font_text_extents)getProc(lib, "cairo_scaled_font_text_extents"); 237 cairo_push_group_with_content = cast(pf_cairo_push_group_with_content)getProc(lib, "cairo_push_group_with_content"); 238 cairo_pattern_get_type = cast(pf_cairo_pattern_get_type)getProc(lib, "cairo_pattern_get_type"); 239 cairo_image_surface_get_data = cast(pf_cairo_image_surface_get_data)getProc(lib, "cairo_image_surface_get_data"); 240 cairo_get_group_target = cast(pf_cairo_get_group_target)getProc(lib, "cairo_get_group_target"); 241 cairo_surface_set_fallback_resolution = cast(pf_cairo_surface_set_fallback_resolution)getProc(lib, "cairo_surface_set_fallback_resolution"); 242 cairo_scaled_font_get_font_matrix = cast(pf_cairo_scaled_font_get_font_matrix)getProc(lib, "cairo_scaled_font_get_font_matrix"); 243 cairo_scaled_font_get_font_face = cast(pf_cairo_scaled_font_get_font_face)getProc(lib, "cairo_scaled_font_get_font_face"); 244 cairo_scaled_font_get_type = cast(pf_cairo_scaled_font_get_type)getProc(lib, "cairo_scaled_font_get_type"); 245 cairo_pop_group = cast(pf_cairo_pop_group)getProc(lib, "cairo_pop_group"); 246 cairo_font_face_get_type = cast(pf_cairo_font_face_get_type)getProc(lib, "cairo_font_face_get_type"); 247 cairo_surface_get_type = cast(pf_cairo_surface_get_type)getProc(lib, "cairo_surface_get_type"); 248 cairo_push_group = cast(pf_cairo_push_group)getProc(lib, "cairo_push_group"); 249 cairo_new_sub_path = cast(pf_cairo_new_sub_path)getProc(lib, "cairo_new_sub_path"); 250 cairo_image_surface_get_stride = cast(pf_cairo_image_surface_get_stride)getProc(lib, "cairo_image_surface_get_stride"); 251 } 252 version( cairo_1_4 ) 253 { 254 cairo_get_user_data = cast(pf_cairo_get_user_data)getProc(lib, "cairo_get_user_data"); 255 cairo_scaled_font_get_user_data = cast(pf_cairo_scaled_font_get_user_data)getProc(lib, "cairo_scaled_font_get_user_data"); 256 cairo_pattern_get_rgba = cast(pf_cairo_pattern_get_rgba)getProc(lib, "cairo_pattern_get_rgba"); 257 cairo_font_face_get_reference_count = cast(pf_cairo_font_face_get_reference_count)getProc(lib, "cairo_font_face_get_reference_count"); 258 cairo_scaled_font_set_user_data = cast(pf_cairo_scaled_font_set_user_data)getProc(lib, "cairo_scaled_font_set_user_data"); 259 cairo_pattern_get_radial_circles = cast(pf_cairo_pattern_get_radial_circles)getProc(lib, "cairo_pattern_get_radial_circles"); 260 cairo_clip_extents = cast(pf_cairo_clip_extents)getProc(lib, "cairo_clip_extents"); 261 cairo_pattern_get_color_stop_rgba = cast(pf_cairo_pattern_get_color_stop_rgba)getProc(lib, "cairo_pattern_get_color_stop_rgba"); 262 cairo_get_dash_count = cast(pf_cairo_get_dash_count)getProc(lib, "cairo_get_dash_count"); 263 cairo_get_reference_count = cast(pf_cairo_get_reference_count)getProc(lib, "cairo_get_reference_count"); 264 cairo_rectangle_list_destroy = cast(pf_cairo_rectangle_list_destroy)getProc(lib, "cairo_rectangle_list_destroy"); 265 cairo_pattern_get_reference_count = cast(pf_cairo_pattern_get_reference_count)getProc(lib, "cairo_pattern_get_reference_count"); 266 cairo_pattern_get_surface = cast(pf_cairo_pattern_get_surface)getProc(lib, "cairo_pattern_get_surface"); 267 cairo_pattern_set_user_data = cast(pf_cairo_pattern_set_user_data)getProc(lib, "cairo_pattern_set_user_data"); 268 cairo_get_dash = cast(pf_cairo_get_dash)getProc(lib, "cairo_get_dash"); 269 cairo_set_user_data = cast(pf_cairo_set_user_data)getProc(lib, "cairo_set_user_data"); 270 cairo_scaled_font_get_reference_count = cast(pf_cairo_scaled_font_get_reference_count)getProc(lib, "cairo_scaled_font_get_reference_count"); 271 cairo_get_scaled_font = cast(pf_cairo_get_scaled_font)getProc(lib, "cairo_get_scaled_font"); 272 cairo_copy_clip_rectangle_list = cast(pf_cairo_copy_clip_rectangle_list)getProc(lib, "cairo_copy_clip_rectangle_list"); 273 cairo_pattern_get_color_stop_count = cast(pf_cairo_pattern_get_color_stop_count)getProc(lib, "cairo_pattern_get_color_stop_count"); 274 cairo_surface_get_reference_count = cast(pf_cairo_surface_get_reference_count)getProc(lib, "cairo_surface_get_reference_count"); 275 cairo_pattern_get_user_data = cast(pf_cairo_pattern_get_user_data)getProc(lib, "cairo_pattern_get_user_data"); 276 cairo_pattern_get_linear_points = cast(pf_cairo_pattern_get_linear_points)getProc(lib, "cairo_pattern_get_linear_points"); 277 } 215 278 } 216 279 … … 380 443 typedef void function(cairo_t* cr, double sx, double sy) pf_cairo_scale; 381 444 typedef void function(cairo_matrix_t* matrix, double tx, double ty) pf_cairo_matrix_init_translate; 445 version( cairo_1_2 ) 446 { 447 typedef void function(cairo_scaled_font_t* scaled_font, cairo_matrix_t* ctm) pf_cairo_scaled_font_get_ctm; 448 typedef cairo_format_t function(cairo_surface_t* surface) pf_cairo_image_surface_get_format; 449 typedef cairo_content_t function(cairo_surface_t* surface) pf_cairo_surface_get_content; 450 typedef void function(cairo_t* cr, cairo_scaled_font_t* scaled_font) pf_cairo_set_scaled_font; 451 typedef void function(cairo_surface_t* surface, double* x_offset, double* y_offset) pf_cairo_surface_get_device_offset; 452 typedef void function(cairo_scaled_font_t* scaled_font, cairo_font_options_t* options) pf_cairo_scaled_font_get_font_options; 453 typedef void function(cairo_t* cr) pf_cairo_pop_group_to_source; 454 typedef void function(cairo_scaled_font_t* scaled_font, char* utf8, cairo_text_extents_t* extents) pf_cairo_scaled_font_text_extents; 455 typedef void function(cairo_t* cr, cairo_content_t content) pf_cairo_push_group_with_content; 456 typedef cairo_pattern_type_t function(cairo_pattern_t* pattern) pf_cairo_pattern_get_type; 457 typedef ubyte* function(cairo_surface_t* surface) pf_cairo_image_surface_get_data; 458 typedef cairo_surface_t* function(cairo_t* cr) pf_cairo_get_group_target; 459 typedef void function(cairo_surface_t* surface, double x_pixels_per_inch, double y_pixels_per_inch) pf_cairo_surface_set_fallback_resolution; 460 typedef void function(cairo_scaled_font_t* scaled_font, cairo_matrix_t* font_matrix) pf_cairo_scaled_font_get_font_matrix; 461 typedef cairo_font_face_t* function(cairo_scaled_font_t* scaled_font) pf_cairo_scaled_font_get_font_face; 462 typedef cairo_font_type_t function(cairo_scaled_font_t* scaled_font) pf_cairo_scaled_font_get_type; 463 typedef cairo_pattern_t* function(cairo_t* cr) pf_cairo_pop_group; 464 typedef cairo_font_type_t function(cairo_font_face_t* font_face) pf_cairo_font_face_get_type; 465 typedef cairo_surface_t function(cairo_surface_t* surface) pf_cairo_surface_get_type; 466 typedef void function(cairo_t* cr) pf_cairo_push_group; 467 typedef void function(cairo_t* cr) pf_cairo_new_sub_path; 468 typedef int function(cairo_surface_t* surface) pf_cairo_image_surface_get_stride; 469 } 470 version( cairo_1_4 ) 471 { 472 typedef void* function(cairo_t* cr, cairo_user_data_key_t* key) pf_cairo_get_user_data; 473 typedef void* function(cairo_scaled_font_t* scaled_font, cairo_user_data_key_t* key) pf_cairo_scaled_font_get_user_data; 474 typedef cairo_status_t function(cairo_pattern_t* pattern, double* red, double* green, double* blue, double* alpha) pf_cairo_pattern_get_rgba; 475 typedef uint function(cairo_font_face_t* font_face) pf_cairo_font_face_get_reference_count; 476 typedef cairo_status_t function(cairo_scaled_font_t* scaled_font, cairo_user_data_key_t* key, void* user_data, cairo_destroy_func_t destroy) pf_cairo_scaled_font_set_user_data; 477 typedef cairo_status_t function(cairo_pattern_t* pattern, double* x0, double* y0, double* r0, double* x1, double* y1, double* r1) pf_cairo_pattern_get_radial_circles; 478 typedef void function(cairo_t* cr, double* x1, double* y1, double* x2, double* y2) pf_cairo_clip_extents; 479 typedef cairo_status_t function(cairo_pattern_t* pattern, int index, double* offset, double* red, double* green, double* blue, double* alpha) pf_cairo_pattern_get_color_stop_rgba; 480 typedef int function(cairo_t* cr) pf_cairo_get_dash_count; 481 typedef uint function(cairo_t* cr) pf_cairo_get_reference_count; 482 typedef void function(cairo_rectangle_list_t* rectangle_list) pf_cairo_rectangle_list_destroy; 483 typedef uint function(cairo_pattern_t* pattern) pf_cairo_pattern_get_reference_count; 484 typedef cairo_status_t function(cairo_pattern_t* pattern, cairo_surface_t** surface) pf_cairo_pattern_get_surface; 485 typedef cairo_status_t function(cairo_pattern_t* pattern, cairo_user_data_key_t* key, void* user_data, cairo_destroy_func_t destroy) pf_cairo_pattern_set_user_data; 486 typedef void function(cairo_t* cr, double* dashes, double* offset) pf_cairo_get_dash; 487 typedef cairo_status_t function(cairo_t* cr, cairo_user_data_key_t* key, void* user_data, cairo_destroy_func_t destroy) pf_cairo_set_user_data; 488 typedef uint function(cairo_scaled_font_t* scaled_font) pf_cairo_scaled_font_get_reference_count; 489 typedef cairo_scaled_font_t* function(cairo_t* cr) pf_cairo_get_scaled_font; 490 typedef cairo_rectangle_list_t* function(cairo_t* cr) pf_cairo_copy_clip_rectangle_list; 491 typedef cairo_status_t function(cairo_pattern_t* pattern, int* count) pf_cairo_pattern_get_color_stop_count; 492 typedef uint function(cairo_surface_t* surface) pf_cairo_surface_get_reference_count; 493 typedef void* function(cairo_pattern_t* pattern, cairo_user_data_key_t* key) pf_cairo_pattern_get_user_data; 494 typedef cairo_status_t function(cairo_pattern_t* pattern, double* x0, double* y0, double* x1, double* y1) pf_cairo_pattern_get_linear_points; 495 } 382 496 383 497 //pfName Name; … … 543 657 pf_cairo_scale cairo_scale; 544 658 pf_cairo_matrix_init_translate cairo_matrix_init_translate; 659 version( cairo_1_2 ) 660 { 661 pf_cairo_scaled_font_get_ctm cairo_scaled_font_get_ctm; 662 pf_cairo_image_surface_get_format cairo_image_surface_get_format; 663 pf_cairo_surface_get_content cairo_surface_get_content; 664 pf_cairo_set_scaled_font cairo_set_scaled_font; 665 pf_cairo_surface_get_device_offset cairo_surface_get_device_offset; 666 pf_cairo_scaled_font_get_font_options cairo_scaled_font_get_font_options; 667 pf_cairo_pop_group_to_source cairo_pop_group_to_source; 668 pf_cairo_scaled_font_text_extents cairo_scaled_font_text_extents; 669 pf_cairo_push_group_with_content cairo_push_group_with_content; 670 pf_cairo_pattern_get_type cairo_pattern_get_type; 671 pf_cairo_image_surface_get_data cairo_image_surface_get_data; 672 pf_cairo_get_group_target cairo_get_group_target; 673 pf_cairo_surface_set_fallback_resolution cairo_surface_set_fallback_resolution; 674 pf_cairo_scaled_font_get_font_matrix cairo_scaled_font_get_font_matrix; 675 pf_cairo_scaled_font_get_font_face cairo_scaled_font_get_font_face; 676 pf_cairo_scaled_font_get_type cairo_scaled_font_get_type; 677 pf_cairo_pop_group cairo_pop_group; 678 pf_cairo_font_face_get_type cairo_font_face_get_type; 679 pf_cairo_surface_get_type cairo_surface_get_type; 680 pf_cairo_push_group cairo_push_group; 681 pf_cairo_new_sub_path cairo_new_sub_path; 682 pf_cairo_image_surface_get_stride cairo_image_surface_get_stride; 683 } 684 version( cairo_1_4 ) 685 { 686 pf_cairo_get_user_data cairo_get_user_data; 687 pf_cairo_scaled_font_get_user_data cairo_scaled_font_get_user_data; 688 pf_cairo_pattern_get_rgba cairo_pattern_get_rgba; 689 pf_cairo_font_face_get_reference_count cairo_font_face_get_reference_count; 690 pf_cairo_scaled_font_set_user_data cairo_scaled_font_set_user_data; 691 pf_cairo_pattern_get_radial_circles cairo_pattern_get_radial_circles; 692 pf_cairo_clip_extents cairo_clip_extents; 693 pf_cairo_pattern_get_color_stop_rgba cairo_pattern_get_color_stop_rgba; 694 pf_cairo_get_dash_count cairo_get_dash_count; 695 pf_cairo_get_reference_count cairo_get_reference_count; 696 pf_cairo_rectangle_list_destroy cairo_rectangle_list_destroy; 697 pf_cairo_pattern_get_reference_count cairo_pattern_get_reference_count; 698 pf_cairo_pattern_get_surface cairo_pattern_get_surface; 699 pf_cairo_pattern_set_user_data cairo_pattern_set_user_data; 700 pf_cairo_get_dash cairo_get_dash; 701 pf_cairo_set_user_data cairo_set_user_data; 702 pf_cairo_scaled_font_get_reference_count cairo_scaled_font_get_reference_count; 703 pf_cairo_get_scaled_font cairo_get_scaled_font; 704 pf_cairo_copy_clip_rectangle_list cairo_copy_clip_rectangle_list; 705 pf_cairo_pattern_get_color_stop_count cairo_pattern_get_color_stop_count; 706 pf_cairo_surface_get_reference_count cairo_surface_get_reference_count; 707 pf_cairo_pattern_get_user_data cairo_pattern_get_user_data; 708 pf_cairo_pattern_get_linear_points cairo_pattern_get_linear_points; 709 } 545 710 trunk/cairo/cairo/cairotypes.d
r119 r228 39 39 */ 40 40 module cairo.cairotypes; 41 42 version( cairo_1_4 ) { version = cairo_1_2; } 41 43 42 44 extern(C): … … 271 273 } 272 274 275 version( cairo_1_2 ) 276 { 277 enum cairo_font_type_t 278 { 279 CAIRO_FONT_TYPE_TOY, 280 CAIRO_FONT_TYPE_FT, 281 CAIRO_FONT_TYPE_WIN32, 282 CAIRO_FONT_TYPE_ATSUI 283 } 284 285 enum cairo_pattern_type_t 286 { 287 CAIRO_PATTERN_TYPE_SOLID, 288 CAIRO_PATTERN_TYPE_SURFACE, 289 CAIRO_PATTERN_TYPE_LINEAR, 290 CAIRO_PATTERN_TYPE_RADIAL 291 } 292 293 enum cairo_surface_type_t 294 { 295 CAIRO_SURFACE_TYPE_IMAGE, 296 CAIRO_SURFACE_TYPE_PDF, 297 CAIRO_SURFACE_TYPE_PS, 298 CAIRO_SURFACE_TYPE_XLIB, 299 CAIRO_SURFACE_TYPE_XCB, 300 CAIRO_SURFACE_TYPE_GLITZ, 301 CAIRO_SURFACE_TYPE_QUARTZ, 302 CAIRO_SURFACE_TYPE_WIN32, 303 CAIRO_SURFACE_TYPE_BEOS, 304 CAIRO_SURFACE_TYPE_DIRECTFB, 305 CAIRO_SURFACE_TYPE_SVG, 306 CAIRO_SURFACE_TYPE_OS2 307 } 308 } 309 310 version( cairo_1_4 ) 311 { 312 struct cairo_rectangle_t 313 { 314 double x, y, width, height; 315 } 316 317 struct cairo_rectangle_list_t 318 { 319 cairo_status_t status; 320 cairo_rectangle_t* rectangles; 321 int num_rectangles; 322 } 323 } 324 trunk/cairo/cairo/loader.d
r179 r228 4 4 * the Derelict project's loader.d file. 5 5 * 6 * Authors: Daniel Keep 7 * Copyright: 2005-2006, Derelict developers; 8 * 2006, Daniel Keep. 6 * Authors: Derelict developers, Daniel Keep 7 * Copyright: 2005-2006 Derelict developers, 2006 Daniel Keep. 9 8 * License: BSD v2 (http://www.opensource.org/licenses/bsd-license.php). 10 9 */ 11 10 /* 12 * Copyright © 2006 Daniel Keep 11 * Copyright © 2006 Daniel Keep. 13 12 * All rights reserved. 14 13 * trunk/cairo/cairo/png/cairofuncs_png.d
r119 r228 42 42 module cairo.png.cairofuncs_png; 43 43 44 version( cairo_1_4 ) { version = cairo_1_2; } 45 44 46 private 45 47 { trunk/cairo/cairo/win32/cairotypes_win32.d
r179 r228 43 43 44 44 public import cairo.cairotypes; 45 public import win32.windows;46 45 46 version( cairo_dfl ) 47 { 48 public import dfl.internal.winapi : HDC, LOGFONTW; 49 } 50 else 51 { 52 public import win32.windows : HDC, LOGFONTW; 53 } 54 trunk/cairo/cairo_snippets/cairo_snippets_png_run.bat
r97 r228 1 1 @ECHO OFF 2 2 mkdir output 2>NUL 3 bu ild -cleanup -release -I.. cairo_snippets_png && cairo_snippets_png3 bud -cleanup -release -I.. cairo_snippets_png && cairo_snippets_png trunk/cairo/cairooo-build.d
r119 r228 65 65 TARGET_WIN32 = {name:"win32oo", type:"lib", target:"lib/cairooo_win32", 66 66 flags:["-Xwin32"], sources:["cairooo/win32/all.d"]}, 67 TARGET_WIN32_DFL = {name:"win32oo-dfl", type:"lib", 68 target:"lib/cairooo_win32_dfl", 69 flags:["-Xwin32","-Xdfl","-version=cairo_dfl"], 70 sources:["cairooo/win32/all.d"]}, 67 71 TARGET_XLIB = {name:"xliboo", type:"lib", target:"lib/cairooo_xlib", 68 72 sources:["cairooo/xlib/all.d"]}, … … 83 87 const Target[] TARGETS = 84 88 [TARGET_ALL, TARGET_PNG, TARGET_CAIRO, TARGET_GLITZ, TARGET_WIN32, 85 TARGET_ XLIB, TARGET_EXTRA];89 TARGET_WIN32_DFL, TARGET_XLIB, TARGET_EXTRA]; 86 90 const DEFAULT_TARGET = &TARGET_ALL; 87 91 const DEBUG_TARGET_SUFFIX = "_debug"; 88 92 89 93 const char[][] FLAGS = ["-allobj","-cleanup"]; 90 const char[][] FLAGS_DEBUG = ["-debug","-unittest","- g"];94 const char[][] FLAGS_DEBUG = ["-debug","-unittest","-version=Unittest","-g"]; 91 95 const char[][] FLAGS_RELEASE = ["-release","-inline","-O"]; 92 96 trunk/cairo/util/script.d
r179 r228 86 86 } 87 87 88 void88 /+void 89 89 echof(...) 90 90 { 91 91 // D really needs argument exploding... 92 92 writefx(stdout, _arguments, _argptr, true); 93 }+/ 94 95 void 96 echof(T...)(T args) 97 { 98 writefln("", args); 93 99 } 94 100 … … 120 126 opts[$-1] = fixPath(opt); 121 127 } 122 exec("bu ild",opts);128 exec("bud",opts); 123 129 } 124 130
