Compare commits
1648 Commits
dcvviewer
...
wip/smcv/c
Author | SHA1 | Date | |
---|---|---|---|
2efd0dfc06 | |||
0b6a3166ed | |||
066bc5986d | |||
e8b09df8d2 | |||
1571f8078a | |||
510cbef15a | |||
99c9a14bc8 | |||
b8003807b0 | |||
8e1bd64e05 | |||
5aa56aa7f5 | |||
c2c4f74923 | |||
f8daa6bc70 | |||
5b07ccd0a7 | |||
ae4d299499 | |||
8798325489 | |||
9e34028742 | |||
258f859e8d | |||
9d3e4fd402 | |||
03c65b93e6 | |||
db975bd2a8 | |||
4e27a4ea1d | |||
346cadeddb | |||
f60c485117 | |||
19550c28f9 | |||
c4949b553d | |||
675a2d13b9 | |||
f4d9953b9c | |||
6db94a0b77 | |||
9bf6faf639 | |||
4434a17d08 | |||
c65f63b647 | |||
79d981aac9 | |||
2791f5b466 | |||
e68bb27df2 | |||
e12b2c417e | |||
0fbda366e8 | |||
106d332c71 | |||
c42c11583d | |||
8c131b32b1 | |||
c8e12ead08 | |||
8a541c08fb | |||
dfed5f6a11 | |||
96dd794fd1 | |||
73a436362a | |||
7343b8d817 | |||
dbf47b652e | |||
b97a6e62a3 | |||
4fac1a4862 | |||
70ba844c3c | |||
bc0b9f7628 | |||
c971d6ea1f | |||
dac09a8e23 | |||
11f224f4b0 | |||
a1be7cdbd7 | |||
82d96aebe1 | |||
c14ba5937f | |||
e50e14af82 | |||
787d9a5a15 | |||
3c29bf7491 | |||
dc8e5c7f8b | |||
0a986fc885 | |||
04e983383f | |||
7ae6e0101c | |||
affb3de829 | |||
24d7a7ad0b | |||
4729cb779e | |||
c8837a8de5 | |||
283cccbe9f | |||
a7bf6322e3 | |||
1d5f9b6917 | |||
3c068ef135 | |||
2becb3dd29 | |||
55f5177fe0 | |||
037b68ab8e | |||
b45d5ef3f5 | |||
7e4e371466 | |||
fbfa136bbb | |||
434845dbe5 | |||
967511be61 | |||
43c7a82461 | |||
066e78c9b3 | |||
08f47fee16 | |||
afe4cd482e | |||
3fed768db4 | |||
8c52b431bb | |||
d9ffbf0576 | |||
b0953b92ba | |||
819f9afa31 | |||
7a0bc5af7f | |||
c5fbab6bad | |||
f4301b77fa | |||
a3f27dfd89 | |||
73ce9c2e81 | |||
fd27c7c444 | |||
a51807fc1e | |||
3c35a78769 | |||
ae7cb7a3bf | |||
531b0ab300 | |||
7cc604b9e5 | |||
f3a65c9b32 | |||
dec97a6541 | |||
cfa2d1abf7 | |||
d9fb6b5ca2 | |||
696b534570 | |||
38db4a5a65 | |||
6f62c5b575 | |||
d823a54b5d | |||
e06daa58c3 | |||
1880e22229 | |||
bd28581471 | |||
82470cd40d | |||
b4972f573c | |||
c97c409c50 | |||
989e2ccc46 | |||
e09e62d585 | |||
033f0d11bf | |||
668eb318c7 | |||
449cbe153b | |||
9b8e5a05f5 | |||
d14c8cf9a4 | |||
4571de5772 | |||
62f449d7d5 | |||
476ef76de6 | |||
48de81b63e | |||
2ee3d5392b | |||
0f2a33cc9c | |||
2ce622f057 | |||
76083d76af | |||
132060db21 | |||
c7f2ae1b16 | |||
24a0e72ae9 | |||
5c4938e479 | |||
322b51cded | |||
b46bc98d44 | |||
da5be1fdea | |||
bc18438cb0 | |||
e3c0fcf7d5 | |||
73cb96ddb9 | |||
1cb59f44ab | |||
a55a286b15 | |||
18e7b814f2 | |||
e073076119 | |||
5d58156134 | |||
c38fa4fa5c | |||
5201d77b0b | |||
aedf692e0c | |||
5dfd86ebe7 | |||
9e41f687a0 | |||
61356caa06 | |||
4300f1f91d | |||
d26dc4ae44 | |||
bd45a00fa3 | |||
793a9d45e1 | |||
43295bdcc4 | |||
43e12dab7b | |||
c4535fdf85 | |||
d2c3272eb7 | |||
90c4b6492f | |||
b7bf42e778 | |||
e849667be6 | |||
424016d66c | |||
a4f55d4986 | |||
1b33a5a3a7 | |||
36111270aa | |||
6e0cfd3e55 | |||
5671f0a284 | |||
a7e63bea6c | |||
94b3c334e5 | |||
efb0addb62 | |||
988da215c8 | |||
551a57ed7f | |||
b7366b5b53 | |||
5e8d8b9ade | |||
4726f3d5d3 | |||
91ef7515de | |||
317f6c0910 | |||
6a3d521466 | |||
1363246d44 | |||
0b6560fac4 | |||
d4c3870286 | |||
4bdf9a1e70 | |||
1909977a67 | |||
655a783891 | |||
a4596becc4 | |||
7015bb3efd | |||
d2c762cc66 | |||
04d429b743 | |||
0b21dcfe08 | |||
7c939d78c2 | |||
8a2b82897d | |||
e95c365cf0 | |||
a32cb7133b | |||
967966cdee | |||
06d67b6abf | |||
f15ce01e2b | |||
e48516679c | |||
65a6c4c361 | |||
b51c468c0f | |||
2e7d02f1ce | |||
dc4fe780f7 | |||
d682cdb078 | |||
ff7a42b8bc | |||
4b1805c306 | |||
03c00e4944 | |||
cb05b16414 | |||
b9fe9c736a | |||
3dd8861fbf | |||
753066598f | |||
3da8c1bfdc | |||
f8ee974628 | |||
f36120757f | |||
bc178b711f | |||
5dad87cfb9 | |||
0f8f607e4c | |||
282aada13a | |||
47002bf0cd | |||
3d47c7edc1 | |||
bc350f37f5 | |||
b55e2e1df9 | |||
43baf643d4 | |||
21b8ae10b8 | |||
425a10de11 | |||
d0ef660ff6 | |||
506e06589b | |||
1d75d5aa2f | |||
645d596f9d | |||
3e967d731a | |||
167fd07e01 | |||
fbd6366edd | |||
23d0bdd46d | |||
0d0834f87c | |||
676997e0af | |||
633d5d1b84 | |||
f620f43353 | |||
eb6e1f694a | |||
6aead84d7a | |||
5b984c1e53 | |||
7660ca2579 | |||
ac52631e8a | |||
5b30a52bbd | |||
a5294ce55f | |||
553372ffb7 | |||
f672d6ee3b | |||
ba3417667f | |||
50fa002a19 | |||
f0718c7d95 | |||
e74c2e42cf | |||
ce64ab5449 | |||
8df3b21a51 | |||
08431a127a | |||
3f068d1138 | |||
6f0e5b0b56 | |||
fe27a6ea3b | |||
1301770dcb | |||
1551b6d386 | |||
a6f94696e2 | |||
c389aadff9 | |||
37eda498f2 | |||
7d2df52336 | |||
5d27e5415d | |||
625773fba4 | |||
7d79ae7b07 | |||
5817779656 | |||
5f5ce08ba4 | |||
223f033780 | |||
50e0ae3cf3 | |||
a8f6cada88 | |||
7f488e3e1d | |||
059d2144b2 | |||
902302a174 | |||
f98ca7683c | |||
479fb0549c | |||
52e5d6fc94 | |||
09a6031c69 | |||
dbe919ef92 | |||
2907ee93cc | |||
aa136f4515 | |||
8748841094 | |||
86f2885e98 | |||
bb5ea0580f | |||
2cfdbbd730 | |||
9f31e7252c | |||
e8ea5ecd8a | |||
ed10aea44d | |||
fed5f4d9aa | |||
73250b8f4c | |||
f6700f19a7 | |||
ea34915df3 | |||
37742c5cde | |||
cdd27d0e53 | |||
82778f72a4 | |||
d846fabda2 | |||
2d94a34a14 | |||
92710d8f89 | |||
da600b8400 | |||
6aa546145f | |||
3956ffd5e8 | |||
05341221d4 | |||
95642d05a6 | |||
51cd8aed96 | |||
ac01e69a67 | |||
a68e6972a2 | |||
55cf1c1496 | |||
343de21af5 | |||
3c157242fa | |||
32c99513c8 | |||
40c345d6f3 | |||
8beef8ccd0 | |||
62d0dd907b | |||
0462208d4e | |||
6885c37784 | |||
238e41d493 | |||
8699482475 | |||
dcaa45fc0c | |||
3c4f5ddcb4 | |||
3aece84499 | |||
40fb06ca17 | |||
d4c070da88 | |||
d052f9c070 | |||
3b88af94e3 | |||
1f00aba92c | |||
ec1195e3ff | |||
18b661cc93 | |||
8592a8591b | |||
7fa7c2aeb7 | |||
41130b08eb | |||
1d20045247 | |||
c131a9b7fa | |||
2ecbf6d746 | |||
a13d60aae5 | |||
ed4b80cee5 | |||
0a6034ef3a | |||
c9a5b2b22f | |||
db9b60cc63 | |||
fa74da0039 | |||
b310e1d9d7 | |||
0053ef2e16 | |||
4133b73632 | |||
074f4974dd | |||
0700f3749f | |||
0487e6f11f | |||
23da6c2426 | |||
67dd0b4fec | |||
6989fea767 | |||
df33255162 | |||
5319949a45 | |||
aba0b9ef64 | |||
512bb7d1cd | |||
d2a12ee0fa | |||
531a195cf1 | |||
509e9ca5a0 | |||
0743381573 | |||
267f712068 | |||
0b102afb53 | |||
304a103659 | |||
2d09e95934 | |||
be11525b28 | |||
adc38f902a | |||
8abdf16a39 | |||
4cc29cfb61 | |||
121c5d2a92 | |||
50ff30bf2b | |||
26e1e495a0 | |||
480e7d44be | |||
1c1adb0036 | |||
6b852e6cb3 | |||
6e966e47f2 | |||
227eea1e31 | |||
79920d66d4 | |||
6cd0aa429f | |||
15d3de0099 | |||
38fb59a6a6 | |||
748f5bb3e6 | |||
3c55475391 | |||
dd6e371bac | |||
00d900e46d | |||
a4f11bef47 | |||
c4f76622a6 | |||
f80e5dd8e4 | |||
f484efaac1 | |||
f97804f4f4 | |||
5c37f5104e | |||
d08a8de265 | |||
6c82feb1b8 | |||
0dac91cffc | |||
ff381d1d52 | |||
05e9d6ab9e | |||
d22f947bf5 | |||
9b97e5ed58 | |||
7f9fac2ba2 | |||
64eaf70279 | |||
e3149e6021 | |||
166a464515 | |||
38e58b837b | |||
39a8c047d1 | |||
c979cd95aa | |||
6831f2edb4 | |||
372d73e275 | |||
0ada90024f | |||
46e38ff61a | |||
1e0b015ce8 | |||
72054332c5 | |||
d30ef0dd3b | |||
84275688f3 | |||
90a1eb4275 | |||
73e3207a85 | |||
8a6673bb55 | |||
35c16a9f4b | |||
390fd7ddcf | |||
4b513a31ae | |||
25c9e66c73 | |||
649911b6b3 | |||
8c332a4704 | |||
21994bb00d | |||
87a06c63ad | |||
09026e5f0e | |||
1f190a7cfe | |||
86168b945c | |||
680a54aff6 | |||
548073ec27 | |||
d366fb335d | |||
7fbb47b2bb | |||
3881c1f952 | |||
038a3170bf | |||
f27de9620a | |||
969ad54feb | |||
987ce5bec0 | |||
d600cd9aee | |||
1fc7935858 | |||
b5354fb3cd | |||
01aaced129 | |||
ff59b5d041 | |||
92f0eb9d14 | |||
e6913d1471 | |||
d495dc6c63 | |||
88bb24f66e | |||
6e7316ef11 | |||
9fa56176fd | |||
fb81199dec | |||
b7f47ea17f | |||
71101cab82 | |||
c4b28b0939 | |||
38954de11c | |||
964ea60090 | |||
159c83b914 | |||
b68c630329 | |||
fe1ccea1e1 | |||
c483b52d24 | |||
f3dcba27f5 | |||
86ccc28413 | |||
0d039c3ba3 | |||
adcbc2aa5f | |||
860906246e | |||
37d7df612b | |||
0baf4578c8 | |||
2d6665950c | |||
1c98f01a65 | |||
e3f30371aa | |||
1a14c4d3c9 | |||
292d2754ae | |||
fe42d56db3 | |||
a11f9bd513 | |||
7f6cafa847 | |||
1b67f49f7f | |||
c447d76cd4 | |||
d327cedb83 | |||
0c55e87d8f | |||
81d11ac0a8 | |||
84261d1db3 | |||
a0441ad666 | |||
67152916e1 | |||
b98ebe60b2 | |||
ad8ba69423 | |||
bf24b816c2 | |||
a9b1134dfb | |||
6fb6a23389 | |||
2da27720ca | |||
f9326cfa3d | |||
963108a9a6 | |||
b8355a6686 | |||
4c421959dc | |||
aedcfcd010 | |||
d7c7311ceb | |||
41d72e86e0 | |||
282b09c17e | |||
c5d2fc856a | |||
f5a28aa9e4 | |||
6206511846 | |||
a209a14898 | |||
3e6a55aff0 | |||
704fea6323 | |||
8c1e6ebde0 | |||
81512ad0dc | |||
d122b66abc | |||
44ae38599f | |||
df642eb150 | |||
722ae2b77a | |||
54194e67e3 | |||
c0c74484bc | |||
5149e1e43a | |||
ac2c870177 | |||
f21595687f | |||
e51279dcf0 | |||
9b58033375 | |||
0bf9727a31 | |||
d053ccfb18 | |||
7cc02cf24e | |||
e07478f8bc | |||
efe1bc2e59 | |||
41992757e0 | |||
445af61a68 | |||
03ef335a70 | |||
b4226daadb | |||
b70611e3cf | |||
35fe6a40ed | |||
4f8e518d42 | |||
d2953e0d33 | |||
b45b03b063 | |||
c06fae4741 | |||
76e0d7293d | |||
0e0afa240e | |||
560055fc97 | |||
3e1db33967 | |||
aceadfe305 | |||
ae344a606d | |||
8b70232d25 | |||
1ecfdb1748 | |||
f7646af810 | |||
586723eb44 | |||
5c704e3f81 | |||
1981449776 | |||
98d7a542b0 | |||
438f75e6b3 | |||
f3cdc9906c | |||
ae00f5653e | |||
7c3172a0af | |||
73dcb9fa22 | |||
3ace2b9a28 | |||
01bab81727 | |||
c1fc46e3db | |||
4abec2f8e7 | |||
ee854ed7ab | |||
ec9d7145c8 | |||
3a8c545b32 | |||
6c1e9b51f9 | |||
851024f730 | |||
b23fc99655 | |||
0f58c98386 | |||
ebc07871eb | |||
840c50b00d | |||
e76ff8530b | |||
c273f74025 | |||
9ff4f29bac | |||
dcba7c5044 | |||
5b1620475e | |||
934a829a57 | |||
264f68858a | |||
56ce25360c | |||
d8b7905662 | |||
ae1768bf4f | |||
cbef49fd74 | |||
bcbb44fdea | |||
0d185b21fd | |||
e4d5cb72ee | |||
c37e2523ac | |||
c4f8b93357 | |||
06dae3a8cc | |||
76240e24f7 | |||
9b0392e988 | |||
aa0aa89a1e | |||
b91d66bf98 | |||
832c0fb0ea | |||
2fbbf657d5 | |||
81de2c2913 | |||
ffad55c66f | |||
2212a44cc2 | |||
98040e67a2 | |||
e7928ce6ee | |||
b41094ef5f | |||
d699c80ac2 | |||
35316a034f | |||
c05019e232 | |||
861e5caf8c | |||
8e6821bc65 | |||
05301d280c | |||
c1bdaba5ac | |||
640ad4718e | |||
985b3b32ce | |||
795491c80a | |||
f5e2310dc7 | |||
c5a936e0e8 | |||
600dd155ce | |||
99043e2af2 | |||
e0d2e1096d | |||
136c09585d | |||
15b46a6f88 | |||
c27fc3537b | |||
6cc748cce9 | |||
afd645193a | |||
09af21cd0b | |||
2731be6929 | |||
5257c6ecc2 | |||
5723bd8ec7 | |||
1e9682b417 | |||
9da275cf73 | |||
f1d4d687f3 | |||
e9fbbd5853 | |||
d3160d095d | |||
873449d0f9 | |||
4413b86a30 | |||
f8fa86f9db | |||
f55d4f33af | |||
4761c4ee1c | |||
7644ddeddc | |||
6dfd2ffcef | |||
835f12043e | |||
7afbc01fe8 | |||
1c689b83f9 | |||
8d0527f674 | |||
bc7ba8c875 | |||
34ce39f8dc | |||
9be4f98c73 | |||
1fc021c3c6 | |||
9aba37f70f | |||
5bb3d86884 | |||
1611979fa8 | |||
467e94f858 | |||
88fb003cdc | |||
a382698acc | |||
8b3bc1f97d | |||
5618e41cea | |||
f97930eaf5 | |||
5e07478843 | |||
1ce933e281 | |||
1000ebe203 | |||
c0321c7b21 | |||
7dbb4bc3f5 | |||
9d390ee49f | |||
403466c0db | |||
f2f89d9b46 | |||
30bf588a38 | |||
090a6ad409 | |||
a6c195b05c | |||
c1df48befd | |||
102c07d5e5 | |||
abc58f7b9d | |||
66fe6d85d0 | |||
a63e80ec64 | |||
9feda1c58b | |||
51733ca499 | |||
f0c92646eb | |||
d28a640960 | |||
b3fbc26340 | |||
612b622689 | |||
ccd33ce17f | |||
f447a053bb | |||
545fcb3dbf | |||
65401ed3f9 | |||
b30a29f830 | |||
b6c824dd16 | |||
03ac7b1821 | |||
f409dddb54 | |||
fe76e6a228 | |||
40408150f0 | |||
fea6abb4f0 | |||
94992ffff6 | |||
d7c9042c78 | |||
5b1ff5935e | |||
347619a85f | |||
282eab45f7 | |||
35f21c5bc0 | |||
9f2662c7f8 | |||
71a2ba7a98 | |||
3f2ad5a50a | |||
abd094d135 | |||
737763112e | |||
ce3409b2b7 | |||
7733f88168 | |||
c0038f6dac | |||
4d5a86327a | |||
d7a7af1ff2 | |||
aa017383ac | |||
c3c54e8ce6 | |||
53fce8e988 | |||
4ae9953607 | |||
10796e6726 | |||
845157c111 | |||
bac188b568 | |||
6d15231f10 | |||
3e90070b88 | |||
f0df07cba3 | |||
fe7bece31e | |||
3969285e5c | |||
60ebf19c9e | |||
fcfe90aa9f | |||
76ee026caa | |||
6e5ac0b585 | |||
17e20619ec | |||
c4fa30ac7d | |||
84ea4ad990 | |||
64685f4b20 | |||
bf594e9fb6 | |||
3958e75ed2 | |||
802309caf9 | |||
468b09c01e | |||
c13ea4f48d | |||
1e7285b2bb | |||
a8cb84c711 | |||
9075a5bf1e | |||
bd4ebd23f4 | |||
31c7bcac29 | |||
d3b1168e26 | |||
674f52ba74 | |||
498264959a | |||
e89cea8e5a | |||
e32e20521d | |||
9d5092cef5 | |||
68d0c11d88 | |||
fdf830940b | |||
10daade1c0 | |||
9a3a6dc212 | |||
f9599b64d0 | |||
a46fd33460 | |||
d5a70c7669 | |||
573ba108d9 | |||
9325bd9d8e | |||
420fb28d3f | |||
5613f4f7f4 | |||
02db9ee577 | |||
4aab814c37 | |||
a48206e827 | |||
99cc435730 | |||
67d9995280 | |||
82233cce65 | |||
2e97ba316d | |||
7186d09085 | |||
4fccc903b5 | |||
06fa131235 | |||
132fbf49d7 | |||
d02c124e1d | |||
554644f9e0 | |||
cc444d4991 | |||
4bf5b7d78d | |||
cb91f44ba4 | |||
f7e256e9a1 | |||
bbec8abb68 | |||
d60d671fec | |||
8dc730e5ca | |||
0cf98c5641 | |||
4bacb3621b | |||
aef865afc4 | |||
d70ddc65ea | |||
832a522cce | |||
79491df2b8 | |||
9f50b2cef2 | |||
96e1883361 | |||
0d1c18a4ce | |||
40205d8f1b | |||
4ede6ea8c5 | |||
77b3c0d670 | |||
3819291cb7 | |||
30964051fe | |||
ae4ae61a5f | |||
a91138c8f8 | |||
27b6d1892f | |||
2a8f0c2801 | |||
9e2e44c0c2 | |||
5e117b3f5a | |||
294b4eda4c | |||
7faf9f91db | |||
4b5abdc988 | |||
629dc4c770 | |||
3f65837e0d | |||
549f60fe49 | |||
26147afb08 | |||
fd0ce66ac1 | |||
c621d4d571 | |||
6f30cf0004 | |||
8c7ec44681 | |||
8329c6b069 | |||
f11170fecb | |||
48e6fccc95 | |||
61026d181b | |||
5145b33e01 | |||
8ce3b3d99e | |||
e696f639ab | |||
9c43b12206 | |||
78a7c93802 | |||
5c68596744 | |||
61b1ead1a2 | |||
138907c480 | |||
66f02ae93d | |||
455535128a | |||
53431fce2a | |||
339372ac99 | |||
cb9d6b79ef | |||
e8e5ccf82d | |||
3f2a6f58eb | |||
98c0fe934b | |||
49c8d42317 | |||
5c986060f0 | |||
404e713227 | |||
542bad60ba | |||
6f4c7d66a4 | |||
c843102eec | |||
b753213f9b | |||
599d8e3287 | |||
1c89fce30e | |||
0247d35e5a | |||
427670cc63 | |||
4af4b79123 | |||
5582d7b3be | |||
4cccba5cac | |||
f4bf48a7d7 | |||
353d7909f6 | |||
a586f6a152 | |||
e44bd2edb4 | |||
8598b654ba | |||
a1116bc6c8 | |||
8e172aeecb | |||
51f68f1054 | |||
92375c75f8 | |||
22d1febf3c | |||
5aa971b177 | |||
e922c640ef | |||
f5050a4f80 | |||
8cac82318f | |||
23e9fd3dfa | |||
13fd213064 | |||
c69dc7566b | |||
c6f5b7f1a1 | |||
1076b31464 | |||
0d006bc8d9 | |||
794d3239c7 | |||
e5af790acb | |||
48639ac5da | |||
e7b2f9603e | |||
46b3811e22 | |||
7adaaab2d6 | |||
289e24f1f7 | |||
c4d1e150ba | |||
293ec0a1cb | |||
24b38a5059 | |||
c74f4f6340 | |||
3e9f8471fc | |||
0a41f0f855 | |||
375d35be60 | |||
6da568e29a | |||
c039764d52 | |||
d3afe4308a | |||
d48fec8855 | |||
d992722c24 | |||
81bb4f0051 | |||
b078917500 | |||
ec1c94d4a7 | |||
faad63adce | |||
244f55df28 | |||
f7ad7e6c0f | |||
e0ebc4de60 | |||
14bb104ef0 | |||
f3b9fc8159 | |||
8907a29912 | |||
a5f986259f | |||
bcc519e4ee | |||
044238b503 | |||
03b59f9e19 | |||
7193938d27 | |||
5afec87b96 | |||
a4f51da184 | |||
0545b93232 | |||
9cbf83d59c | |||
07ca100130 | |||
6944839ab6 | |||
4a76f66a54 | |||
bacbbbd628 | |||
c85fb107c0 | |||
13f10e36e4 | |||
2644e54c51 | |||
0e5a5df5fe | |||
806ebc464a | |||
54ac1f6b59 | |||
9b16b74b5d | |||
9172901458 | |||
ffa0a24848 | |||
efe5bed5b4 | |||
e865fcc460 | |||
16eb461054 | |||
c11ef6ef07 | |||
95eda361c1 | |||
662c76c4fc | |||
ff799a1abe | |||
155b7bf569 | |||
47155ed524 | |||
db91439bb0 | |||
77aad0869f | |||
dc1a28c42a | |||
955b27637c | |||
1f5b403524 | |||
5e87d67e5f | |||
f133de2dd4 | |||
60800d2313 | |||
db90c0d509 | |||
e5b0f474ab | |||
1688cf7c44 | |||
2202c0d02e | |||
dbb95cbe5f | |||
ae238d1d4d | |||
6051712919 | |||
6bfa61a3a7 | |||
cf89e4d2cd | |||
d47324e8d7 | |||
ee4638ef5c | |||
6ee7c0f486 | |||
f4f7e31303 | |||
7c036c5896 | |||
793c2ac58d | |||
13d9e4db30 | |||
e84dbd7faf | |||
711023ea93 | |||
468dc99dc9 | |||
6b8ee80fd0 | |||
17e39ad79c | |||
46aeb9634f | |||
3f9c5d04d4 | |||
40a76590dd | |||
f2b3dd318f | |||
942883577e | |||
23fa59b77c | |||
9678fd5306 | |||
563e7139b6 | |||
2e9faaf67a | |||
4918893326 | |||
3e5960b5a2 | |||
b294e62aed | |||
c63f54b7a7 | |||
3186e45ae5 | |||
ed7afd9e80 | |||
683f18639e | |||
e17494f3bd | |||
c36c865987 | |||
a99f579127 | |||
acc7b83322 | |||
95662fd3d8 | |||
b3980f7a94 | |||
ac626f7334 | |||
b622a8b55d | |||
b6170dbe7b | |||
d6bf4800ed | |||
a60457c2d8 | |||
33d1bae03f | |||
013b336690 | |||
096d78479b | |||
68fca552d7 | |||
18e0a8f7bf | |||
cd2ee44216 | |||
ebf9ac091d | |||
cf791c09f0 | |||
1d8807a171 | |||
f18e2d2e62 | |||
71c3f4af31 | |||
3078394951 | |||
a7f4f5b291 | |||
bd1630a12c | |||
67d5ebb187 | |||
ba7b8a5de3 | |||
d54c548aac | |||
f01db80387 | |||
5e0989532e | |||
673f4295e8 | |||
1f04b1ae69 | |||
26a7387f40 | |||
bd5266a05e | |||
eb3ffeff0a | |||
0731eb629c | |||
34a38827b7 | |||
3076895e98 | |||
0e4c23c985 | |||
fb49e9def7 | |||
45e77c1d87 | |||
cf107c89b8 | |||
6a8830a551 | |||
4523251849 | |||
5f4e8789df | |||
eaf0aa1f07 | |||
96da0c60bd | |||
da36575d7f | |||
7716a418ce | |||
6ab2e30fff | |||
8b0289a5ba | |||
d810c0576d | |||
82f56054d4 | |||
de362537c6 | |||
ba9fb16048 | |||
148cba3270 | |||
c5bb2e3f56 | |||
049e7882b7 | |||
f297a5faa5 | |||
40e6aa7d94 | |||
668be1f4bd | |||
a444a4c5f5 | |||
05da4a6094 | |||
db8fcc0537 | |||
86a5358812 | |||
ff8ed70f84 | |||
179d5ba6a6 | |||
98892391d7 | |||
45a8806e65 | |||
e1fa0734a9 | |||
8665084df1 | |||
62072838c9 | |||
c5b7d73ce2 | |||
0556138b9f | |||
d57dbe1d4c | |||
5d646a5d6f | |||
e82a657cd9 | |||
8c89ea5f0a | |||
8cfa8dc0c1 | |||
bdf5e3f357 | |||
94682e69aa | |||
160cc9182d | |||
cd293f764e | |||
a5d0cfe8fb | |||
ba0f17f5b1 | |||
16875340cb | |||
959a418cc3 | |||
7c7ccb2e43 | |||
cada2b54fe | |||
3ecae81809 | |||
4f2b217a6a | |||
b1a1d4e13d | |||
f7315c9a36 | |||
9ac52f0340 | |||
f059466337 | |||
dcd0f4322a | |||
65d8f27b6b | |||
bdceb3acdb | |||
8e204e036a | |||
553211dd81 | |||
97010ac64d | |||
c2d03bf73e | |||
22c8f179d2 | |||
d4ff5e2d31 | |||
2773e8adf8 | |||
e17d70a592 | |||
da213febdc | |||
7c2e926c44 | |||
c474ad6a53 | |||
877ecc1bb4 | |||
0d0286d59e | |||
23f77a1b63 | |||
317ce05a27 | |||
a8155a0471 | |||
5e7fa20f06 | |||
3a688988e0 | |||
34ff206604 | |||
5c1be2233d | |||
e1751ad9ee | |||
84cc89e19a | |||
ea4665bf51 | |||
227d272049 | |||
e53db92a7b | |||
dd2b1278a0 | |||
f2e2fcf758 | |||
dfd44ff971 | |||
943b069996 | |||
2a56de80a2 | |||
69a0c1dc80 | |||
1b4709794e | |||
1cc249fe18 | |||
446bd04b6c | |||
9234fcb624 | |||
59a697f773 | |||
d49d10b14f | |||
4c15d32b55 | |||
73eaf51770 | |||
81ee8886ce | |||
658c741420 | |||
65cc8c1ea2 | |||
d9597d2148 | |||
fc3831c797 | |||
ce86f90efb | |||
b5f50028f2 | |||
2c388e2155 | |||
fb6e2743ec | |||
6ee006c851 | |||
107e521553 | |||
7735a919d1 | |||
9f617ae43d | |||
104bdde746 | |||
2a990cc140 | |||
3e41568074 | |||
66ae09b670 | |||
7b97c7b35e | |||
ca318c1520 | |||
cbb4f6c892 | |||
092b3edb51 | |||
8d6d2d07dd | |||
fa461525ee | |||
8e510a07c4 | |||
e153524748 | |||
eb8a1f42bc | |||
89cd9d382d | |||
488991b0f6 | |||
e2330617ac | |||
5e6d98e79f | |||
5eaf655224 | |||
2c1553570f | |||
c937dd5ba3 | |||
26b76ee95d | |||
006eb6d81e | |||
0cdf13ac12 | |||
0a3f25c303 | |||
105a3f757a | |||
f376a318ba | |||
4b88c1832a | |||
fc8aa1cdb1 | |||
7049b2f274 | |||
0f51ae7cf0 | |||
437f6b3d59 | |||
05e1a6c2ca | |||
25c1a85384 | |||
bba8f6c53e | |||
dbe9daeb76 | |||
8fd55fef85 | |||
acfd03da30 | |||
f352c3d79d | |||
4bf0bd3f55 | |||
76f2579e44 | |||
0706e021f5 | |||
b5775e3d85 | |||
cd70595b50 | |||
1d2913d9b9 | |||
b8a49a682e | |||
82901f89d5 | |||
c9c53cb55f | |||
1e637bd7e1 | |||
63a0b702c9 | |||
031003a5dc | |||
b69d2aa6a0 | |||
d7d2612218 | |||
7a0340c57d | |||
0863bd2408 | |||
594cc7c7d6 | |||
0b19078b2b | |||
7811865e84 | |||
0e69fe0781 | |||
26b08d87a8 | |||
321ab3b367 | |||
4d0869e206 | |||
d13cea6ccb | |||
6922f0e16a | |||
31df06d94e | |||
ecec9a7eaa | |||
ab7af2d0c5 | |||
f92e0bec0b | |||
7a22f6fd3f | |||
850ef51879 | |||
ef2e04a613 | |||
e16b75a0b7 | |||
8cdcf529e9 | |||
280167f217 | |||
a72f3fdabb | |||
dd6227e3bf | |||
1271ce1cab | |||
998114791f | |||
8a73324a0f | |||
9065edfc95 | |||
5111e33948 | |||
4cf828323d | |||
35776c5d29 | |||
2f27b8d5fa | |||
be4131b3c4 | |||
854feafa83 | |||
f423736a70 | |||
fdbac25e0d | |||
bcfac0d6dc | |||
682d43b5ab | |||
cd273e82ad | |||
3c0067dc69 | |||
a957c2f0c2 | |||
908203c735 | |||
2f072af02b | |||
de98fb29da | |||
82c92177ff | |||
14c706e51b | |||
a70823dd1c | |||
fdda8adfcf | |||
8f242f8bf0 | |||
36a14e65c2 | |||
6ed5d2e2b4 | |||
d4eb222644 | |||
a14fd1b955 | |||
ab1107973b | |||
4ab483d991 | |||
dabf72f3c0 | |||
907a1f5e48 | |||
97140ab634 | |||
dc9c5417bc | |||
556e7694de | |||
1a5cba5df5 | |||
cd0990c581 | |||
96e831dd8a | |||
65fde269c6 | |||
ad138210b3 | |||
6968f17f3f | |||
7e69d1400a | |||
ccefa87351 | |||
a3c97ee535 | |||
77229f99b8 | |||
a51437ee2b | |||
78232fa3eb | |||
433e1b388d | |||
9b7d918537 | |||
4c59eb0910 | |||
5cfea4fee3 | |||
7275cf60bd | |||
acbefa5263 | |||
2b64861ee1 | |||
ea90b803fa | |||
56e8aab280 | |||
1b58341e50 | |||
634c31d7cb | |||
b8dcd5f842 | |||
14e02635ff | |||
9b3b5badfb | |||
47c1558287 | |||
cc7e843c44 | |||
cfb8f18cef | |||
c0a71720af | |||
8b03d9ecc3 | |||
ea54ce7d96 | |||
cb31e3e12a | |||
c710a56903 | |||
96d5bde9b7 | |||
ad72fa46b0 | |||
fa4580de53 | |||
5e343e2c16 | |||
ef93bb6471 | |||
d6aaef9954 | |||
2ca351366e | |||
f54bf022bd | |||
e56df455ae | |||
54101b1948 | |||
829d9c863c | |||
f304fa4869 | |||
a32559e5ae | |||
8e13292d62 | |||
29ea5306eb | |||
fb9e8768a3 | |||
c747be84d9 | |||
2d7adb90c8 | |||
6b35a4901e | |||
4c1fde9deb | |||
425e65049b | |||
d3f30d9ece | |||
75cffd0ec4 | |||
e33d6b2908 | |||
a50907513a | |||
c0130ca8f7 | |||
9d4e4e2bd4 | |||
bdc7cc8ab9 | |||
13deb22223 | |||
220e4caf36 | |||
5c617ac286 | |||
bc08ad2fbb | |||
0947bc37d3 | |||
959eb98090 | |||
32dcf77a8f | |||
75349f8cde | |||
eac227a203 | |||
bc166aa6b4 | |||
5fa8b24b2b | |||
9d65eab549 | |||
c4a9117ef8 | |||
0db38c4999 | |||
8ee00cee60 | |||
984aad4b86 | |||
9af90bf9c1 | |||
12ea2fcb51 | |||
55cd110c63 | |||
f37a172dc7 | |||
ad62a659eb | |||
15c9458e92 | |||
a3baf14e72 | |||
f57ce7254d | |||
4d8190972d | |||
b7ef8796b2 | |||
7e8a864992 | |||
f3660dc60e | |||
0eb355e29d | |||
3ccb7cf4b2 | |||
578ff22464 | |||
73db35c53c | |||
76445bcb97 | |||
6792903c4f | |||
17c217848d | |||
07de258f48 | |||
ee3e195b79 | |||
a0bdf44c2d | |||
3259c7e150 | |||
e9e28baab7 | |||
d20f6c7969 | |||
93c7d571af | |||
d526283ab9 | |||
782056adab | |||
0521706617 | |||
989a281b5f | |||
18838bcefc | |||
f780706f09 | |||
358911a049 | |||
1b9672b5db | |||
08c6b801d2 | |||
80c8a287ee | |||
7ab07b05e9 | |||
141373f0ba | |||
0c5866a9e1 | |||
879f5f0dbb | |||
123b40105d | |||
7ef32f747b | |||
e8949292c1 | |||
f5a2694eba | |||
319f7f5b63 | |||
9a10b8ff94 | |||
8b62f4884d | |||
500a692e3b | |||
d3d1ff1aae | |||
ca51cd8488 | |||
9109fa0eb8 | |||
79b5ece241 | |||
cda9579034 | |||
82b222f218 | |||
56a5c5e4d1 | |||
b95d7e8276 | |||
5b98cc7a3a | |||
4de892b02a | |||
efe6c13d93 | |||
aae9f3a3e6 | |||
f501fdcc56 | |||
90a5582a73 | |||
ac7aa11417 | |||
cc5968109b | |||
0f6ab787ac | |||
2812338b7a | |||
ddbdb5fa77 | |||
35007ebae0 | |||
09bab98b1e | |||
aee8bfce3f | |||
92868182c9 | |||
08a3cbfc6c | |||
59fb26cb00 | |||
87c734cef9 | |||
c755fb6995 | |||
e9cc220c8e | |||
92f210039e | |||
aef393efd0 | |||
6836317e41 | |||
61e51cdef6 | |||
7868ab761f | |||
e6c8939c30 | |||
ac5d9ec558 | |||
9c8ff5dbe8 | |||
7738316dff | |||
1c3d8defb5 | |||
b2ae03c428 | |||
456698c814 | |||
9189b7b512 | |||
4259cfd4c6 | |||
4fdefb5b2e | |||
5ca0ef078d | |||
a5265365dd | |||
62f576e15b | |||
73bc3c4426 | |||
57772e5850 | |||
7c8baf8ed9 | |||
0e3c062406 | |||
4bc7425332 | |||
a2a8f0cdaa | |||
faa7b2d4e5 | |||
a95644dbdc | |||
720f363241 | |||
3794df608c | |||
2c893beff1 | |||
a3c425ad89 | |||
1d144486d1 | |||
9cd3b07472 | |||
6061abbf90 | |||
55c084e6e1 | |||
45289b3d65 | |||
6df34eb4b7 | |||
3e68c9e8fa | |||
fc0ce11fcd | |||
c08a24bb40 | |||
78560b8426 | |||
0eab73dc2e | |||
dd8c8e82f2 | |||
62f4e0501f | |||
6d8293a422 | |||
b80250e483 | |||
bd0f1bd338 | |||
2439255f32 | |||
c327b2df95 | |||
9aee47daa9 | |||
ecf7e53206 | |||
8038eaa99f | |||
9bcb50fa09 | |||
c17af6c794 | |||
4a184d74d5 | |||
1f133b3ed2 | |||
84616bef27 | |||
040de396b2 | |||
5a4bc15d0b | |||
01e20a6ba9 | |||
b0b1ff36ae | |||
5ed9abd51a | |||
65c5260312 | |||
7d9674149f | |||
25376b3b3c | |||
b86a67c80a | |||
7419ab7de5 | |||
6b853ffdbd | |||
ad220fc025 | |||
5bd85ef7e5 | |||
73f83f1ab6 | |||
5cb6286436 | |||
1c25b75571 | |||
f2f4af0d50 | |||
a8f8bc563e | |||
46248748a9 | |||
da7372a2fa | |||
de97b54595 | |||
d7d97f2477 | |||
7776941b89 | |||
4061c8384b | |||
b850f5a732 | |||
7645c51c54 | |||
f1837b785b | |||
22978b9d07 | |||
1206879a20 | |||
dc5925b7d1 | |||
b138006bb7 | |||
bca08c2c4e | |||
6541d49fe7 | |||
c3c6668343 | |||
70de90ebce | |||
0756fd4636 | |||
8c339dac3e | |||
06a7c22bcd | |||
ca88826ce9 | |||
7229a07b6c | |||
85f4772a4f | |||
f2fb3945d1 | |||
d7d75dd8e7 | |||
54fe0d311d | |||
fefac75e96 | |||
5e46940332 | |||
1767672375 | |||
6fc4cd3c0c | |||
feb9d129db | |||
2b519cba36 | |||
832fc798d5 | |||
bd0743a421 | |||
20731887f2 | |||
980d9b1042 | |||
bd7704f9e1 | |||
68f18f1fe9 | |||
c655166398 | |||
e14613e74e | |||
f71151a5dd | |||
6022b23923 | |||
d08763c18c | |||
fcb408ad5d | |||
51f9e04ef1 | |||
2fc7760cee | |||
f2d2d473b7 | |||
e1f839f48f | |||
eccc791f3b | |||
6055f04814 | |||
0185909ee3 | |||
c35e56196a | |||
181c7cab32 | |||
740a62044e | |||
0bf0366933 | |||
70bacb9402 | |||
57dfe4696d | |||
22a91f23ad | |||
6aa1026600 | |||
75dff3e7c9 | |||
bea7600471 | |||
8932388dda | |||
2238c9f180 | |||
ca21ca6745 | |||
2bbd2e5563 | |||
691d58e69b | |||
d84c7269b2 | |||
aba689312f | |||
f2d9a11013 | |||
596376c408 | |||
1f62a8dbd9 | |||
f59d62bc8f | |||
5d5d296551 | |||
065bf752f4 | |||
4d3e804391 | |||
15a2ccd21b | |||
fef5753a19 | |||
f3fd7cf92b | |||
5c500ad402 | |||
e7fd068a78 | |||
171e5fc3c2 | |||
7b7d881386 | |||
44905d96da | |||
73e8127d5d | |||
11e2005563 | |||
02fc0b4533 | |||
36155f72d0 | |||
c63d0173b5 | |||
7fcdd60ac5 | |||
a8984a81c2 | |||
769a02b630 | |||
576330edce | |||
a2a114e79c | |||
79e22853ea | |||
be72b22964 | |||
2464f00902 | |||
9b5d9f3cb3 | |||
088117a619 | |||
4a19628829 | |||
0cd54c5735 | |||
cc2c670a5e | |||
769a01f4e9 | |||
9c1afbbb67 | |||
376725e30e | |||
b836e661cf | |||
446e82e86d | |||
f2020913fd | |||
d9fb11b043 | |||
56ddaaa380 | |||
1efb32d300 | |||
6dba56223a | |||
2ff6beea35 | |||
689c7f4107 | |||
59bf1f4838 | |||
db0f85ba5d | |||
425611eadf | |||
9213574870 | |||
3073acc3b0 | |||
a61d525111 | |||
4064d9a7a7 | |||
8a06cfdd81 | |||
d3e789e677 | |||
c24d8e856b | |||
9db9793f33 | |||
c237bc5f45 | |||
178b975d6a | |||
4abca411f3 | |||
e48c7c009a | |||
36b361617d | |||
5eac1d696d | |||
9b53583945 | |||
1dbf25afa1 | |||
e415cc538a | |||
67a3715ded | |||
35aa278194 | |||
a76762a05e | |||
ccf27e5f83 | |||
912a9ecfba | |||
0487d672ed | |||
e94a0fced9 | |||
a3b86447f7 | |||
1d76eace1e | |||
c1303bd642 | |||
db11a37a68 | |||
0d0b9da6f8 | |||
ab0b407da4 | |||
c33b330799 | |||
144b24bfcc | |||
4d21650d6d | |||
a6fc656e91 | |||
a38bae259e | |||
c53aa89098 | |||
851b7d0639 | |||
b4c78726cf | |||
c9cc07fd3a | |||
f6eb2a8cf8 | |||
08e5589836 | |||
4f5a5e84fc | |||
0786683189 | |||
4887de533c | |||
57945a730f | |||
78254146f3 | |||
3e2a2cf532 | |||
04b240b50c | |||
7810f0e276 | |||
9b8f9b65b8 | |||
e741cab3f4 | |||
53748e3da7 | |||
17c5436f6e | |||
04fb6f7659 | |||
e5e58f8075 | |||
1da0355528 | |||
e5881156f6 | |||
60170cff70 | |||
e2bea48073 | |||
bbfaf8204b | |||
b3e19ee669 | |||
75e2bfb062 | |||
a859d76c72 | |||
2145333969 | |||
1b61b9cd73 | |||
a2c545c321 | |||
3cd8f3b7dc | |||
033ce2d956 | |||
2b47e89405 | |||
80d11287eb | |||
f869e4d54b | |||
c1059df7f9 | |||
e3d3df985f | |||
86ff3dfb3c | |||
7e0d185120 | |||
61c173b777 | |||
f99cd18254 | |||
0405786573 | |||
b016ff29f6 | |||
3f2e86f67c | |||
0aa4a526c6 | |||
85c2aef4bc | |||
76664ef891 | |||
b1ea768949 | |||
ea9d8a895b | |||
38432da328 | |||
430f354cd9 | |||
1cf4279745 | |||
7713006f5b | |||
465e13128b | |||
86de79cfc5 | |||
1d77641f0b | |||
2f217109aa | |||
5e0523cc8b | |||
dbe6e01e12 | |||
103c469cc9 | |||
ef074ea510 | |||
39bac6eabd | |||
0200f4fcd9 | |||
439afb3f19 | |||
b01edc22f3 | |||
e8bca5052a | |||
468882ecec | |||
be3c89d823 | |||
7719e33e68 |
@ -1,9 +1,10 @@
|
||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v2
|
||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v4
|
||||
|
||||
stages:
|
||||
- review
|
||||
- build
|
||||
- test
|
||||
- coverage
|
||||
|
||||
check-commit-log:
|
||||
stage: review
|
||||
@ -17,7 +18,7 @@ check-commit-log:
|
||||
build-mutter:
|
||||
stage: build
|
||||
script:
|
||||
- meson . build -Dbuildtype=debugoptimized -Degl_device=true -Dwayland_eglstream=true --werror --prefix /usr
|
||||
- meson . build -Dbuildtype=debugoptimized -Db_coverage=true -Degl_device=true -Dwayland_eglstream=true --werror --prefix /usr
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
artifacts:
|
||||
@ -28,6 +29,32 @@ build-mutter:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
||||
build-without-opengl-and-glx:
|
||||
stage: build
|
||||
script:
|
||||
- meson . build -Dbuildtype=debugoptimized -Dopengl=false -Dglx=false -Degl_device=true -Dwayland_eglstream=true --werror --prefix /usr
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
artifacts:
|
||||
paths:
|
||||
- build/meson-logs
|
||||
only:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
||||
build-without-native-backend-and-wayland:
|
||||
stage: build
|
||||
script:
|
||||
- meson . build -Dbuildtype=debugoptimized -Dnative_backend=false -Dudev=false -Dwayland=false -Dcore_tests=false --werror --prefix /usr
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
artifacts:
|
||||
paths:
|
||||
- build/meson-logs
|
||||
only:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
||||
test-mutter:
|
||||
stage: test
|
||||
dependencies:
|
||||
@ -35,19 +62,40 @@ test-mutter:
|
||||
variables:
|
||||
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
|
||||
GSETTINGS_SCHEMA_DIR: "$CI_PROJECT_DIR/build/data"
|
||||
G_SLICE: "always-malloc"
|
||||
MALLOC_CHECK_: "3"
|
||||
NO_AT_BRIDGE: "1"
|
||||
script:
|
||||
- dconf update
|
||||
- mkdir -m 700 $XDG_RUNTIME_DIR
|
||||
- glib-compile-schemas $GSETTINGS_SCHEMA_DIR
|
||||
- >
|
||||
env MALLOC_PERTURB_="$((RANDOM % 256 + 1))"
|
||||
dbus-run-session -- xvfb-run -s '+iglx -noreset'
|
||||
meson test -C build --no-rebuild -t 10 --verbose --no-stdsplit --wrap catchsegv
|
||||
meson test -C build --no-rebuild -t 10 --verbose --no-stdsplit --print-errorlogs --wrap catchsegv
|
||||
artifacts:
|
||||
expire_in: 1 day
|
||||
paths:
|
||||
- build
|
||||
only:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
||||
test-mutter-coverage:
|
||||
stage: coverage
|
||||
dependencies:
|
||||
- test-mutter
|
||||
script:
|
||||
- ninja -C build coverage
|
||||
- cat build/meson-logs/coverage.txt
|
||||
artifacts:
|
||||
paths:
|
||||
- build/meson-logs
|
||||
when: manual
|
||||
except:
|
||||
refs:
|
||||
- tags
|
||||
- master
|
||||
|
||||
can-build-gnome-shell:
|
||||
stage: test
|
||||
dependencies:
|
||||
@ -56,7 +104,7 @@ can-build-gnome-shell:
|
||||
- meson install --no-rebuild -C build
|
||||
script:
|
||||
- .gitlab-ci/checkout-gnome-shell.sh
|
||||
- meson gnome-shell gnome-shell/build --prefix /usr
|
||||
- meson gnome-shell gnome-shell/build --prefix /usr -Dman=false
|
||||
- ninja -C gnome-shell/build install
|
||||
only:
|
||||
- merge_requests
|
||||
|
@ -1,26 +1,27 @@
|
||||
FROM fedora:30
|
||||
# Rebuild and push with
|
||||
#
|
||||
# cd .gitlab-ci/
|
||||
# podman build --format docker --no-cache -t registry.gitlab.gnome.org/gnome/mutter/master:v4 .
|
||||
# podman push registry.gitlab.gnome.org/gnome/mutter/master:v4
|
||||
#
|
||||
|
||||
FROM fedora:32
|
||||
|
||||
RUN dnf -y update && dnf -y upgrade && \
|
||||
dnf install -y 'dnf-command(builddep)' && \
|
||||
dnf install -y 'dnf-command(copr)' && \
|
||||
dnf copr enable -y fmuellner/gnome-shell-ci && \
|
||||
dnf copr enable -y jadahl/mutter-ci && \
|
||||
|
||||
dnf builddep -y mutter && \
|
||||
|
||||
# Until Fedora catches up with meson build-deps
|
||||
dnf install -y meson xorg-x11-server-Xorg gnome-settings-daemon-devel egl-wayland-devel xorg-x11-server-Xwayland && \
|
||||
dnf builddep -y mutter --setopt=install_weak_deps=False && \
|
||||
|
||||
# For running unit tests
|
||||
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 '*/xvfb-run' gdm-lib accountsservice-libs && \
|
||||
|
||||
# Unpackaged versions
|
||||
dnf install -y https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00834984-gsettings-desktop-schemas/gsettings-desktop-schemas-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00834984-gsettings-desktop-schemas/gsettings-desktop-schemas-devel-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm && \
|
||||
|
||||
dnf install -y intltool redhat-rpm-config make && \
|
||||
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 \
|
||||
'*/xvfb-run' gdm-lib accountsservice-libs gnome-control-center gcovr \
|
||||
--setopt=install_weak_deps=False && \
|
||||
|
||||
# GNOME Shell
|
||||
dnf builddep -y gnome-shell --setopt=install_weak_deps=False && \
|
||||
dnf remove -y gnome-bluetooth-libs-devel dbus-glib-devel upower-devel python3-devel && \
|
||||
dnf remove -y gnome-bluetooth-libs-devel && \
|
||||
dnf remove -y --noautoremove mutter mutter-devel && \
|
||||
|
||||
dnf clean all
|
||||
|
@ -19,7 +19,7 @@ fi
|
||||
function commit_message_has_url() {
|
||||
commit=$1
|
||||
commit_message=$(git show -s --format='format:%b' $commit)
|
||||
echo "$commit_message" | grep -qe "\($CI_MERGE_REQUEST_PROJECT_URL/\(issues\|merge_requests\)/[0-9]\+\|https://bugzilla.gnome.org/show_bug.cgi?id=[0-9]\+\)"
|
||||
echo "$commit_message" | grep -qe "\($CI_MERGE_REQUEST_PROJECT_URL/\(-/\)\?\(issues\|merge_requests\)/[0-9]\+\|https://bugzilla.gnome.org/show_bug.cgi?id=[0-9]\+\)"
|
||||
return $?
|
||||
}
|
||||
|
||||
@ -40,11 +40,12 @@ function commit_message_subject_is_compliant() {
|
||||
return 0
|
||||
}
|
||||
|
||||
RET=0
|
||||
for commit in $commits; do
|
||||
commit_short=$(echo $commit | cut -c -8)
|
||||
|
||||
if ! commit_message_has_url $commit; then
|
||||
echo "Missing merge request or issue URL on commit $commit_short"
|
||||
echo "Commit $commit_short needs a merge request or issue URL"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -52,6 +53,8 @@ for commit in $commits; do
|
||||
if [ $? != 0 ]; then
|
||||
echo "Commit message for $commit_short is not compliant:"
|
||||
echo "$errors"
|
||||
exit 1
|
||||
RET=1
|
||||
fi
|
||||
done
|
||||
|
||||
exit $RET
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
mutter_branch=$(git describe --contains --all HEAD)
|
||||
gnome_shell_target=
|
||||
|
||||
git clone https://gitlab.gnome.org/GNOME/gnome-shell.git
|
||||
@ -26,8 +25,7 @@ if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ]; then
|
||||
fi
|
||||
|
||||
if [ -z "$gnome_shell_target" ]; then
|
||||
gnome_shell_target=$(git branch -r -l origin/$mutter_branch)
|
||||
gnome_shell_target=${gnome_shell_target:-$(git branch -r -l ${mutter_branch#remotes/})}
|
||||
gnome_shell_target=$(git branch -r -l origin/$CI_COMMIT_REF_NAME)
|
||||
gnome_shell_target=${gnome_shell_target:-origin/master}
|
||||
echo Using $gnome_shell_target instead
|
||||
fi
|
||||
|
55
.gitlab/issue_templates/Bug.md
Normal file
55
.gitlab/issue_templates/Bug.md
Normal file
@ -0,0 +1,55 @@
|
||||
<!--
|
||||
Please read https://wiki.gnome.org/Community/GettingInTouch/BugReportingGuidelines
|
||||
first to ensure that you create a clear and specific issue.
|
||||
-->
|
||||
|
||||
### Affected version
|
||||
|
||||
<!--
|
||||
Provide at least the following information:
|
||||
* Your OS and version
|
||||
* Affected Mutter version
|
||||
* Does this issue appear in XOrg and/or Wayland
|
||||
-->
|
||||
|
||||
### Bug summary
|
||||
|
||||
<!--
|
||||
Provide a short summary of the bug you encountered.
|
||||
-->
|
||||
|
||||
### Steps to reproduce
|
||||
|
||||
<!--
|
||||
1. Step one
|
||||
2. Step two
|
||||
3. ...
|
||||
-->
|
||||
|
||||
### What happened
|
||||
|
||||
<!--
|
||||
What did Mutter do that was unexpected?
|
||||
-->
|
||||
|
||||
### What did you expect to happen
|
||||
|
||||
<!--
|
||||
What did you expect Mutter to do?
|
||||
-->
|
||||
|
||||
### Relevant logs, screenshots, screencasts etc.
|
||||
|
||||
<!--
|
||||
If you have further information, such as technical documentation, logs,
|
||||
screenshots or screencasts related, please provide them here.
|
||||
|
||||
If the bug is a crash, please obtain a stack trace with installed debug
|
||||
symbols (at least for GNOME Shell and Mutter) and attach it to
|
||||
this issue following the instructions on
|
||||
https://wiki.gnome.org/Community/GettingInTouch/Bugzilla/GettingTraces.
|
||||
-->
|
||||
|
||||
|
||||
<!-- Do not remove the following line. -->
|
||||
/label ~"1. Bug"
|
30
.gitlab/issue_templates/Feature.md
Normal file
30
.gitlab/issue_templates/Feature.md
Normal file
@ -0,0 +1,30 @@
|
||||
<!--
|
||||
Please read https://wiki.gnome.org/Community/GettingInTouch/BugReportingGuidelines
|
||||
first to ensure that you create a clear and specific issue.
|
||||
-->
|
||||
|
||||
### Feature summary
|
||||
|
||||
<!--
|
||||
Describe what you would like to be able to do with Mutter
|
||||
that you currently cannot do.
|
||||
-->
|
||||
|
||||
### How would you like it to work
|
||||
|
||||
<!--
|
||||
If you can think of a way Mutter might be able to do this,
|
||||
let us know here.
|
||||
-->
|
||||
|
||||
### Relevant links, screenshots, screencasts etc.
|
||||
|
||||
<!--
|
||||
If you have further information, such as technical documentation,
|
||||
code, mockups or a similar feature in another window managers,
|
||||
please provide them here.
|
||||
-->
|
||||
|
||||
|
||||
<!-- Do not remove the following line. -->
|
||||
/label ~"1. Feature"
|
411
NEWS
411
NEWS
@ -1,3 +1,414 @@
|
||||
3.37.1
|
||||
======
|
||||
* Fix screencasting non-maximized windows [Jonas Å.; !1174]
|
||||
* Make window-aliveness checks less aggressive [Jonas Å.; !1182]
|
||||
* Fix stylus coordinates when using screen rotation [Jonas T.; #1118]
|
||||
* Preserve keyboard state on VT switch [Olivier; !1185]
|
||||
* Remove Clutter's drag and drop actions [Jonas D.; !789]
|
||||
* Cancel clicks/gestures actions on disable [Georges; !1188]
|
||||
* Fix various clipboard issues [Carlos; !1186, !1198, !1203, !1204, !1206]
|
||||
* Fix trackball button scrolling [Phillip; #1120]
|
||||
* Fix tiled monitor support [Jonas; !1199]
|
||||
* Support unredirecting fullscreen wayland surfaces [Jonas Å.; !798]
|
||||
* Support area screencasts [Jonas Å.; !1207]
|
||||
* Synchronize shadows to server-side decorations [Olivier; !1214]
|
||||
* Allow inhibiting remote access [Jonas Å.; !1212]
|
||||
* Fix overview key on X11 when using multiple keyboard layouts [Olivier; !1219]
|
||||
* Fixed crashes [Jonas, D., Carlos; !1173, !1183, !1012]
|
||||
* Misc. bug fixes and cleanups [Andre, Georges, Christian, Jonas Å., Andre,
|
||||
Simon, Florian, Carlos, Adam, Marco, Thomas, Elias, Pekka, Jonas D.,
|
||||
Laurent; !1169, !1168, !1166, !1170, !1167, !1172, !1175, !1176, !1184,
|
||||
!1126, !1187, !1191, !1195, !1179, !1200, !1193, !1209, !1213, !1208,
|
||||
#1074, !1223]
|
||||
|
||||
Contributors:
|
||||
Marco Trevisan (Treviño), Elias Aebi, Thomas Hindoe Paaboel Andersen,
|
||||
Laurent Bigonville, Jonas Dreßler, Olivier Fourdan, Carlos Garnacho,
|
||||
Adam Jackson, Andre Moreira Magalhaes, Simon McVittie, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Pekka Paalanen, Christian Rauch, Jonas Troeger,
|
||||
Phillip Wood, Jonas Ådahl
|
||||
|
||||
Translators:
|
||||
Dušan Kazik [sk], Christian Kirbach [de]
|
||||
|
||||
3.36.0
|
||||
======
|
||||
* Fix placement of popup windows in multi-monitor setups [Jonas; !1110]
|
||||
* Fix invisible mouse cursor on some hardware [Jonas; !1079]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl
|
||||
|
||||
Translators:
|
||||
Aurimas Černius [lt], Goran Vidović [hr], Anders Jonsson [sv],
|
||||
Guillaume Bernard [fr], Milo Casagrande [it], Daniel Korostil [uk],
|
||||
Andre Klapper [cy], Aman Alam [pa], Nathan Follens [nl]
|
||||
|
||||
3.35.92
|
||||
=======
|
||||
* Fix visibility of initially hidden windows [Jonas Å.; !1066]
|
||||
* Avoid flicker when (un)redirecting windows [Sebastian; #997]
|
||||
* Let BindConstraints update the preferred size [Emmanuele; !1070]
|
||||
* Learn about GLES3 [Adam; !882]
|
||||
* Ping windows on every window focus [Jonas D.; !891]
|
||||
* Remove overhead from hot code paths [Christian;
|
||||
#1056, !1081, !1083, !1071, !1087]
|
||||
* Allow remote desktop services to inhibit animations [Jonas Å.; !838]
|
||||
* Update screen-cast code to PipeWire 0.3 API [Wim; !1062]
|
||||
* Make check-alive timeouts configurable [Jonas Å.; !1080]
|
||||
* Make each stage view correspond to a single CRTC [Jonas Å.; !1042]
|
||||
* Implement scaled/transformed hardware cursors [Robert; !526]
|
||||
* Use DMA buffers for screencasting if possible [Georges; !1086]
|
||||
* Make Xwayland startup asynchronous [Carlos; !944]
|
||||
* Fix clipping glitches in long text entries [Jonas D.; !1096]
|
||||
* Add side channel for starting required X11 services [Carlos; !945]
|
||||
* Support synchronized wayland popup moving [Jonas Å.; !705]
|
||||
* Fixed crashes [Olivier, Jonas Å.; !1073, !1093]
|
||||
* Plugged memory leaks [Sebastian, Jonas Å.; !1089, !1095]
|
||||
* Misc. bug fixes and cleanups [Jonas Å, Olivier, Florian, Daniel, Jonas D.,
|
||||
Robert, Sebastian, Christian, Arun, Carlos, worldofpeace; !1061, #1043,
|
||||
!1067, !1068, !1065, !835, !1058, !1069, !1075, #1060, !1077, !423, !1090,
|
||||
!1088, !1094, #1067, !1064, !1099, !957, !1000, !1082]
|
||||
|
||||
Contributors:
|
||||
Emmanuele Bassi, Jonas Dreßler, Olivier Fourdan, Carlos Garnacho,
|
||||
Christian Hergert, Adam Jackson, Sebastian Keller, Robert Mader,
|
||||
Florian Müllner, Georges Basile Stavracas Neto, Arun Raghavan, Wim Taymans,
|
||||
Daniel van Vugt, worldofpeace, Jonas Ådahl
|
||||
|
||||
Translators:
|
||||
Yi-Jyun Pan [zh_TW], Asier Sarasua Garmendia [eu], Rafael Fontenelle [pt_BR],
|
||||
Emin Tufan Çetin [tr], Daniel Mustieles [es], Balázs Úr [hu],
|
||||
Gwan-gyeong Mun [ko], Marek Černocký [cs], Fran Dieguez [gl],
|
||||
Kukuh Syafaat [id], Alan Mortensen [da], Piotr Drąg [pl], sicklylife [ja],
|
||||
Matej Urbančič [sl]
|
||||
|
||||
3.35.91
|
||||
=======
|
||||
* Honor accelerometer orientation on monitor config changes [Hans; !959]
|
||||
* Enable culling for integer-scaled actors [Robert; !1036]
|
||||
* Add ClutterSeat::touch-mode property [Carlos; !1044]
|
||||
* Fix mis-scaling when streaming windows [Olivier; !1022]
|
||||
* Make the cursor renderer use the transactional KMS API [Jonas; !930]
|
||||
* Advertise MetaMonitor as wl_output [Olivier; !994]
|
||||
* Fix culling of XWayland windows [Robert; !1049]
|
||||
* Only consider enabled effects when disabling culling [Robert; !1052]
|
||||
* Misc. bug fixes and cleanups [Olivier, Sergio, Adam, Carlos, Björn; !1040,
|
||||
#985, !1024, !1039, !1051]
|
||||
|
||||
Contributors:
|
||||
Sergio Costas, Björn Daase, Olivier Fourdan, Carlos Garnacho, Hans de Goede,
|
||||
Adam Jackson, Robert Mader, Jonas Ådahl
|
||||
|
||||
Translators:
|
||||
sicklylife [ja]
|
||||
|
||||
3.35.90
|
||||
=======
|
||||
* Cull out clip region [Robert; !985]
|
||||
* Always enable tap-to-click/drag on opaque Wacom tablets [Carlos; !968]
|
||||
* Fix visual glitches with offscreen effects applied [Georges; !992]
|
||||
* Fix "sticky corner" in multi-head setups [Jonas D.; #774]
|
||||
* Fix black shadows around XWayland windows during resizes [Ray, Olivier; #858]
|
||||
* Zero-copy path for GPU-less secondary GPUs [Pekka; !810]
|
||||
* Cancel DND on Esc [Carlos; #1020]
|
||||
* Sync XWayland window shadows to frame during resizes [Olivier; !1009]
|
||||
* Add support for per-monitor workareas [Alberts; !370]
|
||||
* Ensure newly mapped wayland windows receive ENTER event [Olivier; !1026]
|
||||
* Add ClutterSeat object [Carlos; !852]
|
||||
* Honour CLUTTER_ACTOR_NO_LAYOUT flag more efficiently [Daniel; !575]
|
||||
* Fix interoperation with wl_data_device_manager v1 [Carlos; #965]
|
||||
* Favor text over images in clipboard manager [Carlos; #919]
|
||||
* Apply monitor scale after background texture creation [Daniel; !1004]
|
||||
* Plugged memory leaks [Sebastian, Adam; !991, #1000, !1011, !1020, !1030,
|
||||
!1001, !1033]
|
||||
* Fixed crashes [Jonas Å., Florian, Olivier; !961, #1029, !1037]
|
||||
* Misc. bug fixes and cleanups [Björn, Jonas Å., Adam, Sebastian, Jonas D.,
|
||||
Daniel, Carlos, Corentin, Sebastian, Robert, Daniel; #385, !998, !1007, !995,
|
||||
!1016, !1018, !1017, !1005, !1019, !1025, !1028, !1029, !1031, !1015, !1032,
|
||||
!1034, #1025]
|
||||
|
||||
Contributors:
|
||||
Björn Daase, Jonas Dreßler, Olivier Fourdan, Carlos Garnacho, Adam Jackson,
|
||||
Sebastian Keller, Robert Mader, Alberts Muktupāvels, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Corentin Noël, Pekka Paalanen, Ray Strode,
|
||||
Daniel van Vugt, Jonas Ådahl
|
||||
|
||||
Translators:
|
||||
sicklylife [ja], Umarzuki Bin Mochlis Moktar [ms]
|
||||
|
||||
3.35.3
|
||||
======
|
||||
* backends/native: Correct dy value in pinch gesture event [Yariv; !974]
|
||||
* Upload clipping rectangles in parallel [Daniel; !969]
|
||||
* More cogl API cleanups [Adam; !978, !977, !973]
|
||||
* Fix window recording on HiDPI [Pascal; !976]
|
||||
* Fix top-left pixel being insensitive to clicks [Sebastian; #893]
|
||||
* Misc. bug fixes and cleanups [Daniel, Adam; !979, !980]
|
||||
|
||||
Contributors:
|
||||
Yariv Barkan, Adam Jackson, Sebastian Keller, Pascal Nowack, Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Fran Dieguez [gl], Dz Chen [zh_CN]
|
||||
|
||||
3.35.2
|
||||
======
|
||||
* Don't emit focus event after destruction [Marco; gnome-shell#1704, !860]
|
||||
* Add a notion of pixel format planes [Niels; !858]
|
||||
* Replace various Cogl/Clutter types with Graphene [Georges; !458]
|
||||
* Improve CoglJournal [Georges, Jasper; !402]
|
||||
* Split pick and paint [Georges; !865]
|
||||
* Remove deprecated/unused cogl/clutter APIs [Adam; !866, !878, !879, !880,
|
||||
!885, !900, !902, !904, !896, !913, !922, !883, !903, !921, !933, !819]
|
||||
* Fix hang when opening not-responding dialog on Xorg [Carlos; !876]
|
||||
* Allow changing Clutter debug flags at runtime [Georges; !862]
|
||||
* Fix frozen grabs on Xorg after weeks of inactivity [Jonas; !886]
|
||||
* Fix triggering popups from stylus devices o wayland [Carlos; #886]
|
||||
* Fix fallback to GLES2 [Adam; #635]
|
||||
* Fix buffer age checks on multiple monitors [Carlos; !906]
|
||||
* Adjust to Sysprof API change [Christian; !908]
|
||||
* Improve support for (X11) fullscreen games under wayland [Hans; !739]
|
||||
* Support shadow framebuffers for offscreen rendering [Olivier; !877]
|
||||
* Fix hang after interacting with desktop icons on X11 [Marco; !909]
|
||||
* Don't double scale when getting absolute surface coordinates [Xiang; !915]
|
||||
* Respect NET_WM_TRANSIENT_FOR for override-redirect windows [Marco; !920]
|
||||
* Kill window effects on destroy [Robert; !924]
|
||||
* Remove deprecated ClutterTexture [Jonas; !932]
|
||||
* Use regions instead of bounding box for clipping and culling [Carlos; !867]
|
||||
* Use partial damage for dma-buf and EGLImage buffers on wayland [Robert; #947]
|
||||
* Do not stack transients underneath their always-on-top parent [Florian; #587]
|
||||
* Add explicit paint/pick contexts [Jonas; !935]
|
||||
* Fix KMS freeze after pageflip fallback [Pekka; !953]
|
||||
* Fixed crashes [Robert, Carlos, Jonas, Marco, Hans, Tim; !856, !869, !912,
|
||||
!895, !928, #591, !823, !960]
|
||||
* Plugged memory leaks [Niels, Robert, Carlos, Marco; !847, !868, !873, #908]
|
||||
* Misc. bug fixes and cleanups [Niels, Robert, Jonas, Marco, Carlos, Daniel,
|
||||
Jan, Adam, Cosimo, Florian, Thomas, Georges, Hans, Corentin, Christian,
|
||||
Benjamin; !853, !822, !451, !854, !816, !857, !859, !734, !844, !851, #876,
|
||||
!874, !673, !692, !888, !889, !894, !901, !905, !872, !898, !911, !918, !863,
|
||||
#878, !811, !893, !925, !926, !890, !931, !927, !934, !938, !940, !947, !941,
|
||||
!929, !949, !952, !871, !955, !956, !958, !907, !965, !964, !966]
|
||||
|
||||
Contributors:
|
||||
Marco Trevisan (Treviño), Jan Alexander Steffens (heftig),
|
||||
Thomas Hindoe Paaboel Andersen, Benjamin Berg, Cosimo Cecchi, Tim Crawford,
|
||||
Piotr Drąg, Xiang Fan, Olivier Fourdan, Carlos Garnacho, Hans de Goede,
|
||||
Niels De Graef, Christian Hergert, Adam Jackson, Robert Mader,
|
||||
Florian Müllner, Georges Basile Stavracas Neto, Bastien Nocera, Corentin Noël,
|
||||
Pekka Paalanen, Jasper St. Pierre, Christian Rauch, Daniel van Vugt,
|
||||
Jonas Ådahl
|
||||
|
||||
Translators:
|
||||
Bruce Cowan [en_GB]
|
||||
|
||||
3.35.1
|
||||
======
|
||||
* Fix immediate screen blank after releaseing inhibitor [Tim; #573]
|
||||
* Respond to frame callbacks regardless of damage [Jonas; !839]
|
||||
* selection [Carlos; !842]
|
||||
* Fix Night Light on wayland [Jonas; !840]
|
||||
* Fix various copy+paste/DND regressions [Carlos; !848, #789, #842,
|
||||
#793, #845, #854]
|
||||
* Misc. bug fixes and cleanups [Daniel, Marco, Jonas, Georges;
|
||||
!841, !764, !837, !846]
|
||||
|
||||
Contributors:
|
||||
Marco Trevisan (Treviño), Carlos Garnacho, Tim Klocke,
|
||||
Georges Basile Stavracas Neto, Daniel van Vugt, Jonas Ådahl
|
||||
|
||||
3.34.1
|
||||
======
|
||||
* Fix startup of X11 session services on wayland [Carlos; #771]
|
||||
* Fix _NET_ACTIVE_WINDOW emission [Carlos; #751]
|
||||
* Fix initial view perspective [Marco; !803]
|
||||
* Fix screenshots and window animations when scaled [Robert; !758]
|
||||
* Re-enable coredumps when capabilities are set [Jonas; !811]
|
||||
* Fix scaling of DND surface actors [Robert; !780]
|
||||
* Optimize blitting of untransformed offscreen stage views [Olivier; !809, !820]
|
||||
* Fix freeze of pointer event delivery on X11 [Olivier; !821]
|
||||
* Fix scaling of stylus input coordinates with HiDPI [Dorian; !830]
|
||||
* Fix memory leak when using implicit animations [Jonas; !828]
|
||||
* Fix numlock state for native backend [Carlos; #769]
|
||||
* Fixed crashes [Marco, Olivier, Jonas Å.; !805, #823, !808, !825,
|
||||
#844, !826, #779]
|
||||
* Misc. bug fixes and cleanups [Jonas Å., Georges, Jonas D., Michal, Daniel,
|
||||
Iain, Adam, Marco, Carlos, Ting-Wei, Hans, Robert; !787, !795, !791, !797,
|
||||
!772, !775, !799, !778, !785, !782, !796, #819, !814, !769, !817, !783, !786,
|
||||
!829, !774, #822]
|
||||
|
||||
Contributors:
|
||||
Marco Trevisan (Treviño), Jonas Dreßler, Olivier Fourdan, Carlos Garnacho,
|
||||
Hans de Goede, Adam Jackson, Ting-Wei Lan, Iain Lane, Michal Lazo,
|
||||
Robert Mader, Georges Basile Stavracas Neto, Dorian Stoll, Daniel van Vugt,
|
||||
Jonas Ådahl
|
||||
|
||||
Translators:
|
||||
Milo Casagrande [it], Nathan Follens [nl], Matej Urbančič [sl],
|
||||
Ask Hjorth Larsen [da], Alan Mortensen [da], Jordi Mas [ca]
|
||||
|
||||
3.34.0
|
||||
======
|
||||
* Fix xdg-output v3 support [Olivier; !771]
|
||||
* Fix crash when changing decoration state [Jonas; !773]
|
||||
* Add and remove connectors on hot-plug [Jonas; !743]
|
||||
|
||||
Contributors:
|
||||
Olivier Fourdan, Jonas Ådahl
|
||||
|
||||
Translators:
|
||||
Rafael Fontenelle [pt_BR], Gwan-gyeong Mun [ko], Christian Kirbach [de],
|
||||
Claude Paroz [fr], Milo Casagrande [it], Emin Tufan Çetin [tr],
|
||||
Ryuta Fujii [ja]
|
||||
|
||||
3.33.92
|
||||
=======
|
||||
* Turn MetaShapedTexture into a ClutterContent implementation [Georges; !409]
|
||||
* Restore inhibit shortcut for overlay key [Olivier; #734]
|
||||
* Misc. pointer a11y improvements [Jonas D., Olivier; !746, !747, !745, !761]
|
||||
* Fix position of drag surfaces [Robert; !684]
|
||||
* Implement subsurface.place_below() for parents [Robert; !664]
|
||||
* Add meta_window_actor_get_image() [Jonas Å.; !752]
|
||||
* Revert faulty optimization from !719 [Jonas Å.; #735]
|
||||
* Add additional sysprof trace points [Jonas Å.; !757, !765]
|
||||
* Remove GLX "threaded swap wait" used on Nvidia [Daniel; !602]
|
||||
* Implement geometric picking [Daniel; !189]
|
||||
* Fix lost keyboard focus after DND [Olivier; #747]
|
||||
* Misc. bug fixes and cleanups [Florian, Carlos, Piotr, Hans, Georges, Robert,
|
||||
Ray, Mart, Rémi; !740, !672, !749, !751, !753, !730, !755, !756, !750, !715,
|
||||
#738944, !657, !768]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Rémi Bernon, Piotr Drąg, Jonas Dreßler, Olivier Fourdan,
|
||||
Carlos Garnacho, Hans de Goede, Robert Mader, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Mart Raudsepp, Ray Strode, Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Piotr Drąg [pl], Марко Костић [sr], Rūdolfs Mazurs [lv], Matej Urbančič [sl],
|
||||
Balázs Úr [hu], Fran Dieguez [gl], Jordi Mas [ca], Anders Jonsson [sv],
|
||||
Trần Ngọc Quân [vi], Tim Sabsch [de], Fabio Tomat [fur], Goran Vidović [hr],
|
||||
Marek Černocký [cs]
|
||||
|
||||
3.33.91
|
||||
=======
|
||||
* Fix primary selection copy and paste between X11 and wayland [Hans; #702]
|
||||
* Improve monitor hotplug support [Hans; !713]
|
||||
* Remove a source of frame skips [Daniel; !719]
|
||||
* Fix windows being lowered after unmaximizing with double click [Olivier; #88]
|
||||
* Remove Clutter API for global grabs [Jonas D.; !536]
|
||||
* Improve processing of incompressible events [Daniel; !711]
|
||||
* Add xdg-output v3 support [Olivier; !704]
|
||||
* Misc. bug fixes and cleanups [Jonas Å., Marco, Carlos, Adam, Albert, Niels,
|
||||
Olivier, Florian; !722, !385, !728, !726, !500, !731, !727, !700, !735, !738]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Albert Vaca Cintora, Jonas Dreßler, Olivier Fourdan,
|
||||
Carlos Garnacho, Hans de Goede, Niels De Graef, Adam Jackson, Florian Müllner,
|
||||
Marco Trevisan (Treviño), Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Asier Sarasua Garmendia [eu], Kukuh Syafaat [id], Florentina Mușat [ro],
|
||||
Aurimas Černius [lt], Daniel Mustieles [es]
|
||||
|
||||
3.33.90
|
||||
=======
|
||||
* Fix visibility of clones with hidden source [Florian; #683]
|
||||
* Reduce freezes when opening some popup windows [Carlos; #556]
|
||||
* Be more thorough when excluding obscured areas from painting [Carlos; !698]
|
||||
* Make it possible to start Xwayland on demand [Carlos; !709]
|
||||
* clutter: Expose layout_manager to transitions [Florian; !716]
|
||||
* Misc. bug fixes and cleanups [Mark, Florian, Iain, Niels, Carlos, Ray; !671,
|
||||
!691, !694, !696, !703, !707, !697, !710, !708, !714, #719, !721]
|
||||
|
||||
Contributors:
|
||||
Mark Blakeney, Carlos Garnacho, Niels De Graef, Iain Lane, Florian Müllner,
|
||||
Ray Strode
|
||||
|
||||
Translators:
|
||||
Asier Sarasua Garmendia [eu], Rafael Fontenelle [pt_BR], Fabio Tomat [fur],
|
||||
Florentina Mușat [ro]
|
||||
|
||||
3.33.4
|
||||
======
|
||||
* Discard page flip retries on hotplug [Jonas; !630]
|
||||
* Add xdg-output v2 support [Olivier; #645]
|
||||
* Restore DRM format fallbacks [Jonas; !662]
|
||||
* Don't emit ::size-changed when only position changed [Daniel; !568]
|
||||
* Expose workspace layout properties [Florian; !618]
|
||||
* Don't use grab modifiers when shortcuts are inhibited [Olivier; #642]
|
||||
* Fix stuttering due to unchanged power save mode notifications [Georges; !674]
|
||||
* Add API to reorder workspaces [Adam; !670]
|
||||
* Make picking a new focus window more reliable [Marco; !669]
|
||||
* Defer actor allocation till shown [Carlos; !677]
|
||||
* Try to use primary GPU for copy instead of glReadPixels [Pekka; !615]
|
||||
* Unset pointer focus when the cursor is hidden [Jonas D.; !448]
|
||||
* Fix modifier-drag on wayland subsurfaces [Robert; !604]
|
||||
* Fix background corruption on Nvidia after resuming from suspend [Daniel; !600]
|
||||
* Only grab the locate-pointer key when necessary [Olivier; !685, #647]
|
||||
* Misc. bug fixes and cleanups [Florian, Jonas, Daniel, Robert, Olivier,
|
||||
Georges, Marco, Carlos, Emmanuele; !648, !650, !647, !656, !658, !637,
|
||||
!663, !660, !659, !665, !666, !668, !667, #667, !676, !678, #672, !680,
|
||||
!683, !688, !689, !687]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Emmanuele Bassi, Adam Bieńkowski, Piotr Drąg, Jonas Dreßler,
|
||||
Olivier Fourdan, Carlos Garnacho, Robert Mader, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Pekka Paalanen, Marco Trevisan (Treviño),
|
||||
Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Fabio Tomat [fur], Kukuh Syafaat [id]
|
||||
|
||||
3.33.3
|
||||
======
|
||||
* Prepare for running Xwayland on demand [Carlos; !420]
|
||||
* Fix text selection color rendering [Florian; #494]
|
||||
* Fix black shadows when using fractional scaling [Robert; #609]
|
||||
* Honor startup sequence workspace on wayland [Carlos; gnome-shell#674]
|
||||
* Only emit 'grab-op-end` signal after dropping grabs [Marco; !596]
|
||||
* Add a Sysprof-based profiler [Jonas, Georges; !197, !603]
|
||||
* Relax "xwayland-allow-grabs" setting [Olivier; #597]
|
||||
* Implement locate-pointer accessibility feature [Olivier; !453]
|
||||
* Implement mouse accessibility [Olivier; !512]
|
||||
* Consolidate frame throttling [Daniel, Georges; !363]
|
||||
* Fix setting blank cursor under wayland [Jonas; #630]
|
||||
* Pixel-align OpenGL cursors [Jonas; !610]
|
||||
* Handle returning from fullscreen/maximization better [Jonas; !621]
|
||||
* Improve screencast support on multi-monitor systems [Georges; !623]
|
||||
* Fix running X11 applications with sudo under wayland [Hans; #643]
|
||||
* Implement toggle-keys notification [Olivier; #637]
|
||||
* Add initial KMS transactional support [Jonas; !525]
|
||||
* Improve finding new focus window when the old one is closed [Marco; #308]
|
||||
* Misc. bug fixes and cleanups [Jonas, Carlos, Marco, Florian, Pekka, Robert,
|
||||
Douglas, Georges, Daniel, Emil, Niels, Hans, Olivier, Ting-Wei, Corentin;
|
||||
!591, #398, !592, !581, !597, !598, !593, !497, #591, !545, gtk#1675, !601,
|
||||
#568, !564, !605, !609, !115, !214, !611, !617, !616, !619, !624, !622, !627,
|
||||
!628, !629, !632, !633, !631, !636, !639, !638, !634, !640, !529, !644, !590]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Piotr Drąg, Olivier Fourdan, Carlos Garnacho, Hans de Goede,
|
||||
Niels De Graef, Ting-Wei Lan, Robert Mader, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Corentin Noël, Pekka Paalanen, Douglas R. Reno,
|
||||
Marco Trevisan (Treviño), Emil Velikov, Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Balázs Úr [hu], Daniel Mustieles [es], Nathan Follens [nl], Goran Vidović [hr]
|
||||
|
||||
3.33.2
|
||||
======
|
||||
* Fix rendering lag on Xorg [Daniel; !520, !281]
|
||||
* Misc. bug fixes and cleanups [Carlos, Marco, Jonas D., Florian, Niels,
|
||||
Daniel, Benjamin, Jonas Å., Ignacio, Vasilis; #598, !576, !547, !578,
|
||||
!583, !582, !469, !524, !119, !571, !584, !585, !586, #425]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Benjamin Berg, Jonas Dreßler, Carlos Garnacho, Niels De Graef,
|
||||
Vasilis Liaskovitis, Florian Müllner, Ignacio Casal Quinteiro,
|
||||
Marco Trevisan (Treviño), Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Daniel Mustieles [es]
|
||||
|
||||
3.33.1
|
||||
======
|
||||
* Remove unused APIs and outdated driver support
|
||||
|
@ -310,11 +310,7 @@ cally_actor_finalize (GObject *obj)
|
||||
|
||||
_cally_actor_clean_action_list (cally_actor);
|
||||
|
||||
if (priv->action_idle_handler)
|
||||
{
|
||||
g_source_remove (priv->action_idle_handler);
|
||||
priv->action_idle_handler = 0;
|
||||
}
|
||||
g_clear_handle_id (&priv->action_idle_handler, g_source_remove);
|
||||
|
||||
if (priv->action_queue)
|
||||
{
|
||||
@ -604,10 +600,11 @@ cally_actor_real_remove_actor (ClutterActor *container,
|
||||
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), 0);
|
||||
|
||||
atk_parent = ATK_OBJECT (data);
|
||||
atk_child = clutter_actor_get_accessible (actor);
|
||||
|
||||
if (atk_child)
|
||||
if (clutter_actor_has_accessible (actor))
|
||||
{
|
||||
atk_child = clutter_actor_get_accessible (actor);
|
||||
|
||||
g_value_init (&values.old_value, G_TYPE_POINTER);
|
||||
g_value_set_pointer (&values.old_value, atk_parent);
|
||||
|
||||
@ -657,7 +654,7 @@ cally_actor_get_extents (AtkComponent *component,
|
||||
ClutterActor *actor = NULL;
|
||||
gint top_level_x, top_level_y;
|
||||
gfloat f_width, f_height;
|
||||
ClutterVertex verts[4];
|
||||
graphene_point3d_t verts[4];
|
||||
ClutterActor *stage = NULL;
|
||||
|
||||
g_return_if_fail (CALLY_IS_ACTOR (component));
|
||||
@ -737,11 +734,7 @@ cally_actor_grab_focus (AtkComponent *component)
|
||||
*
|
||||
* This gets the top level origin, it is, the position of the stage in
|
||||
* the global screen. You can see it as the absolute display position
|
||||
* of the stage.
|
||||
*
|
||||
* FIXME: only the case with x11 is implemented, other backends are
|
||||
* required
|
||||
*
|
||||
* of the stage. This is 0,0 for a compositor.
|
||||
*/
|
||||
void
|
||||
_cally_actor_get_top_level_origin (ClutterActor *actor,
|
||||
@ -749,54 +742,11 @@ _cally_actor_get_top_level_origin (ClutterActor *actor,
|
||||
gint *yp)
|
||||
{
|
||||
/* default values */
|
||||
gint x = 0;
|
||||
gint y = 0;
|
||||
|
||||
#ifdef CLUTTER_WINDOWING_X11
|
||||
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
|
||||
{
|
||||
ClutterActor *stage = NULL;
|
||||
Display *display = NULL;
|
||||
Window root_window;
|
||||
Window stage_window;
|
||||
Window child;
|
||||
gint return_val = 0;
|
||||
|
||||
stage = clutter_actor_get_stage (actor);
|
||||
|
||||
/* FIXME: what happens if you use another display with
|
||||
clutter_backend_x11_set_display ?*/
|
||||
display = clutter_x11_get_default_display ();
|
||||
root_window = clutter_x11_get_root_window ();
|
||||
stage_window = clutter_x11_get_stage_window (CLUTTER_STAGE (stage));
|
||||
|
||||
return_val = XTranslateCoordinates (display, stage_window, root_window,
|
||||
0, 0, &x, &y,
|
||||
&child);
|
||||
|
||||
if (!return_val)
|
||||
g_warning ("[x11] We were not able to get proper absolute "
|
||||
"position of the stage");
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
static gboolean yet_warned = FALSE;
|
||||
|
||||
if (!yet_warned)
|
||||
{
|
||||
yet_warned = TRUE;
|
||||
|
||||
g_warning ("The current Clutter backend does not support using "
|
||||
"atk_component_get_extents() with ATK_XY_SCREEN.");
|
||||
}
|
||||
}
|
||||
|
||||
if (xp)
|
||||
*xp = x;
|
||||
*xp = 0;
|
||||
|
||||
if (yp)
|
||||
*yp = y;
|
||||
*yp = 0;
|
||||
}
|
||||
|
||||
/* AtkAction implementation */
|
||||
|
@ -75,8 +75,8 @@ struct _CallyRootPrivate
|
||||
GSList *stage_list;
|
||||
|
||||
/* signals id */
|
||||
guint stage_added_id;
|
||||
guint stage_removed_id;
|
||||
gulong stage_added_id;
|
||||
gulong stage_removed_id;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (CallyRoot, cally_root, ATK_TYPE_GOBJECT_ACCESSIBLE)
|
||||
@ -149,11 +149,9 @@ cally_root_finalize (GObject *object)
|
||||
|
||||
stage_manager = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (root));
|
||||
|
||||
g_signal_handler_disconnect (stage_manager,
|
||||
root->priv->stage_added_id);
|
||||
g_clear_signal_handler (&root->priv->stage_added_id, stage_manager);
|
||||
|
||||
g_signal_handler_disconnect (stage_manager,
|
||||
root->priv->stage_added_id);
|
||||
g_clear_signal_handler (&root->priv->stage_removed_id, stage_manager);
|
||||
|
||||
G_OBJECT_CLASS (cally_root_parent_class)->finalize (object);
|
||||
}
|
||||
|
@ -247,11 +247,7 @@ cally_text_finalize (GObject *obj)
|
||||
/* g_object_unref (cally_text->priv->textutil); */
|
||||
/* cally_text->priv->textutil = NULL; */
|
||||
|
||||
if (cally_text->priv->insert_idle_handler)
|
||||
{
|
||||
g_source_remove (cally_text->priv->insert_idle_handler);
|
||||
cally_text->priv->insert_idle_handler = 0;
|
||||
}
|
||||
g_clear_handle_id (&cally_text->priv->insert_idle_handler, g_source_remove);
|
||||
|
||||
G_OBJECT_CLASS (cally_text_parent_class)->finalize (obj);
|
||||
}
|
||||
@ -1438,7 +1434,7 @@ static void cally_text_get_character_extents (AtkText *text,
|
||||
PangoLayout *layout;
|
||||
PangoRectangle extents;
|
||||
const gchar *text_value;
|
||||
ClutterVertex verts[4];
|
||||
graphene_point3d_t verts[4];
|
||||
|
||||
actor = CALLY_GET_CLUTTER_ACTOR (text);
|
||||
if (actor == NULL) /* State is defunct */
|
||||
@ -2294,7 +2290,7 @@ _cally_misc_get_index_at_point (ClutterText *clutter_text,
|
||||
gint index, x_window, y_window, x_toplevel, y_toplevel;
|
||||
gint x_temp, y_temp;
|
||||
gboolean ret;
|
||||
ClutterVertex verts[4];
|
||||
graphene_point3d_t verts[4];
|
||||
PangoLayout *layout;
|
||||
gint x_layout, y_layout;
|
||||
|
||||
|
@ -1,98 +0,0 @@
|
||||
/* CALLY - The Clutter Accessibility Implementation Library
|
||||
*
|
||||
* Copyright (C) 2009 Igalia, S.L.
|
||||
*
|
||||
* Author: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:cally-texture
|
||||
* @Title: CallyTexture
|
||||
* @short_description: Implementation of the ATK interfaces for a #ClutterTexture
|
||||
* @see_also: #ClutterTexture
|
||||
*
|
||||
* #CallyTexture implements the required ATK interfaces of #ClutterTexture
|
||||
*
|
||||
* In particular it sets a proper role for the texture.
|
||||
*/
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "cally-texture.h"
|
||||
#include "cally-actor-private.h"
|
||||
|
||||
#include "deprecated/clutter-texture.h"
|
||||
|
||||
/* AtkObject */
|
||||
static void cally_texture_real_initialize (AtkObject *obj,
|
||||
gpointer data);
|
||||
|
||||
G_DEFINE_TYPE (CallyTexture, cally_texture, CALLY_TYPE_ACTOR)
|
||||
|
||||
static void
|
||||
cally_texture_class_init (CallyTextureClass *klass)
|
||||
{
|
||||
/* GObjectClass *gobject_class = G_OBJECT_CLASS (klass); */
|
||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
||||
|
||||
class->initialize = cally_texture_real_initialize;
|
||||
}
|
||||
|
||||
static void
|
||||
cally_texture_init (CallyTexture *texture)
|
||||
{
|
||||
/* nothing to do yet */
|
||||
}
|
||||
|
||||
/**
|
||||
* cally_texture_new:
|
||||
* @actor: a #ClutterActor
|
||||
*
|
||||
* Creates a new #CallyTexture for the given @actor. @actor must be
|
||||
* a #ClutterTexture.
|
||||
*
|
||||
* Return value: the newly created #AtkObject
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
AtkObject*
|
||||
cally_texture_new (ClutterActor *actor)
|
||||
{
|
||||
GObject *object = NULL;
|
||||
AtkObject *accessible = NULL;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_TEXTURE (actor), NULL);
|
||||
|
||||
object = g_object_new (CALLY_TYPE_TEXTURE, NULL);
|
||||
|
||||
accessible = ATK_OBJECT (object);
|
||||
atk_object_initialize (accessible, actor);
|
||||
|
||||
return accessible;
|
||||
}
|
||||
|
||||
static void
|
||||
cally_texture_real_initialize (AtkObject *obj,
|
||||
gpointer data)
|
||||
{
|
||||
ATK_OBJECT_CLASS (cally_texture_parent_class)->initialize (obj, data);
|
||||
|
||||
/* default role */
|
||||
obj->role = ATK_ROLE_IMAGE;
|
||||
}
|
@ -1,84 +0,0 @@
|
||||
/* CALLY - The Clutter Accessibility Implementation Library
|
||||
*
|
||||
* Copyright (C) 2009 Igalia, S.L.
|
||||
*
|
||||
* Author: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __CALLY_TEXTURE_H__
|
||||
#define __CALLY_TEXTURE_H__
|
||||
|
||||
#if !defined(__CALLY_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <cally/cally.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
#include <cally/cally-actor.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CALLY_TYPE_TEXTURE (cally_texture_get_type ())
|
||||
#define CALLY_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALLY_TYPE_TEXTURE, CallyTexture))
|
||||
#define CALLY_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CALLY_TYPE_TEXTURE, CallyTextureClass))
|
||||
#define CALLY_IS_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CALLY_TYPE_TEXTURE))
|
||||
#define CALLY_IS_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CALLY_TYPE_TEXTURE))
|
||||
#define CALLY_TEXTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CALLY_TYPE_TEXTURE, CallyTextureClass))
|
||||
|
||||
typedef struct _CallyTexture CallyTexture;
|
||||
typedef struct _CallyTextureClass CallyTextureClass;
|
||||
typedef struct _CallyTexturePrivate CallyTexturePrivate;
|
||||
|
||||
/**
|
||||
* CallyTexture:
|
||||
*
|
||||
* The <structname>CallyTexture</structname> structure contains only
|
||||
* private data and should be accessed using the provided API
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
struct _CallyTexture
|
||||
{
|
||||
/*< private >*/
|
||||
CallyActor parent;
|
||||
|
||||
CallyTexturePrivate *priv;
|
||||
};
|
||||
|
||||
/**
|
||||
* CallyTextureClass:
|
||||
*
|
||||
* The <structname>CallyTextureClass</structname> structure contains
|
||||
* only private data
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
struct _CallyTextureClass
|
||||
{
|
||||
/*< private >*/
|
||||
CallyActorClass parent_class;
|
||||
|
||||
/* padding for future expansion */
|
||||
gpointer _padding_dummy[8];
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType cally_texture_get_type (void) G_GNUC_CONST;
|
||||
CLUTTER_EXPORT
|
||||
AtkObject *cally_texture_new (ClutterActor *actor);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CALLY_TEXTURE_H__ */
|
@ -39,7 +39,6 @@
|
||||
#include "cally-group.h"
|
||||
#include "cally-stage.h"
|
||||
#include "cally-text.h"
|
||||
#include "cally-texture.h"
|
||||
#include "cally-rectangle.h"
|
||||
#include "cally-clone.h"
|
||||
|
||||
@ -56,7 +55,6 @@ CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_ACTOR, cally_actor, cally_actor_new)
|
||||
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_GROUP, cally_group, cally_group_new)
|
||||
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_STAGE, cally_stage, cally_stage_new)
|
||||
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_TEXT, cally_text, cally_text_new)
|
||||
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_TEXTURE, cally_texture, cally_texture_new)
|
||||
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_RECTANGLE, cally_rectangle, cally_rectangle_new)
|
||||
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_CLONE, cally_clone, cally_clone_new)
|
||||
|
||||
@ -78,7 +76,6 @@ cally_accessibility_init (void)
|
||||
CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_GROUP, cally_group);
|
||||
CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_STAGE, cally_stage);
|
||||
CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_TEXT, cally_text);
|
||||
CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_TEXTURE, cally_texture);
|
||||
CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_RECTANGLE, cally_rectangle);
|
||||
CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_CLONE, cally_clone);
|
||||
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include "cally-root.h"
|
||||
#include "cally-stage.h"
|
||||
#include "cally-text.h"
|
||||
#include "cally-texture.h"
|
||||
#include "cally-util.h"
|
||||
|
||||
#undef __CALLY_H_INSIDE__
|
||||
|
@ -33,28 +33,11 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_ACTION (clutter_action_get_type ())
|
||||
#define CLUTTER_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ACTION, ClutterAction))
|
||||
#define CLUTTER_IS_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ACTION))
|
||||
#define CLUTTER_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_ACTION, ClutterActionClass))
|
||||
#define CLUTTER_IS_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_ACTION))
|
||||
#define CLUTTER_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_ACTION, ClutterActionClass))
|
||||
#define CLUTTER_TYPE_ACTION (clutter_action_get_type ())
|
||||
|
||||
typedef struct _ClutterActionClass ClutterActionClass;
|
||||
|
||||
/**
|
||||
* ClutterAction:
|
||||
*
|
||||
* The #ClutterAction structure contains only private data and
|
||||
* should be accessed using the provided API.
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
struct _ClutterAction
|
||||
{
|
||||
/*< private >*/
|
||||
ClutterActorMeta parent_instance;
|
||||
};
|
||||
CLUTTER_EXPORT
|
||||
G_DECLARE_DERIVABLE_TYPE (ClutterAction, clutter_action,
|
||||
CLUTTER, ACTION, ClutterActorMeta);
|
||||
|
||||
/**
|
||||
* ClutterActionClass:
|
||||
@ -78,9 +61,6 @@ struct _ClutterActionClass
|
||||
void (* _clutter_action8) (void);
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_action_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/* ClutterActor API */
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_add_action (ClutterActor *self,
|
||||
|
@ -340,7 +340,7 @@ clutter_actor_box_contains (const ClutterActorBox *box,
|
||||
/**
|
||||
* clutter_actor_box_from_vertices:
|
||||
* @box: a #ClutterActorBox
|
||||
* @verts: (array fixed-size=4): array of four #ClutterVertex
|
||||
* @verts: (array fixed-size=4): array of four #graphene_point3d_t
|
||||
*
|
||||
* Calculates the bounding box represented by the four vertices; for details
|
||||
* of the vertex array see clutter_actor_get_abs_allocation_vertices().
|
||||
@ -348,8 +348,8 @@ clutter_actor_box_contains (const ClutterActorBox *box,
|
||||
* Since: 1.0
|
||||
*/
|
||||
void
|
||||
clutter_actor_box_from_vertices (ClutterActorBox *box,
|
||||
const ClutterVertex verts[])
|
||||
clutter_actor_box_from_vertices (ClutterActorBox *box,
|
||||
const graphene_point3d_t verts[])
|
||||
{
|
||||
gfloat x_1, x_2, y_1, y_2;
|
||||
|
||||
|
@ -51,7 +51,7 @@
|
||||
struct _ClutterActorMetaPrivate
|
||||
{
|
||||
ClutterActor *actor;
|
||||
guint destroy_id;
|
||||
gulong destroy_id;
|
||||
|
||||
gchar *name;
|
||||
|
||||
@ -81,28 +81,49 @@ static void
|
||||
on_actor_destroy (ClutterActor *actor,
|
||||
ClutterActorMeta *meta)
|
||||
{
|
||||
meta->priv->actor = NULL;
|
||||
ClutterActorMetaPrivate *priv =
|
||||
clutter_actor_meta_get_instance_private (meta);
|
||||
|
||||
priv->actor = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_actor_meta_real_set_actor (ClutterActorMeta *meta,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
if (meta->priv->actor == actor)
|
||||
ClutterActorMetaPrivate *priv =
|
||||
clutter_actor_meta_get_instance_private (meta);
|
||||
|
||||
g_warn_if_fail (!priv->actor ||
|
||||
!CLUTTER_ACTOR_IN_PAINT (priv->actor));
|
||||
g_warn_if_fail (!actor || !CLUTTER_ACTOR_IN_PAINT (actor));
|
||||
|
||||
if (priv->actor == actor)
|
||||
return;
|
||||
|
||||
if (meta->priv->destroy_id != 0)
|
||||
{
|
||||
g_signal_handler_disconnect (meta->priv->actor, meta->priv->destroy_id);
|
||||
meta->priv->destroy_id = 0;
|
||||
}
|
||||
g_clear_signal_handler (&priv->destroy_id, priv->actor);
|
||||
|
||||
meta->priv->actor = actor;
|
||||
priv->actor = actor;
|
||||
|
||||
if (meta->priv->actor != NULL)
|
||||
meta->priv->destroy_id = g_signal_connect (meta->priv->actor, "destroy",
|
||||
G_CALLBACK (on_actor_destroy),
|
||||
meta);
|
||||
if (priv->actor != NULL)
|
||||
priv->destroy_id = g_signal_connect (priv->actor, "destroy",
|
||||
G_CALLBACK (on_actor_destroy),
|
||||
meta);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_actor_meta_real_set_enabled (ClutterActorMeta *meta,
|
||||
gboolean is_enabled)
|
||||
{
|
||||
ClutterActorMetaPrivate *priv =
|
||||
clutter_actor_meta_get_instance_private (meta);
|
||||
|
||||
g_warn_if_fail (!priv->actor ||
|
||||
!CLUTTER_ACTOR_IN_PAINT (priv->actor));
|
||||
|
||||
priv->is_enabled = is_enabled;
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (meta), obj_props[PROP_ENABLED]);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -135,20 +156,21 @@ clutter_actor_meta_get_property (GObject *gobject,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterActorMeta *meta = CLUTTER_ACTOR_META (gobject);
|
||||
ClutterActorMetaPrivate *priv =
|
||||
clutter_actor_meta_get_instance_private (CLUTTER_ACTOR_META (gobject));
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_ACTOR:
|
||||
g_value_set_object (value, meta->priv->actor);
|
||||
g_value_set_object (value, priv->actor);
|
||||
break;
|
||||
|
||||
case PROP_NAME:
|
||||
g_value_set_string (value, meta->priv->name);
|
||||
g_value_set_string (value, priv->name);
|
||||
break;
|
||||
|
||||
case PROP_ENABLED:
|
||||
g_value_set_boolean (value, meta->priv->is_enabled);
|
||||
g_value_set_boolean (value, priv->is_enabled);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -160,10 +182,11 @@ clutter_actor_meta_get_property (GObject *gobject,
|
||||
static void
|
||||
clutter_actor_meta_finalize (GObject *gobject)
|
||||
{
|
||||
ClutterActorMetaPrivate *priv = CLUTTER_ACTOR_META (gobject)->priv;
|
||||
ClutterActorMetaPrivate *priv =
|
||||
clutter_actor_meta_get_instance_private (CLUTTER_ACTOR_META (gobject));
|
||||
|
||||
if (priv->destroy_id != 0 && priv->actor != NULL)
|
||||
g_signal_handler_disconnect (priv->actor, priv->destroy_id);
|
||||
if (priv->actor != NULL)
|
||||
g_clear_signal_handler (&priv->destroy_id, priv->actor);
|
||||
|
||||
g_free (priv->name);
|
||||
|
||||
@ -176,6 +199,7 @@ clutter_actor_meta_class_init (ClutterActorMetaClass *klass)
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
klass->set_actor = clutter_actor_meta_real_set_actor;
|
||||
klass->set_enabled = clutter_actor_meta_real_set_enabled;
|
||||
|
||||
/**
|
||||
* ClutterActorMeta:actor:
|
||||
@ -230,9 +254,11 @@ clutter_actor_meta_class_init (ClutterActorMetaClass *klass)
|
||||
void
|
||||
clutter_actor_meta_init (ClutterActorMeta *self)
|
||||
{
|
||||
self->priv = clutter_actor_meta_get_instance_private (self);
|
||||
self->priv->is_enabled = TRUE;
|
||||
self->priv->priority = CLUTTER_ACTOR_META_PRIORITY_DEFAULT;
|
||||
ClutterActorMetaPrivate *priv =
|
||||
clutter_actor_meta_get_instance_private (self);
|
||||
|
||||
priv->is_enabled = TRUE;
|
||||
priv->priority = CLUTTER_ACTOR_META_PRIORITY_DEFAULT;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -250,13 +276,17 @@ void
|
||||
clutter_actor_meta_set_name (ClutterActorMeta *meta,
|
||||
const gchar *name)
|
||||
{
|
||||
ClutterActorMetaPrivate *priv;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR_META (meta));
|
||||
|
||||
if (g_strcmp0 (meta->priv->name, name) == 0)
|
||||
priv = clutter_actor_meta_get_instance_private (meta);
|
||||
|
||||
if (g_strcmp0 (priv->name, name) == 0)
|
||||
return;
|
||||
|
||||
g_free (meta->priv->name);
|
||||
meta->priv->name = g_strdup (name);
|
||||
g_free (priv->name);
|
||||
priv->name = g_strdup (name);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (meta), obj_props[PROP_NAME]);
|
||||
}
|
||||
@ -277,9 +307,13 @@ clutter_actor_meta_set_name (ClutterActorMeta *meta,
|
||||
const gchar *
|
||||
clutter_actor_meta_get_name (ClutterActorMeta *meta)
|
||||
{
|
||||
ClutterActorMetaPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_ACTOR_META (meta), NULL);
|
||||
|
||||
return meta->priv->name;
|
||||
priv = clutter_actor_meta_get_instance_private (meta);
|
||||
|
||||
return priv->name;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -295,16 +329,17 @@ void
|
||||
clutter_actor_meta_set_enabled (ClutterActorMeta *meta,
|
||||
gboolean is_enabled)
|
||||
{
|
||||
ClutterActorMetaPrivate *priv;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR_META (meta));
|
||||
|
||||
priv = clutter_actor_meta_get_instance_private (meta);
|
||||
is_enabled = !!is_enabled;
|
||||
|
||||
if (meta->priv->is_enabled == is_enabled)
|
||||
if (priv->is_enabled == is_enabled)
|
||||
return;
|
||||
|
||||
meta->priv->is_enabled = is_enabled;
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (meta), obj_props[PROP_ENABLED]);
|
||||
CLUTTER_ACTOR_META_GET_CLASS (meta)->set_enabled (meta, is_enabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -320,9 +355,13 @@ clutter_actor_meta_set_enabled (ClutterActorMeta *meta,
|
||||
gboolean
|
||||
clutter_actor_meta_get_enabled (ClutterActorMeta *meta)
|
||||
{
|
||||
ClutterActorMetaPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_ACTOR_META (meta), FALSE);
|
||||
|
||||
return meta->priv->is_enabled;
|
||||
priv = clutter_actor_meta_get_instance_private (meta);
|
||||
|
||||
return priv->is_enabled;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -358,40 +397,54 @@ _clutter_actor_meta_set_actor (ClutterActorMeta *meta,
|
||||
ClutterActor *
|
||||
clutter_actor_meta_get_actor (ClutterActorMeta *meta)
|
||||
{
|
||||
ClutterActorMetaPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_ACTOR_META (meta), NULL);
|
||||
|
||||
return meta->priv->actor;
|
||||
priv = clutter_actor_meta_get_instance_private (meta);
|
||||
|
||||
return priv->actor;
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_actor_meta_set_priority (ClutterActorMeta *meta,
|
||||
gint priority)
|
||||
{
|
||||
ClutterActorMetaPrivate *priv;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR_META (meta));
|
||||
|
||||
priv = clutter_actor_meta_get_instance_private (meta);
|
||||
|
||||
/* This property shouldn't be modified after the actor meta is in
|
||||
use because ClutterMetaGroup doesn't resort the list when it
|
||||
changes. If we made the priority public then we could either make
|
||||
the priority a construct-only property or listen for
|
||||
notifications on the property from the ClutterMetaGroup and
|
||||
resort. */
|
||||
g_return_if_fail (meta->priv->actor == NULL);
|
||||
g_return_if_fail (priv->actor == NULL);
|
||||
|
||||
meta->priv->priority = priority;
|
||||
priv->priority = priority;
|
||||
}
|
||||
|
||||
gint
|
||||
_clutter_actor_meta_get_priority (ClutterActorMeta *meta)
|
||||
{
|
||||
ClutterActorMetaPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_ACTOR_META (meta), 0);
|
||||
|
||||
return meta->priv->priority;
|
||||
priv = clutter_actor_meta_get_instance_private (meta);
|
||||
|
||||
return priv->priority;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_actor_meta_is_internal (ClutterActorMeta *meta)
|
||||
{
|
||||
gint priority = meta->priv->priority;
|
||||
ClutterActorMetaPrivate *priv =
|
||||
clutter_actor_meta_get_instance_private (meta);
|
||||
gint priority = priv->priority;
|
||||
|
||||
return (priority <= CLUTTER_ACTOR_META_PRIORITY_INTERNAL_LOW ||
|
||||
priority >= CLUTTER_ACTOR_META_PRIORITY_INTERNAL_HIGH);
|
||||
@ -438,19 +491,21 @@ void
|
||||
_clutter_meta_group_add_meta (ClutterMetaGroup *group,
|
||||
ClutterActorMeta *meta)
|
||||
{
|
||||
ClutterActorMetaPrivate *priv =
|
||||
clutter_actor_meta_get_instance_private (meta);
|
||||
GList *prev = NULL, *l;
|
||||
|
||||
if (meta->priv->actor != NULL)
|
||||
if (priv->actor != NULL)
|
||||
{
|
||||
g_warning ("The meta of type '%s' with name '%s' is "
|
||||
"already attached to actor '%s'",
|
||||
G_OBJECT_TYPE_NAME (meta),
|
||||
meta->priv->name != NULL
|
||||
? meta->priv->name
|
||||
priv->name != NULL
|
||||
? priv->name
|
||||
: "<unknown>",
|
||||
clutter_actor_get_name (meta->priv->actor) != NULL
|
||||
? clutter_actor_get_name (meta->priv->actor)
|
||||
: G_OBJECT_TYPE_NAME (meta->priv->actor));
|
||||
clutter_actor_get_name (priv->actor) != NULL
|
||||
? clutter_actor_get_name (priv->actor)
|
||||
: G_OBJECT_TYPE_NAME (priv->actor));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -486,13 +541,16 @@ void
|
||||
_clutter_meta_group_remove_meta (ClutterMetaGroup *group,
|
||||
ClutterActorMeta *meta)
|
||||
{
|
||||
if (meta->priv->actor != group->actor)
|
||||
ClutterActorMetaPrivate *priv =
|
||||
clutter_actor_meta_get_instance_private (meta);
|
||||
|
||||
if (priv->actor != group->actor)
|
||||
{
|
||||
g_warning ("The meta of type '%s' with name '%s' is not "
|
||||
"attached to the actor '%s'",
|
||||
G_OBJECT_TYPE_NAME (meta),
|
||||
meta->priv->name != NULL
|
||||
? meta->priv->name
|
||||
priv->name != NULL
|
||||
? priv->name
|
||||
: "<unknown>",
|
||||
clutter_actor_get_name (group->actor) != NULL
|
||||
? clutter_actor_get_name (group->actor)
|
||||
@ -635,8 +693,10 @@ _clutter_meta_group_get_meta (ClutterMetaGroup *group,
|
||||
for (l = group->meta; l != NULL; l = l->next)
|
||||
{
|
||||
ClutterActorMeta *meta = l->data;
|
||||
ClutterActorMetaPrivate *priv =
|
||||
clutter_actor_meta_get_instance_private (meta);
|
||||
|
||||
if (g_strcmp0 (meta->priv->name, name) == 0)
|
||||
if (g_strcmp0 (priv->name, name) == 0)
|
||||
return meta;
|
||||
}
|
||||
|
||||
@ -656,6 +716,8 @@ _clutter_meta_group_get_meta (ClutterMetaGroup *group,
|
||||
const gchar *
|
||||
_clutter_actor_meta_get_debug_name (ClutterActorMeta *meta)
|
||||
{
|
||||
return meta->priv->name != NULL ? meta->priv->name
|
||||
: G_OBJECT_TYPE_NAME (meta);
|
||||
ClutterActorMetaPrivate *priv =
|
||||
clutter_actor_meta_get_instance_private (meta);
|
||||
|
||||
return priv->name != NULL ? priv->name : G_OBJECT_TYPE_NAME (meta);
|
||||
}
|
||||
|
@ -33,31 +33,13 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_ACTOR_META (clutter_actor_meta_get_type ())
|
||||
#define CLUTTER_ACTOR_META(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ACTOR_META, ClutterActorMeta))
|
||||
#define CLUTTER_IS_ACTOR_META(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ACTOR_META))
|
||||
#define CLUTTER_ACTOR_META_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_ACTOR_META, ClutterActorMetaClass))
|
||||
#define CLUTTER_IS_ACTOR_META_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_ACTOR_META))
|
||||
#define CLUTTER_ACTOR_META_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_ACTOR_META, ClutterActorMetaClass))
|
||||
#define CLUTTER_TYPE_ACTOR_META (clutter_actor_meta_get_type ())
|
||||
|
||||
typedef struct _ClutterActorMetaPrivate ClutterActorMetaPrivate;
|
||||
typedef struct _ClutterActorMetaClass ClutterActorMetaClass;
|
||||
CLUTTER_EXPORT
|
||||
G_DECLARE_DERIVABLE_TYPE (ClutterActorMeta, clutter_actor_meta,
|
||||
CLUTTER, ACTOR_META, GInitiallyUnowned);
|
||||
|
||||
/**
|
||||
* ClutterActorMeta:
|
||||
*
|
||||
* The #ClutterActorMeta structure contains only
|
||||
* private data and should be accessed using the provided API
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
struct _ClutterActorMeta
|
||||
{
|
||||
/*< private >*/
|
||||
GInitiallyUnowned parent_instance;
|
||||
|
||||
ClutterActorMetaPrivate *priv;
|
||||
};
|
||||
typedef struct _ClutterActorMetaPrivate ClutterActorMetaPrivate;
|
||||
|
||||
/**
|
||||
* ClutterActorMetaClass:
|
||||
@ -87,6 +69,9 @@ struct _ClutterActorMetaClass
|
||||
void (* set_actor) (ClutterActorMeta *meta,
|
||||
ClutterActor *actor);
|
||||
|
||||
void (* set_enabled) (ClutterActorMeta *meta,
|
||||
gboolean is_enabled);
|
||||
|
||||
/*< private >*/
|
||||
void (* _clutter_meta1) (void);
|
||||
void (* _clutter_meta2) (void);
|
||||
@ -94,12 +79,8 @@ struct _ClutterActorMetaClass
|
||||
void (* _clutter_meta4) (void);
|
||||
void (* _clutter_meta5) (void);
|
||||
void (* _clutter_meta6) (void);
|
||||
void (* _clutter_meta7) (void);
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_actor_meta_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_meta_set_name (ClutterActorMeta *meta,
|
||||
const gchar *name);
|
||||
|
@ -135,7 +135,7 @@ struct _AnchorCoord
|
||||
} fraction;
|
||||
|
||||
/* Use when is_fractional == FALSE */
|
||||
ClutterVertex units;
|
||||
graphene_point3d_t units;
|
||||
} v;
|
||||
};
|
||||
|
||||
@ -163,7 +163,7 @@ struct _SizeRequest
|
||||
struct _ClutterLayoutInfo
|
||||
{
|
||||
/* fixed position coordinates */
|
||||
ClutterPoint fixed_pos;
|
||||
graphene_point_t fixed_pos;
|
||||
|
||||
ClutterMargin margin;
|
||||
|
||||
@ -173,8 +173,8 @@ struct _ClutterLayoutInfo
|
||||
guint x_expand : 1;
|
||||
guint y_expand : 1;
|
||||
|
||||
ClutterSize minimum;
|
||||
ClutterSize natural;
|
||||
graphene_size_t minimum;
|
||||
graphene_size_t natural;
|
||||
};
|
||||
|
||||
const ClutterLayoutInfo * _clutter_actor_get_layout_info_or_defaults (ClutterActor *self);
|
||||
@ -203,13 +203,13 @@ struct _ClutterTransformInfo
|
||||
AnchorCoord anchor;
|
||||
|
||||
/* translation */
|
||||
ClutterVertex translation;
|
||||
graphene_point3d_t translation;
|
||||
|
||||
/* z_position */
|
||||
gfloat z_position;
|
||||
|
||||
/* transformation center */
|
||||
ClutterPoint pivot;
|
||||
graphene_point_t pivot;
|
||||
gfloat pivot_z;
|
||||
|
||||
CoglMatrix transform;
|
||||
@ -242,9 +242,6 @@ ClutterAnimationInfo * _clutter_actor_get_animation_info
|
||||
ClutterTransition * _clutter_actor_create_transition (ClutterActor *self,
|
||||
GParamSpec *pspec,
|
||||
...);
|
||||
ClutterTransition * _clutter_actor_get_transition (ClutterActor *self,
|
||||
GParamSpec *pspec);
|
||||
|
||||
gboolean _clutter_actor_foreach_child (ClutterActor *self,
|
||||
ClutterForeachCallback callback,
|
||||
gpointer user_data);
|
||||
@ -277,6 +274,9 @@ void _clutter_actor_set_enable_paint_unmapped
|
||||
void _clutter_actor_set_has_pointer (ClutterActor *self,
|
||||
gboolean has_pointer);
|
||||
|
||||
void _clutter_actor_set_has_key_focus (ClutterActor *self,
|
||||
gboolean has_key_focus);
|
||||
|
||||
void _clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||
ClutterRedrawFlags flags,
|
||||
const ClutterPaintVolume *clip_volume);
|
||||
@ -297,8 +297,6 @@ const gchar * _clutter_actor_get_debug_name
|
||||
void _clutter_actor_push_clone_paint (void);
|
||||
void _clutter_actor_pop_clone_paint (void);
|
||||
|
||||
guint32 _clutter_actor_get_pick_id (ClutterActor *self);
|
||||
|
||||
void _clutter_actor_shader_pre_paint (ClutterActor *actor,
|
||||
gboolean repeat);
|
||||
void _clutter_actor_shader_post_paint (ClutterActor *actor);
|
||||
@ -317,7 +315,6 @@ void _clutter_actor_queue_relayout_on_clones
|
||||
void _clutter_actor_queue_only_relayout (ClutterActor *actor);
|
||||
void _clutter_actor_queue_update_resource_scale_recursive (ClutterActor *actor);
|
||||
|
||||
CoglFramebuffer * _clutter_actor_get_active_framebuffer (ClutterActor *actor);
|
||||
gboolean _clutter_actor_get_real_resource_scale (ClutterActor *actor,
|
||||
float *resource_scale);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -39,6 +39,8 @@
|
||||
|
||||
#include <clutter/clutter-types.h>
|
||||
#include <clutter/clutter-event.h>
|
||||
#include <clutter/clutter-paint-context.h>
|
||||
#include <clutter/clutter-pick-context.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@ -173,9 +175,12 @@ struct _ClutterActor
|
||||
* @get_preferred_height: virtual function, used when querying the minimum
|
||||
* and natural heights of an actor for a given width; it is used by
|
||||
* clutter_actor_get_preferred_height()
|
||||
* @allocate: virtual function, used when settings the coordinates of an
|
||||
* actor; it is used by clutter_actor_allocate(); it must chain up to
|
||||
* the parent's implementation, or call clutter_actor_set_allocation()
|
||||
* @allocate: virtual function, used when setting the coordinates of an
|
||||
* actor; it is used by clutter_actor_allocate(); when overriding this
|
||||
* function without chaining up, clutter_actor_set_allocation() must be
|
||||
* called and children must be allocated by the implementation, when
|
||||
* chaining up though, those things will be done by the parent's
|
||||
* implementation.
|
||||
* @apply_transform: virtual function, used when applying the transformations
|
||||
* to an actor before painting it or when transforming coordinates or
|
||||
* the allocation; it must chain up to the parent's implementation
|
||||
@ -228,13 +233,14 @@ struct _ClutterActorClass
|
||||
void (* unrealize) (ClutterActor *self);
|
||||
void (* map) (ClutterActor *self);
|
||||
void (* unmap) (ClutterActor *self);
|
||||
void (* paint) (ClutterActor *self);
|
||||
void (* paint) (ClutterActor *self,
|
||||
ClutterPaintContext *paint_context);
|
||||
void (* parent_set) (ClutterActor *actor,
|
||||
ClutterActor *old_parent);
|
||||
|
||||
void (* destroy) (ClutterActor *self);
|
||||
void (* pick) (ClutterActor *actor,
|
||||
const ClutterColor *color);
|
||||
ClutterPickContext *pick_context);
|
||||
|
||||
gboolean (* queue_redraw) (ClutterActor *actor,
|
||||
ClutterActor *leaf_that_queued,
|
||||
@ -250,8 +256,7 @@ struct _ClutterActorClass
|
||||
gfloat *min_height_p,
|
||||
gfloat *natural_height_p);
|
||||
void (* allocate) (ClutterActor *self,
|
||||
const ClutterActorBox *box,
|
||||
ClutterAllocationFlags flags);
|
||||
const ClutterActorBox *box);
|
||||
|
||||
/* transformations */
|
||||
void (* apply_transform) (ClutterActor *actor,
|
||||
@ -296,10 +301,11 @@ struct _ClutterActorClass
|
||||
|
||||
gboolean (* touch_event) (ClutterActor *self,
|
||||
ClutterTouchEvent *event);
|
||||
gboolean (* has_accessible) (ClutterActor *self);
|
||||
|
||||
/*< private >*/
|
||||
/* padding for future expansion */
|
||||
gpointer _padding_dummy[26];
|
||||
gpointer _padding_dummy[25];
|
||||
};
|
||||
|
||||
/**
|
||||
@ -350,9 +356,17 @@ void clutter_actor_map
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_unmap (ClutterActor *self);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_paint (ClutterActor *self);
|
||||
void clutter_actor_paint (ClutterActor *self,
|
||||
ClutterPaintContext *paint_context);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_continue_paint (ClutterActor *self);
|
||||
void clutter_actor_continue_paint (ClutterActor *self,
|
||||
ClutterPaintContext *paint_context);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_pick (ClutterActor *actor,
|
||||
ClutterPickContext *pick_context);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_continue_pick (ClutterActor *actor,
|
||||
ClutterPickContext *pick_context);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_queue_redraw (ClutterActor *self);
|
||||
CLUTTER_EXPORT
|
||||
@ -369,6 +383,8 @@ CLUTTER_EXPORT
|
||||
const gchar * clutter_actor_get_name (ClutterActor *self);
|
||||
CLUTTER_EXPORT
|
||||
AtkObject * clutter_actor_get_accessible (ClutterActor *self);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_actor_has_accessible (ClutterActor *self);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_actor_is_visible (ClutterActor *self);
|
||||
@ -401,38 +417,29 @@ void clutter_actor_get_preferred_size
|
||||
gfloat *natural_height_p);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_allocate (ClutterActor *self,
|
||||
const ClutterActorBox *box,
|
||||
ClutterAllocationFlags flags);
|
||||
const ClutterActorBox *box);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_allocate_preferred_size (ClutterActor *self,
|
||||
ClutterAllocationFlags flags);
|
||||
void clutter_actor_allocate_preferred_size (ClutterActor *self);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_allocate_available_size (ClutterActor *self,
|
||||
gfloat x,
|
||||
gfloat y,
|
||||
gfloat available_width,
|
||||
gfloat available_height,
|
||||
ClutterAllocationFlags flags);
|
||||
gfloat available_height);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_allocate_align_fill (ClutterActor *self,
|
||||
const ClutterActorBox *box,
|
||||
gdouble x_align,
|
||||
gdouble y_align,
|
||||
gboolean x_fill,
|
||||
gboolean y_fill,
|
||||
ClutterAllocationFlags flags);
|
||||
gboolean y_fill);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_set_allocation (ClutterActor *self,
|
||||
const ClutterActorBox *box,
|
||||
ClutterAllocationFlags flags);
|
||||
const ClutterActorBox *box);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_get_allocation_box (ClutterActor *self,
|
||||
ClutterActorBox *box);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_get_allocation_vertices (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
ClutterVertex verts[]);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_actor_has_allocation (ClutterActor *self);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_set_size (ClutterActor *self,
|
||||
@ -817,16 +824,16 @@ gboolean clutter_actor_transform_stage_point
|
||||
gfloat *y_out);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_get_abs_allocation_vertices (ClutterActor *self,
|
||||
ClutterVertex verts[]);
|
||||
graphene_point3d_t *verts);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_apply_transform_to_point (ClutterActor *self,
|
||||
const ClutterVertex *point,
|
||||
ClutterVertex *vertex);
|
||||
const graphene_point3d_t *point,
|
||||
graphene_point3d_t *vertex);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
const ClutterVertex *point,
|
||||
ClutterVertex *vertex);
|
||||
const graphene_point3d_t *point,
|
||||
graphene_point3d_t *vertex);
|
||||
|
||||
/* Implicit animations */
|
||||
CLUTTER_EXPORT
|
||||
@ -870,6 +877,11 @@ void clutter_actor_set_opacity_override
|
||||
CLUTTER_EXPORT
|
||||
gint clutter_actor_get_opacity_override (ClutterActor *self);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_inhibit_culling (ClutterActor *actor);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_uninhibit_culling (ClutterActor *actor);
|
||||
|
||||
/**
|
||||
* ClutterActorCreateChildFunc:
|
||||
* @item: (type GObject): the item in the model
|
||||
@ -902,6 +914,11 @@ void clutter_actor_bind_model_with_properties
|
||||
const char *first_model_property,
|
||||
...);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_pick_box (ClutterActor *self,
|
||||
ClutterPickContext *pick_context,
|
||||
const ClutterActorBox *box);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_ACTOR_H__ */
|
||||
|
@ -85,8 +85,7 @@ G_DEFINE_TYPE (ClutterAlignConstraint,
|
||||
|
||||
static void
|
||||
source_position_changed (ClutterActor *actor,
|
||||
const ClutterActorBox *allocation,
|
||||
ClutterAllocationFlags flags,
|
||||
GParamSpec *pspec,
|
||||
ClutterAlignConstraint *align)
|
||||
{
|
||||
if (align->actor != NULL)
|
||||
@ -410,7 +409,7 @@ clutter_align_constraint_set_source (ClutterAlignConstraint *align,
|
||||
align->source = source;
|
||||
if (align->source != NULL)
|
||||
{
|
||||
g_signal_connect (align->source, "allocation-changed",
|
||||
g_signal_connect (align->source, "notify::allocation",
|
||||
G_CALLBACK (source_position_changed),
|
||||
align);
|
||||
g_signal_connect (align->source, "destroy",
|
||||
|
@ -27,36 +27,23 @@
|
||||
* @short_description: Interface for animatable classes
|
||||
*
|
||||
* #ClutterAnimatable is an interface that allows a #GObject class
|
||||
* to control how a #ClutterAnimation will animate a property.
|
||||
* to control how an actor will animate a property.
|
||||
*
|
||||
* Each #ClutterAnimatable should implement the
|
||||
* #ClutterAnimatableInterface.interpolate_property() virtual function of the
|
||||
* interface to compute the animation state between two values of an interval
|
||||
* depending on a progress factor, expressed as a floating point value.
|
||||
*
|
||||
* If a #ClutterAnimatable is animated by a #ClutterAnimation
|
||||
* instance, the #ClutterAnimation will call
|
||||
* clutter_animatable_interpolate_property() passing the name of the
|
||||
* currently animated property; the values interval; and the progress factor.
|
||||
* The #ClutterAnimatable implementation should return the computed value for
|
||||
* the animated
|
||||
* property.
|
||||
*
|
||||
* #ClutterAnimatable is available since Clutter 1.0
|
||||
*/
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "clutter-animatable.h"
|
||||
#include "clutter-interval.h"
|
||||
#include "clutter-debug.h"
|
||||
#include "clutter-private.h"
|
||||
|
||||
#include "deprecated/clutter-animatable.h"
|
||||
#include "deprecated/clutter-animation.h"
|
||||
|
||||
G_DEFINE_INTERFACE (ClutterAnimatable, clutter_animatable, G_TYPE_OBJECT);
|
||||
|
||||
static void
|
||||
@ -64,80 +51,6 @@ clutter_animatable_default_init (ClutterAnimatableInterface *iface)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_animatable_animate_property:
|
||||
* @animatable: a #ClutterAnimatable
|
||||
* @animation: a #ClutterAnimation
|
||||
* @property_name: the name of the animated property
|
||||
* @initial_value: the initial value of the animation interval
|
||||
* @final_value: the final value of the animation interval
|
||||
* @progress: the progress factor
|
||||
* @value: return location for the animation value
|
||||
*
|
||||
* Calls the animate_property() virtual function for @animatable.
|
||||
*
|
||||
* The @initial_value and @final_value #GValue<!-- -->s must contain
|
||||
* the same type; @value must have been initialized to the same
|
||||
* type of @initial_value and @final_value.
|
||||
*
|
||||
* All implementation of the #ClutterAnimatable interface must
|
||||
* implement this function.
|
||||
*
|
||||
* Return value: %TRUE if the value has been validated and can
|
||||
* be applied to the #ClutterAnimatable, and %FALSE otherwise
|
||||
*
|
||||
* Since: 1.0
|
||||
*
|
||||
* Deprecated: 1.8: Use clutter_animatable_interpolate_value()
|
||||
* instead
|
||||
*/
|
||||
gboolean
|
||||
clutter_animatable_animate_property (ClutterAnimatable *animatable,
|
||||
ClutterAnimation *animation,
|
||||
const gchar *property_name,
|
||||
const GValue *initial_value,
|
||||
const GValue *final_value,
|
||||
gdouble progress,
|
||||
GValue *value)
|
||||
{
|
||||
ClutterAnimatableInterface *iface;
|
||||
gboolean res;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE);
|
||||
g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), FALSE);
|
||||
g_return_val_if_fail (property_name != NULL, FALSE);
|
||||
g_return_val_if_fail (initial_value != NULL && final_value != NULL, FALSE);
|
||||
g_return_val_if_fail (G_VALUE_TYPE (initial_value) != G_TYPE_INVALID, FALSE);
|
||||
g_return_val_if_fail (G_VALUE_TYPE (final_value) != G_TYPE_INVALID, FALSE);
|
||||
g_return_val_if_fail (value != NULL, FALSE);
|
||||
g_return_val_if_fail (G_VALUE_TYPE (value) == G_VALUE_TYPE (initial_value) &&
|
||||
G_VALUE_TYPE (value) == G_VALUE_TYPE (final_value),
|
||||
FALSE);
|
||||
|
||||
iface = CLUTTER_ANIMATABLE_GET_IFACE (animatable);
|
||||
if (iface->animate_property == NULL)
|
||||
{
|
||||
ClutterInterval *interval;
|
||||
|
||||
interval = clutter_animation_get_interval (animation, property_name);
|
||||
if (interval == NULL)
|
||||
return FALSE;
|
||||
|
||||
res = clutter_animatable_interpolate_value (animatable, property_name,
|
||||
interval,
|
||||
progress,
|
||||
value);
|
||||
}
|
||||
else
|
||||
res = iface->animate_property (animatable, animation,
|
||||
property_name,
|
||||
initial_value, final_value,
|
||||
progress,
|
||||
value);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_animatable_find_property:
|
||||
* @animatable: a #ClutterAnimatable
|
||||
|
@ -42,8 +42,6 @@ G_DECLARE_INTERFACE (ClutterAnimatable, clutter_animatable,
|
||||
|
||||
/**
|
||||
* ClutterAnimatableInterface:
|
||||
* @animate_property: virtual function for custom interpolation of a
|
||||
* property. This virtual function is deprecated
|
||||
* @find_property: virtual function for retrieving the #GParamSpec of
|
||||
* an animatable property
|
||||
* @get_initial_state: virtual function for retrieving the initial
|
||||
@ -53,9 +51,6 @@ G_DECLARE_INTERFACE (ClutterAnimatable, clutter_animatable,
|
||||
* @interpolate_value: virtual function for interpolating the progress
|
||||
* of a property
|
||||
*
|
||||
* Base interface for #GObject<!-- -->s that can be animated by a
|
||||
* a #ClutterAnimation.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
struct _ClutterAnimatableInterface
|
||||
@ -64,13 +59,6 @@ struct _ClutterAnimatableInterface
|
||||
GTypeInterface parent_iface;
|
||||
|
||||
/*< public >*/
|
||||
gboolean (* animate_property) (ClutterAnimatable *animatable,
|
||||
ClutterAnimation *animation,
|
||||
const gchar *property_name,
|
||||
const GValue *initial_value,
|
||||
const GValue *final_value,
|
||||
gdouble progress,
|
||||
GValue *value);
|
||||
GParamSpec *(* find_property) (ClutterAnimatable *animatable,
|
||||
const gchar *property_name);
|
||||
void (* get_initial_state) (ClutterAnimatable *animatable,
|
||||
|
@ -30,9 +30,7 @@
|
||||
|
||||
#ifndef __GI_SCANNER__
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAction, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActor, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActorMeta, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAlignConstraint, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBackend, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBindConstraint, g_object_unref)
|
||||
@ -43,20 +41,15 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBoxLayout, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBrightnessContrastEffect, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterCanvas, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterChildMeta, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterClickAction, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterClone, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterColorizeEffect, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterConstraint, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterContainer, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeformEffect, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDesaturateEffect, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeviceManager, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDragAction, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDropAction, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterEffect, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterFixedLayout, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterFlowLayout, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterGestureAction, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterGridLayout, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterImage, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterInputDevice, g_object_unref)
|
||||
@ -91,13 +84,10 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActorBox, clutter_actor_box_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterColor, clutter_color_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterMargin, clutter_margin_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterMatrix, clutter_matrix_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintContext, clutter_paint_context_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintNode, clutter_paint_node_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintVolume, clutter_paint_volume_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPathNode, clutter_path_node_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPoint, clutter_point_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterRect, clutter_rect_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterSize, clutter_size_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterVertex, clutter_vertex_free)
|
||||
|
||||
#endif /* __GI_SCANNER__ */
|
||||
|
||||
|
@ -23,12 +23,9 @@
|
||||
#define __CLUTTER_BACKEND_PRIVATE_H__
|
||||
|
||||
#include <clutter/clutter-backend.h>
|
||||
#include <clutter/clutter-device-manager.h>
|
||||
#include <clutter/clutter-keymap.h>
|
||||
#include <clutter/clutter-seat.h>
|
||||
#include <clutter/clutter-stage-window.h>
|
||||
|
||||
#include "clutter-event-translator.h"
|
||||
|
||||
#define CLUTTER_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BACKEND, ClutterBackendClass))
|
||||
#define CLUTTER_IS_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BACKEND))
|
||||
#define CLUTTER_BACKEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BACKEND, ClutterBackendClass))
|
||||
@ -49,8 +46,6 @@ struct _ClutterBackend
|
||||
|
||||
CoglOnscreen *dummy_onscreen;
|
||||
|
||||
ClutterDeviceManager *device_manager;
|
||||
|
||||
cairo_font_options_t *font_options;
|
||||
|
||||
gchar *font_name;
|
||||
@ -58,11 +53,9 @@ struct _ClutterBackend
|
||||
gfloat units_per_em;
|
||||
gint32 units_serial;
|
||||
|
||||
GList *event_translators;
|
||||
ClutterStageWindow *stage_window;
|
||||
|
||||
ClutterInputMethod *input_method;
|
||||
|
||||
ClutterKeymap *keymap;
|
||||
};
|
||||
|
||||
struct _ClutterBackendClass
|
||||
@ -91,23 +84,12 @@ struct _ClutterBackendClass
|
||||
GError **error);
|
||||
gboolean (* create_context) (ClutterBackend *backend,
|
||||
GError **error);
|
||||
ClutterDeviceManager *(* get_device_manager) (ClutterBackend *backend);
|
||||
|
||||
void (* copy_event_data) (ClutterBackend *backend,
|
||||
const ClutterEvent *src,
|
||||
ClutterEvent *dest);
|
||||
void (* free_event_data) (ClutterBackend *backend,
|
||||
ClutterEvent *event);
|
||||
|
||||
gboolean (* translate_event) (ClutterBackend *backend,
|
||||
gpointer native,
|
||||
ClutterEvent *event);
|
||||
|
||||
PangoDirection (* get_keymap_direction) (ClutterBackend *backend);
|
||||
|
||||
void (* bell_notify) (ClutterBackend *backend);
|
||||
|
||||
ClutterKeymap * (* get_keymap) (ClutterBackend *backend);
|
||||
ClutterSeat * (* get_default_seat) (ClutterBackend *backend);
|
||||
|
||||
/* signals */
|
||||
void (* resolution_changed) (ClutterBackend *backend);
|
||||
@ -136,29 +118,21 @@ void _clutter_backend_copy_event_data (Clutter
|
||||
ClutterEvent *dest);
|
||||
void _clutter_backend_free_event_data (ClutterBackend *backend,
|
||||
ClutterEvent *event);
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_backend_translate_event (ClutterBackend *backend,
|
||||
gpointer native,
|
||||
ClutterEvent *event);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_backend_add_event_translator (ClutterBackend *backend,
|
||||
ClutterEventTranslator *translator);
|
||||
|
||||
void _clutter_backend_remove_event_translator (ClutterBackend *backend,
|
||||
ClutterEventTranslator *translator);
|
||||
|
||||
ClutterFeatureFlags _clutter_backend_get_features (ClutterBackend *backend);
|
||||
|
||||
gfloat _clutter_backend_get_units_per_em (ClutterBackend *backend,
|
||||
PangoFontDescription *font_desc);
|
||||
gint32 _clutter_backend_get_units_serial (ClutterBackend *backend);
|
||||
|
||||
PangoDirection _clutter_backend_get_keymap_direction (ClutterBackend *backend);
|
||||
void clutter_set_allowed_drivers (const char *drivers);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend);
|
||||
|
||||
void clutter_set_allowed_drivers (const char *drivers);
|
||||
ClutterStageWindow * clutter_backend_get_stage_window (ClutterBackend *backend);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -51,7 +51,6 @@
|
||||
#include "clutter-stage-manager-private.h"
|
||||
#include "clutter-stage-private.h"
|
||||
#include "clutter-stage-window.h"
|
||||
#include "clutter-device-manager-private.h"
|
||||
|
||||
#ifdef CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT
|
||||
#include "wayland/clutter-wayland-compositor.h"
|
||||
@ -62,9 +61,6 @@
|
||||
#ifdef CLUTTER_INPUT_X11
|
||||
#include "x11/clutter-backend-x11.h"
|
||||
#endif
|
||||
#ifdef CLUTTER_INPUT_EVDEV
|
||||
#include "evdev/clutter-device-manager-evdev.h"
|
||||
#endif
|
||||
#ifdef CLUTTER_WINDOWING_EGL
|
||||
#include "egl/clutter-backend-eglnative.h"
|
||||
#endif
|
||||
@ -104,10 +100,12 @@ clutter_backend_dispose (GObject *gobject)
|
||||
/* clear the events still in the queue of the main context */
|
||||
_clutter_clear_events_queue ();
|
||||
|
||||
/* remove all event translators */
|
||||
g_clear_pointer (&backend->event_translators, g_list_free);
|
||||
|
||||
g_clear_pointer (&backend->dummy_onscreen, cogl_object_unref);
|
||||
if (backend->stage_window)
|
||||
{
|
||||
g_object_remove_weak_pointer (G_OBJECT (backend->stage_window),
|
||||
(gpointer *) &backend->stage_window);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (clutter_backend_parent_class)->dispose (gobject);
|
||||
}
|
||||
@ -397,7 +395,7 @@ clutter_backend_real_create_context (ClutterBackend *backend,
|
||||
else
|
||||
g_set_error_literal (error, CLUTTER_INIT_ERROR,
|
||||
CLUTTER_INIT_ERROR_BACKEND,
|
||||
_("Unable to initialize the Clutter backend: no available drivers found."));
|
||||
"Unable to initialize the Clutter backend: no available drivers found.");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -526,92 +524,7 @@ _clutter_create_backend (void)
|
||||
static void
|
||||
clutter_backend_real_init_events (ClutterBackend *backend)
|
||||
{
|
||||
const char *input_backend = NULL;
|
||||
|
||||
input_backend = g_getenv ("CLUTTER_INPUT_BACKEND");
|
||||
if (input_backend != NULL)
|
||||
input_backend = g_intern_string (input_backend);
|
||||
|
||||
#ifdef CLUTTER_INPUT_X11
|
||||
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11) &&
|
||||
(input_backend == NULL || input_backend == I_(CLUTTER_INPUT_X11)))
|
||||
{
|
||||
_clutter_backend_x11_events_init (backend);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CLUTTER_INPUT_EVDEV
|
||||
/* Evdev can be used regardless of the windowing system */
|
||||
if ((input_backend != NULL && strcmp (input_backend, CLUTTER_INPUT_EVDEV) == 0)
|
||||
#ifdef CLUTTER_WINDOWING_EGL
|
||||
/* but we do want to always use it for EGL native */
|
||||
|| clutter_check_windowing_backend (CLUTTER_WINDOWING_EGL)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
_clutter_events_evdev_init (backend);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (input_backend != NULL)
|
||||
{
|
||||
if (input_backend != I_(CLUTTER_INPUT_NULL))
|
||||
g_error ("Unrecognized input backend '%s'", input_backend);
|
||||
}
|
||||
else
|
||||
g_error ("Unknown input backend");
|
||||
}
|
||||
|
||||
static ClutterDeviceManager *
|
||||
clutter_backend_real_get_device_manager (ClutterBackend *backend)
|
||||
{
|
||||
if (G_UNLIKELY (backend->device_manager == NULL))
|
||||
{
|
||||
g_critical ("No device manager available, expect broken input");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return backend->device_manager;
|
||||
}
|
||||
|
||||
static ClutterKeymap *
|
||||
clutter_backend_real_get_keymap (ClutterBackend *backend)
|
||||
{
|
||||
if (G_UNLIKELY (backend->keymap == NULL))
|
||||
{
|
||||
g_critical ("No keymap available, expect broken keyboard input");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return backend->keymap;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_backend_real_translate_event (ClutterBackend *backend,
|
||||
gpointer native,
|
||||
ClutterEvent *event)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = backend->event_translators;
|
||||
l != NULL;
|
||||
l = l->next)
|
||||
{
|
||||
ClutterEventTranslator *translator = l->data;
|
||||
ClutterTranslateReturn retval;
|
||||
|
||||
retval = _clutter_event_translator_translate_event (translator,
|
||||
native,
|
||||
event);
|
||||
|
||||
if (retval == CLUTTER_TRANSLATE_QUEUE)
|
||||
return TRUE;
|
||||
|
||||
if (retval == CLUTTER_TRANSLATE_REMOVE)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
g_error ("Unknown input backend");
|
||||
}
|
||||
|
||||
static void
|
||||
@ -636,8 +549,7 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterBackendClass, resolution_changed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@ -654,8 +566,7 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterBackendClass, font_changed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@ -672,19 +583,15 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterBackendClass, settings_changed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
klass->resolution_changed = clutter_backend_real_resolution_changed;
|
||||
klass->font_changed = clutter_backend_real_font_changed;
|
||||
|
||||
klass->init_events = clutter_backend_real_init_events;
|
||||
klass->get_device_manager = clutter_backend_real_get_device_manager;
|
||||
klass->translate_event = clutter_backend_real_translate_event;
|
||||
klass->create_context = clutter_backend_real_create_context;
|
||||
klass->get_features = clutter_backend_real_get_features;
|
||||
klass->get_keymap = clutter_backend_real_get_keymap;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -693,7 +600,7 @@ clutter_backend_init (ClutterBackend *self)
|
||||
self->units_per_em = -1.0;
|
||||
self->units_serial = 1;
|
||||
|
||||
self->dummy_onscreen = COGL_INVALID_HANDLE;
|
||||
self->dummy_onscreen = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
@ -761,6 +668,10 @@ _clutter_backend_create_stage (ClutterBackend *backend,
|
||||
|
||||
g_assert (CLUTTER_IS_STAGE_WINDOW (stage_window));
|
||||
|
||||
backend->stage_window = stage_window;
|
||||
g_object_add_weak_pointer (G_OBJECT (backend->stage_window),
|
||||
(gpointer *) &backend->stage_window);
|
||||
|
||||
return stage_window;
|
||||
}
|
||||
|
||||
@ -845,37 +756,24 @@ _clutter_backend_copy_event_data (ClutterBackend *backend,
|
||||
const ClutterEvent *src,
|
||||
ClutterEvent *dest)
|
||||
{
|
||||
ClutterEventExtenderInterface *iface;
|
||||
ClutterBackendClass *klass;
|
||||
ClutterSeatClass *seat_class;
|
||||
ClutterSeat *seat;
|
||||
|
||||
klass = CLUTTER_BACKEND_GET_CLASS (backend);
|
||||
if (CLUTTER_IS_EVENT_EXTENDER (backend->device_manager))
|
||||
{
|
||||
iface = CLUTTER_EVENT_EXTENDER_GET_IFACE (backend->device_manager);
|
||||
iface->copy_event_data (CLUTTER_EVENT_EXTENDER (backend->device_manager),
|
||||
src, dest);
|
||||
}
|
||||
else if (klass->copy_event_data != NULL)
|
||||
klass->copy_event_data (backend, src, dest);
|
||||
seat = clutter_backend_get_default_seat (backend);
|
||||
seat_class = CLUTTER_SEAT_GET_CLASS (seat);
|
||||
seat_class->copy_event_data (seat, src, dest);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_backend_free_event_data (ClutterBackend *backend,
|
||||
ClutterEvent *event)
|
||||
{
|
||||
ClutterEventExtenderInterface *iface;
|
||||
ClutterBackendClass *klass;
|
||||
ClutterSeatClass *seat_class;
|
||||
ClutterSeat *seat;
|
||||
|
||||
klass = CLUTTER_BACKEND_GET_CLASS (backend);
|
||||
|
||||
if (CLUTTER_IS_EVENT_EXTENDER (backend->device_manager))
|
||||
{
|
||||
iface = CLUTTER_EVENT_EXTENDER_GET_IFACE (backend->device_manager);
|
||||
iface->free_event_data (CLUTTER_EVENT_EXTENDER (backend->device_manager),
|
||||
event);
|
||||
}
|
||||
else if (klass->free_event_data != NULL)
|
||||
klass->free_event_data (backend, event);
|
||||
seat = clutter_backend_get_default_seat (backend);
|
||||
seat_class = CLUTTER_SEAT_GET_CLASS (seat);
|
||||
seat_class->free_event_data (seat, event);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1021,28 +919,6 @@ _clutter_backend_translate_event (ClutterBackend *backend,
|
||||
event);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_backend_add_event_translator (ClutterBackend *backend,
|
||||
ClutterEventTranslator *translator)
|
||||
{
|
||||
if (g_list_find (backend->event_translators, translator) != NULL)
|
||||
return;
|
||||
|
||||
backend->event_translators =
|
||||
g_list_prepend (backend->event_translators, translator);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_backend_remove_event_translator (ClutterBackend *backend,
|
||||
ClutterEventTranslator *translator)
|
||||
{
|
||||
if (g_list_find (backend->event_translators, translator) == NULL)
|
||||
return;
|
||||
|
||||
backend->event_translators =
|
||||
g_list_remove (backend->event_translators, translator);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_backend_get_cogl_context: (skip)
|
||||
* @backend: a #ClutterBackend
|
||||
@ -1094,39 +970,6 @@ clutter_wayland_set_compositor_display (void *display)
|
||||
}
|
||||
#endif
|
||||
|
||||
PangoDirection
|
||||
_clutter_backend_get_keymap_direction (ClutterBackend *backend)
|
||||
{
|
||||
ClutterBackendClass *klass;
|
||||
|
||||
klass = CLUTTER_BACKEND_GET_CLASS (backend);
|
||||
if (klass->get_keymap_direction != NULL)
|
||||
return klass->get_keymap_direction (backend);
|
||||
|
||||
return PANGO_DIRECTION_NEUTRAL;
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
|
||||
{
|
||||
if (backend->dummy_onscreen == COGL_INVALID_HANDLE)
|
||||
{
|
||||
CoglError *internal_error = NULL;
|
||||
|
||||
backend->dummy_onscreen = cogl_onscreen_new (backend->cogl_context, 1, 1);
|
||||
|
||||
if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (backend->dummy_onscreen),
|
||||
&internal_error))
|
||||
{
|
||||
g_critical ("Unable to create dummy onscreen: %s", internal_error->message);
|
||||
cogl_error_free (internal_error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
cogl_set_framebuffer (COGL_FRAMEBUFFER (backend->dummy_onscreen));
|
||||
}
|
||||
|
||||
void
|
||||
clutter_set_allowed_drivers (const char *drivers)
|
||||
{
|
||||
@ -1139,16 +982,6 @@ clutter_set_allowed_drivers (const char *drivers)
|
||||
allowed_drivers = g_strdup (drivers);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_backend_bell_notify (ClutterBackend *backend)
|
||||
{
|
||||
ClutterBackendClass *klass;
|
||||
|
||||
klass = CLUTTER_BACKEND_GET_CLASS (backend);
|
||||
if (klass->bell_notify)
|
||||
klass->bell_notify (backend);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_backend_get_input_method:
|
||||
* @backend: the #CLutterBackend
|
||||
@ -1177,16 +1010,24 @@ clutter_backend_set_input_method (ClutterBackend *backend,
|
||||
g_set_object (&backend->input_method, method);
|
||||
}
|
||||
|
||||
ClutterStageWindow *
|
||||
clutter_backend_get_stage_window (ClutterBackend *backend)
|
||||
{
|
||||
return backend->stage_window;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_backend_get_keymap:
|
||||
* clutter_backend_get_default_seat:
|
||||
* @backend: the #ClutterBackend
|
||||
*
|
||||
* Gets the keymap used by Clutter
|
||||
* Returns the default seat
|
||||
*
|
||||
* Returns: (transfer none): the keymap
|
||||
* Returns: (transfer none): the default seat
|
||||
**/
|
||||
ClutterKeymap *
|
||||
clutter_backend_get_keymap (ClutterBackend *backend)
|
||||
ClutterSeat *
|
||||
clutter_backend_get_default_seat (ClutterBackend *backend)
|
||||
{
|
||||
return CLUTTER_BACKEND_GET_CLASS (backend)->get_keymap (backend);
|
||||
g_return_val_if_fail (CLUTTER_IS_BACKEND (backend), NULL);
|
||||
|
||||
return CLUTTER_BACKEND_GET_CLASS (backend)->get_default_seat (backend);
|
||||
}
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include <clutter/clutter-config.h>
|
||||
#include <clutter/clutter-keymap.h>
|
||||
#include <clutter/clutter-types.h>
|
||||
#include <clutter/clutter-seat.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@ -72,9 +73,6 @@ const cairo_font_options_t * clutter_backend_get_font_options (Clutter
|
||||
CLUTTER_EXPORT
|
||||
CoglContext * clutter_backend_get_cogl_context (ClutterBackend *backend);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_backend_bell_notify (ClutterBackend *backend);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterInputMethod * clutter_backend_get_input_method (ClutterBackend *backend);
|
||||
|
||||
@ -82,7 +80,7 @@ CLUTTER_EXPORT
|
||||
void clutter_backend_set_input_method (ClutterBackend *backend,
|
||||
ClutterInputMethod *method);
|
||||
CLUTTER_EXPORT
|
||||
ClutterKeymap * clutter_backend_get_keymap (ClutterBackend *backend);
|
||||
ClutterSeat * clutter_backend_get_default_seat (ClutterBackend *backend);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -49,10 +49,10 @@
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
#include "deprecated/clutter-container.h"
|
||||
#include "deprecated/clutter-bin-layout.h"
|
||||
|
||||
#include "clutter-actor-private.h"
|
||||
#include "clutter-animatable.h"
|
||||
#include "clutter-bin-layout.h"
|
||||
#include "clutter-child-meta.h"
|
||||
#include "clutter-debug.h"
|
||||
#include "clutter-enum-types.h"
|
||||
@ -406,8 +406,7 @@ get_actor_align_factor (ClutterActorAlign alignment)
|
||||
static void
|
||||
clutter_bin_layout_allocate (ClutterLayoutManager *manager,
|
||||
ClutterContainer *container,
|
||||
const ClutterActorBox *allocation,
|
||||
ClutterAllocationFlags flags)
|
||||
const ClutterActorBox *allocation)
|
||||
{
|
||||
gfloat allocation_x, allocation_y;
|
||||
gfloat available_w, available_h;
|
||||
@ -515,8 +514,7 @@ clutter_bin_layout_allocate (ClutterLayoutManager *manager,
|
||||
|
||||
clutter_actor_allocate_align_fill (child, &child_alloc,
|
||||
x_align, y_align,
|
||||
x_fill, y_fill,
|
||||
flags);
|
||||
x_fill, y_fill);
|
||||
}
|
||||
}
|
||||
|
||||
@ -698,187 +696,3 @@ clutter_bin_layout_new (ClutterBinAlignment x_align,
|
||||
"y-align", y_align,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_bin_layout_set_alignment:
|
||||
* @self: a #ClutterBinLayout
|
||||
* @child: (allow-none): a child of @container
|
||||
* @x_align: the horizontal alignment policy to be used for the @child
|
||||
* inside @container
|
||||
* @y_align: the vertical aligment policy to be used on the @child
|
||||
* inside @container
|
||||
*
|
||||
* Sets the horizontal and vertical alignment policies to be applied
|
||||
* to a @child of @self
|
||||
*
|
||||
* If @child is %NULL then the @x_align and @y_align values will
|
||||
* be set as the default alignment policies
|
||||
*
|
||||
* Since: 1.2
|
||||
*
|
||||
* Deprecated: 1.12: Use the #ClutterActor:x-align and
|
||||
* #ClutterActor:y-align properties of #ClutterActor instead.
|
||||
*/
|
||||
void
|
||||
clutter_bin_layout_set_alignment (ClutterBinLayout *self,
|
||||
ClutterActor *child,
|
||||
ClutterBinAlignment x_align,
|
||||
ClutterBinAlignment y_align)
|
||||
{
|
||||
ClutterBinLayoutPrivate *priv;
|
||||
ClutterLayoutManager *manager;
|
||||
ClutterLayoutMeta *meta;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_BIN_LAYOUT (self));
|
||||
g_return_if_fail (child == NULL || CLUTTER_IS_ACTOR (child));
|
||||
|
||||
priv = self->priv;
|
||||
|
||||
if (priv->container == NULL)
|
||||
{
|
||||
if (child == NULL)
|
||||
{
|
||||
set_x_align (self, x_align);
|
||||
set_y_align (self, y_align);
|
||||
}
|
||||
else
|
||||
g_warning ("The layout of type '%s' must be associated to "
|
||||
"a ClutterContainer before setting the alignment "
|
||||
"on its children",
|
||||
G_OBJECT_TYPE_NAME (self));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
manager = CLUTTER_LAYOUT_MANAGER (self);
|
||||
meta = clutter_layout_manager_get_child_meta (manager,
|
||||
priv->container,
|
||||
child);
|
||||
g_assert (CLUTTER_IS_BIN_LAYER (meta));
|
||||
|
||||
set_layer_x_align (CLUTTER_BIN_LAYER (meta), x_align);
|
||||
set_layer_y_align (CLUTTER_BIN_LAYER (meta), y_align);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_bin_layout_get_alignment:
|
||||
* @self: a #ClutterBinLayout
|
||||
* @child: (allow-none): a child of @container
|
||||
* @x_align: (out) (allow-none): return location for the horizontal
|
||||
* alignment policy
|
||||
* @y_align: (out) (allow-none): return location for the vertical
|
||||
* alignment policy
|
||||
*
|
||||
* Retrieves the horizontal and vertical alignment policies for
|
||||
* a child of @self
|
||||
*
|
||||
* If @child is %NULL the default alignment policies will be returned
|
||||
* instead
|
||||
*
|
||||
* Since: 1.2
|
||||
*
|
||||
* Deprecated: 1.12: Use the #ClutterActor:x-align and the
|
||||
* #ClutterActor:y-align properties of #ClutterActor instead.
|
||||
*/
|
||||
void
|
||||
clutter_bin_layout_get_alignment (ClutterBinLayout *self,
|
||||
ClutterActor *child,
|
||||
ClutterBinAlignment *x_align,
|
||||
ClutterBinAlignment *y_align)
|
||||
{
|
||||
ClutterBinLayoutPrivate *priv;
|
||||
ClutterLayoutManager *manager;
|
||||
ClutterLayoutMeta *meta;
|
||||
ClutterBinLayer *layer;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_BIN_LAYOUT (self));
|
||||
|
||||
priv = self->priv;
|
||||
|
||||
if (priv->container == NULL)
|
||||
{
|
||||
if (child == NULL)
|
||||
{
|
||||
if (x_align)
|
||||
*x_align = priv->x_align;
|
||||
|
||||
if (y_align)
|
||||
*y_align = priv->y_align;
|
||||
}
|
||||
else
|
||||
g_warning ("The layout of type '%s' must be associated to "
|
||||
"a ClutterContainer before getting the alignment "
|
||||
"of its children",
|
||||
G_OBJECT_TYPE_NAME (self));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
manager = CLUTTER_LAYOUT_MANAGER (self);
|
||||
meta = clutter_layout_manager_get_child_meta (manager,
|
||||
priv->container,
|
||||
child);
|
||||
g_assert (CLUTTER_IS_BIN_LAYER (meta));
|
||||
|
||||
layer = CLUTTER_BIN_LAYER (meta);
|
||||
|
||||
if (x_align)
|
||||
*x_align = layer->x_align;
|
||||
|
||||
if (y_align)
|
||||
*y_align = layer->y_align;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_bin_layout_add:
|
||||
* @self: a #ClutterBinLayout
|
||||
* @child: a #ClutterActor
|
||||
* @x_align: horizontal alignment policy for @child
|
||||
* @y_align: vertical alignment policy for @child
|
||||
*
|
||||
* Adds a #ClutterActor to the container using @self and
|
||||
* sets the alignment policies for it
|
||||
*
|
||||
* This function is equivalent to clutter_container_add_actor()
|
||||
* and clutter_layout_manager_child_set_property() but it does not
|
||||
* require a pointer to the #ClutterContainer associated to the
|
||||
* #ClutterBinLayout
|
||||
*
|
||||
* Since: 1.2
|
||||
*
|
||||
* Deprecated: 1.12: Use clutter_actor_add_child() instead.
|
||||
*/
|
||||
void
|
||||
clutter_bin_layout_add (ClutterBinLayout *self,
|
||||
ClutterActor *child,
|
||||
ClutterBinAlignment x_align,
|
||||
ClutterBinAlignment y_align)
|
||||
{
|
||||
ClutterBinLayoutPrivate *priv;
|
||||
ClutterLayoutManager *manager;
|
||||
ClutterLayoutMeta *meta;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_BIN_LAYOUT (self));
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (child));
|
||||
|
||||
priv = self->priv;
|
||||
|
||||
if (priv->container == NULL)
|
||||
{
|
||||
g_warning ("The layout of type '%s' must be associated to "
|
||||
"a ClutterContainer before adding children",
|
||||
G_OBJECT_TYPE_NAME (self));
|
||||
return;
|
||||
}
|
||||
|
||||
clutter_container_add_actor (priv->container, child);
|
||||
|
||||
manager = CLUTTER_LAYOUT_MANAGER (self);
|
||||
meta = clutter_layout_manager_get_child_meta (manager,
|
||||
priv->container,
|
||||
child);
|
||||
g_assert (CLUTTER_IS_BIN_LAYER (meta));
|
||||
|
||||
set_layer_x_align (CLUTTER_BIN_LAYER (meta), x_align);
|
||||
set_layer_y_align (CLUTTER_BIN_LAYER (meta), y_align);
|
||||
}
|
||||
|
@ -144,6 +144,55 @@ source_destroyed (ClutterActor *actor,
|
||||
bind->source = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_bind_constraint_update_preferred_size (ClutterConstraint *constraint,
|
||||
ClutterActor *actor,
|
||||
ClutterOrientation direction,
|
||||
float for_size,
|
||||
float *minimum_size,
|
||||
float *natural_size)
|
||||
{
|
||||
ClutterBindConstraint *bind = CLUTTER_BIND_CONSTRAINT (constraint);
|
||||
float source_min, source_nat;
|
||||
|
||||
if (bind->source == NULL)
|
||||
return;
|
||||
|
||||
/* only these bindings affect the preferred size */
|
||||
if (!(bind->coordinate == CLUTTER_BIND_WIDTH ||
|
||||
bind->coordinate == CLUTTER_BIND_HEIGHT ||
|
||||
bind->coordinate == CLUTTER_BIND_SIZE ||
|
||||
bind->coordinate == CLUTTER_BIND_ALL))
|
||||
return;
|
||||
|
||||
switch (direction)
|
||||
{
|
||||
case CLUTTER_ORIENTATION_HORIZONTAL:
|
||||
if (bind->coordinate != CLUTTER_BIND_HEIGHT)
|
||||
{
|
||||
clutter_actor_get_preferred_width (bind->source, for_size,
|
||||
&source_min,
|
||||
&source_nat);
|
||||
|
||||
*minimum_size = source_min;
|
||||
*natural_size = source_nat;
|
||||
}
|
||||
break;
|
||||
|
||||
case CLUTTER_ORIENTATION_VERTICAL:
|
||||
if (bind->coordinate != CLUTTER_BIND_WIDTH)
|
||||
{
|
||||
clutter_actor_get_preferred_height (bind->source, for_size,
|
||||
&source_min,
|
||||
&source_nat);
|
||||
|
||||
*minimum_size = source_min;
|
||||
*natural_size = source_nat;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_bind_constraint_update_allocation (ClutterConstraint *constraint,
|
||||
ClutterActor *actor,
|
||||
@ -152,7 +201,9 @@ clutter_bind_constraint_update_allocation (ClutterConstraint *constraint,
|
||||
ClutterBindConstraint *bind = CLUTTER_BIND_CONSTRAINT (constraint);
|
||||
gfloat source_width, source_height;
|
||||
gfloat actor_width, actor_height;
|
||||
ClutterVertex source_position = { 0., };
|
||||
graphene_point3d_t source_position;
|
||||
|
||||
source_position = GRAPHENE_POINT3D_INIT (0.f, 0.f, 0.f);
|
||||
|
||||
if (bind->source == NULL)
|
||||
return;
|
||||
@ -326,6 +377,8 @@ clutter_bind_constraint_class_init (ClutterBindConstraintClass *klass)
|
||||
meta_class->set_actor = clutter_bind_constraint_set_actor;
|
||||
|
||||
constraint_class->update_allocation = clutter_bind_constraint_update_allocation;
|
||||
constraint_class->update_preferred_size = clutter_bind_constraint_update_preferred_size;
|
||||
|
||||
/**
|
||||
* ClutterBindConstraint:source:
|
||||
*
|
||||
|
@ -99,7 +99,8 @@ G_DEFINE_TYPE (ClutterBlurEffect,
|
||||
CLUTTER_TYPE_OFFSCREEN_EFFECT);
|
||||
|
||||
static gboolean
|
||||
clutter_blur_effect_pre_paint (ClutterEffect *effect)
|
||||
clutter_blur_effect_pre_paint (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
ClutterBlurEffect *self = CLUTTER_BLUR_EFFECT (effect);
|
||||
ClutterEffectClass *parent_class;
|
||||
@ -124,7 +125,7 @@ clutter_blur_effect_pre_paint (ClutterEffect *effect)
|
||||
}
|
||||
|
||||
parent_class = CLUTTER_EFFECT_CLASS (clutter_blur_effect_parent_class);
|
||||
if (parent_class->pre_paint (effect))
|
||||
if (parent_class->pre_paint (effect, paint_context))
|
||||
{
|
||||
ClutterOffscreenEffect *offscreen_effect =
|
||||
CLUTTER_OFFSCREEN_EFFECT (effect);
|
||||
@ -157,10 +158,12 @@ clutter_blur_effect_pre_paint (ClutterEffect *effect)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_blur_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
clutter_blur_effect_paint_target (ClutterOffscreenEffect *effect,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
ClutterBlurEffect *self = CLUTTER_BLUR_EFFECT (effect);
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
CoglFramebuffer *framebuffer =
|
||||
clutter_paint_context_get_framebuffer (paint_context);
|
||||
guint8 paint_opacity;
|
||||
|
||||
paint_opacity = clutter_actor_get_paint_opacity (self->actor);
|
||||
@ -178,11 +181,11 @@ clutter_blur_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_blur_effect_get_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
clutter_blur_effect_modify_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
gfloat cur_width, cur_height;
|
||||
ClutterVertex origin;
|
||||
graphene_point3d_t origin;
|
||||
|
||||
clutter_paint_volume_get_origin (volume, &origin);
|
||||
cur_width = clutter_paint_volume_get_width (volume);
|
||||
@ -223,7 +226,7 @@ clutter_blur_effect_class_init (ClutterBlurEffectClass *klass)
|
||||
gobject_class->dispose = clutter_blur_effect_dispose;
|
||||
|
||||
effect_class->pre_paint = clutter_blur_effect_pre_paint;
|
||||
effect_class->get_paint_volume = clutter_blur_effect_get_paint_volume;
|
||||
effect_class->modify_paint_volume = clutter_blur_effect_modify_paint_volume;
|
||||
|
||||
offscreen_class = CLUTTER_OFFSCREEN_EFFECT_CLASS (klass);
|
||||
offscreen_class->paint_target = clutter_blur_effect_paint_target;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -105,64 +105,6 @@ void clutter_box_layout_set_pack_start (ClutterBoxLayou
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_box_layout_get_pack_start (ClutterBoxLayout *layout);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_box_layout_set_orientation)
|
||||
void clutter_box_layout_set_vertical (ClutterBoxLayout *layout,
|
||||
gboolean vertical);
|
||||
CLUTTER_DEPRECATED_FOR(clutter_box_layout_get_orientation)
|
||||
gboolean clutter_box_layout_get_vertical (ClutterBoxLayout *layout);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_box_layout_pack (ClutterBoxLayout *layout,
|
||||
ClutterActor *actor,
|
||||
gboolean expand,
|
||||
gboolean x_fill,
|
||||
gboolean y_fill,
|
||||
ClutterBoxAlignment x_align,
|
||||
ClutterBoxAlignment y_align);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_box_layout_set_alignment (ClutterBoxLayout *layout,
|
||||
ClutterActor *actor,
|
||||
ClutterBoxAlignment x_align,
|
||||
ClutterBoxAlignment y_align);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_box_layout_get_alignment (ClutterBoxLayout *layout,
|
||||
ClutterActor *actor,
|
||||
ClutterBoxAlignment *x_align,
|
||||
ClutterBoxAlignment *y_align);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_box_layout_set_fill (ClutterBoxLayout *layout,
|
||||
ClutterActor *actor,
|
||||
gboolean x_fill,
|
||||
gboolean y_fill);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_box_layout_get_fill (ClutterBoxLayout *layout,
|
||||
ClutterActor *actor,
|
||||
gboolean *x_fill,
|
||||
gboolean *y_fill);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_box_layout_set_expand (ClutterBoxLayout *layout,
|
||||
ClutterActor *actor,
|
||||
gboolean expand);
|
||||
CLUTTER_DEPRECATED
|
||||
gboolean clutter_box_layout_get_expand (ClutterBoxLayout *layout,
|
||||
ClutterActor *actor);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_box_layout_set_use_animations (ClutterBoxLayout *layout,
|
||||
gboolean animate);
|
||||
CLUTTER_DEPRECATED
|
||||
gboolean clutter_box_layout_get_use_animations (ClutterBoxLayout *layout);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_box_layout_set_easing_mode (ClutterBoxLayout *layout,
|
||||
gulong mode);
|
||||
CLUTTER_DEPRECATED
|
||||
gulong clutter_box_layout_get_easing_mode (ClutterBoxLayout *layout);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_box_layout_set_easing_duration (ClutterBoxLayout *layout,
|
||||
guint msecs);
|
||||
CLUTTER_DEPRECATED
|
||||
guint clutter_box_layout_get_easing_duration (ClutterBoxLayout *layout);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_BOX_LAYOUT_H__ */
|
||||
|
@ -121,16 +121,17 @@ G_DEFINE_TYPE (ClutterBrightnessContrastEffect,
|
||||
static gboolean
|
||||
will_have_no_effect (ClutterBrightnessContrastEffect *self)
|
||||
{
|
||||
return (self->brightness_red == no_change &&
|
||||
self->brightness_green == no_change &&
|
||||
self->brightness_blue == no_change &&
|
||||
self->contrast_red == no_change &&
|
||||
self->contrast_green == no_change &&
|
||||
self->contrast_blue == no_change);
|
||||
return (G_APPROX_VALUE (self->brightness_red, no_change, FLT_EPSILON) &&
|
||||
G_APPROX_VALUE (self->brightness_green, no_change, FLT_EPSILON) &&
|
||||
G_APPROX_VALUE (self->brightness_blue, no_change, FLT_EPSILON) &&
|
||||
G_APPROX_VALUE (self->contrast_red, no_change, FLT_EPSILON) &&
|
||||
G_APPROX_VALUE (self->contrast_green, no_change, FLT_EPSILON) &&
|
||||
G_APPROX_VALUE (self->contrast_blue, no_change, FLT_EPSILON));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_brightness_contrast_effect_pre_paint (ClutterEffect *effect)
|
||||
clutter_brightness_contrast_effect_pre_paint (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
ClutterBrightnessContrastEffect *self = CLUTTER_BRIGHTNESS_CONTRAST_EFFECT (effect);
|
||||
ClutterEffectClass *parent_class;
|
||||
@ -156,7 +157,7 @@ clutter_brightness_contrast_effect_pre_paint (ClutterEffect *effect)
|
||||
|
||||
parent_class =
|
||||
CLUTTER_EFFECT_CLASS (clutter_brightness_contrast_effect_parent_class);
|
||||
if (parent_class->pre_paint (effect))
|
||||
if (parent_class->pre_paint (effect, paint_context))
|
||||
{
|
||||
ClutterOffscreenEffect *offscreen_effect =
|
||||
CLUTTER_OFFSCREEN_EFFECT (effect);
|
||||
@ -175,10 +176,12 @@ clutter_brightness_contrast_effect_pre_paint (ClutterEffect *effect)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_brightness_contrast_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
clutter_brightness_contrast_effect_paint_target (ClutterOffscreenEffect *effect,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
ClutterBrightnessContrastEffect *self = CLUTTER_BRIGHTNESS_CONTRAST_EFFECT (effect);
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
CoglFramebuffer *framebuffer =
|
||||
clutter_paint_context_get_framebuffer (paint_context);
|
||||
ClutterActor *actor;
|
||||
guint8 paint_opacity;
|
||||
|
||||
@ -494,9 +497,9 @@ clutter_brightness_contrast_effect_set_brightness_full (ClutterBrightnessContras
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_BRIGHTNESS_CONTRAST_EFFECT (effect));
|
||||
|
||||
if (red == effect->brightness_red &&
|
||||
green == effect->brightness_green &&
|
||||
blue == effect->brightness_blue)
|
||||
if (G_APPROX_VALUE (red, effect->brightness_red, FLT_EPSILON) &&
|
||||
G_APPROX_VALUE (green, effect->brightness_green, FLT_EPSILON) &&
|
||||
G_APPROX_VALUE (blue, effect->brightness_blue, FLT_EPSILON))
|
||||
return;
|
||||
|
||||
effect->brightness_red = red;
|
||||
@ -584,9 +587,9 @@ clutter_brightness_contrast_effect_set_contrast_full (ClutterBrightnessContrastE
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_BRIGHTNESS_CONTRAST_EFFECT (effect));
|
||||
|
||||
if (red == effect->contrast_red &&
|
||||
green == effect->contrast_green &&
|
||||
blue == effect->contrast_blue)
|
||||
if (G_APPROX_VALUE (red, effect->contrast_red, FLT_EPSILON) &&
|
||||
G_APPROX_VALUE (green, effect->contrast_green, FLT_EPSILON) &&
|
||||
G_APPROX_VALUE (blue, effect->contrast_blue, FLT_EPSILON))
|
||||
return;
|
||||
|
||||
effect->contrast_red = red;
|
||||
|
@ -328,9 +328,10 @@ clutter_canvas_init (ClutterCanvas *self)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_canvas_paint_content (ClutterContent *content,
|
||||
ClutterActor *actor,
|
||||
ClutterPaintNode *root)
|
||||
clutter_canvas_paint_content (ClutterContent *content,
|
||||
ClutterActor *actor,
|
||||
ClutterPaintNode *root,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
ClutterCanvas *self = CLUTTER_CANVAS (content);
|
||||
ClutterCanvasPrivate *priv = self->priv;
|
||||
@ -351,7 +352,7 @@ clutter_canvas_paint_content (ClutterContent *content,
|
||||
return;
|
||||
|
||||
node = clutter_actor_create_texture_paint_node (actor, priv->texture);
|
||||
clutter_paint_node_set_name (node, "Canvas Content");
|
||||
clutter_paint_node_set_static_name (node, "Canvas Content");
|
||||
clutter_paint_node_add_child (root, node);
|
||||
clutter_paint_node_unref (node);
|
||||
|
||||
|
@ -105,8 +105,8 @@ struct _ClutterClickActionPrivate
|
||||
{
|
||||
ClutterActor *stage;
|
||||
|
||||
guint event_id;
|
||||
guint capture_id;
|
||||
gulong event_id;
|
||||
gulong capture_id;
|
||||
guint long_press_id;
|
||||
|
||||
gint long_press_threshold;
|
||||
@ -159,7 +159,8 @@ static inline void
|
||||
click_action_set_pressed (ClutterClickAction *action,
|
||||
gboolean is_pressed)
|
||||
{
|
||||
ClutterClickActionPrivate *priv = action->priv;
|
||||
ClutterClickActionPrivate *priv =
|
||||
clutter_click_action_get_instance_private (action);
|
||||
|
||||
is_pressed = !!is_pressed;
|
||||
|
||||
@ -174,7 +175,8 @@ static inline void
|
||||
click_action_set_held (ClutterClickAction *action,
|
||||
gboolean is_held)
|
||||
{
|
||||
ClutterClickActionPrivate *priv = action->priv;
|
||||
ClutterClickActionPrivate *priv =
|
||||
clutter_click_action_get_instance_private (action);
|
||||
|
||||
is_held = !!is_held;
|
||||
|
||||
@ -189,7 +191,8 @@ static gboolean
|
||||
click_action_emit_long_press (gpointer data)
|
||||
{
|
||||
ClutterClickAction *action = data;
|
||||
ClutterClickActionPrivate *priv = action->priv;
|
||||
ClutterClickActionPrivate *priv =
|
||||
clutter_click_action_get_instance_private (action);
|
||||
ClutterActor *actor;
|
||||
gboolean result;
|
||||
|
||||
@ -202,11 +205,7 @@ click_action_emit_long_press (gpointer data)
|
||||
CLUTTER_LONG_PRESS_ACTIVATE,
|
||||
&result);
|
||||
|
||||
if (priv->capture_id != 0)
|
||||
{
|
||||
g_signal_handler_disconnect (priv->stage, priv->capture_id);
|
||||
priv->capture_id = 0;
|
||||
}
|
||||
g_clear_signal_handler (&priv->capture_id, priv->stage);
|
||||
|
||||
click_action_set_pressed (action, FALSE);
|
||||
click_action_set_held (action, FALSE);
|
||||
@ -217,7 +216,8 @@ click_action_emit_long_press (gpointer data)
|
||||
static inline void
|
||||
click_action_query_long_press (ClutterClickAction *action)
|
||||
{
|
||||
ClutterClickActionPrivate *priv = action->priv;
|
||||
ClutterClickActionPrivate *priv =
|
||||
clutter_click_action_get_instance_private (action);
|
||||
ClutterActor *actor;
|
||||
gboolean result = FALSE;
|
||||
gint timeout;
|
||||
@ -242,6 +242,7 @@ click_action_query_long_press (ClutterClickAction *action)
|
||||
|
||||
if (result)
|
||||
{
|
||||
g_clear_handle_id (&priv->long_press_id, g_source_remove);
|
||||
priv->long_press_id =
|
||||
clutter_threads_add_timeout (timeout,
|
||||
click_action_emit_long_press,
|
||||
@ -252,7 +253,8 @@ click_action_query_long_press (ClutterClickAction *action)
|
||||
static inline void
|
||||
click_action_cancel_long_press (ClutterClickAction *action)
|
||||
{
|
||||
ClutterClickActionPrivate *priv = action->priv;
|
||||
ClutterClickActionPrivate *priv =
|
||||
clutter_click_action_get_instance_private (action);
|
||||
|
||||
if (priv->long_press_id != 0)
|
||||
{
|
||||
@ -261,8 +263,7 @@ click_action_cancel_long_press (ClutterClickAction *action)
|
||||
|
||||
actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action));
|
||||
|
||||
g_source_remove (priv->long_press_id);
|
||||
priv->long_press_id = 0;
|
||||
g_clear_handle_id (&priv->long_press_id, g_source_remove);
|
||||
|
||||
g_signal_emit (action, click_signals[LONG_PRESS], 0,
|
||||
actor,
|
||||
@ -276,7 +277,8 @@ on_event (ClutterActor *actor,
|
||||
ClutterEvent *event,
|
||||
ClutterClickAction *action)
|
||||
{
|
||||
ClutterClickActionPrivate *priv = action->priv;
|
||||
ClutterClickActionPrivate *priv =
|
||||
clutter_click_action_get_instance_private (action);
|
||||
gboolean has_button = TRUE;
|
||||
|
||||
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (action)))
|
||||
@ -346,7 +348,8 @@ on_captured_event (ClutterActor *stage,
|
||||
ClutterEvent *event,
|
||||
ClutterClickAction *action)
|
||||
{
|
||||
ClutterClickActionPrivate *priv = action->priv;
|
||||
ClutterClickActionPrivate *priv =
|
||||
clutter_click_action_get_instance_private (action);
|
||||
ClutterActor *actor;
|
||||
ClutterModifierType modifier_state;
|
||||
gboolean has_button = TRUE;
|
||||
@ -375,17 +378,9 @@ on_captured_event (ClutterActor *stage,
|
||||
click_action_cancel_long_press (action);
|
||||
|
||||
/* disconnect the capture */
|
||||
if (priv->capture_id != 0)
|
||||
{
|
||||
g_signal_handler_disconnect (priv->stage, priv->capture_id);
|
||||
priv->capture_id = 0;
|
||||
}
|
||||
g_clear_signal_handler (&priv->capture_id, priv->stage);
|
||||
|
||||
if (priv->long_press_id != 0)
|
||||
{
|
||||
g_source_remove (priv->long_press_id);
|
||||
priv->long_press_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&priv->long_press_id, g_source_remove);
|
||||
|
||||
if (!clutter_actor_contains (actor, clutter_event_get_source (event)))
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
@ -446,14 +441,15 @@ clutter_click_action_set_actor (ClutterActorMeta *meta,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
ClutterClickAction *action = CLUTTER_CLICK_ACTION (meta);
|
||||
ClutterClickActionPrivate *priv = action->priv;
|
||||
ClutterClickActionPrivate *priv =
|
||||
clutter_click_action_get_instance_private (action);
|
||||
|
||||
if (priv->event_id != 0)
|
||||
{
|
||||
ClutterActor *old_actor = clutter_actor_meta_get_actor (meta);
|
||||
|
||||
if (old_actor != NULL)
|
||||
g_signal_handler_disconnect (old_actor, priv->event_id);
|
||||
g_clear_signal_handler (&priv->event_id, old_actor);
|
||||
|
||||
priv->event_id = 0;
|
||||
}
|
||||
@ -461,17 +457,13 @@ clutter_click_action_set_actor (ClutterActorMeta *meta,
|
||||
if (priv->capture_id != 0)
|
||||
{
|
||||
if (priv->stage != NULL)
|
||||
g_signal_handler_disconnect (priv->stage, priv->capture_id);
|
||||
g_clear_signal_handler (&priv->capture_id, priv->stage);
|
||||
|
||||
priv->capture_id = 0;
|
||||
priv->stage = NULL;
|
||||
}
|
||||
|
||||
if (priv->long_press_id != 0)
|
||||
{
|
||||
g_source_remove (priv->long_press_id);
|
||||
priv->long_press_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&priv->long_press_id, g_source_remove);
|
||||
|
||||
click_action_set_pressed (action, FALSE);
|
||||
click_action_set_held (action, FALSE);
|
||||
@ -484,13 +476,28 @@ clutter_click_action_set_actor (ClutterActorMeta *meta,
|
||||
CLUTTER_ACTOR_META_CLASS (clutter_click_action_parent_class)->set_actor (meta, actor);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_click_action_set_enabled (ClutterActorMeta *meta,
|
||||
gboolean is_enabled)
|
||||
{
|
||||
ClutterClickAction *click_action = CLUTTER_CLICK_ACTION (meta);
|
||||
ClutterActorMetaClass *parent_class =
|
||||
CLUTTER_ACTOR_META_CLASS (clutter_click_action_parent_class);
|
||||
|
||||
if (!is_enabled)
|
||||
clutter_click_action_release (click_action);
|
||||
|
||||
parent_class->set_enabled (meta, is_enabled);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_click_action_set_property (GObject *gobject,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterClickActionPrivate *priv = CLUTTER_CLICK_ACTION (gobject)->priv;
|
||||
ClutterClickActionPrivate *priv =
|
||||
clutter_click_action_get_instance_private (CLUTTER_CLICK_ACTION (gobject));
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
@ -514,7 +521,8 @@ clutter_click_action_get_property (GObject *gobject,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterClickActionPrivate *priv = CLUTTER_CLICK_ACTION (gobject)->priv;
|
||||
ClutterClickActionPrivate *priv =
|
||||
clutter_click_action_get_instance_private (CLUTTER_CLICK_ACTION (gobject));
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
@ -543,26 +551,15 @@ clutter_click_action_get_property (GObject *gobject,
|
||||
static void
|
||||
clutter_click_action_dispose (GObject *gobject)
|
||||
{
|
||||
ClutterClickActionPrivate *priv = CLUTTER_CLICK_ACTION (gobject)->priv;
|
||||
ClutterClickActionPrivate *priv =
|
||||
clutter_click_action_get_instance_private (CLUTTER_CLICK_ACTION (gobject));
|
||||
|
||||
if (priv->event_id)
|
||||
{
|
||||
g_signal_handler_disconnect (clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (gobject)),
|
||||
priv->event_id);
|
||||
priv->event_id = 0;
|
||||
}
|
||||
g_clear_signal_handler (&priv->event_id,
|
||||
clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (gobject)));
|
||||
|
||||
if (priv->capture_id)
|
||||
{
|
||||
g_signal_handler_disconnect (priv->stage, priv->capture_id);
|
||||
priv->capture_id = 0;
|
||||
}
|
||||
g_clear_signal_handler (&priv->capture_id, priv->stage);
|
||||
|
||||
if (priv->long_press_id)
|
||||
{
|
||||
g_source_remove (priv->long_press_id);
|
||||
priv->long_press_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&priv->long_press_id, g_source_remove);
|
||||
|
||||
G_OBJECT_CLASS (clutter_click_action_parent_class)->dispose (gobject);
|
||||
}
|
||||
@ -575,6 +572,7 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
|
||||
ClutterActorMetaClass *meta_class = CLUTTER_ACTOR_META_CLASS (klass);
|
||||
|
||||
meta_class->set_actor = clutter_click_action_set_actor;
|
||||
meta_class->set_enabled = clutter_click_action_set_enabled;
|
||||
|
||||
gobject_class->dispose = clutter_click_action_dispose;
|
||||
gobject_class->set_property = clutter_click_action_set_property;
|
||||
@ -666,8 +664,7 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterClickActionClass, clicked),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@ -713,9 +710,11 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
|
||||
static void
|
||||
clutter_click_action_init (ClutterClickAction *self)
|
||||
{
|
||||
self->priv = clutter_click_action_get_instance_private (self);
|
||||
self->priv->long_press_threshold = -1;
|
||||
self->priv->long_press_duration = -1;
|
||||
ClutterClickActionPrivate *priv =
|
||||
clutter_click_action_get_instance_private (self);
|
||||
|
||||
priv->long_press_threshold = -1;
|
||||
priv->long_press_duration = -1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -755,17 +754,13 @@ clutter_click_action_release (ClutterClickAction *action)
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_CLICK_ACTION (action));
|
||||
|
||||
priv = action->priv;
|
||||
priv = clutter_click_action_get_instance_private (action);
|
||||
|
||||
if (!priv->is_held)
|
||||
return;
|
||||
|
||||
/* disconnect the capture */
|
||||
if (priv->capture_id != 0)
|
||||
{
|
||||
g_signal_handler_disconnect (priv->stage, priv->capture_id);
|
||||
priv->capture_id = 0;
|
||||
}
|
||||
g_clear_signal_handler (&priv->capture_id, priv->stage);
|
||||
|
||||
click_action_cancel_long_press (action);
|
||||
click_action_set_held (action, FALSE);
|
||||
@ -785,9 +780,13 @@ clutter_click_action_release (ClutterClickAction *action)
|
||||
guint
|
||||
clutter_click_action_get_button (ClutterClickAction *action)
|
||||
{
|
||||
ClutterClickActionPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_CLICK_ACTION (action), 0);
|
||||
|
||||
return action->priv->press_button;
|
||||
priv = clutter_click_action_get_instance_private (action);
|
||||
|
||||
return priv->press_button;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -803,9 +802,13 @@ clutter_click_action_get_button (ClutterClickAction *action)
|
||||
ClutterModifierType
|
||||
clutter_click_action_get_state (ClutterClickAction *action)
|
||||
{
|
||||
ClutterClickActionPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_CLICK_ACTION (action), 0);
|
||||
|
||||
return action->priv->modifier_state;
|
||||
priv = clutter_click_action_get_instance_private (action);
|
||||
|
||||
return priv->modifier_state;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -823,11 +826,15 @@ clutter_click_action_get_coords (ClutterClickAction *action,
|
||||
gfloat *press_x,
|
||||
gfloat *press_y)
|
||||
{
|
||||
ClutterClickActionPrivate *priv;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTION (action));
|
||||
|
||||
priv = clutter_click_action_get_instance_private (action);
|
||||
|
||||
if (press_x != NULL)
|
||||
*press_x = action->priv->press_x;
|
||||
*press_x = priv->press_x;
|
||||
|
||||
if (press_y != NULL)
|
||||
*press_y = action->priv->press_y;
|
||||
*press_y = priv->press_y;
|
||||
}
|
||||
|
@ -37,32 +37,13 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_CLICK_ACTION (clutter_click_action_get_type ())
|
||||
#define CLUTTER_CLICK_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_CLICK_ACTION, ClutterClickAction))
|
||||
#define CLUTTER_IS_CLICK_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_CLICK_ACTION))
|
||||
#define CLUTTER_CLICK_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_CLICK_ACTION, ClutterClickActionClass))
|
||||
#define CLUTTER_IS_CLICK_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_CLICK_ACTION))
|
||||
#define CLUTTER_CLICK_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_CLICK_ACTION, ClutterClickActionClass))
|
||||
#define CLUTTER_TYPE_CLICK_ACTION (clutter_click_action_get_type ())
|
||||
|
||||
typedef struct _ClutterClickAction ClutterClickAction;
|
||||
typedef struct _ClutterClickActionPrivate ClutterClickActionPrivate;
|
||||
typedef struct _ClutterClickActionClass ClutterClickActionClass;
|
||||
CLUTTER_EXPORT
|
||||
G_DECLARE_DERIVABLE_TYPE (ClutterClickAction, clutter_click_action,
|
||||
CLUTTER, CLICK_ACTION, ClutterAction);
|
||||
|
||||
/**
|
||||
* ClutterClickAction:
|
||||
*
|
||||
* The #ClutterClickAction structure contains
|
||||
* only private data and should be accessed using the provided API
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
struct _ClutterClickAction
|
||||
{
|
||||
/*< private >*/
|
||||
ClutterAction parent_instance;
|
||||
|
||||
ClutterClickActionPrivate *priv;
|
||||
};
|
||||
typedef struct _ClutterClickActionPrivate ClutterClickActionPrivate;
|
||||
|
||||
/**
|
||||
* ClutterClickActionClass:
|
||||
@ -97,9 +78,6 @@ struct _ClutterClickActionClass
|
||||
void (* _clutter_click_action7) (void);
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_click_action_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterAction * clutter_click_action_new (void);
|
||||
|
||||
|
@ -152,7 +152,8 @@ clutter_clone_apply_transform (ClutterActor *self, CoglMatrix *matrix)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_clone_paint (ClutterActor *actor)
|
||||
clutter_clone_paint (ClutterActor *actor,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
ClutterClone *self = CLUTTER_CLONE (actor);
|
||||
ClutterClonePrivate *priv = self->priv;
|
||||
@ -189,7 +190,7 @@ clutter_clone_paint (ClutterActor *actor)
|
||||
if (clutter_actor_is_realized (priv->clone_source))
|
||||
{
|
||||
_clutter_actor_push_clone_paint ();
|
||||
clutter_actor_paint (priv->clone_source);
|
||||
clutter_actor_paint (priv->clone_source, paint_context);
|
||||
_clutter_actor_pop_clone_paint ();
|
||||
}
|
||||
|
||||
@ -239,19 +240,25 @@ clutter_clone_has_overlaps (ClutterActor *actor)
|
||||
|
||||
static void
|
||||
clutter_clone_allocate (ClutterActor *self,
|
||||
const ClutterActorBox *box,
|
||||
ClutterAllocationFlags flags)
|
||||
const ClutterActorBox *box)
|
||||
{
|
||||
ClutterClonePrivate *priv = CLUTTER_CLONE (self)->priv;
|
||||
ClutterActorClass *parent_class;
|
||||
|
||||
/* chain up */
|
||||
parent_class = CLUTTER_ACTOR_CLASS (clutter_clone_parent_class);
|
||||
parent_class->allocate (self, box, flags);
|
||||
parent_class->allocate (self, box);
|
||||
|
||||
if (priv->clone_source == NULL)
|
||||
return;
|
||||
|
||||
/* ClutterActor delays allocating until the actor is shown; however
|
||||
* we cannot paint it correctly in that case, so force an allocation.
|
||||
*/
|
||||
if (clutter_actor_get_parent (priv->clone_source) != NULL &&
|
||||
!clutter_actor_has_allocation (priv->clone_source))
|
||||
clutter_actor_allocate_preferred_size (priv->clone_source);
|
||||
|
||||
#if 0
|
||||
/* XXX - this is wrong: ClutterClone cannot clone unparented
|
||||
* actors, as it will break all invariants
|
||||
@ -265,7 +272,7 @@ clutter_clone_allocate (ClutterActor *self,
|
||||
* paint cycle, we can safely give it as much size as it requires
|
||||
*/
|
||||
if (clutter_actor_get_parent (priv->clone_source) == NULL)
|
||||
clutter_actor_allocate_preferred_size (priv->clone_source, flags);
|
||||
clutter_actor_allocate_preferred_size (priv->clone_source);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -393,8 +400,7 @@ clutter_clone_set_source_internal (ClutterClone *self,
|
||||
|
||||
if (priv->clone_source != NULL)
|
||||
{
|
||||
g_signal_handler_disconnect (priv->clone_source, priv->source_destroy_id);
|
||||
priv->source_destroy_id = 0;
|
||||
g_clear_signal_handler (&priv->source_destroy_id, priv->clone_source);
|
||||
_clutter_actor_detach_clone (priv->clone_source, CLUTTER_ACTOR (self));
|
||||
g_object_unref (priv->clone_source);
|
||||
priv->clone_source = NULL;
|
||||
|
@ -105,7 +105,8 @@ G_DEFINE_TYPE (ClutterColorizeEffect,
|
||||
CLUTTER_TYPE_OFFSCREEN_EFFECT);
|
||||
|
||||
static gboolean
|
||||
clutter_colorize_effect_pre_paint (ClutterEffect *effect)
|
||||
clutter_colorize_effect_pre_paint (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
ClutterColorizeEffect *self = CLUTTER_COLORIZE_EFFECT (effect);
|
||||
ClutterEffectClass *parent_class;
|
||||
@ -126,7 +127,7 @@ clutter_colorize_effect_pre_paint (ClutterEffect *effect)
|
||||
}
|
||||
|
||||
parent_class = CLUTTER_EFFECT_CLASS (clutter_colorize_effect_parent_class);
|
||||
if (parent_class->pre_paint (effect))
|
||||
if (parent_class->pre_paint (effect, paint_context))
|
||||
{
|
||||
ClutterOffscreenEffect *offscreen_effect =
|
||||
CLUTTER_OFFSCREEN_EFFECT (effect);
|
||||
@ -145,10 +146,12 @@ clutter_colorize_effect_pre_paint (ClutterEffect *effect)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_colorize_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
clutter_colorize_effect_paint_target (ClutterOffscreenEffect *effect,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
ClutterColorizeEffect *self = CLUTTER_COLORIZE_EFFECT (effect);
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
CoglFramebuffer *framebuffer =
|
||||
clutter_paint_context_get_framebuffer (paint_context);
|
||||
ClutterActor *actor;
|
||||
guint8 paint_opacity;
|
||||
|
||||
|
@ -9,7 +9,13 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@CLUTTER_CONFIG_DEFINES@
|
||||
#mesondefine CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT
|
||||
#mesondefine CLUTTER_WINDOWING_X11
|
||||
#mesondefine CLUTTER_INPUT_X11
|
||||
#mesondefine CLUTTER_WINDOWING_GLX
|
||||
#mesondefine CLUTTER_WINDOWING_EGL
|
||||
#mesondefine CLUTTER_INPUT_EVDEV
|
||||
#mesondefine CLUTTER_INPUT_NULL
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -30,13 +30,6 @@ gboolean clutter_constraint_update_allocation (ClutterConstraint *constraint,
|
||||
ClutterActor *actor,
|
||||
ClutterActorBox *allocation);
|
||||
|
||||
void clutter_constraint_update_preferred_size (ClutterConstraint *constraint,
|
||||
ClutterActor *actor,
|
||||
ClutterOrientation direction,
|
||||
float for_size,
|
||||
float *minimum_size,
|
||||
float *natural_size);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_CONSTRAINT_PRIVATE_H__ */
|
||||
|
@ -48,7 +48,7 @@
|
||||
* Constraints provide a way to build user interfaces by using
|
||||
* relations between #ClutterActors, without explicit fixed
|
||||
* positioning and sizing, similarly to how fluid layout managers like
|
||||
* #ClutterBoxLayout and #ClutterTableLayout lay out their children.
|
||||
* #ClutterBoxLayout lay out their children.
|
||||
*
|
||||
* Constraints are attached to a #ClutterActor, and are available
|
||||
* for inspection using clutter_actor_get_constraints().
|
||||
@ -160,28 +160,26 @@ constraint_update_preferred_size (ClutterConstraint *constraint,
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_constraint_notify (GObject *gobject,
|
||||
GParamSpec *pspec)
|
||||
clutter_constraint_set_enabled (ClutterActorMeta *meta,
|
||||
gboolean is_enabled)
|
||||
{
|
||||
if (strcmp (pspec->name, "enabled") == 0)
|
||||
{
|
||||
ClutterActorMeta *meta = CLUTTER_ACTOR_META (gobject);
|
||||
ClutterActor *actor = clutter_actor_meta_get_actor (meta);
|
||||
ClutterActorMetaClass *parent_class =
|
||||
CLUTTER_ACTOR_META_CLASS (clutter_constraint_parent_class);
|
||||
ClutterActor *actor;
|
||||
|
||||
if (actor != NULL)
|
||||
clutter_actor_queue_relayout (actor);
|
||||
}
|
||||
actor = clutter_actor_meta_get_actor (meta);
|
||||
if (actor)
|
||||
clutter_actor_queue_relayout (actor);
|
||||
|
||||
if (G_OBJECT_CLASS (clutter_constraint_parent_class)->notify != NULL)
|
||||
G_OBJECT_CLASS (clutter_constraint_parent_class)->notify (gobject, pspec);
|
||||
parent_class->set_enabled (meta, is_enabled);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_constraint_class_init (ClutterConstraintClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
ClutterActorMetaClass *actor_meta_class = CLUTTER_ACTOR_META_CLASS (klass);
|
||||
|
||||
gobject_class->notify = clutter_constraint_notify;
|
||||
actor_meta_class->set_enabled = clutter_constraint_set_enabled;
|
||||
|
||||
klass->update_allocation = constraint_update_allocation;
|
||||
klass->update_preferred_size = constraint_update_preferred_size;
|
||||
@ -222,6 +220,17 @@ clutter_constraint_update_allocation (ClutterConstraint *constraint,
|
||||
return !clutter_actor_box_equal (allocation, &old_alloc);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_constraint_update_preferred_size:
|
||||
* @constraint: a #ClutterConstraint
|
||||
* @actor: a #ClutterActor
|
||||
* @direction: a #ClutterOrientation
|
||||
* @for_size: the size in the opposite direction
|
||||
* @minimum_size: (inout): the minimum size to modify
|
||||
* @natural_size: (inout): the natural size to modify
|
||||
*
|
||||
* Asks the @constraint to update the size request of a #ClutterActor.
|
||||
*/
|
||||
void
|
||||
clutter_constraint_update_preferred_size (ClutterConstraint *constraint,
|
||||
ClutterActor *actor,
|
||||
|
@ -99,6 +99,14 @@ struct _ClutterConstraintClass
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_constraint_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_constraint_update_preferred_size (ClutterConstraint *constraint,
|
||||
ClutterActor *actor,
|
||||
ClutterOrientation direction,
|
||||
float for_size,
|
||||
float *minimum_size,
|
||||
float *natural_size);
|
||||
|
||||
/* ClutterActor API */
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_add_constraint (ClutterActor *self,
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright 2020 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -17,26 +17,20 @@
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Emmanuele Bassi <ebassi@linux.intel.com>
|
||||
*/
|
||||
|
||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <clutter/clutter.h> can be included directly."
|
||||
#endif
|
||||
#ifndef __CLUTTER_CONTAINER_PRIVATE_H__
|
||||
#define __CLUTTER_CONTAINER_PRIVATE_H__
|
||||
|
||||
#ifndef __CLUTTER_STAGE_MANAGER_DEPRECATED_H__
|
||||
#define __CLUTTER_STAGE_MANAGER_DEPRECATED_H__
|
||||
|
||||
#include <clutter/clutter-stage-manager.h>
|
||||
#include <clutter/clutter-container.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_stage_manager_set_default_stage (ClutterStageManager *stage_manager,
|
||||
ClutterStage *stage);
|
||||
void _clutter_container_emit_actor_added (ClutterContainer *container,
|
||||
ClutterActor *actor);
|
||||
void _clutter_container_emit_actor_removed (ClutterContainer *container,
|
||||
ClutterActor *actor);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /*__CLUTTER_STAGE_MANAGER_DEPRECATED_H__ */
|
||||
|
||||
#endif /* __CLUTTER_CONTAINER_PRIVATE_H__ */
|
@ -37,6 +37,7 @@
|
||||
|
||||
#include "clutter-actor-private.h"
|
||||
#include "clutter-child-meta.h"
|
||||
#include "clutter-container-private.h"
|
||||
#include "clutter-debug.h"
|
||||
#include "clutter-main.h"
|
||||
#include "clutter-marshal.h"
|
||||
@ -118,37 +119,6 @@ container_real_remove (ClutterContainer *container,
|
||||
clutter_actor_remove_child (CLUTTER_ACTOR (container), actor);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
ClutterCallback callback;
|
||||
gpointer data;
|
||||
} ForeachClosure;
|
||||
|
||||
static gboolean
|
||||
foreach_cb (ClutterActor *actor,
|
||||
gpointer data)
|
||||
{
|
||||
ForeachClosure *clos = data;
|
||||
|
||||
clos->callback (actor, clos->data);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
container_real_foreach (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
ForeachClosure clos;
|
||||
|
||||
clos.callback = callback;
|
||||
clos.data = user_data;
|
||||
|
||||
_clutter_actor_foreach_child (CLUTTER_ACTOR (container),
|
||||
foreach_cb,
|
||||
&clos);
|
||||
}
|
||||
|
||||
static void
|
||||
container_real_raise (ClutterContainer *container,
|
||||
ClutterActor *child,
|
||||
@ -197,8 +167,7 @@ clutter_container_default_init (ClutterContainerInterface *iface)
|
||||
iface_type,
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContainerIface, actor_added),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
/**
|
||||
@ -216,8 +185,7 @@ clutter_container_default_init (ClutterContainerInterface *iface)
|
||||
iface_type,
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContainerIface, actor_removed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@ -245,7 +213,6 @@ clutter_container_default_init (ClutterContainerInterface *iface)
|
||||
|
||||
iface->add = container_real_add;
|
||||
iface->remove = container_real_remove;
|
||||
iface->foreach = container_real_foreach;
|
||||
iface->raise = container_real_raise;
|
||||
iface->lower = container_real_lower;
|
||||
iface->sort_depth_order = container_real_sort_depth_order;
|
||||
@ -418,33 +385,6 @@ clutter_container_add_actor (ClutterContainer *container,
|
||||
container_add_actor (container, actor);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_container_add_valist: (skip)
|
||||
* @container: a #ClutterContainer
|
||||
* @first_actor: the first #ClutterActor to add
|
||||
* @var_args: list of actors to add, followed by %NULL
|
||||
*
|
||||
* Alternative va_list version of clutter_container_add().
|
||||
*
|
||||
* This function will call #ClutterContainerIface.add(), which is a
|
||||
* deprecated virtual function. The default implementation will
|
||||
* call clutter_actor_add_child().
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_actor_add_child() instead.
|
||||
*/
|
||||
void
|
||||
clutter_container_add_valist (ClutterContainer *container,
|
||||
ClutterActor *first_actor,
|
||||
va_list var_args)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (first_actor));
|
||||
|
||||
container_add_valist (container, first_actor, var_args);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_container_remove: (skip)
|
||||
* @container: a #ClutterContainer
|
||||
@ -508,42 +448,6 @@ clutter_container_remove_actor (ClutterContainer *container,
|
||||
container_remove_actor (container, actor);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_container_remove_valist: (skip)
|
||||
* @container: a #ClutterContainer
|
||||
* @first_actor: the first #ClutterActor to add
|
||||
* @var_args: list of actors to remove, followed by %NULL
|
||||
*
|
||||
* Alternative va_list version of clutter_container_remove().
|
||||
*
|
||||
* This function will call #ClutterContainerIface.remove(), which is a
|
||||
* deprecated virtual function. The default implementation will call
|
||||
* clutter_actor_remove_child().
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_actor_remove_child() instead.
|
||||
*/
|
||||
void
|
||||
clutter_container_remove_valist (ClutterContainer *container,
|
||||
ClutterActor *first_actor,
|
||||
va_list var_args)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (first_actor));
|
||||
|
||||
container_remove_valist (container, first_actor, var_args);
|
||||
}
|
||||
|
||||
static void
|
||||
get_children_cb (ClutterActor *child,
|
||||
gpointer data)
|
||||
{
|
||||
GList **children = data;
|
||||
|
||||
*children = g_list_prepend (*children, child);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_container_get_children:
|
||||
* @container: a #ClutterContainer
|
||||
@ -561,108 +465,9 @@ get_children_cb (ClutterActor *child,
|
||||
GList *
|
||||
clutter_container_get_children (ClutterContainer *container)
|
||||
{
|
||||
GList *retval;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_CONTAINER (container), NULL);
|
||||
|
||||
retval = NULL;
|
||||
clutter_container_foreach (container, get_children_cb, &retval);
|
||||
|
||||
return g_list_reverse (retval);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_container_foreach:
|
||||
* @container: a #ClutterContainer
|
||||
* @callback: (scope call): a function to be called for each child
|
||||
* @user_data: data to be passed to the function, or %NULL
|
||||
*
|
||||
* Calls @callback for each child of @container that was added
|
||||
* by the application (with clutter_container_add_actor()). Does
|
||||
* not iterate over "internal" children that are part of the
|
||||
* container's own implementation, if any.
|
||||
*
|
||||
* This function calls the #ClutterContainerIface.foreach()
|
||||
* virtual function, which has been deprecated.
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_actor_get_first_child() or
|
||||
* clutter_actor_get_last_child() to retrieve the beginning of
|
||||
* the list of children, and clutter_actor_get_next_sibling()
|
||||
* and clutter_actor_get_previous_sibling() to iterate over it;
|
||||
* alternatively, use the #ClutterActorIter API.
|
||||
*/
|
||||
void
|
||||
clutter_container_foreach (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
if (G_UNLIKELY (_clutter_diagnostic_enabled ()))
|
||||
{
|
||||
ClutterContainerIface *iface = CLUTTER_CONTAINER_GET_IFACE (container);
|
||||
|
||||
if (iface->foreach != container_real_foreach)
|
||||
_clutter_diagnostic_message ("The ClutterContainer::foreach() "
|
||||
"virtual function has been deprecated "
|
||||
"and it should not be overridden by "
|
||||
"newly written code");
|
||||
}
|
||||
#endif /* CLUTTER_ENABLE_DEBUG */
|
||||
|
||||
CLUTTER_CONTAINER_GET_IFACE (container)->foreach (container,
|
||||
callback,
|
||||
user_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_container_foreach_with_internals:
|
||||
* @container: a #ClutterContainer
|
||||
* @callback: (scope call): a function to be called for each child
|
||||
* @user_data: data to be passed to the function, or %NULL
|
||||
*
|
||||
* Calls @callback for each child of @container, including "internal"
|
||||
* children built in to the container itself that were never added
|
||||
* by the application.
|
||||
*
|
||||
* This function calls the #ClutterContainerIface.foreach_with_internals()
|
||||
* virtual function, which has been deprecated.
|
||||
*
|
||||
* Since: 1.0
|
||||
*
|
||||
* Deprecated: 1.10: See clutter_container_foreach().
|
||||
*/
|
||||
void
|
||||
clutter_container_foreach_with_internals (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
ClutterContainerIface *iface;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
iface = CLUTTER_CONTAINER_GET_IFACE (container);
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
if (G_UNLIKELY (_clutter_diagnostic_enabled ()))
|
||||
{
|
||||
if (iface->foreach_with_internals != NULL)
|
||||
_clutter_diagnostic_message ("The ClutterContainer::foreach_with_internals() "
|
||||
"virtual function has been deprecated "
|
||||
"and it should not be overridden by "
|
||||
"newly written code");
|
||||
}
|
||||
#endif /* CLUTTER_ENABLE_DEBUG */
|
||||
|
||||
if (iface->foreach_with_internals != NULL)
|
||||
iface->foreach_with_internals (container, callback, user_data);
|
||||
else
|
||||
iface->foreach (container, callback, user_data);
|
||||
return clutter_actor_get_children (CLUTTER_ACTOR (container));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1446,3 +1251,23 @@ clutter_container_child_notify (ClutterContainer *container,
|
||||
child,
|
||||
pspec);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_container_emit_actor_added (ClutterContainer *container,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
|
||||
|
||||
g_signal_emit (container, container_signals[ACTOR_ADDED], 0, actor);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_container_emit_actor_removed (ClutterContainer *container,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
|
||||
|
||||
g_signal_emit (container, container_signals[ACTOR_REMOVED], 0, actor);
|
||||
}
|
||||
|
@ -59,14 +59,6 @@ typedef struct _ClutterContainerIface ClutterContainerIface;
|
||||
* function is deprecated, and it should not be overridden.
|
||||
* @remove: virtual function for removing an actor from the container. This
|
||||
* virtual function is deprecated, and it should not be overridden.
|
||||
* @foreach: virtual function for iterating over the container's children.
|
||||
* This virtual function is deprecated, and it should not be overridden.
|
||||
* @foreach_with_internals: virtual functions for iterating over the
|
||||
* container's children, both added using the #ClutterContainer API
|
||||
* and internal children. The implementation of this virtual function
|
||||
* is required only if the #ClutterContainer implementation has
|
||||
* internal children. This virtual function is deprecated, and it should
|
||||
* not be overridden.
|
||||
* @raise: virtual function for raising a child. This virtual function is
|
||||
* deprecated and it should not be overridden.
|
||||
* @lower: virtual function for lowering a child. This virtual function is
|
||||
@ -88,7 +80,7 @@ typedef struct _ClutterContainerIface ClutterContainerIface;
|
||||
* @actor_removed: class handler for #ClutterContainer::actor-removed
|
||||
* @child_notify: class handler for #ClutterContainer::child-notify
|
||||
*
|
||||
* Base interface for container actors. The @add, @remove and @foreach
|
||||
* Base interface for container actors. The @add and @remove
|
||||
* virtual functions must be provided by any implementation; the other
|
||||
* virtual functions are optional.
|
||||
*
|
||||
@ -104,13 +96,6 @@ struct _ClutterContainerIface
|
||||
ClutterActor *actor);
|
||||
void (* remove) (ClutterContainer *container,
|
||||
ClutterActor *actor);
|
||||
void (* foreach) (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
void (* foreach_with_internals) (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
/* child stacking */
|
||||
void (* raise) (ClutterContainer *container,
|
||||
|
@ -34,9 +34,10 @@ void _clutter_content_attached (ClutterContent *conte
|
||||
void _clutter_content_detached (ClutterContent *content,
|
||||
ClutterActor *actor);
|
||||
|
||||
void _clutter_content_paint_content (ClutterContent *content,
|
||||
ClutterActor *actor,
|
||||
ClutterPaintNode *node);
|
||||
void _clutter_content_paint_content (ClutterContent *content,
|
||||
ClutterActor *actor,
|
||||
ClutterPaintNode *node,
|
||||
ClutterPaintContext *paint_context);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -96,9 +96,10 @@ clutter_content_real_invalidate_size (ClutterContent *content)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_content_real_paint_content (ClutterContent *content,
|
||||
ClutterActor *actor,
|
||||
ClutterPaintNode *context)
|
||||
clutter_content_real_paint_content (ClutterContent *content,
|
||||
ClutterActor *actor,
|
||||
ClutterPaintNode *context,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
}
|
||||
|
||||
@ -129,8 +130,7 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
||||
G_TYPE_FROM_INTERFACE (iface),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContentInterface, attached),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@ -149,8 +149,7 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
||||
G_TYPE_FROM_INTERFACE (iface),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContentInterface, detached),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
}
|
||||
@ -302,7 +301,8 @@ _clutter_content_detached (ClutterContent *content,
|
||||
* _clutter_content_paint_content:
|
||||
* @content: a #ClutterContent
|
||||
* @actor: a #ClutterActor
|
||||
* @context: a #ClutterPaintNode
|
||||
* @node: a #ClutterPaintNode
|
||||
* @paint_context: a #ClutterPaintContext
|
||||
*
|
||||
* Creates the render tree for the @content and @actor.
|
||||
*
|
||||
@ -310,11 +310,13 @@ _clutter_content_detached (ClutterContent *content,
|
||||
* virtual function.
|
||||
*/
|
||||
void
|
||||
_clutter_content_paint_content (ClutterContent *content,
|
||||
ClutterActor *actor,
|
||||
ClutterPaintNode *node)
|
||||
_clutter_content_paint_content (ClutterContent *content,
|
||||
ClutterActor *actor,
|
||||
ClutterPaintNode *node,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
CLUTTER_CONTENT_GET_IFACE (content)->paint_content (content, actor, node);
|
||||
CLUTTER_CONTENT_GET_IFACE (content)->paint_content (content, actor, node,
|
||||
paint_context);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,9 +65,10 @@ struct _ClutterContentInterface
|
||||
gboolean (* get_preferred_size) (ClutterContent *content,
|
||||
gfloat *width,
|
||||
gfloat *height);
|
||||
void (* paint_content) (ClutterContent *content,
|
||||
ClutterActor *actor,
|
||||
ClutterPaintNode *node);
|
||||
void (* paint_content) (ClutterContent *content,
|
||||
ClutterActor *actor,
|
||||
ClutterPaintNode *node,
|
||||
ClutterPaintContext *paint_context);
|
||||
|
||||
void (* attached) (ClutterContent *content,
|
||||
ClutterActor *actor);
|
||||
|
92
clutter/clutter/clutter-damage-history.c
Normal file
92
clutter/clutter/clutter-damage-history.c
Normal file
@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Copyright (C) 2007,2008,2009,2010,2011 Intel Corporation.
|
||||
* Copyright (C) 2020 Red Hat Inc
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-damage-history.h"
|
||||
|
||||
#define DAMAGE_HISTORY_LENGTH 0x10
|
||||
|
||||
struct _ClutterDamageHistory
|
||||
{
|
||||
cairo_region_t *damages[DAMAGE_HISTORY_LENGTH];
|
||||
int index;
|
||||
};
|
||||
|
||||
ClutterDamageHistory *
|
||||
clutter_damage_history_new (void)
|
||||
{
|
||||
ClutterDamageHistory *history;
|
||||
|
||||
history = g_new0 (ClutterDamageHistory, 1);
|
||||
|
||||
return history;
|
||||
}
|
||||
|
||||
void
|
||||
clutter_damage_history_free (ClutterDamageHistory *history)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (history->damages); i++)
|
||||
g_clear_pointer (&history->damages[i], cairo_region_destroy);
|
||||
|
||||
g_free (history);
|
||||
}
|
||||
|
||||
gboolean
|
||||
clutter_damage_history_is_age_valid (ClutterDamageHistory *history,
|
||||
int age)
|
||||
{
|
||||
if (age >= DAMAGE_HISTORY_LENGTH ||
|
||||
age < 1)
|
||||
return FALSE;
|
||||
|
||||
if (!clutter_damage_history_lookup (history, age))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
clutter_damage_history_record (ClutterDamageHistory *history,
|
||||
const cairo_region_t *damage)
|
||||
{
|
||||
g_clear_pointer (&history->damages[history->index], cairo_region_destroy);
|
||||
history->damages[history->index] = cairo_region_copy (damage);
|
||||
}
|
||||
|
||||
static inline int
|
||||
step_damage_index (int current,
|
||||
int diff)
|
||||
{
|
||||
return (current + diff) & (DAMAGE_HISTORY_LENGTH - 1);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_damage_history_step (ClutterDamageHistory *history)
|
||||
{
|
||||
history->index = step_damage_index (history->index, 1);
|
||||
}
|
||||
|
||||
const cairo_region_t *
|
||||
clutter_damage_history_lookup (ClutterDamageHistory *history,
|
||||
int age)
|
||||
{
|
||||
return history->damages[step_damage_index (history->index, -age)];
|
||||
}
|
42
clutter/clutter/clutter-damage-history.h
Normal file
42
clutter/clutter/clutter-damage-history.h
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (C) 2007,2008,2009,2010,2011 Intel Corporation.
|
||||
* Copyright (C) 2020 Red Hat Inc
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CLUTTER_DAMAGE_HISTORY_H
|
||||
#define CLUTTER_DAMAGE_HISTORY_H
|
||||
|
||||
#include <cairo.h>
|
||||
#include <glib.h>
|
||||
|
||||
typedef struct _ClutterDamageHistory ClutterDamageHistory;
|
||||
|
||||
ClutterDamageHistory * clutter_damage_history_new (void);
|
||||
|
||||
void clutter_damage_history_free (ClutterDamageHistory *history);
|
||||
|
||||
gboolean clutter_damage_history_is_age_valid (ClutterDamageHistory *history,
|
||||
int age);
|
||||
|
||||
void clutter_damage_history_record (ClutterDamageHistory *history,
|
||||
const cairo_region_t *damage);
|
||||
|
||||
void clutter_damage_history_step (ClutterDamageHistory *history);
|
||||
|
||||
const cairo_region_t * clutter_damage_history_lookup (ClutterDamageHistory *history,
|
||||
int age);
|
||||
|
||||
#endif /* CLUTTER_DAMAGE_HISTORY_H */
|
@ -6,46 +6,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_DEBUG_MISC = 1 << 0,
|
||||
CLUTTER_DEBUG_ACTOR = 1 << 1,
|
||||
CLUTTER_DEBUG_TEXTURE = 1 << 2,
|
||||
CLUTTER_DEBUG_EVENT = 1 << 3,
|
||||
CLUTTER_DEBUG_PAINT = 1 << 4,
|
||||
CLUTTER_DEBUG_PANGO = 1 << 5,
|
||||
CLUTTER_DEBUG_BACKEND = 1 << 6,
|
||||
CLUTTER_DEBUG_SCHEDULER = 1 << 7,
|
||||
CLUTTER_DEBUG_SCRIPT = 1 << 8,
|
||||
CLUTTER_DEBUG_SHADER = 1 << 9,
|
||||
CLUTTER_DEBUG_MULTISTAGE = 1 << 10,
|
||||
CLUTTER_DEBUG_ANIMATION = 1 << 11,
|
||||
CLUTTER_DEBUG_LAYOUT = 1 << 12,
|
||||
CLUTTER_DEBUG_PICK = 1 << 13,
|
||||
CLUTTER_DEBUG_EVENTLOOP = 1 << 14,
|
||||
CLUTTER_DEBUG_CLIPPING = 1 << 15,
|
||||
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 16
|
||||
} ClutterDebugFlag;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_DEBUG_NOP_PICKING = 1 << 0,
|
||||
CLUTTER_DEBUG_DUMP_PICK_BUFFERS = 1 << 1
|
||||
} ClutterPickDebugFlag;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_DEBUG_DISABLE_SWAP_EVENTS = 1 << 0,
|
||||
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS = 1 << 1,
|
||||
CLUTTER_DEBUG_REDRAWS = 1 << 2,
|
||||
CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3,
|
||||
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
|
||||
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
|
||||
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
|
||||
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7,
|
||||
CLUTTER_DEBUG_PAINT_DAMAGE_REGION = 1 << 8,
|
||||
} ClutterDrawDebugFlag;
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
|
||||
#define CLUTTER_HAS_DEBUG(type) ((clutter_debug_flags & CLUTTER_DEBUG_##type) != FALSE)
|
||||
|
@ -128,10 +128,9 @@ clutter_deform_effect_deform_vertex (ClutterDeformEffect *effect,
|
||||
}
|
||||
|
||||
static void
|
||||
vbo_invalidate (ClutterActor *actor,
|
||||
const ClutterActorBox *allocation,
|
||||
ClutterAllocationFlags flags,
|
||||
ClutterDeformEffect *effect)
|
||||
vbo_invalidate (ClutterActor *actor,
|
||||
GParamSpec *pspec,
|
||||
ClutterDeformEffect *effect)
|
||||
{
|
||||
effect->priv->is_dirty = TRUE;
|
||||
}
|
||||
@ -147,7 +146,7 @@ clutter_deform_effect_set_actor (ClutterActorMeta *meta,
|
||||
ClutterActor *old_actor = clutter_actor_meta_get_actor (meta);
|
||||
|
||||
if (old_actor != NULL)
|
||||
g_signal_handler_disconnect (old_actor, priv->allocation_id);
|
||||
g_clear_signal_handler (&priv->allocation_id, old_actor);
|
||||
|
||||
priv->allocation_id = 0;
|
||||
}
|
||||
@ -156,7 +155,7 @@ clutter_deform_effect_set_actor (ClutterActorMeta *meta,
|
||||
* changes
|
||||
*/
|
||||
if (actor != NULL)
|
||||
priv->allocation_id = g_signal_connect (actor, "allocation-changed",
|
||||
priv->allocation_id = g_signal_connect (actor, "notify::allocation",
|
||||
G_CALLBACK (vbo_invalidate),
|
||||
meta);
|
||||
|
||||
@ -166,18 +165,20 @@ clutter_deform_effect_set_actor (ClutterActorMeta *meta,
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
ClutterDeformEffect *self= CLUTTER_DEFORM_EFFECT (effect);
|
||||
ClutterDeformEffectPrivate *priv = self->priv;
|
||||
CoglHandle material;
|
||||
CoglPipeline *pipeline;
|
||||
CoglDepthState depth_state;
|
||||
CoglFramebuffer *fb = cogl_get_draw_framebuffer ();
|
||||
CoglFramebuffer *fb =
|
||||
clutter_paint_context_get_framebuffer (paint_context);
|
||||
|
||||
if (priv->is_dirty)
|
||||
{
|
||||
ClutterRect rect;
|
||||
graphene_rect_t rect;
|
||||
gboolean mapped_buffer;
|
||||
CoglVertexP3T2C4 *verts;
|
||||
ClutterActor *actor;
|
||||
@ -193,8 +194,8 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
*/
|
||||
if (clutter_offscreen_effect_get_target_rect (effect, &rect))
|
||||
{
|
||||
width = clutter_rect_get_width (&rect);
|
||||
height = clutter_rect_get_height (&rect);
|
||||
width = graphene_rect_get_width (&rect);
|
||||
height = graphene_rect_get_height (&rect);
|
||||
}
|
||||
else
|
||||
clutter_actor_get_size (actor, &width, &height);
|
||||
|
@ -4,26 +4,11 @@
|
||||
#define __CLUTTER_DEPRECATED_H_INSIDE__
|
||||
|
||||
#include "deprecated/clutter-actor.h"
|
||||
#include "deprecated/clutter-alpha.h"
|
||||
#include "deprecated/clutter-animatable.h"
|
||||
#include "deprecated/clutter-animation.h"
|
||||
#include "deprecated/clutter-behaviour.h"
|
||||
#include "deprecated/clutter-behaviour-depth.h"
|
||||
#include "deprecated/clutter-behaviour-opacity.h"
|
||||
#include "deprecated/clutter-behaviour-scale.h"
|
||||
#include "deprecated/clutter-bin-layout.h"
|
||||
#include "deprecated/clutter-box.h"
|
||||
#include "deprecated/clutter-cairo-texture.h"
|
||||
#include "deprecated/clutter-container.h"
|
||||
#include "deprecated/clutter-group.h"
|
||||
#include "deprecated/clutter-keysyms.h"
|
||||
#include "deprecated/clutter-main.h"
|
||||
#include "deprecated/clutter-rectangle.h"
|
||||
#include "deprecated/clutter-stage-manager.h"
|
||||
#include "deprecated/clutter-stage.h"
|
||||
#include "deprecated/clutter-state.h"
|
||||
#include "deprecated/clutter-table-layout.h"
|
||||
#include "deprecated/clutter-texture.h"
|
||||
#include "deprecated/clutter-timeline.h"
|
||||
|
||||
#undef __CLUTTER_DEPRECATED_H_INSIDE__
|
||||
|
@ -112,7 +112,8 @@ G_DEFINE_TYPE (ClutterDesaturateEffect,
|
||||
CLUTTER_TYPE_OFFSCREEN_EFFECT);
|
||||
|
||||
static gboolean
|
||||
clutter_desaturate_effect_pre_paint (ClutterEffect *effect)
|
||||
clutter_desaturate_effect_pre_paint (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
ClutterDesaturateEffect *self = CLUTTER_DESATURATE_EFFECT (effect);
|
||||
ClutterEffectClass *parent_class;
|
||||
@ -133,7 +134,7 @@ clutter_desaturate_effect_pre_paint (ClutterEffect *effect)
|
||||
}
|
||||
|
||||
parent_class = CLUTTER_EFFECT_CLASS (clutter_desaturate_effect_parent_class);
|
||||
if (parent_class->pre_paint (effect))
|
||||
if (parent_class->pre_paint (effect, paint_context))
|
||||
{
|
||||
ClutterOffscreenEffect *offscreen_effect =
|
||||
CLUTTER_OFFSCREEN_EFFECT (effect);
|
||||
@ -152,10 +153,12 @@ clutter_desaturate_effect_pre_paint (ClutterEffect *effect)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_desaturate_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
clutter_desaturate_effect_paint_target (ClutterOffscreenEffect *effect,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
ClutterDesaturateEffect *self = CLUTTER_DESATURATE_EFFECT (effect);
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
CoglFramebuffer *framebuffer =
|
||||
clutter_paint_context_get_framebuffer (paint_context);
|
||||
ClutterActor *actor;
|
||||
CoglHandle texture;
|
||||
guint8 paint_opacity;
|
||||
|
@ -1,281 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright (C) 2010 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author:
|
||||
* Emmanuele Bassi <ebassi@linux.intel.com>
|
||||
*/
|
||||
|
||||
#ifndef __CLUTTER_DEVICE_MANAGER_PRIVATE_H__
|
||||
#define __CLUTTER_DEVICE_MANAGER_PRIVATE_H__
|
||||
|
||||
#include <clutter/clutter-backend.h>
|
||||
#include <clutter/clutter-device-manager.h>
|
||||
#include <clutter/clutter-event.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _ClutterAxisInfo
|
||||
{
|
||||
ClutterInputAxis axis;
|
||||
|
||||
gdouble min_axis;
|
||||
gdouble max_axis;
|
||||
|
||||
gdouble min_value;
|
||||
gdouble max_value;
|
||||
|
||||
gdouble resolution;
|
||||
} ClutterAxisInfo;
|
||||
|
||||
typedef struct _ClutterKeyInfo
|
||||
{
|
||||
guint keyval;
|
||||
ClutterModifierType modifiers;
|
||||
} ClutterKeyInfo;
|
||||
|
||||
typedef struct _ClutterScrollInfo
|
||||
{
|
||||
guint axis_id;
|
||||
ClutterScrollDirection direction;
|
||||
gdouble increment;
|
||||
|
||||
gdouble last_value;
|
||||
guint last_value_valid : 1;
|
||||
} ClutterScrollInfo;
|
||||
|
||||
typedef struct _ClutterTouchInfo
|
||||
{
|
||||
ClutterEventSequence *sequence;
|
||||
ClutterActor *actor;
|
||||
|
||||
gfloat current_x;
|
||||
gfloat current_y;
|
||||
} ClutterTouchInfo;
|
||||
|
||||
struct _ClutterInputDevice
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
gint id;
|
||||
|
||||
ClutterInputDeviceType device_type;
|
||||
ClutterInputMode device_mode;
|
||||
|
||||
gchar *device_name;
|
||||
|
||||
ClutterDeviceManager *device_manager;
|
||||
|
||||
ClutterBackend *backend;
|
||||
|
||||
/* the associated device */
|
||||
ClutterInputDevice *associated;
|
||||
|
||||
GList *slaves;
|
||||
|
||||
/* the actor underneath the pointer */
|
||||
ClutterActor *cursor_actor;
|
||||
GHashTable *inv_touch_sequence_actors;
|
||||
|
||||
/* the actor that has a grab in place for the device */
|
||||
ClutterActor *pointer_grab_actor;
|
||||
ClutterActor *keyboard_grab_actor;
|
||||
GHashTable *sequence_grab_actors;
|
||||
GHashTable *inv_sequence_grab_actors;
|
||||
|
||||
/* the current click count */
|
||||
gint click_count;
|
||||
|
||||
/* the stage the device is on */
|
||||
ClutterStage *stage;
|
||||
|
||||
/* the current state */
|
||||
gfloat current_x;
|
||||
gfloat current_y;
|
||||
guint32 current_time;
|
||||
gint current_button_number;
|
||||
ClutterModifierType current_state;
|
||||
|
||||
/* the current touch points states */
|
||||
GHashTable *touch_sequences_info;
|
||||
|
||||
/* the previous state, used for click count generation */
|
||||
gint previous_x;
|
||||
gint previous_y;
|
||||
guint32 previous_time;
|
||||
gint previous_button_number;
|
||||
ClutterModifierType previous_state;
|
||||
|
||||
GArray *axes;
|
||||
|
||||
guint n_keys;
|
||||
GArray *keys;
|
||||
|
||||
GArray *scroll_info;
|
||||
|
||||
gchar *vendor_id;
|
||||
gchar *product_id;
|
||||
gchar *node_path;
|
||||
|
||||
GPtrArray *tools;
|
||||
|
||||
gint n_rings;
|
||||
gint n_strips;
|
||||
gint n_mode_groups;
|
||||
|
||||
ClutterInputDeviceMapping mapping_mode;
|
||||
|
||||
guint has_cursor : 1;
|
||||
guint is_enabled : 1;
|
||||
};
|
||||
|
||||
typedef void (*ClutterEmitInputDeviceEvent) (ClutterEvent *event,
|
||||
ClutterInputDevice *device);
|
||||
|
||||
struct _ClutterInputDeviceClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
gboolean (* keycode_to_evdev) (ClutterInputDevice *device,
|
||||
guint hardware_keycode,
|
||||
guint *evdev_keycode);
|
||||
void (* update_from_tool) (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
|
||||
gboolean (* is_mode_switch_button) (ClutterInputDevice *device,
|
||||
guint group,
|
||||
guint button);
|
||||
gint (* get_group_n_modes) (ClutterInputDevice *device,
|
||||
gint group);
|
||||
|
||||
gboolean (* is_grouped) (ClutterInputDevice *device,
|
||||
ClutterInputDevice *other_device);
|
||||
|
||||
/* Keyboard accessbility */
|
||||
void (* process_kbd_a11y_event) (ClutterEvent *event,
|
||||
ClutterInputDevice *device,
|
||||
ClutterEmitInputDeviceEvent emit_event_func);
|
||||
};
|
||||
|
||||
/* Platform-dependent interface */
|
||||
typedef struct _ClutterEventExtender ClutterEventExtender;
|
||||
typedef struct _ClutterEventExtenderInterface ClutterEventExtenderInterface;
|
||||
|
||||
#define CLUTTER_TYPE_EVENT_EXTENDER (clutter_event_extender_get_type ())
|
||||
#define CLUTTER_EVENT_EXTENDER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CLUTTER_TYPE_EVENT_EXTENDER, ClutterEventExtender))
|
||||
#define CLUTTER_IS_EVENT_EXTENDER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CLUTTER_TYPE_EVENT_EXTENDER))
|
||||
#define CLUTTER_EVENT_EXTENDER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), CLUTTER_TYPE_EVENT_EXTENDER, ClutterEventExtenderInterface))
|
||||
|
||||
struct _ClutterEventExtenderInterface
|
||||
{
|
||||
GTypeInterface g_iface;
|
||||
|
||||
void (* copy_event_data) (ClutterEventExtender *event_extender,
|
||||
const ClutterEvent *src,
|
||||
ClutterEvent *dest);
|
||||
void (* free_event_data) (ClutterEventExtender *event_extender,
|
||||
ClutterEvent *event);
|
||||
};
|
||||
|
||||
GType clutter_event_extender_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/* device manager */
|
||||
void _clutter_device_manager_add_device (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDevice *device);
|
||||
void _clutter_device_manager_remove_device (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDevice *device);
|
||||
void _clutter_device_manager_update_devices (ClutterDeviceManager *device_manager);
|
||||
void _clutter_device_manager_select_stage_events (ClutterDeviceManager *device_manager,
|
||||
ClutterStage *stage);
|
||||
ClutterBackend *_clutter_device_manager_get_backend (ClutterDeviceManager *device_manager);
|
||||
|
||||
void _clutter_device_manager_compress_motion (ClutterDeviceManager *device_manger,
|
||||
ClutterEvent *event,
|
||||
const ClutterEvent *to_discard);
|
||||
|
||||
/* input device */
|
||||
gboolean _clutter_input_device_has_sequence (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence);
|
||||
void _clutter_input_device_add_event_sequence (ClutterInputDevice *device,
|
||||
ClutterEvent *event);
|
||||
void _clutter_input_device_remove_event_sequence (ClutterInputDevice *device,
|
||||
ClutterEvent *event);
|
||||
void _clutter_input_device_set_coords (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
gfloat x,
|
||||
gfloat y,
|
||||
ClutterStage *stage);
|
||||
void _clutter_input_device_set_state (ClutterInputDevice *device,
|
||||
ClutterModifierType state);
|
||||
void _clutter_input_device_set_time (ClutterInputDevice *device,
|
||||
guint32 time_);
|
||||
void _clutter_input_device_set_stage (ClutterInputDevice *device,
|
||||
ClutterStage *stage);
|
||||
ClutterStage * _clutter_input_device_get_stage (ClutterInputDevice *device);
|
||||
void _clutter_input_device_set_actor (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
ClutterActor *actor,
|
||||
gboolean emit_crossing);
|
||||
ClutterActor * _clutter_input_device_update (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
gboolean emit_crossing);
|
||||
void _clutter_input_device_set_n_keys (ClutterInputDevice *device,
|
||||
guint n_keys);
|
||||
guint _clutter_input_device_add_axis (ClutterInputDevice *device,
|
||||
ClutterInputAxis axis,
|
||||
gdouble min_value,
|
||||
gdouble max_value,
|
||||
gdouble resolution);
|
||||
void _clutter_input_device_reset_axes (ClutterInputDevice *device);
|
||||
|
||||
void _clutter_input_device_set_associated_device (ClutterInputDevice *device,
|
||||
ClutterInputDevice *associated);
|
||||
void _clutter_input_device_add_slave (ClutterInputDevice *master,
|
||||
ClutterInputDevice *slave);
|
||||
void _clutter_input_device_remove_slave (ClutterInputDevice *master,
|
||||
ClutterInputDevice *slave);
|
||||
|
||||
gboolean _clutter_input_device_translate_axis (ClutterInputDevice *device,
|
||||
guint index_,
|
||||
gdouble value,
|
||||
gdouble *axis_value);
|
||||
|
||||
void _clutter_input_device_add_scroll_info (ClutterInputDevice *device,
|
||||
guint index_,
|
||||
ClutterScrollDirection direction,
|
||||
gdouble increment);
|
||||
void _clutter_input_device_reset_scroll_info (ClutterInputDevice *device);
|
||||
gboolean _clutter_input_device_get_scroll_delta (ClutterInputDevice *device,
|
||||
guint index_,
|
||||
gdouble value,
|
||||
ClutterScrollDirection *direction_p,
|
||||
gdouble *delta_p);
|
||||
|
||||
ClutterInputDeviceTool * clutter_input_device_lookup_tool (ClutterInputDevice *device,
|
||||
guint64 serial,
|
||||
ClutterInputDeviceToolType type);
|
||||
void clutter_input_device_add_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
|
||||
void clutter_input_device_update_from_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_DEVICE_MANAGER_PRIVATE_H__ */
|
@ -1,581 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright (C) 2009 Intel Corp.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Emmanuele Bassi <ebassi@linux.intel.com>
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:clutter-device-manager
|
||||
* @short_description: Maintains the list of input devices
|
||||
*
|
||||
* #ClutterDeviceManager is a singleton object, owned by Clutter, which
|
||||
* maintains the list of #ClutterInputDevice<!-- -->s.
|
||||
*
|
||||
* Depending on the backend used by Clutter it is possible to use the
|
||||
* #ClutterDeviceManager::device-added and
|
||||
* #ClutterDeviceManager::device-removed to monitor addition and removal
|
||||
* of devices.
|
||||
*
|
||||
* #ClutterDeviceManager is available since Clutter 1.2
|
||||
*/
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-backend-private.h"
|
||||
#include "clutter-debug.h"
|
||||
#include "clutter-device-manager-private.h"
|
||||
#include "clutter-enum-types.h"
|
||||
#include "clutter-marshal.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-stage-private.h"
|
||||
#include "clutter-virtual-input-device.h"
|
||||
#include "clutter-input-device-tool.h"
|
||||
|
||||
struct _ClutterDeviceManagerPrivate
|
||||
{
|
||||
/* back-pointer to the backend */
|
||||
ClutterBackend *backend;
|
||||
|
||||
/* Keyboard a11y */
|
||||
ClutterKbdA11ySettings kbd_a11y_settings;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
|
||||
PROP_BACKEND,
|
||||
|
||||
PROP_LAST
|
||||
};
|
||||
|
||||
static GParamSpec *obj_props[PROP_LAST];
|
||||
|
||||
enum
|
||||
{
|
||||
DEVICE_ADDED,
|
||||
DEVICE_REMOVED,
|
||||
TOOL_CHANGED,
|
||||
KBD_A11Y_MASK_CHANGED,
|
||||
KBD_A11Y_FLAGS_CHANGED,
|
||||
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static guint manager_signals[LAST_SIGNAL] = { 0, };
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterDeviceManager,
|
||||
clutter_device_manager,
|
||||
G_TYPE_OBJECT)
|
||||
|
||||
G_DEFINE_INTERFACE (ClutterEventExtender,
|
||||
clutter_event_extender,
|
||||
CLUTTER_TYPE_DEVICE_MANAGER)
|
||||
|
||||
static void
|
||||
clutter_event_extender_default_init (ClutterEventExtenderInterface *iface)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_device_manager_set_property (GObject *gobject,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv = CLUTTER_DEVICE_MANAGER (gobject)->priv;
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_BACKEND:
|
||||
priv->backend = g_value_get_object (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_device_manager_get_property (GObject *gobject,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv = CLUTTER_DEVICE_MANAGER (gobject)->priv;
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_BACKEND:
|
||||
g_value_set_object (value, priv->backend);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
obj_props[PROP_BACKEND] =
|
||||
g_param_spec_object ("backend",
|
||||
P_("Backend"),
|
||||
P_("The ClutterBackend of the device manager"),
|
||||
CLUTTER_TYPE_BACKEND,
|
||||
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||
|
||||
gobject_class->set_property = clutter_device_manager_set_property;
|
||||
gobject_class->get_property = clutter_device_manager_get_property;
|
||||
g_object_class_install_properties (gobject_class,
|
||||
PROP_LAST,
|
||||
obj_props);
|
||||
|
||||
/**
|
||||
* ClutterDeviceManager::device-added:
|
||||
* @manager: the #ClutterDeviceManager that emitted the signal
|
||||
* @device: the newly added #ClutterInputDevice
|
||||
*
|
||||
* The ::device-added signal is emitted each time a device has been
|
||||
* added to the #ClutterDeviceManager
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
manager_signals[DEVICE_ADDED] =
|
||||
g_signal_new (I_("device-added"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_INPUT_DEVICE);
|
||||
|
||||
/**
|
||||
* ClutterDeviceManager::device-removed:
|
||||
* @manager: the #ClutterDeviceManager that emitted the signal
|
||||
* @device: the removed #ClutterInputDevice
|
||||
*
|
||||
* The ::device-removed signal is emitted each time a device has been
|
||||
* removed from the #ClutterDeviceManager
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
manager_signals[DEVICE_REMOVED] =
|
||||
g_signal_new (I_("device-removed"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_INPUT_DEVICE);
|
||||
|
||||
manager_signals[TOOL_CHANGED] =
|
||||
g_signal_new (I_("tool-changed"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT_OBJECT,
|
||||
G_TYPE_NONE, 2,
|
||||
CLUTTER_TYPE_INPUT_DEVICE,
|
||||
CLUTTER_TYPE_INPUT_DEVICE_TOOL);
|
||||
|
||||
/**
|
||||
* ClutterDeviceManager::kbd-a11y-mods-state-changed:
|
||||
* @manager: the #ClutterDeviceManager that emitted the signal
|
||||
* @latched_mask: the latched modifier mask from stickykeys
|
||||
* @locked_mask: the locked modifier mask from stickykeys
|
||||
*
|
||||
* The ::kbd-a11y-mods-state-changed signal is emitted each time either the
|
||||
* latched modifiers mask or locked modifiers mask are changed as the
|
||||
* result of keyboard accessibilty's sticky keys operations.
|
||||
*/
|
||||
manager_signals[KBD_A11Y_MASK_CHANGED] =
|
||||
g_signal_new (I_("kbd-a11y-mods-state-changed"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
_clutter_marshal_VOID__UINT_UINT,
|
||||
G_TYPE_NONE, 2,
|
||||
G_TYPE_UINT,
|
||||
G_TYPE_UINT);
|
||||
|
||||
/**
|
||||
* ClutterDeviceManager::kbd-a11y-flags-changed:
|
||||
* @manager: the #ClutterDeviceManager that emitted the signal
|
||||
* @settings_flags: the new ClutterKeyboardA11yFlags configuration
|
||||
* @changed_mask: the ClutterKeyboardA11yFlags changed
|
||||
*
|
||||
* The ::kbd-a11y-flags-changed signal is emitted each time the
|
||||
* ClutterKeyboardA11yFlags configuration is changed as the result of
|
||||
* keyboard accessibilty operations.
|
||||
*/
|
||||
manager_signals[KBD_A11Y_FLAGS_CHANGED] =
|
||||
g_signal_new (I_("kbd-a11y-flags-changed"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
_clutter_marshal_VOID__UINT_UINT,
|
||||
G_TYPE_NONE, 2,
|
||||
G_TYPE_UINT,
|
||||
G_TYPE_UINT);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_device_manager_init (ClutterDeviceManager *self)
|
||||
{
|
||||
self->priv = clutter_device_manager_get_instance_private (self);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_device_manager_get_default:
|
||||
*
|
||||
* Retrieves the device manager singleton
|
||||
*
|
||||
* Return value: (transfer none): the #ClutterDeviceManager singleton.
|
||||
* The returned instance is owned by Clutter and it should not be
|
||||
* modified or freed
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
ClutterDeviceManager *
|
||||
clutter_device_manager_get_default (void)
|
||||
{
|
||||
ClutterBackend *backend = clutter_get_default_backend ();
|
||||
|
||||
return backend->device_manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_device_manager_list_devices:
|
||||
* @device_manager: a #ClutterDeviceManager
|
||||
*
|
||||
* Lists all currently registered input devices
|
||||
*
|
||||
* Return value: (transfer container) (element-type Clutter.InputDevice):
|
||||
* a newly allocated list of #ClutterInputDevice objects. Use
|
||||
* g_slist_free() to deallocate it when done
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
GSList *
|
||||
clutter_device_manager_list_devices (ClutterDeviceManager *device_manager)
|
||||
{
|
||||
const GSList *devices;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager), NULL);
|
||||
|
||||
devices = clutter_device_manager_peek_devices (device_manager);
|
||||
|
||||
return g_slist_copy ((GSList *) devices);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_device_manager_peek_devices:
|
||||
* @device_manager: a #ClutterDeviceManager
|
||||
*
|
||||
* Lists all currently registered input devices
|
||||
*
|
||||
* Return value: (transfer none) (element-type Clutter.InputDevice):
|
||||
* a pointer to the internal list of #ClutterInputDevice objects. The
|
||||
* returned list is owned by the #ClutterDeviceManager and should never
|
||||
* be modified or freed
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
const GSList *
|
||||
clutter_device_manager_peek_devices (ClutterDeviceManager *device_manager)
|
||||
{
|
||||
ClutterDeviceManagerClass *manager_class;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager), NULL);
|
||||
|
||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
return manager_class->get_devices (device_manager);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_device_manager_get_device:
|
||||
* @device_manager: a #ClutterDeviceManager
|
||||
* @device_id: the integer id of a device
|
||||
*
|
||||
* Retrieves the #ClutterInputDevice with the given @device_id
|
||||
*
|
||||
* Return value: (transfer none): a #ClutterInputDevice or %NULL. The
|
||||
* returned device is owned by the #ClutterDeviceManager and should
|
||||
* never be modified or freed
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
ClutterInputDevice *
|
||||
clutter_device_manager_get_device (ClutterDeviceManager *device_manager,
|
||||
gint device_id)
|
||||
{
|
||||
ClutterDeviceManagerClass *manager_class;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager), NULL);
|
||||
|
||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
return manager_class->get_device (device_manager, device_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_device_manager_get_core_device:
|
||||
* @device_manager: a #ClutterDeviceManager
|
||||
* @device_type: the type of the core device
|
||||
*
|
||||
* Retrieves the core #ClutterInputDevice of type @device_type
|
||||
*
|
||||
* Core devices are devices created automatically by the default
|
||||
* Clutter backend
|
||||
*
|
||||
* Return value: (transfer none): a #ClutterInputDevice or %NULL. The
|
||||
* returned device is owned by the #ClutterDeviceManager and should
|
||||
* not be modified or freed
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
ClutterInputDevice *
|
||||
clutter_device_manager_get_core_device (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDeviceType device_type)
|
||||
{
|
||||
ClutterDeviceManagerClass *manager_class;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager), NULL);
|
||||
|
||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
return manager_class->get_core_device (device_manager, device_type);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_device_manager_select_stage_events (ClutterDeviceManager *device_manager,
|
||||
ClutterStage *stage)
|
||||
{
|
||||
ClutterDeviceManagerClass *manager_class;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
if (manager_class->select_stage_events)
|
||||
manager_class->select_stage_events (device_manager, stage);
|
||||
}
|
||||
|
||||
/*
|
||||
* _clutter_device_manager_add_device:
|
||||
* @device_manager: a #ClutterDeviceManager
|
||||
* @device: a #ClutterInputDevice
|
||||
*
|
||||
* Adds @device to the list of #ClutterInputDevice<!-- -->s maintained
|
||||
* by @device_manager
|
||||
*
|
||||
* The reference count of @device is not increased
|
||||
*
|
||||
* The #ClutterDeviceManager::device-added signal is emitted after
|
||||
* adding @device to the list
|
||||
*/
|
||||
void
|
||||
_clutter_device_manager_add_device (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
ClutterDeviceManagerClass *manager_class;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
g_assert (manager_class->add_device != NULL);
|
||||
|
||||
manager_class->add_device (device_manager, device);
|
||||
|
||||
g_signal_emit (device_manager, manager_signals[DEVICE_ADDED], 0, device);
|
||||
}
|
||||
|
||||
/*
|
||||
* _clutter_device_manager_remove_device:
|
||||
* @device_manager: a #ClutterDeviceManager
|
||||
* @device: a #ClutterInputDevice
|
||||
*
|
||||
* Removes @device from the list of #ClutterInputDevice<!-- -->s
|
||||
* maintained by @device_manager
|
||||
*
|
||||
* The reference count of @device is not decreased
|
||||
*
|
||||
* The #ClutterDeviceManager::device-removed signal is emitted after
|
||||
* removing @device from the list
|
||||
*/
|
||||
void
|
||||
_clutter_device_manager_remove_device (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
ClutterDeviceManagerClass *manager_class;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
g_assert (manager_class->remove_device != NULL);
|
||||
|
||||
/* The subclass remove_device() method will likely unref it but we
|
||||
have to keep it alive during the signal emission. */
|
||||
g_object_ref (device);
|
||||
|
||||
manager_class->remove_device (device_manager, device);
|
||||
g_signal_emit (device_manager, manager_signals[DEVICE_REMOVED], 0, device);
|
||||
|
||||
g_object_unref (device);
|
||||
}
|
||||
|
||||
/*
|
||||
* _clutter_device_manager_update_devices:
|
||||
* @device_manager: a #ClutterDeviceManager
|
||||
*
|
||||
* Updates every #ClutterInputDevice handled by @device_manager
|
||||
* by performing a pick paint at the coordinates of each pointer
|
||||
* device
|
||||
*/
|
||||
void
|
||||
_clutter_device_manager_update_devices (ClutterDeviceManager *device_manager)
|
||||
{
|
||||
const GSList *d;
|
||||
|
||||
for (d = clutter_device_manager_peek_devices (device_manager);
|
||||
d != NULL;
|
||||
d = d->next)
|
||||
{
|
||||
ClutterInputDevice *device = d->data;
|
||||
ClutterInputDeviceType device_type;
|
||||
|
||||
/* we only care about pointer devices */
|
||||
device_type = clutter_input_device_get_device_type (device);
|
||||
if (device_type != CLUTTER_POINTER_DEVICE)
|
||||
continue;
|
||||
|
||||
/* out of stage */
|
||||
if (device->stage == NULL)
|
||||
continue;
|
||||
|
||||
/* the user disabled motion events delivery on actors for
|
||||
* the stage the device is on; we don't perform any picking
|
||||
* since the source of the events will always be set to be
|
||||
* the stage
|
||||
*/
|
||||
if (!clutter_stage_get_motion_events_enabled (device->stage))
|
||||
continue;
|
||||
|
||||
_clutter_input_device_update (device, NULL, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
ClutterBackend *
|
||||
_clutter_device_manager_get_backend (ClutterDeviceManager *manager)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (manager), NULL);
|
||||
|
||||
return manager->priv->backend;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_device_manager_create_virtual_device:
|
||||
* @device_manager: a #ClutterDeviceManager
|
||||
* @device_type: the type of the virtual device
|
||||
*
|
||||
* Creates a virtual input device.
|
||||
*
|
||||
* Returns: (transfer full): a newly created virtual device
|
||||
**/
|
||||
ClutterVirtualInputDevice *
|
||||
clutter_device_manager_create_virtual_device (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDeviceType device_type)
|
||||
{
|
||||
ClutterDeviceManagerClass *manager_class;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager), NULL);
|
||||
|
||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
return manager_class->create_virtual_device (device_manager,
|
||||
device_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_device_manager_supported_virtua_device_types: (skip)
|
||||
*/
|
||||
ClutterVirtualDeviceType
|
||||
clutter_device_manager_get_supported_virtual_device_types (ClutterDeviceManager *device_manager)
|
||||
{
|
||||
ClutterDeviceManagerClass *manager_class;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager),
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_NONE);
|
||||
|
||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
return manager_class->get_supported_virtual_device_types (device_manager);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_device_manager_compress_motion (ClutterDeviceManager *device_manager,
|
||||
ClutterEvent *event,
|
||||
const ClutterEvent *to_discard)
|
||||
{
|
||||
ClutterDeviceManagerClass *manager_class;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
|
||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
if (!manager_class->compress_motion)
|
||||
return;
|
||||
|
||||
manager_class->compress_motion (device_manager, event, to_discard);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
are_kbd_a11y_settings_equal (ClutterKbdA11ySettings *a,
|
||||
ClutterKbdA11ySettings *b)
|
||||
{
|
||||
return (memcmp (a, b, sizeof (ClutterKbdA11ySettings)) == 0);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_device_manager_set_kbd_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterKbdA11ySettings *settings)
|
||||
{
|
||||
ClutterDeviceManagerClass *manager_class;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
if (are_kbd_a11y_settings_equal (&device_manager->priv->kbd_a11y_settings, settings))
|
||||
return;
|
||||
|
||||
device_manager->priv->kbd_a11y_settings = *settings;
|
||||
|
||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
if (manager_class->apply_kbd_a11y_settings)
|
||||
manager_class->apply_kbd_a11y_settings (device_manager, settings);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_device_manager_get_kbd_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterKbdA11ySettings *settings)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
*settings = device_manager->priv->kbd_a11y_settings;
|
||||
}
|
@ -1,161 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright (C) 2009 Intel Corp.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Emmanuele Bassi <ebassi@linux.intel.com>
|
||||
*/
|
||||
|
||||
#ifndef __CLUTTER_DEVICE_MANAGER_H__
|
||||
#define __CLUTTER_DEVICE_MANAGER_H__
|
||||
|
||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <clutter/clutter.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <clutter/clutter-input-device.h>
|
||||
#include <clutter/clutter-stage.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_DEVICE_MANAGER (clutter_device_manager_get_type ())
|
||||
#define CLUTTER_DEVICE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_DEVICE_MANAGER, ClutterDeviceManager))
|
||||
#define CLUTTER_IS_DEVICE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_DEVICE_MANAGER))
|
||||
#define CLUTTER_DEVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_DEVICE_MANAGER, ClutterDeviceManagerClass))
|
||||
#define CLUTTER_IS_DEVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_DEVICE_MANAGER))
|
||||
#define CLUTTER_DEVICE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_DEVICE_MANAGER, ClutterDeviceManagerClass))
|
||||
|
||||
typedef struct _ClutterDeviceManager ClutterDeviceManager;
|
||||
typedef struct _ClutterDeviceManagerPrivate ClutterDeviceManagerPrivate;
|
||||
typedef struct _ClutterDeviceManagerClass ClutterDeviceManagerClass;
|
||||
|
||||
/**
|
||||
* ClutterVirtualDeviceType:
|
||||
*/
|
||||
typedef enum _ClutterVirtualDeviceType
|
||||
{
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_NONE = 0,
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_KEYBOARD = 1 << 0,
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_POINTER = 1 << 1,
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_TOUCHSCREEN = 1 << 2,
|
||||
} ClutterVirtualDeviceType;
|
||||
|
||||
/**
|
||||
* ClutterKbdA11ySettings:
|
||||
*
|
||||
* The #ClutterKbdA11ySettings structure contains keyboard accessibility
|
||||
* settings
|
||||
*
|
||||
*/
|
||||
typedef struct _ClutterKbdA11ySettings
|
||||
{
|
||||
ClutterKeyboardA11yFlags controls;
|
||||
gint slowkeys_delay;
|
||||
gint debounce_delay;
|
||||
gint timeout_delay;
|
||||
gint mousekeys_init_delay;
|
||||
gint mousekeys_max_speed;
|
||||
gint mousekeys_accel_time;
|
||||
} ClutterKbdA11ySettings;
|
||||
|
||||
/**
|
||||
* ClutterDeviceManager:
|
||||
*
|
||||
* The #ClutterDeviceManager structure contains only private data
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
struct _ClutterDeviceManager
|
||||
{
|
||||
/*< private >*/
|
||||
GObject parent_instance;
|
||||
|
||||
ClutterDeviceManagerPrivate *priv;
|
||||
};
|
||||
|
||||
/**
|
||||
* ClutterDeviceManagerClass:
|
||||
*
|
||||
* The #ClutterDeviceManagerClass structure contains only private data
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
struct _ClutterDeviceManagerClass
|
||||
{
|
||||
/*< private >*/
|
||||
GObjectClass parent_class;
|
||||
|
||||
const GSList * (* get_devices) (ClutterDeviceManager *device_manager);
|
||||
ClutterInputDevice *(* get_core_device) (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDeviceType device_type);
|
||||
ClutterInputDevice *(* get_device) (ClutterDeviceManager *device_manager,
|
||||
gint device_id);
|
||||
|
||||
void (* add_device) (ClutterDeviceManager *manager,
|
||||
ClutterInputDevice *device);
|
||||
void (* remove_device) (ClutterDeviceManager *manager,
|
||||
ClutterInputDevice *device);
|
||||
void (* select_stage_events) (ClutterDeviceManager *manager,
|
||||
ClutterStage *stage);
|
||||
ClutterVirtualInputDevice *(* create_virtual_device) (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDeviceType device_type);
|
||||
ClutterVirtualDeviceType (* get_supported_virtual_device_types) (ClutterDeviceManager *device_manager);
|
||||
void (* compress_motion) (ClutterDeviceManager *device_manger,
|
||||
ClutterEvent *event,
|
||||
const ClutterEvent *to_discard);
|
||||
/* Keyboard accessbility */
|
||||
void (* apply_kbd_a11y_settings) (ClutterDeviceManager *device_manger,
|
||||
ClutterKbdA11ySettings *settings);
|
||||
/* padding */
|
||||
gpointer _padding[6];
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_device_manager_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterDeviceManager *clutter_device_manager_get_default (void);
|
||||
CLUTTER_EXPORT
|
||||
GSList * clutter_device_manager_list_devices (ClutterDeviceManager *device_manager);
|
||||
CLUTTER_EXPORT
|
||||
const GSList * clutter_device_manager_peek_devices (ClutterDeviceManager *device_manager);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterInputDevice * clutter_device_manager_get_device (ClutterDeviceManager *device_manager,
|
||||
gint device_id);
|
||||
CLUTTER_EXPORT
|
||||
ClutterInputDevice * clutter_device_manager_get_core_device (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDeviceType device_type);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterVirtualInputDevice *clutter_device_manager_create_virtual_device (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDeviceType device_type);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterVirtualDeviceType clutter_device_manager_get_supported_virtual_device_types (ClutterDeviceManager *device_manager);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_device_manager_set_kbd_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterKbdA11ySettings *settings);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_device_manager_get_kbd_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterKbdA11ySettings *settings);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_DEVICE_MANAGER_H__ */
|
File diff suppressed because it is too large
Load Diff
@ -1,152 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright (C) 2010 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author:
|
||||
* Emmanuele Bassi <ebassi@linux.intel.com>
|
||||
*/
|
||||
|
||||
#ifndef __CLUTTER_DRAG_ACTION_H__
|
||||
#define __CLUTTER_DRAG_ACTION_H__
|
||||
|
||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <clutter/clutter.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <clutter/clutter-action.h>
|
||||
#include <clutter/clutter-event.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_DRAG_ACTION (clutter_drag_action_get_type ())
|
||||
#define CLUTTER_DRAG_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_DRAG_ACTION, ClutterDragAction))
|
||||
#define CLUTTER_IS_DRAG_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_DRAG_ACTION))
|
||||
#define CLUTTER_DRAG_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_DRAG_ACTION, ClutterDragActionClass))
|
||||
#define CLUTTER_IS_DRAG_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_DRAG_ACTION))
|
||||
#define CLUTTER_DRAG_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_DRAG_ACTION, ClutterDragActionClass))
|
||||
|
||||
typedef struct _ClutterDragAction ClutterDragAction;
|
||||
typedef struct _ClutterDragActionPrivate ClutterDragActionPrivate;
|
||||
typedef struct _ClutterDragActionClass ClutterDragActionClass;
|
||||
|
||||
/**
|
||||
* ClutterDragAction:
|
||||
*
|
||||
* The #ClutterDragAction structure contains only
|
||||
* private data and should be accessed using the provided API
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
struct _ClutterDragAction
|
||||
{
|
||||
/*< private >*/
|
||||
ClutterAction parent_instance;
|
||||
|
||||
ClutterDragActionPrivate *priv;
|
||||
};
|
||||
|
||||
/**
|
||||
* ClutterDragActionClass:
|
||||
* @drag_begin: class handler of the #ClutterDragAction::drag-begin signal
|
||||
* @drag_motion: class handler of the #ClutterDragAction::drag-motion signal
|
||||
* @drag_end: class handler of the #ClutterDragAction::drag-end signal
|
||||
* @drag_progress: class handler of the #ClutterDragAction::drag-progress signal
|
||||
*
|
||||
* The #ClutterDragActionClass structure contains
|
||||
* only private data
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
struct _ClutterDragActionClass
|
||||
{
|
||||
/*< private >*/
|
||||
ClutterActionClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
void (* drag_begin) (ClutterDragAction *action,
|
||||
ClutterActor *actor,
|
||||
gfloat event_x,
|
||||
gfloat event_y,
|
||||
ClutterModifierType modifiers);
|
||||
void (* drag_motion) (ClutterDragAction *action,
|
||||
ClutterActor *actor,
|
||||
gfloat delta_x,
|
||||
gfloat delta_y);
|
||||
void (* drag_end) (ClutterDragAction *action,
|
||||
ClutterActor *actor,
|
||||
gfloat event_x,
|
||||
gfloat event_y,
|
||||
ClutterModifierType modifiers);
|
||||
gboolean (* drag_progress) (ClutterDragAction *action,
|
||||
ClutterActor *actor,
|
||||
gfloat delta_x,
|
||||
gfloat delta_y);
|
||||
|
||||
/*< private >*/
|
||||
void (* _clutter_drag_action1) (void);
|
||||
void (* _clutter_drag_action2) (void);
|
||||
void (* _clutter_drag_action3) (void);
|
||||
void (* _clutter_drag_action4) (void);
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_drag_action_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterAction * clutter_drag_action_new (void);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_drag_action_set_drag_threshold (ClutterDragAction *action,
|
||||
gint x_threshold,
|
||||
gint y_threshold);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_drag_action_get_drag_threshold (ClutterDragAction *action,
|
||||
guint *x_threshold,
|
||||
guint *y_threshold);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_drag_action_set_drag_handle (ClutterDragAction *action,
|
||||
ClutterActor *handle);
|
||||
CLUTTER_EXPORT
|
||||
ClutterActor * clutter_drag_action_get_drag_handle (ClutterDragAction *action);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_drag_action_set_drag_axis (ClutterDragAction *action,
|
||||
ClutterDragAxis axis);
|
||||
CLUTTER_EXPORT
|
||||
ClutterDragAxis clutter_drag_action_get_drag_axis (ClutterDragAction *action);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_drag_action_get_press_coords (ClutterDragAction *action,
|
||||
gfloat *press_x,
|
||||
gfloat *press_y);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_drag_action_get_motion_coords (ClutterDragAction *action,
|
||||
gfloat *motion_x,
|
||||
gfloat *motion_y);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_drag_action_get_drag_area (ClutterDragAction *action,
|
||||
ClutterRect *drag_area);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const ClutterRect *drag_area);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_DRAG_ACTION_H__ */
|
@ -1,531 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright © 2011 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author:
|
||||
* Emmanuele Bassi <ebassi@linux.intel.com>
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:clutter-drop-action
|
||||
* @Title: ClutterDropAction
|
||||
* @short_description: An action for drop targets
|
||||
*
|
||||
* #ClutterDropAction is a #ClutterAction that allows a #ClutterActor
|
||||
* implementation to control what happens when an actor dragged using
|
||||
* a #ClutterDragAction crosses the target area or when a dragged actor
|
||||
* is released (or "dropped") on the target area.
|
||||
*
|
||||
* A trivial use of #ClutterDropAction consists in connecting to the
|
||||
* #ClutterDropAction::drop signal and handling the drop from there,
|
||||
* for instance:
|
||||
*
|
||||
* |[<!-- language="C" -->
|
||||
* ClutterAction *action = clutter_drop_action ();
|
||||
*
|
||||
* g_signal_connect (action, "drop", G_CALLBACK (on_drop), NULL);
|
||||
* clutter_actor_add_action (an_actor, action);
|
||||
* ]|
|
||||
*
|
||||
* The #ClutterDropAction::can-drop can be used to control whether the
|
||||
* #ClutterDropAction::drop signal is going to be emitted; returning %FALSE
|
||||
* from a handler connected to the #ClutterDropAction::can-drop signal will
|
||||
* cause the #ClutterDropAction::drop signal to be skipped when the input
|
||||
* device button is released.
|
||||
*
|
||||
* It's important to note that #ClutterDropAction will only work with
|
||||
* actors dragged using #ClutterDragAction.
|
||||
*
|
||||
* See [drop-action.c](https://git.gnome.org/browse/clutter/tree/examples/drop-action.c?h=clutter-1.18)
|
||||
* for an example of how to use #ClutterDropAction.
|
||||
*
|
||||
* #ClutterDropAction is available since Clutter 1.8
|
||||
*/
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-drop-action.h"
|
||||
|
||||
#include "clutter-actor-meta-private.h"
|
||||
#include "clutter-actor-private.h"
|
||||
#include "clutter-drag-action.h"
|
||||
#include "clutter-main.h"
|
||||
#include "clutter-marshal.h"
|
||||
#include "clutter-stage-private.h"
|
||||
|
||||
struct _ClutterDropActionPrivate
|
||||
{
|
||||
ClutterActor *actor;
|
||||
ClutterActor *stage;
|
||||
|
||||
gulong mapped_id;
|
||||
};
|
||||
|
||||
typedef struct _DropTarget {
|
||||
ClutterActor *stage;
|
||||
|
||||
gulong capture_id;
|
||||
|
||||
GHashTable *actions;
|
||||
|
||||
ClutterDropAction *last_action;
|
||||
} DropTarget;
|
||||
|
||||
enum
|
||||
{
|
||||
CAN_DROP,
|
||||
OVER_IN,
|
||||
OVER_OUT,
|
||||
DROP,
|
||||
DROP_CANCEL,
|
||||
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static guint drop_signals[LAST_SIGNAL] = { 0, };
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (ClutterDropAction, clutter_drop_action, CLUTTER_TYPE_ACTION)
|
||||
|
||||
static void
|
||||
drop_target_free (gpointer _data)
|
||||
{
|
||||
DropTarget *data = _data;
|
||||
|
||||
g_signal_handler_disconnect (data->stage, data->capture_id);
|
||||
g_hash_table_destroy (data->actions);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
on_stage_capture (ClutterStage *stage,
|
||||
ClutterEvent *event,
|
||||
gpointer user_data)
|
||||
{
|
||||
DropTarget *data = user_data;
|
||||
gfloat event_x, event_y;
|
||||
ClutterActor *actor, *drag_actor;
|
||||
ClutterDropAction *drop_action;
|
||||
ClutterInputDevice *device;
|
||||
gboolean was_reactive;
|
||||
|
||||
switch (clutter_event_type (event))
|
||||
{
|
||||
case CLUTTER_MOTION:
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
if (clutter_event_type (event) == CLUTTER_MOTION &&
|
||||
!(clutter_event_get_state (event) & CLUTTER_BUTTON1_MASK))
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
|
||||
if (clutter_event_type (event) == CLUTTER_BUTTON_RELEASE &&
|
||||
clutter_event_get_button (event) != CLUTTER_BUTTON_PRIMARY)
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
|
||||
device = clutter_event_get_device (event);
|
||||
drag_actor = _clutter_stage_get_pointer_drag_actor (stage, device);
|
||||
if (drag_actor == NULL)
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCH_UPDATE:
|
||||
case CLUTTER_TOUCH_END:
|
||||
drag_actor = _clutter_stage_get_touch_drag_actor (stage,
|
||||
clutter_event_get_event_sequence (event));
|
||||
if (drag_actor == NULL)
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
break;
|
||||
|
||||
default:
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
}
|
||||
|
||||
clutter_event_get_coords (event, &event_x, &event_y);
|
||||
|
||||
/* get the actor under the cursor, excluding the dragged actor; we
|
||||
* use reactivity because it won't cause any scene invalidation
|
||||
*/
|
||||
was_reactive = clutter_actor_get_reactive (drag_actor);
|
||||
clutter_actor_set_reactive (drag_actor, FALSE);
|
||||
|
||||
actor = clutter_stage_get_actor_at_pos (stage, CLUTTER_PICK_REACTIVE,
|
||||
event_x,
|
||||
event_y);
|
||||
if (actor == NULL || actor == CLUTTER_ACTOR (stage))
|
||||
{
|
||||
if (data->last_action != NULL)
|
||||
{
|
||||
ClutterActorMeta *meta = CLUTTER_ACTOR_META (data->last_action);
|
||||
|
||||
g_signal_emit (data->last_action, drop_signals[OVER_OUT], 0,
|
||||
clutter_actor_meta_get_actor (meta));
|
||||
|
||||
data->last_action = NULL;
|
||||
}
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
drop_action = g_hash_table_lookup (data->actions, actor);
|
||||
|
||||
if (drop_action == NULL)
|
||||
{
|
||||
if (data->last_action != NULL)
|
||||
{
|
||||
ClutterActorMeta *meta = CLUTTER_ACTOR_META (data->last_action);
|
||||
|
||||
g_signal_emit (data->last_action, drop_signals[OVER_OUT], 0,
|
||||
clutter_actor_meta_get_actor (meta));
|
||||
|
||||
data->last_action = NULL;
|
||||
}
|
||||
|
||||
goto out;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (data->last_action != drop_action)
|
||||
{
|
||||
ClutterActorMeta *meta;
|
||||
|
||||
if (data->last_action != NULL)
|
||||
{
|
||||
meta = CLUTTER_ACTOR_META (data->last_action);
|
||||
|
||||
g_signal_emit (data->last_action, drop_signals[OVER_OUT], 0,
|
||||
clutter_actor_meta_get_actor (meta));
|
||||
}
|
||||
|
||||
meta = CLUTTER_ACTOR_META (drop_action);
|
||||
|
||||
g_signal_emit (drop_action, drop_signals[OVER_IN], 0,
|
||||
clutter_actor_meta_get_actor (meta));
|
||||
}
|
||||
|
||||
data->last_action = drop_action;
|
||||
}
|
||||
|
||||
out:
|
||||
if (clutter_event_type (event) == CLUTTER_BUTTON_RELEASE ||
|
||||
clutter_event_type (event) == CLUTTER_TOUCH_END)
|
||||
{
|
||||
if (data->last_action != NULL)
|
||||
{
|
||||
ClutterActorMeta *meta = CLUTTER_ACTOR_META (data->last_action);
|
||||
gboolean can_drop = FALSE;
|
||||
|
||||
g_signal_emit (data->last_action, drop_signals[CAN_DROP], 0,
|
||||
clutter_actor_meta_get_actor (meta),
|
||||
event_x, event_y,
|
||||
&can_drop);
|
||||
|
||||
if (can_drop)
|
||||
{
|
||||
g_signal_emit (data->last_action, drop_signals[DROP], 0,
|
||||
clutter_actor_meta_get_actor (meta),
|
||||
event_x, event_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_signal_emit (data->last_action, drop_signals[DROP_CANCEL], 0,
|
||||
clutter_actor_meta_get_actor (meta),
|
||||
event_x, event_y);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
data->last_action = NULL;
|
||||
}
|
||||
|
||||
if (drag_actor != NULL)
|
||||
clutter_actor_set_reactive (drag_actor, was_reactive);
|
||||
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
}
|
||||
|
||||
static void
|
||||
drop_action_register (ClutterDropAction *self)
|
||||
{
|
||||
ClutterDropActionPrivate *priv = self->priv;
|
||||
DropTarget *data;
|
||||
|
||||
g_assert (priv->stage != NULL);
|
||||
|
||||
data = g_object_get_data (G_OBJECT (priv->stage), "__clutter_drop_targets");
|
||||
if (data == NULL)
|
||||
{
|
||||
data = g_new0 (DropTarget, 1);
|
||||
|
||||
data->stage = priv->stage;
|
||||
data->actions = g_hash_table_new (NULL, NULL);
|
||||
data->capture_id = g_signal_connect (priv->stage, "captured-event",
|
||||
G_CALLBACK (on_stage_capture),
|
||||
data);
|
||||
g_object_set_data_full (G_OBJECT (priv->stage), "__clutter_drop_targets",
|
||||
data,
|
||||
drop_target_free);
|
||||
}
|
||||
|
||||
g_hash_table_replace (data->actions, priv->actor, self);
|
||||
}
|
||||
|
||||
static void
|
||||
drop_action_unregister (ClutterDropAction *self)
|
||||
{
|
||||
ClutterDropActionPrivate *priv = self->priv;
|
||||
DropTarget *data = NULL;
|
||||
|
||||
if (priv->stage != NULL)
|
||||
data = g_object_get_data (G_OBJECT (priv->stage), "__clutter_drop_targets");
|
||||
|
||||
if (data == NULL)
|
||||
return;
|
||||
|
||||
g_hash_table_remove (data->actions, priv->actor);
|
||||
if (g_hash_table_size (data->actions) == 0)
|
||||
g_object_set_data (G_OBJECT (data->stage), "__clutter_drop_targets", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
on_actor_mapped (ClutterActor *actor,
|
||||
GParamSpec *pspec,
|
||||
ClutterDropAction *self)
|
||||
{
|
||||
if (clutter_actor_is_mapped (actor))
|
||||
{
|
||||
if (self->priv->stage == NULL)
|
||||
self->priv->stage = clutter_actor_get_stage (actor);
|
||||
|
||||
drop_action_register (self);
|
||||
}
|
||||
else
|
||||
drop_action_unregister (self);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_drop_action_set_actor (ClutterActorMeta *meta,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
ClutterDropActionPrivate *priv = CLUTTER_DROP_ACTION (meta)->priv;
|
||||
|
||||
if (priv->actor != NULL)
|
||||
{
|
||||
drop_action_unregister (CLUTTER_DROP_ACTION (meta));
|
||||
|
||||
if (priv->mapped_id != 0)
|
||||
g_signal_handler_disconnect (priv->actor, priv->mapped_id);
|
||||
|
||||
priv->stage = NULL;
|
||||
priv->actor = NULL;
|
||||
priv->mapped_id = 0;
|
||||
}
|
||||
|
||||
priv->actor = actor;
|
||||
|
||||
if (priv->actor != NULL)
|
||||
{
|
||||
priv->stage = clutter_actor_get_stage (actor);
|
||||
priv->mapped_id = g_signal_connect (actor, "notify::mapped",
|
||||
G_CALLBACK (on_actor_mapped),
|
||||
meta);
|
||||
|
||||
if (priv->stage != NULL)
|
||||
drop_action_register (CLUTTER_DROP_ACTION (meta));
|
||||
}
|
||||
|
||||
CLUTTER_ACTOR_META_CLASS (clutter_drop_action_parent_class)->set_actor (meta, actor);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
signal_accumulator (GSignalInvocationHint *ihint,
|
||||
GValue *return_accu,
|
||||
const GValue *handler_return,
|
||||
gpointer user_data)
|
||||
{
|
||||
gboolean continue_emission;
|
||||
|
||||
continue_emission = g_value_get_boolean (handler_return);
|
||||
g_value_set_boolean (return_accu, continue_emission);
|
||||
|
||||
return continue_emission;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_drop_action_real_can_drop (ClutterDropAction *action,
|
||||
ClutterActor *actor,
|
||||
gfloat event_x,
|
||||
gfloat event_y)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_drop_action_class_init (ClutterDropActionClass *klass)
|
||||
{
|
||||
ClutterActorMetaClass *meta_class = CLUTTER_ACTOR_META_CLASS (klass);
|
||||
|
||||
meta_class->set_actor = clutter_drop_action_set_actor;
|
||||
|
||||
klass->can_drop = clutter_drop_action_real_can_drop;
|
||||
|
||||
/**
|
||||
* ClutterDropAction::can-drop:
|
||||
* @action: the #ClutterDropAction that emitted the signal
|
||||
* @actor: the #ClutterActor attached to the @action
|
||||
* @event_x: the X coordinate (in stage space) of the drop event
|
||||
* @event_y: the Y coordinate (in stage space) of the drop event
|
||||
*
|
||||
* The ::can-drop signal is emitted when the dragged actor is dropped
|
||||
* on @actor. The return value of the ::can-drop signal will determine
|
||||
* whether or not the #ClutterDropAction::drop signal is going to be
|
||||
* emitted on @action.
|
||||
*
|
||||
* The default implementation of #ClutterDropAction returns %TRUE for
|
||||
* this signal.
|
||||
*
|
||||
* Return value: %TRUE if the drop is accepted, and %FALSE otherwise
|
||||
*
|
||||
* Since: 1.8
|
||||
*/
|
||||
drop_signals[CAN_DROP] =
|
||||
g_signal_new (I_("can-drop"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterDropActionClass, can_drop),
|
||||
signal_accumulator, NULL,
|
||||
_clutter_marshal_BOOLEAN__OBJECT_FLOAT_FLOAT,
|
||||
G_TYPE_BOOLEAN, 3,
|
||||
CLUTTER_TYPE_ACTOR,
|
||||
G_TYPE_FLOAT,
|
||||
G_TYPE_FLOAT);
|
||||
|
||||
/**
|
||||
* ClutterDropAction::over-in:
|
||||
* @action: the #ClutterDropAction that emitted the signal
|
||||
* @actor: the #ClutterActor attached to the @action
|
||||
*
|
||||
* The ::over-in signal is emitted when the dragged actor crosses
|
||||
* into @actor.
|
||||
*
|
||||
* Since: 1.8
|
||||
*/
|
||||
drop_signals[OVER_IN] =
|
||||
g_signal_new (I_("over-in"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterDropActionClass, over_in),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
/**
|
||||
* ClutterDropAction::over-out:
|
||||
* @action: the #ClutterDropAction that emitted the signal
|
||||
* @actor: the #ClutterActor attached to the @action
|
||||
*
|
||||
* The ::over-out signal is emitted when the dragged actor crosses
|
||||
* outside @actor.
|
||||
*
|
||||
* Since: 1.8
|
||||
*/
|
||||
drop_signals[OVER_OUT] =
|
||||
g_signal_new (I_("over-out"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterDropActionClass, over_out),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
/**
|
||||
* ClutterDropAction::drop:
|
||||
* @action: the #ClutterDropAction that emitted the signal
|
||||
* @actor: the #ClutterActor attached to the @action
|
||||
* @event_x: the X coordinate (in stage space) of the drop event
|
||||
* @event_y: the Y coordinate (in stage space) of the drop event
|
||||
*
|
||||
* The ::drop signal is emitted when the dragged actor is dropped
|
||||
* on @actor. This signal is only emitted if at least an handler of
|
||||
* #ClutterDropAction::can-drop returns %TRUE.
|
||||
*
|
||||
* Since: 1.8
|
||||
*/
|
||||
drop_signals[DROP] =
|
||||
g_signal_new (I_("drop"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterDropActionClass, drop),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT_FLOAT_FLOAT,
|
||||
G_TYPE_NONE, 3,
|
||||
CLUTTER_TYPE_ACTOR,
|
||||
G_TYPE_FLOAT,
|
||||
G_TYPE_FLOAT);
|
||||
|
||||
|
||||
/**
|
||||
* ClutterDropAction::drop-cancel:
|
||||
* @action: the #ClutterDropAction that emitted the signal
|
||||
* @actor: the #ClutterActor attached to the @action
|
||||
* @event_x: the X coordinate (in stage space) of the drop event
|
||||
* @event_y: the Y coordinate (in stage space) of the drop event
|
||||
*
|
||||
* The ::drop-cancel signal is emitted when the drop is refused
|
||||
* by an emission of the #ClutterDropAction::can-drop signal.
|
||||
*
|
||||
* After the ::drop-cancel signal is fired the active drag is
|
||||
* terminated.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
drop_signals[DROP_CANCEL] =
|
||||
g_signal_new (I_("drop-cancel"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterDropActionClass, drop),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT_FLOAT_FLOAT,
|
||||
G_TYPE_NONE, 3,
|
||||
CLUTTER_TYPE_ACTOR,
|
||||
G_TYPE_FLOAT,
|
||||
G_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_drop_action_init (ClutterDropAction *self)
|
||||
{
|
||||
self->priv = clutter_drop_action_get_instance_private (self);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_drop_action_new:
|
||||
*
|
||||
* Creates a new #ClutterDropAction.
|
||||
*
|
||||
* Use clutter_actor_add_action() to add the action to a #ClutterActor.
|
||||
*
|
||||
* Return value: the newly created #ClutterDropAction
|
||||
*
|
||||
* Since: 1.8
|
||||
*/
|
||||
ClutterAction *
|
||||
clutter_drop_action_new (void)
|
||||
{
|
||||
return g_object_new (CLUTTER_TYPE_DROP_ACTION, NULL);
|
||||
}
|
@ -1,115 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright © 2011 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author:
|
||||
* Emmanuele Bassi <ebassi@linux.intel.com>
|
||||
*/
|
||||
|
||||
#ifndef __CLUTTER_DROP_ACTION_H__
|
||||
#define __CLUTTER_DROP_ACTION_H__
|
||||
|
||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <clutter/clutter.h> can be directly included."
|
||||
#endif
|
||||
|
||||
#include <clutter/clutter-action.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_DROP_ACTION (clutter_drop_action_get_type ())
|
||||
#define CLUTTER_DROP_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_DROP_ACTION, ClutterDropAction))
|
||||
#define CLUTTER_IS_DROP_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_DROP_ACTION))
|
||||
#define CLUTTER_DROP_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_DROP_ACTION, ClutterDropActionClass))
|
||||
#define CLUTTER_IS_DROP_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_DROP_ACTION))
|
||||
#define CLUTTER_DROP_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_DROP_ACTION, ClutterDropActionClass))
|
||||
|
||||
typedef struct _ClutterDropAction ClutterDropAction;
|
||||
typedef struct _ClutterDropActionPrivate ClutterDropActionPrivate;
|
||||
typedef struct _ClutterDropActionClass ClutterDropActionClass;
|
||||
|
||||
/**
|
||||
* ClutterDropAction:
|
||||
*
|
||||
* The #ClutterDropAction structure contains only
|
||||
* private data and should be accessed using the provided API.
|
||||
*
|
||||
* Since: 1.8
|
||||
*/
|
||||
struct _ClutterDropAction
|
||||
{
|
||||
/*< private >*/
|
||||
ClutterAction parent_instance;
|
||||
|
||||
ClutterDropActionPrivate *priv;
|
||||
};
|
||||
|
||||
/**
|
||||
* ClutterDropActionClass:
|
||||
* @can_drop: class handler for the #ClutterDropAction::can-drop signal
|
||||
* @over_in: class handler for the #ClutterDropAction::over-in signal
|
||||
* @over_out: class handler for the #ClutterDropAction::over-out signal
|
||||
* @drop: class handler for the #ClutterDropAction::drop signal
|
||||
*
|
||||
* The #ClutterDropActionClass structure contains
|
||||
* only private data.
|
||||
*
|
||||
* Since: 1.8
|
||||
*/
|
||||
struct _ClutterDropActionClass
|
||||
{
|
||||
/*< private >*/
|
||||
ClutterActionClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
gboolean (* can_drop) (ClutterDropAction *action,
|
||||
ClutterActor *actor,
|
||||
gfloat event_x,
|
||||
gfloat event_y);
|
||||
|
||||
void (* over_in) (ClutterDropAction *action,
|
||||
ClutterActor *actor);
|
||||
void (* over_out) (ClutterDropAction *action,
|
||||
ClutterActor *actor);
|
||||
|
||||
void (* drop) (ClutterDropAction *action,
|
||||
ClutterActor *actor,
|
||||
gfloat event_x,
|
||||
gfloat event_y);
|
||||
|
||||
/*< private >*/
|
||||
void (*_clutter_drop_action1) (void);
|
||||
void (*_clutter_drop_action2) (void);
|
||||
void (*_clutter_drop_action3) (void);
|
||||
void (*_clutter_drop_action4) (void);
|
||||
void (*_clutter_drop_action5) (void);
|
||||
void (*_clutter_drop_action6) (void);
|
||||
void (*_clutter_drop_action7) (void);
|
||||
void (*_clutter_drop_action8) (void);
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_drop_action_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterAction * clutter_drop_action_new (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_DROP_ACTION_H__ */
|
@ -5,15 +5,18 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
gboolean _clutter_effect_pre_paint (ClutterEffect *effect);
|
||||
void _clutter_effect_post_paint (ClutterEffect *effect);
|
||||
gboolean _clutter_effect_get_paint_volume (ClutterEffect *effect,
|
||||
gboolean _clutter_effect_pre_paint (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context);
|
||||
void _clutter_effect_post_paint (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context);
|
||||
gboolean _clutter_effect_modify_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume);
|
||||
gboolean _clutter_effect_has_custom_paint_volume (ClutterEffect *effect);
|
||||
void _clutter_effect_paint (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context,
|
||||
ClutterEffectPaintFlags flags);
|
||||
void _clutter_effect_pick (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags);
|
||||
ClutterPickContext *pick_context);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -100,13 +100,13 @@
|
||||
* // Clear the previous state //
|
||||
* if (self->rect_1)
|
||||
* {
|
||||
* cogl_handle_unref (self->rect_1);
|
||||
* cogl_object_unref (self->rect_1);
|
||||
* self->rect_1 = NULL;
|
||||
* }
|
||||
*
|
||||
* if (self->rect_2)
|
||||
* {
|
||||
* cogl_handle_unref (self->rect_2);
|
||||
* cogl_object_unref (self->rect_2);
|
||||
* self->rect_2 = NULL;
|
||||
* }
|
||||
*
|
||||
@ -177,25 +177,28 @@ G_DEFINE_ABSTRACT_TYPE (ClutterEffect,
|
||||
CLUTTER_TYPE_ACTOR_META);
|
||||
|
||||
static gboolean
|
||||
clutter_effect_real_pre_paint (ClutterEffect *effect)
|
||||
clutter_effect_real_pre_paint (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_effect_real_post_paint (ClutterEffect *effect)
|
||||
clutter_effect_real_post_paint (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_effect_real_get_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
clutter_effect_real_modify_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_effect_real_paint (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context,
|
||||
ClutterEffectPaintFlags flags)
|
||||
{
|
||||
ClutterActorMeta *actor_meta = CLUTTER_ACTOR_META (effect);
|
||||
@ -206,53 +209,51 @@ clutter_effect_real_paint (ClutterEffect *effect,
|
||||
effects that haven't migrated to use the 'paint' virtual yet. This
|
||||
just calls the old pre and post virtuals before chaining on */
|
||||
|
||||
pre_paint_succeeded = _clutter_effect_pre_paint (effect);
|
||||
pre_paint_succeeded = _clutter_effect_pre_paint (effect, paint_context);
|
||||
|
||||
actor = clutter_actor_meta_get_actor (actor_meta);
|
||||
clutter_actor_continue_paint (actor);
|
||||
clutter_actor_continue_paint (actor, paint_context);
|
||||
|
||||
if (pre_paint_succeeded)
|
||||
_clutter_effect_post_paint (effect);
|
||||
_clutter_effect_post_paint (effect, paint_context);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_effect_real_pick (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags)
|
||||
clutter_effect_real_pick (ClutterEffect *effect,
|
||||
ClutterPickContext *pick_context)
|
||||
{
|
||||
ClutterActorMeta *actor_meta = CLUTTER_ACTOR_META (effect);
|
||||
ClutterActor *actor;
|
||||
|
||||
actor = clutter_actor_meta_get_actor (actor_meta);
|
||||
clutter_actor_continue_paint (actor);
|
||||
clutter_actor_continue_pick (actor, pick_context);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_effect_notify (GObject *gobject,
|
||||
GParamSpec *pspec)
|
||||
clutter_effect_set_enabled (ClutterActorMeta *meta,
|
||||
gboolean is_enabled)
|
||||
{
|
||||
if (strcmp (pspec->name, "enabled") == 0)
|
||||
{
|
||||
ClutterActorMeta *meta = CLUTTER_ACTOR_META (gobject);
|
||||
ClutterActor *actor = clutter_actor_meta_get_actor (meta);
|
||||
ClutterActorMetaClass *parent_class =
|
||||
CLUTTER_ACTOR_META_CLASS (clutter_effect_parent_class);
|
||||
ClutterActor *actor;
|
||||
|
||||
if (actor != NULL)
|
||||
clutter_actor_queue_redraw (actor);
|
||||
}
|
||||
actor = clutter_actor_meta_get_actor (meta);
|
||||
if (actor)
|
||||
clutter_actor_queue_redraw (actor);
|
||||
|
||||
if (G_OBJECT_CLASS (clutter_effect_parent_class)->notify != NULL)
|
||||
G_OBJECT_CLASS (clutter_effect_parent_class)->notify (gobject, pspec);
|
||||
parent_class->set_enabled (meta, is_enabled);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_effect_class_init (ClutterEffectClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
ClutterActorMetaClass *actor_meta_class = CLUTTER_ACTOR_META_CLASS (klass);
|
||||
|
||||
gobject_class->notify = clutter_effect_notify;
|
||||
actor_meta_class->set_enabled = clutter_effect_set_enabled;
|
||||
|
||||
klass->pre_paint = clutter_effect_real_pre_paint;
|
||||
klass->post_paint = clutter_effect_real_post_paint;
|
||||
klass->get_paint_volume = clutter_effect_real_get_paint_volume;
|
||||
klass->modify_paint_volume = clutter_effect_real_modify_paint_volume;
|
||||
klass->paint = clutter_effect_real_paint;
|
||||
klass->pick = clutter_effect_real_pick;
|
||||
}
|
||||
@ -263,47 +264,51 @@ clutter_effect_init (ClutterEffect *self)
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_effect_pre_paint (ClutterEffect *effect)
|
||||
_clutter_effect_pre_paint (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_EFFECT (effect), FALSE);
|
||||
|
||||
return CLUTTER_EFFECT_GET_CLASS (effect)->pre_paint (effect);
|
||||
return CLUTTER_EFFECT_GET_CLASS (effect)->pre_paint (effect, paint_context);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_effect_post_paint (ClutterEffect *effect)
|
||||
_clutter_effect_post_paint (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_EFFECT (effect));
|
||||
|
||||
CLUTTER_EFFECT_GET_CLASS (effect)->post_paint (effect);
|
||||
CLUTTER_EFFECT_GET_CLASS (effect)->post_paint (effect, paint_context);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_effect_paint (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context,
|
||||
ClutterEffectPaintFlags flags)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_EFFECT (effect));
|
||||
|
||||
CLUTTER_EFFECT_GET_CLASS (effect)->paint (effect, flags);
|
||||
CLUTTER_EFFECT_GET_CLASS (effect)->paint (effect, paint_context, flags);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_effect_pick (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags)
|
||||
_clutter_effect_pick (ClutterEffect *effect,
|
||||
ClutterPickContext *pick_context)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_EFFECT (effect));
|
||||
|
||||
CLUTTER_EFFECT_GET_CLASS (effect)->pick (effect, flags);
|
||||
CLUTTER_EFFECT_GET_CLASS (effect)->pick (effect, pick_context);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_effect_get_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
_clutter_effect_modify_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_EFFECT (effect), FALSE);
|
||||
g_return_val_if_fail (volume != NULL, FALSE);
|
||||
|
||||
return CLUTTER_EFFECT_GET_CLASS (effect)->get_paint_volume (effect, volume);
|
||||
return CLUTTER_EFFECT_GET_CLASS (effect)->modify_paint_volume (effect,
|
||||
volume);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@ -311,7 +316,7 @@ _clutter_effect_has_custom_paint_volume (ClutterEffect *effect)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_EFFECT (effect), FALSE);
|
||||
|
||||
return CLUTTER_EFFECT_GET_CLASS (effect)->get_paint_volume != clutter_effect_real_get_paint_volume;
|
||||
return CLUTTER_EFFECT_GET_CLASS (effect)->modify_paint_volume != clutter_effect_real_modify_paint_volume;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -30,6 +30,8 @@
|
||||
#endif
|
||||
|
||||
#include <clutter/clutter-actor-meta.h>
|
||||
#include <clutter/clutter-paint-context.h>
|
||||
#include <clutter/clutter-pick-context.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@ -60,7 +62,7 @@ struct _ClutterEffect
|
||||
* ClutterEffectClass:
|
||||
* @pre_paint: virtual function
|
||||
* @post_paint: virtual function
|
||||
* @get_paint_volume: virtual function
|
||||
* @modify_paint_volume: virtual function
|
||||
* @paint: virtual function
|
||||
* @pick: virtual function
|
||||
*
|
||||
@ -74,16 +76,19 @@ struct _ClutterEffectClass
|
||||
ClutterActorMetaClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
gboolean (* pre_paint) (ClutterEffect *effect);
|
||||
void (* post_paint) (ClutterEffect *effect);
|
||||
gboolean (* pre_paint) (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context);
|
||||
void (* post_paint) (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context);
|
||||
|
||||
gboolean (* get_paint_volume) (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume);
|
||||
gboolean (* modify_paint_volume) (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume);
|
||||
|
||||
void (* paint) (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags);
|
||||
void (* pick) (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags);
|
||||
void (* paint) (ClutterEffect *effect,
|
||||
ClutterPaintContext *paint_context,
|
||||
ClutterEffectPaintFlags flags);
|
||||
void (* pick) (ClutterEffect *effect,
|
||||
ClutterPickContext *pick_context);
|
||||
|
||||
/*< private >*/
|
||||
void (* _clutter_effect4) (void);
|
||||
|
@ -13,7 +13,7 @@ G_BEGIN_DECLS
|
||||
/*** END file-header ***/
|
||||
|
||||
/*** BEGIN file-production ***/
|
||||
/* enumerations from "@filename@" */
|
||||
/* enumerations from "@basename@" */
|
||||
/*** END file-production ***/
|
||||
|
||||
/*** BEGIN value-header ***/
|
||||
|
@ -190,7 +190,7 @@ typedef enum /*< prefix=CLUTTER_REQUEST >*/
|
||||
* @CLUTTER_ANIMATION_LAST: last animation mode, used as a guard for
|
||||
* registered global alpha functions
|
||||
*
|
||||
* The animation modes used by #ClutterAlpha and #ClutterAnimation. This
|
||||
* The animation modes used by #ClutterAnimatable. This
|
||||
* enumeration can be expanded in later versions of Clutter.
|
||||
*
|
||||
* <figure id="easing-modes">
|
||||
@ -277,24 +277,6 @@ typedef enum
|
||||
CLUTTER_ANIMATION_LAST
|
||||
} ClutterAnimationMode;
|
||||
|
||||
/**
|
||||
* ClutterFontFlags:
|
||||
* @CLUTTER_FONT_MIPMAPPING: Set to use mipmaps for the glyph cache textures.
|
||||
* @CLUTTER_FONT_HINTING: Set to enable hinting on the glyphs.
|
||||
*
|
||||
* Runtime flags to change the font quality. To be used with
|
||||
* clutter_set_font_flags().
|
||||
*
|
||||
* Since: 1.0
|
||||
*
|
||||
* Deprecated: 1.22: Use #cairo_font_options_t instead
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_FONT >*/
|
||||
{
|
||||
CLUTTER_FONT_MIPMAPPING = (1 << 0),
|
||||
CLUTTER_FONT_HINTING = (1 << 1)
|
||||
} ClutterFontFlags;
|
||||
|
||||
/**
|
||||
* ClutterTextDirection:
|
||||
* @CLUTTER_TEXT_DIRECTION_DEFAULT: Use the default setting, as returned
|
||||
@ -443,6 +425,88 @@ typedef enum
|
||||
CLUTTER_A11Y_FEATURE_STATE_CHANGE_BEEP = 1 << 13,
|
||||
} ClutterKeyboardA11yFlags;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11yFlags:
|
||||
* @CLUTTER_A11Y_POINTER_ENABLED:
|
||||
* @CLUTTER_A11Y_SECONDARY_CLICK_ENABLED:
|
||||
* @CLUTTER_A11Y_DWELL_ENABLED:
|
||||
*
|
||||
* Pointer accessibility features applied to a ClutterInputDevice pointer.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_SECONDARY_CLICK_ENABLED = 1 << 0,
|
||||
CLUTTER_A11Y_DWELL_ENABLED = 1 << 1,
|
||||
} ClutterPointerA11yFlags;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11yDwellClickType:
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE: Internal use only
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY:
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY:
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE:
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE:
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG:
|
||||
*
|
||||
* Dwell click types.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE,
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY,
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY,
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE,
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE,
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG,
|
||||
} ClutterPointerA11yDwellClickType;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11yDwellDirection:
|
||||
* @CLUTTER_A11Y_DWELL_DIRECTION_NONE:
|
||||
* @CLUTTER_A11Y_DWELL_DIRECTION_LEFT:
|
||||
* @CLUTTER_A11Y_DWELL_DIRECTION_RIGHT:
|
||||
* @CLUTTER_A11Y_DWELL_DIRECTION_UP:
|
||||
* @CLUTTER_A11Y_DWELL_DIRECTION_DOWN:
|
||||
*
|
||||
* Dwell gesture directions.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_DWELL_DIRECTION_NONE,
|
||||
CLUTTER_A11Y_DWELL_DIRECTION_LEFT,
|
||||
CLUTTER_A11Y_DWELL_DIRECTION_RIGHT,
|
||||
CLUTTER_A11Y_DWELL_DIRECTION_UP,
|
||||
CLUTTER_A11Y_DWELL_DIRECTION_DOWN,
|
||||
} ClutterPointerA11yDwellDirection;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11yDwellMode:
|
||||
* @CLUTTER_A11Y_DWELL_MODE_WINDOW:
|
||||
* @CLUTTER_A11Y_DWELL_MODE_GESTURE:
|
||||
*
|
||||
* Dwell mode.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_DWELL_MODE_WINDOW,
|
||||
CLUTTER_A11Y_DWELL_MODE_GESTURE,
|
||||
} ClutterPointerA11yDwellMode;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11yTimeoutType:
|
||||
* @CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK:
|
||||
* @CLUTTER_A11Y_TIMEOUT_TYPE_DWELL:
|
||||
* @CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE:
|
||||
*
|
||||
* Pointer accessibility timeout type.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
||||
} ClutterPointerA11yTimeoutType;
|
||||
|
||||
/**
|
||||
* ClutterActorFlags:
|
||||
* @CLUTTER_ACTOR_MAPPED: the actor will be painted (is visible, and inside
|
||||
@ -471,9 +535,13 @@ typedef enum /*< prefix=CLUTTER_ACTOR >*/
|
||||
* ClutterOffscreenRedirect:
|
||||
* @CLUTTER_OFFSCREEN_REDIRECT_AUTOMATIC_FOR_OPACITY: Only redirect
|
||||
* the actor if it is semi-transparent and its has_overlaps()
|
||||
* virtual returns %TRUE. This is the default.
|
||||
* virtual returns %TRUE.
|
||||
* @CLUTTER_OFFSCREEN_REDIRECT_ALWAYS: Always redirect the actor to an
|
||||
* offscreen buffer even if it is fully opaque.
|
||||
* @CLUTTER_OFFSCREEN_REDIRECT_ON_IDLE: Only redirect the actor if it is the
|
||||
* most efficient thing to do based on its recent repaint behaviour. That
|
||||
* means when its contents are changing less frequently than it's being used
|
||||
* on stage.
|
||||
*
|
||||
* Possible flags to pass to clutter_actor_set_offscreen_redirect().
|
||||
*
|
||||
@ -481,36 +549,11 @@ typedef enum /*< prefix=CLUTTER_ACTOR >*/
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_OFFSCREEN_REDIRECT >*/
|
||||
{
|
||||
CLUTTER_OFFSCREEN_REDIRECT_AUTOMATIC_FOR_OPACITY = 1<<0,
|
||||
CLUTTER_OFFSCREEN_REDIRECT_ALWAYS = 1<<1
|
||||
CLUTTER_OFFSCREEN_REDIRECT_AUTOMATIC_FOR_OPACITY = 1 << 0,
|
||||
CLUTTER_OFFSCREEN_REDIRECT_ALWAYS = 1 << 1,
|
||||
CLUTTER_OFFSCREEN_REDIRECT_ON_IDLE = 1 << 2
|
||||
} ClutterOffscreenRedirect;
|
||||
|
||||
/**
|
||||
* ClutterAllocationFlags:
|
||||
* @CLUTTER_ALLOCATION_NONE: No flag set
|
||||
* @CLUTTER_ABSOLUTE_ORIGIN_CHANGED: Whether the absolute origin of the
|
||||
* actor has changed; this implies that any ancestor of the actor has
|
||||
* been moved.
|
||||
* @CLUTTER_DELEGATE_LAYOUT: Whether the allocation should be delegated
|
||||
* to the #ClutterLayoutManager instance stored inside the
|
||||
* #ClutterActor:layout-manager property of #ClutterActor. This flag
|
||||
* should only be used if you are subclassing #ClutterActor and
|
||||
* overriding the #ClutterActorClass.allocate() virtual function, but
|
||||
* you wish to use the default implementation of the virtual function
|
||||
* inside #ClutterActor. Added in Clutter 1.10.
|
||||
*
|
||||
* Flags passed to the #ClutterActorClass.allocate() virtual function
|
||||
* and to the clutter_actor_allocate() function.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_ALLOCATION_NONE = 0,
|
||||
CLUTTER_ABSOLUTE_ORIGIN_CHANGED = 1 << 1,
|
||||
CLUTTER_DELEGATE_LAYOUT = 1 << 2
|
||||
} ClutterAllocationFlags;
|
||||
|
||||
/**
|
||||
* ClutterAlignAxis:
|
||||
* @CLUTTER_ALIGN_X_AXIS: Maintain the alignment on the X axis
|
||||
@ -609,12 +652,15 @@ typedef enum /*< prefix=CLUTTER_BIND >*/
|
||||
* has queued a redraw before this paint. This implies that the effect
|
||||
* should call clutter_actor_continue_paint() to chain to the next
|
||||
* effect and can not cache any results from a previous paint.
|
||||
* @CLUTTER_EFFECT_PAINT_BYPASS_EFFECT: The effect should not be used
|
||||
* on this frame, but it will be asked to paint the actor still.
|
||||
*
|
||||
* Flags passed to the ‘paint’ or ‘pick’ method of #ClutterEffect.
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_EFFECT_PAINT >*/
|
||||
{
|
||||
CLUTTER_EFFECT_PAINT_ACTOR_DIRTY = (1 << 0)
|
||||
CLUTTER_EFFECT_PAINT_ACTOR_DIRTY = (1 << 0),
|
||||
CLUTTER_EFFECT_PAINT_BYPASS_EFFECT = (1 << 1)
|
||||
} ClutterEffectPaintFlags;
|
||||
|
||||
/**
|
||||
@ -892,8 +938,6 @@ typedef enum /*< prefix=CLUTTER_SCROLL >*/
|
||||
|
||||
/**
|
||||
* ClutterStageState:
|
||||
* @CLUTTER_STAGE_STATE_FULLSCREEN: Fullscreen mask
|
||||
* @CLUTTER_STAGE_STATE_OFFSCREEN: Offscreen mask (deprecated)
|
||||
* @CLUTTER_STAGE_STATE_ACTIVATED: Activated mask
|
||||
*
|
||||
* Stage state masks, used by the #ClutterEvent of type %CLUTTER_STAGE_STATE.
|
||||
@ -902,18 +946,13 @@ typedef enum /*< prefix=CLUTTER_SCROLL >*/
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_STAGE_STATE_FULLSCREEN = (1 << 1),
|
||||
CLUTTER_STAGE_STATE_OFFSCREEN = (1 << 2),
|
||||
CLUTTER_STAGE_STATE_ACTIVATED = (1 << 3)
|
||||
} ClutterStageState;
|
||||
|
||||
/**
|
||||
* ClutterFeatureFlags:
|
||||
* @CLUTTER_FEATURE_SWAP_THROTTLE: Set if backend throttles buffer swaps.
|
||||
* @CLUTTER_FEATURE_TEXTURE_YUV: Set if YUV based textures supported.
|
||||
* @CLUTTER_FEATURE_TEXTURE_READ_PIXELS: Set if texture pixels can be read.
|
||||
* @CLUTTER_FEATURE_STAGE_STATIC: Set if stage size if fixed (i.e framebuffer)
|
||||
* @CLUTTER_FEATURE_STAGE_USER_RESIZE: Set if stage is able to be user resized.
|
||||
* @CLUTTER_FEATURE_STAGE_CURSOR: Set if stage has a graphical cursor.
|
||||
* @CLUTTER_FEATURE_SHADERS_GLSL: Set if the backend supports GLSL shaders.
|
||||
* @CLUTTER_FEATURE_OFFSCREEN: Set if the backend supports offscreen rendering.
|
||||
@ -928,10 +967,7 @@ typedef enum
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_FEATURE_SWAP_THROTTLE = (1 << 3),
|
||||
CLUTTER_FEATURE_TEXTURE_YUV = (1 << 4),
|
||||
CLUTTER_FEATURE_TEXTURE_READ_PIXELS = (1 << 5),
|
||||
CLUTTER_FEATURE_STAGE_STATIC = (1 << 6),
|
||||
CLUTTER_FEATURE_STAGE_USER_RESIZE = (1 << 7),
|
||||
CLUTTER_FEATURE_STAGE_CURSOR = (1 << 8),
|
||||
CLUTTER_FEATURE_SHADERS_GLSL = (1 << 9),
|
||||
CLUTTER_FEATURE_OFFSCREEN = (1 << 10),
|
||||
@ -1129,29 +1165,6 @@ typedef enum /*< prefix=CLUTTER_PAN >*/
|
||||
CLUTTER_PAN_AXIS_AUTO
|
||||
} ClutterPanAxis;
|
||||
|
||||
|
||||
/**
|
||||
* ClutterTableAlignment:
|
||||
* @CLUTTER_TABLE_ALIGNMENT_START: Align the child to the top or to the
|
||||
* left of a cell in the table, depending on the axis
|
||||
* @CLUTTER_TABLE_ALIGNMENT_CENTER: Align the child to the center of
|
||||
* a cell in the table
|
||||
* @CLUTTER_TABLE_ALIGNMENT_END: Align the child to the bottom or to the
|
||||
* right of a cell in the table, depending on the axis
|
||||
*
|
||||
* The alignment policies available on each axis of the #ClutterTableLayout
|
||||
*
|
||||
* Since: 1.4
|
||||
*
|
||||
* Deprecated: 1.22: Use the alignment properties of #ClutterActor
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_TABLE_ALIGNMENT_START,
|
||||
CLUTTER_TABLE_ALIGNMENT_CENTER,
|
||||
CLUTTER_TABLE_ALIGNMENT_END
|
||||
} ClutterTableAlignment;
|
||||
|
||||
/**
|
||||
* ClutterTextureFlags:
|
||||
* @CLUTTER_TEXTURE_NONE: No flags
|
||||
@ -1159,8 +1172,7 @@ typedef enum
|
||||
* @CLUTTER_TEXTURE_RGB_FLAG_PREMULT: Unused flag
|
||||
* @CLUTTER_TEXTURE_YUV_FLAG_YUV2: Unused flag
|
||||
*
|
||||
* Flags for clutter_texture_set_from_rgb_data() and
|
||||
* clutter_texture_set_from_yuv_data().
|
||||
* Flags for clutter_texture_set_from_rgb_data().
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
|
@ -5,22 +5,28 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_event_set_pointer_emulated (ClutterEvent *event,
|
||||
gboolean is_emulated);
|
||||
|
||||
/* Reinjecting queued events for processing */
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_process_event (ClutterEvent *event);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_event_process_filters (ClutterEvent *event);
|
||||
|
||||
/* clears the event queue inside the main context */
|
||||
void _clutter_clear_events_queue (void);
|
||||
void _clutter_clear_events_queue_for_stage (ClutterStage *stage);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_event_set_platform_data (ClutterEvent *event,
|
||||
gpointer data);
|
||||
CLUTTER_EXPORT
|
||||
gpointer _clutter_event_get_platform_data (const ClutterEvent *event);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_event_set_state_full (ClutterEvent *event,
|
||||
ClutterModifierType button_state,
|
||||
ClutterModifierType base_state,
|
||||
@ -28,6 +34,7 @@ void _clutter_event_set_state_full (ClutterEvent *ev
|
||||
ClutterModifierType locked_state,
|
||||
ClutterModifierType effective_state);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_event_push (const ClutterEvent *event,
|
||||
gboolean do_copy);
|
||||
|
||||
|
@ -1,38 +0,0 @@
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-event-translator.h"
|
||||
|
||||
#include "clutter-backend.h"
|
||||
#include "clutter-private.h"
|
||||
|
||||
#define clutter_event_translator_get_type _clutter_event_translator_get_type
|
||||
|
||||
typedef ClutterEventTranslatorIface ClutterEventTranslatorInterface;
|
||||
|
||||
G_DEFINE_INTERFACE (ClutterEventTranslator, clutter_event_translator, G_TYPE_OBJECT);
|
||||
|
||||
static ClutterTranslateReturn
|
||||
default_translate_event (ClutterEventTranslator *translator,
|
||||
gpointer native,
|
||||
ClutterEvent *event)
|
||||
{
|
||||
return CLUTTER_TRANSLATE_CONTINUE;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_event_translator_default_init (ClutterEventTranslatorIface *iface)
|
||||
{
|
||||
iface->translate_event = default_translate_event;
|
||||
}
|
||||
|
||||
ClutterTranslateReturn
|
||||
_clutter_event_translator_translate_event (ClutterEventTranslator *translator,
|
||||
gpointer native,
|
||||
ClutterEvent *translated)
|
||||
{
|
||||
ClutterEventTranslatorIface *iface;
|
||||
|
||||
iface = CLUTTER_EVENT_TRANSLATOR_GET_IFACE (translator);
|
||||
|
||||
return iface->translate_event (translator, native, translated);
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
#ifndef __CLUTTER_EVENT_TRANSLATOR_H__
|
||||
#define __CLUTTER_EVENT_TRANSLATOR_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <clutter/clutter-event.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_EVENT_TRANSLATOR (_clutter_event_translator_get_type ())
|
||||
#define CLUTTER_EVENT_TRANSLATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_EVENT_TRANSLATOR, ClutterEventTranslator))
|
||||
#define CLUTTER_IS_EVENT_TRANSLATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_EVENT_TRANSLATOR))
|
||||
#define CLUTTER_EVENT_TRANSLATOR_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_EVENT_TRANSLATOR, ClutterEventTranslatorIface))
|
||||
|
||||
typedef struct _ClutterEventTranslator ClutterEventTranslator;
|
||||
typedef struct _ClutterEventTranslatorIface ClutterEventTranslatorIface;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_TRANSLATE_CONTINUE,
|
||||
CLUTTER_TRANSLATE_REMOVE,
|
||||
CLUTTER_TRANSLATE_QUEUE
|
||||
} ClutterTranslateReturn;
|
||||
|
||||
struct _ClutterEventTranslatorIface
|
||||
{
|
||||
GTypeInterface g_iface;
|
||||
|
||||
ClutterTranslateReturn (* translate_event) (ClutterEventTranslator *translator,
|
||||
gpointer native,
|
||||
ClutterEvent *translated);
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType _clutter_event_translator_get_type (void) G_GNUC_CONST;
|
||||
|
||||
ClutterTranslateReturn _clutter_event_translator_translate_event (ClutterEventTranslator *translator,
|
||||
gpointer native,
|
||||
ClutterEvent *translated);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_EVENT_TRANSLATOR_H__ */
|
@ -370,7 +370,7 @@ clutter_event_get_coords (const ClutterEvent *event,
|
||||
gfloat *x,
|
||||
gfloat *y)
|
||||
{
|
||||
ClutterPoint coords;
|
||||
graphene_point_t coords;
|
||||
|
||||
g_return_if_fail (event != NULL);
|
||||
|
||||
@ -386,15 +386,15 @@ clutter_event_get_coords (const ClutterEvent *event,
|
||||
/**
|
||||
* clutter_event_get_position:
|
||||
* @event: a #ClutterEvent
|
||||
* @position: a #ClutterPoint
|
||||
* @position: a #graphene_point_t
|
||||
*
|
||||
* Retrieves the event coordinates as a #ClutterPoint.
|
||||
* Retrieves the event coordinates as a #graphene_point_t.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
void
|
||||
clutter_event_get_position (const ClutterEvent *event,
|
||||
ClutterPoint *position)
|
||||
graphene_point_t *position)
|
||||
{
|
||||
g_return_if_fail (event != NULL);
|
||||
g_return_if_fail (position != NULL);
|
||||
@ -415,42 +415,42 @@ clutter_event_get_position (const ClutterEvent *event,
|
||||
case CLUTTER_PAD_BUTTON_RELEASE:
|
||||
case CLUTTER_PAD_STRIP:
|
||||
case CLUTTER_PAD_RING:
|
||||
clutter_point_init (position, 0.f, 0.f);
|
||||
graphene_point_init (position, 0.f, 0.f);
|
||||
break;
|
||||
|
||||
case CLUTTER_ENTER:
|
||||
case CLUTTER_LEAVE:
|
||||
clutter_point_init (position, event->crossing.x, event->crossing.y);
|
||||
graphene_point_init (position, event->crossing.x, event->crossing.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
clutter_point_init (position, event->button.x, event->button.y);
|
||||
graphene_point_init (position, event->button.x, event->button.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_MOTION:
|
||||
clutter_point_init (position, event->motion.x, event->motion.y);
|
||||
graphene_point_init (position, event->motion.x, event->motion.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCH_BEGIN:
|
||||
case CLUTTER_TOUCH_UPDATE:
|
||||
case CLUTTER_TOUCH_END:
|
||||
case CLUTTER_TOUCH_CANCEL:
|
||||
clutter_point_init (position, event->touch.x, event->touch.y);
|
||||
graphene_point_init (position, event->touch.x, event->touch.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_SCROLL:
|
||||
clutter_point_init (position, event->scroll.x, event->scroll.y);
|
||||
graphene_point_init (position, event->scroll.x, event->scroll.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCHPAD_PINCH:
|
||||
clutter_point_init (position, event->touchpad_pinch.x,
|
||||
event->touchpad_pinch.y);
|
||||
graphene_point_init (position, event->touchpad_pinch.x,
|
||||
event->touchpad_pinch.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCHPAD_SWIPE:
|
||||
clutter_point_init (position, event->touchpad_swipe.x,
|
||||
event->touchpad_swipe.y);
|
||||
graphene_point_init (position, event->touchpad_swipe.x,
|
||||
event->touchpad_swipe.y);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1796,12 +1796,12 @@ float
|
||||
clutter_event_get_distance (const ClutterEvent *source,
|
||||
const ClutterEvent *target)
|
||||
{
|
||||
ClutterPoint p0, p1;
|
||||
graphene_point_t p0, p1;
|
||||
|
||||
clutter_event_get_position (source, &p0);
|
||||
clutter_event_get_position (source, &p1);
|
||||
|
||||
return clutter_point_distance (&p0, &p1, NULL, NULL);
|
||||
return graphene_point_distance (&p0, &p1, NULL, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1822,17 +1822,17 @@ double
|
||||
clutter_event_get_angle (const ClutterEvent *source,
|
||||
const ClutterEvent *target)
|
||||
{
|
||||
ClutterPoint p0, p1;
|
||||
graphene_point_t p0, p1;
|
||||
float x_distance, y_distance;
|
||||
double angle;
|
||||
|
||||
clutter_event_get_position (source, &p0);
|
||||
clutter_event_get_position (target, &p1);
|
||||
|
||||
if (clutter_point_equals (&p0, &p1))
|
||||
if (graphene_point_equal (&p0, &p1))
|
||||
return 0;
|
||||
|
||||
clutter_point_distance (&p0, &p1, &x_distance, &y_distance);
|
||||
graphene_point_distance (&p0, &p1, &x_distance, &y_distance);
|
||||
|
||||
angle = atan2 (x_distance, y_distance);
|
||||
|
||||
@ -2161,9 +2161,9 @@ clutter_event_get_scroll_source (const ClutterEvent *event)
|
||||
ClutterScrollFinishFlags
|
||||
clutter_event_get_scroll_finish_flags (const ClutterEvent *event)
|
||||
{
|
||||
g_return_val_if_fail (event != NULL, CLUTTER_SCROLL_SOURCE_UNKNOWN);
|
||||
g_return_val_if_fail (event != NULL, CLUTTER_SCROLL_FINISHED_NONE);
|
||||
g_return_val_if_fail (event->type == CLUTTER_SCROLL,
|
||||
CLUTTER_SCROLL_SOURCE_UNKNOWN);
|
||||
CLUTTER_SCROLL_FINISHED_NONE);
|
||||
|
||||
return event->scroll.finish_flags;
|
||||
}
|
||||
|
@ -686,7 +686,7 @@ void clutter_event_get_coords (const ClutterEv
|
||||
gfloat *y);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_event_get_position (const ClutterEvent *event,
|
||||
ClutterPoint *position);
|
||||
graphene_point_t *position);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_event_get_distance (const ClutterEvent *source,
|
||||
const ClutterEvent *target);
|
||||
|
@ -33,8 +33,6 @@
|
||||
*
|
||||
* It is possible to ask whether Clutter has support for specific features at
|
||||
* run-time.
|
||||
*
|
||||
* See also cogl_get_features() and #CoglFeatureFlags
|
||||
*/
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
@ -60,20 +58,13 @@ typedef struct ClutterFeatures
|
||||
static ClutterFeatures* __features = NULL;
|
||||
|
||||
static ClutterFeatureFlags
|
||||
clutter_features_from_cogl (guint cogl_flags)
|
||||
clutter_features_from_cogl (void)
|
||||
{
|
||||
ClutterFeatureFlags clutter_flags = 0;
|
||||
|
||||
if (cogl_flags & COGL_FEATURE_TEXTURE_YUV)
|
||||
clutter_flags |= CLUTTER_FEATURE_TEXTURE_YUV;
|
||||
|
||||
if (cogl_flags & COGL_FEATURE_TEXTURE_READ_PIXELS)
|
||||
clutter_flags |= CLUTTER_FEATURE_TEXTURE_READ_PIXELS;
|
||||
|
||||
clutter_flags |= CLUTTER_FEATURE_SHADERS_GLSL;
|
||||
|
||||
if (cogl_flags & COGL_FEATURE_OFFSCREEN)
|
||||
clutter_flags |= CLUTTER_FEATURE_OFFSCREEN;
|
||||
clutter_flags |= CLUTTER_FEATURE_OFFSCREEN;
|
||||
|
||||
return clutter_flags;
|
||||
}
|
||||
@ -101,7 +92,7 @@ _clutter_feature_init (GError **error)
|
||||
if (!_clutter_backend_create_context (context->backend, error))
|
||||
return FALSE;
|
||||
|
||||
__features->flags = (clutter_features_from_cogl (cogl_get_features ())
|
||||
__features->flags = (clutter_features_from_cogl ()
|
||||
| _clutter_backend_get_features (context->backend));
|
||||
|
||||
__features->features_set = TRUE;
|
||||
|
@ -131,8 +131,7 @@ clutter_fixed_layout_get_preferred_height (ClutterLayoutManager *manager,
|
||||
static void
|
||||
clutter_fixed_layout_allocate (ClutterLayoutManager *manager,
|
||||
ClutterContainer *container,
|
||||
const ClutterActorBox *allocation,
|
||||
ClutterAllocationFlags flags)
|
||||
const ClutterActorBox *allocation)
|
||||
{
|
||||
ClutterActor *child;
|
||||
|
||||
@ -140,7 +139,7 @@ clutter_fixed_layout_allocate (ClutterLayoutManager *manager,
|
||||
child != NULL;
|
||||
child = clutter_actor_get_next_sibling (child))
|
||||
{
|
||||
clutter_actor_allocate_preferred_size (child, flags);
|
||||
clutter_actor_allocate_preferred_size (child);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -566,8 +566,7 @@ clutter_flow_layout_get_preferred_height (ClutterLayoutManager *manager,
|
||||
static void
|
||||
clutter_flow_layout_allocate (ClutterLayoutManager *manager,
|
||||
ClutterContainer *container,
|
||||
const ClutterActorBox *allocation,
|
||||
ClutterAllocationFlags flags)
|
||||
const ClutterActorBox *allocation)
|
||||
{
|
||||
ClutterFlowLayoutPrivate *priv = CLUTTER_FLOW_LAYOUT (manager)->priv;
|
||||
ClutterActor *actor, *child;
|
||||
@ -729,7 +728,7 @@ clutter_flow_layout_allocate (ClutterLayoutManager *manager,
|
||||
child_alloc.y1 = ceil (item_y);
|
||||
child_alloc.x2 = ceil (child_alloc.x1 + item_width);
|
||||
child_alloc.y2 = ceil (child_alloc.y1 + item_height);
|
||||
clutter_actor_allocate (child, &child_alloc, flags);
|
||||
clutter_actor_allocate (child, &child_alloc);
|
||||
|
||||
if (priv->orientation == CLUTTER_FLOW_HORIZONTAL)
|
||||
item_x = new_x;
|
||||
|
@ -118,7 +118,7 @@ struct _ClutterGestureActionPrivate
|
||||
gint requested_nb_points;
|
||||
GArray *points;
|
||||
|
||||
guint actor_capture_id;
|
||||
gulong actor_capture_id;
|
||||
gulong stage_capture_id;
|
||||
|
||||
ClutterGestureTriggerEdge edge;
|
||||
@ -157,7 +157,8 @@ G_DEFINE_TYPE_WITH_PRIVATE (ClutterGestureAction, clutter_gesture_action, CLUTTE
|
||||
static GesturePoint *
|
||||
gesture_register_point (ClutterGestureAction *action, ClutterEvent *event)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv = action->priv;
|
||||
ClutterGestureActionPrivate *priv =
|
||||
clutter_gesture_action_get_instance_private (action);
|
||||
GesturePoint *point = NULL;
|
||||
|
||||
if (priv->points->len >= MAX_GESTURE_POINTS)
|
||||
@ -190,7 +191,8 @@ gesture_find_point (ClutterGestureAction *action,
|
||||
ClutterEvent *event,
|
||||
gint *position)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv = action->priv;
|
||||
ClutterGestureActionPrivate *priv =
|
||||
clutter_gesture_action_get_instance_private (action);
|
||||
GesturePoint *point = NULL;
|
||||
ClutterEventType type = clutter_event_type (event);
|
||||
ClutterInputDevice *device = clutter_event_get_device (event);
|
||||
@ -220,9 +222,10 @@ gesture_find_point (ClutterGestureAction *action,
|
||||
static void
|
||||
gesture_unregister_point (ClutterGestureAction *action, gint position)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv = action->priv;
|
||||
ClutterGestureActionPrivate *priv =
|
||||
clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
if (action->priv->points->len == 0)
|
||||
if (priv->points->len == 0)
|
||||
return;
|
||||
|
||||
g_array_remove_index (priv->points, position);
|
||||
@ -303,28 +306,26 @@ gesture_point_unset (GesturePoint *point)
|
||||
static void
|
||||
cancel_gesture (ClutterGestureAction *action)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv = action->priv;
|
||||
ClutterGestureActionPrivate *priv =
|
||||
clutter_gesture_action_get_instance_private (action);
|
||||
ClutterActor *actor;
|
||||
|
||||
priv->in_gesture = FALSE;
|
||||
|
||||
if (priv->stage_capture_id != 0)
|
||||
{
|
||||
g_signal_handler_disconnect (priv->stage, priv->stage_capture_id);
|
||||
priv->stage_capture_id = 0;
|
||||
}
|
||||
g_clear_signal_handler (&priv->stage_capture_id, priv->stage);
|
||||
|
||||
actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action));
|
||||
g_signal_emit (action, gesture_signals[GESTURE_CANCEL], 0, actor);
|
||||
|
||||
g_array_set_size (action->priv->points, 0);
|
||||
g_array_set_size (priv->points, 0);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
begin_gesture (ClutterGestureAction *action,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv = action->priv;
|
||||
ClutterGestureActionPrivate *priv =
|
||||
clutter_gesture_action_get_instance_private (action);
|
||||
gboolean return_value;
|
||||
|
||||
priv->in_gesture = TRUE;
|
||||
@ -357,7 +358,8 @@ stage_captured_event_cb (ClutterActor *stage,
|
||||
ClutterEvent *event,
|
||||
ClutterGestureAction *action)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv = action->priv;
|
||||
ClutterGestureActionPrivate *priv =
|
||||
clutter_gesture_action_get_instance_private (action);
|
||||
ClutterActor *actor;
|
||||
gint position;
|
||||
float threshold_x, threshold_y;
|
||||
@ -481,11 +483,8 @@ stage_captured_event_cb (ClutterActor *stage,
|
||||
break;
|
||||
}
|
||||
|
||||
if (priv->points->len == 0 && priv->stage_capture_id)
|
||||
{
|
||||
g_signal_handler_disconnect (priv->stage, priv->stage_capture_id);
|
||||
priv->stage_capture_id = 0;
|
||||
}
|
||||
if (priv->points->len == 0)
|
||||
g_clear_signal_handler (&priv->stage_capture_id, priv->stage);
|
||||
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
}
|
||||
@ -495,7 +494,8 @@ actor_captured_event_cb (ClutterActor *actor,
|
||||
ClutterEvent *event,
|
||||
ClutterGestureAction *action)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv = action->priv;
|
||||
ClutterGestureActionPrivate *priv =
|
||||
clutter_gesture_action_get_instance_private (action);
|
||||
GesturePoint *point G_GNUC_UNUSED;
|
||||
|
||||
if ((clutter_event_type (event) != CLUTTER_BUTTON_PRESS) &&
|
||||
@ -529,7 +529,8 @@ static void
|
||||
clutter_gesture_action_set_actor (ClutterActorMeta *meta,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv = CLUTTER_GESTURE_ACTION (meta)->priv;
|
||||
ClutterGestureActionPrivate *priv =
|
||||
clutter_gesture_action_get_instance_private (CLUTTER_GESTURE_ACTION (meta));
|
||||
ClutterActorMetaClass *meta_class =
|
||||
CLUTTER_ACTOR_META_CLASS (clutter_gesture_action_parent_class);
|
||||
|
||||
@ -538,7 +539,7 @@ clutter_gesture_action_set_actor (ClutterActorMeta *meta,
|
||||
ClutterActor *old_actor = clutter_actor_meta_get_actor (meta);
|
||||
|
||||
if (old_actor != NULL)
|
||||
g_signal_handler_disconnect (old_actor, priv->actor_capture_id);
|
||||
g_clear_signal_handler (&priv->actor_capture_id, old_actor);
|
||||
|
||||
priv->actor_capture_id = 0;
|
||||
}
|
||||
@ -546,7 +547,7 @@ clutter_gesture_action_set_actor (ClutterActorMeta *meta,
|
||||
if (priv->stage_capture_id != 0)
|
||||
{
|
||||
if (priv->stage != NULL)
|
||||
g_signal_handler_disconnect (priv->stage, priv->stage_capture_id);
|
||||
g_clear_signal_handler (&priv->stage_capture_id, priv->stage);
|
||||
|
||||
priv->stage_capture_id = 0;
|
||||
priv->stage = NULL;
|
||||
@ -563,6 +564,22 @@ clutter_gesture_action_set_actor (ClutterActorMeta *meta,
|
||||
meta_class->set_actor (meta, actor);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_gesture_action_set_enabled (ClutterActorMeta *meta,
|
||||
gboolean is_enabled)
|
||||
{
|
||||
ClutterActorMetaClass *meta_class =
|
||||
CLUTTER_ACTOR_META_CLASS (clutter_gesture_action_parent_class);
|
||||
ClutterGestureAction *gesture_action = CLUTTER_GESTURE_ACTION (meta);
|
||||
ClutterGestureActionPrivate *priv =
|
||||
clutter_gesture_action_get_instance_private (gesture_action);
|
||||
|
||||
if (!is_enabled && priv->in_gesture)
|
||||
cancel_gesture (gesture_action);
|
||||
|
||||
meta_class->set_enabled (meta, is_enabled);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
default_event_handler (ClutterGestureAction *action,
|
||||
ClutterActor *actor)
|
||||
@ -577,6 +594,8 @@ clutter_gesture_action_set_property (GObject *gobject,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterGestureAction *self = CLUTTER_GESTURE_ACTION (gobject);
|
||||
ClutterGestureActionPrivate *priv =
|
||||
clutter_gesture_action_get_instance_private (self);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
@ -589,11 +608,15 @@ clutter_gesture_action_set_property (GObject *gobject,
|
||||
break;
|
||||
|
||||
case PROP_THRESHOLD_TRIGGER_DISTANCE_X:
|
||||
clutter_gesture_action_set_threshold_trigger_distance (self, g_value_get_float (value), self->priv->distance_y);
|
||||
clutter_gesture_action_set_threshold_trigger_distance (self,
|
||||
g_value_get_float (value),
|
||||
priv->distance_y);
|
||||
break;
|
||||
|
||||
case PROP_THRESHOLD_TRIGGER_DISTANCE_Y:
|
||||
clutter_gesture_action_set_threshold_trigger_distance (self, self->priv->distance_x, g_value_get_float (value));
|
||||
clutter_gesture_action_set_threshold_trigger_distance (self,
|
||||
priv->distance_x,
|
||||
g_value_get_float (value));
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -608,28 +631,29 @@ clutter_gesture_action_get_property (GObject *gobject,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterGestureAction *self = CLUTTER_GESTURE_ACTION (gobject);
|
||||
ClutterGestureActionPrivate *priv =
|
||||
clutter_gesture_action_get_instance_private (CLUTTER_GESTURE_ACTION (gobject));
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_N_TOUCH_POINTS:
|
||||
g_value_set_int (value, self->priv->requested_nb_points);
|
||||
g_value_set_int (value, priv->requested_nb_points);
|
||||
break;
|
||||
|
||||
case PROP_THRESHOLD_TRIGGER_EDGE:
|
||||
g_value_set_enum (value, self->priv->edge);
|
||||
g_value_set_enum (value, priv->edge);
|
||||
break;
|
||||
|
||||
case PROP_THRESHOLD_TRIGGER_DISTANCE_X:
|
||||
if (self->priv->distance_x > 0.0)
|
||||
g_value_set_float (value, self->priv->distance_x);
|
||||
if (priv->distance_x > 0.0)
|
||||
g_value_set_float (value, priv->distance_x);
|
||||
else
|
||||
g_value_set_float (value, gesture_get_default_threshold ());
|
||||
break;
|
||||
|
||||
case PROP_THRESHOLD_TRIGGER_DISTANCE_Y:
|
||||
if (self->priv->distance_y > 0.0)
|
||||
g_value_set_float (value, self->priv->distance_y);
|
||||
if (priv->distance_y > 0.0)
|
||||
g_value_set_float (value, priv->distance_y);
|
||||
else
|
||||
g_value_set_float (value, gesture_get_default_threshold ());
|
||||
break;
|
||||
@ -643,7 +667,8 @@ clutter_gesture_action_get_property (GObject *gobject,
|
||||
static void
|
||||
clutter_gesture_action_finalize (GObject *gobject)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv = CLUTTER_GESTURE_ACTION (gobject)->priv;
|
||||
ClutterGestureActionPrivate *priv =
|
||||
clutter_gesture_action_get_instance_private (CLUTTER_GESTURE_ACTION (gobject));
|
||||
|
||||
g_array_unref (priv->points);
|
||||
|
||||
@ -661,6 +686,7 @@ clutter_gesture_action_class_init (ClutterGestureActionClass *klass)
|
||||
gobject_class->get_property = clutter_gesture_action_get_property;
|
||||
|
||||
meta_class->set_actor = clutter_gesture_action_set_actor;
|
||||
meta_class->set_enabled = clutter_gesture_action_set_enabled;
|
||||
|
||||
klass->gesture_begin = default_event_handler;
|
||||
klass->gesture_progress = default_event_handler;
|
||||
@ -804,8 +830,7 @@ clutter_gesture_action_class_init (ClutterGestureActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterGestureActionClass, gesture_end),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@ -827,8 +852,7 @@ clutter_gesture_action_class_init (ClutterGestureActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterGestureActionClass, gesture_cancel),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
}
|
||||
@ -836,13 +860,14 @@ clutter_gesture_action_class_init (ClutterGestureActionClass *klass)
|
||||
static void
|
||||
clutter_gesture_action_init (ClutterGestureAction *self)
|
||||
{
|
||||
self->priv = clutter_gesture_action_get_instance_private (self);
|
||||
ClutterGestureActionPrivate *priv =
|
||||
clutter_gesture_action_get_instance_private (self);
|
||||
|
||||
self->priv->points = g_array_sized_new (FALSE, TRUE, sizeof (GesturePoint), 3);
|
||||
g_array_set_clear_func (self->priv->points, (GDestroyNotify) gesture_point_unset);
|
||||
priv->points = g_array_sized_new (FALSE, TRUE, sizeof (GesturePoint), 3);
|
||||
g_array_set_clear_func (priv->points, (GDestroyNotify) gesture_point_unset);
|
||||
|
||||
self->priv->requested_nb_points = 1;
|
||||
self->priv->edge = CLUTTER_GESTURE_TRIGGER_EDGE_NONE;
|
||||
priv->requested_nb_points = 1;
|
||||
priv->edge = CLUTTER_GESTURE_TRIGGER_EDGE_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -881,16 +906,21 @@ clutter_gesture_action_get_press_coords (ClutterGestureAction *action,
|
||||
gfloat *press_x,
|
||||
gfloat *press_y)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_GESTURE_ACTION (action));
|
||||
g_return_if_fail (action->priv->points->len > point);
|
||||
|
||||
priv = clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
g_return_if_fail (priv->points->len > point);
|
||||
|
||||
if (press_x)
|
||||
*press_x = g_array_index (action->priv->points,
|
||||
*press_x = g_array_index (priv->points,
|
||||
GesturePoint,
|
||||
point).press_x;
|
||||
|
||||
if (press_y)
|
||||
*press_y = g_array_index (action->priv->points,
|
||||
*press_y = g_array_index (priv->points,
|
||||
GesturePoint,
|
||||
point).press_y;
|
||||
}
|
||||
@ -916,16 +946,21 @@ clutter_gesture_action_get_motion_coords (ClutterGestureAction *action,
|
||||
gfloat *motion_x,
|
||||
gfloat *motion_y)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_GESTURE_ACTION (action));
|
||||
g_return_if_fail (action->priv->points->len > point);
|
||||
|
||||
priv = clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
g_return_if_fail (priv->points->len > point);
|
||||
|
||||
if (motion_x)
|
||||
*motion_x = g_array_index (action->priv->points,
|
||||
*motion_x = g_array_index (priv->points,
|
||||
GesturePoint,
|
||||
point).last_motion_x;
|
||||
|
||||
if (motion_y)
|
||||
*motion_y = g_array_index (action->priv->points,
|
||||
*motion_y = g_array_index (priv->points,
|
||||
GesturePoint,
|
||||
point).last_motion_y;
|
||||
}
|
||||
@ -953,15 +988,19 @@ clutter_gesture_action_get_motion_delta (ClutterGestureAction *action,
|
||||
gfloat *delta_x,
|
||||
gfloat *delta_y)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv;
|
||||
gfloat d_x, d_y;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_GESTURE_ACTION (action), 0);
|
||||
g_return_val_if_fail (action->priv->points->len > point, 0);
|
||||
|
||||
d_x = g_array_index (action->priv->points,
|
||||
priv = clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
g_return_val_if_fail (priv->points->len > point, 0);
|
||||
|
||||
d_x = g_array_index (priv->points,
|
||||
GesturePoint,
|
||||
point).last_delta_x;
|
||||
d_y = g_array_index (action->priv->points,
|
||||
d_y = g_array_index (priv->points,
|
||||
GesturePoint,
|
||||
point).last_delta_y;
|
||||
|
||||
@ -995,16 +1034,21 @@ clutter_gesture_action_get_release_coords (ClutterGestureAction *action,
|
||||
gfloat *release_x,
|
||||
gfloat *release_y)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_GESTURE_ACTION (action));
|
||||
g_return_if_fail (action->priv->points->len > point);
|
||||
|
||||
priv = clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
g_return_if_fail (priv->points->len > point);
|
||||
|
||||
if (release_x)
|
||||
*release_x = g_array_index (action->priv->points,
|
||||
*release_x = g_array_index (priv->points,
|
||||
GesturePoint,
|
||||
point).release_x;
|
||||
|
||||
if (release_y)
|
||||
*release_y = g_array_index (action->priv->points,
|
||||
*release_y = g_array_index (priv->points,
|
||||
GesturePoint,
|
||||
point).release_y;
|
||||
}
|
||||
@ -1030,16 +1074,20 @@ clutter_gesture_action_get_velocity (ClutterGestureAction *action,
|
||||
gfloat *velocity_x,
|
||||
gfloat *velocity_y)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv;
|
||||
gfloat d_x, d_y, distance, velocity;
|
||||
gint64 d_t;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_GESTURE_ACTION (action), 0);
|
||||
g_return_val_if_fail (action->priv->points->len > point, 0);
|
||||
|
||||
priv = clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
g_return_val_if_fail (priv->points->len > point, 0);
|
||||
|
||||
distance = clutter_gesture_action_get_motion_delta (action, point,
|
||||
&d_x, &d_y);
|
||||
|
||||
d_t = g_array_index (action->priv->points,
|
||||
d_t = g_array_index (priv->points,
|
||||
GesturePoint,
|
||||
point).last_delta_time;
|
||||
|
||||
@ -1066,9 +1114,13 @@ clutter_gesture_action_get_velocity (ClutterGestureAction *action,
|
||||
gint
|
||||
clutter_gesture_action_get_n_touch_points (ClutterGestureAction *action)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_GESTURE_ACTION (action), 0);
|
||||
|
||||
return action->priv->requested_nb_points;
|
||||
priv = clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
return priv->requested_nb_points;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1089,7 +1141,7 @@ clutter_gesture_action_set_n_touch_points (ClutterGestureAction *action,
|
||||
g_return_if_fail (CLUTTER_IS_GESTURE_ACTION (action));
|
||||
g_return_if_fail (nb_points >= 1);
|
||||
|
||||
priv = action->priv;
|
||||
priv = clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
if (priv->requested_nb_points == nb_points)
|
||||
return;
|
||||
@ -1143,9 +1195,13 @@ clutter_gesture_action_set_n_touch_points (ClutterGestureAction *action,
|
||||
guint
|
||||
clutter_gesture_action_get_n_current_points (ClutterGestureAction *action)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_GESTURE_ACTION (action), 0);
|
||||
|
||||
return action->priv->points->len;
|
||||
priv = clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
return priv->points->len;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1163,10 +1219,15 @@ ClutterEventSequence *
|
||||
clutter_gesture_action_get_sequence (ClutterGestureAction *action,
|
||||
guint point)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_GESTURE_ACTION (action), NULL);
|
||||
g_return_val_if_fail (action->priv->points->len > point, NULL);
|
||||
ClutterGestureActionPrivate *priv;
|
||||
|
||||
return g_array_index (action->priv->points, GesturePoint, point).sequence;
|
||||
g_return_val_if_fail (CLUTTER_IS_GESTURE_ACTION (action), NULL);
|
||||
|
||||
priv = clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
g_return_val_if_fail (priv->points->len > point, NULL);
|
||||
|
||||
return g_array_index (priv->points, GesturePoint, point).sequence;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1185,10 +1246,15 @@ ClutterInputDevice *
|
||||
clutter_gesture_action_get_device (ClutterGestureAction *action,
|
||||
guint point)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_GESTURE_ACTION (action), NULL);
|
||||
g_return_val_if_fail (action->priv->points->len > point, NULL);
|
||||
ClutterGestureActionPrivate *priv;
|
||||
|
||||
return g_array_index (action->priv->points, GesturePoint, point).device;
|
||||
g_return_val_if_fail (CLUTTER_IS_GESTURE_ACTION (action), NULL);
|
||||
|
||||
priv = clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
g_return_val_if_fail (priv->points->len > point, NULL);
|
||||
|
||||
return g_array_index (priv->points, GesturePoint, point).device;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1208,11 +1274,15 @@ clutter_gesture_action_get_last_event (ClutterGestureAction *action,
|
||||
guint point)
|
||||
{
|
||||
GesturePoint *gesture_point;
|
||||
ClutterGestureActionPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_GESTURE_ACTION (action), NULL);
|
||||
g_return_val_if_fail (action->priv->points->len > point, NULL);
|
||||
|
||||
gesture_point = &g_array_index (action->priv->points, GesturePoint, point);
|
||||
priv = clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
g_return_val_if_fail (priv->points->len > point, NULL);
|
||||
|
||||
gesture_point = &g_array_index (priv->points, GesturePoint, point);
|
||||
|
||||
return gesture_point->last_event;
|
||||
}
|
||||
@ -1249,12 +1319,16 @@ void
|
||||
clutter_gesture_action_set_threshold_trigger_edge (ClutterGestureAction *action,
|
||||
ClutterGestureTriggerEdge edge)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_GESTURE_ACTION (action));
|
||||
|
||||
if (action->priv->edge == edge)
|
||||
priv = clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
if (priv->edge == edge)
|
||||
return;
|
||||
|
||||
action->priv->edge = edge;
|
||||
priv->edge = edge;
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (action), gesture_props[PROP_THRESHOLD_TRIGGER_EDGE]);
|
||||
}
|
||||
@ -1273,10 +1347,14 @@ clutter_gesture_action_set_threshold_trigger_edge (ClutterGestureAction *ac
|
||||
ClutterGestureTriggerEdge
|
||||
clutter_gesture_action_get_threshold_trigger_edge (ClutterGestureAction *action)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_GESTURE_ACTION (action),
|
||||
CLUTTER_GESTURE_TRIGGER_EDGE_NONE);
|
||||
|
||||
return action->priv->edge;
|
||||
priv = clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
return priv->edge;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1316,17 +1394,21 @@ clutter_gesture_action_set_threshold_trigger_distance (ClutterGestureAction
|
||||
float x,
|
||||
float y)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_GESTURE_ACTION (action));
|
||||
|
||||
if (fabsf (x - action->priv->distance_x) > FLOAT_EPSILON)
|
||||
priv = clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
if (fabsf (x - priv->distance_x) > FLOAT_EPSILON)
|
||||
{
|
||||
action->priv->distance_x = x;
|
||||
priv->distance_x = x;
|
||||
g_object_notify_by_pspec (G_OBJECT (action), gesture_props[PROP_THRESHOLD_TRIGGER_DISTANCE_X]);
|
||||
}
|
||||
|
||||
if (fabsf (y - action->priv->distance_y) > FLOAT_EPSILON)
|
||||
if (fabsf (y - priv->distance_y) > FLOAT_EPSILON)
|
||||
{
|
||||
action->priv->distance_y = y;
|
||||
priv->distance_y = y;
|
||||
g_object_notify_by_pspec (G_OBJECT (action), gesture_props[PROP_THRESHOLD_TRIGGER_DISTANCE_Y]);
|
||||
}
|
||||
}
|
||||
@ -1347,19 +1429,23 @@ clutter_gesture_action_get_threshold_trigger_distance (ClutterGestureAction *act
|
||||
float *x,
|
||||
float *y)
|
||||
{
|
||||
ClutterGestureActionPrivate *priv;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_GESTURE_ACTION (action));
|
||||
|
||||
priv = clutter_gesture_action_get_instance_private (action);
|
||||
|
||||
if (x != NULL)
|
||||
{
|
||||
if (action->priv->distance_x > 0.0)
|
||||
*x = action->priv->distance_x;
|
||||
if (priv->distance_x > 0.0)
|
||||
*x = priv->distance_x;
|
||||
else
|
||||
*x = gesture_get_default_threshold ();
|
||||
}
|
||||
if (y != NULL)
|
||||
{
|
||||
if (action->priv->distance_y > 0.0)
|
||||
*y = action->priv->distance_y;
|
||||
if (priv->distance_y > 0.0)
|
||||
*y = priv->distance_y;
|
||||
else
|
||||
*y = gesture_get_default_threshold ();
|
||||
}
|
||||
|
@ -34,32 +34,13 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_GESTURE_ACTION (clutter_gesture_action_get_type ())
|
||||
#define CLUTTER_GESTURE_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_GESTURE_ACTION, ClutterGestureAction))
|
||||
#define CLUTTER_IS_GESTURE_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_GESTURE_ACTION))
|
||||
#define CLUTTER_GESTURE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_GESTURE_ACTION, ClutterGestureActionClass))
|
||||
#define CLUTTER_IS_GESTURE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_GESTURE_ACTION))
|
||||
#define CLUTTER_GESTURE_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_GESTURE_ACTION, ClutterGestureActionClass))
|
||||
#define CLUTTER_TYPE_GESTURE_ACTION (clutter_gesture_action_get_type ())
|
||||
|
||||
typedef struct _ClutterGestureAction ClutterGestureAction;
|
||||
typedef struct _ClutterGestureActionPrivate ClutterGestureActionPrivate;
|
||||
typedef struct _ClutterGestureActionClass ClutterGestureActionClass;
|
||||
CLUTTER_EXPORT
|
||||
G_DECLARE_DERIVABLE_TYPE (ClutterGestureAction, clutter_gesture_action,
|
||||
CLUTTER, GESTURE_ACTION, ClutterAction);
|
||||
|
||||
/**
|
||||
* ClutterGestureAction:
|
||||
*
|
||||
* The #ClutterGestureAction structure contains
|
||||
* only private data and should be accessed using the provided API
|
||||
*
|
||||
* Since: 1.8
|
||||
*/
|
||||
struct _ClutterGestureAction
|
||||
{
|
||||
/*< private >*/
|
||||
ClutterAction parent_instance;
|
||||
|
||||
ClutterGestureActionPrivate *priv;
|
||||
};
|
||||
typedef struct _ClutterGestureActionPrivate ClutterGestureActionPrivate;
|
||||
|
||||
/**
|
||||
* ClutterGestureActionClass:
|
||||
@ -101,9 +82,6 @@ struct _ClutterGestureActionClass
|
||||
void (* _clutter_gesture_action6) (void);
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_gesture_action_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterAction * clutter_gesture_action_new (void);
|
||||
|
||||
|
111
clutter/clutter/clutter-graphene.c
Normal file
111
clutter/clutter/clutter-graphene.c
Normal file
@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Authored By Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
|
||||
*
|
||||
* Copyright (C) 2019 Endless, Inc
|
||||
* Copyright (C) 2009, 2010 Intel Corp
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-graphene.h"
|
||||
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-types.h"
|
||||
|
||||
static gboolean
|
||||
graphene_point_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
double progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_point_t *ap = g_value_get_boxed (a);
|
||||
const graphene_point_t *bp = g_value_get_boxed (b);
|
||||
graphene_point_t res;
|
||||
|
||||
graphene_point_interpolate (ap, bp, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
graphene_point3d_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
double progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_point3d_t *av = g_value_get_boxed (a);
|
||||
const graphene_point3d_t *bv = g_value_get_boxed (b);
|
||||
graphene_point3d_t res;
|
||||
|
||||
graphene_point3d_interpolate (av, bv, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
graphene_rect_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
double progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_rect_t *rect_a = g_value_get_boxed (a);
|
||||
const graphene_rect_t *rect_b = g_value_get_boxed (b);
|
||||
graphene_rect_t res;
|
||||
|
||||
graphene_rect_interpolate (rect_a, rect_b, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
graphene_size_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
double progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_size_t *as = g_value_get_boxed (a);
|
||||
const graphene_size_t *bs = g_value_get_boxed (b);
|
||||
graphene_size_t res;
|
||||
|
||||
graphene_size_interpolate (as, bs, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
clutter_graphene_init (void)
|
||||
{
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT,
|
||||
graphene_point_progress);
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT3D,
|
||||
graphene_point3d_progress);
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_RECT,
|
||||
graphene_rect_progress);
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_SIZE,
|
||||
graphene_size_progress);
|
||||
}
|
30
clutter/clutter/clutter-graphene.h
Normal file
30
clutter/clutter/clutter-graphene.h
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Authored By Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
|
||||
*
|
||||
* Copyright (C) 2019 Endless, Inc
|
||||
* Copyright (C) 2009, 2010 Intel Corp
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CLUTTER_GRAPHENE_H
|
||||
#define CLUTTER_GRAPHENE_H
|
||||
|
||||
void clutter_graphene_init (void);
|
||||
|
||||
#endif
|
@ -44,12 +44,12 @@
|
||||
* SECTION:clutter-grid-layout
|
||||
* @Short_description: A layout manager for a grid of actors
|
||||
* @Title: ClutterGridLayout
|
||||
* @See_also: #ClutterTableLayout, #ClutterBoxLayout
|
||||
* @See_also: #ClutterBoxLayout
|
||||
*
|
||||
* #ClutterGridLayout is a layout manager which arranges its child widgets in
|
||||
* rows and columns. It is a very similar to #ClutterTableLayout and
|
||||
* #ClutterBoxLayout, but it consistently uses #ClutterActor's
|
||||
* alignment and expansion flags instead of custom child properties.
|
||||
* rows and columns. It is a very similar to #ClutterBoxLayout, but it
|
||||
* consistently uses #ClutterActor's alignment and expansion flags instead of
|
||||
* custom child properties.
|
||||
*
|
||||
* Children are added using clutter_grid_layout_attach(). They can span
|
||||
* multiple rows or columns. It is also possible to add a child next to an
|
||||
@ -1391,8 +1391,7 @@ allocate_child (ClutterGridRequest *request,
|
||||
static void
|
||||
clutter_grid_layout_allocate (ClutterLayoutManager *layout,
|
||||
ClutterContainer *container,
|
||||
const ClutterActorBox *allocation,
|
||||
ClutterAllocationFlags flags)
|
||||
const ClutterActorBox *allocation)
|
||||
{
|
||||
ClutterGridLayout *self = CLUTTER_GRID_LAYOUT (layout);
|
||||
ClutterOrientation orientation;
|
||||
@ -1453,7 +1452,7 @@ clutter_grid_layout_allocate (ClutterLayoutManager *layout,
|
||||
child_allocation.x2 = child_allocation.x1 + width;
|
||||
child_allocation.y2 = child_allocation.y1 + height;
|
||||
|
||||
clutter_actor_allocate (child, &child_allocation, flags);
|
||||
clutter_actor_allocate (child, &child_allocation);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -118,9 +118,10 @@ clutter_image_init (ClutterImage *self)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_image_paint_content (ClutterContent *content,
|
||||
ClutterActor *actor,
|
||||
ClutterPaintNode *root)
|
||||
clutter_image_paint_content (ClutterContent *content,
|
||||
ClutterActor *actor,
|
||||
ClutterPaintNode *root,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
ClutterImagePrivate *priv = CLUTTER_IMAGE (content)->priv;
|
||||
ClutterPaintNode *node;
|
||||
@ -129,7 +130,7 @@ clutter_image_paint_content (ClutterContent *content,
|
||||
return;
|
||||
|
||||
node = clutter_actor_create_texture_paint_node (actor, priv->texture);
|
||||
clutter_paint_node_set_name (node, "Image Content");
|
||||
clutter_paint_node_set_static_name (node, "Image Content");
|
||||
clutter_paint_node_add_child (root, node);
|
||||
clutter_paint_node_unref (node);
|
||||
}
|
||||
@ -256,7 +257,7 @@ clutter_image_set_data (ClutterImage *image,
|
||||
{
|
||||
g_set_error_literal (error, CLUTTER_IMAGE_ERROR,
|
||||
CLUTTER_IMAGE_ERROR_INVALID_DATA,
|
||||
_("Unable to load image data"));
|
||||
"Unable to load image data");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -325,7 +326,7 @@ clutter_image_set_bytes (ClutterImage *image,
|
||||
{
|
||||
g_set_error_literal (error, CLUTTER_IMAGE_ERROR,
|
||||
CLUTTER_IMAGE_ERROR_INVALID_DATA,
|
||||
_("Unable to load image data"));
|
||||
"Unable to load image data");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -419,7 +420,7 @@ clutter_image_set_area (ClutterImage *image,
|
||||
{
|
||||
g_set_error_literal (error, CLUTTER_IMAGE_ERROR,
|
||||
CLUTTER_IMAGE_ERROR_INVALID_DATA,
|
||||
_("Unable to load image data"));
|
||||
"Unable to load image data");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
255
clutter/clutter/clutter-input-device-private.h
Normal file
255
clutter/clutter/clutter-input-device-private.h
Normal file
@ -0,0 +1,255 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright © 2009, 2010, 2011 Intel Corp.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Emmanuele Bassi <ebassi@linux.intel.com>
|
||||
*/
|
||||
|
||||
#ifndef CLUTTER_INPUT_DEVICE_PRIVATE_H
|
||||
#define CLUTTER_INPUT_DEVICE_PRIVATE_H
|
||||
|
||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <clutter/clutter.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <clutter/clutter-input-device.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _ClutterAxisInfo
|
||||
{
|
||||
ClutterInputAxis axis;
|
||||
|
||||
double min_axis;
|
||||
double max_axis;
|
||||
|
||||
double min_value;
|
||||
double max_value;
|
||||
|
||||
double resolution;
|
||||
} ClutterAxisInfo;
|
||||
|
||||
typedef struct _ClutterKeyInfo
|
||||
{
|
||||
guint keyval;
|
||||
ClutterModifierType modifiers;
|
||||
} ClutterKeyInfo;
|
||||
|
||||
typedef struct _ClutterScrollInfo
|
||||
{
|
||||
guint axis_id;
|
||||
ClutterScrollDirection direction;
|
||||
double increment;
|
||||
|
||||
double last_value;
|
||||
guint last_value_valid : 1;
|
||||
} ClutterScrollInfo;
|
||||
|
||||
typedef struct _ClutterTouchInfo
|
||||
{
|
||||
ClutterEventSequence *sequence;
|
||||
ClutterActor *actor;
|
||||
|
||||
float current_x;
|
||||
float current_y;
|
||||
} ClutterTouchInfo;
|
||||
|
||||
typedef struct _ClutterPtrA11yData
|
||||
{
|
||||
int n_btn_pressed;
|
||||
float current_x;
|
||||
float current_y;
|
||||
|
||||
float dwell_x;
|
||||
float dwell_y;
|
||||
gboolean dwell_drag_started;
|
||||
gboolean dwell_gesture_started;
|
||||
guint dwell_timer;
|
||||
guint dwell_position_timer;
|
||||
|
||||
guint secondary_click_timer;
|
||||
gboolean secondary_click_triggered;
|
||||
} ClutterPtrA11yData;
|
||||
|
||||
struct _ClutterInputDevice
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
int id;
|
||||
|
||||
ClutterInputDeviceType device_type;
|
||||
ClutterInputMode device_mode;
|
||||
|
||||
char *device_name;
|
||||
|
||||
ClutterSeat *seat;
|
||||
|
||||
ClutterBackend *backend;
|
||||
|
||||
/* the associated device */
|
||||
ClutterInputDevice *associated;
|
||||
|
||||
GList *slaves;
|
||||
|
||||
/* the actor underneath the pointer */
|
||||
ClutterActor *cursor_actor;
|
||||
GHashTable *inv_touch_sequence_actors;
|
||||
|
||||
/* the actor that has a grab in place for the device */
|
||||
ClutterActor *pointer_grab_actor;
|
||||
ClutterActor *keyboard_grab_actor;
|
||||
GHashTable *sequence_grab_actors;
|
||||
GHashTable *inv_sequence_grab_actors;
|
||||
|
||||
/* the current click count */
|
||||
int click_count;
|
||||
|
||||
/* the stage the device is on */
|
||||
ClutterStage *stage;
|
||||
|
||||
/* the current state */
|
||||
float current_x;
|
||||
float current_y;
|
||||
uint32_t current_time;
|
||||
int current_button_number;
|
||||
ClutterModifierType current_state;
|
||||
|
||||
/* the current touch points states */
|
||||
GHashTable *touch_sequences_info;
|
||||
|
||||
/* the previous state, used for click count generation */
|
||||
int previous_x;
|
||||
int previous_y;
|
||||
uint32_t previous_time;
|
||||
int previous_button_number;
|
||||
ClutterModifierType previous_state;
|
||||
|
||||
GArray *axes;
|
||||
|
||||
guint n_keys;
|
||||
GArray *keys;
|
||||
|
||||
GArray *scroll_info;
|
||||
|
||||
char *vendor_id;
|
||||
char *product_id;
|
||||
char *node_path;
|
||||
|
||||
GPtrArray *tools;
|
||||
|
||||
int n_rings;
|
||||
int n_strips;
|
||||
int n_mode_groups;
|
||||
|
||||
ClutterInputDeviceMapping mapping_mode;
|
||||
|
||||
guint has_cursor : 1;
|
||||
guint is_enabled : 1;
|
||||
|
||||
/* Accessiblity */
|
||||
ClutterVirtualInputDevice *accessibility_virtual_device;
|
||||
ClutterPtrA11yData *ptr_a11y_data;
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_associated_device (ClutterInputDevice *device,
|
||||
ClutterInputDevice *associated);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_add_slave (ClutterInputDevice *master,
|
||||
ClutterInputDevice *slave);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_remove_slave (ClutterInputDevice *master,
|
||||
ClutterInputDevice *slave);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_device_update_from_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
CLUTTER_EXPORT
|
||||
ClutterStage * _clutter_input_device_get_stage (ClutterInputDevice *device);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_stage (ClutterInputDevice *device,
|
||||
ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_coords (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
gfloat x,
|
||||
gfloat y,
|
||||
ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_state (ClutterInputDevice *device,
|
||||
ClutterModifierType state);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_time (ClutterInputDevice *device,
|
||||
guint32 time_);
|
||||
void _clutter_input_device_set_actor (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
ClutterActor *actor,
|
||||
gboolean emit_crossing);
|
||||
CLUTTER_EXPORT
|
||||
ClutterActor * clutter_input_device_update (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
gboolean emit_crossing);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_add_event_sequence (ClutterInputDevice *device,
|
||||
ClutterEvent *event);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_remove_event_sequence (ClutterInputDevice *device,
|
||||
ClutterEvent *event);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_n_keys (ClutterInputDevice *device,
|
||||
guint n_keys);
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_input_device_translate_axis (ClutterInputDevice *device,
|
||||
guint index_,
|
||||
gdouble value,
|
||||
gdouble *axis_value);
|
||||
CLUTTER_EXPORT
|
||||
guint _clutter_input_device_add_axis (ClutterInputDevice *device,
|
||||
ClutterInputAxis axis,
|
||||
gdouble minimum,
|
||||
gdouble maximum,
|
||||
gdouble resolution);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_reset_axes (ClutterInputDevice *device);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_add_scroll_info (ClutterInputDevice *device,
|
||||
guint index_,
|
||||
ClutterScrollDirection direction,
|
||||
gdouble increment);
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_input_device_get_scroll_delta (ClutterInputDevice *device,
|
||||
guint index_,
|
||||
gdouble value,
|
||||
ClutterScrollDirection *direction_p,
|
||||
gdouble *delta_p);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_reset_scroll_info (ClutterInputDevice *device);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_device_add_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterInputDeviceTool *
|
||||
clutter_input_device_lookup_tool (ClutterInputDevice *device,
|
||||
guint64 serial,
|
||||
ClutterInputDeviceToolType type);
|
||||
|
||||
#endif /* CLUTTER_INPUT_DEVICE_PRIVATE_H */
|
@ -37,12 +37,12 @@
|
||||
|
||||
#include "clutter-actor-private.h"
|
||||
#include "clutter-debug.h"
|
||||
#include "clutter-device-manager-private.h"
|
||||
#include "clutter-enum-types.h"
|
||||
#include "clutter-event-private.h"
|
||||
#include "clutter-marshal.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-stage-private.h"
|
||||
#include "clutter-input-device-private.h"
|
||||
#include "clutter-input-device-tool.h"
|
||||
|
||||
#include <math.h>
|
||||
@ -57,7 +57,7 @@ enum
|
||||
PROP_NAME,
|
||||
|
||||
PROP_DEVICE_TYPE,
|
||||
PROP_DEVICE_MANAGER,
|
||||
PROP_SEAT,
|
||||
PROP_DEVICE_MODE,
|
||||
|
||||
PROP_HAS_CURSOR,
|
||||
@ -96,6 +96,7 @@ clutter_input_device_dispose (GObject *gobject)
|
||||
g_clear_pointer (&device->device_name, g_free);
|
||||
g_clear_pointer (&device->vendor_id, g_free);
|
||||
g_clear_pointer (&device->product_id, g_free);
|
||||
g_clear_pointer (&device->node_path, g_free);
|
||||
|
||||
if (device->associated != NULL)
|
||||
{
|
||||
@ -107,6 +108,9 @@ clutter_input_device_dispose (GObject *gobject)
|
||||
device->associated = NULL;
|
||||
}
|
||||
|
||||
if (device->accessibility_virtual_device)
|
||||
g_clear_object (&device->accessibility_virtual_device);
|
||||
|
||||
g_clear_pointer (&device->axes, g_array_unref);
|
||||
g_clear_pointer (&device->keys, g_array_unref);
|
||||
g_clear_pointer (&device->scroll_info, g_array_unref);
|
||||
@ -167,8 +171,8 @@ clutter_input_device_set_property (GObject *gobject,
|
||||
self->device_type = g_value_get_enum (value);
|
||||
break;
|
||||
|
||||
case PROP_DEVICE_MANAGER:
|
||||
self->device_manager = g_value_get_object (value);
|
||||
case PROP_SEAT:
|
||||
self->seat = g_value_get_object (value);
|
||||
break;
|
||||
|
||||
case PROP_DEVICE_MODE:
|
||||
@ -243,8 +247,8 @@ clutter_input_device_get_property (GObject *gobject,
|
||||
g_value_set_enum (value, self->device_type);
|
||||
break;
|
||||
|
||||
case PROP_DEVICE_MANAGER:
|
||||
g_value_set_object (value, self->device_manager);
|
||||
case PROP_SEAT:
|
||||
g_value_set_object (value, self->seat);
|
||||
break;
|
||||
|
||||
case PROP_DEVICE_MODE:
|
||||
@ -358,17 +362,15 @@ clutter_input_device_class_init (ClutterInputDeviceClass *klass)
|
||||
G_PARAM_CONSTRUCT_ONLY);
|
||||
|
||||
/**
|
||||
* ClutterInputDevice:device-manager:
|
||||
* ClutterInputDevice:seat:
|
||||
*
|
||||
* The #ClutterDeviceManager instance which owns the device
|
||||
*
|
||||
* Since: 1.6
|
||||
* The #ClutterSeat instance which owns the device
|
||||
*/
|
||||
obj_props[PROP_DEVICE_MANAGER] =
|
||||
g_param_spec_object ("device-manager",
|
||||
P_("Device Manager"),
|
||||
P_("The device manager instance"),
|
||||
CLUTTER_TYPE_DEVICE_MANAGER,
|
||||
obj_props[PROP_SEAT] =
|
||||
g_param_spec_object ("seat",
|
||||
P_("Seat"),
|
||||
P_("Seat"),
|
||||
CLUTTER_TYPE_SEAT,
|
||||
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||
|
||||
/**
|
||||
@ -796,7 +798,7 @@ on_cursor_actor_reactive_changed (ClutterActor *actor,
|
||||
*
|
||||
* Sets the actor under the pointer coordinates of @device
|
||||
*
|
||||
* This function is called by _clutter_input_device_update()
|
||||
* This function is called by clutter_input_device_update()
|
||||
* and it will:
|
||||
*
|
||||
* - queue a %CLUTTER_LEAVE event on the previous pointer actor
|
||||
@ -988,7 +990,7 @@ clutter_input_device_get_enabled (ClutterInputDevice *device)
|
||||
gboolean
|
||||
clutter_input_device_get_coords (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
ClutterPoint *point)
|
||||
graphene_point_t *point)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
||||
g_return_val_if_fail (point != NULL, FALSE);
|
||||
@ -1014,7 +1016,7 @@ clutter_input_device_get_coords (ClutterInputDevice *device,
|
||||
}
|
||||
|
||||
/*
|
||||
* _clutter_input_device_update:
|
||||
* clutter_input_device_update:
|
||||
* @device: a #ClutterInputDevice
|
||||
*
|
||||
* Updates the input @device by determining the #ClutterActor underneath the
|
||||
@ -1028,14 +1030,14 @@ clutter_input_device_get_coords (ClutterInputDevice *device,
|
||||
* Since: 1.2
|
||||
*/
|
||||
ClutterActor *
|
||||
_clutter_input_device_update (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
gboolean emit_crossing)
|
||||
clutter_input_device_update (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
gboolean emit_crossing)
|
||||
{
|
||||
ClutterStage *stage;
|
||||
ClutterActor *new_cursor_actor;
|
||||
ClutterActor *old_cursor_actor;
|
||||
ClutterPoint point = { -1, -1 };
|
||||
graphene_point_t point = GRAPHENE_POINT_INIT (-1.0f, -1.0f);
|
||||
ClutterInputDeviceType device_type = device->device_type;
|
||||
|
||||
g_assert (device_type != CLUTTER_KEYBOARD_DEVICE &&
|
||||
@ -1221,11 +1223,11 @@ clutter_input_device_get_device_mode (ClutterInputDevice *device)
|
||||
*
|
||||
* translate_native_event_to_clutter (native_event, &c_event);
|
||||
*
|
||||
* // get the device manager
|
||||
* manager = clutter_device_manager_get_default ();
|
||||
* // get the seat
|
||||
* seat = clutter_backend_get_deafult_seat (clutter_get_default_backend ());
|
||||
*
|
||||
* // use the default Core Pointer that Clutter backends register by default
|
||||
* device = clutter_device_manager_get_core_device (manager, %CLUTTER_POINTER_DEVICE);
|
||||
* device = clutter_seat_get_pointer (seat);
|
||||
*
|
||||
* // update the state of the input device
|
||||
* clutter_input_device_update_from_event (device, &c_event, FALSE);
|
||||
@ -1922,6 +1924,157 @@ _clutter_input_device_reset_scroll_info (ClutterInputDevice *device)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_grab_actor_destroy (ClutterActor *actor,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
switch (device->device_type)
|
||||
{
|
||||
case CLUTTER_POINTER_DEVICE:
|
||||
case CLUTTER_TABLET_DEVICE:
|
||||
device->pointer_grab_actor = NULL;
|
||||
break;
|
||||
|
||||
case CLUTTER_KEYBOARD_DEVICE:
|
||||
device->keyboard_grab_actor = NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_input_device_grab:
|
||||
* @device: a #ClutterInputDevice
|
||||
* @actor: a #ClutterActor
|
||||
*
|
||||
* Acquires a grab on @actor for the given @device.
|
||||
*
|
||||
* Any event coming from @device will be delivered to @actor, bypassing
|
||||
* the usual event delivery mechanism, until the grab is released by
|
||||
* calling clutter_input_device_ungrab().
|
||||
*
|
||||
* The grab is client-side: even if the windowing system used by the Clutter
|
||||
* backend has the concept of "device grabs", Clutter will not use them.
|
||||
*
|
||||
* Only #ClutterInputDevice of types %CLUTTER_POINTER_DEVICE,
|
||||
* %CLUTTER_TABLET_DEVICE and %CLUTTER_KEYBOARD_DEVICE can hold a grab.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
void
|
||||
clutter_input_device_grab (ClutterInputDevice *device,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
ClutterActor **grab_actor;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
|
||||
|
||||
switch (device->device_type)
|
||||
{
|
||||
case CLUTTER_POINTER_DEVICE:
|
||||
case CLUTTER_TABLET_DEVICE:
|
||||
grab_actor = &device->pointer_grab_actor;
|
||||
break;
|
||||
|
||||
case CLUTTER_KEYBOARD_DEVICE:
|
||||
grab_actor = &device->keyboard_grab_actor;
|
||||
break;
|
||||
|
||||
default:
|
||||
g_critical ("Only pointer and keyboard devices can grab an actor");
|
||||
return;
|
||||
}
|
||||
|
||||
if (*grab_actor != NULL)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (*grab_actor,
|
||||
G_CALLBACK (on_grab_actor_destroy),
|
||||
device);
|
||||
}
|
||||
|
||||
*grab_actor = actor;
|
||||
|
||||
g_signal_connect (*grab_actor,
|
||||
"destroy",
|
||||
G_CALLBACK (on_grab_actor_destroy),
|
||||
device);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_input_device_ungrab:
|
||||
* @device: a #ClutterInputDevice
|
||||
*
|
||||
* Releases the grab on the @device, if one is in place.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
void
|
||||
clutter_input_device_ungrab (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterActor **grab_actor;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
|
||||
|
||||
switch (device->device_type)
|
||||
{
|
||||
case CLUTTER_POINTER_DEVICE:
|
||||
case CLUTTER_TABLET_DEVICE:
|
||||
grab_actor = &device->pointer_grab_actor;
|
||||
break;
|
||||
|
||||
case CLUTTER_KEYBOARD_DEVICE:
|
||||
grab_actor = &device->keyboard_grab_actor;
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (*grab_actor == NULL)
|
||||
return;
|
||||
|
||||
g_signal_handlers_disconnect_by_func (*grab_actor,
|
||||
G_CALLBACK (on_grab_actor_destroy),
|
||||
device);
|
||||
|
||||
*grab_actor = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_input_device_get_grabbed_actor:
|
||||
* @device: a #ClutterInputDevice
|
||||
*
|
||||
* Retrieves a pointer to the #ClutterActor currently grabbing all
|
||||
* the events coming from @device.
|
||||
*
|
||||
* Return value: (transfer none): a #ClutterActor, or %NULL
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
ClutterActor *
|
||||
clutter_input_device_get_grabbed_actor (ClutterInputDevice *device)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
|
||||
|
||||
switch (device->device_type)
|
||||
{
|
||||
case CLUTTER_POINTER_DEVICE:
|
||||
case CLUTTER_TABLET_DEVICE:
|
||||
return device->pointer_grab_actor;
|
||||
|
||||
case CLUTTER_KEYBOARD_DEVICE:
|
||||
return device->keyboard_grab_actor;
|
||||
|
||||
default:
|
||||
g_critical ("Only pointer and keyboard devices can grab an actor");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
on_grab_sequence_actor_destroy (ClutterActor *actor,
|
||||
ClutterInputDevice *device)
|
||||
@ -2287,3 +2440,19 @@ clutter_input_device_is_grouped (ClutterInputDevice *device,
|
||||
|
||||
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->is_grouped (device, other_device);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_input_device_get_seat:
|
||||
* @device: a #ClutterInputDevice
|
||||
*
|
||||
* Returns the seat the device belongs to
|
||||
*
|
||||
* Returns: (transfer none): the device seat
|
||||
**/
|
||||
ClutterSeat *
|
||||
clutter_input_device_get_seat (ClutterInputDevice *device)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
|
||||
|
||||
return device->seat;
|
||||
}
|
||||
|
@ -28,10 +28,40 @@
|
||||
#error "Only <clutter/clutter.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <clutter/clutter-backend.h>
|
||||
#include <clutter/clutter-types.h>
|
||||
#include <clutter/clutter-seat.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef void (*ClutterEmitInputDeviceEvent) (ClutterEvent *event,
|
||||
ClutterInputDevice *device);
|
||||
|
||||
struct _ClutterInputDeviceClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
gboolean (* keycode_to_evdev) (ClutterInputDevice *device,
|
||||
guint hardware_keycode,
|
||||
guint *evdev_keycode);
|
||||
void (* update_from_tool) (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
|
||||
gboolean (* is_mode_switch_button) (ClutterInputDevice *device,
|
||||
guint group,
|
||||
guint button);
|
||||
gint (* get_group_n_modes) (ClutterInputDevice *device,
|
||||
gint group);
|
||||
|
||||
gboolean (* is_grouped) (ClutterInputDevice *device,
|
||||
ClutterInputDevice *other_device);
|
||||
|
||||
/* Keyboard accessbility */
|
||||
void (* process_kbd_a11y_event) (ClutterEvent *event,
|
||||
ClutterInputDevice *device,
|
||||
ClutterEmitInputDeviceEvent emit_event_func);
|
||||
};
|
||||
|
||||
#define CLUTTER_TYPE_INPUT_DEVICE (clutter_input_device_get_type ())
|
||||
#define CLUTTER_INPUT_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_INPUT_DEVICE, ClutterInputDevice))
|
||||
#define CLUTTER_IS_INPUT_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_INPUT_DEVICE))
|
||||
@ -58,7 +88,7 @@ gint clutter_input_device_get_device_id (ClutterInputDev
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_input_device_get_coords (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
ClutterPoint *point);
|
||||
graphene_point_t *point);
|
||||
CLUTTER_EXPORT
|
||||
ClutterModifierType clutter_input_device_get_modifier_state (ClutterInputDevice *device);
|
||||
CLUTTER_EXPORT
|
||||
@ -171,6 +201,8 @@ void clutter_input_device_set_mapping_mode (ClutterInputDev
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_input_device_is_grouped (ClutterInputDevice *device,
|
||||
ClutterInputDevice *other_device);
|
||||
CLUTTER_EXPORT
|
||||
ClutterSeat * clutter_input_device_get_seat (ClutterInputDevice *device);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -29,7 +29,7 @@ void clutter_input_focus_focus_out (ClutterInputFocus *focus);
|
||||
void clutter_input_focus_commit (ClutterInputFocus *focus,
|
||||
const gchar *text);
|
||||
void clutter_input_focus_delete_surrounding (ClutterInputFocus *focus,
|
||||
guint offset,
|
||||
int offset,
|
||||
guint len);
|
||||
void clutter_input_focus_request_surrounding (ClutterInputFocus *focus);
|
||||
|
||||
|
@ -89,8 +89,8 @@ clutter_input_focus_reset (ClutterInputFocus *focus)
|
||||
}
|
||||
|
||||
void
|
||||
clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const ClutterRect *rect)
|
||||
clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const graphene_rect_t *rect)
|
||||
{
|
||||
ClutterInputFocusPrivate *priv;
|
||||
|
||||
@ -217,7 +217,7 @@ clutter_input_focus_commit (ClutterInputFocus *focus,
|
||||
|
||||
void
|
||||
clutter_input_focus_delete_surrounding (ClutterInputFocus *focus,
|
||||
guint offset,
|
||||
int offset,
|
||||
guint len)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_INPUT_FOCUS (focus));
|
||||
|
@ -41,7 +41,7 @@ struct _ClutterInputFocusClass
|
||||
|
||||
void (* request_surrounding) (ClutterInputFocus *focus);
|
||||
void (* delete_surrounding) (ClutterInputFocus *focus,
|
||||
guint offset,
|
||||
int offset,
|
||||
guint len);
|
||||
void (* commit_text) (ClutterInputFocus *focus,
|
||||
const gchar *text);
|
||||
@ -57,8 +57,8 @@ gboolean clutter_input_focus_is_focused (ClutterInputFocus *focus);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_focus_reset (ClutterInputFocus *focus);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const ClutterRect *rect);
|
||||
void clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const graphene_rect_t *rect);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_focus_set_surrounding (ClutterInputFocus *focus,
|
||||
|
@ -26,8 +26,8 @@ ClutterInputFocus * clutter_input_method_get_focus (ClutterInputMethod *method);
|
||||
|
||||
void clutter_input_method_reset (ClutterInputMethod *method);
|
||||
|
||||
void clutter_input_method_set_cursor_location (ClutterInputMethod *method,
|
||||
const ClutterRect *rect);
|
||||
void clutter_input_method_set_cursor_location (ClutterInputMethod *method,
|
||||
const graphene_rect_t *rect);
|
||||
void clutter_input_method_set_surrounding (ClutterInputMethod *method,
|
||||
const gchar *text,
|
||||
guint cursor,
|
||||
|
@ -22,10 +22,10 @@
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-private.h"
|
||||
#include "clutter/clutter-input-device-private.h"
|
||||
#include "clutter/clutter-input-method.h"
|
||||
#include "clutter/clutter-input-method-private.h"
|
||||
#include "clutter/clutter-input-focus-private.h"
|
||||
#include "clutter/clutter-device-manager-private.h"
|
||||
|
||||
typedef struct _ClutterInputMethodPrivate ClutterInputMethodPrivate;
|
||||
|
||||
@ -168,7 +168,7 @@ clutter_input_method_class_init (ClutterInputMethodClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
|
||||
G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_UINT);
|
||||
signals[REQUEST_SURROUNDING] =
|
||||
g_signal_new ("request-surrounding",
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
@ -187,7 +187,7 @@ clutter_input_method_class_init (ClutterInputMethodClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1, CLUTTER_TYPE_RECT);
|
||||
G_TYPE_NONE, 1, GRAPHENE_TYPE_RECT);
|
||||
|
||||
pspecs[PROP_CONTENT_HINTS] =
|
||||
g_param_spec_flags ("content-hints",
|
||||
@ -292,7 +292,7 @@ clutter_input_method_commit (ClutterInputMethod *im,
|
||||
|
||||
void
|
||||
clutter_input_method_delete_surrounding (ClutterInputMethod *im,
|
||||
guint offset,
|
||||
int offset,
|
||||
guint len)
|
||||
{
|
||||
ClutterInputMethodPrivate *priv;
|
||||
@ -377,8 +377,8 @@ clutter_input_method_reset (ClutterInputMethod *im)
|
||||
}
|
||||
|
||||
void
|
||||
clutter_input_method_set_cursor_location (ClutterInputMethod *im,
|
||||
const ClutterRect *rect)
|
||||
clutter_input_method_set_cursor_location (ClutterInputMethod *im,
|
||||
const graphene_rect_t *rect)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im));
|
||||
|
||||
@ -452,8 +452,8 @@ clutter_input_method_forward_key (ClutterInputMethod *im,
|
||||
gboolean press)
|
||||
{
|
||||
ClutterInputMethodPrivate *priv;
|
||||
ClutterDeviceManager *device_manager;
|
||||
ClutterInputDevice *keyboard;
|
||||
ClutterSeat *seat;
|
||||
ClutterStage *stage;
|
||||
ClutterEvent *event;
|
||||
|
||||
@ -463,9 +463,8 @@ clutter_input_method_forward_key (ClutterInputMethod *im,
|
||||
if (!priv->focus)
|
||||
return;
|
||||
|
||||
device_manager = clutter_device_manager_get_default ();
|
||||
keyboard = clutter_device_manager_get_core_device (device_manager,
|
||||
CLUTTER_KEYBOARD_DEVICE);
|
||||
seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
|
||||
keyboard = clutter_seat_get_keyboard (seat);
|
||||
stage = _clutter_input_device_get_stage (keyboard);
|
||||
if (stage == NULL)
|
||||
return;
|
||||
|
@ -42,8 +42,8 @@ struct _ClutterInputMethodClass
|
||||
|
||||
void (* reset) (ClutterInputMethod *im);
|
||||
|
||||
void (* set_cursor_location) (ClutterInputMethod *im,
|
||||
const ClutterRect *rect);
|
||||
void (* set_cursor_location) (ClutterInputMethod *im,
|
||||
const graphene_rect_t *rect);
|
||||
void (* set_surrounding) (ClutterInputMethod *im,
|
||||
const gchar *text,
|
||||
guint cursor,
|
||||
@ -68,7 +68,7 @@ void clutter_input_method_commit (ClutterInputMethod *im,
|
||||
const gchar *text);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_method_delete_surrounding (ClutterInputMethod *im,
|
||||
guint offset,
|
||||
int offset,
|
||||
guint len);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_method_request_surrounding (ClutterInputMethod *im);
|
||||
|
47
clutter/clutter/clutter-input-pointer-a11y-private.h
Normal file
47
clutter/clutter/clutter-input-pointer-a11y-private.h
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Red Hat
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Author: Olivier Fourdan <ofourdan@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef __CLUTTER_INPUT_POINTER_A11Y_H__
|
||||
#define __CLUTTER_INPUT_POINTER_A11Y_H__
|
||||
|
||||
#include <clutter/clutter-types.h>
|
||||
#include "clutter-enum-types.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_pointer_a11y_add_device (ClutterInputDevice *device);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_pointer_a11y_remove_device (ClutterInputDevice *device);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_pointer_a11y_on_motion_event (ClutterInputDevice *device,
|
||||
float x,
|
||||
float y);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_pointer_a11y_on_button_event (ClutterInputDevice *device,
|
||||
int button,
|
||||
gboolean pressed);
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_is_input_pointer_a11y_enabled (ClutterInputDevice *device);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_INPUT_POINTER_A11Y_H__ */
|
706
clutter/clutter/clutter-input-pointer-a11y.c
Normal file
706
clutter/clutter/clutter-input-pointer-a11y.c
Normal file
@ -0,0 +1,706 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Red Hat
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Author: Olivier Fourdan <ofourdan@redhat.com>
|
||||
*
|
||||
* This reimplements in Clutter the same behavior as mousetweaks original
|
||||
* implementation by Gerd Kohlberger <gerdko gmail com>
|
||||
* mousetweaks Copyright (C) 2007-2010 Gerd Kohlberger <gerdko gmail com>
|
||||
*/
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-enum-types.h"
|
||||
#include "clutter-input-device.h"
|
||||
#include "clutter-input-device-private.h"
|
||||
#include "clutter-input-pointer-a11y-private.h"
|
||||
#include "clutter-main.h"
|
||||
#include "clutter-virtual-input-device.h"
|
||||
|
||||
static gboolean
|
||||
is_secondary_click_enabled (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
return (settings.controls & CLUTTER_A11Y_SECONDARY_CLICK_ENABLED);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_dwell_click_enabled (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
return (settings.controls & CLUTTER_A11Y_DWELL_ENABLED);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
get_secondary_click_delay (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
return settings.secondary_click_delay;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
get_dwell_delay (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
return settings.dwell_delay;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
get_dwell_threshold (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
return settings.dwell_threshold;
|
||||
}
|
||||
|
||||
static ClutterPointerA11yDwellMode
|
||||
get_dwell_mode (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
return settings.dwell_mode;
|
||||
}
|
||||
|
||||
static ClutterPointerA11yDwellClickType
|
||||
get_dwell_click_type (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
return settings.dwell_click_type;
|
||||
}
|
||||
|
||||
static ClutterPointerA11yDwellClickType
|
||||
get_dwell_click_type_for_direction (ClutterInputDevice *device,
|
||||
ClutterPointerA11yDwellDirection direction)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
if (direction == settings.dwell_gesture_single)
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY;
|
||||
else if (direction == settings.dwell_gesture_double)
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE;
|
||||
else if (direction == settings.dwell_gesture_drag)
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG;
|
||||
else if (direction == settings.dwell_gesture_secondary)
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY;
|
||||
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE;
|
||||
}
|
||||
|
||||
static void
|
||||
emit_button_press (ClutterInputDevice *device,
|
||||
gint button)
|
||||
{
|
||||
clutter_virtual_input_device_notify_button (device->accessibility_virtual_device,
|
||||
g_get_monotonic_time (),
|
||||
button,
|
||||
CLUTTER_BUTTON_STATE_PRESSED);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_button_release (ClutterInputDevice *device,
|
||||
gint button)
|
||||
{
|
||||
clutter_virtual_input_device_notify_button (device->accessibility_virtual_device,
|
||||
g_get_monotonic_time (),
|
||||
button,
|
||||
CLUTTER_BUTTON_STATE_RELEASED);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_button_click (ClutterInputDevice *device,
|
||||
gint button)
|
||||
{
|
||||
emit_button_press (device, button);
|
||||
emit_button_release (device, button);
|
||||
}
|
||||
|
||||
static void
|
||||
restore_dwell_position (ClutterInputDevice *device)
|
||||
{
|
||||
clutter_virtual_input_device_notify_absolute_motion (device->accessibility_virtual_device,
|
||||
g_get_monotonic_time (),
|
||||
device->ptr_a11y_data->dwell_x,
|
||||
device->ptr_a11y_data->dwell_y);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
trigger_secondary_click (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
|
||||
device->ptr_a11y_data->secondary_click_triggered = TRUE;
|
||||
device->ptr_a11y_data->secondary_click_timer = 0;
|
||||
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
TRUE);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
start_secondary_click_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
unsigned int delay = get_secondary_click_delay (device);
|
||||
|
||||
device->ptr_a11y_data->secondary_click_timer =
|
||||
clutter_threads_add_timeout (delay, trigger_secondary_click, device);
|
||||
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-started",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
delay);
|
||||
}
|
||||
|
||||
static void
|
||||
stop_secondary_click_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
if (device->ptr_a11y_data->secondary_click_timer)
|
||||
{
|
||||
g_clear_handle_id (&device->ptr_a11y_data->secondary_click_timer,
|
||||
g_source_remove);
|
||||
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
FALSE);
|
||||
}
|
||||
device->ptr_a11y_data->secondary_click_triggered = FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pointer_has_moved (ClutterInputDevice *device)
|
||||
{
|
||||
float dx, dy;
|
||||
gint threshold;
|
||||
|
||||
dx = device->ptr_a11y_data->dwell_x - device->ptr_a11y_data->current_x;
|
||||
dy = device->ptr_a11y_data->dwell_y - device->ptr_a11y_data->current_y;
|
||||
threshold = get_dwell_threshold (device);
|
||||
|
||||
/* Pythagorean theorem */
|
||||
return ((dx * dx) + (dy * dy)) > (threshold * threshold);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_secondary_click_pending (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->secondary_click_timer != 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_secondary_click_triggered (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->secondary_click_triggered;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_dwell_click_pending (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->dwell_timer != 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_dwell_dragging (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->dwell_drag_started;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_dwell_gesturing (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->dwell_gesture_started;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
has_button_pressed (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->n_btn_pressed > 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
should_start_secondary_click_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
return !is_dwell_dragging (device);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
should_start_dwell (ClutterInputDevice *device)
|
||||
{
|
||||
/* We should trigger a dwell if we've not already started one, and if
|
||||
* no button is currently pressed or we are in the middle of a dwell
|
||||
* drag action.
|
||||
*/
|
||||
return !is_dwell_click_pending (device) &&
|
||||
(is_dwell_dragging (device) ||
|
||||
!has_button_pressed (device));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
should_stop_dwell (ClutterInputDevice *device)
|
||||
{
|
||||
/* We should stop a dwell if the motion exceeds the threshold, unless
|
||||
* we've started a gesture, because we want to keep the original dwell
|
||||
* location to both detect a gesture and restore the original pointer
|
||||
* location once the gesture is finished.
|
||||
*/
|
||||
return pointer_has_moved (device) &&
|
||||
!is_dwell_gesturing (device);
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
should_update_dwell_position (ClutterInputDevice *device)
|
||||
{
|
||||
return !is_dwell_gesturing (device) &&
|
||||
!is_dwell_click_pending (device) &&
|
||||
!is_secondary_click_pending (device);
|
||||
}
|
||||
|
||||
static void
|
||||
update_dwell_click_type (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
ClutterPointerA11yDwellClickType dwell_click_type;
|
||||
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
dwell_click_type = settings.dwell_click_type;
|
||||
switch (dwell_click_type)
|
||||
{
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE:
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY:
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE:
|
||||
dwell_click_type = CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY;
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG:
|
||||
if (!is_dwell_dragging (device))
|
||||
dwell_click_type = CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY;
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY:
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (dwell_click_type != settings.dwell_click_type)
|
||||
{
|
||||
settings.dwell_click_type = dwell_click_type;
|
||||
clutter_seat_set_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-dwell-click-type-changed",
|
||||
dwell_click_type);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
emit_dwell_click (ClutterInputDevice *device,
|
||||
ClutterPointerA11yDwellClickType dwell_click_type)
|
||||
{
|
||||
switch (dwell_click_type)
|
||||
{
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY:
|
||||
emit_button_click (device, CLUTTER_BUTTON_PRIMARY);
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE:
|
||||
emit_button_click (device, CLUTTER_BUTTON_PRIMARY);
|
||||
emit_button_click (device, CLUTTER_BUTTON_PRIMARY);
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG:
|
||||
if (is_dwell_dragging (device))
|
||||
{
|
||||
emit_button_release (device, CLUTTER_BUTTON_PRIMARY);
|
||||
device->ptr_a11y_data->dwell_drag_started = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
emit_button_press (device, CLUTTER_BUTTON_PRIMARY);
|
||||
device->ptr_a11y_data->dwell_drag_started = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY:
|
||||
emit_button_click (device, CLUTTER_BUTTON_SECONDARY);
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE:
|
||||
emit_button_click (device, CLUTTER_BUTTON_MIDDLE);
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static ClutterPointerA11yDwellDirection
|
||||
get_dwell_direction (ClutterInputDevice *device)
|
||||
{
|
||||
float dx, dy;
|
||||
|
||||
dx = ABS (device->ptr_a11y_data->dwell_x - device->ptr_a11y_data->current_x);
|
||||
dy = ABS (device->ptr_a11y_data->dwell_y - device->ptr_a11y_data->current_y);
|
||||
|
||||
/* The pointer hasn't moved */
|
||||
if (!pointer_has_moved (device))
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_NONE;
|
||||
|
||||
if (device->ptr_a11y_data->dwell_x < device->ptr_a11y_data->current_x)
|
||||
{
|
||||
if (dx > dy)
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_LEFT;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dx > dy)
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_RIGHT;
|
||||
}
|
||||
|
||||
if (device->ptr_a11y_data->dwell_y < device->ptr_a11y_data->current_y)
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_UP;
|
||||
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_DOWN;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
trigger_clear_dwell_gesture (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
|
||||
device->ptr_a11y_data->dwell_timer = 0;
|
||||
device->ptr_a11y_data->dwell_gesture_started = FALSE;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
trigger_dwell_gesture (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
ClutterPointerA11yDwellDirection direction;
|
||||
unsigned int delay = get_dwell_delay (device);
|
||||
|
||||
restore_dwell_position (device);
|
||||
direction = get_dwell_direction (device);
|
||||
emit_dwell_click (device,
|
||||
get_dwell_click_type_for_direction (device,
|
||||
direction));
|
||||
|
||||
/* Do not clear the gesture right away, otherwise we'll start another one */
|
||||
device->ptr_a11y_data->dwell_timer =
|
||||
clutter_threads_add_timeout (delay, trigger_clear_dwell_gesture, device);
|
||||
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
||||
TRUE);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
start_dwell_gesture_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
unsigned int delay = get_dwell_delay (device);
|
||||
|
||||
device->ptr_a11y_data->dwell_timer =
|
||||
clutter_threads_add_timeout (delay, trigger_dwell_gesture, device);
|
||||
device->ptr_a11y_data->dwell_gesture_started = TRUE;
|
||||
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-started",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
||||
delay);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
trigger_dwell_click (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
|
||||
device->ptr_a11y_data->dwell_timer = 0;
|
||||
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
TRUE);
|
||||
|
||||
if (get_dwell_mode (device) == CLUTTER_A11Y_DWELL_MODE_GESTURE)
|
||||
{
|
||||
if (is_dwell_dragging (device))
|
||||
emit_dwell_click (device, CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG);
|
||||
else
|
||||
start_dwell_gesture_timeout (device);
|
||||
}
|
||||
else
|
||||
{
|
||||
emit_dwell_click (device, get_dwell_click_type (device));
|
||||
update_dwell_click_type (device);
|
||||
}
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
start_dwell_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
unsigned int delay = get_dwell_delay (device);
|
||||
|
||||
device->ptr_a11y_data->dwell_timer =
|
||||
clutter_threads_add_timeout (delay, trigger_dwell_click, device);
|
||||
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-started",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
delay);
|
||||
}
|
||||
|
||||
static void
|
||||
stop_dwell_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
if (device->ptr_a11y_data->dwell_timer)
|
||||
{
|
||||
g_clear_handle_id (&device->ptr_a11y_data->dwell_timer, g_source_remove);
|
||||
device->ptr_a11y_data->dwell_gesture_started = FALSE;
|
||||
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
trigger_dwell_position_timeout (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
|
||||
device->ptr_a11y_data->dwell_position_timer = 0;
|
||||
|
||||
if (is_dwell_click_enabled (device))
|
||||
{
|
||||
if (!pointer_has_moved (device))
|
||||
start_dwell_timeout (device);
|
||||
}
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
start_dwell_position_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
device->ptr_a11y_data->dwell_position_timer =
|
||||
clutter_threads_add_timeout (100, trigger_dwell_position_timeout, device);
|
||||
}
|
||||
|
||||
static void
|
||||
stop_dwell_position_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
g_clear_handle_id (&device->ptr_a11y_data->dwell_position_timer,
|
||||
g_source_remove);
|
||||
}
|
||||
|
||||
static void
|
||||
update_dwell_position (ClutterInputDevice *device)
|
||||
{
|
||||
device->ptr_a11y_data->dwell_x = device->ptr_a11y_data->current_x;
|
||||
device->ptr_a11y_data->dwell_y = device->ptr_a11y_data->current_y;
|
||||
}
|
||||
|
||||
static void
|
||||
update_current_position (ClutterInputDevice *device,
|
||||
float x,
|
||||
float y)
|
||||
{
|
||||
device->ptr_a11y_data->current_x = x;
|
||||
device->ptr_a11y_data->current_y = y;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_device_core_pointer (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterInputDevice *core_pointer;
|
||||
|
||||
core_pointer = clutter_seat_get_pointer (device->seat);
|
||||
if (core_pointer == NULL)
|
||||
return FALSE;
|
||||
|
||||
return (core_pointer == device);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_input_pointer_a11y_add_device (ClutterInputDevice *device)
|
||||
{
|
||||
if (!is_device_core_pointer (device))
|
||||
return;
|
||||
|
||||
device->accessibility_virtual_device =
|
||||
clutter_seat_create_virtual_device (device->seat,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
|
||||
device->ptr_a11y_data = g_new0 (ClutterPtrA11yData, 1);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_input_pointer_a11y_remove_device (ClutterInputDevice *device)
|
||||
{
|
||||
if (!is_device_core_pointer (device))
|
||||
return;
|
||||
|
||||
/* Terminate a drag if started */
|
||||
if (is_dwell_dragging (device))
|
||||
emit_dwell_click (device, CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG);
|
||||
|
||||
stop_dwell_position_timeout (device);
|
||||
stop_dwell_timeout (device);
|
||||
stop_secondary_click_timeout (device);
|
||||
|
||||
g_clear_pointer (&device->ptr_a11y_data, g_free);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_input_pointer_a11y_on_motion_event (ClutterInputDevice *device,
|
||||
float x,
|
||||
float y)
|
||||
{
|
||||
if (!is_device_core_pointer (device))
|
||||
return;
|
||||
|
||||
if (!_clutter_is_input_pointer_a11y_enabled (device))
|
||||
return;
|
||||
|
||||
update_current_position (device, x, y);
|
||||
|
||||
if (is_secondary_click_enabled (device))
|
||||
{
|
||||
if (pointer_has_moved (device))
|
||||
stop_secondary_click_timeout (device);
|
||||
}
|
||||
|
||||
if (is_dwell_click_enabled (device))
|
||||
{
|
||||
stop_dwell_position_timeout (device);
|
||||
|
||||
if (should_stop_dwell (device))
|
||||
stop_dwell_timeout (device);
|
||||
|
||||
if (should_start_dwell (device))
|
||||
start_dwell_position_timeout (device);
|
||||
}
|
||||
|
||||
if (should_update_dwell_position (device))
|
||||
update_dwell_position (device);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_input_pointer_a11y_on_button_event (ClutterInputDevice *device,
|
||||
int button,
|
||||
gboolean pressed)
|
||||
{
|
||||
if (!is_device_core_pointer (device))
|
||||
return;
|
||||
|
||||
if (!_clutter_is_input_pointer_a11y_enabled (device))
|
||||
return;
|
||||
|
||||
if (pressed)
|
||||
{
|
||||
device->ptr_a11y_data->n_btn_pressed++;
|
||||
|
||||
stop_dwell_position_timeout (device);
|
||||
|
||||
if (is_dwell_click_enabled (device))
|
||||
stop_dwell_timeout (device);
|
||||
|
||||
if (is_dwell_dragging (device))
|
||||
stop_dwell_timeout (device);
|
||||
|
||||
if (is_secondary_click_enabled (device))
|
||||
{
|
||||
if (button == CLUTTER_BUTTON_PRIMARY)
|
||||
{
|
||||
if (should_start_secondary_click_timeout (device))
|
||||
start_secondary_click_timeout (device);
|
||||
}
|
||||
else if (is_secondary_click_pending (device))
|
||||
{
|
||||
stop_secondary_click_timeout (device);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (has_button_pressed (device))
|
||||
device->ptr_a11y_data->n_btn_pressed--;
|
||||
|
||||
if (is_secondary_click_triggered (device))
|
||||
{
|
||||
emit_button_click (device, CLUTTER_BUTTON_SECONDARY);
|
||||
stop_secondary_click_timeout (device);
|
||||
}
|
||||
|
||||
if (is_secondary_click_pending (device))
|
||||
stop_secondary_click_timeout (device);
|
||||
|
||||
if (is_dwell_dragging (device))
|
||||
emit_dwell_click (device, CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG);
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_is_input_pointer_a11y_enabled (ClutterInputDevice *device)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
||||
|
||||
return (is_secondary_click_enabled (device) || is_dwell_click_enabled (device));
|
||||
}
|
@ -37,9 +37,6 @@
|
||||
* any object taking a reference on a #ClutterInterval instance should
|
||||
* also take ownership of the interval by using g_object_ref_sink().
|
||||
*
|
||||
* #ClutterInterval is used by #ClutterAnimation to define the
|
||||
* interval of values that an implicit animation should tween over.
|
||||
*
|
||||
* #ClutterInterval can be subclassed to override the validation
|
||||
* and value computation.
|
||||
*
|
||||
|
@ -62,3 +62,9 @@ clutter_keymap_get_caps_lock_state (ClutterKeymap *keymap)
|
||||
{
|
||||
return CLUTTER_KEYMAP_GET_CLASS (keymap)->get_caps_lock_state (keymap);
|
||||
}
|
||||
|
||||
PangoDirection
|
||||
clutter_keymap_get_direction (ClutterKeymap *keymap)
|
||||
{
|
||||
return CLUTTER_KEYMAP_GET_CLASS (keymap)->get_direction (keymap);
|
||||
}
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <clutter/clutter-macros.h>
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <pango/pango.h>
|
||||
|
||||
typedef struct _ClutterKeymap ClutterKeymap;
|
||||
typedef struct _ClutterKeymapClass ClutterKeymapClass;
|
||||
@ -39,6 +40,7 @@ struct _ClutterKeymapClass
|
||||
|
||||
gboolean (* get_num_lock_state) (ClutterKeymap *keymap);
|
||||
gboolean (* get_caps_lock_state) (ClutterKeymap *keymap);
|
||||
PangoDirection (* get_direction) (ClutterKeymap *keymap);
|
||||
};
|
||||
|
||||
#define CLUTTER_TYPE_KEYMAP (clutter_keymap_get_type ())
|
||||
@ -53,4 +55,6 @@ gboolean clutter_keymap_get_num_lock_state (ClutterKeymap *keymap);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_keymap_get_caps_lock_state (ClutterKeymap *keymap);
|
||||
|
||||
PangoDirection clutter_keymap_get_direction (ClutterKeymap *keymap);
|
||||
|
||||
#endif /* CLUTTER_KEYMAP_H */
|
||||
|
@ -58,10 +58,6 @@ die "Could not open file keysymdef.h: $!\n"
|
||||
die "Could not open file clutter-keysyms.h: $!\n"
|
||||
unless open(OUT_KEYSYMS, ">:utf8", "clutter-keysyms.h");
|
||||
|
||||
# Output: clutter/clutter/deprecated/clutter-keysyms.h
|
||||
die "Could not open file clutter-keysyms-compat.h: $!\n"
|
||||
unless open(OUT_KEYSYMS_COMPAT, ">:utf8", "deprecated/clutter-keysyms.h");
|
||||
|
||||
my $LICENSE_HEADER= <<EOF;
|
||||
/* Clutter
|
||||
*
|
||||
@ -85,7 +81,6 @@ my $LICENSE_HEADER= <<EOF;
|
||||
EOF
|
||||
|
||||
print OUT_KEYSYMS $LICENSE_HEADER;
|
||||
print OUT_KEYSYMS_COMPAT $LICENSE_HEADER;
|
||||
|
||||
print OUT_KEYSYMS<<EOF;
|
||||
|
||||
@ -104,23 +99,6 @@ print OUT_KEYSYMS<<EOF;
|
||||
|
||||
EOF
|
||||
|
||||
print OUT_KEYSYMS_COMPAT<<EOF;
|
||||
/*
|
||||
* Compatibility version of clutter-keysyms.h.
|
||||
*
|
||||
* Since Clutter 1.4, the key symbol defines have been changed to have
|
||||
* a KEY_ prefix. This is a compatibility header that is included when
|
||||
* deprecated symbols are enabled. Consider porting to the new names
|
||||
* instead.
|
||||
*/
|
||||
|
||||
#ifndef __CLUTTER_KEYSYMS_DEPRECATED_H__
|
||||
#define __CLUTTER_KEYSYMS_DEPRECATED_H__
|
||||
|
||||
#ifndef CLUTTER_DISABLE_DEPRECATED
|
||||
|
||||
EOF
|
||||
|
||||
while (<IN_KEYSYMDEF>)
|
||||
{
|
||||
next if ( ! /^#define / );
|
||||
@ -137,13 +115,8 @@ while (<IN_KEYSYMDEF>)
|
||||
my $element = $keysymelements[1];
|
||||
my $binding = $element;
|
||||
$binding =~ s/^XK_/CLUTTER_KEY_/g;
|
||||
my $compat_binding = $element;
|
||||
$compat_binding =~ s/^XK_/CLUTTER_/g;
|
||||
|
||||
my $deprecation = "CLUTTER_DEPRECATED_MACRO_FOR(\"Deprecated key symbol. Use $binding instead.\")";
|
||||
|
||||
printf OUT_KEYSYMS "#define %s 0x%03x\n", $binding, hex($keysymelements[2]);
|
||||
printf OUT_KEYSYMS_COMPAT "#define %s 0x%03x %s\n", $compat_binding, hex($keysymelements[2]), $deprecation;
|
||||
}
|
||||
|
||||
close IN_KEYSYMDEF;
|
||||
@ -187,11 +160,8 @@ while (<IN_XF86KEYSYM>)
|
||||
my $element = $keysymelements[1];
|
||||
my $binding = $element;
|
||||
$binding =~ s/^XF86XK_/CLUTTER_KEY_/g;
|
||||
my $compat_binding = $element;
|
||||
$compat_binding =~ s/^XF86XK_/CLUTTER_/g;
|
||||
|
||||
printf OUT_KEYSYMS "#define %s 0x%03x\n", $binding, hex($keysymelements[2]);
|
||||
printf OUT_KEYSYMS_COMPAT "#define %s 0x%03x\n", $compat_binding, hex($keysymelements[2]);
|
||||
}
|
||||
|
||||
close IN_XF86KEYSYM;
|
||||
@ -202,13 +172,6 @@ print OUT_KEYSYMS<<EOF;
|
||||
#endif /* __CLUTTER_KEYSYMS_H__ */
|
||||
EOF
|
||||
|
||||
print OUT_KEYSYMS_COMPAT<<EOF;
|
||||
|
||||
#endif /* CLUTTER_DISABLE_DEPRECATED */
|
||||
|
||||
#endif /* __CLUTTER_KEYSYMS_DEPRECATED_H__ */
|
||||
EOF
|
||||
|
||||
foreach my $f (qw/ keysymdef.h XF86keysym.h /) {
|
||||
unlink $f or die "Unable to delete $f: $!";
|
||||
}
|
||||
|
@ -98,11 +98,11 @@
|
||||
* |[
|
||||
* {
|
||||
* "type" : "ClutterBox",
|
||||
* "layout-manager" : { "type" : "ClutterTableLayout" },
|
||||
* "layout-manager" : { "type" : "ClutterGridLayout" },
|
||||
* "children" : [
|
||||
* {
|
||||
* "type" : "ClutterTexture",
|
||||
* "filename" : "image-00.png",
|
||||
* "type" : "ClutterText",
|
||||
* "text" : "Some text",
|
||||
*
|
||||
* "layout::row" : 0,
|
||||
* "layout::column" : 0,
|
||||
@ -112,8 +112,8 @@
|
||||
* "layout::y-expand" : true
|
||||
* },
|
||||
* {
|
||||
* "type" : "ClutterTexture",
|
||||
* "filename" : "image-01.png",
|
||||
* "type" : "ClutterText",
|
||||
* "text" : "Some more text",
|
||||
*
|
||||
* "layout::row" : 0,
|
||||
* "layout::column" : 1,
|
||||
@ -136,7 +136,6 @@
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
#include "deprecated/clutter-container.h"
|
||||
#include "deprecated/clutter-alpha.h"
|
||||
|
||||
#include "clutter-debug.h"
|
||||
#include "clutter-layout-manager.h"
|
||||
@ -164,7 +163,6 @@ G_DEFINE_ABSTRACT_TYPE (ClutterLayoutManager,
|
||||
G_TYPE_INITIALLY_UNOWNED)
|
||||
|
||||
static GQuark quark_layout_meta = 0;
|
||||
static GQuark quark_layout_alpha = 0;
|
||||
|
||||
static guint manager_signals[LAST_SIGNAL] = { 0, };
|
||||
|
||||
@ -255,8 +253,7 @@ layout_manager_real_get_preferred_height (ClutterLayoutManager *manager,
|
||||
static void
|
||||
layout_manager_real_allocate (ClutterLayoutManager *manager,
|
||||
ClutterContainer *container,
|
||||
const ClutterActorBox *allocation,
|
||||
ClutterAllocationFlags flags)
|
||||
const ClutterActorBox *allocation)
|
||||
{
|
||||
LAYOUT_MANAGER_WARN_NOT_IMPLEMENTED (manager, "allocate");
|
||||
}
|
||||
@ -301,102 +298,12 @@ layout_manager_real_get_child_meta_type (ClutterLayoutManager *manager)
|
||||
return G_TYPE_INVALID;
|
||||
}
|
||||
|
||||
/* XXX:2.0 - Remove */
|
||||
static ClutterAlpha *
|
||||
layout_manager_real_begin_animation (ClutterLayoutManager *manager,
|
||||
guint duration,
|
||||
gulong mode)
|
||||
{
|
||||
ClutterTimeline *timeline;
|
||||
ClutterAlpha *alpha;
|
||||
|
||||
alpha = g_object_get_qdata (G_OBJECT (manager), quark_layout_alpha);
|
||||
if (alpha != NULL)
|
||||
{
|
||||
clutter_alpha_set_mode (alpha, mode);
|
||||
|
||||
timeline = clutter_alpha_get_timeline (alpha);
|
||||
clutter_timeline_set_duration (timeline, duration);
|
||||
clutter_timeline_rewind (timeline);
|
||||
|
||||
return alpha;
|
||||
};
|
||||
|
||||
timeline = clutter_timeline_new (duration);
|
||||
|
||||
alpha = clutter_alpha_new_full (timeline, mode);
|
||||
|
||||
/* let the alpha take ownership of the timeline */
|
||||
g_object_unref (timeline);
|
||||
|
||||
g_signal_connect_swapped (timeline, "completed",
|
||||
G_CALLBACK (clutter_layout_manager_end_animation),
|
||||
manager);
|
||||
g_signal_connect_swapped (timeline, "new-frame",
|
||||
G_CALLBACK (clutter_layout_manager_layout_changed),
|
||||
manager);
|
||||
|
||||
g_object_set_qdata_full (G_OBJECT (manager),
|
||||
quark_layout_alpha, alpha,
|
||||
(GDestroyNotify) g_object_unref);
|
||||
|
||||
clutter_timeline_start (timeline);
|
||||
|
||||
return alpha;
|
||||
}
|
||||
|
||||
/* XXX:2.0 - Remove */
|
||||
static gdouble
|
||||
layout_manager_real_get_animation_progress (ClutterLayoutManager *manager)
|
||||
{
|
||||
ClutterAlpha *alpha;
|
||||
|
||||
alpha = g_object_get_qdata (G_OBJECT (manager), quark_layout_alpha);
|
||||
if (alpha == NULL)
|
||||
return 1.0;
|
||||
|
||||
return clutter_alpha_get_alpha (alpha);
|
||||
}
|
||||
|
||||
/* XXX:2.0 - Remove */
|
||||
static void
|
||||
layout_manager_real_end_animation (ClutterLayoutManager *manager)
|
||||
{
|
||||
ClutterTimeline *timeline;
|
||||
ClutterAlpha *alpha;
|
||||
|
||||
alpha = g_object_get_qdata (G_OBJECT (manager), quark_layout_alpha);
|
||||
if (alpha == NULL)
|
||||
return;
|
||||
|
||||
timeline = clutter_alpha_get_timeline (alpha);
|
||||
g_assert (timeline != NULL);
|
||||
|
||||
if (clutter_timeline_is_playing (timeline))
|
||||
clutter_timeline_stop (timeline);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (timeline,
|
||||
G_CALLBACK (clutter_layout_manager_end_animation),
|
||||
manager);
|
||||
g_signal_handlers_disconnect_by_func (timeline,
|
||||
G_CALLBACK (clutter_layout_manager_layout_changed),
|
||||
manager);
|
||||
|
||||
g_object_set_qdata (G_OBJECT (manager), quark_layout_alpha, NULL);
|
||||
|
||||
clutter_layout_manager_layout_changed (manager);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_layout_manager_class_init (ClutterLayoutManagerClass *klass)
|
||||
{
|
||||
quark_layout_meta =
|
||||
g_quark_from_static_string ("clutter-layout-manager-child-meta");
|
||||
|
||||
/* XXX:2.0 - Remove */
|
||||
quark_layout_alpha =
|
||||
g_quark_from_static_string ("clutter-layout-manager-alpha");
|
||||
|
||||
klass->get_preferred_width = layout_manager_real_get_preferred_width;
|
||||
klass->get_preferred_height = layout_manager_real_get_preferred_height;
|
||||
klass->allocate = layout_manager_real_allocate;
|
||||
@ -404,9 +311,6 @@ clutter_layout_manager_class_init (ClutterLayoutManagerClass *klass)
|
||||
klass->get_child_meta_type = layout_manager_real_get_child_meta_type;
|
||||
|
||||
/* XXX:2.0 - Remove */
|
||||
klass->begin_animation = layout_manager_real_begin_animation;
|
||||
klass->get_animation_progress = layout_manager_real_get_animation_progress;
|
||||
klass->end_animation = layout_manager_real_end_animation;
|
||||
klass->set_container = layout_manager_real_set_container;
|
||||
|
||||
/**
|
||||
@ -444,8 +348,7 @@ clutter_layout_manager_class_init (ClutterLayoutManagerClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterLayoutManagerClass,
|
||||
layout_changed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
@ -530,7 +433,6 @@ clutter_layout_manager_get_preferred_height (ClutterLayoutManager *manager,
|
||||
* @container: the #ClutterContainer using @manager
|
||||
* @allocation: the #ClutterActorBox containing the allocated area
|
||||
* of @container
|
||||
* @flags: the allocation flags
|
||||
*
|
||||
* Allocates the children of @container given an area
|
||||
*
|
||||
@ -541,8 +443,7 @@ clutter_layout_manager_get_preferred_height (ClutterLayoutManager *manager,
|
||||
void
|
||||
clutter_layout_manager_allocate (ClutterLayoutManager *manager,
|
||||
ClutterContainer *container,
|
||||
const ClutterActorBox *allocation,
|
||||
ClutterAllocationFlags flags)
|
||||
const ClutterActorBox *allocation)
|
||||
{
|
||||
ClutterLayoutManagerClass *klass;
|
||||
|
||||
@ -551,7 +452,7 @@ clutter_layout_manager_allocate (ClutterLayoutManager *manager,
|
||||
g_return_if_fail (allocation != NULL);
|
||||
|
||||
klass = CLUTTER_LAYOUT_MANAGER_GET_CLASS (manager);
|
||||
klass->allocate (manager, container, allocation, flags);
|
||||
klass->allocate (manager, container, allocation);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -115,8 +115,7 @@ struct _ClutterLayoutManagerClass
|
||||
gfloat *nat_height_p);
|
||||
void (* allocate) (ClutterLayoutManager *manager,
|
||||
ClutterContainer *container,
|
||||
const ClutterActorBox *allocation,
|
||||
ClutterAllocationFlags flags);
|
||||
const ClutterActorBox *allocation);
|
||||
|
||||
void (* set_container) (ClutterLayoutManager *manager,
|
||||
ClutterContainer *container);
|
||||
@ -126,15 +125,6 @@ struct _ClutterLayoutManagerClass
|
||||
ClutterContainer *container,
|
||||
ClutterActor *actor);
|
||||
|
||||
/* deprecated */
|
||||
ClutterAlpha * (* begin_animation) (ClutterLayoutManager *manager,
|
||||
guint duration,
|
||||
gulong mode);
|
||||
/* deprecated */
|
||||
gdouble (* get_animation_progress) (ClutterLayoutManager *manager);
|
||||
/* deprecated */
|
||||
void (* end_animation) (ClutterLayoutManager *manager);
|
||||
|
||||
void (* layout_changed) (ClutterLayoutManager *manager);
|
||||
|
||||
/*< private >*/
|
||||
@ -167,8 +157,7 @@ void clutter_layout_manager_get_preferred_height (ClutterLayoutMa
|
||||
CLUTTER_EXPORT
|
||||
void clutter_layout_manager_allocate (ClutterLayoutManager *manager,
|
||||
ClutterContainer *container,
|
||||
const ClutterActorBox *allocation,
|
||||
ClutterAllocationFlags flags);
|
||||
const ClutterActorBox *allocation);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_layout_manager_set_container (ClutterLayoutManager *manager,
|
||||
@ -213,15 +202,6 @@ void clutter_layout_manager_child_get_property (ClutterLayoutMa
|
||||
const gchar *property_name,
|
||||
GValue *value);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
ClutterAlpha * clutter_layout_manager_begin_animation (ClutterLayoutManager *manager,
|
||||
guint duration,
|
||||
gulong mode);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_layout_manager_end_animation (ClutterLayoutManager *manager);
|
||||
CLUTTER_DEPRECATED
|
||||
gdouble clutter_layout_manager_get_animation_progress (ClutterLayoutManager *manager);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_LAYOUT_MANAGER_H__ */
|
||||
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user