Compare commits
2822 Commits
Bugzilla_P
...
SVG_200208
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
124fb27d4a | ||
|
|
9ff478fb4e | ||
|
|
fa90b61fc2 | ||
|
|
37a6577219 | ||
|
|
c049cd1a3e | ||
|
|
3310110a52 | ||
|
|
324fd52ea5 | ||
|
|
7253405625 | ||
|
|
8895496b07 | ||
|
|
ce68892c9c | ||
|
|
f2f79ebae8 | ||
|
|
1ba3c8bc3c | ||
|
|
628e2fd72b | ||
|
|
b4cf3ce52e | ||
|
|
f9ec30e1f8 | ||
|
|
e10b5abf77 | ||
|
|
fdc9d79612 | ||
|
|
4de67abf10 | ||
|
|
cc75e15965 | ||
|
|
e979c1cf21 | ||
|
|
f8611f937c | ||
|
|
e35670d62a | ||
|
|
9e2217f461 | ||
|
|
91e2399c96 | ||
|
|
8f3e73639d | ||
|
|
046f8dece7 | ||
|
|
e79a6e13e3 | ||
|
|
8fcb11ad3a | ||
|
|
960045ff84 | ||
|
|
77bfb08cf7 | ||
|
|
0052a7429d | ||
|
|
9c19eed4e5 | ||
|
|
c200d1d972 | ||
|
|
9afbd254bf | ||
|
|
ed3879b9e5 | ||
|
|
a6541de133 | ||
|
|
7dc43318c1 | ||
|
|
34b5f88123 | ||
|
|
c0f1761da3 | ||
|
|
927c4d9146 | ||
|
|
1ceed5c792 | ||
|
|
bc9163fb4c | ||
|
|
953d822a11 | ||
|
|
51bc2cdde5 | ||
|
|
2d9dc00996 | ||
|
|
668d0513c8 | ||
|
|
42d45c1af7 | ||
|
|
c7bdc1a0bb | ||
|
|
3026c2125b | ||
|
|
fe04044f4b | ||
|
|
547ee9f021 | ||
|
|
29c75d807e | ||
|
|
c1a8588436 | ||
|
|
1d5b321391 | ||
|
|
0e4acc3679 | ||
|
|
54f047805b | ||
|
|
1c6d9d1cd3 | ||
|
|
c66846744a | ||
|
|
79c45adec4 | ||
|
|
6ed228a9b6 | ||
|
|
64ddfa4c0a | ||
|
|
22256a2fd4 | ||
|
|
259eecb7d8 | ||
|
|
51c25bdd5c | ||
|
|
314472e423 | ||
|
|
4c70758b42 | ||
|
|
44ac2127f5 | ||
|
|
6e77e63e9e | ||
|
|
de8fdfefd2 | ||
|
|
4ee5a11f4e | ||
|
|
5fc6682a4c | ||
|
|
b4f27e28e5 | ||
|
|
cd8b020073 | ||
|
|
e3ea8752b7 | ||
|
|
4192300b04 | ||
|
|
97449ea51e | ||
|
|
455ea0ba74 | ||
|
|
d68731e18f | ||
|
|
50f30b6c10 | ||
|
|
042951fa82 | ||
|
|
8e8e2f5071 | ||
|
|
c10756872b | ||
|
|
eac86043fd | ||
|
|
472042d899 | ||
|
|
1ca574741e | ||
|
|
b80e5e116d | ||
|
|
8527a7b190 | ||
|
|
ab22154a1b | ||
|
|
2f0e0d8ecd | ||
|
|
be4d0346bc | ||
|
|
b65a04d37c | ||
|
|
f40ce4d8f6 | ||
|
|
086ba3f31f | ||
|
|
29fdff7f17 | ||
|
|
4083d65a98 | ||
|
|
65ad96443a | ||
|
|
fd21bb7f47 | ||
|
|
fa860c5c6c | ||
|
|
9af81d858e | ||
|
|
a33a841b33 | ||
|
|
3eec392591 | ||
|
|
af4c60ffc9 | ||
|
|
83540119ab | ||
|
|
7dfae6e1ee | ||
|
|
1ee8e063cd | ||
|
|
f5460cca5a | ||
|
|
d0c9edc243 | ||
|
|
ffc95aff9d | ||
|
|
62f6f0346c | ||
|
|
90ca863185 | ||
|
|
6e88127a8f | ||
|
|
be67909eab | ||
|
|
82e4c9b535 | ||
|
|
fc1c3e7b5a | ||
|
|
7a52dff6ba | ||
|
|
d543acb064 | ||
|
|
bf87fd6971 | ||
|
|
4c5208689a | ||
|
|
a0450540ec | ||
|
|
5cc861c2fe | ||
|
|
0b284c67b0 | ||
|
|
f8ba312ce3 | ||
|
|
427669723f | ||
|
|
89967ac8f4 | ||
|
|
fd40593907 | ||
|
|
57f0a3a81c | ||
|
|
8240ca9999 | ||
|
|
4ded2f55b2 | ||
|
|
2da93c3af0 | ||
|
|
b9198d5370 | ||
|
|
dafa06a08f | ||
|
|
1b95983f33 | ||
|
|
a8544911ea | ||
|
|
72bc30a9b9 | ||
|
|
13b6c2e76e | ||
|
|
aa455e49df | ||
|
|
79d671e320 | ||
|
|
4d1d2d49fb | ||
|
|
b3a90c6efd | ||
|
|
a6dba709e9 | ||
|
|
d06f55bf97 | ||
|
|
4438b008ef | ||
|
|
4b0f47e701 | ||
|
|
35695feb70 | ||
|
|
91a9d59338 | ||
|
|
7264f9e3a9 | ||
|
|
f3bf9e5147 | ||
|
|
c699807e02 | ||
|
|
235a9071f2 | ||
|
|
b9fc6ecaeb | ||
|
|
974c44a4d9 | ||
|
|
91772cd113 | ||
|
|
49c1920d2a | ||
|
|
18bed169d3 | ||
|
|
21b0e8f669 | ||
|
|
5605dc8ec9 | ||
|
|
9f668a6437 | ||
|
|
d29ed4bbb1 | ||
|
|
0c997b104a | ||
|
|
0bbe559f46 | ||
|
|
cf88193292 | ||
|
|
ac4ea9fb91 | ||
|
|
015a1fa3b8 | ||
|
|
95f35b8965 | ||
|
|
25a6be530c | ||
|
|
e5638cf3e8 | ||
|
|
8b0455794d | ||
|
|
dc3b61e2cf | ||
|
|
447b63ea7c | ||
|
|
536d82e970 | ||
|
|
ac5dfaefe1 | ||
|
|
f8dfbe75d3 | ||
|
|
608f71a6e6 | ||
|
|
3211b86142 | ||
|
|
9fb795520f | ||
|
|
8896426594 | ||
|
|
d058216a99 | ||
|
|
1b472c4a75 | ||
|
|
79cb157ab0 | ||
|
|
304af1c41e | ||
|
|
798558fe81 | ||
|
|
77a8683e17 | ||
|
|
797e2cb2bd | ||
|
|
51fc41a86e | ||
|
|
ec22386ff1 | ||
|
|
9a51483f87 | ||
|
|
7d7f17f67f | ||
|
|
7893a5f58d | ||
|
|
6714715bfd | ||
|
|
5d7a3d611a | ||
|
|
31e1b7eff1 | ||
|
|
9124109e31 | ||
|
|
2d94942f5b | ||
|
|
42e17479e2 | ||
|
|
f8db85b93f | ||
|
|
dcccdaa5f4 | ||
|
|
c81a731259 | ||
|
|
0858c77a11 | ||
|
|
c9a5da2a83 | ||
|
|
5b307b5578 | ||
|
|
962165a230 | ||
|
|
6a7e93fc0d | ||
|
|
8fe31aedde | ||
|
|
925e098bd9 | ||
|
|
185189929a | ||
|
|
30a89ae28b | ||
|
|
67ccf0e802 | ||
|
|
bd2913e8d2 | ||
|
|
8692a724f5 | ||
|
|
68b200682c | ||
|
|
be49a5c533 | ||
|
|
11637c0a67 | ||
|
|
24bb8e9051 | ||
|
|
8afe9be4be | ||
|
|
d645380358 | ||
|
|
24a732e8fb | ||
|
|
63403c7502 | ||
|
|
9738c30437 | ||
|
|
4c364ca78a | ||
|
|
488b81738e | ||
|
|
bbe5320722 | ||
|
|
e05f8b8f47 | ||
|
|
92f6a255c2 | ||
|
|
22c75f27ec | ||
|
|
0623aff329 | ||
|
|
293dbbcd1f | ||
|
|
545a72a5d0 | ||
|
|
0c7c1c04f3 | ||
|
|
4372239cec | ||
|
|
02927da3b6 | ||
|
|
656d7c9457 | ||
|
|
37e1912c6f | ||
|
|
bfb6485edc | ||
|
|
deb2864a2a | ||
|
|
4c014b265d | ||
|
|
c156d4f76f | ||
|
|
cfa1889281 | ||
|
|
0b2ab35cf7 | ||
|
|
1e9640b70f | ||
|
|
c22cb2a477 | ||
|
|
bba4e3b06b | ||
|
|
121e7c48d0 | ||
|
|
ee7e2b52dd | ||
|
|
7183ee1812 | ||
|
|
578afc9476 | ||
|
|
a968ce91ff | ||
|
|
40062f7b35 | ||
|
|
e6b8ae652f | ||
|
|
cb5ac756a1 | ||
|
|
b859c53926 | ||
|
|
229b44fa8e | ||
|
|
7fcf2f29a1 | ||
|
|
102f76a050 | ||
|
|
9844f75573 | ||
|
|
325bff7164 | ||
|
|
f20e59a0fe | ||
|
|
11e488111d | ||
|
|
b23089d0ce | ||
|
|
53af493081 | ||
|
|
55840407d6 | ||
|
|
88412f5cca | ||
|
|
a305d85996 | ||
|
|
781e9c65e2 | ||
|
|
2169fd9093 | ||
|
|
924efd456d | ||
|
|
e18ec1cbb7 | ||
|
|
43d17bd1d6 | ||
|
|
c2a07f8ca4 | ||
|
|
1b57318c55 | ||
|
|
e5f79c89d2 | ||
|
|
a8ca30121c | ||
|
|
ff9f774c5b | ||
|
|
f068dae85c | ||
|
|
03b6db2975 | ||
|
|
c49fae7638 | ||
|
|
1456ece7b6 | ||
|
|
2651f6ccd4 | ||
|
|
a83072dd92 | ||
|
|
fc977eaceb | ||
|
|
861d6bb2cb | ||
|
|
672499b3ae | ||
|
|
725cbaf73e | ||
|
|
133a2f6ef8 | ||
|
|
cd7bad237a | ||
|
|
59edb917bd | ||
|
|
39acdb7a27 | ||
|
|
518a0fb1b9 | ||
|
|
1ed31e83a7 | ||
|
|
56707d69cd | ||
|
|
cda8c2f36a | ||
|
|
99426a9b40 | ||
|
|
2a0f1b0336 | ||
|
|
910a803cc8 | ||
|
|
8677e94998 | ||
|
|
6a0a8efa86 | ||
|
|
a1f6af4667 | ||
|
|
0c0cf9ecf3 | ||
|
|
71e5a0d9ce | ||
|
|
56e1a45320 | ||
|
|
b4d992cb02 | ||
|
|
f0c487bee0 | ||
|
|
02bd51dca0 | ||
|
|
a118c8a10f | ||
|
|
eb760368df | ||
|
|
93a121bec1 | ||
|
|
7383c167c4 | ||
|
|
3c86efbaa2 | ||
|
|
9ba7855de7 | ||
|
|
6d5d0fa10e | ||
|
|
7bc238d7a1 | ||
|
|
94a5d7de0c | ||
|
|
8cd5650005 | ||
|
|
7e8aa74093 | ||
|
|
8f333523c8 | ||
|
|
dd2de77d93 | ||
|
|
af4bc6cf21 | ||
|
|
a728ae346c | ||
|
|
369e8229d0 | ||
|
|
3692434a8e | ||
|
|
28c54c8a52 | ||
|
|
5a3999941d | ||
|
|
cf8b475ee8 | ||
|
|
97e3cd10d2 | ||
|
|
4767339f6c | ||
|
|
dd6dc2263c | ||
|
|
0d552e997c | ||
|
|
e6f206c6ce | ||
|
|
d4abf23b1b | ||
|
|
e5a16281a8 | ||
|
|
23127b1a98 | ||
|
|
2a3bf650f0 | ||
|
|
22622bc346 | ||
|
|
b3bfda0fb7 | ||
|
|
9132da9e54 | ||
|
|
a9eeb6b688 | ||
|
|
69975a03b0 | ||
|
|
3232c2fc50 | ||
|
|
c3e845b32f | ||
|
|
717b70cb65 | ||
|
|
74ea63b790 | ||
|
|
2e65f57aea | ||
|
|
410ad0fd16 | ||
|
|
60422765b0 | ||
|
|
30e5e68735 | ||
|
|
2b1e437151 | ||
|
|
db891f00b1 | ||
|
|
133bfab0b1 | ||
|
|
f83158bd8f | ||
|
|
b25db35652 | ||
|
|
f0187522d7 | ||
|
|
7998b638b7 | ||
|
|
5089477442 | ||
|
|
4d65990457 | ||
|
|
fdea88a4db | ||
|
|
6a614634bf | ||
|
|
1839a35cc1 | ||
|
|
31d3d623b4 | ||
|
|
ed041269b4 | ||
|
|
98a1043bbe | ||
|
|
4200beed9b | ||
|
|
f25e227f7b | ||
|
|
cdeb82a090 | ||
|
|
a8c53c87f7 | ||
|
|
b858190117 | ||
|
|
c86bb44258 | ||
|
|
c35ec937f6 | ||
|
|
54edcc88f8 | ||
|
|
b6ca8fa2ed | ||
|
|
4626ac5418 | ||
|
|
f9416d1e3b | ||
|
|
a3c7a039f9 | ||
|
|
cbac512367 | ||
|
|
20283028ef | ||
|
|
5444122c25 | ||
|
|
369b525690 | ||
|
|
ffb4b008bc | ||
|
|
ef253c4434 | ||
|
|
f44ecc8fb8 | ||
|
|
c05391a935 | ||
|
|
6f5a20fe9d | ||
|
|
e5c4c53135 | ||
|
|
9129fe1a67 | ||
|
|
01886d9c66 | ||
|
|
2b84451550 | ||
|
|
6f65ef4a94 | ||
|
|
c1bd7ab216 | ||
|
|
37e6116529 | ||
|
|
7da03ea51c | ||
|
|
2f1683a246 | ||
|
|
0e88d0860a | ||
|
|
ae3ab7d37a | ||
|
|
a962c21d41 | ||
|
|
6a52761ff9 | ||
|
|
7771c9d127 | ||
|
|
b1357f8a31 | ||
|
|
5282cedd05 | ||
|
|
02cadbb205 | ||
|
|
0cec7b7c5a | ||
|
|
3950b292ff | ||
|
|
a8e7151bf4 | ||
|
|
bebde11822 | ||
|
|
e62936a18e | ||
|
|
d12a957e19 | ||
|
|
2b4bbf7237 | ||
|
|
b01502356c | ||
|
|
c3866b3a50 | ||
|
|
7ce57677ba | ||
|
|
7da2a94cbd | ||
|
|
eaa75bb394 | ||
|
|
ff3b5f1bd2 | ||
|
|
97bfcc4686 | ||
|
|
78fed2e87d | ||
|
|
9afdcf6fb2 | ||
|
|
7611651ee7 | ||
|
|
fdf8ae5b5f | ||
|
|
ec222266a8 | ||
|
|
f50250b92a | ||
|
|
6042d2a155 | ||
|
|
9dc7d79806 | ||
|
|
d21db24616 | ||
|
|
8f356a3e7c | ||
|
|
4298cf96c1 | ||
|
|
ef9c61c74f | ||
|
|
29fd95aef2 | ||
|
|
9b368a5e1d | ||
|
|
01e2d35c8b | ||
|
|
2ca860a6d3 | ||
|
|
63f3c4f791 | ||
|
|
ddfbc0ff4e | ||
|
|
14829a74ad | ||
|
|
e1af56bf1e | ||
|
|
2d1c5ec9f0 | ||
|
|
286ec8b7f4 | ||
|
|
b5e7185c3c | ||
|
|
e1f2c9c169 | ||
|
|
1a05f649c6 | ||
|
|
00cb79e95a | ||
|
|
c728d3962c | ||
|
|
a844108e85 | ||
|
|
a21496a361 | ||
|
|
b92f218827 | ||
|
|
a880ad3702 | ||
|
|
c2e34ab5d1 | ||
|
|
185d879123 | ||
|
|
5c374eed8b | ||
|
|
0130c12013 | ||
|
|
d2ccc8cf02 | ||
|
|
2fd95378c9 | ||
|
|
a588052207 | ||
|
|
e649540c60 | ||
|
|
eb1ac066c6 | ||
|
|
4fe07a1562 | ||
|
|
fbcfda6ec2 | ||
|
|
3fa9d44ed2 | ||
|
|
0c28c38cf0 | ||
|
|
cf73a02489 | ||
|
|
11e8f2ad33 | ||
|
|
71a8c22e47 | ||
|
|
039c30685d | ||
|
|
c4adb46d80 | ||
|
|
f04f61355f | ||
|
|
f9bb67be21 | ||
|
|
798b734575 | ||
|
|
4d051a96ff | ||
|
|
8a0e6bc6e7 | ||
|
|
ba262e33d4 | ||
|
|
d651ed432f | ||
|
|
3636c59169 | ||
|
|
c6f90015df | ||
|
|
d81b80bc41 | ||
|
|
38157b25b7 | ||
|
|
f5446f3c7e | ||
|
|
e7e1db9698 | ||
|
|
5e7b11afb7 | ||
|
|
035dbe91ce | ||
|
|
5d2a4473b9 | ||
|
|
01341d9e3c | ||
|
|
255ebc1837 | ||
|
|
7bc97b064e | ||
|
|
41e6689d50 | ||
|
|
5dfe57abb3 | ||
|
|
96ef7647c7 | ||
|
|
79c60ad859 | ||
|
|
8e7d878186 | ||
|
|
3b89268071 | ||
|
|
544e250544 | ||
|
|
8b20fbdd82 | ||
|
|
1da87a90e5 | ||
|
|
9f7cf37f8c | ||
|
|
993a541873 | ||
|
|
01fcfc5ac4 | ||
|
|
615fd435f4 | ||
|
|
d71824c07d | ||
|
|
3816d9f036 | ||
|
|
3560250015 | ||
|
|
8bffb2130f | ||
|
|
87a19fce64 | ||
|
|
508651d4ca | ||
|
|
e98305c34a | ||
|
|
632cf0781e | ||
|
|
0ec1511934 | ||
|
|
d6e2febb61 | ||
|
|
16c47f8a29 | ||
|
|
8305292a8a | ||
|
|
f55f8c3805 | ||
|
|
0aee0fe7f3 | ||
|
|
295afaadb1 | ||
|
|
21b6c7ef39 | ||
|
|
f144c703ef | ||
|
|
8600889897 | ||
|
|
5f76121e77 | ||
|
|
6e833ccc5b | ||
|
|
5df7b90ed4 | ||
|
|
877fb645db | ||
|
|
f7c6fa9d21 | ||
|
|
dbb888b255 | ||
|
|
563706c60a | ||
|
|
a6c742786a | ||
|
|
50f9170ec7 | ||
|
|
3c4986240c | ||
|
|
66501867de | ||
|
|
7f01d87246 | ||
|
|
19d0492d88 | ||
|
|
e635a3cd71 | ||
|
|
9d33b5519d | ||
|
|
1aac970cf4 | ||
|
|
67dde85655 | ||
|
|
14aeefa20e | ||
|
|
9d364937d7 | ||
|
|
d61df3aa38 | ||
|
|
10b640ad3a | ||
|
|
603ae8ef36 | ||
|
|
c15a216b07 | ||
|
|
4cb4da3135 | ||
|
|
77c6e7b67c | ||
|
|
1b134606f6 | ||
|
|
7d81f1b38d | ||
|
|
55af1e7936 | ||
|
|
f7575b0db1 | ||
|
|
e9d9254cc7 | ||
|
|
78e286b83d | ||
|
|
c2c2197ef6 | ||
|
|
9a11c0aedc | ||
|
|
eb41b992e3 | ||
|
|
c52d22c28d | ||
|
|
55ec460407 | ||
|
|
697f1a9465 | ||
|
|
ecdd8ab65f | ||
|
|
dfa9bd5ea2 | ||
|
|
d34eba106d | ||
|
|
df86a25798 | ||
|
|
5a25868f3a | ||
|
|
8e87af728a | ||
|
|
e7ec69df4b | ||
|
|
208a6f8e3c | ||
|
|
d2cab5173e | ||
|
|
195409b999 | ||
|
|
73d1262924 | ||
|
|
1c01d792f8 | ||
|
|
00aca9ccd9 | ||
|
|
cc965819e8 | ||
|
|
1365591a1e | ||
|
|
64e02d9ae6 | ||
|
|
b5ecb6dda7 | ||
|
|
a0e80802d0 | ||
|
|
0a23433cb9 | ||
|
|
77550ff3b4 | ||
|
|
080c774ee3 | ||
|
|
b97395f839 | ||
|
|
3773761d91 | ||
|
|
6a0f892905 | ||
|
|
01d9d47333 | ||
|
|
20b1f3fa86 | ||
|
|
49ccc35a74 | ||
|
|
8fb7a6ccd5 | ||
|
|
02ee939574 | ||
|
|
1c0c54a637 | ||
|
|
b5c586f6ef | ||
|
|
79e5539aec | ||
|
|
a16e42c146 | ||
|
|
1e79bb6ab0 | ||
|
|
3f5cca095a | ||
|
|
3e602a9f04 | ||
|
|
ba5e37b831 | ||
|
|
13627c98ae | ||
|
|
58298ba6cd | ||
|
|
d1e791d134 | ||
|
|
98bebf9f26 | ||
|
|
3c02768be9 | ||
|
|
d78fa03226 | ||
|
|
beb0c00835 | ||
|
|
281419934a | ||
|
|
30cf0df97e | ||
|
|
02fd13d54d | ||
|
|
2b20d4bbf7 | ||
|
|
59f26094d7 | ||
|
|
3d85f30820 | ||
|
|
e1b0af4e1d | ||
|
|
8db48c9761 | ||
|
|
54b0837973 | ||
|
|
7f5a5a618a | ||
|
|
03e46541b4 | ||
|
|
fb56d1e2c0 | ||
|
|
ea6e894339 | ||
|
|
85c326e9c8 | ||
|
|
21c0ccc330 | ||
|
|
24132ce4c9 | ||
|
|
b074819e6d | ||
|
|
b0b7a20bdb | ||
|
|
178b6c2d5e | ||
|
|
908b8255d4 | ||
|
|
cab12511d4 | ||
|
|
9a806c60fe | ||
|
|
e7c2ffe30a | ||
|
|
6ada3edcd7 | ||
|
|
701be434fb | ||
|
|
d4699db840 | ||
|
|
50be087f7b | ||
|
|
78ee60a834 | ||
|
|
bd64afa8ab | ||
|
|
0c40fcbd93 | ||
|
|
223e70cbbd | ||
|
|
71d5be248f | ||
|
|
64213cbcf3 | ||
|
|
8b45eec30f | ||
|
|
76a809a67c | ||
|
|
f5796b5f71 | ||
|
|
1b7caa10dc | ||
|
|
111f6a2e8d | ||
|
|
01c46ae9cd | ||
|
|
2a055af3f8 | ||
|
|
0b2c94950a | ||
|
|
f3367c89e9 | ||
|
|
48c6b9c1ce | ||
|
|
4dcb11a39f | ||
|
|
76b49d7465 | ||
|
|
690d2c0bef | ||
|
|
f9da4499fa | ||
|
|
7ef44d6e76 | ||
|
|
3495eca2d7 | ||
|
|
4bd8981445 | ||
|
|
7d69abde8e | ||
|
|
4b278d819a | ||
|
|
f2f1b42a6b | ||
|
|
98c1392734 | ||
|
|
d0f3fe54a4 | ||
|
|
23ed5d660d | ||
|
|
ac37835845 | ||
|
|
5a725d3799 | ||
|
|
d3b242d8b6 | ||
|
|
44e616bb84 | ||
|
|
be927b60f1 | ||
|
|
b72e38951c | ||
|
|
be4875d3c7 | ||
|
|
4c78026770 | ||
|
|
ead545266a | ||
|
|
29ca846b8b | ||
|
|
202ab4d6e1 | ||
|
|
4a5f28b71e | ||
|
|
8c3d311cb9 | ||
|
|
2210006d15 | ||
|
|
c05cd73c0a | ||
|
|
1c29191311 | ||
|
|
fe40cb95cb | ||
|
|
6998788589 | ||
|
|
b5574b2a89 | ||
|
|
f0e2529596 | ||
|
|
48ac123446 | ||
|
|
1c9690aa38 | ||
|
|
55ae98c99d | ||
|
|
7d4747a04e | ||
|
|
5a20737e37 | ||
|
|
d896129cde | ||
|
|
5fb9b41f57 | ||
|
|
55dbf25c70 | ||
|
|
4bb036ffe0 | ||
|
|
3ce2c0f149 | ||
|
|
e2aaf6643f | ||
|
|
cd52e68590 | ||
|
|
ed50f0e383 | ||
|
|
a87d01f430 | ||
|
|
55bf8b4f06 | ||
|
|
7c8854f3d0 | ||
|
|
09fb40aa17 | ||
|
|
ea278357db | ||
|
|
aa9222e54c | ||
|
|
2aa4367266 | ||
|
|
05b930589a | ||
|
|
5a05ebc498 | ||
|
|
970893aaaf | ||
|
|
e7e5a1677a | ||
|
|
3dd30e325a | ||
|
|
a1c1e34624 | ||
|
|
a2468389cc | ||
|
|
eb22c6a272 | ||
|
|
d37a90f0b3 | ||
|
|
ff6fec4d67 | ||
|
|
42dc561f4c | ||
|
|
069dbfb68c | ||
|
|
0941d2ecdb | ||
|
|
92c533513a | ||
|
|
fc56222620 | ||
|
|
dd99f9e5bc | ||
|
|
bfa2307cf1 | ||
|
|
436a8b02f7 | ||
|
|
9dc2692721 | ||
|
|
8fe2ca829c | ||
|
|
b2fd32511a | ||
|
|
f80ad3f50f | ||
|
|
96a6b4aa46 | ||
|
|
71ffff784e | ||
|
|
7e2893cc71 | ||
|
|
3f1b90e393 | ||
|
|
3b0fc8bc5c | ||
|
|
0dde44ee8b | ||
|
|
c8844accd0 | ||
|
|
e8c3820f63 | ||
|
|
175c89a2ea | ||
|
|
a7311a64c7 | ||
|
|
8f44bb451e | ||
|
|
7934fc0bf6 | ||
|
|
7a797251db | ||
|
|
368181a95d | ||
|
|
0f1ab3ab0c | ||
|
|
ad1a1e4c9c | ||
|
|
050d8e8c55 | ||
|
|
e8aaf9ad36 | ||
|
|
9abc7e5dc6 | ||
|
|
1e8274b9b8 | ||
|
|
7368ef0536 | ||
|
|
c95dcd43e0 | ||
|
|
c9f6793cd8 | ||
|
|
63fd7c33bc | ||
|
|
87d338aa27 | ||
|
|
2f59581288 | ||
|
|
5d8fa23aad | ||
|
|
38a5767562 | ||
|
|
f44a2d8138 | ||
|
|
f1c996ad85 | ||
|
|
f8b44ebc4e | ||
|
|
44a86dac88 | ||
|
|
e37e3dadbd | ||
|
|
b992a26c12 | ||
|
|
b8c854e6a8 | ||
|
|
74eef6bba9 | ||
|
|
90ad3b5df3 | ||
|
|
238bee30e8 | ||
|
|
5a608bcf5e | ||
|
|
f8753fa9cf | ||
|
|
40b78d68bf | ||
|
|
34f86dd48b | ||
|
|
5e83c9f0ea | ||
|
|
67e2928527 | ||
|
|
2c5eb70b01 | ||
|
|
52ca8acde6 | ||
|
|
ef2e3f111b | ||
|
|
7b06b4f219 | ||
|
|
f397c8ab4e | ||
|
|
051c35befa | ||
|
|
39c72e94a1 | ||
|
|
459e27115c | ||
|
|
79ae232008 | ||
|
|
8dddb7432c | ||
|
|
57bf7291a9 | ||
|
|
479087e18e | ||
|
|
9ad9ff18de | ||
|
|
d2d0482cb1 | ||
|
|
89ce8241d1 | ||
|
|
ae7548953e | ||
|
|
60f9218f48 | ||
|
|
c618262ae9 | ||
|
|
1674f65ec6 | ||
|
|
5853ea409d | ||
|
|
4f9e6e6cb8 | ||
|
|
d49a164e15 | ||
|
|
b1fd9a85ef | ||
|
|
9b1cfb6e2c | ||
|
|
aa10ff2640 | ||
|
|
4f88d7ef1a | ||
|
|
a724a386cb | ||
|
|
df461dc44b | ||
|
|
0eb5cb3c29 | ||
|
|
7b9f5c6894 | ||
|
|
8e4855ea07 | ||
|
|
deb429400d | ||
|
|
3d6303bbd3 | ||
|
|
1891af1c3f | ||
|
|
ec3ad73494 | ||
|
|
5624070d4e | ||
|
|
47e65ff4c9 | ||
|
|
0412cce06c | ||
|
|
6483bbd8b1 | ||
|
|
8e4a295cfc | ||
|
|
8043bb0de2 | ||
|
|
461addf685 | ||
|
|
834a62906f | ||
|
|
4d08509b3d | ||
|
|
57777685b5 | ||
|
|
93e2e8ace2 | ||
|
|
12d567be6b | ||
|
|
c6f4158574 | ||
|
|
0724a82efc | ||
|
|
325641ca5e | ||
|
|
47d45b3c19 | ||
|
|
540cbb8258 | ||
|
|
ceccecffc0 | ||
|
|
26323cee6b | ||
|
|
54cdbde4f2 | ||
|
|
bc04a8751f | ||
|
|
2b8be81f6c | ||
|
|
213d7b24f8 | ||
|
|
76021460f7 | ||
|
|
d16d432af6 | ||
|
|
bea6c23d55 | ||
|
|
66a4990387 | ||
|
|
9cfe0f9106 | ||
|
|
7fd6321e89 | ||
|
|
dfae7afdfb | ||
|
|
772839f188 | ||
|
|
d08c96cba0 | ||
|
|
b119f11485 | ||
|
|
5d8ab56bfa | ||
|
|
cc5235f818 | ||
|
|
6750e9bdec | ||
|
|
cba98b4813 | ||
|
|
7f58eb8a1e | ||
|
|
b7a9a88c22 | ||
|
|
9e19e30655 | ||
|
|
a33d07cb8c | ||
|
|
5f4a189a9e | ||
|
|
cbbd425382 | ||
|
|
502aee4ad8 | ||
|
|
5c0c3e89f7 | ||
|
|
3de7d2a5ec | ||
|
|
cb41e9e24f | ||
|
|
129e2d832a | ||
|
|
d116ada324 | ||
|
|
3c342a7ce4 | ||
|
|
45cb059025 | ||
|
|
b532ff98ea | ||
|
|
a2ce2ba8bb | ||
|
|
3e01415843 | ||
|
|
baf23d4c45 | ||
|
|
38d0ce2531 | ||
|
|
73afe397ff | ||
|
|
b8fc085a5b | ||
|
|
72fb529398 | ||
|
|
48ac34d5f9 | ||
|
|
bd3dc65b0e | ||
|
|
d5884a09a9 | ||
|
|
22f69ee5be | ||
|
|
e2a032fe22 | ||
|
|
c9b2ebecb5 | ||
|
|
2e752e038f | ||
|
|
02b11c8580 | ||
|
|
e47cdb034a | ||
|
|
b1d789fcb1 | ||
|
|
bbdd8e0b52 | ||
|
|
f058a4042f | ||
|
|
1d0c7d7e2c | ||
|
|
846abc7419 | ||
|
|
69cc527890 | ||
|
|
a7768470e8 | ||
|
|
fdc7963798 | ||
|
|
8016c01e56 | ||
|
|
0035e4b8b2 | ||
|
|
b66dd4cca0 | ||
|
|
70ec741585 | ||
|
|
65221c29bc | ||
|
|
bd7293fefb | ||
|
|
2540632077 | ||
|
|
0be5ea680e | ||
|
|
41a593596e | ||
|
|
3c2079a839 | ||
|
|
8962e0aa5e | ||
|
|
ad98a4938f | ||
|
|
36dc9083cb | ||
|
|
9098d13d2f | ||
|
|
b98d9ca536 | ||
|
|
f3d30a54d4 | ||
|
|
9c91f86746 | ||
|
|
76b7b4ab26 | ||
|
|
ff59a7771d | ||
|
|
663d861d36 | ||
|
|
4fca0e23c6 | ||
|
|
fb8a01e1eb | ||
|
|
9e317b4ccb | ||
|
|
1239d1c0e6 | ||
|
|
edb0a778de | ||
|
|
170067993d | ||
|
|
146b7940d3 | ||
|
|
5252d940da | ||
|
|
1371d58da9 | ||
|
|
b82d4ea04d | ||
|
|
ff94f665cd | ||
|
|
0a2ff36319 | ||
|
|
9453ed9295 | ||
|
|
71845857df | ||
|
|
cf13cb59fa | ||
|
|
250429589c | ||
|
|
3c73ec9fee | ||
|
|
952d7bcc66 | ||
|
|
6339db317a | ||
|
|
ec8963c9a4 | ||
|
|
259b6f4456 | ||
|
|
c7ea150cc9 | ||
|
|
1609c42c84 | ||
|
|
da88ff5ca7 | ||
|
|
a9609c2fc8 | ||
|
|
81dcb08012 | ||
|
|
5b33744d9b | ||
|
|
d7ed76a469 | ||
|
|
c6fd9cf998 | ||
|
|
9712894a19 | ||
|
|
661cadbc5a | ||
|
|
84ff17dfed | ||
|
|
cc593fa8c5 | ||
|
|
941afc1277 | ||
|
|
5181418b98 | ||
|
|
ac24e852ff | ||
|
|
d620ae0cc6 | ||
|
|
935eb9fe8c | ||
|
|
abbb6cec3f | ||
|
|
ccff9eabc4 | ||
|
|
6d34b5d1ba | ||
|
|
ed7d78f9fd | ||
|
|
121b842e9f | ||
|
|
437e73a04a | ||
|
|
66ac586fc1 | ||
|
|
345b926d51 | ||
|
|
b53d1997de | ||
|
|
c835c835d1 | ||
|
|
2f101871cb | ||
|
|
910f1bd62f | ||
|
|
ce2c73b7b7 | ||
|
|
8291b6d5c8 | ||
|
|
c93acea7f0 | ||
|
|
4056a4ddc0 | ||
|
|
ca5cb0ece6 | ||
|
|
caac08dd79 | ||
|
|
c856a8ba1d | ||
|
|
dbf788b8a5 | ||
|
|
d80da32ea5 | ||
|
|
879abb16c5 | ||
|
|
458402cb98 | ||
|
|
537f75ea7e | ||
|
|
8c024b9f0a | ||
|
|
45b80ace65 | ||
|
|
72691b43f8 | ||
|
|
0842619afb | ||
|
|
96700ff7a9 | ||
|
|
37577d6ad7 | ||
|
|
ae41b6b04b | ||
|
|
3ebc871217 | ||
|
|
6765ccee5e | ||
|
|
b3c1960bee | ||
|
|
f3dec055c0 | ||
|
|
bb8f63af01 | ||
|
|
e31abc7df2 | ||
|
|
3320591662 | ||
|
|
199945ec0e | ||
|
|
8bef1a4fa1 | ||
|
|
17e9bee4ca | ||
|
|
8515abc672 | ||
|
|
a051d9944e | ||
|
|
58a849eae5 | ||
|
|
90c687bb0b | ||
|
|
3f0f919e44 | ||
|
|
efbebd6a84 | ||
|
|
e6da9c3d6e | ||
|
|
ffe30e3b83 | ||
|
|
d5720e367e | ||
|
|
7689923a5e | ||
|
|
bacc7b5067 | ||
|
|
9b95f57e39 | ||
|
|
f653bbd2e8 | ||
|
|
d2da46a654 | ||
|
|
6c0439dcd1 | ||
|
|
09220e2060 | ||
|
|
ebf6af088f | ||
|
|
df53d70e10 | ||
|
|
b3b36af5d1 | ||
|
|
0ac819f64a | ||
|
|
80a2868a29 | ||
|
|
d69fb55142 | ||
|
|
952ba93bdc | ||
|
|
3f2d766fa7 | ||
|
|
d63c986f4d | ||
|
|
1b722e9746 | ||
|
|
d17b0d8424 | ||
|
|
c856b13142 | ||
|
|
98b3a49ba8 | ||
|
|
280a471a47 | ||
|
|
a1bcd5a6a9 | ||
|
|
0ae5f12de9 | ||
|
|
68d9b6b4a1 | ||
|
|
2e29da5498 | ||
|
|
0e4b4e7250 | ||
|
|
cf1188e327 | ||
|
|
724a995e78 | ||
|
|
40556f4624 | ||
|
|
c8df3e52f1 | ||
|
|
abcc88d4d1 | ||
|
|
656de70be3 | ||
|
|
9a32b7e198 | ||
|
|
9901b85357 | ||
|
|
8af72f6bbb | ||
|
|
17e6ebaa70 | ||
|
|
dd19da27ff | ||
|
|
be0685b6f7 | ||
|
|
8243227c59 | ||
|
|
cd4f79f96a | ||
|
|
0981f17395 | ||
|
|
985fdefa99 | ||
|
|
87f64c60c5 | ||
|
|
ea199f9e7f | ||
|
|
a741fa90cd | ||
|
|
d829df69c0 | ||
|
|
d56912f37e | ||
|
|
f436c3ecbc | ||
|
|
c84f8e935b | ||
|
|
34fcc85176 | ||
|
|
a06e7b1db7 | ||
|
|
7fe283e16d | ||
|
|
fc95521bb7 | ||
|
|
ee782fdffc | ||
|
|
fad3a72e1c | ||
|
|
5adfa6aacb | ||
|
|
542c5d80db | ||
|
|
593d8584e1 | ||
|
|
f244dc4c50 | ||
|
|
2b5ea0bab9 | ||
|
|
462cd27a46 | ||
|
|
5dbe8dcceb | ||
|
|
6fb70f9b1d | ||
|
|
7425c47120 | ||
|
|
c040734998 | ||
|
|
1435808314 | ||
|
|
227549c687 | ||
|
|
f41531d34c | ||
|
|
07e12fc292 | ||
|
|
b29d9cf731 | ||
|
|
f66a698c39 | ||
|
|
78ad394687 | ||
|
|
ece9f73a82 | ||
|
|
c0bafc4f18 | ||
|
|
3c78e284ce | ||
|
|
09f6a15165 | ||
|
|
5e045655d2 | ||
|
|
f2fe76b504 | ||
|
|
f176c10a35 | ||
|
|
034e604aa7 | ||
|
|
6f14d44f09 | ||
|
|
585baa0803 | ||
|
|
c8967dfdcb | ||
|
|
e3fd4dd936 | ||
|
|
8a1d3b6f40 | ||
|
|
9e04981107 | ||
|
|
a803887481 | ||
|
|
5ddddc3cab | ||
|
|
32f4172c4b | ||
|
|
18bd36d2ff | ||
|
|
7a90a48d77 | ||
|
|
2186fde8e5 | ||
|
|
eb31338393 | ||
|
|
6a8f9c9ec2 | ||
|
|
55a02ec46a | ||
|
|
5483f8d08e | ||
|
|
f29a33f656 | ||
|
|
dad895d2f7 | ||
|
|
7d8a95f6c1 | ||
|
|
6ae98c1445 | ||
|
|
86a10335a7 | ||
|
|
d3302daa75 | ||
|
|
ab32c97e63 | ||
|
|
d0fcf231eb | ||
|
|
d46f156b48 | ||
|
|
2d08ff27bf | ||
|
|
89572a0902 | ||
|
|
31fcae953a | ||
|
|
d82896150d | ||
|
|
5baf9991e4 | ||
|
|
c55ccb9962 | ||
|
|
d06636185b | ||
|
|
242d9c13cd | ||
|
|
c4c9c9b75b | ||
|
|
4f9bc9bf2e | ||
|
|
45717b792c | ||
|
|
0240d83d88 | ||
|
|
52e174162e | ||
|
|
74db7ff3c4 | ||
|
|
0e0ceb1e09 | ||
|
|
c5532ad19d | ||
|
|
fd861e3a1e | ||
|
|
f760c5576b | ||
|
|
d05d2dcdd8 | ||
|
|
916b19a61f | ||
|
|
49eaed02f5 | ||
|
|
5c2862abfa | ||
|
|
ff911dd557 | ||
|
|
72a0669999 | ||
|
|
f98d2b5ed4 | ||
|
|
6147487ae6 | ||
|
|
d6d8281aef | ||
|
|
6453edb2dd | ||
|
|
d5ab5f8b0f | ||
|
|
d496989f33 | ||
|
|
df70e74ac3 | ||
|
|
4a861b19fe | ||
|
|
3e3847b616 | ||
|
|
9360f1b06c | ||
|
|
c38f367a90 | ||
|
|
b81bf94cb9 | ||
|
|
0c193e2a0c | ||
|
|
03acfc85fd | ||
|
|
b4fecff35d | ||
|
|
d52d1cc987 | ||
|
|
6248c8f39c | ||
|
|
08f53dff2a | ||
|
|
54697924df | ||
|
|
4cebc25c5a | ||
|
|
6c3f9c2f31 | ||
|
|
d2b241f746 | ||
|
|
5c3fc92dc0 | ||
|
|
180c9eeca1 | ||
|
|
1b1acdabc1 | ||
|
|
c4e44b6b00 | ||
|
|
297a73672a | ||
|
|
b21fe8c889 | ||
|
|
ffc0001734 | ||
|
|
be683bfd2a | ||
|
|
be44b81f3a | ||
|
|
9937942286 | ||
|
|
bafe03cd02 | ||
|
|
9054337392 | ||
|
|
3fdcf45af4 | ||
|
|
7fa26eb60a | ||
|
|
6b35f4e4cb | ||
|
|
8d6dd23a24 | ||
|
|
5f7111a373 | ||
|
|
e81fefd3a4 | ||
|
|
b29b23da3f | ||
|
|
a73f2504b4 | ||
|
|
a60fc067fa | ||
|
|
4571d35cc5 | ||
|
|
094a915347 | ||
|
|
4be148e091 | ||
|
|
29fcdbd9fe | ||
|
|
1731dce854 | ||
|
|
dc7a145d57 | ||
|
|
ace61dd488 | ||
|
|
d08a04e409 | ||
|
|
75b2167fe7 | ||
|
|
e0ca296b59 | ||
|
|
0c646666a7 | ||
|
|
4bb87c3c19 | ||
|
|
b7c06dd457 | ||
|
|
cb54c2c9cf | ||
|
|
c95e2a1f34 | ||
|
|
e03ea9c661 | ||
|
|
34954b96d1 | ||
|
|
67ef248c4f | ||
|
|
b6aaf74f0a | ||
|
|
044ae6008c | ||
|
|
6b0d6beb03 | ||
|
|
eec4e16e84 | ||
|
|
2e4fa7754c | ||
|
|
e9614e28f4 | ||
|
|
ed288aa832 | ||
|
|
dc0ba809e6 | ||
|
|
ec7eb2808b | ||
|
|
efd25a3752 | ||
|
|
09aad9178d | ||
|
|
7f8fe98bf7 | ||
|
|
46d322f36a | ||
|
|
2d3ec44ee8 | ||
|
|
dca861bd0b | ||
|
|
88aa88eb26 | ||
|
|
7122e26142 | ||
|
|
f55468e75c | ||
|
|
de008e9c95 | ||
|
|
f6935d6b59 | ||
|
|
f9158cea97 | ||
|
|
a7c7e77b8b | ||
|
|
2e8b6b11c8 | ||
|
|
13560f5cae | ||
|
|
559d453790 | ||
|
|
ca5efe9921 | ||
|
|
19a7435907 | ||
|
|
7ca34430e3 | ||
|
|
e5438144fe | ||
|
|
35236ca9ac | ||
|
|
8946598190 | ||
|
|
515e16e79d | ||
|
|
b3356503cf | ||
|
|
24a6e1ca01 | ||
|
|
accb5b1067 | ||
|
|
5ad3f1b494 | ||
|
|
beda83c802 | ||
|
|
7580d87e60 | ||
|
|
b6a46a5d60 | ||
|
|
cdaeb6ad4b | ||
|
|
a2d00d8e35 | ||
|
|
c6c289fb6e | ||
|
|
edfb2f49b9 | ||
|
|
ff3a4be02e | ||
|
|
6ccc54e579 | ||
|
|
96663aab15 | ||
|
|
6d087c9706 | ||
|
|
e46f8f1ce2 | ||
|
|
b3514f68fb | ||
|
|
2e48ddff3e | ||
|
|
2cd6ed3ec9 | ||
|
|
6009c8b31c | ||
|
|
c4fe672cd9 | ||
|
|
44f7ee448c | ||
|
|
d1b72e6736 | ||
|
|
a1abaaf6e3 | ||
|
|
49e74dc5a1 | ||
|
|
b2531ff1ba | ||
|
|
26fd0811b2 | ||
|
|
f126f999d3 | ||
|
|
fac146fac7 | ||
|
|
1d576b40e3 | ||
|
|
38f87f8a57 | ||
|
|
0c52be1f09 | ||
|
|
967c8ec974 | ||
|
|
f3b021ab55 | ||
|
|
8b645001a0 | ||
|
|
155ff91722 | ||
|
|
9dca0f7ac7 | ||
|
|
5a9c285acb | ||
|
|
1cdecd3237 | ||
|
|
9eaaec0438 | ||
|
|
d829c90453 | ||
|
|
16fa19c5d5 | ||
|
|
43e0182718 | ||
|
|
a2358254b9 | ||
|
|
a085cb323a | ||
|
|
b2e652332c | ||
|
|
16173d539c | ||
|
|
bd575c3a9a | ||
|
|
f1d54c2188 | ||
|
|
3aea8ccfdb | ||
|
|
7e2732bbd5 | ||
|
|
7021de3468 | ||
|
|
819a2aa815 | ||
|
|
8dbb19be55 | ||
|
|
800aebd000 | ||
|
|
690c519c0a | ||
|
|
58aef136eb | ||
|
|
2910b2cdb3 | ||
|
|
e9887172a9 | ||
|
|
9d5043ea35 | ||
|
|
3d7a05cab8 | ||
|
|
69732c6053 | ||
|
|
dbf420da66 | ||
|
|
9fd584fc27 | ||
|
|
14f060c60c | ||
|
|
725fc2aaf9 | ||
|
|
0cb58d5613 | ||
|
|
27365bdb65 | ||
|
|
1607649be1 | ||
|
|
8ea5186a8e | ||
|
|
d65d49c1a2 | ||
|
|
79776cb2e2 | ||
|
|
6c87171d9e | ||
|
|
264c3d6c83 | ||
|
|
0bd793ec63 | ||
|
|
82e0e6b328 | ||
|
|
15c1b89acb | ||
|
|
ed1b7ae84d | ||
|
|
79c0d720c2 | ||
|
|
bbae640797 | ||
|
|
71058ed532 | ||
|
|
c67e5d2a21 | ||
|
|
12d81dd955 | ||
|
|
8dd05b8809 | ||
|
|
87df0846e3 | ||
|
|
5bddc7d47e | ||
|
|
59858e8dac | ||
|
|
440db5455b | ||
|
|
a238423458 | ||
|
|
3e22f0d1cc | ||
|
|
772b968658 | ||
|
|
3c350cfa09 | ||
|
|
19ac1c3583 | ||
|
|
8acdd77a02 | ||
|
|
c58a02b604 | ||
|
|
7c25744dc3 | ||
|
|
8e64a4b61a | ||
|
|
f3e5816d55 | ||
|
|
58bb3b645b | ||
|
|
69bf58fca3 | ||
|
|
93eb72753c | ||
|
|
1956e9cdc2 | ||
|
|
0fd128e862 | ||
|
|
7f0844c63f | ||
|
|
90d91be9d8 | ||
|
|
c54d33f095 | ||
|
|
6160a4f8fd | ||
|
|
bddfd612b4 | ||
|
|
ef9b5e0a82 | ||
|
|
c62f04697e | ||
|
|
e7b640d60f | ||
|
|
75524fd24d | ||
|
|
a796a3a14e | ||
|
|
4854b34102 | ||
|
|
5373385be8 | ||
|
|
6c102e57b0 | ||
|
|
768aad2447 | ||
|
|
2a3342acec | ||
|
|
820439dde2 | ||
|
|
fa888a1fe1 | ||
|
|
3c12cbcae0 | ||
|
|
9bd7986348 | ||
|
|
6072ff780e | ||
|
|
682cca7d64 | ||
|
|
142ffb6385 | ||
|
|
179bdd69fa | ||
|
|
bbe078f6ae | ||
|
|
a5064d775f | ||
|
|
e250d0bd93 | ||
|
|
d3cba11f38 | ||
|
|
7ef88eeb85 | ||
|
|
931db3bc2f | ||
|
|
53aad51abf | ||
|
|
8bbe090b5c | ||
|
|
c149516850 | ||
|
|
426eb6f081 | ||
|
|
97220d8a12 | ||
|
|
1a7e160ca7 | ||
|
|
d1c2743135 | ||
|
|
71fc30310d | ||
|
|
e2dbb2c75c | ||
|
|
fae79aad48 | ||
|
|
4a7fe047d3 | ||
|
|
692772b640 | ||
|
|
f01814830a | ||
|
|
6af4a9e4af | ||
|
|
9fa1b91220 | ||
|
|
b25de230e2 | ||
|
|
ee63eedd77 | ||
|
|
3ab8902748 | ||
|
|
d0f489236e | ||
|
|
9c996db925 | ||
|
|
12fe395654 | ||
|
|
87e98bd000 | ||
|
|
4417f20d9a | ||
|
|
b9749b23b6 | ||
|
|
866c407033 | ||
|
|
7c94c072e9 | ||
|
|
76ae2acfd8 | ||
|
|
f549f2420d | ||
|
|
084a40dd7d | ||
|
|
1873bc6ab1 | ||
|
|
f8bc79285c | ||
|
|
6a17a8cbac | ||
|
|
5664835ece | ||
|
|
05443b36d2 | ||
|
|
92e616c8ab | ||
|
|
c6d67052ab | ||
|
|
ccaf9ebef4 | ||
|
|
4acd61aeec | ||
|
|
12d6686d3a | ||
|
|
7e004ae22a | ||
|
|
50a39fafc8 | ||
|
|
a22f40a4d3 | ||
|
|
66f1f4f5bb | ||
|
|
b40993301a | ||
|
|
95f38fdaf0 | ||
|
|
f8d56c599a | ||
|
|
0a2126cb7a | ||
|
|
e1ec163df1 | ||
|
|
f8d9f69304 | ||
|
|
c3dfc5ba55 | ||
|
|
270da5e314 | ||
|
|
81c2b5fa2b | ||
|
|
93c88c666f | ||
|
|
45900873d6 | ||
|
|
b7046746c2 | ||
|
|
031ef4a0d2 | ||
|
|
782b31d708 | ||
|
|
3f5db2bdf8 | ||
|
|
f734273127 | ||
|
|
81d0a1472a | ||
|
|
8dd10215ba | ||
|
|
93888c771e | ||
|
|
56fecb2acf | ||
|
|
1a423ebcd7 | ||
|
|
064711676a | ||
|
|
f18d3fbb72 | ||
|
|
a55c7eaa4a | ||
|
|
e2d22de650 | ||
|
|
d8db107b1d | ||
|
|
970c5fe1a6 | ||
|
|
8871a2fa92 | ||
|
|
5006863a28 | ||
|
|
c68338e04f | ||
|
|
9434ebafc9 | ||
|
|
6f6688d9f7 | ||
|
|
7759f2b6a1 | ||
|
|
6e154e7cee | ||
|
|
c02bd0de60 | ||
|
|
c214de3745 | ||
|
|
eaa18c1fcd | ||
|
|
6bc536c9f5 | ||
|
|
a482d110b4 | ||
|
|
62d8c48876 | ||
|
|
e3c70a6bae | ||
|
|
c6210a335b | ||
|
|
68cac7cd8d | ||
|
|
bb8b77bf2b | ||
|
|
cba309a0c0 | ||
|
|
203901ab68 | ||
|
|
9a41c0163b | ||
|
|
080a53305e | ||
|
|
72fa987cbf | ||
|
|
5e8f5af9e5 | ||
|
|
a0da5f8a04 | ||
|
|
9bfc5fdcd0 | ||
|
|
6e63b2898f | ||
|
|
104fdb252d | ||
|
|
a5a2431862 | ||
|
|
b1bcf6fb22 | ||
|
|
1bf6d687de | ||
|
|
5afc1a8426 | ||
|
|
9345c5817f | ||
|
|
da39ef1fe1 | ||
|
|
7fd62c0521 | ||
|
|
71d739a51e | ||
|
|
b6c2e7d426 | ||
|
|
a32d343c85 | ||
|
|
aeb31e27bc | ||
|
|
d00025748d | ||
|
|
a57921536a | ||
|
|
42302ee9b4 | ||
|
|
7c16f21282 | ||
|
|
47cd6ed172 | ||
|
|
1e7e092b20 | ||
|
|
fb1af816bd | ||
|
|
5d4ba0c34e | ||
|
|
b6d6d1447f | ||
|
|
f253e32fcf | ||
|
|
4787211262 | ||
|
|
0cebb32e16 | ||
|
|
d8f4cf294a | ||
|
|
41c58a87db | ||
|
|
267cfc6c79 | ||
|
|
c0d269dc29 | ||
|
|
ad5dce3502 | ||
|
|
9608d2da6f | ||
|
|
d67027bf10 | ||
|
|
ec1887864a | ||
|
|
cd0a2db6d2 | ||
|
|
ca7f2b6bb4 | ||
|
|
1ca2958b88 | ||
|
|
aa5f72e822 | ||
|
|
043c260894 | ||
|
|
2b8bfc61e5 | ||
|
|
20ddec95d1 | ||
|
|
b0d4d06151 | ||
|
|
72c614c38d | ||
|
|
ddd541db47 | ||
|
|
86cd372634 | ||
|
|
e12af3346a | ||
|
|
524eac8eff | ||
|
|
57b8574438 | ||
|
|
a5938760b0 | ||
|
|
2a546013ba | ||
|
|
8a015a6cb7 | ||
|
|
1a0216d3f1 | ||
|
|
7e821aaa94 | ||
|
|
433814b965 | ||
|
|
d64bccb371 | ||
|
|
617f00d148 | ||
|
|
011a3b99d5 | ||
|
|
834cab4048 | ||
|
|
841e7fcc0e | ||
|
|
e920908386 | ||
|
|
418bf748bc | ||
|
|
91708c91f6 | ||
|
|
b39a907034 | ||
|
|
57d889d6b1 | ||
|
|
9ebb13e6eb | ||
|
|
c34c4debd7 | ||
|
|
8814e22684 | ||
|
|
78d913a97d | ||
|
|
2f0dcf4edc | ||
|
|
2be4abd701 | ||
|
|
b36b8f83f6 | ||
|
|
f9a0b8ae70 | ||
|
|
d82a6cb235 | ||
|
|
563a25a8b3 | ||
|
|
0c61f042fd | ||
|
|
d189f67974 | ||
|
|
b2c75a6476 | ||
|
|
1de7967a25 | ||
|
|
3591cf3a12 | ||
|
|
424861117d | ||
|
|
bc5d579da8 | ||
|
|
2e45089ac4 | ||
|
|
faaa4a7e41 | ||
|
|
ca3e3c1b06 | ||
|
|
5d57884434 | ||
|
|
49be84943d | ||
|
|
ca4e1df93c | ||
|
|
bf14218920 | ||
|
|
83f5fd8286 | ||
|
|
11fd8b4a06 | ||
|
|
d5d3234fab | ||
|
|
b4fd9a92a1 | ||
|
|
2a4abd365d | ||
|
|
fac1614754 | ||
|
|
b1b9817c5d | ||
|
|
7c4652cc16 | ||
|
|
acbe281411 | ||
|
|
fd710e312e | ||
|
|
237c9d2ad9 | ||
|
|
5bbb4298d4 | ||
|
|
96eae3a010 | ||
|
|
815bc9a462 | ||
|
|
6b6816d5c4 | ||
|
|
9aa3dc8721 | ||
|
|
e307ff1bc0 | ||
|
|
5ba1277bc6 | ||
|
|
d59ab30e97 | ||
|
|
3a461afe2b | ||
|
|
118af15fda | ||
|
|
c1b2445e4e | ||
|
|
2ea1819330 | ||
|
|
735b4e8efd | ||
|
|
95201415ad | ||
|
|
c865cd2a92 | ||
|
|
ee9c9b6cc4 | ||
|
|
675f88fdcf | ||
|
|
f0514d9184 | ||
|
|
0477aaf57b | ||
|
|
eac3accf28 | ||
|
|
1d2361804a | ||
|
|
294c6fce96 | ||
|
|
5fa0efb987 | ||
|
|
9240563bd9 | ||
|
|
eb675ba4c8 | ||
|
|
e2a7130e41 | ||
|
|
5c3cb24f7a | ||
|
|
06ea59bc4b | ||
|
|
db66460cc5 | ||
|
|
cd78156f1e | ||
|
|
df515d1752 | ||
|
|
b64d478e29 | ||
|
|
d4431cf4c6 | ||
|
|
2346e1ae15 | ||
|
|
a8e09c3c68 | ||
|
|
8f331d44a3 | ||
|
|
e75b9bf3b7 | ||
|
|
aa413cb2ba | ||
|
|
caa7c66928 | ||
|
|
d65d08cc92 | ||
|
|
ba1de533d0 | ||
|
|
5817b5739c | ||
|
|
7bafc16ab3 | ||
|
|
c4ea7ee755 | ||
|
|
7893c66a21 | ||
|
|
3fb8d58b92 | ||
|
|
e5f2c53ab4 | ||
|
|
f450e08565 | ||
|
|
5fbf79f7bb | ||
|
|
baebc923ae | ||
|
|
9145988f99 | ||
|
|
870dbacfc0 | ||
|
|
3df1d271c4 | ||
|
|
e76ec12e0a | ||
|
|
7fb41ca544 | ||
|
|
403f29b5fd | ||
|
|
ee13affff3 | ||
|
|
86dfb17197 | ||
|
|
924b21f4ac | ||
|
|
8e616b1053 | ||
|
|
8d305598c6 | ||
|
|
20b069df40 | ||
|
|
9a84dddba5 | ||
|
|
0aa661f605 | ||
|
|
53a6a0a100 | ||
|
|
dd97fa24d4 | ||
|
|
6e5f467c6a | ||
|
|
1648440ff0 | ||
|
|
0ee4d3d7c9 | ||
|
|
5969e90906 | ||
|
|
a257201203 | ||
|
|
3574a5f2c0 | ||
|
|
3b48ad6bcf | ||
|
|
465a750add | ||
|
|
f01f613a74 | ||
|
|
6eefdb02ac | ||
|
|
e282cfc306 | ||
|
|
09b9b08e16 | ||
|
|
c6574552b4 | ||
|
|
b472d71283 | ||
|
|
85271a01ac | ||
|
|
cb3c931d7b | ||
|
|
1ef77d8221 | ||
|
|
53a062e477 | ||
|
|
f38d95f12c | ||
|
|
cb4e9d6cca | ||
|
|
31a0f0b03e | ||
|
|
38c487570e | ||
|
|
02440b06f9 | ||
|
|
a5fa9e3d05 | ||
|
|
2f09b1be65 | ||
|
|
d966ee4185 | ||
|
|
9b6375ccb6 | ||
|
|
47a022a475 | ||
|
|
ffba89f8d6 | ||
|
|
4a1fbdf8b6 | ||
|
|
dda7fed28f | ||
|
|
1f2d98ea0e | ||
|
|
7a1a30c84e | ||
|
|
7f32c25ed0 | ||
|
|
007d2a0244 | ||
|
|
1ff6a2d8d0 | ||
|
|
74a304ed3a | ||
|
|
6348ad392d | ||
|
|
1bd51431df | ||
|
|
822dbf177a | ||
|
|
017b3b9a47 | ||
|
|
abecd7cc82 | ||
|
|
3abcdbccd4 | ||
|
|
e600c92777 | ||
|
|
1ac6d64fd5 | ||
|
|
c186b96637 | ||
|
|
36cbd28e05 | ||
|
|
3b84d785bc | ||
|
|
bcded6ff42 | ||
|
|
8703400ee9 | ||
|
|
408808e54d | ||
|
|
d998270f22 | ||
|
|
6f431b6b1b | ||
|
|
acc08e7f30 | ||
|
|
e48b4e3b6f | ||
|
|
580560b300 | ||
|
|
0a4d4ff021 | ||
|
|
66a8b12322 | ||
|
|
1be964d42e | ||
|
|
3fb09c9303 | ||
|
|
b451b16592 | ||
|
|
3aebd6125f | ||
|
|
df1ebcf430 | ||
|
|
2d383e548c | ||
|
|
31312aaabc | ||
|
|
a84796793f | ||
|
|
fbf3c70b40 | ||
|
|
ba6f6e9e4f | ||
|
|
c7d4ac8120 | ||
|
|
c1bd73527f | ||
|
|
05f75c5206 | ||
|
|
6475015586 | ||
|
|
3a1e51ce13 | ||
|
|
d7a885939f | ||
|
|
3b9467c589 | ||
|
|
fde673846b | ||
|
|
98ff642747 | ||
|
|
153338799c | ||
|
|
f24e3636f2 | ||
|
|
393768688e | ||
|
|
d71d2b2f3a | ||
|
|
aa87dbcb0f | ||
|
|
6584856e59 | ||
|
|
8e324f78b9 | ||
|
|
af2cd6c3ea | ||
|
|
b894ded1da | ||
|
|
7178b77e33 | ||
|
|
b50de5df02 | ||
|
|
d8ba960367 | ||
|
|
aa351de483 | ||
|
|
5ef4b427f4 | ||
|
|
2b3b345631 | ||
|
|
f3e6ac1869 | ||
|
|
103ea1da45 | ||
|
|
47d66db957 | ||
|
|
6fada4d97a | ||
|
|
48bb8ab7af | ||
|
|
48b10a682c | ||
|
|
042f32d6d7 | ||
|
|
1ebb7a8a84 | ||
|
|
dff99286a0 | ||
|
|
c0733fbd6c | ||
|
|
6b39ba9eda | ||
|
|
df04878acc | ||
|
|
2686facd07 | ||
|
|
9c2b39a976 | ||
|
|
ad178ae388 | ||
|
|
a45162abb5 | ||
|
|
959c2a0a72 | ||
|
|
c1831076be | ||
|
|
e55242b0aa | ||
|
|
dd04539698 | ||
|
|
533c0e05ad | ||
|
|
537d020e5d | ||
|
|
351b59c701 | ||
|
|
71b78df80d | ||
|
|
b840633886 | ||
|
|
c6868cfe74 | ||
|
|
966a773582 | ||
|
|
60969cbdf3 | ||
|
|
1de03ef582 | ||
|
|
392fbcdca7 | ||
|
|
e61f69bb3f | ||
|
|
7e4d76ba50 | ||
|
|
4990bc8a8d | ||
|
|
86b6d45c5d | ||
|
|
3f2463d7dd | ||
|
|
ce59881ff5 | ||
|
|
95023ed66d | ||
|
|
e76d62fd17 | ||
|
|
eb193c5571 | ||
|
|
e045622d4e | ||
|
|
6cf6add6c0 | ||
|
|
e7622066bd | ||
|
|
800eb0e544 | ||
|
|
5f6b3aaff9 | ||
|
|
0a5dcbb6de | ||
|
|
1c8eb7a37f | ||
|
|
d80230e4aa | ||
|
|
30e77d7c98 | ||
|
|
d60d9f439a | ||
|
|
ac30d3738a | ||
|
|
6aad9f8005 | ||
|
|
7fe128322b | ||
|
|
9fd72b9ba8 | ||
|
|
6a4588d35f | ||
|
|
473737daaa | ||
|
|
c7e9e858d1 | ||
|
|
5a2025b86f | ||
|
|
d0b0433757 | ||
|
|
d879cfff92 | ||
|
|
4c00f288d2 | ||
|
|
000d05b462 | ||
|
|
2b5f93b089 | ||
|
|
eecbbc3392 | ||
|
|
92d37b3380 | ||
|
|
7e3e5f670d | ||
|
|
a70407e6e2 | ||
|
|
d60661b832 | ||
|
|
15401e27bb | ||
|
|
226b2f6a13 | ||
|
|
9ef8e7e0a0 | ||
|
|
dfabf75f97 | ||
|
|
70c4e1fc68 | ||
|
|
cc00cc5f7c | ||
|
|
e2a912e048 | ||
|
|
9eacd46b90 | ||
|
|
6ff33d9292 | ||
|
|
6b987491e8 | ||
|
|
505baf58aa | ||
|
|
197d5ae79d | ||
|
|
55f576c6a6 | ||
|
|
ece872da0f | ||
|
|
972fe006e3 | ||
|
|
83079a7bee | ||
|
|
e7dfc78299 | ||
|
|
977eaa489e | ||
|
|
6b5f0435d2 | ||
|
|
f849232aae | ||
|
|
6df33ab0e0 | ||
|
|
5dbadfe64a | ||
|
|
69ece6e75d | ||
|
|
05e5562d17 | ||
|
|
de73e0dbca | ||
|
|
b9882159d7 | ||
|
|
61740cd4da | ||
|
|
75555da65c | ||
|
|
ec5eaef329 | ||
|
|
105074a197 | ||
|
|
35887f441f | ||
|
|
56496de266 | ||
|
|
ee0246f4a9 | ||
|
|
329221d5ba | ||
|
|
8d2bb87fb0 | ||
|
|
982a96dc4a | ||
|
|
dfe71a1368 | ||
|
|
00563fcd57 | ||
|
|
cc6d866e92 | ||
|
|
662cdbc0f1 | ||
|
|
d5ba19e9d7 | ||
|
|
f6c4ac0d13 | ||
|
|
95d5bd9fa3 | ||
|
|
0dc85d2a26 | ||
|
|
818b8f50de | ||
|
|
b7ef813c10 | ||
|
|
2dc724b259 | ||
|
|
cfb63b946a | ||
|
|
614fe5d123 | ||
|
|
1f3848c479 | ||
|
|
21b23754fb | ||
|
|
c982f01623 | ||
|
|
8d7b5f2cd2 | ||
|
|
486242ccde | ||
|
|
007764bf32 | ||
|
|
d83288e41b | ||
|
|
b506de82e7 | ||
|
|
90aecc35e5 | ||
|
|
672184db5f | ||
|
|
5d5c91435f | ||
|
|
0cf2bf774a | ||
|
|
90d599f0f6 | ||
|
|
6d7d25fd32 | ||
|
|
89964087df | ||
|
|
c2aaa714fc | ||
|
|
4f49013024 | ||
|
|
841cdced78 | ||
|
|
438ada5443 | ||
|
|
3513f4811b | ||
|
|
902cca8ec9 | ||
|
|
49c06cb235 | ||
|
|
0dbcd6e661 | ||
|
|
d02a1e6aa1 | ||
|
|
996e95ed25 | ||
|
|
d20e1a3975 | ||
|
|
d24a4a75b0 | ||
|
|
cd7a709a52 | ||
|
|
861ed47bd4 | ||
|
|
49b06a0ae3 | ||
|
|
46de850836 | ||
|
|
c6da77a30d | ||
|
|
84497df0ef | ||
|
|
d45cdeb9ad | ||
|
|
2b8574558e | ||
|
|
50352c57e2 | ||
|
|
374aa80972 | ||
|
|
a1a66f6c6c | ||
|
|
18e3f5da82 | ||
|
|
1747596e9d | ||
|
|
211d1d0454 | ||
|
|
442e627ebf | ||
|
|
c5023cf92e | ||
|
|
f3c2c57f2f | ||
|
|
817969dd8b | ||
|
|
dbbecbf41b | ||
|
|
456fc59036 | ||
|
|
0027d9c146 | ||
|
|
869750bcd2 | ||
|
|
7039a328ba | ||
|
|
7ad7793c14 | ||
|
|
3d1a4a6118 | ||
|
|
7a2eba2709 | ||
|
|
e8443d3679 | ||
|
|
83a9ba6026 | ||
|
|
5f466ecfab | ||
|
|
2842a2dd18 | ||
|
|
f5a9707f87 | ||
|
|
648ccbb0bb | ||
|
|
6414650fe0 | ||
|
|
38a3814bbf | ||
|
|
499a61f3ab | ||
|
|
62a1d41544 | ||
|
|
07377a75e2 | ||
|
|
dbd287ce00 | ||
|
|
971edca6b3 | ||
|
|
5c988c2ba0 | ||
|
|
029d6ccdd3 | ||
|
|
0aa2a089cd | ||
|
|
d642c6edd5 | ||
|
|
ef6c5b4b10 | ||
|
|
28efd0adf4 | ||
|
|
fbbceb9ba0 | ||
|
|
adea31703d | ||
|
|
8e8e728a62 | ||
|
|
8057b841d9 | ||
|
|
e02c16a0cb | ||
|
|
6989005c97 | ||
|
|
405c5bf75e | ||
|
|
703b1a82b1 | ||
|
|
9d76728323 | ||
|
|
da6eccbfc8 | ||
|
|
e38e444584 | ||
|
|
6eb9ee9ff3 | ||
|
|
c99c85379f | ||
|
|
bd8809da27 | ||
|
|
b5784ffa5f | ||
|
|
2a4f3b2290 | ||
|
|
ecf379665c | ||
|
|
007d15c142 | ||
|
|
7310cb4070 | ||
|
|
ef03642949 | ||
|
|
d223c17039 | ||
|
|
4f10888532 | ||
|
|
21b9094220 | ||
|
|
1f965bacc3 | ||
|
|
8b077e2524 | ||
|
|
543c79bf90 | ||
|
|
02934f0cd2 | ||
|
|
65faf62727 | ||
|
|
beab16ccef | ||
|
|
9d5e412a70 | ||
|
|
e97285d861 | ||
|
|
b53a33b90f | ||
|
|
adb51ca23c | ||
|
|
93a8587b78 | ||
|
|
2369ac1bcb | ||
|
|
3404165b95 | ||
|
|
c2d949e101 | ||
|
|
d3c91087e3 | ||
|
|
b795045d2a | ||
|
|
5701b22ce4 | ||
|
|
86ce5fd16c | ||
|
|
b6af887650 | ||
|
|
d401003cfc | ||
|
|
77e5bb115a | ||
|
|
a3473a60eb | ||
|
|
bc31c14df0 | ||
|
|
432946917c | ||
|
|
734cfd7f6b | ||
|
|
a3cd5903f0 | ||
|
|
fa0a102368 | ||
|
|
0df4786fe7 | ||
|
|
5f93e66fd4 | ||
|
|
63a996279d | ||
|
|
4ecef3845e | ||
|
|
4403bbe04e | ||
|
|
6799a03665 | ||
|
|
d2b36ef7f5 | ||
|
|
cbd4179771 | ||
|
|
c048ebabbe | ||
|
|
1eac87dfa5 | ||
|
|
1fdca35cb1 | ||
|
|
1a730ed138 | ||
|
|
9843d9afab | ||
|
|
624f81eece | ||
|
|
695cf90960 | ||
|
|
7db2a571f4 | ||
|
|
7ff16f42c2 | ||
|
|
7ee08a9607 | ||
|
|
3e4a538051 | ||
|
|
40294bf2aa | ||
|
|
f601d73d1d | ||
|
|
b848d573e1 | ||
|
|
cc45d84576 | ||
|
|
922782efff | ||
|
|
900c1c5529 | ||
|
|
f805641c10 | ||
|
|
4ec4085cab | ||
|
|
0e191b52d4 | ||
|
|
1720b469d4 | ||
|
|
6d32e25bf6 | ||
|
|
82cb05e5d3 | ||
|
|
eee428afe5 | ||
|
|
4e72d39123 | ||
|
|
3d5dfe1810 | ||
|
|
c07589174d | ||
|
|
2f4e57a199 | ||
|
|
3a70743e87 | ||
|
|
39a9d51262 | ||
|
|
3cba7a04ae | ||
|
|
65cf3c1192 | ||
|
|
67bca4fa92 | ||
|
|
7ed0e8f76a | ||
|
|
3e45f6cfa0 | ||
|
|
4d6a8f11a0 | ||
|
|
2769794194 | ||
|
|
170982670e | ||
|
|
dc4de4894a | ||
|
|
c28831166e | ||
|
|
0fa36f3315 | ||
|
|
8c220f972c | ||
|
|
ee70597270 | ||
|
|
e4120d8a6c | ||
|
|
90166a6762 | ||
|
|
1ac239a535 | ||
|
|
dffd6e4f8a | ||
|
|
e9bfb59882 | ||
|
|
8872709129 | ||
|
|
3f4bbe0254 | ||
|
|
2a0ec34be8 | ||
|
|
496227a070 | ||
|
|
adff61483a | ||
|
|
2134ab0795 | ||
|
|
0e9d23116e | ||
|
|
ab9c3caa7a | ||
|
|
8e1853b8b8 | ||
|
|
749479c013 | ||
|
|
533691a6eb | ||
|
|
0f3c61e24e | ||
|
|
27c460e18b | ||
|
|
76e55d41f0 | ||
|
|
85a1996b1f | ||
|
|
a939fef597 | ||
|
|
eba5f529b4 | ||
|
|
a9e7516ae5 | ||
|
|
d785948113 | ||
|
|
77c0f2a80a | ||
|
|
e2febf0616 | ||
|
|
fb3b5090df | ||
|
|
6623fb67f1 | ||
|
|
9d067b2d3c | ||
|
|
47dbeb95ff | ||
|
|
7d64dcef9e | ||
|
|
866d996c57 | ||
|
|
e85aa158d5 | ||
|
|
af3f6a837f | ||
|
|
e519a40b96 | ||
|
|
54191082bf | ||
|
|
924ea247db | ||
|
|
9f770f5106 | ||
|
|
e241f72315 | ||
|
|
fa208cf299 | ||
|
|
a7e7d2a7c2 | ||
|
|
99a9d007bd | ||
|
|
9b174da0a3 | ||
|
|
627b67ed9c | ||
|
|
cf0eaecfb1 | ||
|
|
be99cc147f | ||
|
|
e85d2ba2cf | ||
|
|
f6ea2a23b1 | ||
|
|
0785c0f7d3 | ||
|
|
3e4310c8c8 | ||
|
|
87c856e6bd | ||
|
|
6dfc18db5c | ||
|
|
6cbca3a38a | ||
|
|
968e75d5b8 | ||
|
|
bbd30f7c20 | ||
|
|
1ab12e40c7 | ||
|
|
b6972ae532 | ||
|
|
160e779658 | ||
|
|
c4ca9e1986 | ||
|
|
fc1092ad79 | ||
|
|
9ece420781 | ||
|
|
df8aa3ff05 | ||
|
|
13c2f92491 | ||
|
|
7e77598a7c | ||
|
|
05080f2575 | ||
|
|
e22bbce0e2 | ||
|
|
ed4333f06f | ||
|
|
39e7f2c5cb | ||
|
|
ba721cf789 | ||
|
|
b77fd1f9df | ||
|
|
51fe6ae058 | ||
|
|
0ffac72c3d | ||
|
|
9eb5e6fe2b | ||
|
|
3d78e09cce | ||
|
|
7087284a9a | ||
|
|
3a58c581db | ||
|
|
66e159d87f | ||
|
|
f73c8cccfe | ||
|
|
8289062b7c | ||
|
|
6ef6e0913f | ||
|
|
0a777bafa2 | ||
|
|
10f9a3f89c | ||
|
|
f48424e371 | ||
|
|
dbfdef4a37 | ||
|
|
c5d80c4635 | ||
|
|
2fe9a1b7ba | ||
|
|
d7b09cd884 | ||
|
|
4b3c439243 | ||
|
|
3016bcf312 | ||
|
|
fa152a3def | ||
|
|
d3afab8273 | ||
|
|
2ce51981fc | ||
|
|
9817a97775 | ||
|
|
b4c6ecaa43 | ||
|
|
c181c1cb21 | ||
|
|
7cc599691d | ||
|
|
99c3104086 | ||
|
|
ca70f169dd | ||
|
|
ce6f9f4945 | ||
|
|
bcdd06c6c7 | ||
|
|
e0bcbe585e | ||
|
|
cc3c165b03 | ||
|
|
9ff9ac72b8 | ||
|
|
97a5da83a0 | ||
|
|
454f59e06f | ||
|
|
fa69852bc1 | ||
|
|
dc7263dc9e | ||
|
|
75cefae6b4 | ||
|
|
4f8c9ca73b | ||
|
|
caec6c87e9 | ||
|
|
a6ccc7e263 | ||
|
|
ed63a3af9d | ||
|
|
82a129492a | ||
|
|
2bb9b9faf5 | ||
|
|
cc8e538c5c | ||
|
|
1ae7212ab9 | ||
|
|
eccb8e91a1 | ||
|
|
c2a982333d | ||
|
|
152c5b3f06 | ||
|
|
8324b9ee2c | ||
|
|
fd77d8493b | ||
|
|
92f24c181d | ||
|
|
4a618befec | ||
|
|
d0aaf6b995 | ||
|
|
78203efec8 | ||
|
|
e1e52a2b6c | ||
|
|
bbce019e1f | ||
|
|
2b8b549531 | ||
|
|
dafe48f551 | ||
|
|
2690e144de | ||
|
|
5d02703c6f | ||
|
|
77a428cced | ||
|
|
05e7ac85e3 | ||
|
|
5fd2f31989 | ||
|
|
0d116a24db | ||
|
|
8a411ee762 | ||
|
|
58c0e3f529 | ||
|
|
0c480724b4 | ||
|
|
fc8e339e24 | ||
|
|
317ad26b7e | ||
|
|
4838f6a790 | ||
|
|
7a47a05a8a | ||
|
|
768b5dd858 | ||
|
|
70448bead6 | ||
|
|
fe2ac2618f | ||
|
|
d52892536f | ||
|
|
9a446139e8 | ||
|
|
014bbea9c5 | ||
|
|
d4386e47d8 | ||
|
|
53435db67b | ||
|
|
9a0c08391d | ||
|
|
a4f31a4ba2 | ||
|
|
dd6325c370 | ||
|
|
d889597d8d | ||
|
|
97060bb3df | ||
|
|
a65dcc4d82 | ||
|
|
ec1f2825a3 | ||
|
|
dbdffe42cb | ||
|
|
9914bb59c9 | ||
|
|
034f35f406 | ||
|
|
843d8cc562 | ||
|
|
97b9374b49 | ||
|
|
125cb784d6 | ||
|
|
decd49ffba | ||
|
|
b39021ec8c | ||
|
|
43ad149022 | ||
|
|
2e33319f15 | ||
|
|
53396e1fbd | ||
|
|
0544f7b57c | ||
|
|
05ea7d8cad | ||
|
|
7c08110482 | ||
|
|
e1d98d30e0 | ||
|
|
15156fea65 | ||
|
|
f6cf7c683b | ||
|
|
a1dd71ed8e | ||
|
|
447b7a35cc | ||
|
|
17e7119c51 | ||
|
|
b362818ab8 | ||
|
|
df58df2f0b | ||
|
|
cfc603f54a | ||
|
|
f300916895 | ||
|
|
f06e55f876 | ||
|
|
eb9ced023d | ||
|
|
c2cc19d860 | ||
|
|
3a92abc171 | ||
|
|
bd218e60bc | ||
|
|
666b68b3c9 | ||
|
|
12bcdf7ee7 | ||
|
|
6d69027606 | ||
|
|
9abf84847a | ||
|
|
a96a7ab047 | ||
|
|
1a78e93074 | ||
|
|
8599f9d962 | ||
|
|
2f67ab9c46 | ||
|
|
f707f2b47f | ||
|
|
60bd4d527e | ||
|
|
a8c3e46cbb | ||
|
|
57d7ae7c5d | ||
|
|
188285b281 | ||
|
|
d57f95f1d1 | ||
|
|
ebf144fb29 | ||
|
|
c873d40552 | ||
|
|
70a555f5ae | ||
|
|
ed9469d29f | ||
|
|
dcde01e817 | ||
|
|
e1d433d7c1 | ||
|
|
8cd326a2d9 | ||
|
|
49fadf233c | ||
|
|
79a24a38c3 | ||
|
|
3f9af8db03 | ||
|
|
59ca1eaf18 | ||
|
|
f2e7fa038e | ||
|
|
6e1d4791e4 | ||
|
|
437ca845cf | ||
|
|
1fff05a1b3 | ||
|
|
4b610493ea | ||
|
|
25824ec712 | ||
|
|
1a3973781e | ||
|
|
d6cd3ded85 | ||
|
|
da252450dc | ||
|
|
1039fd8f26 | ||
|
|
976567d167 | ||
|
|
cc4e2832ab | ||
|
|
c55073e22f | ||
|
|
19a8442b18 | ||
|
|
a6c0e029bf | ||
|
|
6f7dc93da9 | ||
|
|
e9e6f18d96 | ||
|
|
ac744a4bf8 | ||
|
|
f3b7bec0d2 | ||
|
|
017113fab2 | ||
|
|
04078c93d0 | ||
|
|
547705eee2 | ||
|
|
ded609d173 | ||
|
|
002351597a | ||
|
|
7d9c360c89 | ||
|
|
3c6c31fe23 | ||
|
|
41942cd0e8 | ||
|
|
4b321b16b0 | ||
|
|
ea952eb2de | ||
|
|
99a907f780 | ||
|
|
55cec71794 | ||
|
|
3c7968ad39 | ||
|
|
d6dd9bea7f | ||
|
|
fa93a8146a | ||
|
|
c36127dae2 | ||
|
|
89c9a8fa37 | ||
|
|
fe86486377 | ||
|
|
ad187f7e21 | ||
|
|
23c9a321eb | ||
|
|
d68edc3610 | ||
|
|
5ff1ca3601 | ||
|
|
7824e01dae | ||
|
|
7decc18c6e | ||
|
|
74f18bf830 | ||
|
|
3ae45f670b | ||
|
|
66e8e60df6 | ||
|
|
11df709295 | ||
|
|
6b4af86e93 | ||
|
|
56f95190bc | ||
|
|
a314830789 | ||
|
|
23bc5f9630 | ||
|
|
9b4781ce18 | ||
|
|
c090144e53 | ||
|
|
c9cc369f1b | ||
|
|
b9fd1de57a | ||
|
|
52ad6d126f | ||
|
|
893ea3031d | ||
|
|
de61026d65 | ||
|
|
b4a073fd41 | ||
|
|
16b7a6d7d0 | ||
|
|
dcfb0a0f1f | ||
|
|
fc1f520157 | ||
|
|
2283486834 | ||
|
|
bcef031062 | ||
|
|
577f3246b1 | ||
|
|
f9d9ec1879 | ||
|
|
a1f8df61c4 | ||
|
|
b16f815afb | ||
|
|
104176e6c6 | ||
|
|
4f7b214f80 | ||
|
|
07e6387f6b | ||
|
|
b0e4a10754 | ||
|
|
e2d02ab5b8 | ||
|
|
a24ac0aed0 | ||
|
|
63dbabfc1a | ||
|
|
4c3e7a460f | ||
|
|
e437cd60af | ||
|
|
500495a9f4 | ||
|
|
1adde8f96c | ||
|
|
cc37fd3667 | ||
|
|
95848e2010 | ||
|
|
b996771d69 | ||
|
|
aa742e4e57 | ||
|
|
bb3938d55b | ||
|
|
111ad534c3 | ||
|
|
79d0374ca6 | ||
|
|
68dec9f1bd | ||
|
|
89cfb1c4f3 | ||
|
|
093fc5db82 | ||
|
|
83e4f8d0ae | ||
|
|
13770b909f | ||
|
|
98a69d40fc | ||
|
|
31769bd611 | ||
|
|
acfdc5bfee | ||
|
|
d62903a681 | ||
|
|
23b7300d39 | ||
|
|
ebf7c3a7fa | ||
|
|
c40459bfcc | ||
|
|
e7b5e6e67f | ||
|
|
efe610296d | ||
|
|
4348dcd2d0 | ||
|
|
67d555dd8f | ||
|
|
f229d201a6 | ||
|
|
206740d4be | ||
|
|
c8f46ae8cb | ||
|
|
1a345f8a80 | ||
|
|
2c11535102 | ||
|
|
9ac81ff249 | ||
|
|
8efb8cbaec | ||
|
|
8675a909c5 | ||
|
|
f762610be3 | ||
|
|
23878f8525 | ||
|
|
d789a6545f | ||
|
|
e56d38a8bf | ||
|
|
1fd39ed4a0 | ||
|
|
f190b59da8 | ||
|
|
f609c35582 | ||
|
|
12ba22a968 | ||
|
|
7f3ec768d3 | ||
|
|
bd3a26d33e | ||
|
|
ce270b48fc | ||
|
|
7c12195130 | ||
|
|
db7886826b | ||
|
|
2568ec4881 | ||
|
|
e9be56c1ba | ||
|
|
1ebccf3971 | ||
|
|
5f37ed3fea | ||
|
|
f22c2ff39c | ||
|
|
6bf15bb925 | ||
|
|
5fc5b58188 | ||
|
|
3b77c43899 | ||
|
|
93377e9b1f | ||
|
|
4452c32d00 | ||
|
|
a6e1684fe2 | ||
|
|
25283f33da | ||
|
|
215e1c2477 | ||
|
|
442d04a511 | ||
|
|
7005ea8b71 | ||
|
|
1106f5b133 | ||
|
|
32af0659a4 | ||
|
|
9c27bf0ebd | ||
|
|
269a6f4b8d | ||
|
|
0f6982bbe6 | ||
|
|
afae4e412f | ||
|
|
ed1b38ea91 | ||
|
|
cb7f5ddb29 | ||
|
|
23d9384d58 | ||
|
|
77530b2e38 | ||
|
|
6ebda75c34 | ||
|
|
4dedf2a23f | ||
|
|
a386886cfe | ||
|
|
57a503f498 | ||
|
|
34d0ccf06f | ||
|
|
4dd793c40b | ||
|
|
a0cec7ba96 | ||
|
|
8580080825 | ||
|
|
d51aa273b6 | ||
|
|
b1b69dfd1a | ||
|
|
9b7a6b8b79 | ||
|
|
8a7c290ff7 | ||
|
|
59b1fef7ab | ||
|
|
66a7f248dd | ||
|
|
92725f3819 | ||
|
|
b0352fe719 | ||
|
|
2ae0b2d1b5 | ||
|
|
3faacf9598 | ||
|
|
e9e63aa6a5 | ||
|
|
e9d52dc4f1 | ||
|
|
e73d05592d | ||
|
|
7be8ad9e3f | ||
|
|
519cd93867 | ||
|
|
dfe0761503 | ||
|
|
88353197a6 | ||
|
|
58ed7992a0 | ||
|
|
d8d721272a | ||
|
|
9ffe3b38b2 | ||
|
|
62ad648322 | ||
|
|
64390a84fc | ||
|
|
d3502e5237 | ||
|
|
abc7212fff | ||
|
|
3b6afd04a4 | ||
|
|
84ff93f0f8 | ||
|
|
df3b1882ad | ||
|
|
b22a725980 | ||
|
|
3937da8d3a | ||
|
|
823f4da24f | ||
|
|
9b5b8ae91e | ||
|
|
12dd33911a | ||
|
|
1ecc6f00ca | ||
|
|
f997e30e8d | ||
|
|
bde1b0a610 | ||
|
|
2161560370 | ||
|
|
d433fe17da | ||
|
|
764c900e03 | ||
|
|
c48e3590b3 | ||
|
|
beb4464de3 | ||
|
|
1ec1a80dcc | ||
|
|
1cf870f45c | ||
|
|
1324aacb65 | ||
|
|
a7a8c73bdb | ||
|
|
b4a17af704 | ||
|
|
13e8a43ab1 | ||
|
|
1441afca01 | ||
|
|
c612097537 | ||
|
|
96adc87948 | ||
|
|
a15b86895e | ||
|
|
efa4dc34f4 | ||
|
|
9387a01a7d | ||
|
|
edcb4785bd | ||
|
|
7e8b6c72fa | ||
|
|
32cd03d43c | ||
|
|
d5be1a75f5 | ||
|
|
b4ae1be072 | ||
|
|
53f4c512bd | ||
|
|
caa368c66a | ||
|
|
231e3d4efb | ||
|
|
a5b66ac63a | ||
|
|
c4b7ad94e8 | ||
|
|
7eb9837675 | ||
|
|
8ac1d8fd72 | ||
|
|
5fe52f3af6 | ||
|
|
b8260ca22c | ||
|
|
9346dad1cf | ||
|
|
4fa84bff42 | ||
|
|
6cc179f821 | ||
|
|
7b764c6be1 | ||
|
|
bd469e1cf8 | ||
|
|
9c8877de47 | ||
|
|
d1c1cef388 | ||
|
|
a9100ca2cd | ||
|
|
7096840e76 | ||
|
|
450bbf5543 | ||
|
|
a60dd76705 | ||
|
|
29dc4eb3d1 | ||
|
|
15cf3a18a3 | ||
|
|
167fbed364 | ||
|
|
2e9ed95e9d | ||
|
|
28a8567dd7 | ||
|
|
d89b464a34 | ||
|
|
2bb1c58122 | ||
|
|
eb567220f1 | ||
|
|
ed4ced5369 | ||
|
|
929734e23b | ||
|
|
83ef4246aa | ||
|
|
48f7217c07 | ||
|
|
97b4ba4704 | ||
|
|
7e07e3424b | ||
|
|
90fdf26a1e | ||
|
|
89092f0c1f | ||
|
|
87f1ef3390 | ||
|
|
37f05808a8 | ||
|
|
1e731b00c5 | ||
|
|
2434a69cab | ||
|
|
328e7b8d15 | ||
|
|
6e8339abe6 | ||
|
|
f1b78d408d | ||
|
|
c4d9baabad | ||
|
|
6be84e28ca | ||
|
|
5ab88e7619 | ||
|
|
dafbd8aee3 | ||
|
|
47616d75b2 | ||
|
|
5733ccf9bc | ||
|
|
ba9015bf6b | ||
|
|
65ed9147ab | ||
|
|
e096c8b73a | ||
|
|
5b189d7a7e | ||
|
|
ef11e63725 | ||
|
|
54975d102e | ||
|
|
d85e8fc690 | ||
|
|
ddc193d482 | ||
|
|
0c2a8f4e96 | ||
|
|
6c6de45f44 | ||
|
|
e70d0f0cfb | ||
|
|
595520bd34 | ||
|
|
383bd60e21 | ||
|
|
308f0e52ca | ||
|
|
a2bb716d28 | ||
|
|
f781a8ed5f | ||
|
|
11bd1df123 | ||
|
|
ab2025e799 | ||
|
|
79aa82cbf1 | ||
|
|
07868fbe83 | ||
|
|
b81a15d2af | ||
|
|
6b21bd4499 | ||
|
|
5ba5e9d53a | ||
|
|
b0d3bcb716 | ||
|
|
1ad0e9a6b0 | ||
|
|
22959196d2 | ||
|
|
8e5d762bc9 | ||
|
|
7eef883f83 | ||
|
|
ef969213ad | ||
|
|
fd2465dcb3 | ||
|
|
69fdc31f3f | ||
|
|
a36ee39e7c | ||
|
|
a42d51bdb9 | ||
|
|
268cd40267 | ||
|
|
154b67292f | ||
|
|
8bfd70f18f | ||
|
|
900a49bdd1 | ||
|
|
6806e22931 | ||
|
|
f72ffa8d5c | ||
|
|
2aeaaa942a | ||
|
|
407a99c2ce | ||
|
|
1fd29622e6 | ||
|
|
9b25852c60 | ||
|
|
0c2e47e48f | ||
|
|
8958abf9bc | ||
|
|
716a125a81 | ||
|
|
ff710d4f49 | ||
|
|
33f62fc9c7 | ||
|
|
bd45eaa9a0 | ||
|
|
4b6f95ec84 | ||
|
|
b15518e675 | ||
|
|
f0fa05dfb4 | ||
|
|
ad405e64da | ||
|
|
36fd36bbc6 | ||
|
|
09d26c52c6 | ||
|
|
a712f1b0d1 | ||
|
|
cb0faf5955 | ||
|
|
e0a8ca6af3 | ||
|
|
c85ba6c523 | ||
|
|
163e7fde2b | ||
|
|
ed5f6fb8ab | ||
|
|
4c0089d9ec | ||
|
|
893cd03459 | ||
|
|
6a36dd31a1 | ||
|
|
c6a6d9af87 | ||
|
|
98594a649b | ||
|
|
b758fd6576 | ||
|
|
790caa6b77 | ||
|
|
f50647a44c | ||
|
|
de1dc32f3b | ||
|
|
1a9df5a049 | ||
|
|
9322ecd365 | ||
|
|
7e8230a2e9 | ||
|
|
19d0236976 | ||
|
|
673702591a | ||
|
|
dca1ac3c28 | ||
|
|
b1e8ad1cac | ||
|
|
4be6720d1d | ||
|
|
155d2b611c | ||
|
|
5c7cdaf757 | ||
|
|
d972724220 | ||
|
|
91cd3be265 | ||
|
|
4a7949a501 | ||
|
|
d29ebeedfb | ||
|
|
b132bf75bb | ||
|
|
c0b5d9745f | ||
|
|
1945c01df8 | ||
|
|
29be954fa3 | ||
|
|
cd8c0a0283 | ||
|
|
121b6eb0b7 | ||
|
|
415ce592a5 | ||
|
|
4f75363dc8 | ||
|
|
0d4e89ab00 | ||
|
|
ed427ced18 | ||
|
|
d092b189e7 | ||
|
|
f4f4bed53e | ||
|
|
d58e517145 | ||
|
|
d3ccad6010 | ||
|
|
426342b11c | ||
|
|
58075ac77b | ||
|
|
569cf91012 | ||
|
|
6875060a29 | ||
|
|
eaad2f24e1 | ||
|
|
420e948391 | ||
|
|
42e8e1c328 | ||
|
|
f294906d35 | ||
|
|
aa9ec54e4c | ||
|
|
d213103e86 | ||
|
|
5d8a5ea68e | ||
|
|
ecb82f94ae | ||
|
|
2a651f59bb | ||
|
|
c5e3e718ed | ||
|
|
4290f5b5f0 | ||
|
|
1f856aad23 | ||
|
|
fb3fcd3efb | ||
|
|
018fc5a795 | ||
|
|
fbaf4d843a | ||
|
|
bbd8189ddf | ||
|
|
60796a3343 | ||
|
|
c006e6c2ff | ||
|
|
302df74bf7 | ||
|
|
983543dd55 | ||
|
|
038e706b57 | ||
|
|
af49f8e133 | ||
|
|
22bfbf8d90 | ||
|
|
3eb9c1c912 | ||
|
|
3908d42e0b | ||
|
|
9b9dc6b8cb | ||
|
|
15fe936d2c | ||
|
|
63888ea623 | ||
|
|
901cf1d5a5 | ||
|
|
614583e822 | ||
|
|
8f172d4096 | ||
|
|
790a46bb5c | ||
|
|
ef78f2bb05 | ||
|
|
1462713cdf | ||
|
|
59c038e26c | ||
|
|
b4b25bd669 | ||
|
|
4f3a63e507 | ||
|
|
cb433052ff | ||
|
|
e328978c43 | ||
|
|
b043c8daba | ||
|
|
f217155ede | ||
|
|
faaa2e6676 | ||
|
|
486055f4eb | ||
|
|
c92833f0d7 | ||
|
|
5e0dc42151 | ||
|
|
64c254f530 | ||
|
|
2bd78b3c4e | ||
|
|
fab5fd2009 | ||
|
|
ae54d3c170 | ||
|
|
a224ef2049 | ||
|
|
94af771576 | ||
|
|
43a14861d8 | ||
|
|
271673dd33 | ||
|
|
805b6b9d76 | ||
|
|
4269356169 | ||
|
|
d358a0a5f7 | ||
|
|
1ddeea5df5 | ||
|
|
0122066b4e | ||
|
|
5b5427955e | ||
|
|
a270122e87 | ||
|
|
a6ef5d919a | ||
|
|
a95aac4dd5 | ||
|
|
9facdcf1e6 | ||
|
|
e2fb1ccfa5 | ||
|
|
8f6b3f45c6 | ||
|
|
963d88aa42 | ||
|
|
6e25529d4a | ||
|
|
bd89da6c14 | ||
|
|
859af084f0 | ||
|
|
4fc8c979f9 | ||
|
|
308c6661ba | ||
|
|
f93d1b547a | ||
|
|
5146a834fb | ||
|
|
f05399f127 | ||
|
|
54676a22cc | ||
|
|
03697b0f3a | ||
|
|
e8de478bf5 | ||
|
|
ff9f55ad96 | ||
|
|
d6109426ba | ||
|
|
da23c2e99a | ||
|
|
feb7b283b1 | ||
|
|
43963340a9 | ||
|
|
892ac503e5 | ||
|
|
c9354336c5 | ||
|
|
8f9fb27400 | ||
|
|
e55c1e8c3d | ||
|
|
661fee64f8 | ||
|
|
6f4b5cb4a7 | ||
|
|
75982dd3a9 | ||
|
|
bfdfa6ecf5 | ||
|
|
5fcde94961 | ||
|
|
0b5ceb9949 | ||
|
|
41b8d37fa7 | ||
|
|
bd8eed92ac | ||
|
|
d9186973fd | ||
|
|
42d9d96233 | ||
|
|
b270f7600f | ||
|
|
fd4d0c989c | ||
|
|
daae27a92f | ||
|
|
2b5b989cc5 | ||
|
|
7ebf49f228 | ||
|
|
c20a657848 | ||
|
|
78627302c8 | ||
|
|
f3a6258360 | ||
|
|
6bbfe0697a | ||
|
|
e61e87ebaa | ||
|
|
f062933ad6 | ||
|
|
886ec4bd2d | ||
|
|
aa2473dda9 | ||
|
|
88f990cef8 | ||
|
|
358ed6261c | ||
|
|
907a0675c6 | ||
|
|
4e62966c87 | ||
|
|
8422c4dcf1 | ||
|
|
d828c50b5e | ||
|
|
51d371bf2b | ||
|
|
9b0d389a5a | ||
|
|
8c815c3701 | ||
|
|
04fcbc1487 | ||
|
|
40cddb9e13 | ||
|
|
cb2621eb80 | ||
|
|
23e1977fbe | ||
|
|
389b3e4cb5 | ||
|
|
a40052c8c4 | ||
|
|
efb2134f8c | ||
|
|
b339b0f982 | ||
|
|
3fad646b6d | ||
|
|
39e27ba055 | ||
|
|
326317fc30 | ||
|
|
7cfaf9463f | ||
|
|
e9990e8c24 | ||
|
|
49e0a9f4cb | ||
|
|
c3199263f2 | ||
|
|
590d77d4fc | ||
|
|
9f91e7fbe7 | ||
|
|
b3582cba8f | ||
|
|
ef5de72e24 | ||
|
|
85363a5e88 | ||
|
|
43d12f8473 | ||
|
|
1358b1a9fb | ||
|
|
86a8863718 | ||
|
|
38cc2ea383 | ||
|
|
a2c8c4faa4 | ||
|
|
12c97ff0d7 | ||
|
|
60c3fbb7a2 | ||
|
|
3bfdc94f78 | ||
|
|
aab00646c0 | ||
|
|
bff765059c | ||
|
|
d5879ebb3f | ||
|
|
da45b23bb4 | ||
|
|
cb6d4ae8ad | ||
|
|
a3fa4c9a26 | ||
|
|
1c5c407540 | ||
|
|
0d15d48291 | ||
|
|
072b2a99f7 | ||
|
|
7bc0a4464a | ||
|
|
6f1842fc38 | ||
|
|
e0eb0ff0ad | ||
|
|
4bc8f3b853 | ||
|
|
ec89db1a6b | ||
|
|
178e018e1d | ||
|
|
56927e95fb | ||
|
|
a4cf12cc84 | ||
|
|
ae857abf6a | ||
|
|
6712df4ddb | ||
|
|
0417fe3a86 | ||
|
|
210e5754a7 | ||
|
|
ba68761930 | ||
|
|
cc452efb5b | ||
|
|
255ee4ff0c | ||
|
|
400e259499 | ||
|
|
9278fe7a1b | ||
|
|
8fb371cdfa | ||
|
|
cbbeb386bf | ||
|
|
f641659fa9 | ||
|
|
a7c2106ebe | ||
|
|
98624addbd | ||
|
|
1cff1902c8 | ||
|
|
ed9688c668 | ||
|
|
ce6cc88b16 | ||
|
|
89f0cee255 | ||
|
|
0e5079f263 | ||
|
|
d4325142df | ||
|
|
ff1cf6b73e | ||
|
|
c59d1dd01a | ||
|
|
90856b23af | ||
|
|
1298f2f97f | ||
|
|
f20c39a04a | ||
|
|
c23c0dcdd0 | ||
|
|
d6482d8b53 | ||
|
|
3ef731e4d2 | ||
|
|
ac24fe5f24 | ||
|
|
f013504775 | ||
|
|
0b2049aeb6 | ||
|
|
30586985bd | ||
|
|
f59b0f0a0f | ||
|
|
b6108f7820 | ||
|
|
80b6170fbc | ||
|
|
a9c700ad59 | ||
|
|
2f838a3f76 | ||
|
|
ba00cca6d5 | ||
|
|
d5ce25ebd6 | ||
|
|
9c2691ca76 | ||
|
|
68c295e2dd | ||
|
|
722d3482dd | ||
|
|
cea50b1fdb | ||
|
|
b676ad258e | ||
|
|
66ad65de03 | ||
|
|
9f5b3b789e | ||
|
|
4a920a09e0 | ||
|
|
17cb5dda88 | ||
|
|
ad0d32a868 | ||
|
|
75aeac8e24 | ||
|
|
0fc77e2b10 | ||
|
|
6abcb1feba | ||
|
|
36706675ec | ||
|
|
0e77f84cff | ||
|
|
a7e6103928 | ||
|
|
79ed9a0f65 | ||
|
|
a2698a2a9f | ||
|
|
9e85f461e0 | ||
|
|
22b4d6af78 | ||
|
|
286d31b7a6 | ||
|
|
a271017d01 | ||
|
|
5403a2da1a | ||
|
|
e35a1e74d4 | ||
|
|
d370191df3 | ||
|
|
6847633535 | ||
|
|
8e6b566ead | ||
|
|
46c89f52e4 | ||
|
|
f202a313ac | ||
|
|
4ae0c542c3 | ||
|
|
d2a9c8c9c0 | ||
|
|
b76bb6eb37 | ||
|
|
3c5501ee98 | ||
|
|
5d51940703 | ||
|
|
0b7f74cad2 | ||
|
|
d770508514 | ||
|
|
bb86b1d414 | ||
|
|
fddf628972 | ||
|
|
98a58d052f | ||
|
|
e8312e0827 | ||
|
|
d1708d80b8 | ||
|
|
896214d3e2 | ||
|
|
c2d14ab79f | ||
|
|
6f10f7fde1 | ||
|
|
a6a7877dff | ||
|
|
a442f7cbba | ||
|
|
0370268a4c | ||
|
|
01770e4029 | ||
|
|
42e0661834 | ||
|
|
4b5b93d8b9 | ||
|
|
7add5ab6a7 | ||
|
|
99813d62d1 | ||
|
|
908f88658d | ||
|
|
bc5d4e6aae | ||
|
|
3daa300f09 | ||
|
|
7f0a0a116f | ||
|
|
76e2e3d6e4 | ||
|
|
9de3ff9574 | ||
|
|
166ae94eb0 | ||
|
|
6e15cb8a6a | ||
|
|
d42ff5a2c4 | ||
|
|
f38cc1e52f | ||
|
|
3d2ebbbf5c | ||
|
|
ce23b316f1 | ||
|
|
04500578be | ||
|
|
0e34136ef1 | ||
|
|
293f7a4a7a | ||
|
|
eedcf9208e | ||
|
|
d0e52c624a | ||
|
|
8aaf6c1b1e | ||
|
|
33f7624433 | ||
|
|
52822661f9 | ||
|
|
fc947a0f81 | ||
|
|
38fddcf688 | ||
|
|
f92684db76 | ||
|
|
c62cc8b5d9 | ||
|
|
4189aa0bd0 | ||
|
|
bb1bb5520a | ||
|
|
7e8d6d3e59 |
1964
mozilla/allmakefiles.sh
Executable file
1964
mozilla/allmakefiles.sh
Executable file
File diff suppressed because it is too large
Load Diff
1117
mozilla/client.mk
Normal file
1117
mozilla/client.mk
Normal file
File diff suppressed because it is too large
Load Diff
430
mozilla/config/autoconf.mk.in
Normal file
430
mozilla/config/autoconf.mk.in
Normal file
@@ -0,0 +1,430 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is this file as it was released upon August 6, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Christopher
|
||||
# Seawood. Portions created by Christopher Seawood are
|
||||
# Copyright (C) 1998 Christopher Seawood. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
# A netscape style .mk file for autoconf builds
|
||||
|
||||
INCLUDED_AUTOCONF_MK = 1
|
||||
USE_AUTOCONF = 1
|
||||
MOZILLA_CLIENT = 1
|
||||
BUILD_MODULES = @BUILD_MODULES@
|
||||
MOZILLA_VERSION = @MOZILLA_VERSION@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
bindir = @bindir@
|
||||
includedir = @includedir@/mozilla-$(MOZILLA_VERSION)
|
||||
libdir = @libdir@
|
||||
datadir = @datadir@
|
||||
mandir = @mandir@
|
||||
idldir = @datadir@/idl/mozilla-$(MOZILLA_VERSION)
|
||||
|
||||
mozappdir = $(libdir)/mozilla-$(MOZILLA_VERSION)
|
||||
mredir = $(libdir)/mre/mre-$(MOZILLA_VERSION)
|
||||
mrelibdir = $(mredir)/lib
|
||||
|
||||
DIST = $(DEPTH)/dist
|
||||
|
||||
MOZ_CHROME_FILE_FORMAT = @MOZ_CHROME_FILE_FORMAT@
|
||||
|
||||
MOZ_WIDGET_TOOLKIT = @MOZ_WIDGET_TOOLKIT@
|
||||
MOZ_GFX_TOOLKIT = $(MOZ_WIDGET_TOOLKIT)
|
||||
|
||||
MOZ_JS_LIBS = @MOZ_JS_LIBS@
|
||||
|
||||
MOZ_GFX_TOOLKIT_LDFLAGS = @MOZ_GFX_TOOLKIT_LDFLAGS@
|
||||
MOZ_WIDGET_TOOLKIT_LDFLAGS = @MOZ_WIDGET_TOOLKIT_LDFLAGS@
|
||||
|
||||
MOZ_DEBUG = @MOZ_DEBUG@
|
||||
MOZ_DEBUG_MODULES = @MOZ_DEBUG_MODULES@
|
||||
MOZ_PROFILE_MODULES = @MOZ_PROFILE_MODULES@
|
||||
MOZ_DEBUG_ENABLE_DEFS = @MOZ_DEBUG_ENABLE_DEFS@
|
||||
MOZ_DEBUG_DISABLE_DEFS = @MOZ_DEBUG_DISABLE_DEFS@
|
||||
MOZ_DEBUG_FLAGS = @MOZ_DEBUG_FLAGS@
|
||||
MOZ_DEBUG_LDFLAGS=@MOZ_DEBUG_LDFLAGS@
|
||||
MOZ_DBGRINFO_MODULES = @MOZ_DBGRINFO_MODULES@
|
||||
MOZ_EXTENSIONS = @MOZ_EXTENSIONS@
|
||||
MOZ_IMG_DECODERS= @MOZ_IMG_DECODERS@
|
||||
MOZ_JSDEBUGGER = @MOZ_JSDEBUGGER@
|
||||
MOZ_PERF_METRICS = @MOZ_PERF_METRICS@
|
||||
MOZ_LEAKY = @MOZ_LEAKY@
|
||||
MOZ_JPROF = @MOZ_JPROF@
|
||||
MOZ_XPCTOOLS = @MOZ_XPCTOOLS@
|
||||
ENABLE_EAZEL_PROFILER=@ENABLE_EAZEL_PROFILER@
|
||||
EAZEL_PROFILER_CFLAGS=@EAZEL_PROFILER_CFLAGS@
|
||||
EAZEL_PROFILER_LIBS=@EAZEL_PROFILER_LIBS@
|
||||
GC_LEAK_DETECTOR = @GC_LEAK_DETECTOR@
|
||||
NS_TRACE_MALLOC = @NS_TRACE_MALLOC@
|
||||
USE_ELF_DYNSTR_GC = @USE_ELF_DYNSTR_GC@
|
||||
USE_PREBINDING = @USE_PREBINDING@
|
||||
INCREMENTAL_LINKER = @INCREMENTAL_LINKER@
|
||||
MACOS_DEPLOYMENT_TARGET = @MACOS_DEPLOYMENT_TARGET@
|
||||
MOZ_MAIL_NEWS = @MOZ_MAIL_NEWS@
|
||||
MOZ_CALENDAR = @MOZ_CALENDAR@
|
||||
MOZ_PLAINTEXT_EDITOR_ONLY = @MOZ_PLAINTEXT_EDITOR_ONLY@
|
||||
MOZ_COMPOSER = @MOZ_COMPOSER@
|
||||
BUILD_SHARED_LIBS = @BUILD_SHARED_LIBS@
|
||||
BUILD_STATIC_LIBS = @BUILD_STATIC_LIBS@
|
||||
MOZ_STATIC_COMPONENT_LOADER = @MOZ_STATIC_COMPONENT_LOADER@
|
||||
MOZ_STATIC_COMPONENTS = @MOZ_STATIC_COMPONENTS@
|
||||
MOZ_META_COMPONENTS = @MOZ_META_COMPONENTS@
|
||||
MOZ_STATIC_COMPONENT_LIBS = @MOZ_STATIC_COMPONENT_LIBS@
|
||||
ENABLE_TESTS = @ENABLE_TESTS@
|
||||
IBMBIDI = @IBMBIDI@
|
||||
SUNCTL = @SUNCTL@
|
||||
ACCESSIBILITY = @ACCESSIBILITY@
|
||||
MOZ_VIEW_SOURCE = @MOZ_VIEW_SOURCE@
|
||||
MOZ_XPINSTALL = @MOZ_XPINSTALL@
|
||||
MOZ_JSLOADER = @MOZ_JSLOADER@
|
||||
MOZ_USE_NATIVE_UCONV = @MOZ_USE_NATIVE_UCONV@
|
||||
MOZ_SINGLE_PROFILE = @MOZ_SINGLE_PROFILE@
|
||||
MOZ_LDAP_XPCOM = @MOZ_LDAP_XPCOM@
|
||||
MOZ_LDAP_XPCOM_EXPERIMENTAL = @MOZ_LDAP_XPCOM_EXPERIMENTAL@
|
||||
XPCOM_USE_LEA = @XPCOM_USE_LEA@
|
||||
JS_ULTRASPARC_OPTS = @JS_ULTRASPARC_OPTS@
|
||||
MOZ_ENABLE_POSTSCRIPT = @MOZ_ENABLE_POSTSCRIPT@
|
||||
MOZ_INSTALLER = @MOZ_INSTALLER@
|
||||
MOZ_NO_ACTIVEX_SUPPORT = @MOZ_NO_ACTIVEX_SUPPORT@
|
||||
MOZ_ACTIVEX_SCRIPTING_SUPPORT = @MOZ_ACTIVEX_SCRIPTING_SUPPORT@
|
||||
XPC_IDISPATCH_SUPPORT = @MOZ_ACTIVEX_SCRIPTING_SUPPORT@
|
||||
MOZ_XPFE_COMPONENTS = @MOZ_XPFE_COMPONENTS@
|
||||
MOZ_IPCD = @MOZ_IPCD@
|
||||
MOZ_PROFILESHARING = @MOZ_PROFILESHARING@
|
||||
MOZ_PROFILELOCKING = @MOZ_PROFILELOCKING@
|
||||
|
||||
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS = @MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS@
|
||||
MOZ_COMPONENT_NSPR_LIBS=@MOZ_COMPONENT_NSPR_LIBS@
|
||||
MOZ_COMPONENT_XPCOM_LIBS=@MOZ_COMPONENT_XPCOM_LIBS@
|
||||
XPCOM_LIBS=@XPCOM_LIBS@
|
||||
MOZ_REORDER=@MOZ_REORDER@
|
||||
MOZ_TIMELINE=@MOZ_TIMELINE@
|
||||
|
||||
ENABLE_STRIP = @ENABLE_STRIP@
|
||||
|
||||
ClientWallet=1
|
||||
CookieManagement=1
|
||||
SingleSignon=1
|
||||
|
||||
MOZ_OJI = @MOZ_OJI@
|
||||
|
||||
MOZ_POST_DSO_LIB_COMMAND = @MOZ_POST_DSO_LIB_COMMAND@
|
||||
MOZ_POST_PROGRAM_COMMAND = @MOZ_POST_PROGRAM_COMMAND@
|
||||
|
||||
MOZ_BUILD_ROOT = @MOZ_BUILD_ROOT@
|
||||
|
||||
MOZ_XUL = @MOZ_XUL@
|
||||
|
||||
NECKO_PROTOCOLS = @NECKO_PROTOCOLS@
|
||||
NECKO_DISK_CACHE = @NECKO_DISK_CACHE@
|
||||
NECKO_SMALL_BUFFERS = @NECKO_SMALL_BUFFERS@
|
||||
|
||||
MOZ_NATIVE_ZLIB = @SYSTEM_ZLIB@
|
||||
MOZ_NATIVE_JPEG = @SYSTEM_JPEG@
|
||||
MOZ_NATIVE_PNG = @SYSTEM_PNG@
|
||||
|
||||
MOZ_INTERNAL_LIBART_LGPL = @MOZ_INTERNAL_LIBART_LGPL@
|
||||
|
||||
MOZ_UPDATE_XTERM = @MOZ_UPDATE_XTERM@
|
||||
MOZ_MATHML = @MOZ_MATHML@
|
||||
MOZ_SVG = @MOZ_SVG@
|
||||
MOZ_SVG_RENDERER_GDIPLUS = @MOZ_SVG_RENDERER_GDIPLUS@
|
||||
MOZ_SVG_RENDERER_LIBART = @MOZ_SVG_RENDERER_LIBART@
|
||||
MOZ_LIBART_CFLAGS = @MOZ_LIBART_CFLAGS@
|
||||
TX_EXE = @TX_EXE@
|
||||
|
||||
# Mac's don't like / in a #include, so we include the libart
|
||||
# headers locally if we're using the external library
|
||||
ifdef MOZ_LIBART_CFLAGS
|
||||
ifndef MOZ_INTERNAL_LIBART_LGPL
|
||||
MOZ_LIBART_CFLAGS := $(MOZ_LIBART_CFLAGS)/libart_lgpl
|
||||
endif
|
||||
endif
|
||||
MOZ_LIBART_LIBS = @MOZ_LIBART_LIBS@
|
||||
|
||||
MOZ_INSURE = @MOZ_INSURE@
|
||||
MOZ_INSURIFYING = @MOZ_INSURIFYING@
|
||||
MOZ_INSURE_DIRS = @MOZ_INSURE_DIRS@
|
||||
MOZ_INSURE_EXCLUDE_DIRS = @MOZ_INSURE_EXCLUDE_DIRS@
|
||||
|
||||
MOZ_NATIVE_NSPR = @MOZ_NATIVE_NSPR@
|
||||
|
||||
CROSS_COMPILE = @CROSS_COMPILE@
|
||||
|
||||
OS_CPPFLAGS = @CPPFLAGS@
|
||||
OS_CFLAGS = $(OS_CPPFLAGS) @CFLAGS@
|
||||
OS_CXXFLAGS = $(OS_CPPFLAGS) @CXXFLAGS@
|
||||
OS_LDFLAGS = @LDFLAGS@
|
||||
|
||||
OS_COMPILE_CFLAGS = $(OS_CPPFLAGS) @COMPILE_CFLAGS@
|
||||
OS_COMPILE_CXXFLAGS = $(OS_CPPFLAGS) @COMPILE_CXXFLAGS@
|
||||
|
||||
OS_INCLUDES = $(NSPR_CFLAGS) $(JPEG_CFLAGS) $(PNG_CFLAGS) $(ZLIB_CFLAGS)
|
||||
OS_LIBS = @LIBS@
|
||||
ACDEFINES = @MOZ_DEFINES@
|
||||
|
||||
MOZ_OPTIMIZE = @MOZ_OPTIMIZE@
|
||||
MOZ_OPTIMIZE_FLAGS = @MOZ_OPTIMIZE_FLAGS@
|
||||
MOZ_OPTIMIZE_LDFLAGS = @MOZ_OPTIMIZE_LDFLAGS@
|
||||
|
||||
XCFLAGS = @XCFLAGS@
|
||||
XLDFLAGS = @XLDFLAGS@
|
||||
XLIBS = @XLIBS@
|
||||
|
||||
CYGWIN_WRAPPER = @CYGWIN_WRAPPER@
|
||||
CYGDRIVE_MOUNT = @CYGDRIVE_MOUNT@
|
||||
AR = @AR@
|
||||
AR_FLAGS = @AR_FLAGS@
|
||||
AR_EXTRACT = @AR_EXTRACT@
|
||||
AR_LIST = @AR_LIST@
|
||||
AR_DELETE = @AR_DELETE@
|
||||
AS = @AS@
|
||||
ASFLAGS = @ASFLAGS@
|
||||
AS_DASH_C_FLAG = @AS_DASH_C_FLAG@
|
||||
LD = @LD@
|
||||
RC = @RC@
|
||||
RCFLAGS = @RCFLAGS@
|
||||
WINDRES = @WINDRES@
|
||||
USE_SHORT_LIBNAME = @USE_SHORT_LIBNAME@
|
||||
IMPLIB = @IMPLIB@
|
||||
FILTER = @FILTER@
|
||||
BIN_FLAGS = @BIN_FLAGS@
|
||||
MIDL = @MIDL@
|
||||
MIDL_FLAGS = @MIDL_FLAGS@
|
||||
|
||||
DLL_PREFIX = @DLL_PREFIX@
|
||||
LIB_PREFIX = @LIB_PREFIX@
|
||||
OBJ_SUFFIX = @OBJ_SUFFIX@
|
||||
LIB_SUFFIX = @LIB_SUFFIX@
|
||||
DLL_SUFFIX = @DLL_SUFFIX@
|
||||
BIN_SUFFIX = @BIN_SUFFIX@
|
||||
ASM_SUFFIX = @ASM_SUFFIX@
|
||||
IMPORT_LIB_SUFFIX = @IMPORT_LIB_SUFFIX@
|
||||
USE_N32 = @USE_N32@
|
||||
HAVE_64BIT_OS = @HAVE_64BIT_OS@
|
||||
|
||||
# Temp hack. It is not my intention to leave this crap in here for ever.
|
||||
# Im talking to fur right now to solve the problem without introducing
|
||||
# NS_USE_NATIVE to the build system -ramiro.
|
||||
NS_USE_NATIVE = @NS_USE_NATIVE@
|
||||
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
|
||||
GNU_AS = @GNU_AS@
|
||||
GNU_LD = @GNU_LD@
|
||||
GNU_CC = @GNU_CC@
|
||||
GNU_CXX = @GNU_CXX@
|
||||
HAVE_GCC3_ABI = @HAVE_GCC3_ABI@
|
||||
|
||||
HOST_CC = @HOST_CC@
|
||||
HOST_CXX = @HOST_CXX@
|
||||
HOST_CFLAGS = @HOST_CFLAGS@
|
||||
HOST_CXXFLAGS = @HOST_CXXFLAGS@
|
||||
HOST_OPTIMIZE_FLAGS = @HOST_OPTIMIZE_FLAGS@
|
||||
HOST_NSPR_MDCPUCFG = @HOST_NSPR_MDCPUCFG@
|
||||
HOST_AR = @HOST_AR@
|
||||
HOST_LD = @HOST_LD@
|
||||
HOST_RANLIB = @HOST_RANLIB@
|
||||
|
||||
HOST_LIBIDL_CONFIG = @HOST_LIBIDL_CONFIG@
|
||||
HOST_LIBIDL_CFLAGS = @HOST_LIBIDL_CFLAGS@
|
||||
HOST_LIBIDL_LIBS = @HOST_LIBIDL_LIBS@
|
||||
|
||||
TARGET_NSPR_MDCPUCFG = @TARGET_NSPR_MDCPUCFG@
|
||||
TARGET_CPU = @TARGET_CPU@
|
||||
TARGET_VENDOR = @TARGET_VENDOR@
|
||||
TARGET_OS = @TARGET_OS@
|
||||
TARGET_MD_ARCH = @TARGET_MD_ARCH@
|
||||
|
||||
AUTOCONF = @AUTOCONF@
|
||||
PERL = @PERL@
|
||||
RANLIB = @RANLIB@
|
||||
WHOAMI = @WHOAMI@
|
||||
UNZIP = @UNZIP@
|
||||
ZIP = @ZIP@
|
||||
XARGS = @XARGS@
|
||||
STRIP = @STRIP@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
MAKE = @MAKE@
|
||||
PBBUILD_BIN = @PBBUILD@
|
||||
|
||||
ifdef MOZ_NATIVE_JPEG
|
||||
JPEG_CFLAGS = @JPEG_CFLAGS@
|
||||
JPEG_LIBS = @JPEG_LIBS@
|
||||
JPEG_REQUIRES =
|
||||
else
|
||||
JPEG_CFLAGS = @MOZ_JPEG_CFLAGS@
|
||||
JPEG_LIBS = @MOZ_JPEG_LIBS@
|
||||
JPEG_REQUIRES = jpeg
|
||||
endif
|
||||
|
||||
ifdef MOZ_NATIVE_ZLIB
|
||||
ZLIB_CFLAGS = @ZLIB_CFLAGS@
|
||||
ZLIB_LIBS = @ZLIB_LIBS@
|
||||
ZLIB_REQUIRES =
|
||||
else
|
||||
ZLIB_CFLAGS = @MOZ_ZLIB_CFLAGS@
|
||||
ZLIB_LIBS = @MOZ_ZLIB_LIBS@
|
||||
ZLIB_REQUIRES = zlib
|
||||
endif
|
||||
|
||||
ifdef MOZ_NATIVE_PNG
|
||||
PNG_CFLAGS = @PNG_CFLAGS@
|
||||
PNG_LIBS = @PNG_LIBS@
|
||||
PNG_REQUIRES =
|
||||
else
|
||||
PNG_CFLAGS = @MOZ_PNG_CFLAGS@
|
||||
PNG_LIBS = @MOZ_PNG_LIBS@
|
||||
PNG_REQUIRES = png
|
||||
endif
|
||||
|
||||
NSPR_CFLAGS = @NSPR_CFLAGS@
|
||||
NSPR_LIBS = @NSPR_LIBS@
|
||||
|
||||
LDAP_CFLAGS = @LDAP_CFLAGS@
|
||||
LDAP_LIBS = @LDAP_LIBS@
|
||||
XPCOM_GLUE_LIBS = @XPCOM_GLUE_LIBS@
|
||||
MOZ_XPCOM_OBSOLETE_LIBS = @MOZ_XPCOM_OBSOLETE_LIBS@
|
||||
|
||||
USE_DEPENDENT_LIBS = @USE_DEPENDENT_LIBS@
|
||||
|
||||
# UNIX98 iconv support
|
||||
LIBICONV = @LIBICONV@
|
||||
|
||||
# MKSHLIB_FORCE_ALL is used to force the linker to include all object
|
||||
# files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker
|
||||
# to normal behavior. Makefile's that create shared libraries out of
|
||||
# archives use these flags to force in all of the .o files in the
|
||||
# archives into the shared library.
|
||||
WRAP_MALLOC_LIB = @WRAP_MALLOC_LIB@
|
||||
WRAP_MALLOC_CFLAGS = @WRAP_MALLOC_CFLAGS@
|
||||
DSO_CFLAGS = @DSO_CFLAGS@
|
||||
DSO_PIC_CFLAGS = @DSO_PIC_CFLAGS@
|
||||
MKSHLIB = @MKSHLIB@
|
||||
MKCSHLIB = @MKCSHLIB@
|
||||
MKSHLIB_FORCE_ALL = @MKSHLIB_FORCE_ALL@
|
||||
MKSHLIB_UNFORCE_ALL = @MKSHLIB_UNFORCE_ALL@
|
||||
DSO_LDOPTS = @DSO_LDOPTS@
|
||||
DLL_SUFFIX = @DLL_SUFFIX@
|
||||
|
||||
NO_LD_ARCHIVE_FLAGS = @NO_LD_ARCHIVE_FLAGS@
|
||||
|
||||
GTK_CONFIG = @GTK_CONFIG@
|
||||
TK_CFLAGS = @TK_CFLAGS@
|
||||
TK_LIBS = @TK_LIBS@
|
||||
|
||||
MOZ_TOOLKIT_REGISTRY_CFLAGS = \
|
||||
-DWIDGET_DLL=@WIDGET_DLL@ \
|
||||
-DGFXWIN_DLL=@GFXWIN_DLL@ \
|
||||
$(TK_CFLAGS)
|
||||
|
||||
MOZ_ENABLE_GTK = @MOZ_ENABLE_GTK@
|
||||
MOZ_ENABLE_GTK2 = @MOZ_ENABLE_GTK2@
|
||||
MOZ_ENABLE_XLIB = @MOZ_ENABLE_XLIB@
|
||||
MOZ_ENABLE_PHOTON = @MOZ_ENABLE_PHOTON@
|
||||
MOZ_ENABLE_COCOA = @MOZ_ENABLE_COCOA@
|
||||
MOZ_ENABLE_XREMOTE = @MOZ_ENABLE_XREMOTE@
|
||||
|
||||
MOZ_GTK_CFLAGS = @MOZ_GTK_CFLAGS@
|
||||
MOZ_GTK_LDFLAGS = @MOZ_GTK_LDFLAGS@
|
||||
|
||||
MOZ_GTK2_CFLAGS = @MOZ_GTK2_CFLAGS@
|
||||
MOZ_GTK2_LIBS = @MOZ_GTK2_LIBS@
|
||||
|
||||
MOZ_XLIB_CFLAGS = @MOZ_XLIB_CFLAGS@
|
||||
MOZ_XLIB_LDFLAGS = @MOZ_XLIB_LDFLAGS@
|
||||
|
||||
MOZ_XPRINT_CFLAGS = @MOZ_XPRINT_CFLAGS@
|
||||
MOZ_XPRINT_LDFLAGS = @MOZ_XPRINT_LDFLAGS@
|
||||
MOZ_ENABLE_XPRINT = @MOZ_ENABLE_XPRINT@
|
||||
|
||||
MOZ_ENABLE_FREETYPE2 = @MOZ_ENABLE_FREETYPE2@
|
||||
FT2_CFLAGS = @FT2_CFLAGS@
|
||||
FT2_LIBS = @FT2_LIBS@
|
||||
|
||||
MOZ_ENABLE_XFT = @MOZ_ENABLE_XFT@
|
||||
MOZ_XFT_CFLAGS = @MOZ_XFT_CFLAGS@
|
||||
MOZ_XFT_LIBS = @MOZ_XFT_LIBS@
|
||||
MOZ_ENABLE_COREXFONTS = @MOZ_ENABLE_COREXFONTS@
|
||||
|
||||
MOZ_EXTRA_X11CONVERTERS = @MOZ_EXTRA_X11CONVERTERS@
|
||||
|
||||
MOZ_ENABLE_XINERAMA = @MOZ_ENABLE_XINERAMA@
|
||||
MOZ_XINERAMA_LIBS = @MOZ_XINERAMA_LIBS@
|
||||
|
||||
MOZ_XIE_LIBS = @MOZ_XIE_LIBS@
|
||||
XT_LIBS = @XT_LIBS@
|
||||
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_GMODULE_LIBS = @GLIB_GMODULE_LIBS@
|
||||
LIBIDL_CFLAGS = @LIBIDL_CFLAGS@
|
||||
LIBIDL_LIBS = @LIBIDL_LIBS@
|
||||
|
||||
MOZ_NATIVE_MAKEDEPEND = @SYSTEM_MAKEDEPEND@
|
||||
|
||||
# Used for LD_LIBRARY_PATH
|
||||
LIBS_PATH = @LIBS_PATH@
|
||||
|
||||
MOZ_AUTO_DEPS = @MOZ_AUTO_DEPS@
|
||||
COMPILER_DEPEND = @COMPILER_DEPEND@
|
||||
MDDEPDIR := @MDDEPDIR@
|
||||
|
||||
MOZ_DEMANGLE_SYMBOLS = @MOZ_DEMANGLE_SYMBOLS@
|
||||
|
||||
# XXX - these need to be cleaned up and have real checks added -cls
|
||||
CM_BLDTYPE=dbg
|
||||
AWT_11=1
|
||||
MOZ_BITS=32
|
||||
OS_TARGET=@OS_TARGET@
|
||||
OS_ARCH=@OS_ARCH@
|
||||
OS_RELEASE=@OS_RELEASE@
|
||||
OS_TEST=@OS_TEST@
|
||||
|
||||
# For OS/2 build
|
||||
MOZ_OS2_TOOLS = @MOZ_OS2_TOOLS@
|
||||
MOZ_OS2_EMX_OBJECTFORMAT = @MOZ_OS2_EMX_OBJECTFORMAT@
|
||||
|
||||
HAVE_XIE=@HAVE_XIE@
|
||||
|
||||
MOZ_MOVEMAIL=@MOZ_MOVEMAIL@
|
||||
MOZ_PSM=@MOZ_PSM@
|
||||
|
||||
# for Qt build
|
||||
MOC=@MOC@
|
||||
|
||||
# Win32 options
|
||||
MOZ_PROFILE = @MOZ_PROFILE@
|
||||
MOZ_COVERAGE = @MOZ_COVERAGE@
|
||||
MOZ_BROWSE_INFO = @MOZ_BROWSE_INFO@
|
||||
MOZ_TOOLS_DIR = @MOZ_TOOLS_DIR@
|
||||
|
||||
# Codesighs tools option, enables win32 mapfiles.
|
||||
MOZ_MAPINFO = @MOZ_MAPINFO@
|
||||
|
||||
MOZ_PHOENIX = @MOZ_PHOENIX@
|
||||
MOZ_XUL_APP = @MOZ_XUL_APP@
|
||||
MOZ_THUNDERBIRD = @MOZ_THUNDERBIRD@
|
||||
MOZ_STANDALONE_COMPOSER= @MOZ_STANDALONE_COMPOSER@
|
||||
MOZ_STATIC_MAIL_BUILD = @MOZ_STATIC_MAIL_BUILD@
|
||||
|
||||
MINIMO = @MINIMO@
|
||||
|
||||
MOZ_COMPONENTLIB = @MOZ_COMPONENTLIB@
|
||||
MACOS_SDK_DIR = @MACOS_SDK_DIR@
|
||||
16390
mozilla/configure
vendored
Executable file
16390
mozilla/configure
vendored
Executable file
File diff suppressed because it is too large
Load Diff
5609
mozilla/configure.in
Normal file
5609
mozilla/configure.in
Normal file
File diff suppressed because it is too large
Load Diff
318
mozilla/content/base/public/nsContentCID.h
Normal file
318
mozilla/content/base/public/nsContentCID.h
Normal file
@@ -0,0 +1,318 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef nsContentCID_h__
|
||||
#define nsContentCID_h__
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsIFactory.h"
|
||||
#include "nsIComponentManager.h"
|
||||
|
||||
// {1691E1F7-EE41-11d4-9885-00C04FA0CF4B}
|
||||
#define NS_STYLESET_CID \
|
||||
{ 0x1691e1f7, 0xee41, 0x11d4, { 0x98, 0x85, 0x0, 0xc0, 0x4f, 0xa0, 0xcf, 0x4b } }
|
||||
|
||||
// {96882B70-8A27-11d2-8EAF-00805F29F370}
|
||||
#define NS_HTMLSTYLESHEET_CID \
|
||||
{ 0x96882b70, 0x8a27, 0x11d2, { 0x8e, 0xaf, 0x0, 0x80, 0x5f, 0x29, 0xf3, 0x70 } }
|
||||
|
||||
// {972D8D8F-F0DA-11d4-9885-00C04FA0CF4B}
|
||||
#define NS_DOCUMENT_VIEWER_CID \
|
||||
{ 0x972d8d8f, 0xf0da, 0x11d4, { 0x98, 0x85, 0x0, 0xc0, 0x4f, 0xa0, 0xcf, 0x4b } }
|
||||
|
||||
// {A5121627-EDB6-11d4-9885-00C04FA0CF4B}
|
||||
#define NS_ANONYMOUSCONTENT_CID \
|
||||
{ 0xa5121627, 0xedb6, 0x11d4, { 0x98, 0x85, 0x0, 0xc0, 0x4f, 0xa0, 0xcf, 0x4b } }
|
||||
|
||||
// {FC886801-E768-11d4-9885-00C04FA0CF4B}
|
||||
#define NS_CONTENT_DOCUMENT_LOADER_FACTORY_CID \
|
||||
{ 0xfc886801, 0xe768, 0x11d4, { 0x98, 0x85, 0x0, 0xc0, 0x4f, 0xa0, 0xcf, 0x4b } }
|
||||
|
||||
/* a6cf90f9-15b3-11d2-932e-00805f8add32 */
|
||||
#define NS_LAYOUT_DEBUGGER_CID \
|
||||
{ 0xa6cf90f9, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
||||
/* a6cf90fc-15b3-11d2-932e-00805f8add32 */
|
||||
#define NS_HTML_ELEMENT_FACTORY_CID \
|
||||
{ 0xa6cf90fc, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
||||
#define NS_HTMLDOCUMENT_CID \
|
||||
{ /* 5d0fcdd0-4daa-11d2-b328-00805f8a3859 */ \
|
||||
0x5d0fcdd0, 0x4daa, 0x11d2, \
|
||||
{0xb3, 0x28, 0x00, 0x80, 0x5f, 0x8a, 0x38, 0x59}}
|
||||
|
||||
#define NS_WYCIWYGPROTOCOLHANDLER_CID \
|
||||
{ /* e7509b46-2eB2-410a-9d7c-c3ce73284d01 */ \
|
||||
0xe7509b46, 0x2eb2, 0x410a, \
|
||||
{0x9d, 0x7c, 0xc3, 0xce, 0x73, 0x28, 0x4d, 0x01}}
|
||||
|
||||
#define NS_XMLDOCUMENT_CID \
|
||||
{ /* a6cf9063-15b3-11d2-932e-00805f8add32 */ \
|
||||
0xa6cf9063, 0x15b3, 0x11d2, \
|
||||
{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
||||
#define NS_XML_ELEMENT_FACTORY_CID \
|
||||
{ /* CF170391-79CC-11d3-BE44-0020A6361667 */ \
|
||||
0xcf170391, 0x79cc, 0x11d3, \
|
||||
{0xbe, 0x44, 0x0, 0x20, 0xa6, 0x36, 0x16, 0x67}}
|
||||
|
||||
#define NS_IMAGEDOCUMENT_CID \
|
||||
{ /* e11a6080-4daa-11d2-b328-00805f8a3859 */ \
|
||||
0xe11a6080, 0x4daa, 0x11d2, \
|
||||
{0xb3, 0x28, 0x00, 0x80, 0x5f, 0x8a, 0x38, 0x59}}
|
||||
|
||||
// {A1FDE864-E802-11d4-9885-00C04FA0CF4B}
|
||||
#define NS_HTMLHRELEMENT_CID \
|
||||
{ 0xa1fde864, 0xe802, 0x11d4, { 0x98, 0x85, 0x0, 0xc0, 0x4f, 0xa0, 0xcf, 0x4b } }
|
||||
|
||||
// {A1FDE865-E802-11d4-9885-00C04FA0CF4B}
|
||||
#define NS_HTMLINPUTELEMENT_CID \
|
||||
{ 0xa1fde865, 0xe802, 0x11d4, { 0x98, 0x85, 0x0, 0xc0, 0x4f, 0xa0, 0xcf, 0x4b } }
|
||||
|
||||
#define NS_HTMLIMAGEELEMENT_CID \
|
||||
{ /* d6008c40-4dad-11d2-b328-00805f8a3859 */ \
|
||||
0xd6008c40, 0x4dad, 0x11d2, \
|
||||
{0xb3, 0x28, 0x00, 0x80, 0x5f, 0x8a, 0x38, 0x59}}
|
||||
|
||||
#define NS_HTMLOPTIONELEMENT_CID \
|
||||
{ /* a6cf90f5-15b3-11d2-932e-00805f8add32 */ \
|
||||
0xa6cf90f5, 0x15b3, 0x11d2, \
|
||||
{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
||||
#define NS_NAMESPACEMANAGER_CID \
|
||||
{ /* d9783472-8fe9-11d2-9d3c-0060088f9ff7 */ \
|
||||
0xd9783472, 0x8fe9, 0x11d2, \
|
||||
{0x9d, 0x3c, 0x00, 0x60, 0x08, 0x8f, 0x9f, 0xf7}}
|
||||
|
||||
/* a6cf90d7-15b3-11d2-932e-00805f8add32 */
|
||||
#define NS_FRAME_UTIL_CID \
|
||||
{ 0xa6cf90d5, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
||||
|
||||
// XXX This should really be factored into a style-specific DLL so
|
||||
// that all the HTML, generic layout, and style stuff isn't munged
|
||||
// together.
|
||||
|
||||
// {2E363D60-872E-11d2-B531-000000000000}
|
||||
#define NS_CSSPARSER_CID \
|
||||
{ 0x2e363d60, 0x872e, 0x11d2, { 0xb5, 0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }
|
||||
|
||||
// {95F46161-D177-11d2-BF86-00105A1B0627}
|
||||
#define NS_HTML_CSS_STYLESHEET_CID \
|
||||
{ 0x95f46161, 0xd177, 0x11d2, { 0xbf, 0x86, 0x0, 0x10, 0x5a, 0x1b, 0x6, 0x27 } }
|
||||
|
||||
// {A1FDE867-E802-11d4-9885-00C04FA0CF4B}
|
||||
#define NS_CSS_STYLESHEET_CID \
|
||||
{ 0xa1fde867, 0xe802, 0x11d4, { 0x98, 0x85, 0x0, 0xc0, 0x4f, 0xa0, 0xcf, 0x4b } }
|
||||
|
||||
// {eaca2576-0d4a-11d3-9d7e-0060088f9ff7}
|
||||
#define NS_CSS_LOADER_CID \
|
||||
{ 0xeaca2576, 0x0d4a, 0x11d3, { 0x9d, 0x7e, 0x00, 0x60, 0x08, 0x8f, 0x9f, 0xf7 } }
|
||||
|
||||
// {96882B71-8A27-11d2-8EAF-00805F29F370}
|
||||
#define NS_TEXTNODE_CID \
|
||||
{ 0x96882b71, 0x8a27, 0x11d2, { 0x8e, 0xaf, 0x0, 0x80, 0x5f, 0x29, 0xf3, 0x70 } }
|
||||
|
||||
// {96882B72-8A27-11d2-8EAF-00805F29F370}
|
||||
#define NS_SELECTION_CID \
|
||||
{ 0x96882b72, 0x8a27, 0x11d2, { 0x8e, 0xaf, 0x0, 0x80, 0x5f, 0x29, 0xf3, 0x70 } }
|
||||
|
||||
#define NS_FRAMESELECTION_CID \
|
||||
{/* {905F80F1-8A7B-11d2-918C-0080C8E44DB5}*/ \
|
||||
0x905f80f1, 0x8a7b, 0x11d2, { 0x91, 0x8c, 0x0, 0x80, 0xc8, 0xe4, 0x4d, 0xb5 } }
|
||||
|
||||
#define NS_DOMSELECTION_CID \
|
||||
{/* {C87A37FC-8109-4ce2-A322-8CDEC925379F}*/ \
|
||||
0xc87a37fc, 0x8109, 0x4ce2, { 0xa3, 0x22, 0x8c, 0xde, 0xc9, 0x25, 0x37, 0x9f } }
|
||||
|
||||
#define NS_RANGE_CID \
|
||||
{/* {56AD2981-8A87-11d2-918C-0080C8E44DB5}*/ \
|
||||
0x56ad2981, 0x8a87, 0x11d2, { 0x91, 0x8c, 0x0, 0x80, 0xc8, 0xe4, 0x4d, 0xb5 } }
|
||||
#define NS_CONTENTITERATOR_CID \
|
||||
{/* {a6cf90e3-15b3-11d2-932e-00805f8add32}*/ \
|
||||
0xa6cf90e3, 0x15b3, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 } }
|
||||
|
||||
#define NS_PRECONTENTITERATOR_CID \
|
||||
{/* {80D7E247-D4B8-45d7-BB59-6F1DD56F384C} */ \
|
||||
0x80d7e247, 0xd4b8, 0x45d7, { 0xbb, 0x59, 0x6f, 0x1d, 0xd5, 0x6f, 0x38, 0x4c } }
|
||||
|
||||
#define NS_GENERATEDSUBTREEITERATOR_CID \
|
||||
{/* {9A45253B-EB8F-49f1-B925-E9EA90D3EB3A}*/ \
|
||||
0x9a45253b, 0xeb8f, 0x49f1, { 0xb9, 0x25, 0xe9, 0xea, 0x90, 0xd3, 0xeb, 0x3a } }
|
||||
|
||||
#define NS_GENERATEDCONTENTITERATOR_CID \
|
||||
{/* {A364930F-E353-49f1-AC69-91637EB8B757}*/ \
|
||||
0xa364930f, 0xe353, 0x49f1, { 0xac, 0x69, 0x91, 0x63, 0x7e, 0xb8, 0xb7, 0x57 } }
|
||||
|
||||
#define NS_SUBTREEITERATOR_CID \
|
||||
{/* {a6cf90e5-15b3-11d2-932e-00805f8add32}*/ \
|
||||
0xa6cf90e5, 0x15b3, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 } }
|
||||
|
||||
// {09F689E0-B4DA-11d2-A68B-00104BDE6048}
|
||||
#define NS_EVENTLISTENERMANAGER_CID \
|
||||
{ 0x9f689e0, 0xb4da, 0x11d2, { 0xa6, 0x8b, 0x0, 0x10, 0x4b, 0xde, 0x60, 0x48 } }
|
||||
|
||||
// {A1FDE862-E802-11d4-9885-00C04FA0CF4B}
|
||||
#define NS_EVENTSTATEMANAGER_CID \
|
||||
{ 0xa1fde862, 0xe802, 0x11d4, { 0x98, 0x85, 0x0, 0xc0, 0x4f, 0xa0, 0xcf, 0x4b } }
|
||||
|
||||
// {66856477-6596-40eb-bb87-59ca2dabb6f7}
|
||||
#define NS_DOMEVENTGROUP_CID \
|
||||
{ 0x66856477, 0x6596, 0x40eb, { 0xbb, 0x87, 0x59, 0xca, 0x2d, 0xab, 0xb6, 0xf7 } }
|
||||
|
||||
// {64F300A1-C88C-11d3-97FB-00400553EEF0}
|
||||
#define NS_XBLSERVICE_CID \
|
||||
{ 0x64f300a1, 0xc88c, 0x11d3, { 0x97, 0xfb, 0x0, 0x40, 0x5, 0x53, 0xee, 0xf0 } }
|
||||
|
||||
// {15671AF5-39F9-4c70-8CE3-72C97111B52D}
|
||||
#define NS_BINDINGMANAGER_CID \
|
||||
{ 0x15671af5, 0x39f9, 0x4c70, { 0x8c, 0xe3, 0x72, 0xc9, 0x71, 0x11, 0xb5, 0x2d } }
|
||||
|
||||
// 3a9cd622-264d-11d4-ba06-0060b0fc76dd
|
||||
#define NS_DOM_IMPLEMENTATION_CID \
|
||||
{ 0x3a9cd622, 0x264d, 0x11d4, {0xba, 0x06, 0x00, 0x60, 0xb0, 0xfc, 0x76, 0xdd } }
|
||||
|
||||
// {AE52FE52-683A-437D-B661-DE55F4E0A873}
|
||||
#define NS_NODEINFOMANAGER_CID \
|
||||
{ 0xae52fe52, 0x683a, 0x437d, { 0xb6, 0x61, 0xde, 0x55, 0xf4, 0xe0, 0xa8, 0x73 } }
|
||||
|
||||
// {ECEA1B28-AE54-4047-8BBE-C624235106B4}
|
||||
#define NS_COMPUTEDDOMSTYLE_CID \
|
||||
{ 0xecea1b28, 0xae54, 0x4047, { 0x8b, 0xbe, 0xc6, 0x24, 0x23, 0x51, 0x06, 0xb4 } }
|
||||
|
||||
// {4aef38b7-6364-4e23-a5e7-12f837fbbd9c}
|
||||
#define NS_XMLCONTENTSERIALIZER_CID \
|
||||
{ 0x4aef38b7, 0x6364, 0x4e23, { 0xa5, 0xe7, 0x12, 0xf8, 0x37, 0xfb, 0xbd, 0x9c } }
|
||||
|
||||
// {9d3f70da-86e9-11d4-95ec-00b0d03e37b7}
|
||||
#define NS_HTMLCONTENTSERIALIZER_CID \
|
||||
{ 0x9d3f70da, 0x86e9, 0x11d4, { 0x95, 0xec, 0x00, 0xb0, 0xd0, 0x3e, 0x37, 0xb7 } }
|
||||
|
||||
// {feca3c34-205e-4ae5-bd1c-03c686ff012b}
|
||||
#define MOZ_SANITIZINGHTMLSERIALIZER_CID \
|
||||
{ 0xfeca3c34, 0x205e, 0x4ae5, { 0xbd, 0x1c, 0x03, 0xc6, 0x86, 0xff, 0x01, 0x2b } }
|
||||
|
||||
// {6030f7ef-32ed-46a7-9a63-6a5d3f90445f}
|
||||
#define NS_PLAINTEXTSERIALIZER_CID \
|
||||
{ 0x6030f7ef, 0x32ed, 0x46a7, { 0x9a, 0x63, 0x6a, 0x5d, 0x3f, 0x90, 0x44, 0x5f } }
|
||||
|
||||
// {d4f2b600-b5c1-11d6-b483-cc97c63e567c}
|
||||
#define NS_HTMLFRAGMENTSINK_CID \
|
||||
{ 0xd4f2b600, 0xb5c1, 0x11d6, { 0xb4, 0x83, 0xcc, 0x97, 0xc6, 0x3e, 0x56, 0x7c } }
|
||||
|
||||
// {13111d00-ce81-11d6-8082-ecf3665af67c}
|
||||
#define NS_HTMLFRAGMENTSINK2_CID \
|
||||
{ 0x13111d00, 0xce81, 0x11d6, { 0x80, 0x82, 0xec, 0xf3, 0x66, 0x5a, 0xf6, 0x7c } }
|
||||
|
||||
// {3986B301-097C-11d3-BF87-00105A1B0627}
|
||||
#define NS_XULPOPUPLISTENER_CID \
|
||||
{ 0x3986b301, 0x97c, 0x11d3, { 0xbf, 0x87, 0x0, 0x10, 0x5a, 0x1b, 0x6, 0x27 } }
|
||||
|
||||
// {1F5C1721-7DC3-11d3-BF87-00105A1B0627}
|
||||
#define NS_XULCONTROLLERS_CID \
|
||||
{ 0x1f5c1721, 0x7dc3, 0x11d3, { 0xbf, 0x87, 0x0, 0x10, 0x5a, 0x1b, 0x6, 0x27 } }
|
||||
|
||||
|
||||
// {daedcb43-1dd1-11b2-b1d2-caf06cb40387}
|
||||
#define NS_DLGDEFAULTKEYS_CID \
|
||||
{ 0xdaedcb43, 0x1dd1, 0x11b2, { 0xb1, 0xd2, 0xca, 0xf0, 0x6c, 0xb4, 0x3, 0x87 } }
|
||||
|
||||
// {76E92881-CDDB-11d3-BF87-00105A1B0627}
|
||||
#define NS_XULELEMENTFACTORY_CID \
|
||||
{ 0x76e92881, 0xcddb, 0x11d3, { 0xbf, 0x87, 0x0, 0x10, 0x5a, 0x1b, 0x6, 0x27 } }
|
||||
|
||||
|
||||
// {BFD05264-834C-11d2-8EAC-00805F29F371}
|
||||
#define NS_XULSORTSERVICE_CID \
|
||||
{ 0xbfd05264, 0x834c, 0x11d2, { 0x8e, 0xac, 0x0, 0x80, 0x5f, 0x29, 0xf3, 0x71 } }
|
||||
|
||||
// {3D262D00-8B5A-11d2-8EB0-00805F29F370}
|
||||
#define NS_XULTEMPLATEBUILDER_CID \
|
||||
{ 0x3d262d00, 0x8b5a, 0x11d2, { 0x8e, 0xb0, 0x0, 0x80, 0x5f, 0x29, 0xf3, 0x70 } }
|
||||
|
||||
// {1abdcc96-1dd2-11b2-b520-f8f59cdd67bc}
|
||||
#define NS_XULTREEBUILDER_CID \
|
||||
{ 0x1abdcc96, 0x1dd2, 0x11b2, { 0xb5, 0x20, 0xf8, 0xf5, 0x9c, 0xdd, 0x67, 0xbc } }
|
||||
|
||||
// {CE058B21-BA9C-11d2-BF86-00105A1B0627}
|
||||
#define NS_XULCONTENTSINK_CID \
|
||||
{ 0xce058b21, 0xba9c, 0x11d2, { 0xbf, 0x86, 0x0, 0x10, 0x5a, 0x1b, 0x6, 0x27 } }
|
||||
|
||||
// {541AFCB2-A9A3-11d2-8EC5-00805F29F370}
|
||||
#define NS_XULDOCUMENT_CID \
|
||||
{ 0x541afcb2, 0xa9a3, 0x11d2, { 0x8e, 0xc5, 0x0, 0x80, 0x5f, 0x29, 0xf3, 0x70 } }
|
||||
|
||||
// {3A0A0FC1-8349-11d3-BE47-00104BDE6048}
|
||||
#define NS_XULPROTOTYPECACHE_CID \
|
||||
{ 0x3a0a0fc1, 0x8349, 0x11d3, { 0xbe, 0x47, 0x0, 0x10, 0x4b, 0xde, 0x60, 0x48 } }
|
||||
|
||||
// {a6cf9126-15b3-11d2-932e-00805f8add32}
|
||||
#define NS_RANGEUTILS_CID \
|
||||
{ 0xa6cf9126, 0x15b3, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 } }
|
||||
|
||||
#ifdef MOZ_MATHML
|
||||
// {68b9fbda-f230-45a9-bf92-dbbbd4ac8555}
|
||||
#define NS_MATHMLELEMENTFACTORY_CID \
|
||||
{ 0x68b9fbda, 0xf230, 0x45a9, {0xbf, 0x92, 0xdb, 0xbb, 0xd4, 0xac, 0x85, 0x55 } }
|
||||
#endif // MOZ_MATHML
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
|
||||
// {34D9B28A-FBFF-4bbd-8546-1822FE3FB8B5}
|
||||
#define NS_SVGELEMENTFACTORY_CID \
|
||||
{ 0x34d9b28a, 0xfbff, 0x4bbd, { 0x85, 0x46, 0x18, 0x22, 0xfe, 0x3f, 0xb8, 0xb5 } }
|
||||
|
||||
#define NS_SVGDOCUMENT_CID \
|
||||
{ /* b7f44954-1dd1-11b2-8c2e-c2feab4186bc */ \
|
||||
0xb7f44954, 0x11d1, 0x11b2, \
|
||||
{0x8c, 0x2e, 0xc2, 0xfe, 0xab, 0x41, 0x86, 0xbc}}
|
||||
|
||||
#endif // MOZ_SVG
|
||||
|
||||
#define NS_SYNCLOADDOMSERVICE_CID \
|
||||
{ /* 0e4e7d00-f71a-439f-9178-1a71ff11b55f */ \
|
||||
0x0e4e7d00, 0xf71a, 0x439f, \
|
||||
{0x91, 0x78, 0x1a, 0x71, 0xff, 0x11, 0xb5, 0x5f} }
|
||||
#define NS_SYNCLOADDOMSERVICE_CONTRACTID \
|
||||
"@mozilla.org/content/syncload-dom-service;1"
|
||||
|
||||
// {f96f5ec9-755b-447e-b1f3-717d1a84bb41}
|
||||
#define NS_PLUGINDOCUMENT_CID \
|
||||
{ 0xf96f5ec9, 0x755b, 0x447e, { 0xb1, 0xf3, 0x71, 0x7d, 0x1a, 0x84, 0xbb, 0x41 } }
|
||||
|
||||
#endif /* nsContentCID_h__ */
|
||||
81
mozilla/content/base/public/nsIElementFactory.h
Normal file
81
mozilla/content/base/public/nsIElementFactory.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#ifndef nsIElementFactory_h___
|
||||
#define nsIElementFactory_h___
|
||||
|
||||
#include "nsISupports.h"
|
||||
|
||||
class nsIContent;
|
||||
class nsINodeInfo;
|
||||
|
||||
/* a6cf90fb-15b3-11d2-932e-00805f8add32 */
|
||||
#define NS_IELEMENT_FACTORY_IID \
|
||||
{ 0xa6cf90fb, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
||||
/**
|
||||
* An API for creating html content objects
|
||||
*/
|
||||
class nsIElementFactory : public nsISupports {
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IELEMENT_FACTORY_IID)
|
||||
|
||||
NS_IMETHOD CreateInstanceByTag(nsINodeInfo *aNodeInfo,
|
||||
nsIContent** aResult) = 0;
|
||||
};
|
||||
|
||||
// ContractIDs for element factory registration
|
||||
#define NS_ELEMENT_FACTORY_CONTRACTID "@mozilla.org/layout/element-factory;1"
|
||||
#define NS_ELEMENT_FACTORY_CONTRACTID_PREFIX NS_ELEMENT_FACTORY_CONTRACTID "?namespace="
|
||||
|
||||
#define NS_HTML_NAMESPACE "http://www.w3.org/1999/xhtml"
|
||||
#define NS_XML_NAMESPACE "http://www.w3.org/XML/1998/namespace"
|
||||
|
||||
#define NS_HTML_ELEMENT_FACTORY_CONTRACTID NS_ELEMENT_FACTORY_CONTRACTID_PREFIX NS_HTML_NAMESPACE
|
||||
#define NS_XML_ELEMENT_FACTORY_CONTRACTID NS_ELEMENT_FACTORY_CONTRACTID_PREFIX NS_XML_NAMESPACE
|
||||
|
||||
#ifdef MOZ_MATHML
|
||||
#define NS_MATHML_NAMESPACE "http://www.w3.org/1998/Math/MathML"
|
||||
#define NS_MATHML_ELEMENT_FACTORY_CONTRACTID NS_ELEMENT_FACTORY_CONTRACTID_PREFIX NS_MATHML_NAMESPACE
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
#define NS_SVG_NAMESPACE "http://www.w3.org/2000/svg"
|
||||
#define NS_SVG_ELEMENT_FACTORY_CONTRACTID NS_ELEMENT_FACTORY_CONTRACTID_PREFIX NS_SVG_NAMESPACE
|
||||
#endif
|
||||
|
||||
#endif /* nsIElementFactory_h___ */
|
||||
4600
mozilla/content/base/src/nsRuleNode.cpp
Normal file
4600
mozilla/content/base/src/nsRuleNode.cpp
Normal file
File diff suppressed because it is too large
Load Diff
883
mozilla/content/base/src/nsStyleContext.cpp
Normal file
883
mozilla/content/base/src/nsStyleContext.cpp
Normal file
@@ -0,0 +1,883 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* David Hyatt <hyatt@netscape.com>
|
||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsIStyleRule.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsStyleSet.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "prenv.h"
|
||||
|
||||
#include "nsRuleNode.h"
|
||||
#include "nsUnitConversion.h"
|
||||
#include "nsStyleContext.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
// #define NOISY_DEBUG
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
nsStyleContext::nsStyleContext(nsStyleContext* aParent,
|
||||
nsIAtom* aPseudoTag,
|
||||
nsRuleNode* aRuleNode,
|
||||
nsIPresContext* aPresContext)
|
||||
: mParent((nsStyleContext*)aParent),
|
||||
mChild(nsnull),
|
||||
mEmptyChild(nsnull),
|
||||
mPseudoTag(aPseudoTag),
|
||||
mRuleNode(aRuleNode),
|
||||
mBits(0),
|
||||
mRefCnt(0)
|
||||
{
|
||||
mNextSibling = this;
|
||||
mPrevSibling = this;
|
||||
if (mParent) {
|
||||
mParent->AddRef();
|
||||
mParent->AppendChild(this);
|
||||
}
|
||||
|
||||
ApplyStyleFixups(aPresContext);
|
||||
|
||||
NS_ASSERTION(NS_STYLE_INHERIT_MASK &
|
||||
(1 << PRInt32(nsStyleStructID_Length - 1)) != 0,
|
||||
"NS_STYLE_INHERIT_MASK must be bigger, and other bits shifted");
|
||||
}
|
||||
|
||||
nsStyleContext::~nsStyleContext()
|
||||
{
|
||||
NS_ASSERTION((nsnull == mChild) && (nsnull == mEmptyChild), "destructing context with children");
|
||||
|
||||
nsIPresContext *presContext = mRuleNode->GetPresContext();
|
||||
|
||||
presContext->PresShell()->StyleSet()->
|
||||
NotifyStyleContextDestroyed(presContext, this);
|
||||
|
||||
if (mParent) {
|
||||
mParent->RemoveChild(this);
|
||||
mParent->Release();
|
||||
}
|
||||
|
||||
// Free up our data structs.
|
||||
if (mCachedStyleData.mResetData || mCachedStyleData.mInheritedData) {
|
||||
mCachedStyleData.Destroy(mBits, presContext);
|
||||
}
|
||||
}
|
||||
|
||||
void nsStyleContext::AppendChild(nsStyleContext* aChild)
|
||||
{
|
||||
if (aChild->mRuleNode->IsRoot()) {
|
||||
// The child matched no rules.
|
||||
if (!mEmptyChild) {
|
||||
mEmptyChild = aChild;
|
||||
}
|
||||
else {
|
||||
aChild->mNextSibling = mEmptyChild;
|
||||
aChild->mPrevSibling = mEmptyChild->mPrevSibling;
|
||||
mEmptyChild->mPrevSibling->mNextSibling = aChild;
|
||||
mEmptyChild->mPrevSibling = aChild;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!mChild) {
|
||||
mChild = aChild;
|
||||
}
|
||||
else {
|
||||
aChild->mNextSibling = mChild;
|
||||
aChild->mPrevSibling = mChild->mPrevSibling;
|
||||
mChild->mPrevSibling->mNextSibling = aChild;
|
||||
mChild->mPrevSibling = aChild;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void nsStyleContext::RemoveChild(nsStyleContext* aChild)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aChild && this == aChild->mParent, "bad argument");
|
||||
|
||||
if (aChild->mRuleNode->IsRoot()) { // is empty
|
||||
if (aChild->mPrevSibling != aChild) { // has siblings
|
||||
if (mEmptyChild == aChild) {
|
||||
mEmptyChild = mEmptyChild->mNextSibling;
|
||||
}
|
||||
}
|
||||
else {
|
||||
NS_ASSERTION(mEmptyChild == aChild, "bad sibling pointers");
|
||||
mEmptyChild = nsnull;
|
||||
}
|
||||
}
|
||||
else { // isn't empty
|
||||
if (aChild->mPrevSibling != aChild) { // has siblings
|
||||
if (mChild == aChild) {
|
||||
mChild = mChild->mNextSibling;
|
||||
}
|
||||
}
|
||||
else {
|
||||
NS_ASSERTION(mChild == aChild, "bad sibling pointers");
|
||||
if (mChild == aChild) {
|
||||
mChild = nsnull;
|
||||
}
|
||||
}
|
||||
}
|
||||
aChild->mPrevSibling->mNextSibling = aChild->mNextSibling;
|
||||
aChild->mNextSibling->mPrevSibling = aChild->mPrevSibling;
|
||||
aChild->mNextSibling = aChild;
|
||||
aChild->mPrevSibling = aChild;
|
||||
}
|
||||
|
||||
already_AddRefed<nsStyleContext>
|
||||
nsStyleContext::FindChildWithRules(const nsIAtom* aPseudoTag,
|
||||
nsRuleNode* aRuleNode)
|
||||
{
|
||||
PRUint32 threshold = 10; // The # of siblings we're willing to examine
|
||||
// before just giving this whole thing up.
|
||||
|
||||
nsStyleContext* aResult = nsnull;
|
||||
|
||||
if ((nsnull != mChild) || (nsnull != mEmptyChild)) {
|
||||
nsStyleContext* child;
|
||||
if (aRuleNode->IsRoot()) {
|
||||
if (nsnull != mEmptyChild) {
|
||||
child = mEmptyChild;
|
||||
do {
|
||||
if (aPseudoTag == child->mPseudoTag) {
|
||||
aResult = child;
|
||||
break;
|
||||
}
|
||||
child = child->mNextSibling;
|
||||
threshold--;
|
||||
if (threshold == 0)
|
||||
break;
|
||||
} while (child != mEmptyChild);
|
||||
}
|
||||
}
|
||||
else if (nsnull != mChild) {
|
||||
child = mChild;
|
||||
|
||||
do {
|
||||
if (child->mRuleNode == aRuleNode && child->mPseudoTag == aPseudoTag) {
|
||||
aResult = child;
|
||||
break;
|
||||
}
|
||||
child = child->mNextSibling;
|
||||
threshold--;
|
||||
if (threshold == 0)
|
||||
break;
|
||||
} while (child != mChild);
|
||||
}
|
||||
}
|
||||
|
||||
if (aResult)
|
||||
aResult->AddRef();
|
||||
|
||||
return aResult;
|
||||
}
|
||||
|
||||
|
||||
PRBool nsStyleContext::Equals(const nsStyleContext* aOther) const
|
||||
{
|
||||
PRBool result = PR_TRUE;
|
||||
const nsStyleContext* other = (nsStyleContext*)aOther;
|
||||
|
||||
if (other != this) {
|
||||
if (mParent != other->mParent) {
|
||||
result = PR_FALSE;
|
||||
}
|
||||
else if (mBits != other->mBits) {
|
||||
result = PR_FALSE;
|
||||
}
|
||||
else if (mPseudoTag != other->mPseudoTag) {
|
||||
result = PR_FALSE;
|
||||
}
|
||||
else if (mRuleNode != other->mRuleNode) {
|
||||
result = PR_FALSE;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//=========================================================================================================
|
||||
|
||||
const nsStyleStruct* nsStyleContext::GetStyleData(nsStyleStructID aSID)
|
||||
{
|
||||
const nsStyleStruct* cachedData = mCachedStyleData.GetStyleData(aSID);
|
||||
if (cachedData)
|
||||
return cachedData; // We have computed data stored on this node in the context tree.
|
||||
return mRuleNode->GetStyleData(aSID, this, PR_TRUE); // Our rule node will take care of it for us.
|
||||
}
|
||||
|
||||
inline const nsStyleStruct* nsStyleContext::PeekStyleData(nsStyleStructID aSID)
|
||||
{
|
||||
const nsStyleStruct* cachedData = mCachedStyleData.GetStyleData(aSID);
|
||||
if (cachedData)
|
||||
return cachedData; // We have computed data stored on this node in the context tree.
|
||||
return mRuleNode->GetStyleData(aSID, this, PR_FALSE); // Our rule node will take care of it for us.
|
||||
}
|
||||
|
||||
void
|
||||
nsStyleContext::GetBorderPaddingFor(nsStyleBorderPadding& aBorderPadding)
|
||||
{
|
||||
nsMargin border, padding;
|
||||
if (GetStyleBorder()->GetBorder(border)) {
|
||||
if (GetStylePadding()->GetPadding(padding)) {
|
||||
border += padding;
|
||||
aBorderPadding.SetBorderPadding(border);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This is an evil evil function, since it forces you to alloc your own separate copy of
|
||||
// style data! Do not use this function unless you absolutely have to! You should avoid
|
||||
// this at all costs! -dwh
|
||||
nsStyleStruct*
|
||||
nsStyleContext::GetUniqueStyleData(nsIPresContext* aPresContext, const nsStyleStructID& aSID)
|
||||
{
|
||||
nsStyleStruct* result = nsnull;
|
||||
switch (aSID) {
|
||||
case eStyleStruct_Display: {
|
||||
const nsStyleDisplay* dis = GetStyleDisplay();
|
||||
nsStyleDisplay* newDis = new (aPresContext) nsStyleDisplay(*dis);
|
||||
SetStyle(aSID, newDis);
|
||||
result = newDis;
|
||||
mBits &= ~NS_STYLE_INHERIT_BIT(Display);
|
||||
break;
|
||||
}
|
||||
case eStyleStruct_Background: {
|
||||
const nsStyleBackground* bg = GetStyleBackground();
|
||||
nsStyleBackground* newBG = new (aPresContext) nsStyleBackground(*bg);
|
||||
SetStyle(aSID, newBG);
|
||||
result = newBG;
|
||||
mBits &= ~NS_STYLE_INHERIT_BIT(Background);
|
||||
break;
|
||||
}
|
||||
case eStyleStruct_Text: {
|
||||
const nsStyleText* text = GetStyleText();
|
||||
nsStyleText* newText = new (aPresContext) nsStyleText(*text);
|
||||
SetStyle(aSID, newText);
|
||||
result = newText;
|
||||
mBits &= ~NS_STYLE_INHERIT_BIT(Text);
|
||||
break;
|
||||
}
|
||||
case eStyleStruct_TextReset: {
|
||||
const nsStyleTextReset* reset = GetStyleTextReset();
|
||||
nsStyleTextReset* newReset = new (aPresContext) nsStyleTextReset(*reset);
|
||||
SetStyle(aSID, newReset);
|
||||
result = newReset;
|
||||
mBits &= ~NS_STYLE_INHERIT_BIT(TextReset);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
NS_ERROR("Struct type not supported. Please find another way to do this if you can!\n");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
nsStyleContext::SetStyle(nsStyleStructID aSID, nsStyleStruct* aStruct)
|
||||
{
|
||||
// This method should only be called from nsRuleNode! It is not a public
|
||||
// method!
|
||||
|
||||
NS_ASSERTION(aSID >= 0 && aSID < nsStyleStructID_Length, "out of bounds");
|
||||
|
||||
// NOTE: nsCachedStyleData::GetStyleData works roughly the same way.
|
||||
// See the comments there (in nsRuleNode.h) for more details about
|
||||
// what this is doing and why.
|
||||
|
||||
const nsCachedStyleData::StyleStructInfo& info =
|
||||
nsCachedStyleData::gInfo[aSID];
|
||||
char* resetOrInheritSlot = NS_REINTERPRET_CAST(char*, &mCachedStyleData) +
|
||||
info.mCachedStyleDataOffset;
|
||||
char* resetOrInherit = NS_REINTERPRET_CAST(char*,
|
||||
*NS_REINTERPRET_CAST(void**, resetOrInheritSlot));
|
||||
if (!resetOrInherit) {
|
||||
nsIPresContext *presContext = mRuleNode->GetPresContext();
|
||||
if (mCachedStyleData.IsReset(aSID)) {
|
||||
mCachedStyleData.mResetData = new (presContext) nsResetStyleData;
|
||||
resetOrInherit = NS_REINTERPRET_CAST(char*, mCachedStyleData.mResetData);
|
||||
} else {
|
||||
mCachedStyleData.mInheritedData =
|
||||
new (presContext) nsInheritedStyleData;
|
||||
resetOrInherit =
|
||||
NS_REINTERPRET_CAST(char*, mCachedStyleData.mInheritedData);
|
||||
}
|
||||
}
|
||||
char* dataSlot = resetOrInherit + info.mInheritResetOffset;
|
||||
*NS_REINTERPRET_CAST(nsStyleStruct**, dataSlot) = aStruct;
|
||||
}
|
||||
|
||||
void
|
||||
nsStyleContext::ApplyStyleFixups(nsIPresContext* aPresContext)
|
||||
{
|
||||
// See if we have any text decorations.
|
||||
// First see if our parent has text decorations. If our parent does, then we inherit the bit.
|
||||
if (mParent && mParent->HasTextDecorations())
|
||||
mBits |= NS_STYLE_HAS_TEXT_DECORATIONS;
|
||||
else {
|
||||
// We might have defined a decoration.
|
||||
const nsStyleTextReset* text = GetStyleTextReset();
|
||||
if (text->mTextDecoration != NS_STYLE_TEXT_DECORATION_NONE &&
|
||||
text->mTextDecoration != NS_STYLE_TEXT_DECORATION_OVERRIDE_ALL)
|
||||
mBits |= NS_STYLE_HAS_TEXT_DECORATIONS;
|
||||
}
|
||||
|
||||
// Correct tables.
|
||||
const nsStyleDisplay* disp = GetStyleDisplay();
|
||||
if (disp->mDisplay == NS_STYLE_DISPLAY_TABLE) {
|
||||
// -moz-center and -moz-right are used for HTML's alignment
|
||||
// This is covering the <div align="right"><table>...</table></div> case.
|
||||
// In this case, we don't want to inherit the text alignment into the table.
|
||||
const nsStyleText* text = GetStyleText();
|
||||
|
||||
if (text->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_CENTER ||
|
||||
text->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_RIGHT)
|
||||
{
|
||||
nsStyleText* uniqueText = (nsStyleText*)GetUniqueStyleData(aPresContext, eStyleStruct_Text);
|
||||
uniqueText->mTextAlign = NS_STYLE_TEXT_ALIGN_DEFAULT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsStyleContext::ClearStyleData(nsIPresContext* aPresContext)
|
||||
{
|
||||
// First we need to clear out all of our style data.
|
||||
if (mCachedStyleData.mResetData || mCachedStyleData.mInheritedData)
|
||||
mCachedStyleData.Destroy(mBits, aPresContext);
|
||||
|
||||
mBits = 0; // Clear all bits.
|
||||
|
||||
ApplyStyleFixups(aPresContext);
|
||||
|
||||
if (mChild) {
|
||||
nsStyleContext* child = mChild;
|
||||
do {
|
||||
child->ClearStyleData(aPresContext);
|
||||
child = child->mNextSibling;
|
||||
} while (mChild != child);
|
||||
}
|
||||
|
||||
if (mEmptyChild) {
|
||||
nsStyleContext* child = mEmptyChild;
|
||||
do {
|
||||
child->ClearStyleData(aPresContext);
|
||||
child = child->mNextSibling;
|
||||
} while (mEmptyChild != child);
|
||||
}
|
||||
}
|
||||
|
||||
nsChangeHint
|
||||
nsStyleContext::CalcStyleDifference(nsStyleContext* aOther)
|
||||
{
|
||||
nsChangeHint hint = NS_STYLE_HINT_NONE;
|
||||
NS_ENSURE_TRUE(aOther, hint);
|
||||
// We must always ensure that we populate the structs on the new style
|
||||
// context that are filled in on the old context, so that if we get
|
||||
// two style changes in succession, the second of which causes a real
|
||||
// style change, the PeekStyleData doesn't fail.
|
||||
|
||||
// If our rule nodes are the same, then we are looking at the same
|
||||
// style data. We know this because CalcStyleDifference is always
|
||||
// called on two style contexts that point to the same element, so we
|
||||
// know that our position in the style context tree is the same and
|
||||
// our position in the rule node tree is also the same.
|
||||
PRBool compare = mRuleNode != aOther->mRuleNode;
|
||||
|
||||
nsChangeHint maxHint = NS_STYLE_HINT_FRAMECHANGE;
|
||||
|
||||
#define DO_STRUCT_DIFFERENCE(struct_) \
|
||||
PR_BEGIN_MACRO \
|
||||
const nsStyle##struct_* this##struct_ = \
|
||||
NS_STATIC_CAST(const nsStyle##struct_*, \
|
||||
PeekStyleData(NS_GET_STYLESTRUCTID(nsStyle##struct_))); \
|
||||
if (this##struct_) { \
|
||||
const nsStyle##struct_* other##struct_ = \
|
||||
NS_STATIC_CAST(const nsStyle##struct_*, \
|
||||
aOther->GetStyleData(NS_GET_STYLESTRUCTID(nsStyle##struct_))); \
|
||||
if (compare && \
|
||||
!NS_IsHintSubset(maxHint, hint) && \
|
||||
this##struct_ != other##struct_) { \
|
||||
NS_UpdateHint(hint, this##struct_->CalcDifference(*other##struct_)); \
|
||||
} \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
|
||||
// We begin by examining those style structs that are capable of
|
||||
// causing the maximal difference, a FRAMECHANGE.
|
||||
// FRAMECHANGE Structs: Display, XUL, Content, UserInterface,
|
||||
// Visibility, Quotes
|
||||
DO_STRUCT_DIFFERENCE(Display);
|
||||
DO_STRUCT_DIFFERENCE(XUL);
|
||||
DO_STRUCT_DIFFERENCE(Content);
|
||||
DO_STRUCT_DIFFERENCE(UserInterface);
|
||||
DO_STRUCT_DIFFERENCE(Visibility);
|
||||
#ifdef MOZ_SVG
|
||||
DO_STRUCT_DIFFERENCE(SVG);
|
||||
#endif
|
||||
// If the quotes implementation is ever going to change we might not need
|
||||
// a framechange here and a reflow should be sufficient. See bug 35768.
|
||||
DO_STRUCT_DIFFERENCE(Quotes);
|
||||
|
||||
// At this point, we know that the worst kind of damage we could do is
|
||||
// a reflow.
|
||||
maxHint = NS_STYLE_HINT_REFLOW;
|
||||
|
||||
// The following structs cause (as their maximal difference) a reflow
|
||||
// to occur. REFLOW Structs: Font, Margin, Padding, Border, List,
|
||||
// Position, Text, TextReset, Table, TableBorder
|
||||
DO_STRUCT_DIFFERENCE(Font);
|
||||
DO_STRUCT_DIFFERENCE(Margin);
|
||||
DO_STRUCT_DIFFERENCE(Padding);
|
||||
DO_STRUCT_DIFFERENCE(Border);
|
||||
DO_STRUCT_DIFFERENCE(List);
|
||||
DO_STRUCT_DIFFERENCE(Position);
|
||||
DO_STRUCT_DIFFERENCE(Text);
|
||||
DO_STRUCT_DIFFERENCE(TextReset);
|
||||
DO_STRUCT_DIFFERENCE(Table);
|
||||
DO_STRUCT_DIFFERENCE(TableBorder);
|
||||
|
||||
// At this point, we know that the worst kind of damage we could do is
|
||||
// a re-render (i.e., a VISUAL change).
|
||||
maxHint = NS_STYLE_HINT_VISUAL;
|
||||
|
||||
// The following structs cause (as their maximal difference) a
|
||||
// re-render to occur. VISUAL Structs: Color, Background, Outline,
|
||||
// UIReset
|
||||
DO_STRUCT_DIFFERENCE(Color);
|
||||
DO_STRUCT_DIFFERENCE(Background);
|
||||
DO_STRUCT_DIFFERENCE(Outline);
|
||||
DO_STRUCT_DIFFERENCE(UIReset);
|
||||
|
||||
#undef DO_STRUCT_DIFFERENCE
|
||||
|
||||
return hint;
|
||||
}
|
||||
|
||||
void
|
||||
nsStyleContext::Mark()
|
||||
{
|
||||
// Mark our rule node.
|
||||
mRuleNode->Mark();
|
||||
|
||||
// Mark our children (i.e., tell them to mark their rule nodes, etc.).
|
||||
if (mChild) {
|
||||
nsStyleContext* child = mChild;
|
||||
do {
|
||||
child->Mark();
|
||||
child = child->mNextSibling;
|
||||
} while (mChild != child);
|
||||
}
|
||||
|
||||
if (mEmptyChild) {
|
||||
nsStyleContext* child = mEmptyChild;
|
||||
do {
|
||||
child->Mark();
|
||||
child = child->mNextSibling;
|
||||
} while (mEmptyChild != child);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
class URICString : public nsCAutoString {
|
||||
public:
|
||||
URICString(nsIURI* aURI) {
|
||||
if (aURI) {
|
||||
aURI->GetSpec(*this);
|
||||
} else {
|
||||
Assign("[none]");
|
||||
}
|
||||
}
|
||||
|
||||
URICString& operator=(const URICString& aOther) {
|
||||
Assign(aOther);
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
void nsStyleContext::List(FILE* out, PRInt32 aIndent)
|
||||
{
|
||||
// Indent
|
||||
PRInt32 ix;
|
||||
for (ix = aIndent; --ix >= 0; ) fputs(" ", out);
|
||||
fprintf(out, "%p(%d) parent=%p ",
|
||||
(void*)this, mRefCnt, (void *)mParent);
|
||||
if (mPseudoTag) {
|
||||
nsAutoString buffer;
|
||||
mPseudoTag->ToString(buffer);
|
||||
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
||||
fputs(" ", out);
|
||||
}
|
||||
|
||||
if (mRuleNode) {
|
||||
fputs("{\n", out);
|
||||
nsRuleNode* ruleNode = mRuleNode;
|
||||
while (ruleNode) {
|
||||
nsIStyleRule *styleRule = ruleNode->GetRule();
|
||||
if (styleRule) {
|
||||
styleRule->List(out, aIndent + 1);
|
||||
}
|
||||
ruleNode = ruleNode->GetParent();
|
||||
}
|
||||
for (ix = aIndent; --ix >= 0; ) fputs(" ", out);
|
||||
fputs("}\n", out);
|
||||
}
|
||||
else {
|
||||
fputs("{}\n", out);
|
||||
}
|
||||
|
||||
if (nsnull != mChild) {
|
||||
nsStyleContext* child = mChild;
|
||||
do {
|
||||
child->List(out, aIndent + 1);
|
||||
child = child->mNextSibling;
|
||||
} while (mChild != child);
|
||||
}
|
||||
if (nsnull != mEmptyChild) {
|
||||
nsStyleContext* child = mEmptyChild;
|
||||
do {
|
||||
child->List(out, aIndent + 1);
|
||||
child = child->mNextSibling;
|
||||
} while (mEmptyChild != child);
|
||||
}
|
||||
}
|
||||
|
||||
static void IndentBy(FILE* out, PRInt32 aIndent) {
|
||||
while (--aIndent >= 0) fputs(" ", out);
|
||||
}
|
||||
// virtual
|
||||
void nsStyleContext::DumpRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent)
|
||||
{
|
||||
nsAutoString str;
|
||||
|
||||
// FONT
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleFont* font = GetStyleFont();
|
||||
fprintf(out, "<font %s %d %d %d />\n",
|
||||
NS_ConvertUCS2toUTF8(font->mFont.name).get(),
|
||||
font->mFont.size,
|
||||
font->mSize,
|
||||
font->mFlags);
|
||||
|
||||
// COLOR
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleColor* color = GetStyleColor();
|
||||
fprintf(out, "<color data=\"%ld\"/>\n",
|
||||
(long)color->mColor);
|
||||
|
||||
// BACKGROUND
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleBackground* bg = GetStyleBackground();
|
||||
fprintf(out, "<background data=\"%d %d %d %ld %ld %ld %s\"/>\n",
|
||||
(int)bg->mBackgroundAttachment,
|
||||
(int)bg->mBackgroundFlags,
|
||||
(int)bg->mBackgroundRepeat,
|
||||
(long)bg->mBackgroundColor,
|
||||
(long)bg->mBackgroundXPosition.mCoord, // potentially lossy on some platforms
|
||||
(long)bg->mBackgroundYPosition.mCoord, // potentially lossy on some platforms
|
||||
URICString(bg->mBackgroundImage).get());
|
||||
|
||||
// SPACING (ie. margin, padding, border, outline)
|
||||
IndentBy(out,aIndent);
|
||||
fprintf(out, "<spacing data=\"");
|
||||
|
||||
const nsStyleMargin* margin = GetStyleMargin();
|
||||
margin->mMargin.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
|
||||
const nsStylePadding* padding = GetStylePadding();
|
||||
padding->mPadding.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
|
||||
const nsStyleBorder* border = GetStyleBorder();
|
||||
border->mBorder.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
border->mBorderRadius.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
|
||||
const nsStyleOutline* outline = GetStyleOutline();
|
||||
outline->mOutlineRadius.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
outline->mOutlineWidth.ToString(str);
|
||||
fprintf(out, "%s", NS_ConvertUCS2toUTF8(str).get());
|
||||
fprintf(out, "%d", (int)border->mFloatEdge);
|
||||
fprintf(out, "\" />\n");
|
||||
|
||||
// LIST
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleList* list = GetStyleList();
|
||||
fprintf(out, "<list data=\"%d %d %s\" />\n",
|
||||
(int)list->mListStyleType,
|
||||
(int)list->mListStyleType,
|
||||
URICString(list->mListStyleImage).get());
|
||||
|
||||
// POSITION
|
||||
IndentBy(out,aIndent);
|
||||
const nsStylePosition* pos = GetStylePosition();
|
||||
fprintf(out, "<position data=\"");
|
||||
pos->mOffset.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
pos->mWidth.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
pos->mMinWidth.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
pos->mMaxWidth.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
pos->mHeight.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
pos->mMinHeight.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
pos->mMaxHeight.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
fprintf(out, "%d ", (int)pos->mBoxSizing);
|
||||
pos->mZIndex.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
fprintf(out, "\" />\n");
|
||||
|
||||
// TEXT
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleText* text = GetStyleText();
|
||||
fprintf(out, "<text data=\"%d %d %d ",
|
||||
(int)text->mTextAlign,
|
||||
(int)text->mTextTransform,
|
||||
(int)text->mWhiteSpace);
|
||||
text->mLetterSpacing.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
text->mLineHeight.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
text->mTextIndent.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
text->mWordSpacing.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
fprintf(out, "\" />\n");
|
||||
|
||||
// TEXT RESET
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleTextReset* textReset = GetStyleTextReset();
|
||||
fprintf(out, "<textreset data=\"%d ",
|
||||
(int)textReset->mTextDecoration);
|
||||
textReset->mVerticalAlign.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
fprintf(out, "\" />\n");
|
||||
|
||||
// DISPLAY
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleDisplay* disp = GetStyleDisplay();
|
||||
fprintf(out, "<display data=\"%d %d %f %d %d %d %d %d %d %ld %ld %ld %ld %s\" />\n",
|
||||
(int)disp->mPosition,
|
||||
(int)disp->mDisplay,
|
||||
(float)disp->mOpacity,
|
||||
(int)disp->mFloats,
|
||||
(int)disp->mBreakType,
|
||||
(int)disp->mBreakBefore,
|
||||
(int)disp->mBreakAfter,
|
||||
(int)disp->mOverflow,
|
||||
(int)disp->mClipFlags,
|
||||
(long)disp->mClip.x,
|
||||
(long)disp->mClip.y,
|
||||
(long)disp->mClip.width,
|
||||
(long)disp->mClip.height,
|
||||
URICString(disp->mBinding).get()
|
||||
);
|
||||
|
||||
// VISIBILITY
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleVisibility* vis = GetStyleVisibility();
|
||||
fprintf(out, "<visibility data=\"%d %d\" />\n",
|
||||
(int)vis->mDirection,
|
||||
(int)vis->mVisible
|
||||
);
|
||||
|
||||
// TABLE
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleTable* table = GetStyleTable();
|
||||
fprintf(out, "<table data=\"%d %d %d ",
|
||||
(int)table->mLayoutStrategy,
|
||||
(int)table->mFrame,
|
||||
(int)table->mRules);
|
||||
fprintf(out, "%ld %ld ",
|
||||
(long)table->mCols,
|
||||
(long)table->mSpan);
|
||||
fprintf(out, "\" />\n");
|
||||
|
||||
// TABLEBORDER
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleTableBorder* tableBorder = GetStyleTableBorder();
|
||||
fprintf(out, "<tableborder data=\"%d ",
|
||||
(int)tableBorder->mBorderCollapse);
|
||||
tableBorder->mBorderSpacingX.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
tableBorder->mBorderSpacingY.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
fprintf(out, "%d %d ",
|
||||
(int)tableBorder->mCaptionSide,
|
||||
(int)tableBorder->mEmptyCells);
|
||||
fprintf(out, "\" />\n");
|
||||
|
||||
// CONTENT
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleContent* content = GetStyleContent();
|
||||
fprintf(out, "<content data=\"%ld %ld %ld ",
|
||||
(long)content->ContentCount(),
|
||||
(long)content->CounterIncrementCount(),
|
||||
(long)content->CounterResetCount());
|
||||
// XXX: iterate over the content and counters...
|
||||
content->mMarkerOffset.ToString(str);
|
||||
fprintf(out, "%s ", NS_ConvertUCS2toUTF8(str).get());
|
||||
fprintf(out, "\" />\n");
|
||||
|
||||
// QUOTES
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleQuotes* quotes = GetStyleQuotes();
|
||||
fprintf(out, "<quotes data=\"%ld ",
|
||||
(long)quotes->QuotesCount());
|
||||
// XXX: iterate over the quotes...
|
||||
fprintf(out, "\" />\n");
|
||||
|
||||
// UI
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleUserInterface* ui = GetStyleUserInterface();
|
||||
fprintf(out, "<ui data=\"%d %d %d %d\" />\n",
|
||||
(int)ui->mUserInput,
|
||||
(int)ui->mUserModify,
|
||||
(int)ui->mUserFocus,
|
||||
(int)ui->mCursor);
|
||||
|
||||
// UIReset
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleUIReset* uiReset = GetStyleUIReset();
|
||||
fprintf(out, "<uireset data=\"%d %d %d\" />\n",
|
||||
(int)uiReset->mUserSelect,
|
||||
(int)uiReset->mKeyEquivalent,
|
||||
(int)uiReset->mResizer);
|
||||
|
||||
// XUL
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleXUL* xul = GetStyleXUL();
|
||||
fprintf(out, "<xul data=\"%d %d %d %d %d %d",
|
||||
(int)xul->mBoxAlign,
|
||||
(int)xul->mBoxDirection,
|
||||
(int)xul->mBoxFlex,
|
||||
(int)xul->mBoxOrient,
|
||||
(int)xul->mBoxPack,
|
||||
(int)xul->mBoxOrdinal);
|
||||
fprintf(out, "\" />\n");
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
// SVG
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleSVG* svg = GetStyleSVG();
|
||||
fprintf(out, "<svg data=\"%d %ld %f %d %d %d %d %ld %s %f %d %d %f %f %f %d %d\" />\n",
|
||||
(int)svg->mFill.mType,
|
||||
(long)svg->mFill.mColor,
|
||||
svg->mFillOpacity,
|
||||
(int)svg->mFillRule,
|
||||
(int)svg->mPointerEvents,
|
||||
(int)svg->mShapeRendering,
|
||||
(int)svg->mStroke.mType,
|
||||
(long)svg->mStroke.mColor,
|
||||
NS_ConvertUCS2toUTF8(svg->mStrokeDasharray).get(),
|
||||
svg->mStrokeDashoffset,
|
||||
(int)svg->mStrokeLinecap,
|
||||
(int)svg->mStrokeLinejoin,
|
||||
svg->mStrokeMiterlimit,
|
||||
svg->mStrokeOpacity,
|
||||
svg->mStrokeWidth,
|
||||
(int)svg->mTextAnchor,
|
||||
(int)svg->mTextRendering);
|
||||
|
||||
// SVGReset
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleSVGReset* svgReset = GetStyleSVGReset();
|
||||
fprintf(out, "<svgreset data=\"%d\" />\n",
|
||||
(int)svgReset->mDominantBaseline);
|
||||
#endif
|
||||
//#insert new style structs here#
|
||||
}
|
||||
#endif
|
||||
|
||||
// Overloaded new operator. Initializes the memory to 0 and relies on an arena
|
||||
// (which comes from the presShell) to perform the allocation.
|
||||
void*
|
||||
nsStyleContext::operator new(size_t sz, nsIPresContext* aPresContext) CPP_THROW_NEW
|
||||
{
|
||||
// Check the recycle list first.
|
||||
void* result = nsnull;
|
||||
aPresContext->AllocateFromShell(sz, &result);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Overridden to prevent the global delete from being called, since the memory
|
||||
// came out of an nsIArena instead of the global delete operator's heap.
|
||||
void
|
||||
nsStyleContext::Destroy()
|
||||
{
|
||||
// Get the pres context from our rule node.
|
||||
nsCOMPtr<nsIPresContext> presContext = mRuleNode->GetPresContext();
|
||||
|
||||
// Call our destructor.
|
||||
this->~nsStyleContext();
|
||||
|
||||
// Don't let the memory be freed, since it will be recycled
|
||||
// instead. Don't call the global operator delete.
|
||||
presContext->FreeToShell(sizeof(nsStyleContext), this);
|
||||
}
|
||||
|
||||
already_AddRefed<nsStyleContext>
|
||||
NS_NewStyleContext(nsStyleContext* aParentContext,
|
||||
nsIAtom* aPseudoTag,
|
||||
nsRuleNode* aRuleNode,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
nsStyleContext* context = new (aPresContext) nsStyleContext(aParentContext, aPseudoTag,
|
||||
aRuleNode, aPresContext);
|
||||
if (context)
|
||||
context->AddRef();
|
||||
return context;
|
||||
}
|
||||
|
||||
1300
mozilla/content/html/style/src/nsCSSDeclaration.cpp
Normal file
1300
mozilla/content/html/style/src/nsCSSDeclaration.cpp
Normal file
File diff suppressed because it is too large
Load Diff
250
mozilla/content/html/style/src/nsCSSDeclaration.h
Normal file
250
mozilla/content/html/style/src/nsCSSDeclaration.h
Normal file
@@ -0,0 +1,250 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Daniel Glazman <glazman@netscape.com>
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#ifndef nsCSSDeclaration_h___
|
||||
#define nsCSSDeclaration_h___
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsColor.h"
|
||||
#include <stdio.h>
|
||||
#include "nsString.h"
|
||||
#include "nsCoord.h"
|
||||
#include "nsCSSValue.h"
|
||||
#include "nsCSSProps.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsValueArray.h"
|
||||
#include "nsCSSDataBlock.h"
|
||||
#include "nsCSSStruct.h"
|
||||
|
||||
class nsCSSDeclaration {
|
||||
public:
|
||||
/**
|
||||
* Construct an |nsCSSDeclaration| that is in an invalid state (null
|
||||
* |mData|) and cannot be used until its |CompressFrom| method or
|
||||
* |InitializeEmpty| method is called.
|
||||
*/
|
||||
nsCSSDeclaration();
|
||||
|
||||
nsCSSDeclaration(const nsCSSDeclaration& aCopy);
|
||||
|
||||
/**
|
||||
* |ValueAppended| must be called to maintain this declaration's
|
||||
* |mOrder| whenever a property is parsed into an expanded data block
|
||||
* for this declaration.
|
||||
*/
|
||||
nsresult ValueAppended(nsCSSProperty aProperty);
|
||||
|
||||
nsresult AppendComment(const nsAString& aComment);
|
||||
nsresult RemoveProperty(nsCSSProperty aProperty);
|
||||
|
||||
nsresult GetValue(nsCSSProperty aProperty, nsAString& aValue) const;
|
||||
nsresult GetValue(const nsAString& aProperty, nsAString& aValue) const;
|
||||
|
||||
PRBool HasImportantData() const { return mImportantData != nsnull; }
|
||||
PRBool GetValueIsImportant(nsCSSProperty aProperty) const;
|
||||
PRBool GetValueIsImportant(const nsAString& aProperty) const;
|
||||
|
||||
PRUint32 Count() const;
|
||||
nsresult GetNthProperty(PRUint32 aIndex, nsAString& aReturn) const;
|
||||
|
||||
nsresult ToString(nsAString& aString) const;
|
||||
|
||||
nsCSSDeclaration* Clone() const;
|
||||
|
||||
nsresult MapRuleInfoInto(nsRuleData *aRuleData) const {
|
||||
return mData->MapRuleInfoInto(aRuleData);
|
||||
}
|
||||
|
||||
nsresult MapImportantRuleInfoInto(nsRuleData *aRuleData) const {
|
||||
return mImportantData->MapRuleInfoInto(aRuleData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize this declaration as holding no data. Return false on
|
||||
* out-of-memory.
|
||||
*/
|
||||
PRBool InitializeEmpty();
|
||||
|
||||
/**
|
||||
* Transfer all of the state from |aExpandedData| into this declaration.
|
||||
* After calling, |aExpandedData| should be in its initial state.
|
||||
*/
|
||||
void CompressFrom(nsCSSExpandedDataBlock *aExpandedData) {
|
||||
NS_ASSERTION(!mData, "oops");
|
||||
NS_ASSERTION(!mImportantData, "oops");
|
||||
aExpandedData->Compress(&mData, &mImportantData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transfer all of the state from this declaration into
|
||||
* |aExpandedData| and put this declaration temporarily into an
|
||||
* invalid state (ended by |CompressFrom| or |InitializeEmpty|) that
|
||||
* should last only during parsing. During this time only
|
||||
* |ValueAppended| should be called.
|
||||
*/
|
||||
void ExpandTo(nsCSSExpandedDataBlock *aExpandedData) {
|
||||
aExpandedData->AssertInitialState();
|
||||
|
||||
NS_ASSERTION(mData, "oops");
|
||||
aExpandedData->Expand(&mData, &mImportantData);
|
||||
NS_ASSERTION(!mData && !mImportantData,
|
||||
"Expand didn't null things out");
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the data, in preparation for its replacement with entirely
|
||||
* new data by a call to |CompressFrom|.
|
||||
*/
|
||||
void ClearData() {
|
||||
mData->Destroy();
|
||||
mData = nsnull;
|
||||
if (mImportantData) {
|
||||
mImportantData->Destroy();
|
||||
mImportantData = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
private:
|
||||
// Not implemented, and not supported.
|
||||
nsCSSDeclaration& operator=(const nsCSSDeclaration& aCopy);
|
||||
PRBool operator==(const nsCSSDeclaration& aCopy) const;
|
||||
|
||||
void AppendImportanceToString(PRBool aIsImportant, nsAString& aString) const;
|
||||
// return whether there was a value in |aValue| (i.e., it had a non-null unit)
|
||||
PRBool AppendValueToString(nsCSSProperty aProperty, nsAString& aResult) const;
|
||||
// return whether there was a value in |aValue| (i.e., it had a non-null unit)
|
||||
PRBool AppendCSSValueToString(nsCSSProperty aProperty, const nsCSSValue& aValue, nsAString& aResult) const;
|
||||
|
||||
// May be called only for properties whose type is eCSSType_Value.
|
||||
nsresult GetValueOrImportantValue(nsCSSProperty aProperty, nsCSSValue& aValue) const;
|
||||
|
||||
void PropertyIsSet(PRInt32 & aPropertyIndex, PRInt32 aIndex, PRUint32 & aSet, PRUint32 aValue) const;
|
||||
PRBool TryBorderShorthand(nsAString & aString, PRUint32 aPropertiesSet,
|
||||
PRInt32 aBorderTopWidth,
|
||||
PRInt32 aBorderTopStyle,
|
||||
PRInt32 aBorderTopColor,
|
||||
PRInt32 aBorderBottomWidth,
|
||||
PRInt32 aBorderBottomStyle,
|
||||
PRInt32 aBorderBottomColor,
|
||||
PRInt32 aBorderLeftWidth,
|
||||
PRInt32 aBorderLeftStyle,
|
||||
PRInt32 aBorderLeftColor,
|
||||
PRInt32 aBorderRightWidth,
|
||||
PRInt32 aBorderRightStyle,
|
||||
PRInt32 aBorderRightColor) const;
|
||||
PRBool TryBorderSideShorthand(nsAString & aString,
|
||||
nsCSSProperty aShorthand,
|
||||
PRInt32 aBorderWidth,
|
||||
PRInt32 aBorderStyle,
|
||||
PRInt32 aBorderColor) const;
|
||||
PRBool TryFourSidesShorthand(nsAString & aString,
|
||||
nsCSSProperty aShorthand,
|
||||
PRInt32 & aTop,
|
||||
PRInt32 & aBottom,
|
||||
PRInt32 & aLeft,
|
||||
PRInt32 & aRight,
|
||||
PRBool aClearIndexes) const;
|
||||
void TryBackgroundShorthand(nsAString & aString,
|
||||
PRInt32 & aBgColor, PRInt32 & aBgImage,
|
||||
PRInt32 & aBgRepeat, PRInt32 & aBgAttachment,
|
||||
PRInt32 & aBgPositionX,
|
||||
PRInt32 & aBgPositionY) const;
|
||||
void UseBackgroundPosition(nsAString & aString,
|
||||
PRInt32 & aBgPositionX,
|
||||
PRInt32 & aBgPositionY) const;
|
||||
|
||||
PRBool AllPropertiesSameImportance(PRInt32 aFirst, PRInt32 aSecond,
|
||||
PRInt32 aThird, PRInt32 aFourth,
|
||||
PRInt32 aFifth, PRInt32 aSixth,
|
||||
PRBool & aImportance) const;
|
||||
PRBool AllPropertiesSameValue(PRInt32 aFirst, PRInt32 aSecond,
|
||||
PRInt32 aThird, PRInt32 aFourth) const;
|
||||
void AppendPropertyAndValueToString(nsCSSProperty aProperty,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
AppendPropertyAndValueToString(aProperty, aProperty, aResult);
|
||||
}
|
||||
void AppendPropertyAndValueToString(nsCSSProperty aProperty,
|
||||
nsCSSProperty aPropertyName,
|
||||
nsAString& aResult) const;
|
||||
|
||||
private:
|
||||
//
|
||||
// Specialized ref counting.
|
||||
// We do not want everyone to ref count us, only the rules which hold
|
||||
// onto us (our well defined lifetime is when the last rule releases
|
||||
// us).
|
||||
// It's worth a comment here that the main nsCSSDeclaration is refcounted,
|
||||
// but it's |mImportant| is not refcounted, but just owned by the
|
||||
// non-important declaration.
|
||||
//
|
||||
friend class CSSStyleRuleImpl;
|
||||
void AddRef(void) {
|
||||
++mRefCnt;
|
||||
}
|
||||
void Release(void) {
|
||||
NS_ASSERTION(0 < mRefCnt, "bad Release");
|
||||
if (0 == --mRefCnt) {
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
public:
|
||||
void RuleAbort(void) {
|
||||
NS_ASSERTION(0 == mRefCnt, "bad RuleAbort");
|
||||
delete this;
|
||||
}
|
||||
private:
|
||||
// Block everyone, except us or a derivative, from deleting us.
|
||||
~nsCSSDeclaration(void);
|
||||
|
||||
nsCSSProperty OrderValueAt(nsValueArrayIndex aValue) const {
|
||||
return nsCSSProperty(mOrder.ValueAt(aValue));
|
||||
}
|
||||
|
||||
private:
|
||||
nsValueArray mOrder;
|
||||
nsAutoRefCnt mRefCnt;
|
||||
nsCSSCompressedDataBlock *mData; // never null, except while expanded
|
||||
nsCSSCompressedDataBlock *mImportantData; // may be null
|
||||
};
|
||||
|
||||
#endif /* nsCSSDeclaration_h___ */
|
||||
5646
mozilla/content/html/style/src/nsCSSParser.cpp
Normal file
5646
mozilla/content/html/style/src/nsCSSParser.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1219
mozilla/content/html/style/src/nsCSSStruct.cpp
Normal file
1219
mozilla/content/html/style/src/nsCSSStruct.cpp
Normal file
File diff suppressed because it is too large
Load Diff
531
mozilla/content/html/style/src/nsCSSStruct.h
Normal file
531
mozilla/content/html/style/src/nsCSSStruct.h
Normal file
@@ -0,0 +1,531 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Daniel Glazman <glazman@netscape.com>
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#ifndef nsCSSStruct_h___
|
||||
#define nsCSSStruct_h___
|
||||
|
||||
#include "nsCSSValue.h"
|
||||
#include <stdio.h>
|
||||
|
||||
struct nsCSSStruct {
|
||||
// EMPTY on purpose. ABSTRACT with no virtuals (typedef void nsCSSStruct?)
|
||||
};
|
||||
|
||||
// We use the nsCSS* structures for storing nsCSSDeclaration's
|
||||
// *temporary* data during parsing and modification. (They are too big
|
||||
// for permanent storage.) We also use them for nsRuleData, with some
|
||||
// additions of things that the style system must cascade, but that
|
||||
// aren't CSS properties. Thus we use typedefs and inheritance
|
||||
// (forwards, when the rule data needs extra data) to make the rule data
|
||||
// structs from the declaration structs.
|
||||
typedef nsCSSStruct nsRuleDataStruct;
|
||||
|
||||
|
||||
struct nsCSSFont : public nsCSSStruct {
|
||||
nsCSSFont(void);
|
||||
nsCSSFont(const nsCSSFont& aCopy);
|
||||
~nsCSSFont(void);
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
nsCSSValue mFamily;
|
||||
nsCSSValue mStyle;
|
||||
nsCSSValue mVariant;
|
||||
nsCSSValue mWeight;
|
||||
nsCSSValue mSize;
|
||||
nsCSSValue mSizeAdjust; // NEW
|
||||
nsCSSValue mStretch; // NEW
|
||||
};
|
||||
|
||||
struct nsRuleDataFont : public nsCSSFont {
|
||||
PRBool mFamilyFromHTML; // Is the family from an HTML FONT element
|
||||
};
|
||||
|
||||
struct nsCSSValueList {
|
||||
nsCSSValueList(void);
|
||||
nsCSSValueList(const nsCSSValueList& aCopy);
|
||||
~nsCSSValueList(void);
|
||||
|
||||
static PRBool Equal(nsCSSValueList* aList1, nsCSSValueList* aList2);
|
||||
|
||||
nsCSSValue mValue;
|
||||
nsCSSValueList* mNext;
|
||||
};
|
||||
|
||||
struct nsCSSColor : public nsCSSStruct {
|
||||
nsCSSColor(void);
|
||||
nsCSSColor(const nsCSSColor& aCopy);
|
||||
~nsCSSColor(void);
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
nsCSSValue mColor;
|
||||
nsCSSValue mBackColor;
|
||||
nsCSSValue mBackImage;
|
||||
nsCSSValue mBackRepeat;
|
||||
nsCSSValue mBackAttachment;
|
||||
nsCSSValue mBackPositionX;
|
||||
nsCSSValue mBackPositionY;
|
||||
nsCSSValue mBackClip;
|
||||
nsCSSValue mBackOrigin;
|
||||
nsCSSValue mBackInlinePolicy;
|
||||
};
|
||||
|
||||
struct nsRuleDataColor : public nsCSSColor {
|
||||
};
|
||||
|
||||
struct nsCSSShadow {
|
||||
nsCSSShadow(void);
|
||||
nsCSSShadow(const nsCSSShadow& aCopy);
|
||||
~nsCSSShadow(void);
|
||||
|
||||
static PRBool Equal(nsCSSShadow* aList1, nsCSSShadow* aList2);
|
||||
|
||||
nsCSSValue mColor;
|
||||
nsCSSValue mXOffset;
|
||||
nsCSSValue mYOffset;
|
||||
nsCSSValue mRadius;
|
||||
nsCSSShadow* mNext;
|
||||
};
|
||||
|
||||
struct nsCSSText : public nsCSSStruct {
|
||||
nsCSSText(void);
|
||||
nsCSSText(const nsCSSText& aCopy);
|
||||
~nsCSSText(void);
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
nsCSSValue mWordSpacing;
|
||||
nsCSSValue mLetterSpacing;
|
||||
nsCSSValue mVerticalAlign;
|
||||
nsCSSValue mTextTransform;
|
||||
nsCSSValue mTextAlign;
|
||||
nsCSSValue mTextIndent;
|
||||
nsCSSValue mDecoration;
|
||||
nsCSSShadow* mTextShadow; // NEW
|
||||
nsCSSValue mUnicodeBidi; // NEW
|
||||
nsCSSValue mLineHeight;
|
||||
nsCSSValue mWhiteSpace;
|
||||
};
|
||||
|
||||
struct nsRuleDataText : public nsCSSText {
|
||||
};
|
||||
|
||||
#define FOR_CSS_SIDES(var_) for (PRInt32 var_ = 0; var_ < 4; ++var_)
|
||||
|
||||
struct nsCSSRect {
|
||||
nsCSSRect(void);
|
||||
nsCSSRect(const nsCSSRect& aCopy);
|
||||
~nsCSSRect();
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = 0, nsCSSProperty aPropID = eCSSProperty_UNKNOWN, PRInt32 aIndent = 0) const;
|
||||
void List(FILE* out, PRInt32 aIndent, const nsCSSProperty aTRBL[]) const;
|
||||
#endif
|
||||
|
||||
PRBool operator==(const nsCSSRect& aOther) const {
|
||||
return mTop == aOther.mTop &&
|
||||
mRight == aOther.mRight &&
|
||||
mBottom == aOther.mBottom &&
|
||||
mLeft == aOther.mLeft;
|
||||
}
|
||||
|
||||
PRBool operator!=(const nsCSSRect& aOther) const {
|
||||
return mTop != aOther.mTop ||
|
||||
mRight != aOther.mRight ||
|
||||
mBottom != aOther.mBottom ||
|
||||
mLeft != aOther.mLeft;
|
||||
}
|
||||
|
||||
void SetAllSidesTo(const nsCSSValue& aValue);
|
||||
|
||||
nsCSSValue mTop;
|
||||
nsCSSValue mRight;
|
||||
nsCSSValue mBottom;
|
||||
nsCSSValue mLeft;
|
||||
|
||||
typedef nsCSSValue nsCSSRect::*side_type;
|
||||
static const side_type sides[4];
|
||||
};
|
||||
|
||||
struct nsCSSValueListRect {
|
||||
nsCSSValueListRect(void);
|
||||
nsCSSValueListRect(const nsCSSValueListRect& aCopy);
|
||||
~nsCSSValueListRect();
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = 0, nsCSSProperty aPropID = eCSSProperty_UNKNOWN, PRInt32 aIndent = 0) const;
|
||||
void List(FILE* out, PRInt32 aIndent, const nsCSSProperty aTRBL[]) const;
|
||||
#endif
|
||||
|
||||
nsCSSValueList* mTop;
|
||||
nsCSSValueList* mRight;
|
||||
nsCSSValueList* mBottom;
|
||||
nsCSSValueList* mLeft;
|
||||
|
||||
typedef nsCSSValueList* nsCSSValueListRect::*side_type;
|
||||
static const side_type sides[4];
|
||||
};
|
||||
|
||||
struct nsCSSDisplay : public nsCSSStruct {
|
||||
nsCSSDisplay(void);
|
||||
nsCSSDisplay(const nsCSSDisplay& aCopy);
|
||||
~nsCSSDisplay(void);
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
nsCSSValue mDirection;
|
||||
nsCSSValue mDisplay;
|
||||
nsCSSValue mBinding;
|
||||
nsCSSValue mAppearance;
|
||||
nsCSSValue mPosition;
|
||||
nsCSSValue mFloat;
|
||||
nsCSSValue mClear;
|
||||
nsCSSRect mClip;
|
||||
nsCSSValue mOverflow;
|
||||
nsCSSValue mVisibility;
|
||||
nsCSSValue mOpacity;
|
||||
|
||||
// temp fix for bug 24000
|
||||
nsCSSValue mBreakBefore;
|
||||
nsCSSValue mBreakAfter;
|
||||
// end temp fix
|
||||
};
|
||||
|
||||
struct nsRuleDataDisplay : public nsCSSDisplay {
|
||||
nsCSSValue mLang;
|
||||
};
|
||||
|
||||
struct nsCSSMargin : public nsCSSStruct {
|
||||
nsCSSMargin(void);
|
||||
nsCSSMargin(const nsCSSMargin& aCopy);
|
||||
~nsCSSMargin(void);
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
nsCSSRect mMargin;
|
||||
nsCSSValue mMarginStart;
|
||||
nsCSSValue mMarginEnd;
|
||||
nsCSSValue mMarginLeftLTRSource;
|
||||
nsCSSValue mMarginLeftRTLSource;
|
||||
nsCSSValue mMarginRightLTRSource;
|
||||
nsCSSValue mMarginRightRTLSource;
|
||||
nsCSSRect mPadding;
|
||||
nsCSSValue mPaddingStart;
|
||||
nsCSSValue mPaddingEnd;
|
||||
nsCSSValue mPaddingLeftLTRSource;
|
||||
nsCSSValue mPaddingLeftRTLSource;
|
||||
nsCSSValue mPaddingRightLTRSource;
|
||||
nsCSSValue mPaddingRightRTLSource;
|
||||
nsCSSRect mBorderWidth;
|
||||
nsCSSRect mBorderColor;
|
||||
nsCSSValueListRect mBorderColors;
|
||||
nsCSSRect mBorderStyle;
|
||||
nsCSSRect mBorderRadius; // (extension)
|
||||
nsCSSValue mOutlineWidth;
|
||||
nsCSSValue mOutlineColor;
|
||||
nsCSSValue mOutlineStyle;
|
||||
nsCSSRect mOutlineRadius; // (extension)
|
||||
nsCSSValue mFloatEdge; // NEW
|
||||
};
|
||||
|
||||
struct nsRuleDataMargin : public nsCSSMargin {
|
||||
};
|
||||
|
||||
struct nsCSSPosition : public nsCSSStruct {
|
||||
nsCSSPosition(void);
|
||||
nsCSSPosition(const nsCSSPosition& aCopy);
|
||||
~nsCSSPosition(void);
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
nsCSSValue mWidth;
|
||||
nsCSSValue mMinWidth;
|
||||
nsCSSValue mMaxWidth;
|
||||
nsCSSValue mHeight;
|
||||
nsCSSValue mMinHeight;
|
||||
nsCSSValue mMaxHeight;
|
||||
nsCSSValue mBoxSizing; // NEW
|
||||
nsCSSRect mOffset;
|
||||
nsCSSValue mZIndex;
|
||||
};
|
||||
|
||||
struct nsRuleDataPosition : public nsCSSPosition {
|
||||
};
|
||||
|
||||
struct nsCSSList : public nsCSSStruct {
|
||||
nsCSSList(void);
|
||||
nsCSSList(const nsCSSList& aCopy);
|
||||
~nsCSSList(void);
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
nsCSSValue mType;
|
||||
nsCSSValue mImage;
|
||||
nsCSSValue mPosition;
|
||||
nsCSSRect mImageRegion;
|
||||
};
|
||||
|
||||
struct nsRuleDataList : public nsCSSList {
|
||||
};
|
||||
|
||||
struct nsCSSTable : public nsCSSStruct { // NEW
|
||||
nsCSSTable(void);
|
||||
nsCSSTable(const nsCSSTable& aCopy);
|
||||
~nsCSSTable(void);
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
nsCSSValue mBorderCollapse;
|
||||
nsCSSValue mBorderSpacingX;
|
||||
nsCSSValue mBorderSpacingY;
|
||||
nsCSSValue mCaptionSide;
|
||||
nsCSSValue mEmptyCells;
|
||||
|
||||
nsCSSValue mLayout;
|
||||
nsCSSValue mFrame; // Not mappable via CSS, only using HTML4 table attrs.
|
||||
nsCSSValue mRules; // Not mappable via CSS, only using HTML4 table attrs.
|
||||
nsCSSValue mSpan; // Not mappable via CSS, only using HTML4 table attrs.
|
||||
nsCSSValue mCols; // Not mappable via CSS, only using HTML4 table attrs.
|
||||
};
|
||||
|
||||
struct nsRuleDataTable : public nsCSSTable {
|
||||
};
|
||||
|
||||
struct nsCSSBreaks : public nsCSSStruct { // NEW
|
||||
nsCSSBreaks(void);
|
||||
nsCSSBreaks(const nsCSSBreaks& aCopy);
|
||||
~nsCSSBreaks(void);
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
nsCSSValue mOrphans;
|
||||
nsCSSValue mWidows;
|
||||
nsCSSValue mPage;
|
||||
// temp fix for bug 24000
|
||||
//nsCSSValue mPageBreakAfter;
|
||||
//nsCSSValue mPageBreakBefore;
|
||||
nsCSSValue mPageBreakInside;
|
||||
};
|
||||
|
||||
struct nsRuleDataBreaks : public nsCSSBreaks {
|
||||
};
|
||||
|
||||
struct nsCSSPage : public nsCSSStruct { // NEW
|
||||
nsCSSPage(void);
|
||||
nsCSSPage(const nsCSSPage& aCopy);
|
||||
~nsCSSPage(void);
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
nsCSSValue mMarks;
|
||||
nsCSSValue mSizeWidth;
|
||||
nsCSSValue mSizeHeight;
|
||||
};
|
||||
|
||||
struct nsRuleDataPage : public nsCSSPage {
|
||||
};
|
||||
|
||||
struct nsCSSCounterData {
|
||||
nsCSSCounterData(void);
|
||||
nsCSSCounterData(const nsCSSCounterData& aCopy);
|
||||
~nsCSSCounterData(void);
|
||||
|
||||
static PRBool Equal(nsCSSCounterData* aList1, nsCSSCounterData* aList2);
|
||||
|
||||
nsCSSValue mCounter;
|
||||
nsCSSValue mValue;
|
||||
nsCSSCounterData* mNext;
|
||||
};
|
||||
|
||||
struct nsCSSQuotes {
|
||||
nsCSSQuotes(void);
|
||||
nsCSSQuotes(const nsCSSQuotes& aCopy);
|
||||
~nsCSSQuotes(void);
|
||||
|
||||
static PRBool Equal(nsCSSQuotes* aList1, nsCSSQuotes* aList2);
|
||||
|
||||
nsCSSValue mOpen;
|
||||
nsCSSValue mClose;
|
||||
nsCSSQuotes* mNext;
|
||||
};
|
||||
|
||||
struct nsCSSContent : public nsCSSStruct {
|
||||
nsCSSContent(void);
|
||||
nsCSSContent(const nsCSSContent& aCopy);
|
||||
~nsCSSContent(void);
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
nsCSSValueList* mContent;
|
||||
nsCSSCounterData* mCounterIncrement;
|
||||
nsCSSCounterData* mCounterReset;
|
||||
nsCSSValue mMarkerOffset;
|
||||
nsCSSQuotes* mQuotes;
|
||||
};
|
||||
|
||||
struct nsRuleDataContent : public nsCSSContent {
|
||||
};
|
||||
|
||||
struct nsCSSUserInterface : public nsCSSStruct { // NEW
|
||||
nsCSSUserInterface(void);
|
||||
nsCSSUserInterface(const nsCSSUserInterface& aCopy);
|
||||
~nsCSSUserInterface(void);
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
nsCSSValue mUserInput;
|
||||
nsCSSValue mUserModify;
|
||||
nsCSSValue mUserSelect;
|
||||
nsCSSValueList* mKeyEquivalent;
|
||||
nsCSSValue mUserFocus;
|
||||
nsCSSValue mResizer;
|
||||
|
||||
nsCSSValueList* mCursor;
|
||||
nsCSSValue mForceBrokenImageIcon;
|
||||
};
|
||||
|
||||
struct nsRuleDataUserInterface : public nsCSSUserInterface {
|
||||
};
|
||||
|
||||
struct nsCSSAural : public nsCSSStruct { // NEW
|
||||
nsCSSAural(void);
|
||||
nsCSSAural(const nsCSSAural& aCopy);
|
||||
~nsCSSAural(void);
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
nsCSSValue mAzimuth;
|
||||
nsCSSValue mElevation;
|
||||
nsCSSValue mCueAfter;
|
||||
nsCSSValue mCueBefore;
|
||||
nsCSSValue mPauseAfter;
|
||||
nsCSSValue mPauseBefore;
|
||||
nsCSSValue mPitch;
|
||||
nsCSSValue mPitchRange;
|
||||
nsCSSValue mPlayDuring;
|
||||
nsCSSValue mPlayDuringFlags;
|
||||
nsCSSValue mRichness;
|
||||
nsCSSValue mSpeak;
|
||||
nsCSSValue mSpeakHeader;
|
||||
nsCSSValue mSpeakNumeral;
|
||||
nsCSSValue mSpeakPunctuation;
|
||||
nsCSSValue mSpeechRate;
|
||||
nsCSSValue mStress;
|
||||
nsCSSValue mVoiceFamily;
|
||||
nsCSSValue mVolume;
|
||||
};
|
||||
|
||||
struct nsRuleDataAural : public nsCSSAural {
|
||||
};
|
||||
|
||||
struct nsCSSXUL : public nsCSSStruct {
|
||||
nsCSSXUL(void);
|
||||
nsCSSXUL(const nsCSSXUL& aCopy);
|
||||
~nsCSSXUL(void);
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
nsCSSValue mBoxAlign;
|
||||
nsCSSValue mBoxDirection;
|
||||
nsCSSValue mBoxFlex;
|
||||
nsCSSValue mBoxOrient;
|
||||
nsCSSValue mBoxPack;
|
||||
nsCSSValue mBoxOrdinal;
|
||||
};
|
||||
|
||||
struct nsRuleDataXUL : public nsCSSXUL {
|
||||
};
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
struct nsCSSSVG : public nsCSSStruct {
|
||||
nsCSSSVG(void);
|
||||
nsCSSSVG(const nsCSSSVG& aCopy);
|
||||
~nsCSSSVG(void);
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
nsCSSValue mDominantBaseline;
|
||||
nsCSSValue mFill;
|
||||
nsCSSValue mFillOpacity;
|
||||
nsCSSValue mFillRule;
|
||||
nsCSSValue mPointerEvents;
|
||||
nsCSSValue mShapeRendering;
|
||||
nsCSSValue mStroke;
|
||||
nsCSSValue mStrokeDasharray;
|
||||
nsCSSValue mStrokeDashoffset;
|
||||
nsCSSValue mStrokeLinecap;
|
||||
nsCSSValue mStrokeLinejoin;
|
||||
nsCSSValue mStrokeMiterlimit;
|
||||
nsCSSValue mStrokeOpacity;
|
||||
nsCSSValue mStrokeWidth;
|
||||
nsCSSValue mTextAnchor;
|
||||
nsCSSValue mTextRendering;
|
||||
};
|
||||
|
||||
struct nsRuleDataSVG : public nsCSSSVG {
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* nsCSSStruct_h___ */
|
||||
1537
mozilla/content/html/style/src/nsCSSStyleRule.cpp
Normal file
1537
mozilla/content/html/style/src/nsCSSStyleRule.cpp
Normal file
File diff suppressed because it is too large
Load Diff
538
mozilla/content/shared/public/nsCSSKeywordList.h
Normal file
538
mozilla/content/shared/public/nsCSSKeywordList.h
Normal file
@@ -0,0 +1,538 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1999
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/******
|
||||
|
||||
This file contains the list of all parsed CSS keywords
|
||||
See nsCSSKeywords.h for access to the enum values for keywords
|
||||
|
||||
It is designed to be used as inline input to nsCSSKeywords.cpp *only*
|
||||
through the magic of C preprocessing.
|
||||
|
||||
All entires must be enclosed in the macro CSS_KEY which will have cruel
|
||||
and unusual things done to it
|
||||
|
||||
It is recommended (but not strictly necessary) to keep all entries
|
||||
in alphabetical order
|
||||
|
||||
Requirements:
|
||||
|
||||
Entries are in the form: (name,id). 'id' must always be the same as 'name'
|
||||
except that all hyphens ('-') in 'name' are converted to underscores ('_')
|
||||
in 'id'. This lets us do nice things with the macros without having to
|
||||
copy/convert strings at runtime.
|
||||
|
||||
'name' entries *must* use only lowercase characters.
|
||||
|
||||
** Break these invariants and bad things will happen. **
|
||||
|
||||
******/
|
||||
|
||||
// OUTPUT_CLASS=nsCSSKeywords
|
||||
// MACRO_NAME=CSS_KEY
|
||||
|
||||
CSS_KEY(-moz-activehyperlinktext, _moz_activehyperlinktext)
|
||||
CSS_KEY(-moz-alias, _moz_alias)
|
||||
CSS_KEY(-moz-all, _moz_all)
|
||||
CSS_KEY(-moz-anchor-decoration, _moz_anchor_decoration)
|
||||
CSS_KEY(-moz-arabic-indic, _moz_arabic_indic)
|
||||
CSS_KEY(-moz-bengali, _moz_bengali)
|
||||
CSS_KEY(-moz-bg-inset, _moz_bg_inset)
|
||||
CSS_KEY(-moz-bg-outset, _moz_bg_outset)
|
||||
CSS_KEY(-moz-bg-solid, _moz_bg_solid)
|
||||
CSS_KEY(-moz-box, _moz_box)
|
||||
CSS_KEY(-moz-bulletinboard, _moz_bulletinboard)
|
||||
CSS_KEY(-moz-button, _moz_button)
|
||||
CSS_KEY(-moz-buttondefault, _moz_buttondefault)
|
||||
CSS_KEY(-moz-cell, _moz_cell)
|
||||
CSS_KEY(-moz-center, _moz_center)
|
||||
CSS_KEY(-moz-cjk-earthly-branch, _moz_cjk_earthly_branch)
|
||||
CSS_KEY(-moz-cjk-heavenly-stem, _moz_cjk_heavenly_stem)
|
||||
CSS_KEY(-moz-compact, _moz_compact) // Disabled because not supported.
|
||||
CSS_KEY(-moz-context-menu, _moz_context_menu)
|
||||
CSS_KEY(-moz-copy, _moz_copy)
|
||||
CSS_KEY(-moz-count-down, _moz_count_down)
|
||||
CSS_KEY(-moz-count-up-down, _moz_count_up_down)
|
||||
CSS_KEY(-moz-count-up, _moz_count_up)
|
||||
CSS_KEY(-moz-deck, _moz_deck)
|
||||
CSS_KEY(-moz-desktop, _moz_desktop)
|
||||
CSS_KEY(-moz-devanagari, _moz_devanagari)
|
||||
CSS_KEY(-moz-dialog, _moz_dialog)
|
||||
CSS_KEY(-moz-dialogtext, _moz_dialogtext)
|
||||
CSS_KEY(-moz-document, _moz_document)
|
||||
CSS_KEY(-moz-dragtargetzone, _moz_dragtargetzone)
|
||||
CSS_KEY(-moz-ethiopic-halehame, _moz_ethiopic_halehame)
|
||||
CSS_KEY(-moz-ethiopic-numeric, _moz_ethiopic_numeric)
|
||||
CSS_KEY(-moz-ethiopic-halehame-am, _moz_ethiopic_halehame_am)
|
||||
CSS_KEY(-moz-ethiopic-halehame-ti-er, _moz_ethiopic_halehame_ti_er)
|
||||
CSS_KEY(-moz-ethiopic-halehame-ti-et, _moz_ethiopic_halehame_ti_et)
|
||||
CSS_KEY(-moz-field, _moz_field)
|
||||
CSS_KEY(-moz-fieldtext, _moz_fieldtext)
|
||||
CSS_KEY(-moz-grabbing, _moz_grabbing)
|
||||
CSS_KEY(-moz-grab, _moz_grab)
|
||||
CSS_KEY(-moz-grid-group, _moz_grid_group)
|
||||
CSS_KEY(-moz-grid-line, _moz_grid_line)
|
||||
CSS_KEY(-moz-grid, _moz_grid)
|
||||
CSS_KEY(-moz-groupbox, _moz_groupbox)
|
||||
CSS_KEY(-moz-gujarati, _moz_gujarati)
|
||||
CSS_KEY(-moz-gurmukhi, _moz_gurmukhi)
|
||||
CSS_KEY(-moz-hangul-consonant, _moz_hangul_consonant)
|
||||
CSS_KEY(-moz-hidden-unscrollable, _moz_hidden_unscrollable)
|
||||
CSS_KEY(-moz-hangul, _moz_hangul)
|
||||
CSS_KEY(-moz-hyperlinktext, _moz_hyperlinktext)
|
||||
CSS_KEY(-moz-info, _moz_info)
|
||||
CSS_KEY(-moz-initial, _moz_initial)
|
||||
CSS_KEY(-moz-inline-block, _moz_inline_block)
|
||||
CSS_KEY(-moz-inline-box, _moz_inline_box)
|
||||
CSS_KEY(-moz-inline-grid, _moz_inline_grid)
|
||||
CSS_KEY(-moz-inline-stack, _moz_inline_stack)
|
||||
CSS_KEY(-moz-inline-table, _moz_inline_table)
|
||||
CSS_KEY(-moz-japanese-formal, _moz_japanese_formal)
|
||||
CSS_KEY(-moz-japanese-informal, _moz_japanese_informal)
|
||||
CSS_KEY(-moz-kannada, _moz_kannada)
|
||||
CSS_KEY(-moz-khmer, _moz_khmer)
|
||||
CSS_KEY(-moz-lao, _moz_lao)
|
||||
CSS_KEY(-moz-list, _moz_list)
|
||||
CSS_KEY(-moz-mac-accentdarkestshadow, _moz_mac_accentdarkestshadow)
|
||||
CSS_KEY(-moz-mac-accentdarkshadow, _moz_mac_accentdarkshadow)
|
||||
CSS_KEY(-moz-mac-accentface, _moz_mac_accentface)
|
||||
CSS_KEY(-moz-mac-accentlightesthighlight, _moz_mac_accentlightesthighlight)
|
||||
CSS_KEY(-moz-mac-accentlightshadow, _moz_mac_accentlightshadow)
|
||||
CSS_KEY(-moz-mac-accentregularhighlight, _moz_mac_accentregularhighlight)
|
||||
CSS_KEY(-moz-mac-accentregularshadow, _moz_mac_accentregularshadow)
|
||||
CSS_KEY(-moz-mac-focusring, _moz_mac_focusring)
|
||||
CSS_KEY(-moz-mac-menuselect, _moz_mac_menuselect)
|
||||
CSS_KEY(-moz-mac-menushadow, _moz_mac_menushadow)
|
||||
CSS_KEY(-moz-mac-menutextselect, _moz_mac_menutextselect)
|
||||
CSS_KEY(-moz-malayalam, _moz_malayalam)
|
||||
CSS_KEY(-moz-marker, _moz_marker) // Disabled because not supported correctly.
|
||||
CSS_KEY(-moz-myanmar, _moz_myanmar)
|
||||
CSS_KEY(-moz-oriya, _moz_oriya)
|
||||
CSS_KEY(-moz-page-break, _moz_page_break)
|
||||
CSS_KEY(-moz-persian, _moz_persian)
|
||||
CSS_KEY(-moz-popup, _moz_popup)
|
||||
CSS_KEY(-moz-pre-wrap, _moz_pre_wrap)
|
||||
CSS_KEY(-moz-pull-down-menu, _moz_pull_down_menu)
|
||||
CSS_KEY(-moz-right, _moz_right)
|
||||
CSS_KEY(-moz-run-in, _moz_run_in) // Disabled because not supported.
|
||||
CSS_KEY(-moz-scrollbars-horizontal, _moz_scrollbars_horizontal)
|
||||
CSS_KEY(-moz-scrollbars-none, _moz_scrollbars_none)
|
||||
CSS_KEY(-moz-scrollbars-vertical, _moz_scrollbars_vertical)
|
||||
CSS_KEY(-moz-show-background, _moz_show_background)
|
||||
CSS_KEY(-moz-simp-chinese-formal, _moz_simp_chinese_formal)
|
||||
CSS_KEY(-moz-simp-chinese-informal, _moz_simp_chinese_informal)
|
||||
CSS_KEY(-moz-spinning, _moz_spinning)
|
||||
CSS_KEY(-moz-stack, _moz_stack)
|
||||
CSS_KEY(-moz-tamil, _moz_tamil)
|
||||
CSS_KEY(-moz-telugu, _moz_telugu)
|
||||
CSS_KEY(-moz-thai, _moz_thai)
|
||||
CSS_KEY(-moz-trad-chinese-formal, _moz_trad_chinese_formal)
|
||||
CSS_KEY(-moz-trad-chinese-informal, _moz_trad_chinese_informal)
|
||||
CSS_KEY(-moz-urdu, _moz_urdu)
|
||||
CSS_KEY(-moz-use-text-color, _moz_use_text_color)
|
||||
CSS_KEY(-moz-visitedhyperlinktext, _moz_visitedhyperlinktext)
|
||||
CSS_KEY(-moz-window, _moz_window)
|
||||
CSS_KEY(-moz-workspace, _moz_workspace)
|
||||
CSS_KEY(-moz-zoom-in, _moz_zoom_in)
|
||||
CSS_KEY(-moz-zoom-out, _moz_zoom_out)
|
||||
CSS_KEY(above, above)
|
||||
CSS_KEY(absolute, absolute)
|
||||
CSS_KEY(activeborder, activeborder)
|
||||
CSS_KEY(activecaption, activecaption)
|
||||
CSS_KEY(all, all)
|
||||
CSS_KEY(always, always)
|
||||
CSS_KEY(appworkspace, appworkspace)
|
||||
CSS_KEY(armenian, armenian)
|
||||
CSS_KEY(auto, auto)
|
||||
CSS_KEY(avoid, avoid)
|
||||
CSS_KEY(background, background)
|
||||
CSS_KEY(baseline, baseline)
|
||||
CSS_KEY(behind, behind)
|
||||
CSS_KEY(below, below)
|
||||
CSS_KEY(bidi-override, bidi_override)
|
||||
CSS_KEY(blink, blink)
|
||||
CSS_KEY(block, block)
|
||||
CSS_KEY(block-axis, block_axis)
|
||||
CSS_KEY(bold, bold)
|
||||
CSS_KEY(bolder, bolder)
|
||||
CSS_KEY(border, border)
|
||||
CSS_KEY(border-box, border_box)
|
||||
CSS_KEY(both, both)
|
||||
CSS_KEY(bottom, bottom)
|
||||
CSS_KEY(bounding-box, bounding_box)
|
||||
CSS_KEY(button, button)
|
||||
CSS_KEY(buttonface, buttonface)
|
||||
CSS_KEY(buttonhighlight, buttonhighlight)
|
||||
CSS_KEY(buttonshadow, buttonshadow)
|
||||
CSS_KEY(buttontext, buttontext)
|
||||
CSS_KEY(capitalize, capitalize)
|
||||
CSS_KEY(caption, caption)
|
||||
CSS_KEY(captiontext, captiontext)
|
||||
CSS_KEY(center, center)
|
||||
CSS_KEY(center-left, center_left)
|
||||
CSS_KEY(center-right, center_right)
|
||||
CSS_KEY(ch, ch)
|
||||
CSS_KEY(circle, circle)
|
||||
CSS_KEY(cjk-ideographic, cjk_ideographic)
|
||||
CSS_KEY(close-quote, close_quote)
|
||||
CSS_KEY(cm, cm)
|
||||
CSS_KEY(code, code)
|
||||
CSS_KEY(collapse, collapse)
|
||||
CSS_KEY(condensed, condensed)
|
||||
CSS_KEY(content, content)
|
||||
CSS_KEY(content-box, content_box)
|
||||
CSS_KEY(continuous, continuous)
|
||||
CSS_KEY(crop, crop)
|
||||
CSS_KEY(cross, cross)
|
||||
CSS_KEY(crosshair, crosshair)
|
||||
CSS_KEY(dashed, dashed)
|
||||
CSS_KEY(decimal, decimal)
|
||||
CSS_KEY(decimal-leading-zero, decimal_leading_zero)
|
||||
CSS_KEY(default, default)
|
||||
CSS_KEY(deg, deg)
|
||||
CSS_KEY(dialog, dialog)
|
||||
CSS_KEY(digits, digits)
|
||||
CSS_KEY(disabled, disabled)
|
||||
CSS_KEY(disc, disc)
|
||||
CSS_KEY(dotted, dotted)
|
||||
CSS_KEY(double, double)
|
||||
CSS_KEY(e-resize, e_resize)
|
||||
CSS_KEY(each-box, each_box)
|
||||
CSS_KEY(element, element)
|
||||
CSS_KEY(elements, elements)
|
||||
CSS_KEY(em, em)
|
||||
CSS_KEY(embed, embed)
|
||||
CSS_KEY(enabled, enabled)
|
||||
CSS_KEY(end, end)
|
||||
CSS_KEY(ex, ex)
|
||||
CSS_KEY(expanded, expanded)
|
||||
CSS_KEY(extra-condensed, extra_condensed)
|
||||
CSS_KEY(extra-expanded, extra_expanded)
|
||||
CSS_KEY(far-left, far_left)
|
||||
CSS_KEY(far-right, far_right)
|
||||
CSS_KEY(fast, fast)
|
||||
CSS_KEY(faster, faster)
|
||||
CSS_KEY(fixed, fixed)
|
||||
CSS_KEY(georgian, georgian)
|
||||
CSS_KEY(grad, grad)
|
||||
CSS_KEY(graytext, graytext)
|
||||
CSS_KEY(groove, groove)
|
||||
CSS_KEY(hebrew, hebrew)
|
||||
CSS_KEY(help, help)
|
||||
CSS_KEY(hidden, hidden)
|
||||
CSS_KEY(hide, hide)
|
||||
CSS_KEY(high, high)
|
||||
CSS_KEY(higher, higher)
|
||||
CSS_KEY(highlight, highlight)
|
||||
CSS_KEY(highlighttext, highlighttext)
|
||||
CSS_KEY(hiragana, hiragana)
|
||||
CSS_KEY(hiragana-iroha, hiragana_iroha)
|
||||
CSS_KEY(horizontal, horizontal)
|
||||
CSS_KEY(hz, hz)
|
||||
CSS_KEY(icon, icon)
|
||||
CSS_KEY(ignore, ignore)
|
||||
CSS_KEY(in, in)
|
||||
CSS_KEY(inactiveborder, inactiveborder)
|
||||
CSS_KEY(inactivecaption, inactivecaption)
|
||||
CSS_KEY(inactivecaptiontext, inactivecaptiontext)
|
||||
CSS_KEY(infobackground, infobackground)
|
||||
CSS_KEY(infotext, infotext)
|
||||
CSS_KEY(inherit, inherit)
|
||||
CSS_KEY(inline, inline)
|
||||
CSS_KEY(inline-axis, inline_axis)
|
||||
CSS_KEY(inset, inset)
|
||||
CSS_KEY(inside, inside)
|
||||
CSS_KEY(invert, invert)
|
||||
CSS_KEY(italic, italic)
|
||||
CSS_KEY(justify, justify)
|
||||
CSS_KEY(katakana, katakana)
|
||||
CSS_KEY(katakana-iroha, katakana_iroha)
|
||||
CSS_KEY(khz, khz)
|
||||
CSS_KEY(landscape, landscape)
|
||||
CSS_KEY(large, large)
|
||||
CSS_KEY(larger, larger)
|
||||
CSS_KEY(left, left)
|
||||
CSS_KEY(left-side, left_side)
|
||||
CSS_KEY(leftwards, leftwards)
|
||||
CSS_KEY(level, level)
|
||||
CSS_KEY(lighter, lighter)
|
||||
CSS_KEY(line-through, line_through)
|
||||
CSS_KEY(list-item, list_item)
|
||||
CSS_KEY(logical, logical)
|
||||
CSS_KEY(loud, loud)
|
||||
CSS_KEY(low, low)
|
||||
CSS_KEY(lower, lower)
|
||||
CSS_KEY(lower-alpha, lower_alpha)
|
||||
CSS_KEY(lower-greek, lower_greek)
|
||||
CSS_KEY(lower-latin, lower_latin)
|
||||
CSS_KEY(lower-roman, lower_roman)
|
||||
CSS_KEY(lowercase, lowercase)
|
||||
CSS_KEY(ltr, ltr)
|
||||
CSS_KEY(margin-box, margin_box)
|
||||
CSS_KEY(medium, medium)
|
||||
CSS_KEY(menu, menu)
|
||||
CSS_KEY(menubar, menubar)
|
||||
CSS_KEY(menutext, menutext)
|
||||
CSS_KEY(message-box, message_box)
|
||||
CSS_KEY(middle, middle)
|
||||
CSS_KEY(mix, mix)
|
||||
CSS_KEY(mm, mm)
|
||||
CSS_KEY(move, move)
|
||||
CSS_KEY(ms, ms)
|
||||
CSS_KEY(n-resize, n_resize)
|
||||
CSS_KEY(narrower, narrower)
|
||||
CSS_KEY(ne-resize, ne_resize)
|
||||
CSS_KEY(no-close-quote, no_close_quote)
|
||||
CSS_KEY(no-open-quote, no_open_quote)
|
||||
CSS_KEY(no-repeat, no_repeat)
|
||||
CSS_KEY(none, none)
|
||||
CSS_KEY(normal, normal)
|
||||
CSS_KEY(nowrap, nowrap)
|
||||
CSS_KEY(nw-resize, nw_resize)
|
||||
CSS_KEY(oblique, oblique)
|
||||
CSS_KEY(once, once)
|
||||
CSS_KEY(open-quote, open_quote)
|
||||
CSS_KEY(outset, outset)
|
||||
CSS_KEY(outside, outside)
|
||||
CSS_KEY(overline, overline)
|
||||
CSS_KEY(padding, padding)
|
||||
CSS_KEY(padding-box, padding_box)
|
||||
CSS_KEY(pc, pc)
|
||||
CSS_KEY(physical, physical)
|
||||
CSS_KEY(pointer, pointer)
|
||||
CSS_KEY(portrait, portrait)
|
||||
CSS_KEY(pre, pre)
|
||||
CSS_KEY(progress, progress)
|
||||
CSS_KEY(pt, pt)
|
||||
CSS_KEY(px, px)
|
||||
CSS_KEY(rad, rad)
|
||||
CSS_KEY(read-only, read_only)
|
||||
CSS_KEY(read-write, read_write)
|
||||
CSS_KEY(relative, relative)
|
||||
CSS_KEY(repeat, repeat)
|
||||
CSS_KEY(repeat-x, repeat_x)
|
||||
CSS_KEY(repeat-y, repeat_y)
|
||||
CSS_KEY(reverse, reverse)
|
||||
CSS_KEY(ridge, ridge)
|
||||
CSS_KEY(right, right)
|
||||
CSS_KEY(right-side, right_side)
|
||||
CSS_KEY(rightwards, rightwards)
|
||||
CSS_KEY(rtl, rtl)
|
||||
CSS_KEY(s, s)
|
||||
CSS_KEY(s-resize, s_resize)
|
||||
CSS_KEY(scroll, scroll)
|
||||
CSS_KEY(scrollbar, scrollbar)
|
||||
CSS_KEY(se-resize, se_resize)
|
||||
CSS_KEY(select-after, select_after)
|
||||
CSS_KEY(select-all, select_all)
|
||||
CSS_KEY(select-before, select_before)
|
||||
CSS_KEY(select-menu, select_menu)
|
||||
CSS_KEY(select-same, select_same)
|
||||
CSS_KEY(semi-condensed, semi_condensed)
|
||||
CSS_KEY(semi-expanded, semi_expanded)
|
||||
CSS_KEY(separate, separate)
|
||||
CSS_KEY(show, show)
|
||||
CSS_KEY(silent, silent)
|
||||
CSS_KEY(slow, slow)
|
||||
CSS_KEY(slower, slower)
|
||||
CSS_KEY(small, small)
|
||||
CSS_KEY(small-caps, small_caps)
|
||||
CSS_KEY(small-caption, small_caption)
|
||||
CSS_KEY(smaller, smaller)
|
||||
CSS_KEY(soft, soft)
|
||||
CSS_KEY(solid, solid)
|
||||
CSS_KEY(spell-out, spell_out)
|
||||
CSS_KEY(square, square)
|
||||
CSS_KEY(start, start)
|
||||
CSS_KEY(static, static)
|
||||
CSS_KEY(status-bar, status_bar)
|
||||
CSS_KEY(stretch, stretch)
|
||||
CSS_KEY(sub, sub)
|
||||
CSS_KEY(super, super)
|
||||
CSS_KEY(sw-resize, sw_resize)
|
||||
CSS_KEY(table, table)
|
||||
CSS_KEY(table-caption, table_caption)
|
||||
CSS_KEY(table-cell, table_cell)
|
||||
CSS_KEY(table-column, table_column)
|
||||
CSS_KEY(table-column-group, table_column_group)
|
||||
CSS_KEY(table-footer-group, table_footer_group)
|
||||
CSS_KEY(table-header-group, table_header_group)
|
||||
CSS_KEY(table-row, table_row)
|
||||
CSS_KEY(table-row-group, table_row_group)
|
||||
CSS_KEY(text, text)
|
||||
CSS_KEY(text-bottom, text_bottom)
|
||||
CSS_KEY(text-top, text_top)
|
||||
CSS_KEY(thick, thick)
|
||||
CSS_KEY(thin, thin)
|
||||
CSS_KEY(threeddarkshadow, threeddarkshadow)
|
||||
CSS_KEY(threedface, threedface)
|
||||
CSS_KEY(threedhighlight, threedhighlight)
|
||||
CSS_KEY(threedlightshadow, threedlightshadow)
|
||||
CSS_KEY(threedshadow, threedshadow)
|
||||
CSS_KEY(toggle, toggle)
|
||||
CSS_KEY(top, top)
|
||||
CSS_KEY(transparent, transparent)
|
||||
CSS_KEY(tri-state, tri_state)
|
||||
CSS_KEY(ultra-condensed, ultra_condensed)
|
||||
CSS_KEY(ultra-expanded, ultra_expanded)
|
||||
CSS_KEY(underline, underline)
|
||||
CSS_KEY(upper-alpha, upper_alpha)
|
||||
CSS_KEY(upper-latin, upper_latin)
|
||||
CSS_KEY(upper-roman, upper_roman)
|
||||
CSS_KEY(uppercase, uppercase)
|
||||
CSS_KEY(vertical, vertical)
|
||||
CSS_KEY(visible, visible)
|
||||
CSS_KEY(w-resize, w_resize)
|
||||
CSS_KEY(wait, wait)
|
||||
CSS_KEY(wider, wider)
|
||||
CSS_KEY(window, window)
|
||||
CSS_KEY(windowframe, windowframe)
|
||||
CSS_KEY(windowtext, windowtext)
|
||||
CSS_KEY(write-only, write_only)
|
||||
CSS_KEY(x-fast, x_fast)
|
||||
CSS_KEY(x-high, x_high)
|
||||
CSS_KEY(x-large, x_large)
|
||||
CSS_KEY(x-loud, x_loud)
|
||||
CSS_KEY(x-low, x_low)
|
||||
CSS_KEY(x-slow, x_slow)
|
||||
CSS_KEY(x-small, x_small)
|
||||
CSS_KEY(x-soft, x_soft)
|
||||
CSS_KEY(xx-large, xx_large)
|
||||
CSS_KEY(xx-small, xx_small)
|
||||
|
||||
// Appearance keywords for widget styles
|
||||
CSS_KEY(radio, radio)
|
||||
CSS_KEY(checkbox, checkbox)
|
||||
CSS_KEY(radio-small, radio_small)
|
||||
CSS_KEY(checkbox-small, checkbox_small)
|
||||
CSS_KEY(button-small, button_small)
|
||||
CSS_KEY(button-bevel, button_bevel)
|
||||
CSS_KEY(toolbox, toolbox)
|
||||
CSS_KEY(toolbar, toolbar)
|
||||
CSS_KEY(toolbarbutton, toolbarbutton)
|
||||
CSS_KEY(toolbargripper, toolbargripper)
|
||||
CSS_KEY(dualbutton, dualbutton)
|
||||
CSS_KEY(dualbutton-dropdown, dualbutton_dropdown)
|
||||
CSS_KEY(separator, separator)
|
||||
CSS_KEY(statusbar, statusbar)
|
||||
CSS_KEY(statusbarpanel, statusbarpanel)
|
||||
CSS_KEY(resizerpanel, resizerpanel)
|
||||
CSS_KEY(resizer, resizer)
|
||||
CSS_KEY(listbox, listbox)
|
||||
CSS_KEY(listitem, listitem)
|
||||
CSS_KEY(treeview, treeview)
|
||||
CSS_KEY(treeitem, treeitem)
|
||||
CSS_KEY(treetwisty, treetwisty)
|
||||
CSS_KEY(treetwistyopen, treetwistyopen)
|
||||
CSS_KEY(treeline, treeline)
|
||||
CSS_KEY(treeheader, treeheader)
|
||||
CSS_KEY(treeheadercell, treeheadercell)
|
||||
CSS_KEY(treeheadersortarrow, treeheadersortarrow)
|
||||
CSS_KEY(progressbar, progressbar)
|
||||
CSS_KEY(progressbar-vertical, progressbar_vertical)
|
||||
CSS_KEY(progresschunk, progresschunk)
|
||||
CSS_KEY(progresschunk-vertical, progresschunk_vertical)
|
||||
CSS_KEY(tab, tab)
|
||||
CSS_KEY(tab-left-edge, tab_left_edge)
|
||||
CSS_KEY(tab-right-edge, tab_right_edge)
|
||||
CSS_KEY(tabpanels, tabpanels)
|
||||
CSS_KEY(tabpanel, tabpanel)
|
||||
CSS_KEY(tooltip, tooltip)
|
||||
CSS_KEY(spinner, spinner)
|
||||
CSS_KEY(spinner-upbutton, spinner_upbutton)
|
||||
CSS_KEY(spinner-downbutton, spinner_downbutton)
|
||||
CSS_KEY(scrollbarbutton-up, scrollbarbutton_up)
|
||||
CSS_KEY(scrollbarbutton-down, scrollbarbutton_down)
|
||||
CSS_KEY(scrollbarbutton-left, scrollbarbutton_left)
|
||||
CSS_KEY(scrollbarbutton-right, scrollbarbutton_right)
|
||||
CSS_KEY(scrollbartrack-horizontal, scrollbartrack_horizontal)
|
||||
CSS_KEY(scrollbartrack-vertical, scrollbartrack_vertical)
|
||||
CSS_KEY(scrollbarthumb-horizontal, scrollbarthumb_horizontal)
|
||||
CSS_KEY(scrollbarthumb-vertical, scrollbarthumb_vertical)
|
||||
CSS_KEY(scrollbargripper-horizontal, scrollbargripper_horizontal)
|
||||
CSS_KEY(scrollbargripper-vertical, scrollbargripper_vertical)
|
||||
CSS_KEY(textfield, textfield)
|
||||
CSS_KEY(caret, caret)
|
||||
CSS_KEY(menulist, menulist)
|
||||
CSS_KEY(menulist-button, menulistbutton)
|
||||
CSS_KEY(menulist-text, menulisttext)
|
||||
CSS_KEY(menulist-textfield, menulisttextfield)
|
||||
CSS_KEY(slider, slider)
|
||||
CSS_KEY(sliderthumb, sliderthumb)
|
||||
CSS_KEY(sliderthumbstart, sliderthumbstart)
|
||||
CSS_KEY(sliderthumbend, sliderthumbend)
|
||||
CSS_KEY(sliderthumbtick, sliderthumbtick)
|
||||
CSS_KEY(checkbox-container, checkboxcontainer)
|
||||
CSS_KEY(radio-container, radiocontainer)
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
//CSS_KEY(all, all)
|
||||
CSS_KEY(alphabetic, alphabetic)
|
||||
//CSS_KEY(auto, auto)
|
||||
CSS_KEY(bevel, bevel)
|
||||
CSS_KEY(butt, butt)
|
||||
CSS_KEY(central, central)
|
||||
CSS_KEY(crispedges, crispedges)
|
||||
//CSS_KEY(end, end)
|
||||
CSS_KEY(evenodd, evenodd)
|
||||
CSS_KEY(fill, fill)
|
||||
CSS_KEY(geometricprecision, geometricprecision)
|
||||
CSS_KEY(hanging, hanging)
|
||||
CSS_KEY(ideographic, ideographic)
|
||||
CSS_KEY(mathematical, mathematical)
|
||||
//CSS_KEY(middle, middle)
|
||||
CSS_KEY(miter, miter)
|
||||
CSS_KEY(no-change, no_change)
|
||||
//CSS_KEY(none, none)
|
||||
CSS_KEY(nonzero, nonzero)
|
||||
CSS_KEY(optimizelegibility, optimizelegibility)
|
||||
CSS_KEY(optimizespeed, optimizespeed)
|
||||
CSS_KEY(painted, painted)
|
||||
CSS_KEY(reset-size, reset_size)
|
||||
CSS_KEY(round, round)
|
||||
//CSS_KEY(square, square)
|
||||
//CSS_KEY(start, start)
|
||||
CSS_KEY(stroke, stroke)
|
||||
CSS_KEY(text-after-edge, text_after_edge)
|
||||
CSS_KEY(text-before-edge, text_before_edge)
|
||||
CSS_KEY(use-script, use_script)
|
||||
//CSS_KEY(visible, visible)
|
||||
CSS_KEY(visiblefill, visiblefill)
|
||||
CSS_KEY(visiblepainted, visiblepainted)
|
||||
CSS_KEY(visiblestroke, visiblestroke)
|
||||
#endif
|
||||
657
mozilla/content/shared/public/nsCSSPropList.h
Normal file
657
mozilla/content/shared/public/nsCSSPropList.h
Normal file
@@ -0,0 +1,657 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1999
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/******
|
||||
|
||||
This file contains the list of all parsed CSS properties. It is
|
||||
designed to be used as inline input through the magic of C
|
||||
preprocessing. All entries must be enclosed in the appropriate
|
||||
CSS_PROP_* macro which will have cruel and unusual things done to it.
|
||||
It is recommended (but not strictly necessary) to keep all entries in
|
||||
alphabetical order.
|
||||
|
||||
The arguments to CSS_PROP_* are:
|
||||
|
||||
1. 'name' entries represent a CSS property name and *must* use only
|
||||
lowercase characters.
|
||||
|
||||
2. 'id' should be the same as 'name' except that all hyphens ('-')
|
||||
in 'name' are converted to underscores ('_') in 'id'. This lets us
|
||||
do nice things with the macros without having to copy/convert strings
|
||||
at runtime. These are the names used for the enum values of the
|
||||
nsCSSProperty enumeration defined in nsCSSProps.h.
|
||||
|
||||
3. 'method' is designed to be as input for CSS2Properties and similar
|
||||
callers. It must always be the same as 'name' except it must use
|
||||
InterCaps and all hyphens ('-') must be removed.
|
||||
|
||||
4. 'datastruct' says which nsRuleData* struct this property goes in.
|
||||
|
||||
5. 'member' gives the name of the member variable in the nsRuleData
|
||||
struct.
|
||||
|
||||
6. 'type' gives the |nsCSSType| of the data in the nsRuleData struct
|
||||
and in the nsCSSDeclaration backend.
|
||||
|
||||
7. 'iscoord' says whether the property is a coordinate property for
|
||||
which we use an explicit inherit value in the *style structs* (since
|
||||
inheritance requires knowledge of layout).
|
||||
|
||||
Which CSS_PROP_* macro a property is in depends on which nsStyle* its
|
||||
computed value lives in (unless it is a shorthand, in which case it
|
||||
gets CSS_PROP_SHORTHAND).
|
||||
|
||||
******/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
// XXX Should we really be using CSS_PROP_SHORTHAND for 'border-spacing',
|
||||
// 'background-position', and 'size'?
|
||||
|
||||
|
||||
// All includers must explicitly define CSS_PROP_NOTIMPLEMENTED if they
|
||||
// want this. (Only the DOM cares.)
|
||||
#ifndef CSS_PROP_NOTIMPLEMENTED
|
||||
#define CSS_PROP_NOTIMPLEMENTED(name_, id_, method_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_NOTIMPLEMENTED
|
||||
#endif
|
||||
|
||||
// All includers must explicitly define CSS_PROP_SHORTHAND if they
|
||||
// want it.
|
||||
#ifndef CSS_PROP_SHORTHAND
|
||||
#define CSS_PROP_SHORTHAND(name_, id_, method_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_SHORTHAND
|
||||
#endif
|
||||
|
||||
|
||||
// Callers may define CSS_PROP_LIST_EXCLUDE_INTERNAL if they want to
|
||||
// exclude internal properties that are not represented in the DOM (only
|
||||
// the DOM style code defines this).
|
||||
|
||||
// A caller who wants all the properties can define the |CSS_PROP|
|
||||
// macro.
|
||||
#ifdef CSS_PROP
|
||||
|
||||
#define USED_CSS_PROP
|
||||
#define CSS_PROP_FONT(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_COLOR(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_BACKGROUND(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_LIST(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_POSITION(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_TEXT(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_TEXTRESET(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_DISPLAY(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_VISIBILITY(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_CONTENT(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_QUOTES(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_USERINTERFACE(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_UIRESET(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_TABLE(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_TABLEBORDER(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_MARGIN(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_PADDING(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_BORDER(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_OUTLINE(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_XUL(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#ifdef MOZ_SVG
|
||||
#define CSS_PROP_SVG(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define CSS_PROP_SVGRESET(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#endif
|
||||
|
||||
// For properties that are stored in the CSS backend but are not
|
||||
// computed. An includer may define this in addition to CSS_PROP, but
|
||||
// otherwise we treat it as the same.
|
||||
#ifndef CSS_PROP_BACKENDONLY
|
||||
#define CSS_PROP_BACKENDONLY(name_, id_, method_, datastruct_, member_, type_, iscoord_) CSS_PROP(name_, id_, method_, datastruct_, member_, type_, iscoord_)
|
||||
#define DEFINED_CSS_PROP_BACKENDONLY
|
||||
#endif
|
||||
|
||||
#else /* !defined(CSS_PROP) */
|
||||
|
||||
// An includer who does not define CSS_PROP can define any or all of the
|
||||
// per-struct macros that are equivalent to it, and the rest will be
|
||||
// ignored.
|
||||
|
||||
#ifndef CSS_PROP_FONT
|
||||
#define CSS_PROP_FONT(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_FONT
|
||||
#endif
|
||||
#ifndef CSS_PROP_COLOR
|
||||
#define CSS_PROP_COLOR(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_COLOR
|
||||
#endif
|
||||
#ifndef CSS_PROP_BACKGROUND
|
||||
#define CSS_PROP_BACKGROUND(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_BACKGROUND
|
||||
#endif
|
||||
#ifndef CSS_PROP_LIST
|
||||
#define CSS_PROP_LIST(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_LIST
|
||||
#endif
|
||||
#ifndef CSS_PROP_POSITION
|
||||
#define CSS_PROP_POSITION(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_POSITION
|
||||
#endif
|
||||
#ifndef CSS_PROP_TEXT
|
||||
#define CSS_PROP_TEXT(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_TEXT
|
||||
#endif
|
||||
#ifndef CSS_PROP_TEXTRESET
|
||||
#define CSS_PROP_TEXTRESET(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_TEXTRESET
|
||||
#endif
|
||||
#ifndef CSS_PROP_DISPLAY
|
||||
#define CSS_PROP_DISPLAY(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_DISPLAY
|
||||
#endif
|
||||
#ifndef CSS_PROP_VISIBILITY
|
||||
#define CSS_PROP_VISIBILITY(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_VISIBILITY
|
||||
#endif
|
||||
#ifndef CSS_PROP_CONTENT
|
||||
#define CSS_PROP_CONTENT(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_CONTENT
|
||||
#endif
|
||||
#ifndef CSS_PROP_QUOTES
|
||||
#define CSS_PROP_QUOTES(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_QUOTES
|
||||
#endif
|
||||
#ifndef CSS_PROP_USERINTERFACE
|
||||
#define CSS_PROP_USERINTERFACE(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_USERINTERFACE
|
||||
#endif
|
||||
#ifndef CSS_PROP_UIRESET
|
||||
#define CSS_PROP_UIRESET(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_UIRESET
|
||||
#endif
|
||||
#ifndef CSS_PROP_TABLE
|
||||
#define CSS_PROP_TABLE(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_TABLE
|
||||
#endif
|
||||
#ifndef CSS_PROP_TABLEBORDER
|
||||
#define CSS_PROP_TABLEBORDER(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_TABLEBORDER
|
||||
#endif
|
||||
#ifndef CSS_PROP_MARGIN
|
||||
#define CSS_PROP_MARGIN(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_MARGIN
|
||||
#endif
|
||||
#ifndef CSS_PROP_PADDING
|
||||
#define CSS_PROP_PADDING(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_PADDING
|
||||
#endif
|
||||
#ifndef CSS_PROP_BORDER
|
||||
#define CSS_PROP_BORDER(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_BORDER
|
||||
#endif
|
||||
#ifndef CSS_PROP_OUTLINE
|
||||
#define CSS_PROP_OUTLINE(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_OUTLINE
|
||||
#endif
|
||||
#ifndef CSS_PROP_XUL
|
||||
#define CSS_PROP_XUL(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_XUL
|
||||
#endif
|
||||
#ifdef MOZ_SVG
|
||||
#ifndef CSS_PROP_SVG
|
||||
#define CSS_PROP_SVG(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_SVG
|
||||
#endif
|
||||
#ifndef CSS_PROP_SVGRESET
|
||||
#define CSS_PROP_SVGRESET(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_SVGRESET
|
||||
#endif
|
||||
#endif /* defined(MOZ_SVG) */
|
||||
|
||||
#ifndef CSS_PROP_BACKENDONLY
|
||||
#define CSS_PROP_BACKENDONLY(name_, id_, method_, datastruct_, member_, type_, iscoord_) /* nothing */
|
||||
#define DEFINED_CSS_PROP_BACKENDONLY
|
||||
#endif
|
||||
|
||||
#endif /* !defined(CSS_PROP) */
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
// For notes XXX bug 3935 below, the names being parsed do not correspond
|
||||
// to the constants used internally. It would be nice to bring the
|
||||
// constants into line sometime.
|
||||
|
||||
// The parser will refuse to parse properties marked with -x-.
|
||||
|
||||
// Those marked XXX bug 48973 are CSS2 properties that we support
|
||||
// differently from the spec for UI requirements. If we ever
|
||||
// support them correctly the old constants need to be renamed and
|
||||
// new ones should be entered.
|
||||
|
||||
CSS_PROP_DISPLAY(-moz-appearance, appearance, MozAppearance, Display, mAppearance, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SHORTHAND(-moz-border-radius, _moz_border_radius, MozBorderRadius)
|
||||
CSS_PROP_BORDER(-moz-border-radius-topleft, _moz_border_radius_topLeft, MozBorderRadiusTopleft, Margin, mBorderRadius.mTop, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_BORDER(-moz-border-radius-topright, _moz_border_radius_topRight, MozBorderRadiusTopright, Margin, mBorderRadius.mRight, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_BORDER(-moz-border-radius-bottomleft, _moz_border_radius_bottomLeft, MozBorderRadiusBottomleft, Margin, mBorderRadius.mLeft, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_BORDER(-moz-border-radius-bottomright, _moz_border_radius_bottomRight, MozBorderRadiusBottomright, Margin, mBorderRadius.mBottom, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_SHORTHAND(-moz-outline-radius, _moz_outline_radius, MozOutlineRadius)
|
||||
CSS_PROP_OUTLINE(-moz-outline-radius-topleft, _moz_outline_radius_topLeft, MozOutlineRadiusTopleft, Margin, mOutlineRadius.mTop, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_OUTLINE(-moz-outline-radius-topright, _moz_outline_radius_topRight, MozOutlineRadiusTopright, Margin, mOutlineRadius.mRight, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_OUTLINE(-moz-outline-radius-bottomleft, _moz_outline_radius_bottomLeft, MozOutlineRadiusBottomleft, Margin, mOutlineRadius.mLeft, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_OUTLINE(-moz-outline-radius-bottomright, _moz_outline_radius_bottomRight, MozOutlineRadiusBottomright, Margin, mOutlineRadius.mBottom, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_BACKENDONLY(azimuth, azimuth, Azimuth, Aural, mAzimuth, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SHORTHAND(background, background, Background)
|
||||
CSS_PROP_BACKGROUND(background-attachment, background_attachment, BackgroundAttachment, Color, mBackAttachment, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKGROUND(-moz-background-clip, _moz_background_clip, MozBackgroundClip, Color, mBackClip, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKGROUND(background-color, background_color, BackgroundColor, Color, mBackColor, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKGROUND(background-image, background_image, BackgroundImage, Color, mBackImage, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKGROUND(-moz-background-inline-policy, _moz_background_inline_policy, MozBackgroundInlinePolicy, Color, mBackInlinePolicy, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKGROUND(-moz-background-origin, _moz_background_origin, MozBackgroundOrigin, Color, mBackOrigin, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SHORTHAND(background-position, background_position, BackgroundPosition)
|
||||
CSS_PROP_BACKGROUND(background-repeat, background_repeat, BackgroundRepeat, Color, mBackRepeat, eCSSType_Value, PR_FALSE)
|
||||
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||
CSS_PROP_BACKGROUND(-x-background-x-position, background_x_position, BackgroundXPosition, Color, mBackPositionX, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_BACKGROUND(-x-background-y-position, background_y_position, BackgroundYPosition, Color, mBackPositionY, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
#endif /* !defined (CSS_PROP_LIST_EXCLUDE_INTERNAL) */
|
||||
CSS_PROP_DISPLAY(-moz-binding, binding, MozBinding, Display, mBinding, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_SHORTHAND(border, border, Border)
|
||||
CSS_PROP_SHORTHAND(border-bottom, border_bottom, BorderBottom)
|
||||
CSS_PROP_BORDER(border-bottom-color, border_bottom_color, BorderBottomColor, Margin, mBorderColor.mBottom, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BORDER(-moz-border-bottom-colors, border_bottom_colors, MozBorderBottomColors, Margin, mBorderColors.mBottom, eCSSType_ValueList, PR_FALSE)
|
||||
CSS_PROP_BORDER(border-bottom-style, border_bottom_style, BorderBottomStyle, Margin, mBorderStyle.mBottom, eCSSType_Value, PR_FALSE) // on/off will need reflow
|
||||
CSS_PROP_BORDER(border-bottom-width, border_bottom_width, BorderBottomWidth, Margin, mBorderWidth.mBottom, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_TABLEBORDER(border-collapse, border_collapse, BorderCollapse, Table, mBorderCollapse, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SHORTHAND(border-color, border_color, BorderColor)
|
||||
CSS_PROP_SHORTHAND(border-left, border_left, BorderLeft)
|
||||
CSS_PROP_BORDER(border-left-color, border_left_color, BorderLeftColor, Margin, mBorderColor.mLeft, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BORDER(-moz-border-left-colors, border_left_colors, MozBorderLeftColors, Margin, mBorderColors.mLeft, eCSSType_ValueList, PR_FALSE)
|
||||
CSS_PROP_BORDER(border-left-style, border_left_style, BorderLeftStyle, Margin, mBorderStyle.mLeft, eCSSType_Value, PR_FALSE) // on/off will need reflow
|
||||
CSS_PROP_BORDER(border-left-width, border_left_width, BorderLeftWidth, Margin, mBorderWidth.mLeft, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SHORTHAND(border-right, border_right, BorderRight)
|
||||
CSS_PROP_BORDER(border-right-color, border_right_color, BorderRightColor, Margin, mBorderColor.mRight, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BORDER(-moz-border-right-colors, border_right_colors, MozBorderRightColors, Margin, mBorderColors.mRight, eCSSType_ValueList, PR_FALSE)
|
||||
CSS_PROP_BORDER(border-right-style, border_right_style, BorderRightStyle, Margin, mBorderStyle.mRight, eCSSType_Value, PR_FALSE) // on/off will need reflow
|
||||
CSS_PROP_BORDER(border-right-width, border_right_width, BorderRightWidth, Margin, mBorderWidth.mRight, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SHORTHAND(border-spacing, border_spacing, BorderSpacing)
|
||||
CSS_PROP_SHORTHAND(border-style, border_style, BorderStyle) // on/off will need reflow
|
||||
CSS_PROP_SHORTHAND(border-top, border_top, BorderTop)
|
||||
CSS_PROP_BORDER(border-top-color, border_top_color, BorderTopColor, Margin, mBorderColor.mTop, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BORDER(-moz-border-top-colors, border_top_colors, MozBorderTopColors, Margin, mBorderColors.mTop, eCSSType_ValueList, PR_FALSE)
|
||||
CSS_PROP_BORDER(border-top-style, border_top_style, BorderTopStyle, Margin, mBorderStyle.mTop, eCSSType_Value, PR_FALSE) // on/off will need reflow
|
||||
CSS_PROP_BORDER(border-top-width, border_top_width, BorderTopWidth, Margin, mBorderWidth.mTop, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SHORTHAND(border-width, border_width, BorderWidth)
|
||||
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||
CSS_PROP_TABLEBORDER(-x-border-x-spacing, border_x_spacing, BorderXSpacing, Table, mBorderSpacingX, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_TABLEBORDER(-x-border-y-spacing, border_y_spacing, BorderYSpacing, Table, mBorderSpacingY, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
#endif /* !defined (CSS_PROP_LIST_EXCLUDE_INTERNAL) */
|
||||
CSS_PROP_POSITION(bottom, bottom, Bottom, Position, mOffset.mBottom, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_POSITION(-moz-box-sizing, box_sizing, MozBoxSizing, Position, mBoxSizing, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_TABLEBORDER(caption-side, caption_side, CaptionSide, Table, mCaptionSide, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_DISPLAY(clear, clear, Clear, Display, mClear, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_DISPLAY(clip, clip, Clip, Display, mClip, eCSSType_Rect, PR_FALSE)
|
||||
CSS_PROP_COLOR(color, color, Color, Color, mColor, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_CONTENT(content, content, Content, Content, mContent, eCSSType_ValueList, PR_FALSE)
|
||||
CSS_PROP_NOTIMPLEMENTED(counter-increment, counter_increment, CounterIncrement)
|
||||
CSS_PROP_NOTIMPLEMENTED(counter-reset, counter_reset, CounterReset)
|
||||
CSS_PROP_CONTENT(-moz-counter-increment, _moz_counter_increment, MozCounterIncrement, Content, mCounterIncrement, eCSSType_CounterData, PR_FALSE) // XXX bug 137285
|
||||
CSS_PROP_CONTENT(-moz-counter-reset, _moz_counter_reset, MozCounterReset, Content, mCounterReset, eCSSType_CounterData, PR_FALSE) // XXX bug 137285
|
||||
CSS_PROP_SHORTHAND(cue, cue, Cue)
|
||||
CSS_PROP_BACKENDONLY(cue-after, cue_after, CueAfter, Aural, mCueAfter, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKENDONLY(cue-before, cue_before, CueBefore, Aural, mCueBefore, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_USERINTERFACE(cursor, cursor, Cursor, UserInterface, mCursor, eCSSType_ValueList, PR_FALSE)
|
||||
CSS_PROP_VISIBILITY(direction, direction, Direction, Display, mDirection, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_DISPLAY(display, display, Display, Display, mDisplay, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKENDONLY(elevation, elevation, Elevation, Aural, mElevation, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_TABLEBORDER(empty-cells, empty_cells, EmptyCells, Table, mEmptyCells, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_DISPLAY(float, float, CssFloat, Display, mFloat, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BORDER(-moz-float-edge, float_edge, MozFloatEdge, Margin, mFloatEdge, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_SHORTHAND(font, font, Font)
|
||||
CSS_PROP_FONT(font-family, font_family, FontFamily, Font, mFamily, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_FONT(font-size, font_size, FontSize, Font, mSize, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_FONT(font-size-adjust, font_size_adjust, FontSizeAdjust, Font, mSizeAdjust, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKENDONLY(font-stretch, font_stretch, FontStretch, Font, mStretch, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_FONT(font-style, font_style, FontStyle, Font, mStyle, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_FONT(font-variant, font_variant, FontVariant, Font, mVariant, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_FONT(font-weight, font_weight, FontWeight, Font, mWeight, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_UIRESET(-moz-force-broken-image-icon, force_broken_image_icon, MozForceBrokenImageIcon, UserInterface, mForceBrokenImageIcon, eCSSType_Value, PR_FALSE) // bug 58646
|
||||
CSS_PROP_POSITION(height, height, Height, Position, mHeight, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_LIST(-moz-image-region, image_region, MozImageRegion, List, mImageRegion, eCSSType_Rect, PR_TRUE)
|
||||
CSS_PROP_UIRESET(-moz-key-equivalent, key_equivalent, MozKeyEquivalent, UserInterface, mKeyEquivalent, eCSSType_ValueList, PR_FALSE) // This will need some other notification, but what? // XXX bug 3935
|
||||
CSS_PROP_POSITION(left, left, Left, Position, mOffset.mLeft, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_TEXT(letter-spacing, letter_spacing, LetterSpacing, Text, mLetterSpacing, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_TEXT(line-height, line_height, LineHeight, Text, mLineHeight, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_SHORTHAND(list-style, list_style, ListStyle)
|
||||
CSS_PROP_LIST(list-style-image, list_style_image, ListStyleImage, List, mImage, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_LIST(list-style-position, list_style_position, ListStylePosition, List, mPosition, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_LIST(list-style-type, list_style_type, ListStyleType, List, mType, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SHORTHAND(margin, margin, Margin)
|
||||
CSS_PROP_MARGIN(margin-bottom, margin_bottom, MarginBottom, Margin, mMargin.mBottom, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_SHORTHAND(-moz-margin-end, margin_end, MozMarginEnd)
|
||||
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||
CSS_PROP_MARGIN(margin-end-value, margin_end_value, X, Margin, mMarginEnd, eCSSType_Value, PR_TRUE)
|
||||
#endif
|
||||
CSS_PROP_SHORTHAND(margin-left, margin_left, MarginLeft)
|
||||
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||
CSS_PROP_MARGIN(margin-left-value, margin_left_value, X, Margin, mMargin.mLeft, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_MARGIN(margin-left-ltr-source, margin_left_ltr_source, X, Margin, mMarginLeftLTRSource, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_MARGIN(margin-left-rtl-source, margin_left_rtl_source, X, Margin, mMarginLeftRTLSource, eCSSType_Value, PR_TRUE)
|
||||
#endif
|
||||
CSS_PROP_SHORTHAND(margin-right, margin_right, MarginRight)
|
||||
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||
CSS_PROP_MARGIN(margin-right-value, margin_right_value, X, Margin, mMargin.mRight, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_MARGIN(margin-right-ltr-source, margin_right_ltr_source, X, Margin, mMarginRightLTRSource, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_MARGIN(margin-right-rtl-source, margin_right_rtl_source, X, Margin, mMarginRightRTLSource, eCSSType_Value, PR_TRUE)
|
||||
#endif
|
||||
CSS_PROP_SHORTHAND(-moz-margin-start, margin_start, MozMarginStart)
|
||||
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||
CSS_PROP_MARGIN(margin-start-value, margin_start_value, X, Margin, mMarginStart, eCSSType_Value, PR_TRUE)
|
||||
#endif
|
||||
CSS_PROP_MARGIN(margin-top, margin_top, MarginTop, Margin, mMargin.mTop, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_CONTENT(marker-offset, marker_offset, MarkerOffset, Content, mMarkerOffset, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_BACKENDONLY(marks, marks, Marks, Page, mMarks, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_POSITION(max-height, max_height, MaxHeight, Position, mMaxHeight, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_POSITION(max-width, max_width, MaxWidth, Position, mMaxWidth, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_POSITION(min-height, min_height, MinHeight, Position, mMinHeight, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_POSITION(min-width, min_width, MinWidth, Position, mMinWidth, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_DISPLAY(-moz-opacity, opacity, MozOpacity, Display, mOpacity, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_BACKENDONLY(orphans, orphans, Orphans, Breaks, mOrphans, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_NOTIMPLEMENTED(outline, outline, Outline)
|
||||
CSS_PROP_NOTIMPLEMENTED(outline-color, outline_color, OutlineColor)
|
||||
CSS_PROP_NOTIMPLEMENTED(outline-style, outline_style, OutlineStyle)
|
||||
CSS_PROP_NOTIMPLEMENTED(outline-width, outline_width, OutlineWidth)
|
||||
CSS_PROP_SHORTHAND(-moz-outline, _moz_outline, MozOutline) // XXX This is temporary fix for nsbeta3+ Bug 48973, turning outline into -moz-outline XXX bug 48973
|
||||
CSS_PROP_OUTLINE(-moz-outline-color, _moz_outline_color, MozOutlineColor, Margin, mOutlineColor, eCSSType_Value, PR_FALSE) // XXX bug 48973
|
||||
CSS_PROP_OUTLINE(-moz-outline-style, _moz_outline_style, MozOutlineStyle, Margin, mOutlineStyle, eCSSType_Value, PR_FALSE) // XXX bug 48973
|
||||
CSS_PROP_OUTLINE(-moz-outline-width, _moz_outline_width, MozOutlineWidth, Margin, mOutlineWidth, eCSSType_Value, PR_TRUE) // XXX bug 48973
|
||||
CSS_PROP_DISPLAY(overflow, overflow, Overflow, Display, mOverflow, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SHORTHAND(padding, padding, Padding)
|
||||
CSS_PROP_PADDING(padding-bottom, padding_bottom, PaddingBottom, Margin, mPadding.mBottom, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_SHORTHAND(-moz-padding-end, padding_end, MozPaddingEnd)
|
||||
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||
CSS_PROP_PADDING(padding-end-value, padding_end_value, X, Margin, mPaddingEnd, eCSSType_Value, PR_TRUE)
|
||||
#endif
|
||||
CSS_PROP_SHORTHAND(padding-left, padding_left, PaddingLeft)
|
||||
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||
CSS_PROP_PADDING(padding-left-value, padding_left_value, X, Margin, mPadding.mLeft, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_PADDING(padding-left-ltr-source, padding_left_ltr_source, X, Margin, mPaddingLeftLTRSource, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_PADDING(padding-left-rtl-source, padding_left_rtl_source, X, Margin, mPaddingLeftRTLSource, eCSSType_Value, PR_TRUE)
|
||||
#endif
|
||||
CSS_PROP_SHORTHAND(padding-right, padding_right, PaddingRight)
|
||||
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||
CSS_PROP_PADDING(padding-right-value, padding_right_value, X, Margin, mPadding.mRight, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_PADDING(padding-right-ltr-source, padding_right_ltr_source, X, Margin, mPaddingRightLTRSource, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_PADDING(padding-right-rtl-source, padding_right_rtl_source, X, Margin, mPaddingRightRTLSource, eCSSType_Value, PR_TRUE)
|
||||
#endif
|
||||
CSS_PROP_SHORTHAND(-moz-padding-start, padding_start, MozPaddingStart)
|
||||
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||
CSS_PROP_PADDING(padding-start-value, padding_start_value, X, Margin, mPaddingStart, eCSSType_Value, PR_TRUE)
|
||||
#endif
|
||||
CSS_PROP_PADDING(padding-top, padding_top, PaddingTop, Margin, mPadding.mTop, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_BACKENDONLY(page, page, Page, Breaks, mPage, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_DISPLAY(page-break-after, page_break_after, PageBreakAfter, Display, mBreakAfter, eCSSType_Value, PR_FALSE) // temp fix for bug 24000
|
||||
CSS_PROP_DISPLAY(page-break-before, page_break_before, PageBreakBefore, Display, mBreakBefore, eCSSType_Value, PR_FALSE) // temp fix for bug 24000
|
||||
CSS_PROP_BACKENDONLY(page-break-inside, page_break_inside, PageBreakInside, Breaks, mPageBreakInside, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SHORTHAND(pause, pause, Pause)
|
||||
CSS_PROP_BACKENDONLY(pause-after, pause_after, PauseAfter, Aural, mPauseAfter, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKENDONLY(pause-before, pause_before, PauseBefore, Aural, mPauseBefore, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKENDONLY(pitch, pitch, Pitch, Aural, mPitch, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKENDONLY(pitch-range, pitch_range, PitchRange, Aural, mPitchRange, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SHORTHAND(play-during, play_during, PlayDuring)
|
||||
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||
CSS_PROP_BACKENDONLY(-x-play-during-flags, play_during_flags, PlayDuringFlags, Aural, mPlayDuringFlags, eCSSType_Value, PR_FALSE) // XXX why is this here?
|
||||
CSS_PROP_BACKENDONLY(-x-play-during-uri, play_during_uri, PlayDuringURI, Aural, mPlayDuring, eCSSType_Value, PR_FALSE) // XXX why is this here?
|
||||
#endif /* !defined (CSS_PROP_LIST_EXCLUDE_INTERNAL) */
|
||||
CSS_PROP_DISPLAY(position, position, Position, Display, mPosition, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_QUOTES(quotes, quotes, Quotes, Content, mQuotes, eCSSType_Quotes, PR_FALSE)
|
||||
CSS_PROP_UIRESET(-moz-resizer, resizer, MozResizer, UserInterface, mResizer, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_BACKENDONLY(richness, richness, Richness, Aural, mRichness, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_POSITION(right, right, Right, Position, mOffset.mRight, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_SHORTHAND(size, size, Size)
|
||||
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||
CSS_PROP_BACKENDONLY(-x-size-height, size_height, SizeHeight, Page, mSizeHeight, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_BACKENDONLY(-x-size-width, size_width, SizeWidth, Page, mSizeWidth, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
#endif /* !defined (CSS_PROP_LIST_EXCLUDE_INTERNAL) */
|
||||
CSS_PROP_BACKENDONLY(speak, speak, Speak, Aural, mSpeak, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKENDONLY(speak-header, speak_header, SpeakHeader, Aural, mSpeakHeader, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKENDONLY(speak-numeral, speak_numeral, SpeakNumeral, Aural, mSpeakNumeral, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKENDONLY(speak-punctuation, speak_punctuation, SpeakPunctuation, Aural, mSpeakPunctuation, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKENDONLY(speech-rate, speech_rate, SpeechRate, Aural, mSpeechRate, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKENDONLY(stress, stress, Stress, Aural, mStress, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_TABLE(table-layout, table_layout, TableLayout, Table, mLayout, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_TEXT(text-align, text_align, TextAlign, Text, mTextAlign, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_TEXTRESET(text-decoration, text_decoration, TextDecoration, Text, mDecoration, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_TEXT(text-indent, text_indent, TextIndent, Text, mTextIndent, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_BACKENDONLY(text-shadow, text_shadow, TextShadow, Text, mTextShadow, eCSSType_Shadow, PR_FALSE)
|
||||
CSS_PROP_TEXT(text-transform, text_transform, TextTransform, Text, mTextTransform, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_POSITION(top, top, Top, Position, mOffset.mTop, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_TEXTRESET(unicode-bidi, unicode_bidi, UnicodeBidi, Text, mUnicodeBidi, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_USERINTERFACE(-moz-user-focus, user_focus, MozUserFocus, UserInterface, mUserFocus, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_USERINTERFACE(-moz-user-input, user_input, MozUserInput, UserInterface, mUserInput, eCSSType_Value, PR_FALSE) // XXX ??? // XXX bug 3935
|
||||
CSS_PROP_USERINTERFACE(-moz-user-modify, user_modify, MozUserModify, UserInterface, mUserModify, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_UIRESET(-moz-user-select, user_select, MozUserSelect, UserInterface, mUserSelect, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_TEXTRESET(vertical-align, vertical_align, VerticalAlign, Text, mVerticalAlign, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_VISIBILITY(visibility, visibility, Visibility, Display, mVisibility, eCSSType_Value, PR_FALSE) // reflow for collapse
|
||||
CSS_PROP_BACKENDONLY(voice-family, voice_family, VoiceFamily, Aural, mVoiceFamily, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKENDONLY(volume, volume, Volume, Aural, mVolume, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_TEXT(white-space, white_space, WhiteSpace, Text, mWhiteSpace, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_BACKENDONLY(widows, widows, Widows, Breaks, mWidows, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_POSITION(width, width, Width, Position, mWidth, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_TEXT(word-spacing, word_spacing, WordSpacing, Text, mWordSpacing, eCSSType_Value, PR_TRUE)
|
||||
CSS_PROP_POSITION(z-index, z_index, ZIndex, Position, mZIndex, eCSSType_Value, PR_FALSE)
|
||||
|
||||
CSS_PROP_XUL(-moz-box-align, box_align, MozBoxAlign, XUL, mBoxAlign, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_XUL(-moz-box-direction, box_direction, MozBoxDirection, XUL, mBoxDirection, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_XUL(-moz-box-flex, box_flex, MozBoxFlex, XUL, mBoxFlex, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_XUL(-moz-box-orient, box_orient, MozBoxOrient, XUL, mBoxOrient, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_XUL(-moz-box-pack, box_pack, MozBoxPack, XUL, mBoxPack, eCSSType_Value, PR_FALSE) // XXX bug 3935
|
||||
CSS_PROP_XUL(-moz-box-ordinal-group, box_ordinal_group, MozBoxOrdinalGroup, XUL, mBoxOrdinal, eCSSType_Value, PR_FALSE)
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
// XXX treat SVG's CSS Properties as internal for now.
|
||||
// Do we want to create an nsIDOMSVGCSS2Properties interface?
|
||||
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||
CSS_PROP_SVGRESET(dominant-baseline, dominant_baseline, DominantBaseline, SVG, mDominantBaseline, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SVG(fill, fill, Fill, SVG, mFill, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SVG(fill-opacity, fill_opacity, FillOpacity, SVG, mFillOpacity, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SVG(fill-rule, fill_rule, FillRule, SVG, mFillRule, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SVG(pointer-events, pointer_events, PointerEvents, SVG, mPointerEvents, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SVG(shape-rendering, shape_rendering, ShapeRendering, SVG, mShapeRendering, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SVG(stroke, stroke, Stroke, SVG, mStroke, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SVG(stroke-dasharray, stroke_dasharray, StrokeDasharray, SVG, mStrokeDasharray, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SVG(stroke-dashoffset, stroke_dashoffset, StrokeDashoffset, SVG, mStrokeDashoffset, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SVG(stroke-linecap, stroke_linecap, StrokeLinecap, SVG, mStrokeLinecap, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SVG(stroke-linejoin, stroke_linejoin, StrokeLinejoin, SVG, mStrokeLinejoin, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SVG(stroke-miterlimit, stroke_miterlimit, StrokeMiterlimit, SVG, mStrokeMiterlimit, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SVG(stroke-opacity, stroke_opacity, StrokeOpacity, SVG, mStrokeOpacity, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SVG(stroke-width, stroke_width, StrokeWidth, SVG, mStrokeWidth, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SVG(text-anchor, text_anchor, TextAnchor, SVG, mTextAnchor, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_SVG(text-rendering, text_rendering, TextRendering, SVG, mTextRendering, eCSSType_Value, PR_FALSE)
|
||||
#endif /* !defined (CSS_PROP_LIST_EXCLUDE_INTERNAL) */
|
||||
#endif
|
||||
|
||||
// Callers that want information on the properties that are in
|
||||
// the style structs but not in the nsCSS* structs should define
|
||||
// |CSS_PROP_INCLUDE_NOT_CSS|. (Some of these are also in nsRuleData*,
|
||||
// and a distinction might be needed at some point.)
|
||||
// The first 3 parameters don't matter, but some compilers don't like
|
||||
// empty arguments to macros.
|
||||
#ifdef CSS_PROP_INCLUDE_NOT_CSS
|
||||
CSS_PROP_VISIBILITY(X, X, X, Display, mLang, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_TABLE(X, X, X, Table, mFrame, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_TABLE(X, X, X, Table, mRules, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_TABLE(X, X, X, Table, mCols, eCSSType_Value, PR_FALSE)
|
||||
CSS_PROP_TABLE(X, X, X, Table, mSpan, eCSSType_Value, PR_FALSE)
|
||||
#endif /* defined(CSS_PROP_INCLUDE_NOT_CSS) */
|
||||
|
||||
#ifdef USED_CSS_PROP
|
||||
|
||||
#undef USED_CSS_PROP
|
||||
#undef CSS_PROP_FONT
|
||||
#undef CSS_PROP_COLOR
|
||||
#undef CSS_PROP_BACKGROUND
|
||||
#undef CSS_PROP_LIST
|
||||
#undef CSS_PROP_POSITION
|
||||
#undef CSS_PROP_TEXT
|
||||
#undef CSS_PROP_TEXTRESET
|
||||
#undef CSS_PROP_DISPLAY
|
||||
#undef CSS_PROP_VISIBILITY
|
||||
#undef CSS_PROP_CONTENT
|
||||
#undef CSS_PROP_QUOTES
|
||||
#undef CSS_PROP_USERINTERFACE
|
||||
#undef CSS_PROP_UIRESET
|
||||
#undef CSS_PROP_TABLE
|
||||
#undef CSS_PROP_TABLEBORDER
|
||||
#undef CSS_PROP_MARGIN
|
||||
#undef CSS_PROP_PADDING
|
||||
#undef CSS_PROP_BORDER
|
||||
#undef CSS_PROP_OUTLINE
|
||||
#undef CSS_PROP_XUL
|
||||
#ifdef MOZ_SVG
|
||||
#undef CSS_PROP_SVG
|
||||
#undef CSS_PROP_SVGRESET
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_BACKENDONLY
|
||||
#undef CSS_PROP_BACKENDONLY
|
||||
#undef DEFINED_CSS_PROP_BACKENDONLY
|
||||
#endif
|
||||
|
||||
#else /* !defined(USED_CSS_PROP) */
|
||||
|
||||
#ifdef DEFINED_CSS_PROP_FONT
|
||||
#undef CSS_PROP_FONT
|
||||
#undef DEFINED_CSS_PROP_FONT
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_COLOR
|
||||
#undef CSS_PROP_COLOR
|
||||
#undef DEFINED_CSS_PROP_COLOR
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_BACKGROUND
|
||||
#undef CSS_PROP_BACKGROUND
|
||||
#undef DEFINED_CSS_PROP_BACKGROUND
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_LIST
|
||||
#undef CSS_PROP_LIST
|
||||
#undef DEFINED_CSS_PROP_LIST
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_POSITION
|
||||
#undef CSS_PROP_POSITION
|
||||
#undef DEFINED_CSS_PROP_POSITION
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_TEXT
|
||||
#undef CSS_PROP_TEXT
|
||||
#undef DEFINED_CSS_PROP_TETEXTRESETT
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_TEXTRESET
|
||||
#undef CSS_PROP_TEXTRESET
|
||||
#undef DEFINED_CSS_PROP_TEDISPLAYTRESET
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_DISPLAY
|
||||
#undef CSS_PROP_DISPLAY
|
||||
#undef DEFINED_CSS_PROP_DISPLAY
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_VISIBILITY
|
||||
#undef CSS_PROP_VISIBILITY
|
||||
#undef DEFINED_CSS_PROP_VISIBILITY
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_CONTENT
|
||||
#undef CSS_PROP_CONTENT
|
||||
#undef DEFINED_CSS_PROP_CONTENT
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_QUOTES
|
||||
#undef CSS_PROP_QUOTES
|
||||
#undef DEFINED_CSS_PROP_QUOTES
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_USERINTERFACE
|
||||
#undef CSS_PROP_USERINTERFACE
|
||||
#undef DEFINED_CSS_PROP_USERINTERFACE
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_UIRESET
|
||||
#undef CSS_PROP_UIRESET
|
||||
#undef DEFINED_CSS_PROP_UIRESET
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_TABLE
|
||||
#undef CSS_PROP_TABLE
|
||||
#undef DEFINED_CSS_PROP_TABLE
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_TABLEBORDER
|
||||
#undef CSS_PROP_TABLEBORDER
|
||||
#undef DEFINED_CSS_PROP_TABLEBORDER
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_MARGIN
|
||||
#undef CSS_PROP_MARGIN
|
||||
#undef DEFINED_CSS_PROP_MARGIN
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_PADDING
|
||||
#undef CSS_PROP_PADDING
|
||||
#undef DEFINED_CSS_PROP_PADDING
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_BORDER
|
||||
#undef CSS_PROP_BORDER
|
||||
#undef DEFINED_CSS_PROP_BORDER
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_OUTLINE
|
||||
#undef CSS_PROP_OUTLINE
|
||||
#undef DEFINED_CSS_PROP_OUTLINE
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_XUL
|
||||
#undef CSS_PROP_XUL
|
||||
#undef DEFINED_CSS_PROP_XUL
|
||||
#endif
|
||||
#ifdef MOZ_SVG
|
||||
#ifdef DEFINED_CSS_PROP_SVG
|
||||
#undef CSS_PROP_SVG
|
||||
#undef DEFINED_CSS_PROP_SVG
|
||||
#endif
|
||||
#ifdef DEFINED_CSS_PROP_SVGRESET
|
||||
#undef CSS_PROP_SVGRESET
|
||||
#undef DEFINED_CSS_PROP_SVGRESET
|
||||
#endif
|
||||
#endif /* defined(MOZ_SVG) */
|
||||
#ifdef DEFINED_CSS_PROP_BACKENDONLY
|
||||
#undef CSS_PROP_BACKENDONLY
|
||||
#undef DEFINED_CSS_PROP_BACKENDONLY
|
||||
#endif
|
||||
|
||||
#endif /* !defined(USED_CSS_PROP) */
|
||||
|
||||
#ifdef DEFINED_CSS_PROP_NOTIMPLEMENTED
|
||||
#undef CSS_PROP_NOTIMPLEMENTED
|
||||
#undef DEFINED_CSS_PROP_NOTIMPLEMENTED
|
||||
#endif
|
||||
|
||||
#ifdef DEFINED_CSS_PROP_SHORTHAND
|
||||
#undef CSS_PROP_SHORTHAND
|
||||
#undef DEFINED_CSS_PROP_SHORTHAND
|
||||
#endif
|
||||
180
mozilla/content/shared/public/nsCSSProps.h
Normal file
180
mozilla/content/shared/public/nsCSSProps.h
Normal file
@@ -0,0 +1,180 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#ifndef nsCSSProps_h___
|
||||
#define nsCSSProps_h___
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsChangeHint.h"
|
||||
#include "nsCSSProperty.h"
|
||||
#include "nsStyleStruct.h"
|
||||
|
||||
class nsCSSProps {
|
||||
public:
|
||||
static void AddRefTable(void);
|
||||
static void ReleaseTable(void);
|
||||
|
||||
// Given a property string, return the enum value
|
||||
static nsCSSProperty LookupProperty(const nsAString& aProperty);
|
||||
static nsCSSProperty LookupProperty(const nsACString& aProperty);
|
||||
|
||||
static inline PRBool IsShorthand(nsCSSProperty aProperty) {
|
||||
NS_ASSERTION(0 <= aProperty && aProperty < eCSSProperty_COUNT,
|
||||
"out of range");
|
||||
return (aProperty >= eCSSProperty_COUNT_no_shorthands);
|
||||
}
|
||||
|
||||
// Given a property enum, get the string value
|
||||
static const nsAFlatCString& GetStringValue(nsCSSProperty aProperty);
|
||||
|
||||
// Given a CSS Property and a Property Enum Value
|
||||
// Return back a const nsString& representation of the
|
||||
// value. Return back nullstr if no value is found
|
||||
static const nsAFlatCString& LookupPropertyValue(nsCSSProperty aProperty, PRInt32 aValue);
|
||||
|
||||
// Get a color name for a predefined color value like buttonhighlight or activeborder
|
||||
// Sets the aStr param to the name of the propertyID
|
||||
static PRBool GetColorName(PRInt32 aPropID, nsCString &aStr);
|
||||
|
||||
static PRInt32 SearchKeywordTableInt(PRInt32 aValue, const PRInt32 aTable[]);
|
||||
static const nsAFlatCString& SearchKeywordTable(PRInt32 aValue, const PRInt32 aTable[]);
|
||||
|
||||
static const nsCSSType kTypeTable[eCSSProperty_COUNT_no_shorthands];
|
||||
static const nsStyleStructID kSIDTable[eCSSProperty_COUNT_no_shorthands];
|
||||
|
||||
// A table for shorthand properties. The appropriate index is the
|
||||
// property ID minus eCSSProperty_COUNT_no_shorthands.
|
||||
private:
|
||||
static const nsCSSProperty *const
|
||||
kSubpropertyTable[eCSSProperty_COUNT - eCSSProperty_COUNT_no_shorthands];
|
||||
|
||||
public:
|
||||
static inline
|
||||
const nsCSSProperty *const SubpropertyEntryFor(nsCSSProperty aProperty) {
|
||||
NS_ASSERTION(eCSSProperty_COUNT_no_shorthands <= aProperty &&
|
||||
aProperty < eCSSProperty_COUNT,
|
||||
"out of range");
|
||||
return nsCSSProps::kSubpropertyTable[aProperty -
|
||||
eCSSProperty_COUNT_no_shorthands];
|
||||
}
|
||||
|
||||
#define CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(iter_, prop_) \
|
||||
for (const nsCSSProperty* iter_ = nsCSSProps::SubpropertyEntryFor(prop_); \
|
||||
*iter_ != eCSSProperty_UNKNOWN; ++iter_)
|
||||
|
||||
// Keyword/Enum value tables
|
||||
static const PRInt32 kAppearanceKTable[];
|
||||
static const PRInt32 kAzimuthKTable[];
|
||||
static const PRInt32 kBackgroundAttachmentKTable[];
|
||||
static const PRInt32 kBackgroundClipKTable[];
|
||||
static const PRInt32 kBackgroundColorKTable[];
|
||||
static const PRInt32 kBackgroundInlinePolicyKTable[];
|
||||
static const PRInt32 kBackgroundOriginKTable[];
|
||||
static const PRInt32 kBackgroundRepeatKTable[];
|
||||
static const PRInt32 kBackgroundXPositionKTable[];
|
||||
static const PRInt32 kBackgroundYPositionKTable[];
|
||||
static const PRInt32 kBorderCollapseKTable[];
|
||||
static const PRInt32 kBorderColorKTable[];
|
||||
static const PRInt32 kBorderStyleKTable[];
|
||||
static const PRInt32 kBorderWidthKTable[];
|
||||
static const PRInt32 kBoxAlignKTable[];
|
||||
static const PRInt32 kBoxDirectionKTable[];
|
||||
static const PRInt32 kBoxOrientKTable[];
|
||||
static const PRInt32 kBoxPackKTable[];
|
||||
#ifdef MOZ_SVG
|
||||
static const PRInt32 kDominantBaselineKTable[];
|
||||
static const PRInt32 kFillRuleKTable[];
|
||||
static const PRInt32 kPointerEventsKTable[];
|
||||
static const PRInt32 kShapeRenderingKTable[];
|
||||
static const PRInt32 kStrokeLinecapKTable[];
|
||||
static const PRInt32 kStrokeLinejoinKTable[];
|
||||
static const PRInt32 kTextAnchorKTable[];
|
||||
static const PRInt32 kTextRenderingKTable[];
|
||||
#endif
|
||||
static const PRInt32 kBoxPropSourceKTable[];
|
||||
static const PRInt32 kBoxSizingKTable[];
|
||||
static const PRInt32 kCaptionSideKTable[];
|
||||
static const PRInt32 kClearKTable[];
|
||||
static const PRInt32 kColorKTable[];
|
||||
static const PRInt32 kContentKTable[];
|
||||
static const PRInt32 kCursorKTable[];
|
||||
static const PRInt32 kDirectionKTable[];
|
||||
static const PRInt32 kDisplayKTable[];
|
||||
static const PRInt32 kElevationKTable[];
|
||||
static const PRInt32 kEmptyCellsKTable[];
|
||||
static const PRInt32 kFloatKTable[];
|
||||
static const PRInt32 kFloatEdgeKTable[];
|
||||
static const PRInt32 kFontKTable[];
|
||||
static const PRInt32 kFontSizeKTable[];
|
||||
static const PRInt32 kFontStretchKTable[];
|
||||
static const PRInt32 kFontStyleKTable[];
|
||||
static const PRInt32 kFontVariantKTable[];
|
||||
static const PRInt32 kFontWeightKTable[];
|
||||
static const PRInt32 kKeyEquivalentKTable[];
|
||||
static const PRInt32 kListStylePositionKTable[];
|
||||
static const PRInt32 kListStyleKTable[];
|
||||
static const PRInt32 kOutlineColorKTable[];
|
||||
static const PRInt32 kOverflowKTable[];
|
||||
static const PRInt32 kPageBreakKTable[];
|
||||
static const PRInt32 kPageBreakInsideKTable[];
|
||||
static const PRInt32 kPageMarksKTable[];
|
||||
static const PRInt32 kPageSizeKTable[];
|
||||
static const PRInt32 kPitchKTable[];
|
||||
static const PRInt32 kPlayDuringKTable[];
|
||||
static const PRInt32 kPositionKTable[];
|
||||
static const PRInt32 kResizerKTable[];
|
||||
static const PRInt32 kSpeakKTable[];
|
||||
static const PRInt32 kSpeakHeaderKTable[];
|
||||
static const PRInt32 kSpeakNumeralKTable[];
|
||||
static const PRInt32 kSpeakPunctuationKTable[];
|
||||
static const PRInt32 kSpeechRateKTable[];
|
||||
static const PRInt32 kTableLayoutKTable[];
|
||||
static const PRInt32 kTextAlignKTable[];
|
||||
static const PRInt32 kTextDecorationKTable[];
|
||||
static const PRInt32 kTextTransformKTable[];
|
||||
static const PRInt32 kUnicodeBidiKTable[];
|
||||
static const PRInt32 kUserFocusKTable[];
|
||||
static const PRInt32 kUserInputKTable[];
|
||||
static const PRInt32 kUserModifyKTable[];
|
||||
static const PRInt32 kUserSelectKTable[];
|
||||
static const PRInt32 kVerticalAlignKTable[];
|
||||
static const PRInt32 kVisibilityKTable[];
|
||||
static const PRInt32 kVolumeKTable[];
|
||||
static const PRInt32 kWhitespaceKTable[];
|
||||
};
|
||||
|
||||
#endif /* nsCSSProps_h___ */
|
||||
575
mozilla/content/shared/public/nsRuleNode.h
Normal file
575
mozilla/content/shared/public/nsRuleNode.h
Normal file
@@ -0,0 +1,575 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Original Author: David W. Hyatt (hyatt@netscape.com)
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef nsRuleNode_h___
|
||||
#define nsRuleNode_h___
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIStyleRule.h"
|
||||
#include "nsFixedSizeAllocator.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsCSSStruct.h"
|
||||
#include "nsILanguageAtomService.h"
|
||||
#include "nsStyleStruct.h"
|
||||
|
||||
class nsStyleContext;
|
||||
struct nsRuleList;
|
||||
struct PLDHashTable;
|
||||
|
||||
typedef void (*nsPostResolveFunc)(nsStyleStruct* aStyleStruct, nsRuleData* aData);
|
||||
|
||||
struct nsInheritedStyleData
|
||||
{
|
||||
|
||||
#define STYLE_STRUCT_INHERITED(name, checkdata_cb, ctor_args) \
|
||||
nsStyle##name * m##name##Data;
|
||||
#define STYLE_STRUCT_RESET(name, checkdata_cb, ctor_args)
|
||||
|
||||
#include "nsStyleStructList.h"
|
||||
|
||||
#undef STYLE_STRUCT_INHERITED
|
||||
#undef STYLE_STRUCT_RESET
|
||||
|
||||
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
|
||||
void* result = nsnull;
|
||||
aContext->AllocateFromShell(sz, &result);
|
||||
return result;
|
||||
};
|
||||
|
||||
void ClearInheritedData(PRUint32 aBits) {
|
||||
#define STYLE_STRUCT_INHERITED(name, checkdata_cb, ctor_args) \
|
||||
if (m##name##Data && (aBits & NS_STYLE_INHERIT_BIT(name))) \
|
||||
m##name##Data = nsnull;
|
||||
#define STYLE_STRUCT_RESET(name, checkdata_cb, ctor_args)
|
||||
|
||||
#include "nsStyleStructList.h"
|
||||
|
||||
#undef STYLE_STRUCT_INHERITED
|
||||
#undef STYLE_STRUCT_RESET
|
||||
};
|
||||
|
||||
void Destroy(PRUint32 aBits, nsIPresContext* aContext) {
|
||||
#define STYLE_STRUCT_INHERITED(name, checkdata_cb, ctor_args) \
|
||||
if (m##name##Data && !(aBits & NS_STYLE_INHERIT_BIT(name))) \
|
||||
m##name##Data->Destroy(aContext);
|
||||
#define STYLE_STRUCT_RESET(name, checkdata_cb, ctor_args)
|
||||
|
||||
#include "nsStyleStructList.h"
|
||||
|
||||
#undef STYLE_STRUCT_INHERITED
|
||||
#undef STYLE_STRUCT_RESET
|
||||
|
||||
aContext->FreeToShell(sizeof(nsInheritedStyleData), this);
|
||||
};
|
||||
|
||||
nsInheritedStyleData() {
|
||||
#define STYLE_STRUCT_INHERITED(name, checkdata_cb, ctor_args) \
|
||||
m##name##Data = nsnull;
|
||||
#define STYLE_STRUCT_RESET(name, checkdata_cb, ctor_args)
|
||||
|
||||
#include "nsStyleStructList.h"
|
||||
|
||||
#undef STYLE_STRUCT_INHERITED
|
||||
#undef STYLE_STRUCT_RESET
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
struct nsResetStyleData
|
||||
{
|
||||
nsResetStyleData()
|
||||
{
|
||||
#define STYLE_STRUCT_RESET(name, checkdata_cb, ctor_args) \
|
||||
m##name##Data = nsnull;
|
||||
#define STYLE_STRUCT_INHERITED(name, checkdata_cb, ctor_args)
|
||||
|
||||
#include "nsStyleStructList.h"
|
||||
|
||||
#undef STYLE_STRUCT_RESET
|
||||
#undef STYLE_STRUCT_INHERITED
|
||||
};
|
||||
|
||||
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
|
||||
void* result = nsnull;
|
||||
aContext->AllocateFromShell(sz, &result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void ClearInheritedData(PRUint32 aBits) {
|
||||
#define STYLE_STRUCT_RESET(name, checkdata_cb, ctor_args) \
|
||||
if (m##name##Data && (aBits & NS_STYLE_INHERIT_BIT(name))) \
|
||||
m##name##Data = nsnull;
|
||||
#define STYLE_STRUCT_INHERITED(name, checkdata_cb, ctor_args)
|
||||
|
||||
#include "nsStyleStructList.h"
|
||||
|
||||
#undef STYLE_STRUCT_RESET
|
||||
#undef STYLE_STRUCT_INHERITED
|
||||
};
|
||||
|
||||
void Destroy(PRUint32 aBits, nsIPresContext* aContext) {
|
||||
#define STYLE_STRUCT_RESET(name, checkdata_cb, ctor_args) \
|
||||
if (m##name##Data && !(aBits & NS_STYLE_INHERIT_BIT(name))) \
|
||||
m##name##Data->Destroy(aContext);
|
||||
#define STYLE_STRUCT_INHERITED(name, checkdata_cb, ctor_args)
|
||||
|
||||
#include "nsStyleStructList.h"
|
||||
|
||||
#undef STYLE_STRUCT_RESET
|
||||
#undef STYLE_STRUCT_INHERITED
|
||||
|
||||
aContext->FreeToShell(sizeof(nsResetStyleData), this);
|
||||
};
|
||||
|
||||
#define STYLE_STRUCT_RESET(name, checkdata_cb, ctor_args) \
|
||||
nsStyle##name * m##name##Data;
|
||||
#define STYLE_STRUCT_INHERITED(name, checkdata_cb, ctor_args)
|
||||
|
||||
#include "nsStyleStructList.h"
|
||||
|
||||
#undef STYLE_STRUCT_RESET
|
||||
#undef STYLE_STRUCT_INHERITED
|
||||
|
||||
};
|
||||
|
||||
struct nsCachedStyleData
|
||||
{
|
||||
struct StyleStructInfo {
|
||||
ptrdiff_t mCachedStyleDataOffset;
|
||||
ptrdiff_t mInheritResetOffset;
|
||||
PRBool mIsReset;
|
||||
};
|
||||
|
||||
static StyleStructInfo gInfo[];
|
||||
|
||||
nsInheritedStyleData* mInheritedData;
|
||||
nsResetStyleData* mResetData;
|
||||
|
||||
static PRBool IsReset(const nsStyleStructID& aSID) {
|
||||
return gInfo[aSID].mIsReset;
|
||||
};
|
||||
|
||||
static PRUint32 GetBitForSID(const nsStyleStructID& aSID) {
|
||||
return 1 << aSID;
|
||||
};
|
||||
|
||||
nsStyleStruct* GetStyleData(const nsStyleStructID& aSID) {
|
||||
// Each struct is stored at this.m##type##Data->m##name##Data where
|
||||
// |type| is either Inherit or Reset, and |name| is the name of the
|
||||
// style struct. The |gInfo| stores the offset of the appropriate
|
||||
// m##type##Data for the struct within nsCachedStyleData (|this|)
|
||||
// and the offset of the appropriate m##name##Data within the
|
||||
// m##type##Data. Note that if we don't have any reset structs,
|
||||
// then mResetData is null, and likewise for mInheritedData. This
|
||||
// saves us from having to go through the long if-else cascade into
|
||||
// which most compilers will turn a case statement.
|
||||
|
||||
// NOTE: nsStyleContext::SetStyle works roughly the same way.
|
||||
|
||||
const StyleStructInfo& info = gInfo[aSID];
|
||||
|
||||
// Get either &mInheritedData or &mResetData.
|
||||
char* resetOrInheritSlot = NS_REINTERPRET_CAST(char*, this) + info.mCachedStyleDataOffset;
|
||||
|
||||
// Get either mInheritedData or mResetData.
|
||||
char* resetOrInherit = NS_REINTERPRET_CAST(char*, *NS_REINTERPRET_CAST(void**, resetOrInheritSlot));
|
||||
|
||||
nsStyleStruct* data = nsnull;
|
||||
if (resetOrInherit) {
|
||||
// If we have the mInheritedData or mResetData, then we might have
|
||||
// the struct, so get it.
|
||||
char* dataSlot = resetOrInherit + info.mInheritResetOffset;
|
||||
data = *NS_REINTERPRET_CAST(nsStyleStruct**, dataSlot);
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
||||
void ClearInheritedData(PRUint32 aBits) {
|
||||
if (mResetData)
|
||||
mResetData->ClearInheritedData(aBits);
|
||||
if (mInheritedData)
|
||||
mInheritedData->ClearInheritedData(aBits);
|
||||
}
|
||||
|
||||
void Destroy(PRUint32 aBits, nsIPresContext* aContext) {
|
||||
if (mResetData)
|
||||
mResetData->Destroy(aBits, aContext);
|
||||
if (mInheritedData)
|
||||
mInheritedData->Destroy(aBits, aContext);
|
||||
mResetData = nsnull;
|
||||
mInheritedData = nsnull;
|
||||
}
|
||||
|
||||
nsCachedStyleData() :mInheritedData(nsnull), mResetData(nsnull) {};
|
||||
~nsCachedStyleData() {};
|
||||
};
|
||||
|
||||
struct nsRuleData
|
||||
{
|
||||
nsStyleStructID mSID;
|
||||
PRPackedBool mCanStoreInRuleTree;
|
||||
nsIPresContext* mPresContext;
|
||||
nsStyleContext* mStyleContext;
|
||||
nsPostResolveFunc mPostResolveCallback;
|
||||
nsRuleDataFont* mFontData; // Should always be stack-allocated! We don't own these structures!
|
||||
nsRuleDataDisplay* mDisplayData;
|
||||
nsRuleDataMargin* mMarginData;
|
||||
nsRuleDataList* mListData;
|
||||
nsRuleDataPosition* mPositionData;
|
||||
nsRuleDataTable* mTableData;
|
||||
nsRuleDataColor* mColorData;
|
||||
nsRuleDataContent* mContentData;
|
||||
nsRuleDataText* mTextData;
|
||||
nsRuleDataUserInterface* mUserInterfaceData;
|
||||
nsRuleDataXUL* mXULData;
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
nsRuleDataSVG* mSVGData;
|
||||
#endif
|
||||
|
||||
nsRuleData(const nsStyleStructID& aSID, nsIPresContext* aContext, nsStyleContext* aStyleContext)
|
||||
:mSID(aSID), mPresContext(aContext), mStyleContext(aStyleContext), mPostResolveCallback(nsnull),
|
||||
mFontData(nsnull), mDisplayData(nsnull), mMarginData(nsnull), mListData(nsnull),
|
||||
mPositionData(nsnull), mTableData(nsnull), mColorData(nsnull), mContentData(nsnull), mTextData(nsnull),
|
||||
mUserInterfaceData(nsnull)
|
||||
{
|
||||
mCanStoreInRuleTree = PR_TRUE;
|
||||
mXULData = nsnull;
|
||||
#ifdef MOZ_SVG
|
||||
mSVGData = nsnull;
|
||||
#endif
|
||||
};
|
||||
~nsRuleData() {};
|
||||
};
|
||||
|
||||
class nsRuleNode {
|
||||
public:
|
||||
// for purposes of the RuleDetail (and related code),
|
||||
// * a non-inherited value is one that is specified as a
|
||||
// non-"inherit" value or as an "inherit" value that is reflected
|
||||
// in the struct and to the user of the style system with an
|
||||
// eCSSUnit_Inherit value
|
||||
// * an inherited value is one that is specified as "inherit" and
|
||||
// where the inheritance is computed by the style system
|
||||
enum RuleDetail {
|
||||
eRuleNone, // No props have been specified at all.
|
||||
eRulePartialReset, // At least one prop with a non-inherited value
|
||||
// has been specified. No props have been
|
||||
// specified with an inherited value. At least
|
||||
// one prop remains unspecified.
|
||||
eRulePartialMixed, // At least one prop with a non-inherited value
|
||||
// has been specified. Some props may also have
|
||||
// been specified with an inherited value. At
|
||||
// least one prop remains unspecified.
|
||||
eRulePartialInherited, // Only props with inherited values have
|
||||
// have been specified. At least one prop
|
||||
// remains unspecified.
|
||||
eRuleFullReset, // All props have been specified. None has an
|
||||
// inherited value.
|
||||
eRuleFullMixed, // All props have been specified. At least one has
|
||||
// a non-inherited value.
|
||||
eRuleFullInherited, // All props have been specified with inherited
|
||||
// values.
|
||||
eRuleUnknown // Information unknown (used as a result from a check
|
||||
// callback to trigger the normal checking codepath)
|
||||
};
|
||||
|
||||
private:
|
||||
nsIPresContext* mPresContext; // Our pres context.
|
||||
|
||||
nsRuleNode* mParent; // A pointer to the parent node in the tree.
|
||||
// This enables us to walk backwards from the
|
||||
// most specific rule matched to the least
|
||||
// specific rule (which is the optimal order to
|
||||
// use for lookups of style properties.
|
||||
nsCOMPtr<nsIStyleRule> mRule; // A pointer to our specific rule.
|
||||
|
||||
// The children of this node are stored in either a hashtable or list
|
||||
// that maps from rules to our nsRuleNode children. When matching
|
||||
// rules, we use this mapping to transition from node to node
|
||||
// (constructing new nodes as needed to flesh out the tree).
|
||||
|
||||
void *mChildrenTaggedPtr; // Accessed only through the methods below.
|
||||
|
||||
enum {
|
||||
kTypeMask = 0x1,
|
||||
kListType = 0x0,
|
||||
kHashType = 0x1
|
||||
};
|
||||
enum {
|
||||
// Maximum to have in a list before converting to a hashtable.
|
||||
// XXX Need to optimize this.
|
||||
kMaxChildrenInList = 32
|
||||
};
|
||||
|
||||
PRBool HaveChildren() {
|
||||
return mChildrenTaggedPtr != nsnull;
|
||||
}
|
||||
PRBool ChildrenAreHashed() {
|
||||
return (PRWord(mChildrenTaggedPtr) & kTypeMask) == kHashType;
|
||||
}
|
||||
nsRuleList* ChildrenList() {
|
||||
return NS_REINTERPRET_CAST(nsRuleList*, mChildrenTaggedPtr);
|
||||
}
|
||||
nsRuleList** ChildrenListPtr() {
|
||||
return NS_REINTERPRET_CAST(nsRuleList**, &mChildrenTaggedPtr);
|
||||
}
|
||||
PLDHashTable* ChildrenHash() {
|
||||
return (PLDHashTable*) (PRWord(mChildrenTaggedPtr) & ~PRWord(kTypeMask));
|
||||
}
|
||||
void SetChildrenList(nsRuleList *aList) {
|
||||
NS_ASSERTION(!(PRWord(aList) & kTypeMask),
|
||||
"pointer not 2-byte aligned");
|
||||
mChildrenTaggedPtr = aList;
|
||||
}
|
||||
void SetChildrenHash(PLDHashTable *aHashtable) {
|
||||
NS_ASSERTION(!(PRWord(aHashtable) & kTypeMask),
|
||||
"pointer not 2-byte aligned");
|
||||
mChildrenTaggedPtr = (void*)(PRWord(aHashtable) | kHashType);
|
||||
}
|
||||
void ConvertChildrenToHash();
|
||||
|
||||
nsCachedStyleData mStyleData; // Any data we cached on the rule node.
|
||||
|
||||
PRUint32 mDependentBits; // Used to cache the fact that we can look up
|
||||
// cached data under a parent rule.
|
||||
|
||||
PRUint32 mNoneBits; // Used to cache the fact that the branch to this
|
||||
// node specifies no non-inherited data for a
|
||||
// given struct type. (This usually implies that
|
||||
// the entire branch specifies no non-inherited
|
||||
// data, although not necessarily, if a
|
||||
// non-inherited value is overridden by an
|
||||
// explicit 'inherit' value.) For example, if an
|
||||
// entire rule branch specifies no color
|
||||
// information, then a bit will be set along every
|
||||
// rule node on that branch, so that you can break
|
||||
// out of the rule tree early and just inherit
|
||||
// from the parent style context. The presence of
|
||||
// this bit means we should just get inherited
|
||||
// data from the parent style context, and it is
|
||||
// never used for reset structs since their
|
||||
// Compute*Data functions don't initialize from
|
||||
// inherited data.
|
||||
|
||||
friend struct nsRuleList;
|
||||
|
||||
public:
|
||||
// Overloaded new operator. Initializes the memory to 0 and relies on an arena
|
||||
// (which comes from the presShell) to perform the allocation.
|
||||
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW;
|
||||
void Destroy();
|
||||
static nsILanguageAtomService *gLangService;
|
||||
|
||||
protected:
|
||||
void PropagateDependentBit(PRUint32 aBit, nsRuleNode* aHighestNode);
|
||||
void PropagateNoneBit(PRUint32 aBit, nsRuleNode* aHighestNode);
|
||||
|
||||
const nsStyleStruct* SetDefaultOnRoot(const nsStyleStructID aSID, nsStyleContext* aContext);
|
||||
|
||||
const nsStyleStruct* WalkRuleTree(const nsStyleStructID aSID, nsStyleContext* aContext,
|
||||
nsRuleData* aRuleData,
|
||||
nsRuleDataStruct* aSpecificData);
|
||||
|
||||
const nsStyleStruct* ComputeDisplayData(nsStyleStruct* aStartDisplay, const nsRuleDataStruct& aDisplayData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeVisibilityData(nsStyleStruct* aStartVisibility, const nsRuleDataStruct& aDisplayData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeFontData(nsStyleStruct* aStartFont, const nsRuleDataStruct& aFontData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeColorData(nsStyleStruct* aStartColor, const nsRuleDataStruct& aColorData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeBackgroundData(nsStyleStruct* aStartBackground, const nsRuleDataStruct& aColorData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeMarginData(nsStyleStruct* aStartMargin, const nsRuleDataStruct& aMarginData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeBorderData(nsStyleStruct* aStartBorder, const nsRuleDataStruct& aMarginData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputePaddingData(nsStyleStruct* aStartPadding, const nsRuleDataStruct& aMarginData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeOutlineData(nsStyleStruct* aStartOutline, const nsRuleDataStruct& aMarginData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeListData(nsStyleStruct* aStartList, const nsRuleDataStruct& aListData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputePositionData(nsStyleStruct* aStartPosition, const nsRuleDataStruct& aPositionData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeTableData(nsStyleStruct* aStartTable, const nsRuleDataStruct& aTableData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeTableBorderData(nsStyleStruct* aStartTable, const nsRuleDataStruct& aTableData,
|
||||
nsStyleContext* aContext,
|
||||
nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeContentData(nsStyleStruct* aStartContent, const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext,
|
||||
nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeQuotesData(nsStyleStruct* aStartQuotes, const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext,
|
||||
nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeTextData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext,
|
||||
nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeTextResetData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext,
|
||||
nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeUserInterfaceData(nsStyleStruct* aStartData,
|
||||
const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext,
|
||||
nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail,
|
||||
PRBool aInherited);
|
||||
const nsStyleStruct* ComputeUIResetData(nsStyleStruct* aStartData, const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext,
|
||||
nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeXULData(nsStyleStruct* aStartXUL, const nsRuleDataStruct& aXULData,
|
||||
nsStyleContext* aContext,
|
||||
nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
const nsStyleStruct* ComputeSVGData(nsStyleStruct* aStartSVG, const nsRuleDataStruct& aSVGData,
|
||||
nsStyleContext* aContext,
|
||||
nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
const nsStyleStruct* ComputeSVGResetData(nsStyleStruct* aStartSVG, const nsRuleDataStruct& aSVGData,
|
||||
nsStyleContext* aContext,
|
||||
nsRuleNode* aHighestNode,
|
||||
const RuleDetail& aRuleDetail, PRBool aInherited);
|
||||
#endif
|
||||
|
||||
// helpers for |ComputeFontData| that need access to |mNoneBits|:
|
||||
static void SetFont(nsIPresContext* aPresContext, nsStyleContext* aContext,
|
||||
nscoord aMinFontSize, PRBool aUseDocumentFonts,
|
||||
PRBool aIsGeneric, const nsRuleDataFont& aFontData,
|
||||
const nsFont& aDefaultFont,
|
||||
const nsStyleFont* aParentFont,
|
||||
nsStyleFont* aFont, PRBool& aInherited);
|
||||
static void SetGenericFont(nsIPresContext* aPresContext,
|
||||
nsStyleContext* aContext,
|
||||
const nsRuleDataFont& aFontData,
|
||||
PRUint8 aGenericFontID, nscoord aMinFontSize,
|
||||
PRBool aUseDocumentFonts, nsStyleFont* aFont);
|
||||
|
||||
void AdjustLogicalBoxProp(nsStyleContext* aContext,
|
||||
const nsCSSValue& aLTRSource,
|
||||
const nsCSSValue& aRTLSource,
|
||||
const nsCSSValue& aLTRLogicalValue,
|
||||
const nsCSSValue& aRTLLogicalValue,
|
||||
const nsStyleSides& aParentRect,
|
||||
nsStyleSides& aRect,
|
||||
PRUint8 aSide,
|
||||
PRInt32 aMask,
|
||||
PRBool& aInherited);
|
||||
|
||||
inline RuleDetail CheckSpecifiedProperties(const nsStyleStructID aSID, const nsRuleDataStruct& aRuleDataStruct);
|
||||
|
||||
const nsStyleStruct* GetParentData(const nsStyleStructID aSID);
|
||||
const nsStyleStruct* GetDisplayData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetVisibilityData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetFontData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetColorData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetBackgroundData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetMarginData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetBorderData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetPaddingData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetOutlineData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetListData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetPositionData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetTableData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetTableBorderData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetContentData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetQuotesData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetTextData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetTextResetData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetUserInterfaceData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetUIResetData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetXULData(nsStyleContext* aContext);
|
||||
#ifdef MOZ_SVG
|
||||
const nsStyleStruct* GetSVGData(nsStyleContext* aContext);
|
||||
const nsStyleStruct* GetSVGResetData(nsStyleContext* aContext);
|
||||
#endif
|
||||
|
||||
public:
|
||||
nsRuleNode(nsIPresContext* aPresContext, nsIStyleRule* aRule,
|
||||
nsRuleNode* aParent);
|
||||
virtual ~nsRuleNode();
|
||||
|
||||
static nsRuleNode* CreateRootNode(nsIPresContext* aPresContext);
|
||||
|
||||
nsresult Transition(nsIStyleRule* aRule, nsRuleNode** aResult);
|
||||
nsRuleNode* GetParent() const { return mParent; }
|
||||
PRBool IsRoot() const { return mParent == nsnull; }
|
||||
|
||||
// NOTE: Does not |AddRef|.
|
||||
nsIStyleRule* GetRule() const { return mRule; }
|
||||
// NOTE: Does not |AddRef|.
|
||||
nsIPresContext* GetPresContext() const { return mPresContext; }
|
||||
|
||||
nsresult ClearStyleData();
|
||||
const nsStyleStruct* GetStyleData(nsStyleStructID aSID,
|
||||
nsStyleContext* aContext,
|
||||
PRBool aComputeData);
|
||||
|
||||
/*
|
||||
* Garbage collection. Mark walks up the tree, marking any unmarked
|
||||
* ancestors until it reaches a marked one. Sweep recursively sweeps
|
||||
* the children, destroys any that are unmarked, and clears marks,
|
||||
* returning true if the node on which it was called was destroyed.
|
||||
*/
|
||||
void Mark();
|
||||
PRBool Sweep();
|
||||
};
|
||||
|
||||
#endif
|
||||
145
mozilla/content/shared/public/nsSVGAtomList.h
Normal file
145
mozilla/content/shared/public/nsSVGAtomList.h
Normal file
@@ -0,0 +1,145 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Original Author: Rod Spears (rods@netscape.com)
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
/******
|
||||
|
||||
This file contains the list of all SVG nsIAtoms and their values
|
||||
|
||||
It is designed to be used as inline input to nsSVGAtoms.cpp *only*
|
||||
through the magic of C preprocessing.
|
||||
|
||||
All entires must be enclosed in the macro SVG_ATOM which will have cruel
|
||||
and unusual things done to it
|
||||
|
||||
It is recommended (but not strictly necessary) to keep all entries
|
||||
in alphabetical order
|
||||
|
||||
The first argument to SVG_ATOM is the C++ identifier of the atom
|
||||
The second argument is the string value of the atom
|
||||
|
||||
******/
|
||||
|
||||
// tags
|
||||
SVG_ATOM(circle, "circle")
|
||||
SVG_ATOM(defs, "defs")
|
||||
SVG_ATOM(ellipse, "ellipse")
|
||||
SVG_ATOM(foreignObject, "foreignObject")
|
||||
SVG_ATOM(g, "g")
|
||||
SVG_ATOM(generic, "generic")
|
||||
SVG_ATOM(image, "image")
|
||||
SVG_ATOM(line, "line")
|
||||
SVG_ATOM(path, "path")
|
||||
SVG_ATOM(polygon, "polygon")
|
||||
SVG_ATOM(polyline, "polyline")
|
||||
SVG_ATOM(rect, "rect")
|
||||
SVG_ATOM(svg, "svg")
|
||||
SVG_ATOM(text, "text")
|
||||
SVG_ATOM(tref, "tref")
|
||||
SVG_ATOM(tspan, "tspan")
|
||||
|
||||
|
||||
// properties
|
||||
SVG_ATOM(alignment_baseline, "alignment-baseline")
|
||||
SVG_ATOM(baseline_shift, "baseline-shift")
|
||||
SVG_ATOM(clip_path, "clip-path")
|
||||
SVG_ATOM(clip_rule, "clip-rule")
|
||||
SVG_ATOM(cursor, "cursor")
|
||||
SVG_ATOM(cx, "cx")
|
||||
SVG_ATOM(cy, "cy")
|
||||
SVG_ATOM(d, "d")
|
||||
SVG_ATOM(direction, "direction")
|
||||
SVG_ATOM(display, "display")
|
||||
SVG_ATOM(dominant_baseline, "dominant-baseline")
|
||||
SVG_ATOM(fill, "fill")
|
||||
SVG_ATOM(fill_opacity, "fill-opacity")
|
||||
SVG_ATOM(fill_rule, "fill-rule")
|
||||
SVG_ATOM(filter, "filter")
|
||||
SVG_ATOM(font_family, "font-family")
|
||||
SVG_ATOM(font_size, "font-size")
|
||||
SVG_ATOM(font_size_adjust, "font-size-adjust")
|
||||
SVG_ATOM(font_stretch, "font-stretch")
|
||||
SVG_ATOM(font_style, "font-style")
|
||||
SVG_ATOM(font_variant, "font-variant")
|
||||
SVG_ATOM(font_weight, "font-weight")
|
||||
SVG_ATOM(glyph_orientation_horizontal, "glyph-orientation-horizontal")
|
||||
SVG_ATOM(glyph_orientation_vertical, "glyph-orientation-vertical")
|
||||
SVG_ATOM(height, "height")
|
||||
SVG_ATOM(href, "href")
|
||||
SVG_ATOM(id, "id")
|
||||
SVG_ATOM(image_rendering, "image-rendering")
|
||||
SVG_ATOM(kerning, "kerning")
|
||||
SVG_ATOM(letter_spacing, "letter-spacing")
|
||||
SVG_ATOM(mask, "mask")
|
||||
SVG_ATOM(opacity, "opacity")
|
||||
SVG_ATOM(pathLength, "pathLength")
|
||||
SVG_ATOM(pointer_events, "pointer-events")
|
||||
SVG_ATOM(points, "points")
|
||||
SVG_ATOM(r, "r")
|
||||
SVG_ATOM(rx, "rx")
|
||||
SVG_ATOM(ry, "ry")
|
||||
SVG_ATOM(shape_rendering, "shape-rendering")
|
||||
SVG_ATOM(stroke, "stroke")
|
||||
SVG_ATOM(stroke_dasharray, "stroke-dasharray")
|
||||
SVG_ATOM(stroke_dashoffset, "stroke-dashoffset")
|
||||
SVG_ATOM(stroke_linecap, "stroke-linecap")
|
||||
SVG_ATOM(stroke_linejoin, "stroke-linejoin")
|
||||
SVG_ATOM(stroke_miterlimit, "stroke-miterlimit")
|
||||
SVG_ATOM(stroke_opacity, "stroke-opacity")
|
||||
SVG_ATOM(stroke_width, "stroke-width")
|
||||
SVG_ATOM(style, "style")
|
||||
SVG_ATOM(text_anchor, "text-anchor")
|
||||
SVG_ATOM(text_decoration, "text-decoration")
|
||||
SVG_ATOM(text_rendering, "text-rendering")
|
||||
SVG_ATOM(transform, "transform")
|
||||
SVG_ATOM(unicode_bidi, "unicode-bidi")
|
||||
SVG_ATOM(viewBox, "viewBox")
|
||||
SVG_ATOM(visibility, "visibility")
|
||||
SVG_ATOM(width, "width")
|
||||
SVG_ATOM(word_spacing, "word-spacing")
|
||||
SVG_ATOM(x, "x")
|
||||
SVG_ATOM(x1, "x1")
|
||||
SVG_ATOM(x2, "x2")
|
||||
SVG_ATOM(y, "y")
|
||||
SVG_ATOM(y1, "y1")
|
||||
SVG_ATOM(y2, "y2")
|
||||
|
||||
// transformation keywords
|
||||
SVG_ATOM(matrix, "matrix")
|
||||
SVG_ATOM(rotate, "rotate")
|
||||
SVG_ATOM(scale, "scale")
|
||||
SVG_ATOM(skewX, "skewX")
|
||||
SVG_ATOM(skewY, "skewY")
|
||||
SVG_ATOM(translate, "translate")
|
||||
|
||||
// length units
|
||||
SVG_ATOM(cm, "cm")
|
||||
SVG_ATOM(ems, "em")
|
||||
SVG_ATOM(exs, "ex")
|
||||
SVG_ATOM(in, "in")
|
||||
SVG_ATOM(mm, "mm")
|
||||
SVG_ATOM(pc, "pc")
|
||||
SVG_ATOM(percentage, "%")
|
||||
SVG_ATOM(pt, "pt")
|
||||
SVG_ATOM(px, "px")
|
||||
|
||||
1281
mozilla/content/shared/public/nsStyleStruct.h
Normal file
1281
mozilla/content/shared/public/nsStyleStruct.h
Normal file
File diff suppressed because it is too large
Load Diff
165
mozilla/content/shared/public/nsStyleStructList.h
Normal file
165
mozilla/content/shared/public/nsStyleStructList.h
Normal file
@@ -0,0 +1,165 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
// vim:cindent:ts=8:et:sw=4:
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* L. David Baron <dbaron@dbaron.org> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
* This file is intended to be used by different parts of the code, with
|
||||
* the STYLE_STRUCT macro (or the STYLE_STRUCT_INHERITED and
|
||||
* STYLE_STRUCT_RESET pair of macros) defined in different ways.
|
||||
*/
|
||||
|
||||
#ifndef STYLE_STRUCT_INHERITED
|
||||
#define STYLE_STRUCT_INHERITED(name, checkdata_cb, ctor_args) \
|
||||
STYLE_STRUCT(name, checkdata_cb, ctor_args)
|
||||
#define UNDEF_STYLE_STRUCT_INHERITED
|
||||
#endif
|
||||
|
||||
#ifndef STYLE_STRUCT_RESET
|
||||
#define STYLE_STRUCT_RESET(name, checkdata_cb, ctor_args) \
|
||||
STYLE_STRUCT(name, checkdata_cb, ctor_args)
|
||||
#define UNDEF_STYLE_STRUCT_RESET
|
||||
#endif
|
||||
|
||||
#ifdef STYLE_STRUCT_TEST
|
||||
#define STYLE_STRUCT_TEST_CODE(c) c
|
||||
#else
|
||||
#define STYLE_STRUCT_TEST_CODE(c)
|
||||
#endif
|
||||
|
||||
STYLE_STRUCT_TEST_CODE(if (STYLE_STRUCT_TEST < 8) {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST < 4) {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST < 2) {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 0) {)
|
||||
STYLE_STRUCT_INHERITED(Font, CheckFontCallback, (SSARG_PRESCONTEXT))
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_INHERITED(Color, nsnull, (SSARG_PRESCONTEXT))
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 2) {)
|
||||
STYLE_STRUCT_RESET(Background, nsnull, (SSARG_PRESCONTEXT))
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_INHERITED(List, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST < 6) {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 4) {)
|
||||
STYLE_STRUCT_RESET(Position, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_INHERITED(Text, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 6) {)
|
||||
STYLE_STRUCT_RESET(TextReset, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_RESET(Display, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE(} else if (STYLE_STRUCT_TEST < 16) {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST < 12) {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST < 10) {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 8) {)
|
||||
STYLE_STRUCT_INHERITED(Visibility, nsnull, (SSARG_PRESCONTEXT))
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_RESET(Content, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 10) {)
|
||||
STYLE_STRUCT_INHERITED(Quotes, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_INHERITED(UserInterface, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST < 14) {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 12) {)
|
||||
STYLE_STRUCT_RESET(UIReset, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_RESET(Table, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 14) {)
|
||||
STYLE_STRUCT_INHERITED(TableBorder, nsnull, (SSARG_PRESCONTEXT))
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_RESET(Margin, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE(} else {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST < 18) {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 16) {)
|
||||
STYLE_STRUCT_RESET(Padding, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_RESET(Border, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
#ifndef MOZ_SVG
|
||||
STYLE_STRUCT_TEST_CODE( } else if (STYLE_STRUCT_TEST == 18) {)
|
||||
STYLE_STRUCT_RESET(Outline, nsnull, (SSARG_PRESCONTEXT))
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_TEST_CODE( NS_ASSERTION(STYLE_STRUCT_TEST == 19, "out of range");)
|
||||
STYLE_STRUCT_RESET(XUL, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE(})
|
||||
#else // MOZ_SVG
|
||||
STYLE_STRUCT_TEST_CODE( } else if (STYLE_STRUCT_TEST < 20) {)
|
||||
STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 18) {)
|
||||
STYLE_STRUCT_RESET(Outline, nsnull, (SSARG_PRESCONTEXT))
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_RESET(XUL, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE( } else if (STYLE_STRUCT_TEST == 20) {)
|
||||
STYLE_STRUCT_INHERITED(SVG, nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( } else {)
|
||||
STYLE_STRUCT_TEST_CODE( NS_ASSERTION(STYLE_STRUCT_TEST == 21, "out of range");)
|
||||
STYLE_STRUCT_RESET(SVGReset,nsnull, ())
|
||||
STYLE_STRUCT_TEST_CODE( })
|
||||
STYLE_STRUCT_TEST_CODE(})
|
||||
#endif
|
||||
|
||||
#ifdef UNDEF_STYLE_STRUCT_INHERITED
|
||||
#undef STYLE_STRUCT_INHERITED
|
||||
#undef UNDEF_STYLE_STRUCT_INHERITED
|
||||
#endif
|
||||
|
||||
#ifdef UNDEF_STYLE_STRUCT_RESET
|
||||
#undef STYLE_STRUCT_RESET
|
||||
#undef UNDEF_STYLE_STRUCT_RESET
|
||||
#endif
|
||||
|
||||
#undef STYLE_STRUCT_TEST_CODE
|
||||
1767
mozilla/content/shared/src/nsCSSProps.cpp
Normal file
1767
mozilla/content/shared/src/nsCSSProps.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1450
mozilla/content/shared/src/nsStyleStruct.cpp
Normal file
1450
mozilla/content/shared/src/nsStyleStruct.cpp
Normal file
File diff suppressed because it is too large
Load Diff
116
mozilla/content/svg/content/src/Makefile.in
Normal file
116
mozilla/content/svg/content/src/Makefile.in
Normal file
@@ -0,0 +1,116 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Crocodile Clips Ltd code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Crocodile Clips Ltd. Portions created by Crocodile Clips are
|
||||
# Copyright (C) 2001 Crocodile Clips Ltd. All
|
||||
# Rights Reserved.
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = content
|
||||
LIBRARY_NAME = gkcontentsvg_s
|
||||
REQUIRES = xpcom \
|
||||
string \
|
||||
layout \
|
||||
content \
|
||||
widget \
|
||||
gfx \
|
||||
dom \
|
||||
js \
|
||||
locale \
|
||||
htmlparser \
|
||||
view \
|
||||
pref \
|
||||
necko \
|
||||
xpconnect \
|
||||
webshell
|
||||
|
||||
CPPSRCS = \
|
||||
nsSVGAnimatedLength.cpp \
|
||||
nsSVGAnimatedLengthList.cpp \
|
||||
nsSVGAnimatedRect.cpp \
|
||||
nsSVGAnimatedString.cpp \
|
||||
nsSVGAnimatedTransformList.cpp \
|
||||
nsSVGAttributes.cpp \
|
||||
nsSVGCircleElement.cpp \
|
||||
nsSVGElement.cpp \
|
||||
nsSVGElementFactory.cpp \
|
||||
nsSVGEllipseElement.cpp \
|
||||
nsSVGForeignObjectElement.cpp \
|
||||
nsSVGGElement.cpp \
|
||||
nsSVGGenericStringValue.cpp \
|
||||
nsSVGGraphicElement.cpp \
|
||||
nsSVGImageElement.cpp \
|
||||
nsSVGLength.cpp \
|
||||
nsSVGLengthList.cpp \
|
||||
nsSVGLineElement.cpp \
|
||||
nsSVGMatrix.cpp \
|
||||
nsSVGNumber.cpp \
|
||||
nsSVGPathDataParser.cpp \
|
||||
nsSVGPathElement.cpp \
|
||||
nsSVGPathSeg.cpp \
|
||||
nsSVGPathSegList.cpp \
|
||||
nsSVGPoint.cpp \
|
||||
nsSVGPointList.cpp \
|
||||
nsSVGPolygonElement.cpp \
|
||||
nsSVGPolylineElement.cpp \
|
||||
nsSVGStringProxyValue.cpp \
|
||||
nsSVGRect.cpp \
|
||||
nsSVGRectElement.cpp \
|
||||
nsSVGSVGElement.cpp \
|
||||
nsSVGStyleValue.cpp \
|
||||
nsSVGTSpanElement.cpp \
|
||||
nsSVGTextElement.cpp \
|
||||
nsSVGTransform.cpp \
|
||||
nsSVGTransformList.cpp \
|
||||
nsSVGValue.cpp \
|
||||
nsSVGViewportRect.cpp \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
# we don't want the shared lib, but we want to force the creation of a static lib.
|
||||
FORCE_STATIC_LIB = 1
|
||||
|
||||
EXPORTS = \
|
||||
nsISVGAttribute.h \
|
||||
nsISVGStyleValue.h \
|
||||
nsISVGTextContentMetrics.h \
|
||||
nsISVGValue.h \
|
||||
nsISVGValueObserver.h \
|
||||
nsISVGValueUtils.h \
|
||||
nsSVGTypeCIDs.h \
|
||||
nsISVGContent.h \
|
||||
$(NULL)
|
||||
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
||||
INCLUDES += \
|
||||
-I$(srcdir)/../../../shared/public \
|
||||
-I$(srcdir)/../../../html/base/src \
|
||||
-I$(srcdir)/../../../xml/content/src \
|
||||
-I$(srcdir)/../../../../dom \
|
||||
-I$(srcdir)/../../../base/src \
|
||||
-I$(srcdir)/../../../../layout/svg/base/src \
|
||||
-I$(srcdir)/../../../html/style/src \
|
||||
$(NULL)
|
||||
|
||||
DEFINES += -D_IMPL_NS_LAYOUT
|
||||
59
mozilla/content/svg/content/src/nsISVGContent.h
Normal file
59
mozilla/content/svg/content/src/nsISVGContent.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_ISVGCONTENT__
|
||||
#define __NS_ISVGCONTENT__
|
||||
|
||||
#include "nsISupports.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsISVGContent
|
||||
|
||||
// {4473C9A8-4376-48A5-BF99-D5820A1FF14E}
|
||||
#define NS_ISVGCONTENT_IID \
|
||||
{ 0x4473c9a8, 0x4376, 0x48a5, { 0xbf, 0x99, 0xd5, 0x82, 0x0a, 0x1f, 0xf1, 0x4e } }
|
||||
|
||||
class nsISVGContent : public nsISupports
|
||||
{
|
||||
public:
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_ISVGCONTENT_IID; return iid; }
|
||||
|
||||
NS_IMETHOD IsPresentationAttribute(const nsIAtom* attribute, PRBool* retval)=0;
|
||||
};
|
||||
|
||||
#endif // __NS_ISVGCONTENT__
|
||||
62
mozilla/content/svg/content/src/nsISVGLength.h
Normal file
62
mozilla/content/svg/content/src/nsISVGLength.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_ISVGLENGTH_H__
|
||||
#define __NS_ISVGLENGTH_H__
|
||||
|
||||
#include "nsIDOMSVGLength.h"
|
||||
|
||||
class nsISVGViewportAxis;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsISVGLength: private interface for svg lengths
|
||||
|
||||
// {4DA3041C-7A32-4F81-A44F-E468D025AD7C}
|
||||
#define NS_ISVGLENGTH_IID \
|
||||
{ 0x4da3041c, 0x7a32, 0x4f81, { 0xa4, 0x4f, 0xe4, 0x68, 0xd0, 0x25, 0xad, 0x7c } }
|
||||
|
||||
class nsISVGLength : public nsIDOMSVGLength
|
||||
{
|
||||
public:
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_ISVGLENGTH_IID; return iid; }
|
||||
|
||||
NS_IMETHOD SetContext(nsISVGViewportAxis* axis)=0;
|
||||
};
|
||||
|
||||
|
||||
#endif // __NS_ISVGLENGTH_H__
|
||||
62
mozilla/content/svg/content/src/nsISVGLengthList.h
Normal file
62
mozilla/content/svg/content/src/nsISVGLengthList.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_ISVGLENGTHLIST_H__
|
||||
#define __NS_ISVGLENGTHLIST_H__
|
||||
|
||||
#include "nsIDOMSVGLengthList.h"
|
||||
|
||||
class nsISVGViewportAxis;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsISVGLengthList: private interface for svg lengthlists
|
||||
|
||||
// {3B57DE3C-A2C3-4C17-B47A-0791C2EE0BE1}
|
||||
#define NS_ISVGLENGTHLIST_IID \
|
||||
{ 0x3b57de3c, 0xa2c3, 0x4c17, { 0xb4, 0x7a, 0x07, 0x91, 0xc2, 0xee, 0x0b, 0xe1 } }
|
||||
|
||||
class nsISVGLengthList : public nsIDOMSVGLengthList
|
||||
{
|
||||
public:
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_ISVGLENGTHLIST_IID; return iid; }
|
||||
|
||||
NS_IMETHOD SetContext(nsISVGViewportAxis* axis)=0;
|
||||
};
|
||||
|
||||
|
||||
#endif // __NS_ISVGLENGTHLIST_H__
|
||||
62
mozilla/content/svg/content/src/nsISVGSVGElement.h
Normal file
62
mozilla/content/svg/content/src/nsISVGSVGElement.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_ISVGSVGELEMENT__
|
||||
#define __NS_ISVGSVGELEMENT__
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsIDOMSVGSVGElement.h"
|
||||
|
||||
class nsISVGViewportRect;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsISVGSVGElement: private interface implemented by <svg>-elements
|
||||
|
||||
// {C82DA355-56DE-4DB0-B7A8-D9750BF0DDD9}
|
||||
#define NS_ISVGSVGELEMENT_IID \
|
||||
{ 0xc82da355, 0x56de, 0x4db0, { 0xb7, 0xa8, 0xd9, 0x75, 0x0b, 0xf0, 0xdd, 0xd9 } }
|
||||
|
||||
class nsISVGSVGElement : public nsIDOMSVGSVGElement
|
||||
{
|
||||
public:
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_ISVGSVGELEMENT_IID; return iid; }
|
||||
|
||||
NS_IMETHOD GetParentViewportRect(nsISVGViewportRect **parentViewport)=0;
|
||||
};
|
||||
|
||||
#endif // __NS_ISVGSVGELEMENT__
|
||||
60
mozilla/content/svg/content/src/nsISVGTextContentMetrics.h
Normal file
60
mozilla/content/svg/content/src/nsISVGTextContentMetrics.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_ISVGTEXTCONTENTMETRICS_H__
|
||||
#define __NS_ISVGTEXTCONTENTMETRICS_H__
|
||||
|
||||
#include "nsISupports.h"
|
||||
class nsIDOMSVGRect;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsISVGTextContentMetrics
|
||||
|
||||
// {351AC4D0-22B3-45F5-BA26-8B8CF21EF1D8}
|
||||
#define NS_ISVGTEXTCONTENTMETRICS_IID \
|
||||
{ 0x351ac4d0, 0x22b3, 0x45f5, { 0xba, 0x26, 0x8b, 0x8c, 0xf2, 0x1e, 0xf1, 0xd8 } }
|
||||
|
||||
class nsISVGTextContentMetrics : public nsISupports
|
||||
{
|
||||
public:
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_ISVGTEXTCONTENTMETRICS_IID; return iid; }
|
||||
|
||||
NS_IMETHOD GetExtentOfChar(PRUint32 charnum, nsIDOMSVGRect **_retval)=0;
|
||||
};
|
||||
|
||||
#endif // __NS_ISVGTEXTCONTENTMETRICS_H__
|
||||
87
mozilla/content/svg/content/src/nsISVGValue.h
Normal file
87
mozilla/content/svg/content/src/nsISVGValue.h
Normal file
@@ -0,0 +1,87 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
|
||||
#ifndef __NS_ISVGVALUE_H__
|
||||
#define __NS_ISVGVALUE_H__
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsString.h"
|
||||
|
||||
class nsISVGValueObserver;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsISVGValue: private interface for svg values
|
||||
|
||||
/* This interface is implemented by all value-types (e.g. coords,
|
||||
pointlists, matrices) that can be parsed from/to strings. This is
|
||||
used for element-properties that are also XML attributes. E.g. the
|
||||
'polyline'-element has a 'points'-attribute and a property
|
||||
'animatedPoints' in the DOM.
|
||||
|
||||
XXX Observers
|
||||
*/
|
||||
|
||||
// {79293232-F695-4bda-9FC7-C2679647B790}
|
||||
#define NS_ISVGVALUE_IID \
|
||||
{ 0x79293232, 0xf695, 0x4bda, { 0x9f, 0xc7, 0xc2, 0x67, 0x96, 0x47, 0xb7, 0x90 } }
|
||||
|
||||
|
||||
class nsISVGValue : public nsISupports
|
||||
{
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISVGVALUE_IID)
|
||||
|
||||
NS_IMETHOD SetValueString(const nsAString& aValue)=0;
|
||||
NS_IMETHOD GetValueString(nsAString& aValue)=0;
|
||||
|
||||
NS_IMETHOD AddObserver(nsISVGValueObserver* observer)=0;
|
||||
NS_IMETHOD RemoveObserver(nsISVGValueObserver* observer)=0;
|
||||
|
||||
NS_IMETHOD BeginBatchUpdate()=0;
|
||||
NS_IMETHOD EndBatchUpdate()=0;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_CreateSVGGenericStringValue(const nsAString& aValue, nsISVGValue** aResult);
|
||||
|
||||
nsresult
|
||||
NS_CreateSVGStringProxyValue(nsISVGValue* proxiedValue, nsISVGValue** aResult);
|
||||
|
||||
#endif // __NS_ISVGVALUE_H__
|
||||
|
||||
74
mozilla/content/svg/content/src/nsISVGValueUtils.h
Normal file
74
mozilla/content/svg/content/src/nsISVGValueUtils.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_ISVGVALUEUTILS_H__
|
||||
#define __NS_ISVGVALUEUTILS_H__
|
||||
|
||||
|
||||
|
||||
// NS_ADD_SVGVALUE_OBSERVER() :
|
||||
// add *this* as an observer to 'value'
|
||||
|
||||
#define NS_ADD_SVGVALUE_OBSERVER(value) \
|
||||
PR_BEGIN_MACRO \
|
||||
{ \
|
||||
nsCOMPtr<nsISVGValue> v = do_QueryInterface(value); \
|
||||
NS_ASSERTION(v, "can't find nsISVGValue interface on " #value ); \
|
||||
if (v) \
|
||||
v->AddObserver(this); \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
|
||||
|
||||
|
||||
// NS_REMOVE_SVGVALUE_OBSERVER() :
|
||||
// remove *this* as an observer to 'value'
|
||||
|
||||
#define NS_REMOVE_SVGVALUE_OBSERVER(value) \
|
||||
PR_BEGIN_MACRO \
|
||||
{ \
|
||||
nsCOMPtr<nsISVGValue> v = do_QueryInterface(value); \
|
||||
NS_ASSERTION(v, "can't find nsISVGValue interface on " #value ); \
|
||||
if (v) \
|
||||
v->RemoveObserver(this); \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
|
||||
|
||||
|
||||
#endif // __NS_ISVGVALUEUTILS_H__
|
||||
65
mozilla/content/svg/content/src/nsISVGViewportAxis.h
Normal file
65
mozilla/content/svg/content/src/nsISVGViewportAxis.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_ISVGVIEWPORTAXIS_H__
|
||||
#define __NS_ISVGVIEWPORTAXIS_H__
|
||||
|
||||
#include "nsISupports.h"
|
||||
|
||||
class nsIDOMSVGNumber;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsISVGViewportAxis: private interface used as a context for
|
||||
// percentage/unit-based calculations on svg lengths
|
||||
|
||||
// {62C247BD-0CF0-43B6-A937-6BD7875B5E0E}
|
||||
#define NS_ISVGVIEWPORTAXIS_IID \
|
||||
{ 0x62c247bd, 0x0cf0, 0x43b6, { 0xa9, 0x37, 0x6b, 0xd7, 0x87, 0x5b, 0x5e, 0x0e } }
|
||||
|
||||
class nsISVGViewportAxis : public nsISupports
|
||||
{
|
||||
public:
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_ISVGVIEWPORTAXIS_IID; return iid; }
|
||||
|
||||
NS_IMETHOD GetMillimeterPerPixel(nsIDOMSVGNumber **scale)=0;
|
||||
NS_IMETHOD GetLength(nsIDOMSVGNumber **length)=0;
|
||||
};
|
||||
|
||||
#endif // __NS_ISVGVIEWPORTAXIS_H__
|
||||
|
||||
|
||||
75
mozilla/content/svg/content/src/nsISVGViewportRect.h
Normal file
75
mozilla/content/svg/content/src/nsISVGViewportRect.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_ISVGVIEWPORTRECT_H__
|
||||
#define __NS_ISVGVIEWPORTRECT_H__
|
||||
|
||||
#include "nsIDOMSVGRect.h"
|
||||
|
||||
class nsISVGViewportAxis;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsISVGViewportRect: private viewport interface
|
||||
|
||||
// {96547374-899B-434C-9566-0E23C58712F6}
|
||||
#define NS_ISVGVIEWPORTRECT_IID \
|
||||
{ 0x96547374, 0x899b, 0x434c, { 0x95, 0x66, 0x0e, 0x23, 0xc5, 0x87, 0x12, 0xf6 } }
|
||||
|
||||
class nsISVGViewportRect : public nsIDOMSVGRect
|
||||
{
|
||||
public:
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_ISVGVIEWPORTRECT_IID; return iid; }
|
||||
|
||||
NS_IMETHOD GetXAxis(nsISVGViewportAxis **xaxis)=0;
|
||||
NS_IMETHOD GetYAxis(nsISVGViewportAxis **yaxis)=0;
|
||||
NS_IMETHOD GetUnspecifiedAxis(nsISVGViewportAxis **axis)=0;
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
class nsIDOMSVGNumber;
|
||||
|
||||
extern nsresult
|
||||
NS_NewSVGViewportRect(nsISVGViewportRect **result,
|
||||
nsIDOMSVGNumber* scalex,
|
||||
nsIDOMSVGNumber* scaley,
|
||||
nsIDOMSVGNumber* lengthx,
|
||||
nsIDOMSVGNumber* lengthy);
|
||||
|
||||
#endif // __NS_ISVGVIEWPORTRECT_H__
|
||||
202
mozilla/content/svg/content/src/nsSVGAnimatedLength.cpp
Normal file
202
mozilla/content/svg/content/src/nsSVGAnimatedLength.cpp
Normal file
@@ -0,0 +1,202 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGValue.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsSVGAnimatedLength.h"
|
||||
#include "nsSVGLength.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGAnimatedLength
|
||||
|
||||
class nsSVGAnimatedLength : public nsIDOMSVGAnimatedLength,
|
||||
public nsSVGValue,
|
||||
public nsISVGValueObserver,
|
||||
public nsSupportsWeakReference
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGAnimatedLength(nsIDOMSVGAnimatedLength** result,
|
||||
nsIDOMSVGLength* baseVal);
|
||||
nsSVGAnimatedLength();
|
||||
~nsSVGAnimatedLength();
|
||||
void Init(nsIDOMSVGLength* baseVal);
|
||||
|
||||
public:
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMSVGAnimatedLength interface:
|
||||
NS_DECL_NSIDOMSVGANIMATEDLENGTH
|
||||
|
||||
// remainder of nsISVGValue interface:
|
||||
NS_IMETHOD SetValueString(const nsAString& aValue);
|
||||
NS_IMETHOD GetValueString(nsAString& aValue);
|
||||
|
||||
// nsISVGValueObserver
|
||||
NS_IMETHOD WillModifySVGObservable(nsISVGValue* observable);
|
||||
NS_IMETHOD DidModifySVGObservable (nsISVGValue* observable);
|
||||
|
||||
// nsISupportsWeakReference
|
||||
// implementation inherited from nsSupportsWeakReference
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsIDOMSVGLength> mBaseVal;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsSVGAnimatedLength::nsSVGAnimatedLength()
|
||||
{
|
||||
}
|
||||
|
||||
nsSVGAnimatedLength::~nsSVGAnimatedLength()
|
||||
{
|
||||
if (!mBaseVal) return;
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(mBaseVal);
|
||||
if (!val) return;
|
||||
val->RemoveObserver(this);
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGAnimatedLength::Init(nsIDOMSVGLength* baseVal)
|
||||
{
|
||||
mBaseVal = baseVal;
|
||||
if (!mBaseVal) return;
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(mBaseVal);
|
||||
NS_ASSERTION(val, "baseval needs to implement nsISVGValue interface");
|
||||
if (!val) return;
|
||||
val->AddObserver(this);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGAnimatedLength)
|
||||
NS_IMPL_RELEASE(nsSVGAnimatedLength)
|
||||
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGAnimatedLength)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedLength)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedLength)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValue methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedLength::SetValueString(const nsAString& aValue)
|
||||
{
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mBaseVal);
|
||||
return value->SetValueString(aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedLength::GetValueString(nsAString& aValue)
|
||||
{
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mBaseVal);
|
||||
return value->GetValueString(aValue);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGAnimatedLength methods:
|
||||
|
||||
/* readonly attribute nsIDOMSVGLength baseVal; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedLength::GetBaseVal(nsIDOMSVGLength * *aBaseVal)
|
||||
{
|
||||
*aBaseVal = mBaseVal;
|
||||
NS_ADDREF(*aBaseVal);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGLength animVal; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedLength::GetAnimVal(nsIDOMSVGLength * *aAnimVal)
|
||||
{
|
||||
*aAnimVal = mBaseVal;
|
||||
NS_ADDREF(*aAnimVal);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValueObserver methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedLength::WillModifySVGObservable(nsISVGValue* observable)
|
||||
{
|
||||
WillModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedLength::DidModifySVGObservable (nsISVGValue* observable)
|
||||
{
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Exported creation functions
|
||||
|
||||
nsresult
|
||||
NS_NewSVGAnimatedLength(nsIDOMSVGAnimatedLength** aResult,
|
||||
nsIDOMSVGLength* baseVal)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
|
||||
nsSVGAnimatedLength* animatedLength = new nsSVGAnimatedLength();
|
||||
if(!animatedLength) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(animatedLength);
|
||||
|
||||
// nsCOMPtr<nsIDOMSVGLength> baseVal;
|
||||
// NS_NewSVGLength(getter_AddRefs(baseVal), context);
|
||||
|
||||
animatedLength->Init(baseVal);
|
||||
|
||||
*aResult = (nsIDOMSVGAnimatedLength*) animatedLength;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
200
mozilla/content/svg/content/src/nsSVGAnimatedLengthList.cpp
Normal file
200
mozilla/content/svg/content/src/nsSVGAnimatedLengthList.cpp
Normal file
@@ -0,0 +1,200 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGAnimatedLengthList.h"
|
||||
#include "nsSVGLengthList.h"
|
||||
#include "nsSVGValue.h"
|
||||
#include "nsWeakReference.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGAnimatedTransformList
|
||||
|
||||
class nsSVGAnimatedLengthList : public nsIDOMSVGAnimatedLengthList,
|
||||
public nsSVGValue,
|
||||
public nsISVGValueObserver,
|
||||
public nsSupportsWeakReference
|
||||
{
|
||||
protected:
|
||||
friend nsresult
|
||||
NS_NewSVGAnimatedLengthList(nsIDOMSVGAnimatedLengthList** result,
|
||||
nsIDOMSVGLengthList* baseVal);
|
||||
|
||||
nsSVGAnimatedLengthList();
|
||||
~nsSVGAnimatedLengthList();
|
||||
void Init(nsIDOMSVGLengthList* baseVal);
|
||||
|
||||
public:
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMSVGAnimatedLengthList interface:
|
||||
NS_DECL_NSIDOMSVGANIMATEDLENGTHLIST
|
||||
|
||||
// remainder of nsISVGValue interface:
|
||||
NS_IMETHOD SetValueString(const nsAString& aValue);
|
||||
NS_IMETHOD GetValueString(nsAString& aValue);
|
||||
|
||||
// nsISVGValueObserver
|
||||
NS_IMETHOD WillModifySVGObservable(nsISVGValue* observable);
|
||||
NS_IMETHOD DidModifySVGObservable (nsISVGValue* observable);
|
||||
|
||||
// nsISupportsWeakReference
|
||||
// implementation inherited from nsSupportsWeakReference
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsIDOMSVGLengthList> mBaseVal;
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsSVGAnimatedLengthList::nsSVGAnimatedLengthList()
|
||||
{
|
||||
}
|
||||
|
||||
nsSVGAnimatedLengthList::~nsSVGAnimatedLengthList()
|
||||
{
|
||||
if (!mBaseVal) return;
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(mBaseVal);
|
||||
if (!val) return;
|
||||
val->RemoveObserver(this);
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGAnimatedLengthList::Init(nsIDOMSVGLengthList* baseVal)
|
||||
{
|
||||
mBaseVal = baseVal;
|
||||
if (!mBaseVal) return;
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(mBaseVal);
|
||||
if (!val) return;
|
||||
val->AddObserver(this);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGAnimatedLengthList)
|
||||
NS_IMPL_RELEASE(nsSVGAnimatedLengthList)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGAnimatedLengthList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedLengthList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedLengthList)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValue methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedLengthList::SetValueString(const nsAString& aValue)
|
||||
{
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mBaseVal);
|
||||
return value->SetValueString(aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedLengthList::GetValueString(nsAString& aValue)
|
||||
{
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mBaseVal);
|
||||
return value->GetValueString(aValue);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGAnimatedLengthList methods:
|
||||
|
||||
/* readonly attribute nsIDOMSVGLengthList baseVal; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedLengthList::GetBaseVal(nsIDOMSVGLengthList * *aBaseVal)
|
||||
{
|
||||
*aBaseVal = mBaseVal;
|
||||
NS_ADDREF(*aBaseVal);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGLengthList animVal; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedLengthList::GetAnimVal(nsIDOMSVGLengthList * *aAnimVal)
|
||||
{
|
||||
*aAnimVal = mBaseVal;
|
||||
NS_ADDREF(*aAnimVal);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValueObserver methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedLengthList::WillModifySVGObservable(nsISVGValue* observable)
|
||||
{
|
||||
WillModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedLengthList::DidModifySVGObservable (nsISVGValue* observable)
|
||||
{
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Exported creation functions:
|
||||
|
||||
nsresult
|
||||
NS_NewSVGAnimatedLengthList(nsIDOMSVGAnimatedLengthList** result,
|
||||
nsIDOMSVGLengthList* baseVal)
|
||||
{
|
||||
*result = nsnull;
|
||||
|
||||
nsSVGAnimatedLengthList* animatedLengthList = new nsSVGAnimatedLengthList();
|
||||
if(!animatedLengthList) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(animatedLengthList);
|
||||
|
||||
animatedLengthList->Init(baseVal);
|
||||
|
||||
*result = (nsIDOMSVGAnimatedLengthList*) animatedLengthList;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
49
mozilla/content/svg/content/src/nsSVGAnimatedLengthList.h
Normal file
49
mozilla/content/svg/content/src/nsSVGAnimatedLengthList.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_SVGANIMATEDLENGTHLIST_H__
|
||||
#define __NS_SVGANIMATEDLENGTHLIST_H__
|
||||
|
||||
#include "nsIDOMSVGAnimatedLengthList.h"
|
||||
#include "nsIDOMSVGLengthList.h"
|
||||
|
||||
nsresult
|
||||
NS_NewSVGAnimatedLengthList(nsIDOMSVGAnimatedLengthList** result,
|
||||
nsIDOMSVGLengthList* baseVal);
|
||||
|
||||
#endif //__NS_SVGANIMATEDLENGTHLIST_H__
|
||||
164
mozilla/content/svg/content/src/nsSVGAnimatedString.cpp
Normal file
164
mozilla/content/svg/content/src/nsSVGAnimatedString.cpp
Normal file
@@ -0,0 +1,164 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGValue.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsSVGAnimatedString.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGAnimatedString
|
||||
|
||||
class nsSVGAnimatedString : public nsIDOMSVGAnimatedString,
|
||||
public nsSVGValue
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGAnimatedString(nsIDOMSVGAnimatedString** result);
|
||||
nsSVGAnimatedString();
|
||||
~nsSVGAnimatedString();
|
||||
void Init();
|
||||
|
||||
public:
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMSVGAnimatedString interface:
|
||||
NS_DECL_NSIDOMSVGANIMATEDSTRING
|
||||
|
||||
// remainder of nsISVGValue interface:
|
||||
NS_IMETHOD SetValueString(const nsAString& aValue);
|
||||
NS_IMETHOD GetValueString(nsAString& aValue);
|
||||
|
||||
protected:
|
||||
nsString mBaseVal;
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsSVGAnimatedString::nsSVGAnimatedString()
|
||||
{
|
||||
}
|
||||
|
||||
nsSVGAnimatedString::~nsSVGAnimatedString()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGAnimatedString::Init()
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGAnimatedString)
|
||||
NS_IMPL_RELEASE(nsSVGAnimatedString)
|
||||
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGAnimatedString)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedString)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedString)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValue methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedString::SetValueString(const nsAString& aValue)
|
||||
{
|
||||
WillModify();
|
||||
mBaseVal = aValue;
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedString::GetValueString(nsAString& aValue)
|
||||
{
|
||||
aValue = mBaseVal;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGAnimatedString methods:
|
||||
|
||||
|
||||
/* attribute DOMString baseVal; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedString::GetBaseVal(nsAString & aBaseVal)
|
||||
{
|
||||
aBaseVal = mBaseVal;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedString::SetBaseVal(const nsAString & aBaseVal)
|
||||
{
|
||||
mBaseVal = aBaseVal;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString animVal; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGAnimatedString::GetAnimVal(nsAString & aAnimVal)
|
||||
{
|
||||
aAnimVal = mBaseVal;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Exported creation functions
|
||||
|
||||
nsresult
|
||||
NS_NewSVGAnimatedString(nsIDOMSVGAnimatedString** aResult)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
|
||||
nsSVGAnimatedString* animatedString = new nsSVGAnimatedString();
|
||||
if(!animatedString) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(animatedString);
|
||||
|
||||
animatedString->Init();
|
||||
|
||||
*aResult = (nsIDOMSVGAnimatedString*) animatedString;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
49
mozilla/content/svg/content/src/nsSVGAnimatedString.h
Normal file
49
mozilla/content/svg/content/src/nsSVGAnimatedString.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_SVGANIMATEDSTRING_H__
|
||||
#define __NS_SVGANIMATEDSTRING_H__
|
||||
|
||||
#include "nsIDOMSVGAnimatedString.h"
|
||||
|
||||
nsresult NS_NewSVGAnimatedString(nsIDOMSVGAnimatedString** result);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //__NS_SVGANIMATEDSTRING_H__
|
||||
1095
mozilla/content/svg/content/src/nsSVGAttributes.cpp
Normal file
1095
mozilla/content/svg/content/src/nsSVGAttributes.cpp
Normal file
File diff suppressed because it is too large
Load Diff
218
mozilla/content/svg/content/src/nsSVGAttributes.h
Normal file
218
mozilla/content/svg/content/src/nsSVGAttributes.h
Normal file
@@ -0,0 +1,218 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
|
||||
#ifndef __NS_SVGATTRIBUTES_H__
|
||||
#define __NS_SVGATTRIBUTES_H__
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsISVGAttribute.h"
|
||||
#include "nsIDOMNamedNodeMap.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsINodeInfo.h"
|
||||
#include "nsISVGValue.h"
|
||||
#include "nsISVGValueObserver.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsICSSStyleRule.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsAttrName.h"
|
||||
|
||||
class nsIStyledContent;
|
||||
class nsSVGAttributes;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// SVG Attribute Flags
|
||||
|
||||
// XXX these flags are not used yet
|
||||
|
||||
typedef PRUint32 nsSVGAttributeFlags;
|
||||
|
||||
// This is a #REQUIRED-attribute. Should not be allowed to unset
|
||||
#define NS_SVGATTRIBUTE_FLAGS_REQUIRED 0x0001
|
||||
|
||||
// This is a #FIXED-attribute. Should not be allowed to set/unset
|
||||
#define NS_SVGATTRIBUTE_FLAGS_FIXED 0x0002
|
||||
|
||||
// this attribute is a mapped value. if it is being unset we keep it
|
||||
// around to be reused:
|
||||
#define NS_SVGATTRIBUTE_FLAGS_MAPPED 0x0004
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGAttribute
|
||||
|
||||
class nsSVGAttribute : public nsISVGAttribute, // :nsIDOMAttr
|
||||
public nsISVGValueObserver,
|
||||
public nsSupportsWeakReference
|
||||
{
|
||||
public:
|
||||
static nsresult
|
||||
Create(const nsAttrName& aName,
|
||||
nsISVGValue* value,
|
||||
nsSVGAttributeFlags flags,
|
||||
nsSVGAttribute** aResult);
|
||||
|
||||
// create a generic string attribute:
|
||||
static nsresult
|
||||
Create(const nsAttrName& aName,
|
||||
const nsAString& value,
|
||||
nsSVGAttribute** aResult);
|
||||
|
||||
protected:
|
||||
|
||||
nsSVGAttribute(const nsAttrName& aName,
|
||||
nsISVGValue* value,
|
||||
nsSVGAttributeFlags flags);
|
||||
|
||||
virtual ~nsSVGAttribute();
|
||||
|
||||
public:
|
||||
// nsISupports interface
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode interface
|
||||
NS_DECL_NSIDOMNODE
|
||||
|
||||
// nsIDOMAttr interface
|
||||
NS_DECL_NSIDOMATTR
|
||||
|
||||
// nsISVGAttribute interface
|
||||
NS_IMETHOD GetSVGValue(nsISVGValue** value);
|
||||
|
||||
// nsISVGValueObserver
|
||||
NS_IMETHOD WillModifySVGObservable(nsISVGValue* observable);
|
||||
NS_IMETHOD DidModifySVGObservable (nsISVGValue* observable);
|
||||
|
||||
// nsISupportsWeakReference
|
||||
// implementation inherited from nsSupportsWeakReference
|
||||
|
||||
|
||||
// other implementation functions
|
||||
const nsAttrName* Name() const { return &mName; }
|
||||
void GetQualifiedName(nsAString& aQualifiedName)const;
|
||||
|
||||
nsISVGValue* GetValue() { return mValue; }
|
||||
|
||||
void SetValueString(const nsAString& aValue);
|
||||
|
||||
nsSVGAttributeFlags GetFlags()const { return mFlags; }
|
||||
PRBool IsRequired()const { return mFlags & NS_SVGATTRIBUTE_FLAGS_REQUIRED; }
|
||||
PRBool IsFixed()const { return mFlags & NS_SVGATTRIBUTE_FLAGS_FIXED; }
|
||||
|
||||
protected:
|
||||
friend class nsSVGAttributes;
|
||||
|
||||
nsSVGAttributeFlags mFlags;
|
||||
nsSVGAttributes* mOwner;
|
||||
nsAttrName mName;
|
||||
nsCOMPtr<nsISVGValue> mValue;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGAttributes: the collection of attribs for one content element
|
||||
|
||||
class nsSVGAttributes : public nsIDOMNamedNodeMap
|
||||
{
|
||||
public:
|
||||
static nsresult
|
||||
Create(nsIStyledContent* aElement, nsSVGAttributes** aResult);
|
||||
|
||||
protected:
|
||||
nsSVGAttributes(nsIStyledContent* aContent);
|
||||
virtual ~nsSVGAttributes();
|
||||
|
||||
public:
|
||||
// nsISupports interface
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNamedNodeMap interface
|
||||
NS_DECL_NSIDOMNAMEDNODEMAP
|
||||
|
||||
// interface exposed to the content element:
|
||||
PRInt32 Count() const;
|
||||
nsresult GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
nsAString& aResult);
|
||||
nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix,
|
||||
const nsAString& aValue, PRBool aNotify);
|
||||
nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
PRBool aNotify);
|
||||
NS_IMETHOD_(PRBool) HasAttr(PRInt32 aNameSpaceID,
|
||||
nsIAtom* aName) const;
|
||||
const nsAttrName* GetExistingAttrNameFromQName(const nsAString& aStr);
|
||||
nsresult GetAttrNameAt(PRInt32 aIndex,
|
||||
PRInt32* aNameSpaceID,
|
||||
nsIAtom** aName,
|
||||
nsIAtom** aPrefix);
|
||||
|
||||
nsresult AddMappedSVGValue(nsIAtom* name, nsISupports* value,
|
||||
PRInt32 namespaceID=kNameSpaceID_None);
|
||||
nsresult CopyAttributes(nsSVGAttributes* dest);
|
||||
void GetContentStyleRule(nsIStyleRule** rule);
|
||||
|
||||
// interface exposed to our attributes:
|
||||
nsIStyledContent* GetContent(){ return mContent; }
|
||||
void AttributeWasModified(nsSVGAttribute* caller);
|
||||
|
||||
protected:
|
||||
// implementation helpers:
|
||||
void ReleaseAttributes();
|
||||
void ReleaseMappedAttributes();
|
||||
PRBool GetMappedAttribute(PRInt32 aNamespaceID, nsIAtom* aName,
|
||||
nsSVGAttribute** attrib);
|
||||
|
||||
PRBool IsExplicitAttribute(nsSVGAttribute* attrib);
|
||||
PRBool IsMappedAttribute(nsSVGAttribute* attrib);
|
||||
|
||||
nsSVGAttribute* ElementAt(PRInt32 index) const;
|
||||
void AppendElement(nsSVGAttribute* aElement);
|
||||
void RemoveElementAt(PRInt32 aIndex);
|
||||
|
||||
PRBool AffectsContentStyleRule(const nsIAtom* aAttribute);
|
||||
void UpdateContentStyleRule();
|
||||
|
||||
nsIStyledContent* mContent; // our owner
|
||||
|
||||
nsCOMPtr<nsICSSStyleRule> mContentStyleRule;
|
||||
nsAutoVoidArray mAttributes;
|
||||
nsAutoVoidArray mMappedAttributes;
|
||||
};
|
||||
|
||||
|
||||
#endif // __NS_SVGATTRIBUTES_H__
|
||||
|
||||
318
mozilla/content/svg/content/src/nsSVGCircleElement.cpp
Normal file
318
mozilla/content/svg/content/src/nsSVGCircleElement.cpp
Normal file
@@ -0,0 +1,318 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGGraphicElement.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
#include "nsSVGAnimatedLength.h"
|
||||
#include "nsSVGLength.h"
|
||||
#include "nsIDOMSVGCircleElement.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsISVGSVGElement.h"
|
||||
#include "nsISVGViewportAxis.h"
|
||||
#include "nsISVGViewportRect.h"
|
||||
|
||||
typedef nsSVGGraphicElement nsSVGCircleElementBase;
|
||||
|
||||
class nsSVGCircleElement : public nsSVGCircleElementBase,
|
||||
public nsIDOMSVGCircleElement
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGCircleElement(nsIContent **aResult,
|
||||
nsINodeInfo *aNodeInfo);
|
||||
nsSVGCircleElement();
|
||||
virtual ~nsSVGCircleElement();
|
||||
virtual nsresult Init();
|
||||
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIDOMSVGCIRCLEELEMENT
|
||||
|
||||
// xxx I wish we could use virtual inheritance
|
||||
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsSVGCircleElementBase::)
|
||||
NS_FORWARD_NSIDOMELEMENT(nsSVGCircleElementBase::)
|
||||
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGCircleElementBase::)
|
||||
|
||||
protected:
|
||||
virtual void ParentChainChanged();
|
||||
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mCx;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mCy;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mR;
|
||||
|
||||
};
|
||||
|
||||
|
||||
nsresult NS_NewSVGCircleElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
nsSVGCircleElement* it = new nsSVGCircleElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aResult = NS_STATIC_CAST(nsIContent *, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsSVGCircleElement,nsSVGCircleElementBase)
|
||||
NS_IMPL_RELEASE_INHERITED(nsSVGCircleElement,nsSVGCircleElementBase)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGCircleElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGCircleElement)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGCircleElement)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsSVGCircleElementBase)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsSVGCircleElement::nsSVGCircleElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
nsSVGCircleElement::~nsSVGCircleElement()
|
||||
{
|
||||
if (mCx) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mCx);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mCy) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mCy);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mR) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mR);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsSVGCircleElement::Init()
|
||||
{
|
||||
nsresult rv;
|
||||
rv = nsSVGCircleElementBase::Init();
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
// Create mapped properties:
|
||||
|
||||
// DOM property: cx , #IMPLIED attrib: cx
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length), 0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mCx), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::cx, mCx);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: cy , #IMPLIED attrib: cy
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length), 0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mCy), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::cy, mCy);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: r , #REQUIRED attrib: r
|
||||
// XXX: enforce requiredness
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length), 0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mR), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::r, mR);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGCircleElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
||||
{
|
||||
*aReturn = nsnull;
|
||||
nsSVGCircleElement* it = new nsSVGCircleElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = CopyNode(it, aDeep);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aReturn = NS_STATIC_CAST(nsSVGCircleElementBase*, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGCircleElement methods
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength cx; */
|
||||
NS_IMETHODIMP nsSVGCircleElement::GetCx(nsIDOMSVGAnimatedLength * *aCx)
|
||||
{
|
||||
*aCx = mCx;
|
||||
NS_IF_ADDREF(*aCx);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength cy; */
|
||||
NS_IMETHODIMP nsSVGCircleElement::GetCy(nsIDOMSVGAnimatedLength * *aCy)
|
||||
{
|
||||
*aCy = mCy;
|
||||
NS_IF_ADDREF(*aCy);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength r; */
|
||||
NS_IMETHODIMP nsSVGCircleElement::GetR(nsIDOMSVGAnimatedLength * *aR)
|
||||
{
|
||||
*aR = mR;
|
||||
NS_IF_ADDREF(*aR);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
|
||||
void nsSVGCircleElement::ParentChainChanged()
|
||||
{
|
||||
// set new context information on our length-properties:
|
||||
|
||||
nsCOMPtr<nsIDOMSVGSVGElement> dom_elem;
|
||||
GetOwnerSVGElement(getter_AddRefs(dom_elem));
|
||||
if (!dom_elem) return;
|
||||
|
||||
nsCOMPtr<nsISVGSVGElement> svg_elem = do_QueryInterface(dom_elem);
|
||||
NS_ASSERTION(svg_elem, "<svg> element missing interface");
|
||||
|
||||
// cx:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mCx->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetXAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// cy:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mCy->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetYAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// r:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mR->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetUnspecifiedAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
}
|
||||
646
mozilla/content/svg/content/src/nsSVGElement.cpp
Normal file
646
mozilla/content/svg/content/src/nsSVGElement.cpp
Normal file
@@ -0,0 +1,646 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGElement.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsRange.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIDOMMutationEvent.h"
|
||||
#include "nsMutationEvent.h"
|
||||
#include "nsIBindingManager.h"
|
||||
#include "nsIXBLBinding.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsDOMError.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIXBLService.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
#include "nsICSSStyleRule.h"
|
||||
#include "nsISVGSVGElement.h"
|
||||
#include "nsRuleWalker.h"
|
||||
#include "nsSVGStyleValue.h"
|
||||
|
||||
nsSVGElement::nsSVGElement()
|
||||
: mAttributes(nsnull)
|
||||
{
|
||||
}
|
||||
|
||||
nsSVGElement::~nsSVGElement()
|
||||
{
|
||||
|
||||
PRInt32 count = mChildren.Count();
|
||||
PRInt32 index;
|
||||
for (index = 0; index < count; index++) {
|
||||
mChildren[index]->SetParent(nsnull);
|
||||
}
|
||||
|
||||
if (mAttributes)
|
||||
NS_RELEASE(mAttributes);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsSVGElement,nsGenericElement)
|
||||
NS_IMPL_RELEASE_INHERITED(nsSVGElement,nsGenericElement)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIXMLContent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNode)
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOM3Node, new nsNode3Tearoff(this))
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGContent)
|
||||
// provided by nsGenericElement:
|
||||
// NS_INTERFACE_MAP_ENTRY(nsIStyledContent)
|
||||
// NS_INTERFACE_MAP_ENTRY(nsIContent)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsGenericElement)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsresult
|
||||
nsSVGElement::Init()
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
rv = nsSVGAttributes::Create(this,&mAttributes);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
nsCOMPtr<nsINodeInfo> ni;
|
||||
|
||||
// Create mapped properties:
|
||||
|
||||
// style #IMPLIED
|
||||
rv = NS_NewSVGStyleValue(getter_AddRefs(mStyle));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::style, mStyle);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIContent methods
|
||||
|
||||
void
|
||||
nsSVGElement::SetParent(nsIContent* aParent)
|
||||
{
|
||||
nsGenericElement::SetParent(aParent);
|
||||
|
||||
ParentChainChanged();
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsSVGElement::CanContainChildren() const
|
||||
{
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PRUint32
|
||||
nsSVGElement::GetChildCount() const
|
||||
{
|
||||
return mChildren.Count();
|
||||
}
|
||||
|
||||
nsIContent *
|
||||
nsSVGElement::GetChildAt(PRUint32 aIndex) const
|
||||
{
|
||||
return mChildren.SafeObjectAt(aIndex);
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsSVGElement::IndexOf(nsIContent* aPossibleChild) const
|
||||
{
|
||||
return mChildren.IndexOf(aPossibleChild);
|
||||
}
|
||||
|
||||
nsIAtom *
|
||||
nsSVGElement::GetIDAttributeName() const
|
||||
{
|
||||
return nsSVGAtoms::id;
|
||||
}
|
||||
|
||||
const nsAttrName*
|
||||
nsSVGElement::InternalGetExistingAttrNameFromQName(const nsAString& aStr) const
|
||||
{
|
||||
return mAttributes->GetExistingAttrNameFromQName(aStr);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsSVGElement::SetAttr(PRInt32 aNamespaceID, nsIAtom* aName, nsIAtom* aPrefix,
|
||||
const nsAString& aValue,
|
||||
PRBool aNotify)
|
||||
{
|
||||
return mAttributes->SetAttr(aNamespaceID, aName, aPrefix, aValue, aNotify);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsSVGElement::GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown,
|
||||
"must have a real namespace ID!");
|
||||
|
||||
return mAttributes->GetAttr(aNameSpaceID, aName, aResult);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsSVGElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
PRBool aNotify)
|
||||
{
|
||||
return mAttributes->UnsetAttr(aNameSpaceID, aName, aNotify);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsSVGElement::HasAttr(PRInt32 aNameSpaceID, nsIAtom* aName) const
|
||||
{
|
||||
NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown,
|
||||
"must have a real namespace ID!");
|
||||
return mAttributes->HasAttr(aNameSpaceID, aName);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsSVGElement::GetAttrNameAt(PRUint32 aIndex,
|
||||
PRInt32* aNameSpaceID,
|
||||
nsIAtom** aName,
|
||||
nsIAtom** aPrefix) const
|
||||
{
|
||||
return mAttributes->GetAttrNameAt(aIndex, aNameSpaceID, aName, aPrefix);
|
||||
}
|
||||
|
||||
PRUint32
|
||||
nsSVGElement::GetAttrCount() const
|
||||
{
|
||||
return mAttributes->Count();
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
nsSVGElement::List(FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
// XXX
|
||||
fprintf(out, "some SVG element\n");
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGElement::DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const
|
||||
{
|
||||
// XXX
|
||||
fprintf(out, "some SVG element\n");
|
||||
}
|
||||
#endif // DEBUG
|
||||
|
||||
nsresult
|
||||
nsSVGElement::SetBindingParent(nsIContent* aParent)
|
||||
{
|
||||
nsresult rv = nsGenericElement::SetBindingParent(aParent);
|
||||
|
||||
// XXX Are parent and bindingparent always in sync? (in which case
|
||||
// we don't have to call ParentChainChanged() here)
|
||||
ParentChainChanged();
|
||||
return rv;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIStyledContent methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetID(nsIAtom** aId)const
|
||||
{
|
||||
nsAutoString value;
|
||||
|
||||
nsresult rv = NS_CONST_CAST(nsSVGElement*,this)->
|
||||
GetAttribute(NS_LITERAL_STRING("id"), value);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
*aId = NS_NewAtom(value);
|
||||
else
|
||||
*aId = nsnull;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
// printf("nsSVGElement(%p)::WalkContentStyleRules()\n", this);
|
||||
#endif
|
||||
nsCOMPtr<nsIStyleRule> rule;
|
||||
mAttributes->GetContentStyleRule(getter_AddRefs(rule));
|
||||
if (rule)
|
||||
aRuleWalker->Forward(rule);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetInlineStyleRule(nsICSSStyleRule** aStyleRule)
|
||||
{
|
||||
return mStyle->GetStyleRule(this, aStyleRule);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetNodeName(nsAString& aNodeName)
|
||||
{
|
||||
mNodeInfo->GetQualifiedName(aNodeName);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetNodeValue(nsAString& aNodeValue)
|
||||
{
|
||||
SetDOMStringToNull(aNodeValue);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::SetNodeValue(const nsAString& aNodeValue)
|
||||
{
|
||||
// The DOM spec says that when nodeValue is defined to be null "setting it
|
||||
// has no effect", so we don't throw an exception.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetNodeType(PRUint16* aNodeType)
|
||||
{
|
||||
*aNodeType = (PRUint16)nsIDOMNode::ELEMENT_NODE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetParentNode(nsIDOMNode** aParentNode)
|
||||
{
|
||||
if (GetParent()) {
|
||||
return CallQueryInterface(GetParent(), aParentNode);
|
||||
}
|
||||
if (mDocument) {
|
||||
// we're the root content
|
||||
return CallQueryInterface(mDocument, aParentNode);
|
||||
}
|
||||
|
||||
// A standalone element (i.e. one without a parent or a document)
|
||||
*aParentNode = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetChildNodes(nsIDOMNodeList** aChildNodes)
|
||||
{
|
||||
nsDOMSlots *slots = GetDOMSlots();
|
||||
|
||||
if (!slots->mChildNodes) {
|
||||
slots->mChildNodes = new nsChildContentList(this);
|
||||
if (!slots->mChildNodes) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
NS_ADDREF(*aChildNodes = slots->mChildNodes);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetFirstChild(nsIDOMNode** aNode)
|
||||
{
|
||||
nsIContent *child = mChildren.SafeObjectAt(0);
|
||||
if (child) {
|
||||
nsresult res = CallQueryInterface(child, aNode);
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "Must be a DOM Node"); // must be a DOM Node
|
||||
return res;
|
||||
}
|
||||
|
||||
*aNode = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetLastChild(nsIDOMNode** aNode)
|
||||
{
|
||||
PRInt32 count = mChildren.Count();
|
||||
if (count) {
|
||||
nsresult res = CallQueryInterface(mChildren[count - 1], aNode);
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "Must be a DOM Node"); // must be a DOM Node
|
||||
return res;
|
||||
}
|
||||
|
||||
*aNode = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetPreviousSibling(nsIDOMNode** aPreviousSibling)
|
||||
{
|
||||
return nsGenericElement::GetPreviousSibling(aPreviousSibling);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetNextSibling(nsIDOMNode** aNextSibling)
|
||||
{
|
||||
return nsGenericElement::GetNextSibling(aNextSibling);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetAttributes(nsIDOMNamedNodeMap** aAttributes)
|
||||
{
|
||||
*aAttributes = mAttributes;
|
||||
NS_ADDREF(*aAttributes);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetOwnerDocument(nsIDOMDocument** aOwnerDocument)
|
||||
{
|
||||
return nsGenericElement::GetOwnerDocument(aOwnerDocument);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetNamespaceURI(nsAString& aNamespaceURI)
|
||||
{
|
||||
return mNodeInfo->GetNamespaceURI(aNamespaceURI);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetPrefix(nsAString& aPrefix)
|
||||
{
|
||||
return nsGenericElement::GetPrefix(aPrefix);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::SetPrefix(const nsAString& aPrefix)
|
||||
{
|
||||
return nsGenericElement::SetPrefix(aPrefix);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetLocalName(nsAString& aLocalName)
|
||||
{
|
||||
return nsGenericElement::GetLocalName(aLocalName);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::InsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild, nsIDOMNode** aReturn)
|
||||
{
|
||||
return nsGenericElement::doInsertBefore(this, aNewChild, aRefChild, aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::ReplaceChild(nsIDOMNode* aNewChild, nsIDOMNode* aOldChild, nsIDOMNode** aReturn)
|
||||
{
|
||||
return nsGenericElement::doReplaceChild(this, aNewChild, aOldChild, aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::RemoveChild(nsIDOMNode* aOldChild, nsIDOMNode** aReturn)
|
||||
{
|
||||
return nsGenericElement::doRemoveChild(this, aOldChild, aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::AppendChild(nsIDOMNode* aNewChild, nsIDOMNode** aReturn)
|
||||
{
|
||||
return nsGenericElement::doInsertBefore(this, aNewChild, nsnull, aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::HasChildNodes(PRBool* aReturn)
|
||||
{
|
||||
if (0 != mChildren.Count()) {
|
||||
*aReturn = PR_TRUE;
|
||||
}
|
||||
else {
|
||||
*aReturn = PR_FALSE;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
||||
{
|
||||
NS_ASSERTION(1==0,"CloneNode must be implemented by subclass!");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::Normalize()
|
||||
{
|
||||
return nsGenericElement::Normalize();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::IsSupported(const nsAString& aFeature, const nsAString& aVersion, PRBool* aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::HasAttributes(PRBool* aReturn)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aReturn);
|
||||
|
||||
*aReturn = GetAttrCount() > 0;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMElement methods
|
||||
|
||||
// forwarded to nsGenericElement implementations
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGElement methods
|
||||
|
||||
/* attribute DOMString id; */
|
||||
NS_IMETHODIMP nsSVGElement::GetId(nsAString & aId)
|
||||
{
|
||||
return GetAttribute(NS_LITERAL_STRING("id"), aId);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsSVGElement::SetId(const nsAString & aId)
|
||||
{
|
||||
return SetAttribute(NS_LITERAL_STRING("id"), aId);
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGSVGElement ownerSVGElement; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetOwnerSVGElement(nsIDOMSVGSVGElement * *aOwnerSVGElement)
|
||||
{
|
||||
*aOwnerSVGElement = nsnull;
|
||||
|
||||
nsIBindingManager *bindingManager = nsnull;
|
||||
if (mDocument) {
|
||||
bindingManager = mDocument->GetBindingManager();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
|
||||
if (bindingManager) {
|
||||
// we have a binding manager -- do we have an anonymous parent?
|
||||
bindingManager->GetInsertionParent(this, getter_AddRefs(parent));
|
||||
}
|
||||
|
||||
if (!parent) {
|
||||
// if we didn't find an anonymous parent, use the explicit one,
|
||||
// whether it's null or not...
|
||||
parent = GetParent();
|
||||
}
|
||||
|
||||
while (parent) {
|
||||
nsCOMPtr<nsIDOMSVGSVGElement> SVGSVGElement = do_QueryInterface(parent);
|
||||
if (SVGSVGElement) {
|
||||
*aOwnerSVGElement = SVGSVGElement;
|
||||
NS_ADDREF(*aOwnerSVGElement);
|
||||
return NS_OK;
|
||||
}
|
||||
nsCOMPtr<nsIContent> next;
|
||||
|
||||
if (bindingManager) {
|
||||
bindingManager->GetInsertionParent(parent, getter_AddRefs(next));
|
||||
}
|
||||
|
||||
if (!next) {
|
||||
// no anonymous parent, so use explicit one
|
||||
next = parent->GetParent();
|
||||
}
|
||||
|
||||
parent = next;
|
||||
}
|
||||
|
||||
// we don't have a parent SVG element...
|
||||
|
||||
// are _we_ the outermost SVG element? If yes, return nsnull, but don't fail
|
||||
nsCOMPtr<nsIDOMSVGSVGElement> SVGSVGElement = do_QueryInterface((nsIDOMSVGElement*)this);
|
||||
if (SVGSVGElement) return NS_OK;
|
||||
|
||||
// no owner found and we aren't the outermost SVG element either.
|
||||
// this situation can e.g. occur during content tree teardown.
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGElement viewportElement; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetViewportElement(nsIDOMSVGElement * *aViewportElement)
|
||||
{
|
||||
*aViewportElement = nsnull;
|
||||
nsCOMPtr<nsIDOMSVGSVGElement> SVGSVGElement;
|
||||
nsresult rv = GetOwnerSVGElement(getter_AddRefs(SVGSVGElement));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
if (SVGSVGElement) {
|
||||
nsCOMPtr<nsIDOMSVGElement> SVGElement = do_QueryInterface(SVGSVGElement);
|
||||
*aViewportElement = SVGElement;
|
||||
NS_IF_ADDREF(*aViewportElement);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValueObserver methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::WillModifySVGObservable(nsISVGValue* observable)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::DidModifySVGObservable (nsISVGValue* observable)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation Helpers:
|
||||
|
||||
nsresult
|
||||
nsSVGElement::CopyNode(nsSVGElement* dest, PRBool deep)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
// copy attributes:
|
||||
NS_ASSERTION(mAttributes, "null pointer");
|
||||
NS_ASSERTION(dest->mAttributes, "null pointer");
|
||||
rv = mAttributes->CopyAttributes(dest->mAttributes);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
if (deep) {
|
||||
// copy children:
|
||||
PRInt32 count = mChildren.Count();
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
nsIContent* child = mChildren[i];
|
||||
|
||||
NS_ASSERTION(child != nsnull, "null ptr");
|
||||
if (!child)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
nsCOMPtr<nsIDOMNode> domchild = do_QueryInterface(child);
|
||||
NS_ASSERTION(domchild != nsnull, "child is not a DOM node");
|
||||
if (! domchild)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
nsCOMPtr<nsIDOMNode> newdomchild;
|
||||
rv = domchild->CloneNode(PR_TRUE, getter_AddRefs(newdomchild));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIContent> newchild = do_QueryInterface(newdomchild);
|
||||
NS_ASSERTION(newchild != nsnull, "newdomchild is not an nsIContent");
|
||||
if (!newchild)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
rv = dest->AppendChildTo(newchild, PR_FALSE, PR_FALSE);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
161
mozilla/content/svg/content/src/nsSVGElement.h
Normal file
161
mozilla/content/svg/content/src/nsSVGElement.h
Normal file
@@ -0,0 +1,161 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_SVGELEMENT_H__
|
||||
#define __NS_SVGELEMENT_H__
|
||||
|
||||
/*
|
||||
nsSVGElement is the base class for all SVG content elements.
|
||||
It implements all the common DOM interfaces and handles attributes.
|
||||
*/
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIDOMSVGElement.h"
|
||||
#include "nsGenericElement.h"
|
||||
#include "nsSVGAttributes.h"
|
||||
#include "nsISVGValue.h"
|
||||
#include "nsISVGValueObserver.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsISVGStyleValue.h"
|
||||
#include "nsISVGContent.h"
|
||||
|
||||
class nsSVGElement : public nsGenericElement, // :nsIHTMLContent:nsIXMLContent:nsIStyledContent:nsIContent
|
||||
public nsIDOMSVGElement, // :nsIDOMElement:nsIDOMNode
|
||||
public nsISVGValueObserver,
|
||||
public nsSupportsWeakReference, // :nsISupportsWeakReference
|
||||
public nsISVGContent
|
||||
{
|
||||
protected:
|
||||
nsSVGElement();
|
||||
virtual ~nsSVGElement();
|
||||
|
||||
virtual nsresult Init();
|
||||
|
||||
public:
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIContent interface methods
|
||||
|
||||
virtual void SetParent(nsIContent* aParent);
|
||||
virtual PRBool CanContainChildren() const;
|
||||
virtual PRUint32 GetChildCount() const;
|
||||
virtual nsIContent *GetChildAt(PRUint32 aIndex) const;
|
||||
virtual PRInt32 IndexOf(nsIContent* aPossibleChild) const;
|
||||
virtual nsIAtom *GetIDAttributeName() const;
|
||||
nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
const nsAString& aValue, PRBool aNotify)
|
||||
{
|
||||
return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify);
|
||||
}
|
||||
virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
nsIAtom* aPrefix, const nsAString& aValue,
|
||||
PRBool aNotify);
|
||||
virtual nsresult GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
nsAString& aResult) const;
|
||||
virtual PRBool HasAttr(PRInt32 aNameSpaceID, nsIAtom* aName) const;
|
||||
virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
||||
PRBool aNotify);
|
||||
virtual nsresult GetAttrNameAt(PRUint32 aIndex, PRInt32* aNameSpaceID,
|
||||
nsIAtom** aName, nsIAtom** aPrefix) const;
|
||||
virtual PRUint32 GetAttrCount() const;
|
||||
|
||||
#ifdef DEBUG
|
||||
virtual void List(FILE* out, PRInt32 aIndent) const;
|
||||
virtual void DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const;
|
||||
#endif // DEBUG
|
||||
|
||||
// Child list modification hooks
|
||||
virtual PRBool InternalInsertChildAt(nsIContent* aKid, PRUint32 aIndex) {
|
||||
return mChildren.InsertObjectAt(aKid, aIndex);
|
||||
}
|
||||
virtual PRBool InternalReplaceChildAt(nsIContent* aKid, PRUint32 aIndex) {
|
||||
return mChildren.ReplaceObjectAt(aKid, aIndex);
|
||||
}
|
||||
virtual PRBool InternalAppendChildTo(nsIContent* aKid) {
|
||||
return mChildren.AppendObject(aKid);
|
||||
}
|
||||
virtual PRBool InternalRemoveChildAt(PRUint32 aIndex) {
|
||||
return mChildren.RemoveObjectAt(aIndex);
|
||||
}
|
||||
|
||||
virtual const nsAttrName* InternalGetExistingAttrNameFromQName(const nsAString& aStr) const;
|
||||
|
||||
virtual nsresult SetBindingParent(nsIContent* aParent);
|
||||
|
||||
// nsIStyledContent
|
||||
NS_IMETHOD GetID(nsIAtom** aResult) const;
|
||||
// NS_IMETHOD GetClasses(nsVoidArray& aArray) const;
|
||||
// NS_IMETHOD HasClass(nsIAtom* aClass) const;
|
||||
|
||||
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
|
||||
NS_IMETHOD GetInlineStyleRule(nsICSSStyleRule** aStyleRule);
|
||||
|
||||
// nsIDOMNode
|
||||
NS_DECL_NSIDOMNODE
|
||||
|
||||
// nsIDOMElement
|
||||
// NS_DECL_IDOMELEMENT
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericElement::)
|
||||
|
||||
// nsIDOMSVGElement
|
||||
NS_DECL_NSIDOMSVGELEMENT
|
||||
|
||||
// nsISVGValueObserver
|
||||
NS_IMETHOD WillModifySVGObservable(nsISVGValue* observable);
|
||||
NS_IMETHOD DidModifySVGObservable (nsISVGValue* observable);
|
||||
|
||||
// nsISupportsWeakReference
|
||||
// implementation inherited from nsSupportsWeakReference
|
||||
|
||||
// nsISVGContent interface
|
||||
NS_IMETHOD IsPresentationAttribute(const nsIAtom* attribute, PRBool* retval){*retval=PR_FALSE; return NS_OK;}
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
nsresult CopyNode(nsSVGElement* dest, PRBool deep);
|
||||
virtual void ParentChainChanged(){};
|
||||
|
||||
nsCOMArray<nsIContent> mChildren;
|
||||
nsSVGAttributes* mAttributes;
|
||||
nsCOMPtr<nsISVGStyleValue> mStyle;
|
||||
};
|
||||
|
||||
#endif // __NS_SVGELEMENT_H__
|
||||
160
mozilla/content/svg/content/src/nsSVGElementFactory.cpp
Normal file
160
mozilla/content/svg/content/src/nsSVGElementFactory.cpp
Normal file
@@ -0,0 +1,160 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIElementFactory.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsINodeInfo.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
#include "nsIXMLContent.h"
|
||||
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPolylineElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
|
||||
nsresult
|
||||
NS_NewSVGPolygonElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
|
||||
nsresult
|
||||
NS_NewSVGCircleElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
|
||||
nsresult
|
||||
NS_NewSVGEllipseElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
|
||||
nsresult
|
||||
NS_NewSVGLineElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
|
||||
nsresult
|
||||
NS_NewSVGRectElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
|
||||
nsresult
|
||||
NS_NewSVGGElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
|
||||
nsresult
|
||||
NS_NewSVGSVGElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
|
||||
nsresult
|
||||
NS_NewSVGForeignObjectElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
|
||||
nsresult
|
||||
NS_NewSVGPathElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
|
||||
nsresult
|
||||
NS_NewSVGTextElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
|
||||
nsresult
|
||||
NS_NewSVGTSpanElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
|
||||
nsresult
|
||||
NS_NewSVGImageElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
|
||||
|
||||
|
||||
class nsSVGElementFactory : public nsIElementFactory
|
||||
{
|
||||
protected:
|
||||
nsSVGElementFactory();
|
||||
virtual ~nsSVGElementFactory();
|
||||
|
||||
// nsISupports interface
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIElementFactory interface
|
||||
NS_IMETHOD CreateInstanceByTag(nsINodeInfo *aNodeInfo, nsIContent** aResult);
|
||||
|
||||
public:
|
||||
friend nsresult NS_NewSVGElementFactory(nsIElementFactory** aResult);
|
||||
};
|
||||
|
||||
|
||||
|
||||
nsSVGElementFactory::nsSVGElementFactory()
|
||||
{
|
||||
}
|
||||
|
||||
nsSVGElementFactory::~nsSVGElementFactory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsSVGElementFactory, nsIElementFactory)
|
||||
|
||||
|
||||
nsresult
|
||||
NS_NewSVGElementFactory(nsIElementFactory** aResult)
|
||||
{
|
||||
NS_PRECONDITION(aResult != nsnull, "null ptr");
|
||||
if (! aResult)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsSVGElementFactory* result = new nsSVGElementFactory();
|
||||
if (! result)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(result);
|
||||
*aResult = result;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElementFactory::CreateInstanceByTag(nsINodeInfo *aNodeInfo,
|
||||
nsIContent** aResult)
|
||||
{
|
||||
nsIAtom *name = aNodeInfo->NameAtom();
|
||||
|
||||
if (name == nsSVGAtoms::polyline)
|
||||
return NS_NewSVGPolylineElement(aResult, aNodeInfo);
|
||||
if (name == nsSVGAtoms::polygon)
|
||||
return NS_NewSVGPolygonElement(aResult, aNodeInfo);
|
||||
if (name == nsSVGAtoms::circle)
|
||||
return NS_NewSVGCircleElement(aResult, aNodeInfo);
|
||||
if (name == nsSVGAtoms::ellipse)
|
||||
return NS_NewSVGEllipseElement(aResult, aNodeInfo);
|
||||
if (name == nsSVGAtoms::line)
|
||||
return NS_NewSVGLineElement(aResult, aNodeInfo);
|
||||
if (name == nsSVGAtoms::rect)
|
||||
return NS_NewSVGRectElement(aResult, aNodeInfo);
|
||||
if (name == nsSVGAtoms::svg)
|
||||
return NS_NewSVGSVGElement(aResult, aNodeInfo);
|
||||
if (name == nsSVGAtoms::g)
|
||||
return NS_NewSVGGElement(aResult, aNodeInfo);
|
||||
if (name == nsSVGAtoms::foreignObject)
|
||||
return NS_NewSVGForeignObjectElement(aResult, aNodeInfo);
|
||||
if (name == nsSVGAtoms::path)
|
||||
return NS_NewSVGPathElement(aResult, aNodeInfo);
|
||||
else if (name == nsSVGAtoms::text)
|
||||
return NS_NewSVGTextElement(aResult, aNodeInfo);
|
||||
else if (name == nsSVGAtoms::tspan)
|
||||
return NS_NewSVGTSpanElement(aResult, aNodeInfo);
|
||||
else if (name == nsSVGAtoms::image)
|
||||
return NS_NewSVGImageElement(aResult, aNodeInfo);
|
||||
|
||||
// if we don't know what to create, just create a standard xml element:
|
||||
return NS_NewXMLElement(aResult, aNodeInfo);
|
||||
}
|
||||
|
||||
367
mozilla/content/svg/content/src/nsSVGEllipseElement.cpp
Normal file
367
mozilla/content/svg/content/src/nsSVGEllipseElement.cpp
Normal file
@@ -0,0 +1,367 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* William Cook <william.cook@crocodile-clips.com> (original author)
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGGraphicElement.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
#include "nsSVGAnimatedLength.h"
|
||||
#include "nsSVGLength.h"
|
||||
#include "nsIDOMSVGEllipseElement.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsISVGSVGElement.h"
|
||||
#include "nsISVGViewportAxis.h"
|
||||
#include "nsISVGViewportRect.h"
|
||||
|
||||
typedef nsSVGGraphicElement nsSVGEllipseElementBase;
|
||||
|
||||
class nsSVGEllipseElement : public nsSVGEllipseElementBase,
|
||||
public nsIDOMSVGEllipseElement
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGEllipseElement(nsIContent **aResult,
|
||||
nsINodeInfo *aNodeInfo);
|
||||
nsSVGEllipseElement();
|
||||
virtual ~nsSVGEllipseElement();
|
||||
virtual nsresult Init();
|
||||
|
||||
public:
|
||||
// interfaces:
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIDOMSVGELLIPSEELEMENT
|
||||
|
||||
// xxx I wish we could use virtual inheritance
|
||||
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsSVGEllipseElementBase::)
|
||||
NS_FORWARD_NSIDOMELEMENT(nsSVGEllipseElementBase::)
|
||||
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGEllipseElementBase::)
|
||||
|
||||
protected:
|
||||
virtual void ParentChainChanged();
|
||||
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mCx;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mCy;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mRx;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mRy;
|
||||
|
||||
};
|
||||
|
||||
|
||||
nsresult NS_NewSVGEllipseElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
nsSVGEllipseElement* it = new nsSVGEllipseElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aResult = NS_STATIC_CAST(nsIContent *, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsSVGEllipseElement,nsSVGEllipseElementBase)
|
||||
NS_IMPL_RELEASE_INHERITED(nsSVGEllipseElement,nsSVGEllipseElementBase)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGEllipseElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGEllipseElement)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGEllipseElement)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsSVGEllipseElementBase)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsSVGEllipseElement::nsSVGEllipseElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
nsSVGEllipseElement::~nsSVGEllipseElement()
|
||||
{
|
||||
if (mCx) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mCx);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mCy) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mCy);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mRx) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mRx);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mRy) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mRy);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsSVGEllipseElement::Init()
|
||||
{
|
||||
nsresult rv;
|
||||
rv = nsSVGEllipseElementBase::Init();
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
// Create mapped properties:
|
||||
|
||||
// DOM property: cx , #IMPLIED attrib: cx
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mCx), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::cx, mCx);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: cy , #IMPLIED attrib: cy
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mCy), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::cy, mCy);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: rx , #REQUIRED attrib: rx
|
||||
// XXX: enforce requiredness
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mRx), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::rx, mRx);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: ry , #REQUIRED attrib: ry
|
||||
// XXX: enforce requiredness
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mRy), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::ry, mRy);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGEllipseElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
||||
{
|
||||
*aReturn = nsnull;
|
||||
nsSVGEllipseElement* it = new nsSVGEllipseElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = CopyNode(it, aDeep);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aReturn = NS_STATIC_CAST(nsSVGEllipseElementBase*, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGEllipseElement methods
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength cx; */
|
||||
NS_IMETHODIMP nsSVGEllipseElement::GetCx(nsIDOMSVGAnimatedLength * *aCx)
|
||||
{
|
||||
*aCx = mCx;
|
||||
NS_IF_ADDREF(*aCx);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength cy; */
|
||||
NS_IMETHODIMP nsSVGEllipseElement::GetCy(nsIDOMSVGAnimatedLength * *aCy)
|
||||
{
|
||||
*aCy = mCy;
|
||||
NS_IF_ADDREF(*aCy);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength rx; */
|
||||
NS_IMETHODIMP nsSVGEllipseElement::GetRx(nsIDOMSVGAnimatedLength * *aRx)
|
||||
{
|
||||
*aRx = mRx;
|
||||
NS_IF_ADDREF(*aRx);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength ry; */
|
||||
NS_IMETHODIMP nsSVGEllipseElement::GetRy(nsIDOMSVGAnimatedLength * *aRy)
|
||||
{
|
||||
*aRy = mRy;
|
||||
NS_IF_ADDREF(*aRy);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
|
||||
|
||||
void nsSVGEllipseElement::ParentChainChanged()
|
||||
{
|
||||
// set new context information on our length-properties:
|
||||
|
||||
nsCOMPtr<nsIDOMSVGSVGElement> dom_elem;
|
||||
GetOwnerSVGElement(getter_AddRefs(dom_elem));
|
||||
if (!dom_elem) return;
|
||||
|
||||
nsCOMPtr<nsISVGSVGElement> svg_elem = do_QueryInterface(dom_elem);
|
||||
NS_ASSERTION(svg_elem, "<svg> element missing interface");
|
||||
|
||||
// cx:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mCx->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetXAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// cy:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mCy->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetYAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// rx:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mRx->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetXAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// rx:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mRy->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetYAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
}
|
||||
363
mozilla/content/svg/content/src/nsSVGForeignObjectElement.cpp
Normal file
363
mozilla/content/svg/content/src/nsSVGForeignObjectElement.cpp
Normal file
@@ -0,0 +1,363 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGGraphicElement.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
#include "nsIDOMSVGForeignObjectElem.h"
|
||||
#include "nsSVGLength.h"
|
||||
#include "nsSVGAnimatedLength.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsISVGSVGElement.h"
|
||||
#include "nsISVGViewportAxis.h"
|
||||
#include "nsISVGViewportRect.h"
|
||||
|
||||
typedef nsSVGGraphicElement nsSVGForeignObjectElementBase;
|
||||
|
||||
class nsSVGForeignObjectElement : public nsSVGForeignObjectElementBase,
|
||||
public nsIDOMSVGForeignObjectElement
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGForeignObjectElement(nsIContent **aResult,
|
||||
nsINodeInfo *aNodeInfo);
|
||||
nsSVGForeignObjectElement();
|
||||
virtual ~nsSVGForeignObjectElement();
|
||||
virtual nsresult Init();
|
||||
|
||||
public:
|
||||
// interfaces:
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIDOMSVGFOREIGNOBJECTELEMENT
|
||||
|
||||
// xxx I wish we could use virtual inheritance
|
||||
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsSVGForeignObjectElementBase::)
|
||||
NS_FORWARD_NSIDOMELEMENT(nsSVGForeignObjectElementBase::)
|
||||
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGForeignObjectElementBase::)
|
||||
|
||||
protected:
|
||||
virtual void ParentChainChanged();
|
||||
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mX;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mY;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mWidth;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mHeight;
|
||||
};
|
||||
|
||||
|
||||
nsresult NS_NewSVGForeignObjectElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
nsSVGForeignObjectElement* it = new nsSVGForeignObjectElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aResult = NS_STATIC_CAST(nsIContent *, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsSVGForeignObjectElement,nsSVGForeignObjectElementBase)
|
||||
NS_IMPL_RELEASE_INHERITED(nsSVGForeignObjectElement,nsSVGForeignObjectElementBase)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGForeignObjectElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGForeignObjectElement)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGForeignObjectElement)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsSVGForeignObjectElementBase)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsSVGForeignObjectElement::nsSVGForeignObjectElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
nsSVGForeignObjectElement::~nsSVGForeignObjectElement()
|
||||
{
|
||||
if (mX) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mX);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mY) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mY);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mWidth) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mWidth);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mHeight) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mHeight);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsSVGForeignObjectElement::Init()
|
||||
{
|
||||
nsresult rv;
|
||||
rv = nsSVGForeignObjectElementBase::Init();
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
// Create mapped properties:
|
||||
|
||||
|
||||
// DOM property: x , #IMPLIED attrib: x
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mX), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::x, mX);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: y , #IMPLIED attrib: y
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mY), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::y, mY);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: width , #REQUIRED attrib: width
|
||||
// XXX: enforce requiredness
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
100.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mWidth), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::width, mWidth);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: height , #REQUIRED attrib: height
|
||||
// XXX: enforce requiredness
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
100.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mHeight), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::height, mHeight);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGForeignObjectElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
||||
{
|
||||
*aReturn = nsnull;
|
||||
nsSVGForeignObjectElement* it = new nsSVGForeignObjectElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = CopyNode(it, aDeep);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aReturn = NS_STATIC_CAST(nsSVGForeignObjectElementBase*, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGForeignObjectElement methods:
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength x; */
|
||||
NS_IMETHODIMP nsSVGForeignObjectElement::GetX(nsIDOMSVGAnimatedLength * *aX)
|
||||
{
|
||||
*aX = mX;
|
||||
NS_IF_ADDREF(*aX);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength y; */
|
||||
NS_IMETHODIMP nsSVGForeignObjectElement::GetY(nsIDOMSVGAnimatedLength * *aY)
|
||||
{
|
||||
*aY = mY;
|
||||
NS_IF_ADDREF(*aY);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength width; */
|
||||
NS_IMETHODIMP nsSVGForeignObjectElement::GetWidth(nsIDOMSVGAnimatedLength * *aWidth)
|
||||
{
|
||||
*aWidth = mWidth;
|
||||
NS_IF_ADDREF(*aWidth);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength height; */
|
||||
NS_IMETHODIMP nsSVGForeignObjectElement::GetHeight(nsIDOMSVGAnimatedLength * *aHeight)
|
||||
{
|
||||
*aHeight = mHeight;
|
||||
NS_IF_ADDREF(*aHeight);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
|
||||
void nsSVGForeignObjectElement::ParentChainChanged()
|
||||
{
|
||||
// set new context information on our length-properties:
|
||||
|
||||
nsCOMPtr<nsIDOMSVGSVGElement> dom_elem;
|
||||
GetOwnerSVGElement(getter_AddRefs(dom_elem));
|
||||
if (!dom_elem) return;
|
||||
|
||||
nsCOMPtr<nsISVGSVGElement> svg_elem = do_QueryInterface(dom_elem);
|
||||
NS_ASSERTION(svg_elem, "<svg> element missing interface");
|
||||
|
||||
// x:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mX->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetXAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// y:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mY->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetYAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// width:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mWidth->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetXAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// height:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mHeight->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetYAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
}
|
||||
209
mozilla/content/svg/content/src/nsSVGGElement.cpp
Normal file
209
mozilla/content/svg/content/src/nsSVGGElement.cpp
Normal file
@@ -0,0 +1,209 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGGraphicElement.h"
|
||||
#include "nsIDOMSVGGElement.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
|
||||
typedef nsSVGGraphicElement nsSVGGElementBase;
|
||||
|
||||
class nsSVGGElement : public nsSVGGElementBase,
|
||||
public nsIDOMSVGGElement
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGGElement(nsIContent **aResult,
|
||||
nsINodeInfo *aNodeInfo);
|
||||
nsSVGGElement();
|
||||
virtual ~nsSVGGElement();
|
||||
virtual nsresult Init();
|
||||
|
||||
public:
|
||||
// interfaces:
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIDOMSVGGELEMENT
|
||||
|
||||
// xxx I wish we could use virtual inheritance
|
||||
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsSVGGElementBase::)
|
||||
NS_FORWARD_NSIDOMELEMENT(nsSVGGElementBase::)
|
||||
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGGElementBase::)
|
||||
|
||||
// nsISVGContent interface
|
||||
NS_IMETHOD IsPresentationAttribute(const nsIAtom* attribute, PRBool* retval);
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// implementation
|
||||
|
||||
nsresult NS_NewSVGGElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
nsSVGGElement* it = new nsSVGGElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aResult = NS_STATIC_CAST(nsIContent *, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsSVGGElement,nsSVGGElementBase)
|
||||
NS_IMPL_RELEASE_INHERITED(nsSVGGElement,nsSVGGElementBase)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGGElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGGElement)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGGElement)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsSVGGElementBase)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsSVGGElement::nsSVGGElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
nsSVGGElement::~nsSVGGElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsSVGGElement::Init()
|
||||
{
|
||||
nsresult rv;
|
||||
rv = nsSVGGElementBase::Init();
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGGElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
||||
{
|
||||
*aReturn = nsnull;
|
||||
nsSVGGElement* it = new nsSVGGElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = CopyNode(it, aDeep);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aReturn = NS_STATIC_CAST(nsSVGGElementBase*, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGContent methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGGElement::IsPresentationAttribute(const nsIAtom* name, PRBool *retval)
|
||||
{
|
||||
if (
|
||||
// PresentationAttributes-TextContentElements
|
||||
name==nsSVGAtoms::alignment_baseline ||
|
||||
name==nsSVGAtoms::baseline_shift ||
|
||||
name==nsSVGAtoms::direction ||
|
||||
name==nsSVGAtoms::dominant_baseline ||
|
||||
name==nsSVGAtoms::glyph_orientation_horizontal ||
|
||||
name==nsSVGAtoms::glyph_orientation_vertical ||
|
||||
name==nsSVGAtoms::kerning ||
|
||||
name==nsSVGAtoms::letter_spacing ||
|
||||
name==nsSVGAtoms::text_anchor ||
|
||||
name==nsSVGAtoms::text_decoration ||
|
||||
name==nsSVGAtoms::unicode_bidi ||
|
||||
name==nsSVGAtoms::word_spacing ||
|
||||
// PresentationAttributes-FontSpecification
|
||||
name==nsSVGAtoms::font_family ||
|
||||
name==nsSVGAtoms::font_size ||
|
||||
name==nsSVGAtoms::font_size_adjust ||
|
||||
name==nsSVGAtoms::font_stretch ||
|
||||
name==nsSVGAtoms::font_style ||
|
||||
name==nsSVGAtoms::font_variant ||
|
||||
name==nsSVGAtoms::font_weight
|
||||
) {
|
||||
*retval = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
else
|
||||
return nsSVGGElementBase::IsPresentationAttribute(name, retval);
|
||||
}
|
||||
345
mozilla/content/svg/content/src/nsSVGGraphicElement.cpp
Normal file
345
mozilla/content/svg/content/src/nsSVGGraphicElement.cpp
Normal file
@@ -0,0 +1,345 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGGraphicElement.h"
|
||||
#include "nsSVGTransformList.h"
|
||||
#include "nsSVGAnimatedTransformList.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
#include "nsSVGMatrix.h"
|
||||
#include "nsISVGSVGElement.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIBindingManager.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsISVGChildFrame.h"
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsSVGGraphicElement, nsSVGGraphicElementBase)
|
||||
NS_IMPL_RELEASE_INHERITED(nsSVGGraphicElement, nsSVGGraphicElementBase)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGGraphicElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGLocatable)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGTransformable)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsSVGGraphicElementBase)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsresult
|
||||
nsSVGGraphicElement::Init()
|
||||
{
|
||||
nsresult rv;
|
||||
rv = nsSVGGraphicElementBase::Init();
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
// Create mapped properties:
|
||||
|
||||
// DOM property: transform, #IMPLIED attrib: transform
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGTransformList> transformList;
|
||||
rv = nsSVGTransformList::Create(getter_AddRefs(transformList));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedTransformList(getter_AddRefs(mTransforms),
|
||||
transformList);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::transform, mTransforms);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGLocatable methods
|
||||
|
||||
/* readonly attribute nsIDOMSVGElement nearestViewportElement; */
|
||||
NS_IMETHODIMP nsSVGGraphicElement::GetNearestViewportElement(nsIDOMSVGElement * *aNearestViewportElement)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGElement farthestViewportElement; */
|
||||
NS_IMETHODIMP nsSVGGraphicElement::GetFarthestViewportElement(nsIDOMSVGElement * *aFarthestViewportElement)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGRect getBBox (); */
|
||||
NS_IMETHODIMP nsSVGGraphicElement::GetBBox(nsIDOMSVGRect **_retval)
|
||||
{
|
||||
*_retval = nsnull;
|
||||
|
||||
if (!mDocument) return NS_ERROR_FAILURE;
|
||||
nsIPresShell *presShell = mDocument->GetShellAt(0);
|
||||
NS_ASSERTION(presShell, "no presShell");
|
||||
if (!presShell) return NS_ERROR_FAILURE;
|
||||
|
||||
nsIFrame* frame;
|
||||
presShell->GetPrimaryFrameFor(NS_STATIC_CAST(nsIStyledContent*, this), &frame);
|
||||
|
||||
NS_ASSERTION(frame, "can't get bounding box for element without frame");
|
||||
|
||||
if (frame) {
|
||||
nsISVGChildFrame* svgframe;
|
||||
frame->QueryInterface(NS_GET_IID(nsISVGChildFrame),(void**)&svgframe);
|
||||
NS_ASSERTION(svgframe, "wrong frame type");
|
||||
if (svgframe) {
|
||||
return svgframe->GetBBox(_retval);
|
||||
}
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGMatrix getCTM (); */
|
||||
NS_IMETHODIMP nsSVGGraphicElement::GetCTM(nsIDOMSVGMatrix **_retval)
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGMatrix> CTM;
|
||||
|
||||
nsIBindingManager *bindingManager = nsnull;
|
||||
if (mDocument) {
|
||||
bindingManager = mDocument->GetBindingManager();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
|
||||
if (bindingManager) {
|
||||
// we have a binding manager -- do we have an anonymous parent?
|
||||
bindingManager->GetInsertionParent(this, getter_AddRefs(parent));
|
||||
}
|
||||
|
||||
if (!parent) {
|
||||
// if we didn't find an anonymous parent, use the explicit one,
|
||||
// whether it's null or not...
|
||||
parent = GetParent();
|
||||
}
|
||||
|
||||
while (parent) {
|
||||
nsCOMPtr<nsIDOMSVGSVGElement> viewportElement = do_QueryInterface(parent);
|
||||
if (viewportElement) {
|
||||
// Our nearest SVG parent is a viewport element.
|
||||
viewportElement->GetViewboxToViewportTransform(getter_AddRefs(CTM));
|
||||
break;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMSVGLocatable> locatableElement = do_QueryInterface(parent);
|
||||
if (locatableElement) {
|
||||
// Our nearest SVG parent is a locatable object that is not a
|
||||
// viewport. Its GetCTM function will give us a ctm from the
|
||||
// viewport to itself:
|
||||
locatableElement->GetCTM(getter_AddRefs(CTM));
|
||||
break;
|
||||
}
|
||||
|
||||
// Our parent was not svg content. We allow interdispersed non-SVG
|
||||
// content to coexist with XBL. Loop until we find the first SVG
|
||||
// parent.
|
||||
|
||||
nsCOMPtr<nsIContent> next;
|
||||
|
||||
if (bindingManager) {
|
||||
bindingManager->GetInsertionParent(parent, getter_AddRefs(next));
|
||||
}
|
||||
|
||||
if (!next) {
|
||||
// no anonymous parent, so use explicit one
|
||||
next = parent->GetParent();
|
||||
}
|
||||
|
||||
parent = next;
|
||||
}
|
||||
|
||||
if (!CTM) {
|
||||
// We either didn't find an SVG parent, or our parent failed in
|
||||
// giving us a CTM. In either case:
|
||||
NS_WARNING("Couldn't get CTM");
|
||||
nsSVGMatrix::Create(getter_AddRefs(CTM));
|
||||
}
|
||||
|
||||
// append our local transformations:
|
||||
nsCOMPtr<nsIDOMSVGTransformList> transforms;
|
||||
mTransforms->GetAnimVal(getter_AddRefs(transforms));
|
||||
NS_ENSURE_TRUE(transforms, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIDOMSVGMatrix> matrix;
|
||||
transforms->GetConsolidation(getter_AddRefs(matrix));
|
||||
|
||||
return CTM->Multiply(matrix, _retval);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGMatrix getScreenCTM (); */
|
||||
NS_IMETHODIMP nsSVGGraphicElement::GetScreenCTM(nsIDOMSVGMatrix **_retval)
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGMatrix> screenCTM;
|
||||
|
||||
nsIBindingManager *bindingManager = nsnull;
|
||||
if (mDocument) {
|
||||
bindingManager = mDocument->GetBindingManager();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
|
||||
if (bindingManager) {
|
||||
// we have a binding manager -- do we have an anonymous parent?
|
||||
bindingManager->GetInsertionParent(this, getter_AddRefs(parent));
|
||||
}
|
||||
|
||||
if (!parent) {
|
||||
// if we didn't find an anonymous parent, use the explicit one,
|
||||
// whether it's null or not...
|
||||
parent = GetParent();
|
||||
}
|
||||
|
||||
while (parent) {
|
||||
|
||||
nsCOMPtr<nsIDOMSVGLocatable> locatableElement = do_QueryInterface(parent);
|
||||
if (locatableElement) {
|
||||
nsCOMPtr<nsIDOMSVGMatrix> ctm;
|
||||
locatableElement->GetScreenCTM(getter_AddRefs(ctm));
|
||||
if (!ctm) break;
|
||||
|
||||
nsCOMPtr<nsIDOMSVGSVGElement> viewportElement = do_QueryInterface(parent);
|
||||
if (viewportElement) {
|
||||
// It is a viewport element. we need to append the viewbox xform:
|
||||
nsCOMPtr<nsIDOMSVGMatrix> matrix;
|
||||
viewportElement->GetViewboxToViewportTransform(getter_AddRefs(matrix));
|
||||
ctm->Multiply(matrix, getter_AddRefs(screenCTM));
|
||||
}
|
||||
else
|
||||
screenCTM = ctm;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Our parent was not svg content. We allow interdispersed non-SVG
|
||||
// content to coexist with XBL. Loop until we find the first SVG
|
||||
// parent.
|
||||
|
||||
nsCOMPtr<nsIContent> next;
|
||||
|
||||
if (bindingManager) {
|
||||
bindingManager->GetInsertionParent(parent, getter_AddRefs(next));
|
||||
}
|
||||
|
||||
if (!next) {
|
||||
// no anonymous parent, so use explicit one
|
||||
next = parent->GetParent();
|
||||
}
|
||||
|
||||
parent = next;
|
||||
}
|
||||
|
||||
if (!screenCTM) {
|
||||
// We either didn't find an SVG parent, or our parent failed in
|
||||
// giving us a CTM. In either case:
|
||||
NS_ERROR("couldn't get ctm");
|
||||
nsSVGMatrix::Create(getter_AddRefs(screenCTM));
|
||||
}
|
||||
|
||||
// append our local transformations:
|
||||
nsCOMPtr<nsIDOMSVGTransformList> transforms;
|
||||
mTransforms->GetAnimVal(getter_AddRefs(transforms));
|
||||
NS_ENSURE_TRUE(transforms, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIDOMSVGMatrix> matrix;
|
||||
transforms->GetConsolidation(getter_AddRefs(matrix));
|
||||
|
||||
return screenCTM->Multiply(matrix, _retval);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGMatrix getTransformToElement (in nsIDOMSVGElement element); */
|
||||
NS_IMETHODIMP nsSVGGraphicElement::GetTransformToElement(nsIDOMSVGElement *element, nsIDOMSVGMatrix **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGTransformable methods
|
||||
/* readonly attribute nsIDOMSVGAnimatedTransformList transform; */
|
||||
|
||||
NS_IMETHODIMP nsSVGGraphicElement::GetTransform(nsIDOMSVGAnimatedTransformList * *aTransform)
|
||||
{
|
||||
*aTransform = mTransforms;
|
||||
NS_IF_ADDREF(*aTransform);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGContent methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGGraphicElement::IsPresentationAttribute(const nsIAtom* name, PRBool *retval)
|
||||
{
|
||||
if (
|
||||
// PresentationAttributes-FillStroke
|
||||
name==nsSVGAtoms::fill ||
|
||||
name==nsSVGAtoms::fill_opacity ||
|
||||
name==nsSVGAtoms::fill_rule ||
|
||||
name==nsSVGAtoms::stroke ||
|
||||
name==nsSVGAtoms::stroke_dasharray ||
|
||||
name==nsSVGAtoms::stroke_dashoffset ||
|
||||
name==nsSVGAtoms::stroke_linecap ||
|
||||
name==nsSVGAtoms::stroke_linejoin ||
|
||||
name==nsSVGAtoms::stroke_miterlimit ||
|
||||
name==nsSVGAtoms::stroke_opacity ||
|
||||
name==nsSVGAtoms::stroke_width ||
|
||||
// PresentationAttributes-Graphics
|
||||
name==nsSVGAtoms::clip_path ||
|
||||
name==nsSVGAtoms::clip_rule ||
|
||||
name==nsSVGAtoms::cursor ||
|
||||
name==nsSVGAtoms::display ||
|
||||
name==nsSVGAtoms::filter ||
|
||||
name==nsSVGAtoms::image_rendering ||
|
||||
name==nsSVGAtoms::mask ||
|
||||
name==nsSVGAtoms::opacity ||
|
||||
name==nsSVGAtoms::pointer_events ||
|
||||
name==nsSVGAtoms::shape_rendering ||
|
||||
name==nsSVGAtoms::text_rendering ||
|
||||
name==nsSVGAtoms::visibility
|
||||
) {
|
||||
*retval = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
else
|
||||
return nsSVGGraphicElementBase::IsPresentationAttribute(name, retval);
|
||||
}
|
||||
|
||||
69
mozilla/content/svg/content/src/nsSVGGraphicElement.h
Normal file
69
mozilla/content/svg/content/src/nsSVGGraphicElement.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_SVGGRAPHICELEMENT_H__
|
||||
#define __NS_SVGGRAPHICELEMENT_H__
|
||||
|
||||
#include "nsSVGElement.h"
|
||||
#include "nsIDOMSVGLocatable.h"
|
||||
#include "nsIDOMSVGTransformable.h"
|
||||
#include "nsIDOMSVGAnimTransformList.h"
|
||||
|
||||
typedef nsSVGElement nsSVGGraphicElementBase;
|
||||
|
||||
class nsSVGGraphicElement : public nsSVGGraphicElementBase,
|
||||
public nsIDOMSVGTransformable // : nsIDOMSVGLocatable
|
||||
{
|
||||
protected:
|
||||
virtual nsresult Init();
|
||||
|
||||
public:
|
||||
// interfaces:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIDOMSVGLOCATABLE
|
||||
NS_DECL_NSIDOMSVGTRANSFORMABLE
|
||||
|
||||
// nsISVGContent interface
|
||||
NS_IMETHOD IsPresentationAttribute(const nsIAtom* attribute, PRBool* retval);
|
||||
|
||||
protected:
|
||||
|
||||
nsCOMPtr<nsIDOMSVGAnimatedTransformList> mTransforms;
|
||||
};
|
||||
|
||||
#endif // __NS_SVGGRAPHICELEMENT_H__
|
||||
427
mozilla/content/svg/content/src/nsSVGImageElement.cpp
Normal file
427
mozilla/content/svg/content/src/nsSVGImageElement.cpp
Normal file
@@ -0,0 +1,427 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGGraphicElement.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
#include "nsIDOMSVGImageElement.h"
|
||||
#include "nsIDOMSVGURIReference.h"
|
||||
#include "nsSVGLength.h"
|
||||
#include "nsSVGAnimatedLength.h"
|
||||
#include "nsSVGAnimatedString.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsISVGSVGElement.h"
|
||||
#include "nsISVGViewportAxis.h"
|
||||
#include "nsISVGViewportRect.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
||||
typedef nsSVGGraphicElement nsSVGImageElementBase;
|
||||
|
||||
class nsSVGImageElement : public nsSVGImageElementBase,
|
||||
public nsIDOMSVGImageElement,
|
||||
public nsIDOMSVGURIReference
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGImageElement(nsIContent **aResult,
|
||||
nsINodeInfo *aNodeInfo);
|
||||
nsSVGImageElement();
|
||||
virtual ~nsSVGImageElement();
|
||||
virtual nsresult Init();
|
||||
|
||||
public:
|
||||
// interfaces:
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIDOMSVGIMAGEELEMENT
|
||||
NS_DECL_NSIDOMSVGURIREFERENCE
|
||||
|
||||
// xxx I wish we could use virtual inheritance
|
||||
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsSVGImageElementBase::)
|
||||
NS_FORWARD_NSIDOMELEMENT(nsSVGImageElementBase::)
|
||||
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGImageElementBase::)
|
||||
|
||||
protected:
|
||||
void GetSrc(nsAString& src);
|
||||
|
||||
virtual void ParentChainChanged();
|
||||
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mX;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mY;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mWidth;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mHeight;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedString> mHref;
|
||||
|
||||
};
|
||||
|
||||
|
||||
nsresult NS_NewSVGImageElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
nsSVGImageElement* it = new nsSVGImageElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aResult = NS_STATIC_CAST(nsIContent *, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsSVGImageElement,nsSVGImageElementBase)
|
||||
NS_IMPL_RELEASE_INHERITED(nsSVGImageElement,nsSVGImageElementBase)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGImageElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGImageElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGURIReference)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGImageElement)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsSVGImageElementBase)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsSVGImageElement::nsSVGImageElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
nsSVGImageElement::~nsSVGImageElement()
|
||||
{
|
||||
if (mX) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mX);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mY) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mY);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mWidth) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mWidth);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mHeight) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mHeight);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsSVGImageElement::Init()
|
||||
{
|
||||
nsresult rv;
|
||||
rv = nsSVGImageElementBase::Init();
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
// Create mapped properties:
|
||||
|
||||
|
||||
// nsIDOMSVGImage properties
|
||||
|
||||
// DOM property: x , #IMPLIED attrib: x
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mX), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::x, mX);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: y , #IMPLIED attrib: y
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mY), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::y, mY);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: width , #REQUIRED attrib: width
|
||||
// XXX: enforce requiredness
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
100.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mWidth), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::width, mWidth);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: height , #REQUIRED attrib: height
|
||||
// XXX: enforce requiredness
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
100.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mHeight), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::height, mHeight);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// nsIDOMSVGURIReference properties
|
||||
|
||||
// DOM property: href , #REQUIRED attrib: xlink:href
|
||||
// XXX: enforce requiredness
|
||||
{
|
||||
rv = NS_NewSVGAnimatedString(getter_AddRefs(mHref));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::href, mHref, kNameSpaceID_XLink);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGImageElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
||||
{
|
||||
*aReturn = nsnull;
|
||||
nsSVGImageElement* it = new nsSVGImageElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = CopyNode(it, aDeep);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aReturn = NS_STATIC_CAST(nsSVGImageElementBase*, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGImageElement methods:
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength x; */
|
||||
NS_IMETHODIMP nsSVGImageElement::GetX(nsIDOMSVGAnimatedLength * *aX)
|
||||
{
|
||||
*aX = mX;
|
||||
NS_IF_ADDREF(*aX);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength y; */
|
||||
NS_IMETHODIMP nsSVGImageElement::GetY(nsIDOMSVGAnimatedLength * *aY)
|
||||
{
|
||||
*aY = mY;
|
||||
NS_IF_ADDREF(*aY);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength width; */
|
||||
NS_IMETHODIMP nsSVGImageElement::GetWidth(nsIDOMSVGAnimatedLength * *aWidth)
|
||||
{
|
||||
*aWidth = mWidth;
|
||||
NS_IF_ADDREF(*aWidth);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength height; */
|
||||
NS_IMETHODIMP nsSVGImageElement::GetHeight(nsIDOMSVGAnimatedLength * *aHeight)
|
||||
{
|
||||
*aHeight = mHeight;
|
||||
NS_IF_ADDREF(*aHeight);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedPreserveAspectRatio preserveAspectRatio; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGImageElement::GetPreserveAspectRatio(nsIDOMSVGAnimatedPreserveAspectRatio
|
||||
**aPreserveAspectRatio)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGURIReference methods:
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedString href; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGImageElement::GetHref(nsIDOMSVGAnimatedString * *aHref)
|
||||
{
|
||||
*aHref = mHref;
|
||||
NS_IF_ADDREF(*aHref);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
|
||||
void nsSVGImageElement::ParentChainChanged()
|
||||
{
|
||||
// set new context information on our length-properties:
|
||||
|
||||
nsCOMPtr<nsIDOMSVGSVGElement> dom_elem;
|
||||
GetOwnerSVGElement(getter_AddRefs(dom_elem));
|
||||
if (!dom_elem) return;
|
||||
|
||||
nsCOMPtr<nsISVGSVGElement> svg_elem = do_QueryInterface(dom_elem);
|
||||
NS_ASSERTION(svg_elem, "<svg> element missing interface");
|
||||
|
||||
// x:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mX->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetXAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// y:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mY->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetYAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// width:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mWidth->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetXAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// height:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mHeight->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetYAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void nsSVGImageElement::GetSrc(nsAString& src)
|
||||
{
|
||||
// resolve href attribute
|
||||
|
||||
nsCOMPtr<nsIURI> baseURI = GetBaseURI();
|
||||
|
||||
nsAutoString relURIStr;
|
||||
mHref->GetAnimVal(relURIStr);
|
||||
relURIStr.Trim(" \t\n\r");
|
||||
|
||||
if (baseURI && !relURIStr.IsEmpty())
|
||||
NS_MakeAbsoluteURI(src, relURIStr, baseURI);
|
||||
else
|
||||
src = relURIStr;
|
||||
}
|
||||
644
mozilla/content/svg/content/src/nsSVGLength.cpp
Normal file
644
mozilla/content/svg/content/src/nsSVGLength.cpp
Normal file
@@ -0,0 +1,644 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGLength.h"
|
||||
#include "prdtoa.h"
|
||||
#include "nsIDOMSVGMatrix.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
#include "nsSVGValue.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsTextFormatter.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsISVGViewportAxis.h"
|
||||
#include "nsIDOMSVGNumber.h"
|
||||
#include "nsISVGValueUtils.h"
|
||||
#include "nsWeakReference.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGLength class
|
||||
|
||||
class nsSVGLength : public nsISVGLength,
|
||||
public nsSVGValue,
|
||||
public nsISVGValueObserver,
|
||||
public nsSupportsWeakReference
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGLength(nsISVGLength** result,
|
||||
float value,
|
||||
PRUint16 unit);
|
||||
|
||||
friend nsresult NS_NewSVGLength(nsISVGLength** result,
|
||||
const nsAString &value);
|
||||
|
||||
nsSVGLength(float value, PRUint16 unit);
|
||||
nsSVGLength();
|
||||
virtual ~nsSVGLength();
|
||||
|
||||
public:
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMSVGLength interface:
|
||||
NS_DECL_NSIDOMSVGLENGTH
|
||||
|
||||
// nsISVGLength interface:
|
||||
NS_IMETHOD SetContext(nsISVGViewportAxis* context);
|
||||
|
||||
// nsISVGValue interface:
|
||||
NS_IMETHOD SetValueString(const nsAString& aValue);
|
||||
NS_IMETHOD GetValueString(nsAString& aValue);
|
||||
|
||||
// nsISVGValueObserver interface:
|
||||
NS_IMETHOD WillModifySVGObservable(nsISVGValue* observable);
|
||||
NS_IMETHOD DidModifySVGObservable (nsISVGValue* observable);
|
||||
|
||||
// nsISupportsWeakReference
|
||||
// implementation inherited from nsSupportsWeakReference
|
||||
|
||||
protected:
|
||||
// implementation helpers:
|
||||
float UserUnitsPerPixel();
|
||||
float mmPerPixel();
|
||||
float AxisLength();
|
||||
void GetUnitString(nsAString& unit);
|
||||
PRUint16 GetUnitTypeForString(const char* unitStr);
|
||||
PRBool IsValidUnitType(PRUint16 unit);
|
||||
|
||||
void MaybeAddAsObserver();
|
||||
void MaybeRemoveAsObserver();
|
||||
|
||||
float mValueInSpecifiedUnits;
|
||||
PRUint16 mSpecifiedUnitType;
|
||||
nsCOMPtr<nsISVGViewportAxis> mContext;
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsresult
|
||||
NS_NewSVGLength(nsISVGLength** result,
|
||||
float value,
|
||||
PRUint16 unit)
|
||||
{
|
||||
nsSVGLength *pl = new nsSVGLength(value, unit);
|
||||
NS_ENSURE_TRUE(pl, NS_ERROR_OUT_OF_MEMORY);
|
||||
NS_ADDREF(pl);
|
||||
*result = pl;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewSVGLength(nsISVGLength** result,
|
||||
const nsAString &value)
|
||||
{
|
||||
*result = nsnull;
|
||||
nsSVGLength *pl = new nsSVGLength();
|
||||
NS_ENSURE_TRUE(pl, NS_ERROR_OUT_OF_MEMORY);
|
||||
NS_ADDREF(pl);
|
||||
if (NS_FAILED(pl->SetValueAsString(value))) {
|
||||
NS_RELEASE(pl);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
*result = pl;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsSVGLength::nsSVGLength(float value,
|
||||
PRUint16 unit)
|
||||
: mValueInSpecifiedUnits(value),
|
||||
mSpecifiedUnitType(unit)
|
||||
{
|
||||
MaybeAddAsObserver();
|
||||
}
|
||||
|
||||
nsSVGLength::nsSVGLength()
|
||||
{
|
||||
}
|
||||
|
||||
nsSVGLength::~nsSVGLength()
|
||||
{
|
||||
MaybeRemoveAsObserver();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGLength)
|
||||
NS_IMPL_RELEASE(nsSVGLength)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGLength)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGLength)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGLength)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGLength)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValue methods:
|
||||
NS_IMETHODIMP
|
||||
nsSVGLength::SetValueString(const nsAString& aValue)
|
||||
{
|
||||
return SetValueAsString(aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGLength::GetValueString(nsAString& aValue)
|
||||
{
|
||||
return GetValueAsString(aValue);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValueObserver methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGLength::WillModifySVGObservable(nsISVGValue* observable)
|
||||
{
|
||||
WillModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGLength::DidModifySVGObservable(nsISVGValue* observable)
|
||||
{
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGLength methods:
|
||||
|
||||
/* readonly attribute unsigned short unitType; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGLength::GetUnitType(PRUint16 *aUnitType)
|
||||
{
|
||||
*aUnitType = mSpecifiedUnitType;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute float value; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGLength::GetValue(float *aValue)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
switch (mSpecifiedUnitType) {
|
||||
case SVG_LENGTHTYPE_NUMBER:
|
||||
*aValue = mValueInSpecifiedUnits;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_PX:
|
||||
*aValue = mValueInSpecifiedUnits * UserUnitsPerPixel();
|
||||
break;
|
||||
case SVG_LENGTHTYPE_MM:
|
||||
*aValue = mValueInSpecifiedUnits / mmPerPixel() * UserUnitsPerPixel();
|
||||
break;
|
||||
case SVG_LENGTHTYPE_CM:
|
||||
*aValue = mValueInSpecifiedUnits * 10.0f / mmPerPixel() * UserUnitsPerPixel();
|
||||
break;
|
||||
case SVG_LENGTHTYPE_IN:
|
||||
*aValue = mValueInSpecifiedUnits * 25.4f / mmPerPixel() * UserUnitsPerPixel();
|
||||
break;
|
||||
case SVG_LENGTHTYPE_PT:
|
||||
*aValue = mValueInSpecifiedUnits * 25.4f/72.0f / mmPerPixel() * UserUnitsPerPixel();
|
||||
break;
|
||||
case SVG_LENGTHTYPE_PC:
|
||||
*aValue = mValueInSpecifiedUnits * 25.4f*12.0f/72.0f / mmPerPixel() * UserUnitsPerPixel();
|
||||
break;
|
||||
case SVG_LENGTHTYPE_PERCENTAGE:
|
||||
*aValue = mValueInSpecifiedUnits * AxisLength() / 100.0f;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_EMS:
|
||||
case SVG_LENGTHTYPE_EXS:
|
||||
//XXX
|
||||
NS_ASSERTION(PR_FALSE, "unit not implemented yet");
|
||||
default:
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGLength::SetValue(float aValue)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
WillModify();
|
||||
|
||||
switch (mSpecifiedUnitType) {
|
||||
case SVG_LENGTHTYPE_NUMBER:
|
||||
mValueInSpecifiedUnits = aValue;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_PX:
|
||||
mValueInSpecifiedUnits = aValue / UserUnitsPerPixel();
|
||||
break;
|
||||
case SVG_LENGTHTYPE_MM:
|
||||
mValueInSpecifiedUnits = aValue / UserUnitsPerPixel() * mmPerPixel();
|
||||
break;
|
||||
case SVG_LENGTHTYPE_CM:
|
||||
mValueInSpecifiedUnits = aValue / UserUnitsPerPixel() * mmPerPixel() / 10.0f;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_IN:
|
||||
mValueInSpecifiedUnits = aValue / UserUnitsPerPixel() * mmPerPixel() / 25.4f;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_PT:
|
||||
mValueInSpecifiedUnits = aValue / UserUnitsPerPixel() * mmPerPixel() * 72.0f/25.4f;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_PC:
|
||||
mValueInSpecifiedUnits = aValue / UserUnitsPerPixel() * mmPerPixel() * 72.0f/24.4f/12.0f;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_PERCENTAGE:
|
||||
mValueInSpecifiedUnits = aValue * 100.0f / AxisLength();
|
||||
break;
|
||||
case SVG_LENGTHTYPE_EMS:
|
||||
case SVG_LENGTHTYPE_EXS:
|
||||
//XXX
|
||||
NS_ASSERTION(PR_FALSE, "unit not implemented yet");
|
||||
default:
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break;
|
||||
}
|
||||
|
||||
DidModify();
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* attribute float valueInSpecifiedUnits; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGLength::GetValueInSpecifiedUnits(float *aValueInSpecifiedUnits)
|
||||
{
|
||||
*aValueInSpecifiedUnits = mValueInSpecifiedUnits;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsSVGLength::SetValueInSpecifiedUnits(float aValueInSpecifiedUnits)
|
||||
{
|
||||
WillModify();
|
||||
mValueInSpecifiedUnits = aValueInSpecifiedUnits;
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute DOMString valueAsString; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGLength::GetValueAsString(nsAString & aValueAsString)
|
||||
{
|
||||
aValueAsString.Truncate();
|
||||
|
||||
PRUnichar buf[24];
|
||||
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
|
||||
NS_LITERAL_STRING("%g").get(),
|
||||
(double)mValueInSpecifiedUnits);
|
||||
aValueAsString.Append(buf);
|
||||
|
||||
nsAutoString unitString;
|
||||
GetUnitString(unitString);
|
||||
aValueAsString.Append(unitString);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGLength::SetValueAsString(const nsAString & aValueAsString)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
char *str = ToNewCString(aValueAsString);
|
||||
|
||||
char* number = str;
|
||||
while (*number && isspace(*number))
|
||||
++number;
|
||||
|
||||
if (*number) {
|
||||
char *rest;
|
||||
double value = PR_strtod(number, &rest);
|
||||
if (rest!=number) {
|
||||
PRUint16 unitType = GetUnitTypeForString(nsCRT::strtok(rest, "\x20\x9\xD\xA", &rest));
|
||||
if (IsValidUnitType(unitType)){
|
||||
WillModify();
|
||||
mValueInSpecifiedUnits = (float)value;
|
||||
mSpecifiedUnitType = unitType;
|
||||
DidModify();
|
||||
}
|
||||
else { // parse error
|
||||
// not a valid unit type
|
||||
rv = NS_ERROR_FAILURE;
|
||||
NS_ERROR("invalid length type");
|
||||
}
|
||||
}
|
||||
else { // parse error
|
||||
// no number
|
||||
rv = NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
nsMemory::Free(str);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* void newValueSpecifiedUnits (in unsigned short unitType, in float valueInSpecifiedUnits); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGLength::NewValueSpecifiedUnits(PRUint16 unitType, float valueInSpecifiedUnits)
|
||||
{
|
||||
if (!IsValidUnitType(unitType)) return NS_ERROR_FAILURE;
|
||||
|
||||
bool observer_change = (unitType != mSpecifiedUnitType);
|
||||
|
||||
WillModify();
|
||||
if (observer_change)
|
||||
MaybeRemoveAsObserver();
|
||||
mValueInSpecifiedUnits = valueInSpecifiedUnits;
|
||||
mSpecifiedUnitType = unitType;
|
||||
if (observer_change)
|
||||
MaybeAddAsObserver();
|
||||
DidModify();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void convertToSpecifiedUnits (in unsigned short unitType); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGLength::ConvertToSpecifiedUnits(PRUint16 unitType)
|
||||
{
|
||||
if (!IsValidUnitType(unitType)) return NS_ERROR_FAILURE;
|
||||
|
||||
bool observer_change = (unitType != mSpecifiedUnitType);
|
||||
|
||||
WillModify();
|
||||
if (observer_change)
|
||||
MaybeRemoveAsObserver();
|
||||
float valueInUserUnits;
|
||||
GetValue(&valueInUserUnits);
|
||||
mSpecifiedUnitType = unitType;
|
||||
SetValue(valueInUserUnits);
|
||||
if (observer_change)
|
||||
MaybeAddAsObserver();
|
||||
DidModify();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* float getTransformedValue (in nsIDOMSVGMatrix matrix); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGLength::GetTransformedValue(nsIDOMSVGMatrix *matrix,
|
||||
float *_retval)
|
||||
{
|
||||
|
||||
// XXX we don't have enough information here. is it the length part of
|
||||
// a coordinate pair (in which case it should transform like a point)
|
||||
// or is it used like a vector-component (in which case it doesn't
|
||||
// translate)
|
||||
|
||||
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGLength methods:
|
||||
NS_IMETHODIMP
|
||||
nsSVGLength::SetContext(nsISVGViewportAxis* context)
|
||||
{
|
||||
// XXX should we bracket this inbetween WillModify/DidModify pairs?
|
||||
MaybeRemoveAsObserver();
|
||||
mContext = context;
|
||||
MaybeAddAsObserver();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation helpers:
|
||||
|
||||
float nsSVGLength::UserUnitsPerPixel()
|
||||
{
|
||||
float UUPerPx = 1.0f;
|
||||
|
||||
// SVG CR 20001102: New: A px unit and a user unit are defined to be
|
||||
// equivalent in SVG. Thus, a length of "5px" is the same as a
|
||||
// length of "5".
|
||||
//
|
||||
|
||||
// old way of mapping pixels:
|
||||
// if (!mOwnerElement) return UUPerPx;
|
||||
|
||||
// nsCOMPtr<nsIDOMSVGLocatable> locatable;
|
||||
// locatable = do_QueryInterface(mOwnerElement);
|
||||
// if (!locatable) return UUPerPx;
|
||||
|
||||
// nsCOMPtr<nsIDOMSVGMatrix> matrix;
|
||||
// locatable->GetCTM( getter_AddRefs(matrix) );
|
||||
// if (!matrix) return UUPerPx;
|
||||
|
||||
// nsCOMPtr<nsIDOMSVGPoint> point, XFormedPoint;
|
||||
// nsSVGPoint::Create(1.0, 1.0, getter_AddRefs(point));
|
||||
// point->MatrixTransform(matrix, getter_AddRefs(XFormedPoint));
|
||||
|
||||
// switch (mDirection) {
|
||||
// case eXDirection:
|
||||
// XFormedPoint->GetX(&UUPerPx);
|
||||
// break;
|
||||
// case eYDirection:
|
||||
// XFormedPoint->GetY(&UUPerPx);
|
||||
// break;
|
||||
// case eNoDirection:
|
||||
// {
|
||||
// float x,y;
|
||||
// XFormedPoint->GetX(&x);
|
||||
// XFormedPoint->GetY(&y);
|
||||
// UUPerPx = (x==y ? x : (x+y)/2);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (UUPerPx == 0.0f) {
|
||||
// NS_ASSERTION(PR_FALSE, "invalid uu/pixels");
|
||||
// UUPerPx = 1e-20f; // some small value
|
||||
// }
|
||||
|
||||
return UUPerPx;
|
||||
}
|
||||
|
||||
float nsSVGLength::mmPerPixel()
|
||||
{
|
||||
if (!mContext) {
|
||||
NS_WARNING("no context in mmPerPixel()");
|
||||
return 1e-20f;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMSVGNumber> num;
|
||||
mContext->GetMillimeterPerPixel(getter_AddRefs(num));
|
||||
NS_ASSERTION(num, "null interface");
|
||||
float mmPerPx;
|
||||
num->GetValue(&mmPerPx);
|
||||
|
||||
if (mmPerPx == 0.0f) {
|
||||
NS_ASSERTION(PR_FALSE, "invalid mm/pixels");
|
||||
mmPerPx = 1e-20f; // some small value
|
||||
}
|
||||
|
||||
return mmPerPx;
|
||||
}
|
||||
|
||||
float nsSVGLength::AxisLength()
|
||||
{
|
||||
if (!mContext) {
|
||||
NS_WARNING("no context in AxisLength()");
|
||||
return 1e-20f;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMSVGNumber> num;
|
||||
mContext->GetLength(getter_AddRefs(num));
|
||||
NS_ASSERTION(num, "null interface");
|
||||
float d;
|
||||
num->GetValue(&d);
|
||||
|
||||
NS_ASSERTION(d!=0.0f, "zero axis length");
|
||||
|
||||
if (d == 0.0f)
|
||||
d = 1e-20f;
|
||||
return d;
|
||||
}
|
||||
|
||||
void nsSVGLength::GetUnitString(nsAString& unit)
|
||||
{
|
||||
nsIAtom* UnitAtom = nsnull;
|
||||
|
||||
switch (mSpecifiedUnitType) {
|
||||
case SVG_LENGTHTYPE_NUMBER:
|
||||
UnitAtom = nsnull;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_PX:
|
||||
UnitAtom = nsSVGAtoms::px;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_MM:
|
||||
UnitAtom = nsSVGAtoms::mm;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_CM:
|
||||
UnitAtom = nsSVGAtoms::cm;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_IN:
|
||||
UnitAtom = nsSVGAtoms::in;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_PT:
|
||||
UnitAtom = nsSVGAtoms::pt;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_PC:
|
||||
UnitAtom = nsSVGAtoms::pc;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_EMS:
|
||||
UnitAtom = nsSVGAtoms::ems;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_EXS:
|
||||
UnitAtom = nsSVGAtoms::exs;
|
||||
break;
|
||||
case SVG_LENGTHTYPE_PERCENTAGE:
|
||||
UnitAtom = nsSVGAtoms::percentage;
|
||||
break;
|
||||
default:
|
||||
NS_ASSERTION(PR_FALSE, "unknown unit");
|
||||
break;
|
||||
}
|
||||
if (!UnitAtom) return;
|
||||
|
||||
UnitAtom->ToString(unit);
|
||||
}
|
||||
|
||||
PRUint16 nsSVGLength::GetUnitTypeForString(const char* unitStr)
|
||||
{
|
||||
if (!unitStr || *unitStr=='\0') return SVG_LENGTHTYPE_NUMBER;
|
||||
|
||||
nsCOMPtr<nsIAtom> unitAtom = do_GetAtom(unitStr);
|
||||
|
||||
if (unitAtom == nsSVGAtoms::px)
|
||||
return SVG_LENGTHTYPE_PX;
|
||||
else if (unitAtom == nsSVGAtoms::mm)
|
||||
return SVG_LENGTHTYPE_MM;
|
||||
else if (unitAtom == nsSVGAtoms::cm)
|
||||
return SVG_LENGTHTYPE_CM;
|
||||
else if (unitAtom == nsSVGAtoms::in)
|
||||
return SVG_LENGTHTYPE_IN;
|
||||
else if (unitAtom == nsSVGAtoms::pt)
|
||||
return SVG_LENGTHTYPE_PT;
|
||||
else if (unitAtom == nsSVGAtoms::pc)
|
||||
return SVG_LENGTHTYPE_PC;
|
||||
else if (unitAtom == nsSVGAtoms::ems)
|
||||
return SVG_LENGTHTYPE_EMS;
|
||||
else if (unitAtom == nsSVGAtoms::exs)
|
||||
return SVG_LENGTHTYPE_EXS;
|
||||
else if (unitAtom == nsSVGAtoms::percentage)
|
||||
return SVG_LENGTHTYPE_PERCENTAGE;
|
||||
|
||||
return SVG_LENGTHTYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
PRBool nsSVGLength::IsValidUnitType(PRUint16 unit)
|
||||
{
|
||||
if (unit>0 && unit<=10)
|
||||
return PR_TRUE;
|
||||
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
void nsSVGLength::MaybeAddAsObserver()
|
||||
{
|
||||
if ((mSpecifiedUnitType==SVG_LENGTHTYPE_PERCENTAGE) &&
|
||||
mContext) {
|
||||
nsCOMPtr<nsIDOMSVGNumber> num;
|
||||
mContext->GetLength(getter_AddRefs(num));
|
||||
NS_ADD_SVGVALUE_OBSERVER(num);
|
||||
}
|
||||
}
|
||||
|
||||
void nsSVGLength::MaybeRemoveAsObserver()
|
||||
{
|
||||
if ((mSpecifiedUnitType==SVG_LENGTHTYPE_PERCENTAGE) &&
|
||||
mContext) {
|
||||
nsCOMPtr<nsIDOMSVGNumber> num;
|
||||
mContext->GetLength(getter_AddRefs(num));
|
||||
NS_REMOVE_SVGVALUE_OBSERVER(num);
|
||||
}
|
||||
}
|
||||
|
||||
59
mozilla/content/svg/content/src/nsSVGLength.h
Normal file
59
mozilla/content/svg/content/src/nsSVGLength.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_SVGLENGTH_H__
|
||||
#define __NS_SVGLENGTH_H__
|
||||
|
||||
#include "nsISVGLength.h"
|
||||
#include "nsAString.h"
|
||||
|
||||
nsresult
|
||||
NS_NewSVGLength(nsISVGLength** result,
|
||||
float value=0.0f,
|
||||
PRUint16 unit=nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGLength(nsISVGLength** result,
|
||||
const nsAString &value);
|
||||
|
||||
// XXX we'll need this prototype-based stuff to support unsetting:
|
||||
//nsresult NS_NewSVGLength(nsIDOMSVGLength** result,
|
||||
// nsIDOMSVGLength* prototype);
|
||||
|
||||
|
||||
#endif //__NS_SVGLENGTH_H__
|
||||
400
mozilla/content/svg/content/src/nsSVGLengthList.cpp
Normal file
400
mozilla/content/svg/content/src/nsSVGLengthList.cpp
Normal file
@@ -0,0 +1,400 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGLengthList.h"
|
||||
#include "nsSVGLength.h"
|
||||
#include "nsSVGValue.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsDOMError.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsISVGViewportAxis.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsISVGValueUtils.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGLengthList
|
||||
|
||||
class nsSVGLengthList : public nsISVGLengthList,
|
||||
public nsSVGValue,
|
||||
public nsISVGValueObserver,
|
||||
public nsSupportsWeakReference
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGLengthList(nsISVGLengthList** result);
|
||||
|
||||
nsSVGLengthList();
|
||||
~nsSVGLengthList();
|
||||
// void Init();
|
||||
|
||||
public:
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMSVGLengthList interface:
|
||||
NS_DECL_NSIDOMSVGLENGTHLIST
|
||||
|
||||
// nsISVGLengthList interface:
|
||||
NS_IMETHOD SetContext(nsISVGViewportAxis* context);
|
||||
|
||||
// remainder of nsISVGValue interface:
|
||||
NS_IMETHOD SetValueString(const nsAString& aValue);
|
||||
NS_IMETHOD GetValueString(nsAString& aValue);
|
||||
|
||||
// nsISVGValueObserver interface:
|
||||
NS_IMETHOD WillModifySVGObservable(nsISVGValue* observable);
|
||||
NS_IMETHOD DidModifySVGObservable (nsISVGValue* observable);
|
||||
|
||||
// nsISupportsWeakReference
|
||||
// implementation inherited from nsSupportsWeakReference
|
||||
|
||||
protected:
|
||||
// implementation helpers:
|
||||
nsISVGLength* ElementAt(PRInt32 index);
|
||||
void AppendElement(nsISVGLength* aElement);
|
||||
void RemoveElementAt(PRInt32 index);
|
||||
void InsertElementAt(nsISVGLength* aElement, PRInt32 index);
|
||||
|
||||
void ReleaseLengths();
|
||||
|
||||
nsAutoVoidArray mLengths;
|
||||
nsCOMPtr<nsISVGViewportAxis> mContext;
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsSVGLengthList::nsSVGLengthList()
|
||||
{
|
||||
}
|
||||
|
||||
nsSVGLengthList::~nsSVGLengthList()
|
||||
{
|
||||
ReleaseLengths();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGLengthList)
|
||||
NS_IMPL_RELEASE(nsSVGLengthList)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGLengthList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGLengthList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGLengthList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGLengthList)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValue methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGLengthList::SetValueString(const nsAString& aValue)
|
||||
{
|
||||
WillModify();
|
||||
|
||||
ReleaseLengths();
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
char* str;
|
||||
str = ToNewCString(aValue);
|
||||
|
||||
char* rest = str;
|
||||
char* token;
|
||||
const char* delimiters = ",\x20\x9\xD\xA";
|
||||
|
||||
while ((token = nsCRT::strtok(rest, delimiters, &rest))) {
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
NS_NewSVGLength(getter_AddRefs(length), NS_ConvertASCIItoUCS2(token));
|
||||
if (!length) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break;
|
||||
}
|
||||
AppendElement(length);
|
||||
}
|
||||
|
||||
nsMemory::Free(str);
|
||||
|
||||
DidModify();
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGLengthList::GetValueString(nsAString& aValue)
|
||||
{
|
||||
aValue.Truncate();
|
||||
|
||||
PRInt32 count = mLengths.Count();
|
||||
|
||||
if (count<=0) return NS_OK;
|
||||
|
||||
PRInt32 i = 0;
|
||||
|
||||
while (1) {
|
||||
nsISVGLength* length = ElementAt(i);
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(length);
|
||||
NS_ASSERTION(val, "length doesn't implement required interface");
|
||||
if (!val) continue;
|
||||
nsAutoString str;
|
||||
val->GetValueString(str);
|
||||
aValue.Append(str);
|
||||
|
||||
if (++i >= count) break;
|
||||
|
||||
aValue.Append(NS_LITERAL_STRING(" "));
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGLengthList methods:
|
||||
|
||||
/* readonly attribute unsigned long numberOfItems; */
|
||||
NS_IMETHODIMP nsSVGLengthList::GetNumberOfItems(PRUint32 *aNumberOfItems)
|
||||
{
|
||||
*aNumberOfItems = mLengths.Count();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void clear (); */
|
||||
NS_IMETHODIMP nsSVGLengthList::Clear()
|
||||
{
|
||||
WillModify();
|
||||
ReleaseLengths();
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGLength initialize (in nsIDOMSVGLength newItem); */
|
||||
NS_IMETHODIMP nsSVGLengthList::Initialize(nsIDOMSVGLength *newItem, nsIDOMSVGLength **_retval)
|
||||
{
|
||||
Clear();
|
||||
return AppendItem(newItem, _retval);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGLength getItem (in unsigned long index); */
|
||||
NS_IMETHODIMP nsSVGLengthList::GetItem(PRUint32 index, nsIDOMSVGLength **_retval)
|
||||
{
|
||||
if ((PRInt32)index >= mLengths.Count()) {
|
||||
*_retval = nsnull;
|
||||
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
||||
}
|
||||
|
||||
*_retval = ElementAt(index);
|
||||
NS_ADDREF(*_retval);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGLength insertItemBefore (in nsIDOMSVGLength newItem, in unsigned long index); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGLengthList::InsertItemBefore(nsIDOMSVGLength *newItem, PRUint32 index, nsIDOMSVGLength **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGLength replaceItem (in nsIDOMSVGLength newItem, in unsigned long index); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGLengthList::ReplaceItem(nsIDOMSVGLength *newItem, PRUint32 index, nsIDOMSVGLength **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGLengthList removeItem (in unsigned long index); */
|
||||
NS_IMETHODIMP nsSVGLengthList::RemoveItem(PRUint32 index, nsIDOMSVGLength **_retval)
|
||||
{
|
||||
if ((PRInt32)index >= mLengths.Count()) {
|
||||
*_retval = nsnull;
|
||||
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
||||
}
|
||||
|
||||
*_retval = ElementAt(index);
|
||||
NS_ADDREF(*_retval);
|
||||
WillModify();
|
||||
RemoveElementAt(index);
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGLengthList appendItem (in nsIDOMSVGLengthList newItem); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGLengthList::AppendItem(nsIDOMSVGLength *newItem, nsIDOMSVGLength **_retval)
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(newItem);
|
||||
if (!length) {
|
||||
NS_ERROR("length doesn't implement required interface");
|
||||
*_retval = nsnull;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
AppendElement(length);
|
||||
|
||||
*_retval = newItem;
|
||||
NS_ADDREF(*_retval);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGLength methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGLengthList::SetContext(nsISVGViewportAxis *context)
|
||||
{
|
||||
mContext = context;
|
||||
|
||||
PRInt32 count = mLengths.Count();
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
nsISVGLength* length = ElementAt(i);
|
||||
length->SetContext(mContext);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValueObserver methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGLengthList::WillModifySVGObservable(nsISVGValue* observable)
|
||||
{
|
||||
WillModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGLengthList::DidModifySVGObservable(nsISVGValue* observable)
|
||||
{
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation helpers
|
||||
|
||||
void
|
||||
nsSVGLengthList::ReleaseLengths()
|
||||
{
|
||||
WillModify();
|
||||
PRInt32 count = mLengths.Count();
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
nsISVGLength* length = ElementAt(i);
|
||||
length->SetContext(nsnull);
|
||||
NS_REMOVE_SVGVALUE_OBSERVER(length);
|
||||
NS_RELEASE(length);
|
||||
}
|
||||
mLengths.Clear();
|
||||
DidModify();
|
||||
}
|
||||
|
||||
nsISVGLength*
|
||||
nsSVGLengthList::ElementAt(PRInt32 index)
|
||||
{
|
||||
return (nsISVGLength*)mLengths.ElementAt(index);
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGLengthList::AppendElement(nsISVGLength* aElement)
|
||||
{
|
||||
WillModify();
|
||||
NS_ADDREF(aElement);
|
||||
|
||||
// The SVG specs state that 'if newItem is already in a list, it
|
||||
// is removed from its previous list before it is inserted into this
|
||||
// list':
|
||||
// aElement->SetListOwner(this);
|
||||
|
||||
aElement->SetContext(mContext);
|
||||
mLengths.AppendElement((void*)aElement);
|
||||
NS_ADD_SVGVALUE_OBSERVER(aElement);
|
||||
DidModify();
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGLengthList::RemoveElementAt(PRInt32 index)
|
||||
{
|
||||
WillModify();
|
||||
nsISVGLength* length = ElementAt(index);
|
||||
NS_ASSERTION(length, "null length");
|
||||
NS_REMOVE_SVGVALUE_OBSERVER(length);
|
||||
mLengths.RemoveElementAt(index);
|
||||
NS_RELEASE(length);
|
||||
DidModify();
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGLengthList::InsertElementAt(nsISVGLength* aElement, PRInt32 index)
|
||||
{
|
||||
WillModify();
|
||||
NS_ADDREF(aElement);
|
||||
|
||||
// The SVG specs state that 'if newItem is already in a list, it
|
||||
// is removed from its previous list before it is inserted into this
|
||||
// list':
|
||||
// aElement->SetListOwner(this);
|
||||
|
||||
aElement->SetContext(mContext);
|
||||
|
||||
mLengths.InsertElementAt((void*)aElement, index);
|
||||
NS_ADD_SVGVALUE_OBSERVER(aElement);
|
||||
DidModify();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Exported creation functions:
|
||||
|
||||
nsresult
|
||||
NS_NewSVGLengthList(nsISVGLengthList** result)
|
||||
{
|
||||
*result = nsnull;
|
||||
|
||||
nsSVGLengthList* lengthList = new nsSVGLengthList();
|
||||
if (!lengthList) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(lengthList);
|
||||
|
||||
*result = lengthList;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
47
mozilla/content/svg/content/src/nsSVGLengthList.h
Normal file
47
mozilla/content/svg/content/src/nsSVGLengthList.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_SVGLENGTHLIST_H__
|
||||
#define __NS_SVGLENGTHLIST_H__
|
||||
|
||||
#include "nsISVGLengthList.h"
|
||||
|
||||
nsresult
|
||||
NS_NewSVGLengthList(nsISVGLengthList** result);
|
||||
|
||||
#endif //__NS_SVGLENGTHLIST_H__
|
||||
362
mozilla/content/svg/content/src/nsSVGLineElement.cpp
Normal file
362
mozilla/content/svg/content/src/nsSVGLineElement.cpp
Normal file
@@ -0,0 +1,362 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* William Cook <william.cook@crocodile-clips.com> (original author)
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGGraphicElement.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
#include "nsSVGAnimatedLength.h"
|
||||
#include "nsSVGLength.h"
|
||||
#include "nsIDOMSVGLineElement.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsISVGSVGElement.h"
|
||||
#include "nsISVGViewportAxis.h"
|
||||
#include "nsISVGViewportRect.h"
|
||||
|
||||
typedef nsSVGGraphicElement nsSVGLineElementBase;
|
||||
|
||||
class nsSVGLineElement : public nsSVGLineElementBase,
|
||||
public nsIDOMSVGLineElement
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGLineElement(nsIContent **aResult,
|
||||
nsINodeInfo *aNodeInfo);
|
||||
nsSVGLineElement();
|
||||
virtual ~nsSVGLineElement();
|
||||
virtual nsresult Init();
|
||||
|
||||
public:
|
||||
// interfaces:
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIDOMSVGLINEELEMENT
|
||||
|
||||
// xxx I wish we could use virtual inheritance
|
||||
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsSVGLineElementBase::)
|
||||
NS_FORWARD_NSIDOMELEMENT(nsSVGLineElementBase::)
|
||||
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGLineElementBase::)
|
||||
|
||||
protected:
|
||||
virtual void ParentChainChanged();
|
||||
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mX1;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mY1;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mX2;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mY2;
|
||||
|
||||
};
|
||||
|
||||
|
||||
nsresult NS_NewSVGLineElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
nsSVGLineElement* it = new nsSVGLineElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aResult = NS_STATIC_CAST(nsIContent *, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsSVGLineElement,nsSVGLineElementBase)
|
||||
NS_IMPL_RELEASE_INHERITED(nsSVGLineElement,nsSVGLineElementBase)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGLineElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGLineElement)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGLineElement)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsSVGLineElementBase)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsSVGLineElement::nsSVGLineElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
nsSVGLineElement::~nsSVGLineElement()
|
||||
{
|
||||
if (mX1) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mX1);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mY1) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mY1);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mX2) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mX2);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mY2) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mY2);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsSVGLineElement::Init()
|
||||
{
|
||||
nsresult rv;
|
||||
rv = nsSVGLineElementBase::Init();
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
// Create mapped properties:
|
||||
|
||||
// DOM property: x1 , #IMPLIED attrib: x1
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mX1), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::x1, mX1);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: y1 , #IMPLIED attrib: y1
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mY1), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::y1, mY1);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: x2 , #IMPLIED attrib: x2
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mX2), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::x2, mX2);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: y2 , #IMPLIED attrib: y2
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mY2), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::y2, mY2);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGLineElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
||||
{
|
||||
*aReturn = nsnull;
|
||||
nsSVGLineElement* it = new nsSVGLineElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = CopyNode(it, aDeep);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aReturn = NS_STATIC_CAST(nsSVGLineElementBase*, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGLineElement methods
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength cx; */
|
||||
NS_IMETHODIMP nsSVGLineElement::GetX1(nsIDOMSVGAnimatedLength * *aX1)
|
||||
{
|
||||
*aX1 = mX1;
|
||||
NS_IF_ADDREF(*aX1);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength cy; */
|
||||
NS_IMETHODIMP nsSVGLineElement::GetY1(nsIDOMSVGAnimatedLength * *aY1)
|
||||
{
|
||||
*aY1 = mY1;
|
||||
NS_IF_ADDREF(*aY1);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength rx; */
|
||||
NS_IMETHODIMP nsSVGLineElement::GetX2(nsIDOMSVGAnimatedLength * *aX2)
|
||||
{
|
||||
*aX2 = mX2;
|
||||
NS_IF_ADDREF(*aX2);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength ry; */
|
||||
NS_IMETHODIMP nsSVGLineElement::GetY2(nsIDOMSVGAnimatedLength * *aY2)
|
||||
{
|
||||
*aY2 = mY2;
|
||||
NS_IF_ADDREF(*aY2);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
|
||||
void nsSVGLineElement::ParentChainChanged()
|
||||
{
|
||||
// set new context information on our length-properties:
|
||||
|
||||
nsCOMPtr<nsIDOMSVGSVGElement> dom_elem;
|
||||
GetOwnerSVGElement(getter_AddRefs(dom_elem));
|
||||
if (!dom_elem) return;
|
||||
|
||||
nsCOMPtr<nsISVGSVGElement> svg_elem = do_QueryInterface(dom_elem);
|
||||
NS_ASSERTION(svg_elem, "<svg> element missing interface");
|
||||
|
||||
// x1:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mX1->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetXAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// y1:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mY1->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetYAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// x2:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mX2->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetXAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// y2:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mY2->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetYAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
}
|
||||
352
mozilla/content/svg/content/src/nsSVGMatrix.cpp
Normal file
352
mozilla/content/svg/content/src/nsSVGMatrix.cpp
Normal file
@@ -0,0 +1,352 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGMatrix.h"
|
||||
#include <math.h>
|
||||
|
||||
const double radPerDegree = 2.0*3.1415926535 / 360.0;
|
||||
|
||||
nsresult
|
||||
nsSVGMatrix::Create(nsIDOMSVGMatrix** aResult,
|
||||
float a, float b, float c,
|
||||
float d, float e, float f)
|
||||
{
|
||||
*aResult = (nsIDOMSVGMatrix*) new nsSVGMatrix(a, b, c, d, e, f);
|
||||
if(!*aResult) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(*aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsSVGMatrix::nsSVGMatrix(float a, float b, float c,
|
||||
float d, float e, float f)
|
||||
: mA(a), mB(b), mC(c), mD(d), mE(e), mF(f)
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGMatrix)
|
||||
NS_IMPL_RELEASE(nsSVGMatrix)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGMatrix)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGMatrix)
|
||||
// NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
// NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGMatrix)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGMatrix methods:
|
||||
|
||||
/* attribute float a; */
|
||||
NS_IMETHODIMP nsSVGMatrix::GetA(float *aA)
|
||||
{
|
||||
*aA = mA;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsSVGMatrix::SetA(float aA)
|
||||
{
|
||||
WillModify();
|
||||
mA = aA;
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute float b; */
|
||||
NS_IMETHODIMP nsSVGMatrix::GetB(float *aB)
|
||||
{
|
||||
*aB = mB;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsSVGMatrix::SetB(float aB)
|
||||
{
|
||||
WillModify();
|
||||
mB = aB;
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute float c; */
|
||||
NS_IMETHODIMP nsSVGMatrix::GetC(float *aC)
|
||||
{
|
||||
*aC = mC;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsSVGMatrix::SetC(float aC)
|
||||
{
|
||||
WillModify();
|
||||
mC = aC;
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute float d; */
|
||||
NS_IMETHODIMP nsSVGMatrix::GetD(float *aD)
|
||||
{
|
||||
*aD = mD;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsSVGMatrix::SetD(float aD)
|
||||
{
|
||||
WillModify();
|
||||
mD = aD;
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute float e; */
|
||||
NS_IMETHODIMP nsSVGMatrix::GetE(float *aE)
|
||||
{
|
||||
*aE = mE;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsSVGMatrix::SetE(float aE)
|
||||
{
|
||||
WillModify();
|
||||
mE = aE;
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute float f; */
|
||||
NS_IMETHODIMP nsSVGMatrix::GetF(float *aF)
|
||||
{
|
||||
*aF = mF;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsSVGMatrix::SetF(float aF)
|
||||
{
|
||||
WillModify();
|
||||
mF = aF;
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGMatrix multiply (in nsIDOMSVGMatrix secondMatrix); */
|
||||
NS_IMETHODIMP nsSVGMatrix::Multiply(nsIDOMSVGMatrix *secondMatrix, nsIDOMSVGMatrix **_retval)
|
||||
{
|
||||
if (!secondMatrix) return NS_ERROR_FAILURE;
|
||||
|
||||
float sa,sb,sc,sd,se,sf;
|
||||
secondMatrix->GetA(&sa);
|
||||
secondMatrix->GetB(&sb);
|
||||
secondMatrix->GetC(&sc);
|
||||
secondMatrix->GetD(&sd);
|
||||
secondMatrix->GetE(&se);
|
||||
secondMatrix->GetF(&sf);
|
||||
|
||||
Create(_retval);
|
||||
if (!*_retval) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
(*_retval)->SetA( mA*sa + mC*sb );
|
||||
(*_retval)->SetB( mB*sa + mD*sb );
|
||||
(*_retval)->SetC( mA*sc + mC*sd );
|
||||
(*_retval)->SetD( mB*sc + mD*sd );
|
||||
(*_retval)->SetE( mA*se + mC*sf + mE );
|
||||
(*_retval)->SetF( mB*se + mD*sf + mF );
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGMatrix inverse (); */
|
||||
NS_IMETHODIMP nsSVGMatrix::Inverse(nsIDOMSVGMatrix **_retval)
|
||||
{
|
||||
double det = mA*mD - mC*mB;
|
||||
if (det == 0.0) {
|
||||
return NS_ERROR_FAILURE;
|
||||
// XXX should return SVG_MATRIX_NOT_INVERTABLE
|
||||
}
|
||||
|
||||
Create(_retval);
|
||||
if (!*_retval) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
(*_retval)->SetA( (float)( mD/det) );
|
||||
(*_retval)->SetB( (float)(-mB/det) );
|
||||
(*_retval)->SetC( (float)(-mC/det) );
|
||||
(*_retval)->SetD( (float)( mA/det) );
|
||||
(*_retval)->SetE( (float)((mC*mF - mE*mD)/det) );
|
||||
(*_retval)->SetF( (float)((mE*mB - mA*mF)/det) );
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGMatrix translate (in float x, in float y); */
|
||||
NS_IMETHODIMP nsSVGMatrix::Translate(float x, float y, nsIDOMSVGMatrix **_retval)
|
||||
{
|
||||
Create(_retval);
|
||||
if (!*_retval) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
(*_retval)->SetA( mA );
|
||||
(*_retval)->SetB( mB );
|
||||
(*_retval)->SetC( mC );
|
||||
(*_retval)->SetD( mD );
|
||||
(*_retval)->SetE( mA*x + mC*y + mE );
|
||||
(*_retval)->SetF( mB*x + mD*y + mF );
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGMatrix scale (in float scaleFactor); */
|
||||
NS_IMETHODIMP nsSVGMatrix::Scale(float scaleFactor, nsIDOMSVGMatrix **_retval)
|
||||
{
|
||||
Create(_retval);
|
||||
if (!*_retval) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
(*_retval)->SetA( mA*scaleFactor );
|
||||
(*_retval)->SetB( mB*scaleFactor );
|
||||
(*_retval)->SetC( mC*scaleFactor );
|
||||
(*_retval)->SetD( mD*scaleFactor );
|
||||
(*_retval)->SetE( mE );
|
||||
(*_retval)->SetF( mF );
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGMatrix scaleNonUniform (in float scaleFactorX, in float scaleFactorY); */
|
||||
NS_IMETHODIMP nsSVGMatrix::ScaleNonUniform(float scaleFactorX, float scaleFactorY, nsIDOMSVGMatrix **_retval)
|
||||
{
|
||||
Create(_retval);
|
||||
if (!*_retval) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
(*_retval)->SetA( mA*scaleFactorX );
|
||||
(*_retval)->SetB( mB*scaleFactorX );
|
||||
(*_retval)->SetC( mC*scaleFactorY );
|
||||
(*_retval)->SetD( mD*scaleFactorY );
|
||||
(*_retval)->SetE( mE );
|
||||
(*_retval)->SetF( mF );
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGMatrix rotate (in float angle); */
|
||||
NS_IMETHODIMP nsSVGMatrix::Rotate(float angle, nsIDOMSVGMatrix **_retval)
|
||||
{
|
||||
Create(_retval);
|
||||
if (!*_retval) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
double ca = cos( angle*radPerDegree );
|
||||
double sa = sin( angle*radPerDegree );
|
||||
|
||||
(*_retval)->SetA( (float) (mA*ca + mC*sa) );
|
||||
(*_retval)->SetB( (float) (mB*ca + mD*sa) );
|
||||
(*_retval)->SetC( (float) (mC*ca - mA*sa) );
|
||||
(*_retval)->SetD( (float) (mD*ca - mB*sa) );
|
||||
(*_retval)->SetE( mE );
|
||||
(*_retval)->SetF( mF );
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGMatrix rotateFromVector (in float x, in float y); */
|
||||
NS_IMETHODIMP nsSVGMatrix::RotateFromVector(float x, float y, nsIDOMSVGMatrix **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGMatrix flipX (); */
|
||||
NS_IMETHODIMP nsSVGMatrix::FlipX(nsIDOMSVGMatrix **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGMatrix flipY (); */
|
||||
NS_IMETHODIMP nsSVGMatrix::FlipY(nsIDOMSVGMatrix **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGMatrix skewX (in float angle); */
|
||||
NS_IMETHODIMP nsSVGMatrix::SkewX(float angle, nsIDOMSVGMatrix **_retval)
|
||||
{
|
||||
Create(_retval);
|
||||
if (!*_retval) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
double ta = tan( angle*radPerDegree );
|
||||
|
||||
(*_retval)->SetA( mA );
|
||||
(*_retval)->SetB( mB );
|
||||
(*_retval)->SetC( (float) ( mC + mA*ta) );
|
||||
(*_retval)->SetD( (float) ( mD + mB*ta) );
|
||||
(*_retval)->SetE( mE );
|
||||
(*_retval)->SetF( mF );
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGMatrix skewY (in float angle); */
|
||||
NS_IMETHODIMP nsSVGMatrix::SkewY(float angle, nsIDOMSVGMatrix **_retval)
|
||||
{
|
||||
Create(_retval);
|
||||
if (!*_retval) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
double ta = tan( angle*radPerDegree );
|
||||
|
||||
(*_retval)->SetA( (float) (mA + mC*ta) );
|
||||
(*_retval)->SetB( (float) (mB + mD*ta) );
|
||||
(*_retval)->SetC( mC );
|
||||
(*_retval)->SetD( mD );
|
||||
(*_retval)->SetE( mE );
|
||||
(*_retval)->SetF( mF );
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValue methods:
|
||||
NS_IMETHODIMP
|
||||
nsSVGMatrix::SetValueString(const nsAString& aValue)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGMatrix::GetValueString(nsAString& aValue)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
80
mozilla/content/svg/content/src/nsSVGMatrix.h
Normal file
80
mozilla/content/svg/content/src/nsSVGMatrix.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_SVGMATRIX_H__
|
||||
#define __NS_SVGMATRIX_H__
|
||||
|
||||
#include "nsIDOMSVGMatrix.h"
|
||||
#include "nsSVGValue.h"
|
||||
|
||||
class nsSVGMatrix : public nsIDOMSVGMatrix,
|
||||
public nsSVGValue
|
||||
{
|
||||
public:
|
||||
// XXX the first parameter 'a' is renamed to 'xxx_a' to work around
|
||||
// what seems to be a VC++ compiler problem; see bug#122363, comment#2
|
||||
static nsresult Create(nsIDOMSVGMatrix** aResult,
|
||||
float xxx_a=1.0f, float b=0.0f, float c=0.0f,
|
||||
float d=1.0f, float e=0.0f, float f=0.0f);
|
||||
|
||||
protected:
|
||||
nsSVGMatrix(float a=1.0f,
|
||||
float b=0.0f,
|
||||
float c=0.0f,
|
||||
float d=1.0f,
|
||||
float e=0.0f,
|
||||
float f=0.0f);
|
||||
|
||||
public:
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMSVGMatrix interface:
|
||||
NS_DECL_NSIDOMSVGMATRIX
|
||||
|
||||
// nsISVGValue interface:
|
||||
NS_IMETHOD SetValueString(const nsAString& aValue);
|
||||
NS_IMETHOD GetValueString(nsAString& aValue);
|
||||
|
||||
|
||||
protected:
|
||||
float mA, mB, mC, mD, mE, mF;
|
||||
};
|
||||
|
||||
|
||||
#endif //__NS_SVGMATRIX_H__
|
||||
133
mozilla/content/svg/content/src/nsSVGNumber.cpp
Normal file
133
mozilla/content/svg/content/src/nsSVGNumber.cpp
Normal file
@@ -0,0 +1,133 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGNumber.h"
|
||||
#include "prdtoa.h"
|
||||
#include "nsSVGValue.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGNumber class
|
||||
|
||||
class nsSVGNumber : public nsIDOMSVGNumber,
|
||||
public nsSVGValue
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGNumber(nsIDOMSVGNumber** result,
|
||||
float val);
|
||||
nsSVGNumber(float val);
|
||||
|
||||
public:
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMSVGNumber interface:
|
||||
NS_DECL_NSIDOMSVGNUMBER
|
||||
|
||||
// nsISVGValue interface:
|
||||
NS_IMETHOD SetValueString(const nsAString& aValue);
|
||||
NS_IMETHOD GetValueString(nsAString& aValue);
|
||||
|
||||
|
||||
protected:
|
||||
float mValue;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// implementation:
|
||||
|
||||
nsresult
|
||||
NS_NewSVGNumber(nsIDOMSVGNumber** result, float val)
|
||||
{
|
||||
*result = new nsSVGNumber(val);
|
||||
if(!*result) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(*result);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsSVGNumber::nsSVGNumber(float val)
|
||||
: mValue(val)
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGNumber)
|
||||
NS_IMPL_RELEASE(nsSVGNumber)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGNumber)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGNumber)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGNumber)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValue methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGNumber::SetValueString(const nsAString& aValue)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGNumber::GetValueString(nsAString& aValue)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGNumber methods:
|
||||
|
||||
/* attribute float value; */
|
||||
NS_IMETHODIMP nsSVGNumber::GetValue(float *aValue)
|
||||
{
|
||||
*aValue = mValue;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsSVGNumber::SetValue(float aValue)
|
||||
{
|
||||
WillModify();
|
||||
mValue = aValue;
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
48
mozilla/content/svg/content/src/nsSVGNumber.h
Normal file
48
mozilla/content/svg/content/src/nsSVGNumber.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_SVGNUMBER_H__
|
||||
#define __NS_SVGNUMBER_H__
|
||||
|
||||
#include "nsIDOMSVGNumber.h"
|
||||
|
||||
nsresult
|
||||
NS_NewSVGNumber(nsIDOMSVGNumber** result,
|
||||
float value=0.0f);
|
||||
|
||||
#endif //__NS_SVGNUMBER_H__
|
||||
1254
mozilla/content/svg/content/src/nsSVGPathDataParser.cpp
Normal file
1254
mozilla/content/svg/content/src/nsSVGPathDataParser.cpp
Normal file
File diff suppressed because it is too large
Load Diff
164
mozilla/content/svg/content/src/nsSVGPathDataParser.h
Normal file
164
mozilla/content/svg/content/src/nsSVGPathDataParser.h
Normal file
@@ -0,0 +1,164 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_SVGPATHDATAPARSER_H__
|
||||
#define __NS_SVGPATHDATAPARSER_H__
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsIDOMSVGPathSeg.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGPathDataParser: a simple recursive descent parser that builds
|
||||
// nsIDOMPathSegs from path data strings. The grammar for path data
|
||||
// can be found in SVG CR 20001102, chapter 8.
|
||||
|
||||
class nsSVGPathDataParser
|
||||
{
|
||||
public:
|
||||
nsSVGPathDataParser(nsVoidArray* data);
|
||||
nsresult Parse(const char* str);
|
||||
|
||||
protected:
|
||||
nsVoidArray *mData;
|
||||
|
||||
const char* inputpos;
|
||||
|
||||
char tokenval;
|
||||
const char* tokenpos;
|
||||
enum { DIGIT, WSP, COMMA, POINT, SIGN, OTHER, END } tokentype;
|
||||
|
||||
|
||||
// helpers
|
||||
nsresult AppendSegment(nsIDOMSVGPathSeg* seg);
|
||||
void getNextToken();
|
||||
void windBack(const char* pos);
|
||||
nsresult match(char tok);
|
||||
|
||||
|
||||
nsresult matchSvgPath();
|
||||
|
||||
nsresult matchSubPaths();
|
||||
PRBool isTokenSubPathsStarter();
|
||||
|
||||
nsresult matchSubPath();
|
||||
PRBool isTokenSubPathStarter();
|
||||
|
||||
nsresult matchSubPathElements();
|
||||
PRBool isTokenSubPathElementsStarter();
|
||||
|
||||
nsresult matchSubPathElement();
|
||||
PRBool isTokenSubPathElementStarter();
|
||||
|
||||
nsresult matchMoveto();
|
||||
nsresult matchMovetoArgSeq(PRBool absCoords);
|
||||
|
||||
nsresult matchClosePath();
|
||||
|
||||
nsresult matchLineto();
|
||||
|
||||
nsresult matchLinetoArgSeq(PRBool absCoords);
|
||||
PRBool isTokenLinetoArgSeqStarter();
|
||||
|
||||
nsresult matchHorizontalLineto();
|
||||
nsresult matchHorizontalLinetoArgSeq(PRBool absCoords);
|
||||
|
||||
nsresult matchVerticalLineto();
|
||||
nsresult matchVerticalLinetoArgSeq(PRBool absCoords);
|
||||
|
||||
nsresult matchCurveto();
|
||||
nsresult matchCurvetoArgSeq(PRBool absCoords);
|
||||
nsresult matchCurvetoArg(float* x, float* y, float* x1,
|
||||
float* y1, float* x2, float* y2);
|
||||
PRBool isTokenCurvetoArgStarter();
|
||||
|
||||
nsresult matchSmoothCurveto();
|
||||
nsresult matchSmoothCurvetoArgSeq(PRBool absCoords);
|
||||
nsresult matchSmoothCurvetoArg(float* x, float* y, float* x2, float* y2);
|
||||
PRBool isTokenSmoothCurvetoArgStarter();
|
||||
|
||||
nsresult matchQuadBezierCurveto();
|
||||
nsresult matchQuadBezierCurvetoArgSeq(PRBool absCoords);
|
||||
nsresult matchQuadBezierCurvetoArg(float* x, float* y, float* x1, float* y1);
|
||||
PRBool isTokenQuadBezierCurvetoArgStarter();
|
||||
|
||||
nsresult matchSmoothQuadBezierCurveto();
|
||||
nsresult matchSmoothQuadBezierCurvetoArgSeq(PRBool absCoords);
|
||||
|
||||
nsresult matchEllipticalArc();
|
||||
nsresult matchEllipticalArcArgSeq(PRBool absCoords);
|
||||
nsresult matchEllipticalArcArg(float* x, float* y,
|
||||
float* r1, float* r2, float* angle,
|
||||
PRBool* largeArcFlag, PRBool* sweepFlag);
|
||||
PRBool isTokenEllipticalArcArgStarter();
|
||||
|
||||
nsresult matchCoordPair(float* x, float* y);
|
||||
PRBool isTokenCoordPairStarter();
|
||||
|
||||
nsresult matchCoord(float* x);
|
||||
PRBool isTokenCoordStarter();
|
||||
|
||||
nsresult matchNonNegativeNumber(float* x);
|
||||
PRBool isTokenNonNegativeNumberStarter();
|
||||
|
||||
nsresult matchNumber(float* x);
|
||||
PRBool isTokenNumberStarter();
|
||||
|
||||
nsresult matchFlag(PRBool* f);
|
||||
|
||||
nsresult matchCommaWsp();
|
||||
PRBool isTokenCommaWspStarter();
|
||||
|
||||
nsresult matchIntegerConst();
|
||||
|
||||
nsresult matchFloatingPointConst();
|
||||
|
||||
nsresult matchFractConst();
|
||||
|
||||
nsresult matchExponent();
|
||||
PRBool isTokenExponentStarter();
|
||||
|
||||
nsresult matchDigitSeq();
|
||||
PRBool isTokenDigitSeqStarter();
|
||||
|
||||
nsresult matchWsp();
|
||||
PRBool isTokenWspStarter();
|
||||
|
||||
};
|
||||
|
||||
#endif // __NS_SVGPATHDATAPARSER_H__
|
||||
386
mozilla/content/svg/content/src/nsSVGPathElement.cpp
Normal file
386
mozilla/content/svg/content/src/nsSVGPathElement.cpp
Normal file
@@ -0,0 +1,386 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGGraphicElement.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
#include "nsSVGPathSegList.h"
|
||||
#include "nsIDOMSVGPathElement.h"
|
||||
#include "nsIDOMSVGAnimatedPathData.h"
|
||||
#include "nsIDOMSVGPathSeg.h"
|
||||
#include "nsSVGPathSeg.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
typedef nsSVGGraphicElement nsSVGPathElementBase;
|
||||
|
||||
class nsSVGPathElement : public nsSVGPathElementBase,
|
||||
public nsIDOMSVGPathElement,
|
||||
public nsIDOMSVGAnimatedPathData
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGPathElement(nsIContent **aResult,
|
||||
nsINodeInfo *aNodeInfo);
|
||||
nsSVGPathElement();
|
||||
virtual ~nsSVGPathElement();
|
||||
virtual nsresult Init();
|
||||
|
||||
public:
|
||||
// interfaces:
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIDOMSVGPATHELEMENT
|
||||
NS_DECL_NSIDOMSVGANIMATEDPATHDATA
|
||||
|
||||
// xxx I wish we could use virtual inheritance
|
||||
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsSVGPathElementBase::)
|
||||
NS_FORWARD_NSIDOMELEMENT(nsSVGPathElementBase::)
|
||||
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGPathElementBase::)
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsIDOMSVGPathSegList> mSegments;
|
||||
};
|
||||
|
||||
|
||||
nsresult NS_NewSVGPathElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
nsSVGPathElement* it = new nsSVGPathElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aResult = NS_STATIC_CAST(nsIContent *, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsSVGPathElement,nsSVGPathElementBase)
|
||||
NS_IMPL_RELEASE_INHERITED(nsSVGPathElement,nsSVGPathElementBase)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGPathElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGPathElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedPathData)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGPathElement)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsSVGPathElementBase)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsSVGPathElement::nsSVGPathElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
nsSVGPathElement::~nsSVGPathElement()
|
||||
{
|
||||
if (mSegments) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mSegments);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsSVGPathElement::Init()
|
||||
{
|
||||
nsresult rv;
|
||||
rv = nsSVGPathElementBase::Init();
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
// Create mapped properties:
|
||||
|
||||
// d #REQUIRED
|
||||
rv = NS_NewSVGPathSegList(getter_AddRefs(mSegments));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::d, mSegments);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
||||
{
|
||||
*aReturn = nsnull;
|
||||
nsSVGPathElement* it = new nsSVGPathElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = CopyNode(it, aDeep);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aReturn = NS_STATIC_CAST(nsSVGPathElementBase*, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGPathElement methods:
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedNumber pathLength; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::GetPathLength(nsIDOMSVGAnimatedNumber * *aPathLength)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* float getTotalLength (); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::GetTotalLength(float *_retval)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint getPointAtLength (in float distance); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::GetPointAtLength(float distance, nsIDOMSVGPoint **_retval)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* unsigned long getPathSegAtLength (in float distance); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::GetPathSegAtLength(float distance, PRUint32 *_retval)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegClosePath createSVGPathSegClosePath (); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegClosePath(nsIDOMSVGPathSegClosePath **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegClosePath(_retval);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegMovetoAbs createSVGPathSegMovetoAbs (in float x, in float y); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegMovetoAbs(float x, float y, nsIDOMSVGPathSegMovetoAbs **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegMovetoAbs(_retval, x, y);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegMovetoRel createSVGPathSegMovetoRel (in float x, in float y); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegMovetoRel(float x, float y, nsIDOMSVGPathSegMovetoRel **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegMovetoRel(_retval, x, y);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegLinetoAbs createSVGPathSegLinetoAbs (in float x, in float y); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegLinetoAbs(float x, float y, nsIDOMSVGPathSegLinetoAbs **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegLinetoAbs(_retval, x, y);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegLinetoRel createSVGPathSegLinetoRel (in float x, in float y); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegLinetoRel(float x, float y, nsIDOMSVGPathSegLinetoRel **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegLinetoRel(_retval, x, y);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs (in float x, in float y, in float x1, in float y1, in float x2, in float y2); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2, nsIDOMSVGPathSegCurvetoCubicAbs **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegCurvetoCubicAbs(_retval, x, y, x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegCurvetoCubicRel createSVGPathSegCurvetoCubicRel (in float x, in float y, in float x1, in float y1, in float x2, in float y2); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2, nsIDOMSVGPathSegCurvetoCubicRel **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegCurvetoCubicRel(_retval, x, y, x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs (in float x, in float y, in float x1, in float y1); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1, nsIDOMSVGPathSegCurvetoQuadraticAbs **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegCurvetoQuadraticAbs(_retval, x, y, x1, y1);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel (in float x, in float y, in float x1, in float y1); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1, nsIDOMSVGPathSegCurvetoQuadraticRel **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegCurvetoQuadraticRel(_retval, x, y, x1, y1);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegArcAbs createSVGPathSegArcAbs (in float x, in float y, in float r1, in float r2, in float angle, in boolean largeArcFlag, in boolean sweepFlag); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, PRBool largeArcFlag, PRBool sweepFlag, nsIDOMSVGPathSegArcAbs **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegArcAbs(_retval, x, y, r1, r2, angle, largeArcFlag, sweepFlag);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegArcRel createSVGPathSegArcRel (in float x, in float y, in float r1, in float r2, in float angle, in boolean largeArcFlag, in boolean sweepFlag); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, PRBool largeArcFlag, PRBool sweepFlag, nsIDOMSVGPathSegArcRel **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegArcRel(_retval, x, y, r1, r2, angle, largeArcFlag, sweepFlag);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegLinetoHorizontalAbs createSVGPathSegLinetoHorizontalAbs (in float x); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegLinetoHorizontalAbs(float x, nsIDOMSVGPathSegLinetoHorizontalAbs **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegLinetoHorizontalAbs(_retval, x);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegLinetoHorizontalRel createSVGPathSegLinetoHorizontalRel (in float x); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegLinetoHorizontalRel(float x, nsIDOMSVGPathSegLinetoHorizontalRel **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegLinetoHorizontalRel(_retval, x);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegLinetoVerticalAbs createSVGPathSegLinetoVerticalAbs (in float y); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegLinetoVerticalAbs(float y, nsIDOMSVGPathSegLinetoVerticalAbs **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegLinetoVerticalAbs(_retval, y);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegLinetoVerticalRel createSVGPathSegLinetoVerticalRel (in float y); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegLinetoVerticalRel(float y, nsIDOMSVGPathSegLinetoVerticalRel **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegLinetoVerticalRel(_retval, y);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegCurvetoCubicSmoothAbs createSVGPathSegCurvetoCubicSmoothAbs (in float x, in float y, in float x2, in float y2); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2, nsIDOMSVGPathSegCurvetoCubicSmoothAbs **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegCurvetoCubicSmoothAbs(_retval, x, y, x2, y2);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegCurvetoCubicSmoothRel createSVGPathSegCurvetoCubicSmoothRel (in float x, in float y, in float x2, in float y2); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2, nsIDOMSVGPathSegCurvetoCubicSmoothRel **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegCurvetoCubicSmoothRel(_retval, x, y, x2, y2);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs createSVGPathSegCurvetoQuadraticSmoothAbs (in float x, in float y); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y, nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegCurvetoQuadraticSmoothAbs(_retval, x, y);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSegCurvetoQuadraticSmoothRel createSVGPathSegCurvetoQuadraticSmoothRel (in float x, in float y); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothRel(float x, float y, nsIDOMSVGPathSegCurvetoQuadraticSmoothRel **_retval)
|
||||
{
|
||||
return NS_NewSVGPathSegCurvetoQuadraticSmoothRel(_retval, x, y);
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGAnimatedPathData methods:
|
||||
|
||||
/* readonly attribute nsIDOMSVGPathSegList pathSegList; */
|
||||
NS_IMETHODIMP nsSVGPathElement::GetPathSegList(nsIDOMSVGPathSegList * *aPathSegList)
|
||||
{
|
||||
*aPathSegList = mSegments;
|
||||
NS_ADDREF(*aPathSegList);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGPathSegList normalizedPathSegList; */
|
||||
NS_IMETHODIMP nsSVGPathElement::GetNormalizedPathSegList(nsIDOMSVGPathSegList * *aNormalizedPathSegList)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGPathSegList animatedPathSegList; */
|
||||
NS_IMETHODIMP nsSVGPathElement::GetAnimatedPathSegList(nsIDOMSVGPathSegList * *aAnimatedPathSegList)
|
||||
{
|
||||
*aAnimatedPathSegList = mSegments;
|
||||
NS_ADDREF(*aAnimatedPathSegList);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGPathSegList animatedNormalizedPathSegList; */
|
||||
NS_IMETHODIMP nsSVGPathElement::GetAnimatedNormalizedPathSegList(nsIDOMSVGPathSegList * *aAnimatedNormalizedPathSegList)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
2430
mozilla/content/svg/content/src/nsSVGPathSeg.cpp
Normal file
2430
mozilla/content/svg/content/src/nsSVGPathSeg.cpp
Normal file
File diff suppressed because it is too large
Load Diff
132
mozilla/content/svg/content/src/nsSVGPathSeg.h
Normal file
132
mozilla/content/svg/content/src/nsSVGPathSeg.h
Normal file
@@ -0,0 +1,132 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_SVGPATHSEG_H__
|
||||
#define __NS_SVGPATHSEG_H__
|
||||
|
||||
#include "nsIDOMSVGPathSeg.h"
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegClosePath(nsIDOMSVGPathSegClosePath** result);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegMovetoAbs(nsIDOMSVGPathSegMovetoAbs** result,
|
||||
float x, float y);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegMovetoRel(nsIDOMSVGPathSegMovetoRel** result,
|
||||
float x, float y);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegLinetoAbs(nsIDOMSVGPathSegLinetoAbs** result,
|
||||
float x, float y);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegLinetoRel(nsIDOMSVGPathSegLinetoRel** result,
|
||||
float x, float y);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegCurvetoCubicAbs(nsIDOMSVGPathSegCurvetoCubicAbs** result,
|
||||
float x, float y,
|
||||
float x1, float y1,
|
||||
float x2, float y2);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegCurvetoCubicRel(nsIDOMSVGPathSegCurvetoCubicRel** result,
|
||||
float x, float y,
|
||||
float x1, float y1,
|
||||
float x2, float y2);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegCurvetoQuadraticAbs(nsIDOMSVGPathSegCurvetoQuadraticAbs** result,
|
||||
float x, float y,
|
||||
float x1, float y1);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegCurvetoQuadraticRel(nsIDOMSVGPathSegCurvetoQuadraticRel** result,
|
||||
float x, float y,
|
||||
float x1, float y1);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegArcAbs(nsIDOMSVGPathSegArcAbs** result,
|
||||
float x, float y,
|
||||
float r1, float r2, float angle,
|
||||
PRBool largeArcFlag, PRBool sweepFlag);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegArcRel(nsIDOMSVGPathSegArcRel** result,
|
||||
float x, float y,
|
||||
float r1, float r2, float angle,
|
||||
PRBool largeArcFlag, PRBool sweepFlag);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegLinetoHorizontalAbs(nsIDOMSVGPathSegLinetoHorizontalAbs** result,
|
||||
float x);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegLinetoHorizontalRel(nsIDOMSVGPathSegLinetoHorizontalRel** result,
|
||||
float x);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegLinetoVerticalAbs(nsIDOMSVGPathSegLinetoVerticalAbs** result,
|
||||
float y);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegLinetoVerticalRel(nsIDOMSVGPathSegLinetoVerticalRel** result,
|
||||
float y);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegCurvetoCubicSmoothAbs(nsIDOMSVGPathSegCurvetoCubicSmoothAbs** result,
|
||||
float x, float y,
|
||||
float x2, float y2);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegCurvetoCubicSmoothRel(nsIDOMSVGPathSegCurvetoCubicSmoothRel** result,
|
||||
float x, float y,
|
||||
float x2, float y2);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegCurvetoQuadraticSmoothAbs(nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs** result,
|
||||
float x, float y);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegCurvetoQuadraticSmoothRel(nsIDOMSVGPathSegCurvetoQuadraticSmoothRel** result,
|
||||
float x, float y);
|
||||
|
||||
|
||||
#endif //__NS_SVGPATHSEG_H__
|
||||
371
mozilla/content/svg/content/src/nsSVGPathSegList.cpp
Normal file
371
mozilla/content/svg/content/src/nsSVGPathSegList.cpp
Normal file
@@ -0,0 +1,371 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGPathSegList.h"
|
||||
#include "nsSVGPathSeg.h"
|
||||
#include "nsSVGValue.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsDOMError.h"
|
||||
#include "nsSVGPathDataParser.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGPathSegList
|
||||
|
||||
class nsSVGPathSegList : public nsIDOMSVGPathSegList,
|
||||
public nsSVGValue,
|
||||
public nsISVGValueObserver,
|
||||
public nsSupportsWeakReference
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGPathSegList(nsIDOMSVGPathSegList** result);
|
||||
|
||||
nsSVGPathSegList();
|
||||
~nsSVGPathSegList();
|
||||
// void Init();
|
||||
|
||||
public:
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMSVGPathSegList interface:
|
||||
NS_DECL_NSIDOMSVGPATHSEGLIST
|
||||
|
||||
// remainder of nsISVGValue interface:
|
||||
NS_IMETHOD SetValueString(const nsAString& aValue);
|
||||
NS_IMETHOD GetValueString(nsAString& aValue);
|
||||
|
||||
// nsISVGValueObserver
|
||||
NS_IMETHOD WillModifySVGObservable(nsISVGValue* observable);
|
||||
NS_IMETHOD DidModifySVGObservable (nsISVGValue* observable);
|
||||
|
||||
// nsISupportsWeakReference
|
||||
// implementation inherited from nsSupportsWeakReference
|
||||
|
||||
protected:
|
||||
// implementation helpers:
|
||||
nsIDOMSVGPathSeg* ElementAt(PRInt32 index);
|
||||
void AppendElement(nsIDOMSVGPathSeg* aElement);
|
||||
void RemoveElementAt(PRInt32 index);
|
||||
void InsertElementAt(nsIDOMSVGPathSeg* aElement, PRInt32 index);
|
||||
|
||||
void ReleaseSegments();
|
||||
|
||||
nsVoidArray mSegments;
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsSVGPathSegList::nsSVGPathSegList()
|
||||
{
|
||||
}
|
||||
|
||||
nsSVGPathSegList::~nsSVGPathSegList()
|
||||
{
|
||||
ReleaseSegments();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGPathSegList)
|
||||
NS_IMPL_RELEASE(nsSVGPathSegList)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGPathSegList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGPathSegList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGPathSegList)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValue methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathSegList::SetValueString(const nsAString& aValue)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
char *str = ToNewCString(aValue);
|
||||
|
||||
nsVoidArray data;
|
||||
nsSVGPathDataParser parser(&data);
|
||||
rv = parser.Parse(str);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
WillModify();
|
||||
ReleaseSegments();
|
||||
mSegments = data;
|
||||
PRInt32 count = mSegments.Count();
|
||||
for (PRInt32 i=0; i<count; ++i) {
|
||||
nsIDOMSVGPathSeg* seg = ElementAt(i);
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(seg);
|
||||
if (val)
|
||||
val->AddObserver(this);
|
||||
}
|
||||
DidModify();
|
||||
}
|
||||
else {
|
||||
NS_ERROR("path data parse error!");
|
||||
PRInt32 count = data.Count();
|
||||
for (PRInt32 i=0; i<count; ++i) {
|
||||
nsIDOMSVGPathSeg* seg = ElementAt(i);
|
||||
NS_RELEASE(seg);
|
||||
}
|
||||
}
|
||||
|
||||
nsMemory::Free(str);
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathSegList::GetValueString(nsAString& aValue)
|
||||
{
|
||||
aValue.Truncate();
|
||||
|
||||
PRInt32 count = mSegments.Count();
|
||||
|
||||
if (count<=0) return NS_OK;
|
||||
|
||||
PRInt32 i = 0;
|
||||
|
||||
while (1) {
|
||||
nsIDOMSVGPathSeg* seg = ElementAt(i);
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(seg);
|
||||
NS_ASSERTION(val, "path segment doesn't implement required interface");
|
||||
if (!val) continue;
|
||||
nsAutoString str;
|
||||
val->GetValueString(str);
|
||||
aValue.Append(str);
|
||||
|
||||
if (++i >= count) break;
|
||||
|
||||
aValue.Append(NS_LITERAL_STRING(" "));
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGPathSegList methods:
|
||||
|
||||
/* readonly attribute unsigned long numberOfItems; */
|
||||
NS_IMETHODIMP nsSVGPathSegList::GetNumberOfItems(PRUint32 *aNumberOfItems)
|
||||
{
|
||||
*aNumberOfItems = mSegments.Count();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void clear (); */
|
||||
NS_IMETHODIMP nsSVGPathSegList::Clear()
|
||||
{
|
||||
WillModify();
|
||||
ReleaseSegments();
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSeg initialize (in nsIDOMSVGPathSeg newItem); */
|
||||
NS_IMETHODIMP nsSVGPathSegList::Initialize(nsIDOMSVGPathSeg *newItem, nsIDOMSVGPathSeg **_retval)
|
||||
{
|
||||
Clear();
|
||||
return AppendItem(newItem, _retval);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSeg getItem (in unsigned long index); */
|
||||
NS_IMETHODIMP nsSVGPathSegList::GetItem(PRUint32 index, nsIDOMSVGPathSeg **_retval)
|
||||
{
|
||||
if ((PRInt32)index >= mSegments.Count()) {
|
||||
*_retval = nsnull;
|
||||
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
||||
}
|
||||
|
||||
*_retval = ElementAt(index);
|
||||
NS_ADDREF(*_retval);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSeg insertItemBefore (in nsIDOMSVGPathSeg newItem, in unsigned long index); */
|
||||
NS_IMETHODIMP nsSVGPathSegList::InsertItemBefore(nsIDOMSVGPathSeg *newItem, PRUint32 index, nsIDOMSVGPathSeg **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSeg replaceItem (in nsIDOMSVGPathSeg newItem, in unsigned long index); */
|
||||
NS_IMETHODIMP nsSVGPathSegList::ReplaceItem(nsIDOMSVGPathSeg *newItem, PRUint32 index, nsIDOMSVGPathSeg **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSeg removeItem (in unsigned long index); */
|
||||
NS_IMETHODIMP nsSVGPathSegList::RemoveItem(PRUint32 index, nsIDOMSVGPathSeg **_retval)
|
||||
{
|
||||
if ((PRInt32)index >= mSegments.Count()) {
|
||||
*_retval = nsnull;
|
||||
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
||||
}
|
||||
|
||||
*_retval = ElementAt(index);
|
||||
NS_ADDREF(*_retval);
|
||||
WillModify();
|
||||
RemoveElementAt(index);
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPathSeg appendItem (in nsIDOMSVGPathSeg newItem); */
|
||||
NS_IMETHODIMP nsSVGPathSegList::AppendItem(nsIDOMSVGPathSeg *newItem, nsIDOMSVGPathSeg **_retval)
|
||||
{
|
||||
// XXX The SVG specs state that 'if newItem is already in a list, it
|
||||
// is removed from its previous list before it is inserted into this
|
||||
// list'. We don't do that. Should we?
|
||||
|
||||
*_retval = newItem;
|
||||
NS_ADDREF(*_retval);
|
||||
AppendElement(newItem);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValueObserver methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathSegList::WillModifySVGObservable(nsISVGValue* observable)
|
||||
{
|
||||
WillModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathSegList::DidModifySVGObservable (nsISVGValue* observable)
|
||||
{
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation helpers
|
||||
|
||||
void
|
||||
nsSVGPathSegList::ReleaseSegments()
|
||||
{
|
||||
WillModify();
|
||||
PRInt32 count = mSegments.Count();
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
nsIDOMSVGPathSeg* seg = ElementAt(i);
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(seg);
|
||||
if (val)
|
||||
val->RemoveObserver(this);
|
||||
NS_RELEASE(seg);
|
||||
}
|
||||
mSegments.Clear();
|
||||
DidModify();
|
||||
}
|
||||
|
||||
nsIDOMSVGPathSeg*
|
||||
nsSVGPathSegList::ElementAt(PRInt32 index)
|
||||
{
|
||||
return (nsIDOMSVGPathSeg*)mSegments.ElementAt(index);
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGPathSegList::AppendElement(nsIDOMSVGPathSeg* aElement)
|
||||
{
|
||||
WillModify();
|
||||
NS_ADDREF(aElement);
|
||||
mSegments.AppendElement((void*)aElement);
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(aElement);
|
||||
if (val)
|
||||
val->AddObserver(this);
|
||||
DidModify();
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGPathSegList::RemoveElementAt(PRInt32 index)
|
||||
{
|
||||
WillModify();
|
||||
nsIDOMSVGPathSeg* seg = ElementAt(index);
|
||||
NS_ASSERTION(seg, "null pathsegment");
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(seg);
|
||||
if (val)
|
||||
val->RemoveObserver(this);
|
||||
mSegments.RemoveElementAt(index);
|
||||
NS_RELEASE(seg);
|
||||
DidModify();
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGPathSegList::InsertElementAt(nsIDOMSVGPathSeg* aElement, PRInt32 index)
|
||||
{
|
||||
WillModify();
|
||||
NS_ADDREF(aElement);
|
||||
mSegments.InsertElementAt((void*)aElement, index);
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(aElement);
|
||||
if (val)
|
||||
val->AddObserver(this);
|
||||
DidModify();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Exported creation functions:
|
||||
|
||||
nsresult
|
||||
NS_NewSVGPathSegList(nsIDOMSVGPathSegList** result)
|
||||
{
|
||||
*result = nsnull;
|
||||
|
||||
nsSVGPathSegList* pathSegList = new nsSVGPathSegList();
|
||||
if (!pathSegList) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(pathSegList);
|
||||
|
||||
// pathSegList->Init();
|
||||
|
||||
*result = (nsIDOMSVGPathSegList*) pathSegList;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
342
mozilla/content/svg/content/src/nsSVGPointList.cpp
Normal file
342
mozilla/content/svg/content/src/nsSVGPointList.cpp
Normal file
@@ -0,0 +1,342 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGPointList.h"
|
||||
#include "nsSVGPoint.h"
|
||||
#include "nsDOMError.h"
|
||||
#include "prdtoa.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsTextFormatter.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsCOMArray.h"
|
||||
|
||||
nsresult
|
||||
nsSVGPointList::Create(const nsAString& aValue,
|
||||
nsISVGValue** aResult)
|
||||
{
|
||||
*aResult = (nsISVGValue*) new nsSVGPointList();
|
||||
if(!*aResult) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(*aResult);
|
||||
|
||||
(*aResult)->SetValueString(aValue);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsSVGPointList::Create(nsIDOMSVGPointList** aResult)
|
||||
{
|
||||
*aResult = (nsIDOMSVGPointList*) new nsSVGPointList();
|
||||
if(!*aResult) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(*aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsSVGPointList::nsSVGPointList()
|
||||
{
|
||||
}
|
||||
|
||||
nsSVGPointList::~nsSVGPointList()
|
||||
{
|
||||
ReleasePoints();
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGPointList::ReleasePoints()
|
||||
{
|
||||
WillModify();
|
||||
PRInt32 count = mPoints.Count();
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
nsIDOMSVGPoint* point = ElementAt(i);
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(point);
|
||||
if (val)
|
||||
val->RemoveObserver(this);
|
||||
NS_RELEASE(point);
|
||||
}
|
||||
mPoints.Clear();
|
||||
DidModify();
|
||||
}
|
||||
|
||||
nsIDOMSVGPoint*
|
||||
nsSVGPointList::ElementAt(PRInt32 index)
|
||||
{
|
||||
return (nsIDOMSVGPoint*)mPoints.ElementAt(index);
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGPointList::AppendElement(nsIDOMSVGPoint* aElement)
|
||||
{
|
||||
WillModify();
|
||||
NS_ADDREF(aElement);
|
||||
mPoints.AppendElement((void*)aElement);
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(aElement);
|
||||
if (val)
|
||||
val->AddObserver(this);
|
||||
DidModify();
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGPointList::RemoveElementAt(PRInt32 index)
|
||||
{
|
||||
WillModify();
|
||||
nsIDOMSVGPoint* point = ElementAt(index);
|
||||
NS_ASSERTION(point, "null point");
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(point);
|
||||
if (val)
|
||||
val->RemoveObserver(this);
|
||||
mPoints.RemoveElementAt(index);
|
||||
NS_RELEASE(point);
|
||||
DidModify();
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGPointList::InsertElementAt(nsIDOMSVGPoint* aElement, PRInt32 index)
|
||||
{
|
||||
WillModify();
|
||||
NS_ADDREF(aElement);
|
||||
mPoints.InsertElementAt((void*)aElement, index);
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(aElement);
|
||||
if (val)
|
||||
val->AddObserver(this);
|
||||
DidModify();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGPointList)
|
||||
NS_IMPL_RELEASE(nsSVGPointList)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGPointList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGPointList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGPointList)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValue methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGPointList::SetValueString(const nsAString& aValue)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
char* str = ToNewCString(aValue);
|
||||
|
||||
char* rest = str;
|
||||
char* token1;
|
||||
char* token2;
|
||||
const char* delimiters = ",\x20\x9\xD\xA";
|
||||
nsCOMArray<nsIDOMSVGPoint> points;
|
||||
|
||||
while ( (token1 = nsCRT::strtok(rest, delimiters, &rest)) &&
|
||||
(token2 = nsCRT::strtok(rest, delimiters, &rest)) ) {
|
||||
|
||||
char *end;
|
||||
|
||||
double x = PR_strtod(token1, &end);
|
||||
if (*end != '\0') {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break; // parse error
|
||||
}
|
||||
double y = PR_strtod(token2, &end);
|
||||
if (*end != '\0') {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break; // parse error
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMSVGPoint> point;
|
||||
nsSVGPoint::Create((float)x, (float)y, getter_AddRefs(point));
|
||||
if (!point) {
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
break;
|
||||
}
|
||||
points.AppendObject(point);
|
||||
}
|
||||
|
||||
if (token1 || NS_FAILED(rv)) {
|
||||
// there was a parse error.
|
||||
rv = NS_ERROR_FAILURE;
|
||||
}
|
||||
else {
|
||||
WillModify();
|
||||
ReleasePoints();
|
||||
PRInt32 count = points.Count();
|
||||
for (PRInt32 i=0; i<count; ++i) {
|
||||
AppendElement(points.ObjectAt(i));
|
||||
}
|
||||
DidModify();
|
||||
}
|
||||
|
||||
nsMemory::Free(str);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGPointList::GetValueString(nsAString& aValue)
|
||||
{
|
||||
aValue.Truncate();
|
||||
|
||||
PRInt32 count = mPoints.Count();
|
||||
|
||||
if (count<=0) return NS_OK;
|
||||
|
||||
PRInt32 i = 0;
|
||||
PRUnichar buf[48];
|
||||
|
||||
while (1) {
|
||||
nsIDOMSVGPoint* point = ElementAt(i);
|
||||
float x, y;
|
||||
point->GetX(&x);
|
||||
point->GetY(&y);
|
||||
|
||||
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("%g,%g").get(), (double)x, (double)y);
|
||||
aValue.Append(buf);
|
||||
|
||||
if (++i >= count) break;
|
||||
|
||||
aValue.Append(NS_LITERAL_STRING(" "));
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGPointList methods:
|
||||
|
||||
/* readonly attribute unsigned long numberOfItems; */
|
||||
NS_IMETHODIMP nsSVGPointList::GetNumberOfItems(PRUint32 *aNumberOfItems)
|
||||
{
|
||||
*aNumberOfItems = mPoints.Count();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void clear (); */
|
||||
NS_IMETHODIMP nsSVGPointList::Clear()
|
||||
{
|
||||
WillModify();
|
||||
ReleasePoints();
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint initialize (in nsIDOMSVGPoint newItem); */
|
||||
NS_IMETHODIMP nsSVGPointList::Initialize(nsIDOMSVGPoint *newItem, nsIDOMSVGPoint **_retval)
|
||||
{
|
||||
Clear();
|
||||
return AppendItem(newItem, _retval);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint getItem (in unsigned long index); */
|
||||
NS_IMETHODIMP nsSVGPointList::GetItem(PRUint32 index, nsIDOMSVGPoint **_retval)
|
||||
{
|
||||
if ((PRInt32)index >= mPoints.Count()) {
|
||||
*_retval = nsnull;
|
||||
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
||||
}
|
||||
|
||||
*_retval = ElementAt(index);
|
||||
NS_ADDREF(*_retval);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint insertItemBefore (in nsIDOMSVGPoint newItem, in unsigned long index); */
|
||||
NS_IMETHODIMP nsSVGPointList::InsertItemBefore(nsIDOMSVGPoint *newItem, PRUint32 index, nsIDOMSVGPoint **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint replaceItem (in nsIDOMSVGPoint newItem, in unsigned long index); */
|
||||
NS_IMETHODIMP nsSVGPointList::ReplaceItem(nsIDOMSVGPoint *newItem, PRUint32 index, nsIDOMSVGPoint **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint removeItem (in unsigned long index); */
|
||||
NS_IMETHODIMP nsSVGPointList::RemoveItem(PRUint32 index, nsIDOMSVGPoint **_retval)
|
||||
{
|
||||
if ((PRInt32)index >= mPoints.Count()) {
|
||||
*_retval = nsnull;
|
||||
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
||||
}
|
||||
|
||||
*_retval = ElementAt(index);
|
||||
NS_ADDREF(*_retval);
|
||||
WillModify();
|
||||
RemoveElementAt(index);
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint appendItem (in nsIDOMSVGPoint newItem); */
|
||||
NS_IMETHODIMP nsSVGPointList::AppendItem(nsIDOMSVGPoint *newItem, nsIDOMSVGPoint **_retval)
|
||||
{
|
||||
// XXX The SVG specs state that 'if newItem is already in a list, it
|
||||
// is removed from its previous list before it is inserted into this
|
||||
// list'. We don't do that. Should we?
|
||||
|
||||
*_retval = newItem;
|
||||
NS_ADDREF(*_retval);
|
||||
AppendElement(newItem);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValueObserver methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGPointList::WillModifySVGObservable(nsISVGValue* observable)
|
||||
{
|
||||
WillModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGPointList::DidModifySVGObservable (nsISVGValue* observable)
|
||||
{
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
408
mozilla/content/svg/content/src/nsSVGRect.cpp
Normal file
408
mozilla/content/svg/content/src/nsSVGRect.cpp
Normal file
@@ -0,0 +1,408 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGRect.h"
|
||||
#include "prdtoa.h"
|
||||
#include "nsSVGValue.h"
|
||||
#include "nsTextFormatter.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGRect class
|
||||
|
||||
class nsSVGRect : public nsIDOMSVGRect,
|
||||
public nsSVGValue
|
||||
{
|
||||
public:
|
||||
static nsresult Create(nsIDOMSVGRect** result,
|
||||
float x=0.0f, float y=0.0f,
|
||||
float w=0.0f, float h=0.0f);
|
||||
protected:
|
||||
nsSVGRect(float x, float y, float w, float h);
|
||||
|
||||
public:
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMSVGRect interface:
|
||||
NS_DECL_NSIDOMSVGRECT
|
||||
|
||||
// nsISVGValue interface:
|
||||
NS_IMETHOD SetValueString(const nsAString& aValue);
|
||||
NS_IMETHOD GetValueString(nsAString& aValue);
|
||||
|
||||
|
||||
protected:
|
||||
float mX, mY, mWidth, mHeight;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// implementation:
|
||||
|
||||
nsresult
|
||||
nsSVGRect::Create(nsIDOMSVGRect** result,
|
||||
float x, float y, float w, float h)
|
||||
{
|
||||
*result = (nsIDOMSVGRect*) new nsSVGRect(x,y,w,h);
|
||||
if(!*result) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(*result);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsSVGRect::nsSVGRect(float x, float y, float w, float h)
|
||||
: mX(x), mY(y), mWidth(w), mHeight(h)
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGRect)
|
||||
NS_IMPL_RELEASE(nsSVGRect)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGRect)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGRect)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGRect)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValue methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGRect::SetValueString(const nsAString& aValue)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
char* str = ToNewCString(aValue);
|
||||
|
||||
char* rest = str;
|
||||
char* token;
|
||||
const char* delimiters = ",\x20\x9\xD\xA";
|
||||
|
||||
double vals[4];
|
||||
int i;
|
||||
for (i=0;i<4;++i) {
|
||||
if (!(token = nsCRT::strtok(rest, delimiters, &rest))) break; // parse error
|
||||
|
||||
char *end;
|
||||
vals[i] = PR_strtod(token, &end);
|
||||
if (*end != '\0') break; // parse error
|
||||
}
|
||||
if (i!=4 || (nsCRT::strtok(rest, delimiters, &rest)!=0)) {
|
||||
// there was a parse error.
|
||||
rv = NS_ERROR_FAILURE;
|
||||
}
|
||||
else {
|
||||
WillModify();
|
||||
mX = (double)vals[0];
|
||||
mY = (double)vals[1];
|
||||
mWidth = (double)vals[2];
|
||||
mHeight = (double)vals[3];
|
||||
DidModify();
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGRect::GetValueString(nsAString& aValue)
|
||||
{
|
||||
PRUnichar buf[200];
|
||||
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
|
||||
NS_LITERAL_STRING("%g %g %g %g").get(),
|
||||
(double)mX, (double)mY,
|
||||
(double)mWidth, (double)mHeight);
|
||||
aValue.Append(buf);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGRect methods:
|
||||
|
||||
/* attribute float x; */
|
||||
NS_IMETHODIMP nsSVGRect::GetX(float *aX)
|
||||
{
|
||||
*aX = mX;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsSVGRect::SetX(float aX)
|
||||
{
|
||||
WillModify();
|
||||
mX = aX;
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute float y; */
|
||||
NS_IMETHODIMP nsSVGRect::GetY(float *aY)
|
||||
{
|
||||
*aY = mY;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsSVGRect::SetY(float aY)
|
||||
{
|
||||
WillModify();
|
||||
mY = aY;
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute float width; */
|
||||
NS_IMETHODIMP nsSVGRect::GetWidth(float *aWidth)
|
||||
{
|
||||
*aWidth = mWidth;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsSVGRect::SetWidth(float aWidth)
|
||||
{
|
||||
WillModify();
|
||||
mWidth = aWidth;
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute float height; */
|
||||
NS_IMETHODIMP nsSVGRect::GetHeight(float *aHeight)
|
||||
{
|
||||
*aHeight = mHeight;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsSVGRect::SetHeight(float aHeight)
|
||||
{
|
||||
WillModify();
|
||||
mHeight = aHeight;
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGRect prototype wrapper class
|
||||
// delegates all 'getter' calls to the given prototype if the property
|
||||
// hasn't been set on the object directly
|
||||
|
||||
class nsSVGRectPrototypeWrapper : public nsIDOMSVGRect,
|
||||
public nsSVGValue
|
||||
{
|
||||
public:
|
||||
static nsresult Create(nsIDOMSVGRect** result,
|
||||
nsIDOMSVGRect* prototype,
|
||||
nsIDOMSVGRect* body=nsnull);
|
||||
protected:
|
||||
nsSVGRectPrototypeWrapper(nsIDOMSVGRect* prototype,
|
||||
nsIDOMSVGRect* body);
|
||||
virtual ~nsSVGRectPrototypeWrapper();
|
||||
|
||||
public:
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMSVGRect interface:
|
||||
NS_DECL_NSIDOMSVGRECT
|
||||
|
||||
// nsISVGValue interface:
|
||||
NS_IMETHOD SetValueString(const nsAString& aValue);
|
||||
NS_IMETHOD GetValueString(nsAString& aValue);
|
||||
|
||||
|
||||
protected:
|
||||
void EnsureBody();
|
||||
nsIDOMSVGRect* Delegate() { return mBody ? mBody.get() : mPrototype.get(); }
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> mPrototype;
|
||||
nsCOMPtr<nsIDOMSVGRect> mBody;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// implementation:
|
||||
|
||||
nsresult
|
||||
nsSVGRectPrototypeWrapper::Create(nsIDOMSVGRect** result,
|
||||
nsIDOMSVGRect* prototype,
|
||||
nsIDOMSVGRect* body)
|
||||
{
|
||||
*result = (nsIDOMSVGRect*) new nsSVGRectPrototypeWrapper(prototype, body);
|
||||
if(!*result) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(*result);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsSVGRectPrototypeWrapper::nsSVGRectPrototypeWrapper(nsIDOMSVGRect* prototype,
|
||||
nsIDOMSVGRect* body)
|
||||
: mPrototype(prototype), mBody(body)
|
||||
{
|
||||
NS_ASSERTION(mPrototype, "need prototype");
|
||||
}
|
||||
|
||||
nsSVGRectPrototypeWrapper::~nsSVGRectPrototypeWrapper()
|
||||
{
|
||||
// if (mBody) {
|
||||
// nsCOMPtr<nsISVGValue> val = do_QueryInterface(mBody);
|
||||
// if (val)
|
||||
// val->RemoveObserver(this);
|
||||
// }
|
||||
}
|
||||
|
||||
void nsSVGRectPrototypeWrapper::EnsureBody()
|
||||
{
|
||||
if (mBody) return;
|
||||
|
||||
nsSVGRect::Create(getter_AddRefs(mBody));
|
||||
NS_ASSERTION(mBody, "couldn't create body");
|
||||
// nsCOMPtr<nsISVGValue> val = do_QueryInterface(mBody);
|
||||
// if (val)
|
||||
// val->AddObserver(this);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGRectPrototypeWrapper)
|
||||
NS_IMPL_RELEASE(nsSVGRectPrototypeWrapper)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGRectPrototypeWrapper)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGRect)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGRect)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValue methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGRectPrototypeWrapper::SetValueString(const nsAString& aValue)
|
||||
{
|
||||
EnsureBody();
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(mBody);
|
||||
NS_ASSERTION(val, "missing interface on body");
|
||||
|
||||
return val->SetValueString(aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGRectPrototypeWrapper::GetValueString(nsAString& aValue)
|
||||
{
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface( Delegate() );
|
||||
NS_ASSERTION(val, "missing interface on body");
|
||||
|
||||
return val->GetValueString(aValue);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGRect methods:
|
||||
|
||||
/* attribute float x; */
|
||||
NS_IMETHODIMP nsSVGRectPrototypeWrapper::GetX(float *aX)
|
||||
{
|
||||
return Delegate()->GetX(aX);
|
||||
}
|
||||
NS_IMETHODIMP nsSVGRectPrototypeWrapper::SetX(float aX)
|
||||
{
|
||||
WillModify();
|
||||
EnsureBody();
|
||||
nsresult rv = mBody->SetX(aX);
|
||||
DidModify();
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* attribute float y; */
|
||||
NS_IMETHODIMP nsSVGRectPrototypeWrapper::GetY(float *aY)
|
||||
{
|
||||
return Delegate()->GetY(aY);
|
||||
}
|
||||
NS_IMETHODIMP nsSVGRectPrototypeWrapper::SetY(float aY)
|
||||
{
|
||||
WillModify();
|
||||
EnsureBody();
|
||||
nsresult rv = mBody->SetY(aY);
|
||||
DidModify();
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* attribute float width; */
|
||||
NS_IMETHODIMP nsSVGRectPrototypeWrapper::GetWidth(float *aWidth)
|
||||
{
|
||||
return Delegate()->GetWidth(aWidth);
|
||||
}
|
||||
NS_IMETHODIMP nsSVGRectPrototypeWrapper::SetWidth(float aWidth)
|
||||
{
|
||||
WillModify();
|
||||
EnsureBody();
|
||||
nsresult rv = mBody->SetWidth(aWidth);
|
||||
DidModify();
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* attribute float height; */
|
||||
NS_IMETHODIMP nsSVGRectPrototypeWrapper::GetHeight(float *aHeight)
|
||||
{
|
||||
return Delegate()->GetHeight(aHeight);
|
||||
}
|
||||
NS_IMETHODIMP nsSVGRectPrototypeWrapper::SetHeight(float aHeight)
|
||||
{
|
||||
WillModify();
|
||||
EnsureBody();
|
||||
nsresult rv = mBody->SetHeight(aHeight);
|
||||
DidModify();
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Exported creation functions:
|
||||
|
||||
nsresult
|
||||
NS_NewSVGRect(nsIDOMSVGRect** result, float x, float y,
|
||||
float width, float height)
|
||||
{
|
||||
return nsSVGRect::Create(result, x, y, width, height);
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewSVGRectPrototypeWrapper(nsIDOMSVGRect** result,
|
||||
nsIDOMSVGRect* prototype)
|
||||
{
|
||||
return nsSVGRectPrototypeWrapper::Create(result, prototype);
|
||||
}
|
||||
447
mozilla/content/svg/content/src/nsSVGRectElement.cpp
Normal file
447
mozilla/content/svg/content/src/nsSVGRectElement.cpp
Normal file
@@ -0,0 +1,447 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* William Cook <william.cook@crocodile-clips.com> (original author)
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGGraphicElement.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
#include "nsSVGAnimatedLength.h"
|
||||
#include "nsSVGLength.h"
|
||||
#include "nsIDOMSVGRectElement.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsISVGSVGElement.h"
|
||||
#include "nsISVGViewportAxis.h"
|
||||
#include "nsISVGViewportRect.h"
|
||||
|
||||
typedef nsSVGGraphicElement nsSVGRectElementBase;
|
||||
|
||||
class nsSVGRectElement : public nsSVGRectElementBase,
|
||||
public nsIDOMSVGRectElement
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGRectElement(nsIContent **aResult,
|
||||
nsINodeInfo *aNodeInfo);
|
||||
nsSVGRectElement();
|
||||
virtual ~nsSVGRectElement();
|
||||
virtual nsresult Init();
|
||||
|
||||
public:
|
||||
// interfaces:
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIDOMSVGRECTELEMENT
|
||||
|
||||
// xxx I wish we could use virtual inheritance
|
||||
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsSVGRectElementBase::)
|
||||
NS_FORWARD_NSIDOMELEMENT(nsSVGRectElementBase::)
|
||||
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGRectElementBase::)
|
||||
|
||||
protected:
|
||||
virtual void ParentChainChanged();
|
||||
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mX;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mY;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mWidth;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mHeight;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mRx;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLength> mRy;
|
||||
|
||||
};
|
||||
|
||||
|
||||
nsresult NS_NewSVGRectElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
nsSVGRectElement* it = new nsSVGRectElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aResult = NS_STATIC_CAST(nsIContent *, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsSVGRectElement,nsSVGRectElementBase)
|
||||
NS_IMPL_RELEASE_INHERITED(nsSVGRectElement,nsSVGRectElementBase)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGRectElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGRectElement)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGRectElement)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsSVGRectElementBase)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsSVGRectElement::nsSVGRectElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
nsSVGRectElement::~nsSVGRectElement()
|
||||
{
|
||||
if (mX) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mX);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mY) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mY);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mWidth) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mWidth);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mHeight) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mHeight);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mRx) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mRx);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
if (mRy) {
|
||||
nsCOMPtr<nsISVGValue> value = do_QueryInterface(mRy);
|
||||
value->RemoveObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsSVGRectElement::Init()
|
||||
{
|
||||
nsresult rv;
|
||||
rv = nsSVGRectElementBase::Init();
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
// Create mapped properties:
|
||||
|
||||
// DOM property: x , #IMPLIED attrib: x
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mX), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::x, mX);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: y , #IMPLIED attrib: y
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mY), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::y, mY);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: width , #REQUIRED attrib: width
|
||||
// XXX: enforce requiredness
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mWidth), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::width, mWidth);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: height , #REQUIRED attrib: height
|
||||
// XXX: enforce requiredness
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mHeight), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::height, mHeight);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
// DOM property: rx , #IMPLIED attrib: rx
|
||||
// XXX: enforce requiredness
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mRx), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::rx, mRx);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: ry , #IMPLIED attrib: ry
|
||||
// XXX: enforce requiredness
|
||||
{
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
rv = NS_NewSVGLength(getter_AddRefs(length),
|
||||
0.0f);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLength(getter_AddRefs(mRy), length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::ry, mRy);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGRectElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
||||
{
|
||||
*aReturn = nsnull;
|
||||
nsSVGRectElement* it = new nsSVGRectElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = CopyNode(it, aDeep);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aReturn = NS_STATIC_CAST(nsSVGRectElementBase*, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGRectElement methods
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength x; */
|
||||
NS_IMETHODIMP nsSVGRectElement::GetX(nsIDOMSVGAnimatedLength * *aX)
|
||||
{
|
||||
*aX = mX;
|
||||
NS_IF_ADDREF(*aX);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength y; */
|
||||
NS_IMETHODIMP nsSVGRectElement::GetY(nsIDOMSVGAnimatedLength * *aY)
|
||||
{
|
||||
*aY = mY;
|
||||
NS_IF_ADDREF(*aY);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength width; */
|
||||
NS_IMETHODIMP nsSVGRectElement::GetWidth(nsIDOMSVGAnimatedLength * *aWidth)
|
||||
{
|
||||
*aWidth = mWidth;
|
||||
NS_IF_ADDREF(*aWidth);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength height; */
|
||||
NS_IMETHODIMP nsSVGRectElement::GetHeight(nsIDOMSVGAnimatedLength * *aHeight)
|
||||
{
|
||||
*aHeight = mHeight;
|
||||
NS_IF_ADDREF(*aHeight);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength rx; */
|
||||
NS_IMETHODIMP nsSVGRectElement::GetRx(nsIDOMSVGAnimatedLength * *aRx)
|
||||
{
|
||||
*aRx = mRx;
|
||||
NS_IF_ADDREF(*aRx);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength ry; */
|
||||
NS_IMETHODIMP nsSVGRectElement::GetRy(nsIDOMSVGAnimatedLength * *aRy)
|
||||
{
|
||||
*aRy = mRy;
|
||||
NS_IF_ADDREF(*aRy);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
|
||||
void nsSVGRectElement::ParentChainChanged()
|
||||
{
|
||||
// set new context information on our length-properties:
|
||||
|
||||
nsCOMPtr<nsIDOMSVGSVGElement> dom_elem;
|
||||
GetOwnerSVGElement(getter_AddRefs(dom_elem));
|
||||
if (!dom_elem) return;
|
||||
|
||||
nsCOMPtr<nsISVGSVGElement> svg_elem = do_QueryInterface(dom_elem);
|
||||
NS_ASSERTION(svg_elem, "<svg> element missing interface");
|
||||
|
||||
// x:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mX->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetXAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// y:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mY->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetYAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// width:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mWidth->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetXAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// height:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mHeight->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetYAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// rx:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mRx->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetXAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
|
||||
// ry:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLength> dom_length;
|
||||
mRy->GetBaseVal(getter_AddRefs(dom_length));
|
||||
nsCOMPtr<nsISVGLength> length = do_QueryInterface(dom_length);
|
||||
NS_ASSERTION(length, "svg length missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetYAxis(getter_AddRefs(ctx));
|
||||
|
||||
length->SetContext(ctx);
|
||||
}
|
||||
}
|
||||
1265
mozilla/content/svg/content/src/nsSVGSVGElement.cpp
Normal file
1265
mozilla/content/svg/content/src/nsSVGSVGElement.cpp
Normal file
File diff suppressed because it is too large
Load Diff
196
mozilla/content/svg/content/src/nsSVGStringProxyValue.cpp
Normal file
196
mozilla/content/svg/content/src/nsSVGStringProxyValue.cpp
Normal file
@@ -0,0 +1,196 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2004
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex@croczilla.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGValue.h"
|
||||
#include "nsWeakReference.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGStringProxyValue implementation
|
||||
//
|
||||
// This class is intended to sit between a client and an nsISVGValue object.
|
||||
// It is used to allow mapped SVG attributes (which store their value in parsed
|
||||
// form) to assume any string value. This is needed for SVG to work properly with
|
||||
// XUL templates, where we have XML like this: <svg:circle r="?r"/>.
|
||||
//
|
||||
// When nsSVGStringProxyValue::SetValueString() will attempt to call its
|
||||
// proxied object's SetValueString method. If that call fails, nsSVGStringProxyValue
|
||||
// will cache the string and return it for subsequent invocations of GetValueString().
|
||||
// If the call succeeds, however, invocations of GetValueString() will call the
|
||||
// proxied objects's GetValueString() method.
|
||||
// If the proxied object's data is changed internally, invocations of GetValueString()
|
||||
// will also return the proxied object's GetValueString().
|
||||
|
||||
|
||||
class nsSVGStringProxyValue : public nsSVGValue,
|
||||
public nsISVGValueObserver,
|
||||
public nsSupportsWeakReference
|
||||
{
|
||||
protected:
|
||||
friend nsresult
|
||||
NS_CreateSVGStringProxyValue(nsISVGValue* proxiedValue, nsISVGValue** aResult);
|
||||
|
||||
nsSVGStringProxyValue();
|
||||
virtual ~nsSVGStringProxyValue();
|
||||
PRBool Init(nsISVGValue* proxiedValue);
|
||||
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsISVGValue interface:
|
||||
NS_IMETHOD SetValueString(const nsAString& aValue);
|
||||
NS_IMETHOD GetValueString(nsAString& aValue);
|
||||
|
||||
// nsISVGValueObserver
|
||||
NS_IMETHOD WillModifySVGObservable(nsISVGValue* observable);
|
||||
NS_IMETHOD DidModifySVGObservable (nsISVGValue* observable);
|
||||
|
||||
// nsISupportsWeakReference
|
||||
// implementation inherited from nsSupportsWeakReference
|
||||
|
||||
protected:
|
||||
nsString mCachedValue;
|
||||
nsCOMPtr<nsISVGValue> mProxiedValue;
|
||||
PRBool mUseCachedValue;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_CreateSVGStringProxyValue(nsISVGValue* proxiedValue,
|
||||
nsISVGValue** aResult)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
|
||||
nsSVGStringProxyValue *sp = new nsSVGStringProxyValue();
|
||||
if(!sp) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(sp);
|
||||
if (!sp->Init(proxiedValue)) {
|
||||
NS_RELEASE(sp);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
*aResult = sp;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsSVGStringProxyValue::nsSVGStringProxyValue()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("nsSVGStringProxyValue CTOR\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
nsSVGStringProxyValue::~nsSVGStringProxyValue()
|
||||
{
|
||||
mProxiedValue->RemoveObserver(this);
|
||||
#ifdef DEBUG
|
||||
printf("nsSVGStringProxyValue DTOR\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
PRBool nsSVGStringProxyValue::Init(nsISVGValue* proxiedValue)
|
||||
{
|
||||
mProxiedValue = proxiedValue;
|
||||
mProxiedValue->AddObserver(this);
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGStringProxyValue)
|
||||
NS_IMPL_RELEASE(nsSVGStringProxyValue)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGStringProxyValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValue methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGStringProxyValue::SetValueString(const nsAString& aValue)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("nsSVGStringProxyValue(%p)::SetValueString(%s)\n", this, NS_ConvertUCS2toUTF8(aValue).get());
|
||||
#endif
|
||||
if (NS_FAILED(mProxiedValue->SetValueString(aValue))) {
|
||||
#ifdef DEBUG
|
||||
printf(" -> call failed, now using cached value\n");
|
||||
#endif
|
||||
mUseCachedValue = PR_TRUE; // mUseCachedValue will be reset in DidModifySVGObservable,
|
||||
// should the inner object ever change state internally
|
||||
mCachedValue = aValue;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGStringProxyValue::GetValueString(nsAString& aValue)
|
||||
{
|
||||
if (!mUseCachedValue)
|
||||
return mProxiedValue->GetValueString(aValue);
|
||||
|
||||
aValue = mCachedValue;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValueObserver methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGStringProxyValue::WillModifySVGObservable(nsISVGValue* observable)
|
||||
{
|
||||
WillModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGStringProxyValue::DidModifySVGObservable (nsISVGValue* observable)
|
||||
{
|
||||
// Our internal proxied object has set its state internally.
|
||||
// Make sure its new value takes priority over our cached string:
|
||||
mUseCachedValue = PR_FALSE;
|
||||
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
449
mozilla/content/svg/content/src/nsSVGTSpanElement.cpp
Normal file
449
mozilla/content/svg/content/src/nsSVGTSpanElement.cpp
Normal file
@@ -0,0 +1,449 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGElement.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
#include "nsIDOMSVGTSpanElement.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsSVGAnimatedLengthList.h"
|
||||
#include "nsSVGLengthList.h"
|
||||
#include "nsISVGSVGElement.h"
|
||||
#include "nsISVGViewportAxis.h"
|
||||
#include "nsISVGViewportRect.h"
|
||||
|
||||
typedef nsSVGElement nsSVGTSpanElementBase;
|
||||
|
||||
class nsSVGTSpanElement : public nsSVGTSpanElementBase,
|
||||
public nsIDOMSVGTSpanElement // : nsIDOMSVGTextPositioningElement
|
||||
// : nsIDOMSVGTextContentElement
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGTSpanElement(nsIContent **aResult,
|
||||
nsINodeInfo *aNodeInfo);
|
||||
nsSVGTSpanElement();
|
||||
virtual ~nsSVGTSpanElement();
|
||||
virtual nsresult Init();
|
||||
|
||||
public:
|
||||
// interfaces:
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIDOMSVGTSPANELEMENT
|
||||
NS_DECL_NSIDOMSVGTEXTPOSITIONINGELEMENT
|
||||
NS_DECL_NSIDOMSVGTEXTCONTENTELEMENT
|
||||
|
||||
// xxx If xpcom allowed virtual inheritance we wouldn't need to
|
||||
// forward here :-(
|
||||
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsSVGTSpanElementBase::)
|
||||
NS_FORWARD_NSIDOMELEMENT(nsSVGTSpanElementBase::)
|
||||
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGTSpanElementBase::)
|
||||
|
||||
// nsISVGContent interface
|
||||
NS_IMETHOD IsPresentationAttribute(const nsIAtom* attribute, PRBool* retval);
|
||||
|
||||
protected:
|
||||
|
||||
virtual void ParentChainChanged();
|
||||
|
||||
// nsIDOMSVGTextPositioning properties:
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLengthList> mX;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLengthList> mY;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLengthList> mdX;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLengthList> mdY;
|
||||
|
||||
};
|
||||
|
||||
|
||||
nsresult NS_NewSVGTSpanElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
nsSVGTSpanElement* it = new nsSVGTSpanElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aResult = NS_STATIC_CAST(nsIContent *, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsSVGTSpanElement,nsSVGTSpanElementBase)
|
||||
NS_IMPL_RELEASE_INHERITED(nsSVGTSpanElement,nsSVGTSpanElementBase)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGTSpanElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGTSpanElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGTextPositioningElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGTextContentElement)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGTSpanElement)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsSVGTSpanElementBase)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsSVGTSpanElement::nsSVGTSpanElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
nsSVGTSpanElement::~nsSVGTSpanElement()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsSVGTSpanElement::Init()
|
||||
{
|
||||
nsresult rv;
|
||||
rv = nsSVGTSpanElementBase::Init();
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
// Create mapped properties:
|
||||
|
||||
// DOM property: nsIDOMSVGTextPositioningElement::x, #IMPLIED attrib: x
|
||||
{
|
||||
nsCOMPtr<nsISVGLengthList> lengthList;
|
||||
rv = NS_NewSVGLengthList(getter_AddRefs(lengthList));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLengthList(getter_AddRefs(mX),
|
||||
lengthList);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::x, mX);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: nsIDOMSVGTextPositioningElement::y, #IMPLIED attrib: y
|
||||
{
|
||||
nsCOMPtr<nsISVGLengthList> lengthList;
|
||||
rv = NS_NewSVGLengthList(getter_AddRefs(lengthList));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLengthList(getter_AddRefs(mY),
|
||||
lengthList);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::y, mY);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTSpanElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
||||
{
|
||||
*aReturn = nsnull;
|
||||
nsSVGTSpanElement* it = new nsSVGTSpanElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = CopyNode(it, aDeep);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aReturn = NS_STATIC_CAST(nsSVGTSpanElementBase*, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGTSpanElement methods
|
||||
|
||||
// - no methods -
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGTextPositioningElement methods
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLengthList x; */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::GetX(nsIDOMSVGAnimatedLengthList * *aX)
|
||||
{
|
||||
*aX = mX;
|
||||
NS_IF_ADDREF(*aX);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLengthList y; */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::GetY(nsIDOMSVGAnimatedLengthList * *aY)
|
||||
{
|
||||
*aY = mY;
|
||||
NS_IF_ADDREF(*aY);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLengthList dx; */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::GetDx(nsIDOMSVGAnimatedLengthList * *aDx)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLengthList dy; */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::GetDy(nsIDOMSVGAnimatedLengthList * *aDy)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedNumberList rotate; */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::GetRotate(nsIDOMSVGAnimatedNumberList * *aRotate)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGTextContentElement methods
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength textLength; */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::GetTextLength(nsIDOMSVGAnimatedLength * *aTextLength)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedEnumeration lengthAdjust; */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::GetLengthAdjust(nsIDOMSVGAnimatedEnumeration * *aLengthAdjust)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* long getNumberOfChars (); */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::GetNumberOfChars(PRInt32 *_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* float getComputedTextLength (); */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::GetComputedTextLength(float *_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* float getSubStringLength (in unsigned long charnum, in unsigned long nchars); */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::GetSubStringLength(PRUint32 charnum, PRUint32 nchars, float *_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint getStartPositionOfChar (in unsigned long charnum); */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::GetStartPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint getEndPositionOfChar (in unsigned long charnum); */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::GetEndPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGRect getExtentOfChar (in unsigned long charnum); */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::GetExtentOfChar(PRUint32 charnum, nsIDOMSVGRect **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* float getRotationOfChar (in unsigned long charnum); */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::GetRotationOfChar(PRUint32 charnum, float *_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* long getCharNumAtPosition (in nsIDOMSVGPoint point); */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::GetCharNumAtPosition(nsIDOMSVGPoint *point, PRInt32 *_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* void selectSubString (in unsigned long charnum, in unsigned long nchars); */
|
||||
NS_IMETHODIMP nsSVGTSpanElement::SelectSubString(PRUint32 charnum, PRUint32 nchars)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGContent methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTSpanElement::IsPresentationAttribute(const nsIAtom* name, PRBool *retval)
|
||||
{
|
||||
if (
|
||||
// PresentationAttributes-FillStroke
|
||||
name==nsSVGAtoms::fill ||
|
||||
name==nsSVGAtoms::fill_opacity ||
|
||||
name==nsSVGAtoms::fill_rule ||
|
||||
name==nsSVGAtoms::stroke ||
|
||||
name==nsSVGAtoms::stroke_dasharray ||
|
||||
name==nsSVGAtoms::stroke_dashoffset ||
|
||||
name==nsSVGAtoms::stroke_linecap ||
|
||||
name==nsSVGAtoms::stroke_linejoin ||
|
||||
name==nsSVGAtoms::stroke_miterlimit ||
|
||||
name==nsSVGAtoms::stroke_opacity ||
|
||||
name==nsSVGAtoms::stroke_width ||
|
||||
// PresentationAttributes-Graphics
|
||||
name==nsSVGAtoms::clip_path ||
|
||||
name==nsSVGAtoms::clip_rule ||
|
||||
name==nsSVGAtoms::cursor ||
|
||||
name==nsSVGAtoms::display ||
|
||||
name==nsSVGAtoms::filter ||
|
||||
name==nsSVGAtoms::image_rendering ||
|
||||
name==nsSVGAtoms::mask ||
|
||||
name==nsSVGAtoms::opacity ||
|
||||
name==nsSVGAtoms::pointer_events ||
|
||||
name==nsSVGAtoms::shape_rendering ||
|
||||
name==nsSVGAtoms::text_rendering ||
|
||||
name==nsSVGAtoms::visibility ||
|
||||
// PresentationAttributes-TextContentElements
|
||||
name==nsSVGAtoms::alignment_baseline ||
|
||||
name==nsSVGAtoms::baseline_shift ||
|
||||
name==nsSVGAtoms::direction ||
|
||||
name==nsSVGAtoms::dominant_baseline ||
|
||||
name==nsSVGAtoms::glyph_orientation_horizontal ||
|
||||
name==nsSVGAtoms::glyph_orientation_vertical ||
|
||||
name==nsSVGAtoms::kerning ||
|
||||
name==nsSVGAtoms::letter_spacing ||
|
||||
name==nsSVGAtoms::text_anchor ||
|
||||
name==nsSVGAtoms::text_decoration ||
|
||||
name==nsSVGAtoms::unicode_bidi ||
|
||||
name==nsSVGAtoms::word_spacing ||
|
||||
// PresentationAttributes-FontSpecification
|
||||
name==nsSVGAtoms::font_family ||
|
||||
name==nsSVGAtoms::font_size ||
|
||||
name==nsSVGAtoms::font_size_adjust ||
|
||||
name==nsSVGAtoms::font_stretch ||
|
||||
name==nsSVGAtoms::font_style ||
|
||||
name==nsSVGAtoms::font_variant ||
|
||||
name==nsSVGAtoms::font_weight
|
||||
) {
|
||||
*retval = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
else
|
||||
return nsSVGTSpanElementBase::IsPresentationAttribute(name, retval);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
|
||||
void nsSVGTSpanElement::ParentChainChanged()
|
||||
{
|
||||
// set new context information on our length-properties:
|
||||
|
||||
nsCOMPtr<nsIDOMSVGSVGElement> dom_elem;
|
||||
GetOwnerSVGElement(getter_AddRefs(dom_elem));
|
||||
if (!dom_elem) return;
|
||||
|
||||
nsCOMPtr<nsISVGSVGElement> svg_elem = do_QueryInterface(dom_elem);
|
||||
NS_ASSERTION(svg_elem, "<svg> element missing interface");
|
||||
|
||||
// x:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLengthList> dom_lengthlist;
|
||||
mX->GetBaseVal(getter_AddRefs(dom_lengthlist));
|
||||
nsCOMPtr<nsISVGLengthList> lengthlist = do_QueryInterface(dom_lengthlist);
|
||||
NS_ASSERTION(lengthlist, "svg lengthlist missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetXAxis(getter_AddRefs(ctx));
|
||||
|
||||
lengthlist->SetContext(ctx);
|
||||
}
|
||||
|
||||
// y:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLengthList> dom_lengthlist;
|
||||
mY->GetBaseVal(getter_AddRefs(dom_lengthlist));
|
||||
nsCOMPtr<nsISVGLengthList> lengthlist = do_QueryInterface(dom_lengthlist);
|
||||
NS_ASSERTION(lengthlist, "svg lengthlist missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetYAxis(getter_AddRefs(ctx));
|
||||
|
||||
lengthlist->SetContext(ctx);
|
||||
}
|
||||
}
|
||||
461
mozilla/content/svg/content/src/nsSVGTextElement.cpp
Normal file
461
mozilla/content/svg/content/src/nsSVGTextElement.cpp
Normal file
@@ -0,0 +1,461 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGGraphicElement.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
#include "nsIDOMSVGTextElement.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsSVGAnimatedLengthList.h"
|
||||
#include "nsSVGLengthList.h"
|
||||
#include "nsISVGSVGElement.h"
|
||||
#include "nsISVGViewportAxis.h"
|
||||
#include "nsISVGViewportRect.h"
|
||||
#include "nsISVGTextContentMetrics.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
typedef nsSVGGraphicElement nsSVGTextElementBase;
|
||||
|
||||
class nsSVGTextElement : public nsSVGTextElementBase,
|
||||
public nsIDOMSVGTextElement // : nsIDOMSVGTextPositioningElement
|
||||
// : nsIDOMSVGTextContentElement
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGTextElement(nsIContent **aResult,
|
||||
nsINodeInfo *aNodeInfo);
|
||||
nsSVGTextElement();
|
||||
virtual ~nsSVGTextElement();
|
||||
virtual nsresult Init();
|
||||
|
||||
public:
|
||||
// interfaces:
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIDOMSVGTEXTELEMENT
|
||||
NS_DECL_NSIDOMSVGTEXTPOSITIONINGELEMENT
|
||||
NS_DECL_NSIDOMSVGTEXTCONTENTELEMENT
|
||||
|
||||
// xxx If xpcom allowed virtual inheritance we wouldn't need to
|
||||
// forward here :-(
|
||||
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsSVGTextElementBase::)
|
||||
NS_FORWARD_NSIDOMELEMENT(nsSVGTextElementBase::)
|
||||
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGTextElementBase::)
|
||||
|
||||
// nsISVGContent interface
|
||||
NS_IMETHOD IsPresentationAttribute(const nsIAtom* attribute, PRBool* retval);
|
||||
|
||||
protected:
|
||||
virtual void ParentChainChanged();
|
||||
|
||||
already_AddRefed<nsISVGTextContentMetrics> GetTextContentMetrics();
|
||||
|
||||
// nsIDOMSVGTextPositioning properties:
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLengthList> mX;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLengthList> mY;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLengthList> mdX;
|
||||
nsCOMPtr<nsIDOMSVGAnimatedLengthList> mdY;
|
||||
|
||||
};
|
||||
|
||||
|
||||
nsresult NS_NewSVGTextElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
nsSVGTextElement* it = new nsSVGTextElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aResult = NS_STATIC_CAST(nsIContent *, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsSVGTextElement,nsSVGTextElementBase)
|
||||
NS_IMPL_RELEASE_INHERITED(nsSVGTextElement,nsSVGTextElementBase)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGTextElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGTextElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGTextPositioningElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGTextContentElement)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGTextElement)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsSVGTextElementBase)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsSVGTextElement::nsSVGTextElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
nsSVGTextElement::~nsSVGTextElement()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsSVGTextElement::Init()
|
||||
{
|
||||
nsresult rv;
|
||||
rv = nsSVGTextElementBase::Init();
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
// Create mapped properties:
|
||||
|
||||
// DOM property: nsIDOMSVGTextPositioningElement::x, #IMPLIED attrib: x
|
||||
{
|
||||
nsCOMPtr<nsISVGLengthList> lengthList;
|
||||
rv = NS_NewSVGLengthList(getter_AddRefs(lengthList));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLengthList(getter_AddRefs(mX),
|
||||
lengthList);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::x, mX);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
// DOM property: nsIDOMSVGTextPositioningElement::y, #IMPLIED attrib: y
|
||||
{
|
||||
nsCOMPtr<nsISVGLengthList> lengthList;
|
||||
rv = NS_NewSVGLengthList(getter_AddRefs(lengthList));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGAnimatedLengthList(getter_AddRefs(mY),
|
||||
lengthList);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = mAttributes->AddMappedSVGValue(nsSVGAtoms::y, mY);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTextElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
||||
{
|
||||
*aReturn = nsnull;
|
||||
nsSVGTextElement* it = new nsSVGTextElement();
|
||||
|
||||
if (!it) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(it);
|
||||
|
||||
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = it->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = CopyNode(it, aDeep);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
it->Release();
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aReturn = NS_STATIC_CAST(nsSVGTextElementBase*, it);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGTextElement methods
|
||||
|
||||
// - no methods -
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGTextPositioningElement methods
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLengthList x; */
|
||||
NS_IMETHODIMP nsSVGTextElement::GetX(nsIDOMSVGAnimatedLengthList * *aX)
|
||||
{
|
||||
*aX = mX;
|
||||
NS_IF_ADDREF(*aX);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLengthList y; */
|
||||
NS_IMETHODIMP nsSVGTextElement::GetY(nsIDOMSVGAnimatedLengthList * *aY)
|
||||
{
|
||||
*aY = mY;
|
||||
NS_IF_ADDREF(*aY);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLengthList dx; */
|
||||
NS_IMETHODIMP nsSVGTextElement::GetDx(nsIDOMSVGAnimatedLengthList * *aDx)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLengthList dy; */
|
||||
NS_IMETHODIMP nsSVGTextElement::GetDy(nsIDOMSVGAnimatedLengthList * *aDy)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedNumberList rotate; */
|
||||
NS_IMETHODIMP nsSVGTextElement::GetRotate(nsIDOMSVGAnimatedNumberList * *aRotate)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGTextContentElement methods
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedLength textLength; */
|
||||
NS_IMETHODIMP nsSVGTextElement::GetTextLength(nsIDOMSVGAnimatedLength * *aTextLength)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGAnimatedEnumeration lengthAdjust; */
|
||||
NS_IMETHODIMP nsSVGTextElement::GetLengthAdjust(nsIDOMSVGAnimatedEnumeration * *aLengthAdjust)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* long getNumberOfChars (); */
|
||||
NS_IMETHODIMP nsSVGTextElement::GetNumberOfChars(PRInt32 *_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* float getComputedTextLength (); */
|
||||
NS_IMETHODIMP nsSVGTextElement::GetComputedTextLength(float *_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* float getSubStringLength (in unsigned long charnum, in unsigned long nchars); */
|
||||
NS_IMETHODIMP nsSVGTextElement::GetSubStringLength(PRUint32 charnum, PRUint32 nchars, float *_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint getStartPositionOfChar (in unsigned long charnum); */
|
||||
NS_IMETHODIMP nsSVGTextElement::GetStartPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint getEndPositionOfChar (in unsigned long charnum); */
|
||||
NS_IMETHODIMP nsSVGTextElement::GetEndPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGRect getExtentOfChar (in unsigned long charnum); */
|
||||
NS_IMETHODIMP nsSVGTextElement::GetExtentOfChar(PRUint32 charnum, nsIDOMSVGRect **_retval)
|
||||
{
|
||||
*_retval = nsnull;
|
||||
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics();
|
||||
|
||||
if (!metrics) return NS_ERROR_FAILURE;
|
||||
|
||||
return metrics->GetExtentOfChar(charnum, _retval);
|
||||
}
|
||||
|
||||
/* float getRotationOfChar (in unsigned long charnum); */
|
||||
NS_IMETHODIMP nsSVGTextElement::GetRotationOfChar(PRUint32 charnum, float *_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* long getCharNumAtPosition (in nsIDOMSVGPoint point); */
|
||||
NS_IMETHODIMP nsSVGTextElement::GetCharNumAtPosition(nsIDOMSVGPoint *point, PRInt32 *_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* void selectSubString (in unsigned long charnum, in unsigned long nchars); */
|
||||
NS_IMETHODIMP nsSVGTextElement::SelectSubString(PRUint32 charnum, PRUint32 nchars)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGContent methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTextElement::IsPresentationAttribute(const nsIAtom* name, PRBool *retval)
|
||||
{
|
||||
if (
|
||||
// PresentationAttributes-TextContentElements
|
||||
name==nsSVGAtoms::alignment_baseline ||
|
||||
name==nsSVGAtoms::baseline_shift ||
|
||||
name==nsSVGAtoms::direction ||
|
||||
name==nsSVGAtoms::dominant_baseline ||
|
||||
name==nsSVGAtoms::glyph_orientation_horizontal ||
|
||||
name==nsSVGAtoms::glyph_orientation_vertical ||
|
||||
name==nsSVGAtoms::kerning ||
|
||||
name==nsSVGAtoms::letter_spacing ||
|
||||
name==nsSVGAtoms::text_anchor ||
|
||||
name==nsSVGAtoms::text_decoration ||
|
||||
name==nsSVGAtoms::unicode_bidi ||
|
||||
name==nsSVGAtoms::word_spacing ||
|
||||
// PresentationAttributes-FontSpecification
|
||||
name==nsSVGAtoms::font_family ||
|
||||
name==nsSVGAtoms::font_size ||
|
||||
name==nsSVGAtoms::font_size_adjust ||
|
||||
name==nsSVGAtoms::font_stretch ||
|
||||
name==nsSVGAtoms::font_style ||
|
||||
name==nsSVGAtoms::font_variant ||
|
||||
name==nsSVGAtoms::font_weight
|
||||
) {
|
||||
*retval = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
else
|
||||
return nsSVGTextElementBase::IsPresentationAttribute(name, retval);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
|
||||
void nsSVGTextElement::ParentChainChanged()
|
||||
{
|
||||
// set new context information on our length-properties:
|
||||
|
||||
nsCOMPtr<nsIDOMSVGSVGElement> dom_elem;
|
||||
GetOwnerSVGElement(getter_AddRefs(dom_elem));
|
||||
if (!dom_elem) return;
|
||||
|
||||
nsCOMPtr<nsISVGSVGElement> svg_elem = do_QueryInterface(dom_elem);
|
||||
NS_ASSERTION(svg_elem, "<svg> element missing interface");
|
||||
|
||||
// x:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLengthList> dom_lengthlist;
|
||||
mX->GetBaseVal(getter_AddRefs(dom_lengthlist));
|
||||
nsCOMPtr<nsISVGLengthList> lengthlist = do_QueryInterface(dom_lengthlist);
|
||||
NS_ASSERTION(lengthlist, "svg lengthlist missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetXAxis(getter_AddRefs(ctx));
|
||||
|
||||
lengthlist->SetContext(ctx);
|
||||
}
|
||||
|
||||
// y:
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGLengthList> dom_lengthlist;
|
||||
mY->GetBaseVal(getter_AddRefs(dom_lengthlist));
|
||||
nsCOMPtr<nsISVGLengthList> lengthlist = do_QueryInterface(dom_lengthlist);
|
||||
NS_ASSERTION(lengthlist, "svg lengthlist missing interface");
|
||||
|
||||
nsCOMPtr<nsIDOMSVGRect> vp_dom;
|
||||
svg_elem->GetViewport(getter_AddRefs(vp_dom));
|
||||
nsCOMPtr<nsISVGViewportRect> vp = do_QueryInterface(vp_dom);
|
||||
nsCOMPtr<nsISVGViewportAxis> ctx;
|
||||
vp->GetYAxis(getter_AddRefs(ctx));
|
||||
|
||||
lengthlist->SetContext(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
already_AddRefed<nsISVGTextContentMetrics>
|
||||
nsSVGTextElement::GetTextContentMetrics()
|
||||
{
|
||||
if (!mDocument) {
|
||||
NS_ERROR("no document");
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsIPresShell* presShell = mDocument->GetShellAt(0);
|
||||
if (!presShell) {
|
||||
NS_ERROR("no presshell");
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsIFrame* frame;
|
||||
presShell->GetPrimaryFrameFor(NS_STATIC_CAST(nsIStyledContent*, this), &frame);
|
||||
|
||||
if (!frame) {
|
||||
NS_ERROR("no frame");
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsISVGTextContentMetrics* metrics;
|
||||
frame->QueryInterface(NS_GET_IID(nsISVGTextContentMetrics),(void**)&metrics);
|
||||
NS_ASSERTION(metrics, "wrong frame type");
|
||||
return metrics;
|
||||
}
|
||||
352
mozilla/content/svg/content/src/nsSVGTransform.cpp
Normal file
352
mozilla/content/svg/content/src/nsSVGTransform.cpp
Normal file
@@ -0,0 +1,352 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGTransform.h"
|
||||
#include "prdtoa.h"
|
||||
#include "nsSVGMatrix.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
#include "nsSVGValue.h"
|
||||
#include "nsIWeakReference.h"
|
||||
#include "nsSVGMatrix.h"
|
||||
#include "nsTextFormatter.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGTransform 'letter' class
|
||||
|
||||
class nsSVGTransform : public nsIDOMSVGTransform,
|
||||
public nsSVGValue
|
||||
{
|
||||
public:
|
||||
static nsresult Create(nsIDOMSVGTransform** aResult);
|
||||
|
||||
protected:
|
||||
nsSVGTransform();
|
||||
nsresult Init();
|
||||
public:
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMSVGTransform interface:
|
||||
NS_DECL_NSIDOMSVGTRANSFORM
|
||||
|
||||
// nsISVGValue interface:
|
||||
NS_IMETHOD SetValueString(const nsAString& aValue);
|
||||
NS_IMETHOD GetValueString(nsAString& aValue);
|
||||
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsIDOMSVGMatrix> mMatrix;
|
||||
float mAngle, mOriginX, mOriginY;
|
||||
PRUint16 mType;
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsresult
|
||||
nsSVGTransform::Create(nsIDOMSVGTransform** aResult)
|
||||
{
|
||||
nsSVGTransform *pl = new nsSVGTransform();
|
||||
NS_ENSURE_TRUE(pl, NS_ERROR_OUT_OF_MEMORY);
|
||||
NS_ADDREF(pl);
|
||||
if (NS_FAILED(pl->Init())) {
|
||||
NS_RELEASE(pl);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
*aResult = pl;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsSVGTransform::nsSVGTransform()
|
||||
: mAngle(0.0f),
|
||||
mOriginX(0.0f),
|
||||
mOriginY(0.0f),
|
||||
mType( SVG_TRANSFORM_MATRIX )
|
||||
{
|
||||
}
|
||||
|
||||
nsresult nsSVGTransform::Init()
|
||||
{
|
||||
return nsSVGMatrix::Create(getter_AddRefs(mMatrix));
|
||||
// XXX register as matrix observer
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGTransform)
|
||||
NS_IMPL_RELEASE(nsSVGTransform)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGTransform)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGTransform)
|
||||
// NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
// NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGTransform)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValue methods:
|
||||
NS_IMETHODIMP
|
||||
nsSVGTransform::SetValueString(const nsAString& aValue)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTransform::GetValueString(nsAString& aValue)
|
||||
{
|
||||
aValue.Truncate();
|
||||
PRUnichar buf[256];
|
||||
|
||||
switch (mType) {
|
||||
case nsIDOMSVGTransform::SVG_TRANSFORM_TRANSLATE:
|
||||
{
|
||||
float dx, dy;
|
||||
mMatrix->GetE(&dx);
|
||||
mMatrix->GetF(&dy);
|
||||
if (dy != 0.0f)
|
||||
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("translate(%g, %g)").get(), dx, dy);
|
||||
else
|
||||
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar), NS_LITERAL_STRING("translate(%g)").get(), dx);
|
||||
}
|
||||
break;
|
||||
case nsIDOMSVGTransform::SVG_TRANSFORM_ROTATE:
|
||||
{
|
||||
if (mOriginX != 0.0f || mOriginY != 0.0f)
|
||||
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
|
||||
NS_LITERAL_STRING("rotate(%g, %g, %g)").get(),
|
||||
mAngle, mOriginX, mOriginY);
|
||||
else
|
||||
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
|
||||
NS_LITERAL_STRING("rotate(%g)").get(), mAngle);
|
||||
}
|
||||
break;
|
||||
case nsIDOMSVGTransform::SVG_TRANSFORM_SCALE:
|
||||
{
|
||||
float sx, sy;
|
||||
mMatrix->GetA(&sx);
|
||||
mMatrix->GetD(&sy);
|
||||
if (sy != 0.0f)
|
||||
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
|
||||
NS_LITERAL_STRING("scale(%g, %g)").get(), sx, sy);
|
||||
else
|
||||
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
|
||||
NS_LITERAL_STRING("scale(%g)").get(), sx);
|
||||
}
|
||||
break;
|
||||
case nsIDOMSVGTransform::SVG_TRANSFORM_SKEWX:
|
||||
{
|
||||
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
|
||||
NS_LITERAL_STRING("skewX(%g)").get(), mAngle);
|
||||
}
|
||||
break;
|
||||
case nsIDOMSVGTransform::SVG_TRANSFORM_SKEWY:
|
||||
{
|
||||
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
|
||||
NS_LITERAL_STRING("skewY(%g)").get(), mAngle);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
buf[0] = '\0';
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
break;
|
||||
}
|
||||
|
||||
aValue.Append(buf);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGTransform methods:
|
||||
|
||||
/* readonly attribute unsigned short type; */
|
||||
NS_IMETHODIMP nsSVGTransform::GetType(PRUint16 *aType)
|
||||
{
|
||||
*aType = mType;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGMatrix matrix; */
|
||||
NS_IMETHODIMP nsSVGTransform::GetMatrix(nsIDOMSVGMatrix * *aMatrix)
|
||||
{
|
||||
// XXX should we make a copy here? is the matrix supposed to be live
|
||||
// or not?
|
||||
*aMatrix = mMatrix;
|
||||
NS_IF_ADDREF(*aMatrix);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute float angle; */
|
||||
NS_IMETHODIMP nsSVGTransform::GetAngle(float *aAngle)
|
||||
{
|
||||
*aAngle = mAngle;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void setMatrix (in nsIDOMSVGMatrix matrix); */
|
||||
NS_IMETHODIMP nsSVGTransform::SetMatrix(nsIDOMSVGMatrix *matrix)
|
||||
{
|
||||
WillModify();
|
||||
|
||||
mType = SVG_TRANSFORM_MATRIX;
|
||||
mAngle = 0.0f;
|
||||
mOriginX = 0.0f;
|
||||
mOriginY = 0.0f;
|
||||
|
||||
// XXX should we copy the matrix instead of replacing?
|
||||
mMatrix = matrix;
|
||||
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void setTranslate (in float tx, in float ty); */
|
||||
NS_IMETHODIMP nsSVGTransform::SetTranslate(float tx, float ty)
|
||||
{
|
||||
WillModify();
|
||||
|
||||
mType = SVG_TRANSFORM_TRANSLATE;
|
||||
mAngle = 0.0f;
|
||||
mOriginX = 0.0f;
|
||||
mOriginY = 0.0f;
|
||||
mMatrix->SetA(1.0f);
|
||||
mMatrix->SetB(0.0f);
|
||||
mMatrix->SetC(0.0f);
|
||||
mMatrix->SetD(1.0f);
|
||||
mMatrix->SetE(tx);
|
||||
mMatrix->SetF(ty);
|
||||
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void setScale (in float sx, in float sy); */
|
||||
NS_IMETHODIMP nsSVGTransform::SetScale(float sx, float sy)
|
||||
{
|
||||
WillModify();
|
||||
|
||||
mType = SVG_TRANSFORM_SCALE;
|
||||
mAngle = 0.0f;
|
||||
mOriginX = 0.0f;
|
||||
mOriginY = 0.0f;
|
||||
mMatrix->SetA(sx);
|
||||
mMatrix->SetB(0.0f);
|
||||
mMatrix->SetC(0.0f);
|
||||
mMatrix->SetD(sy);
|
||||
mMatrix->SetE(0.0f);
|
||||
mMatrix->SetF(0.0f);
|
||||
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void setRotate (in float angle, in float cx, in float cy); */
|
||||
NS_IMETHODIMP nsSVGTransform::SetRotate(float angle, float cx, float cy)
|
||||
{
|
||||
WillModify();
|
||||
|
||||
mType = SVG_TRANSFORM_ROTATE;
|
||||
mAngle = angle;
|
||||
mOriginX = cx;
|
||||
mOriginY = cy;
|
||||
|
||||
nsSVGMatrix::Create(getter_AddRefs(mMatrix));
|
||||
nsCOMPtr<nsIDOMSVGMatrix> temp;
|
||||
mMatrix->Translate(cx, cy, getter_AddRefs(temp));
|
||||
mMatrix = temp;
|
||||
mMatrix->Rotate(angle, getter_AddRefs(temp));
|
||||
mMatrix = temp;
|
||||
mMatrix->Translate(-cx,-cy, getter_AddRefs(temp));
|
||||
mMatrix = temp;
|
||||
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void setSkewX (in float angle); */
|
||||
NS_IMETHODIMP nsSVGTransform::SetSkewX(float angle)
|
||||
{
|
||||
WillModify();
|
||||
|
||||
mType = SVG_TRANSFORM_SKEWX;
|
||||
mAngle = angle;
|
||||
|
||||
nsSVGMatrix::Create(getter_AddRefs(mMatrix));
|
||||
nsCOMPtr<nsIDOMSVGMatrix> temp;
|
||||
mMatrix->SkewX(angle, getter_AddRefs(temp));
|
||||
mMatrix = temp;
|
||||
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void setSkewY (in float angle); */
|
||||
NS_IMETHODIMP nsSVGTransform::SetSkewY(float angle)
|
||||
{
|
||||
WillModify();
|
||||
|
||||
mType = SVG_TRANSFORM_SKEWY;
|
||||
mAngle = angle;
|
||||
|
||||
nsSVGMatrix::Create(getter_AddRefs(mMatrix));
|
||||
nsCOMPtr<nsIDOMSVGMatrix> temp;
|
||||
mMatrix->SkewY(angle, getter_AddRefs(temp));
|
||||
mMatrix = temp;
|
||||
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Exported creation functions:
|
||||
|
||||
nsresult
|
||||
NS_NewSVGTransform(nsIDOMSVGTransform** result)
|
||||
{
|
||||
return nsSVGTransform::Create(result);
|
||||
}
|
||||
507
mozilla/content/svg/content/src/nsSVGTransformList.cpp
Normal file
507
mozilla/content/svg/content/src/nsSVGTransformList.cpp
Normal file
@@ -0,0 +1,507 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGTransformList.h"
|
||||
#include "nsSVGTransform.h"
|
||||
#include "nsSVGMatrix.h"
|
||||
#include "nsDOMError.h"
|
||||
#include "prdtoa.h"
|
||||
#include "nsSVGAtoms.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsCOMArray.h"
|
||||
|
||||
nsresult
|
||||
nsSVGTransformList::Create(const nsAString& aValue,
|
||||
nsISVGValue** aResult)
|
||||
{
|
||||
*aResult = (nsISVGValue*) new nsSVGTransformList();
|
||||
if(!*aResult) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(*aResult);
|
||||
|
||||
(*aResult)->SetValueString(aValue);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsSVGTransformList::Create(nsIDOMSVGTransformList** aResult)
|
||||
{
|
||||
*aResult = (nsIDOMSVGTransformList*) new nsSVGTransformList();
|
||||
if(!*aResult) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(*aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsSVGTransformList::nsSVGTransformList()
|
||||
{
|
||||
}
|
||||
|
||||
nsSVGTransformList::~nsSVGTransformList()
|
||||
{
|
||||
ReleaseTransforms();
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTransformList::ReleaseTransforms()
|
||||
{
|
||||
WillModify();
|
||||
PRInt32 count = mTransforms.Count();
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
nsIDOMSVGTransform* transform = ElementAt(i);
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(transform);
|
||||
if (val)
|
||||
val->RemoveObserver(this);
|
||||
NS_RELEASE(transform);
|
||||
}
|
||||
mTransforms.Clear();
|
||||
DidModify();
|
||||
}
|
||||
|
||||
nsIDOMSVGTransform*
|
||||
nsSVGTransformList::ElementAt(PRInt32 index)
|
||||
{
|
||||
return (nsIDOMSVGTransform*)mTransforms.ElementAt(index);
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTransformList::AppendElement(nsIDOMSVGTransform* aElement)
|
||||
{
|
||||
WillModify();
|
||||
NS_ADDREF(aElement);
|
||||
mTransforms.AppendElement((void*)aElement);
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(aElement);
|
||||
if (val)
|
||||
val->AddObserver(this);
|
||||
DidModify();
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTransformList::RemoveElementAt(PRInt32 index)
|
||||
{
|
||||
WillModify();
|
||||
nsIDOMSVGTransform* transform = ElementAt(index);
|
||||
NS_ASSERTION(transform, "null transform");
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(transform);
|
||||
if (val)
|
||||
val->RemoveObserver(this);
|
||||
mTransforms.RemoveElementAt(index);
|
||||
NS_RELEASE(transform);
|
||||
DidModify();
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTransformList::InsertElementAt(nsIDOMSVGTransform* aElement, PRInt32 index)
|
||||
{
|
||||
WillModify();
|
||||
NS_ADDREF(aElement);
|
||||
mTransforms.InsertElementAt((void*)aElement, index);
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(aElement);
|
||||
if (val)
|
||||
val->AddObserver(this);
|
||||
DidModify();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// XPConnect interface list
|
||||
NS_CLASSINFO_MAP_BEGIN(SVGTransformList)
|
||||
NS_CLASSINFO_MAP_ENTRY(nsIDOMSVGTransformList)
|
||||
NS_CLASSINFO_MAP_END
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGTransformList)
|
||||
NS_IMPL_RELEASE(nsSVGTransformList)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGTransformList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGTransformList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGTransformList)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValue methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTransformList::SetValueString(const nsAString& aValue)
|
||||
{
|
||||
// XXX: we don't implement the _exact_ BNF given in the
|
||||
// specs.
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
char *str = ToNewCString(aValue);
|
||||
|
||||
char* rest = str;
|
||||
char* keyword;
|
||||
char* args;
|
||||
const char* delimiters1 = "\x20\x9\xD\xA,(";
|
||||
const char* delimiters2 = "()";
|
||||
const char* delimiters3 = "\x20\x9\xD\xA,";
|
||||
nsCOMArray<nsIDOMSVGTransform> xforms;
|
||||
|
||||
while ((keyword = nsCRT::strtok(rest, delimiters1, &rest))) {
|
||||
|
||||
while (rest && isspace(*rest))
|
||||
++rest;
|
||||
|
||||
if (!(args = nsCRT::strtok(rest, delimiters2, &rest))) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break; // parse error
|
||||
}
|
||||
nsCOMPtr<nsIDOMSVGTransform> transform;
|
||||
NS_NewSVGTransform(getter_AddRefs(transform));
|
||||
if (!transform) {
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
break;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAtom> keyatom = do_GetAtom(keyword);
|
||||
|
||||
if (keyatom == nsSVGAtoms::translate) {
|
||||
char* arg1 = nsCRT::strtok(args, delimiters3, &args);
|
||||
if (!arg1) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break; // parse error
|
||||
}
|
||||
char* arg2 = nsCRT::strtok(args, delimiters3, &args);
|
||||
char* end;
|
||||
float tx = (float) PR_strtod(arg1, &end);
|
||||
float ty = arg2 ? (float) PR_strtod(arg2, &end) : 0.0f;
|
||||
transform->SetTranslate(tx, ty);
|
||||
}
|
||||
else if (keyatom == nsSVGAtoms::scale) {
|
||||
char* arg1 = nsCRT::strtok(args, delimiters3, &args);
|
||||
if (!arg1) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break; // parse error
|
||||
}
|
||||
char* arg2 = nsCRT::strtok(args, delimiters3, &args);
|
||||
char* end;
|
||||
float sx = (float) PR_strtod(arg1, &end);
|
||||
float sy = arg2 ? (float) PR_strtod(arg2, &end) : sx;
|
||||
transform->SetScale(sx, sy);
|
||||
}
|
||||
else if (keyatom == nsSVGAtoms::rotate) {
|
||||
char* arg1 = nsCRT::strtok(args, delimiters3, &args);
|
||||
if (!arg1) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break; // parse error
|
||||
}
|
||||
char* arg2 = nsCRT::strtok(args, delimiters3, &args);
|
||||
char* arg3 = arg2 ? nsCRT::strtok(args, delimiters3, &args) : nsnull;
|
||||
if (arg2 && !arg3) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break; // parse error
|
||||
}
|
||||
char* end;
|
||||
float angle = (float) PR_strtod(arg1, &end);
|
||||
float cx = arg2 ? (float) PR_strtod(arg2, &end) : 0.0f;
|
||||
float cy = arg3 ? (float) PR_strtod(arg3, &end) : 0.0f;
|
||||
transform->SetRotate(angle, cx, cy);
|
||||
}
|
||||
else if (keyatom == nsSVGAtoms::skewX) {
|
||||
char* arg1 = nsCRT::strtok(args, delimiters3, &args);
|
||||
if (!arg1) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break; // parse error
|
||||
}
|
||||
|
||||
char* end;
|
||||
float angle = (float) PR_strtod(arg1, &end);
|
||||
transform->SetSkewX(angle);
|
||||
}
|
||||
else if (keyatom == nsSVGAtoms::skewY) {
|
||||
char* arg1 = nsCRT::strtok(args, delimiters3, &args);
|
||||
if (!arg1) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break; // parse error
|
||||
}
|
||||
char* end;
|
||||
float angle = (float) PR_strtod(arg1, &end);
|
||||
transform->SetSkewY(angle);
|
||||
}
|
||||
else if (keyatom == nsSVGAtoms::matrix) {
|
||||
char *arg, *end;
|
||||
|
||||
arg = nsCRT::strtok(args, delimiters3, &args);
|
||||
if (!arg) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break; // parse error
|
||||
}
|
||||
float a = (float) PR_strtod(arg, &end);
|
||||
|
||||
arg = nsCRT::strtok(args, delimiters3, &args);
|
||||
if (!arg) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break; // parse error
|
||||
}
|
||||
float b = (float) PR_strtod(arg, &end);
|
||||
|
||||
arg = nsCRT::strtok(args, delimiters3, &args);
|
||||
if (!arg) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break; // parse error
|
||||
}
|
||||
float c = (float) PR_strtod(arg, &end);
|
||||
|
||||
arg = nsCRT::strtok(args, delimiters3, &args);
|
||||
if (!arg) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break; // parse error
|
||||
}
|
||||
float d = (float) PR_strtod(arg, &end);
|
||||
|
||||
arg = nsCRT::strtok(args, delimiters3, &args);
|
||||
if (!arg) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break; // parse error
|
||||
}
|
||||
float e = (float) PR_strtod(arg, &end);
|
||||
|
||||
arg = nsCRT::strtok(args, delimiters3, &args);
|
||||
if (!arg) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break; // parse error
|
||||
}
|
||||
float f = (float) PR_strtod(arg, &end);
|
||||
|
||||
nsCOMPtr<nsIDOMSVGMatrix> matrix;
|
||||
nsSVGMatrix::Create(getter_AddRefs(matrix),
|
||||
a, b, c, d, e, f);
|
||||
NS_ASSERTION(matrix, "couldn't create matrix");
|
||||
transform->SetMatrix(matrix);
|
||||
}
|
||||
else { // parse error
|
||||
rv = NS_ERROR_FAILURE;
|
||||
break;
|
||||
}
|
||||
xforms.AppendObject(transform);
|
||||
}
|
||||
|
||||
if (keyword || NS_FAILED(rv)) {
|
||||
// there was a parse error.
|
||||
rv = NS_ERROR_FAILURE;
|
||||
NS_ERROR("transform-attribute parse error");
|
||||
}
|
||||
else {
|
||||
WillModify();
|
||||
ReleaseTransforms();
|
||||
PRInt32 count = xforms.Count();
|
||||
for (PRInt32 i=0; i<count; ++i) {
|
||||
AppendElement(xforms.ObjectAt(i));
|
||||
}
|
||||
DidModify();
|
||||
}
|
||||
|
||||
nsMemory::Free(str);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTransformList::GetValueString(nsAString& aValue)
|
||||
{
|
||||
aValue.Truncate();
|
||||
|
||||
PRInt32 count = mTransforms.Count();
|
||||
|
||||
if (count<=0) return NS_OK;
|
||||
|
||||
PRInt32 i = 0;
|
||||
|
||||
while (1) {
|
||||
nsIDOMSVGTransform* transform = ElementAt(i);
|
||||
|
||||
nsCOMPtr<nsISVGValue> val = do_QueryInterface(transform);
|
||||
nsAutoString str;
|
||||
val->GetValueString(str);
|
||||
aValue.Append(str);
|
||||
|
||||
if (++i >= count) break;
|
||||
|
||||
aValue.Append(NS_LITERAL_STRING(" "));
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGTransformList methods:
|
||||
|
||||
/* readonly attribute unsigned long numberOfItems; */
|
||||
NS_IMETHODIMP nsSVGTransformList::GetNumberOfItems(PRUint32 *aNumberOfItems)
|
||||
{
|
||||
*aNumberOfItems = mTransforms.Count();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void clear (); */
|
||||
NS_IMETHODIMP nsSVGTransformList::Clear()
|
||||
{
|
||||
WillModify();
|
||||
ReleaseTransforms();
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGTransform initialize (in nsIDOMSVGTransform newItem); */
|
||||
NS_IMETHODIMP nsSVGTransformList::Initialize(nsIDOMSVGTransform *newItem, nsIDOMSVGTransform **_retval)
|
||||
{
|
||||
Clear();
|
||||
return AppendItem(newItem, _retval);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGTransform getItem (in unsigned long index); */
|
||||
NS_IMETHODIMP nsSVGTransformList::GetItem(PRUint32 index, nsIDOMSVGTransform **_retval)
|
||||
{
|
||||
if ((PRInt32)index >= mTransforms.Count()) {
|
||||
*_retval = nsnull;
|
||||
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
||||
}
|
||||
|
||||
*_retval = ElementAt(index);
|
||||
NS_ADDREF(*_retval);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGTransform insertItemBefore (in nsIDOMSVGTransform newItem, in unsigned long index); */
|
||||
NS_IMETHODIMP nsSVGTransformList::InsertItemBefore(nsIDOMSVGTransform *newItem, PRUint32 index, nsIDOMSVGTransform **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGTransform replaceItem (in nsIDOMSVGTransform newItem, in unsigned long index); */
|
||||
NS_IMETHODIMP nsSVGTransformList::ReplaceItem(nsIDOMSVGTransform *newItem, PRUint32 index, nsIDOMSVGTransform **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGTransform removeItem (in unsigned long index); */
|
||||
NS_IMETHODIMP nsSVGTransformList::RemoveItem(PRUint32 index, nsIDOMSVGTransform **_retval)
|
||||
{
|
||||
if ((PRInt32)index >= mTransforms.Count()) {
|
||||
*_retval = nsnull;
|
||||
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
||||
}
|
||||
|
||||
*_retval = ElementAt(index);
|
||||
NS_ADDREF(*_retval);
|
||||
WillModify();
|
||||
RemoveElementAt(index);
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGTransform appendItem (in nsIDOMSVGTransform newItem); */
|
||||
NS_IMETHODIMP nsSVGTransformList::AppendItem(nsIDOMSVGTransform *newItem, nsIDOMSVGTransform **_retval)
|
||||
{
|
||||
// XXX The SVG specs state that 'if newItem is already in a list, it
|
||||
// is removed from its previous list before it is inserted into this
|
||||
// list'. We don't do that. Should we?
|
||||
|
||||
*_retval = newItem;
|
||||
NS_ADDREF(*_retval);
|
||||
AppendElement(newItem);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGTransform createSVGTransformFromMatrix (in nsIDOMSVGMatrix matrix); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGTransformList::CreateSVGTransformFromMatrix(nsIDOMSVGMatrix *matrix,
|
||||
nsIDOMSVGTransform **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGTransform consolidate (); */
|
||||
NS_IMETHODIMP nsSVGTransformList::Consolidate(nsIDOMSVGTransform **_retval)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGMatrix getConsolidation (); */
|
||||
NS_IMETHODIMP nsSVGTransformList::GetConsolidation(nsIDOMSVGMatrix **_retval)
|
||||
{
|
||||
PRInt32 count = mTransforms.Count();
|
||||
|
||||
nsCOMPtr<nsIDOMSVGMatrix> consolidation;
|
||||
nsSVGMatrix::Create(getter_AddRefs(consolidation));
|
||||
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
nsIDOMSVGTransform* transform = ElementAt(i);
|
||||
nsCOMPtr<nsIDOMSVGMatrix> matrix;
|
||||
transform->GetMatrix(getter_AddRefs(matrix));
|
||||
nsCOMPtr<nsIDOMSVGMatrix> temp;
|
||||
consolidation->Multiply(matrix, getter_AddRefs(temp));
|
||||
consolidation = temp;
|
||||
}
|
||||
|
||||
*_retval = consolidation;
|
||||
NS_ADDREF(*_retval);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValueObserver methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTransformList::WillModifySVGObservable(nsISVGValue* observable)
|
||||
{
|
||||
WillModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTransformList::DidModifySVGObservable (nsISVGValue* observable)
|
||||
{
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
49
mozilla/content/svg/content/src/nsSVGTypeCIDs.h
Normal file
49
mozilla/content/svg/content/src/nsSVGTypeCIDs.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_SVGTYPECIDS_H__
|
||||
#define __NS_SVGTYPECIDS_H__
|
||||
|
||||
// {AAD39B18-B9D3-45E1-B5A6-80C0EB12B23E}
|
||||
#define NS_SVGRECT_CID \
|
||||
{ 0xaad39b18, 0xb9d3, 0x45e1, { 0xb5, 0xa6, 0x80, 0xc0, 0xeb, 0x12, 0xb2, 0x3e } }
|
||||
|
||||
#define NS_SVGRECT_CONTRACTID \
|
||||
"@mozilla.org/svg/rect;1"
|
||||
|
||||
#endif // __NS_SVGTYPECIDS_H__
|
||||
131
mozilla/content/svg/content/src/nsSVGValue.cpp
Normal file
131
mozilla/content/svg/content/src/nsSVGValue.cpp
Normal file
@@ -0,0 +1,131 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGValue.h"
|
||||
#include "nsIWeakReference.h"
|
||||
|
||||
nsSVGValue::nsSVGValue()
|
||||
: mModifyNestCount(0)
|
||||
{
|
||||
}
|
||||
|
||||
nsSVGValue::~nsSVGValue()
|
||||
{
|
||||
ReleaseObservers();
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGValue::ReleaseObservers()
|
||||
{
|
||||
PRInt32 count = mObservers.Count();
|
||||
PRInt32 i;
|
||||
for (i = 0; i < count; ++i) {
|
||||
nsIWeakReference* wr = NS_STATIC_CAST(nsIWeakReference*,mObservers.ElementAt(i));
|
||||
NS_RELEASE(wr);
|
||||
}
|
||||
while (i)
|
||||
mObservers.RemoveElementAt(--i);
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGValue::NotifyObservers(SVGObserverNotifyFunction f)
|
||||
{
|
||||
PRInt32 count = mObservers.Count();
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
nsIWeakReference* wr = NS_STATIC_CAST(nsIWeakReference*,mObservers.ElementAt(i));
|
||||
nsCOMPtr<nsISVGValueObserver> observer = do_QueryReferent(wr);
|
||||
if(observer)
|
||||
(NS_STATIC_CAST(nsISVGValueObserver*,observer)->*f)(this);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGValue::WillModify()
|
||||
{
|
||||
if (++mModifyNestCount == 1)
|
||||
NotifyObservers(&nsISVGValueObserver::WillModifySVGObservable);
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGValue::DidModify()
|
||||
{
|
||||
NS_ASSERTION(mModifyNestCount>0, "unbalanced Will/DidModify calls");
|
||||
if (--mModifyNestCount == 0) {
|
||||
OnDidModify();
|
||||
NotifyObservers(&nsISVGValueObserver::DidModifySVGObservable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGValue::AddObserver(nsISVGValueObserver* observer)
|
||||
{
|
||||
nsIWeakReference* wr = NS_GetWeakReference(observer);
|
||||
if (!wr) return NS_ERROR_FAILURE;
|
||||
mObservers.AppendElement((void*)wr);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGValue::RemoveObserver(nsISVGValueObserver* observer)
|
||||
{
|
||||
nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(observer);
|
||||
if (!wr) return NS_ERROR_FAILURE;
|
||||
PRInt32 i = mObservers.IndexOf((void*)wr);
|
||||
if (i<0) return NS_ERROR_FAILURE;
|
||||
nsIWeakReference* wr2 = NS_STATIC_CAST(nsIWeakReference*,mObservers.ElementAt(i));
|
||||
NS_RELEASE(wr2);
|
||||
mObservers.RemoveElementAt(i);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGValue::BeginBatchUpdate()
|
||||
{
|
||||
WillModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGValue::EndBatchUpdate()
|
||||
{
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
84
mozilla/content/svg/content/src/nsSVGValue.h
Normal file
84
mozilla/content/svg/content/src/nsSVGValue.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef __NS_SVGVALUE_H__
|
||||
#define __NS_SVGVALUE_H__
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsISVGValue.h"
|
||||
#include "nsGenericElement.h" // for nsSmallVoidArray
|
||||
#include "nsISVGValueObserver.h"
|
||||
|
||||
class nsSVGValue : public nsISVGValue
|
||||
{
|
||||
protected:
|
||||
nsSVGValue();
|
||||
virtual ~nsSVGValue();
|
||||
|
||||
// to be called by subclass whenever value is being modified.
|
||||
// nested calls will be ignored, so calls need to be balanced
|
||||
void WillModify();
|
||||
void DidModify();
|
||||
|
||||
public:
|
||||
// Partial Implementation of nsISVGValue interface:
|
||||
NS_IMETHOD AddObserver(nsISVGValueObserver* observer);
|
||||
NS_IMETHOD RemoveObserver(nsISVGValueObserver* observer);
|
||||
NS_IMETHOD BeginBatchUpdate();
|
||||
NS_IMETHOD EndBatchUpdate();
|
||||
|
||||
typedef
|
||||
NS_STDCALL_FUNCPROTO(nsresult,
|
||||
SVGObserverNotifyFunction,
|
||||
nsISVGValueObserver, DidModifySVGObservable,
|
||||
(nsISVGValue*));
|
||||
|
||||
protected:
|
||||
// implementation helpers
|
||||
void ReleaseObservers();
|
||||
void NotifyObservers(SVGObserverNotifyFunction f);
|
||||
PRInt32 GetModifyNestCount() { return mModifyNestCount; }
|
||||
private:
|
||||
virtual void OnDidModify(){}; // hook that will be called before observers are notified
|
||||
|
||||
nsSmallVoidArray mObservers;
|
||||
PRInt32 mModifyNestCount;
|
||||
};
|
||||
|
||||
|
||||
#endif //__NS_SVGVALUE_H__
|
||||
504
mozilla/content/svg/content/src/nsSVGViewportRect.cpp
Normal file
504
mozilla/content/svg/content/src/nsSVGViewportRect.cpp
Normal file
@@ -0,0 +1,504 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsISVGViewportAxis.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsISVGViewportRect.h"
|
||||
#include "nsSVGNumber.h"
|
||||
#include "nsISVGValue.h"
|
||||
#include "nsSVGValue.h"
|
||||
#include "nsISVGValueObserver.h"
|
||||
#include "nsISVGValueUtils.h"
|
||||
#include "nsDOMError.h"
|
||||
#include <math.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGViewportAxis : helper class implementing nsISVGViewportAxis
|
||||
|
||||
class nsSVGViewportAxis : public nsISVGViewportAxis
|
||||
// ,public nsISVGValueObserver,
|
||||
// public nsSupportsWeakReference
|
||||
{
|
||||
protected:
|
||||
friend nsresult NS_NewSVGViewportAxis(nsISVGViewportAxis **result,
|
||||
nsIDOMSVGNumber* scale,
|
||||
nsIDOMSVGNumber* length);
|
||||
nsSVGViewportAxis();
|
||||
nsresult Init(nsIDOMSVGNumber* scale, nsIDOMSVGNumber* length);
|
||||
|
||||
public:
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsISVGViewportAxis methods:
|
||||
NS_IMETHOD GetMillimeterPerPixel(nsIDOMSVGNumber **scale);
|
||||
NS_IMETHOD GetLength(nsIDOMSVGNumber **length);
|
||||
|
||||
// nsISVGValueObserver
|
||||
// NS_IMETHOD WillModifySVGObservable(nsISVGValue* observable);
|
||||
// NS_IMETHOD DidModifySVGObservable (nsISVGValue* observable);
|
||||
|
||||
// nsISupportsWeakReference
|
||||
// implementation inherited from nsSupportsWeakReference
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIDOMSVGNumber> mScale;
|
||||
nsCOMPtr<nsIDOMSVGNumber> mLength;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsresult
|
||||
NS_NewSVGViewportAxis(nsISVGViewportAxis **result, nsIDOMSVGNumber* scale,
|
||||
nsIDOMSVGNumber* length)
|
||||
{
|
||||
*result = nsnull;
|
||||
nsSVGViewportAxis *va = new nsSVGViewportAxis();
|
||||
NS_ENSURE_TRUE(va, NS_ERROR_OUT_OF_MEMORY);
|
||||
NS_ADDREF(va);
|
||||
|
||||
nsresult rv = va->Init(scale, length);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(va);
|
||||
return rv;
|
||||
}
|
||||
|
||||
*result = va;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsSVGViewportAxis::nsSVGViewportAxis()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsSVGViewportAxis::Init(nsIDOMSVGNumber* scale,
|
||||
nsIDOMSVGNumber* length)
|
||||
{
|
||||
mScale = scale;
|
||||
mLength = length;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGViewportAxis)
|
||||
NS_IMPL_RELEASE(nsSVGViewportAxis)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGViewportAxis)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGViewportAxis)
|
||||
// NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
// NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGViewportAxis)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGViewportAxis methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportAxis::GetMillimeterPerPixel(nsIDOMSVGNumber **scale)
|
||||
{
|
||||
*scale = mScale;
|
||||
NS_ADDREF(*scale);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportAxis::GetLength(nsIDOMSVGNumber **length)
|
||||
{
|
||||
*length = mLength;
|
||||
NS_ADDREF(*length);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValueObserver methods
|
||||
|
||||
// NS_IMETHODIMP
|
||||
// nsSVGViewportAxis::WillModifySVGObservable(nsISVGValue* observable)
|
||||
// {
|
||||
// return NS_OK;
|
||||
// }
|
||||
|
||||
// NS_IMETHODIMP
|
||||
// nsSVGViewportAxis::DidModifySVGObservable(nsISVGValue* observable)
|
||||
// {
|
||||
// // we only listen in on changes to the length
|
||||
// UpdateLength();
|
||||
// return NS_OK;
|
||||
// }
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGViewportRect
|
||||
|
||||
|
||||
class nsSVGViewportRect : public nsISVGViewportRect,
|
||||
public nsSVGValue,
|
||||
public nsISVGValueObserver,
|
||||
public nsSupportsWeakReference
|
||||
{
|
||||
protected:
|
||||
friend nsresult
|
||||
NS_NewSVGViewportRect(nsISVGViewportRect **result,
|
||||
nsIDOMSVGNumber* scalex,
|
||||
nsIDOMSVGNumber* scaley,
|
||||
nsIDOMSVGNumber* lengthx,
|
||||
nsIDOMSVGNumber* lengthy);
|
||||
nsSVGViewportRect();
|
||||
~nsSVGViewportRect();
|
||||
nsresult Init(nsIDOMSVGNumber* scalex,
|
||||
nsIDOMSVGNumber* scaley,
|
||||
nsIDOMSVGNumber* lengthx,
|
||||
nsIDOMSVGNumber* lengthy);
|
||||
|
||||
public:
|
||||
// nsISupports interface:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsISVGViewportRect interface:
|
||||
NS_IMETHOD GetXAxis(nsISVGViewportAxis **xaxis);
|
||||
NS_IMETHOD GetYAxis(nsISVGViewportAxis **yaxis);
|
||||
NS_IMETHOD GetUnspecifiedAxis(nsISVGViewportAxis **axis);
|
||||
|
||||
// nsIDOMSVGRect interface:
|
||||
NS_DECL_NSIDOMSVGRECT
|
||||
|
||||
// nsISVGValue interface:
|
||||
NS_IMETHOD SetValueString(const nsAString& aValue);
|
||||
NS_IMETHOD GetValueString(nsAString& aValue);
|
||||
|
||||
// nsISVGValueObserver interface:
|
||||
NS_IMETHOD WillModifySVGObservable(nsISVGValue* observable);
|
||||
NS_IMETHOD DidModifySVGObservable (nsISVGValue* observable);
|
||||
|
||||
// nsISupportsWeakReference
|
||||
// implementation inherited from nsSupportsWeakReference
|
||||
|
||||
protected:
|
||||
void UpdateGenericAxisScale();
|
||||
void UpdateGenericAxisLength();
|
||||
|
||||
private:
|
||||
virtual void OnDidModify();
|
||||
|
||||
nsCOMPtr<nsISVGViewportAxis> mAxisX;
|
||||
nsCOMPtr<nsISVGViewportAxis> mAxisY;
|
||||
nsCOMPtr<nsISVGViewportAxis> mAxisUnspecified;
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// implementation:
|
||||
|
||||
nsresult
|
||||
NS_NewSVGViewportRect(nsISVGViewportRect **result,
|
||||
nsIDOMSVGNumber* scalex,
|
||||
nsIDOMSVGNumber* scaley,
|
||||
nsIDOMSVGNumber* lengthx,
|
||||
nsIDOMSVGNumber* lengthy)
|
||||
{
|
||||
*result = nsnull;
|
||||
|
||||
nsSVGViewportRect *vr = new nsSVGViewportRect();
|
||||
if (!vr) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(vr);
|
||||
nsresult rv = vr->Init(scalex, scaley, lengthx, lengthy);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(vr);
|
||||
return rv;
|
||||
}
|
||||
|
||||
*result = vr;
|
||||
return NS_OK;
|
||||
|
||||
}
|
||||
|
||||
nsSVGViewportRect::nsSVGViewportRect()
|
||||
{
|
||||
}
|
||||
|
||||
nsSVGViewportRect::~nsSVGViewportRect()
|
||||
{
|
||||
if (mAxisX) {
|
||||
nsCOMPtr<nsIDOMSVGNumber> l;
|
||||
mAxisX->GetLength(getter_AddRefs(l));
|
||||
NS_REMOVE_SVGVALUE_OBSERVER(l);
|
||||
|
||||
nsCOMPtr<nsIDOMSVGNumber> s;
|
||||
mAxisX->GetMillimeterPerPixel(getter_AddRefs(s));
|
||||
NS_REMOVE_SVGVALUE_OBSERVER(s);
|
||||
}
|
||||
|
||||
if (mAxisY) {
|
||||
nsCOMPtr<nsIDOMSVGNumber> l;
|
||||
mAxisY->GetLength(getter_AddRefs(l));
|
||||
NS_REMOVE_SVGVALUE_OBSERVER(l);
|
||||
|
||||
nsCOMPtr<nsIDOMSVGNumber> s;
|
||||
mAxisY->GetMillimeterPerPixel(getter_AddRefs(s));
|
||||
NS_REMOVE_SVGVALUE_OBSERVER(s);
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsSVGViewportRect::Init(nsIDOMSVGNumber* scalex, nsIDOMSVGNumber* scaley,
|
||||
nsIDOMSVGNumber* lengthx, nsIDOMSVGNumber* lengthy)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
rv = NS_NewSVGViewportAxis(getter_AddRefs(mAxisX), scalex,lengthx);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
rv = NS_NewSVGViewportAxis(getter_AddRefs(mAxisY), scaley,lengthy);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGNumber> sqrt_scale;
|
||||
rv = NS_NewSVGNumber(getter_AddRefs(sqrt_scale));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
nsCOMPtr<nsIDOMSVGNumber> sqrt_length;
|
||||
rv = NS_NewSVGNumber(getter_AddRefs(sqrt_length));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = NS_NewSVGViewportAxis(getter_AddRefs(mAxisUnspecified),
|
||||
sqrt_scale,sqrt_length);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
UpdateGenericAxisScale();
|
||||
UpdateGenericAxisLength();
|
||||
}
|
||||
|
||||
NS_ADD_SVGVALUE_OBSERVER(scalex);
|
||||
NS_ADD_SVGVALUE_OBSERVER(scaley);
|
||||
NS_ADD_SVGVALUE_OBSERVER(lengthx);
|
||||
NS_ADD_SVGVALUE_OBSERVER(lengthy);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods:
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGViewportRect)
|
||||
NS_IMPL_RELEASE(nsSVGViewportRect)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGViewportRect)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValue)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGRect)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGViewportRect)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGRect)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGViewportRect methods:
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportRect::GetXAxis(nsISVGViewportAxis **xaxis)
|
||||
{
|
||||
*xaxis = mAxisX;
|
||||
NS_ADDREF(*xaxis);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportRect::GetYAxis(nsISVGViewportAxis **yaxis)
|
||||
{
|
||||
*yaxis = mAxisY;
|
||||
NS_ADDREF(*yaxis);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportRect::GetUnspecifiedAxis(nsISVGViewportAxis **axis)
|
||||
{
|
||||
*axis = mAxisUnspecified;
|
||||
NS_ADDREF(*axis);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMSVGRect methods:
|
||||
|
||||
/* attribute float x; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportRect::GetX(float *aX)
|
||||
{
|
||||
*aX = 0.0f;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportRect::SetX(float aX)
|
||||
{
|
||||
return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; // XXX return different error
|
||||
}
|
||||
|
||||
/* attribute float y; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportRect::GetY(float *aY)
|
||||
{
|
||||
*aY = 0.0f;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportRect::SetY(float aY)
|
||||
{
|
||||
return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
|
||||
}
|
||||
|
||||
/* attribute float width; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportRect::GetWidth(float *aWidth)
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGNumber> l;
|
||||
mAxisX->GetLength(getter_AddRefs(l));
|
||||
return l->GetValue(aWidth);
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportRect::SetWidth(float aWidth)
|
||||
{
|
||||
return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
|
||||
}
|
||||
|
||||
/* attribute float height; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportRect::GetHeight(float *aHeight)
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGNumber> l;
|
||||
mAxisY->GetLength(getter_AddRefs(l));
|
||||
return l->GetValue(aHeight);
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportRect::SetHeight(float aHeight)
|
||||
{
|
||||
return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValue methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportRect::SetValueString(const nsAString& aValue)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportRect::GetValueString(nsAString& aValue)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGValueObserver methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportRect::WillModifySVGObservable(nsISVGValue* observable)
|
||||
{
|
||||
WillModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGViewportRect::DidModifySVGObservable (nsISVGValue* observable)
|
||||
{
|
||||
DidModify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// helpers:
|
||||
|
||||
void nsSVGViewportRect::UpdateGenericAxisLength()
|
||||
{
|
||||
float x;
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGNumber> l_x;
|
||||
mAxisX->GetLength(getter_AddRefs(l_x));
|
||||
l_x->GetValue(&x);
|
||||
}
|
||||
|
||||
float y;
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGNumber> l_y;
|
||||
mAxisY->GetLength(getter_AddRefs(l_y));
|
||||
l_y->GetValue(&y);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMSVGNumber> l_sqrt;
|
||||
mAxisUnspecified->GetLength (getter_AddRefs(l_sqrt));
|
||||
l_sqrt->SetValue((float)sqrt((x*x + y*y)/2.0f));
|
||||
}
|
||||
|
||||
void nsSVGViewportRect::UpdateGenericAxisScale()
|
||||
{
|
||||
float x;
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGNumber> s_x;
|
||||
mAxisX->GetMillimeterPerPixel(getter_AddRefs(s_x));
|
||||
s_x->GetValue(&x);
|
||||
}
|
||||
|
||||
float y;
|
||||
{
|
||||
nsCOMPtr<nsIDOMSVGNumber> s_y;
|
||||
mAxisY->GetMillimeterPerPixel(getter_AddRefs(s_y));
|
||||
s_y->GetValue(&y);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMSVGNumber> s_sqrt;
|
||||
mAxisUnspecified->GetMillimeterPerPixel(getter_AddRefs(s_sqrt));
|
||||
s_sqrt->SetValue((float)sqrt(x*x + y*y));
|
||||
}
|
||||
|
||||
void nsSVGViewportRect::OnDidModify()
|
||||
{
|
||||
UpdateGenericAxisLength();
|
||||
UpdateGenericAxisScale();
|
||||
}
|
||||
158
mozilla/content/svg/document/src/nsSVGDocument.cpp
Normal file
158
mozilla/content/svg/document/src/nsSVGDocument.cpp
Normal file
@@ -0,0 +1,158 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Bradley Baetz.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Bradley Baetz <bbaetz@cs.mcgill.ca> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsSVGDocument.h"
|
||||
#include "nsIDOMClassInfo.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIHttpChannel.h"
|
||||
#include "nsString.h"
|
||||
#include "nsLiteralString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGDocument)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGDocument)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentEvent)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGDocument)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsXMLDocument)
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsSVGDocument, nsXMLDocument)
|
||||
NS_IMPL_RELEASE_INHERITED(nsSVGDocument, nsXMLDocument)
|
||||
|
||||
nsSVGDocument::nsSVGDocument() {
|
||||
|
||||
}
|
||||
|
||||
nsSVGDocument::~nsSVGDocument() {
|
||||
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsSVGDocument::StartDocumentLoad(const char* aCommand,
|
||||
nsIChannel* aChannel,
|
||||
nsILoadGroup* aLoadGroup,
|
||||
nsISupports* aContainer,
|
||||
nsIStreamListener **aDocListener,
|
||||
PRBool aReset,
|
||||
nsIContentSink* aSink) {
|
||||
nsresult rv = nsXMLDocument::StartDocumentLoad(aCommand,
|
||||
aChannel,
|
||||
aLoadGroup,
|
||||
aContainer,
|
||||
aDocListener,
|
||||
aReset,
|
||||
aSink);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
|
||||
if (httpChannel) {
|
||||
nsCAutoString referrer;
|
||||
rv = httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("referrer"), referrer);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
CopyUTF8toUTF16(referrer, mReferrer);
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// nsIDOMSVGDocument
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGDocument::GetTitle(nsAString& aTitle) {
|
||||
return nsXMLDocument::GetTitle(aTitle);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGDocument::GetReferrer(nsAString& aReferrer) {
|
||||
aReferrer.Assign(mReferrer);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGDocument::GetDomain(nsAString& aDomain) {
|
||||
nsCAutoString domain;
|
||||
|
||||
if (mDocumentURI) {
|
||||
nsresult rv = mDocumentURI->GetHost(domain);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
CopyUTF8toUTF16(domain, aDomain);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGDocument::GetURL(nsAString& aURL) {
|
||||
nsCAutoString url;
|
||||
|
||||
if (mDocumentURI) {
|
||||
nsresult rv = mDocumentURI->GetSpec(url);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
CopyUTF8toUTF16(url, aURL);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGDocument::GetRootElement(nsIDOMSVGSVGElement** aRootElement) {
|
||||
NS_NOTYETIMPLEMENTED("nsSVGDocument::GetRootElement");
|
||||
// XXX - writeme
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewSVGDocument(nsIDocument** aInstancePtrResult)
|
||||
{
|
||||
nsSVGDocument* doc = new nsSVGDocument();
|
||||
|
||||
NS_ENSURE_TRUE(doc, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
NS_ADDREF(doc);
|
||||
nsresult rv = doc->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(doc);
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aInstancePtrResult = doc;
|
||||
return rv;
|
||||
}
|
||||
74
mozilla/content/svg/document/src/nsSVGDocument.h
Normal file
74
mozilla/content/svg/document/src/nsSVGDocument.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Bradley Baetz.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Bradley Baetz <bbaetz@cs.mcgill.ca> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#ifndef nsSVGDocument_h__
|
||||
#define nsSVGDocument_h__
|
||||
|
||||
#include "nsXMLDocument.h"
|
||||
#include "nsIDOMSVGDocument.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIURI.h"
|
||||
|
||||
class nsSVGDocument : public nsXMLDocument,
|
||||
public nsIDOMSVGDocument
|
||||
{
|
||||
public:
|
||||
nsSVGDocument();
|
||||
virtual ~nsSVGDocument();
|
||||
|
||||
// Most methods will just fall through to the XMLDocument
|
||||
|
||||
virtual nsresult StartDocumentLoad(const char* aCommand,
|
||||
nsIChannel* aChannel,
|
||||
nsILoadGroup* aLoadGroup,
|
||||
nsISupports* aContainer,
|
||||
nsIStreamListener **aDocListener,
|
||||
PRBool aReset = PR_TRUE,
|
||||
nsIContentSink* aSink = nsnull);
|
||||
|
||||
NS_DECL_NSIDOMSVGDOCUMENT
|
||||
NS_FORWARD_NSIDOMDOCUMENT(nsXMLDocument::)
|
||||
NS_FORWARD_NSIDOMNODE(nsXMLDocument::)
|
||||
NS_FORWARD_NSIDOMDOCUMENTEVENT(nsXMLDocument::)
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
protected:
|
||||
nsString mReferrer;
|
||||
};
|
||||
|
||||
#endif
|
||||
80
mozilla/dom/public/idl/svg/Makefile.in
Normal file
80
mozilla/dom/public/idl/svg/Makefile.in
Normal file
@@ -0,0 +1,80 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Crocodile Clips Ltd code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Crocodile Clips Ltd. Portions created by Crocodile Clips are
|
||||
# Copyright (C) 2001 Crocodile Clips Ltd. All
|
||||
# Rights Reserved.
|
||||
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = dom
|
||||
XPIDL_MODULE = dom_svg
|
||||
|
||||
|
||||
XPIDLSRCS = \
|
||||
nsIDOMSVGAnimatedEnum.idl \
|
||||
nsIDOMSVGAnimatedLength.idl \
|
||||
nsIDOMSVGAnimatedLengthList.idl \
|
||||
nsIDOMSVGAnimatedNumberList.idl \
|
||||
nsIDOMSVGAnimatedPathData.idl \
|
||||
nsIDOMSVGAnimatedPoints.idl \
|
||||
nsIDOMSVGAnimatedString.idl \
|
||||
nsIDOMSVGAnimPresAspRatio.idl \
|
||||
nsIDOMSVGAnimatedRect.idl \
|
||||
nsIDOMSVGAnimTransformList.idl \
|
||||
nsIDOMSVGCircleElement.idl \
|
||||
nsIDOMSVGDocument.idl \
|
||||
nsIDOMSVGElement.idl \
|
||||
nsIDOMSVGEllipseElement.idl \
|
||||
nsIDOMSVGFitToViewBox.idl \
|
||||
nsIDOMSVGForeignObjectElem.idl \
|
||||
nsIDOMSVGGElement.idl \
|
||||
nsIDOMSVGImageElement.idl \
|
||||
nsIDOMSVGLength.idl \
|
||||
nsIDOMSVGLengthList.idl \
|
||||
nsIDOMSVGLineElement.idl \
|
||||
nsIDOMSVGLocatable.idl \
|
||||
nsIDOMSVGMatrix.idl \
|
||||
nsIDOMSVGNumber.idl \
|
||||
nsIDOMSVGNumberList.idl \
|
||||
nsIDOMSVGPathElement.idl \
|
||||
nsIDOMSVGPathSeg.idl \
|
||||
nsIDOMSVGPathSegList.idl \
|
||||
nsIDOMSVGPoint.idl \
|
||||
nsIDOMSVGPointList.idl \
|
||||
nsIDOMSVGPolygonElement.idl \
|
||||
nsIDOMSVGPolylineElement.idl \
|
||||
nsIDOMSVGPresAspectRatio.idl \
|
||||
nsIDOMSVGRect.idl \
|
||||
nsIDOMSVGRectElement.idl \
|
||||
nsIDOMSVGSVGElement.idl \
|
||||
nsIDOMSVGStylable.idl \
|
||||
nsIDOMSVGTextContentElement.idl \
|
||||
nsIDOMSVGTextElement.idl \
|
||||
nsIDOMSVGTextPositionElem.idl \
|
||||
nsIDOMSVGTransform.idl \
|
||||
nsIDOMSVGTransformList.idl \
|
||||
nsIDOMSVGTransformable.idl \
|
||||
nsIDOMSVGTSpanElement.idl \
|
||||
nsIDOMSVGURIReference.idl \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
48
mozilla/dom/public/idl/svg/nsIDOMSVGAnimatedString.idl
Normal file
48
mozilla/dom/public/idl/svg/nsIDOMSVGAnimatedString.idl
Normal file
@@ -0,0 +1,48 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
[scriptable, uuid(36f18f12-61a9-4529-8fa9-30050bd6ac00)]
|
||||
interface nsIDOMSVGAnimatedString
|
||||
: nsISupports
|
||||
{
|
||||
attribute DOMString baseVal;
|
||||
// raises DOMException on setting
|
||||
readonly attribute DOMString animVal;
|
||||
};
|
||||
68
mozilla/dom/public/idl/svg/nsIDOMSVGImageElement.idl
Normal file
68
mozilla/dom/public/idl/svg/nsIDOMSVGImageElement.idl
Normal file
@@ -0,0 +1,68 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsIDOMSVGElement.idl"
|
||||
|
||||
interface nsIDOMSVGAnimatedLength;
|
||||
interface nsIDOMSVGAnimatedPreserveAspectRatio;
|
||||
|
||||
[scriptable, uuid(43ae4efe-2610-4cce-8242-279e556a78fa)]
|
||||
interface nsIDOMSVGImageElement
|
||||
: nsIDOMSVGElement
|
||||
/*
|
||||
The SVG DOM makes use of multiple interface inheritance.
|
||||
Since XPCOM only supports single interface inheritance,
|
||||
the best thing that we can do is to promise that whenever
|
||||
an object implements _this_ interface it will also
|
||||
implement the following interfaces. (We then have to QI to
|
||||
hop between them.)
|
||||
nsIDOMSVGURIReference,
|
||||
nsIDOMSVGTests,
|
||||
nsIDOMSVGLangSpace,
|
||||
nsIDOMSVGExternalResourcesRequired,
|
||||
nsIDOMSVGStylable,
|
||||
nsIDOMSVGTransformable,
|
||||
events::nsIDOMEventTarget
|
||||
*/
|
||||
{
|
||||
readonly attribute nsIDOMSVGAnimatedLength x;
|
||||
readonly attribute nsIDOMSVGAnimatedLength y;
|
||||
readonly attribute nsIDOMSVGAnimatedLength width;
|
||||
readonly attribute nsIDOMSVGAnimatedLength height;
|
||||
readonly attribute nsIDOMSVGAnimatedPreserveAspectRatio preserveAspectRatio;
|
||||
};
|
||||
48
mozilla/dom/public/idl/svg/nsIDOMSVGURIReference.idl
Normal file
48
mozilla/dom/public/idl/svg/nsIDOMSVGURIReference.idl
Normal file
@@ -0,0 +1,48 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla SVG project.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Crocodile Clips Ltd..
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMSVGAnimatedString;
|
||||
|
||||
[scriptable, uuid(8092b5f3-dc8a-459c-94f1-92f8011f2438)]
|
||||
interface nsIDOMSVGURIReference
|
||||
: nsISupports
|
||||
{
|
||||
readonly attribute nsIDOMSVGAnimatedString href;
|
||||
};
|
||||
474
mozilla/dom/public/nsIDOMClassInfo.h
Normal file
474
mozilla/dom/public/nsIDOMClassInfo.h
Normal file
@@ -0,0 +1,474 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Johnny Stenback <jst@netscape.com> (original author)
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef nsIDOMClassInfo_h___
|
||||
#define nsIDOMClassInfo_h___
|
||||
|
||||
#include "nsIClassInfo.h"
|
||||
#include "nsVoidArray.h"
|
||||
|
||||
enum nsDOMClassInfoID {
|
||||
// Base classes
|
||||
eDOMClassInfo_Window_id,
|
||||
eDOMClassInfo_Location_id,
|
||||
eDOMClassInfo_Navigator_id,
|
||||
eDOMClassInfo_Plugin_id,
|
||||
eDOMClassInfo_PluginArray_id,
|
||||
eDOMClassInfo_MimeType_id,
|
||||
eDOMClassInfo_MimeTypeArray_id,
|
||||
eDOMClassInfo_BarProp_id,
|
||||
eDOMClassInfo_History_id,
|
||||
eDOMClassInfo_Screen_id,
|
||||
|
||||
// Core classes
|
||||
eDOMClassInfo_XMLDocument_id,
|
||||
eDOMClassInfo_DocumentType_id,
|
||||
eDOMClassInfo_DOMImplementation_id,
|
||||
eDOMClassInfo_DOMException_id,
|
||||
eDOMClassInfo_DocumentFragment_id,
|
||||
eDOMClassInfo_Element_id,
|
||||
eDOMClassInfo_Attr_id,
|
||||
eDOMClassInfo_Text_id,
|
||||
eDOMClassInfo_Comment_id,
|
||||
eDOMClassInfo_CDATASection_id,
|
||||
eDOMClassInfo_ProcessingInstruction_id,
|
||||
eDOMClassInfo_Entity_id,
|
||||
eDOMClassInfo_EntityReference_id,
|
||||
eDOMClassInfo_Notation_id,
|
||||
eDOMClassInfo_NodeList_id,
|
||||
eDOMClassInfo_NamedNodeMap_id,
|
||||
|
||||
// StyleSheet classes
|
||||
eDOMClassInfo_DocumentStyleSheetList_id,
|
||||
|
||||
// Event classes
|
||||
eDOMClassInfo_Event_id,
|
||||
eDOMClassInfo_MutationEvent_id,
|
||||
|
||||
// HTML classes
|
||||
eDOMClassInfo_HTMLDocument_id,
|
||||
eDOMClassInfo_HTMLCollection_id,
|
||||
eDOMClassInfo_HTMLOptionsCollection_id,
|
||||
eDOMClassInfo_HTMLFormControlCollection_id,
|
||||
eDOMClassInfo_HTMLGenericCollection_id,
|
||||
|
||||
// HTML element classes
|
||||
eDOMClassInfo_HTMLAnchorElement_id,
|
||||
eDOMClassInfo_HTMLAppletElement_id,
|
||||
eDOMClassInfo_HTMLAreaElement_id,
|
||||
eDOMClassInfo_HTMLBRElement_id,
|
||||
eDOMClassInfo_HTMLBaseElement_id,
|
||||
eDOMClassInfo_HTMLBaseFontElement_id,
|
||||
eDOMClassInfo_HTMLBodyElement_id,
|
||||
eDOMClassInfo_HTMLButtonElement_id,
|
||||
eDOMClassInfo_HTMLDListElement_id,
|
||||
eDOMClassInfo_HTMLDelElement_id,
|
||||
eDOMClassInfo_HTMLDirectoryElement_id,
|
||||
eDOMClassInfo_HTMLDivElement_id,
|
||||
eDOMClassInfo_HTMLEmbedElement_id,
|
||||
eDOMClassInfo_HTMLFieldSetElement_id,
|
||||
eDOMClassInfo_HTMLFontElement_id,
|
||||
eDOMClassInfo_HTMLFormElement_id,
|
||||
eDOMClassInfo_HTMLFrameElement_id,
|
||||
eDOMClassInfo_HTMLFrameSetElement_id,
|
||||
eDOMClassInfo_HTMLHRElement_id,
|
||||
eDOMClassInfo_HTMLHeadElement_id,
|
||||
eDOMClassInfo_HTMLHeadingElement_id,
|
||||
eDOMClassInfo_HTMLHtmlElement_id,
|
||||
eDOMClassInfo_HTMLIFrameElement_id,
|
||||
eDOMClassInfo_HTMLImageElement_id,
|
||||
eDOMClassInfo_HTMLInputElement_id,
|
||||
eDOMClassInfo_HTMLInsElement_id,
|
||||
eDOMClassInfo_HTMLIsIndexElement_id,
|
||||
eDOMClassInfo_HTMLLIElement_id,
|
||||
eDOMClassInfo_HTMLLabelElement_id,
|
||||
eDOMClassInfo_HTMLLegendElement_id,
|
||||
eDOMClassInfo_HTMLLinkElement_id,
|
||||
eDOMClassInfo_HTMLMapElement_id,
|
||||
eDOMClassInfo_HTMLMenuElement_id,
|
||||
eDOMClassInfo_HTMLMetaElement_id,
|
||||
eDOMClassInfo_HTMLModElement_id,
|
||||
eDOMClassInfo_HTMLOListElement_id,
|
||||
eDOMClassInfo_HTMLObjectElement_id,
|
||||
eDOMClassInfo_HTMLOptGroupElement_id,
|
||||
eDOMClassInfo_HTMLOptionElement_id,
|
||||
eDOMClassInfo_HTMLParagraphElement_id,
|
||||
eDOMClassInfo_HTMLParamElement_id,
|
||||
eDOMClassInfo_HTMLPreElement_id,
|
||||
eDOMClassInfo_HTMLQuoteElement_id,
|
||||
eDOMClassInfo_HTMLScriptElement_id,
|
||||
eDOMClassInfo_HTMLSelectElement_id,
|
||||
eDOMClassInfo_HTMLSpacerElement_id,
|
||||
eDOMClassInfo_HTMLSpanElement_id,
|
||||
eDOMClassInfo_HTMLStyleElement_id,
|
||||
eDOMClassInfo_HTMLTableCaptionElement_id,
|
||||
eDOMClassInfo_HTMLTableCellElement_id,
|
||||
eDOMClassInfo_HTMLTableColElement_id,
|
||||
eDOMClassInfo_HTMLTableColGroupElement_id,
|
||||
eDOMClassInfo_HTMLTableElement_id,
|
||||
eDOMClassInfo_HTMLTableRowElement_id,
|
||||
eDOMClassInfo_HTMLTableSectionElement_id,
|
||||
eDOMClassInfo_HTMLTextAreaElement_id,
|
||||
eDOMClassInfo_HTMLTitleElement_id,
|
||||
eDOMClassInfo_HTMLUListElement_id,
|
||||
eDOMClassInfo_HTMLUnknownElement_id,
|
||||
eDOMClassInfo_HTMLWBRElement_id,
|
||||
|
||||
// CSS classes
|
||||
eDOMClassInfo_CSSStyleRule_id,
|
||||
eDOMClassInfo_CSSCharsetRule_id,
|
||||
eDOMClassInfo_CSSImportRule_id,
|
||||
eDOMClassInfo_CSSMediaRule_id,
|
||||
eDOMClassInfo_CSSNameSpaceRule_id,
|
||||
eDOMClassInfo_CSSRuleList_id,
|
||||
eDOMClassInfo_CSSGroupRuleRuleList_id,
|
||||
eDOMClassInfo_MediaList_id,
|
||||
eDOMClassInfo_StyleSheetList_id,
|
||||
eDOMClassInfo_CSSStyleSheet_id,
|
||||
eDOMClassInfo_CSSStyleDeclaration_id,
|
||||
eDOMClassInfo_ComputedCSSStyleDeclaration_id,
|
||||
eDOMClassInfo_ROCSSPrimitiveValue_id,
|
||||
|
||||
// Range classes
|
||||
eDOMClassInfo_Range_id,
|
||||
eDOMClassInfo_Selection_id,
|
||||
|
||||
// XUL classes
|
||||
#ifdef MOZ_XUL
|
||||
eDOMClassInfo_XULDocument_id,
|
||||
eDOMClassInfo_XULElement_id,
|
||||
eDOMClassInfo_XULCommandDispatcher_id,
|
||||
eDOMClassInfo_XULNodeList_id,
|
||||
eDOMClassInfo_XULNamedNodeMap_id,
|
||||
eDOMClassInfo_XULAttr_id,
|
||||
#endif
|
||||
eDOMClassInfo_XULControllers_id,
|
||||
#ifdef MOZ_XUL
|
||||
eDOMClassInfo_BoxObject_id,
|
||||
eDOMClassInfo_TreeSelection_id,
|
||||
eDOMClassInfo_TreeContentView_id,
|
||||
#endif
|
||||
|
||||
// Crypto classes
|
||||
eDOMClassInfo_Crypto_id,
|
||||
eDOMClassInfo_CRMFObject_id,
|
||||
eDOMClassInfo_Pkcs11_id,
|
||||
|
||||
// DOM Traversal classes
|
||||
eDOMClassInfo_TreeWalker_id,
|
||||
|
||||
// We are now trying to preserve binary compat in classinfo. No
|
||||
// more putting things in those categories up there. New entries
|
||||
// are to be added right before eDOMClassInfoIDCount
|
||||
|
||||
// Rect object used by getComputedStyle
|
||||
eDOMClassInfo_CSSRect_id,
|
||||
|
||||
// DOM Chrome Window class, almost identical to Window
|
||||
eDOMClassInfo_ChromeWindow_id,
|
||||
|
||||
// RGBColor object used by getComputedStyle
|
||||
eDOMClassInfo_CSSRGBColor_id,
|
||||
|
||||
eDOMClassInfo_RangeException_id,
|
||||
|
||||
// CSSValueList object that represents an nsIDOMCSSValueList, used
|
||||
// by DOM CSS
|
||||
eDOMClassInfo_CSSValueList_id,
|
||||
|
||||
// ContentList object used for various live NodeLists
|
||||
eDOMClassInfo_ContentList_id,
|
||||
|
||||
// Processing-instruction with target "xml-stylesheet"
|
||||
eDOMClassInfo_XMLStylesheetProcessingInstruction_id,
|
||||
|
||||
eDOMClassInfo_ImageDocument_id,
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
eDOMClassInfo_XULTreeBuilder_id,
|
||||
#endif
|
||||
|
||||
// DOMStringList object
|
||||
eDOMClassInfo_DOMStringList_id,
|
||||
|
||||
// NameList object used by the DOM
|
||||
eDOMClassInfo_NameList_id,
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
// The SVG document
|
||||
eDOMClassInfo_SVGDocument_id,
|
||||
|
||||
// SVG element classes
|
||||
eDOMClassInfo_SVGSVGElement_id,
|
||||
eDOMClassInfo_SVGPolygonElement_id,
|
||||
eDOMClassInfo_SVGPolylineElement_id,
|
||||
eDOMClassInfo_SVGCircleElement_id,
|
||||
eDOMClassInfo_SVGEllipseElement_id,
|
||||
eDOMClassInfo_SVGLineElement_id,
|
||||
eDOMClassInfo_SVGRectElement_id,
|
||||
eDOMClassInfo_SVGGElement_id,
|
||||
eDOMClassInfo_SVGForeignObjectElement_id,
|
||||
eDOMClassInfo_SVGPathElement_id,
|
||||
|
||||
// other SVG classes
|
||||
eDOMClassInfo_SVGAnimatedLength_id,
|
||||
eDOMClassInfo_SVGLength_id,
|
||||
eDOMClassInfo_SVGAnimatedPoints_id,
|
||||
eDOMClassInfo_SVGPointList_id,
|
||||
eDOMClassInfo_SVGPoint_id,
|
||||
eDOMClassInfo_SVGAnimatedTransformList_id,
|
||||
eDOMClassInfo_SVGTransformList_id,
|
||||
eDOMClassInfo_SVGTransform_id,
|
||||
eDOMClassInfo_SVGMatrix_id,
|
||||
eDOMClassInfo_SVGPathSegList_id,
|
||||
eDOMClassInfo_SVGPathSegClosePath_id,
|
||||
eDOMClassInfo_SVGPathSegMovetoAbs_id,
|
||||
eDOMClassInfo_SVGPathSegMovetoRel_id,
|
||||
eDOMClassInfo_SVGPathSegLinetoAbs_id,
|
||||
eDOMClassInfo_SVGPathSegLinetoRel_id,
|
||||
eDOMClassInfo_SVGPathSegCurvetoCubicAbs_id,
|
||||
eDOMClassInfo_SVGPathSegCurvetoCubicRel_id,
|
||||
eDOMClassInfo_SVGPathSegCurvetoQuadraticAbs_id,
|
||||
eDOMClassInfo_SVGPathSegCurvetoQuadraticRel_id,
|
||||
eDOMClassInfo_SVGPathSegArcAbs_id,
|
||||
eDOMClassInfo_SVGPathSegArcRel_id,
|
||||
eDOMClassInfo_SVGPathSegLinetoHorizontalAbs_id,
|
||||
eDOMClassInfo_SVGPathSegLinetoHorizontalRel_id,
|
||||
eDOMClassInfo_SVGPathSegLinetoVerticalAbs_id,
|
||||
eDOMClassInfo_SVGPathSegLinetoVerticalRel_id,
|
||||
eDOMClassInfo_SVGPathSegCurvetoCubicSmoothAbs_id,
|
||||
eDOMClassInfo_SVGPathSegCurvetoCubicSmoothRel_id,
|
||||
eDOMClassInfo_SVGPathSegCurvetoQuadraticSmoothAbs_id,
|
||||
eDOMClassInfo_SVGPathSegCurvetoQuadraticSmoothRel_id,
|
||||
eDOMClassInfo_SVGRect_id,
|
||||
eDOMClassInfo_SVGAnimatedRect_id,
|
||||
eDOMClassInfo_SVGAnimatedLengthList_id,
|
||||
eDOMClassInfo_SVGLengthList_id,
|
||||
eDOMClassInfo_SVGNumber_id,
|
||||
eDOMClassInfo_SVGTextElement_id,
|
||||
eDOMClassInfo_SVGTSpanElement_id,
|
||||
eDOMClassInfo_SVGAnimatedString_id,
|
||||
eDOMClassInfo_SVGImageElement_id,
|
||||
#endif //MOZ_SVG
|
||||
|
||||
// This one better be the last one in this list
|
||||
eDOMClassInfoIDCount
|
||||
};
|
||||
|
||||
#include "nsIXPCScriptable.h"
|
||||
|
||||
#define DEFAULT_SCRIPTABLE_FLAGS \
|
||||
(nsIXPCScriptable::USE_JSSTUB_FOR_ADDPROPERTY | \
|
||||
nsIXPCScriptable::USE_JSSTUB_FOR_DELPROPERTY | \
|
||||
nsIXPCScriptable::USE_JSSTUB_FOR_SETPROPERTY | \
|
||||
nsIXPCScriptable::ALLOW_PROP_MODS_DURING_RESOLVE | \
|
||||
nsIXPCScriptable::ALLOW_PROP_MODS_TO_PROTOTYPE | \
|
||||
nsIXPCScriptable::DONT_ASK_INSTANCE_FOR_SCRIPTABLE | \
|
||||
nsIXPCScriptable::DONT_REFLECT_INTERFACE_NAMES | \
|
||||
nsIXPCScriptable::WANT_NEWRESOLVE | \
|
||||
nsIXPCScriptable::WANT_CHECKACCESS | \
|
||||
nsIXPCScriptable::WANT_POSTCREATE)
|
||||
|
||||
#define DOM_DEFAULT_SCRIPTABLE_FLAGS \
|
||||
(DEFAULT_SCRIPTABLE_FLAGS | \
|
||||
nsIXPCScriptable::DONT_ENUM_QUERY_INTERFACE | \
|
||||
nsIXPCScriptable::CLASSINFO_INTERFACES_ONLY)
|
||||
|
||||
|
||||
typedef nsIClassInfo* (*nsDOMClassInfoExternalConstructorFnc)
|
||||
(const char* aName);
|
||||
|
||||
|
||||
/**
|
||||
* nsIClassInfo helper macros
|
||||
*/
|
||||
|
||||
#define NS_CLASSINFO_MAP_BEGIN(_class)
|
||||
|
||||
#define NS_CLASSINFO_MAP_BEGIN_EXPORTED(_class)
|
||||
|
||||
#define NS_CLASSINFO_MAP_ENTRY(_interface)
|
||||
|
||||
#define NS_CLASSINFO_MAP_ENTRY_FUNCTION(_function)
|
||||
|
||||
#define NS_CLASSINFO_MAP_END
|
||||
|
||||
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIDOMScriptObjectFactory.h"
|
||||
#include "nsDOMCID.h"
|
||||
|
||||
#define NS_INTERFACE_MAP_ENTRY_DOM_CLASSINFO(_class) \
|
||||
if (aIID.Equals(NS_GET_IID(nsIClassInfo))) { \
|
||||
static NS_DEFINE_CID(kDOMSOF_CID, NS_DOM_SCRIPT_OBJECT_FACTORY_CID); \
|
||||
\
|
||||
nsresult rv; \
|
||||
nsCOMPtr<nsIDOMScriptObjectFactory> sof(do_GetService(kDOMSOF_CID, \
|
||||
&rv)); \
|
||||
if (NS_FAILED(rv)) { \
|
||||
*aInstancePtr = nsnull; \
|
||||
return rv; \
|
||||
} \
|
||||
\
|
||||
foundInterface = \
|
||||
sof->GetClassInfoInstance(eDOMClassInfo_##_class##_id); \
|
||||
} else
|
||||
|
||||
// Looks up the nsIClassInfo for a class name registered with the
|
||||
// nsScriptNamespaceManager. Remember to release NS_CLASSINFO_NAME(_class)
|
||||
// (eg. when your module unloads).
|
||||
#define NS_INTERFACE_MAP_ENTRY_EXTERNAL_DOM_CLASSINFO(_class) \
|
||||
if (aIID.Equals(NS_GET_IID(nsIClassInfo))) { \
|
||||
extern nsISupports *NS_CLASSINFO_NAME(_class); \
|
||||
if (NS_CLASSINFO_NAME(_class)) { \
|
||||
foundInterface = NS_CLASSINFO_NAME(_class); \
|
||||
} else { \
|
||||
static NS_DEFINE_CID(kDOMSOF_CID, NS_DOM_SCRIPT_OBJECT_FACTORY_CID); \
|
||||
\
|
||||
nsresult rv; \
|
||||
nsCOMPtr<nsIDOMScriptObjectFactory> sof(do_GetService(kDOMSOF_CID, \
|
||||
&rv)); \
|
||||
if (NS_FAILED(rv)) { \
|
||||
*aInstancePtr = nsnull; \
|
||||
return rv; \
|
||||
} \
|
||||
\
|
||||
foundInterface = \
|
||||
sof->GetExternalClassInfoInstance(NS_LITERAL_STRING(#_class)); \
|
||||
\
|
||||
if (foundInterface) { \
|
||||
NS_CLASSINFO_NAME(_class) = foundInterface; \
|
||||
NS_CLASSINFO_NAME(_class)->AddRef(); \
|
||||
} \
|
||||
} \
|
||||
} else
|
||||
|
||||
|
||||
#define NS_DECL_DOM_CLASSINFO(_class) \
|
||||
nsISupports *NS_CLASSINFO_NAME(_class) = nsnull;
|
||||
|
||||
// {891a7b01-1b61-11d6-a7f2-f690b638899c}
|
||||
#define NS_IDOMCI_EXTENSION_IID \
|
||||
{ 0x891a7b01, 0x1b61, 0x11d6, \
|
||||
{ 0xa7, 0xf2, 0xf6, 0x90, 0xb6, 0x38, 0x89, 0x9c } }
|
||||
|
||||
class nsIDOMScriptObjectFactory;
|
||||
|
||||
class nsIDOMCIExtension : public nsISupports {
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDOMCI_EXTENSION_IID)
|
||||
|
||||
NS_IMETHOD RegisterDOMCI(const char* aName,
|
||||
nsIDOMScriptObjectFactory* aDOMSOFactory) = 0;
|
||||
};
|
||||
|
||||
|
||||
#define NS_DOMCI_EXTENSION_NAME(_module) ns##_module##DOMCIExtension
|
||||
#define NS_DOMCI_EXTENSION_CONSTRUCTOR(_module) \
|
||||
ns##_module##DOMCIExtensionConstructor
|
||||
#define NS_DOMCI_EXTENSION_CONSTRUCTOR_IMP(_extension) \
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(_extension)
|
||||
|
||||
#define NS_DOMCI_EXTENSION(_module) \
|
||||
class NS_DOMCI_EXTENSION_NAME(_module) : public nsIDOMCIExtension \
|
||||
{ \
|
||||
public: \
|
||||
NS_DOMCI_EXTENSION_NAME(_module)(); \
|
||||
virtual ~NS_DOMCI_EXTENSION_NAME(_module)(); \
|
||||
\
|
||||
NS_DECL_ISUPPORTS \
|
||||
\
|
||||
NS_IMETHOD RegisterDOMCI(const char* aName, \
|
||||
nsIDOMScriptObjectFactory* aDOMSOFactory); \
|
||||
}; \
|
||||
\
|
||||
NS_DOMCI_EXTENSION_CONSTRUCTOR_IMP(NS_DOMCI_EXTENSION_NAME(_module)) \
|
||||
\
|
||||
NS_DOMCI_EXTENSION_NAME(_module)::NS_DOMCI_EXTENSION_NAME(_module)() \
|
||||
{ \
|
||||
} \
|
||||
\
|
||||
NS_DOMCI_EXTENSION_NAME(_module)::~NS_DOMCI_EXTENSION_NAME(_module)() \
|
||||
{ \
|
||||
} \
|
||||
\
|
||||
NS_IMPL_ISUPPORTS1(NS_DOMCI_EXTENSION_NAME(_module), nsIDOMCIExtension) \
|
||||
\
|
||||
NS_IMETHODIMP \
|
||||
NS_DOMCI_EXTENSION_NAME(_module)::RegisterDOMCI(const char* aName, \
|
||||
nsIDOMScriptObjectFactory* aDOMSOFactory) \
|
||||
{
|
||||
|
||||
#define NS_DOMCI_EXTENSION_ENTRY_BEGIN(_class) \
|
||||
if (nsCRT::strcmp(aName, #_class) == 0) { \
|
||||
static const nsIID* interfaces[] = {
|
||||
|
||||
#define NS_DOMCI_EXTENSION_ENTRY_INTERFACE(_interface) \
|
||||
&NS_GET_IID(_interface),
|
||||
|
||||
// Don't forget to register the primary interface (_proto) in the
|
||||
// JAVASCRIPT_DOM_INTERFACE category, or prototypes for this class
|
||||
// won't work (except if the interface name starts with nsIDOM).
|
||||
#define NS_DOMCI_EXTENSION_ENTRY_END_HELPER(_class, _proto, _hasclassif, \
|
||||
_constructorcid) \
|
||||
nsnull \
|
||||
}; \
|
||||
aDOMSOFactory->RegisterDOMClassInfo(#_class, nsnull, _proto, \
|
||||
interfaces, \
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS, \
|
||||
_hasclassif, _constructorcid); \
|
||||
return NS_OK; \
|
||||
}
|
||||
|
||||
#define NS_DOMCI_EXTENSION_ENTRY_END(_class, _proto, _hasclassif, \
|
||||
_constructorcid) \
|
||||
NS_DOMCI_EXTENSION_ENTRY_END_HELPER(_class, &NS_GET_IID(_proto), \
|
||||
_hasclassif, _constructorcid)
|
||||
|
||||
#define NS_DOMCI_EXTENSION_ENTRY_END_NO_PRIMARY_IF(_class, _hasclassif, \
|
||||
_constructorcid) \
|
||||
NS_DOMCI_EXTENSION_ENTRY_END_HELPER(_class, nsnull, _hasclassif, \
|
||||
_constructorcid)
|
||||
|
||||
#define NS_DOMCI_EXTENSION_END \
|
||||
return NS_ERROR_FAILURE; \
|
||||
}
|
||||
|
||||
|
||||
#endif /* nsIDOMClassInfo_h___ */
|
||||
6561
mozilla/dom/src/base/nsDOMClassInfo.cpp
Normal file
6561
mozilla/dom/src/base/nsDOMClassInfo.cpp
Normal file
File diff suppressed because it is too large
Load Diff
141
mozilla/gfx/idl/nsIFreeType2.idl
Normal file
141
mozilla/gfx/idl/nsIFreeType2.idl
Normal file
@@ -0,0 +1,141 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Golden Hills Computer Services code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Brian Stell.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Brian Stell <bstell@ix.netcom.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
%{C++
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_CACHE_H
|
||||
#include FT_CACHE_IMAGE_H
|
||||
#include FT_OUTLINE_H
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
#define NS_FREETYPE2_CONTRACTID "@mozilla.org/freetype2;1"
|
||||
#define NS_FREETYPE2_CID NS_IFREETYPE2_IID
|
||||
// macros to handle FreeType2 26.6 numbers (26 bit number with 6 bit fraction)
|
||||
#define FT_REG_TO_16_16(x) ((x)<<16)
|
||||
#ifndef FT_MulFix
|
||||
#define FT_MulFix(v, s) (((v)*(s))>>16)
|
||||
#endif
|
||||
#define FT_ROUND(x) (((x) + 32) & ~63) // 63 = 2^6 - 1
|
||||
#define FT_TRUNC(x) ((x) >> 6)
|
||||
#define FT_DESIGN_UNITS_TO_PIXELS(v, s) FT_TRUNC(FT_ROUND(FT_MulFix((v) , (s))))
|
||||
|
||||
%}
|
||||
|
||||
|
||||
[ptr] native constCharPtr(const char);
|
||||
native FT_Int(FT_Int);
|
||||
native FT_Long(FT_Long);
|
||||
native FT_UInt(FT_UInt);
|
||||
native FT_ULong(FT_ULong);
|
||||
|
||||
native FT_BBox(FT_BBox);
|
||||
native FT_CharMap(FT_CharMap);
|
||||
native FT_Error(FT_Error);
|
||||
native FT_Face(FT_Face);
|
||||
native FT_Glyph(FT_Glyph);
|
||||
native FT_GlyphSlot(FT_GlyphSlot);
|
||||
native FT_Library(FT_Library);
|
||||
[ptr] native FT_Outline_p(FT_Outline);
|
||||
[ptr] native const_FT_Outline_Funcs_p(const FT_Outline_Funcs);
|
||||
native FT_Pointer(FT_Pointer);
|
||||
native FT_Sfnt_Tag(FT_Sfnt_Tag);
|
||||
native FT_Size(FT_Size);
|
||||
|
||||
[ptr] native FTC_Image_Desc_p(FTC_Image_Desc);
|
||||
native FTC_Face_Requester(FTC_Face_Requester);
|
||||
native FTC_Font(FTC_Font);
|
||||
native FTC_Image_Cache(FTC_Image_Cache);
|
||||
native FTC_Manager(FTC_Manager);
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
[ptr] native FT_Matrix_p(FT_Matrix);
|
||||
native FT_Vector(FT_Vector);
|
||||
[ptr] native FT_Vector_p(FT_Vector);
|
||||
native FT_Render_Mode(FT_Render_Mode);
|
||||
native FT_Bool(FT_Bool);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* A XPCOM interface to the run-time loaded functions
|
||||
*/
|
||||
[uuid(606eac78-16d4-486a-9f0e-f180aebd449b)]
|
||||
interface nsIFreeType2 : nsISupports
|
||||
{
|
||||
|
||||
readonly attribute FT_Library library;
|
||||
readonly attribute FTC_Manager FTCacheManager;
|
||||
readonly attribute FTC_Image_Cache ImageCache;
|
||||
|
||||
void doneFace(in FT_Face face);
|
||||
void doneFreeType(in FT_Library lib);
|
||||
void doneGlyph(in FT_Glyph glyph);
|
||||
FT_UInt getCharIndex(in FT_Face face, in FT_ULong charcode);
|
||||
void getGlyph(in FT_GlyphSlot slot, out FT_Glyph glyph);
|
||||
voidPtr getSfntTable(in FT_Face face, in FT_Sfnt_Tag tag);
|
||||
void glyphGetCBox(in FT_Glyph glyph, in FT_UInt mode, out FT_BBox box);
|
||||
void initFreeType(out FT_Library lib);
|
||||
void loadGlyph(in FT_Face face, in FT_UInt gindex, in FT_Int flags);
|
||||
void newFace(in FT_Library lib, in constCharPtr filename,
|
||||
in FT_Long face_num, out FT_Face face);
|
||||
void outlineDecompose(in FT_Outline_p outline,
|
||||
in const_FT_Outline_Funcs_p funcs, in voidPtr p);
|
||||
void setCharmap(in FT_Face face, in FT_CharMap charmap);
|
||||
void imageCacheLookup(in FTC_Image_Cache cache, in FTC_Image_Desc_p desc,
|
||||
in FT_UInt gindex, out FT_Glyph glyph);
|
||||
void managerLookupSize(in FTC_Manager manager, in FTC_Font font,
|
||||
out FT_Face face, out FT_Size size);
|
||||
void managerDone(in FTC_Manager manager);
|
||||
void managerNew(in FT_Library lib, in FT_UInt max_faces,
|
||||
in FT_UInt max_sizes, in FT_ULong max_bytes,
|
||||
in FTC_Face_Requester requester, in FT_Pointer req_data,
|
||||
out FTC_Manager manager);
|
||||
void imageCacheNew(in FTC_Manager manager, out FTC_Image_Cache cache);
|
||||
#ifdef MOZ_SVG
|
||||
void glyphTransform(in FT_Glyph glyph, in FT_Matrix_p matrix,
|
||||
in FT_Vector_p delta);
|
||||
void getKerning(in FT_Face face, in FT_UInt left_glyph, in FT_UInt right_glyph,
|
||||
in FT_UInt kern_mode, out FT_Vector akerning);
|
||||
void glyphCopy(in FT_Glyph source, out FT_Glyph target);
|
||||
void glyphToBitmap(inout FT_Glyph the_glyph, in FT_Render_Mode render_mode,
|
||||
in FT_Vector_p origin, in FT_Bool destroy);
|
||||
#endif
|
||||
|
||||
FT_ULong getFirstChar(in FT_Face face, out FT_UInt gindex);
|
||||
FT_ULong getNextChar(in FT_Face face, in FT_ULong charcode, out FT_UInt gindex);
|
||||
void supportsExtFunc(out PRBool res);
|
||||
};
|
||||
1172
mozilla/gfx/src/freetype/nsFreeType.cpp
Normal file
1172
mozilla/gfx/src/freetype/nsFreeType.cpp
Normal file
File diff suppressed because it is too large
Load Diff
307
mozilla/gfx/src/freetype/nsFreeType.h
Normal file
307
mozilla/gfx/src/freetype/nsFreeType.h
Normal file
@@ -0,0 +1,307 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* ex: set tabstop=8 softtabstop=2 shiftwidth=2 expandtab:
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
#ifndef nsFreeType_h__
|
||||
#define nsFreeType_h__
|
||||
|
||||
#include "gfx-config.h"
|
||||
#if (defined(MOZ_ENABLE_FREETYPE2))
|
||||
|
||||
#include "nspr.h"
|
||||
#include "nsHashtable.h"
|
||||
#include "nsICharsetConverterManager.h"
|
||||
#include "nsIFontCatalogService.h"
|
||||
#include "nsIFreeType2.h"
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_CACHE_H
|
||||
#include FT_CACHE_IMAGE_H
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
|
||||
typedef struct FT_FaceRec_* FT_Face;
|
||||
|
||||
typedef struct {
|
||||
const char *mFontFileName;
|
||||
time_t mMTime;
|
||||
PRUint32 mFlags;
|
||||
const char *mFontType;
|
||||
int mFaceIndex;
|
||||
int mNumFaces;
|
||||
const char *mFamilyName;
|
||||
const char *mStyleName;
|
||||
FT_UShort mWeight;
|
||||
FT_UShort mWidth;
|
||||
int mNumGlyphs;
|
||||
int mNumUsableGlyphs;
|
||||
FT_Long mFaceFlags;
|
||||
FT_Long mStyleFlags;
|
||||
FT_Long mCodePageRange1;
|
||||
FT_Long mCodePageRange2;
|
||||
char mVendorID[5];
|
||||
const char *mFoundryName;
|
||||
int mNumEmbeddedBitmaps;
|
||||
int *mEmbeddedBitmapHeights;
|
||||
PRUint16 *mCCMap; // compressed char map
|
||||
} nsFontCatalogEntry;
|
||||
|
||||
#define FCE_FLAGS_ISVALID 0x01
|
||||
#define FCE_FLAGS_UNICODE 0x02
|
||||
#define FCE_FLAGS_SYMBOL 0x04
|
||||
#define FCE_FLAGS_SURROGATE 0x08
|
||||
#define FREE_IF(x) if(x) free((void*)x)
|
||||
|
||||
typedef struct {
|
||||
const char *mConverterName;
|
||||
PRUint8 mCmapPlatformID;
|
||||
PRUint8 mCmapEncoding;
|
||||
nsIUnicodeEncoder* mConverter;
|
||||
} nsTTFontEncoderInfo;
|
||||
|
||||
typedef struct nsTTFontFamilyEncoderInfo {
|
||||
const char *mFamilyName;
|
||||
nsTTFontEncoderInfo *mEncodingInfo;
|
||||
} nsTTFontFamilyEncoderInfo;
|
||||
|
||||
typedef struct {
|
||||
unsigned long bit;
|
||||
const char *charsetName;
|
||||
} nsulCodePageRangeCharSetName;
|
||||
|
||||
//
|
||||
// the FreeType2 function type declarations
|
||||
//
|
||||
typedef FT_Error (*FT_Done_Face_t)(FT_Face);
|
||||
typedef FT_Error (*FT_Done_FreeType_t)(FT_Library);
|
||||
typedef FT_Error (*FT_Done_Glyph_t)(FT_Glyph);
|
||||
typedef FT_Error (*FT_Get_Char_Index_t)(FT_Face, FT_ULong);
|
||||
typedef FT_Error (*FT_Get_Glyph_t)(FT_GlyphSlot, FT_Glyph*);
|
||||
typedef void* (*FT_Get_Sfnt_Table_t)(FT_Face, FT_Sfnt_Tag);
|
||||
typedef FT_Error (*FT_Glyph_Get_CBox_t)(FT_Glyph, FT_UInt, FT_BBox*);
|
||||
typedef FT_Error (*FT_Init_FreeType_t)(FT_Library*);
|
||||
typedef FT_Error (*FT_Load_Glyph_t)(FT_Face, FT_UInt, FT_Int);
|
||||
typedef FT_Error (*FT_Outline_Decompose_t)
|
||||
(FT_Outline*, const FT_Outline_Funcs*, void*);
|
||||
typedef FT_Error (*FT_New_Face_t)(FT_Library, const char*, FT_Long, FT_Face*);
|
||||
typedef FT_Error (*FT_Set_Charmap_t)(FT_Face face, FT_CharMap charmap);
|
||||
typedef FT_Error (*FTC_Image_Cache_Lookup_t)
|
||||
(FTC_Image_Cache, FTC_Image_Desc*, FT_UInt, FT_Glyph*);
|
||||
typedef FT_Error (*FTC_Manager_Lookup_Size_t)
|
||||
(FTC_Manager, FTC_Font, FT_Face*, FT_Size*);
|
||||
typedef FT_Error (*FTC_Manager_Done_t)(FTC_Manager);
|
||||
typedef FT_Error (*FTC_Manager_New_t)(FT_Library, FT_UInt, FT_UInt, FT_ULong,
|
||||
FTC_Face_Requester, FT_Pointer, FTC_Manager*);
|
||||
typedef FT_Error (*FTC_Image_Cache_New_t)(FTC_Manager, FTC_Image_Cache*);
|
||||
#ifdef MOZ_SVG
|
||||
typedef FT_Error (*FT_Glyph_Transform_t)(FT_Glyph, FT_Matrix*, FT_Vector*);
|
||||
typedef FT_Error (*FT_Get_Kerning_t)
|
||||
(FT_Face, FT_UInt, FT_UInt, FT_UInt, FT_Vector*);
|
||||
typedef FT_Error (*FT_Glyph_Copy_t)(FT_Glyph, FT_Glyph*);
|
||||
typedef FT_Error (*FT_Glyph_To_Bitmap_t)
|
||||
(FT_Glyph*, FT_Render_Mode, FT_Vector*, FT_Bool);
|
||||
#endif
|
||||
|
||||
typedef FT_ULong (*FT_Get_First_Char_t)(FT_Face, FT_UInt*);
|
||||
typedef FT_ULong (*FT_Get_Next_Char_t)(FT_Face, FT_ULong, FT_UInt*);
|
||||
|
||||
class nsFreeTypeFace;
|
||||
|
||||
nsFreeTypeFace * nsFreeTypeGetFaceID(nsFontCatalogEntry *aFce);
|
||||
|
||||
typedef struct {
|
||||
const char *FuncName;
|
||||
int FuncOffset;
|
||||
const PRBool Required;
|
||||
} FtFuncList;
|
||||
|
||||
// class nsFreeType class definition
|
||||
class nsFreeType2 : nsIFreeType2 {
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
public:
|
||||
void FreeGlobals();
|
||||
nsresult Init();
|
||||
virtual ~nsFreeType2();
|
||||
|
||||
NS_DECL_NSIFREETYPE2
|
||||
|
||||
// these belong in nsFT2FontCatalog
|
||||
static PRUint16* GetCCMap(nsFontCatalogEntry *aFce);
|
||||
static const char* GetRange1CharSetName(unsigned long aBit);
|
||||
static const char* GetRange2CharSetName(unsigned long aBit);
|
||||
static nsTTFontFamilyEncoderInfo* GetCustomEncoderInfo(const char *);
|
||||
|
||||
protected:
|
||||
// run time loaded function pointers
|
||||
FT_Done_Face_t nsFT_Done_Face;
|
||||
FT_Done_FreeType_t nsFT_Done_FreeType;
|
||||
FT_Done_Glyph_t nsFT_Done_Glyph;
|
||||
FT_Get_Char_Index_t nsFT_Get_Char_Index;
|
||||
FT_Get_Glyph_t nsFT_Get_Glyph;
|
||||
FT_Get_Sfnt_Table_t nsFT_Get_Sfnt_Table;
|
||||
FT_Glyph_Get_CBox_t nsFT_Glyph_Get_CBox;
|
||||
FT_Init_FreeType_t nsFT_Init_FreeType;
|
||||
FT_Load_Glyph_t nsFT_Load_Glyph;
|
||||
FT_New_Face_t nsFT_New_Face;
|
||||
FT_Outline_Decompose_t nsFT_Outline_Decompose;
|
||||
FT_Set_Charmap_t nsFT_Set_Charmap;
|
||||
FTC_Image_Cache_Lookup_t nsFTC_Image_Cache_Lookup;
|
||||
FTC_Manager_Lookup_Size_t nsFTC_Manager_Lookup_Size;
|
||||
FTC_Manager_Done_t nsFTC_Manager_Done;
|
||||
FTC_Manager_New_t nsFTC_Manager_New;
|
||||
FTC_Image_Cache_New_t nsFTC_Image_Cache_New;
|
||||
#ifdef MOZ_SVG
|
||||
FT_Glyph_Transform_t nsFT_Glyph_Transform;
|
||||
FT_Get_Kerning_t nsFT_Get_Kerning;
|
||||
FT_Glyph_Copy_t nsFT_Glyph_Copy;
|
||||
FT_Glyph_To_Bitmap_t nsFT_Glyph_To_Bitmap;
|
||||
#endif
|
||||
FT_Get_First_Char_t nsFT_Get_First_Char;
|
||||
FT_Get_Next_Char_t nsFT_Get_Next_Char;
|
||||
|
||||
// this array needs to be big enough to hold all the function pointers
|
||||
// plus one extra for the null at the end
|
||||
#ifdef MOZ_SVG
|
||||
static FtFuncList FtFuncs[24];
|
||||
#else
|
||||
static FtFuncList FtFuncs[20];
|
||||
#endif
|
||||
|
||||
protected:
|
||||
PRBool mEnableFreeType2;
|
||||
char* mFreeType2SharedLibraryName;
|
||||
|
||||
public:
|
||||
// these belong in the nsFontFreeType code
|
||||
static PRBool gFreeType2Autohinted;
|
||||
static PRBool gFreeType2Unhinted;
|
||||
static PRUint8 gAATTDarkTextMinValue;
|
||||
static double gAATTDarkTextGain;
|
||||
static PRInt32 gAntiAliasMinimum;
|
||||
static PRInt32 gEmbeddedBitmapMaximumHeight;
|
||||
static PRBool gHasExtFunc;
|
||||
|
||||
protected:
|
||||
void ClearGlobals();
|
||||
void ClearFunctions();
|
||||
PRBool InitLibrary();
|
||||
PRBool LoadSharedLib();
|
||||
void UnloadSharedLib();
|
||||
|
||||
// this belongs in nsFT2FontCatalog
|
||||
static nsICharsetConverterManager* GetCharSetManager();
|
||||
|
||||
PRLibrary *mSharedLib;
|
||||
FT_Library mFreeTypeLibrary;
|
||||
FTC_Manager mFTCacheManager;
|
||||
FTC_Image_Cache mImageCache;
|
||||
|
||||
static nsHashtable *sFontFamilies;
|
||||
static nsHashtable *sRange1CharSetNames;
|
||||
static nsHashtable *sRange2CharSetNames;
|
||||
static nsICharsetConverterManager* sCharSetManager;
|
||||
};
|
||||
|
||||
/* this simple record is used to model a given `installed' face */
|
||||
class nsFreeTypeFace : public nsITrueTypeFontCatalogEntry {
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSITRUETYPEFONTCATALOGENTRY
|
||||
|
||||
nsFreeTypeFace();
|
||||
virtual ~nsFreeTypeFace();
|
||||
virtual nsresult Init(nsFontCatalogEntry *aFce);
|
||||
/* additional members */
|
||||
NS_IMETHODIMP GetFontCatalogType(PRUint16 *aFontCatalogType);
|
||||
|
||||
static PRBool FreeFace(nsHashKey* aKey, void* aData, void* aClosure);
|
||||
const char *GetFilename()
|
||||
{ return mFce->mFontFileName; }
|
||||
int *GetEmbeddedBitmapHeights()
|
||||
{ return mFce->mEmbeddedBitmapHeights; } ;
|
||||
int GetFaceIndex()
|
||||
{ return mFce->mFaceIndex; }
|
||||
int GetNumEmbeddedBitmaps()
|
||||
{ return mFce->mNumEmbeddedBitmaps; } ;
|
||||
PRUint16 *GetCCMap();
|
||||
nsFontCatalogEntry* GetFce() { return mFce; };
|
||||
|
||||
PRBool mHasExtendFuncs;
|
||||
|
||||
protected:
|
||||
nsFontCatalogEntry *mFce;
|
||||
PRUint16 *mCCMap;
|
||||
|
||||
};
|
||||
|
||||
#endif /* MOZ_ENABLE_FREETYPE2 */
|
||||
|
||||
/*
|
||||
* Defines for the TrueType codepage bits.
|
||||
* Used as a hint for the languages supported in a TrueType font.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ulCodePageRange1
|
||||
*/
|
||||
#define TT_OS2_CPR1_LATIN1 (0x00000001) /* Latin 1 */
|
||||
#define TT_OS2_CPR1_LATIN2 (0x00000002) /* Latin 2: Eastern Europe */
|
||||
#define TT_OS2_CPR1_CYRILLIC (0x00000004) /* Cyrillic */
|
||||
#define TT_OS2_CPR1_GREEK (0x00000008) /* Greek */
|
||||
#define TT_OS2_CPR1_TURKISH (0x00000010) /* Turkish */
|
||||
#define TT_OS2_CPR1_HEBREW (0x00000020) /* Hebrew */
|
||||
#define TT_OS2_CPR1_ARABIC (0x00000040) /* Arabic */
|
||||
#define TT_OS2_CPR1_BALTIC (0x00000080) /* Windows Baltic */
|
||||
#define TT_OS2_CPR1_VIETNAMESE (0x00000100) /* Vietnamese */
|
||||
/* 9-15 Reserved for Alternate ANSI */
|
||||
#define TT_OS2_CPR1_THAI (0x00010000) /* Thai */
|
||||
#define TT_OS2_CPR1_JAPANESE (0x00020000) /* JIS/Japan */
|
||||
#define TT_OS2_CPR1_CHINESE_SIMP (0x00040000) /* Chinese: Simplified */
|
||||
#define TT_OS2_CPR1_KO_WANSUNG (0x00080000) /* Korean Wansung */
|
||||
#define TT_OS2_CPR1_CHINESE_TRAD (0x00100000) /* Chinese: Traditional */
|
||||
#define TT_OS2_CPR1_KO_JOHAB (0x00200000) /* Korean Johab */
|
||||
/* 22-28 Reserved for Alternate ANSI&OEM */
|
||||
#define TT_OS2_CPR1_MAC_ROMAN (0x20000000) /* Mac (US Roman) */
|
||||
#define TT_OS2_CPR1_OEM (0x40000000) /* OEM Character Set */
|
||||
#define TT_OS2_CPR1_SYMBOL (0x80000000) /* Symbol Character Set */
|
||||
|
||||
/*
|
||||
* ulCodePageRange2
|
||||
*/ /* 32-47 Reserved for OEM */
|
||||
#define TT_OS2_CPR2_GREEK (0x00010000) /* IBM Greek */
|
||||
#define TT_OS2_CPR2_RUSSIAN (0x00020000) /* MS-DOS Russian */
|
||||
#define TT_OS2_CPR2_NORDIC (0x00040000) /* MS-DOS Nordic */
|
||||
#define TT_OS2_CPR2_ARABIC (0x00080000) /* Arabic */
|
||||
#define TT_OS2_CPR2_CA_FRENCH (0x00100000) /* MS-DOS Canadian French */
|
||||
#define TT_OS2_CPR2_HEBREW (0x00200000) /* Hebrew */
|
||||
#define TT_OS2_CPR2_ICELANDIC (0x00400000) /* MS-DOS Icelandic */
|
||||
#define TT_OS2_CPR2_PORTUGESE (0x00800000) /* MS-DOS Portuguese */
|
||||
#define TT_OS2_CPR2_TURKISH (0x01000000) /* IBM Turkish */
|
||||
#define TT_OS2_CPR2_CYRILLIC (0x02000000)/*IBM Cyrillic; primarily Russian*/
|
||||
#define TT_OS2_CPR2_LATIN2 (0x04000000) /* Latin 2 */
|
||||
#define TT_OS2_CPR2_BALTIC (0x08000000) /* MS-DOS Baltic */
|
||||
#define TT_OS2_CPR2_GREEK_437G (0x10000000) /* Greek; former 437 G */
|
||||
#define TT_OS2_CPR2_ARABIC_708 (0x20000000) /* Arabic; ASMO 708 */
|
||||
#define TT_OS2_CPR2_WE_LATIN1 (0x40000000) /* WE/Latin 1 */
|
||||
#define TT_OS2_CPR2_US (0x80000000) /* US */
|
||||
|
||||
#endif
|
||||
942
mozilla/gfx/src/windows/nsDrawingSurfaceWin.cpp
Normal file
942
mozilla/gfx/src/windows/nsDrawingSurfaceWin.cpp
Normal file
@@ -0,0 +1,942 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifdef NGLAYOUT_DDRAW
|
||||
#define INITGUID
|
||||
#endif
|
||||
|
||||
#include "nsDrawingSurfaceWin.h"
|
||||
#include "prmem.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
//#define GFX_DEBUG
|
||||
|
||||
#ifdef GFX_DEBUG
|
||||
#define BREAK_TO_DEBUGGER DebugBreak()
|
||||
#else
|
||||
#define BREAK_TO_DEBUGGER
|
||||
#endif
|
||||
|
||||
#ifdef GFX_DEBUG
|
||||
#define VERIFY(exp) ((exp) ? 0: (GetLastError(), BREAK_TO_DEBUGGER))
|
||||
#else // !_DEBUG
|
||||
#define VERIFY(exp) (exp)
|
||||
#endif // !_DEBUG
|
||||
|
||||
static NS_DEFINE_IID(kIDrawingSurfaceIID, NS_IDRAWING_SURFACE_IID);
|
||||
static NS_DEFINE_IID(kIDrawingSurfaceWinIID, NS_IDRAWING_SURFACE_WIN_IID);
|
||||
|
||||
#ifdef NGLAYOUT_DDRAW
|
||||
IDirectDraw *nsDrawingSurfaceWin::mDDraw = NULL;
|
||||
IDirectDraw2 *nsDrawingSurfaceWin::mDDraw2 = NULL;
|
||||
nsresult nsDrawingSurfaceWin::mDDrawResult = NS_OK;
|
||||
#endif
|
||||
|
||||
nsDrawingSurfaceWin :: nsDrawingSurfaceWin()
|
||||
{
|
||||
mDC = NULL;
|
||||
mOrigBitmap = nsnull;
|
||||
mSelectedBitmap = nsnull;
|
||||
mKillDC = PR_FALSE;
|
||||
mBitmapInfo = nsnull;
|
||||
mDIBits = nsnull;
|
||||
mLockedBitmap = nsnull;
|
||||
mWidth = mHeight = 0;
|
||||
mLockOffset = mLockHeight = 0;
|
||||
mLockFlags = 0;
|
||||
|
||||
#ifdef NGLAYOUT_DDRAW
|
||||
|
||||
CreateDDraw();
|
||||
|
||||
mSurface = NULL;
|
||||
mSurfLockCnt = 0;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
nsDrawingSurfaceWin :: ~nsDrawingSurfaceWin()
|
||||
{
|
||||
if ((nsnull != mDC) && (nsnull != mOrigBitmap))
|
||||
{
|
||||
HBITMAP tbits = (HBITMAP)::SelectObject(mDC, mOrigBitmap);
|
||||
|
||||
if (nsnull != tbits)
|
||||
VERIFY(::DeleteObject(tbits));
|
||||
|
||||
mOrigBitmap = nsnull;
|
||||
}
|
||||
|
||||
if (nsnull != mBitmapInfo)
|
||||
{
|
||||
PR_Free(mBitmapInfo);
|
||||
mBitmapInfo = nsnull;
|
||||
}
|
||||
|
||||
if ((nsnull != mDIBits) && (nsnull == mSelectedBitmap))
|
||||
PR_Free(mDIBits);
|
||||
|
||||
mDIBits = nsnull;
|
||||
mSelectedBitmap = nsnull;
|
||||
|
||||
#ifdef NGLAYOUT_DDRAW
|
||||
if (NULL != mSurface)
|
||||
{
|
||||
if (NULL != mDC)
|
||||
{
|
||||
mSurface->ReleaseDC(mDC);
|
||||
mDC = NULL;
|
||||
}
|
||||
|
||||
NS_RELEASE(mSurface);
|
||||
mSurface = NULL;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (NULL != mDC)
|
||||
{
|
||||
if (PR_TRUE == mKillDC)
|
||||
::DeleteDC(mDC);
|
||||
|
||||
mDC = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceWin :: QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
if (nsnull == aInstancePtr)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
if (aIID.Equals(kIDrawingSurfaceIID))
|
||||
{
|
||||
nsIDrawingSurface* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aIID.Equals(kIDrawingSurfaceWinIID))
|
||||
{
|
||||
nsIDrawingSurfaceWin* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
if (aIID.Equals(kISupportsIID))
|
||||
{
|
||||
nsIDrawingSurface* tmp = this;
|
||||
nsISupports* tmp2 = tmp;
|
||||
*aInstancePtr = (void*) tmp2;
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsDrawingSurfaceWin)
|
||||
NS_IMPL_RELEASE(nsDrawingSurfaceWin)
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceWin :: Lock(PRInt32 aX, PRInt32 aY,
|
||||
PRUint32 aWidth, PRUint32 aHeight,
|
||||
void **aBits, PRInt32 *aStride,
|
||||
PRInt32 *aWidthBytes, PRUint32 aFlags)
|
||||
{
|
||||
#ifdef NGLAYOUT_DDRAW
|
||||
if (mSurfLockCnt == 0)
|
||||
{
|
||||
RECT srect;
|
||||
DWORD lockflags = 0;
|
||||
|
||||
srect.left = aX;
|
||||
srect.top = aY;
|
||||
srect.right = aX + aWidth;
|
||||
srect.bottom = aY + aHeight;
|
||||
|
||||
if (aFlags & NS_LOCK_SURFACE_READ_ONLY)
|
||||
lockflags |= DDLOCK_READONLY;
|
||||
|
||||
if (aFlags & NS_LOCK_SURFACE_WRITE_ONLY)
|
||||
lockflags |= DDLOCK_WRITEONLY;
|
||||
|
||||
if (PR_TRUE == LockSurface(mSurface, &mSurfDesc, &mBitmap, &srect, lockflags, &mPixFormat))
|
||||
mSurfLockCnt++;
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_ASSERTION(0, "nested lock attempt");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (mSurfLockCnt == 0)
|
||||
#endif
|
||||
{
|
||||
if (nsnull == mLockedBitmap)
|
||||
{
|
||||
if (nsnull == mSelectedBitmap)
|
||||
{
|
||||
HBITMAP tbits = ::CreateCompatibleBitmap(mDC, 2, 2);
|
||||
if ( tbits != nsnull )
|
||||
{
|
||||
mLockedBitmap = (HBITMAP)::SelectObject(mDC, tbits);
|
||||
|
||||
// if the SelectObject fails, or there was no bitmap returned from this DC
|
||||
if ( mLockedBitmap != nsnull )
|
||||
{
|
||||
::GetObject(mLockedBitmap, sizeof(BITMAP), &mBitmap);
|
||||
|
||||
if (aY < 0 || aY + aHeight > mBitmap.bmHeight) {
|
||||
::DeleteObject(tbits);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// GetDIBits always seems to interpret the scanlines as bottom-to-top.
|
||||
mLockHeight = (PRInt32)aHeight;
|
||||
mLockOffset = mBitmap.bmHeight - (aY + aHeight);
|
||||
|
||||
mBitmapInfo = CreateBitmapInfo(mBitmap.bmWidth, mBitmap.bmHeight, mBitmap.bmBitsPixel, (void **)&mDIBits);
|
||||
|
||||
if ( mBitmapInfo != nsnull ) {
|
||||
if (!(aFlags & NS_LOCK_SURFACE_WRITE_ONLY))
|
||||
::GetDIBits(mDC, mLockedBitmap, mLockOffset, mLockHeight, mDIBits, mBitmapInfo, DIB_RGB_COLORS);
|
||||
|
||||
mBitmap.bmBits = mDIBits;
|
||||
// Note the width of the DIB-bits rows. DIB rows are DWORD-aligned,
|
||||
// the original bitmap's rows may not have been DWORD-aligned.
|
||||
mBitmap.bmWidthBytes = RASWIDTH(mBitmap.bmWidth, mBitmap.bmBitsPixel);
|
||||
} else {
|
||||
::DeleteObject(tbits);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
::DeleteObject(tbits);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mLockedBitmap = mSelectedBitmap;
|
||||
mBitmap.bmBits = mDIBits + mBitmap.bmWidthBytes * aY;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_ASSERTION(0, "nested lock attempt");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
*aBits = (PRUint8 *)mBitmap.bmBits + (aX * (mBitmap.bmBitsPixel >> 3));
|
||||
*aStride = mBitmap.bmWidthBytes;
|
||||
*aWidthBytes = aWidth * (mBitmap.bmBitsPixel >> 3);
|
||||
mLockFlags = aFlags;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceWin :: Unlock(void)
|
||||
{
|
||||
#ifdef NGLAYOUT_DDRAW
|
||||
NS_ASSERTION(!(mDC != nsnull), "attempt to unlock with dc");
|
||||
|
||||
if (nsnull == mDC)
|
||||
{
|
||||
mSurfLockCnt--;
|
||||
|
||||
NS_ASSERTION(!(mSurfLockCnt != 0), "nested surface locks");
|
||||
|
||||
if (mSurfLockCnt == 0)
|
||||
mSurface->Unlock(mSurfDesc.lpSurface);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (nsnull != mLockedBitmap)
|
||||
{
|
||||
if (nsnull == mSelectedBitmap)
|
||||
{
|
||||
HBITMAP tbits;
|
||||
|
||||
if (!(mLockFlags & NS_LOCK_SURFACE_READ_ONLY))
|
||||
::SetDIBits(mDC, mLockedBitmap, mLockOffset, mLockHeight, mDIBits, mBitmapInfo, DIB_RGB_COLORS);
|
||||
|
||||
tbits = (HBITMAP)::SelectObject(mDC, mLockedBitmap);
|
||||
::DeleteObject(tbits);
|
||||
|
||||
if (nsnull != mBitmapInfo)
|
||||
{
|
||||
PR_Free(mBitmapInfo);
|
||||
mBitmapInfo = nsnull;
|
||||
}
|
||||
|
||||
if (nsnull != mDIBits)
|
||||
{
|
||||
PR_Free(mDIBits);
|
||||
mDIBits = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
mLockedBitmap = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceWin :: GetDimensions(PRUint32 *aWidth, PRUint32 *aHeight)
|
||||
{
|
||||
*aWidth = mWidth;
|
||||
*aHeight = mHeight;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceWin :: IsOffscreen(PRBool *aOffScreen)
|
||||
{
|
||||
*aOffScreen = mKillDC;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceWin :: IsPixelAddressable(PRBool *aAddressable)
|
||||
{
|
||||
#ifdef NGLAYOUT_DDRAW
|
||||
if (nsnull != mSurface)
|
||||
*aAddressable = PR_TRUE;
|
||||
else
|
||||
#endif
|
||||
if (nsnull != mSelectedBitmap)
|
||||
*aAddressable = PR_TRUE;
|
||||
else
|
||||
*aAddressable = PR_FALSE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceWin :: GetPixelFormat(nsPixelFormat *aFormat)
|
||||
{
|
||||
*aFormat = mPixFormat;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceWin :: Init(HDC aDC)
|
||||
{
|
||||
mDC = aDC;
|
||||
|
||||
mTechnology = ::GetDeviceCaps(mDC, TECHNOLOGY);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceWin :: Init(HDC aDC, PRUint32 aWidth,
|
||||
PRUint32 aHeight, PRUint32 aFlags)
|
||||
{
|
||||
NS_ASSERTION(!(aDC == nsnull), "null DC");
|
||||
|
||||
#if defined(MOZ_SVG) && defined(SVG_FORCE_PIXEL_ACCESS_SURFACES)
|
||||
// force pixel access on all surfaces. Improves gdi+ performance
|
||||
aFlags |= NS_CREATEDRAWINGSURFACE_FOR_PIXEL_ACCESS;
|
||||
#endif
|
||||
|
||||
#ifdef NGLAYOUT_DDRAW
|
||||
if (aFlags & NS_CREATEDRAWINGSURFACE_FOR_PIXEL_ACCESS)
|
||||
{
|
||||
LPDIRECTDRAWSURFACE ddsurf = nsnull;
|
||||
|
||||
if ((NULL != mDDraw2) && (aWidth > 0) && (aHeight > 0))
|
||||
{
|
||||
DDSURFACEDESC ddsd;
|
||||
|
||||
ddsd.dwSize = sizeof(ddsd);
|
||||
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
|
||||
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN |
|
||||
((aFlags & NS_CREATEDRAWINGSURFACE_FOR_PIXEL_ACCESS) ?
|
||||
DDSCAPS_SYSTEMMEMORY : 0);
|
||||
ddsd.dwWidth = aWidth;
|
||||
ddsd.dwHeight = aHeight;
|
||||
|
||||
mDDraw2->CreateSurface(&ddsd, &ddsurf, NULL);
|
||||
}
|
||||
|
||||
if (NULL != ddsurf)
|
||||
mSurface = ddsurf;
|
||||
else
|
||||
{
|
||||
mDC = ::CreateCompatibleDC(aDC);
|
||||
mKillDC = PR_TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
mDC = ::CreateCompatibleDC(aDC);
|
||||
mTechnology = ::GetDeviceCaps(mDC, TECHNOLOGY);
|
||||
mKillDC = PR_TRUE;
|
||||
}
|
||||
|
||||
#ifdef NGLAYOUT_DDRAW
|
||||
if (nsnull == mSurface)
|
||||
#endif
|
||||
{
|
||||
HBITMAP tbits;
|
||||
|
||||
if ((aWidth > 0) && (aHeight > 0))
|
||||
{
|
||||
if (aFlags & NS_CREATEDRAWINGSURFACE_FOR_PIXEL_ACCESS)
|
||||
{
|
||||
void *bits;
|
||||
BITMAPINFO *binfo;
|
||||
int depth;
|
||||
|
||||
depth = ::GetDeviceCaps(aDC, BITSPIXEL);
|
||||
|
||||
binfo = CreateBitmapInfo(aWidth, aHeight, depth);
|
||||
|
||||
if (nsnull != binfo)
|
||||
mSelectedBitmap = tbits = ::CreateDIBSection(aDC, binfo, DIB_RGB_COLORS, &bits, NULL, 0);
|
||||
|
||||
if (NULL == mSelectedBitmap)
|
||||
tbits = ::CreateCompatibleBitmap(aDC, aWidth, aHeight);
|
||||
else
|
||||
{
|
||||
mBitmapInfo = binfo;
|
||||
mDIBits = (PRUint8 *)bits;
|
||||
mBitmap.bmWidthBytes = RASWIDTH(aWidth, depth);
|
||||
mBitmap.bmBitsPixel = depth;
|
||||
}
|
||||
}
|
||||
else
|
||||
tbits = ::CreateCompatibleBitmap(aDC, aWidth, aHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
//we do this to make sure that the memory DC knows what the
|
||||
//bitmap format of the original DC was. this way, later
|
||||
//operations to create bitmaps from the memory DC will create
|
||||
//bitmaps with the correct properties.
|
||||
|
||||
tbits = ::CreateCompatibleBitmap(aDC, 2, 2);
|
||||
}
|
||||
|
||||
mOrigBitmap = (HBITMAP)::SelectObject(mDC, tbits);
|
||||
}
|
||||
|
||||
mWidth = aWidth;
|
||||
mHeight = aHeight;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceWin :: GetDC(HDC *aDC)
|
||||
{
|
||||
#ifdef NGLAYOUT_DDRAW
|
||||
if (nsnull != mSurface)
|
||||
{
|
||||
if (0 == mSurfLockCnt)
|
||||
mSurface->GetDC(&mDC);
|
||||
|
||||
mSurfLockCnt++;
|
||||
}
|
||||
#endif
|
||||
|
||||
*aDC = mDC;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDrawingSurfaceWin::GetTECHNOLOGY(PRInt32 *aTechnology)
|
||||
{
|
||||
|
||||
*aTechnology = mTechnology;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceWin :: ReleaseDC(void)
|
||||
{
|
||||
#ifdef NGLAYOUT_DDRAW
|
||||
if (nsnull != mSurface)
|
||||
{
|
||||
--mSurfLockCnt;
|
||||
|
||||
if ((nsnull != mDC) && (mSurfLockCnt == 0))
|
||||
{
|
||||
mSurface->ReleaseDC(mDC);
|
||||
mDC = nsnull;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDrawingSurfaceWin :: IsReleaseDCDestructive(PRBool *aDestructive)
|
||||
{
|
||||
#ifdef NGLAYOUT_DDRAW
|
||||
if (nsnull != mSurface)
|
||||
*aDestructive = PR_TRUE;
|
||||
else
|
||||
#endif
|
||||
*aDestructive = PR_FALSE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
BITMAPINFO * nsDrawingSurfaceWin :: CreateBitmapInfo(PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth,
|
||||
void **aBits)
|
||||
{
|
||||
PRInt32 palsize, imagesize, spanbytes, allocsize;
|
||||
PRUint8 *colortable;
|
||||
DWORD bicomp, masks[3];
|
||||
BITMAPINFO *rv = nsnull;
|
||||
|
||||
switch (aDepth)
|
||||
{
|
||||
case 8:
|
||||
palsize = 256;
|
||||
allocsize = 256;
|
||||
bicomp = BI_RGB;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
palsize = 0;
|
||||
allocsize = 3;
|
||||
bicomp = BI_BITFIELDS;
|
||||
masks[0] = 0xf800;
|
||||
masks[1] = 0x07e0;
|
||||
masks[2] = 0x001f;
|
||||
|
||||
mPixFormat.mRedZeroMask = 0x1f;
|
||||
mPixFormat.mGreenZeroMask = 0x3f;
|
||||
mPixFormat.mBlueZeroMask = 0x1f;
|
||||
mPixFormat.mAlphaZeroMask = 0;
|
||||
mPixFormat.mRedMask = masks[0];
|
||||
mPixFormat.mGreenMask = masks[1];
|
||||
mPixFormat.mBlueMask = masks[2];
|
||||
mPixFormat.mAlphaMask = 0;
|
||||
mPixFormat.mRedCount = 5;
|
||||
mPixFormat.mGreenCount = 6;
|
||||
mPixFormat.mBlueCount = 5;
|
||||
mPixFormat.mAlphaCount = 0;
|
||||
mPixFormat.mRedShift = 11;
|
||||
mPixFormat.mGreenShift = 5;
|
||||
mPixFormat.mBlueShift = 0;
|
||||
mPixFormat.mAlphaShift = 0;
|
||||
|
||||
break;
|
||||
|
||||
case 24:
|
||||
palsize = 0;
|
||||
allocsize = 0;
|
||||
bicomp = BI_RGB;
|
||||
|
||||
|
||||
mPixFormat.mRedZeroMask = 0xff;
|
||||
mPixFormat.mGreenZeroMask = 0xff;
|
||||
mPixFormat.mBlueZeroMask = 0xff;
|
||||
mPixFormat.mAlphaZeroMask = 0;
|
||||
mPixFormat.mRedMask = 0xff;
|
||||
mPixFormat.mGreenMask = 0xff00;
|
||||
mPixFormat.mBlueMask = 0xff0000;
|
||||
mPixFormat.mAlphaMask = 0;
|
||||
mPixFormat.mRedCount = 8;
|
||||
mPixFormat.mGreenCount = 8;
|
||||
mPixFormat.mBlueCount = 8;
|
||||
mPixFormat.mAlphaCount = 0;
|
||||
mPixFormat.mRedShift = 0;
|
||||
mPixFormat.mGreenShift = 8;
|
||||
mPixFormat.mBlueShift = 16;
|
||||
mPixFormat.mAlphaShift = 0;
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 32:
|
||||
palsize = 0;
|
||||
allocsize = 3;
|
||||
bicomp = BI_BITFIELDS;
|
||||
masks[0] = 0xff0000;
|
||||
masks[1] = 0x00ff00;
|
||||
masks[2] = 0x0000ff;
|
||||
|
||||
mPixFormat.mRedZeroMask = 0xff;
|
||||
mPixFormat.mGreenZeroMask = 0xff;
|
||||
mPixFormat.mBlueZeroMask = 0xff;
|
||||
mPixFormat.mAlphaZeroMask = 0xff;
|
||||
mPixFormat.mRedMask = masks[0];
|
||||
mPixFormat.mGreenMask = masks[1];
|
||||
mPixFormat.mBlueMask = masks[2];
|
||||
mPixFormat.mAlphaMask = 0xff000000;
|
||||
mPixFormat.mRedCount = 8;
|
||||
mPixFormat.mGreenCount = 8;
|
||||
mPixFormat.mBlueCount = 8;
|
||||
mPixFormat.mAlphaCount = 8;
|
||||
mPixFormat.mRedShift = 16;
|
||||
mPixFormat.mGreenShift = 8;
|
||||
mPixFormat.mBlueShift = 0;
|
||||
mPixFormat.mAlphaShift = 24;
|
||||
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
palsize = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (palsize >= 0)
|
||||
{
|
||||
spanbytes = RASWIDTH(aWidth, aDepth);
|
||||
imagesize = spanbytes * aHeight;
|
||||
|
||||
rv = (BITMAPINFO *)PR_Malloc(sizeof(BITMAPINFOHEADER) + (sizeof(RGBQUAD) * allocsize));
|
||||
|
||||
if (nsnull != rv)
|
||||
{
|
||||
rv->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||
rv->bmiHeader.biWidth = aWidth;
|
||||
rv->bmiHeader.biHeight = -aHeight;
|
||||
rv->bmiHeader.biPlanes = 1;
|
||||
rv->bmiHeader.biBitCount = (unsigned short)aDepth;
|
||||
rv->bmiHeader.biCompression = bicomp;
|
||||
rv->bmiHeader.biSizeImage = imagesize;
|
||||
rv->bmiHeader.biXPelsPerMeter = 0;
|
||||
rv->bmiHeader.biYPelsPerMeter = 0;
|
||||
rv->bmiHeader.biClrUsed = palsize;
|
||||
rv->bmiHeader.biClrImportant = palsize;
|
||||
|
||||
// set the color table in the info header
|
||||
colortable = (PRUint8 *)rv + sizeof(BITMAPINFOHEADER);
|
||||
|
||||
if ((aDepth == 16) || (aDepth == 32))
|
||||
memcpy(colortable, masks, sizeof(DWORD) * allocsize);
|
||||
else
|
||||
memset(colortable, 0, sizeof(RGBQUAD) * palsize);
|
||||
|
||||
if (nsnull != aBits) {
|
||||
*aBits = PR_Malloc(imagesize);
|
||||
if ( nsnull == *aBits ) {
|
||||
PR_Free(rv);
|
||||
rv = nsnull;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
#ifdef NGLAYOUT_DDRAW
|
||||
|
||||
PRBool nsDrawingSurfaceWin :: LockSurface(IDirectDrawSurface *aSurface, DDSURFACEDESC *aDesc,
|
||||
BITMAP *aBitmap, RECT *aRect, DWORD aLockFlags, nsPixelFormat *aPixFormat)
|
||||
{
|
||||
if (nsnull != aSurface)
|
||||
{
|
||||
aDesc->dwSize = sizeof(DDSURFACEDESC);
|
||||
|
||||
if (DD_OK == aSurface->Lock(aRect, aDesc, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | aLockFlags, NULL))
|
||||
{
|
||||
if ((aDesc->ddpfPixelFormat.dwFlags &
|
||||
(DDPF_ALPHA | DDPF_PALETTEINDEXED1 |
|
||||
DDPF_PALETTEINDEXED2 | DDPF_PALETTEINDEXED4 |
|
||||
DDPF_PALETTEINDEXEDTO8 | DDPF_YUV | DDPF_ZBUFFER)) ||
|
||||
(aDesc->ddpfPixelFormat.dwRGBBitCount < 8))
|
||||
{
|
||||
//this is a surface that we can't, or don't want to handle.
|
||||
|
||||
aSurface->Unlock(aDesc->lpSurface);
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
aBitmap->bmType = 0;
|
||||
aBitmap->bmWidth = aDesc->dwWidth;
|
||||
aBitmap->bmHeight = aDesc->dwHeight;
|
||||
aBitmap->bmWidthBytes = aDesc->lPitch;
|
||||
aBitmap->bmPlanes = 1;
|
||||
aBitmap->bmBitsPixel = (PRUint16)aDesc->ddpfPixelFormat.dwRGBBitCount;
|
||||
aBitmap->bmBits = aDesc->lpSurface;
|
||||
|
||||
if ((nsnull != aPixFormat) && (aBitmap->bmBitsPixel > 8))
|
||||
{
|
||||
DWORD btemp, shiftcnt;
|
||||
|
||||
btemp = aDesc->ddpfPixelFormat.dwRBitMask;
|
||||
|
||||
aPixFormat->mRedMask = btemp;
|
||||
|
||||
shiftcnt = 32;
|
||||
|
||||
if (!(btemp & 0xffff))
|
||||
{
|
||||
aPixFormat->mRedShift = 16;
|
||||
btemp >>= 16;
|
||||
shiftcnt = 16;
|
||||
}
|
||||
else if (!(btemp & 0xff))
|
||||
{
|
||||
aPixFormat->mRedShift = 8;
|
||||
btemp >>= 8;
|
||||
shiftcnt = 24;
|
||||
}
|
||||
else
|
||||
{
|
||||
aPixFormat->mRedShift = 0;
|
||||
shiftcnt = 32;
|
||||
}
|
||||
|
||||
while (!(btemp & 1) && shiftcnt--)
|
||||
{
|
||||
btemp >>= 1;
|
||||
aPixFormat->mRedShift++;
|
||||
}
|
||||
|
||||
aPixFormat->mRedZeroMask = btemp;
|
||||
aPixFormat->mRedCount = 0;
|
||||
|
||||
while ((btemp & 1) && shiftcnt--)
|
||||
{
|
||||
btemp >>= 1;
|
||||
aPixFormat->mRedCount++;
|
||||
}
|
||||
|
||||
btemp = aDesc->ddpfPixelFormat.dwGBitMask;
|
||||
|
||||
aPixFormat->mGreenMask = btemp;
|
||||
|
||||
shiftcnt = 32;
|
||||
|
||||
if (!(btemp & 0xffff))
|
||||
{
|
||||
aPixFormat->mGreenShift = 16;
|
||||
btemp >>= 16;
|
||||
shiftcnt = 16;
|
||||
}
|
||||
else if (!(btemp & 0xff))
|
||||
{
|
||||
aPixFormat->mGreenShift = 8;
|
||||
btemp >>= 8;
|
||||
shiftcnt = 24;
|
||||
}
|
||||
else
|
||||
{
|
||||
aPixFormat->mGreenShift = 0;
|
||||
shiftcnt = 32;
|
||||
}
|
||||
|
||||
while (!(btemp & 1) && shiftcnt--)
|
||||
{
|
||||
btemp >>= 1;
|
||||
aPixFormat->mGreenShift++;
|
||||
}
|
||||
|
||||
aPixFormat->mGreenZeroMask = btemp;
|
||||
aPixFormat->mGreenCount = 0;
|
||||
|
||||
while ((btemp & 1) && shiftcnt--)
|
||||
{
|
||||
btemp >>= 1;
|
||||
aPixFormat->mGreenCount++;
|
||||
}
|
||||
|
||||
btemp = aDesc->ddpfPixelFormat.dwBBitMask;
|
||||
|
||||
aPixFormat->mBlueMask = btemp;
|
||||
|
||||
shiftcnt = 32;
|
||||
|
||||
if (!(btemp & 0xffff))
|
||||
{
|
||||
aPixFormat->mBlueShift = 16;
|
||||
btemp >>= 16;
|
||||
shiftcnt = 16;
|
||||
}
|
||||
else if (!(btemp & 0xff))
|
||||
{
|
||||
aPixFormat->mBlueShift = 8;
|
||||
btemp >>= 8;
|
||||
shiftcnt = 24;
|
||||
}
|
||||
else
|
||||
{
|
||||
aPixFormat->mBlueShift = 0;
|
||||
shiftcnt = 32;
|
||||
}
|
||||
|
||||
while (!(btemp & 1) && shiftcnt--)
|
||||
{
|
||||
btemp >>= 1;
|
||||
aPixFormat->mBlueShift++;
|
||||
}
|
||||
|
||||
aPixFormat->mBlueZeroMask = btemp;
|
||||
aPixFormat->mBlueCount = 0;
|
||||
|
||||
while ((btemp & 1) && shiftcnt--)
|
||||
{
|
||||
btemp >>= 1;
|
||||
aPixFormat->mBlueCount++;
|
||||
}
|
||||
|
||||
aPixFormat->mAlphaCount = (PRUint8)aDesc->ddpfPixelFormat.dwAlphaBitDepth;
|
||||
|
||||
if (aPixFormat->mAlphaCount > 0)
|
||||
{
|
||||
btemp = aDesc->ddpfPixelFormat.dwRGBAlphaBitMask;
|
||||
|
||||
aPixFormat->mAlphaMask = btemp;
|
||||
|
||||
shiftcnt = 32;
|
||||
|
||||
if (!(btemp & 0xffff))
|
||||
{
|
||||
aPixFormat->mAlphaShift = 16;
|
||||
btemp >>= 16;
|
||||
shiftcnt = 16;
|
||||
}
|
||||
else if (!(btemp & 0xff))
|
||||
{
|
||||
aPixFormat->mAlphaShift = 8;
|
||||
btemp >>= 8;
|
||||
shiftcnt = 24;
|
||||
}
|
||||
else
|
||||
{
|
||||
aPixFormat->mAlphaShift = 0;
|
||||
shiftcnt = 32;
|
||||
}
|
||||
|
||||
while (!(btemp & 1) && shiftcnt--)
|
||||
{
|
||||
btemp >>= 1;
|
||||
aPixFormat->mAlphaShift++;
|
||||
}
|
||||
|
||||
aPixFormat->mAlphaZeroMask = btemp;
|
||||
}
|
||||
else
|
||||
{
|
||||
aPixFormat->mAlphaMask = 0;
|
||||
aPixFormat->mAlphaShift = 0;
|
||||
aPixFormat->mAlphaZeroMask = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
else
|
||||
return PR_FALSE;
|
||||
}
|
||||
else
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
nsresult nsDrawingSurfaceWin :: CreateDDraw()
|
||||
{
|
||||
if ((mDDraw2 == NULL) && (mDDrawResult == NS_OK))
|
||||
{
|
||||
CoInitialize(NULL);
|
||||
|
||||
mDDrawResult = DirectDrawCreate(NULL, &mDDraw, NULL);
|
||||
|
||||
if (mDDrawResult == NS_OK)
|
||||
mDDrawResult = mDDraw->QueryInterface(IID_IDirectDraw2, (LPVOID *)&mDDraw2);
|
||||
|
||||
if (mDDrawResult == NS_OK)
|
||||
{
|
||||
mDDraw2->SetCooperativeLevel(NULL, DDSCL_NORMAL);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
printf("using DirectDraw (%08X)\n", mDDraw2);
|
||||
|
||||
DDSCAPS ddscaps;
|
||||
DWORD totalmem, freemem;
|
||||
|
||||
ddscaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY;
|
||||
nsresult res = mDDraw2->GetAvailableVidMem(&ddscaps, &totalmem, &freemem);
|
||||
|
||||
if (NS_SUCCEEDED(res))
|
||||
{
|
||||
printf("total video memory: %d\n", totalmem);
|
||||
printf("free video memory: %d\n", freemem);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("GetAvailableVidMem() returned %08x: %s\n", res,
|
||||
(res == DDERR_NODIRECTDRAWHW) ?
|
||||
"no hardware ddraw driver available" : "unknown error code");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return mDDrawResult;
|
||||
}
|
||||
|
||||
nsresult nsDrawingSurfaceWin :: GetDDraw(IDirectDraw2 **aDDraw)
|
||||
{
|
||||
CreateDDraw();
|
||||
|
||||
if (NULL != mDDraw2)
|
||||
{
|
||||
NS_ADDREF(mDDraw2);
|
||||
*aDDraw = mDDraw2;
|
||||
}
|
||||
else
|
||||
*aDDraw = NULL;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
3939
mozilla/htmlparser/src/CNavDTD.cpp
Normal file
3939
mozilla/htmlparser/src/CNavDTD.cpp
Normal file
File diff suppressed because it is too large
Load Diff
191
mozilla/htmlparser/src/CParserContext.cpp
Normal file
191
mozilla/htmlparser/src/CParserContext.cpp
Normal file
@@ -0,0 +1,191 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
|
||||
#include "nsIAtom.h"
|
||||
#include "CParserContext.h"
|
||||
#include "nsToken.h"
|
||||
#include "prenv.h"
|
||||
#include "nsHTMLTokenizer.h"
|
||||
#include "nsExpatDriver.h"
|
||||
|
||||
MOZ_DECL_CTOR_COUNTER(CParserContext)
|
||||
|
||||
/**
|
||||
* Your friendly little constructor. Ok, it's not the friendly, but the only guy
|
||||
* using it is the parser.
|
||||
* @update gess7/23/98
|
||||
* @param aScanner
|
||||
* @param aKey
|
||||
* @param aListener
|
||||
*/
|
||||
CParserContext::CParserContext(nsScanner* aScanner,
|
||||
void *aKey,
|
||||
eParserCommands aCommand,
|
||||
nsIRequestObserver* aListener,
|
||||
nsIDTD *aDTD,
|
||||
eAutoDetectResult aStatus,
|
||||
PRBool aCopyUnused)
|
||||
{
|
||||
MOZ_COUNT_CTOR(CParserContext);
|
||||
|
||||
mScanner=aScanner;
|
||||
mKey=aKey;
|
||||
mPrevContext=0;
|
||||
mListener=aListener;
|
||||
NS_IF_ADDREF(mListener);
|
||||
mDTDMode=eDTDMode_unknown;
|
||||
mAutoDetectStatus=aStatus;
|
||||
mTransferBuffer=0;
|
||||
mDTD=aDTD;
|
||||
NS_IF_ADDREF(mDTD);
|
||||
mTokenizer = 0;
|
||||
mTransferBufferSize=eTransferBufferSize;
|
||||
mStreamListenerState=eNone;
|
||||
mMultipart=PR_TRUE;
|
||||
mContextType=eCTNone;
|
||||
mCopyUnused=aCopyUnused;
|
||||
mParserCommand=aCommand;
|
||||
mRequest=0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Your friendly little constructor. Ok, it's not the friendly, but the only guy
|
||||
* using it is the parser.
|
||||
* @update gess7/23/98
|
||||
* @param aScanner
|
||||
* @param aKey
|
||||
* @param aListener
|
||||
*/
|
||||
CParserContext::CParserContext(const CParserContext &aContext) : mMimeType() {
|
||||
MOZ_COUNT_CTOR(CParserContext);
|
||||
|
||||
mScanner=aContext.mScanner;
|
||||
mKey=aContext.mKey;
|
||||
mPrevContext=0;
|
||||
mListener=aContext.mListener;
|
||||
NS_IF_ADDREF(mListener);
|
||||
|
||||
mDTDMode=aContext.mDTDMode;
|
||||
mAutoDetectStatus=aContext.mAutoDetectStatus;
|
||||
mTransferBuffer=aContext.mTransferBuffer;
|
||||
mDTD=aContext.mDTD;
|
||||
NS_IF_ADDREF(mDTD);
|
||||
|
||||
mTokenizer = aContext.mTokenizer;
|
||||
NS_IF_ADDREF(mTokenizer);
|
||||
|
||||
mTransferBufferSize=eTransferBufferSize;
|
||||
mStreamListenerState=aContext.mStreamListenerState;
|
||||
mMultipart=aContext.mMultipart;
|
||||
mContextType=aContext.mContextType;
|
||||
mRequest=aContext.mRequest;
|
||||
mParserCommand=aContext.mParserCommand;
|
||||
SetMimeType(aContext.mMimeType);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Destructor for parser context
|
||||
* NOTE: DO NOT destroy the dtd here.
|
||||
* @update gess7/11/98
|
||||
*/
|
||||
CParserContext::~CParserContext(){
|
||||
|
||||
MOZ_COUNT_DTOR(CParserContext);
|
||||
|
||||
if(mScanner) {
|
||||
delete mScanner;
|
||||
mScanner=nsnull;
|
||||
}
|
||||
|
||||
if(mTransferBuffer)
|
||||
delete [] mTransferBuffer;
|
||||
|
||||
NS_IF_RELEASE(mDTD);
|
||||
NS_IF_RELEASE(mListener);
|
||||
NS_IF_RELEASE(mTokenizer);
|
||||
|
||||
//Remember that it's ok to simply ingore the PrevContext.
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set's the mimetype for this context
|
||||
* @update rickg 03.18.2000
|
||||
*/
|
||||
void CParserContext::SetMimeType(const nsACString& aMimeType){
|
||||
mMimeType.Assign(aMimeType);
|
||||
|
||||
mDocType=ePlainText;
|
||||
|
||||
if(mMimeType.Equals(NS_LITERAL_CSTRING(kHTMLTextContentType)))
|
||||
mDocType=eHTML_Strict;
|
||||
else if (mMimeType.Equals(NS_LITERAL_CSTRING(kXMLTextContentType)) ||
|
||||
mMimeType.Equals(NS_LITERAL_CSTRING(kXMLApplicationContentType)) ||
|
||||
mMimeType.Equals(NS_LITERAL_CSTRING(kXHTMLApplicationContentType)) ||
|
||||
mMimeType.Equals(NS_LITERAL_CSTRING(kXULTextContentType)) ||
|
||||
#ifdef MOZ_SVG
|
||||
mMimeType.Equals(NS_LITERAL_CSTRING(kSVGTextContentType)) ||
|
||||
#endif
|
||||
mMimeType.Equals(NS_LITERAL_CSTRING(kRDFTextContentType)))
|
||||
mDocType=eXML;
|
||||
}
|
||||
|
||||
nsresult
|
||||
CParserContext::GetTokenizer(PRInt32 aType, nsITokenizer*& aTokenizer) {
|
||||
nsresult result = NS_OK;
|
||||
|
||||
if(!mTokenizer) {
|
||||
if (aType == NS_IPARSER_FLAG_HTML || mParserCommand == eViewSource) {
|
||||
result = NS_NewHTMLTokenizer(&mTokenizer,mDTDMode,mDocType,mParserCommand);
|
||||
// Propagate tokenizer state so that information is preserved
|
||||
// between document.write. This fixes bug 99467
|
||||
if (mTokenizer && mPrevContext)
|
||||
mTokenizer->CopyState(mPrevContext->mTokenizer);
|
||||
}
|
||||
else if (aType == NS_IPARSER_FLAG_XML)
|
||||
{
|
||||
result = CallQueryInterface(mDTD, &mTokenizer);
|
||||
}
|
||||
}
|
||||
|
||||
aTokenizer = mTokenizer;
|
||||
return result;
|
||||
}
|
||||
1205
mozilla/htmlparser/src/nsExpatDriver.cpp
Normal file
1205
mozilla/htmlparser/src/nsExpatDriver.cpp
Normal file
File diff suppressed because it is too large
Load Diff
698
mozilla/layout/base/public/nsStyleConsts.h
Normal file
698
mozilla/layout/base/public/nsStyleConsts.h
Normal file
@@ -0,0 +1,698 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#ifndef nsStyleConsts_h___
|
||||
#define nsStyleConsts_h___
|
||||
|
||||
#include "nsFont.h"
|
||||
|
||||
// XXX fold this into nsStyleContext and group by nsStyleXXX struct
|
||||
|
||||
// Indices into border/padding/margin arrays
|
||||
#define NS_SIDE_TOP 0
|
||||
#define NS_SIDE_RIGHT 1
|
||||
#define NS_SIDE_BOTTOM 2
|
||||
#define NS_SIDE_LEFT 3
|
||||
|
||||
// {margin,padding}-{left,right}-{ltr,rtl}-source
|
||||
#define NS_BOXPROP_SOURCE_PHYSICAL 0
|
||||
#define NS_BOXPROP_SOURCE_LOGICAL 1
|
||||
|
||||
// box-sizing
|
||||
#define NS_STYLE_BOX_SIZING_CONTENT 0
|
||||
#define NS_STYLE_BOX_SIZING_PADDING 1
|
||||
#define NS_STYLE_BOX_SIZING_BORDER 2
|
||||
|
||||
// float-edge
|
||||
#define NS_STYLE_FLOAT_EDGE_CONTENT 0
|
||||
#define NS_STYLE_FLOAT_EDGE_PADDING 1
|
||||
#define NS_STYLE_FLOAT_EDGE_BORDER 2
|
||||
#define NS_STYLE_FLOAT_EDGE_MARGIN 3
|
||||
|
||||
// key-equivalent
|
||||
#define NS_STYLE_KEY_EQUIVALENT_NONE 0
|
||||
|
||||
// resizer
|
||||
#define NS_STYLE_RESIZER_NONE 0x00
|
||||
#define NS_STYLE_RESIZER_HORIZONTAL 0x01 // bits
|
||||
#define NS_STYLE_RESIZER_VERTICAL 0x02 // bits
|
||||
#define NS_STYLE_RESIZER_BOTH 0x03 // bits
|
||||
#define NS_STYLE_RESIZER_AUTO 0x04 // bits
|
||||
|
||||
// user-focus
|
||||
#define NS_STYLE_USER_FOCUS_NONE 0
|
||||
#define NS_STYLE_USER_FOCUS_IGNORE 1
|
||||
#define NS_STYLE_USER_FOCUS_NORMAL 2
|
||||
#define NS_STYLE_USER_FOCUS_SELECT_ALL 3
|
||||
#define NS_STYLE_USER_FOCUS_SELECT_BEFORE 4
|
||||
#define NS_STYLE_USER_FOCUS_SELECT_AFTER 5
|
||||
#define NS_STYLE_USER_FOCUS_SELECT_SAME 6
|
||||
#define NS_STYLE_USER_FOCUS_SELECT_MENU 7
|
||||
|
||||
// user-select
|
||||
#define NS_STYLE_USER_SELECT_NONE 0
|
||||
#define NS_STYLE_USER_SELECT_TEXT 1
|
||||
#define NS_STYLE_USER_SELECT_ELEMENT 2
|
||||
#define NS_STYLE_USER_SELECT_ELEMENTS 3
|
||||
#define NS_STYLE_USER_SELECT_ALL 4
|
||||
#define NS_STYLE_USER_SELECT_TOGGLE 5
|
||||
#define NS_STYLE_USER_SELECT_TRI_STATE 6
|
||||
#define NS_STYLE_USER_SELECT_AUTO 7 // internal value - please use nsFrame::IsSelectable()
|
||||
#define NS_STYLE_USER_SELECT_MOZ_ALL 8 // force selection of all children - bug 48096
|
||||
|
||||
// user-input
|
||||
#define NS_STYLE_USER_INPUT_NONE 0
|
||||
#define NS_STYLE_USER_INPUT_ENABLED 1
|
||||
#define NS_STYLE_USER_INPUT_DISABLED 2
|
||||
#define NS_STYLE_USER_INPUT_AUTO 3
|
||||
|
||||
// user-modify
|
||||
#define NS_STYLE_USER_MODIFY_READ_ONLY 0
|
||||
#define NS_STYLE_USER_MODIFY_READ_WRITE 1
|
||||
#define NS_STYLE_USER_MODIFY_WRITE_ONLY 2
|
||||
|
||||
// box-align
|
||||
#define NS_STYLE_BOX_ALIGN_STRETCH 0
|
||||
#define NS_STYLE_BOX_ALIGN_START 1
|
||||
#define NS_STYLE_BOX_ALIGN_CENTER 2
|
||||
#define NS_STYLE_BOX_ALIGN_BASELINE 3
|
||||
#define NS_STYLE_BOX_ALIGN_END 4
|
||||
|
||||
// box-pack
|
||||
#define NS_STYLE_BOX_PACK_START 0
|
||||
#define NS_STYLE_BOX_PACK_CENTER 1
|
||||
#define NS_STYLE_BOX_PACK_END 2
|
||||
#define NS_STYLE_BOX_PACK_JUSTIFY 3
|
||||
|
||||
// box-direction
|
||||
#define NS_STYLE_BOX_DIRECTION_NORMAL 0
|
||||
#define NS_STYLE_BOX_DIRECTION_REVERSE 1
|
||||
|
||||
// box-orient
|
||||
#define NS_STYLE_BOX_ORIENT_HORIZONTAL 0
|
||||
#define NS_STYLE_BOX_ORIENT_VERTICAL 1
|
||||
|
||||
// Azimuth - See nsStyleAural
|
||||
#define NS_STYLE_AZIMUTH_LEFT_SIDE 0x00
|
||||
#define NS_STYLE_AZIMUTH_FAR_LEFT 0x01
|
||||
#define NS_STYLE_AZIMUTH_LEFT 0x02
|
||||
#define NS_STYLE_AZIMUTH_CENTER_LEFT 0x03
|
||||
#define NS_STYLE_AZIMUTH_CENTER 0x04
|
||||
#define NS_STYLE_AZIMUTH_CENTER_RIGHT 0x05
|
||||
#define NS_STYLE_AZIMUTH_RIGHT 0x06
|
||||
#define NS_STYLE_AZIMUTH_FAR_RIGHT 0x07
|
||||
#define NS_STYLE_AZIMUTH_RIGHT_SIDE 0x08
|
||||
#define NS_STYLE_AZIMUTH_BEHIND 0x80 // bits
|
||||
#define NS_STYLE_AZIMUTH_LEFTWARDS 0x10 // bits
|
||||
#define NS_STYLE_AZIMUTH_RIGHTWARDS 0x20 // bits
|
||||
|
||||
// See nsStyleAural
|
||||
#define NS_STYLE_ELEVATION_BELOW 1
|
||||
#define NS_STYLE_ELEVATION_LEVEL 2
|
||||
#define NS_STYLE_ELEVATION_ABOVE 3
|
||||
#define NS_STYLE_ELEVATION_HIGHER 4
|
||||
#define NS_STYLE_ELEVATION_LOWER 5
|
||||
|
||||
// See nsStyleAural
|
||||
#define NS_STYLE_PITCH_X_LOW 1
|
||||
#define NS_STYLE_PITCH_LOW 2
|
||||
#define NS_STYLE_PITCH_MEDIUM 3
|
||||
#define NS_STYLE_PITCH_HIGH 4
|
||||
#define NS_STYLE_PITCH_X_HIGH 5
|
||||
|
||||
// See nsStyleAural
|
||||
#define NS_STYLE_PLAY_DURING_MIX 0x01 // bit field
|
||||
#define NS_STYLE_PLAY_DURING_REPEAT 0x02
|
||||
|
||||
// See nsStyleAural
|
||||
#define NS_STYLE_SPEAK_NONE 0
|
||||
#define NS_STYLE_SPEAK_NORMAL 1
|
||||
#define NS_STYLE_SPEAK_SPELL_OUT 2
|
||||
|
||||
// See nsStyleAural
|
||||
#define NS_STYLE_SPEAK_HEADER_ONCE 0
|
||||
#define NS_STYLE_SPEAK_HEADER_ALWAYS 1
|
||||
|
||||
// See nsStyleAural
|
||||
#define NS_STYLE_SPEAK_NUMERAL_DIGITS 0
|
||||
#define NS_STYLE_SPEAK_NUMERAL_CONTINUOUS 1
|
||||
|
||||
// See nsStyleAural
|
||||
#define NS_STYLE_SPEAK_PUNCTUATION_NONE 0
|
||||
#define NS_STYLE_SPEAK_PUNCTUATION_CODE 1
|
||||
|
||||
// See nsStyleAural
|
||||
#define NS_STYLE_SPEECH_RATE_X_SLOW 0
|
||||
#define NS_STYLE_SPEECH_RATE_SLOW 1
|
||||
#define NS_STYLE_SPEECH_RATE_MEDIUM 2
|
||||
#define NS_STYLE_SPEECH_RATE_FAST 3
|
||||
#define NS_STYLE_SPEECH_RATE_X_FAST 4
|
||||
#define NS_STYLE_SPEECH_RATE_FASTER 10
|
||||
#define NS_STYLE_SPEECH_RATE_SLOWER 11
|
||||
|
||||
// See nsStyleAural
|
||||
#define NS_STYLE_VOLUME_SILENT 0
|
||||
#define NS_STYLE_VOLUME_X_SOFT 1
|
||||
#define NS_STYLE_VOLUME_SOFT 2
|
||||
#define NS_STYLE_VOLUME_MEDIUM 3
|
||||
#define NS_STYLE_VOLUME_LOUD 4
|
||||
#define NS_STYLE_VOLUME_X_LOUD 5
|
||||
|
||||
// See nsStyleColor
|
||||
#define NS_STYLE_COLOR_TRANSPARENT 0
|
||||
#define NS_STYLE_COLOR_INVERT 1
|
||||
#define NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR 2
|
||||
|
||||
// See nsStyleColor
|
||||
#define NS_COLOR_MOZ_HYPERLINKTEXT -1
|
||||
#define NS_COLOR_MOZ_VISITEDHYPERLINKTEXT -2
|
||||
#define NS_COLOR_MOZ_ACTIVEHYPERLINKTEXT -3
|
||||
|
||||
// See nsStyleBackground
|
||||
#define NS_STYLE_BG_COLOR_TRANSPARENT 0x01
|
||||
#define NS_STYLE_BG_IMAGE_NONE 0x02
|
||||
#define NS_STYLE_BG_X_POSITION_PERCENT 0x04
|
||||
#define NS_STYLE_BG_X_POSITION_LENGTH 0x08
|
||||
#define NS_STYLE_BG_Y_POSITION_PERCENT 0x10
|
||||
#define NS_STYLE_BG_Y_POSITION_LENGTH 0x20
|
||||
|
||||
// See nsStyleBackground
|
||||
#define NS_STYLE_BG_ATTACHMENT_SCROLL 0
|
||||
#define NS_STYLE_BG_ATTACHMENT_FIXED 1
|
||||
|
||||
// See nsStyleBackground
|
||||
#define NS_STYLE_BG_CLIP_BORDER 0
|
||||
#define NS_STYLE_BG_CLIP_PADDING 1
|
||||
|
||||
// See nsStyleBackground
|
||||
#define NS_STYLE_BG_INLINE_POLICY_EACH_BOX 0
|
||||
#define NS_STYLE_BG_INLINE_POLICY_CONTINUOUS 1
|
||||
#define NS_STYLE_BG_INLINE_POLICY_BOUNDING_BOX 2
|
||||
|
||||
// See nsStyleBackground
|
||||
#define NS_STYLE_BG_ORIGIN_BORDER 0
|
||||
#define NS_STYLE_BG_ORIGIN_PADDING 1
|
||||
#define NS_STYLE_BG_ORIGIN_CONTENT 2
|
||||
|
||||
// See nsStyleBackground
|
||||
#define NS_STYLE_BG_REPEAT_OFF 0x00
|
||||
#define NS_STYLE_BG_REPEAT_X 0x01
|
||||
#define NS_STYLE_BG_REPEAT_Y 0x02
|
||||
#define NS_STYLE_BG_REPEAT_XY 0x03
|
||||
|
||||
// See nsStyleTable
|
||||
#define NS_STYLE_BORDER_COLLAPSE 0
|
||||
#define NS_STYLE_BORDER_SEPARATE 1
|
||||
|
||||
// See nsStyleBorder mBorder enum values
|
||||
#define NS_STYLE_BORDER_WIDTH_THIN 0
|
||||
#define NS_STYLE_BORDER_WIDTH_MEDIUM 1
|
||||
#define NS_STYLE_BORDER_WIDTH_THICK 2
|
||||
// XXX chopping block #define NS_STYLE_BORDER_WIDTH_LENGTH_VALUE 3
|
||||
|
||||
// See nsStyleBorder mBorderStyle
|
||||
#define NS_STYLE_BORDER_STYLE_NONE 0
|
||||
#define NS_STYLE_BORDER_STYLE_GROOVE 1
|
||||
#define NS_STYLE_BORDER_STYLE_RIDGE 2
|
||||
#define NS_STYLE_BORDER_STYLE_DOTTED 3
|
||||
#define NS_STYLE_BORDER_STYLE_DASHED 4
|
||||
#define NS_STYLE_BORDER_STYLE_SOLID 5
|
||||
#define NS_STYLE_BORDER_STYLE_DOUBLE 6
|
||||
#define NS_STYLE_BORDER_STYLE_BLANK 7
|
||||
#define NS_STYLE_BORDER_STYLE_INSET 8
|
||||
#define NS_STYLE_BORDER_STYLE_OUTSET 9
|
||||
#define NS_STYLE_BORDER_STYLE_HIDDEN 10
|
||||
#define NS_STYLE_BORDER_STYLE_BG_INSET 11
|
||||
#define NS_STYLE_BORDER_STYLE_BG_OUTSET 12
|
||||
#define NS_STYLE_BORDER_STYLE_BG_SOLID 13
|
||||
// a bit ORed onto the style for table border collapsing indicating that the style was
|
||||
// derived from a table with its rules attribute set
|
||||
#define NS_STYLE_BORDER_STYLE_RULES_MASK 0x10
|
||||
|
||||
// See nsStyleDisplay
|
||||
#define NS_STYLE_CLEAR_NONE 0
|
||||
#define NS_STYLE_CLEAR_LEFT 1
|
||||
#define NS_STYLE_CLEAR_RIGHT 2
|
||||
#define NS_STYLE_CLEAR_LEFT_AND_RIGHT 3
|
||||
#define NS_STYLE_CLEAR_LINE 4
|
||||
#define NS_STYLE_CLEAR_BLOCK 5
|
||||
#define NS_STYLE_CLEAR_COLUMN 6
|
||||
#define NS_STYLE_CLEAR_PAGE 7
|
||||
#define NS_STYLE_CLEAR_LAST_VALUE NS_STYLE_CLEAR_PAGE
|
||||
|
||||
// See
|
||||
#define NS_STYLE_CONTENT_OPEN_QUOTE 0
|
||||
#define NS_STYLE_CONTENT_CLOSE_QUOTE 1
|
||||
#define NS_STYLE_CONTENT_NO_OPEN_QUOTE 2
|
||||
#define NS_STYLE_CONTENT_NO_CLOSE_QUOTE 3
|
||||
|
||||
// See nsStyleColor
|
||||
#define NS_STYLE_CURSOR_AUTO 1
|
||||
#define NS_STYLE_CURSOR_CROSSHAIR 2
|
||||
#define NS_STYLE_CURSOR_DEFAULT 3 // ie: an arrow
|
||||
#define NS_STYLE_CURSOR_POINTER 4 // for links
|
||||
#define NS_STYLE_CURSOR_MOVE 5
|
||||
#define NS_STYLE_CURSOR_E_RESIZE 6
|
||||
#define NS_STYLE_CURSOR_NE_RESIZE 7
|
||||
#define NS_STYLE_CURSOR_NW_RESIZE 8
|
||||
#define NS_STYLE_CURSOR_N_RESIZE 9
|
||||
#define NS_STYLE_CURSOR_SE_RESIZE 10
|
||||
#define NS_STYLE_CURSOR_SW_RESIZE 11
|
||||
#define NS_STYLE_CURSOR_S_RESIZE 12
|
||||
#define NS_STYLE_CURSOR_W_RESIZE 13
|
||||
#define NS_STYLE_CURSOR_TEXT 14 // ie: i-beam
|
||||
#define NS_STYLE_CURSOR_WAIT 15
|
||||
#define NS_STYLE_CURSOR_HELP 16
|
||||
#define NS_STYLE_CURSOR_COPY 17 // CSS3
|
||||
#define NS_STYLE_CURSOR_ALIAS 18
|
||||
#define NS_STYLE_CURSOR_CONTEXT_MENU 19
|
||||
#define NS_STYLE_CURSOR_CELL 20
|
||||
#define NS_STYLE_CURSOR_GRAB 21
|
||||
#define NS_STYLE_CURSOR_GRABBING 22
|
||||
#define NS_STYLE_CURSOR_SPINNING 23
|
||||
#define NS_STYLE_CURSOR_COUNT_UP 24
|
||||
#define NS_STYLE_CURSOR_COUNT_DOWN 25
|
||||
#define NS_STYLE_CURSOR_COUNT_UP_DOWN 26
|
||||
#define NS_STYLE_CURSOR_MOZ_ZOOM_IN 27
|
||||
#define NS_STYLE_CURSOR_MOZ_ZOOM_OUT 28
|
||||
|
||||
|
||||
// See nsStyleDisplay
|
||||
#define NS_STYLE_DIRECTION_LTR 0
|
||||
#define NS_STYLE_DIRECTION_RTL 1
|
||||
#define NS_STYLE_DIRECTION_INHERIT 2
|
||||
|
||||
// See nsStyleDisplay
|
||||
#define NS_STYLE_DISPLAY_NONE 0
|
||||
#define NS_STYLE_DISPLAY_BLOCK 1
|
||||
#define NS_STYLE_DISPLAY_INLINE 2
|
||||
#define NS_STYLE_DISPLAY_INLINE_BLOCK 3
|
||||
#define NS_STYLE_DISPLAY_LIST_ITEM 4
|
||||
#define NS_STYLE_DISPLAY_MARKER 5
|
||||
#define NS_STYLE_DISPLAY_RUN_IN 6
|
||||
#define NS_STYLE_DISPLAY_COMPACT 7
|
||||
#define NS_STYLE_DISPLAY_TABLE 8
|
||||
#define NS_STYLE_DISPLAY_INLINE_TABLE 9
|
||||
#define NS_STYLE_DISPLAY_TABLE_ROW_GROUP 10
|
||||
#define NS_STYLE_DISPLAY_TABLE_COLUMN 11
|
||||
#define NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP 12
|
||||
#define NS_STYLE_DISPLAY_TABLE_HEADER_GROUP 13
|
||||
#define NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP 14
|
||||
#define NS_STYLE_DISPLAY_TABLE_ROW 15
|
||||
#define NS_STYLE_DISPLAY_TABLE_CELL 16
|
||||
#define NS_STYLE_DISPLAY_TABLE_CAPTION 17
|
||||
#define NS_STYLE_DISPLAY_BOX 18
|
||||
#define NS_STYLE_DISPLAY_INLINE_BOX 19
|
||||
#define NS_STYLE_DISPLAY_GRID 20
|
||||
#define NS_STYLE_DISPLAY_INLINE_GRID 21
|
||||
#define NS_STYLE_DISPLAY_GRID_GROUP 22
|
||||
#define NS_STYLE_DISPLAY_GRID_LINE 23
|
||||
#define NS_STYLE_DISPLAY_STACK 24
|
||||
#define NS_STYLE_DISPLAY_INLINE_STACK 25
|
||||
#define NS_STYLE_DISPLAY_DECK 26
|
||||
#define NS_STYLE_DISPLAY_BULLETINBOARD 27
|
||||
#define NS_STYLE_DISPLAY_POPUP 28
|
||||
#define NS_STYLE_DISPLAY_GROUPBOX 29
|
||||
#define NS_STYLE_DISPLAY_PAGE_BREAK 30
|
||||
|
||||
// See nsStyleDisplay
|
||||
#define NS_STYLE_FLOAT_NONE 0
|
||||
#define NS_STYLE_FLOAT_LEFT 1
|
||||
#define NS_STYLE_FLOAT_RIGHT 2
|
||||
|
||||
// See nsStyleFont
|
||||
#define NS_STYLE_FONT_STYLE_NORMAL 0
|
||||
#define NS_STYLE_FONT_STYLE_ITALIC 1
|
||||
#define NS_STYLE_FONT_STYLE_OBLIQUE 2
|
||||
|
||||
// See nsStyleFont
|
||||
#define NS_STYLE_FONT_VARIANT_NORMAL 0
|
||||
#define NS_STYLE_FONT_VARIANT_SMALL_CAPS 1
|
||||
|
||||
// See nsStyleFont
|
||||
#define NS_STYLE_FONT_WEIGHT_NORMAL 400
|
||||
#define NS_STYLE_FONT_WEIGHT_BOLD 700
|
||||
#define NS_STYLE_FONT_WEIGHT_BOLDER 1
|
||||
#define NS_STYLE_FONT_WEIGHT_LIGHTER -1
|
||||
|
||||
// See nsStyleFont
|
||||
#define NS_STYLE_FONT_SIZE_XXSMALL 0
|
||||
#define NS_STYLE_FONT_SIZE_XSMALL 1
|
||||
#define NS_STYLE_FONT_SIZE_SMALL 2
|
||||
#define NS_STYLE_FONT_SIZE_MEDIUM 3
|
||||
#define NS_STYLE_FONT_SIZE_LARGE 4
|
||||
#define NS_STYLE_FONT_SIZE_XLARGE 5
|
||||
#define NS_STYLE_FONT_SIZE_XXLARGE 6
|
||||
#define NS_STYLE_FONT_SIZE_XXXLARGE 7 // Only used by <font size="7">. Not specifiable in CSS.
|
||||
#define NS_STYLE_FONT_SIZE_LARGER 8
|
||||
#define NS_STYLE_FONT_SIZE_SMALLER 9
|
||||
|
||||
// See nsStyleFont
|
||||
#define NS_STYLE_FONT_STRETCH_ULTRA_CONDENSED -4
|
||||
#define NS_STYLE_FONT_STRETCH_EXTRA_CONDENSED -3
|
||||
#define NS_STYLE_FONT_STRETCH_CONDENSED -2
|
||||
#define NS_STYLE_FONT_STRETCH_SEMI_CONDENSED -1
|
||||
#define NS_STYLE_FONT_STRETCH_NORMAL 0
|
||||
#define NS_STYLE_FONT_STRETCH_SEMI_EXPANDED 1
|
||||
#define NS_STYLE_FONT_STRETCH_EXPANDED 2
|
||||
#define NS_STYLE_FONT_STRETCH_EXTRA_EXPANDED 3
|
||||
#define NS_STYLE_FONT_STRETCH_ULTRA_EXPANDED 4
|
||||
#define NS_STYLE_FONT_STRETCH_WIDER 10
|
||||
#define NS_STYLE_FONT_STRETCH_NARROWER -10
|
||||
|
||||
// See nsStyleFont mFlags
|
||||
#define NS_STYLE_FONT_DEFAULT 0x00
|
||||
#define NS_STYLE_FONT_FACE_MASK 0xFF // used to flag generic fonts
|
||||
|
||||
// See nsStyleFont - system fonts
|
||||
#define NS_STYLE_FONT_CAPTION 1 // css2
|
||||
#define NS_STYLE_FONT_ICON 2
|
||||
#define NS_STYLE_FONT_MENU 3
|
||||
#define NS_STYLE_FONT_MESSAGE_BOX 4
|
||||
#define NS_STYLE_FONT_SMALL_CAPTION 5
|
||||
#define NS_STYLE_FONT_STATUS_BAR 6
|
||||
#define NS_STYLE_FONT_WINDOW 7 // css3
|
||||
#define NS_STYLE_FONT_DOCUMENT 8
|
||||
#define NS_STYLE_FONT_WORKSPACE 9
|
||||
#define NS_STYLE_FONT_DESKTOP 10
|
||||
#define NS_STYLE_FONT_INFO 11
|
||||
#define NS_STYLE_FONT_DIALOG 12
|
||||
#define NS_STYLE_FONT_BUTTON 13
|
||||
#define NS_STYLE_FONT_PULL_DOWN_MENU 14
|
||||
#define NS_STYLE_FONT_LIST 15
|
||||
#define NS_STYLE_FONT_FIELD 16
|
||||
|
||||
// See nsStylePosition.mPosition
|
||||
#define NS_STYLE_POSITION_STATIC 0
|
||||
#define NS_STYLE_POSITION_RELATIVE 1
|
||||
#define NS_STYLE_POSITION_ABSOLUTE 2
|
||||
#define NS_STYLE_POSITION_FIXED 3
|
||||
|
||||
// See nsStylePosition.mClip
|
||||
#define NS_STYLE_CLIP_AUTO 0x00
|
||||
#define NS_STYLE_CLIP_RECT 0x01
|
||||
#define NS_STYLE_CLIP_TYPE_MASK 0x0F
|
||||
#define NS_STYLE_CLIP_LEFT_AUTO 0x10
|
||||
#define NS_STYLE_CLIP_TOP_AUTO 0x20
|
||||
#define NS_STYLE_CLIP_RIGHT_AUTO 0x40
|
||||
#define NS_STYLE_CLIP_BOTTOM_AUTO 0x80
|
||||
|
||||
// FRAME/FRAMESET/IFRAME specific values including backward compatibility. Boolean values with
|
||||
// the same meaning (e.g. 1 & yes) may need to be distinguished for correct mode processing
|
||||
#define NS_STYLE_FRAME_YES 0
|
||||
#define NS_STYLE_FRAME_NO 1
|
||||
#define NS_STYLE_FRAME_0 2
|
||||
#define NS_STYLE_FRAME_1 3
|
||||
#define NS_STYLE_FRAME_ON 4
|
||||
#define NS_STYLE_FRAME_OFF 5
|
||||
#define NS_STYLE_FRAME_AUTO 6
|
||||
#define NS_STYLE_FRAME_SCROLL 7
|
||||
#define NS_STYLE_FRAME_NOSCROLL 8
|
||||
|
||||
// See nsStylePosition.mOverflow
|
||||
#define NS_STYLE_OVERFLOW_VISIBLE 0
|
||||
#define NS_STYLE_OVERFLOW_HIDDEN 1
|
||||
#define NS_STYLE_OVERFLOW_SCROLL 2
|
||||
#define NS_STYLE_OVERFLOW_AUTO 3
|
||||
#define NS_STYLE_OVERFLOW_SCROLLBARS_NONE 4
|
||||
#define NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL 5
|
||||
#define NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL 6
|
||||
|
||||
// See nsStyleList
|
||||
#define NS_STYLE_LIST_STYLE_NONE 0
|
||||
#define NS_STYLE_LIST_STYLE_DISC 1
|
||||
#define NS_STYLE_LIST_STYLE_CIRCLE 2
|
||||
#define NS_STYLE_LIST_STYLE_SQUARE 3
|
||||
#define NS_STYLE_LIST_STYLE_DECIMAL 4
|
||||
#define NS_STYLE_LIST_STYLE_DECIMAL_LEADING_ZERO 5
|
||||
#define NS_STYLE_LIST_STYLE_LOWER_ROMAN 6
|
||||
#define NS_STYLE_LIST_STYLE_UPPER_ROMAN 7
|
||||
#define NS_STYLE_LIST_STYLE_LOWER_GREEK 8
|
||||
#define NS_STYLE_LIST_STYLE_LOWER_ALPHA 9
|
||||
#define NS_STYLE_LIST_STYLE_LOWER_LATIN 9 // == ALPHA
|
||||
#define NS_STYLE_LIST_STYLE_UPPER_ALPHA 10
|
||||
#define NS_STYLE_LIST_STYLE_UPPER_LATIN 10 // == ALPHA
|
||||
#define NS_STYLE_LIST_STYLE_HEBREW 11
|
||||
#define NS_STYLE_LIST_STYLE_ARMENIAN 12
|
||||
#define NS_STYLE_LIST_STYLE_GEORGIAN 13
|
||||
#define NS_STYLE_LIST_STYLE_CJK_IDEOGRAPHIC 14
|
||||
#define NS_STYLE_LIST_STYLE_HIRAGANA 15
|
||||
#define NS_STYLE_LIST_STYLE_KATAKANA 16
|
||||
#define NS_STYLE_LIST_STYLE_HIRAGANA_IROHA 17
|
||||
#define NS_STYLE_LIST_STYLE_KATAKANA_IROHA 18
|
||||
#define NS_STYLE_LIST_STYLE_OLD_LOWER_ROMAN 19
|
||||
#define NS_STYLE_LIST_STYLE_OLD_UPPER_ROMAN 20
|
||||
#define NS_STYLE_LIST_STYLE_OLD_LOWER_ALPHA 21
|
||||
#define NS_STYLE_LIST_STYLE_OLD_UPPER_ALPHA 22
|
||||
#define NS_STYLE_LIST_STYLE_OLD_DECIMAL 23
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_CJK_HEAVENLY_STEM 24
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_CJK_EARTHLY_BRANCH 25
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_INFORMAL 26
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_FORMAL 27
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_INFORMAL 28
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_FORMAL 29
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_JAPANESE_INFORMAL 30
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_JAPANESE_FORMAL 31
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_ARABIC_INDIC 32
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_PERSIAN 33
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_URDU 34
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_DEVANAGARI 35
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_GURMUKHI 36
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_GUJARATI 37
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_ORIYA 38
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_KANNADA 39
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_MALAYALAM 40
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_BENGALI 41
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_TAMIL 42
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_TELUGU 43
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_THAI 44
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_LAO 45
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_MYANMAR 46
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_KHMER 47
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_HANGUL 48
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_HANGUL_CONSONANT 49
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME 50
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_NUMERIC 51
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_AM 52
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ER 53
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ET 54
|
||||
|
||||
// See nsStyleList
|
||||
#define NS_STYLE_LIST_STYLE_POSITION_INSIDE 0
|
||||
#define NS_STYLE_LIST_STYLE_POSITION_OUTSIDE 1
|
||||
|
||||
// See nsStyleMargin
|
||||
#define NS_STYLE_MARGIN_SIZE_AUTO 0
|
||||
|
||||
// See nsStyleText
|
||||
//
|
||||
// Note: make sure the numbers are less than the numbers that start
|
||||
// the vertical_align values below!
|
||||
#define NS_STYLE_TEXT_ALIGN_DEFAULT 0
|
||||
#define NS_STYLE_TEXT_ALIGN_LEFT 1
|
||||
#define NS_STYLE_TEXT_ALIGN_RIGHT 2
|
||||
#define NS_STYLE_TEXT_ALIGN_CENTER 3
|
||||
#define NS_STYLE_TEXT_ALIGN_JUSTIFY 4
|
||||
#define NS_STYLE_TEXT_ALIGN_CHAR 5 //align based on a certain character, for table cell
|
||||
#define NS_STYLE_TEXT_ALIGN_MOZ_CENTER 6
|
||||
#define NS_STYLE_TEXT_ALIGN_MOZ_RIGHT 7
|
||||
|
||||
// See nsStyleText, nsStyleFont
|
||||
#define NS_STYLE_TEXT_DECORATION_NONE 0
|
||||
#define NS_STYLE_TEXT_DECORATION_UNDERLINE NS_FONT_DECORATION_UNDERLINE
|
||||
#define NS_STYLE_TEXT_DECORATION_OVERLINE NS_FONT_DECORATION_OVERLINE
|
||||
#define NS_STYLE_TEXT_DECORATION_LINE_THROUGH NS_FONT_DECORATION_LINE_THROUGH
|
||||
#define NS_STYLE_TEXT_DECORATION_BLINK 0x08
|
||||
#define NS_STYLE_TEXT_DECORATION_OVERRIDE_ALL 0x10
|
||||
#define NS_STYLE_TEXT_DECORATION_PREF_ANCHORS 0x20
|
||||
|
||||
// See nsStyleText
|
||||
#define NS_STYLE_TEXT_TRANSFORM_NONE 0
|
||||
#define NS_STYLE_TEXT_TRANSFORM_CAPITALIZE 1
|
||||
#define NS_STYLE_TEXT_TRANSFORM_LOWERCASE 2
|
||||
#define NS_STYLE_TEXT_TRANSFORM_UPPERCASE 3
|
||||
|
||||
// See nsStyleText
|
||||
// Note: these values pickup after the text-align values because there
|
||||
// are a few html cases where an object can have both types of
|
||||
// alignment applied with a single attribute
|
||||
#define NS_STYLE_VERTICAL_ALIGN_BASELINE 10
|
||||
#define NS_STYLE_VERTICAL_ALIGN_SUB 11
|
||||
#define NS_STYLE_VERTICAL_ALIGN_SUPER 12
|
||||
#define NS_STYLE_VERTICAL_ALIGN_TOP 13
|
||||
#define NS_STYLE_VERTICAL_ALIGN_TEXT_TOP 14
|
||||
#define NS_STYLE_VERTICAL_ALIGN_MIDDLE 15
|
||||
#define NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM 16
|
||||
#define NS_STYLE_VERTICAL_ALIGN_BOTTOM 17
|
||||
|
||||
// See nsStyleDisplay
|
||||
#define NS_STYLE_VISIBILITY_HIDDEN 0
|
||||
#define NS_STYLE_VISIBILITY_VISIBLE 1
|
||||
#define NS_STYLE_VISIBILITY_COLLAPSE 2
|
||||
|
||||
// See nsStyleText
|
||||
#define NS_STYLE_WHITESPACE_NORMAL 0
|
||||
#define NS_STYLE_WHITESPACE_PRE 1
|
||||
#define NS_STYLE_WHITESPACE_NOWRAP 2
|
||||
#define NS_STYLE_WHITESPACE_MOZ_PRE_WRAP 3
|
||||
|
||||
// See nsStyleText
|
||||
#define NS_STYLE_UNICODE_BIDI_NORMAL 0
|
||||
#define NS_STYLE_UNICODE_BIDI_EMBED 1
|
||||
#define NS_STYLE_UNICODE_BIDI_OVERRIDE 2
|
||||
|
||||
// See nsStyleTable (here for HTML 4.0 for now, should probably change to side flags)
|
||||
#define NS_STYLE_TABLE_FRAME_NONE 0
|
||||
#define NS_STYLE_TABLE_FRAME_ABOVE 1
|
||||
#define NS_STYLE_TABLE_FRAME_BELOW 2
|
||||
#define NS_STYLE_TABLE_FRAME_HSIDES 3
|
||||
#define NS_STYLE_TABLE_FRAME_VSIDES 4
|
||||
#define NS_STYLE_TABLE_FRAME_LEFT 5
|
||||
#define NS_STYLE_TABLE_FRAME_RIGHT 6
|
||||
#define NS_STYLE_TABLE_FRAME_BOX 7
|
||||
#define NS_STYLE_TABLE_FRAME_BORDER 8
|
||||
|
||||
// See nsStyleTable
|
||||
#define NS_STYLE_TABLE_RULES_NONE 0
|
||||
#define NS_STYLE_TABLE_RULES_GROUPS 1
|
||||
#define NS_STYLE_TABLE_RULES_ROWS 2
|
||||
#define NS_STYLE_TABLE_RULES_COLS 3
|
||||
#define NS_STYLE_TABLE_RULES_ALL 4
|
||||
|
||||
#define NS_STYLE_TABLE_COLS_NONE (-1)
|
||||
#define NS_STYLE_TABLE_COLS_ALL PRInt32(1 << 30)
|
||||
|
||||
#define NS_STYLE_TABLE_LAYOUT_AUTO 0
|
||||
#define NS_STYLE_TABLE_LAYOUT_FIXED 1
|
||||
|
||||
#define NS_STYLE_TABLE_EMPTY_CELLS_HIDE 0
|
||||
#define NS_STYLE_TABLE_EMPTY_CELLS_SHOW 1
|
||||
#define NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND 2
|
||||
|
||||
// CAPTION_SIDE uses NS_SIDE_*
|
||||
|
||||
// constants for cell "scope" attribute
|
||||
#define NS_STYLE_CELL_SCOPE_ROW 0
|
||||
#define NS_STYLE_CELL_SCOPE_COL 1
|
||||
#define NS_STYLE_CELL_SCOPE_ROWGROUP 2
|
||||
#define NS_STYLE_CELL_SCOPE_COLGROUP 3
|
||||
|
||||
// See nsStylePage
|
||||
#define NS_STYLE_PAGE_MARKS_NONE 0x00
|
||||
#define NS_STYLE_PAGE_MARKS_CROP 0x01
|
||||
#define NS_STYLE_PAGE_MARKS_REGISTER 0x02
|
||||
|
||||
// See nsStylePage
|
||||
#define NS_STYLE_PAGE_SIZE_AUTO 0
|
||||
#define NS_STYLE_PAGE_SIZE_PORTRAIT 1
|
||||
#define NS_STYLE_PAGE_SIZE_LANDSCAPE 2
|
||||
|
||||
// See nsStyleBreaks
|
||||
#define NS_STYLE_PAGE_BREAK_AUTO 0
|
||||
#define NS_STYLE_PAGE_BREAK_ALWAYS 1
|
||||
#define NS_STYLE_PAGE_BREAK_AVOID 2
|
||||
#define NS_STYLE_PAGE_BREAK_LEFT 3
|
||||
#define NS_STYLE_PAGE_BREAK_RIGHT 4
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
// Some of our constants must map to the same values as those defined in
|
||||
// nsISVG{,Path,Glyph}GeometrySource.idl/
|
||||
// I don't want to add a dependency on the SVG module
|
||||
// everywhere by #include'ing nsISVG{,Path,Glyph}GeometrySource.h, so these consts
|
||||
// have to be kept in sync manually.
|
||||
|
||||
// dominant-baseline
|
||||
#define NS_STYLE_DOMINANT_BASELINE_AUTO 0
|
||||
#define NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT 1
|
||||
#define NS_STYLE_DOMINANT_BASELINE_NO_CHANGE 2
|
||||
#define NS_STYLE_DOMINANT_BASELINE_RESET_SIZE 3
|
||||
#define NS_STYLE_DOMINANT_BASELINE_ALPHABETIC 4
|
||||
#define NS_STYLE_DOMINANT_BASELINE_HANGING 5
|
||||
#define NS_STYLE_DOMINANT_BASELINE_IDEOGRAPHIC 6
|
||||
#define NS_STYLE_DOMINANT_BASELINE_MATHEMATICAL 7
|
||||
#define NS_STYLE_DOMINANT_BASELINE_CENTRAL 8
|
||||
#define NS_STYLE_DOMINANT_BASELINE_MIDDLE 9
|
||||
#define NS_STYLE_DOMINANT_BASELINE_TEXT_AFTER_EDGE 10
|
||||
#define NS_STYLE_DOMINANT_BASELINE_TEXT_BEFORE_EDGE 11
|
||||
#define NS_STYLE_DOMINANT_BASELINE_TEXT_TOP 12
|
||||
#define NS_STYLE_DOMINANT_BASELINE_TEXT_BOTTOM 13
|
||||
|
||||
// fill-rule
|
||||
#define NS_STYLE_FILL_RULE_NONZERO 0 /* == nsISVGGeometrySource::FILL_RULE_NONZERO */
|
||||
#define NS_STYLE_FILL_RULE_EVENODD 1 /* == nsISVGGeometrySource::FILL_RULE_EVENODD */
|
||||
|
||||
// pointer-events
|
||||
#define NS_STYLE_POINTER_EVENTS_NONE 0
|
||||
#define NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED 1
|
||||
#define NS_STYLE_POINTER_EVENTS_VISIBLEFILL 2
|
||||
#define NS_STYLE_POINTER_EVENTS_VISIBLESTROKE 3
|
||||
#define NS_STYLE_POINTER_EVENTS_VISIBLE 4
|
||||
#define NS_STYLE_POINTER_EVENTS_PAINTED 5
|
||||
#define NS_STYLE_POINTER_EVENTS_FILL 6
|
||||
#define NS_STYLE_POINTER_EVENTS_STROKE 7
|
||||
#define NS_STYLE_POINTER_EVENTS_ALL 8
|
||||
|
||||
// shape-rendering
|
||||
#define NS_STYLE_SHAPE_RENDERING_AUTO 0 /* == nsISVGPathGeometrySource::SHAPE_RENDERING_AUTO */
|
||||
#define NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED 1 /* == nsISVGPathGeometrySource::SHAPE_RENDERING_OPTIMIZESPEED */
|
||||
#define NS_STYLE_SHAPE_RENDERING_CRISPEDGES 2 /* == nsISVGPathGeometrySource::SHAPE_RENDERING_CRISPEDGES */
|
||||
#define NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION 3 /* == nsISVGPathGeometrySource::SHAPE_RENDERING_GEOMETRICPRECISION */
|
||||
|
||||
|
||||
// stroke-linecap
|
||||
#define NS_STYLE_STROKE_LINECAP_BUTT 0 /* == nsISVGGeometrySource::STROKE_LINECAP_BUTT */
|
||||
#define NS_STYLE_STROKE_LINECAP_ROUND 1 /* == nsISVGGeometrySource::STROKE_LINECAP_ROUND */
|
||||
#define NS_STYLE_STROKE_LINECAP_SQUARE 2 /* == nsISVGGeometrySource::STROKE_LINECAP_SQUARE */
|
||||
|
||||
// stroke-linejoin
|
||||
#define NS_STYLE_STROKE_LINEJOIN_MITER 0 /* == nsISVGGeometrySource::STROKE_LINEJOIN_MITER */
|
||||
#define NS_STYLE_STROKE_LINEJOIN_ROUND 1 /* == nsISVGGeometrySource::STROKE_LINEJOIN_ROUND */
|
||||
#define NS_STYLE_STROKE_LINEJOIN_BEVEL 2 /* == nsISVGGeometrySource::STROKE_LINEJOIN_BEVEL */
|
||||
|
||||
// text-anchor
|
||||
#define NS_STYLE_TEXT_ANCHOR_START 0
|
||||
#define NS_STYLE_TEXT_ANCHOR_MIDDLE 1
|
||||
#define NS_STYLE_TEXT_ANCHOR_END 2
|
||||
|
||||
// text-rendering
|
||||
#define NS_STYLE_TEXT_RENDERING_AUTO 0 /* == nsISVGGlyphGeometrySource::TEXT_RENDERING_AUTO */
|
||||
#define NS_STYLE_TEXT_RENDERING_OPTIMIZESPEED 1 /* == nsISVGG.G.S.::TEXT_RENDERING_OPTIMIZESPEED */
|
||||
#define NS_STYLE_TEXT_RENDERING_OPTIMIZELEGIBILITY 2 /* == nsISVGG.G.S.::TEXT_RENDERING_OPTIMIZELEGIBILITY */
|
||||
#define NS_STYLE_TEXT_RENDERING_GEOMETRICPRECISION 3 /* == nsISVGG.G.S.::TEXT_RENDERING_GEOMETRICPRECISION */
|
||||
|
||||
#endif // MOZ_SVG
|
||||
|
||||
#endif /* nsStyleConsts_h___ */
|
||||
209
mozilla/layout/build/Makefile.in
Normal file
209
mozilla/layout/build/Makefile.in
Normal file
@@ -0,0 +1,209 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
BUILD_DATE = gbdate.h
|
||||
|
||||
MODULE = layout
|
||||
LIBRARY_NAME = gklayout
|
||||
EXPORT_LIBRARY = 1
|
||||
IS_COMPONENT = 1
|
||||
MODULE_NAME = nsLayoutModule
|
||||
GRE_MODULE = 1
|
||||
|
||||
PACKAGE_FILE = layout.pkg
|
||||
PACKAGE_VARS += MOZ_XUL
|
||||
|
||||
EXTRA_DSO_LIBS = gkgfx
|
||||
ifdef MOZ_PERF_METRICS
|
||||
EXTRA_DSO_LIBS += mozutil_s
|
||||
endif
|
||||
|
||||
REQUIRES = xpcom \
|
||||
string \
|
||||
content \
|
||||
gfx \
|
||||
widget \
|
||||
view \
|
||||
locale \
|
||||
necko \
|
||||
dom \
|
||||
editor \
|
||||
webshell \
|
||||
docshell \
|
||||
htmlparser \
|
||||
js \
|
||||
xpconnect \
|
||||
uriloader \
|
||||
caps \
|
||||
necko2 \
|
||||
rdf \
|
||||
xuldoc \
|
||||
imglib2 \
|
||||
pref \
|
||||
unicharutil \
|
||||
xul \
|
||||
xultmpl \
|
||||
lwbrk \
|
||||
plugin \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS = \
|
||||
nsLayoutModule.cpp \
|
||||
nsContentHTTPStartup.cpp \
|
||||
nsContentDLF.cpp \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = nsLayoutCID.h
|
||||
|
||||
SHARED_LIBRARY_LIBS = \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkhtmlbase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkhtmldoc_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkhtmlforms_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkhtmlstyle_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkhtmltable_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkxulbase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkbase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconbase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconevents_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconhtmlcon_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconhtmldoc_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconhtmlstyle_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconxmlcon_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconxmldoc_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconxbl_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconxuldoc_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconshared_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkview_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_XUL
|
||||
SHARED_LIBRARY_LIBS += \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkxultree_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkxulgrid_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconxulcon_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconxultmpl_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifdef MOZ_MATHML
|
||||
SHARED_LIBRARY_LIBS += \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkmathmlcon_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkmathmlbase_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifdef MOZ_SVG
|
||||
SHARED_LIBRARY_LIBS += \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gksvgbase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconsvgdoc_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkcontentsvg_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_SVG_RENDERER_GDIPLUS
|
||||
SHARED_LIBRARY_LIBS += \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gksvgrenderergdiplus_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
|
||||
OS_LIBS += \
|
||||
Gdiplus.lib \
|
||||
$(NULL)
|
||||
endif
|
||||
ifdef MOZ_SVG_RENDERER_LIBART
|
||||
SHARED_LIBRARY_LIBS += \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gksvgrendererlibart_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
endif
|
||||
endif
|
||||
|
||||
EXTRA_DSO_LDOPTS = \
|
||||
$(LIBS_DIR) \
|
||||
$(EXTRA_DSO_LIBS) \
|
||||
$(MOZ_UNICHARUTIL_LIBS) \
|
||||
$(MOZ_COMPONENT_LIBS) \
|
||||
$(MOZ_JS_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_SVG_RENDERER_LIBART
|
||||
EXTRA_DSO_LDOPTS += $(MOZ_LIBART_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_ENABLE_GTK2
|
||||
EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS) \
|
||||
$(NULL)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
||||
EXTRA_DSO_LDOPTS += \
|
||||
$(TK_LIBS) \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
INCLUDES += -I$(srcdir)/../base/src \
|
||||
-I$(srcdir)/../html/base/src \
|
||||
-I$(srcdir)/../html/forms/src \
|
||||
-I$(srcdir)/../html/style/src \
|
||||
-I$(srcdir)/../xul/content/src \
|
||||
-I$(srcdir)/../xul/base/src \
|
||||
-I$(srcdir)/../../content/base/src \
|
||||
-I$(srcdir)/../../content/html/content/src \
|
||||
-I$(srcdir)/../../content/html/document/src \
|
||||
-I$(srcdir)/../../content/html/style/src \
|
||||
-I$(srcdir)/../../content/xul/content/src \
|
||||
-I$(srcdir)/../../content/xul/templates/src \
|
||||
-I$(srcdir)/../../content/events/src \
|
||||
-I$(topsrcdir)/view/src \
|
||||
-I. \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_MATHML
|
||||
INCLUDES += -I$(srcdir)/../mathml/content/src
|
||||
endif
|
||||
|
||||
ifdef MOZ_SVG
|
||||
INCLUDES += -I$(srcdir)/../../content/svg/content/src
|
||||
endif
|
||||
|
||||
DEFINES += -D_IMPL_NS_LAYOUT
|
||||
|
||||
GARBAGE += $(BUILD_DATE)
|
||||
|
||||
ifeq ($(OS_ARCH),IRIX)
|
||||
ifeq ($(GNU_CXX),1)
|
||||
LDFLAGS += -Wl,-LD_LAYOUT:lgot_buffer=50
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
export:: $(BUILD_DATE)
|
||||
|
||||
$(BUILD_DATE):: gbdate.pl $(wildcard $(SHARED_LIBRARY_LIBS))
|
||||
$(RM) $@
|
||||
$(PERL) $(srcdir)/gbdate.pl > $@
|
||||
1253
mozilla/layout/build/nsLayoutModule.cpp
Normal file
1253
mozilla/layout/build/nsLayoutModule.cpp
Normal file
File diff suppressed because it is too large
Load Diff
2429
mozilla/layout/html/base/src/nsFrameManager.cpp
Normal file
2429
mozilla/layout/html/base/src/nsFrameManager.cpp
Normal file
File diff suppressed because it is too large
Load Diff
13321
mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp
Normal file
13321
mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp
Normal file
File diff suppressed because it is too large
Load Diff
32
mozilla/layout/svg/Makefile.in
Normal file
32
mozilla/layout/svg/Makefile.in
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = base renderer
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user