gir_ffi-cairo 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +9 -0
- data/lib/gir_ffi-cairo/context.rb +18 -0
- data/test/gir_ffi-cairo/context_test.rb +3 -2
- data/test/integration/context_test.rb +10 -0
- metadata +13 -20
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 41d0b043cad1e510dc0de5cde27db190bb4f9140
|
4
|
+
data.tar.gz: b4231c573d90bef3b8e4227d8120462b4063b422
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 29b0c0f6d5ebbccf645329aec41f6fa934c0a1606c26d4b43325b28523e045872babbe3122eed8bedc64fc3798478597c7c0689ad0d7dfbb232c21d86bd532aa
|
7
|
+
data.tar.gz: 39f660fffd91ed25d7dd4c4b4d8458dccf2d9b9f92f2ff4d35c48248d4f194e67e5286ea1875131304cbc5cfc6c8132efdc3541537b1b072ce1d782a107cb8af
|
data/README.md
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
GirFFI-based bindings for Cairo
|
4
4
|
|
5
|
+
## Features/Issues
|
6
|
+
|
7
|
+
This gem allows use of Cairo from your GirFFI-based Gtk+ application. It
|
8
|
+
is only a thin layer on top of the C library.
|
9
|
+
|
10
|
+
Please note that this library is in the very early stages of
|
11
|
+
development. Please file bugs for any functionality that is not yet
|
12
|
+
implemented.
|
13
|
+
|
5
14
|
## Usage
|
6
15
|
|
7
16
|
require 'gir_ffi-cairo'
|
@@ -7,14 +7,32 @@ module Cairo
|
|
7
7
|
self.wrap ptr
|
8
8
|
end
|
9
9
|
|
10
|
+
def arc xc, yc, radius, angle1, angle2
|
11
|
+
Lib.cairo_arc self, xc, yc, radius, angle1, angle2
|
12
|
+
end
|
13
|
+
|
14
|
+
def fill
|
15
|
+
Lib.cairo_fill self
|
16
|
+
end
|
17
|
+
|
10
18
|
def get_target
|
11
19
|
ptr = Lib.cairo_get_target self
|
12
20
|
Surface.wrap ptr
|
13
21
|
end
|
22
|
+
|
23
|
+
def set_source_rgba red, green, blue, alpha
|
24
|
+
Lib.cairo_set_source_rgba self, red, green, blue, alpha
|
25
|
+
end
|
14
26
|
end
|
15
27
|
|
16
28
|
module Lib
|
17
29
|
attach_function :cairo_create, [:pointer], :pointer
|
18
30
|
attach_function :cairo_get_target, [:pointer], :pointer
|
31
|
+
|
32
|
+
attach_function :cairo_arc,
|
33
|
+
[:pointer, :double, :double, :double, :double, :double], :void
|
34
|
+
attach_function :cairo_fill, [:pointer], :void
|
35
|
+
attach_function :cairo_set_source_rgba,
|
36
|
+
[:pointer, :double, :double, :double, :double], :void
|
19
37
|
end
|
20
38
|
end
|
@@ -8,10 +8,11 @@ describe Cairo::Context do
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
+
let(:instance) { Cairo::Context.create(nil) }
|
12
|
+
|
11
13
|
describe "#get_target" do
|
12
14
|
it "returns the context's target" do
|
13
|
-
|
14
|
-
obj.get_target.must_be_instance_of Cairo::Surface
|
15
|
+
instance.get_target.must_be_instance_of Cairo::Surface
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -5,5 +5,15 @@ describe Cairo::Context do
|
|
5
5
|
dst = Cairo::ImageSurface.create(:argb32, 400, 300)
|
6
6
|
ctx = Cairo::Context.create(dst)
|
7
7
|
ctx.get_target.to_ptr.must_equal dst.to_ptr
|
8
|
+
pass
|
9
|
+
end
|
10
|
+
|
11
|
+
it "can create and fill a path" do
|
12
|
+
dst = Cairo::ImageSurface.create(:argb32, 400, 300)
|
13
|
+
ctx = Cairo::Context.create(dst)
|
14
|
+
ctx.arc(300, 200, 100, 0, 2 * Math::PI)
|
15
|
+
ctx.set_source_rgba(1, 1, 0, 0.5)
|
16
|
+
ctx.fill
|
17
|
+
pass
|
8
18
|
end
|
9
19
|
end
|
metadata
CHANGED
@@ -1,36 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gir_ffi-cairo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Matijs van Zuijlen
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-01-11 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: gir_ffi
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
19
|
+
version: 0.7.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
26
|
+
version: 0.7.0
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: minitest
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,19 +41,17 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rake
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: 10.
|
47
|
+
version: '10.1'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version: 10.
|
54
|
+
version: '10.1'
|
62
55
|
description: Bindings for Cairo generated by GirFFI, with overrides.
|
63
56
|
email:
|
64
57
|
- matijs@matijs.net
|
@@ -79,28 +72,28 @@ files:
|
|
79
72
|
- Rakefile
|
80
73
|
- COPYING.LIB
|
81
74
|
homepage: http://www.github.com/mvz/gir_ffi-cairo
|
82
|
-
licenses:
|
75
|
+
licenses:
|
76
|
+
- LGPL-2.1
|
77
|
+
metadata: {}
|
83
78
|
post_install_message:
|
84
79
|
rdoc_options: []
|
85
80
|
require_paths:
|
86
81
|
- lib
|
87
82
|
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
-
none: false
|
89
83
|
requirements:
|
90
|
-
- -
|
84
|
+
- - '>='
|
91
85
|
- !ruby/object:Gem::Version
|
92
86
|
version: '0'
|
93
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
-
none: false
|
95
88
|
requirements:
|
96
|
-
- -
|
89
|
+
- - '>='
|
97
90
|
- !ruby/object:Gem::Version
|
98
91
|
version: '0'
|
99
92
|
requirements: []
|
100
93
|
rubyforge_project:
|
101
|
-
rubygems_version:
|
94
|
+
rubygems_version: 2.0.14
|
102
95
|
signing_key:
|
103
|
-
specification_version:
|
96
|
+
specification_version: 4
|
104
97
|
summary: GirFFI-based bindings for Cairo
|
105
98
|
test_files:
|
106
99
|
- test/test_helper.rb
|