author | Jan Vrany <jan.vrany@labware.com> |
Mon, 15 Jun 2020 15:01:43 +0100 | |
changeset 88 | 9d51db2ba641 |
parent 29 | 6ba06265e543 |
permissions | -rw-r--r-- |
88 | 1 |
" |
2 |
stx:goodies/libcairo - Cairo graphics bindings for Smalltalk/X |
|
3 |
||
4 |
Copyright (C) 2008-2019 Jan Vrany |
|
5 |
||
6 |
This code is licensed under Creative Commons Attribution-NonCommercial License. |
|
7 |
For full text of the license, see file LICENSE.txt |
|
8 |
" |
|
1 | 9 |
"{ Package: 'stx:goodies/libcairo' }" |
10 |
||
11 |
"{ NameSpace: Cairo }" |
|
12 |
||
13 |
ExternalStructure subclass:#PathData |
|
14 |
instanceVariableNames:'' |
|
15 |
classVariableNames:'' |
|
16 |
poolDictionaries:'' |
|
12 | 17 |
category:'Cairo-Objects' |
1 | 18 |
! |
19 |
||
88 | 20 |
!PathData class methodsFor:'documentation'! |
21 |
||
22 |
copyright |
|
23 |
" |
|
24 |
stx:goodies/libcairo - Cairo graphics bindings for Smalltalk/X |
|
25 |
||
26 |
Copyright (C) 2008-2019 Jan Vrany |
|
27 |
||
28 |
This code is licensed under Creative Commons Attribution-NonCommercial License. |
|
29 |
For full text of the license, see file LICENSE.txt |
|
30 |
" |
|
31 |
! ! |
|
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
32 |
|
1 | 33 |
!PathData class methodsFor:'accessing'! |
34 |
||
12 | 35 |
dllPath |
36 |
||
37 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
38 |
^ #( 'C:\Windows' 'C:\Windows\System32' "Wild guess, should not harm" ) |
|
39 |
]. |
|
40 |
||
41 |
OperatingSystem isUNIXlike ifTrue:[ |
|
42 |
OperatingSystem getSystemType == #linux ifTrue:[ |
|
43 |
| path | |
|
44 |
||
45 |
path := #( '/lib' '/usr/lib' '/usr/local/lib' ). |
|
46 |
(OperatingSystem getSystemInfo at:#machine) = 'x86_64' ifTrue:[ |
|
47 |
"If the machine is 64bit, prepend standard path for 32bit libs. |
|
48 |
Leave standard paths at the end, as the system might be completely |
|
49 |
32bit but running on 64bit-capable CPU. |
|
50 |
||
51 |
CAVEAT: This is bit dangerous, as on 64bit OS, if ia32 libs are |
|
52 |
not installed byt 64bit sqlite libs are, then 64bit libs are found |
|
53 |
and when a function is called, segfault will occur!! |
|
54 |
||
55 |
Q: Is there a way how to figure out if the OS itself is 32bit, |
|
56 |
regardles on CPU?" |
|
57 |
path := #( '/lib32' '/usr/lib32' '/usr/local/lib32' ) , path. |
|
58 |
]. |
|
59 |
^path |
|
60 |
||
61 |
]. |
|
62 |
]. |
|
63 |
||
64 |
self error:'Unsupported operating system' |
|
65 |
||
66 |
" |
|
67 |
SqliteLibrary dllPath |
|
68 |
" |
|
69 |
||
70 |
"Created: / 31-08-2011 / 18:02:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
71 |
! |
|
72 |
||
1 | 73 |
libraryName |
74 |
||
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
75 |
OperatingSystem isUNIXlike ifTrue:[^'libcairo.so.2']. |
1 | 76 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
77 |
OperatingSystem isMSWINDOWSlike ifTrue:[^'cairo.dll']. |
12 | 78 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
79 |
self error:'Library name for host OS is not known' |
6
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
80 |
! |
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
81 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
82 |
sizeof |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
83 |
"Returns size of undelaying structure in bytes" |
6
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
84 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
85 |
^16 |
1 | 86 |
! ! |
87 |
||
6
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
88 |
!PathData methodsFor:'accessing'! |
1 | 89 |
|
6
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
90 |
header |
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
91 |
"Returns ;; Line: 179 |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
92 |
" |
1 | 93 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
94 |
^self at:1 + 0 |
1 | 95 |
! |
96 |
||
6
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
97 |
header: value |
1 | 98 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
99 |
self at:1 + 0 put:value |
1 | 100 |
! |
101 |
||
6
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
102 |
point |
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
103 |
"Returns ;; Line: 185 |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
104 |
" |
1 | 105 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
106 |
^self at:1 + 0 |
1 | 107 |
! |
108 |
||
6
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
109 |
point: value |
1 | 110 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
111 |
self at:1 + 0 put:value |
1 | 112 |
! ! |
113 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
114 |
!PathData class methodsFor:'documentation'! |
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
115 |
|
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
116 |
version |
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
117 |
^'$Id$' |
11 | 118 |
! |
119 |
||
23
38ee47dbd976
Added version_HG to make Mercurial happy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
120 |
version_HG |
38ee47dbd976
Added version_HG to make Mercurial happy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
121 |
^ '$Changeset: <not expanded> $' |
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
122 |
! ! |
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
123 |