Skip to content

Commit

Permalink
add: svg.cr, tee.cr
Browse files Browse the repository at this point in the history
  • Loading branch information
TamasSzekeres committed Nov 9, 2016
1 parent 3453fb0 commit 14e39aa
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/cairo/svg.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
require "./cairo"

{% if CairoCr::HAS_SVG_SURFACE %}
module CairoCr
@[Link("cairo")]
lib Cairo
enum SvgVersionT
V_1_1,
V_1_2
end

fun svg_surface_create = cairo_svg_surface_create(
filename : UInt8*,
width_in_points : Float64,
height_in_points : Float64
) : PSurfaceT

fun svg_surface_create_for_stream = cairo_svg_surface_create_for_stream(
write_func : WriteFuncT,
closure : Void*,
width_in_points : Float64,
height_in_points : Float64
) : PSurfaceT

fun svg_surface_restrict_to_version = cairo_svg_surface_restrict_to_version(
surface : PSurfaceT,
version : SvgVersionT
) : Void

fun svg_get_versions = cairo_svg_get_versions(
versions : SvgVersionT**,
num_versions : Int32*
) : Void

fun svg_version_to_string = cairo_svg_version_to_string(
version : SvgVersionT
) : UInt8*
end # lib Cairo
end # module CairoCr
{% else %} # CairoCr::HAS_SVG_SURFACE
puts "Cairo was not compiled with support for the svg backend"
{% end %} # CairoCr::HAS_SVG_SURFACE
29 changes: 29 additions & 0 deletions src/cairo/tee.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
require "./cairo"

{% if CairoCr::HAS_TEE_SURFACE %}
module CairoCr
@[Link("cairo")]
lib Cairo
fun tee_surface_create = cairo_tee_surface_create(
master : PSurfaceT
) : PSurfaceT

fun tee_surface_add = cairo_tee_surface_add(
surface : PSurfaceT,
target : PSurfaceT
) : Void

fun tee_surface_remove = cairo_tee_surface_remove(
surface : PSurfaceT,
target : PSurfaceT
) : Void

fun tee_surface_index = cairo_tee_surface_index(
surface : PSurfaceT,
index : UInt32
) : PSurfaceT
end # lib Cairo
end # module CairoCr
{% else %} # CairoCr::HAS_TEE_SURFACE
puts "Cairo was not compiled with support for the TEE backend"
{% end %} # CairoCr::HAS_TEE_SURFACE

0 comments on commit 14e39aa

Please sign in to comment.