Skip to content

Commit

Permalink
merge from master
Browse files Browse the repository at this point in the history
  • Loading branch information
lobingera committed Dec 6, 2017
2 parents e5d1be5 + 10913a1 commit cefb1de
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 27 deletions.
13 changes: 1 addition & 12 deletions .travis.yml
Expand Up @@ -10,22 +10,11 @@ matrix:
os: linux
dist: trusty
sudo: false
- language: julia
julia: nightly
os: linux
dist: trusty
sudo: false
- language: julia
julia: 0.6
os: linux
- language: julia
julia: 0.5
os: osx
- language: julia
julia: 0.6
os: osx
- language: julia
julia: nightly
os: osx
notifications:
email: false
after_success:
Expand Down
3 changes: 1 addition & 2 deletions README.md
@@ -1,8 +1,7 @@
[![Build Status](https://travis-ci.org/JuliaGraphics/Cairo.jl.svg)](https://travis-ci.org/JuliaGraphics/Cairo.jl)
[![Build status](https://ci.appveyor.com/api/projects/status/mpuhyoy9ew187f08/branch/master?svg=true)](https://ci.appveyor.com/project/tkelman/cairo-jl/branch/master)
[![Build status](https://ci.appveyor.com/api/projects/status/gbugok7e67nn4eov?svg=true)](https://ci.appveyor.com/project/lobingera/cairo-jl)
[![Coverage Status](https://coveralls.io/repos/JuliaGraphics/Cairo.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/JuliaGraphics/Cairo.jl?branch=master)

[![Cairo](http://pkg.julialang.org/badges/Cairo_0.4.svg)](http://pkg.julialang.org/?pkg=Cairo)
[![Cairo](http://pkg.julialang.org/badges/Cairo_0.5.svg)](http://pkg.julialang.org/?pkg=Cairo)
[![Cairo](http://pkg.julialang.org/badges/Cairo_0.6.svg)](http://pkg.julialang.org/?pkg=Cairo)

Expand Down
4 changes: 2 additions & 2 deletions REQUIRE
@@ -1,5 +1,5 @@
julia 0.4
Compat 0.9.5
julia 0.5
Compat 0.39.0
Colors
BinDeps 0.3.21
Graphics 0.1
Expand Down
11 changes: 8 additions & 3 deletions appveyor.yml
@@ -1,10 +1,15 @@
environment:
matrix:
<<<<<<< HEAD
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
=======
# - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.4/julia-0.4-latest-win32.exe"
# - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.4/julia-0.4-latest-win64.exe"
# - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
# - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
# - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
# - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
branches:
only:
Expand Down
53 changes: 45 additions & 8 deletions src/Cairo.jl
Expand Up @@ -2,7 +2,8 @@ __precompile__()

module Cairo

using Compat; import Compat.String
using Compat; import Compat: String, textwidth


depsjl = joinpath(dirname(@__FILE__), "..", "deps", "deps.jl")
isfile(depsjl) ? include(depsjl) : error("Cairo not properly ",
Expand All @@ -20,7 +21,7 @@ libpango_version = VersionNumber(unsafe_string(
if !is_windows()
libpangocairo_version = VersionNumber(unsafe_string(
ccall((:pango_version_string,Cairo._jl_libpangocairo),Cstring,()) ))
libgobject_version = VersionNumber(
libgobject_version = VersionNumber(
unsafe_load(cglobal((:glib_major_version, Cairo._jl_libgobject), Cuint)),
unsafe_load(cglobal((:glib_minor_version, Cairo._jl_libgobject), Cuint)),
unsafe_load(cglobal((:glib_micro_version, Cairo._jl_libgobject), Cuint)))
Expand Down Expand Up @@ -98,6 +99,42 @@ export
# push+pop group
push_group, pop_group

## head docstring following

"
Surfaces, the canvas you are painting on
CairoSurface, CairoRGBSurface, CairoPDFSurface, CairoEPSSurface,
CairoXlibSurface, CairoARGBSurface, CairoSVGSurface,
CairoImageSurface, CairoQuartzSurface,
CairoWin32Surface, CairoScriptSurface, CairoRecordingSurface,
CairoPSSurface,
Context, the handle to coordinate transformation, paint+Color
CairoContext, finish, destroy, status, get_source,
creategc, getgc, save, restore, show_page, width, height
Path creation API
new_path, new_sub_path, close_path,
move_to, line_to, rel_line_to, rel_move_to,
rectangle, circle, arc, arc_negative,
curve_to, rel_curve_to,
path_extents,
Stroking and painting API
fill, fill_preserve, paint, paint_with_alpha, stroke,
stroke_preserve, stroke_transformed, stroke_transformed_preserve
CairoContext, finish, destroy, status, get_source,
creategc, getgc, save, restore, show_page, width, height
"
Cairo

function write_to_stream_callback(s::IO, buf::Ptr{UInt8}, len::UInt32)
n = VERSION < v"0.5-dev+2301" ? write(s,buf,len) : unsafe_write(s,buf,len)
@compat Int32((n == len) ? 0 : 11)
Expand All @@ -109,7 +146,7 @@ get_stream_callback(T) = cfunction(write_to_stream_callback, Int32, (Ref{T}, Ptr
function read_from_stream_callback(s::IO, buf::Ptr{UInt8}, len::UInt32)
# wrap the provided buf into a julia Array
b1 = unsafe_wrap(Array,buf,len)

# read from stream
nb = readbytes!(s,b1,len)

Expand All @@ -128,20 +165,20 @@ type CairoSurface{T<:Union{UInt32,RGB24,ARGB32}} <: GraphicsDevice

@compat function (::Type{CairoSurface{T}}){T}(ptr::Ptr{Void}, w, h)
self = new{T}(ptr, w, h)
finalizer(self, destroy)
finalizer(destroy, self)
self
end
@compat function (::Type{CairoSurface{T}}){T}(ptr::Ptr{Void}, w, h, data::Matrix{T})
self = new{T}(ptr, w, h, data)
finalizer(self, destroy)
finalizer(destroy, self)
self
end
@compat function (::Type{CairoSurface{T}}){T}(ptr::Ptr{Void})
ccall(
(:cairo_surface_reference,_jl_libcairo),
Ptr{Void}, (Ptr{Void}, ), ptr)
self = new{T}(ptr)
finalizer(self, destroy)
finalizer(destroy, self)
self
end
end
Expand Down Expand Up @@ -924,7 +961,7 @@ end
function CairoPatternMesh()
ptr = ccall((:cairo_pattern_create_mesh, _jl_libcairo),
Ptr{Void}, ())
pattern = CairoPattern(ptr)
pattern = CairoPattern(ptr)
#status = ccall((:cairo_pattern_status, _jl_libcairo),
# Cint, (Ptr{Void},), pattern.ptr)
#if status != 0
Expand Down Expand Up @@ -980,7 +1017,7 @@ function mesh_pattern_set_corner_color_rgb(pat::CairoPattern, corner_num::Real,
end

function mesh_pattern_set_corner_color_rgba(pat::CairoPattern, corner_num::Real, red::Real, green::Real, blue::Real, alpha::Real)
ccall((:cairo_mesh_pattern_set_corner_color_rgb, _jl_libcairo),
ccall((:cairo_mesh_pattern_set_corner_color_rgba, _jl_libcairo),
Void, (Ptr{Void},Int32,Float64,Float64,Float64,Float64),pat.ptr,corner_num,red,green,blue,alpha)
end

Expand Down

0 comments on commit cefb1de

Please sign in to comment.