Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

_jl_libcairo -> libcairo #448

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
WinRPM = "c17dfb99-b4f7-5aad-8812-456da1ad7187"

[compat]
Cairo = "0.3, 0.4, 0.5, 0.6"
Cairo = "0.7"
Graphics = "≥ 0.1.0"
julia = "0.7, 1"
12 changes: 6 additions & 6 deletions src/cairo.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Cairo._jl_libcairo
import Cairo.libcairo

# GtkCanvas is the plain Gtk drawing canvas built on Cairo.
mutable struct GtkCanvas <: GtkDrawingArea # NOT an @GType
Expand Down Expand Up @@ -103,18 +103,18 @@ function cairo_surface_for(widget::GtkCanvas)
end

function canvas_on_draw_event(::Ptr{GObject}, cc::Ptr{Nothing}, widget::GtkCanvas) # cc is a Cairo context
ccall((:cairo_set_source_surface, _jl_libcairo), Nothing,
ccall((:cairo_set_source_surface, libcairo), Nothing,
(Ptr{Nothing}, Ptr{Nothing}, Float64, Float64), cc, widget.back.ptr, 0, 0)
ccall((:cairo_paint, _jl_libcairo), Nothing, (Ptr{Nothing},), cc)
ccall((:cairo_paint, libcairo), Nothing, (Ptr{Nothing},), cc)
Int32(false) # propagate the event further
end

function canvas_on_expose_event(::Ptr{GObject}, e::Ptr{Nothing}, widget::GtkCanvas) # e is a GdkEventExpose
cc = ccall((:gdk_cairo_create, libgdk), Ptr{Nothing}, (Ptr{Nothing},), gdk_window(widget))
ccall((:cairo_set_source_surface, _jl_libcairo), Nothing,
ccall((:cairo_set_source_surface, libcairo), Nothing,
(Ptr{Nothing}, Ptr{Nothing}, Float64, Float64), cc, widget.back.ptr, 0, 0)
ccall((:cairo_paint, _jl_libcairo), Nothing, (Ptr{Nothing},), cc)
ccall((:cairo_destroy, _jl_libcairo), Nothing, (Ptr{Nothing},), cc)
ccall((:cairo_paint, libcairo), Nothing, (Ptr{Nothing},), cc)
ccall((:cairo_destroy, libcairo), Nothing, (Ptr{Nothing},), cc)
Int32(false) # propagate the event further
end

Expand Down