Giter Site home page Giter Site logo

notspooky / cairod Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cairod/cairod

0.0 2.0 0.0 6.44 MB

cairo bindings and wrappers for the D programming language

Home Page: https://cairod.github.io/cairoD/api/cairo/cairo.html

License: Boost Software License 1.0

D 99.82% Shell 0.17% Makefile 0.01%

cairod's Introduction

cairoD Build Status

This is a D2 binding and wrapper for the cairo graphics library.

Currently cairoD targets cairo version 1.10.2.

Homepage: https://github.com/cairoD/cairoD

API Documentation: https://cairod.github.io/cairoD/api/cairo/cairo.html

Examples

The cairoD library ships with some examples in the example directory. Some of these examples are ported from cairographics.org, some are original. To build these examples, simply use dub:

dub run

On windows you have to manually copy the DLLs into the bin directory. Run

dub build

This will build the example and copy the executable to the bin directory. Then copy all DLLs from /lib/32 or /lib/64 into the bin directory and run the example.exe manually.

Some examples can directly present the results in a GTK2 or GTK3 window. Simply use the correct dub configurations:

dub run --config=gtk2
dub run --config=gtk3

GTK3 example image

Building

You can use [dub] to make this library a dependency for your project. [dub]: http://code.dlang.org/packages/cairod

Windows support

cairoD can be used on windows, but it requires cairo DLLs and matching import libraries. We provide a set of DLLs and import libraries in the lib directory. Copy the lib folder into your dub project and then use this dub configuration to support all windows compilers:

    "libs-windows-x86-dmd": ["lib/32/mars/cairo"],
    "libs-windows-x86-gdc": ["lib/32/msvc_mingw/cairo"],
    "libs-windows-x86-ldc": ["lib/32/msvc_mingw/cairo"],
    "libs-windows-x86_64": ["lib/64/cairo"],
    "copyFiles-windows-x86": ["lib/32/*.dll"],
    "copyFiles-windows-x86_64": ["lib/64/*.dll"]

Note: cairoD currently uses the windows-headers package for the Win32Surface. Use the CairoWindowsDruntime version if you want to use the windows bindings shipped with D version 2.070+.

Customizing the cairoD configuration

The cairo library provides certain features as optional extensions. CairoD does not provide access to these extensions by default. To enable the extensions, pass the matching version to your D compiler or specify the versions in your dub.json file:

"dependencies": {
    "cairod": {"version": "~>0.0.1"}
},
"versions": ["CairoPNG"]

The following versions are available:

version name Cairo C feature Description
CairoPNG CAIRO_HAS_PNG_FUNCTIONS Enable loading/saving of PNG files
CairoPSSurface CAIRO_HAS_PS_SURFACE Enable cairo.ps module
CairoPDFSurface CAIRO_HAS_PDF_SURFACE Enable cairo.pdf module
CairoSVGSurface CAIRO_HAS_SVG_SURFACE Enable cairo.svg module
CairoFTFont CAIRO_HAS_FT_FONT Enable cairo.ft module (FreeType fonts)
CairoWin32Surface CAIRO_HAS_WIN32_SURFACE Enable cairo.win32 module (rendering)
CairoWin32Font CAIRO_HAS_WIN32_FONT Enable cairo.win32 module (fonts)
CairoXlibSurface CAIRO_HAS_XLIB_SURFACE Enable cairo.xlib module
CairoXCBSurface CAIRO_HAS_XCB_SURFACE Enable cairo.xcb module
CairoDirectFBSurface CAIRO_HAS_DIRECTFB_SURFACE Enable cairo.directfb module
CairoWindowsDruntime - Use core.sys.windows instead of windows-headers

Links

License

Distributed under the Boost Software License, Version 1.0.

See the accompanying file LICENSE_1_0.txt or view it online.

cairod's People

Contributors

andrejmitrovic avatar aruthane avatar drug007 avatar gerdus avatar jpf91 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.