/
CairoLibrary.class.st
46 lines (38 loc) · 1.29 KB
/
CairoLibrary.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"
I provide access to cairo library.
Since paths and names can be tricky in different versions, I have methods to solve this in any platforms I want cairo to run.
"
Class {
#name : #CairoLibrary,
#superclass : #FFILibrary,
#category : #'Athens-Cairo-Library'
}
{ #category : #'accessing platform' }
CairoLibrary >> macLibraryName [
^ 'libcairo.2.dylib'
]
{ #category : #'accessing platform' }
CairoLibrary >> unix32LibraryName [
"On different flavors of linux the path to library may differ
depending on OS distro or whether system is 32 or 64 bit.
Packages such as snapcraft can also change the path.
Look in a number of known locations, or LD_LIBRARY_PATH."
^ FFIUnix32LibraryFinder findLibrary: 'libcairo.so.2'
]
{ #category : #'accessing platform' }
CairoLibrary >> unix64LibraryName [
"On different flavors of linux the path to library may differ
depending on OS distro or whether system is 32 or 64 bit.
Packages such as snapcraft can also change the path.
Look in a number of known locations, or LD_LIBRARY_PATH."
^ FFIUnix64LibraryFinder findLibrary: 'libcairo.so.2'
]
{ #category : #'accessing platform' }
CairoLibrary >> unixLibraryName [
"Backward compatibility"
^ self unix32LibraryName
]
{ #category : #'accessing platform' }
CairoLibrary >> win32LibraryName [
^ 'libcairo-2.dll'
]