author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 16 Feb 2016 07:46:52 +0000 | |
changeset 39 | 8af34937e1ec |
parent 29 | 6ba06265e543 |
child 88 | 9d51db2ba641 |
permissions | -rw-r--r-- |
1 | 1 |
"{ Package: 'stx:goodies/libcairo' }" |
2 |
||
3 |
"{ NameSpace: Cairo }" |
|
4 |
||
5 |
ExternalStructure subclass:#RectangleList |
|
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 |
|
1 | 13 |
!RectangleList class methodsFor:'accessing'! |
14 |
||
12 | 15 |
dllPath |
16 |
||
17 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
18 |
^ #( 'C:\Windows' 'C:\Windows\System32' "Wild guess, should not harm" ) |
|
19 |
]. |
|
20 |
||
21 |
OperatingSystem isUNIXlike ifTrue:[ |
|
22 |
OperatingSystem getSystemType == #linux ifTrue:[ |
|
23 |
| path | |
|
24 |
||
25 |
path := #( '/lib' '/usr/lib' '/usr/local/lib' ). |
|
26 |
(OperatingSystem getSystemInfo at:#machine) = 'x86_64' ifTrue:[ |
|
27 |
"If the machine is 64bit, prepend standard path for 32bit libs. |
|
28 |
Leave standard paths at the end, as the system might be completely |
|
29 |
32bit but running on 64bit-capable CPU. |
|
30 |
||
31 |
CAVEAT: This is bit dangerous, as on 64bit OS, if ia32 libs are |
|
32 |
not installed byt 64bit sqlite libs are, then 64bit libs are found |
|
33 |
and when a function is called, segfault will occur!! |
|
34 |
||
35 |
Q: Is there a way how to figure out if the OS itself is 32bit, |
|
36 |
regardles on CPU?" |
|
37 |
path := #( '/lib32' '/usr/lib32' '/usr/local/lib32' ) , path. |
|
38 |
]. |
|
39 |
^path |
|
40 |
||
41 |
]. |
|
42 |
]. |
|
43 |
||
44 |
self error:'Unsupported operating system' |
|
45 |
||
46 |
" |
|
47 |
SqliteLibrary dllPath |
|
48 |
" |
|
49 |
||
50 |
"Created: / 31-08-2011 / 18:02:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
51 |
! |
|
52 |
||
1 | 53 |
libraryName |
54 |
||
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
55 |
OperatingSystem isUNIXlike ifTrue:[^'libcairo.so.2']. |
1 | 56 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
57 |
OperatingSystem isMSWINDOWSlike ifTrue:[^'cairo.dll']. |
12 | 58 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
59 |
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
|
60 |
! |
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
61 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
62 |
sizeof |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
63 |
"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
|
64 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
65 |
^12 |
1 | 66 |
! ! |
67 |
||
68 |
!RectangleList class methodsFor:'primitives'! |
|
69 |
||
70 |
primDestroy: rectangle_list |
|
71 |
||
20
18a3e6b5f310
Added const modifier to FFI specs (required by recent STX)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
72 |
<cdecl: const void "cairo_rectangle_list_destroy" ( Cairo::RectangleList ) > |
1 | 73 |
self primitiveFailed |
74 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
75 |
"Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
1 | 76 |
! ! |
77 |
||
6
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
78 |
!RectangleList methodsFor:'accessing'! |
1 | 79 |
|
6
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
80 |
numRectangles |
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
81 |
"Returns int32" |
1 | 82 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
83 |
^self longAt:1 + 8 |
1 | 84 |
! |
85 |
||
6
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
86 |
numRectangles: value |
1 | 87 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
88 |
self longAt:1 + 8 put:value |
1 | 89 |
! |
90 |
||
6
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
91 |
rectangles |
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
92 |
"Returns (pointer-to ;; Line: 496 |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
93 |
;; Namespace: Cairo |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
94 |
;; Class: Rectangle |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
95 |
)" |
1 | 96 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
97 |
^self pointerAt:1 + 4 |
1 | 98 |
! |
99 |
||
6
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
100 |
rectangles: value |
1 | 101 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
102 |
self pointerAt:1 + 4 put:value |
1 | 103 |
! |
104 |
||
6
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
105 |
status |
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
106 |
"Returns ;; Line: 398 |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
107 |
;; Namespace: Cairo |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
108 |
;; Class: Status |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
109 |
(enum _cairo_status |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
110 |
(value (CAIRO_STATUS_SUCCESS) 0) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
111 |
(value (CAIRO_STATUS_NO_MEMORY) 1) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
112 |
(value (CAIRO_STATUS_INVALID_RESTORE) 2) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
113 |
(value (CAIRO_STATUS_INVALID_POP_GROUP) 3) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
114 |
(value (CAIRO_STATUS_NO_CURRENT_POINT) 4) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
115 |
(value (CAIRO_STATUS_INVALID_MATRIX) 5) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
116 |
(value (CAIRO_STATUS_INVALID_STATUS) 6) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
117 |
(value (CAIRO_STATUS_NULL_POINTER) 7) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
118 |
(value (CAIRO_STATUS_INVALID_STRING) 8) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
119 |
(value (CAIRO_STATUS_INVALID_PATH_DATA) 9) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
120 |
(value (CAIRO_STATUS_READ_ERROR) 10) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
121 |
(value (CAIRO_STATUS_WRITE_ERROR) 11) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
122 |
(value (CAIRO_STATUS_SURFACE_FINISHED) 12) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
123 |
(value (CAIRO_STATUS_SURFACE_TYPE_MISMATCH) 13) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
124 |
(value (CAIRO_STATUS_PATTERN_TYPE_MISMATCH) 14) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
125 |
(value (CAIRO_STATUS_INVALID_CONTENT) 15) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
126 |
(value (CAIRO_STATUS_INVALID_FORMAT) 16) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
127 |
(value (CAIRO_STATUS_INVALID_VISUAL) 17) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
128 |
(value (CAIRO_STATUS_FILE_NOT_FOUND) 18) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
129 |
(value (CAIRO_STATUS_INVALID_DASH) 19) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
130 |
(value (CAIRO_STATUS_INVALID_DSC_COMMENT) 20) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
131 |
(value (CAIRO_STATUS_INVALID_INDEX) 21) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
132 |
(value (CAIRO_STATUS_CLIP_NOT_REPRESENTABLE) 22) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
133 |
(value (CAIRO_STATUS_TEMP_FILE_ERROR) 23) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
134 |
(value (CAIRO_STATUS_INVALID_STRIDE) 24) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
135 |
(value (CAIRO_STATUS_FONT_TYPE_MISMATCH) 25) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
136 |
(value (CAIRO_STATUS_USER_FONT_IMMUTABLE) 26) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
137 |
(value (CAIRO_STATUS_USER_FONT_ERROR) 27) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
138 |
(value (CAIRO_STATUS_NEGATIVE_COUNT) 28) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
139 |
(value (CAIRO_STATUS_INVALID_CLUSTERS) 29) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
140 |
(value (CAIRO_STATUS_INVALID_SLANT) 30) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
141 |
(value (CAIRO_STATUS_INVALID_WEIGHT) 31) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
142 |
(value (CAIRO_STATUS_INVALID_SIZE) 32) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
143 |
(value (CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED) 33) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
144 |
(value (CAIRO_STATUS_DEVICE_TYPE_MISMATCH) 34) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
145 |
(value (CAIRO_STATUS_DEVICE_ERROR) 35) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
146 |
(value (CAIRO_STATUS_INVALID_MESH_CONSTRUCTION) 36) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
147 |
(value (CAIRO_STATUS_DEVICE_FINISHED) 37) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
148 |
(value (CAIRO_STATUS_JBIG2_GLOBAL_MISSING) 38) |
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
149 |
(value (CAIRO_STATUS_LAST_STATUS) 39) )" |
1 | 150 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
151 |
^self doubleWordAt:1 + 0 |
1 | 152 |
! |
153 |
||
6
c1f387b40e3a
regenerated using newer version of CFace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
154 |
status: value |
1 | 155 |
|
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
156 |
self doubleWordAt:1 + 0 put:value |
1 | 157 |
! ! |
158 |
||
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
159 |
!RectangleList class methodsFor:'documentation'! |
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
160 |
|
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
161 |
version |
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
162 |
^'$Id$' |
11 | 163 |
! |
164 |
||
23
38ee47dbd976
Added version_HG to make Mercurial happy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
20
diff
changeset
|
165 |
version_HG |
38ee47dbd976
Added version_HG to make Mercurial happy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
20
diff
changeset
|
166 |
^ '$Changeset: <not expanded> $' |
7
392289f92fab
- DLL path is set automatically.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6
diff
changeset
|
167 |
! ! |
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
168 |