Compare commits
472 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9b2ee14eb1 | ||
![]() |
0a8286e008 | ||
![]() |
42fecdb60b | ||
![]() |
f84ec95d2f | ||
![]() |
4b4cf96de1 | ||
![]() |
c413dd9078 | ||
![]() |
95f3fe7bd5 | ||
![]() |
443dd146e1 | ||
![]() |
2d982b678e | ||
![]() |
7cf61a392d | ||
![]() |
e190efb7af | ||
![]() |
711adcb36e | ||
![]() |
b98ce96d09 | ||
![]() |
b7ad1fb086 | ||
![]() |
d812cecc44 | ||
![]() |
965d74355a | ||
![]() |
92b1359d04 | ||
![]() |
c25fa19208 | ||
![]() |
ad500ef4e5 | ||
![]() |
9a2471db47 | ||
![]() |
db164bcfa2 | ||
![]() |
83553e3f6e | ||
![]() |
3b2f6ae93d | ||
![]() |
bc47f0a1ac | ||
![]() |
c8986d19e5 | ||
![]() |
7baabc7ed0 | ||
![]() |
b0709504ea | ||
![]() |
7e94311e2e | ||
![]() |
e339a57ddf | ||
![]() |
e3b2b90c72 | ||
![]() |
6f094bd399 | ||
![]() |
2c805524b4 | ||
![]() |
95c1baf3d1 | ||
![]() |
6f9b5edd4d | ||
![]() |
31809e1214 | ||
![]() |
82f3bdd14e | ||
![]() |
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 |
@@ -28,6 +28,20 @@ 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:
|
||||
expire_in: 1 day
|
||||
paths:
|
||||
- build
|
||||
only:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
||||
build-without-native-backend-and-wayland:
|
||||
stage: build
|
||||
script:
|
||||
|
@@ -11,6 +11,7 @@ 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 -y update && dnf -y upgrade && \
|
||||
|
||||
dnf builddep -y mutter && \
|
||||
@@ -26,4 +27,6 @@ RUN dnf -y update && dnf -y upgrade && \
|
||||
dnf remove -y gnome-bluetooth-libs-devel dbus-glib-devel upower-devel python3-devel && \
|
||||
dnf remove -y --noautoremove mutter mutter-devel && \
|
||||
|
||||
dnf upgrade -y 'pkgconfig(libpipewire-0.3)' && \
|
||||
|
||||
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 $?
|
||||
}
|
||||
|
||||
|
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"
|
149
NEWS
149
NEWS
@@ -1,3 +1,152 @@
|
||||
3.36.1
|
||||
======
|
||||
* Fix hardware cursor on GPU hotplpug [Pekka; !1097]
|
||||
* Fix black areas around XWayland windows when resizing [Robert, Olivier; !1091]
|
||||
* Fix applying wrong scale to monitors on X11 [Jonas; !1118]
|
||||
* Fix moving/resizing windows via keyboard on wayland [Alynx; !997]
|
||||
* Fix locate-pointer feature interfering with keybindings [Carlos; !1014]
|
||||
* Add support for middle-click emulation [Andrew; !256]
|
||||
* Fix freeze when moving cursor between scaled monitors [Robert; !1125]
|
||||
* Fix popup misplacement with focus-follows-mouse [Jonas Å.; !1122]
|
||||
* Fix misplaced cursor in preedit strings [Carlos; !1132]
|
||||
* Support mirroring with proprietary Nvidia driver [Jonas Å.; !1098]
|
||||
* Support tablets with multiple mode switch buttons in a group [Carlos; !970]
|
||||
* Ignore foreground color for color glyphs (emojis) [Carlos; !1148]
|
||||
* Allow pad mode switches while showing OSD [Carlos; !975]
|
||||
* Fix positioning of OSD for display-attached tablets [Carlos; !971]
|
||||
* Respect configured RANDR panning on X11 [Jonas Å.; !1085]
|
||||
* Use correct texture filtering with scaled displays [Jonas; !1124]
|
||||
* Fix cursor hotspots in virtual machines [Jonas Å.; !1136]
|
||||
* Fix build with GLES and no GL [Georges; !1151]
|
||||
* Work around Firefox bug when copying images on wayland [Robert; !1141]
|
||||
* Fix wrong cursor rotation on rotated displays [Hans; !1153]
|
||||
* Fix glitches in window screencasts [Georges; !1129]
|
||||
* Fix IM support for deleting surrounding text [Takao, Carlos; #539]
|
||||
* Fix map animation of maximized windows [Robert; !1164]
|
||||
* Fixed crashes [Jonas Å., Carlos, Florian, Robert; !1120, !1121,
|
||||
#917, #1132, #1083, !1147, #1147]
|
||||
* Misc. bug fixes and cleanups [Jonas Å., Olivier, Mart, Sebastian, Corentin,
|
||||
Andre, Daniel, Robert, Carlos, Peter, Georges, Jonas D., Florian, Christian;
|
||||
!1115, !1102, !1104, !1106, !1117, !1119, !1101, !1123, #1124, !1130, !1131,
|
||||
!1133, #1065, !1108, !1144, !1145, !1109, !1059, !1107, !999, !1152, #1128,
|
||||
!1155, !1156, !1158, !1157, #1146, !1161, !1163]
|
||||
|
||||
Contributors:
|
||||
Jonas Dreßler, Olivier Fourdan, Takao Fujiwara, Carlos Garnacho, Andrew Gaul,
|
||||
Hans de Goede, Peter Hutterer, Sebastian Keller, Robert Mader,
|
||||
Andre Moreira Magalhaes, Florian Müllner, Georges Basile Stavracas Neto,
|
||||
Corentin Noël, Pekka Paalanen, Christian Rauch, Mart Raudsepp,
|
||||
Daniel van Vugt, Alynx Zhou, Jonas Ådahl
|
||||
|
||||
Translators:
|
||||
Марко Костић [sr], Daniel Șerbănescu [ro]
|
||||
|
||||
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]
|
||||
|
@@ -600,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);
|
||||
|
||||
|
@@ -631,7 +631,7 @@
|
||||
#include "clutter-color-static.h"
|
||||
#include "clutter-color.h"
|
||||
#include "clutter-constraint-private.h"
|
||||
#include "clutter-container.h"
|
||||
#include "clutter-container-private.h"
|
||||
#include "clutter-content-private.h"
|
||||
#include "clutter-debug.h"
|
||||
#include "clutter-easing.h"
|
||||
@@ -710,6 +710,7 @@ struct _ClutterActorPrivate
|
||||
|
||||
guint8 opacity;
|
||||
gint opacity_override;
|
||||
unsigned int inhibit_culling_counter;
|
||||
|
||||
ClutterOffscreenRedirect offscreen_redirect;
|
||||
|
||||
@@ -1124,6 +1125,20 @@ static GQuark quark_actor_layout_info = 0;
|
||||
static GQuark quark_actor_transform_info = 0;
|
||||
static GQuark quark_actor_animation_info = 0;
|
||||
|
||||
static GQuark quark_key = 0;
|
||||
static GQuark quark_motion = 0;
|
||||
static GQuark quark_pointer_focus = 0;
|
||||
static GQuark quark_button = 0;
|
||||
static GQuark quark_scroll = 0;
|
||||
static GQuark quark_stage = 0;
|
||||
static GQuark quark_destroy = 0;
|
||||
static GQuark quark_client = 0;
|
||||
static GQuark quark_delete = 0;
|
||||
static GQuark quark_touch = 0;
|
||||
static GQuark quark_touchpad = 0;
|
||||
static GQuark quark_proximity = 0;
|
||||
static GQuark quark_pad = 0;
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (ClutterActor,
|
||||
clutter_actor,
|
||||
G_TYPE_INITIALLY_UNOWNED,
|
||||
@@ -1778,6 +1793,15 @@ clutter_actor_unmap (ClutterActor *self)
|
||||
clutter_actor_update_map_state (self, MAP_STATE_MAKE_UNMAPPED);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_actor_queue_shallow_relayout (ClutterActor *self)
|
||||
{
|
||||
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
|
||||
|
||||
if (stage != NULL)
|
||||
clutter_stage_queue_actor_relayout (CLUTTER_STAGE (stage), self);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_actor_real_show (ClutterActor *self)
|
||||
{
|
||||
@@ -1811,6 +1835,11 @@ clutter_actor_real_show (ClutterActor *self)
|
||||
|
||||
clutter_actor_queue_relayout (self);
|
||||
}
|
||||
else /* but still don't leave the actor un-allocated before showing it */
|
||||
{
|
||||
clutter_actor_queue_shallow_relayout (self);
|
||||
clutter_actor_queue_redraw (self);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
@@ -2381,6 +2410,7 @@ clutter_actor_should_pick_paint (ClutterActor *self)
|
||||
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE);
|
||||
|
||||
if (CLUTTER_ACTOR_IS_MAPPED (self) &&
|
||||
clutter_actor_has_allocation (self) &&
|
||||
(_clutter_context_get_pick_mode () == CLUTTER_PICK_ALL ||
|
||||
CLUTTER_ACTOR_IS_REACTIVE (self)))
|
||||
return TRUE;
|
||||
@@ -2864,9 +2894,23 @@ clutter_actor_real_queue_relayout (ClutterActor *self)
|
||||
memset (priv->height_requests, 0,
|
||||
N_CACHED_SIZE_REQUESTS * sizeof (SizeRequest));
|
||||
|
||||
/* We need to go all the way up the hierarchy */
|
||||
/* We may need to go all the way up the hierarchy */
|
||||
if (priv->parent != NULL)
|
||||
_clutter_actor_queue_only_relayout (priv->parent);
|
||||
{
|
||||
if (priv->parent->flags & CLUTTER_ACTOR_NO_LAYOUT)
|
||||
{
|
||||
clutter_actor_queue_shallow_relayout (self);
|
||||
|
||||
/* The above might have invalidated the parent's paint volume if self
|
||||
* has moved or resized. DnD seems to require this...
|
||||
*/
|
||||
priv->parent->priv->needs_paint_volume_update = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
_clutter_actor_queue_only_relayout (priv->parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3446,8 +3490,8 @@ _clutter_actor_draw_paint_volume_full (ClutterActor *self,
|
||||
cogl_pipeline_set_color (outline, &cogl_color);
|
||||
|
||||
pipeline_node = clutter_pipeline_node_new (outline);
|
||||
clutter_paint_node_set_name (pipeline_node,
|
||||
"ClutterActor (paint volume outline)");
|
||||
clutter_paint_node_set_static_name (pipeline_node,
|
||||
"ClutterActor (paint volume outline)");
|
||||
clutter_paint_node_add_primitive (pipeline_node, prim);
|
||||
clutter_paint_node_add_child (node, pipeline_node);
|
||||
cogl_object_unref (prim);
|
||||
@@ -3461,8 +3505,8 @@ _clutter_actor_draw_paint_volume_full (ClutterActor *self,
|
||||
pango_layout_set_text (layout, label, -1);
|
||||
|
||||
text_node = clutter_text_node_new (layout, color);
|
||||
clutter_paint_node_set_name (text_node,
|
||||
"ClutterActor (paint volume label)");
|
||||
clutter_paint_node_set_static_name (text_node,
|
||||
"ClutterActor (paint volume label)");
|
||||
clutter_paint_node_add_rectangle (text_node,
|
||||
&(ClutterActorBox) {
|
||||
.x1 = pv->vertices[0].x,
|
||||
@@ -3558,8 +3602,8 @@ _clutter_actor_paint_cull_result (ClutterActor *self,
|
||||
pango_layout_set_text (layout, label, -1);
|
||||
|
||||
text_node = clutter_text_node_new (layout, &color);
|
||||
clutter_paint_node_set_name (text_node,
|
||||
"ClutterActor (paint volume text)");
|
||||
clutter_paint_node_set_static_name (text_node,
|
||||
"ClutterActor (paint volume text)");
|
||||
clutter_paint_node_add_rectangle (text_node,
|
||||
&(ClutterActorBox) {
|
||||
.x1 = 0.f,
|
||||
@@ -3715,7 +3759,13 @@ needs_flatten_effect (ClutterActor *self)
|
||||
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT))
|
||||
return FALSE;
|
||||
|
||||
if (priv->offscreen_redirect & CLUTTER_OFFSCREEN_REDIRECT_ALWAYS)
|
||||
/* We need to enable the effect immediately even in ON_IDLE because that can
|
||||
* only be implemented efficiently within the effect itself.
|
||||
* If it was implemented here using just priv->is_dirty then we would lose
|
||||
* the ability to animate opacity without repaints.
|
||||
*/
|
||||
if ((priv->offscreen_redirect & CLUTTER_OFFSCREEN_REDIRECT_ALWAYS) ||
|
||||
(priv->offscreen_redirect & CLUTTER_OFFSCREEN_REDIRECT_ON_IDLE))
|
||||
return TRUE;
|
||||
else if (priv->offscreen_redirect & CLUTTER_OFFSCREEN_REDIRECT_AUTOMATIC_FOR_OPACITY)
|
||||
{
|
||||
@@ -3834,7 +3884,7 @@ clutter_actor_paint_node (ClutterActor *actor,
|
||||
clear_flags = COGL_BUFFER_BIT_DEPTH;
|
||||
|
||||
node = clutter_root_node_new (fb, &bg_color, clear_flags);
|
||||
clutter_paint_node_set_name (node, "stageClear");
|
||||
clutter_paint_node_set_static_name (node, "stageClear");
|
||||
clutter_paint_node_add_rectangle (node, &box);
|
||||
clutter_paint_node_add_child (root, node);
|
||||
clutter_paint_node_unref (node);
|
||||
@@ -3849,7 +3899,7 @@ clutter_actor_paint_node (ClutterActor *actor,
|
||||
/ 255;
|
||||
|
||||
node = clutter_color_node_new (&bg_color);
|
||||
clutter_paint_node_set_name (node, "backgroundColor");
|
||||
clutter_paint_node_set_static_name (node, "backgroundColor");
|
||||
clutter_paint_node_add_rectangle (node, &box);
|
||||
clutter_paint_node_add_child (root, node);
|
||||
clutter_paint_node_unref (node);
|
||||
@@ -3903,6 +3953,7 @@ clutter_actor_paint (ClutterActor *self,
|
||||
g_autoptr (ClutterPaintNode) root_node = NULL;
|
||||
ClutterActorPrivate *priv;
|
||||
ClutterActorBox clip;
|
||||
gboolean culling_inhibited;
|
||||
gboolean clip_set = FALSE;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||
@@ -3969,11 +4020,14 @@ clutter_actor_paint (ClutterActor *self,
|
||||
|
||||
clutter_actor_get_transform (self, &transform);
|
||||
|
||||
transform_node = clutter_transform_node_new (&transform);
|
||||
clutter_paint_node_add_child (transform_node, root_node);
|
||||
clutter_paint_node_unref (root_node);
|
||||
if (!cogl_matrix_is_identity (&transform))
|
||||
{
|
||||
transform_node = clutter_transform_node_new (&transform);
|
||||
clutter_paint_node_add_child (transform_node, root_node);
|
||||
clutter_paint_node_unref (root_node);
|
||||
|
||||
root_node = g_steal_pointer (&transform_node);
|
||||
root_node = g_steal_pointer (&transform_node);
|
||||
}
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
/* Catch when out-of-band transforms have been made by actors not as part
|
||||
@@ -4048,7 +4102,8 @@ clutter_actor_paint (ClutterActor *self,
|
||||
* paint then the last-paint-volume would likely represent the new
|
||||
* actor position not the old.
|
||||
*/
|
||||
if (!in_clone_paint ())
|
||||
culling_inhibited = priv->inhibit_culling_counter > 0;
|
||||
if (!culling_inhibited && !in_clone_paint ())
|
||||
{
|
||||
gboolean success;
|
||||
/* annoyingly gcc warns if uninitialized even though
|
||||
@@ -4130,7 +4185,7 @@ clutter_actor_continue_paint (ClutterActor *self,
|
||||
*/
|
||||
framebuffer = clutter_paint_context_get_base_framebuffer (paint_context);
|
||||
dummy = _clutter_dummy_node_new (self, framebuffer);
|
||||
clutter_paint_node_set_name (dummy, "Root");
|
||||
clutter_paint_node_set_static_name (dummy, "Root");
|
||||
|
||||
/* XXX - for 1.12, we use the return value of paint_node() to
|
||||
* decide whether we should emit the ::paint signal.
|
||||
@@ -4170,6 +4225,11 @@ clutter_actor_continue_paint (ClutterActor *self,
|
||||
run_flags |= CLUTTER_EFFECT_PAINT_ACTOR_DIRTY;
|
||||
}
|
||||
|
||||
if (priv->current_effect == priv->flatten_effect &&
|
||||
priv->offscreen_redirect & CLUTTER_OFFSCREEN_REDIRECT_ON_IDLE &&
|
||||
run_flags & CLUTTER_EFFECT_PAINT_ACTOR_DIRTY)
|
||||
run_flags |= CLUTTER_EFFECT_PAINT_BYPASS_EFFECT;
|
||||
|
||||
_clutter_effect_paint (priv->current_effect, paint_context, run_flags);
|
||||
|
||||
priv->current_effect = old_current_effect;
|
||||
@@ -4540,7 +4600,7 @@ clutter_actor_remove_child_internal (ClutterActor *self,
|
||||
|
||||
/* we need to emit the signal before dropping the reference */
|
||||
if (emit_actor_removed)
|
||||
g_signal_emit_by_name (self, "actor-removed", child);
|
||||
_clutter_container_emit_actor_removed (CLUTTER_CONTAINER (self), child);
|
||||
|
||||
if (notify_first_last)
|
||||
{
|
||||
@@ -6503,6 +6563,20 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
||||
quark_actor_transform_info = g_quark_from_static_string ("-clutter-actor-transform-info");
|
||||
quark_actor_animation_info = g_quark_from_static_string ("-clutter-actor-animation-info");
|
||||
|
||||
quark_key = g_quark_from_static_string ("key");
|
||||
quark_motion = g_quark_from_static_string ("motion");
|
||||
quark_pointer_focus = g_quark_from_static_string ("pointer-focus");
|
||||
quark_button = g_quark_from_static_string ("button");
|
||||
quark_scroll = g_quark_from_static_string ("scroll");
|
||||
quark_stage = g_quark_from_static_string ("stage");
|
||||
quark_destroy = g_quark_from_static_string ("destroy");
|
||||
quark_client = g_quark_from_static_string ("client");
|
||||
quark_delete = g_quark_from_static_string ("delete");
|
||||
quark_touch = g_quark_from_static_string ("touch");
|
||||
quark_touchpad = g_quark_from_static_string ("touchpad");
|
||||
quark_proximity = g_quark_from_static_string ("proximity");
|
||||
quark_pad = g_quark_from_static_string ("pad");
|
||||
|
||||
object_class->constructor = clutter_actor_constructor;
|
||||
object_class->set_property = clutter_actor_set_property;
|
||||
object_class->get_property = clutter_actor_get_property;
|
||||
@@ -6602,7 +6676,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
||||
g_param_spec_float ("width",
|
||||
P_("Width"),
|
||||
P_("Width of the actor"),
|
||||
0.0, G_MAXFLOAT,
|
||||
-1.0f, G_MAXFLOAT,
|
||||
0.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
@@ -6621,7 +6695,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
||||
g_param_spec_float ("height",
|
||||
P_("Height"),
|
||||
P_("Height of the actor"),
|
||||
0.0, G_MAXFLOAT,
|
||||
-1.0f, G_MAXFLOAT,
|
||||
0.0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
@@ -8538,7 +8612,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
||||
actor_signals[CAPTURED_EVENT] =
|
||||
g_signal_new (I_("captured-event"),
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
|
||||
G_STRUCT_OFFSET (ClutterActorClass, captured_event),
|
||||
_clutter_boolean_handled_accumulator, NULL,
|
||||
_clutter_marshal_BOOLEAN__BOXED,
|
||||
@@ -9725,6 +9799,23 @@ clutter_actor_get_preferred_width (ClutterActor *self,
|
||||
return;
|
||||
}
|
||||
|
||||
/* if the request mode is CONTENT_SIZE we simply return the content width */
|
||||
if (priv->request_mode == CLUTTER_REQUEST_CONTENT_SIZE)
|
||||
{
|
||||
float content_width = 0.f;
|
||||
|
||||
if (priv->content != NULL)
|
||||
clutter_content_get_preferred_size (priv->content, &content_width, NULL);
|
||||
|
||||
if (min_width_p != NULL)
|
||||
*min_width_p = content_width;
|
||||
|
||||
if (natural_width_p != NULL)
|
||||
*natural_width_p = content_width;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_WIDTH);
|
||||
|
||||
/* the remaining cases are:
|
||||
@@ -9873,6 +9964,23 @@ clutter_actor_get_preferred_height (ClutterActor *self,
|
||||
return;
|
||||
}
|
||||
|
||||
/* if the request mode is CONTENT_SIZE we simply return the content height */
|
||||
if (priv->request_mode == CLUTTER_REQUEST_CONTENT_SIZE)
|
||||
{
|
||||
float content_height = 0.f;
|
||||
|
||||
if (priv->content != NULL)
|
||||
clutter_content_get_preferred_size (priv->content, NULL, &content_height);
|
||||
|
||||
if (min_height_p != NULL)
|
||||
*min_height_p = content_height;
|
||||
|
||||
if (natural_height_p != NULL)
|
||||
*natural_height_p = content_height;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_HEIGHT);
|
||||
|
||||
/* the remaining cases are:
|
||||
@@ -13150,7 +13258,7 @@ clutter_actor_add_child_internal (ClutterActor *self,
|
||||
}
|
||||
|
||||
if (emit_actor_added)
|
||||
g_signal_emit_by_name (self, "actor-added", child);
|
||||
_clutter_container_emit_actor_added (CLUTTER_CONTAINER (self), child);
|
||||
|
||||
if (notify_first_last)
|
||||
{
|
||||
@@ -13814,8 +13922,70 @@ clutter_actor_event (ClutterActor *actor,
|
||||
|
||||
if (capture)
|
||||
{
|
||||
g_signal_emit (actor, actor_signals[CAPTURED_EVENT], 0,
|
||||
event,
|
||||
GQuark detail = 0;
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
case CLUTTER_NOTHING:
|
||||
break;
|
||||
case CLUTTER_KEY_PRESS:
|
||||
case CLUTTER_KEY_RELEASE:
|
||||
detail = quark_key;
|
||||
break;
|
||||
case CLUTTER_MOTION:
|
||||
detail = quark_motion;
|
||||
break;
|
||||
case CLUTTER_ENTER:
|
||||
case CLUTTER_LEAVE:
|
||||
detail = quark_pointer_focus;
|
||||
break;
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
detail = quark_button;
|
||||
break;
|
||||
case CLUTTER_SCROLL:
|
||||
detail = quark_scroll;
|
||||
break;
|
||||
case CLUTTER_STAGE_STATE:
|
||||
detail = quark_stage;
|
||||
break;
|
||||
case CLUTTER_DESTROY_NOTIFY:
|
||||
detail = quark_destroy;
|
||||
break;
|
||||
case CLUTTER_CLIENT_MESSAGE:
|
||||
detail = quark_client;
|
||||
break;
|
||||
case CLUTTER_DELETE:
|
||||
detail = quark_delete;
|
||||
break;
|
||||
case CLUTTER_TOUCH_BEGIN:
|
||||
case CLUTTER_TOUCH_UPDATE:
|
||||
case CLUTTER_TOUCH_END:
|
||||
case CLUTTER_TOUCH_CANCEL:
|
||||
detail = quark_touch;
|
||||
break;
|
||||
case CLUTTER_TOUCHPAD_PINCH:
|
||||
case CLUTTER_TOUCHPAD_SWIPE:
|
||||
detail = quark_touchpad;
|
||||
break;
|
||||
case CLUTTER_PROXIMITY_IN:
|
||||
case CLUTTER_PROXIMITY_OUT:
|
||||
detail = quark_proximity;
|
||||
break;
|
||||
case CLUTTER_PAD_BUTTON_PRESS:
|
||||
case CLUTTER_PAD_BUTTON_RELEASE:
|
||||
case CLUTTER_PAD_STRIP:
|
||||
case CLUTTER_PAD_RING:
|
||||
detail = quark_pad;
|
||||
break;
|
||||
case CLUTTER_EVENT_LAST: /* Just keep compiler warnings quiet */
|
||||
break;
|
||||
}
|
||||
|
||||
g_signal_emit (actor,
|
||||
actor_signals[CAPTURED_EVENT],
|
||||
detail,
|
||||
event,
|
||||
&retval);
|
||||
goto out;
|
||||
}
|
||||
@@ -15836,6 +16006,63 @@ clutter_actor_get_opacity_override (ClutterActor *self)
|
||||
return self->priv->opacity_override;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_actor_inhibit_culling:
|
||||
* @actor: a #ClutterActor
|
||||
*
|
||||
* Increases the culling inhibitor counter. Inhibiting culling
|
||||
* forces the actor to be painted even when outside the visible
|
||||
* bounds of the stage view.
|
||||
*
|
||||
* This is usually necessary when an actor is being painted on
|
||||
* another paint context.
|
||||
*
|
||||
* Pair with clutter_actor_uninhibit_culling() when the actor doesn't
|
||||
* need to be painted anymore.
|
||||
*/
|
||||
void
|
||||
clutter_actor_inhibit_culling (ClutterActor *actor)
|
||||
{
|
||||
ClutterActorPrivate *priv;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
|
||||
|
||||
priv = actor->priv;
|
||||
|
||||
priv->inhibit_culling_counter++;
|
||||
_clutter_actor_set_enable_paint_unmapped (actor, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_actor_uninhibit_culling:
|
||||
* @actor: a #ClutterActor
|
||||
*
|
||||
* Decreases the culling inhibitor counter. See clutter_actor_inhibit_culling()
|
||||
* for when inhibit culling is necessary.
|
||||
*
|
||||
* Calling this function without a matching call to
|
||||
* clutter_actor_inhibit_culling() is a programming error.
|
||||
*/
|
||||
void
|
||||
clutter_actor_uninhibit_culling (ClutterActor *actor)
|
||||
{
|
||||
ClutterActorPrivate *priv;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
|
||||
|
||||
priv = actor->priv;
|
||||
|
||||
if (priv->inhibit_culling_counter == 0)
|
||||
{
|
||||
g_critical ("Unpaired call to clutter_actor_uninhibit_culling");
|
||||
return;
|
||||
}
|
||||
|
||||
priv->inhibit_culling_counter--;
|
||||
if (priv->inhibit_culling_counter == 0)
|
||||
_clutter_actor_set_enable_paint_unmapped (actor, FALSE);
|
||||
}
|
||||
|
||||
/* Allows you to disable applying the actors model view transform during
|
||||
* a paint. Used by ClutterClone. */
|
||||
void
|
||||
@@ -17549,10 +17776,42 @@ _clutter_actor_compute_resource_scale (ClutterActor *self,
|
||||
resource_scale))
|
||||
{
|
||||
if (priv->parent)
|
||||
return _clutter_actor_compute_resource_scale (priv->parent,
|
||||
resource_scale);
|
||||
{
|
||||
gboolean in_clone_paint;
|
||||
gboolean was_parent_in_clone_paint;
|
||||
gboolean was_parent_unmapped;
|
||||
gboolean was_parent_paint_unmapped;
|
||||
gboolean ret;
|
||||
|
||||
in_clone_paint = clutter_actor_is_in_clone_paint (self);
|
||||
was_parent_unmapped = !clutter_actor_is_mapped (priv->parent);
|
||||
was_parent_in_clone_paint =
|
||||
clutter_actor_is_in_clone_paint (priv->parent);
|
||||
was_parent_paint_unmapped = priv->parent->priv->enable_paint_unmapped;
|
||||
|
||||
if (in_clone_paint && was_parent_unmapped)
|
||||
{
|
||||
_clutter_actor_set_in_clone_paint (priv->parent, TRUE);
|
||||
_clutter_actor_set_enable_paint_unmapped (priv->parent, TRUE);
|
||||
}
|
||||
|
||||
ret = _clutter_actor_compute_resource_scale (priv->parent,
|
||||
resource_scale);
|
||||
|
||||
if (in_clone_paint && was_parent_unmapped)
|
||||
{
|
||||
_clutter_actor_set_in_clone_paint (priv->parent,
|
||||
was_parent_in_clone_paint);
|
||||
_clutter_actor_set_enable_paint_unmapped (priv->parent,
|
||||
was_parent_paint_unmapped);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -19203,8 +19462,8 @@ _clutter_actor_create_transition (ClutterActor *actor,
|
||||
gboolean call_restore = FALSE;
|
||||
TransitionClosure *clos;
|
||||
va_list var_args;
|
||||
GValue initial = G_VALUE_INIT;
|
||||
GValue final = G_VALUE_INIT;
|
||||
g_auto (GValue) initial = G_VALUE_INIT;
|
||||
g_auto (GValue) final = G_VALUE_INIT;
|
||||
GType ptype;
|
||||
char *error;
|
||||
|
||||
@@ -19253,7 +19512,6 @@ _clutter_actor_create_transition (ClutterActor *actor,
|
||||
if (error != NULL)
|
||||
{
|
||||
g_critical ("%s: %s", G_STRLOC, error);
|
||||
g_value_unset (&initial);
|
||||
g_free (error);
|
||||
goto out;
|
||||
}
|
||||
@@ -19275,9 +19533,6 @@ _clutter_actor_create_transition (ClutterActor *actor,
|
||||
&final,
|
||||
pspec);
|
||||
|
||||
g_value_unset (&initial);
|
||||
g_value_unset (&final);
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -19325,9 +19580,6 @@ _clutter_actor_create_transition (ClutterActor *actor,
|
||||
|
||||
/* the actor now owns the transition */
|
||||
g_object_unref (res);
|
||||
|
||||
g_value_unset (&initial);
|
||||
g_value_unset (&final);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -21102,7 +21354,7 @@ clutter_actor_create_texture_paint_node (ClutterActor *self,
|
||||
color.alpha = clutter_actor_get_paint_opacity_internal (self);
|
||||
|
||||
node = clutter_texture_node_new (texture, &color, priv->min_filter, priv->mag_filter);
|
||||
clutter_paint_node_set_name (node, "Texture");
|
||||
clutter_paint_node_set_static_name (node, "Texture");
|
||||
|
||||
if (priv->content_repeat == CLUTTER_REPEAT_NONE)
|
||||
clutter_paint_node_add_rectangle (node, &box);
|
||||
@@ -21123,3 +21375,14 @@ clutter_actor_create_texture_paint_node (ClutterActor *self,
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
gboolean
|
||||
clutter_actor_has_accessible (ClutterActor *actor)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), FALSE);
|
||||
|
||||
if (CLUTTER_ACTOR_GET_CLASS (actor)->has_accessible)
|
||||
return CLUTTER_ACTOR_GET_CLASS (actor)->has_accessible (actor);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -299,10 +299,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];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -380,6 +381,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);
|
||||
@@ -881,6 +884,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
|
||||
|
@@ -23,8 +23,7 @@
|
||||
#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>
|
||||
|
||||
#define CLUTTER_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BACKEND, ClutterBackendClass))
|
||||
@@ -47,8 +46,6 @@ struct _ClutterBackend
|
||||
|
||||
CoglOnscreen *dummy_onscreen;
|
||||
|
||||
ClutterDeviceManager *device_manager;
|
||||
|
||||
cairo_font_options_t *font_options;
|
||||
|
||||
gchar *font_name;
|
||||
@@ -59,8 +56,6 @@ struct _ClutterBackend
|
||||
ClutterStageWindow *stage_window;
|
||||
|
||||
ClutterInputMethod *input_method;
|
||||
|
||||
ClutterKeymap *keymap;
|
||||
};
|
||||
|
||||
struct _ClutterBackendClass
|
||||
@@ -89,17 +84,12 @@ struct _ClutterBackendClass
|
||||
GError **error);
|
||||
gboolean (* create_context) (ClutterBackend *backend,
|
||||
GError **error);
|
||||
ClutterDeviceManager *(* get_device_manager) (ClutterBackend *backend);
|
||||
|
||||
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);
|
||||
@@ -139,8 +129,6 @@ gfloat _clutter_backend_get_units_per_em (Clutter
|
||||
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
|
||||
|
@@ -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"
|
||||
@@ -528,30 +527,6 @@ clutter_backend_real_init_events (ClutterBackend *backend)
|
||||
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 void
|
||||
clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
{
|
||||
@@ -615,10 +590,8 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
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->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
|
||||
@@ -783,24 +756,24 @@ _clutter_backend_copy_event_data (ClutterBackend *backend,
|
||||
const ClutterEvent *src,
|
||||
ClutterEvent *dest)
|
||||
{
|
||||
ClutterDeviceManagerClass *device_manager_class;
|
||||
ClutterDeviceManager *device_manager;
|
||||
ClutterSeatClass *seat_class;
|
||||
ClutterSeat *seat;
|
||||
|
||||
device_manager = clutter_device_manager_get_default ();
|
||||
device_manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
device_manager_class->copy_event_data (device_manager, 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)
|
||||
{
|
||||
ClutterDeviceManagerClass *device_manager_class;
|
||||
ClutterDeviceManager *device_manager;
|
||||
ClutterSeatClass *seat_class;
|
||||
ClutterSeat *seat;
|
||||
|
||||
device_manager = clutter_device_manager_get_default ();
|
||||
device_manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
device_manager_class->free_event_data (device_manager, event);
|
||||
seat = clutter_backend_get_default_seat (backend);
|
||||
seat_class = CLUTTER_SEAT_GET_CLASS (seat);
|
||||
seat_class->free_event_data (seat, event);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -997,18 +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_set_allowed_drivers (const char *drivers)
|
||||
{
|
||||
@@ -1021,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
|
||||
@@ -1059,22 +1010,24 @@ clutter_backend_set_input_method (ClutterBackend *backend,
|
||||
g_set_object (&backend->input_method, method);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_backend_get_keymap:
|
||||
* @backend: the #ClutterBackend
|
||||
*
|
||||
* Gets the keymap used by Clutter
|
||||
*
|
||||
* Returns: (transfer none): the keymap
|
||||
**/
|
||||
ClutterKeymap *
|
||||
clutter_backend_get_keymap (ClutterBackend *backend)
|
||||
{
|
||||
return CLUTTER_BACKEND_GET_CLASS (backend)->get_keymap (backend);
|
||||
}
|
||||
|
||||
ClutterStageWindow *
|
||||
clutter_backend_get_stage_window (ClutterBackend *backend)
|
||||
{
|
||||
return backend->stage_window;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_backend_get_default_seat:
|
||||
* @backend: the #ClutterBackend
|
||||
*
|
||||
* Returns the default seat
|
||||
*
|
||||
* Returns: (transfer none): the default seat
|
||||
**/
|
||||
ClutterSeat *
|
||||
clutter_backend_get_default_seat (ClutterBackend *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
|
||||
|
||||
|
@@ -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,
|
||||
@@ -328,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:
|
||||
*
|
||||
|
@@ -121,12 +121,12 @@ 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
|
||||
@@ -497,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;
|
||||
@@ -587,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;
|
||||
|
@@ -352,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);
|
||||
|
||||
|
@@ -346,6 +346,12 @@ on_captured_event (ClutterActor *stage,
|
||||
ClutterModifierType modifier_state;
|
||||
gboolean has_button = TRUE;
|
||||
|
||||
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (action)))
|
||||
{
|
||||
clutter_click_action_release (action);
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
}
|
||||
|
||||
actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action));
|
||||
|
||||
switch (clutter_event_type (event))
|
||||
|
@@ -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__ */
|
||||
|
@@ -222,6 +222,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,
|
||||
|
36
clutter/clutter/clutter-container-private.h
Normal file
36
clutter/clutter/clutter-container-private.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* 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
|
||||
* 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_CONTAINER_PRIVATE_H__
|
||||
#define __CLUTTER_CONTAINER_PRIVATE_H__
|
||||
|
||||
#include <clutter/clutter-container.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
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_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"
|
||||
@@ -1250,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);
|
||||
}
|
||||
|
@@ -1,306 +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;
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
/* Accessiblity */
|
||||
ClutterVirtualInputDevice *accessibility_virtual_device;
|
||||
ClutterPtrA11yData *ptr_a11y_data;
|
||||
};
|
||||
|
||||
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);
|
||||
};
|
||||
|
||||
/* device manager */
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_device_manager_add_device (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDevice *device);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_device_manager_remove_device (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDevice *device);
|
||||
void _clutter_device_manager_update_devices (ClutterDeviceManager *device_manager);
|
||||
CLUTTER_EXPORT
|
||||
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);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_device_manager_ensure_a11y_state (ClutterDeviceManager *device_manager);
|
||||
|
||||
/* input device */
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_input_device_has_sequence (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence);
|
||||
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_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_);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_stage (ClutterInputDevice *device,
|
||||
ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
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);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_n_keys (ClutterInputDevice *device,
|
||||
guint n_keys);
|
||||
CLUTTER_EXPORT
|
||||
guint _clutter_input_device_add_axis (ClutterInputDevice *device,
|
||||
ClutterInputAxis axis,
|
||||
gdouble min_value,
|
||||
gdouble max_value,
|
||||
gdouble resolution);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_reset_axes (ClutterInputDevice *device);
|
||||
|
||||
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
|
||||
gboolean _clutter_input_device_translate_axis (ClutterInputDevice *device,
|
||||
guint index_,
|
||||
gdouble value,
|
||||
gdouble *axis_value);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_add_scroll_info (ClutterInputDevice *device,
|
||||
guint index_,
|
||||
ClutterScrollDirection direction,
|
||||
gdouble increment);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_reset_scroll_info (ClutterInputDevice *device);
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_input_device_get_scroll_delta (ClutterInputDevice *device,
|
||||
guint index_,
|
||||
gdouble value,
|
||||
ClutterScrollDirection *direction_p,
|
||||
gdouble *delta_p);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterInputDeviceTool * clutter_input_device_lookup_tool (ClutterInputDevice *device,
|
||||
guint64 serial,
|
||||
ClutterInputDeviceToolType type);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_device_add_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_device_update_from_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_DEVICE_MANAGER_PRIVATE_H__ */
|
@@ -1,753 +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"
|
||||
#include "clutter-input-pointer-a11y-private.h"
|
||||
|
||||
struct _ClutterDeviceManagerPrivate
|
||||
{
|
||||
/* back-pointer to the backend */
|
||||
ClutterBackend *backend;
|
||||
|
||||
/* Keyboard a11y */
|
||||
ClutterKbdA11ySettings kbd_a11y_settings;
|
||||
/* Pointer a11y */
|
||||
ClutterPointerA11ySettings pointer_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,
|
||||
PTR_A11Y_DWELL_CLICK_TYPE_CHANGED,
|
||||
PTR_A11Y_TIMEOUT_STARTED,
|
||||
PTR_A11Y_TIMEOUT_STOPPED,
|
||||
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static guint manager_signals[LAST_SIGNAL] = { 0, };
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterDeviceManager,
|
||||
clutter_device_manager,
|
||||
G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
clutter_device_manager_set_property (GObject *gobject,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterDeviceManager *self = CLUTTER_DEVICE_MANAGER (gobject);
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (self);
|
||||
|
||||
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)
|
||||
{
|
||||
ClutterDeviceManager *self = CLUTTER_DEVICE_MANAGER (gobject);
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (self);
|
||||
|
||||
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, NULL,
|
||||
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, NULL,
|
||||
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);
|
||||
|
||||
/**
|
||||
* ClutterDeviceManager::ptr-a11y-dwell-click-type-changed:
|
||||
* @manager: the #ClutterDeviceManager that emitted the signal
|
||||
* @click_type: the new #ClutterPointerA11yDwellClickType mode
|
||||
*
|
||||
* The ::ptr-a11y-dwell-click-type-changed signal is emitted each time
|
||||
* the ClutterPointerA11yDwellClickType mode is changed as the result
|
||||
* of pointer accessibility operations.
|
||||
*/
|
||||
manager_signals[PTR_A11Y_DWELL_CLICK_TYPE_CHANGED] =
|
||||
g_signal_new (I_("ptr-a11y-dwell-click-type-changed"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__FLAGS,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_POINTER_A11Y_DWELL_CLICK_TYPE);
|
||||
|
||||
/**
|
||||
* ClutterDeviceManager::ptr-a11y-timeout-started:
|
||||
* @manager: the #ClutterDeviceManager that emitted the signal
|
||||
* @device: the core pointer #ClutterInputDevice
|
||||
* @timeout_type: the type of timeout #ClutterPointerA11yTimeoutType
|
||||
* @delay: the delay in ms before secondary-click is triggered.
|
||||
*
|
||||
* The ::ptr-a11y-timeout-started signal is emitted when a
|
||||
* pointer accessibility timeout delay is started, so that upper
|
||||
* layers can notify the user with some visual feedback.
|
||||
*/
|
||||
manager_signals[PTR_A11Y_TIMEOUT_STARTED] =
|
||||
g_signal_new (I_("ptr-a11y-timeout-started"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT_FLAGS_UINT,
|
||||
G_TYPE_NONE, 3,
|
||||
CLUTTER_TYPE_INPUT_DEVICE,
|
||||
CLUTTER_TYPE_POINTER_A11Y_TIMEOUT_TYPE,
|
||||
G_TYPE_UINT);
|
||||
|
||||
/**
|
||||
* ClutterDeviceManager::ptr-a11y-timeout-stopped:
|
||||
* @manager: the #ClutterDeviceManager that emitted the signal
|
||||
* @device: the core pointer #ClutterInputDevice
|
||||
* @timeout_type: the type of timeout #ClutterPointerA11yTimeoutType
|
||||
* @clicked: %TRUE if the timeout finished and triggered a click
|
||||
*
|
||||
* The ::ptr-a11y-timeout-stopped signal is emitted when a running
|
||||
* pointer accessibility timeout delay is stopped, either because
|
||||
* it's triggered at the end of the delay or cancelled, so that
|
||||
* upper layers can notify the user with some visual feedback.
|
||||
*/
|
||||
manager_signals[PTR_A11Y_TIMEOUT_STOPPED] =
|
||||
g_signal_new (I_("ptr-a11y-timeout-stopped"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT_FLAGS_BOOLEAN,
|
||||
G_TYPE_NONE, 3,
|
||||
CLUTTER_TYPE_INPUT_DEVICE,
|
||||
CLUTTER_TYPE_POINTER_A11Y_TIMEOUT_TYPE,
|
||||
G_TYPE_BOOLEAN);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_device_manager_init (ClutterDeviceManager *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 CLUTTER_BACKEND_GET_CLASS (backend)->get_device_manager (backend);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (manager);
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (manager), NULL);
|
||||
|
||||
return 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);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_device_manager_ensure_a11y_state (ClutterDeviceManager *device_manager)
|
||||
{
|
||||
ClutterInputDevice *core_pointer;
|
||||
|
||||
core_pointer = clutter_device_manager_get_core_device (device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
if (core_pointer)
|
||||
{
|
||||
if (_clutter_is_input_pointer_a11y_enabled (core_pointer))
|
||||
_clutter_input_pointer_a11y_add_device (core_pointer);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (device_manager);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
if (are_kbd_a11y_settings_equal (&priv->kbd_a11y_settings, settings))
|
||||
return;
|
||||
|
||||
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)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (device_manager);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
*settings = priv->kbd_a11y_settings;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
are_pointer_a11y_settings_equal (ClutterPointerA11ySettings *a,
|
||||
ClutterPointerA11ySettings *b)
|
||||
{
|
||||
return (memcmp (a, b, sizeof (ClutterPointerA11ySettings)) == 0);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_device_manager_enable_pointer_a11y (ClutterDeviceManager *device_manager)
|
||||
{
|
||||
ClutterInputDevice *core_pointer;
|
||||
|
||||
core_pointer = clutter_device_manager_get_core_device (device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
|
||||
_clutter_input_pointer_a11y_add_device (core_pointer);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_device_manager_disable_pointer_a11y (ClutterDeviceManager *device_manager)
|
||||
{
|
||||
ClutterInputDevice *core_pointer;
|
||||
|
||||
core_pointer = clutter_device_manager_get_core_device (device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
|
||||
_clutter_input_pointer_a11y_remove_device (core_pointer);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_device_manager_set_pointer_a11y_settings:
|
||||
* @device_manager: a #ClutterDeviceManager
|
||||
* @settings: a pointer to a #ClutterPointerA11ySettings
|
||||
*
|
||||
* Sets the pointer accessibility settings
|
||||
**/
|
||||
void
|
||||
clutter_device_manager_set_pointer_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterPointerA11ySettings *settings)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv =
|
||||
clutter_device_manager_get_instance_private (device_manager);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
if (are_pointer_a11y_settings_equal (&priv->pointer_a11y_settings, settings))
|
||||
return;
|
||||
|
||||
if (priv->pointer_a11y_settings.controls == 0 && settings->controls != 0)
|
||||
clutter_device_manager_enable_pointer_a11y (device_manager);
|
||||
else if (priv->pointer_a11y_settings.controls != 0 && settings->controls == 0)
|
||||
clutter_device_manager_disable_pointer_a11y (device_manager);
|
||||
|
||||
priv->pointer_a11y_settings = *settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_device_manager_get_pointer_a11y_settings:
|
||||
* @device_manager: a #ClutterDeviceManager
|
||||
* @settings: a pointer to a #ClutterPointerA11ySettings
|
||||
*
|
||||
* Gets the current pointer accessibility settings
|
||||
**/
|
||||
void
|
||||
clutter_device_manager_get_pointer_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterPointerA11ySettings *settings)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv =
|
||||
clutter_device_manager_get_instance_private (device_manager);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
*settings = priv->pointer_a11y_settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_device_manager_set_pointer_a11y_dwell_click_type:
|
||||
* @device_manager: a #ClutterDeviceManager
|
||||
* @click_type: type of click as #ClutterPointerA11yDwellClickType
|
||||
*
|
||||
* Sets the dwell click type
|
||||
**/
|
||||
void
|
||||
clutter_device_manager_set_pointer_a11y_dwell_click_type (ClutterDeviceManager *device_manager,
|
||||
ClutterPointerA11yDwellClickType click_type)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv =
|
||||
clutter_device_manager_get_instance_private (device_manager);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
priv->pointer_a11y_settings.dwell_click_type = click_type;
|
||||
}
|
@@ -1,181 +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 ())
|
||||
CLUTTER_EXPORT
|
||||
G_DECLARE_DERIVABLE_TYPE (ClutterDeviceManager, clutter_device_manager,
|
||||
CLUTTER, DEVICE_MANAGER, GObject)
|
||||
|
||||
typedef struct _ClutterDeviceManagerPrivate ClutterDeviceManagerPrivate;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11ySettings:
|
||||
*
|
||||
* The #ClutterPointerA11ySettings structure contains pointer accessibility
|
||||
* settings
|
||||
*
|
||||
*/
|
||||
typedef struct _ClutterPointerA11ySettings
|
||||
{
|
||||
ClutterPointerA11yFlags controls;
|
||||
ClutterPointerA11yDwellClickType dwell_click_type;
|
||||
ClutterPointerA11yDwellMode dwell_mode;
|
||||
ClutterPointerA11yDwellDirection dwell_gesture_single;
|
||||
ClutterPointerA11yDwellDirection dwell_gesture_double;
|
||||
ClutterPointerA11yDwellDirection dwell_gesture_drag;
|
||||
ClutterPointerA11yDwellDirection dwell_gesture_secondary;
|
||||
gint secondary_click_delay;
|
||||
gint dwell_delay;
|
||||
gint dwell_threshold;
|
||||
} ClutterPointerA11ySettings;
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/* Event platform data */
|
||||
void (* copy_event_data) (ClutterDeviceManager *device_manager,
|
||||
const ClutterEvent *src,
|
||||
ClutterEvent *dest);
|
||||
void (* free_event_data) (ClutterDeviceManager *device_manager,
|
||||
ClutterEvent *event);
|
||||
|
||||
/* padding */
|
||||
gpointer _padding[4];
|
||||
};
|
||||
|
||||
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);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_device_manager_set_pointer_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterPointerA11ySettings *settings);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_device_manager_get_pointer_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterPointerA11ySettings *settings);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_device_manager_set_pointer_a11y_dwell_click_type (ClutterDeviceManager *device_manager,
|
||||
ClutterPointerA11yDwellClickType click_type);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_DEVICE_MANAGER_H__ */
|
@@ -535,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().
|
||||
*
|
||||
@@ -545,8 +549,9 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -673,12 +678,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;
|
||||
|
||||
/**
|
||||
|
@@ -130,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);
|
||||
}
|
||||
|
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)
|
||||
{
|
||||
@@ -170,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:
|
||||
@@ -246,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:
|
||||
@@ -361,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);
|
||||
|
||||
/**
|
||||
@@ -799,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
|
||||
@@ -1017,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
|
||||
@@ -1031,9 +1030,9 @@ 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;
|
||||
@@ -1224,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);
|
||||
@@ -2441,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))
|
||||
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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),
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -25,10 +25,9 @@
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-device-manager.h"
|
||||
#include "clutter-device-manager-private.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"
|
||||
@@ -38,7 +37,7 @@ is_secondary_click_enabled (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
return (settings.controls & CLUTTER_A11Y_SECONDARY_CLICK_ENABLED);
|
||||
}
|
||||
@@ -48,7 +47,7 @@ is_dwell_click_enabled (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
return (settings.controls & CLUTTER_A11Y_DWELL_ENABLED);
|
||||
}
|
||||
@@ -58,7 +57,7 @@ get_secondary_click_delay (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
return settings.secondary_click_delay;
|
||||
}
|
||||
@@ -68,7 +67,7 @@ get_dwell_delay (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
return settings.dwell_delay;
|
||||
}
|
||||
@@ -78,7 +77,7 @@ get_dwell_threshold (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
return settings.dwell_threshold;
|
||||
}
|
||||
@@ -88,7 +87,7 @@ get_dwell_mode (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
return settings.dwell_mode;
|
||||
}
|
||||
@@ -98,7 +97,7 @@ get_dwell_click_type (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
return settings.dwell_click_type;
|
||||
}
|
||||
@@ -109,7 +108,7 @@ get_dwell_click_type_for_direction (ClutterInputDevice *device,
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
if (direction == settings.dwell_gesture_single)
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY;
|
||||
@@ -168,7 +167,7 @@ trigger_secondary_click (gpointer data)
|
||||
device->ptr_a11y_data->secondary_click_triggered = TRUE;
|
||||
device->ptr_a11y_data->secondary_click_timer = 0;
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
@@ -185,7 +184,7 @@ start_secondary_click_timeout (ClutterInputDevice *device)
|
||||
device->ptr_a11y_data->secondary_click_timer =
|
||||
clutter_threads_add_timeout (delay, trigger_secondary_click, device);
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-started",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
@@ -200,7 +199,7 @@ stop_secondary_click_timeout (ClutterInputDevice *device)
|
||||
g_clear_handle_id (&device->ptr_a11y_data->secondary_click_timer,
|
||||
g_source_remove);
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
@@ -304,7 +303,7 @@ update_dwell_click_type (ClutterInputDevice *device)
|
||||
ClutterPointerA11ySettings settings;
|
||||
ClutterPointerA11yDwellClickType dwell_click_type;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
clutter_seat_get_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
dwell_click_type = settings.dwell_click_type;
|
||||
switch (dwell_click_type)
|
||||
@@ -329,10 +328,9 @@ update_dwell_click_type (ClutterInputDevice *device)
|
||||
if (dwell_click_type != settings.dwell_click_type)
|
||||
{
|
||||
settings.dwell_click_type = dwell_click_type;
|
||||
clutter_device_manager_set_pointer_a11y_settings (device->device_manager,
|
||||
&settings);
|
||||
clutter_seat_set_pointer_a11y_settings (device->seat, &settings);
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-dwell-click-type-changed",
|
||||
dwell_click_type);
|
||||
}
|
||||
@@ -437,7 +435,7 @@ trigger_dwell_gesture (gpointer data)
|
||||
device->ptr_a11y_data->dwell_timer =
|
||||
clutter_threads_add_timeout (delay, trigger_clear_dwell_gesture, device);
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
||||
@@ -455,7 +453,7 @@ start_dwell_gesture_timeout (ClutterInputDevice *device)
|
||||
clutter_threads_add_timeout (delay, trigger_dwell_gesture, device);
|
||||
device->ptr_a11y_data->dwell_gesture_started = TRUE;
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-started",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
||||
@@ -469,7 +467,7 @@ trigger_dwell_click (gpointer data)
|
||||
|
||||
device->ptr_a11y_data->dwell_timer = 0;
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
@@ -499,7 +497,7 @@ start_dwell_timeout (ClutterInputDevice *device)
|
||||
device->ptr_a11y_data->dwell_timer =
|
||||
clutter_threads_add_timeout (delay, trigger_dwell_click, device);
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-started",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
@@ -514,7 +512,7 @@ stop_dwell_timeout (ClutterInputDevice *device)
|
||||
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->device_manager,
|
||||
g_signal_emit_by_name (device->seat,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
@@ -573,8 +571,7 @@ is_device_core_pointer (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterInputDevice *core_pointer;
|
||||
|
||||
core_pointer = clutter_device_manager_get_core_device (device->device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
core_pointer = clutter_seat_get_pointer (device->seat);
|
||||
if (core_pointer == NULL)
|
||||
return FALSE;
|
||||
|
||||
@@ -588,8 +585,8 @@ _clutter_input_pointer_a11y_add_device (ClutterInputDevice *device)
|
||||
return;
|
||||
|
||||
device->accessibility_virtual_device =
|
||||
clutter_device_manager_create_virtual_device (device->device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
clutter_seat_create_virtual_device (device->seat,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
|
||||
device->ptr_a11y_data = g_new0 (ClutterPtrA11yData, 1);
|
||||
}
|
||||
|
@@ -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 */
|
||||
|
@@ -55,14 +55,15 @@
|
||||
#include "clutter-backend-private.h"
|
||||
#include "clutter-config.h"
|
||||
#include "clutter-debug.h"
|
||||
#include "clutter-device-manager-private.h"
|
||||
#include "clutter-event-private.h"
|
||||
#include "clutter-feature.h"
|
||||
#include "clutter-input-device-private.h"
|
||||
#include "clutter-input-pointer-a11y-private.h"
|
||||
#include "clutter-graphene.h"
|
||||
#include "clutter-main.h"
|
||||
#include "clutter-master-clock.h"
|
||||
#include "clutter-mutter.h"
|
||||
#include "clutter-paint-node-private.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-settings-private.h"
|
||||
#include "clutter-stage-manager.h"
|
||||
@@ -970,6 +971,9 @@ clutter_init_real (GError **error)
|
||||
if (clutter_enable_accessibility)
|
||||
cally_accessibility_init ();
|
||||
|
||||
/* Initialize types required for paint nodes */
|
||||
_clutter_paint_node_init_types ();
|
||||
|
||||
return CLUTTER_INIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1523,7 +1527,7 @@ event_click_count_generate (ClutterEvent *event)
|
||||
previous_y = event->button.y;
|
||||
previous_time = event->button.time;
|
||||
|
||||
/* fallthrough */
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
event->button.click_count = click_count;
|
||||
break;
|
||||
@@ -1776,7 +1780,7 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
|
||||
emit_crossing_event (event, device);
|
||||
|
||||
actor = _clutter_input_device_update (device, NULL, FALSE);
|
||||
actor = clutter_input_device_update (device, NULL, FALSE);
|
||||
if (actor != stage)
|
||||
{
|
||||
ClutterEvent *crossing;
|
||||
@@ -1834,13 +1838,10 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
{
|
||||
if (_clutter_is_input_pointer_a11y_enabled (device))
|
||||
{
|
||||
ClutterInputDevice *core_pointer;
|
||||
gfloat x, y;
|
||||
|
||||
clutter_event_get_coords (event, &x, &y);
|
||||
core_pointer = clutter_device_manager_get_core_device (device->device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
_clutter_input_pointer_a11y_on_motion_event (core_pointer, x, y);
|
||||
_clutter_input_pointer_a11y_on_motion_event (device, x, y);
|
||||
}
|
||||
}
|
||||
#endif /* CLUTTER_WINDOWING_X11 */
|
||||
@@ -1871,7 +1872,7 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
break;
|
||||
}
|
||||
|
||||
/* fallthrough from motion */
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
#ifdef CLUTTER_WINDOWING_X11
|
||||
@@ -1879,12 +1880,7 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
{
|
||||
if (_clutter_is_input_pointer_a11y_enabled (device) && (event->type != CLUTTER_MOTION))
|
||||
{
|
||||
ClutterInputDevice *core_pointer;
|
||||
|
||||
core_pointer = clutter_device_manager_get_core_device (device->device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
|
||||
_clutter_input_pointer_a11y_on_button_event (core_pointer,
|
||||
_clutter_input_pointer_a11y_on_button_event (device,
|
||||
event->button.button,
|
||||
event->type == CLUTTER_BUTTON_PRESS);
|
||||
}
|
||||
@@ -1943,7 +1939,7 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
* get the actor underneath
|
||||
*/
|
||||
if (device != NULL)
|
||||
actor = _clutter_input_device_update (device, NULL, TRUE);
|
||||
actor = clutter_input_device_update (device, NULL, TRUE);
|
||||
else
|
||||
{
|
||||
CLUTTER_NOTE (EVENT, "No device found: picking");
|
||||
@@ -2016,7 +2012,7 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
break;
|
||||
}
|
||||
|
||||
/* fallthrough from motion */
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case CLUTTER_TOUCH_BEGIN:
|
||||
case CLUTTER_TOUCH_CANCEL:
|
||||
case CLUTTER_TOUCH_END:
|
||||
@@ -2060,7 +2056,7 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
}
|
||||
|
||||
if (device != NULL)
|
||||
actor = _clutter_input_device_update (device, sequence, TRUE);
|
||||
actor = clutter_input_device_update (device, sequence, TRUE);
|
||||
else
|
||||
{
|
||||
CLUTTER_NOTE (EVENT, "No device found: picking");
|
||||
|
@@ -31,6 +31,8 @@
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include <cogl/cogl.h>
|
||||
|
||||
#include "clutter-master-clock.h"
|
||||
#include "clutter-master-clock-default.h"
|
||||
#include "clutter-debug.h"
|
||||
@@ -188,6 +190,26 @@ master_clock_get_swap_wait_time (ClutterMasterClockDefault *master_clock)
|
||||
}
|
||||
}
|
||||
|
||||
static int64_t
|
||||
master_clock_get_next_presentation_time (ClutterMasterClockDefault *master_clock)
|
||||
{
|
||||
ClutterStageManager *stage_manager = clutter_stage_manager_get_default ();
|
||||
const GSList *stages, *l;
|
||||
int64_t earliest = -1;
|
||||
|
||||
stages = clutter_stage_manager_peek_stages (stage_manager);
|
||||
|
||||
for (l = stages; l != NULL; l = l->next)
|
||||
{
|
||||
gint64 t = _clutter_stage_get_next_presentation_time (l->data);
|
||||
|
||||
if (earliest == -1 || (t != -1 && t < earliest))
|
||||
earliest = t;
|
||||
}
|
||||
|
||||
return earliest;
|
||||
}
|
||||
|
||||
static void
|
||||
master_clock_schedule_stage_updates (ClutterMasterClockDefault *master_clock)
|
||||
{
|
||||
@@ -461,8 +483,14 @@ clutter_clock_dispatch (GSource *source,
|
||||
|
||||
_clutter_threads_acquire_lock ();
|
||||
|
||||
COGL_TRACE_BEGIN (ClutterMasterClockTick, "Master Clock (tick)");
|
||||
|
||||
/* Get the time to use for this frame */
|
||||
master_clock->cur_tick = g_source_get_time (source);
|
||||
master_clock->cur_tick = master_clock_get_next_presentation_time (master_clock);
|
||||
|
||||
/* On the first frame the backend might not have an answer */
|
||||
if (master_clock->cur_tick <= 0)
|
||||
master_clock->cur_tick = g_source_get_time (source);
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
master_clock->remaining_budget = master_clock->frame_budget;
|
||||
@@ -492,6 +520,8 @@ clutter_clock_dispatch (GSource *source,
|
||||
|
||||
g_slist_free_full (stages, g_object_unref);
|
||||
|
||||
COGL_TRACE_END (ClutterMasterClockTick);
|
||||
|
||||
_clutter_threads_release_lock ();
|
||||
|
||||
return TRUE;
|
||||
|
@@ -26,8 +26,8 @@
|
||||
#define __CLUTTER_H_INSIDE__
|
||||
|
||||
#include "clutter-backend.h"
|
||||
#include "clutter-device-manager-private.h"
|
||||
#include "clutter-event-private.h"
|
||||
#include "clutter-input-device-private.h"
|
||||
#include "clutter-input-pointer-a11y-private.h"
|
||||
#include "clutter-macros.h"
|
||||
#include "clutter-private.h"
|
||||
|
@@ -118,11 +118,7 @@ clutter_offscreen_effect_set_actor (ClutterActorMeta *meta,
|
||||
meta_class->set_actor (meta, actor);
|
||||
|
||||
/* clear out the previous state */
|
||||
if (priv->offscreen != NULL)
|
||||
{
|
||||
cogl_object_unref (priv->offscreen);
|
||||
priv->offscreen = NULL;
|
||||
}
|
||||
g_clear_pointer (&priv->offscreen, cogl_object_unref);
|
||||
|
||||
/* we keep a back pointer here, to avoid going through the ActorMeta */
|
||||
priv->actor = clutter_actor_meta_get_actor (meta);
|
||||
@@ -198,17 +194,8 @@ update_fbo (ClutterEffect *effect,
|
||||
ensure_pipeline_filter_for_scale (self, resource_scale);
|
||||
}
|
||||
|
||||
if (priv->texture != NULL)
|
||||
{
|
||||
cogl_object_unref (priv->texture);
|
||||
priv->texture = NULL;
|
||||
}
|
||||
|
||||
if (priv->offscreen != NULL)
|
||||
{
|
||||
cogl_object_unref (priv->offscreen);
|
||||
priv->offscreen = NULL;
|
||||
}
|
||||
g_clear_pointer (&priv->texture, cogl_object_unref);
|
||||
g_clear_pointer (&priv->offscreen, cogl_object_unref);
|
||||
|
||||
priv->texture =
|
||||
clutter_offscreen_effect_create_texture (self, target_width, target_height);
|
||||
@@ -482,34 +469,56 @@ clutter_offscreen_effect_paint (ClutterEffect *effect,
|
||||
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
|
||||
ClutterOffscreenEffectPrivate *priv = self->priv;
|
||||
|
||||
if (flags & CLUTTER_EFFECT_PAINT_BYPASS_EFFECT)
|
||||
{
|
||||
clutter_actor_continue_paint (priv->actor, paint_context);
|
||||
cogl_clear_object (&priv->offscreen);
|
||||
return;
|
||||
}
|
||||
|
||||
/* If we've already got a cached image and the actor hasn't been redrawn
|
||||
* then we can just use the cached image in the FBO.
|
||||
*/
|
||||
if (priv->offscreen == NULL || (flags & CLUTTER_EFFECT_PAINT_ACTOR_DIRTY))
|
||||
{
|
||||
/* Chain up to the parent paint method which will call the pre and
|
||||
post paint functions to update the image */
|
||||
CLUTTER_EFFECT_CLASS (clutter_offscreen_effect_parent_class)->
|
||||
paint (effect, paint_context, flags);
|
||||
ClutterEffectClass *effect_class = CLUTTER_EFFECT_GET_CLASS (effect);
|
||||
gboolean pre_paint_succeeded;
|
||||
|
||||
pre_paint_succeeded = effect_class->pre_paint (effect, paint_context);
|
||||
|
||||
clutter_actor_continue_paint (priv->actor, paint_context);
|
||||
|
||||
if (pre_paint_succeeded)
|
||||
effect_class->post_paint (effect, paint_context);
|
||||
else
|
||||
g_clear_pointer (&priv->offscreen, cogl_object_unref);
|
||||
}
|
||||
else
|
||||
clutter_offscreen_effect_paint_texture (self, paint_context);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_offscreen_effect_notify (GObject *gobject,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterOffscreenEffect *offscreen_effect = CLUTTER_OFFSCREEN_EFFECT (gobject);
|
||||
ClutterOffscreenEffectPrivate *priv = offscreen_effect->priv;
|
||||
|
||||
if (strcmp (pspec->name, "enabled") == 0)
|
||||
g_clear_pointer (&priv->offscreen, cogl_object_unref);
|
||||
|
||||
G_OBJECT_CLASS (clutter_offscreen_effect_parent_class)->notify (gobject, pspec);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_offscreen_effect_finalize (GObject *gobject)
|
||||
{
|
||||
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (gobject);
|
||||
ClutterOffscreenEffectPrivate *priv = self->priv;
|
||||
|
||||
if (priv->offscreen)
|
||||
cogl_object_unref (priv->offscreen);
|
||||
|
||||
if (priv->target)
|
||||
cogl_object_unref (priv->target);
|
||||
|
||||
if (priv->texture)
|
||||
cogl_object_unref (priv->texture);
|
||||
g_clear_pointer (&priv->offscreen, cogl_object_unref);
|
||||
g_clear_pointer (&priv->texture, cogl_object_unref);
|
||||
g_clear_pointer (&priv->target, cogl_object_unref);
|
||||
|
||||
G_OBJECT_CLASS (clutter_offscreen_effect_parent_class)->finalize (gobject);
|
||||
}
|
||||
@@ -531,6 +540,7 @@ clutter_offscreen_effect_class_init (ClutterOffscreenEffectClass *klass)
|
||||
effect_class->paint = clutter_offscreen_effect_paint;
|
||||
|
||||
gobject_class->finalize = clutter_offscreen_effect_finalize;
|
||||
gobject_class->notify = clutter_offscreen_effect_notify;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -20,7 +20,8 @@
|
||||
|
||||
#include "clutter-paint-context.h"
|
||||
|
||||
ClutterPaintContext * clutter_paint_context_new_for_view (ClutterStageView *view);
|
||||
ClutterPaintContext * clutter_paint_context_new_for_view (ClutterStageView *view,
|
||||
const cairo_region_t *redraw_clip);
|
||||
|
||||
gboolean clutter_paint_context_is_drawing_off_stage (ClutterPaintContext *paint_context);
|
||||
|
||||
|
@@ -26,6 +26,8 @@ struct _ClutterPaintContext
|
||||
GList *framebuffers;
|
||||
|
||||
ClutterStageView *view;
|
||||
|
||||
cairo_region_t *redraw_clip;
|
||||
};
|
||||
|
||||
G_DEFINE_BOXED_TYPE (ClutterPaintContext, clutter_paint_context,
|
||||
@@ -33,7 +35,8 @@ G_DEFINE_BOXED_TYPE (ClutterPaintContext, clutter_paint_context,
|
||||
clutter_paint_context_unref)
|
||||
|
||||
ClutterPaintContext *
|
||||
clutter_paint_context_new_for_view (ClutterStageView *view)
|
||||
clutter_paint_context_new_for_view (ClutterStageView *view,
|
||||
const cairo_region_t *redraw_clip)
|
||||
{
|
||||
ClutterPaintContext *paint_context;
|
||||
CoglFramebuffer *framebuffer;
|
||||
@@ -41,6 +44,7 @@ clutter_paint_context_new_for_view (ClutterStageView *view)
|
||||
paint_context = g_new0 (ClutterPaintContext, 1);
|
||||
g_ref_count_init (&paint_context->ref_count);
|
||||
paint_context->view = view;
|
||||
paint_context->redraw_clip = cairo_region_copy (redraw_clip);
|
||||
|
||||
framebuffer = clutter_stage_view_get_framebuffer (view);
|
||||
clutter_paint_context_push_framebuffer (paint_context, framebuffer);
|
||||
@@ -77,6 +81,7 @@ clutter_paint_context_dispose (ClutterPaintContext *paint_context)
|
||||
g_list_free_full (paint_context->framebuffers,
|
||||
cogl_object_unref);
|
||||
paint_context->framebuffers = NULL;
|
||||
g_clear_pointer (&paint_context->redraw_clip, cairo_region_destroy);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -115,6 +120,12 @@ clutter_paint_context_pop_framebuffer (ClutterPaintContext *paint_context)
|
||||
paint_context->framebuffers);
|
||||
}
|
||||
|
||||
const cairo_region_t *
|
||||
clutter_paint_context_get_redraw_clip (ClutterPaintContext *paint_context)
|
||||
{
|
||||
return paint_context->redraw_clip;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_paint_context_get_framebuffer:
|
||||
* @paint_context: The #ClutterPaintContext
|
||||
|
@@ -59,4 +59,7 @@ void clutter_paint_context_push_framebuffer (ClutterPaintContext *paint_context,
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_context_pop_framebuffer (ClutterPaintContext *paint_context);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
const cairo_region_t * clutter_paint_context_get_redraw_clip (ClutterPaintContext *paint_context);
|
||||
|
||||
#endif /* CLUTTER_PAINT_CONTEXT_H */
|
||||
|
@@ -49,11 +49,11 @@ struct _ClutterPaintNode
|
||||
ClutterPaintNode *next_sibling;
|
||||
ClutterPaintNode *last_child;
|
||||
|
||||
guint n_children;
|
||||
|
||||
GArray *operations;
|
||||
|
||||
gchar *name;
|
||||
const gchar *name;
|
||||
|
||||
guint n_children;
|
||||
|
||||
volatile int ref_count;
|
||||
};
|
||||
|
@@ -171,8 +171,6 @@ clutter_paint_node_real_finalize (ClutterPaintNode *node)
|
||||
{
|
||||
ClutterPaintNode *iter;
|
||||
|
||||
g_free (node->name);
|
||||
|
||||
if (node->operations != NULL)
|
||||
{
|
||||
guint i;
|
||||
@@ -297,7 +295,8 @@ clutter_paint_node_get_type (void)
|
||||
*
|
||||
* The @name will be used for debugging purposes.
|
||||
*
|
||||
* The @node will copy the passed string.
|
||||
* The @node will intern @name using g_intern_string(). If you have access to a
|
||||
* static string, use clutter_paint_node_set_static_name() instead.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
@@ -307,8 +306,22 @@ clutter_paint_node_set_name (ClutterPaintNode *node,
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_PAINT_NODE (node));
|
||||
|
||||
g_free (node->name);
|
||||
node->name = g_strdup (name);
|
||||
node->name = g_intern_string (name);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_paint_node_set_static_name: (skip)
|
||||
*
|
||||
* Like clutter_paint_node_set_name() but uses a static or interned string
|
||||
* containing the name.
|
||||
*/
|
||||
void
|
||||
clutter_paint_node_set_static_name (ClutterPaintNode *node,
|
||||
const char *name)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_PAINT_NODE (node));
|
||||
|
||||
node->name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1181,8 +1194,6 @@ _clutter_paint_node_create (GType gtype)
|
||||
{
|
||||
g_return_val_if_fail (g_type_is_a (gtype, CLUTTER_TYPE_PAINT_NODE), NULL);
|
||||
|
||||
_clutter_paint_node_init_types ();
|
||||
|
||||
return (gpointer) g_type_create_instance (gtype);
|
||||
}
|
||||
|
||||
|
@@ -56,6 +56,9 @@ void clutter_paint_node_paint (Clutter
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_node_set_name (ClutterPaintNode *node,
|
||||
const char *name);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_node_set_static_name (ClutterPaintNode *node,
|
||||
const char *name);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
CoglFramebuffer * clutter_paint_node_get_framebuffer (ClutterPaintNode *node);
|
||||
|
@@ -248,6 +248,9 @@ gboolean _clutter_util_rectangle_intersection (const cairo_rectangle_int_t *src1
|
||||
const cairo_rectangle_int_t *src2,
|
||||
cairo_rectangle_int_t *dest);
|
||||
|
||||
gboolean clutter_util_rectangle_equal (const cairo_rectangle_int_t *src1,
|
||||
const cairo_rectangle_int_t *src2);
|
||||
|
||||
|
||||
struct _ClutterVertex4
|
||||
{
|
||||
|
701
clutter/clutter/clutter-seat.c
Normal file
701
clutter/clutter/clutter-seat.c
Normal file
@@ -0,0 +1,701 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright (C) 2019 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/>.
|
||||
*
|
||||
* Author: Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-backend-private.h"
|
||||
#include "clutter-input-device-tool.h"
|
||||
#include "clutter-input-pointer-a11y-private.h"
|
||||
#include "clutter-marshal.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-seat.h"
|
||||
#include "clutter-virtual-input-device.h"
|
||||
|
||||
enum
|
||||
{
|
||||
DEVICE_ADDED,
|
||||
DEVICE_REMOVED,
|
||||
TOOL_CHANGED,
|
||||
KBD_A11Y_MASK_CHANGED,
|
||||
KBD_A11Y_FLAGS_CHANGED,
|
||||
PTR_A11Y_DWELL_CLICK_TYPE_CHANGED,
|
||||
PTR_A11Y_TIMEOUT_STARTED,
|
||||
PTR_A11Y_TIMEOUT_STOPPED,
|
||||
IS_UNFOCUS_INHIBITED_CHANGED,
|
||||
N_SIGNALS,
|
||||
};
|
||||
|
||||
static guint signals[N_SIGNALS] = { 0 };
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_BACKEND,
|
||||
PROP_TOUCH_MODE,
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
static GParamSpec *props[N_PROPS];
|
||||
|
||||
typedef struct _ClutterSeatPrivate ClutterSeatPrivate;
|
||||
|
||||
struct _ClutterSeatPrivate
|
||||
{
|
||||
ClutterBackend *backend;
|
||||
|
||||
unsigned int inhibit_unfocus_count;
|
||||
|
||||
/* Keyboard a11y */
|
||||
ClutterKbdA11ySettings kbd_a11y_settings;
|
||||
|
||||
/* Pointer a11y */
|
||||
ClutterPointerA11ySettings pointer_a11y_settings;
|
||||
};
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterSeat, clutter_seat, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
clutter_seat_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterSeat *seat = CLUTTER_SEAT (object);
|
||||
ClutterSeatPrivate *priv = clutter_seat_get_instance_private (seat);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_BACKEND:
|
||||
priv->backend = g_value_get_object (value);
|
||||
break;
|
||||
case PROP_TOUCH_MODE:
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_seat_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterSeat *seat = CLUTTER_SEAT (object);
|
||||
ClutterSeatPrivate *priv = clutter_seat_get_instance_private (seat);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_BACKEND:
|
||||
g_value_set_object (value, priv->backend);
|
||||
break;
|
||||
case PROP_TOUCH_MODE:
|
||||
g_value_set_boolean (value, FALSE);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_seat_finalize (GObject *object)
|
||||
{
|
||||
ClutterSeat *seat = CLUTTER_SEAT (object);
|
||||
ClutterSeatPrivate *priv = clutter_seat_get_instance_private (seat);
|
||||
|
||||
g_clear_object (&priv->backend);
|
||||
|
||||
G_OBJECT_CLASS (clutter_seat_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_seat_class_init (ClutterSeatClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->set_property = clutter_seat_set_property;
|
||||
object_class->get_property = clutter_seat_get_property;
|
||||
object_class->finalize = clutter_seat_finalize;
|
||||
|
||||
signals[DEVICE_ADDED] =
|
||||
g_signal_new (I_("device-added"),
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_INPUT_DEVICE);
|
||||
|
||||
signals[DEVICE_REMOVED] =
|
||||
g_signal_new (I_("device-removed"),
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_INPUT_DEVICE);
|
||||
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);
|
||||
g_signal_set_va_marshaller (signals[TOOL_CHANGED],
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
_clutter_marshal_VOID__OBJECT_OBJECTv);
|
||||
|
||||
/**
|
||||
* ClutterSeat::kbd-a11y-mods-state-changed:
|
||||
* @seat: the #ClutterSeat 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.
|
||||
*/
|
||||
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);
|
||||
g_signal_set_va_marshaller (signals[KBD_A11Y_MASK_CHANGED],
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
_clutter_marshal_VOID__UINT_UINTv);
|
||||
|
||||
/**
|
||||
* ClutterSeat::kbd-a11y-flags-changed:
|
||||
* @seat: the #ClutterSeat 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 accessibility operations.
|
||||
*/
|
||||
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);
|
||||
g_signal_set_va_marshaller (signals[KBD_A11Y_FLAGS_CHANGED],
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
_clutter_marshal_VOID__UINT_UINTv);
|
||||
|
||||
/**
|
||||
* ClutterSeat::ptr-a11y-dwell-click-type-changed:
|
||||
* @seat: the #ClutterSeat that emitted the signal
|
||||
* @click_type: the new #ClutterPointerA11yDwellClickType mode
|
||||
*
|
||||
* The ::ptr-a11y-dwell-click-type-changed signal is emitted each time
|
||||
* the ClutterPointerA11yDwellClickType mode is changed as the result
|
||||
* of pointer accessibility operations.
|
||||
*/
|
||||
signals[PTR_A11Y_DWELL_CLICK_TYPE_CHANGED] =
|
||||
g_signal_new (I_("ptr-a11y-dwell-click-type-changed"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_POINTER_A11Y_DWELL_CLICK_TYPE);
|
||||
|
||||
/**
|
||||
* ClutterSeat::ptr-a11y-timeout-started:
|
||||
* @seat: the #ClutterSeat that emitted the signal
|
||||
* @device: the core pointer #ClutterInputDevice
|
||||
* @timeout_type: the type of timeout #ClutterPointerA11yTimeoutType
|
||||
* @delay: the delay in ms before secondary-click is triggered.
|
||||
*
|
||||
* The ::ptr-a11y-timeout-started signal is emitted when a
|
||||
* pointer accessibility timeout delay is started, so that upper
|
||||
* layers can notify the user with some visual feedback.
|
||||
*/
|
||||
signals[PTR_A11Y_TIMEOUT_STARTED] =
|
||||
g_signal_new (I_("ptr-a11y-timeout-started"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT_FLAGS_UINT,
|
||||
G_TYPE_NONE, 3,
|
||||
CLUTTER_TYPE_INPUT_DEVICE,
|
||||
CLUTTER_TYPE_POINTER_A11Y_TIMEOUT_TYPE,
|
||||
G_TYPE_UINT);
|
||||
g_signal_set_va_marshaller (signals[PTR_A11Y_TIMEOUT_STARTED],
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
_clutter_marshal_VOID__OBJECT_FLAGS_UINTv);
|
||||
|
||||
/**
|
||||
* ClutterSeat::ptr-a11y-timeout-stopped:
|
||||
* @seat: the #ClutterSeat that emitted the signal
|
||||
* @device: the core pointer #ClutterInputDevice
|
||||
* @timeout_type: the type of timeout #ClutterPointerA11yTimeoutType
|
||||
* @clicked: %TRUE if the timeout finished and triggered a click
|
||||
*
|
||||
* The ::ptr-a11y-timeout-stopped signal is emitted when a running
|
||||
* pointer accessibility timeout delay is stopped, either because
|
||||
* it's triggered at the end of the delay or cancelled, so that
|
||||
* upper layers can notify the user with some visual feedback.
|
||||
*/
|
||||
signals[PTR_A11Y_TIMEOUT_STOPPED] =
|
||||
g_signal_new (I_("ptr-a11y-timeout-stopped"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT_FLAGS_BOOLEAN,
|
||||
G_TYPE_NONE, 3,
|
||||
CLUTTER_TYPE_INPUT_DEVICE,
|
||||
CLUTTER_TYPE_POINTER_A11Y_TIMEOUT_TYPE,
|
||||
G_TYPE_BOOLEAN);
|
||||
g_signal_set_va_marshaller (signals[PTR_A11Y_TIMEOUT_STOPPED],
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
_clutter_marshal_VOID__OBJECT_FLAGS_BOOLEANv);
|
||||
|
||||
/**
|
||||
* ClutterSeat::is-unfocus-inhibited-changed:
|
||||
* @seat: the #ClutterSeat that emitted the signal
|
||||
*
|
||||
* The ::is-unfocus-inhibited-changed signal is emitted when the
|
||||
* property to inhibit the unsetting of the focus-surface of the
|
||||
* #ClutterSeat changed. To get the current state of this property,
|
||||
* use clutter_seat_is_unfocus_inhibited().
|
||||
*/
|
||||
signals[IS_UNFOCUS_INHIBITED_CHANGED] =
|
||||
g_signal_new (I_("is-unfocus-inhibited-changed"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
props[PROP_BACKEND] =
|
||||
g_param_spec_object ("backend",
|
||||
P_("Backend"),
|
||||
P_("Backend"),
|
||||
CLUTTER_TYPE_BACKEND,
|
||||
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||
|
||||
/**
|
||||
* ClutterSeat:touch-mode:
|
||||
*
|
||||
* The current touch-mode of the #ClutterSeat, it is set to %TRUE if the
|
||||
* requirements documented in clutter_seat_get_touch_mode() are fulfilled.
|
||||
**/
|
||||
props[PROP_TOUCH_MODE] =
|
||||
g_param_spec_boolean ("touch-mode",
|
||||
P_("Touch mode"),
|
||||
P_("Touch mode"),
|
||||
FALSE,
|
||||
CLUTTER_PARAM_READABLE);
|
||||
|
||||
g_object_class_install_properties (object_class, N_PROPS, props);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_seat_init (ClutterSeat *seat)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_seat_get_pointer:
|
||||
* @seat: a #ClutterSeat
|
||||
*
|
||||
* Returns the master pointer
|
||||
*
|
||||
* Returns: (transfer none): the master pointer
|
||||
**/
|
||||
ClutterInputDevice *
|
||||
clutter_seat_get_pointer (ClutterSeat *seat)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SEAT (seat), NULL);
|
||||
|
||||
return CLUTTER_SEAT_GET_CLASS (seat)->get_pointer (seat);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_seat_get_keyboard:
|
||||
* @seat: a #ClutterSeat
|
||||
*
|
||||
* Returns the master keyboard
|
||||
*
|
||||
* Returns: (transfer none): the master keyboard
|
||||
**/
|
||||
ClutterInputDevice *
|
||||
clutter_seat_get_keyboard (ClutterSeat *seat)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SEAT (seat), NULL);
|
||||
|
||||
return CLUTTER_SEAT_GET_CLASS (seat)->get_keyboard (seat);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_seat_list_devices:
|
||||
* @seat: a #ClutterSeat
|
||||
*
|
||||
* Returns the list of HW devices
|
||||
*
|
||||
* Returns: (transfer container) (element-type Clutter.InputDevice): A list
|
||||
* of #ClutterInputDevice. The elements of the returned list are owned by
|
||||
* Clutter and may not be freed, the returned list should be freed using
|
||||
* g_list_free() when done.
|
||||
**/
|
||||
GList *
|
||||
clutter_seat_list_devices (ClutterSeat *seat)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SEAT (seat), NULL);
|
||||
|
||||
return CLUTTER_SEAT_GET_CLASS (seat)->list_devices (seat);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_seat_bell_notify (ClutterSeat *seat)
|
||||
{
|
||||
CLUTTER_SEAT_GET_CLASS (seat)->bell_notify (seat);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_seat_get_keymap:
|
||||
* @seat: a #ClutterSeat
|
||||
*
|
||||
* Returns the seat keymap
|
||||
*
|
||||
* Returns: (transfer none): the seat keymap
|
||||
**/
|
||||
ClutterKeymap *
|
||||
clutter_seat_get_keymap (ClutterSeat *seat)
|
||||
{
|
||||
return CLUTTER_SEAT_GET_CLASS (seat)->get_keymap (seat);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
are_kbd_a11y_settings_equal (ClutterKbdA11ySettings *a,
|
||||
ClutterKbdA11ySettings *b)
|
||||
{
|
||||
return (memcmp (a, b, sizeof (ClutterKbdA11ySettings)) == 0);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_seat_set_kbd_a11y_settings (ClutterSeat *seat,
|
||||
ClutterKbdA11ySettings *settings)
|
||||
{
|
||||
ClutterSeatClass *seat_class;
|
||||
ClutterSeatPrivate *priv = clutter_seat_get_instance_private (seat);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_SEAT (seat));
|
||||
|
||||
if (are_kbd_a11y_settings_equal (&priv->kbd_a11y_settings, settings))
|
||||
return;
|
||||
|
||||
priv->kbd_a11y_settings = *settings;
|
||||
|
||||
seat_class = CLUTTER_SEAT_GET_CLASS (seat);
|
||||
if (seat_class->apply_kbd_a11y_settings)
|
||||
seat_class->apply_kbd_a11y_settings (seat, settings);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_seat_get_kbd_a11y_settings (ClutterSeat *seat,
|
||||
ClutterKbdA11ySettings *settings)
|
||||
{
|
||||
ClutterSeatPrivate *priv = clutter_seat_get_instance_private (seat);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_SEAT (seat));
|
||||
|
||||
*settings = priv->kbd_a11y_settings;
|
||||
}
|
||||
|
||||
void
|
||||
clutter_seat_ensure_a11y_state (ClutterSeat *seat)
|
||||
{
|
||||
ClutterInputDevice *core_pointer;
|
||||
|
||||
core_pointer = clutter_seat_get_pointer (seat);
|
||||
|
||||
if (core_pointer)
|
||||
{
|
||||
if (_clutter_is_input_pointer_a11y_enabled (core_pointer))
|
||||
_clutter_input_pointer_a11y_add_device (core_pointer);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
are_pointer_a11y_settings_equal (ClutterPointerA11ySettings *a,
|
||||
ClutterPointerA11ySettings *b)
|
||||
{
|
||||
return (memcmp (a, b, sizeof (ClutterPointerA11ySettings)) == 0);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_seat_enable_pointer_a11y (ClutterSeat *seat)
|
||||
{
|
||||
ClutterInputDevice *core_pointer;
|
||||
|
||||
core_pointer = clutter_seat_get_pointer (seat);
|
||||
|
||||
_clutter_input_pointer_a11y_add_device (core_pointer);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_seat_disable_pointer_a11y (ClutterSeat *seat)
|
||||
{
|
||||
ClutterInputDevice *core_pointer;
|
||||
|
||||
core_pointer = clutter_seat_get_pointer (seat);
|
||||
|
||||
_clutter_input_pointer_a11y_remove_device (core_pointer);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_seat_set_pointer_a11y_settings:
|
||||
* @seat: a #ClutterSeat
|
||||
* @settings: a pointer to a #ClutterPointerA11ySettings
|
||||
*
|
||||
* Sets the pointer accessibility settings
|
||||
**/
|
||||
void
|
||||
clutter_seat_set_pointer_a11y_settings (ClutterSeat *seat,
|
||||
ClutterPointerA11ySettings *settings)
|
||||
{
|
||||
ClutterSeatPrivate *priv = clutter_seat_get_instance_private (seat);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_SEAT (seat));
|
||||
|
||||
if (are_pointer_a11y_settings_equal (&priv->pointer_a11y_settings, settings))
|
||||
return;
|
||||
|
||||
if (priv->pointer_a11y_settings.controls == 0 && settings->controls != 0)
|
||||
clutter_seat_enable_pointer_a11y (seat);
|
||||
else if (priv->pointer_a11y_settings.controls != 0 && settings->controls == 0)
|
||||
clutter_seat_disable_pointer_a11y (seat);
|
||||
|
||||
priv->pointer_a11y_settings = *settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_seat_get_pointer_a11y_settings:
|
||||
* @seat: a #ClutterSeat
|
||||
* @settings: a pointer to a #ClutterPointerA11ySettings
|
||||
*
|
||||
* Gets the current pointer accessibility settings
|
||||
**/
|
||||
void
|
||||
clutter_seat_get_pointer_a11y_settings (ClutterSeat *seat,
|
||||
ClutterPointerA11ySettings *settings)
|
||||
{
|
||||
ClutterSeatPrivate *priv = clutter_seat_get_instance_private (seat);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_SEAT (seat));
|
||||
|
||||
*settings = priv->pointer_a11y_settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_seat_set_pointer_a11y_dwell_click_type:
|
||||
* @seat: a #ClutterSeat
|
||||
* @click_type: type of click as #ClutterPointerA11yDwellClickType
|
||||
*
|
||||
* Sets the dwell click type
|
||||
**/
|
||||
void
|
||||
clutter_seat_set_pointer_a11y_dwell_click_type (ClutterSeat *seat,
|
||||
ClutterPointerA11yDwellClickType click_type)
|
||||
{
|
||||
ClutterSeatPrivate *priv = clutter_seat_get_instance_private (seat);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_SEAT (seat));
|
||||
|
||||
priv->pointer_a11y_settings.dwell_click_type = click_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_seat_inhibit_unfocus:
|
||||
* @seat: a #ClutterSeat
|
||||
*
|
||||
* Inhibits unsetting of the pointer focus-surface for the #ClutterSeat @seat,
|
||||
* this allows to keep using the pointer even when it's hidden.
|
||||
*
|
||||
* This property is refcounted, so clutter_seat_uninhibit_unfocus() must be
|
||||
* called the exact same number of times as clutter_seat_inhibit_unfocus()
|
||||
* was called before.
|
||||
**/
|
||||
void
|
||||
clutter_seat_inhibit_unfocus (ClutterSeat *seat)
|
||||
{
|
||||
ClutterSeatPrivate *priv;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_SEAT (seat));
|
||||
|
||||
priv = clutter_seat_get_instance_private (seat);
|
||||
|
||||
priv->inhibit_unfocus_count++;
|
||||
|
||||
if (priv->inhibit_unfocus_count == 1)
|
||||
g_signal_emit (G_OBJECT (seat), signals[IS_UNFOCUS_INHIBITED_CHANGED], 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_seat_uninhibit_unfocus:
|
||||
* @seat: a #ClutterSeat
|
||||
*
|
||||
* Disables the inhibiting of unsetting of the pointer focus-surface
|
||||
* previously enabled by calling clutter_seat_inhibit_unfocus().
|
||||
*
|
||||
* This property is refcounted, so clutter_seat_uninhibit_unfocus() must be
|
||||
* called the exact same number of times as clutter_seat_inhibit_unfocus()
|
||||
* was called before.
|
||||
**/
|
||||
void
|
||||
clutter_seat_uninhibit_unfocus (ClutterSeat *seat)
|
||||
{
|
||||
ClutterSeatPrivate *priv;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_SEAT (seat));
|
||||
|
||||
priv = clutter_seat_get_instance_private (seat);
|
||||
|
||||
if (priv->inhibit_unfocus_count == 0)
|
||||
{
|
||||
g_warning ("Called clutter_seat_uninhibit_unfocus without inhibiting before");
|
||||
return;
|
||||
}
|
||||
|
||||
priv->inhibit_unfocus_count--;
|
||||
|
||||
if (priv->inhibit_unfocus_count == 0)
|
||||
g_signal_emit (G_OBJECT (seat), signals[IS_UNFOCUS_INHIBITED_CHANGED], 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_seat_is_unfocus_inhibited:
|
||||
* @seat: a #ClutterSeat
|
||||
*
|
||||
* Gets whether unsetting of the pointer focus-surface is inhibited
|
||||
* for the #ClutterSeat @seat.
|
||||
*
|
||||
* Returns: %TRUE if unsetting is inhibited, %FALSE otherwise
|
||||
**/
|
||||
gboolean
|
||||
clutter_seat_is_unfocus_inhibited (ClutterSeat *seat)
|
||||
{
|
||||
ClutterSeatPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_SEAT (seat), FALSE);
|
||||
|
||||
priv = clutter_seat_get_instance_private (seat);
|
||||
|
||||
return priv->inhibit_unfocus_count > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_seat_create_virtual_device:
|
||||
* @seat: a #ClutterSeat
|
||||
* @device_type: the type of the virtual device
|
||||
*
|
||||
* Creates a virtual input device.
|
||||
*
|
||||
* Returns: (transfer full): a newly created virtual device
|
||||
**/
|
||||
ClutterVirtualInputDevice *
|
||||
clutter_seat_create_virtual_device (ClutterSeat *seat,
|
||||
ClutterInputDeviceType device_type)
|
||||
{
|
||||
ClutterSeatClass *seat_class;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_SEAT (seat), NULL);
|
||||
|
||||
seat_class = CLUTTER_SEAT_GET_CLASS (seat);
|
||||
return seat_class->create_virtual_device (seat, device_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_seat_supported_virtual_device_types: (skip)
|
||||
*/
|
||||
ClutterVirtualDeviceType
|
||||
clutter_seat_get_supported_virtual_device_types (ClutterSeat *seat)
|
||||
{
|
||||
ClutterSeatClass *seat_class;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_SEAT (seat),
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_NONE);
|
||||
|
||||
seat_class = CLUTTER_SEAT_GET_CLASS (seat);
|
||||
return seat_class->get_supported_virtual_device_types (seat);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_seat_compress_motion (ClutterSeat *seat,
|
||||
ClutterEvent *event,
|
||||
const ClutterEvent *to_discard)
|
||||
{
|
||||
ClutterSeatClass *seat_class;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_SEAT (seat));
|
||||
|
||||
seat_class = CLUTTER_SEAT_GET_CLASS (seat);
|
||||
|
||||
if (seat_class->compress_motion)
|
||||
seat_class->compress_motion (seat, event, to_discard);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_seat_warp_pointer (ClutterSeat *seat,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_SEAT (seat));
|
||||
|
||||
CLUTTER_SEAT_GET_CLASS (seat)->warp_pointer (seat, x, y);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_seat_get_touch_mode:
|
||||
* @seat: a #ClutterSeat
|
||||
*
|
||||
* Gets the current touch-mode state of the #ClutterSeat @seat.
|
||||
* The #ClutterSeat:touch-mode property is set to %TRUE if the following
|
||||
* requirements are fulfilled:
|
||||
*
|
||||
* - A touchscreen is available
|
||||
* - No external keyboard is attached to the device
|
||||
* - A tablet mode switch, if present, is enabled
|
||||
*
|
||||
* Returns: %TRUE if the device is a tablet that doesn't have an external
|
||||
* keyboard attached, %FALSE otherwise.
|
||||
**/
|
||||
gboolean
|
||||
clutter_seat_get_touch_mode (ClutterSeat *seat)
|
||||
{
|
||||
gboolean touch_mode;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_SEAT (seat), FALSE);
|
||||
|
||||
g_object_get (G_OBJECT (seat), "touch-mode", &touch_mode, NULL);
|
||||
|
||||
return touch_mode;
|
||||
}
|
190
clutter/clutter/clutter-seat.h
Normal file
190
clutter/clutter/clutter-seat.h
Normal file
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright (C) 2019 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/>.
|
||||
*
|
||||
* Author: Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
#ifndef CLUTTER_SEAT_H
|
||||
#define CLUTTER_SEAT_H
|
||||
|
||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <clutter/clutter.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include "clutter/clutter-types.h"
|
||||
#include "clutter/clutter-keymap.h"
|
||||
#include "clutter/clutter-virtual-input-device.h"
|
||||
|
||||
#define CLUTTER_TYPE_SEAT (clutter_seat_get_type ())
|
||||
|
||||
CLUTTER_EXPORT
|
||||
G_DECLARE_DERIVABLE_TYPE (ClutterSeat, clutter_seat,
|
||||
CLUTTER, SEAT, GObject)
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11ySettings:
|
||||
*
|
||||
* The #ClutterPointerA11ySettings structure contains pointer accessibility
|
||||
* settings
|
||||
*
|
||||
*/
|
||||
typedef struct _ClutterPointerA11ySettings
|
||||
{
|
||||
ClutterPointerA11yFlags controls;
|
||||
ClutterPointerA11yDwellClickType dwell_click_type;
|
||||
ClutterPointerA11yDwellMode dwell_mode;
|
||||
ClutterPointerA11yDwellDirection dwell_gesture_single;
|
||||
ClutterPointerA11yDwellDirection dwell_gesture_double;
|
||||
ClutterPointerA11yDwellDirection dwell_gesture_drag;
|
||||
ClutterPointerA11yDwellDirection dwell_gesture_secondary;
|
||||
gint secondary_click_delay;
|
||||
gint dwell_delay;
|
||||
gint dwell_threshold;
|
||||
} ClutterPointerA11ySettings;
|
||||
|
||||
/**
|
||||
* ClutterVirtualDeviceType:
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
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;
|
||||
|
||||
typedef struct _ClutterSeatClass ClutterSeatClass;
|
||||
|
||||
struct _ClutterSeatClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
ClutterInputDevice * (* get_pointer) (ClutterSeat *seat);
|
||||
ClutterInputDevice * (* get_keyboard) (ClutterSeat *seat);
|
||||
|
||||
GList * (* list_devices) (ClutterSeat *seat);
|
||||
|
||||
void (* bell_notify) (ClutterSeat *seat);
|
||||
|
||||
ClutterKeymap * (* get_keymap) (ClutterSeat *seat);
|
||||
|
||||
void (* compress_motion) (ClutterSeat *seat,
|
||||
ClutterEvent *event,
|
||||
const ClutterEvent *to_discard);
|
||||
|
||||
void (* warp_pointer) (ClutterSeat *seat,
|
||||
int x,
|
||||
int y);
|
||||
|
||||
/* Event platform data */
|
||||
void (* copy_event_data) (ClutterSeat *seat,
|
||||
const ClutterEvent *src,
|
||||
ClutterEvent *dest);
|
||||
void (* free_event_data) (ClutterSeat *seat,
|
||||
ClutterEvent *event);
|
||||
|
||||
/* Keyboard accessibility */
|
||||
void (* apply_kbd_a11y_settings) (ClutterSeat *seat,
|
||||
ClutterKbdA11ySettings *settings);
|
||||
|
||||
/* Virtual devices */
|
||||
ClutterVirtualInputDevice * (* create_virtual_device) (ClutterSeat *seat,
|
||||
ClutterInputDeviceType device_type);
|
||||
ClutterVirtualDeviceType (* get_supported_virtual_device_types) (ClutterSeat *seat);
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterInputDevice * clutter_seat_get_pointer (ClutterSeat *seat);
|
||||
CLUTTER_EXPORT
|
||||
ClutterInputDevice * clutter_seat_get_keyboard (ClutterSeat *seat);
|
||||
CLUTTER_EXPORT
|
||||
GList * clutter_seat_list_devices (ClutterSeat *seat);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_seat_bell_notify (ClutterSeat *seat);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterKeymap * clutter_seat_get_keymap (ClutterSeat *seat);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_seat_set_kbd_a11y_settings (ClutterSeat *seat,
|
||||
ClutterKbdA11ySettings *settings);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_seat_get_kbd_a11y_settings (ClutterSeat *seat,
|
||||
ClutterKbdA11ySettings *settings);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_seat_ensure_a11y_state (ClutterSeat *seat);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_seat_set_pointer_a11y_settings (ClutterSeat *seat,
|
||||
ClutterPointerA11ySettings *settings);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_seat_get_pointer_a11y_settings (ClutterSeat *seat,
|
||||
ClutterPointerA11ySettings *settings);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_seat_set_pointer_a11y_dwell_click_type (ClutterSeat *seat,
|
||||
ClutterPointerA11yDwellClickType click_type);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_seat_inhibit_unfocus (ClutterSeat *seat);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_seat_uninhibit_unfocus (ClutterSeat *seat);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_seat_is_unfocus_inhibited (ClutterSeat *seat);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterVirtualInputDevice *clutter_seat_create_virtual_device (ClutterSeat *seat,
|
||||
ClutterInputDeviceType device_type);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterVirtualDeviceType clutter_seat_get_supported_virtual_device_types (ClutterSeat *seat);
|
||||
|
||||
void clutter_seat_compress_motion (ClutterSeat *seat,
|
||||
ClutterEvent *event,
|
||||
const ClutterEvent *to_discard);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_seat_warp_pointer (ClutterSeat *seat,
|
||||
int x,
|
||||
int y);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_seat_get_touch_mode (ClutterSeat *seat);
|
||||
|
||||
#endif /* CLUTTER_SEAT_H */
|
@@ -367,24 +367,12 @@ clutter_shader_effect_try_static_source (ClutterShaderEffect *self)
|
||||
|
||||
CLUTTER_NOTE (SHADER, "Compiling shader effect");
|
||||
|
||||
cogl_shader_compile (class_priv->shader);
|
||||
class_priv->program = cogl_create_program ();
|
||||
|
||||
if (cogl_shader_is_compiled (class_priv->shader))
|
||||
{
|
||||
class_priv->program = cogl_create_program ();
|
||||
cogl_program_attach_shader (class_priv->program,
|
||||
class_priv->shader);
|
||||
|
||||
cogl_program_attach_shader (class_priv->program,
|
||||
class_priv->shader);
|
||||
|
||||
cogl_program_link (class_priv->program);
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *log_buf = cogl_shader_get_info_log (class_priv->shader);
|
||||
|
||||
g_warning (G_STRLOC ": Unable to compile the GLSL shader: %s", log_buf);
|
||||
g_free (log_buf);
|
||||
}
|
||||
cogl_program_link (class_priv->program);
|
||||
}
|
||||
|
||||
priv->shader = cogl_object_ref (class_priv->shader);
|
||||
@@ -902,23 +890,11 @@ clutter_shader_effect_set_shader_source (ClutterShaderEffect *effect,
|
||||
|
||||
CLUTTER_NOTE (SHADER, "Compiling shader effect");
|
||||
|
||||
cogl_shader_compile (priv->shader);
|
||||
priv->program = cogl_create_program ();
|
||||
|
||||
if (cogl_shader_is_compiled (priv->shader))
|
||||
{
|
||||
priv->program = cogl_create_program ();
|
||||
cogl_program_attach_shader (priv->program, priv->shader);
|
||||
|
||||
cogl_program_attach_shader (priv->program, priv->shader);
|
||||
|
||||
cogl_program_link (priv->program);
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *log_buf = cogl_shader_get_info_log (priv->shader);
|
||||
|
||||
g_warning (G_STRLOC ": Unable to compile the GLSL shader: %s", log_buf);
|
||||
g_free (log_buf);
|
||||
}
|
||||
cogl_program_link (priv->program);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -36,9 +36,9 @@ typedef struct _ClutterStageQueueRedrawEntry ClutterStageQueueRedrawEntry;
|
||||
/* stage */
|
||||
ClutterStageWindow *_clutter_stage_get_default_window (void);
|
||||
|
||||
void _clutter_stage_paint_view (ClutterStage *stage,
|
||||
ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip);
|
||||
void clutter_stage_paint_view (ClutterStage *stage,
|
||||
ClutterStageView *view,
|
||||
const cairo_region_t *redraw_clip);
|
||||
|
||||
void _clutter_stage_emit_after_paint (ClutterStage *stage);
|
||||
|
||||
@@ -78,6 +78,7 @@ void _clutter_stage_schedule_update (ClutterStage *stage);
|
||||
gint64 _clutter_stage_get_update_time (ClutterStage *stage);
|
||||
void _clutter_stage_clear_update_time (ClutterStage *stage);
|
||||
gboolean _clutter_stage_has_full_redraw_queued (ClutterStage *stage);
|
||||
int64_t _clutter_stage_get_next_presentation_time (ClutterStage *stage);
|
||||
|
||||
void clutter_stage_log_pick (ClutterStage *stage,
|
||||
const graphene_point_t *vertices,
|
||||
@@ -141,6 +142,9 @@ void _clutter_stage_presented (ClutterStage *stag
|
||||
|
||||
GList * _clutter_stage_peek_stage_views (ClutterStage *stage);
|
||||
|
||||
void clutter_stage_queue_actor_relayout (ClutterStage *stage,
|
||||
ClutterActor *actor);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_STAGE_PRIVATE_H__ */
|
||||
|
@@ -20,8 +20,7 @@
|
||||
|
||||
#include "clutter/clutter-stage-view.h"
|
||||
|
||||
void clutter_stage_view_after_paint (ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip);
|
||||
void clutter_stage_view_after_paint (ClutterStageView *view);
|
||||
|
||||
gboolean clutter_stage_view_is_dirty_viewport (ClutterStageView *view);
|
||||
|
||||
@@ -33,7 +32,15 @@ gboolean clutter_stage_view_is_dirty_projection (ClutterStageView *view);
|
||||
void clutter_stage_view_set_dirty_projection (ClutterStageView *view,
|
||||
gboolean dirty);
|
||||
|
||||
void clutter_stage_view_add_redraw_clip (ClutterStageView *view,
|
||||
cairo_rectangle_int_t *clip);
|
||||
void clutter_stage_view_add_redraw_clip (ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip);
|
||||
|
||||
gboolean clutter_stage_view_has_full_redraw_clip (ClutterStageView *view);
|
||||
|
||||
gboolean clutter_stage_view_has_redraw_clip (ClutterStageView *view);
|
||||
|
||||
const cairo_region_t * clutter_stage_view_peek_redraw_clip (ClutterStageView *view);
|
||||
|
||||
cairo_region_t * clutter_stage_view_take_redraw_clip (ClutterStageView *view);
|
||||
|
||||
#endif /* __CLUTTER_STAGE_VIEW_PRIVATE_H__ */
|
||||
|
@@ -23,6 +23,8 @@
|
||||
#include <cairo-gobject.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "clutter/clutter-private.h"
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
@@ -50,6 +52,9 @@ typedef struct _ClutterStageViewPrivate
|
||||
CoglOffscreen *shadowfb;
|
||||
CoglPipeline *shadowfb_pipeline;
|
||||
|
||||
gboolean has_redraw_clip;
|
||||
cairo_region_t *redraw_clip;
|
||||
|
||||
guint dirty_viewport : 1;
|
||||
guint dirty_projection : 1;
|
||||
} ClutterStageViewPrivate;
|
||||
@@ -166,12 +171,11 @@ clutter_stage_view_invalidate_offscreen_blit_pipeline (ClutterStageView *view)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_stage_view_copy_to_framebuffer (ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *rect,
|
||||
CoglPipeline *pipeline,
|
||||
CoglFramebuffer *src_framebuffer,
|
||||
CoglFramebuffer *dst_framebuffer,
|
||||
gboolean can_blit)
|
||||
clutter_stage_view_copy_to_framebuffer (ClutterStageView *view,
|
||||
CoglPipeline *pipeline,
|
||||
CoglFramebuffer *src_framebuffer,
|
||||
CoglFramebuffer *dst_framebuffer,
|
||||
gboolean can_blit)
|
||||
{
|
||||
CoglMatrix matrix;
|
||||
|
||||
@@ -204,8 +208,7 @@ clutter_stage_view_copy_to_framebuffer (ClutterStageView *view,
|
||||
}
|
||||
|
||||
void
|
||||
clutter_stage_view_after_paint (ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *rect)
|
||||
clutter_stage_view_after_paint (ClutterStageView *view)
|
||||
{
|
||||
ClutterStageViewPrivate *priv =
|
||||
clutter_stage_view_get_instance_private (view);
|
||||
@@ -222,7 +225,6 @@ clutter_stage_view_after_paint (ClutterStageView *view,
|
||||
if (priv->shadowfb)
|
||||
{
|
||||
clutter_stage_view_copy_to_framebuffer (view,
|
||||
rect,
|
||||
priv->offscreen_pipeline,
|
||||
priv->offscreen,
|
||||
priv->shadowfb,
|
||||
@@ -231,7 +233,6 @@ clutter_stage_view_after_paint (ClutterStageView *view,
|
||||
else
|
||||
{
|
||||
clutter_stage_view_copy_to_framebuffer (view,
|
||||
rect,
|
||||
priv->offscreen_pipeline,
|
||||
priv->offscreen,
|
||||
priv->framebuffer,
|
||||
@@ -243,7 +244,6 @@ clutter_stage_view_after_paint (ClutterStageView *view,
|
||||
{
|
||||
clutter_stage_view_ensure_shadowfb_blit_pipeline (view);
|
||||
clutter_stage_view_copy_to_framebuffer (view,
|
||||
rect,
|
||||
priv->shadowfb_pipeline,
|
||||
priv->shadowfb,
|
||||
priv->framebuffer,
|
||||
@@ -307,6 +307,86 @@ clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView *view,
|
||||
view_class->get_offscreen_transformation_matrix (view, matrix);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_stage_view_add_redraw_clip (ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip)
|
||||
{
|
||||
ClutterStageViewPrivate *priv =
|
||||
clutter_stage_view_get_instance_private (view);
|
||||
|
||||
if (priv->has_redraw_clip && !priv->redraw_clip)
|
||||
return;
|
||||
|
||||
if (!clip)
|
||||
{
|
||||
g_clear_pointer (&priv->redraw_clip, cairo_region_destroy);
|
||||
priv->has_redraw_clip = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (clip->width == 0 || clip->height == 0)
|
||||
return;
|
||||
|
||||
if (!priv->redraw_clip)
|
||||
{
|
||||
if (!clutter_util_rectangle_equal (&priv->layout, clip))
|
||||
priv->redraw_clip = cairo_region_create_rectangle (clip);
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_region_union_rectangle (priv->redraw_clip, clip);
|
||||
|
||||
if (cairo_region_num_rectangles (priv->redraw_clip) == 1)
|
||||
{
|
||||
cairo_rectangle_int_t redraw_clip_extents;
|
||||
|
||||
cairo_region_get_extents (priv->redraw_clip, &redraw_clip_extents);
|
||||
if (clutter_util_rectangle_equal (&priv->layout, &redraw_clip_extents))
|
||||
g_clear_pointer (&priv->redraw_clip, cairo_region_destroy);
|
||||
}
|
||||
}
|
||||
|
||||
priv->has_redraw_clip = TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
clutter_stage_view_has_redraw_clip (ClutterStageView *view)
|
||||
{
|
||||
ClutterStageViewPrivate *priv =
|
||||
clutter_stage_view_get_instance_private (view);
|
||||
|
||||
return priv->has_redraw_clip;
|
||||
}
|
||||
|
||||
gboolean
|
||||
clutter_stage_view_has_full_redraw_clip (ClutterStageView *view)
|
||||
{
|
||||
ClutterStageViewPrivate *priv =
|
||||
clutter_stage_view_get_instance_private (view);
|
||||
|
||||
return priv->has_redraw_clip && !priv->redraw_clip;
|
||||
}
|
||||
|
||||
const cairo_region_t *
|
||||
clutter_stage_view_peek_redraw_clip (ClutterStageView *view)
|
||||
{
|
||||
ClutterStageViewPrivate *priv =
|
||||
clutter_stage_view_get_instance_private (view);
|
||||
|
||||
return priv->redraw_clip;
|
||||
}
|
||||
|
||||
cairo_region_t *
|
||||
clutter_stage_view_take_redraw_clip (ClutterStageView *view)
|
||||
{
|
||||
ClutterStageViewPrivate *priv =
|
||||
clutter_stage_view_get_instance_private (view);
|
||||
|
||||
priv->has_redraw_clip = FALSE;
|
||||
|
||||
return g_steal_pointer (&priv->redraw_clip);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_stage_view_transform_to_onscreen (ClutterStageView *view,
|
||||
gfloat *x,
|
||||
@@ -419,6 +499,7 @@ clutter_stage_view_dispose (GObject *object)
|
||||
g_clear_pointer (&priv->offscreen, cogl_object_unref);
|
||||
g_clear_pointer (&priv->offscreen_pipeline, cogl_object_unref);
|
||||
g_clear_pointer (&priv->shadowfb_pipeline, cogl_object_unref);
|
||||
g_clear_pointer (&priv->redraw_clip, cairo_region_destroy);
|
||||
|
||||
G_OBJECT_CLASS (clutter_stage_view_parent_class)->dispose (object);
|
||||
}
|
||||
|
@@ -178,75 +178,20 @@ _clutter_stage_window_clear_update_time (ClutterStageWindow *window)
|
||||
iface->clear_update_time (window);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
|
||||
cairo_rectangle_int_t *stage_clip)
|
||||
int64_t
|
||||
_clutter_stage_window_get_next_presentation_time (ClutterStageWindow *window)
|
||||
{
|
||||
ClutterStageWindowInterface *iface;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
||||
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), 0);
|
||||
|
||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||
if (iface->add_redraw_clip != NULL)
|
||||
iface->add_redraw_clip (window, stage_clip);
|
||||
}
|
||||
|
||||
/* Determines if the backend will clip the rendering of the next
|
||||
* frame.
|
||||
*
|
||||
* Note: at the start of each new frame there is an implied clip that
|
||||
* clips everything (i.e. nothing would be drawn) so this function
|
||||
* will return True at the start of a new frame if the backend
|
||||
* supports clipped redraws.
|
||||
*/
|
||||
gboolean
|
||||
_clutter_stage_window_has_redraw_clips (ClutterStageWindow *window)
|
||||
{
|
||||
ClutterStageWindowInterface *iface;
|
||||
/* If not implemented then just revert to the old behaviour... */
|
||||
if (iface->get_next_presentation_time == NULL)
|
||||
return _clutter_stage_window_get_update_time (window);
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
||||
|
||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||
if (iface->has_redraw_clips != NULL)
|
||||
return iface->has_redraw_clips (window);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Determines if the backend will discard any additional redraw clips
|
||||
* and instead promote them to a full stage redraw.
|
||||
*
|
||||
* The ideas is that backend may have some heuristics that cause it to
|
||||
* give up tracking redraw clips so this can be used to avoid the cost
|
||||
* of calculating a redraw clip when we know it's going to be ignored
|
||||
* anyway.
|
||||
*/
|
||||
gboolean
|
||||
_clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window)
|
||||
{
|
||||
ClutterStageWindowInterface *iface;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
||||
|
||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||
if (iface->ignoring_redraw_clips != NULL)
|
||||
return iface->ignoring_redraw_clips (window);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
cairo_region_t *
|
||||
_clutter_stage_window_get_redraw_clip (ClutterStageWindow *window)
|
||||
{
|
||||
ClutterStageWindowInterface *iface;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
||||
|
||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||
if (iface->get_redraw_clip != NULL)
|
||||
return iface->get_redraw_clip (window);
|
||||
|
||||
return NULL;
|
||||
return iface->get_next_presentation_time (window);
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -51,12 +51,6 @@ struct _ClutterStageWindowInterface
|
||||
gint64 (* get_update_time) (ClutterStageWindow *stage_window);
|
||||
void (* clear_update_time) (ClutterStageWindow *stage_window);
|
||||
|
||||
void (* add_redraw_clip) (ClutterStageWindow *stage_window,
|
||||
cairo_rectangle_int_t *stage_rectangle);
|
||||
gboolean (* has_redraw_clips) (ClutterStageWindow *stage_window);
|
||||
gboolean (* ignoring_redraw_clips) (ClutterStageWindow *stage_window);
|
||||
cairo_region_t * (* get_redraw_clip) (ClutterStageWindow *stage_window);
|
||||
|
||||
void (* set_accept_focus) (ClutterStageWindow *stage_window,
|
||||
gboolean accept_focus);
|
||||
|
||||
@@ -67,6 +61,8 @@ struct _ClutterStageWindowInterface
|
||||
GList *(* get_views) (ClutterStageWindow *stage_window);
|
||||
int64_t (* get_frame_counter) (ClutterStageWindow *stage_window);
|
||||
void (* finish_frame) (ClutterStageWindow *stage_window);
|
||||
|
||||
int64_t (* get_next_presentation_time) (ClutterStageWindow *stage_window);
|
||||
};
|
||||
|
||||
ClutterActor * _clutter_stage_window_get_wrapper (ClutterStageWindow *window);
|
||||
@@ -94,12 +90,6 @@ void _clutter_stage_window_schedule_update (ClutterStageWin
|
||||
gint64 _clutter_stage_window_get_update_time (ClutterStageWindow *window);
|
||||
void _clutter_stage_window_clear_update_time (ClutterStageWindow *window);
|
||||
|
||||
void _clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
|
||||
cairo_rectangle_int_t *stage_clip);
|
||||
gboolean _clutter_stage_window_has_redraw_clips (ClutterStageWindow *window);
|
||||
gboolean _clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window);
|
||||
cairo_region_t * _clutter_stage_window_get_redraw_clip (ClutterStageWindow *window);
|
||||
|
||||
void _clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
|
||||
gboolean accept_focus);
|
||||
|
||||
@@ -113,6 +103,8 @@ void _clutter_stage_window_finish_frame (ClutterStageWin
|
||||
|
||||
int64_t _clutter_stage_window_get_frame_counter (ClutterStageWindow *window);
|
||||
|
||||
int64_t _clutter_stage_window_get_next_presentation_time (ClutterStageWindow *window);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_STAGE_WINDOW_H__ */
|
||||
|
@@ -60,10 +60,10 @@
|
||||
#include "clutter-color.h"
|
||||
#include "clutter-container.h"
|
||||
#include "clutter-debug.h"
|
||||
#include "clutter-device-manager-private.h"
|
||||
#include "clutter-enum-types.h"
|
||||
#include "clutter-event-private.h"
|
||||
#include "clutter-id-pool.h"
|
||||
#include "clutter-input-device-private.h"
|
||||
#include "clutter-main.h"
|
||||
#include "clutter-marshal.h"
|
||||
#include "clutter-master-clock.h"
|
||||
@@ -78,7 +78,6 @@
|
||||
#include "clutter-private.h"
|
||||
|
||||
#include "cogl/cogl.h"
|
||||
#include "cogl/cogl-trace.h"
|
||||
|
||||
struct _ClutterStageQueueRedrawEntry
|
||||
{
|
||||
@@ -120,6 +119,8 @@ struct _ClutterStagePrivate
|
||||
|
||||
ClutterPlane current_clip_planes[4];
|
||||
|
||||
GHashTable *pending_relayouts;
|
||||
unsigned int pending_relayouts_version;
|
||||
GList *pending_queue_redraws;
|
||||
|
||||
gint sync_delay;
|
||||
@@ -142,11 +143,8 @@ struct _ClutterStagePrivate
|
||||
gpointer paint_data;
|
||||
GDestroyNotify paint_notify;
|
||||
|
||||
cairo_rectangle_int_t view_clip;
|
||||
|
||||
int update_freeze_count;
|
||||
|
||||
guint relayout_pending : 1;
|
||||
guint redraw_pending : 1;
|
||||
guint is_cursor_visible : 1;
|
||||
guint throttle_motion_events : 1;
|
||||
@@ -558,6 +556,33 @@ pick_record_contains_point (ClutterStage *stage,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_stage_add_redraw_clip (ClutterStage *stage,
|
||||
cairo_rectangle_int_t *clip)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = _clutter_stage_peek_stage_views (stage); l; l = l->next)
|
||||
{
|
||||
ClutterStageView *view = l->data;
|
||||
|
||||
if (!clip)
|
||||
{
|
||||
clutter_stage_view_add_redraw_clip (view, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_rectangle_int_t view_layout;
|
||||
cairo_rectangle_int_t intersection;
|
||||
|
||||
clutter_stage_view_get_layout (view, &view_layout);
|
||||
if (_clutter_util_rectangle_intersection (&view_layout, clip,
|
||||
&intersection))
|
||||
clutter_stage_view_add_redraw_clip (view, &intersection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
queue_full_redraw (ClutterStage *stage)
|
||||
{
|
||||
@@ -576,7 +601,7 @@ queue_full_redraw (ClutterStage *stage)
|
||||
if (stage_window == NULL)
|
||||
return;
|
||||
|
||||
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
|
||||
clutter_stage_add_redraw_clip (stage, NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -902,15 +927,18 @@ setup_view_for_pick_or_paint (ClutterStage *stage,
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_stage_do_paint_view (ClutterStage *stage,
|
||||
ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip)
|
||||
clutter_stage_do_paint_view (ClutterStage *stage,
|
||||
ClutterStageView *view,
|
||||
const cairo_region_t *redraw_clip)
|
||||
{
|
||||
ClutterPaintContext *paint_context;
|
||||
cairo_rectangle_int_t clip_rect;
|
||||
|
||||
paint_context = clutter_paint_context_new_for_view (view);
|
||||
paint_context = clutter_paint_context_new_for_view (view, redraw_clip);
|
||||
|
||||
cairo_region_get_extents (redraw_clip, &clip_rect);
|
||||
setup_view_for_pick_or_paint (stage, view, &clip_rect);
|
||||
|
||||
setup_view_for_pick_or_paint (stage, view, clip);
|
||||
clutter_actor_paint (CLUTTER_ACTOR (stage), paint_context);
|
||||
clutter_paint_context_destroy (paint_context);
|
||||
}
|
||||
@@ -919,9 +947,9 @@ clutter_stage_do_paint_view (ClutterStage *stage,
|
||||
* for picking or painting...
|
||||
*/
|
||||
void
|
||||
_clutter_stage_paint_view (ClutterStage *stage,
|
||||
ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip)
|
||||
clutter_stage_paint_view (ClutterStage *stage,
|
||||
ClutterStageView *view,
|
||||
const cairo_region_t *redraw_clip)
|
||||
{
|
||||
ClutterStagePrivate *priv = stage->priv;
|
||||
|
||||
@@ -930,15 +958,11 @@ _clutter_stage_paint_view (ClutterStage *stage,
|
||||
|
||||
COGL_TRACE_BEGIN_SCOPED (ClutterStagePaintView, "Paint (view)");
|
||||
|
||||
priv->view_clip = *clip;
|
||||
|
||||
if (g_signal_has_handler_pending (stage, stage_signals[PAINT_VIEW],
|
||||
0, TRUE))
|
||||
g_signal_emit (stage, stage_signals[PAINT_VIEW], 0, view);
|
||||
g_signal_emit (stage, stage_signals[PAINT_VIEW], 0, view, redraw_clip);
|
||||
else
|
||||
CLUTTER_STAGE_GET_CLASS (stage)->paint_view (stage, view);
|
||||
|
||||
priv->view_clip = (cairo_rectangle_int_t) { 0 };
|
||||
CLUTTER_STAGE_GET_CLASS (stage)->paint_view (stage, view, redraw_clip);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1239,11 +1263,9 @@ _clutter_stage_process_queued_events (ClutterStage *stage)
|
||||
|
||||
if (next_event->type == CLUTTER_MOTION)
|
||||
{
|
||||
ClutterDeviceManager *device_manager =
|
||||
clutter_device_manager_get_default ();
|
||||
ClutterSeat *seat = clutter_input_device_get_seat (device);
|
||||
|
||||
_clutter_device_manager_compress_motion (device_manager,
|
||||
next_event, event);
|
||||
clutter_seat_compress_motion (seat, next_event, event);
|
||||
}
|
||||
|
||||
goto next_event;
|
||||
@@ -1289,7 +1311,20 @@ _clutter_stage_needs_update (ClutterStage *stage)
|
||||
|
||||
priv = stage->priv;
|
||||
|
||||
return priv->relayout_pending || priv->redraw_pending;
|
||||
return priv->redraw_pending || g_hash_table_size (priv->pending_relayouts) > 0;
|
||||
}
|
||||
|
||||
void
|
||||
clutter_stage_queue_actor_relayout (ClutterStage *stage,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
ClutterStagePrivate *priv = stage->priv;
|
||||
|
||||
if (g_hash_table_size (priv->pending_relayouts) == 0)
|
||||
_clutter_stage_schedule_update (stage);
|
||||
|
||||
g_hash_table_add (priv->pending_relayouts, g_object_ref (actor));
|
||||
priv->pending_relayouts_version++;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1297,41 +1332,58 @@ _clutter_stage_maybe_relayout (ClutterActor *actor)
|
||||
{
|
||||
ClutterStage *stage = CLUTTER_STAGE (actor);
|
||||
ClutterStagePrivate *priv = stage->priv;
|
||||
gfloat natural_width, natural_height;
|
||||
ClutterActorBox box = { 0, };
|
||||
GHashTableIter iter;
|
||||
gpointer key;
|
||||
int count = 0;
|
||||
|
||||
if (!priv->relayout_pending)
|
||||
/* No work to do? Avoid the extraneous debug log messages too. */
|
||||
if (g_hash_table_size (priv->pending_relayouts) == 0)
|
||||
return;
|
||||
|
||||
/* avoid reentrancy */
|
||||
if (!CLUTTER_ACTOR_IN_RELAYOUT (stage))
|
||||
CLUTTER_NOTE (ACTOR, ">>> Recomputing layout");
|
||||
|
||||
g_hash_table_iter_init (&iter, priv->pending_relayouts);
|
||||
while (g_hash_table_iter_next (&iter, &key, NULL))
|
||||
{
|
||||
priv->relayout_pending = FALSE;
|
||||
priv->stage_was_relayout = TRUE;
|
||||
g_autoptr (ClutterActor) queued_actor = key;
|
||||
unsigned int old_version;
|
||||
|
||||
CLUTTER_NOTE (ACTOR, "Recomputing layout");
|
||||
g_hash_table_iter_steal (&iter);
|
||||
priv->pending_relayouts_version++;
|
||||
|
||||
CLUTTER_SET_PRIVATE_FLAGS (stage, CLUTTER_IN_RELAYOUT);
|
||||
if (CLUTTER_ACTOR_IN_RELAYOUT (queued_actor)) /* avoid reentrancy */
|
||||
continue;
|
||||
|
||||
natural_width = natural_height = 0;
|
||||
clutter_actor_get_preferred_size (CLUTTER_ACTOR (stage),
|
||||
NULL, NULL,
|
||||
&natural_width, &natural_height);
|
||||
/* An actor may have been destroyed or hidden between queuing and now */
|
||||
if (clutter_actor_get_stage (queued_actor) != actor)
|
||||
continue;
|
||||
|
||||
box.x1 = 0;
|
||||
box.y1 = 0;
|
||||
box.x2 = natural_width;
|
||||
box.y2 = natural_height;
|
||||
if (queued_actor == actor)
|
||||
CLUTTER_NOTE (ACTOR, " Deep relayout of stage %s",
|
||||
_clutter_actor_get_debug_name (queued_actor));
|
||||
else
|
||||
CLUTTER_NOTE (ACTOR, " Shallow relayout of actor %s",
|
||||
_clutter_actor_get_debug_name (queued_actor));
|
||||
|
||||
CLUTTER_NOTE (ACTOR, "Allocating (0, 0 - %d, %d) for the stage",
|
||||
(int) natural_width,
|
||||
(int) natural_height);
|
||||
CLUTTER_SET_PRIVATE_FLAGS (queued_actor, CLUTTER_IN_RELAYOUT);
|
||||
|
||||
clutter_actor_allocate (CLUTTER_ACTOR (stage),
|
||||
&box, CLUTTER_ALLOCATION_NONE);
|
||||
old_version = priv->pending_relayouts_version;
|
||||
clutter_actor_allocate_preferred_size (queued_actor,
|
||||
CLUTTER_ALLOCATION_NONE);
|
||||
|
||||
CLUTTER_UNSET_PRIVATE_FLAGS (stage, CLUTTER_IN_RELAYOUT);
|
||||
CLUTTER_UNSET_PRIVATE_FLAGS (queued_actor, CLUTTER_IN_RELAYOUT);
|
||||
|
||||
count++;
|
||||
|
||||
/* Prevent using an iterator that's been invalidated */
|
||||
if (old_version != priv->pending_relayouts_version)
|
||||
g_hash_table_iter_init (&iter, priv->pending_relayouts);
|
||||
}
|
||||
|
||||
CLUTTER_NOTE (ACTOR, "<<< Completed recomputing layout of %d subtrees", count);
|
||||
|
||||
if (count)
|
||||
priv->stage_was_relayout = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1381,21 +1433,21 @@ clutter_stage_do_redraw (ClutterStage *stage)
|
||||
static GSList *
|
||||
_clutter_stage_check_updated_pointers (ClutterStage *stage)
|
||||
{
|
||||
ClutterStagePrivate *priv = stage->priv;
|
||||
ClutterDeviceManager *device_manager;
|
||||
ClutterBackend *backend;
|
||||
ClutterSeat *seat;
|
||||
GSList *updating = NULL;
|
||||
const GSList *devices;
|
||||
cairo_region_t *clip;
|
||||
GList *l, *devices;
|
||||
graphene_point_t point;
|
||||
|
||||
clip = _clutter_stage_window_get_redraw_clip (priv->impl);
|
||||
backend = clutter_get_default_backend ();
|
||||
seat = clutter_backend_get_default_seat (backend);
|
||||
devices = clutter_seat_list_devices (seat);
|
||||
|
||||
device_manager = clutter_device_manager_get_default ();
|
||||
devices = clutter_device_manager_peek_devices (device_manager);
|
||||
|
||||
for (; devices != NULL; devices = devices->next)
|
||||
for (l = devices; l; l = l->next)
|
||||
{
|
||||
ClutterInputDevice *dev = devices->data;
|
||||
ClutterInputDevice *dev = l->data;
|
||||
ClutterStageView *view;
|
||||
const cairo_region_t *clip;
|
||||
|
||||
if (clutter_input_device_get_device_mode (dev) !=
|
||||
CLUTTER_INPUT_MODE_MASTER)
|
||||
@@ -1411,6 +1463,11 @@ _clutter_stage_check_updated_pointers (ClutterStage *stage)
|
||||
if (!clutter_input_device_get_coords (dev, NULL, &point))
|
||||
continue;
|
||||
|
||||
view = clutter_stage_get_view_at (stage, point.x, point.y);
|
||||
if (!view)
|
||||
continue;
|
||||
|
||||
clip = clutter_stage_view_peek_redraw_clip (view);
|
||||
if (!clip || cairo_region_contains_point (clip, point.x, point.y))
|
||||
updating = g_slist_prepend (updating, dev);
|
||||
break;
|
||||
@@ -1424,6 +1481,8 @@ _clutter_stage_check_updated_pointers (ClutterStage *stage)
|
||||
}
|
||||
}
|
||||
|
||||
g_list_free (devices);
|
||||
|
||||
return updating;
|
||||
}
|
||||
|
||||
@@ -1496,7 +1555,7 @@ _clutter_stage_do_update (ClutterStage *stage)
|
||||
|
||||
while (pointers)
|
||||
{
|
||||
_clutter_input_device_update (pointers->data, NULL, TRUE);
|
||||
clutter_input_device_update (pointers->data, NULL, TRUE);
|
||||
pointers = g_slist_delete_link (pointers, pointers);
|
||||
}
|
||||
|
||||
@@ -1509,20 +1568,31 @@ static void
|
||||
clutter_stage_real_queue_relayout (ClutterActor *self)
|
||||
{
|
||||
ClutterStage *stage = CLUTTER_STAGE (self);
|
||||
ClutterStagePrivate *priv = stage->priv;
|
||||
ClutterActorClass *parent_class;
|
||||
|
||||
if (!priv->relayout_pending)
|
||||
{
|
||||
_clutter_stage_schedule_update (stage);
|
||||
priv->relayout_pending = TRUE;
|
||||
}
|
||||
clutter_stage_queue_actor_relayout (stage, self);
|
||||
|
||||
/* chain up */
|
||||
parent_class = CLUTTER_ACTOR_CLASS (clutter_stage_parent_class);
|
||||
parent_class->queue_relayout (self);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_full_stage_redraw_queued (ClutterStage *stage)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = _clutter_stage_peek_stage_views (stage); l; l = l->next)
|
||||
{
|
||||
ClutterStageView *view = l->data;
|
||||
|
||||
if (!clutter_stage_view_has_full_redraw_clip (view))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_stage_real_queue_redraw (ClutterActor *actor,
|
||||
ClutterActor *leaf,
|
||||
@@ -1544,12 +1614,12 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
|
||||
if (stage_window == NULL)
|
||||
return TRUE;
|
||||
|
||||
if (_clutter_stage_window_ignoring_redraw_clips (stage_window))
|
||||
if (is_full_stage_redraw_queued (stage))
|
||||
return FALSE;
|
||||
|
||||
if (redraw_clip == NULL)
|
||||
{
|
||||
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
|
||||
clutter_stage_add_redraw_clip (stage, NULL);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1581,43 +1651,20 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
|
||||
stage_clip.width = intersection_box.x2 - stage_clip.x;
|
||||
stage_clip.height = intersection_box.y2 - stage_clip.y;
|
||||
|
||||
_clutter_stage_window_add_redraw_clip (stage_window, &stage_clip);
|
||||
clutter_stage_add_redraw_clip (stage, &stage_clip);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_stage_has_full_redraw_queued (ClutterStage *stage)
|
||||
{
|
||||
ClutterStageWindow *stage_window = _clutter_stage_get_window (stage);
|
||||
|
||||
if (CLUTTER_ACTOR_IN_DESTRUCTION (stage) || stage_window == NULL)
|
||||
if (CLUTTER_ACTOR_IN_DESTRUCTION (stage))
|
||||
return FALSE;
|
||||
|
||||
if (stage->priv->redraw_pending &&
|
||||
!_clutter_stage_window_has_redraw_clips (stage_window))
|
||||
return TRUE;
|
||||
else
|
||||
if (!stage->priv->redraw_pending)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
cairo_region_t *
|
||||
clutter_stage_get_redraw_clip (ClutterStage *stage)
|
||||
{
|
||||
ClutterStagePrivate *priv;
|
||||
cairo_rectangle_int_t clip;
|
||||
cairo_region_t *region;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
|
||||
|
||||
priv = stage->priv;
|
||||
|
||||
region = _clutter_stage_window_get_redraw_clip (priv->impl);
|
||||
if (region)
|
||||
return region;
|
||||
|
||||
/* Set clip to the full extents of the stage */
|
||||
_clutter_stage_window_get_geometry (priv->impl, &clip);
|
||||
return cairo_region_create_rectangle (&clip);
|
||||
return is_full_stage_redraw_queued (stage);
|
||||
}
|
||||
|
||||
static ClutterActor *
|
||||
@@ -1910,6 +1957,8 @@ clutter_stage_dispose (GObject *object)
|
||||
(GDestroyNotify) free_queue_redraw_entry);
|
||||
priv->pending_queue_redraws = NULL;
|
||||
|
||||
g_clear_pointer (&priv->pending_relayouts, g_hash_table_destroy);
|
||||
|
||||
/* this will release the reference on the stage */
|
||||
stage_manager = clutter_stage_manager_get_default ();
|
||||
_clutter_stage_manager_remove_stage (stage_manager, stage);
|
||||
@@ -1944,13 +1993,11 @@ clutter_stage_finalize (GObject *object)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_stage_real_paint_view (ClutterStage *stage,
|
||||
ClutterStageView *view)
|
||||
clutter_stage_real_paint_view (ClutterStage *stage,
|
||||
ClutterStageView *view,
|
||||
const cairo_region_t *redraw_clip)
|
||||
{
|
||||
ClutterStagePrivate *priv = stage->priv;
|
||||
const cairo_rectangle_int_t *clip = &priv->view_clip;
|
||||
|
||||
clutter_stage_do_paint_view (stage, view, clip);
|
||||
clutter_stage_do_paint_view (stage, view, redraw_clip);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2176,6 +2223,7 @@ clutter_stage_class_init (ClutterStageClass *klass)
|
||||
* ClutterStage::paint-view:
|
||||
* @stage: the stage that received the event
|
||||
* @view: a #ClutterStageView
|
||||
* @redraw_clip: a #cairo_region_t with the redraw clip
|
||||
*
|
||||
* The ::paint-view signal is emitted before a #ClutterStageView is being
|
||||
* painted.
|
||||
@@ -2190,8 +2238,9 @@ clutter_stage_class_init (ClutterStageClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterStageClass, paint_view),
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_STAGE_VIEW);
|
||||
G_TYPE_NONE, 2,
|
||||
CLUTTER_TYPE_STAGE_VIEW,
|
||||
G_TYPE_POINTER);
|
||||
|
||||
/**
|
||||
* ClutterStage::presented: (skip)
|
||||
@@ -2269,7 +2318,11 @@ clutter_stage_init (ClutterStage *self)
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (self),
|
||||
&default_stage_color);
|
||||
|
||||
priv->relayout_pending = TRUE;
|
||||
priv->pending_relayouts = g_hash_table_new_full (NULL,
|
||||
NULL,
|
||||
g_object_unref,
|
||||
NULL);
|
||||
clutter_stage_queue_actor_relayout (self, CLUTTER_ACTOR (self));
|
||||
|
||||
clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE);
|
||||
clutter_stage_set_title (self, g_get_prgname ());
|
||||
@@ -2763,13 +2816,17 @@ clutter_stage_read_pixels (ClutterStage *stage,
|
||||
.height = height,
|
||||
});
|
||||
cairo_region_get_extents (clip, &clip_rect);
|
||||
cairo_region_destroy (clip);
|
||||
|
||||
if (clip_rect.width == 0 || clip_rect.height == 0)
|
||||
return NULL;
|
||||
{
|
||||
cairo_region_destroy (clip);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
framebuffer = clutter_stage_view_get_framebuffer (view);
|
||||
clutter_stage_do_paint_view (stage, view, &clip_rect);
|
||||
clutter_stage_do_paint_view (stage, view, clip);
|
||||
|
||||
cairo_region_destroy (clip);
|
||||
|
||||
view_scale = clutter_stage_view_get_scale (view);
|
||||
pixel_width = roundf (clip_rect.width * view_scale);
|
||||
@@ -3344,10 +3401,9 @@ clutter_stage_ensure_redraw (ClutterStage *stage)
|
||||
|
||||
priv = stage->priv;
|
||||
|
||||
if (!priv->relayout_pending && !priv->redraw_pending)
|
||||
if (!_clutter_stage_needs_update (stage))
|
||||
_clutter_stage_schedule_update (stage);
|
||||
|
||||
priv->relayout_pending = TRUE;
|
||||
priv->redraw_pending = TRUE;
|
||||
|
||||
master_clock = _clutter_master_clock_get_default ();
|
||||
@@ -3689,6 +3745,21 @@ _clutter_stage_clear_update_time (ClutterStage *stage)
|
||||
_clutter_stage_window_clear_update_time (stage_window);
|
||||
}
|
||||
|
||||
int64_t
|
||||
_clutter_stage_get_next_presentation_time (ClutterStage *stage)
|
||||
{
|
||||
ClutterStageWindow *stage_window;
|
||||
|
||||
if (CLUTTER_ACTOR_IN_DESTRUCTION (stage))
|
||||
return 0;
|
||||
|
||||
stage_window = _clutter_stage_get_window (stage);
|
||||
if (stage_window == NULL)
|
||||
return 0;
|
||||
|
||||
return _clutter_stage_window_get_next_presentation_time (stage_window);
|
||||
}
|
||||
|
||||
ClutterPaintVolume *
|
||||
_clutter_stage_paint_volume_stack_allocate (ClutterStage *stage)
|
||||
{
|
||||
@@ -4277,7 +4348,6 @@ capture_view (ClutterStage *stage,
|
||||
texture_width, texture_height);
|
||||
cairo_surface_set_device_scale (image, view_scale, view_scale);
|
||||
|
||||
|
||||
data = cairo_image_surface_get_data (image);
|
||||
stride = cairo_image_surface_get_stride (image);
|
||||
|
||||
@@ -4287,6 +4357,20 @@ capture_view (ClutterStage *stage,
|
||||
cairo_surface_mark_dirty (capture->image);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_stage_capture:
|
||||
* @stage: a #ClutterStage
|
||||
* @paint: whether to pain the frame
|
||||
* @rect: a #cairo_rectangle_int_t in stage coordinates
|
||||
* @out_captures: (out) (array length=out_n_captures): an array of
|
||||
* #ClutterCapture
|
||||
* @out_n_captures: (out): the number of captures in @out_captures
|
||||
*
|
||||
* Captures the stage pixels of @rect into @captures. @rect is in stage
|
||||
* coordinates.
|
||||
*
|
||||
* Returns: %TRUE if a #ClutterCapture has been created, %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
clutter_stage_capture (ClutterStage *stage,
|
||||
gboolean paint,
|
||||
@@ -4411,8 +4495,12 @@ capture_view_into (ClutterStage *stage,
|
||||
|
||||
if (paint)
|
||||
{
|
||||
cairo_region_t *region;
|
||||
|
||||
_clutter_stage_maybe_setup_viewport (stage, view);
|
||||
clutter_stage_do_paint_view (stage, view, rect);
|
||||
region = cairo_region_create_rectangle (rect);
|
||||
clutter_stage_do_paint_view (stage, view, region);
|
||||
cairo_region_destroy (region);
|
||||
}
|
||||
|
||||
view_scale = clutter_stage_view_get_scale (view);
|
||||
@@ -4438,49 +4526,42 @@ capture_view_into (ClutterStage *stage,
|
||||
cogl_object_unref (bitmap);
|
||||
}
|
||||
|
||||
static ClutterStageView *
|
||||
get_view_at_rect (ClutterStage *stage,
|
||||
cairo_rectangle_int_t *rect)
|
||||
{
|
||||
ClutterStagePrivate *priv = stage->priv;
|
||||
GList *views = _clutter_stage_window_get_views (priv->impl);
|
||||
GList *l;
|
||||
|
||||
for (l = views; l; l = l->next)
|
||||
{
|
||||
ClutterStageView *view = l->data;
|
||||
cairo_rectangle_int_t view_layout;
|
||||
cairo_region_t *region;
|
||||
cairo_rectangle_int_t view_capture_rect;
|
||||
|
||||
clutter_stage_view_get_layout (view, &view_layout);
|
||||
region = cairo_region_create_rectangle (&view_layout);
|
||||
cairo_region_intersect_rectangle (region, rect);
|
||||
cairo_region_get_extents (region, &view_capture_rect);
|
||||
cairo_region_destroy (region);
|
||||
|
||||
if (view_capture_rect.width == 0 || view_capture_rect.height == 0)
|
||||
continue;
|
||||
|
||||
g_assert (view_capture_rect.width == rect->width &&
|
||||
view_capture_rect.height == rect->height);
|
||||
return view;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
clutter_stage_capture_into (ClutterStage *stage,
|
||||
gboolean paint,
|
||||
cairo_rectangle_int_t *rect,
|
||||
uint8_t *data)
|
||||
{
|
||||
ClutterStageView *view;
|
||||
ClutterStagePrivate *priv = stage->priv;
|
||||
GList *l;
|
||||
int bpp = 4;
|
||||
int stride;
|
||||
|
||||
view = get_view_at_rect (stage, rect);
|
||||
capture_view_into (stage, paint, view, rect, data, rect->width * bpp);
|
||||
stride = rect->width * 4;
|
||||
|
||||
for (l = _clutter_stage_window_get_views (priv->impl); l; l = l->next)
|
||||
{
|
||||
ClutterStageView *view = l->data;
|
||||
cairo_rectangle_int_t view_layout;
|
||||
cairo_region_t *region;
|
||||
cairo_rectangle_int_t capture_rect;
|
||||
int x_offset, y_offset;
|
||||
|
||||
clutter_stage_view_get_layout (view, &view_layout);
|
||||
region = cairo_region_create_rectangle (&view_layout);
|
||||
cairo_region_intersect_rectangle (region, rect);
|
||||
|
||||
cairo_region_get_extents (region, &capture_rect);
|
||||
cairo_region_destroy (region);
|
||||
|
||||
x_offset = capture_rect.x - rect->x;
|
||||
y_offset = capture_rect.y - rect->y;
|
||||
|
||||
capture_view_into (stage, paint, view,
|
||||
&capture_rect,
|
||||
data + (x_offset * bpp) + (y_offset * stride),
|
||||
stride);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -84,8 +84,9 @@ struct _ClutterStageClass
|
||||
gboolean (* delete_event) (ClutterStage *stage,
|
||||
ClutterEvent *event);
|
||||
|
||||
void (* paint_view) (ClutterStage *stage,
|
||||
ClutterStageView *view);
|
||||
void (* paint_view) (ClutterStage *stage,
|
||||
ClutterStageView *view,
|
||||
const cairo_region_t *redraw_clip);
|
||||
|
||||
/*< private >*/
|
||||
/* padding for future expansion */
|
||||
@@ -205,8 +206,6 @@ guchar * clutter_stage_read_pixels (ClutterStage
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
cairo_region_t * clutter_stage_get_redraw_clip (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_ensure_viewport (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
@@ -234,8 +233,8 @@ CLUTTER_EXPORT
|
||||
gboolean clutter_stage_capture (ClutterStage *stage,
|
||||
gboolean paint,
|
||||
cairo_rectangle_int_t *rect,
|
||||
ClutterCapture **captures,
|
||||
int *n_captures);
|
||||
ClutterCapture **out_captures,
|
||||
int *out_n_captures);
|
||||
CLUTTER_EXPORT
|
||||
ClutterStageView * clutter_stage_get_view_at (ClutterStage *stage,
|
||||
float x,
|
||||
|
@@ -348,13 +348,23 @@ clutter_text_input_focus_request_surrounding (ClutterInputFocus *focus)
|
||||
|
||||
static void
|
||||
clutter_text_input_focus_delete_surrounding (ClutterInputFocus *focus,
|
||||
guint offset,
|
||||
int offset,
|
||||
guint len)
|
||||
{
|
||||
ClutterText *clutter_text = CLUTTER_TEXT_INPUT_FOCUS (focus)->text;
|
||||
int cursor;
|
||||
int start;
|
||||
|
||||
cursor = clutter_text_get_cursor_position (clutter_text);
|
||||
start = cursor + offset;
|
||||
if (start < 0)
|
||||
{
|
||||
g_warning ("The offset '%d' of deleting surrounding is larger than the cursor pos '%d'",
|
||||
offset, cursor);
|
||||
return;
|
||||
}
|
||||
if (clutter_text_get_editable (clutter_text))
|
||||
clutter_text_delete_text (clutter_text, offset, len);
|
||||
clutter_text_delete_text (clutter_text, start, len);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -759,7 +769,14 @@ clutter_text_create_layout_no_cache (ClutterText *text,
|
||||
ClutterTextDirection text_dir;
|
||||
|
||||
if (clutter_actor_has_key_focus (CLUTTER_ACTOR (text)))
|
||||
pango_dir = _clutter_backend_get_keymap_direction (backend);
|
||||
{
|
||||
ClutterSeat *seat;
|
||||
ClutterKeymap *keymap;
|
||||
|
||||
seat = clutter_backend_get_default_seat (backend);
|
||||
keymap = clutter_seat_get_keymap (seat);
|
||||
pango_dir = clutter_keymap_get_direction (keymap);
|
||||
}
|
||||
else
|
||||
{
|
||||
text_dir = clutter_actor_get_text_direction (CLUTTER_ACTOR (text));
|
||||
|
@@ -214,6 +214,16 @@ _clutter_util_rectangle_intersection (const cairo_rectangle_int_t *src1,
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
clutter_util_rectangle_equal (const cairo_rectangle_int_t *src1,
|
||||
const cairo_rectangle_int_t *src2)
|
||||
{
|
||||
return ((src1->x == src2->x) &&
|
||||
(src1->y == src2->y) &&
|
||||
(src1->width == src2->width) &&
|
||||
(src1->height == src2->height));
|
||||
}
|
||||
|
||||
float
|
||||
_clutter_util_matrix_determinant (const ClutterMatrix *matrix)
|
||||
{
|
||||
|
@@ -27,15 +27,15 @@
|
||||
|
||||
#include "clutter-virtual-input-device.h"
|
||||
|
||||
#include "clutter-device-manager.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-enum-types.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-seat.h"
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
|
||||
PROP_DEVICE_MANAGER,
|
||||
PROP_SEAT,
|
||||
PROP_DEVICE_TYPE,
|
||||
|
||||
PROP_LAST
|
||||
@@ -45,7 +45,7 @@ static GParamSpec *obj_props[PROP_LAST];
|
||||
|
||||
typedef struct _ClutterVirtualInputDevicePrivate
|
||||
{
|
||||
ClutterDeviceManager *manager;
|
||||
ClutterSeat *seat;
|
||||
ClutterInputDeviceType device_type;
|
||||
} ClutterVirtualInputDevicePrivate;
|
||||
|
||||
@@ -181,23 +181,6 @@ clutter_virtual_input_device_notify_touch_up (ClutterVirtualInputDevice *virtual
|
||||
slot);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_virtual_input_device_get_manager:
|
||||
* @virtual_device: a virtual device
|
||||
*
|
||||
* Gets the device manager of this virtual device.
|
||||
*
|
||||
* Returns: (transfer none): The #ClutterDeviceManager of this virtual device
|
||||
**/
|
||||
ClutterDeviceManager *
|
||||
clutter_virtual_input_device_get_manager (ClutterVirtualInputDevice *virtual_device)
|
||||
{
|
||||
ClutterVirtualInputDevicePrivate *priv =
|
||||
clutter_virtual_input_device_get_instance_private (virtual_device);
|
||||
|
||||
return priv->manager;
|
||||
}
|
||||
|
||||
int
|
||||
clutter_virtual_input_device_get_device_type (ClutterVirtualInputDevice *virtual_device)
|
||||
{
|
||||
@@ -220,8 +203,8 @@ clutter_virtual_input_device_get_property (GObject *object,
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_DEVICE_MANAGER:
|
||||
g_value_set_object (value, priv->manager);
|
||||
case PROP_SEAT:
|
||||
g_value_set_object (value, priv->seat);
|
||||
break;
|
||||
case PROP_DEVICE_TYPE:
|
||||
g_value_set_enum (value, priv->device_type);
|
||||
@@ -245,8 +228,8 @@ clutter_virtual_input_device_set_property (GObject *object,
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_DEVICE_MANAGER:
|
||||
priv->manager = g_value_get_object (value);
|
||||
case PROP_SEAT:
|
||||
priv->seat = g_value_get_object (value);
|
||||
break;
|
||||
case PROP_DEVICE_TYPE:
|
||||
priv->device_type = g_value_get_enum (value);
|
||||
@@ -270,11 +253,11 @@ clutter_virtual_input_device_class_init (ClutterVirtualInputDeviceClass *klass)
|
||||
object_class->get_property = clutter_virtual_input_device_get_property;
|
||||
object_class->set_property = clutter_virtual_input_device_set_property;
|
||||
|
||||
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);
|
||||
obj_props[PROP_DEVICE_TYPE] =
|
||||
g_param_spec_enum ("device-type",
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#include <glib-object.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "clutter-device-manager.h"
|
||||
#include "clutter-seat.h"
|
||||
|
||||
#define CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE (clutter_virtual_input_device_get_type ())
|
||||
|
||||
@@ -169,9 +169,6 @@ void clutter_virtual_input_device_notify_touch_up (ClutterVirtualInputDevice *vi
|
||||
uint64_t time_us,
|
||||
int slot);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterDeviceManager * clutter_virtual_input_device_get_manager (ClutterVirtualInputDevice *virtual_device);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
int clutter_virtual_input_device_get_device_type (ClutterVirtualInputDevice *virtual_device);
|
||||
|
||||
|
@@ -56,7 +56,6 @@
|
||||
#include "clutter-content.h"
|
||||
#include "clutter-deform-effect.h"
|
||||
#include "clutter-desaturate-effect.h"
|
||||
#include "clutter-device-manager.h"
|
||||
#include "clutter-drag-action.h"
|
||||
#include "clutter-drop-action.h"
|
||||
#include "clutter-effect.h"
|
||||
|
@@ -47,7 +47,7 @@
|
||||
#include "clutter-stage-private.h"
|
||||
#include "clutter-stage-view-private.h"
|
||||
|
||||
#include "cogl/cogl-trace.h"
|
||||
#define MAX_STACK_RECTS 256
|
||||
|
||||
typedef struct _ClutterStageViewCoglPrivate
|
||||
{
|
||||
@@ -235,7 +235,12 @@ clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window,
|
||||
stage_cogl->update_time = next_presentation_time - max_render_time_allowed;
|
||||
|
||||
if (stage_cogl->update_time == stage_cogl->last_update_time)
|
||||
stage_cogl->update_time = stage_cogl->last_update_time + refresh_interval;
|
||||
{
|
||||
stage_cogl->update_time += refresh_interval;
|
||||
next_presentation_time += refresh_interval;
|
||||
}
|
||||
|
||||
stage_cogl->next_presentation_time = next_presentation_time;
|
||||
}
|
||||
|
||||
static gint64
|
||||
@@ -256,6 +261,29 @@ clutter_stage_cogl_clear_update_time (ClutterStageWindow *stage_window)
|
||||
|
||||
stage_cogl->last_update_time = stage_cogl->update_time;
|
||||
stage_cogl->update_time = -1;
|
||||
stage_cogl->next_presentation_time = -1;
|
||||
}
|
||||
|
||||
static int64_t
|
||||
clutter_stage_cogl_get_next_presentation_time (ClutterStageWindow *stage_window)
|
||||
{
|
||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
||||
int64_t now = g_get_monotonic_time ();
|
||||
|
||||
if (stage_cogl->next_presentation_time > 0 &&
|
||||
stage_cogl->next_presentation_time <= now)
|
||||
{
|
||||
CLUTTER_NOTE (BACKEND,
|
||||
"Missed some frames. Something blocked for over "
|
||||
"%" G_GINT64_FORMAT "ms.",
|
||||
(now - stage_cogl->next_presentation_time) / 1000);
|
||||
|
||||
stage_cogl->update_time = -1;
|
||||
clutter_stage_cogl_schedule_update (stage_window,
|
||||
stage_cogl->last_sync_delay);
|
||||
}
|
||||
|
||||
return stage_cogl->next_presentation_time;
|
||||
}
|
||||
|
||||
static ClutterActor *
|
||||
@@ -288,97 +316,6 @@ clutter_stage_cogl_resize (ClutterStageWindow *stage_window,
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_stage_cogl_has_redraw_clips (ClutterStageWindow *stage_window)
|
||||
{
|
||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
||||
|
||||
/* NB: at the start of each new frame there is an implied clip that
|
||||
* clips everything (i.e. nothing would be drawn) so we need to make
|
||||
* sure we return True in the un-initialized case here.
|
||||
*/
|
||||
if (!stage_cogl->initialized_redraw_clip ||
|
||||
(stage_cogl->initialized_redraw_clip &&
|
||||
stage_cogl->redraw_clip))
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_stage_cogl_ignoring_redraw_clips (ClutterStageWindow *stage_window)
|
||||
{
|
||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
||||
|
||||
/* NB: a NULL clip means a full stage redraw is required */
|
||||
if (stage_cogl->initialized_redraw_clip &&
|
||||
!stage_cogl->redraw_clip)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* A redraw clip represents (in stage coordinates) the bounding box of
|
||||
* something that needs to be redrawn. Typically they are added to the
|
||||
* StageWindow as a result of clutter_actor_queue_clipped_redraw() by
|
||||
* actors such as ClutterGLXTexturePixmap. All redraw clips are
|
||||
* discarded after the next paint.
|
||||
*
|
||||
* A NULL stage_clip means the whole stage needs to be redrawn.
|
||||
*
|
||||
* What we do with this information:
|
||||
* - we keep track of the bounding box for all redraw clips
|
||||
* - when we come to redraw; we scissor the redraw to that box and use
|
||||
* glBlitFramebuffer to present the redraw to the front
|
||||
* buffer.
|
||||
*/
|
||||
static void
|
||||
clutter_stage_cogl_add_redraw_clip (ClutterStageWindow *stage_window,
|
||||
cairo_rectangle_int_t *stage_clip)
|
||||
{
|
||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
||||
|
||||
/* If we are already forced to do a full stage redraw then bail early */
|
||||
if (clutter_stage_cogl_ignoring_redraw_clips (stage_window))
|
||||
return;
|
||||
|
||||
/* A NULL stage clip means a full stage redraw has been queued and
|
||||
* we keep track of this by setting a NULL redraw_clip.
|
||||
*/
|
||||
if (stage_clip == NULL)
|
||||
{
|
||||
g_clear_pointer (&stage_cogl->redraw_clip, cairo_region_destroy);
|
||||
stage_cogl->initialized_redraw_clip = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Ignore requests to add degenerate/empty clip rectangles */
|
||||
if (stage_clip->width == 0 || stage_clip->height == 0)
|
||||
return;
|
||||
|
||||
if (!stage_cogl->redraw_clip)
|
||||
{
|
||||
stage_cogl->redraw_clip = cairo_region_create_rectangle (stage_clip);
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_region_union_rectangle (stage_cogl->redraw_clip, stage_clip);
|
||||
}
|
||||
|
||||
stage_cogl->initialized_redraw_clip = TRUE;
|
||||
}
|
||||
|
||||
static cairo_region_t *
|
||||
clutter_stage_cogl_get_redraw_clip (ClutterStageWindow *stage_window)
|
||||
{
|
||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
||||
|
||||
if (stage_cogl->using_clipped_redraw && stage_cogl->redraw_clip)
|
||||
return cairo_region_copy (stage_cogl->redraw_clip);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
valid_buffer_age (ClutterStageViewCogl *view_cogl,
|
||||
int age)
|
||||
@@ -395,7 +332,8 @@ valid_buffer_age (ClutterStageViewCogl *view_cogl,
|
||||
static void
|
||||
paint_damage_region (ClutterStageWindow *stage_window,
|
||||
ClutterStageView *view,
|
||||
cairo_region_t *swap_region)
|
||||
cairo_region_t *swap_region,
|
||||
cairo_region_t *queued_redraw_clip)
|
||||
{
|
||||
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view);
|
||||
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
|
||||
@@ -432,8 +370,7 @@ paint_damage_region (ClutterStageWindow *stage_window,
|
||||
}
|
||||
|
||||
/* Red for the clip */
|
||||
if (stage_cogl->initialized_redraw_clip &&
|
||||
stage_cogl->redraw_clip)
|
||||
if (queued_redraw_clip)
|
||||
{
|
||||
static CoglPipeline *overlay_red = NULL;
|
||||
|
||||
@@ -443,13 +380,13 @@ paint_damage_region (ClutterStageWindow *stage_window,
|
||||
cogl_pipeline_set_color4ub (overlay_red, 0x33, 0x00, 0x00, 0x33);
|
||||
}
|
||||
|
||||
n_rects = cairo_region_num_rectangles (stage_cogl->redraw_clip);
|
||||
n_rects = cairo_region_num_rectangles (queued_redraw_clip);
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
cairo_rectangle_int_t rect;
|
||||
float x_1, x_2, y_1, y_2;
|
||||
|
||||
cairo_region_get_rectangle (stage_cogl->redraw_clip, i, &rect);
|
||||
cairo_region_get_rectangle (queued_redraw_clip, i, &rect);
|
||||
x_1 = rect.x;
|
||||
x_2 = rect.x + rect.width;
|
||||
y_1 = rect.y;
|
||||
@@ -466,13 +403,14 @@ static gboolean
|
||||
swap_framebuffer (ClutterStageWindow *stage_window,
|
||||
ClutterStageView *view,
|
||||
cairo_region_t *swap_region,
|
||||
gboolean swap_with_damage)
|
||||
gboolean swap_with_damage,
|
||||
cairo_region_t *queued_redraw_clip)
|
||||
{
|
||||
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view);
|
||||
int *damage, n_rects, i;
|
||||
|
||||
if (G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION)))
|
||||
paint_damage_region (stage_window, view, swap_region);
|
||||
paint_damage_region (stage_window, view, swap_region, queued_redraw_clip);
|
||||
|
||||
n_rects = cairo_region_num_rectangles (swap_region);
|
||||
damage = g_newa (int, n_rects * 4);
|
||||
@@ -536,34 +474,52 @@ scale_and_clamp_rect (const graphene_rect_t *rect,
|
||||
_clutter_util_rectangle_int_extents (&tmp, dest);
|
||||
}
|
||||
|
||||
static cairo_region_t *
|
||||
offset_scale_and_clamp_region (const cairo_region_t *region,
|
||||
int offset_x,
|
||||
int offset_y,
|
||||
float scale)
|
||||
{
|
||||
int n_rects, i;
|
||||
cairo_rectangle_int_t *rects;
|
||||
g_autofree cairo_rectangle_int_t *freeme = NULL;
|
||||
|
||||
n_rects = cairo_region_num_rectangles (region);
|
||||
|
||||
if (n_rects == 0)
|
||||
return cairo_region_create ();
|
||||
|
||||
if (n_rects < MAX_STACK_RECTS)
|
||||
rects = g_newa (cairo_rectangle_int_t, n_rects);
|
||||
else
|
||||
rects = freeme = g_new (cairo_rectangle_int_t, n_rects);
|
||||
|
||||
for (i = 0; i < n_rects; i++)
|
||||
cairo_region_get_rectangle (region, i, &rects[i]);
|
||||
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
graphene_rect_t tmp;
|
||||
|
||||
_clutter_util_rect_from_rectangle (&rects[i], &tmp);
|
||||
graphene_rect_offset (&tmp, offset_x, offset_y);
|
||||
scale_and_clamp_rect (&tmp, scale, &rects[i]);
|
||||
}
|
||||
|
||||
return cairo_region_create_rectangles (rects, n_rects);
|
||||
}
|
||||
|
||||
static void
|
||||
paint_stage (ClutterStageCogl *stage_cogl,
|
||||
ClutterStageView *view,
|
||||
cairo_region_t *clip)
|
||||
paint_stage (ClutterStageCogl *stage_cogl,
|
||||
ClutterStageView *view,
|
||||
cairo_region_t *redraw_clip)
|
||||
{
|
||||
ClutterStage *stage = stage_cogl->wrapper;
|
||||
cairo_rectangle_int_t clip_rect;
|
||||
cairo_rectangle_int_t paint_rect;
|
||||
cairo_rectangle_int_t view_rect;
|
||||
graphene_rect_t rect;
|
||||
float fb_scale;
|
||||
|
||||
clutter_stage_view_get_layout (view, &view_rect);
|
||||
fb_scale = clutter_stage_view_get_scale (view);
|
||||
|
||||
cairo_region_get_extents (clip, &clip_rect);
|
||||
|
||||
_clutter_util_rect_from_rectangle (&clip_rect, &rect);
|
||||
scale_and_clamp_rect (&rect, 1.0f / fb_scale, &paint_rect);
|
||||
_clutter_util_rectangle_offset (&paint_rect,
|
||||
view_rect.x,
|
||||
view_rect.y,
|
||||
&paint_rect);
|
||||
|
||||
_clutter_stage_maybe_setup_viewport (stage, view);
|
||||
_clutter_stage_paint_view (stage, view, &paint_rect);
|
||||
clutter_stage_paint_view (stage, view, redraw_clip);
|
||||
|
||||
clutter_stage_view_after_paint (view, &paint_rect);
|
||||
clutter_stage_view_after_paint (view);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -683,7 +639,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
clutter_stage_view_cogl_get_instance_private (view_cogl);
|
||||
CoglFramebuffer *fb = clutter_stage_view_get_framebuffer (view);
|
||||
cairo_rectangle_int_t view_rect;
|
||||
gboolean have_clip;
|
||||
gboolean is_full_redraw;
|
||||
gboolean may_use_clipped_redraw;
|
||||
gboolean use_clipped_redraw;
|
||||
gboolean can_blit_sub_buffer;
|
||||
@@ -692,6 +648,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
gboolean swap_with_damage;
|
||||
ClutterActor *wrapper;
|
||||
cairo_region_t *redraw_clip;
|
||||
cairo_region_t *queued_redraw_clip;
|
||||
cairo_region_t *fb_clip_region;
|
||||
cairo_region_t *swap_region;
|
||||
cairo_rectangle_int_t redraw_rect;
|
||||
@@ -699,6 +656,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
float fb_scale;
|
||||
int subpixel_compensation = 0;
|
||||
int fb_width, fb_height;
|
||||
int buffer_age;
|
||||
|
||||
wrapper = CLUTTER_ACTOR (stage_cogl->wrapper);
|
||||
|
||||
@@ -713,55 +671,44 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
|
||||
has_buffer_age = cogl_is_onscreen (fb) && is_buffer_age_enabled ();
|
||||
|
||||
redraw_clip = clutter_stage_view_take_redraw_clip (view);
|
||||
|
||||
/* NB: a NULL redraw clip == full stage redraw */
|
||||
if (!stage_cogl->redraw_clip)
|
||||
have_clip = FALSE;
|
||||
if (!redraw_clip)
|
||||
is_full_redraw = TRUE;
|
||||
else
|
||||
is_full_redraw = FALSE;
|
||||
|
||||
may_use_clipped_redraw =
|
||||
_clutter_stage_window_can_clip_redraws (stage_window) &&
|
||||
(can_blit_sub_buffer || has_buffer_age) &&
|
||||
!is_full_redraw &&
|
||||
/* some drivers struggle to get going and produce some junk
|
||||
* frames when starting up... */
|
||||
cogl_onscreen_get_frame_counter (COGL_ONSCREEN (fb)) > 3;
|
||||
|
||||
if (has_buffer_age)
|
||||
{
|
||||
cairo_region_t *view_region;
|
||||
redraw_clip = cairo_region_copy (stage_cogl->redraw_clip);
|
||||
|
||||
view_region = cairo_region_create_rectangle (&view_rect);
|
||||
cairo_region_intersect (redraw_clip, view_region);
|
||||
|
||||
have_clip = !cairo_region_equal (redraw_clip, view_region);
|
||||
cairo_region_destroy (view_region);
|
||||
buffer_age = cogl_onscreen_get_buffer_age (COGL_ONSCREEN (fb));
|
||||
if (!valid_buffer_age (view_cogl, buffer_age))
|
||||
{
|
||||
CLUTTER_NOTE (CLIPPING, "Invalid back buffer(age=%d): forcing full redraw\n", buffer_age);
|
||||
may_use_clipped_redraw = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
may_use_clipped_redraw = FALSE;
|
||||
if (_clutter_stage_window_can_clip_redraws (stage_window) &&
|
||||
(can_blit_sub_buffer || has_buffer_age) &&
|
||||
have_clip &&
|
||||
/* some drivers struggle to get going and produce some junk
|
||||
* frames when starting up... */
|
||||
cogl_onscreen_get_frame_counter (COGL_ONSCREEN (fb)) > 3)
|
||||
if (may_use_clipped_redraw)
|
||||
{
|
||||
graphene_rect_t rect;
|
||||
cairo_rectangle_int_t *rects;
|
||||
int n_rects, i;
|
||||
|
||||
may_use_clipped_redraw = TRUE;
|
||||
|
||||
fb_clip_region = cairo_region_create ();
|
||||
|
||||
n_rects = cairo_region_num_rectangles (redraw_clip);
|
||||
rects = g_new (cairo_rectangle_int_t, n_rects);
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
cairo_rectangle_int_t new_fb_clip_rect;
|
||||
|
||||
cairo_region_get_rectangle (redraw_clip, i, &rects[i]);
|
||||
|
||||
_clutter_util_rect_from_rectangle (&rects[i], &rect);
|
||||
graphene_rect_offset (&rect, -view_rect.x, -view_rect.y);
|
||||
scale_and_clamp_rect (&rect, fb_scale, &new_fb_clip_rect);
|
||||
|
||||
cairo_region_union_rectangle (fb_clip_region, &new_fb_clip_rect);
|
||||
}
|
||||
g_free (rects);
|
||||
fb_clip_region = offset_scale_and_clamp_region (redraw_clip,
|
||||
-view_rect.x,
|
||||
-view_rect.y,
|
||||
fb_scale);
|
||||
|
||||
if (fb_scale != floorf (fb_scale))
|
||||
{
|
||||
int n_rects, i;
|
||||
cairo_rectangle_int_t *rects;
|
||||
|
||||
subpixel_compensation = ceilf (fb_scale);
|
||||
|
||||
n_rects = cairo_region_num_rectangles (fb_clip_region);
|
||||
@@ -780,11 +727,20 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_rectangle_int_t rect = { 0, 0, view_rect.width, view_rect.height };
|
||||
fb_clip_region = cairo_region_create_rectangle (&rect);
|
||||
redraw_clip = cairo_region_copy (fb_clip_region);
|
||||
cairo_rectangle_int_t fb_rect;
|
||||
|
||||
fb_rect = (cairo_rectangle_int_t) {
|
||||
.width = fb_width,
|
||||
.height = fb_height,
|
||||
};
|
||||
fb_clip_region = cairo_region_create_rectangle (&fb_rect);
|
||||
|
||||
g_clear_pointer (&redraw_clip, cairo_region_destroy);
|
||||
redraw_clip = cairo_region_create_rectangle (&view_rect);
|
||||
}
|
||||
|
||||
queued_redraw_clip = cairo_region_copy (redraw_clip);
|
||||
|
||||
if (may_use_clipped_redraw &&
|
||||
G_LIKELY (!(clutter_paint_debug_flags & CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS)))
|
||||
use_clipped_redraw = TRUE;
|
||||
@@ -798,62 +754,43 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
{
|
||||
if (use_clipped_redraw && !clip_region_empty)
|
||||
{
|
||||
int age;
|
||||
cairo_region_t *fb_damage;
|
||||
cairo_region_t *view_damage;
|
||||
int i;
|
||||
|
||||
age = cogl_onscreen_get_buffer_age (COGL_ONSCREEN (fb));
|
||||
fill_current_damage_history (view, fb_clip_region);
|
||||
|
||||
if (valid_buffer_age (view_cogl, age))
|
||||
fb_damage = cairo_region_create ();
|
||||
|
||||
for (i = 1; i <= buffer_age; i++)
|
||||
{
|
||||
graphene_rect_t rect;
|
||||
cairo_rectangle_int_t damage_region;
|
||||
cairo_rectangle_int_t *rects;
|
||||
int n_rects, i;
|
||||
int damage_index;
|
||||
|
||||
fill_current_damage_history (view, fb_clip_region);
|
||||
|
||||
for (i = 1; i <= age; i++)
|
||||
{
|
||||
cairo_region_t *fb_damage =
|
||||
view_priv->damage_history[DAMAGE_HISTORY (view_priv->damage_index - i - 1)];
|
||||
cairo_region_union (fb_clip_region, fb_damage);
|
||||
}
|
||||
|
||||
/* Update the redraw clip state with the extra damage. */
|
||||
n_rects = cairo_region_num_rectangles (fb_clip_region);
|
||||
rects = g_newa (cairo_rectangle_int_t, n_rects);
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
cairo_region_get_rectangle (fb_clip_region, i, &rects[i]);
|
||||
_clutter_util_rect_from_rectangle (&rects[i], &rect);
|
||||
scale_and_clamp_rect (&rect, 1.0f / fb_scale, &damage_region);
|
||||
_clutter_util_rectangle_offset (&damage_region,
|
||||
view_rect.x,
|
||||
view_rect.y,
|
||||
&damage_region);
|
||||
cairo_region_union_rectangle (stage_cogl->redraw_clip,
|
||||
&damage_region);
|
||||
}
|
||||
|
||||
CLUTTER_NOTE (CLIPPING, "Reusing back buffer(age=%d) - repairing region: num rects: %d\n",
|
||||
age,
|
||||
cairo_region_num_rectangles (fb_clip_region));
|
||||
|
||||
swap_with_damage = TRUE;
|
||||
damage_index = DAMAGE_HISTORY (view_priv->damage_index - i - 1);
|
||||
cairo_region_union (fb_damage,
|
||||
view_priv->damage_history[damage_index]);
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_rectangle_int_t fb_damage;
|
||||
|
||||
CLUTTER_NOTE (CLIPPING, "Invalid back buffer(age=%d): forcing full redraw\n", age);
|
||||
use_clipped_redraw = FALSE;
|
||||
fb_damage = (cairo_rectangle_int_t) {
|
||||
.x = 0,
|
||||
.y = 0,
|
||||
.width = ceilf (view_rect.width * fb_scale),
|
||||
.height = ceilf (view_rect.height * fb_scale)
|
||||
};
|
||||
fill_current_damage_history_rectangle (view, &fb_damage);
|
||||
}
|
||||
/* Update the fb clip region with the extra damage. */
|
||||
cairo_region_union (fb_clip_region, fb_damage);
|
||||
|
||||
view_damage = offset_scale_and_clamp_region (fb_damage,
|
||||
0, 0,
|
||||
1.0f / fb_scale);
|
||||
cairo_region_translate (view_damage, view_rect.x, view_rect.y);
|
||||
cairo_region_intersect_rectangle (view_damage, &view_rect);
|
||||
|
||||
/* Update the redraw clip region with the extra damage. */
|
||||
cairo_region_union (redraw_clip, view_damage);
|
||||
|
||||
cairo_region_destroy (view_damage);
|
||||
cairo_region_destroy (fb_damage);
|
||||
|
||||
CLUTTER_NOTE (CLIPPING, "Reusing back buffer(age=%d) - repairing region: num rects: %d\n",
|
||||
buffer_age,
|
||||
cairo_region_num_rectangles (fb_clip_region));
|
||||
|
||||
swap_with_damage = TRUE;
|
||||
}
|
||||
else if (!use_clipped_redraw)
|
||||
{
|
||||
@@ -878,8 +815,6 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
cairo_rectangle_int_t clip_rect;
|
||||
cairo_rectangle_int_t scissor_rect;
|
||||
|
||||
stage_cogl->using_clipped_redraw = TRUE;
|
||||
|
||||
if (cairo_region_num_rectangles (fb_clip_region) == 1)
|
||||
{
|
||||
cairo_region_get_extents (fb_clip_region, &clip_rect);
|
||||
@@ -907,11 +842,9 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
cogl_framebuffer_push_region_clip (fb, fb_clip_region);
|
||||
}
|
||||
|
||||
paint_stage (stage_cogl, view, fb_clip_region);
|
||||
paint_stage (stage_cogl, view, redraw_clip);
|
||||
|
||||
cogl_framebuffer_pop_clip (fb);
|
||||
|
||||
stage_cogl->using_clipped_redraw = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -939,24 +872,13 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
scissor_rect.width,
|
||||
scissor_rect.height);
|
||||
|
||||
paint_stage (stage_cogl, view, fb_clip_region);
|
||||
paint_stage (stage_cogl, view, redraw_clip);
|
||||
|
||||
cogl_framebuffer_pop_clip (fb);
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_rectangle_int_t clip;
|
||||
cairo_region_t *view_region;
|
||||
|
||||
clip = (cairo_rectangle_int_t) {
|
||||
.x = 0,
|
||||
.y = 0,
|
||||
.width = ceilf (view_rect.width * fb_scale),
|
||||
.height = ceilf (view_rect.height * fb_scale)
|
||||
};
|
||||
view_region = cairo_region_create_rectangle (&clip);
|
||||
paint_stage (stage_cogl, view, view_region);
|
||||
cairo_region_destroy (view_region);
|
||||
paint_stage (stage_cogl, view, redraw_clip);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1027,10 +949,9 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
do_swap_buffer = TRUE;
|
||||
}
|
||||
|
||||
if (redraw_clip)
|
||||
cairo_region_destroy (redraw_clip);
|
||||
if (fb_clip_region)
|
||||
cairo_region_destroy (fb_clip_region);
|
||||
g_clear_pointer (&redraw_clip, cairo_region_destroy);
|
||||
g_clear_pointer (&queued_redraw_clip, cairo_region_destroy);
|
||||
g_clear_pointer (&fb_clip_region, cairo_region_destroy);
|
||||
|
||||
if (do_swap_buffer)
|
||||
{
|
||||
@@ -1053,7 +974,8 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
res = swap_framebuffer (stage_window,
|
||||
view,
|
||||
swap_region,
|
||||
swap_with_damage);
|
||||
swap_with_damage,
|
||||
queued_redraw_clip);
|
||||
|
||||
cairo_region_destroy (swap_region);
|
||||
|
||||
@@ -1078,8 +1000,10 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
|
||||
{
|
||||
ClutterStageView *view = l->data;
|
||||
|
||||
swap_event =
|
||||
clutter_stage_cogl_redraw_view (stage_window, view) || swap_event;
|
||||
if (!clutter_stage_view_has_redraw_clip (view))
|
||||
continue;
|
||||
|
||||
swap_event |= clutter_stage_cogl_redraw_view (stage_window, view);
|
||||
}
|
||||
|
||||
_clutter_stage_emit_after_paint (stage_cogl->wrapper);
|
||||
@@ -1095,10 +1019,6 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
|
||||
stage_cogl->pending_swaps++;
|
||||
}
|
||||
|
||||
/* reset the redraw clipping for the next paint... */
|
||||
stage_cogl->initialized_redraw_clip = FALSE;
|
||||
g_clear_pointer (&stage_cogl->redraw_clip, cairo_region_destroy);
|
||||
|
||||
stage_cogl->frame_count++;
|
||||
|
||||
COGL_TRACE_END (ClutterStageCoglRedraw);
|
||||
@@ -1116,10 +1036,7 @@ clutter_stage_window_iface_init (ClutterStageWindowInterface *iface)
|
||||
iface->schedule_update = clutter_stage_cogl_schedule_update;
|
||||
iface->get_update_time = clutter_stage_cogl_get_update_time;
|
||||
iface->clear_update_time = clutter_stage_cogl_clear_update_time;
|
||||
iface->add_redraw_clip = clutter_stage_cogl_add_redraw_clip;
|
||||
iface->has_redraw_clips = clutter_stage_cogl_has_redraw_clips;
|
||||
iface->ignoring_redraw_clips = clutter_stage_cogl_ignoring_redraw_clips;
|
||||
iface->get_redraw_clip = clutter_stage_cogl_get_redraw_clip;
|
||||
iface->get_next_presentation_time = clutter_stage_cogl_get_next_presentation_time;
|
||||
iface->redraw = clutter_stage_cogl_redraw;
|
||||
}
|
||||
|
||||
@@ -1165,6 +1082,7 @@ _clutter_stage_cogl_init (ClutterStageCogl *stage)
|
||||
stage->refresh_rate = 0.0;
|
||||
|
||||
stage->update_time = -1;
|
||||
stage->next_presentation_time = -1;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -48,6 +48,7 @@ struct _ClutterStageCogl
|
||||
gint64 last_presentation_time;
|
||||
gint64 update_time;
|
||||
int64_t last_update_time;
|
||||
int64_t next_presentation_time;
|
||||
|
||||
/* We only enable clipped redraws after 2 frames, since we've seen
|
||||
* a lot of drivers can struggle to get going and may output some
|
||||
@@ -55,14 +56,6 @@ struct _ClutterStageCogl
|
||||
unsigned int frame_count;
|
||||
|
||||
gint last_sync_delay;
|
||||
|
||||
cairo_region_t *redraw_clip;
|
||||
|
||||
guint initialized_redraw_clip : 1;
|
||||
|
||||
/* TRUE if the current paint cycle has a clipped redraw. In that
|
||||
case bounding_redraw_clip specifies the the bounds. */
|
||||
guint using_clipped_redraw : 1;
|
||||
};
|
||||
|
||||
struct _ClutterStageCoglClass
|
||||
|
@@ -233,7 +233,7 @@ clutter_backend_egl_native_init (ClutterBackendEglNative *backend_egl_native)
|
||||
GSettingsSchemaSource *source = g_settings_schema_source_get_default ();
|
||||
GSettingsSchema *schema = g_settings_schema_source_lookup (source,
|
||||
xsettings_path,
|
||||
FALSE);
|
||||
TRUE);
|
||||
|
||||
if (!schema)
|
||||
{
|
||||
|
@@ -27,11 +27,11 @@
|
||||
#define __CLUTTER_BACKEND_EGL_NATIVE_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gio/gio.h>
|
||||
#include <cogl/cogl.h>
|
||||
#include <cogl/cogl-egl.h>
|
||||
#include <clutter/clutter-event.h>
|
||||
#include <clutter/clutter-backend.h>
|
||||
#include <clutter/clutter-device-manager.h>
|
||||
|
||||
#include "clutter-backend-private.h"
|
||||
|
||||
@@ -53,9 +53,6 @@ struct _ClutterBackendEglNative
|
||||
{
|
||||
ClutterBackend parent_instance;
|
||||
|
||||
/* device manager (ie evdev) */
|
||||
ClutterDeviceManager *device_manager;
|
||||
|
||||
/* event source */
|
||||
GSource *event_source;
|
||||
|
||||
|
@@ -30,7 +30,6 @@ clutter_headers = [
|
||||
'clutter-deform-effect.h',
|
||||
'clutter-deprecated.h',
|
||||
'clutter-desaturate-effect.h',
|
||||
'clutter-device-manager.h',
|
||||
'clutter-drag-action.h',
|
||||
'clutter-drop-action.h',
|
||||
'clutter-effect.h',
|
||||
@@ -70,6 +69,7 @@ clutter_headers = [
|
||||
'clutter-script.h',
|
||||
'clutter-scriptable.h',
|
||||
'clutter-scroll-actor.h',
|
||||
'clutter-seat.h',
|
||||
'clutter-settings.h',
|
||||
'clutter-shader-effect.h',
|
||||
'clutter-shader-types.h',
|
||||
@@ -118,7 +118,6 @@ clutter_sources = [
|
||||
'clutter-content.c',
|
||||
'clutter-deform-effect.c',
|
||||
'clutter-desaturate-effect.c',
|
||||
'clutter-device-manager.c',
|
||||
'clutter-drag-action.c',
|
||||
'clutter-drop-action.c',
|
||||
'clutter-effect.c',
|
||||
@@ -161,6 +160,7 @@ clutter_sources = [
|
||||
'clutter-script-parser.c',
|
||||
'clutter-scriptable.c',
|
||||
'clutter-scroll-actor.c',
|
||||
'clutter-seat.c',
|
||||
'clutter-settings.c',
|
||||
'clutter-shader-effect.c',
|
||||
'clutter-shader-types.c',
|
||||
@@ -190,7 +190,6 @@ clutter_private_headers = [
|
||||
'clutter-constraint-private.h',
|
||||
'clutter-content-private.h',
|
||||
'clutter-debug.h',
|
||||
'clutter-device-manager-private.h',
|
||||
'clutter-easing.h',
|
||||
'clutter-effect-private.h',
|
||||
'clutter-event-private.h',
|
||||
@@ -198,6 +197,7 @@ clutter_private_headers = [
|
||||
'clutter-graphene.h',
|
||||
'clutter-gesture-action-private.h',
|
||||
'clutter-id-pool.h',
|
||||
'clutter-input-device-private.h',
|
||||
'clutter-input-focus-private.h',
|
||||
'clutter-input-method-private.h',
|
||||
'clutter-input-pointer-a11y-private.h',
|
||||
|
@@ -47,7 +47,6 @@
|
||||
|
||||
#include "clutter-backend.h"
|
||||
#include "clutter-debug.h"
|
||||
#include "clutter-device-manager-private.h"
|
||||
#include "clutter-event-private.h"
|
||||
#include "clutter-main.h"
|
||||
#include "clutter-private.h"
|
||||
|
@@ -86,8 +86,6 @@ struct _ClutterBackendX11
|
||||
|
||||
Time last_event_time;
|
||||
|
||||
ClutterDeviceManager *device_manager;
|
||||
|
||||
XSettingsClient *xsettings;
|
||||
Window xsettings_xwin;
|
||||
};
|
||||
|
@@ -81,6 +81,7 @@ struct _CoglPangoDisplayListNode
|
||||
GArray *rectangles;
|
||||
/* A primitive representing those vertices */
|
||||
CoglPrimitive *primitive;
|
||||
guint has_color : 1;
|
||||
} texture;
|
||||
|
||||
struct
|
||||
@@ -420,7 +421,9 @@ _cogl_pango_display_list_render (CoglFramebuffer *fb,
|
||||
cogl_color_get_red_byte (&node->color),
|
||||
cogl_color_get_green_byte (&node->color),
|
||||
cogl_color_get_blue_byte (&node->color),
|
||||
cogl_color_get_alpha_byte (color));
|
||||
(cogl_color_get_alpha_byte (&node->color) *
|
||||
cogl_color_get_alpha_byte (color) /
|
||||
255));
|
||||
else
|
||||
draw_color = *color;
|
||||
cogl_color_premultiply (&draw_color);
|
||||
|
@@ -58,27 +58,29 @@ struct _CoglPangoGlyphCacheValue
|
||||
|
||||
/* This will be set to TRUE when the glyph atlas is reorganized
|
||||
which means the glyph will need to be redrawn */
|
||||
gboolean dirty;
|
||||
guint dirty : 1;
|
||||
/* Set to TRUE if the glyph has colors (eg. emoji) */
|
||||
guint has_color : 1;
|
||||
};
|
||||
|
||||
typedef void (* CoglPangoGlyphCacheDirtyFunc) (PangoFont *font,
|
||||
PangoGlyph glyph,
|
||||
CoglPangoGlyphCacheValue *value);
|
||||
|
||||
CoglPangoGlyphCache *
|
||||
COGL_EXPORT CoglPangoGlyphCache *
|
||||
cogl_pango_glyph_cache_new (CoglContext *ctx,
|
||||
gboolean use_mipmapping);
|
||||
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_pango_glyph_cache_free (CoglPangoGlyphCache *cache);
|
||||
|
||||
CoglPangoGlyphCacheValue *
|
||||
COGL_EXPORT CoglPangoGlyphCacheValue *
|
||||
cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
|
||||
gboolean create,
|
||||
PangoFont *font,
|
||||
PangoGlyph glyph);
|
||||
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_pango_glyph_cache_clear (CoglPangoGlyphCache *cache);
|
||||
|
||||
void
|
||||
|
@@ -50,6 +50,7 @@
|
||||
#include <pango/pangocairo.h>
|
||||
#include <pango/pango-renderer.h>
|
||||
#include <cairo.h>
|
||||
#include <cairo-ft.h>
|
||||
|
||||
#include "cogl/cogl-debug.h"
|
||||
#include "cogl/cogl-context-private.h"
|
||||
@@ -526,6 +527,24 @@ cogl_pango_renderer_get_cached_glyph (PangoRenderer *renderer,
|
||||
create, font, glyph);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
font_has_color_glyphs (const PangoFont *font)
|
||||
{
|
||||
cairo_scaled_font_t *scaled_font;
|
||||
gboolean has_color = FALSE;
|
||||
|
||||
scaled_font = pango_cairo_font_get_scaled_font ((PangoCairoFont *) font);
|
||||
|
||||
if (cairo_scaled_font_get_type (scaled_font) == CAIRO_FONT_TYPE_FT)
|
||||
{
|
||||
FT_Face ft_face = cairo_ft_scaled_font_lock_face (scaled_font);
|
||||
has_color = (FT_HAS_COLOR (ft_face) != 0);
|
||||
cairo_ft_scaled_font_unlock_face (scaled_font);
|
||||
}
|
||||
|
||||
return has_color;
|
||||
}
|
||||
|
||||
static void
|
||||
cogl_pango_renderer_set_dirty_glyph (PangoFont *font,
|
||||
PangoGlyph glyph,
|
||||
@@ -600,6 +619,8 @@ cogl_pango_renderer_set_dirty_glyph (PangoFont *font,
|
||||
cairo_image_surface_get_data (surface));
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
value->has_color = font_has_color_glyphs (font);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -698,6 +719,7 @@ cogl_pango_renderer_set_color_for_part (PangoRenderer *renderer,
|
||||
PangoRenderPart part)
|
||||
{
|
||||
PangoColor *pango_color = pango_renderer_get_color (renderer, part);
|
||||
uint16_t alpha = pango_renderer_get_alpha (renderer, part);
|
||||
CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer);
|
||||
|
||||
if (pango_color)
|
||||
@@ -708,7 +730,7 @@ cogl_pango_renderer_set_color_for_part (PangoRenderer *renderer,
|
||||
pango_color->red >> 8,
|
||||
pango_color->green >> 8,
|
||||
pango_color->blue >> 8,
|
||||
0xff);
|
||||
alpha ? alpha >> 8 : 0xff);
|
||||
|
||||
_cogl_pango_display_list_set_color_override (priv->display_list, &color);
|
||||
}
|
||||
@@ -820,14 +842,13 @@ cogl_pango_renderer_draw_glyphs (PangoRenderer *renderer,
|
||||
CoglPangoGlyphCacheValue *cache_value;
|
||||
int i;
|
||||
|
||||
cogl_pango_renderer_set_color_for_part (renderer,
|
||||
PANGO_RENDER_PART_FOREGROUND);
|
||||
|
||||
for (i = 0; i < glyphs->num_glyphs; i++)
|
||||
{
|
||||
PangoGlyphInfo *gi = glyphs->glyphs + i;
|
||||
float x, y;
|
||||
|
||||
cogl_pango_renderer_set_color_for_part (renderer,
|
||||
PANGO_RENDER_PART_FOREGROUND);
|
||||
cogl_pango_renderer_get_device_units (renderer,
|
||||
xi + gi->geometry.x_offset,
|
||||
yi + gi->geometry.y_offset,
|
||||
@@ -884,6 +905,19 @@ cogl_pango_renderer_draw_glyphs (PangoRenderer *renderer,
|
||||
x += (float)(cache_value->draw_x);
|
||||
y += (float)(cache_value->draw_y);
|
||||
|
||||
/* Do not override color if the glyph/font provide its own */
|
||||
if (cache_value->has_color)
|
||||
{
|
||||
CoglColor color;
|
||||
uint16_t alpha;
|
||||
|
||||
alpha = pango_renderer_get_alpha (renderer,
|
||||
PANGO_RENDER_PART_FOREGROUND);
|
||||
cogl_color_init_from_4ub (&color, 0xff, 0xff, 0xff,
|
||||
alpha ? alpha >> 8 : 0xff);
|
||||
_cogl_pango_display_list_set_color_override (priv->display_list, &color);
|
||||
}
|
||||
|
||||
cogl_pango_renderer_draw_glyph (priv, cache_value, x, y);
|
||||
}
|
||||
}
|
||||
|
@@ -75,7 +75,7 @@ typedef PangoCairoFontMap CoglPangoFontMap;
|
||||
*
|
||||
* Since: 1.14
|
||||
*/
|
||||
PangoFontMap *
|
||||
COGL_EXPORT PangoFontMap *
|
||||
cogl_pango_font_map_new (void);
|
||||
|
||||
/**
|
||||
@@ -86,7 +86,7 @@ cogl_pango_font_map_new (void);
|
||||
*
|
||||
* Returns: (transfer full): the newly created context: free with g_object_unref().
|
||||
*/
|
||||
PangoContext *
|
||||
COGL_EXPORT PangoContext *
|
||||
cogl_pango_font_map_create_context (CoglPangoFontMap *font_map);
|
||||
|
||||
/**
|
||||
@@ -102,7 +102,7 @@ cogl_pango_font_map_create_context (CoglPangoFontMap *font_map);
|
||||
*
|
||||
* Since: 1.14
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_pango_font_map_set_resolution (CoglPangoFontMap *font_map,
|
||||
double dpi);
|
||||
|
||||
@@ -114,7 +114,7 @@ cogl_pango_font_map_set_resolution (CoglPangoFontMap *font_map,
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_pango_font_map_clear_glyph_cache (CoglPangoFontMap *font_map);
|
||||
|
||||
/**
|
||||
@@ -129,7 +129,7 @@ cogl_pango_font_map_clear_glyph_cache (CoglPangoFontMap *font_map);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_pango_ensure_glyph_cache_for_layout (PangoLayout *layout);
|
||||
|
||||
/**
|
||||
@@ -142,7 +142,7 @@ cogl_pango_ensure_glyph_cache_for_layout (PangoLayout *layout);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *font_map,
|
||||
gboolean value);
|
||||
|
||||
@@ -157,7 +157,7 @@ cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *font_map,
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *font_map);
|
||||
|
||||
/**
|
||||
@@ -170,7 +170,7 @@ cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *font_map);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
PangoRenderer *
|
||||
COGL_EXPORT PangoRenderer *
|
||||
cogl_pango_font_map_get_renderer (CoglPangoFontMap *font_map);
|
||||
|
||||
/**
|
||||
@@ -187,7 +187,7 @@ cogl_pango_font_map_get_renderer (CoglPangoFontMap *font_map);
|
||||
*
|
||||
* Since: 1.14
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_pango_show_layout (CoglFramebuffer *framebuffer,
|
||||
PangoLayout *layout,
|
||||
float x,
|
||||
@@ -208,7 +208,7 @@ cogl_pango_show_layout (CoglFramebuffer *framebuffer,
|
||||
*
|
||||
* Since: 1.14
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_pango_show_layout_line (CoglFramebuffer *framebuffer,
|
||||
PangoLayoutLine *line,
|
||||
float x,
|
||||
@@ -227,7 +227,7 @@ cogl_pango_show_layout_line (CoglFramebuffer *framebuffer,
|
||||
typedef struct _CoglPangoRenderer CoglPangoRenderer;
|
||||
typedef struct _CoglPangoRendererClass CoglPangoRendererClass;
|
||||
|
||||
GType cogl_pango_renderer_get_type (void) G_GNUC_CONST;
|
||||
COGL_EXPORT GType cogl_pango_renderer_get_type (void) G_GNUC_CONST;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -1,6 +0,0 @@
|
||||
{
|
||||
global:
|
||||
cogl_pango_*;
|
||||
local:
|
||||
*;
|
||||
};
|
@@ -20,19 +20,13 @@ cogl_pango_deps = [
|
||||
libmutter_cogl_dep,
|
||||
]
|
||||
|
||||
libmutter_cogl_pango_map = 'libmutter-cogl-pango.map'
|
||||
libmutter_cogl_pango_link_args = [
|
||||
'-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(),
|
||||
libmutter_cogl_pango_map),
|
||||
]
|
||||
libmutter_cogl_pango = shared_library('mutter-cogl-pango-' + libmutter_api_version,
|
||||
sources: [cogl_pango_sources, cogl_pango_public_headers],
|
||||
version: '0.0.0',
|
||||
soversion: 0,
|
||||
c_args: cogl_c_args,
|
||||
include_directories: [cogl_includepath, cogl_path_includepath],
|
||||
link_depends: libmutter_cogl_pango_map,
|
||||
link_args: libmutter_cogl_pango_link_args,
|
||||
gnu_symbol_visibility: 'hidden',
|
||||
dependencies: [cogl_pango_deps],
|
||||
install_rpath: pkglibdir,
|
||||
install_dir: pkglibdir,
|
||||
|
@@ -50,6 +50,7 @@ G_BEGIN_DECLS
|
||||
*
|
||||
* Returns: a #GType that can be used with the GLib type system.
|
||||
*/
|
||||
COGL_EXPORT
|
||||
GType cogl_path_get_gtype (void);
|
||||
|
||||
#define cogl_path_new cogl2_path_new
|
||||
@@ -64,7 +65,7 @@ GType cogl_path_get_gtype (void);
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
CoglPath *
|
||||
COGL_EXPORT CoglPath *
|
||||
cogl_path_new (void);
|
||||
|
||||
/**
|
||||
@@ -82,7 +83,7 @@ cogl_path_new (void);
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
CoglPath *
|
||||
COGL_EXPORT CoglPath *
|
||||
cogl_path_copy (CoglPath *path);
|
||||
|
||||
/**
|
||||
@@ -96,7 +97,7 @@ cogl_path_copy (CoglPath *path);
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_is_path (void *object);
|
||||
|
||||
#define cogl_path_move_to cogl2_path_move_to
|
||||
@@ -110,7 +111,7 @@ cogl_is_path (void *object);
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_path_move_to (CoglPath *path,
|
||||
float x,
|
||||
float y);
|
||||
@@ -127,7 +128,7 @@ cogl_path_move_to (CoglPath *path,
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_path_rel_move_to (CoglPath *path,
|
||||
float x,
|
||||
float y);
|
||||
@@ -143,7 +144,7 @@ cogl_path_rel_move_to (CoglPath *path,
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_path_line_to (CoglPath *path,
|
||||
float x,
|
||||
float y);
|
||||
@@ -159,7 +160,7 @@ cogl_path_line_to (CoglPath *path,
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_path_rel_line_to (CoglPath *path,
|
||||
float x,
|
||||
float y);
|
||||
@@ -187,7 +188,7 @@ cogl_path_rel_line_to (CoglPath *path,
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_path_arc (CoglPath *path,
|
||||
float center_x,
|
||||
float center_y,
|
||||
@@ -212,7 +213,7 @@ cogl_path_arc (CoglPath *path,
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_path_curve_to (CoglPath *path,
|
||||
float x_1,
|
||||
float y_1,
|
||||
@@ -238,7 +239,7 @@ cogl_path_curve_to (CoglPath *path,
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_path_rel_curve_to (CoglPath *path,
|
||||
float x_1,
|
||||
float y_1,
|
||||
@@ -256,7 +257,7 @@ cogl_path_rel_curve_to (CoglPath *path,
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_path_close (CoglPath *path);
|
||||
|
||||
#define cogl_path_line cogl2_path_line
|
||||
@@ -273,7 +274,7 @@ cogl_path_close (CoglPath *path);
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_path_line (CoglPath *path,
|
||||
float x_1,
|
||||
float y_1,
|
||||
@@ -301,7 +302,7 @@ cogl_path_line (CoglPath *path,
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_path_polyline (CoglPath *path,
|
||||
const float *coords,
|
||||
int num_points);
|
||||
@@ -323,7 +324,7 @@ cogl_path_polyline (CoglPath *path,
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_path_polygon (CoglPath *path,
|
||||
const float *coords,
|
||||
int num_points);
|
||||
@@ -341,7 +342,7 @@ cogl_path_polygon (CoglPath *path,
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_path_rectangle (CoglPath *path,
|
||||
float x_1,
|
||||
float y_1,
|
||||
@@ -361,7 +362,7 @@ cogl_path_rectangle (CoglPath *path,
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_path_ellipse (CoglPath *path,
|
||||
float center_x,
|
||||
float center_y,
|
||||
@@ -384,7 +385,7 @@ cogl_path_ellipse (CoglPath *path,
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_path_round_rectangle (CoglPath *path,
|
||||
float x_1,
|
||||
float y_1,
|
||||
@@ -406,7 +407,7 @@ cogl_path_round_rectangle (CoglPath *path,
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_path_set_fill_rule (CoglPath *path, CoglPathFillRule fill_rule);
|
||||
|
||||
#define cogl_path_get_fill_rule cogl2_path_get_fill_rule
|
||||
@@ -419,7 +420,7 @@ cogl_path_set_fill_rule (CoglPath *path, CoglPathFillRule fill_rule);
|
||||
*
|
||||
* Since: 2.0
|
||||
*/
|
||||
CoglPathFillRule
|
||||
COGL_EXPORT CoglPathFillRule
|
||||
cogl_path_get_fill_rule (CoglPath *path);
|
||||
|
||||
/**
|
||||
@@ -441,7 +442,7 @@ cogl_path_get_fill_rule (CoglPath *path);
|
||||
*
|
||||
* Stability: unstable
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_framebuffer_fill_path (CoglFramebuffer *framebuffer,
|
||||
CoglPipeline *pipeline,
|
||||
CoglPath *path);
|
||||
@@ -458,7 +459,7 @@ cogl_framebuffer_fill_path (CoglFramebuffer *framebuffer,
|
||||
*
|
||||
* Stability: unstable
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_framebuffer_stroke_path (CoglFramebuffer *framebuffer,
|
||||
CoglPipeline *pipeline,
|
||||
CoglPath *path);
|
||||
@@ -476,7 +477,7 @@ cogl_framebuffer_stroke_path (CoglFramebuffer *framebuffer,
|
||||
* Since: 1.0
|
||||
* Stability: unstable
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_framebuffer_push_path_clip (CoglFramebuffer *framebuffer,
|
||||
CoglPath *path);
|
||||
|
||||
|
@@ -1,17 +0,0 @@
|
||||
{
|
||||
global:
|
||||
cogl_framebuffer_*;
|
||||
cogl_path_*;
|
||||
cogl_is_*;
|
||||
cogl_clip_*;
|
||||
cogl_get_*;
|
||||
cogl_set_*;
|
||||
cogl2_framebuffer_*;
|
||||
cogl2_path_*;
|
||||
cogl2_is_*;
|
||||
cogl2_clip_*;
|
||||
cogl2_get_*;
|
||||
cogl2_set_*;
|
||||
local:
|
||||
*;
|
||||
};
|
@@ -53,19 +53,13 @@ cogl_path_c_args = [
|
||||
cogl_c_args,
|
||||
]
|
||||
|
||||
libmutter_cogl_path_map = 'libmutter-cogl-path.map'
|
||||
libmutter_cogl_path_link_args = [
|
||||
'-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(),
|
||||
libmutter_cogl_path_map),
|
||||
]
|
||||
libmutter_cogl_path = shared_library('mutter-cogl-path-' + libmutter_api_version,
|
||||
sources: [cogl_path_sources, cogl_path_public_headers],
|
||||
version: '0.0.0',
|
||||
soversion: 0,
|
||||
c_args: cogl_path_c_args,
|
||||
include_directories: [cogl_includepath, cogl_path_includepath],
|
||||
link_depends: libmutter_cogl_path_map,
|
||||
link_args: libmutter_cogl_path_link_args,
|
||||
gnu_symbol_visibility: 'hidden',
|
||||
dependencies: libmutter_cogl_dep,
|
||||
install_rpath: pkglibdir,
|
||||
install_dir: pkglibdir,
|
||||
|
@@ -65,12 +65,12 @@ CoglAtlasTexture *
|
||||
_cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp,
|
||||
gboolean can_convert_in_place);
|
||||
|
||||
void
|
||||
COGL_EXPORT void
|
||||
_cogl_atlas_texture_add_reorganize_callback (CoglContext *ctx,
|
||||
GHookFunc callback,
|
||||
void *user_data);
|
||||
|
||||
void
|
||||
COGL_EXPORT void
|
||||
_cogl_atlas_texture_remove_reorganize_callback (CoglContext *ctx,
|
||||
GHookFunc callback,
|
||||
void *user_data);
|
||||
|
@@ -252,16 +252,14 @@ _cogl_atlas_texture_foreach_sub_texture_in_region (
|
||||
static void
|
||||
_cogl_atlas_texture_gl_flush_legacy_texobj_wrap_modes (CoglTexture *tex,
|
||||
GLenum wrap_mode_s,
|
||||
GLenum wrap_mode_t,
|
||||
GLenum wrap_mode_p)
|
||||
GLenum wrap_mode_t)
|
||||
{
|
||||
CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex);
|
||||
|
||||
/* Forward on to the sub texture */
|
||||
_cogl_texture_gl_flush_legacy_texobj_wrap_modes (atlas_tex->sub_texture,
|
||||
wrap_mode_s,
|
||||
wrap_mode_t,
|
||||
wrap_mode_p);
|
||||
wrap_mode_t);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -74,6 +74,7 @@ typedef struct _CoglAtlasTexture CoglAtlasTexture;
|
||||
*
|
||||
* Returns: a #GType that can be used with the GLib type system.
|
||||
*/
|
||||
COGL_EXPORT
|
||||
GType cogl_atlas_texture_get_gtype (void);
|
||||
|
||||
/**
|
||||
@@ -108,7 +109,7 @@ GType cogl_atlas_texture_get_gtype (void);
|
||||
* Since: 1.16
|
||||
* Stability: unstable
|
||||
*/
|
||||
CoglAtlasTexture *
|
||||
COGL_EXPORT CoglAtlasTexture *
|
||||
cogl_atlas_texture_new_with_size (CoglContext *ctx,
|
||||
int width,
|
||||
int height);
|
||||
@@ -146,7 +147,7 @@ cogl_atlas_texture_new_with_size (CoglContext *ctx,
|
||||
* Since: 1.16
|
||||
* Stability: unstable
|
||||
*/
|
||||
CoglAtlasTexture *
|
||||
COGL_EXPORT CoglAtlasTexture *
|
||||
cogl_atlas_texture_new_from_file (CoglContext *ctx,
|
||||
const char *filename,
|
||||
GError **error);
|
||||
@@ -191,7 +192,7 @@ cogl_atlas_texture_new_from_file (CoglContext *ctx,
|
||||
* Since: 1.16
|
||||
* Stability: unstable
|
||||
*/
|
||||
CoglAtlasTexture *
|
||||
COGL_EXPORT CoglAtlasTexture *
|
||||
cogl_atlas_texture_new_from_data (CoglContext *ctx,
|
||||
int width,
|
||||
int height,
|
||||
@@ -231,7 +232,7 @@ cogl_atlas_texture_new_from_data (CoglContext *ctx,
|
||||
* Since: 1.16
|
||||
* Stability: unstable
|
||||
*/
|
||||
CoglAtlasTexture *
|
||||
COGL_EXPORT CoglAtlasTexture *
|
||||
cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp);
|
||||
|
||||
/**
|
||||
@@ -246,7 +247,7 @@ cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp);
|
||||
* Since: 1.16
|
||||
* Stability: Unstable
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_is_atlas_texture (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -64,12 +64,12 @@ struct _CoglAtlas
|
||||
GHookList post_reorganize_callbacks;
|
||||
};
|
||||
|
||||
CoglAtlas *
|
||||
COGL_EXPORT CoglAtlas *
|
||||
_cogl_atlas_new (CoglPixelFormat texture_format,
|
||||
CoglAtlasFlags flags,
|
||||
CoglAtlasUpdatePositionCallback update_position_cb);
|
||||
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
_cogl_atlas_reserve_space (CoglAtlas *atlas,
|
||||
unsigned int width,
|
||||
unsigned int height,
|
||||
@@ -87,7 +87,7 @@ _cogl_atlas_copy_rectangle (CoglAtlas *atlas,
|
||||
int height,
|
||||
CoglPixelFormat format);
|
||||
|
||||
void
|
||||
COGL_EXPORT void
|
||||
_cogl_atlas_add_reorganize_callback (CoglAtlas *atlas,
|
||||
GHookFunc pre_callback,
|
||||
GHookFunc post_callback,
|
||||
|
@@ -64,6 +64,7 @@ G_BEGIN_DECLS
|
||||
*
|
||||
* Returns: a #GType that can be used with the GLib type system.
|
||||
*/
|
||||
COGL_EXPORT
|
||||
GType cogl_attribute_buffer_get_gtype (void);
|
||||
|
||||
/**
|
||||
@@ -89,7 +90,7 @@ GType cogl_attribute_buffer_get_gtype (void);
|
||||
*
|
||||
* Stability: Unstable
|
||||
*/
|
||||
CoglAttributeBuffer *
|
||||
COGL_EXPORT CoglAttributeBuffer *
|
||||
cogl_attribute_buffer_new_with_size (CoglContext *context,
|
||||
size_t bytes);
|
||||
|
||||
@@ -122,7 +123,7 @@ cogl_attribute_buffer_new_with_size (CoglContext *context,
|
||||
* Since: 1.4
|
||||
* Stability: Unstable
|
||||
*/
|
||||
CoglAttributeBuffer *
|
||||
COGL_EXPORT CoglAttributeBuffer *
|
||||
cogl_attribute_buffer_new (CoglContext *context,
|
||||
size_t bytes,
|
||||
const void *data);
|
||||
@@ -139,7 +140,7 @@ cogl_attribute_buffer_new (CoglContext *context,
|
||||
* Since: 1.4
|
||||
* Stability: Unstable
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_is_attribute_buffer (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -168,35 +168,6 @@ validate_n_components (const CoglAttributeNameState *name_state,
|
||||
{
|
||||
switch (name_state->name_id)
|
||||
{
|
||||
case COGL_ATTRIBUTE_NAME_ID_POSITION_ARRAY:
|
||||
if (G_UNLIKELY (n_components == 1))
|
||||
{
|
||||
g_critical ("glVertexPointer doesn't allow 1 component vertex "
|
||||
"positions so we currently only support \"cogl_vertex\" "
|
||||
"attributes where n_components == 2, 3 or 4");
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
case COGL_ATTRIBUTE_NAME_ID_COLOR_ARRAY:
|
||||
if (G_UNLIKELY (n_components != 3 && n_components != 4))
|
||||
{
|
||||
g_critical ("glColorPointer expects 3 or 4 component colors so we "
|
||||
"currently only support \"cogl_color\" attributes where "
|
||||
"n_components == 3 or 4");
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
case COGL_ATTRIBUTE_NAME_ID_TEXTURE_COORD_ARRAY:
|
||||
break;
|
||||
case COGL_ATTRIBUTE_NAME_ID_NORMAL_ARRAY:
|
||||
if (G_UNLIKELY (n_components != 3))
|
||||
{
|
||||
g_critical ("glNormalPointer expects 3 component normals so we "
|
||||
"currently only support \"cogl_normal\" attributes "
|
||||
"where n_components == 3");
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
case COGL_ATTRIBUTE_NAME_ID_POINT_SIZE_ARRAY:
|
||||
if (G_UNLIKELY (n_components != 1))
|
||||
{
|
||||
@@ -205,6 +176,10 @@ validate_n_components (const CoglAttributeNameState *name_state,
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
case COGL_ATTRIBUTE_NAME_ID_POSITION_ARRAY:
|
||||
case COGL_ATTRIBUTE_NAME_ID_COLOR_ARRAY:
|
||||
case COGL_ATTRIBUTE_NAME_ID_TEXTURE_COORD_ARRAY:
|
||||
case COGL_ATTRIBUTE_NAME_ID_NORMAL_ARRAY:
|
||||
case COGL_ATTRIBUTE_NAME_ID_CUSTOM_ARRAY:
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -63,6 +63,7 @@ G_BEGIN_DECLS
|
||||
*
|
||||
* Returns: a #GType that can be used with the GLib type system.
|
||||
*/
|
||||
COGL_EXPORT
|
||||
GType cogl_attribute_get_gtype (void);
|
||||
|
||||
/**
|
||||
@@ -155,7 +156,7 @@ GType cogl_attribute_get_gtype (void);
|
||||
*/
|
||||
/* XXX: look for a precedent to see if the stride/offset args should
|
||||
* have a different order. */
|
||||
CoglAttribute *
|
||||
COGL_EXPORT CoglAttribute *
|
||||
cogl_attribute_new (CoglAttributeBuffer *attribute_buffer,
|
||||
const char *name,
|
||||
size_t stride,
|
||||
@@ -183,7 +184,7 @@ cogl_attribute_new (CoglAttributeBuffer *attribute_buffer,
|
||||
* Return value: (transfer full): A newly allocated #CoglAttribute
|
||||
* representing the given constant @value.
|
||||
*/
|
||||
CoglAttribute *
|
||||
COGL_EXPORT CoglAttribute *
|
||||
cogl_attribute_new_const_1f (CoglContext *context,
|
||||
const char *name,
|
||||
float value);
|
||||
@@ -210,7 +211,7 @@ cogl_attribute_new_const_1f (CoglContext *context,
|
||||
* Return value: (transfer full): A newly allocated #CoglAttribute
|
||||
* representing the given constant vector.
|
||||
*/
|
||||
CoglAttribute *
|
||||
COGL_EXPORT CoglAttribute *
|
||||
cogl_attribute_new_const_2f (CoglContext *context,
|
||||
const char *name,
|
||||
float component0,
|
||||
@@ -242,7 +243,7 @@ cogl_attribute_new_const_2f (CoglContext *context,
|
||||
* Return value: (transfer full): A newly allocated #CoglAttribute
|
||||
* representing the given constant vector.
|
||||
*/
|
||||
CoglAttribute *
|
||||
COGL_EXPORT CoglAttribute *
|
||||
cogl_attribute_new_const_3f (CoglContext *context,
|
||||
const char *name,
|
||||
float component0,
|
||||
@@ -277,7 +278,7 @@ cogl_attribute_new_const_3f (CoglContext *context,
|
||||
* Return value: (transfer full): A newly allocated #CoglAttribute
|
||||
* representing the given constant vector.
|
||||
*/
|
||||
CoglAttribute *
|
||||
COGL_EXPORT CoglAttribute *
|
||||
cogl_attribute_new_const_4f (CoglContext *context,
|
||||
const char *name,
|
||||
float component0,
|
||||
@@ -306,7 +307,7 @@ cogl_attribute_new_const_4f (CoglContext *context,
|
||||
* Return value: (transfer full): A newly allocated #CoglAttribute
|
||||
* representing the given constant vector.
|
||||
*/
|
||||
CoglAttribute *
|
||||
COGL_EXPORT CoglAttribute *
|
||||
cogl_attribute_new_const_2fv (CoglContext *context,
|
||||
const char *name,
|
||||
const float *value);
|
||||
@@ -335,7 +336,7 @@ cogl_attribute_new_const_2fv (CoglContext *context,
|
||||
* Return value: (transfer full): A newly allocated #CoglAttribute
|
||||
* representing the given constant vector.
|
||||
*/
|
||||
CoglAttribute *
|
||||
COGL_EXPORT CoglAttribute *
|
||||
cogl_attribute_new_const_3fv (CoglContext *context,
|
||||
const char *name,
|
||||
const float *value);
|
||||
@@ -365,7 +366,7 @@ cogl_attribute_new_const_3fv (CoglContext *context,
|
||||
* Return value: (transfer full): A newly allocated #CoglAttribute
|
||||
* representing the given constant vector.
|
||||
*/
|
||||
CoglAttribute *
|
||||
COGL_EXPORT CoglAttribute *
|
||||
cogl_attribute_new_const_4fv (CoglContext *context,
|
||||
const char *name,
|
||||
const float *value);
|
||||
@@ -398,7 +399,7 @@ cogl_attribute_new_const_4fv (CoglContext *context,
|
||||
* Return value: (transfer full): A newly allocated #CoglAttribute
|
||||
* representing the given constant matrix.
|
||||
*/
|
||||
CoglAttribute *
|
||||
COGL_EXPORT CoglAttribute *
|
||||
cogl_attribute_new_const_2x2fv (CoglContext *context,
|
||||
const char *name,
|
||||
const float *matrix2x2,
|
||||
@@ -433,7 +434,7 @@ cogl_attribute_new_const_2x2fv (CoglContext *context,
|
||||
* Return value: (transfer full): A newly allocated #CoglAttribute
|
||||
* representing the given constant matrix.
|
||||
*/
|
||||
CoglAttribute *
|
||||
COGL_EXPORT CoglAttribute *
|
||||
cogl_attribute_new_const_3x3fv (CoglContext *context,
|
||||
const char *name,
|
||||
const float *matrix3x3,
|
||||
@@ -468,7 +469,7 @@ cogl_attribute_new_const_3x3fv (CoglContext *context,
|
||||
* Return value: (transfer full): A newly allocated #CoglAttribute
|
||||
* representing the given constant matrix.
|
||||
*/
|
||||
CoglAttribute *
|
||||
COGL_EXPORT CoglAttribute *
|
||||
cogl_attribute_new_const_4x4fv (CoglContext *context,
|
||||
const char *name,
|
||||
const float *matrix4x4,
|
||||
@@ -492,7 +493,7 @@ cogl_attribute_new_const_4x4fv (CoglContext *context,
|
||||
* Stability: unstable
|
||||
* Since: 1.10
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_attribute_set_normalized (CoglAttribute *attribute,
|
||||
gboolean normalized);
|
||||
|
||||
@@ -506,7 +507,7 @@ cogl_attribute_set_normalized (CoglAttribute *attribute,
|
||||
* Stability: unstable
|
||||
* Since: 1.10
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_attribute_get_normalized (CoglAttribute *attribute);
|
||||
|
||||
/**
|
||||
@@ -519,7 +520,7 @@ cogl_attribute_get_normalized (CoglAttribute *attribute);
|
||||
* Stability: unstable
|
||||
* Since: 1.10
|
||||
*/
|
||||
CoglAttributeBuffer *
|
||||
COGL_EXPORT CoglAttributeBuffer *
|
||||
cogl_attribute_get_buffer (CoglAttribute *attribute);
|
||||
|
||||
/**
|
||||
@@ -532,7 +533,7 @@ cogl_attribute_get_buffer (CoglAttribute *attribute);
|
||||
* Stability: unstable
|
||||
* Since: 1.10
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_attribute_set_buffer (CoglAttribute *attribute,
|
||||
CoglAttributeBuffer *attribute_buffer);
|
||||
|
||||
@@ -545,7 +546,7 @@ cogl_attribute_set_buffer (CoglAttribute *attribute,
|
||||
* Return value: %TRUE if the @object references a #CoglAttribute,
|
||||
* %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_is_attribute (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -54,6 +54,7 @@ G_BEGIN_DECLS
|
||||
*
|
||||
* Returns: a #GType that can be used with the GLib type system.
|
||||
*/
|
||||
COGL_EXPORT
|
||||
GType cogl_bitmap_get_gtype (void);
|
||||
|
||||
/**
|
||||
@@ -80,7 +81,7 @@ GType cogl_bitmap_get_gtype (void);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
CoglBitmap *
|
||||
COGL_EXPORT CoglBitmap *
|
||||
cogl_bitmap_new_from_file (const char *filename,
|
||||
GError **error);
|
||||
|
||||
@@ -103,7 +104,7 @@ cogl_bitmap_new_from_file (const char *filename,
|
||||
* Since: 1.8
|
||||
* Stability: unstable
|
||||
*/
|
||||
CoglBitmap *
|
||||
COGL_EXPORT CoglBitmap *
|
||||
cogl_bitmap_new_from_buffer (CoglBuffer *buffer,
|
||||
CoglPixelFormat format,
|
||||
int width,
|
||||
@@ -140,7 +141,7 @@ cogl_bitmap_new_from_buffer (CoglBuffer *buffer,
|
||||
* Since: 1.10
|
||||
* Stability: Unstable
|
||||
*/
|
||||
CoglBitmap *
|
||||
COGL_EXPORT CoglBitmap *
|
||||
cogl_bitmap_new_with_size (CoglContext *context,
|
||||
unsigned int width,
|
||||
unsigned int height,
|
||||
@@ -166,7 +167,7 @@ cogl_bitmap_new_with_size (CoglContext *context,
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
CoglBitmap *
|
||||
COGL_EXPORT CoglBitmap *
|
||||
cogl_bitmap_new_for_data (CoglContext *context,
|
||||
int width,
|
||||
int height,
|
||||
@@ -182,7 +183,7 @@ cogl_bitmap_new_for_data (CoglContext *context,
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
CoglPixelFormat
|
||||
COGL_EXPORT CoglPixelFormat
|
||||
cogl_bitmap_get_format (CoglBitmap *bitmap);
|
||||
|
||||
/**
|
||||
@@ -193,7 +194,7 @@ cogl_bitmap_get_format (CoglBitmap *bitmap);
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
int
|
||||
COGL_EXPORT int
|
||||
cogl_bitmap_get_width (CoglBitmap *bitmap);
|
||||
|
||||
/**
|
||||
@@ -204,7 +205,7 @@ cogl_bitmap_get_width (CoglBitmap *bitmap);
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
int
|
||||
COGL_EXPORT int
|
||||
cogl_bitmap_get_height (CoglBitmap *bitmap);
|
||||
|
||||
/**
|
||||
@@ -217,7 +218,7 @@ cogl_bitmap_get_height (CoglBitmap *bitmap);
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
int
|
||||
COGL_EXPORT int
|
||||
cogl_bitmap_get_rowstride (CoglBitmap *bitmap);
|
||||
|
||||
/**
|
||||
@@ -231,7 +232,7 @@ cogl_bitmap_get_rowstride (CoglBitmap *bitmap);
|
||||
* Stability: unstable
|
||||
* Since: 1.10
|
||||
*/
|
||||
CoglPixelBuffer *
|
||||
COGL_EXPORT CoglPixelBuffer *
|
||||
cogl_bitmap_get_buffer (CoglBitmap *bitmap);
|
||||
|
||||
/**
|
||||
@@ -247,7 +248,7 @@ cogl_bitmap_get_buffer (CoglBitmap *bitmap);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_bitmap_get_size_from_file (const char *filename,
|
||||
int *width,
|
||||
int *height);
|
||||
@@ -263,7 +264,7 @@ cogl_bitmap_get_size_from_file (const char *filename,
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_is_bitmap (void *object);
|
||||
|
||||
/**
|
||||
@@ -297,6 +298,7 @@ typedef enum
|
||||
COGL_BITMAP_ERROR_CORRUPT_IMAGE
|
||||
} CoglBitmapError;
|
||||
|
||||
COGL_EXPORT
|
||||
uint32_t cogl_bitmap_error_quark (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -509,7 +509,7 @@ parse_argument (const char *string, /* original user string */
|
||||
if (parsing_factor)
|
||||
arg->factor.is_color = TRUE;
|
||||
|
||||
/* fall through */
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case PARSER_ARG_STATE_SCRAPING_COLOR_SRC_NAME:
|
||||
if (!is_symbol_char (*p))
|
||||
{
|
||||
@@ -540,7 +540,7 @@ parse_argument (const char *string, /* original user string */
|
||||
else
|
||||
continue;
|
||||
|
||||
/* fall through */
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case PARSER_ARG_STATE_MAYBE_COLOR_MASK:
|
||||
if (*p != '[')
|
||||
{
|
||||
@@ -554,7 +554,7 @@ parse_argument (const char *string, /* original user string */
|
||||
state = PARSER_ARG_STATE_SCRAPING_MASK;
|
||||
mark = p;
|
||||
|
||||
/* fall through */
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case PARSER_ARG_STATE_SCRAPING_MASK:
|
||||
if (*p == ']')
|
||||
{
|
||||
@@ -687,7 +687,7 @@ parse_argument (const char *string, /* original user string */
|
||||
arg->factor.is_one = TRUE;
|
||||
state = PARSER_ARG_STATE_EXPECT_END;
|
||||
|
||||
/* fall through */
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case PARSER_ARG_STATE_EXPECT_END:
|
||||
if (*p != ',' && *p != ')')
|
||||
{
|
||||
@@ -787,7 +787,7 @@ _cogl_blend_string_compile (const char *string,
|
||||
mark = p;
|
||||
state = PARSER_STATE_SCRAPING_DEST_CHANNELS;
|
||||
|
||||
/* fall through */
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case PARSER_STATE_SCRAPING_DEST_CHANNELS:
|
||||
if (*p != '=')
|
||||
continue;
|
||||
@@ -810,7 +810,7 @@ _cogl_blend_string_compile (const char *string,
|
||||
mark = p;
|
||||
state = PARSER_STATE_SCRAPING_FUNCTION_NAME;
|
||||
|
||||
/* fall through */
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case PARSER_STATE_SCRAPING_FUNCTION_NAME:
|
||||
if (*p != '(')
|
||||
{
|
||||
@@ -832,7 +832,7 @@ _cogl_blend_string_compile (const char *string,
|
||||
current_arg = 0;
|
||||
state = PARSER_STATE_EXPECT_ARG_START;
|
||||
|
||||
/* fall through */
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case PARSER_STATE_EXPECT_ARG_START:
|
||||
if (*p != '(' && *p != ',')
|
||||
continue;
|
||||
|
@@ -139,9 +139,6 @@ _cogl_buffer_fini (CoglBuffer *buffer);
|
||||
CoglBufferUsageHint
|
||||
_cogl_buffer_get_usage_hint (CoglBuffer *buffer);
|
||||
|
||||
GLenum
|
||||
_cogl_buffer_access_to_gl_enum (CoglBufferAccess access);
|
||||
|
||||
CoglBuffer *
|
||||
_cogl_buffer_immutable_ref (CoglBuffer *buffer);
|
||||
|
||||
@@ -171,10 +168,10 @@ void *
|
||||
_cogl_buffer_map_range_for_fill_or_fallback (CoglBuffer *buffer,
|
||||
size_t offset,
|
||||
size_t size);
|
||||
void *
|
||||
COGL_EXPORT void *
|
||||
_cogl_buffer_map_for_fill_or_fallback (CoglBuffer *buffer);
|
||||
|
||||
void
|
||||
COGL_EXPORT void
|
||||
_cogl_buffer_unmap_for_fill_or_fallback (CoglBuffer *buffer);
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -107,7 +107,7 @@ _cogl_buffer_error_domain (void);
|
||||
* Since: 1.2
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_is_buffer (void *object);
|
||||
|
||||
/**
|
||||
@@ -121,7 +121,7 @@ cogl_is_buffer (void *object);
|
||||
* Since: 1.2
|
||||
* Stability: unstable
|
||||
*/
|
||||
unsigned int
|
||||
COGL_EXPORT unsigned int
|
||||
cogl_buffer_get_size (CoglBuffer *buffer);
|
||||
|
||||
/**
|
||||
@@ -155,7 +155,7 @@ typedef enum /*< prefix=COGL_BUFFER_UPDATE_HINT >*/
|
||||
* Since: 1.2
|
||||
* Stability: unstable
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_buffer_set_update_hint (CoglBuffer *buffer,
|
||||
CoglBufferUpdateHint hint);
|
||||
|
||||
@@ -170,7 +170,7 @@ cogl_buffer_set_update_hint (CoglBuffer *buffer,
|
||||
* Since: 1.2
|
||||
* Stability: unstable
|
||||
*/
|
||||
CoglBufferUpdateHint
|
||||
COGL_EXPORT CoglBufferUpdateHint
|
||||
cogl_buffer_get_update_hint (CoglBuffer *buffer);
|
||||
|
||||
/**
|
||||
@@ -244,7 +244,7 @@ typedef enum /*< prefix=COGL_BUFFER_MAP_HINT >*/
|
||||
* Since: 1.2
|
||||
* Stability: unstable
|
||||
*/
|
||||
void *
|
||||
COGL_EXPORT void *
|
||||
cogl_buffer_map (CoglBuffer *buffer,
|
||||
CoglBufferAccess access,
|
||||
CoglBufferMapHint hints);
|
||||
@@ -281,7 +281,7 @@ cogl_buffer_map (CoglBuffer *buffer,
|
||||
* Since: 2.0
|
||||
* Stability: unstable
|
||||
*/
|
||||
void *
|
||||
COGL_EXPORT void *
|
||||
cogl_buffer_map_range (CoglBuffer *buffer,
|
||||
size_t offset,
|
||||
size_t size,
|
||||
@@ -298,7 +298,7 @@ cogl_buffer_map_range (CoglBuffer *buffer,
|
||||
* Since: 1.2
|
||||
* Stability: unstable
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_buffer_unmap (CoglBuffer *buffer);
|
||||
|
||||
/**
|
||||
@@ -317,7 +317,7 @@ cogl_buffer_unmap (CoglBuffer *buffer);
|
||||
* Since: 1.2
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_buffer_set_data (CoglBuffer *buffer,
|
||||
size_t offset,
|
||||
const void *data,
|
||||
|
@@ -178,7 +178,7 @@ _cogl_clip_stack_push_window_rectangle (CoglClipStack *stack,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
CoglClipStack *
|
||||
COGL_EXPORT CoglClipStack *
|
||||
_cogl_clip_stack_push_rectangle (CoglClipStack *stack,
|
||||
float x_1,
|
||||
float y_1,
|
||||
@@ -188,7 +188,7 @@ _cogl_clip_stack_push_rectangle (CoglClipStack *stack,
|
||||
CoglMatrixEntry *projection_entry,
|
||||
const float *viewport);
|
||||
|
||||
CoglClipStack *
|
||||
COGL_EXPORT CoglClipStack *
|
||||
_cogl_clip_stack_push_primitive (CoglClipStack *stack,
|
||||
CoglPrimitive *primitive,
|
||||
float bounds_x1,
|
||||
|
@@ -65,7 +65,7 @@ typedef struct _CoglClosure
|
||||
* Removes the given closure from the callback list it is connected to
|
||||
* and destroys it. If the closure was created with a destroy function
|
||||
* then it will be invoked. */
|
||||
void
|
||||
COGL_EXPORT void
|
||||
_cogl_closure_disconnect (CoglClosure *closure);
|
||||
|
||||
void
|
||||
|
@@ -57,6 +57,7 @@ G_BEGIN_DECLS
|
||||
*
|
||||
* Returns: a #GType that can be used with the GLib type system.
|
||||
*/
|
||||
COGL_EXPORT
|
||||
GType cogl_color_get_gtype (void);
|
||||
|
||||
/**
|
||||
@@ -69,7 +70,7 @@ GType cogl_color_get_gtype (void);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
CoglColor *
|
||||
COGL_EXPORT CoglColor *
|
||||
cogl_color_new (void);
|
||||
|
||||
/**
|
||||
@@ -83,7 +84,7 @@ cogl_color_new (void);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
CoglColor *
|
||||
COGL_EXPORT CoglColor *
|
||||
cogl_color_copy (const CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -94,7 +95,7 @@ cogl_color_copy (const CoglColor *color);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_free (CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -109,7 +110,7 @@ cogl_color_free (CoglColor *color);
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_init_from_4ub (CoglColor *color,
|
||||
uint8_t red,
|
||||
uint8_t green,
|
||||
@@ -128,7 +129,7 @@ cogl_color_init_from_4ub (CoglColor *color,
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_init_from_4f (CoglColor *color,
|
||||
float red,
|
||||
float green,
|
||||
@@ -144,7 +145,7 @@ cogl_color_init_from_4f (CoglColor *color,
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_init_from_4fv (CoglColor *color,
|
||||
const float *color_array);
|
||||
|
||||
@@ -159,7 +160,7 @@ cogl_color_init_from_4fv (CoglColor *color,
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
unsigned char
|
||||
COGL_EXPORT unsigned char
|
||||
cogl_color_get_red_byte (const CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -173,7 +174,7 @@ cogl_color_get_red_byte (const CoglColor *color);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
unsigned char
|
||||
COGL_EXPORT unsigned char
|
||||
cogl_color_get_green_byte (const CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -187,7 +188,7 @@ cogl_color_get_green_byte (const CoglColor *color);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
unsigned char
|
||||
COGL_EXPORT unsigned char
|
||||
cogl_color_get_blue_byte (const CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -201,7 +202,7 @@ cogl_color_get_blue_byte (const CoglColor *color);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
unsigned char
|
||||
COGL_EXPORT unsigned char
|
||||
cogl_color_get_alpha_byte (const CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -215,7 +216,7 @@ cogl_color_get_alpha_byte (const CoglColor *color);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
float
|
||||
COGL_EXPORT float
|
||||
cogl_color_get_red_float (const CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -229,7 +230,7 @@ cogl_color_get_red_float (const CoglColor *color);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
float
|
||||
COGL_EXPORT float
|
||||
cogl_color_get_green_float (const CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -243,7 +244,7 @@ cogl_color_get_green_float (const CoglColor *color);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
float
|
||||
COGL_EXPORT float
|
||||
cogl_color_get_blue_float (const CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -257,7 +258,7 @@ cogl_color_get_blue_float (const CoglColor *color);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
float
|
||||
COGL_EXPORT float
|
||||
cogl_color_get_alpha_float (const CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -271,7 +272,7 @@ cogl_color_get_alpha_float (const CoglColor *color);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
float
|
||||
COGL_EXPORT float
|
||||
cogl_color_get_red (const CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -285,7 +286,7 @@ cogl_color_get_red (const CoglColor *color);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
float
|
||||
COGL_EXPORT float
|
||||
cogl_color_get_green (const CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -299,7 +300,7 @@ cogl_color_get_green (const CoglColor *color);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
float
|
||||
COGL_EXPORT float
|
||||
cogl_color_get_blue (const CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -313,7 +314,7 @@ cogl_color_get_blue (const CoglColor *color);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
float
|
||||
COGL_EXPORT float
|
||||
cogl_color_get_alpha (const CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -325,7 +326,7 @@ cogl_color_get_alpha (const CoglColor *color);
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_set_red_byte (CoglColor *color,
|
||||
unsigned char red);
|
||||
|
||||
@@ -338,7 +339,7 @@ cogl_color_set_red_byte (CoglColor *color,
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_set_green_byte (CoglColor *color,
|
||||
unsigned char green);
|
||||
|
||||
@@ -351,7 +352,7 @@ cogl_color_set_green_byte (CoglColor *color,
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_set_blue_byte (CoglColor *color,
|
||||
unsigned char blue);
|
||||
|
||||
@@ -364,7 +365,7 @@ cogl_color_set_blue_byte (CoglColor *color,
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_set_alpha_byte (CoglColor *color,
|
||||
unsigned char alpha);
|
||||
|
||||
@@ -377,7 +378,7 @@ cogl_color_set_alpha_byte (CoglColor *color,
|
||||
*
|
||||
* since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_set_red_float (CoglColor *color,
|
||||
float red);
|
||||
|
||||
@@ -390,7 +391,7 @@ cogl_color_set_red_float (CoglColor *color,
|
||||
*
|
||||
* since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_set_green_float (CoglColor *color,
|
||||
float green);
|
||||
|
||||
@@ -403,7 +404,7 @@ cogl_color_set_green_float (CoglColor *color,
|
||||
*
|
||||
* since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_set_blue_float (CoglColor *color,
|
||||
float blue);
|
||||
|
||||
@@ -416,7 +417,7 @@ cogl_color_set_blue_float (CoglColor *color,
|
||||
*
|
||||
* since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_set_alpha_float (CoglColor *color,
|
||||
float alpha);
|
||||
|
||||
@@ -429,7 +430,7 @@ cogl_color_set_alpha_float (CoglColor *color,
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_set_red (CoglColor *color,
|
||||
float red);
|
||||
|
||||
@@ -442,7 +443,7 @@ cogl_color_set_red (CoglColor *color,
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_set_green (CoglColor *color,
|
||||
float green);
|
||||
|
||||
@@ -455,7 +456,7 @@ cogl_color_set_green (CoglColor *color,
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_set_blue (CoglColor *color,
|
||||
float blue);
|
||||
|
||||
@@ -468,7 +469,7 @@ cogl_color_set_blue (CoglColor *color,
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_set_alpha (CoglColor *color,
|
||||
float alpha);
|
||||
|
||||
@@ -482,7 +483,7 @@ cogl_color_set_alpha (CoglColor *color,
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_premultiply (CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -495,7 +496,7 @@ cogl_color_premultiply (CoglColor *color);
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_unpremultiply (CoglColor *color);
|
||||
|
||||
/**
|
||||
@@ -512,7 +513,7 @@ cogl_color_unpremultiply (CoglColor *color);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_color_equal (const void *v1, const void *v2);
|
||||
|
||||
/**
|
||||
@@ -529,7 +530,7 @@ cogl_color_equal (const void *v1, const void *v2);
|
||||
*
|
||||
* Since: 1.16
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_to_hsl (const CoglColor *color,
|
||||
float *hue,
|
||||
float *saturation,
|
||||
@@ -547,7 +548,7 @@ cogl_color_to_hsl (const CoglColor *color,
|
||||
*
|
||||
* Since: 1.16
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_color_init_from_hsl (CoglColor *color,
|
||||
float hue,
|
||||
float saturation,
|
||||
|
@@ -104,15 +104,11 @@ struct _CoglContext
|
||||
GArray *attribute_name_index_map;
|
||||
int n_attribute_names;
|
||||
|
||||
CoglBitmask enabled_builtin_attributes;
|
||||
CoglBitmask enabled_texcoord_attributes;
|
||||
CoglBitmask enabled_custom_attributes;
|
||||
|
||||
/* These are temporary bitmasks that are used when disabling
|
||||
* builtin,texcoord and custom attribute arrays. They are here just
|
||||
* builtin and custom attribute arrays. They are here just
|
||||
* to avoid allocating new ones each time */
|
||||
CoglBitmask enable_builtin_attributes_tmp;
|
||||
CoglBitmask enable_texcoord_attributes_tmp;
|
||||
CoglBitmask enable_custom_attributes_tmp;
|
||||
CoglBitmask changed_bits_tmp;
|
||||
|
||||
@@ -122,10 +118,6 @@ struct _CoglContext
|
||||
CoglMatrix identity_matrix;
|
||||
CoglMatrix y_flip_matrix;
|
||||
|
||||
/* Value that was last used when calling glMatrixMode to avoid
|
||||
calling it multiple times */
|
||||
CoglMatrixMode flushed_matrix_mode;
|
||||
|
||||
/* The matrix stack entries that should be flushed during the next
|
||||
* pipeline state flush */
|
||||
CoglMatrixEntry *current_projection_entry;
|
||||
@@ -236,8 +228,6 @@ struct _CoglContext
|
||||
GLint max_activateable_texture_units;
|
||||
|
||||
/* Fragment processing programs */
|
||||
CoglHandle current_program;
|
||||
|
||||
GLuint current_gl_program;
|
||||
|
||||
gboolean current_gl_dither_enabled;
|
||||
@@ -310,7 +300,7 @@ struct _CoglContext
|
||||
#undef COGL_EXT_END
|
||||
};
|
||||
|
||||
CoglContext *
|
||||
COGL_EXPORT CoglContext *
|
||||
_cogl_context_get_default (void);
|
||||
|
||||
const CoglWinsysVtable *
|
||||
|
@@ -211,7 +211,7 @@ cogl_context_new (CoglDisplay *display,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!context->driver_vtable->context_init (context, error))
|
||||
if (!context->driver_vtable->context_init (context))
|
||||
{
|
||||
cogl_object_unref (display);
|
||||
g_free (context);
|
||||
@@ -252,8 +252,6 @@ cogl_context_new (CoglDisplay *display,
|
||||
cogl_matrix_init_identity (&context->y_flip_matrix);
|
||||
cogl_matrix_scale (&context->y_flip_matrix, 1, -1, 1);
|
||||
|
||||
context->flushed_matrix_mode = COGL_MATRIX_MODELVIEW;
|
||||
|
||||
context->opaque_color_pipeline = cogl_pipeline_new (context);
|
||||
|
||||
context->codegen_header_buffer = g_string_new ("");
|
||||
@@ -284,10 +282,6 @@ cogl_context_new (CoglDisplay *display,
|
||||
context->current_pipeline_changes_since_flush = 0;
|
||||
context->current_pipeline_with_color_attrib = FALSE;
|
||||
|
||||
_cogl_bitmask_init (&context->enabled_builtin_attributes);
|
||||
_cogl_bitmask_init (&context->enable_builtin_attributes_tmp);
|
||||
_cogl_bitmask_init (&context->enabled_texcoord_attributes);
|
||||
_cogl_bitmask_init (&context->enable_texcoord_attributes_tmp);
|
||||
_cogl_bitmask_init (&context->enabled_custom_attributes);
|
||||
_cogl_bitmask_init (&context->enable_custom_attributes_tmp);
|
||||
_cogl_bitmask_init (&context->changed_bits_tmp);
|
||||
@@ -411,10 +405,6 @@ _cogl_context_free (CoglContext *context)
|
||||
g_slist_free (context->atlases);
|
||||
g_hook_list_clear (&context->atlas_reorganize_callbacks);
|
||||
|
||||
_cogl_bitmask_destroy (&context->enabled_builtin_attributes);
|
||||
_cogl_bitmask_destroy (&context->enable_builtin_attributes_tmp);
|
||||
_cogl_bitmask_destroy (&context->enabled_texcoord_attributes);
|
||||
_cogl_bitmask_destroy (&context->enable_texcoord_attributes_tmp);
|
||||
_cogl_bitmask_destroy (&context->enabled_custom_attributes);
|
||||
_cogl_bitmask_destroy (&context->enable_custom_attributes_tmp);
|
||||
_cogl_bitmask_destroy (&context->changed_bits_tmp);
|
||||
|
@@ -99,6 +99,7 @@ G_BEGIN_DECLS
|
||||
*
|
||||
* Returns: a #GType that can be used with the GLib type system.
|
||||
*/
|
||||
COGL_EXPORT
|
||||
GType cogl_context_get_gtype (void);
|
||||
|
||||
/**
|
||||
@@ -113,7 +114,7 @@ GType cogl_context_get_gtype (void);
|
||||
* Since: 1.8
|
||||
* Stability: unstable
|
||||
*/
|
||||
CoglContext *
|
||||
COGL_EXPORT CoglContext *
|
||||
cogl_context_new (CoglDisplay *display,
|
||||
GError **error);
|
||||
|
||||
@@ -132,7 +133,7 @@ cogl_context_new (CoglDisplay *display,
|
||||
* Since: 1.8
|
||||
* Stability: unstable
|
||||
*/
|
||||
CoglDisplay *
|
||||
COGL_EXPORT CoglDisplay *
|
||||
cogl_context_get_display (CoglContext *context);
|
||||
|
||||
/**
|
||||
@@ -151,7 +152,7 @@ cogl_context_get_display (CoglContext *context);
|
||||
* Since: 1.16
|
||||
* Stability: unstable
|
||||
*/
|
||||
CoglRenderer *
|
||||
COGL_EXPORT CoglRenderer *
|
||||
cogl_context_get_renderer (CoglContext *context);
|
||||
|
||||
/**
|
||||
@@ -166,7 +167,7 @@ cogl_context_get_renderer (CoglContext *context);
|
||||
* Since: 1.10
|
||||
* Stability: Unstable
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_is_context (void *object);
|
||||
|
||||
/* XXX: not guarded by the EXPERIMENTAL_API defines to avoid
|
||||
@@ -234,7 +235,7 @@ typedef enum _CoglFeatureID
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_has_feature (CoglContext *context, CoglFeatureID feature);
|
||||
|
||||
/**
|
||||
@@ -254,7 +255,7 @@ cogl_has_feature (CoglContext *context, CoglFeatureID feature);
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_has_features (CoglContext *context, ...);
|
||||
|
||||
/**
|
||||
@@ -283,7 +284,7 @@ typedef void (*CoglFeatureCallback) (CoglFeatureID feature, void *user_data);
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_foreach_feature (CoglContext *context,
|
||||
CoglFeatureCallback callback,
|
||||
void *user_data);
|
||||
@@ -308,7 +309,7 @@ cogl_foreach_feature (CoglContext *context,
|
||||
* Since: 1.14
|
||||
* Stability: unstable
|
||||
*/
|
||||
int64_t
|
||||
COGL_EXPORT int64_t
|
||||
cogl_get_clock_time (CoglContext *context);
|
||||
|
||||
/**
|
||||
@@ -350,7 +351,7 @@ typedef enum _CoglGraphicsResetStatus
|
||||
*
|
||||
* Return value: a #CoglGraphicsResetStatus
|
||||
*/
|
||||
CoglGraphicsResetStatus
|
||||
COGL_EXPORT CoglGraphicsResetStatus
|
||||
cogl_get_graphics_reset_status (CoglContext *context);
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -75,10 +75,12 @@ typedef enum
|
||||
COGL_DEBUG_N_FLAGS
|
||||
} CoglDebugFlags;
|
||||
|
||||
extern GHashTable *_cogl_debug_instances;
|
||||
COGL_EXPORT
|
||||
GHashTable *_cogl_debug_instances;
|
||||
#define COGL_DEBUG_N_LONGS COGL_FLAGS_N_LONGS_FOR_SIZE (COGL_DEBUG_N_FLAGS)
|
||||
|
||||
extern unsigned long _cogl_debug_flags[COGL_DEBUG_N_LONGS];
|
||||
COGL_EXPORT
|
||||
unsigned long _cogl_debug_flags[COGL_DEBUG_N_LONGS];
|
||||
|
||||
#define COGL_DEBUG_ENABLED(flag) \
|
||||
COGL_FLAGS_GET (_cogl_debug_flags, flag)
|
||||
|
@@ -46,3 +46,5 @@
|
||||
#mesondefine COGL_HAS_X11_SUPPORT
|
||||
#mesondefine COGL_HAS_XLIB
|
||||
#mesondefine COGL_HAS_XLIB_SUPPORT
|
||||
|
||||
#mesondefine COGL_HAS_TRACING
|
||||
|
@@ -84,7 +84,7 @@ typedef struct {
|
||||
* Since: 2.0
|
||||
* Stability: Unstable
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_depth_state_init (CoglDepthState *state);
|
||||
|
||||
/**
|
||||
@@ -112,7 +112,7 @@ cogl_depth_state_init (CoglDepthState *state);
|
||||
* Since: 2.0
|
||||
* Stability: Unstable
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_depth_state_set_test_enabled (CoglDepthState *state,
|
||||
gboolean enable);
|
||||
|
||||
@@ -127,7 +127,7 @@ cogl_depth_state_set_test_enabled (CoglDepthState *state,
|
||||
* Since: 2.0
|
||||
* Stability: Unstable
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_depth_state_get_test_enabled (CoglDepthState *state);
|
||||
|
||||
/**
|
||||
@@ -150,7 +150,7 @@ cogl_depth_state_get_test_enabled (CoglDepthState *state);
|
||||
* Since: 2.0
|
||||
* Stability: Unstable
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_depth_state_set_write_enabled (CoglDepthState *state,
|
||||
gboolean enable);
|
||||
|
||||
@@ -165,7 +165,7 @@ cogl_depth_state_set_write_enabled (CoglDepthState *state,
|
||||
* Since: 2.0
|
||||
* Stability: Unstable
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_depth_state_get_write_enabled (CoglDepthState *state);
|
||||
|
||||
/**
|
||||
@@ -186,7 +186,7 @@ cogl_depth_state_get_write_enabled (CoglDepthState *state);
|
||||
* Since: 2.0
|
||||
* Stability: Unstable
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_depth_state_set_test_function (CoglDepthState *state,
|
||||
CoglDepthTestFunction function);
|
||||
|
||||
@@ -201,7 +201,7 @@ cogl_depth_state_set_test_function (CoglDepthState *state,
|
||||
* Since: 2.0
|
||||
* Stability: Unstable
|
||||
*/
|
||||
CoglDepthTestFunction
|
||||
COGL_EXPORT CoglDepthTestFunction
|
||||
cogl_depth_state_get_test_function (CoglDepthState *state);
|
||||
|
||||
/**
|
||||
@@ -235,7 +235,7 @@ cogl_depth_state_get_test_function (CoglDepthState *state);
|
||||
* Since: 2.0
|
||||
* Stability: Unstable
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_depth_state_set_range (CoglDepthState *state,
|
||||
float near_val,
|
||||
float far_val);
|
||||
@@ -253,7 +253,7 @@ cogl_depth_state_set_range (CoglDepthState *state,
|
||||
* Since: 2.0
|
||||
* Stability: Unstable
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_depth_state_get_range (CoglDepthState *state,
|
||||
float *near_val,
|
||||
float *far_val);
|
||||
|
@@ -75,6 +75,7 @@ typedef struct _CoglDisplay CoglDisplay;
|
||||
*
|
||||
* Returns: a #GType that can be used with the GLib type system.
|
||||
*/
|
||||
COGL_EXPORT
|
||||
GType cogl_display_get_gtype (void);
|
||||
|
||||
/**
|
||||
@@ -117,7 +118,7 @@ GType cogl_display_get_gtype (void);
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
CoglDisplay *
|
||||
COGL_EXPORT CoglDisplay *
|
||||
cogl_display_new (CoglRenderer *renderer,
|
||||
CoglOnscreenTemplate *onscreen_template);
|
||||
|
||||
@@ -132,7 +133,7 @@ cogl_display_new (CoglRenderer *renderer,
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
CoglRenderer *
|
||||
COGL_EXPORT CoglRenderer *
|
||||
cogl_display_get_renderer (CoglDisplay *display);
|
||||
|
||||
/**
|
||||
@@ -151,7 +152,7 @@ cogl_display_get_renderer (CoglDisplay *display);
|
||||
* Since: 1.16
|
||||
* Stability: unstable
|
||||
*/
|
||||
void
|
||||
COGL_EXPORT void
|
||||
cogl_display_set_onscreen_template (CoglDisplay *display,
|
||||
CoglOnscreenTemplate *onscreen_template);
|
||||
|
||||
@@ -186,7 +187,7 @@ cogl_display_set_onscreen_template (CoglDisplay *display,
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_display_setup (CoglDisplay *display,
|
||||
GError **error);
|
||||
|
||||
@@ -201,7 +202,7 @@ cogl_display_setup (CoglDisplay *display,
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
COGL_EXPORT gboolean
|
||||
cogl_is_display (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user