author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 17 Feb 2016 06:43:31 +0000 | |
changeset 40 | 28dfc583beb5 |
parent 29 | 6ba06265e543 |
child 43 | 1006839761af |
permissions | -rw-r--r-- |
1 | 1 |
"{ Package: 'stx:goodies/libcairo' }" |
2 |
||
3 |
"{ NameSpace: Cairo }" |
|
4 |
||
40
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
5 |
CObject variableByteSubclass:#FontOptions |
1 | 6 |
instanceVariableNames:'' |
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
12 | 9 |
category:'Cairo-Objects' |
1 | 10 |
! |
11 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
12 |
|
40
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
13 |
!FontOptions class methodsFor:'instance creation'! |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
14 |
|
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
15 |
new |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
16 |
^ CPrimitives cairo_font_options_create |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
17 |
|
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
18 |
"Created: / 17-02-2016 / 20:30:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
19 |
! ! |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
20 |
|
1 | 21 |
!FontOptions class methodsFor:'accessing'! |
22 |
||
12 | 23 |
dllPath |
24 |
||
25 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
26 |
^ #( 'C:\Windows' 'C:\Windows\System32' "Wild guess, should not harm" ) |
|
27 |
]. |
|
28 |
||
29 |
OperatingSystem isUNIXlike ifTrue:[ |
|
30 |
OperatingSystem getSystemType == #linux ifTrue:[ |
|
31 |
| path | |
|
32 |
||
33 |
path := #( '/lib' '/usr/lib' '/usr/local/lib' ). |
|
34 |
(OperatingSystem getSystemInfo at:#machine) = 'x86_64' ifTrue:[ |
|
35 |
"If the machine is 64bit, prepend standard path for 32bit libs. |
|
36 |
Leave standard paths at the end, as the system might be completely |
|
37 |
32bit but running on 64bit-capable CPU. |
|
38 |
||
39 |
CAVEAT: This is bit dangerous, as on 64bit OS, if ia32 libs are |
|
40 |
not installed byt 64bit sqlite libs are, then 64bit libs are found |
|
41 |
and when a function is called, segfault will occur!! |
|
42 |
||
43 |
Q: Is there a way how to figure out if the OS itself is 32bit, |
|
44 |
regardles on CPU?" |
|
45 |
path := #( '/lib32' '/usr/lib32' '/usr/local/lib32' ) , path. |
|
46 |
]. |
|
47 |
^path |
|
48 |
||
49 |
]. |
|
50 |
]. |
|
51 |
||
52 |
self error:'Unsupported operating system' |
|
53 |
||
54 |
" |
|
55 |
SqliteLibrary dllPath |
|
56 |
" |
|
57 |
||
58 |
"Created: / 31-08-2011 / 18:02:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
59 |
! |
|
60 |
||
1 | 61 |
libraryName |
62 |
||
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
63 |
OperatingSystem isUNIXlike ifTrue:[^'libcairo.so.2']. |
1 | 64 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
65 |
OperatingSystem isMSWINDOWSlike ifTrue:[^'cairo.dll']. |
12 | 66 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
67 |
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
|
68 |
! |
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
69 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
70 |
sizeof |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
71 |
"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
|
72 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
73 |
^0 |
1 | 74 |
! ! |
75 |
||
76 |
!FontOptions class methodsFor:'primitives'! |
|
77 |
||
78 |
primCopy: original |
|
79 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
80 |
<cdecl: const Cairo::FontOptions "cairo_font_options_copy" ( Cairo::FontOptions ) > |
1 | 81 |
self primitiveFailed |
82 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
83 |
"Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 84 |
! |
85 |
||
86 |
primDestroy: options |
|
87 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
88 |
<cdecl: const void "cairo_font_options_destroy" ( Cairo::FontOptions ) > |
1 | 89 |
self primitiveFailed |
90 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
91 |
"Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 92 |
! |
93 |
||
94 |
primEqual: options other: other |
|
95 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
96 |
<cdecl: const int32 "cairo_font_options_equal" ( Cairo::FontOptions Cairo::FontOptions ) > |
1 | 97 |
self primitiveFailed |
98 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
99 |
"Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 100 |
! |
101 |
||
102 |
primFontOptionsCreate |
|
103 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
104 |
<cdecl: const Cairo::FontOptions "cairo_font_options_create" ( ) > |
1 | 105 |
self primitiveFailed |
106 |
||
12 | 107 |
"Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
3 | 108 |
! |
109 |
||
110 |
primFtFontOptionsSubstitute: options pattern: pattern |
|
111 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
112 |
<cdecl: const void "cairo_ft_font_options_substitute" ( Cairo::FontOptions pointer ) > |
3 | 113 |
self primitiveFailed |
114 |
||
115 |
"Created: / 10-07-2008 / 23:05:54 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1 | 116 |
! |
117 |
||
118 |
primGetAntialias: options |
|
119 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
120 |
<cdecl: const int32 "cairo_font_options_get_antialias" ( Cairo::FontOptions ) > |
1 | 121 |
self primitiveFailed |
122 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
123 |
"Modified: / 10-09-2008 / 18:19:54 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 124 |
! |
125 |
||
126 |
primGetHintMetrics: options |
|
127 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
128 |
<cdecl: const int32 "cairo_font_options_get_hint_metrics" ( Cairo::FontOptions ) > |
1 | 129 |
self primitiveFailed |
130 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
131 |
"Modified: / 10-09-2008 / 18:19:54 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 132 |
! |
133 |
||
134 |
primGetHintStyle: options |
|
135 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
136 |
<cdecl: const int32 "cairo_font_options_get_hint_style" ( Cairo::FontOptions ) > |
1 | 137 |
self primitiveFailed |
138 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
139 |
"Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 140 |
! |
141 |
||
142 |
primGetSubpixelOrder: options |
|
143 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
144 |
<cdecl: const int32 "cairo_font_options_get_subpixel_order" ( Cairo::FontOptions ) > |
1 | 145 |
self primitiveFailed |
146 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
147 |
"Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 148 |
! |
149 |
||
150 |
primHash: options |
|
151 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
152 |
<cdecl: const int32 "cairo_font_options_hash" ( Cairo::FontOptions ) > |
1 | 153 |
self primitiveFailed |
154 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
155 |
"Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 156 |
! |
157 |
||
158 |
primMerge: options other: other |
|
159 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
160 |
<cdecl: const void "cairo_font_options_merge" ( Cairo::FontOptions Cairo::FontOptions ) > |
1 | 161 |
self primitiveFailed |
162 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
163 |
"Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 164 |
! |
165 |
||
166 |
primSetAntialias: options antialias: antialias |
|
167 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
168 |
<cdecl: const void "cairo_font_options_set_antialias" ( Cairo::FontOptions int32 ) > |
1 | 169 |
self primitiveFailed |
170 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
171 |
"Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 172 |
! |
173 |
||
174 |
primSetHintMetrics: options hintMetrics: hint_metrics |
|
175 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
176 |
<cdecl: const void "cairo_font_options_set_hint_metrics" ( Cairo::FontOptions int32 ) > |
1 | 177 |
self primitiveFailed |
178 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
179 |
"Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 180 |
! |
181 |
||
182 |
primSetHintStyle: options hintStyle: hint_style |
|
183 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
184 |
<cdecl: const void "cairo_font_options_set_hint_style" ( Cairo::FontOptions int32 ) > |
1 | 185 |
self primitiveFailed |
186 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
187 |
"Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 188 |
! |
189 |
||
190 |
primSetSubpixelOrder: options subpixelOrder: subpixel_order |
|
191 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
192 |
<cdecl: const void "cairo_font_options_set_subpixel_order" ( Cairo::FontOptions int32 ) > |
1 | 193 |
self primitiveFailed |
194 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
195 |
"Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 196 |
! |
197 |
||
198 |
primStatus: options |
|
199 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
200 |
<cdecl: const int32 "cairo_font_options_status" ( Cairo::FontOptions ) > |
1 | 201 |
self primitiveFailed |
202 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
203 |
"Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 204 |
! ! |
205 |
||
40
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
206 |
!FontOptions methodsFor:'accessing'! |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
207 |
|
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
208 |
referenceCount |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
209 |
"Return value or reference counter" |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
210 |
|
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
211 |
^ self shouldNotImplement |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
212 |
|
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
213 |
"Modified: / 17-02-2016 / 20:29:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
214 |
! ! |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
215 |
|
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
216 |
!FontOptions methodsFor:'private'! |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
217 |
|
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
218 |
destroy |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
219 |
"Tell Cairo library to destroy the corresponding C object. |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
220 |
Remember that object is physically destroyed only if internal |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
221 |
refcounter goes to zero. However, after calling destroy, |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
222 |
this instance should be treated as invalid." |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
223 |
|
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
224 |
CPrimitives cairo_font_options_destroy: self. |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
225 |
|
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
226 |
"Modified: / 17-02-2016 / 20:29:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
227 |
! ! |
28dfc583beb5
#displayString: in CairoGraphicsContext revamped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
228 |
|
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
229 |
!FontOptions class methodsFor:'documentation'! |
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
230 |
|
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
231 |
version |
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
232 |
^'$Id$' |
11 | 233 |
! |
234 |
||
23
38ee47dbd976
Added version_HG to make Mercurial happy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
20
diff
changeset
|
235 |
version_HG |
38ee47dbd976
Added version_HG to make Mercurial happy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
20
diff
changeset
|
236 |
^ '$Changeset: <not expanded> $' |
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
237 |
! ! |
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
238 |