Compare commits
458 Commits
gbsneto/gr
...
wip/carlos
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d7f799bfaf | ||
![]() |
09bab98b1e | ||
![]() |
aee8bfce3f | ||
![]() |
92868182c9 | ||
![]() |
08a3cbfc6c | ||
![]() |
59fb26cb00 | ||
![]() |
87c734cef9 | ||
![]() |
c755fb6995 | ||
![]() |
e9cc220c8e | ||
![]() |
92f210039e | ||
![]() |
aef393efd0 | ||
![]() |
6836317e41 | ||
![]() |
61e51cdef6 | ||
![]() |
7868ab761f | ||
![]() |
e6c8939c30 | ||
![]() |
ac5d9ec558 | ||
![]() |
9c8ff5dbe8 | ||
![]() |
7738316dff | ||
![]() |
1c3d8defb5 | ||
![]() |
b2ae03c428 | ||
![]() |
456698c814 | ||
![]() |
9189b7b512 | ||
![]() |
4259cfd4c6 | ||
![]() |
4fdefb5b2e | ||
![]() |
5ca0ef078d | ||
![]() |
a5265365dd | ||
![]() |
62f576e15b | ||
![]() |
73bc3c4426 | ||
![]() |
57772e5850 | ||
![]() |
7c8baf8ed9 | ||
![]() |
0e3c062406 | ||
![]() |
4bc7425332 | ||
![]() |
a2a8f0cdaa | ||
![]() |
faa7b2d4e5 | ||
![]() |
a95644dbdc | ||
![]() |
720f363241 | ||
![]() |
3794df608c | ||
![]() |
2c893beff1 | ||
![]() |
a3c425ad89 | ||
![]() |
1d144486d1 | ||
![]() |
9cd3b07472 | ||
![]() |
6061abbf90 | ||
![]() |
55c084e6e1 | ||
![]() |
45289b3d65 | ||
![]() |
6df34eb4b7 | ||
![]() |
3e68c9e8fa | ||
![]() |
fc0ce11fcd | ||
![]() |
c08a24bb40 | ||
![]() |
78560b8426 | ||
![]() |
0eab73dc2e | ||
![]() |
dd8c8e82f2 | ||
![]() |
62f4e0501f | ||
![]() |
6d8293a422 | ||
![]() |
b80250e483 | ||
![]() |
bd0f1bd338 | ||
![]() |
2439255f32 | ||
![]() |
c327b2df95 | ||
![]() |
9aee47daa9 | ||
![]() |
ecf7e53206 | ||
![]() |
8038eaa99f | ||
![]() |
9bcb50fa09 | ||
![]() |
c17af6c794 | ||
![]() |
4a184d74d5 | ||
![]() |
1f133b3ed2 | ||
![]() |
84616bef27 | ||
![]() |
040de396b2 | ||
![]() |
5a4bc15d0b | ||
![]() |
01e20a6ba9 | ||
![]() |
b0b1ff36ae | ||
![]() |
5ed9abd51a | ||
![]() |
65c5260312 | ||
![]() |
7d9674149f | ||
![]() |
25376b3b3c | ||
![]() |
b86a67c80a | ||
![]() |
7419ab7de5 | ||
![]() |
6b853ffdbd | ||
![]() |
ad220fc025 | ||
![]() |
5bd85ef7e5 | ||
![]() |
73f83f1ab6 | ||
![]() |
5cb6286436 | ||
![]() |
1c25b75571 | ||
![]() |
f2f4af0d50 | ||
![]() |
a8f8bc563e | ||
![]() |
46248748a9 | ||
![]() |
da7372a2fa | ||
![]() |
de97b54595 | ||
![]() |
d7d97f2477 | ||
![]() |
7776941b89 | ||
![]() |
4061c8384b | ||
![]() |
b850f5a732 | ||
![]() |
7645c51c54 | ||
![]() |
f1837b785b | ||
![]() |
22978b9d07 | ||
![]() |
1206879a20 | ||
![]() |
dc5925b7d1 | ||
![]() |
b138006bb7 | ||
![]() |
bca08c2c4e | ||
![]() |
6541d49fe7 | ||
![]() |
c3c6668343 | ||
![]() |
70de90ebce | ||
![]() |
0756fd4636 | ||
![]() |
8c339dac3e | ||
![]() |
06a7c22bcd | ||
![]() |
ca88826ce9 | ||
![]() |
7229a07b6c | ||
![]() |
85f4772a4f | ||
![]() |
f2fb3945d1 | ||
![]() |
d7d75dd8e7 | ||
![]() |
54fe0d311d | ||
![]() |
fefac75e96 | ||
![]() |
5e46940332 | ||
![]() |
1767672375 | ||
![]() |
6fc4cd3c0c | ||
![]() |
feb9d129db | ||
![]() |
2b519cba36 | ||
![]() |
832fc798d5 | ||
![]() |
bd0743a421 | ||
![]() |
20731887f2 | ||
![]() |
980d9b1042 | ||
![]() |
bd7704f9e1 | ||
![]() |
68f18f1fe9 | ||
![]() |
c655166398 | ||
![]() |
e14613e74e | ||
![]() |
f71151a5dd | ||
![]() |
6022b23923 | ||
![]() |
d08763c18c | ||
![]() |
fcb408ad5d | ||
![]() |
51f9e04ef1 | ||
![]() |
2fc7760cee | ||
![]() |
f2d2d473b7 | ||
![]() |
e1f839f48f | ||
![]() |
eccc791f3b | ||
![]() |
6055f04814 | ||
![]() |
0185909ee3 | ||
![]() |
c35e56196a | ||
![]() |
181c7cab32 | ||
![]() |
740a62044e | ||
![]() |
0bf0366933 | ||
![]() |
70bacb9402 | ||
![]() |
57dfe4696d | ||
![]() |
22a91f23ad | ||
![]() |
6aa1026600 | ||
![]() |
75dff3e7c9 | ||
![]() |
bea7600471 | ||
![]() |
8932388dda | ||
![]() |
2238c9f180 | ||
![]() |
ca21ca6745 | ||
![]() |
2bbd2e5563 | ||
![]() |
691d58e69b | ||
![]() |
d84c7269b2 | ||
![]() |
aba689312f | ||
![]() |
f2d9a11013 | ||
![]() |
596376c408 | ||
![]() |
1f62a8dbd9 | ||
![]() |
f59d62bc8f | ||
![]() |
5d5d296551 | ||
![]() |
065bf752f4 | ||
![]() |
4d3e804391 | ||
![]() |
15a2ccd21b | ||
![]() |
fef5753a19 | ||
![]() |
f3fd7cf92b | ||
![]() |
5c500ad402 | ||
![]() |
e7fd068a78 | ||
![]() |
171e5fc3c2 | ||
![]() |
7b7d881386 | ||
![]() |
44905d96da | ||
![]() |
73e8127d5d | ||
![]() |
11e2005563 | ||
![]() |
02fc0b4533 | ||
![]() |
36155f72d0 | ||
![]() |
c63d0173b5 | ||
![]() |
7fcdd60ac5 | ||
![]() |
a8984a81c2 | ||
![]() |
769a02b630 | ||
![]() |
576330edce | ||
![]() |
a2a114e79c | ||
![]() |
79e22853ea | ||
![]() |
be72b22964 | ||
![]() |
2464f00902 | ||
![]() |
9b5d9f3cb3 | ||
![]() |
088117a619 | ||
![]() |
4a19628829 | ||
![]() |
0cd54c5735 | ||
![]() |
cc2c670a5e | ||
![]() |
769a01f4e9 | ||
![]() |
9c1afbbb67 | ||
![]() |
376725e30e | ||
![]() |
b836e661cf | ||
![]() |
446e82e86d | ||
![]() |
f2020913fd | ||
![]() |
d9fb11b043 | ||
![]() |
56ddaaa380 | ||
![]() |
1efb32d300 | ||
![]() |
6dba56223a | ||
![]() |
2ff6beea35 | ||
![]() |
689c7f4107 | ||
![]() |
59bf1f4838 | ||
![]() |
db0f85ba5d | ||
![]() |
425611eadf | ||
![]() |
9213574870 | ||
![]() |
3073acc3b0 | ||
![]() |
a61d525111 | ||
![]() |
4064d9a7a7 | ||
![]() |
8a06cfdd81 | ||
![]() |
d3e789e677 | ||
![]() |
c24d8e856b | ||
![]() |
9db9793f33 | ||
![]() |
c237bc5f45 | ||
![]() |
178b975d6a | ||
![]() |
4abca411f3 | ||
![]() |
e48c7c009a | ||
![]() |
36b361617d | ||
![]() |
5eac1d696d | ||
![]() |
9b53583945 | ||
![]() |
1dbf25afa1 | ||
![]() |
e415cc538a | ||
![]() |
67a3715ded | ||
![]() |
35aa278194 | ||
![]() |
a76762a05e | ||
![]() |
ccf27e5f83 | ||
![]() |
912a9ecfba | ||
![]() |
0487d672ed | ||
![]() |
e94a0fced9 | ||
![]() |
a3b86447f7 | ||
![]() |
1d76eace1e | ||
![]() |
c1303bd642 | ||
![]() |
db11a37a68 | ||
![]() |
0d0b9da6f8 | ||
![]() |
ab0b407da4 | ||
![]() |
c33b330799 | ||
![]() |
144b24bfcc | ||
![]() |
4d21650d6d | ||
![]() |
a6fc656e91 | ||
![]() |
a38bae259e | ||
![]() |
c53aa89098 | ||
![]() |
851b7d0639 | ||
![]() |
b4c78726cf | ||
![]() |
c9cc07fd3a | ||
![]() |
f6eb2a8cf8 | ||
![]() |
08e5589836 | ||
![]() |
4f5a5e84fc | ||
![]() |
0786683189 | ||
![]() |
4887de533c | ||
![]() |
57945a730f | ||
![]() |
78254146f3 | ||
![]() |
3e2a2cf532 | ||
![]() |
04b240b50c | ||
![]() |
7810f0e276 | ||
![]() |
9b8f9b65b8 | ||
![]() |
e741cab3f4 | ||
![]() |
53748e3da7 | ||
![]() |
17c5436f6e | ||
![]() |
04fb6f7659 | ||
![]() |
e5e58f8075 | ||
![]() |
1da0355528 | ||
![]() |
e5881156f6 | ||
![]() |
60170cff70 | ||
![]() |
e2bea48073 | ||
![]() |
bbfaf8204b | ||
![]() |
b3e19ee669 | ||
![]() |
75e2bfb062 | ||
![]() |
a859d76c72 | ||
![]() |
2145333969 | ||
![]() |
1b61b9cd73 | ||
![]() |
a2c545c321 | ||
![]() |
3cd8f3b7dc | ||
![]() |
033ce2d956 | ||
![]() |
2b47e89405 | ||
![]() |
80d11287eb | ||
![]() |
f869e4d54b | ||
![]() |
c1059df7f9 | ||
![]() |
e3d3df985f | ||
![]() |
86ff3dfb3c | ||
![]() |
7e0d185120 | ||
![]() |
61c173b777 | ||
![]() |
f99cd18254 | ||
![]() |
0405786573 | ||
![]() |
b016ff29f6 | ||
![]() |
3f2e86f67c | ||
![]() |
0aa4a526c6 | ||
![]() |
85c2aef4bc | ||
![]() |
76664ef891 | ||
![]() |
b1ea768949 | ||
![]() |
ea9d8a895b | ||
![]() |
38432da328 | ||
![]() |
430f354cd9 | ||
![]() |
1cf4279745 | ||
![]() |
7713006f5b | ||
![]() |
465e13128b | ||
![]() |
86de79cfc5 | ||
![]() |
1d77641f0b | ||
![]() |
2f217109aa | ||
![]() |
5e0523cc8b | ||
![]() |
dbe6e01e12 | ||
![]() |
103c469cc9 | ||
![]() |
ef074ea510 | ||
![]() |
39bac6eabd | ||
![]() |
0200f4fcd9 | ||
![]() |
439afb3f19 | ||
![]() |
b01edc22f3 | ||
![]() |
e8bca5052a | ||
![]() |
468882ecec | ||
![]() |
be3c89d823 | ||
![]() |
7719e33e68 | ||
![]() |
deef9960a4 | ||
![]() |
9305b6d8ee | ||
![]() |
62de4b4f82 | ||
![]() |
ea0a89bde8 | ||
![]() |
4faeb12731 | ||
![]() |
91ac64bb44 | ||
![]() |
ed56edc7ba | ||
![]() |
6eeba2434a | ||
![]() |
7fb7b28cd6 | ||
![]() |
08aec58c22 | ||
![]() |
52945f383d | ||
![]() |
fecc57ddf0 | ||
![]() |
0d7a929b83 | ||
![]() |
991f9505ad | ||
![]() |
358b67871f | ||
![]() |
2b1acea1b0 | ||
![]() |
91aee3d5c4 | ||
![]() |
02812fb988 | ||
![]() |
29211c9020 | ||
![]() |
68fba458b3 | ||
![]() |
9c2fdcdbb2 | ||
![]() |
d4a0893d76 | ||
![]() |
7a6c755833 | ||
![]() |
45244852ac | ||
![]() |
e96136e418 | ||
![]() |
eae6e7a889 | ||
![]() |
a48b6cc9ca | ||
![]() |
786305f7d6 | ||
![]() |
30a2483e6e | ||
![]() |
f5f0aa1023 | ||
![]() |
b86fba2f3c | ||
![]() |
f7ecf3b618 | ||
![]() |
7a17e236f7 | ||
![]() |
df7d8e2cbf | ||
![]() |
9e82f9af25 | ||
![]() |
329c4bc5b3 | ||
![]() |
706c5a7565 | ||
![]() |
24b3467584 | ||
![]() |
9e0e35d2a7 | ||
![]() |
dae2c1d420 | ||
![]() |
01d0316fd7 | ||
![]() |
7e2a0ede16 | ||
![]() |
7738b5c00b | ||
![]() |
454651f79f | ||
![]() |
bf8bc65cc9 | ||
![]() |
6a89e7969f | ||
![]() |
3ffc4f8876 | ||
![]() |
b4d973fbe4 | ||
![]() |
da1e917b38 | ||
![]() |
160d2d56d9 | ||
![]() |
3468144847 | ||
![]() |
ae6d9e35bd | ||
![]() |
ac15a8abca | ||
![]() |
5480a3f238 | ||
![]() |
0d50a37091 | ||
![]() |
1ca0fdc928 | ||
![]() |
23a8ea2821 | ||
![]() |
ee4bb2240b | ||
![]() |
81ae886dda | ||
![]() |
63c40a9711 | ||
![]() |
8374be46d2 | ||
![]() |
5d1a87d355 | ||
![]() |
34312c272b | ||
![]() |
2b8f5e65b6 | ||
![]() |
a934fa07b8 | ||
![]() |
c6d1cf4af4 | ||
![]() |
8dbe4210b4 | ||
![]() |
02c99524bf | ||
![]() |
17d00d49d4 | ||
![]() |
634f512bb0 | ||
![]() |
5c009c20ab | ||
![]() |
535ce00abb | ||
![]() |
37144f0609 | ||
![]() |
ab76576340 | ||
![]() |
09aa82db49 | ||
![]() |
c95db7c542 | ||
![]() |
a984622cd1 | ||
![]() |
156980eff9 | ||
![]() |
736cac43e9 | ||
![]() |
3ba79961fe | ||
![]() |
7718e67f5c | ||
![]() |
ba8f5a1178 | ||
![]() |
502da973eb | ||
![]() |
eccf7b105c | ||
![]() |
bcee890434 | ||
![]() |
251fa024c4 | ||
![]() |
471b61bd14 | ||
![]() |
7df86fb246 | ||
![]() |
3f29b47809 | ||
![]() |
9ab3a02a8a | ||
![]() |
ca2be8ef5b | ||
![]() |
1783ea5af1 | ||
![]() |
862e56f01d | ||
![]() |
2b9cd50e84 | ||
![]() |
e71f44dbd6 | ||
![]() |
c881b4970d | ||
![]() |
d79f176142 | ||
![]() |
ce6acf9dca | ||
![]() |
2a15e5f16a | ||
![]() |
fb40e2eefb | ||
![]() |
fc09fa50a5 | ||
![]() |
48f04c7968 | ||
![]() |
007297f1a6 | ||
![]() |
302a171c08 | ||
![]() |
893e894fff | ||
![]() |
2aaed7bdfc | ||
![]() |
249f9a4a2e | ||
![]() |
68166f33d9 | ||
![]() |
28954e8271 | ||
![]() |
22884b0b00 | ||
![]() |
d2415da0d4 | ||
![]() |
96f7bf28f1 | ||
![]() |
db486ad897 | ||
![]() |
8180927de2 | ||
![]() |
191c31b0f0 | ||
![]() |
a94841abf1 | ||
![]() |
b624e94ab1 | ||
![]() |
e3f3274bbf | ||
![]() |
d2ca5cc26b | ||
![]() |
3de6f7ebfe | ||
![]() |
38ff01d6d0 | ||
![]() |
40103d6f41 | ||
![]() |
ab7ef5f8bf | ||
![]() |
2c1a951b6e | ||
![]() |
6ec330ccfa | ||
![]() |
20c1295a33 | ||
![]() |
fa4a787386 | ||
![]() |
85b734fde8 | ||
![]() |
28419cdedf | ||
![]() |
3b46a8cd70 | ||
![]() |
b2d0184c6e | ||
![]() |
808a75b231 | ||
![]() |
88e4ff7409 | ||
![]() |
3cc3b7526c | ||
![]() |
53b59d8bff | ||
![]() |
40e7e5d356 | ||
![]() |
4cae9b5b11 | ||
![]() |
72aeeb8c37 | ||
![]() |
7b3dee2d97 | ||
![]() |
5199c7834d | ||
![]() |
afe8610b4a | ||
![]() |
9d49e8abd0 | ||
![]() |
4043d0b455 | ||
![]() |
34ee46022e | ||
![]() |
ee507d9ab2 | ||
![]() |
28e0a7bfb5 | ||
![]() |
58f7059ea4 | ||
![]() |
d15e11bfe7 | ||
![]() |
1eabaf12da | ||
![]() |
fe86694ddd | ||
![]() |
a1969c98cd | ||
![]() |
47663c7e0f | ||
![]() |
9843e21fff | ||
![]() |
5c27bf6a2b |
@@ -1,4 +1,4 @@
|
||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v1
|
||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v2
|
||||
|
||||
stages:
|
||||
- review
|
||||
@@ -7,6 +7,8 @@ stages:
|
||||
|
||||
check-commit-log:
|
||||
stage: review
|
||||
variables:
|
||||
GIT_DEPTH: "100"
|
||||
script:
|
||||
- ./.gitlab-ci/check-commit-log.sh
|
||||
only:
|
||||
@@ -15,7 +17,21 @@ check-commit-log:
|
||||
build-mutter:
|
||||
stage: build
|
||||
script:
|
||||
- meson . build -Dbuildtype=debugoptimized -Degl_device=true -Dwayland_eglstream=true --werror
|
||||
- meson . build -Dbuildtype=debugoptimized -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:
|
||||
stage: build
|
||||
script:
|
||||
- meson . build -Dbuildtype=debugoptimized -Dnative_backend=false -Dudev=false --werror --prefix /usr
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
artifacts:
|
||||
@@ -33,12 +49,31 @@ test-mutter:
|
||||
variables:
|
||||
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
|
||||
GSETTINGS_SCHEMA_DIR: "$CI_PROJECT_DIR/build/data"
|
||||
G_SLICE: "always-malloc"
|
||||
MALLOC_CHECK_: "3"
|
||||
NO_AT_BRIDGE: "1"
|
||||
MALLOC_PERTURB_: "123"
|
||||
script:
|
||||
- dconf update
|
||||
- mkdir -m 700 $XDG_RUNTIME_DIR
|
||||
- glib-compile-schemas $GSETTINGS_SCHEMA_DIR
|
||||
- >
|
||||
dbus-run-session -- xvfb-run -s '+iglx -noreset'
|
||||
meson test -C build --no-rebuild -t 10 --verbose --no-stdsplit --wrap catchsegv
|
||||
meson test -C build --no-rebuild -t 10 --verbose --no-stdsplit --print-errorlogs --wrap catchsegv
|
||||
only:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
||||
can-build-gnome-shell:
|
||||
stage: test
|
||||
dependencies:
|
||||
- build-mutter
|
||||
before_script:
|
||||
- meson install --no-rebuild -C build
|
||||
script:
|
||||
- .gitlab-ci/checkout-gnome-shell.sh
|
||||
- meson gnome-shell gnome-shell/build --prefix /usr
|
||||
- ninja -C gnome-shell/build install
|
||||
only:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
@@ -1,17 +1,37 @@
|
||||
FROM fedora:29
|
||||
# Rebuild and push with
|
||||
#
|
||||
# cd .gitlab-ci/
|
||||
# docker build -t registry.gitlab.gnome.org/gnome/mutter/master:v2 .
|
||||
# docker push registry.gitlab.gnome.org/gnome/mutter/master:v2
|
||||
#
|
||||
|
||||
FROM fedora:30
|
||||
|
||||
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 copr enable -y hergertme/sysprof-3 && \
|
||||
|
||||
dnf builddep -y mutter && \
|
||||
|
||||
# Until Fedora catches up with meson build-deps
|
||||
dnf install -y meson xorg-x11-server-Xorg gnome-settings-daemon-devel egl-wayland-devel xorg-x11-server-Xwayland graphene-devel && \
|
||||
dnf install -y meson xorg-x11-server-Xorg gnome-settings-daemon-devel egl-wayland-devel xorg-x11-server-Xwayland && \
|
||||
|
||||
# Until Fedora catches up with mesa bug fixes
|
||||
dnf upgrade -y mesa-dri-drivers mesa-libEGL && \
|
||||
|
||||
# For running unit tests
|
||||
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 && \
|
||||
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 '*/xvfb-run' gdm-lib accountsservice-libs && \
|
||||
|
||||
# Unpackaged versions
|
||||
dnf install -y https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00834984-gsettings-desktop-schemas/gsettings-desktop-schemas-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00834984-gsettings-desktop-schemas/gsettings-desktop-schemas-devel-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm && \
|
||||
dnf install -y sysprof-devel && \
|
||||
|
||||
dnf install -y intltool redhat-rpm-config make && \
|
||||
|
||||
# GNOME Shell
|
||||
dnf builddep -y gnome-shell --setopt=install_weak_deps=False && \
|
||||
dnf remove -y gnome-bluetooth-libs-devel dbus-glib-devel upower-devel python3-devel && \
|
||||
dnf remove -y --noautoremove mutter mutter-devel && \
|
||||
|
||||
dnf clean all
|
||||
|
@@ -23,9 +23,35 @@ function commit_message_has_url() {
|
||||
return $?
|
||||
}
|
||||
|
||||
function commit_message_subject_is_compliant() {
|
||||
commit=$1
|
||||
commit_message_subject=$(git show -s --format='format:%s' $commit)
|
||||
|
||||
if echo "$commit_message_subject" | grep -qe "\(^meta-\|^Meta\)"; then
|
||||
echo " - message subject should not be prefixed with 'meta-' or 'Meta'"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if echo "$commit_message_subject" | grep -qe "\.[ch]:"; then
|
||||
echo " - message subject prefix should not include .c, .h, etc."
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
for commit in $commits; do
|
||||
commit_short=$(echo $commit | cut -c -8)
|
||||
|
||||
if ! commit_message_has_url $commit; then
|
||||
echo "Missing merge request or issue URL on commit $(echo $commit | cut -c -8)"
|
||||
echo "Missing merge request or issue URL on commit $commit_short"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
errors=$(commit_message_subject_is_compliant $commit)
|
||||
if [ $? != 0 ]; then
|
||||
echo "Commit message for $commit_short is not compliant:"
|
||||
echo "$errors"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
35
.gitlab-ci/checkout-gnome-shell.sh
Executable file
35
.gitlab-ci/checkout-gnome-shell.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
mutter_branch=$(git describe --contains --all HEAD)
|
||||
gnome_shell_target=
|
||||
|
||||
git clone https://gitlab.gnome.org/GNOME/gnome-shell.git
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo Checkout failed
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd gnome-shell
|
||||
|
||||
if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ]; then
|
||||
merge_request_remote=${CI_MERGE_REQUEST_SOURCE_PROJECT_URL//mutter/gnome-shell}
|
||||
merge_request_branch=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
|
||||
|
||||
echo Looking for $merge_request_branch on remote ...
|
||||
if git fetch -q $merge_request_remote $merge_request_branch 2>/dev/null; then
|
||||
gnome_shell_target=FETCH_HEAD
|
||||
else
|
||||
gnome_shell_target=origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
|
||||
echo Using $gnome_shell_target instead
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$gnome_shell_target" ]; then
|
||||
gnome_shell_target=$(git branch -r -l origin/$mutter_branch)
|
||||
gnome_shell_target=${gnome_shell_target:-$(git branch -r -l ${mutter_branch#remotes/})}
|
||||
gnome_shell_target=${gnome_shell_target:-origin/master}
|
||||
echo Using $gnome_shell_target instead
|
||||
fi
|
||||
|
||||
git checkout -q $gnome_shell_target
|
136
NEWS
136
NEWS
@@ -1,3 +1,139 @@
|
||||
3.33.4
|
||||
======
|
||||
* Discard page flip retries on hotplug [Jonas; !630]
|
||||
* Add xdg-output v2 support [Olivier; #645]
|
||||
* Restore DRM format fallbacks [Jonas; !662]
|
||||
* Don't emit ::size-changed when only position changed [Daniel; !568]
|
||||
* Expose workspace layout properties [Florian; !618]
|
||||
* Don't use grab modifiers when shortcuts are inhibited [Olivier; #642]
|
||||
* Fix stuttering due to unchanged power save mode notifications [Georges; !674]
|
||||
* Add API to reorder workspaces [Adam; !670]
|
||||
* Make picking a new focus window more reliable [Marco; !669]
|
||||
* Defer actor allocation till shown [Carlos; !677]
|
||||
* Try to use primary GPU for copy instead of glReadPixels [Pekka; !615]
|
||||
* Unset pointer focus when the cursor is hidden [Jonas D.; !448]
|
||||
* Fix modifier-drag on wayland subsurfaces [Robert; !604]
|
||||
* Fix background corruption on Nvidia after resuming from suspend [Daniel; !600]
|
||||
* Only grab the locate-pointer key when necessary [Olivier; !685, #647]
|
||||
* Misc. bug fixes and cleanups [Florian, Jonas, Daniel, Robert, Olivier,
|
||||
Georges, Marco, Carlos, Emmanuele; !648, !650, !647, !656, !658, !637,
|
||||
!663, !660, !659, !665, !666, !668, !667, #667, !676, !678, #672, !680,
|
||||
!683, !688, !689, !687]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Emmanuele Bassi, Adam Bieńkowski, Piotr Drąg, Jonas Dreßler,
|
||||
Olivier Fourdan, Carlos Garnacho, Robert Mader, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Pekka Paalanen, Marco Trevisan (Treviño),
|
||||
Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Fabio Tomat [fur], Kukuh Syafaat [id]
|
||||
|
||||
3.33.3
|
||||
======
|
||||
* Prepare for running Xwayland on demand [Carlos; !420]
|
||||
* Fix text selection color rendering [Florian; #494]
|
||||
* Fix black shadows when using fractional scaling [Robert; #609]
|
||||
* Honor startup sequence workspace on wayland [Carlos; gnome-shell#674]
|
||||
* Only emit 'grab-op-end` signal after dropping grabs [Marco; !596]
|
||||
* Add a Sysprof-based profiler [Jonas, Georges; !197, !603]
|
||||
* Relax "xwayland-allow-grabs" setting [Olivier; #597]
|
||||
* Implement locate-pointer accessibility feature [Olivier; !453]
|
||||
* Implement mouse accessibility [Olivier; !512]
|
||||
* Consolidate frame throttling [Daniel, Georges; !363]
|
||||
* Fix setting blank cursor under wayland [Jonas; #630]
|
||||
* Pixel-align OpenGL cursors [Jonas; !610]
|
||||
* Handle returning from fullscreen/maximization better [Jonas; !621]
|
||||
* Improve screencast support on multi-monitor systems [Georges; !623]
|
||||
* Fix running X11 applications with sudo under wayland [Hans; #643]
|
||||
* Implement toggle-keys notification [Olivier; #637]
|
||||
* Add initial KMS transactional support [Jonas; !525]
|
||||
* Improve finding new focus window when the old one is closed [Marco; #308]
|
||||
* Misc. bug fixes and cleanups [Jonas, Carlos, Marco, Florian, Pekka, Robert,
|
||||
Douglas, Georges, Daniel, Emil, Niels, Hans, Olivier, Ting-Wei, Corentin;
|
||||
!591, #398, !592, !581, !597, !598, !593, !497, #591, !545, gtk#1675, !601,
|
||||
#568, !564, !605, !609, !115, !214, !611, !617, !616, !619, !624, !622, !627,
|
||||
!628, !629, !632, !633, !631, !636, !639, !638, !634, !640, !529, !644, !590]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Piotr Drąg, Olivier Fourdan, Carlos Garnacho, Hans de Goede,
|
||||
Niels De Graef, Ting-Wei Lan, Robert Mader, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Corentin Noël, Pekka Paalanen, Douglas R. Reno,
|
||||
Marco Trevisan (Treviño), Emil Velikov, Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Balázs Úr [hu], Daniel Mustieles [es], Nathan Follens [nl], Goran Vidović [hr]
|
||||
|
||||
3.33.2
|
||||
======
|
||||
* Fix rendering lag on Xorg [Daniel; !520, !281]
|
||||
* Misc. bug fixes and cleanups [Carlos, Marco, Jonas D., Florian, Niels,
|
||||
Daniel, Benjamin, Jonas Å., Ignacio, Vasilis; #598, !576, !547, !578,
|
||||
!583, !582, !469, !524, !119, !571, !584, !585, !586, #425]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Benjamin Berg, Jonas Dreßler, Carlos Garnacho, Niels De Graef,
|
||||
Vasilis Liaskovitis, Florian Müllner, Ignacio Casal Quinteiro,
|
||||
Marco Trevisan (Treviño), Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Daniel Mustieles [es]
|
||||
|
||||
3.33.1
|
||||
======
|
||||
* Remove unused APIs and outdated driver support
|
||||
[Adam; !481, !468, !489, !487, !546]
|
||||
* Enable EGL_IMG_context_priority [Adam; !454]
|
||||
* Disable mouse keys with Numlock on [Olivier; #530]
|
||||
* Fix crash when restarting on X11 [Marco; #576]
|
||||
* Implement clipboard manager [Carlos; !320]
|
||||
* Fix spurious idle signals that prevent session unblank [Jonas Å.; !543]
|
||||
* Fix mapping of touchscreens that don't report dimensions [Carlos; #581]
|
||||
* Fix propagating fractional scaling factor [Robert; !537]
|
||||
* Add experimental RT scheduling support [Carlos; !460]
|
||||
* Misc. bug fixes and cleanups [Robert, Carlos, Olivier, Ray, Marco, Jonas D.,
|
||||
Georges, Daniel V., Daniel M; !467, !504, !551, !552, #575, #556, !557, !442,
|
||||
!562, !535, !548, #586, !567, !396, !422, !507]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Piotr Drąg, Jonas Dreßler, Olivier Fourdan, Carlos Garnacho,
|
||||
Adam Jackson, Robert Mader, Daniel García Moreno, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Ray Strode, Marco Trevisan (Treviño),
|
||||
Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Daniel Mustieles [es], Fabio Tomat [fur], Kukuh Syafaat [id]
|
||||
|
||||
3.32.1
|
||||
======
|
||||
* Fix fallback app menu on wayland [Florian; #493]
|
||||
* Fix elogind support [Tom; !491]
|
||||
* Fix startup notifications not timing out [Carlos; #501]
|
||||
* Fix keyboard accessibility toggle from keys
|
||||
[Olivier, Carlos; !501, #529, !531]
|
||||
* Fix touchscreen input on rotated displays [Carlos; #514]
|
||||
* Work around hangul text input bug [Carlos; #1365]
|
||||
* Fix blurry wallpaper scaling [Daniel; !505]
|
||||
* Fix placement of window menu when using fractional scaling [Jan; #527]
|
||||
* Fix repaint issues of offscreen effects on secondary monitors [Daniel; !511]
|
||||
* Fix windows not getting focus after launch [Daniel; #505]
|
||||
* Properly advertise support for 'underscan' property [Jonas; !507]
|
||||
* Improve power-saving handling [Jonas; !506]
|
||||
* Fix moving windows by super+touch [Jonas D.; !495]
|
||||
* Misc. bug fixes and cleanups [Benjamin, Florian, Adam, Marco, Pablo,
|
||||
Erik, Jonas, Heiher, Pekka, Daniel, Olivier, Carlos; !478, !475, !480,
|
||||
!482, #490, !488, #491, #480, !477, !496, !492, !485, !515, !519, !521,
|
||||
!216, !538, #541, #523]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Pablo Barciela, Benjamin Berg, Tom Briden, Jonas Dreßler,
|
||||
Olivier Fourdan, Carlos Garnacho, Jan Alexander Steffens (heftig), Heiher,
|
||||
Adam Jackson, Erik Kurzinger, Florian Müllner, Pekka Paalanen,
|
||||
Marco Trevisan (Treviño), Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Khaled Hosny [ar], Goran Vidović [hr], Daniel Mustieles [es]
|
||||
|
||||
3.32.0
|
||||
======
|
||||
* Fix deadlock when cancelling a theme sound [Andrea; !474]
|
||||
|
@@ -657,7 +657,7 @@ cally_actor_get_extents (AtkComponent *component,
|
||||
ClutterActor *actor = NULL;
|
||||
gint top_level_x, top_level_y;
|
||||
gfloat f_width, f_height;
|
||||
graphene_point3d_t verts[4];
|
||||
ClutterVertex verts[4];
|
||||
ClutterActor *stage = NULL;
|
||||
|
||||
g_return_if_fail (CALLY_IS_ACTOR (component));
|
||||
@@ -1044,10 +1044,8 @@ _cally_actor_clean_action_list (CallyActor *cally_actor)
|
||||
|
||||
if (priv->action_list)
|
||||
{
|
||||
g_list_foreach (priv->action_list,
|
||||
(GFunc) _cally_actor_destroy_action_info,
|
||||
NULL);
|
||||
g_list_free (priv->action_list);
|
||||
g_list_free_full (priv->action_list,
|
||||
(GDestroyNotify) _cally_actor_destroy_action_info);
|
||||
priv->action_list = NULL;
|
||||
}
|
||||
}
|
||||
|
@@ -1438,7 +1438,7 @@ static void cally_text_get_character_extents (AtkText *text,
|
||||
PangoLayout *layout;
|
||||
PangoRectangle extents;
|
||||
const gchar *text_value;
|
||||
graphene_point3d_t verts[4];
|
||||
ClutterVertex verts[4];
|
||||
|
||||
actor = CALLY_GET_CLUTTER_ACTOR (text);
|
||||
if (actor == NULL) /* State is defunct */
|
||||
@@ -2294,7 +2294,7 @@ _cally_misc_get_index_at_point (ClutterText *clutter_text,
|
||||
gint index, x_window, y_window, x_toplevel, y_toplevel;
|
||||
gint x_temp, y_temp;
|
||||
gboolean ret;
|
||||
graphene_point3d_t verts[4];
|
||||
ClutterVertex verts[4];
|
||||
PangoLayout *layout;
|
||||
gint x_layout, y_layout;
|
||||
|
||||
|
@@ -340,7 +340,7 @@ clutter_actor_box_contains (const ClutterActorBox *box,
|
||||
/**
|
||||
* clutter_actor_box_from_vertices:
|
||||
* @box: a #ClutterActorBox
|
||||
* @verts: (array fixed-size=4): array of four #graphene_point3d_t
|
||||
* @verts: (array fixed-size=4): array of four #ClutterVertex
|
||||
*
|
||||
* Calculates the bounding box represented by the four vertices; for details
|
||||
* of the vertex array see clutter_actor_get_abs_allocation_vertices().
|
||||
@@ -349,7 +349,7 @@ clutter_actor_box_contains (const ClutterActorBox *box,
|
||||
*/
|
||||
void
|
||||
clutter_actor_box_from_vertices (ClutterActorBox *box,
|
||||
const graphene_point3d_t verts[])
|
||||
const ClutterVertex verts[])
|
||||
{
|
||||
gfloat x_1, x_2, y_1, y_2;
|
||||
|
||||
|
@@ -577,8 +577,7 @@ _clutter_meta_group_clear_metas (ClutterMetaGroup *group)
|
||||
{
|
||||
g_list_foreach (group->meta, (GFunc) _clutter_actor_meta_set_actor, NULL);
|
||||
|
||||
g_list_foreach (group->meta, (GFunc) g_object_unref, NULL);
|
||||
g_list_free (group->meta);
|
||||
g_list_free_full (group->meta, g_object_unref);
|
||||
group->meta = NULL;
|
||||
}
|
||||
|
||||
|
@@ -135,7 +135,7 @@ struct _AnchorCoord
|
||||
} fraction;
|
||||
|
||||
/* Use when is_fractional == FALSE */
|
||||
graphene_point3d_t units;
|
||||
ClutterVertex units;
|
||||
} v;
|
||||
};
|
||||
|
||||
@@ -163,7 +163,7 @@ struct _SizeRequest
|
||||
struct _ClutterLayoutInfo
|
||||
{
|
||||
/* fixed position coordinates */
|
||||
graphene_point_t fixed_pos;
|
||||
ClutterPoint fixed_pos;
|
||||
|
||||
ClutterMargin margin;
|
||||
|
||||
@@ -173,8 +173,8 @@ struct _ClutterLayoutInfo
|
||||
guint x_expand : 1;
|
||||
guint y_expand : 1;
|
||||
|
||||
graphene_size_t minimum;
|
||||
graphene_size_t natural;
|
||||
ClutterSize minimum;
|
||||
ClutterSize natural;
|
||||
};
|
||||
|
||||
const ClutterLayoutInfo * _clutter_actor_get_layout_info_or_defaults (ClutterActor *self);
|
||||
@@ -203,13 +203,13 @@ struct _ClutterTransformInfo
|
||||
AnchorCoord anchor;
|
||||
|
||||
/* translation */
|
||||
graphene_point3d_t translation;
|
||||
ClutterVertex translation;
|
||||
|
||||
/* z_position */
|
||||
gfloat z_position;
|
||||
|
||||
/* transformation center */
|
||||
graphene_point_t pivot;
|
||||
ClutterPoint pivot;
|
||||
gfloat pivot_z;
|
||||
|
||||
CoglMatrix transform;
|
||||
|
@@ -36,15 +36,15 @@
|
||||
* or clutter_actor_set_rotation(). The order in which the transformations are
|
||||
* applied is decided by Clutter and it is the following:
|
||||
*
|
||||
* 1. negative translation by the actor's #ClutterActor:pivot-point
|
||||
* 2. negative translation by the #ClutterActor:anchor-x and #ClutterActor:anchor-y point.
|
||||
* 3. rotation around the #ClutterActor:rotation-angle-z and #ClutterActor:rotation-center-z
|
||||
* 4. rotation around the #ClutterActor:rotation-angle-y and #ClutterActor:rotation-center-y
|
||||
* 1. translation by the origin of the #ClutterActor:allocation property
|
||||
* 2. translation by the actor's #ClutterActor:z-position property
|
||||
* 3. translation by the actor's #ClutterActor:pivot-point property
|
||||
* 4. scaling by the #ClutterActor:scale-x and #ClutterActor:scale-y factors
|
||||
* 5. rotation around the #ClutterActor:rotation-angle-x and #ClutterActor:rotation-center-x
|
||||
* 6. scaling by the #ClutterActor:scale-x and #ClutterActor:scale-y factors
|
||||
* 7. translation by the actor's #ClutterActor:pivot-point property
|
||||
* 8. translation by the actor's #ClutterActor:z-position property
|
||||
* 9. translation by the origin of the #ClutterActor:allocation property
|
||||
* 6. rotation around the #ClutterActor:rotation-angle-y and #ClutterActor:rotation-center-y
|
||||
* 7. rotation around the #ClutterActor:rotation-angle-z and #ClutterActor:rotation-center-z
|
||||
* 8. negative translation by the #ClutterActor:anchor-x and #ClutterActor:anchor-y point.
|
||||
* 9. negative translation by the actor's #ClutterActor:pivot-point
|
||||
*
|
||||
* ## Modifying an actor's geometry ## {#clutter-actor-geometry}
|
||||
*
|
||||
@@ -694,7 +694,7 @@ struct _ClutterActorPrivate
|
||||
ClutterAllocationFlags allocation_flags;
|
||||
|
||||
/* clip, in actor coordinates */
|
||||
graphene_rect_t clip;
|
||||
ClutterRect clip;
|
||||
|
||||
/* the cached transformation matrix; see apply_transform() */
|
||||
CoglMatrix transform;
|
||||
@@ -807,6 +807,9 @@ struct _ClutterActorPrivate
|
||||
gpointer create_child_data;
|
||||
GDestroyNotify create_child_notify;
|
||||
|
||||
guint resolution_changed_id;
|
||||
guint font_changed_id;
|
||||
|
||||
/* bitfields: KEEP AT THE END */
|
||||
|
||||
/* fixed position and sizes */
|
||||
@@ -896,6 +899,7 @@ enum
|
||||
PROP_DEPTH, /* XXX:2.0 remove */
|
||||
PROP_Z_POSITION,
|
||||
|
||||
PROP_CLIP, /* XXX:2.0 remove */
|
||||
PROP_CLIP_RECT,
|
||||
PROP_HAS_CLIP,
|
||||
PROP_CLIP_TO_ALLOCATION,
|
||||
@@ -1069,6 +1073,8 @@ static ClutterGravity clutter_anchor_coord_get_gravity (const AnchorCoord *coord
|
||||
static void clutter_anchor_coord_set_gravity (AnchorCoord *coord,
|
||||
ClutterGravity gravity);
|
||||
|
||||
static gboolean clutter_anchor_coord_is_zero (const AnchorCoord *coord);
|
||||
|
||||
static void _clutter_actor_get_relative_transformation_matrix (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
CoglMatrix *matrix);
|
||||
@@ -1109,9 +1115,9 @@ static void clutter_actor_pop_in_cloned_branch (ClutterActor *self,
|
||||
#define TRANSFORM_ABOUT_ANCHOR_COORD(a,m,c,_transform) G_STMT_START { \
|
||||
gfloat _tx, _ty, _tz; \
|
||||
clutter_anchor_coord_get_units ((a), (c), &_tx, &_ty, &_tz); \
|
||||
cogl_matrix_translate ((m), -_tx, -_ty, -_tz); \
|
||||
cogl_matrix_translate ((m), _tx, _ty, _tz); \
|
||||
{ _transform; } \
|
||||
cogl_matrix_translate ((m), _tx, _ty, _tz); } G_STMT_END
|
||||
cogl_matrix_translate ((m), -_tx, -_ty, -_tz); } G_STMT_END
|
||||
|
||||
static GQuark quark_actor_layout_info = 0;
|
||||
static GQuark quark_actor_transform_info = 0;
|
||||
@@ -2823,8 +2829,8 @@ clutter_actor_real_queue_relayout (ClutterActor *self)
|
||||
* @self: A #ClutterActor
|
||||
* @ancestor: (allow-none): A #ClutterActor ancestor, or %NULL to use the
|
||||
* default #ClutterStage
|
||||
* @point: A point as #graphene_point3d_t
|
||||
* @vertex: (out caller-allocates): The translated #graphene_point3d_t
|
||||
* @point: A point as #ClutterVertex
|
||||
* @vertex: (out caller-allocates): The translated #ClutterVertex
|
||||
*
|
||||
* Transforms @point in coordinates relative to the actor into
|
||||
* ancestor-relative coordinates using the relevant transform
|
||||
@@ -2838,10 +2844,10 @@ clutter_actor_real_queue_relayout (ClutterActor *self)
|
||||
* Since: 0.6
|
||||
*/
|
||||
void
|
||||
clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
const graphene_point3d_t *point,
|
||||
graphene_point3d_t *vertex)
|
||||
clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
const ClutterVertex *point,
|
||||
ClutterVertex *vertex)
|
||||
{
|
||||
gfloat w;
|
||||
CoglMatrix matrix;
|
||||
@@ -2868,10 +2874,10 @@ clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_clutter_actor_fully_transform_vertices (ClutterActor *self,
|
||||
const graphene_point3d_t *vertices_in,
|
||||
graphene_point3d_t *vertices_out,
|
||||
int n_vertices)
|
||||
_clutter_actor_fully_transform_vertices (ClutterActor *self,
|
||||
const ClutterVertex *vertices_in,
|
||||
ClutterVertex *vertices_out,
|
||||
int n_vertices)
|
||||
{
|
||||
ClutterActor *stage;
|
||||
CoglMatrix modelview;
|
||||
@@ -2913,8 +2919,8 @@ _clutter_actor_fully_transform_vertices (ClutterActor *self,
|
||||
/**
|
||||
* clutter_actor_apply_transform_to_point:
|
||||
* @self: A #ClutterActor
|
||||
* @point: A point as #graphene_point3d_t
|
||||
* @vertex: (out caller-allocates): The translated #graphene_point3d_t
|
||||
* @point: A point as #ClutterVertex
|
||||
* @vertex: (out caller-allocates): The translated #ClutterVertex
|
||||
*
|
||||
* Transforms @point in coordinates relative to the actor
|
||||
* into screen-relative coordinates with the current actor
|
||||
@@ -2923,9 +2929,9 @@ _clutter_actor_fully_transform_vertices (ClutterActor *self,
|
||||
* Since: 0.4
|
||||
**/
|
||||
void
|
||||
clutter_actor_apply_transform_to_point (ClutterActor *self,
|
||||
const graphene_point3d_t *point,
|
||||
graphene_point3d_t *vertex)
|
||||
clutter_actor_apply_transform_to_point (ClutterActor *self,
|
||||
const ClutterVertex *point,
|
||||
ClutterVertex *vertex)
|
||||
{
|
||||
g_return_if_fail (point != NULL);
|
||||
g_return_if_fail (vertex != NULL);
|
||||
@@ -2975,10 +2981,10 @@ _clutter_actor_get_relative_transformation_matrix (ClutterActor *self,
|
||||
* transformed vertices to @verts[]. */
|
||||
static gboolean
|
||||
_clutter_actor_transform_and_project_box (ClutterActor *self,
|
||||
const ClutterActorBox *box,
|
||||
graphene_point3d_t *verts)
|
||||
const ClutterActorBox *box,
|
||||
ClutterVertex verts[])
|
||||
{
|
||||
graphene_point3d_t box_vertices[4];
|
||||
ClutterVertex box_vertices[4];
|
||||
|
||||
box_vertices[0].x = box->x1;
|
||||
box_vertices[0].y = box->y1;
|
||||
@@ -3002,8 +3008,8 @@ _clutter_actor_transform_and_project_box (ClutterActor *self,
|
||||
* @self: A #ClutterActor
|
||||
* @ancestor: (allow-none): A #ClutterActor to calculate the vertices
|
||||
* against, or %NULL to use the #ClutterStage
|
||||
* @verts: (out) (array fixed-size=4): return
|
||||
* location for an array of 4 #graphene_point3d_t in which to store the result
|
||||
* @verts: (out) (array fixed-size=4) (element-type Clutter.Vertex): return
|
||||
* location for an array of 4 #ClutterVertex in which to store the result
|
||||
*
|
||||
* Calculates the transformed coordinates of the four corners of the
|
||||
* actor in the plane of @ancestor. The returned vertices relate to
|
||||
@@ -3022,13 +3028,13 @@ _clutter_actor_transform_and_project_box (ClutterActor *self,
|
||||
* Since: 0.6
|
||||
*/
|
||||
void
|
||||
clutter_actor_get_allocation_vertices (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
graphene_point3d_t *verts)
|
||||
clutter_actor_get_allocation_vertices (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
ClutterVertex verts[])
|
||||
{
|
||||
ClutterActorPrivate *priv;
|
||||
ClutterActorBox box;
|
||||
graphene_point3d_t vertices[4];
|
||||
ClutterVertex vertices[4];
|
||||
CoglMatrix modelview;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||
@@ -3080,9 +3086,9 @@ clutter_actor_get_allocation_vertices (ClutterActor *self,
|
||||
|
||||
cogl_matrix_transform_points (&modelview,
|
||||
3,
|
||||
sizeof (graphene_point3d_t),
|
||||
sizeof (ClutterVertex),
|
||||
vertices,
|
||||
sizeof (graphene_point3d_t),
|
||||
sizeof (ClutterVertex),
|
||||
vertices,
|
||||
4);
|
||||
}
|
||||
@@ -3091,7 +3097,7 @@ clutter_actor_get_allocation_vertices (ClutterActor *self,
|
||||
* clutter_actor_get_abs_allocation_vertices:
|
||||
* @self: A #ClutterActor
|
||||
* @verts: (out) (array fixed-size=4): Pointer to a location of an array
|
||||
* of 4 #graphene_point3d_t where to store the result.
|
||||
* of 4 #ClutterVertex where to store the result.
|
||||
*
|
||||
* Calculates the transformed screen coordinates of the four corners of
|
||||
* the actor; the returned vertices relate to the #ClutterActorBox
|
||||
@@ -3105,8 +3111,8 @@ clutter_actor_get_allocation_vertices (ClutterActor *self,
|
||||
* Since: 0.4
|
||||
*/
|
||||
void
|
||||
clutter_actor_get_abs_allocation_vertices (ClutterActor *self,
|
||||
graphene_point3d_t *verts)
|
||||
clutter_actor_get_abs_allocation_vertices (ClutterActor *self,
|
||||
ClutterVertex verts[])
|
||||
{
|
||||
ClutterActorPrivate *priv;
|
||||
ClutterActorBox actor_space_allocation;
|
||||
@@ -3148,7 +3154,6 @@ clutter_actor_real_apply_transform (ClutterActor *self,
|
||||
CoglMatrix *transform = &priv->transform;
|
||||
const ClutterTransformInfo *info;
|
||||
float pivot_x = 0.f, pivot_y = 0.f;
|
||||
float tx, ty, tz;
|
||||
|
||||
/* we already have a cached transformation */
|
||||
if (priv->transform_valid)
|
||||
@@ -3192,45 +3197,42 @@ clutter_actor_real_apply_transform (ClutterActor *self,
|
||||
* space, and to the pivot point
|
||||
*/
|
||||
cogl_matrix_translate (transform,
|
||||
-pivot_x,
|
||||
-pivot_y,
|
||||
-info->pivot_z);
|
||||
cogl_matrix_multiply (transform, &info->transform, transform);
|
||||
cogl_matrix_translate (transform,
|
||||
priv->allocation.x1,
|
||||
priv->allocation.y1,
|
||||
0.0f);
|
||||
priv->allocation.x1 + pivot_x,
|
||||
priv->allocation.y1 + pivot_y,
|
||||
info->pivot_z);
|
||||
cogl_matrix_multiply (transform, transform, &info->transform);
|
||||
goto roll_back_pivot;
|
||||
}
|
||||
|
||||
/* XXX:2.0 remove anchor point translation */
|
||||
clutter_anchor_coord_get_units (self, &info->anchor, &tx, &ty, &tz);
|
||||
tx += pivot_x;
|
||||
ty += pivot_y;
|
||||
tz += info->pivot_z;
|
||||
/* basic translation: :allocation's origin and :z-position; instead
|
||||
* of decomposing the pivot and translation info separate operations,
|
||||
* we just compose everything into a single translation
|
||||
*/
|
||||
cogl_matrix_translate (transform,
|
||||
priv->allocation.x1 + pivot_x + info->translation.x,
|
||||
priv->allocation.y1 + pivot_y + info->translation.y,
|
||||
info->z_position + info->pivot_z + info->translation.z);
|
||||
|
||||
if (tx != 0.f || ty != 0.f || tz != 0.f)
|
||||
cogl_matrix_translate (transform, -tx, -ty, -tz);
|
||||
|
||||
if (info->rx_angle)
|
||||
/* because the rotation involves translations, we must scale
|
||||
* before applying the rotations (if we apply the scale after
|
||||
* the rotations, the translations included in the rotation are
|
||||
* not scaled and so the entire object will move on the screen
|
||||
* as a result of rotating it).
|
||||
*
|
||||
* XXX:2.0 the comment has to be reworded once we remove the
|
||||
* per-transformation centers; we also may want to apply rotation
|
||||
* first and scaling after, to match the matrix decomposition
|
||||
* code we use when interpolating transformations
|
||||
*/
|
||||
if (info->scale_x != 1.0 || info->scale_y != 1.0 || info->scale_z != 1.0)
|
||||
{
|
||||
/* XXX:2.0 remove anchor coord */
|
||||
TRANSFORM_ABOUT_ANCHOR_COORD (self, transform,
|
||||
&info->rx_center,
|
||||
cogl_matrix_rotate (transform,
|
||||
info->rx_angle,
|
||||
1.0, 0, 0));
|
||||
}
|
||||
|
||||
|
||||
if (info->ry_angle)
|
||||
{
|
||||
/* XXX:2.0 remove anchor coord */
|
||||
TRANSFORM_ABOUT_ANCHOR_COORD (self, transform,
|
||||
&info->ry_center,
|
||||
cogl_matrix_rotate (transform,
|
||||
info->ry_angle,
|
||||
0, 1.0, 0));
|
||||
&info->scale_center,
|
||||
cogl_matrix_scale (transform,
|
||||
info->scale_x,
|
||||
info->scale_y,
|
||||
info->scale_z));
|
||||
}
|
||||
|
||||
if (info->rz_angle)
|
||||
@@ -3243,26 +3245,39 @@ clutter_actor_real_apply_transform (ClutterActor *self,
|
||||
0, 0, 1.0));
|
||||
}
|
||||
|
||||
if (info->scale_x != 1.0 || info->scale_y != 1.0 || info->scale_z != 1.0)
|
||||
if (info->ry_angle)
|
||||
{
|
||||
/* XXX:2.0 remove anchor coord */
|
||||
TRANSFORM_ABOUT_ANCHOR_COORD (self, transform,
|
||||
&info->scale_center,
|
||||
cogl_matrix_scale (transform,
|
||||
info->scale_x,
|
||||
info->scale_y,
|
||||
info->scale_z));
|
||||
&info->ry_center,
|
||||
cogl_matrix_rotate (transform,
|
||||
info->ry_angle,
|
||||
0, 1.0, 0));
|
||||
}
|
||||
|
||||
cogl_matrix_translate (transform,
|
||||
priv->allocation.x1 + info->translation.x,
|
||||
priv->allocation.y1 + info->translation.y,
|
||||
info->z_position + info->translation.z);
|
||||
if (info->rx_angle)
|
||||
{
|
||||
/* XXX:2.0 remove anchor coord */
|
||||
TRANSFORM_ABOUT_ANCHOR_COORD (self, transform,
|
||||
&info->rx_center,
|
||||
cogl_matrix_rotate (transform,
|
||||
info->rx_angle,
|
||||
1.0, 0, 0));
|
||||
}
|
||||
|
||||
/* XXX:2.0 remove anchor point translation */
|
||||
if (!clutter_anchor_coord_is_zero (&info->anchor))
|
||||
{
|
||||
gfloat x, y, z;
|
||||
|
||||
clutter_anchor_coord_get_units (self, &info->anchor, &x, &y, &z);
|
||||
cogl_matrix_translate (transform, -x, -y, -z);
|
||||
}
|
||||
|
||||
roll_back_pivot:
|
||||
/* roll back the pivot translation */
|
||||
if (pivot_x != 0.f || pivot_y != 0.f || info->pivot_z != 0.f)
|
||||
cogl_matrix_translate (transform, pivot_x, pivot_y, info->pivot_z);
|
||||
cogl_matrix_translate (transform, -pivot_x, -pivot_y, -info->pivot_z);
|
||||
|
||||
/* we have a valid modelview */
|
||||
priv->transform_valid = TRUE;
|
||||
@@ -3338,7 +3353,7 @@ _clutter_actor_draw_paint_volume_full (ClutterActor *self,
|
||||
{
|
||||
static CoglPipeline *outline = NULL;
|
||||
CoglPrimitive *prim;
|
||||
graphene_point3d_t line_ends[12 * 2];
|
||||
ClutterVertex line_ends[12 * 2];
|
||||
int n_vertices;
|
||||
CoglContext *ctx =
|
||||
clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||
@@ -3995,12 +4010,12 @@ clutter_actor_paint (ClutterActor *self)
|
||||
pick_mode == CLUTTER_PICK_NONE))
|
||||
_clutter_actor_draw_paint_volume (self);
|
||||
|
||||
done:
|
||||
/* If we make it here then the actor has run through a complete
|
||||
paint run including all the effects so it's no longer dirty */
|
||||
if (pick_mode == CLUTTER_PICK_NONE)
|
||||
priv->is_dirty = FALSE;
|
||||
|
||||
done:
|
||||
if (clip_set)
|
||||
{
|
||||
CoglFramebuffer *fb = _clutter_stage_get_active_framebuffer (stage);
|
||||
@@ -4386,11 +4401,11 @@ static const ClutterTransformInfo default_transform_info = {
|
||||
|
||||
{ 0, }, /* anchor XXX:2.0 - remove*/
|
||||
|
||||
GRAPHENE_POINT3D_INIT_ZERO, /* translation */
|
||||
CLUTTER_VERTEX_INIT_ZERO, /* translation */
|
||||
|
||||
0.f, /* z-position */
|
||||
|
||||
GRAPHENE_POINT_INIT_ZERO, /* pivot */
|
||||
CLUTTER_POINT_INIT_ZERO, /* pivot */
|
||||
0.f, /* pivot-z */
|
||||
|
||||
CLUTTER_MATRIX_INIT_IDENTITY,
|
||||
@@ -4469,8 +4484,8 @@ _clutter_actor_get_transform_info (ClutterActor *self)
|
||||
}
|
||||
|
||||
static inline void
|
||||
clutter_actor_set_pivot_point_internal (ClutterActor *self,
|
||||
const graphene_point_t *pivot)
|
||||
clutter_actor_set_pivot_point_internal (ClutterActor *self,
|
||||
const ClutterPoint *pivot)
|
||||
{
|
||||
ClutterTransformInfo *info;
|
||||
|
||||
@@ -4777,9 +4792,9 @@ clutter_actor_get_rotation_angle (ClutterActor *self,
|
||||
static inline void
|
||||
clutter_actor_set_rotation_center_internal (ClutterActor *self,
|
||||
ClutterRotateAxis axis,
|
||||
const graphene_point3d_t *center)
|
||||
const ClutterVertex *center)
|
||||
{
|
||||
graphene_point3d_t v = GRAPHENE_POINT3D_INIT_ZERO;
|
||||
ClutterVertex v = CLUTTER_VERTEX_INIT_ZERO;
|
||||
GObject *obj = G_OBJECT (self);
|
||||
ClutterTransformInfo *info;
|
||||
|
||||
@@ -5006,8 +5021,8 @@ clutter_actor_set_anchor_coord (ClutterActor *self,
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_actor_set_clip_rect (ClutterActor *self,
|
||||
const graphene_rect_t *clip)
|
||||
clutter_actor_set_clip_rect (ClutterActor *self,
|
||||
const ClutterRect *clip)
|
||||
{
|
||||
ClutterActorPrivate *priv = self->priv;
|
||||
GObject *obj = G_OBJECT (self);
|
||||
@@ -5022,6 +5037,7 @@ clutter_actor_set_clip_rect (ClutterActor *self,
|
||||
|
||||
clutter_actor_queue_redraw (self);
|
||||
|
||||
g_object_notify_by_pspec (obj, obj_props[PROP_CLIP]); /* XXX:2.0 - remove */
|
||||
g_object_notify_by_pspec (obj, obj_props[PROP_CLIP_RECT]);
|
||||
g_object_notify_by_pspec (obj, obj_props[PROP_HAS_CLIP]);
|
||||
}
|
||||
@@ -5047,7 +5063,7 @@ clutter_actor_set_property (GObject *object,
|
||||
|
||||
case PROP_POSITION:
|
||||
{
|
||||
const graphene_point_t *pos = g_value_get_boxed (value);
|
||||
const ClutterPoint *pos = g_value_get_boxed (value);
|
||||
|
||||
if (pos != NULL)
|
||||
clutter_actor_set_position (actor, pos->x, pos->y);
|
||||
@@ -5066,7 +5082,7 @@ clutter_actor_set_property (GObject *object,
|
||||
|
||||
case PROP_SIZE:
|
||||
{
|
||||
const graphene_size_t *size = g_value_get_boxed (value);
|
||||
const ClutterSize *size = g_value_get_boxed (value);
|
||||
|
||||
if (size != NULL)
|
||||
clutter_actor_set_size (actor, size->width, size->height);
|
||||
@@ -5152,10 +5168,10 @@ clutter_actor_set_property (GObject *object,
|
||||
|
||||
case PROP_PIVOT_POINT:
|
||||
{
|
||||
const graphene_point_t *pivot = g_value_get_boxed (value);
|
||||
const ClutterPoint *pivot = g_value_get_boxed (value);
|
||||
|
||||
if (pivot == NULL)
|
||||
pivot = graphene_point_zero ();
|
||||
pivot = clutter_point_zero ();
|
||||
|
||||
clutter_actor_set_pivot_point (actor, pivot->x, pivot->y);
|
||||
}
|
||||
@@ -5209,6 +5225,16 @@ clutter_actor_set_property (GObject *object,
|
||||
clutter_actor_set_scale_gravity (actor, g_value_get_enum (value));
|
||||
break;
|
||||
|
||||
case PROP_CLIP: /* XXX:2.0 - remove */
|
||||
{
|
||||
const ClutterGeometry *geom = g_value_get_boxed (value);
|
||||
|
||||
clutter_actor_set_clip (actor,
|
||||
geom->x, geom->y,
|
||||
geom->width, geom->height);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_CLIP_RECT:
|
||||
clutter_actor_set_clip_rect (actor, g_value_get_boxed (value));
|
||||
break;
|
||||
@@ -5401,11 +5427,11 @@ clutter_actor_get_property (GObject *object,
|
||||
|
||||
case PROP_POSITION:
|
||||
{
|
||||
graphene_point_t position;
|
||||
ClutterPoint position;
|
||||
|
||||
graphene_point_init (&position,
|
||||
clutter_actor_get_x (actor),
|
||||
clutter_actor_get_y (actor));
|
||||
clutter_point_init (&position,
|
||||
clutter_actor_get_x (actor),
|
||||
clutter_actor_get_y (actor));
|
||||
g_value_set_boxed (value, &position);
|
||||
}
|
||||
break;
|
||||
@@ -5420,11 +5446,11 @@ clutter_actor_get_property (GObject *object,
|
||||
|
||||
case PROP_SIZE:
|
||||
{
|
||||
graphene_size_t size;
|
||||
ClutterSize size;
|
||||
|
||||
graphene_size_init (&size,
|
||||
clutter_actor_get_width (actor),
|
||||
clutter_actor_get_height (actor));
|
||||
clutter_size_init (&size,
|
||||
clutter_actor_get_width (actor),
|
||||
clutter_actor_get_height (actor));
|
||||
g_value_set_boxed (value, &size);
|
||||
}
|
||||
break;
|
||||
@@ -5547,6 +5573,19 @@ clutter_actor_get_property (GObject *object,
|
||||
g_value_set_boolean (value, priv->has_clip);
|
||||
break;
|
||||
|
||||
case PROP_CLIP: /* XXX:2.0 - remove */
|
||||
{
|
||||
ClutterGeometry clip;
|
||||
|
||||
clip.x = CLUTTER_NEARBYINT (priv->clip.origin.x);
|
||||
clip.y = CLUTTER_NEARBYINT (priv->clip.origin.y);
|
||||
clip.width = CLUTTER_NEARBYINT (priv->clip.size.width);
|
||||
clip.height = CLUTTER_NEARBYINT (priv->clip.size.height);
|
||||
|
||||
g_value_set_boxed (value, &clip);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_CLIP_RECT:
|
||||
g_value_set_boxed (value, &priv->clip);
|
||||
break;
|
||||
@@ -5694,7 +5733,7 @@ clutter_actor_get_property (GObject *object,
|
||||
|
||||
case PROP_ROTATION_CENTER_X: /* XXX:2.0 - remove */
|
||||
{
|
||||
graphene_point3d_t center;
|
||||
ClutterVertex center;
|
||||
|
||||
clutter_actor_get_rotation (actor, CLUTTER_X_AXIS,
|
||||
¢er.x,
|
||||
@@ -5707,7 +5746,7 @@ clutter_actor_get_property (GObject *object,
|
||||
|
||||
case PROP_ROTATION_CENTER_Y: /* XXX:2.0 - remove */
|
||||
{
|
||||
graphene_point3d_t center;
|
||||
ClutterVertex center;
|
||||
|
||||
clutter_actor_get_rotation (actor, CLUTTER_Y_AXIS,
|
||||
¢er.x,
|
||||
@@ -5720,7 +5759,7 @@ clutter_actor_get_property (GObject *object,
|
||||
|
||||
case PROP_ROTATION_CENTER_Z: /* XXX:2.0 - remove */
|
||||
{
|
||||
graphene_point3d_t center;
|
||||
ClutterVertex center;
|
||||
|
||||
clutter_actor_get_rotation (actor, CLUTTER_Z_AXIS,
|
||||
¢er.x,
|
||||
@@ -5947,6 +5986,7 @@ clutter_actor_dispose (GObject *object)
|
||||
{
|
||||
ClutterActor *self = CLUTTER_ACTOR (object);
|
||||
ClutterActorPrivate *priv = self->priv;
|
||||
ClutterBackend *backend = clutter_get_default_backend ();
|
||||
|
||||
CLUTTER_NOTE (MISC, "Dispose actor (name='%s', ref_count:%d) of type '%s'",
|
||||
_clutter_actor_get_debug_name (self),
|
||||
@@ -5983,6 +6023,18 @@ clutter_actor_dispose (GObject *object)
|
||||
g_assert (!CLUTTER_ACTOR_IS_REALIZED (self));
|
||||
}
|
||||
|
||||
if (priv->resolution_changed_id)
|
||||
{
|
||||
g_signal_handler_disconnect (backend, priv->resolution_changed_id);
|
||||
priv->resolution_changed_id = 0;
|
||||
}
|
||||
|
||||
if (priv->font_changed_id)
|
||||
{
|
||||
g_signal_handler_disconnect (backend, priv->font_changed_id);
|
||||
priv->font_changed_id = 0;
|
||||
}
|
||||
|
||||
g_clear_object (&priv->pango_context);
|
||||
g_clear_object (&priv->actions);
|
||||
g_clear_object (&priv->constraints);
|
||||
@@ -6130,7 +6182,7 @@ clutter_actor_update_default_paint_volume (ClutterActor *self,
|
||||
priv->clip.size.width >= 0 &&
|
||||
priv->clip.size.height >= 0)
|
||||
{
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
|
||||
origin.x = priv->clip.origin.x;
|
||||
origin.y = priv->clip.origin.y;
|
||||
@@ -6406,7 +6458,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
||||
g_param_spec_boxed ("position",
|
||||
P_("Position"),
|
||||
P_("The position of the origin of the actor"),
|
||||
GRAPHENE_TYPE_POINT,
|
||||
CLUTTER_TYPE_POINT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
CLUTTER_PARAM_ANIMATABLE);
|
||||
@@ -6465,7 +6517,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
||||
g_param_spec_boxed ("size",
|
||||
P_("Size"),
|
||||
P_("The size of the actor"),
|
||||
GRAPHENE_TYPE_SIZE,
|
||||
CLUTTER_TYPE_SIZE,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
CLUTTER_PARAM_ANIMATABLE);
|
||||
@@ -6907,11 +6959,25 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
||||
FALSE,
|
||||
CLUTTER_PARAM_READABLE);
|
||||
|
||||
/**
|
||||
* ClutterActor:clip:
|
||||
*
|
||||
* The visible region of the actor, in actor-relative coordinates
|
||||
*
|
||||
* Deprecated: 1.12: Use #ClutterActor:clip-rect instead.
|
||||
*/
|
||||
obj_props[PROP_CLIP] = /* XXX:2.0 - remove */
|
||||
g_param_spec_boxed ("clip",
|
||||
P_("Clip"),
|
||||
P_("The clip region for the actor"),
|
||||
CLUTTER_TYPE_GEOMETRY,
|
||||
CLUTTER_PARAM_READWRITE);
|
||||
|
||||
/**
|
||||
* ClutterActor:clip-rect:
|
||||
*
|
||||
* The visible region of the actor, in actor-relative coordinates,
|
||||
* expressed as a #graphene_rect_t.
|
||||
* expressed as a #ClutterRect.
|
||||
*
|
||||
* Setting this property to %NULL will unset the existing clip.
|
||||
*
|
||||
@@ -6924,7 +6990,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
||||
g_param_spec_boxed ("clip-rect",
|
||||
P_("Clip Rectangle"),
|
||||
P_("The visible region of the actor"),
|
||||
GRAPHENE_TYPE_RECT,
|
||||
CLUTTER_TYPE_RECT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -6961,7 +7027,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
||||
g_param_spec_boxed ("pivot-point",
|
||||
P_("Pivot Point"),
|
||||
P_("The point around which the scaling and rotation occur"),
|
||||
GRAPHENE_TYPE_POINT,
|
||||
CLUTTER_TYPE_POINT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
CLUTTER_PARAM_ANIMATABLE);
|
||||
@@ -7183,7 +7249,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
||||
g_param_spec_boxed ("rotation-center-x",
|
||||
P_("Rotation Center X"),
|
||||
P_("The rotation center on the X axis"),
|
||||
GRAPHENE_TYPE_POINT3D,
|
||||
CLUTTER_TYPE_VERTEX,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
G_PARAM_DEPRECATED);
|
||||
@@ -7201,7 +7267,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
||||
g_param_spec_boxed ("rotation-center-y",
|
||||
P_("Rotation Center Y"),
|
||||
P_("The rotation center on the Y axis"),
|
||||
GRAPHENE_TYPE_POINT3D,
|
||||
CLUTTER_TYPE_VERTEX,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
G_PARAM_DEPRECATED);
|
||||
@@ -7219,7 +7285,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
||||
g_param_spec_boxed ("rotation-center-z",
|
||||
P_("Rotation Center Z"),
|
||||
P_("The rotation center on the Z axis"),
|
||||
GRAPHENE_TYPE_POINT3D,
|
||||
CLUTTER_TYPE_VERTEX,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
G_PARAM_DEPRECATED);
|
||||
@@ -8783,9 +8849,9 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
|
||||
*
|
||||
* later during _clutter_stage_do_update(), once relayouting is done
|
||||
* and the scenegraph has been updated we will call:
|
||||
* _clutter_stage_finish_queue_redraws().
|
||||
* clutter_stage_maybe_finish_queue_redraws().
|
||||
*
|
||||
* _clutter_stage_finish_queue_redraws() will call
|
||||
* clutter_stage_maybe_finish_queue_redraws() will call
|
||||
* _clutter_actor_finish_queue_redraw() for each listed actor.
|
||||
*
|
||||
* Note: actors *are* allowed to queue further redraws during this
|
||||
@@ -8846,7 +8912,7 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
|
||||
if (flags & CLUTTER_REDRAW_CLIPPED_TO_ALLOCATION)
|
||||
{
|
||||
ClutterActorBox allocation_clip;
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
|
||||
/* If the actor doesn't have a valid allocation then we will
|
||||
* queue a full stage redraw. */
|
||||
@@ -9050,7 +9116,7 @@ clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||
const cairo_rectangle_int_t *clip)
|
||||
{
|
||||
ClutterPaintVolume volume;
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||
|
||||
@@ -10041,6 +10107,9 @@ clutter_actor_allocate (ClutterActor *self,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!clutter_actor_is_visible (self))
|
||||
return;
|
||||
|
||||
priv = self->priv;
|
||||
|
||||
old_allocation = priv->allocation;
|
||||
@@ -10274,17 +10343,17 @@ clutter_actor_set_position (ClutterActor *self,
|
||||
gfloat x,
|
||||
gfloat y)
|
||||
{
|
||||
graphene_point_t new_position;
|
||||
graphene_point_t cur_position;
|
||||
ClutterPoint new_position;
|
||||
ClutterPoint cur_position;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||
|
||||
graphene_point_init (&new_position, x, y);
|
||||
clutter_point_init (&new_position, x, y);
|
||||
|
||||
cur_position.x = clutter_actor_get_x (self);
|
||||
cur_position.y = clutter_actor_get_y (self);
|
||||
|
||||
if (!graphene_point_equal (&cur_position, &new_position))
|
||||
if (!clutter_point_equals (&cur_position, &new_position))
|
||||
_clutter_actor_create_transition (self, obj_props[PROP_POSITION],
|
||||
&cur_position,
|
||||
&new_position);
|
||||
@@ -10719,8 +10788,8 @@ clutter_actor_set_height_internal (ClutterActor *self,
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_actor_set_size_internal (ClutterActor *self,
|
||||
const graphene_size_t *size)
|
||||
clutter_actor_set_size_internal (ClutterActor *self,
|
||||
const ClutterSize *size)
|
||||
{
|
||||
if (size != NULL)
|
||||
{
|
||||
@@ -10756,11 +10825,11 @@ clutter_actor_set_size (ClutterActor *self,
|
||||
gfloat width,
|
||||
gfloat height)
|
||||
{
|
||||
graphene_size_t new_size;
|
||||
ClutterSize new_size;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||
|
||||
graphene_size_init (&new_size, width, height);
|
||||
clutter_size_init (&new_size, width, height);
|
||||
|
||||
/* minor optimization: if we don't have a duration then we can
|
||||
* skip the get_size() below, to avoid the chance of going through
|
||||
@@ -10779,11 +10848,11 @@ clutter_actor_set_size (ClutterActor *self,
|
||||
}
|
||||
else
|
||||
{
|
||||
graphene_size_t cur_size;
|
||||
ClutterSize cur_size;
|
||||
|
||||
graphene_size_init (&cur_size,
|
||||
clutter_actor_get_width (self),
|
||||
clutter_actor_get_height (self));
|
||||
clutter_size_init (&cur_size,
|
||||
clutter_actor_get_width (self),
|
||||
clutter_actor_get_height (self));
|
||||
|
||||
_clutter_actor_create_transition (self,
|
||||
obj_props[PROP_SIZE],
|
||||
@@ -10869,8 +10938,8 @@ clutter_actor_get_transformed_position (ClutterActor *self,
|
||||
gfloat *x,
|
||||
gfloat *y)
|
||||
{
|
||||
graphene_point3d_t v1;
|
||||
graphene_point3d_t v2;
|
||||
ClutterVertex v1;
|
||||
ClutterVertex v2;
|
||||
|
||||
v1.x = v1.y = v1.z = 0;
|
||||
clutter_actor_apply_transform_to_point (self, &v1, &v2);
|
||||
@@ -10916,7 +10985,7 @@ clutter_actor_get_transformed_size (ClutterActor *self,
|
||||
gfloat *height)
|
||||
{
|
||||
ClutterActorPrivate *priv;
|
||||
graphene_point3d_t v[4];
|
||||
ClutterVertex v[4];
|
||||
gfloat x_min, x_max, y_min, y_max;
|
||||
gint i;
|
||||
|
||||
@@ -11238,8 +11307,8 @@ clutter_actor_set_y_internal (ClutterActor *self,
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_actor_set_position_internal (ClutterActor *self,
|
||||
const graphene_point_t *position)
|
||||
clutter_actor_set_position_internal (ClutterActor *self,
|
||||
const ClutterPoint *position)
|
||||
{
|
||||
ClutterActorPrivate *priv = self->priv;
|
||||
ClutterLayoutInfo *linfo;
|
||||
@@ -11248,7 +11317,7 @@ clutter_actor_set_position_internal (ClutterActor *self,
|
||||
linfo = _clutter_actor_get_layout_info (self);
|
||||
|
||||
if (priv->position_set &&
|
||||
graphene_point_equal (position, &linfo->fixed_pos))
|
||||
clutter_point_equals (position, &linfo->fixed_pos))
|
||||
return;
|
||||
|
||||
clutter_actor_store_old_geometry (self, &old);
|
||||
@@ -11333,7 +11402,8 @@ clutter_actor_set_y (ClutterActor *self,
|
||||
* the X coordinate of the origin of the allocation box.
|
||||
*
|
||||
* If the actor has any fixed coordinate set using clutter_actor_set_x(),
|
||||
* clutter_actor_set_position(), this function will return that coordinate.
|
||||
* clutter_actor_set_position() or clutter_actor_set_geometry(), this
|
||||
* function will return that coordinate.
|
||||
*
|
||||
* If both the allocation and a fixed position are missing, this function
|
||||
* will return 0.
|
||||
@@ -11380,7 +11450,8 @@ clutter_actor_get_x (ClutterActor *self)
|
||||
* the Y coordinate of the origin of the allocation box.
|
||||
*
|
||||
* If the actor has any fixed coordinate set using clutter_actor_set_y(),
|
||||
* clutter_actor_set_position(), this function will return that coordinate.
|
||||
* clutter_actor_set_position() or clutter_actor_set_geometry(), this
|
||||
* function will return that coordinate.
|
||||
*
|
||||
* If both the allocation and a fixed position are missing, this function
|
||||
* will return 0.
|
||||
@@ -12065,7 +12136,7 @@ clutter_actor_set_pivot_point (ClutterActor *self,
|
||||
gfloat pivot_x,
|
||||
gfloat pivot_y)
|
||||
{
|
||||
graphene_point_t pivot = GRAPHENE_POINT_INIT (pivot_x, pivot_y);
|
||||
ClutterPoint pivot = CLUTTER_POINT_INIT (pivot_x, pivot_y);
|
||||
const ClutterTransformInfo *info;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||
@@ -12226,7 +12297,7 @@ clutter_actor_set_rotation (ClutterActor *self,
|
||||
gfloat y,
|
||||
gfloat z)
|
||||
{
|
||||
graphene_point3d_t v;
|
||||
ClutterVertex v;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||
|
||||
@@ -12423,6 +12494,7 @@ clutter_actor_set_clip (ClutterActor *self,
|
||||
|
||||
clutter_actor_queue_redraw (self);
|
||||
|
||||
g_object_notify_by_pspec (obj, obj_props[PROP_CLIP]);
|
||||
g_object_notify_by_pspec (obj, obj_props[PROP_CLIP_RECT]);
|
||||
g_object_notify_by_pspec (obj, obj_props[PROP_HAS_CLIP]);
|
||||
}
|
||||
@@ -15173,7 +15245,7 @@ clutter_actor_transform_stage_point (ClutterActor *self,
|
||||
gfloat *x_out,
|
||||
gfloat *y_out)
|
||||
{
|
||||
graphene_point3d_t v[4];
|
||||
ClutterVertex v[4];
|
||||
double ST[3][3];
|
||||
double RQ[3][3];
|
||||
int du, dv;
|
||||
@@ -15831,10 +15903,12 @@ clutter_actor_get_pango_context (ClutterActor *self)
|
||||
{
|
||||
priv->pango_context = clutter_actor_create_pango_context (self);
|
||||
|
||||
g_signal_connect_object (backend, "resolution-changed",
|
||||
G_CALLBACK (update_pango_context), priv->pango_context, 0);
|
||||
g_signal_connect_object (backend, "font-changed",
|
||||
G_CALLBACK (update_pango_context), priv->pango_context, 0);
|
||||
priv->resolution_changed_id =
|
||||
g_signal_connect_object (backend, "resolution-changed",
|
||||
G_CALLBACK (update_pango_context), priv->pango_context, 0);
|
||||
priv->font_changed_id =
|
||||
g_signal_connect_object (backend, "font-changed",
|
||||
G_CALLBACK (update_pango_context), priv->pango_context, 0);
|
||||
}
|
||||
else
|
||||
update_pango_context (backend, priv->pango_context);
|
||||
@@ -16156,6 +16230,17 @@ clutter_anchor_coord_set_gravity (AnchorCoord *coord,
|
||||
coord->is_fractional = TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_anchor_coord_is_zero (const AnchorCoord *coord)
|
||||
{
|
||||
if (coord->is_fractional)
|
||||
return coord->v.fraction.x == 0.0 && coord->v.fraction.y == 0.0;
|
||||
else
|
||||
return (coord->v.units.x == 0.0
|
||||
&& coord->v.units.y == 0.0
|
||||
&& coord->v.units.z == 0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_actor_get_flags:
|
||||
* @self: a #ClutterActor
|
||||
@@ -17469,7 +17554,7 @@ _clutter_actor_get_paint_volume_real (ClutterActor *self,
|
||||
l != NULL && l->data != priv->current_effect;
|
||||
l = l->next)
|
||||
{
|
||||
if (!_clutter_effect_get_paint_volume (l->data, pv))
|
||||
if (!_clutter_effect_modify_paint_volume (l->data, pv))
|
||||
{
|
||||
clutter_paint_volume_free (pv);
|
||||
CLUTTER_NOTE (CLIPPING, "Bail from get_paint_volume (%s): "
|
||||
@@ -17487,7 +17572,7 @@ _clutter_actor_get_paint_volume_real (ClutterActor *self,
|
||||
/* otherwise, get the cumulative volume */
|
||||
effects = _clutter_meta_group_peek_metas (priv->effects);
|
||||
for (l = effects; l != NULL; l = l->next)
|
||||
if (!_clutter_effect_get_paint_volume (l->data, pv))
|
||||
if (!_clutter_effect_modify_paint_volume (l->data, pv))
|
||||
{
|
||||
clutter_paint_volume_free (pv);
|
||||
CLUTTER_NOTE (CLIPPING, "Bail from get_paint_volume (%s): "
|
||||
@@ -17716,9 +17801,9 @@ clutter_actor_get_paint_box (ClutterActor *self,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_clutter_actor_get_resource_scale_for_rect (ClutterActor *self,
|
||||
graphene_rect_t *bounding_rect,
|
||||
float *resource_scale)
|
||||
_clutter_actor_get_resource_scale_for_rect (ClutterActor *self,
|
||||
ClutterRect *bounding_rect,
|
||||
float *resource_scale)
|
||||
{
|
||||
ClutterActor *stage;
|
||||
float max_scale = 0;
|
||||
@@ -17741,7 +17826,7 @@ static gboolean
|
||||
_clutter_actor_compute_resource_scale (ClutterActor *self,
|
||||
float *resource_scale)
|
||||
{
|
||||
graphene_rect_t bounding_rect;
|
||||
ClutterRect bounding_rect;
|
||||
ClutterActorPrivate *priv = self->priv;
|
||||
|
||||
if (CLUTTER_ACTOR_IN_DESTRUCTION (self) ||
|
||||
@@ -18285,13 +18370,13 @@ clutter_actor_get_layout_manager (ClutterActor *self)
|
||||
}
|
||||
|
||||
static const ClutterLayoutInfo default_layout_info = {
|
||||
GRAPHENE_POINT_INIT_ZERO, /* fixed-pos */
|
||||
CLUTTER_POINT_INIT_ZERO, /* fixed-pos */
|
||||
{ 0, 0, 0, 0 }, /* margin */
|
||||
CLUTTER_ACTOR_ALIGN_FILL, /* x-align */
|
||||
CLUTTER_ACTOR_ALIGN_FILL, /* y-align */
|
||||
FALSE, FALSE, /* expand */
|
||||
GRAPHENE_SIZE_INIT_ZERO, /* minimum */
|
||||
GRAPHENE_SIZE_INIT_ZERO, /* natural */
|
||||
CLUTTER_SIZE_INIT_ZERO, /* minimum */
|
||||
CLUTTER_SIZE_INIT_ZERO, /* natural */
|
||||
};
|
||||
|
||||
static void
|
||||
|
@@ -431,7 +431,7 @@ void clutter_actor_get_allocation_box
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_get_allocation_vertices (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
graphene_point3d_t *verts);
|
||||
ClutterVertex verts[]);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_actor_has_allocation (ClutterActor *self);
|
||||
CLUTTER_EXPORT
|
||||
@@ -817,16 +817,16 @@ gboolean clutter_actor_transform_stage_point
|
||||
gfloat *y_out);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_get_abs_allocation_vertices (ClutterActor *self,
|
||||
graphene_point3d_t *verts);
|
||||
ClutterVertex verts[]);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_apply_transform_to_point (ClutterActor *self,
|
||||
const graphene_point3d_t *point,
|
||||
graphene_point3d_t *vertex);
|
||||
const ClutterVertex *point,
|
||||
ClutterVertex *vertex);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
const graphene_point3d_t *point,
|
||||
graphene_point3d_t *vertex);
|
||||
const ClutterVertex *point,
|
||||
ClutterVertex *vertex);
|
||||
|
||||
/* Implicit animations */
|
||||
CLUTTER_EXPORT
|
||||
|
@@ -94,6 +94,10 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterMatrix, clutter_matrix_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintNode, clutter_paint_node_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintVolume, clutter_paint_volume_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPathNode, clutter_path_node_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPoint, clutter_point_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterRect, clutter_rect_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterSize, clutter_size_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterVertex, clutter_vertex_free)
|
||||
|
||||
#endif /* __GI_SCANNER__ */
|
||||
|
||||
|
@@ -1111,7 +1111,7 @@ _clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
|
||||
{
|
||||
if (backend->dummy_onscreen == COGL_INVALID_HANDLE)
|
||||
{
|
||||
CoglError *internal_error = NULL;
|
||||
GError *internal_error = NULL;
|
||||
|
||||
backend->dummy_onscreen = cogl_onscreen_new (backend->cogl_context, 1, 1);
|
||||
|
||||
@@ -1119,7 +1119,7 @@ _clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
|
||||
&internal_error))
|
||||
{
|
||||
g_critical ("Unable to create dummy onscreen: %s", internal_error->message);
|
||||
cogl_error_free (internal_error);
|
||||
g_error_free (internal_error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -152,9 +152,7 @@ clutter_bind_constraint_update_allocation (ClutterConstraint *constraint,
|
||||
ClutterBindConstraint *bind = CLUTTER_BIND_CONSTRAINT (constraint);
|
||||
gfloat source_width, source_height;
|
||||
gfloat actor_width, actor_height;
|
||||
graphene_point3d_t source_position;
|
||||
|
||||
source_position = GRAPHENE_POINT3D_INIT (0.f, 0.f, 0.f);
|
||||
ClutterVertex source_position = { 0., };
|
||||
|
||||
if (bind->source == NULL)
|
||||
return;
|
||||
|
@@ -235,8 +235,7 @@ clutter_binding_pool_finalize (GObject *gobject)
|
||||
|
||||
g_hash_table_destroy (pool->entries_hash);
|
||||
|
||||
g_slist_foreach (pool->entries, (GFunc) binding_entry_free, NULL);
|
||||
g_slist_free (pool->entries);
|
||||
g_slist_free_full (pool->entries, (GDestroyNotify) binding_entry_free);
|
||||
|
||||
G_OBJECT_CLASS (clutter_binding_pool_parent_class)->finalize (gobject);
|
||||
}
|
||||
|
@@ -178,11 +178,11 @@ clutter_blur_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_blur_effect_get_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
clutter_blur_effect_modify_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
gfloat cur_width, cur_height;
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
|
||||
clutter_paint_volume_get_origin (volume, &origin);
|
||||
cur_width = clutter_paint_volume_get_width (volume);
|
||||
@@ -223,7 +223,7 @@ clutter_blur_effect_class_init (ClutterBlurEffectClass *klass)
|
||||
gobject_class->dispose = clutter_blur_effect_dispose;
|
||||
|
||||
effect_class->pre_paint = clutter_blur_effect_pre_paint;
|
||||
effect_class->get_paint_volume = clutter_blur_effect_get_paint_volume;
|
||||
effect_class->modify_paint_volume = clutter_blur_effect_modify_paint_volume;
|
||||
|
||||
offscreen_class = CLUTTER_OFFSCREEN_EFFECT_CLASS (klass);
|
||||
offscreen_class->paint_target = clutter_blur_effect_paint_target;
|
||||
@@ -249,9 +249,7 @@ clutter_blur_effect_init (ClutterBlurEffect *self)
|
||||
cogl_pipeline_add_layer_snippet (klass->base_pipeline, 0, snippet);
|
||||
cogl_object_unref (snippet);
|
||||
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline,
|
||||
0, /* layer number */
|
||||
COGL_TEXTURE_TYPE_2D);
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline, 0);
|
||||
}
|
||||
|
||||
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
||||
|
@@ -438,9 +438,7 @@ clutter_brightness_contrast_effect_init (ClutterBrightnessContrastEffect *self)
|
||||
cogl_pipeline_add_snippet (klass->base_pipeline, snippet);
|
||||
cogl_object_unref (snippet);
|
||||
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline,
|
||||
0, /* layer number */
|
||||
COGL_TEXTURE_TYPE_2D);
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline, 0);
|
||||
}
|
||||
|
||||
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
||||
|
@@ -355,6 +355,10 @@ on_captured_event (ClutterActor *stage,
|
||||
|
||||
switch (clutter_event_type (event))
|
||||
{
|
||||
case CLUTTER_TOUCH_CANCEL:
|
||||
clutter_click_action_release (action);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCH_END:
|
||||
has_button = FALSE;
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
|
@@ -252,6 +252,13 @@ clutter_clone_allocate (ClutterActor *self,
|
||||
if (priv->clone_source == NULL)
|
||||
return;
|
||||
|
||||
/* ClutterActor delays allocating until the actor is shown; however
|
||||
* we cannot paint it correctly in that case, so force an allocation.
|
||||
*/
|
||||
if (clutter_actor_get_parent (priv->clone_source) != NULL &&
|
||||
!clutter_actor_has_allocation (priv->clone_source))
|
||||
clutter_actor_allocate_preferred_size (priv->clone_source, flags);
|
||||
|
||||
#if 0
|
||||
/* XXX - this is wrong: ClutterClone cannot clone unparented
|
||||
* actors, as it will break all invariants
|
||||
|
@@ -293,9 +293,7 @@ clutter_colorize_effect_init (ClutterColorizeEffect *self)
|
||||
cogl_pipeline_add_snippet (klass->base_pipeline, snippet);
|
||||
cogl_object_unref (snippet);
|
||||
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline,
|
||||
0, /* layer number */
|
||||
COGL_TEXTURE_TYPE_2D);
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline, 0);
|
||||
}
|
||||
|
||||
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
||||
|
@@ -177,7 +177,7 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
|
||||
if (priv->is_dirty)
|
||||
{
|
||||
graphene_rect_t rect;
|
||||
ClutterRect rect;
|
||||
gboolean mapped_buffer;
|
||||
CoglVertexP3T2C4 *verts;
|
||||
ClutterActor *actor;
|
||||
@@ -193,8 +193,8 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
*/
|
||||
if (clutter_offscreen_effect_get_target_rect (effect, &rect))
|
||||
{
|
||||
width = graphene_rect_get_width (&rect);
|
||||
height = graphene_rect_get_height (&rect);
|
||||
width = clutter_rect_get_width (&rect);
|
||||
height = clutter_rect_get_height (&rect);
|
||||
}
|
||||
else
|
||||
clutter_actor_get_size (actor, &width, &height);
|
||||
@@ -282,6 +282,7 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
/* enable depth testing */
|
||||
cogl_depth_state_init (&depth_state);
|
||||
cogl_depth_state_set_test_enabled (&depth_state, TRUE);
|
||||
cogl_depth_state_set_test_function (&depth_state, COGL_DEPTH_TEST_FUNCTION_LEQUAL);
|
||||
cogl_pipeline_set_depth_state (pipeline, &depth_state, NULL);
|
||||
|
||||
/* enable backface culling if we have a back material */
|
||||
|
@@ -17,7 +17,6 @@
|
||||
#include "deprecated/clutter-container.h"
|
||||
#include "deprecated/clutter-group.h"
|
||||
#include "deprecated/clutter-keysyms.h"
|
||||
#include "deprecated/clutter-main.h"
|
||||
#include "deprecated/clutter-rectangle.h"
|
||||
#include "deprecated/clutter-stage-manager.h"
|
||||
#include "deprecated/clutter-stage.h"
|
||||
|
@@ -297,9 +297,7 @@ clutter_desaturate_effect_init (ClutterDesaturateEffect *self)
|
||||
cogl_pipeline_add_snippet (klass->base_pipeline, snippet);
|
||||
cogl_object_unref (snippet);
|
||||
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline,
|
||||
0, /* layer number */
|
||||
COGL_TEXTURE_TYPE_2D);
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline, 0);
|
||||
}
|
||||
|
||||
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
||||
|
@@ -69,6 +69,22 @@ typedef struct _ClutterTouchInfo
|
||||
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 secondary_click_timer;
|
||||
gboolean secondary_click_triggered;
|
||||
} ClutterPtrA11yData;
|
||||
|
||||
struct _ClutterInputDevice
|
||||
{
|
||||
GObject parent_instance;
|
||||
@@ -143,6 +159,10 @@ struct _ClutterInputDevice
|
||||
|
||||
guint has_cursor : 1;
|
||||
guint is_enabled : 1;
|
||||
|
||||
/* Accessiblity */
|
||||
ClutterVirtualInputDevice *accessibility_virtual_device;
|
||||
ClutterPtrA11yData *ptr_a11y_data;
|
||||
};
|
||||
|
||||
typedef void (*ClutterEmitInputDeviceEvent) (ClutterEvent *event,
|
||||
@@ -167,10 +187,6 @@ struct _ClutterInputDeviceClass
|
||||
gboolean (* is_grouped) (ClutterInputDevice *device,
|
||||
ClutterInputDevice *other_device);
|
||||
|
||||
gboolean (* get_physical_size) (ClutterInputDevice *device,
|
||||
gdouble *width,
|
||||
gdouble *height);
|
||||
|
||||
/* Keyboard accessbility */
|
||||
void (* process_kbd_a11y_event) (ClutterEvent *event,
|
||||
ClutterInputDevice *device,
|
||||
|
@@ -47,6 +47,7 @@
|
||||
#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
|
||||
{
|
||||
@@ -55,6 +56,8 @@ struct _ClutterDeviceManagerPrivate
|
||||
|
||||
/* Keyboard a11y */
|
||||
ClutterKbdA11ySettings kbd_a11y_settings;
|
||||
/* Pointer a11y */
|
||||
ClutterPointerA11ySettings pointer_a11y_settings;
|
||||
};
|
||||
|
||||
enum
|
||||
@@ -75,6 +78,9 @@ enum
|
||||
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
|
||||
};
|
||||
@@ -239,6 +245,67 @@ clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
|
||||
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
|
||||
*
|
||||
* 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,
|
||||
G_TYPE_NONE, 2,
|
||||
CLUTTER_TYPE_INPUT_DEVICE,
|
||||
CLUTTER_TYPE_POINTER_A11Y_TIMEOUT_TYPE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -550,13 +617,7 @@ static gboolean
|
||||
are_kbd_a11y_settings_equal (ClutterKbdA11ySettings *a,
|
||||
ClutterKbdA11ySettings *b)
|
||||
{
|
||||
return (a->controls == b->controls &&
|
||||
a->slowkeys_delay == b->slowkeys_delay &&
|
||||
a->debounce_delay == b->debounce_delay &&
|
||||
a->timeout_delay == b->timeout_delay &&
|
||||
a->mousekeys_init_delay == b->mousekeys_init_delay &&
|
||||
a->mousekeys_max_speed == b->mousekeys_max_speed &&
|
||||
a->mousekeys_accel_time == b->mousekeys_accel_time);
|
||||
return (memcmp (a, b, sizeof (ClutterKbdA11ySettings)) == 0);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -585,3 +646,88 @@ clutter_device_manager_get_kbd_a11y_settings (ClutterDeviceManager *device_man
|
||||
|
||||
*settings = device_manager->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)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
if (are_pointer_a11y_settings_equal (&device_manager->priv->pointer_a11y_settings, settings))
|
||||
return;
|
||||
|
||||
if (device_manager->priv->pointer_a11y_settings.controls == 0 && settings->controls != 0)
|
||||
clutter_device_manager_enable_pointer_a11y (device_manager);
|
||||
else if (device_manager->priv->pointer_a11y_settings.controls != 0 && settings->controls == 0)
|
||||
clutter_device_manager_disable_pointer_a11y (device_manager);
|
||||
|
||||
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)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
*settings = device_manager->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)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
device_manager->priv->pointer_a11y_settings.dwell_click_type = click_type;
|
||||
}
|
||||
|
@@ -73,6 +73,27 @@ typedef struct _ClutterKbdA11ySettings
|
||||
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;
|
||||
|
||||
/**
|
||||
* ClutterDeviceManager:
|
||||
*
|
||||
@@ -152,10 +173,23 @@ ClutterVirtualDeviceType clutter_device_manager_get_supported_virtual_device_typ
|
||||
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__ */
|
||||
|
@@ -81,7 +81,7 @@ struct _ClutterDragActionPrivate
|
||||
gint y_drag_threshold;
|
||||
ClutterActor *drag_handle;
|
||||
ClutterDragAxis drag_axis;
|
||||
graphene_rect_t drag_area;
|
||||
ClutterRect drag_area;
|
||||
|
||||
ClutterInputDevice *device;
|
||||
ClutterEventSequence *sequence;
|
||||
@@ -542,7 +542,7 @@ clutter_drag_action_real_drag_motion (ClutterDragAction *action,
|
||||
|
||||
if (action->priv->drag_area_set)
|
||||
{
|
||||
graphene_rect_t *drag_area = &action->priv->drag_area;
|
||||
ClutterRect *drag_area = &action->priv->drag_area;
|
||||
|
||||
x = CLAMP (x, drag_area->origin.x, drag_area->origin.x + drag_area->size.width);
|
||||
y = CLAMP (y, drag_area->origin.y, drag_area->origin.y + drag_area->size.height);
|
||||
@@ -811,7 +811,7 @@ clutter_drag_action_class_init (ClutterDragActionClass *klass)
|
||||
g_param_spec_boxed ("drag-area",
|
||||
P_("Drag Area"),
|
||||
P_("Constrains the dragging to a rectangle"),
|
||||
GRAPHENE_TYPE_RECT,
|
||||
CLUTTER_TYPE_RECT,
|
||||
CLUTTER_PARAM_READWRITE);
|
||||
|
||||
/**
|
||||
@@ -1267,10 +1267,10 @@ clutter_drag_action_get_motion_coords (ClutterDragAction *action,
|
||||
/**
|
||||
* clutter_drag_action_get_drag_area:
|
||||
* @action: a #ClutterDragAction
|
||||
* @drag_area: (out caller-allocates): a #graphene_rect_t to be filled
|
||||
* @drag_area: (out caller-allocates): a #ClutterRect to be filled
|
||||
*
|
||||
* Retrieves the "drag area" associated with @action, that
|
||||
* is a #graphene_rect_t that constrains the actor movements,
|
||||
* is a #ClutterRect that constrains the actor movements,
|
||||
* in parents coordinates.
|
||||
*
|
||||
* Returns: %TRUE if the actor is actually constrained (and thus
|
||||
@@ -1278,7 +1278,7 @@ clutter_drag_action_get_motion_coords (ClutterDragAction *action,
|
||||
*/
|
||||
gboolean
|
||||
clutter_drag_action_get_drag_area (ClutterDragAction *action,
|
||||
graphene_rect_t *drag_area)
|
||||
ClutterRect *drag_area)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_DRAG_ACTION (action), FALSE);
|
||||
|
||||
@@ -1298,8 +1298,8 @@ clutter_drag_action_get_drag_area (ClutterDragAction *action,
|
||||
* If @drag_area is %NULL, the actor is not constrained.
|
||||
*/
|
||||
void
|
||||
clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const graphene_rect_t *drag_area)
|
||||
clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const ClutterRect *drag_area)
|
||||
{
|
||||
ClutterDragActionPrivate *priv;
|
||||
|
||||
|
@@ -141,11 +141,11 @@ void clutter_drag_action_get_motion_coords (ClutterDragAction *actio
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_drag_action_get_drag_area (ClutterDragAction *action,
|
||||
graphene_rect_t *drag_area);
|
||||
ClutterRect *drag_area);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const graphene_rect_t *drag_area);
|
||||
void clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const ClutterRect *drag_area);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -7,7 +7,7 @@ G_BEGIN_DECLS
|
||||
|
||||
gboolean _clutter_effect_pre_paint (ClutterEffect *effect);
|
||||
void _clutter_effect_post_paint (ClutterEffect *effect);
|
||||
gboolean _clutter_effect_get_paint_volume (ClutterEffect *effect,
|
||||
gboolean _clutter_effect_modify_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume);
|
||||
gboolean _clutter_effect_has_custom_paint_volume (ClutterEffect *effect);
|
||||
void _clutter_effect_paint (ClutterEffect *effect,
|
||||
|
@@ -188,8 +188,8 @@ clutter_effect_real_post_paint (ClutterEffect *effect)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_effect_real_get_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
clutter_effect_real_modify_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -252,7 +252,7 @@ clutter_effect_class_init (ClutterEffectClass *klass)
|
||||
|
||||
klass->pre_paint = clutter_effect_real_pre_paint;
|
||||
klass->post_paint = clutter_effect_real_post_paint;
|
||||
klass->get_paint_volume = clutter_effect_real_get_paint_volume;
|
||||
klass->modify_paint_volume = clutter_effect_real_modify_paint_volume;
|
||||
klass->paint = clutter_effect_real_paint;
|
||||
klass->pick = clutter_effect_real_pick;
|
||||
}
|
||||
@@ -297,13 +297,14 @@ _clutter_effect_pick (ClutterEffect *effect,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_effect_get_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
_clutter_effect_modify_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_EFFECT (effect), FALSE);
|
||||
g_return_val_if_fail (volume != NULL, FALSE);
|
||||
|
||||
return CLUTTER_EFFECT_GET_CLASS (effect)->get_paint_volume (effect, volume);
|
||||
return CLUTTER_EFFECT_GET_CLASS (effect)->modify_paint_volume (effect,
|
||||
volume);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -311,7 +312,7 @@ _clutter_effect_has_custom_paint_volume (ClutterEffect *effect)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_EFFECT (effect), FALSE);
|
||||
|
||||
return CLUTTER_EFFECT_GET_CLASS (effect)->get_paint_volume != clutter_effect_real_get_paint_volume;
|
||||
return CLUTTER_EFFECT_GET_CLASS (effect)->modify_paint_volume != clutter_effect_real_modify_paint_volume;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -60,7 +60,7 @@ struct _ClutterEffect
|
||||
* ClutterEffectClass:
|
||||
* @pre_paint: virtual function
|
||||
* @post_paint: virtual function
|
||||
* @get_paint_volume: virtual function
|
||||
* @modify_paint_volume: virtual function
|
||||
* @paint: virtual function
|
||||
* @pick: virtual function
|
||||
*
|
||||
@@ -74,16 +74,16 @@ struct _ClutterEffectClass
|
||||
ClutterActorMetaClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
gboolean (* pre_paint) (ClutterEffect *effect);
|
||||
void (* post_paint) (ClutterEffect *effect);
|
||||
gboolean (* pre_paint) (ClutterEffect *effect);
|
||||
void (* post_paint) (ClutterEffect *effect);
|
||||
|
||||
gboolean (* get_paint_volume) (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume);
|
||||
gboolean (* modify_paint_volume) (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume);
|
||||
|
||||
void (* paint) (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags);
|
||||
void (* pick) (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags);
|
||||
void (* paint) (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags);
|
||||
void (* pick) (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags);
|
||||
|
||||
/*< private >*/
|
||||
void (* _clutter_effect4) (void);
|
||||
|
@@ -13,7 +13,7 @@ G_BEGIN_DECLS
|
||||
/*** END file-header ***/
|
||||
|
||||
/*** BEGIN file-production ***/
|
||||
/* enumerations from "@filename@" */
|
||||
/* enumerations from "@basename@" */
|
||||
/*** END file-production ***/
|
||||
|
||||
/*** BEGIN value-header ***/
|
||||
|
@@ -277,24 +277,6 @@ typedef enum
|
||||
CLUTTER_ANIMATION_LAST
|
||||
} ClutterAnimationMode;
|
||||
|
||||
/**
|
||||
* ClutterFontFlags:
|
||||
* @CLUTTER_FONT_MIPMAPPING: Set to use mipmaps for the glyph cache textures.
|
||||
* @CLUTTER_FONT_HINTING: Set to enable hinting on the glyphs.
|
||||
*
|
||||
* Runtime flags to change the font quality. To be used with
|
||||
* clutter_set_font_flags().
|
||||
*
|
||||
* Since: 1.0
|
||||
*
|
||||
* Deprecated: 1.22: Use #cairo_font_options_t instead
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_FONT >*/
|
||||
{
|
||||
CLUTTER_FONT_MIPMAPPING = (1 << 0),
|
||||
CLUTTER_FONT_HINTING = (1 << 1)
|
||||
} ClutterFontFlags;
|
||||
|
||||
/**
|
||||
* ClutterTextDirection:
|
||||
* @CLUTTER_TEXT_DIRECTION_DEFAULT: Use the default setting, as returned
|
||||
@@ -443,6 +425,88 @@ typedef enum
|
||||
CLUTTER_A11Y_FEATURE_STATE_CHANGE_BEEP = 1 << 13,
|
||||
} ClutterKeyboardA11yFlags;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11yFlags:
|
||||
* @CLUTTER_A11Y_POINTER_ENABLED:
|
||||
* @CLUTTER_A11Y_SECONDARY_CLICK_ENABLED:
|
||||
* @CLUTTER_A11Y_DWELL_ENABLED:
|
||||
*
|
||||
* Pointer accessibility features applied to a ClutterInputDevice pointer.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_SECONDARY_CLICK_ENABLED = 1 << 0,
|
||||
CLUTTER_A11Y_DWELL_ENABLED = 1 << 1,
|
||||
} ClutterPointerA11yFlags;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11yDwellClickType:
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE: Internal use only
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY:
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY:
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE:
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE:
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG:
|
||||
*
|
||||
* Dwell click types.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE,
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY,
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY,
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE,
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE,
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG,
|
||||
} ClutterPointerA11yDwellClickType;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11yDwellDirection:
|
||||
* @CLUTTER_A11Y_DWELL_DIRECTION_NONE:
|
||||
* @CLUTTER_A11Y_DWELL_DIRECTION_LEFT:
|
||||
* @CLUTTER_A11Y_DWELL_DIRECTION_RIGHT:
|
||||
* @CLUTTER_A11Y_DWELL_DIRECTION_UP:
|
||||
* @CLUTTER_A11Y_DWELL_DIRECTION_DOWN:
|
||||
*
|
||||
* Dwell gesture directions.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_DWELL_DIRECTION_NONE,
|
||||
CLUTTER_A11Y_DWELL_DIRECTION_LEFT,
|
||||
CLUTTER_A11Y_DWELL_DIRECTION_RIGHT,
|
||||
CLUTTER_A11Y_DWELL_DIRECTION_UP,
|
||||
CLUTTER_A11Y_DWELL_DIRECTION_DOWN,
|
||||
} ClutterPointerA11yDwellDirection;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11yDwellMode:
|
||||
* @CLUTTER_A11Y_DWELL_MODE_WINDOW:
|
||||
* @CLUTTER_A11Y_DWELL_MODE_GESTURE:
|
||||
*
|
||||
* Dwell mode.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_DWELL_MODE_WINDOW,
|
||||
CLUTTER_A11Y_DWELL_MODE_GESTURE,
|
||||
} ClutterPointerA11yDwellMode;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11yTimeoutType:
|
||||
* @CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK:
|
||||
* @CLUTTER_A11Y_TIMEOUT_TYPE_DWELL:
|
||||
* @CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE:
|
||||
*
|
||||
* Pointer accessibility timeout type.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
||||
} ClutterPointerA11yTimeoutType;
|
||||
|
||||
/**
|
||||
* ClutterActorFlags:
|
||||
* @CLUTTER_ACTOR_MAPPED: the actor will be painted (is visible, and inside
|
||||
@@ -892,8 +956,6 @@ typedef enum /*< prefix=CLUTTER_SCROLL >*/
|
||||
|
||||
/**
|
||||
* ClutterStageState:
|
||||
* @CLUTTER_STAGE_STATE_FULLSCREEN: Fullscreen mask
|
||||
* @CLUTTER_STAGE_STATE_OFFSCREEN: Offscreen mask (deprecated)
|
||||
* @CLUTTER_STAGE_STATE_ACTIVATED: Activated mask
|
||||
*
|
||||
* Stage state masks, used by the #ClutterEvent of type %CLUTTER_STAGE_STATE.
|
||||
@@ -902,19 +964,15 @@ typedef enum /*< prefix=CLUTTER_SCROLL >*/
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_STAGE_STATE_FULLSCREEN = (1 << 1),
|
||||
CLUTTER_STAGE_STATE_OFFSCREEN = (1 << 2),
|
||||
CLUTTER_STAGE_STATE_ACTIVATED = (1 << 3)
|
||||
} ClutterStageState;
|
||||
|
||||
/**
|
||||
* ClutterFeatureFlags:
|
||||
* @CLUTTER_FEATURE_TEXTURE_NPOT: Set if NPOTS textures supported.
|
||||
* @CLUTTER_FEATURE_SWAP_THROTTLE: Set if backend throttles buffer swaps.
|
||||
* @CLUTTER_FEATURE_TEXTURE_YUV: Set if YUV based textures supported.
|
||||
* @CLUTTER_FEATURE_TEXTURE_READ_PIXELS: Set if texture pixels can be read.
|
||||
* @CLUTTER_FEATURE_STAGE_STATIC: Set if stage size if fixed (i.e framebuffer)
|
||||
* @CLUTTER_FEATURE_STAGE_USER_RESIZE: Set if stage is able to be user resized.
|
||||
* @CLUTTER_FEATURE_STAGE_CURSOR: Set if stage has a graphical cursor.
|
||||
* @CLUTTER_FEATURE_SHADERS_GLSL: Set if the backend supports GLSL shaders.
|
||||
* @CLUTTER_FEATURE_OFFSCREEN: Set if the backend supports offscreen rendering.
|
||||
@@ -928,12 +986,10 @@ typedef enum
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_FEATURE_TEXTURE_NPOT = (1 << 2),
|
||||
CLUTTER_FEATURE_SWAP_THROTTLE = (1 << 3),
|
||||
CLUTTER_FEATURE_TEXTURE_YUV = (1 << 4),
|
||||
CLUTTER_FEATURE_TEXTURE_READ_PIXELS = (1 << 5),
|
||||
CLUTTER_FEATURE_STAGE_STATIC = (1 << 6),
|
||||
CLUTTER_FEATURE_STAGE_USER_RESIZE = (1 << 7),
|
||||
CLUTTER_FEATURE_STAGE_CURSOR = (1 << 8),
|
||||
CLUTTER_FEATURE_SHADERS_GLSL = (1 << 9),
|
||||
CLUTTER_FEATURE_OFFSCREEN = (1 << 10),
|
||||
|
@@ -370,7 +370,7 @@ clutter_event_get_coords (const ClutterEvent *event,
|
||||
gfloat *x,
|
||||
gfloat *y)
|
||||
{
|
||||
graphene_point_t coords;
|
||||
ClutterPoint coords;
|
||||
|
||||
g_return_if_fail (event != NULL);
|
||||
|
||||
@@ -386,15 +386,15 @@ clutter_event_get_coords (const ClutterEvent *event,
|
||||
/**
|
||||
* clutter_event_get_position:
|
||||
* @event: a #ClutterEvent
|
||||
* @position: a #graphene_point_t
|
||||
* @position: a #ClutterPoint
|
||||
*
|
||||
* Retrieves the event coordinates as a #graphene_point_t.
|
||||
* Retrieves the event coordinates as a #ClutterPoint.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
void
|
||||
clutter_event_get_position (const ClutterEvent *event,
|
||||
graphene_point_t *position)
|
||||
ClutterPoint *position)
|
||||
{
|
||||
g_return_if_fail (event != NULL);
|
||||
g_return_if_fail (position != NULL);
|
||||
@@ -415,42 +415,42 @@ clutter_event_get_position (const ClutterEvent *event,
|
||||
case CLUTTER_PAD_BUTTON_RELEASE:
|
||||
case CLUTTER_PAD_STRIP:
|
||||
case CLUTTER_PAD_RING:
|
||||
graphene_point_init (position, 0.f, 0.f);
|
||||
clutter_point_init (position, 0.f, 0.f);
|
||||
break;
|
||||
|
||||
case CLUTTER_ENTER:
|
||||
case CLUTTER_LEAVE:
|
||||
graphene_point_init (position, event->crossing.x, event->crossing.y);
|
||||
clutter_point_init (position, event->crossing.x, event->crossing.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
graphene_point_init (position, event->button.x, event->button.y);
|
||||
clutter_point_init (position, event->button.x, event->button.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_MOTION:
|
||||
graphene_point_init (position, event->motion.x, event->motion.y);
|
||||
clutter_point_init (position, event->motion.x, event->motion.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCH_BEGIN:
|
||||
case CLUTTER_TOUCH_UPDATE:
|
||||
case CLUTTER_TOUCH_END:
|
||||
case CLUTTER_TOUCH_CANCEL:
|
||||
graphene_point_init (position, event->touch.x, event->touch.y);
|
||||
clutter_point_init (position, event->touch.x, event->touch.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_SCROLL:
|
||||
graphene_point_init (position, event->scroll.x, event->scroll.y);
|
||||
clutter_point_init (position, event->scroll.x, event->scroll.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCHPAD_PINCH:
|
||||
graphene_point_init (position, event->touchpad_pinch.x,
|
||||
event->touchpad_pinch.y);
|
||||
clutter_point_init (position, event->touchpad_pinch.x,
|
||||
event->touchpad_pinch.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCHPAD_SWIPE:
|
||||
graphene_point_init (position, event->touchpad_swipe.x,
|
||||
event->touchpad_swipe.y);
|
||||
clutter_point_init (position, event->touchpad_swipe.x,
|
||||
event->touchpad_swipe.y);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1021,6 +1021,9 @@ clutter_event_get_event_sequence (const ClutterEvent *event)
|
||||
event->type == CLUTTER_TOUCH_END ||
|
||||
event->type == CLUTTER_TOUCH_CANCEL)
|
||||
return event->touch.sequence;
|
||||
else if (event->type == CLUTTER_ENTER ||
|
||||
event->type == CLUTTER_LEAVE)
|
||||
return event->crossing.sequence;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -1793,12 +1796,12 @@ float
|
||||
clutter_event_get_distance (const ClutterEvent *source,
|
||||
const ClutterEvent *target)
|
||||
{
|
||||
graphene_point_t p0, p1;
|
||||
ClutterPoint p0, p1;
|
||||
|
||||
clutter_event_get_position (source, &p0);
|
||||
clutter_event_get_position (source, &p1);
|
||||
|
||||
return graphene_point_distance (&p0, &p1, NULL, NULL);
|
||||
return clutter_point_distance (&p0, &p1, NULL, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1819,17 +1822,17 @@ double
|
||||
clutter_event_get_angle (const ClutterEvent *source,
|
||||
const ClutterEvent *target)
|
||||
{
|
||||
graphene_point_t p0, p1;
|
||||
ClutterPoint p0, p1;
|
||||
float x_distance, y_distance;
|
||||
double angle;
|
||||
|
||||
clutter_event_get_position (source, &p0);
|
||||
clutter_event_get_position (target, &p1);
|
||||
|
||||
if (graphene_point_equal (&p0, &p1))
|
||||
if (clutter_point_equals (&p0, &p1))
|
||||
return 0;
|
||||
|
||||
graphene_point_distance (&p0, &p1, &x_distance, &y_distance);
|
||||
clutter_point_distance (&p0, &p1, &x_distance, &y_distance);
|
||||
|
||||
angle = atan2 (x_distance, y_distance);
|
||||
|
||||
|
@@ -269,6 +269,7 @@ struct _ClutterCrossingEvent
|
||||
gfloat x;
|
||||
gfloat y;
|
||||
ClutterInputDevice *device;
|
||||
ClutterEventSequence *sequence;
|
||||
ClutterActor *related;
|
||||
};
|
||||
|
||||
@@ -685,7 +686,7 @@ void clutter_event_get_coords (const ClutterEv
|
||||
gfloat *y);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_event_get_position (const ClutterEvent *event,
|
||||
graphene_point_t *position);
|
||||
ClutterPoint *position);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_event_get_distance (const ClutterEvent *source,
|
||||
const ClutterEvent *target);
|
||||
|
@@ -64,17 +64,13 @@ clutter_features_from_cogl (guint cogl_flags)
|
||||
{
|
||||
ClutterFeatureFlags clutter_flags = 0;
|
||||
|
||||
if (cogl_flags & COGL_FEATURE_TEXTURE_NPOT)
|
||||
clutter_flags |= CLUTTER_FEATURE_TEXTURE_NPOT;
|
||||
|
||||
if (cogl_flags & COGL_FEATURE_TEXTURE_YUV)
|
||||
clutter_flags |= CLUTTER_FEATURE_TEXTURE_YUV;
|
||||
|
||||
if (cogl_flags & COGL_FEATURE_TEXTURE_READ_PIXELS)
|
||||
clutter_flags |= CLUTTER_FEATURE_TEXTURE_READ_PIXELS;
|
||||
|
||||
if (cogl_flags & COGL_FEATURE_SHADERS_GLSL)
|
||||
clutter_flags |= CLUTTER_FEATURE_SHADERS_GLSL;
|
||||
clutter_flags |= CLUTTER_FEATURE_SHADERS_GLSL;
|
||||
|
||||
if (cogl_flags & COGL_FEATURE_OFFSCREEN)
|
||||
clutter_flags |= CLUTTER_FEATURE_OFFSCREEN;
|
||||
|
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Authored By Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
|
||||
*
|
||||
* Copyright (C) 2019 Endless, Inc
|
||||
* Copyright (C) 2009, 2010 Intel Corp
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "clutter-graphene.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-types.h"
|
||||
|
||||
static gboolean
|
||||
graphene_point_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
gdouble progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_point_t *ap = g_value_get_boxed (a);
|
||||
const graphene_point_t *bp = g_value_get_boxed (b);
|
||||
graphene_point_t res;
|
||||
|
||||
graphene_point_interpolate (ap, bp, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
graphene_point3d_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
gdouble progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_point3d_t *av = g_value_get_boxed (a);
|
||||
const graphene_point3d_t *bv = g_value_get_boxed (b);
|
||||
graphene_point3d_t res;
|
||||
|
||||
graphene_point3d_interpolate (av, bv, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
graphene_rect_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
gdouble progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_rect_t *rect_a = g_value_get_boxed (a);
|
||||
const graphene_rect_t *rect_b = g_value_get_boxed (b);
|
||||
graphene_rect_t res;
|
||||
|
||||
graphene_rect_interpolate (rect_a, rect_b, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
graphene_size_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
gdouble progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_size_t *as = g_value_get_boxed (a);
|
||||
const graphene_size_t *bs = g_value_get_boxed (b);
|
||||
graphene_size_t res;
|
||||
|
||||
graphene_size_interpolate (as, bs, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
clutter_graphene_init (void)
|
||||
{
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT,
|
||||
graphene_point_progress);
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT3D,
|
||||
graphene_point3d_progress);
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_RECT,
|
||||
graphene_rect_progress);
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_SIZE,
|
||||
graphene_size_progress);
|
||||
}
|
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Authored By Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
|
||||
*
|
||||
* Copyright (C) 2019 Endless, Inc
|
||||
* Copyright (C) 2009, 2010 Intel Corp
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CLUTTER_GRAPHENE_H
|
||||
#define CLUTTER_GRAPHENE_H
|
||||
|
||||
void clutter_graphene_init (void);
|
||||
|
||||
#endif
|
@@ -107,6 +107,9 @@ clutter_input_device_dispose (GObject *gobject)
|
||||
device->associated = NULL;
|
||||
}
|
||||
|
||||
if (device->accessibility_virtual_device)
|
||||
g_clear_object (&device->accessibility_virtual_device);
|
||||
|
||||
g_clear_pointer (&device->axes, g_array_unref);
|
||||
g_clear_pointer (&device->keys, g_array_unref);
|
||||
g_clear_pointer (&device->scroll_info, g_array_unref);
|
||||
@@ -834,6 +837,7 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
|
||||
event->crossing.x = device->current_x;
|
||||
event->crossing.y = device->current_y;
|
||||
event->crossing.related = actor;
|
||||
event->crossing.sequence = sequence;
|
||||
clutter_event_set_device (event, device);
|
||||
|
||||
/* we need to make sure that this event is processed
|
||||
@@ -870,6 +874,7 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
|
||||
event->crossing.y = device->current_y;
|
||||
event->crossing.source = actor;
|
||||
event->crossing.related = old_actor;
|
||||
event->crossing.sequence = sequence;
|
||||
clutter_event_set_device (event, device);
|
||||
|
||||
/* see above */
|
||||
@@ -986,7 +991,7 @@ clutter_input_device_get_enabled (ClutterInputDevice *device)
|
||||
gboolean
|
||||
clutter_input_device_get_coords (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
graphene_point_t *point)
|
||||
ClutterPoint *point)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
||||
g_return_val_if_fail (point != NULL, FALSE);
|
||||
@@ -1033,12 +1038,11 @@ _clutter_input_device_update (ClutterInputDevice *device,
|
||||
ClutterStage *stage;
|
||||
ClutterActor *new_cursor_actor;
|
||||
ClutterActor *old_cursor_actor;
|
||||
graphene_point_t point;
|
||||
ClutterPoint point = { -1, -1 };
|
||||
ClutterInputDeviceType device_type = device->device_type;
|
||||
|
||||
point = GRAPHENE_POINT_INIT (-1.0f, -1.0f);
|
||||
|
||||
if (device->device_type == CLUTTER_KEYBOARD_DEVICE)
|
||||
return NULL;
|
||||
g_assert (device_type != CLUTTER_KEYBOARD_DEVICE &&
|
||||
device_type != CLUTTER_PAD_DEVICE);
|
||||
|
||||
stage = device->stage;
|
||||
if (G_UNLIKELY (stage == NULL))
|
||||
@@ -2286,15 +2290,3 @@ clutter_input_device_is_grouped (ClutterInputDevice *device,
|
||||
|
||||
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->is_grouped (device, other_device);
|
||||
}
|
||||
|
||||
gboolean
|
||||
clutter_input_device_get_physical_size (ClutterInputDevice *device,
|
||||
gdouble *width,
|
||||
gdouble *height)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
||||
|
||||
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->get_physical_size (device,
|
||||
width,
|
||||
height);
|
||||
}
|
||||
|
@@ -58,7 +58,7 @@ gint clutter_input_device_get_device_id (ClutterInputDev
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_input_device_get_coords (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
graphene_point_t *point);
|
||||
ClutterPoint *point);
|
||||
CLUTTER_EXPORT
|
||||
ClutterModifierType clutter_input_device_get_modifier_state (ClutterInputDevice *device);
|
||||
CLUTTER_EXPORT
|
||||
@@ -171,10 +171,6 @@ void clutter_input_device_set_mapping_mode (ClutterInputDev
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_input_device_is_grouped (ClutterInputDevice *device,
|
||||
ClutterInputDevice *other_device);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_input_device_get_physical_size (ClutterInputDevice *device,
|
||||
gdouble *width,
|
||||
gdouble *height);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -89,8 +89,8 @@ clutter_input_focus_reset (ClutterInputFocus *focus)
|
||||
}
|
||||
|
||||
void
|
||||
clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const graphene_rect_t *rect)
|
||||
clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const ClutterRect *rect)
|
||||
{
|
||||
ClutterInputFocusPrivate *priv;
|
||||
|
||||
|
@@ -57,8 +57,8 @@ gboolean clutter_input_focus_is_focused (ClutterInputFocus *focus);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_focus_reset (ClutterInputFocus *focus);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const graphene_rect_t *rect);
|
||||
void clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const ClutterRect *rect);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_focus_set_surrounding (ClutterInputFocus *focus,
|
||||
|
@@ -26,8 +26,8 @@ ClutterInputFocus * clutter_input_method_get_focus (ClutterInputMethod *method);
|
||||
|
||||
void clutter_input_method_reset (ClutterInputMethod *method);
|
||||
|
||||
void clutter_input_method_set_cursor_location (ClutterInputMethod *method,
|
||||
const graphene_rect_t *rect);
|
||||
void clutter_input_method_set_cursor_location (ClutterInputMethod *method,
|
||||
const ClutterRect *rect);
|
||||
void clutter_input_method_set_surrounding (ClutterInputMethod *method,
|
||||
const gchar *text,
|
||||
guint cursor,
|
||||
|
@@ -187,7 +187,7 @@ clutter_input_method_class_init (ClutterInputMethodClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1, GRAPHENE_TYPE_RECT);
|
||||
G_TYPE_NONE, 1, CLUTTER_TYPE_RECT);
|
||||
|
||||
pspecs[PROP_CONTENT_HINTS] =
|
||||
g_param_spec_flags ("content-hints",
|
||||
@@ -377,8 +377,8 @@ clutter_input_method_reset (ClutterInputMethod *im)
|
||||
}
|
||||
|
||||
void
|
||||
clutter_input_method_set_cursor_location (ClutterInputMethod *im,
|
||||
const graphene_rect_t *rect)
|
||||
clutter_input_method_set_cursor_location (ClutterInputMethod *im,
|
||||
const ClutterRect *rect)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im));
|
||||
|
||||
|
@@ -42,8 +42,8 @@ struct _ClutterInputMethodClass
|
||||
|
||||
void (* reset) (ClutterInputMethod *im);
|
||||
|
||||
void (* set_cursor_location) (ClutterInputMethod *im,
|
||||
const graphene_rect_t *rect);
|
||||
void (* set_cursor_location) (ClutterInputMethod *im,
|
||||
const ClutterRect *rect);
|
||||
void (* set_surrounding) (ClutterInputMethod *im,
|
||||
const gchar *text,
|
||||
guint cursor,
|
||||
|
42
clutter/clutter/clutter-input-pointer-a11y-private.h
Normal file
42
clutter/clutter/clutter-input-pointer-a11y-private.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Red Hat
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Author: Olivier Fourdan <ofourdan@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef __CLUTTER_INPUT_POINTER_A11Y_H__
|
||||
#define __CLUTTER_INPUT_POINTER_A11Y_H__
|
||||
|
||||
#include <clutter/clutter-types.h>
|
||||
#include "clutter-enum-types.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
void _clutter_input_pointer_a11y_add_device (ClutterInputDevice *device);
|
||||
void _clutter_input_pointer_a11y_remove_device (ClutterInputDevice *device);
|
||||
void _clutter_input_pointer_a11y_on_motion_event (ClutterInputDevice *device,
|
||||
float x,
|
||||
float y);
|
||||
void _clutter_input_pointer_a11y_on_button_event (ClutterInputDevice *device,
|
||||
int button,
|
||||
gboolean pressed);
|
||||
gboolean _clutter_is_input_pointer_a11y_enabled (ClutterInputDevice *device);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_INPUT_POINTER_A11Y_H__ */
|
669
clutter/clutter/clutter-input-pointer-a11y.c
Normal file
669
clutter/clutter/clutter-input-pointer-a11y.c
Normal file
@@ -0,0 +1,669 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Red Hat
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Author: Olivier Fourdan <ofourdan@redhat.com>
|
||||
*
|
||||
* This reimplements in Clutter the same behavior as mousetweaks original
|
||||
* implementation by Gerd Kohlberger <gerdko gmail com>
|
||||
* mousetweaks Copyright (C) 2007-2010 Gerd Kohlberger <gerdko gmail com>
|
||||
*/
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-device-manager.h"
|
||||
#include "clutter-device-manager-private.h"
|
||||
#include "clutter-enum-types.h"
|
||||
#include "clutter-input-device.h"
|
||||
#include "clutter-input-pointer-a11y-private.h"
|
||||
#include "clutter-main.h"
|
||||
#include "clutter-virtual-input-device.h"
|
||||
|
||||
static gboolean
|
||||
is_secondary_click_enabled (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
return (settings.controls & CLUTTER_A11Y_SECONDARY_CLICK_ENABLED);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_dwell_click_enabled (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
return (settings.controls & CLUTTER_A11Y_DWELL_ENABLED);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
get_secondary_click_delay (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
return settings.secondary_click_delay;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
get_dwell_delay (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
return settings.dwell_delay;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
get_dwell_threshold (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
return settings.dwell_threshold;
|
||||
}
|
||||
|
||||
static ClutterPointerA11yDwellMode
|
||||
get_dwell_mode (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
return settings.dwell_mode;
|
||||
}
|
||||
|
||||
static ClutterPointerA11yDwellClickType
|
||||
get_dwell_click_type (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
#
|
||||
return settings.dwell_click_type;
|
||||
}
|
||||
|
||||
static ClutterPointerA11yDwellClickType
|
||||
get_dwell_click_type_for_direction (ClutterInputDevice *device,
|
||||
ClutterPointerA11yDwellDirection direction)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
if (direction == settings.dwell_gesture_single)
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY;
|
||||
else if (direction == settings.dwell_gesture_double)
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE;
|
||||
else if (direction == settings.dwell_gesture_drag)
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG;
|
||||
else if (direction == settings.dwell_gesture_secondary)
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY;
|
||||
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE;
|
||||
}
|
||||
|
||||
static void
|
||||
emit_button_press (ClutterInputDevice *device,
|
||||
gint button)
|
||||
{
|
||||
clutter_virtual_input_device_notify_button (device->accessibility_virtual_device,
|
||||
g_get_monotonic_time (),
|
||||
button,
|
||||
CLUTTER_BUTTON_STATE_PRESSED);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_button_release (ClutterInputDevice *device,
|
||||
gint button)
|
||||
{
|
||||
clutter_virtual_input_device_notify_button (device->accessibility_virtual_device,
|
||||
g_get_monotonic_time (),
|
||||
button,
|
||||
CLUTTER_BUTTON_STATE_RELEASED);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_button_click (ClutterInputDevice *device,
|
||||
gint button)
|
||||
{
|
||||
emit_button_press (device, button);
|
||||
emit_button_release (device, button);
|
||||
}
|
||||
|
||||
static void
|
||||
restore_dwell_position (ClutterInputDevice *device)
|
||||
{
|
||||
clutter_virtual_input_device_notify_absolute_motion (device->accessibility_virtual_device,
|
||||
g_get_monotonic_time (),
|
||||
device->ptr_a11y_data->dwell_x,
|
||||
device->ptr_a11y_data->dwell_y);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
trigger_secondary_click (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
|
||||
device->ptr_a11y_data->secondary_click_triggered = TRUE;
|
||||
device->ptr_a11y_data->secondary_click_timer = 0;
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
start_secondary_click_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
unsigned int delay = get_secondary_click_delay (device);
|
||||
|
||||
device->ptr_a11y_data->secondary_click_timer =
|
||||
clutter_threads_add_timeout (delay, trigger_secondary_click, device);
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-started",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
delay);
|
||||
}
|
||||
|
||||
static void
|
||||
stop_secondary_click_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
if (device->ptr_a11y_data->secondary_click_timer)
|
||||
{
|
||||
g_source_remove (device->ptr_a11y_data->secondary_click_timer);
|
||||
device->ptr_a11y_data->secondary_click_timer = 0;
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK);
|
||||
}
|
||||
device->ptr_a11y_data->secondary_click_triggered = FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pointer_has_moved (ClutterInputDevice *device)
|
||||
{
|
||||
float dx, dy;
|
||||
gint threshold;
|
||||
|
||||
dx = device->ptr_a11y_data->dwell_x - device->ptr_a11y_data->current_x;
|
||||
dy = device->ptr_a11y_data->dwell_y - device->ptr_a11y_data->current_y;
|
||||
threshold = get_dwell_threshold (device);
|
||||
|
||||
/* Pythagorean theorem */
|
||||
return ((dx * dx) + (dy * dy)) > (threshold * threshold);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_secondary_click_pending (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->secondary_click_timer != 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_secondary_click_triggered (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->secondary_click_triggered;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_dwell_click_pending (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->dwell_timer != 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_dwell_dragging (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->dwell_drag_started;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_dwell_gesturing (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->dwell_gesture_started;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
has_button_pressed (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->n_btn_pressed > 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
should_start_secondary_click_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
return !is_dwell_dragging (device);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
should_start_dwell (ClutterInputDevice *device)
|
||||
{
|
||||
/* We should trigger a dwell if we've not already started one, and if
|
||||
* no button is currently pressed or we are in the middle of a dwell
|
||||
* drag action.
|
||||
*/
|
||||
return !is_dwell_click_pending (device) &&
|
||||
(is_dwell_dragging (device) ||
|
||||
!has_button_pressed (device));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
should_stop_dwell (ClutterInputDevice *device)
|
||||
{
|
||||
/* We should stop a dwell if the motion exceeds the threshold, unless
|
||||
* we've started a gesture, because we want to keep the original dwell
|
||||
* location to both detect a gesture and restore the original pointer
|
||||
* location once the gesture is finished.
|
||||
*/
|
||||
return pointer_has_moved (device) &&
|
||||
!is_dwell_gesturing (device);
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
should_update_dwell_position (ClutterInputDevice *device)
|
||||
{
|
||||
return !is_dwell_gesturing (device) &&
|
||||
!is_dwell_click_pending (device) &&
|
||||
!is_secondary_click_pending (device);
|
||||
}
|
||||
|
||||
static void
|
||||
update_dwell_click_type (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
ClutterPointerA11yDwellClickType dwell_click_type;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
dwell_click_type = settings.dwell_click_type;
|
||||
switch (dwell_click_type)
|
||||
{
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE:
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY:
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE:
|
||||
dwell_click_type = CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY;
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG:
|
||||
if (!is_dwell_dragging (device))
|
||||
dwell_click_type = CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY;
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY:
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (dwell_click_type != settings.dwell_click_type)
|
||||
{
|
||||
settings.dwell_click_type = dwell_click_type;
|
||||
clutter_device_manager_set_pointer_a11y_settings (device->device_manager,
|
||||
&settings);
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-dwell-click-type-changed",
|
||||
dwell_click_type);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
emit_dwell_click (ClutterInputDevice *device,
|
||||
ClutterPointerA11yDwellClickType dwell_click_type)
|
||||
{
|
||||
switch (dwell_click_type)
|
||||
{
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY:
|
||||
emit_button_click (device, CLUTTER_BUTTON_PRIMARY);
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE:
|
||||
emit_button_click (device, CLUTTER_BUTTON_PRIMARY);
|
||||
emit_button_click (device, CLUTTER_BUTTON_PRIMARY);
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG:
|
||||
if (is_dwell_dragging (device))
|
||||
{
|
||||
emit_button_release (device, CLUTTER_BUTTON_PRIMARY);
|
||||
device->ptr_a11y_data->dwell_drag_started = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
emit_button_press (device, CLUTTER_BUTTON_PRIMARY);
|
||||
device->ptr_a11y_data->dwell_drag_started = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY:
|
||||
emit_button_click (device, CLUTTER_BUTTON_SECONDARY);
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE:
|
||||
emit_button_click (device, CLUTTER_BUTTON_MIDDLE);
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static ClutterPointerA11yDwellDirection
|
||||
get_dwell_direction (ClutterInputDevice *device)
|
||||
{
|
||||
float dx, dy;
|
||||
|
||||
dx = ABS (device->ptr_a11y_data->dwell_x - device->ptr_a11y_data->current_x);
|
||||
dy = ABS (device->ptr_a11y_data->dwell_y - device->ptr_a11y_data->current_y);
|
||||
|
||||
/* The pointer hasn't moved */
|
||||
if (!pointer_has_moved (device))
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_NONE;
|
||||
|
||||
if (device->ptr_a11y_data->dwell_x < device->ptr_a11y_data->current_x)
|
||||
{
|
||||
if (dx > dy)
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_LEFT;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dx > dy)
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_RIGHT;
|
||||
}
|
||||
|
||||
if (device->ptr_a11y_data->dwell_y < device->ptr_a11y_data->current_y)
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_UP;
|
||||
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_DOWN;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
trigger_clear_dwell_gesture (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
|
||||
device->ptr_a11y_data->dwell_timer = 0;
|
||||
device->ptr_a11y_data->dwell_gesture_started = FALSE;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
trigger_dwell_gesture (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
ClutterPointerA11yDwellDirection direction;
|
||||
unsigned int delay = get_dwell_delay (device);
|
||||
|
||||
restore_dwell_position (device);
|
||||
direction = get_dwell_direction (device);
|
||||
emit_dwell_click (device,
|
||||
get_dwell_click_type_for_direction (device,
|
||||
direction));
|
||||
|
||||
/* Do not clear the gesture right away, otherwise we'll start another one */
|
||||
device->ptr_a11y_data->dwell_timer =
|
||||
clutter_threads_add_timeout (delay, trigger_clear_dwell_gesture, device);
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
start_dwell_gesture_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
unsigned int delay = get_dwell_delay (device);
|
||||
|
||||
device->ptr_a11y_data->dwell_timer =
|
||||
clutter_threads_add_timeout (delay, trigger_dwell_gesture, device);
|
||||
device->ptr_a11y_data->dwell_gesture_started = TRUE;
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-started",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
||||
delay);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
trigger_dwell_click (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
|
||||
device->ptr_a11y_data->dwell_timer = 0;
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL);
|
||||
|
||||
if (get_dwell_mode (device) == CLUTTER_A11Y_DWELL_MODE_GESTURE)
|
||||
{
|
||||
if (is_dwell_dragging (device))
|
||||
emit_dwell_click (device, CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG);
|
||||
else
|
||||
start_dwell_gesture_timeout (device);
|
||||
}
|
||||
else
|
||||
{
|
||||
emit_dwell_click (device, get_dwell_click_type (device));
|
||||
update_dwell_click_type (device);
|
||||
}
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
start_dwell_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
unsigned int delay = get_dwell_delay (device);
|
||||
|
||||
device->ptr_a11y_data->dwell_timer =
|
||||
clutter_threads_add_timeout (delay, trigger_dwell_click, device);
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-started",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
delay);
|
||||
}
|
||||
|
||||
static void
|
||||
stop_dwell_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
if (device->ptr_a11y_data->dwell_timer)
|
||||
{
|
||||
g_source_remove (device->ptr_a11y_data->dwell_timer);
|
||||
device->ptr_a11y_data->dwell_timer = 0;
|
||||
device->ptr_a11y_data->dwell_gesture_started = FALSE;
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
update_dwell_position (ClutterInputDevice *device)
|
||||
{
|
||||
device->ptr_a11y_data->dwell_x = device->ptr_a11y_data->current_x;
|
||||
device->ptr_a11y_data->dwell_y = device->ptr_a11y_data->current_y;
|
||||
}
|
||||
|
||||
static void
|
||||
update_current_position (ClutterInputDevice *device,
|
||||
float x,
|
||||
float y)
|
||||
{
|
||||
device->ptr_a11y_data->current_x = x;
|
||||
device->ptr_a11y_data->current_y = y;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_device_core_pointer (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterInputDevice *core_pointer;
|
||||
|
||||
core_pointer = clutter_device_manager_get_core_device (device->device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
if (core_pointer == NULL)
|
||||
return FALSE;
|
||||
|
||||
return (core_pointer == device);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_input_pointer_a11y_add_device (ClutterInputDevice *device)
|
||||
{
|
||||
if (!is_device_core_pointer (device))
|
||||
return;
|
||||
|
||||
device->accessibility_virtual_device =
|
||||
clutter_device_manager_create_virtual_device (device->device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
|
||||
device->ptr_a11y_data = g_new0 (ClutterPtrA11yData, 1);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_input_pointer_a11y_remove_device (ClutterInputDevice *device)
|
||||
{
|
||||
if (!is_device_core_pointer (device))
|
||||
return;
|
||||
|
||||
/* Terminate a drag if started */
|
||||
if (is_dwell_dragging (device))
|
||||
emit_dwell_click (device, CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG);
|
||||
|
||||
stop_dwell_timeout (device);
|
||||
stop_secondary_click_timeout (device);
|
||||
|
||||
g_clear_pointer (&device->ptr_a11y_data, g_free);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_input_pointer_a11y_on_motion_event (ClutterInputDevice *device,
|
||||
float x,
|
||||
float y)
|
||||
{
|
||||
if (!is_device_core_pointer (device))
|
||||
return;
|
||||
|
||||
if (!_clutter_is_input_pointer_a11y_enabled (device))
|
||||
return;
|
||||
|
||||
update_current_position (device, x, y);
|
||||
|
||||
if (is_secondary_click_enabled (device))
|
||||
{
|
||||
if (pointer_has_moved (device))
|
||||
stop_secondary_click_timeout (device);
|
||||
}
|
||||
|
||||
if (is_dwell_click_enabled (device))
|
||||
{
|
||||
if (should_stop_dwell (device))
|
||||
stop_dwell_timeout (device);
|
||||
else if (should_start_dwell (device))
|
||||
start_dwell_timeout (device);
|
||||
}
|
||||
|
||||
if (should_update_dwell_position (device))
|
||||
update_dwell_position (device);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_input_pointer_a11y_on_button_event (ClutterInputDevice *device,
|
||||
int button,
|
||||
gboolean pressed)
|
||||
{
|
||||
if (!is_device_core_pointer (device))
|
||||
return;
|
||||
|
||||
if (!_clutter_is_input_pointer_a11y_enabled (device))
|
||||
return;
|
||||
|
||||
if (pressed)
|
||||
{
|
||||
device->ptr_a11y_data->n_btn_pressed++;
|
||||
|
||||
if (is_dwell_click_enabled (device))
|
||||
stop_dwell_timeout (device);
|
||||
|
||||
if (is_dwell_dragging (device))
|
||||
stop_dwell_timeout (device);
|
||||
|
||||
if (is_secondary_click_enabled (device))
|
||||
{
|
||||
if (button == CLUTTER_BUTTON_PRIMARY)
|
||||
{
|
||||
if (should_start_secondary_click_timeout (device))
|
||||
start_secondary_click_timeout (device);
|
||||
}
|
||||
else if (is_secondary_click_pending (device))
|
||||
{
|
||||
stop_secondary_click_timeout (device);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (has_button_pressed (device))
|
||||
device->ptr_a11y_data->n_btn_pressed--;
|
||||
|
||||
if (is_secondary_click_triggered (device))
|
||||
{
|
||||
emit_button_click (device, CLUTTER_BUTTON_SECONDARY);
|
||||
stop_secondary_click_timeout (device);
|
||||
}
|
||||
|
||||
if (is_secondary_click_pending (device))
|
||||
stop_secondary_click_timeout (device);
|
||||
|
||||
if (is_dwell_dragging (device))
|
||||
emit_dwell_click (device, CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG);
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_is_input_pointer_a11y_enabled (ClutterInputDevice *device)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
||||
|
||||
return (is_secondary_click_enabled (device) || is_dwell_click_enabled (device));
|
||||
}
|
@@ -58,7 +58,7 @@
|
||||
#include "clutter-device-manager-private.h"
|
||||
#include "clutter-event-private.h"
|
||||
#include "clutter-feature.h"
|
||||
#include "clutter-graphene.h"
|
||||
#include "clutter-input-pointer-a11y-private.h"
|
||||
#include "clutter-main.h"
|
||||
#include "clutter-master-clock.h"
|
||||
#include "clutter-mutter.h"
|
||||
@@ -85,8 +85,6 @@ G_LOCK_DEFINE_STATIC (ClutterCntx);
|
||||
|
||||
/* main lock and locking/unlocking functions */
|
||||
static GMutex clutter_threads_mutex;
|
||||
static GCallback clutter_threads_lock = NULL;
|
||||
static GCallback clutter_threads_unlock = NULL;
|
||||
|
||||
/* command line options */
|
||||
static gboolean clutter_is_initialized = FALSE;
|
||||
@@ -146,38 +144,10 @@ static const GDebugKey clutter_paint_debug_keys[] = {
|
||||
{ "damage-region", CLUTTER_DEBUG_PAINT_DAMAGE_REGION },
|
||||
};
|
||||
|
||||
static void
|
||||
clutter_threads_impl_lock (void)
|
||||
{
|
||||
g_mutex_lock (&clutter_threads_mutex);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_threads_impl_unlock (void)
|
||||
{
|
||||
/* we need to trylock here, in case the lock hasn't been acquired; on
|
||||
* various systems trying to release a mutex that hasn't been acquired
|
||||
* will cause a run-time error. trylock() will either fail, in which
|
||||
* case we can release the lock we own; or it will succeeds, in which
|
||||
* case we need to release the lock we just acquired. so we ignore the
|
||||
* returned value.
|
||||
*
|
||||
* see: https://bugs.gnome.org/679439
|
||||
*/
|
||||
g_mutex_trylock (&clutter_threads_mutex);
|
||||
g_mutex_unlock (&clutter_threads_mutex);
|
||||
}
|
||||
|
||||
static inline void
|
||||
clutter_threads_init_default (void)
|
||||
{
|
||||
g_mutex_init (&clutter_threads_mutex);
|
||||
|
||||
if (clutter_threads_lock == NULL)
|
||||
clutter_threads_lock = clutter_threads_impl_lock;
|
||||
|
||||
if (clutter_threads_unlock == NULL)
|
||||
clutter_threads_unlock = clutter_threads_impl_unlock;
|
||||
}
|
||||
|
||||
#define ENVIRONMENT_GROUP "Environment"
|
||||
@@ -383,28 +353,6 @@ clutter_config_read (void)
|
||||
g_free (config_path);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_show_fps:
|
||||
*
|
||||
* Returns whether Clutter should print out the frames per second on the
|
||||
* console. You can enable this setting either using the
|
||||
* <literal>CLUTTER_SHOW_FPS</literal> environment variable or passing
|
||||
* the <literal>--clutter-show-fps</literal> command line argument. *
|
||||
*
|
||||
* Return value: %TRUE if Clutter should show the FPS.
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.10: This function does not do anything. Use the environment
|
||||
* variable or the configuration file to determine whether Clutter should
|
||||
* print out the FPS counter on the console.
|
||||
*/
|
||||
gboolean
|
||||
clutter_get_show_fps (void)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_context_get_show_fps (void)
|
||||
{
|
||||
@@ -453,86 +401,6 @@ clutter_disable_accessibility (void)
|
||||
clutter_enable_accessibility = FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_redraw:
|
||||
*
|
||||
* Forces a redraw of the entire stage. Applications should never use this
|
||||
* function, but queue a redraw using clutter_actor_queue_redraw().
|
||||
*
|
||||
* This function should only be used by libraries integrating Clutter from
|
||||
* within another toolkit.
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_stage_ensure_redraw() instead.
|
||||
*/
|
||||
void
|
||||
clutter_redraw (ClutterStage *stage)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
||||
|
||||
clutter_stage_ensure_redraw (stage);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_set_motion_events_enabled:
|
||||
* @enable: %TRUE to enable per-actor motion events
|
||||
*
|
||||
* Sets whether per-actor motion events should be enabled or not on
|
||||
* all #ClutterStage<!-- -->s managed by Clutter.
|
||||
*
|
||||
* If @enable is %FALSE the following events will not work:
|
||||
*
|
||||
* - ClutterActor::motion-event, except on the #ClutterStage
|
||||
* - ClutterActor::enter-event
|
||||
* - ClutterActor::leave-event
|
||||
*
|
||||
* Since: 0.6
|
||||
*
|
||||
* Deprecated: 1.8: Use clutter_stage_set_motion_events_enabled() instead.
|
||||
*/
|
||||
void
|
||||
clutter_set_motion_events_enabled (gboolean enable)
|
||||
{
|
||||
ClutterStageManager *stage_manager;
|
||||
ClutterMainContext *context;
|
||||
const GSList *l;
|
||||
|
||||
enable = !!enable;
|
||||
|
||||
context = _clutter_context_get_default ();
|
||||
if (context->motion_events_per_actor == enable)
|
||||
return;
|
||||
|
||||
/* store the flag for later query and for newly created stages */
|
||||
context->motion_events_per_actor = enable;
|
||||
|
||||
/* propagate the change to all stages */
|
||||
stage_manager = clutter_stage_manager_get_default ();
|
||||
|
||||
for (l = clutter_stage_manager_peek_stages (stage_manager);
|
||||
l != NULL;
|
||||
l = l->next)
|
||||
{
|
||||
clutter_stage_set_motion_events_enabled (l->data, enable);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_motion_events_enabled:
|
||||
*
|
||||
* Gets whether the per-actor motion events are enabled.
|
||||
*
|
||||
* Return value: %TRUE if the motion events are enabled
|
||||
*
|
||||
* Since: 0.6
|
||||
*
|
||||
* Deprecated: 1.8: Use clutter_stage_get_motion_events_enabled() instead.
|
||||
*/
|
||||
gboolean
|
||||
clutter_get_motion_events_enabled (void)
|
||||
{
|
||||
return _clutter_context_get_motion_events_enabled ();
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_id_to_color (guint id_,
|
||||
ClutterColor *col)
|
||||
@@ -784,69 +652,6 @@ clutter_main (void)
|
||||
clutter_main_loop_level--;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_threads_init:
|
||||
*
|
||||
* Initialises the Clutter threading mechanism, so that Clutter API can be
|
||||
* called by multiple threads, using clutter_threads_enter() and
|
||||
* clutter_threads_leave() to mark the critical sections.
|
||||
*
|
||||
* You must call g_thread_init() before this function.
|
||||
*
|
||||
* This function must be called before clutter_init().
|
||||
*
|
||||
* It is safe to call this function multiple times.
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.10: This function does not do anything. Threading support
|
||||
* is initialized when Clutter is initialized.
|
||||
*/
|
||||
void
|
||||
clutter_threads_init (void)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_threads_set_lock_functions: (skip)
|
||||
* @enter_fn: function called when aquiring the Clutter main lock
|
||||
* @leave_fn: function called when releasing the Clutter main lock
|
||||
*
|
||||
* Allows the application to replace the standard method that
|
||||
* Clutter uses to protect its data structures. Normally, Clutter
|
||||
* creates a single #GMutex that is locked by clutter_threads_enter(),
|
||||
* and released by clutter_threads_leave(); using this function an
|
||||
* application provides, instead, a function @enter_fn that is
|
||||
* called by clutter_threads_enter() and a function @leave_fn that is
|
||||
* called by clutter_threads_leave().
|
||||
*
|
||||
* The functions must provide at least same locking functionality
|
||||
* as the default implementation, but can also do extra application
|
||||
* specific processing.
|
||||
*
|
||||
* As an example, consider an application that has its own recursive
|
||||
* lock that when held, holds the Clutter lock as well. When Clutter
|
||||
* unlocks the Clutter lock when entering a recursive main loop, the
|
||||
* application must temporarily release its lock as well.
|
||||
*
|
||||
* Most threaded Clutter apps won't need to use this method.
|
||||
*
|
||||
* This method must be called before clutter_init(), and cannot
|
||||
* be called multiple times.
|
||||
*
|
||||
* Since: 0.4
|
||||
*/
|
||||
void
|
||||
clutter_threads_set_lock_functions (GCallback enter_fn,
|
||||
GCallback leave_fn)
|
||||
{
|
||||
g_return_if_fail (clutter_threads_lock == NULL &&
|
||||
clutter_threads_unlock == NULL);
|
||||
|
||||
clutter_threads_lock = enter_fn;
|
||||
clutter_threads_unlock = leave_fn;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_threads_dispatch (gpointer data)
|
||||
{
|
||||
@@ -903,17 +708,11 @@ _clutter_threads_dispatch_free (gpointer data)
|
||||
* SafeClosure *closure = data;
|
||||
* gboolean res = FALSE;
|
||||
*
|
||||
* // mark the critical section //
|
||||
*
|
||||
* clutter_threads_enter();
|
||||
*
|
||||
* // the callback does not need to acquire the Clutter
|
||||
* / lock itself, as it is held by the this proxy handler
|
||||
* //
|
||||
* res = closure->callback (closure->data);
|
||||
*
|
||||
* clutter_threads_leave();
|
||||
*
|
||||
* return res;
|
||||
* }
|
||||
* static gulong
|
||||
@@ -1093,69 +892,23 @@ clutter_threads_add_timeout (guint interval,
|
||||
void
|
||||
_clutter_threads_acquire_lock (void)
|
||||
{
|
||||
if (clutter_threads_lock != NULL)
|
||||
(* clutter_threads_lock) ();
|
||||
g_mutex_lock (&clutter_threads_mutex);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_threads_release_lock (void)
|
||||
{
|
||||
if (clutter_threads_unlock != NULL)
|
||||
(* clutter_threads_unlock) ();
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_threads_enter:
|
||||
*
|
||||
* Locks the Clutter thread lock.
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.12: This function should not be used by application
|
||||
* code; marking critical sections is not portable on various
|
||||
* platforms. Instead of acquiring the Clutter lock, schedule UI
|
||||
* updates from the main loop using clutter_threads_add_idle() or
|
||||
* clutter_threads_add_timeout().
|
||||
*/
|
||||
void
|
||||
clutter_threads_enter (void)
|
||||
{
|
||||
_clutter_threads_acquire_lock ();
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_threads_leave:
|
||||
*
|
||||
* Unlocks the Clutter thread lock.
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.12: This function should not be used by application
|
||||
* code; marking critical sections is not portable on various
|
||||
* platforms. Instead of acquiring the Clutter lock, schedule UI
|
||||
* updates from the main loop using clutter_threads_add_idle() or
|
||||
* clutter_threads_add_timeout().
|
||||
*/
|
||||
void
|
||||
clutter_threads_leave (void)
|
||||
{
|
||||
_clutter_threads_release_lock ();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* clutter_get_debug_enabled:
|
||||
*
|
||||
* Check if Clutter has debugging enabled.
|
||||
*
|
||||
* Return value: %FALSE
|
||||
*
|
||||
* Deprecated: 1.10: This function does not do anything.
|
||||
*/
|
||||
gboolean
|
||||
clutter_get_debug_enabled (void)
|
||||
{
|
||||
return FALSE;
|
||||
/* we need to trylock here, in case the lock hasn't been acquired; on
|
||||
* various systems trying to release a mutex that hasn't been acquired
|
||||
* will cause a run-time error. trylock() will either fail, in which
|
||||
* case we can release the lock we own; or it will succeeds, in which
|
||||
* case we need to release the lock we just acquired. so we ignore the
|
||||
* returned value.
|
||||
*
|
||||
* see: https://bugs.gnome.org/679439
|
||||
*/
|
||||
g_mutex_trylock (&clutter_threads_mutex);
|
||||
g_mutex_unlock (&clutter_threads_mutex);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1205,7 +958,6 @@ clutter_context_get_default_unlocked (void)
|
||||
ctx->settings = clutter_settings_get_default ();
|
||||
_clutter_settings_set_backend (ctx->settings, ctx->backend);
|
||||
|
||||
ctx->motion_events_per_actor = TRUE;
|
||||
ctx->last_repaint_id = 1;
|
||||
}
|
||||
|
||||
@@ -1226,36 +978,6 @@ _clutter_context_get_default (void)
|
||||
return retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_timestamp:
|
||||
*
|
||||
* Returns the approximate number of microseconds passed since Clutter was
|
||||
* intialised.
|
||||
*
|
||||
* This function shdould not be used by application code.
|
||||
*
|
||||
* The output of this function depends on whether Clutter was configured to
|
||||
* enable its debugging code paths, so it's less useful than intended.
|
||||
*
|
||||
* Since Clutter 1.10, this function is an alias to g_get_monotonic_time()
|
||||
* if Clutter was configured to enable the debugging code paths.
|
||||
*
|
||||
* Return value: Number of microseconds since clutter_init() was called, or
|
||||
* zero if Clutter was not configured with debugging code paths.
|
||||
*
|
||||
* Deprecated: 1.10: Use #GTimer or g_get_monotonic_time() for a proper
|
||||
* timing source
|
||||
*/
|
||||
gulong
|
||||
clutter_get_timestamp (void)
|
||||
{
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
return (gulong) g_get_monotonic_time ();
|
||||
#else
|
||||
return 0L;
|
||||
#endif
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_arg_direction_cb (const char *key,
|
||||
const char *value,
|
||||
@@ -2005,6 +1727,36 @@ emit_pointer_event (ClutterEvent *event,
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
emit_crossing_event (ClutterEvent *event,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
ClutterMainContext *context = _clutter_context_get_default ();
|
||||
ClutterEventSequence *sequence = clutter_event_get_event_sequence (event);
|
||||
ClutterActor *grab_actor = NULL;
|
||||
|
||||
if (_clutter_event_process_filters (event))
|
||||
return;
|
||||
|
||||
if (sequence)
|
||||
{
|
||||
if (device->sequence_grab_actors != NULL)
|
||||
grab_actor = g_hash_table_lookup (device->sequence_grab_actors, sequence);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (context->pointer_grab_actor != NULL)
|
||||
grab_actor = context->pointer_grab_actor;
|
||||
else if (device != NULL && device->pointer_grab_actor != NULL)
|
||||
grab_actor = device->pointer_grab_actor;
|
||||
}
|
||||
|
||||
if (grab_actor != NULL)
|
||||
clutter_actor_event (grab_actor, event, FALSE);
|
||||
else
|
||||
emit_event_chain (event);
|
||||
}
|
||||
|
||||
static inline void
|
||||
emit_touch_event (ClutterEvent *event,
|
||||
ClutterInputDevice *device)
|
||||
@@ -2178,7 +1930,7 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
{
|
||||
ClutterActor *actor = NULL;
|
||||
|
||||
emit_pointer_event (event, device);
|
||||
emit_crossing_event (event, device);
|
||||
|
||||
actor = _clutter_input_device_update (device, NULL, FALSE);
|
||||
if (actor != stage)
|
||||
@@ -2190,12 +1942,12 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
crossing->crossing.related = stage;
|
||||
crossing->crossing.source = actor;
|
||||
|
||||
emit_pointer_event (crossing, device);
|
||||
emit_crossing_event (crossing, device);
|
||||
clutter_event_free (crossing);
|
||||
}
|
||||
}
|
||||
else
|
||||
emit_pointer_event (event, device);
|
||||
emit_crossing_event (event, device);
|
||||
break;
|
||||
|
||||
case CLUTTER_LEAVE:
|
||||
@@ -2214,10 +1966,10 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
crossing->crossing.related = stage;
|
||||
crossing->crossing.source = device->cursor_actor;
|
||||
|
||||
emit_pointer_event (crossing, device);
|
||||
emit_crossing_event (crossing, device);
|
||||
clutter_event_free (crossing);
|
||||
}
|
||||
emit_pointer_event (event, device);
|
||||
emit_crossing_event (event, device);
|
||||
break;
|
||||
|
||||
case CLUTTER_DESTROY_NOTIFY:
|
||||
@@ -2232,6 +1984,21 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
break;
|
||||
|
||||
case CLUTTER_MOTION:
|
||||
#ifdef CLUTTER_WINDOWING_X11
|
||||
if (!clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
#endif /* CLUTTER_WINDOWING_X11 */
|
||||
/* only the stage gets motion events if they are enabled */
|
||||
if (!clutter_stage_get_motion_events_enabled (CLUTTER_STAGE (stage)) &&
|
||||
event->any.source == NULL)
|
||||
@@ -2270,6 +2037,22 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
/* fallthrough from motion */
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
#ifdef CLUTTER_WINDOWING_X11
|
||||
if (!clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
|
||||
{
|
||||
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,
|
||||
event->button.button,
|
||||
event->type == CLUTTER_BUTTON_PRESS);
|
||||
}
|
||||
}
|
||||
#endif /* CLUTTER_WINDOWING_X11 */
|
||||
case CLUTTER_SCROLL:
|
||||
case CLUTTER_TOUCHPAD_PINCH:
|
||||
case CLUTTER_TOUCHPAD_SWIPE:
|
||||
@@ -2491,7 +2274,7 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
break;
|
||||
|
||||
case CLUTTER_STAGE_STATE:
|
||||
/* fullscreen / focus - forward to stage */
|
||||
/* focus - forward to stage */
|
||||
event->any.source = stage;
|
||||
if (!_clutter_event_process_filters (event))
|
||||
clutter_stage_event (CLUTTER_STAGE (stage), event);
|
||||
@@ -2575,8 +2358,6 @@ clutter_base_init (void)
|
||||
|
||||
/* initialise the Big Clutter Lock™ if necessary */
|
||||
clutter_threads_init_default ();
|
||||
|
||||
clutter_graphene_init ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2599,24 +2380,6 @@ clutter_get_default_frame_rate (void)
|
||||
return context->frame_rate;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_set_default_frame_rate:
|
||||
* @frames_per_sec: the new default frame rate
|
||||
*
|
||||
* Sets the default frame rate. This frame rate will be used to limit
|
||||
* the number of frames drawn if Clutter is not able to synchronize
|
||||
* with the vertical refresh rate of the display. When synchronization
|
||||
* is possible, this value is ignored.
|
||||
*
|
||||
* Since: 0.6
|
||||
*
|
||||
* Deprecated: 1.10: This function does not do anything any more.
|
||||
*/
|
||||
void
|
||||
clutter_set_default_frame_rate (guint frames_per_sec)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
on_grab_actor_destroy (ClutterActor *actor,
|
||||
ClutterInputDevice *device)
|
||||
@@ -2831,57 +2594,6 @@ clutter_input_device_get_grabbed_actor (ClutterInputDevice *device)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_grab_pointer_for_device:
|
||||
* @actor: a #ClutterActor
|
||||
* @id_: a device id, or -1
|
||||
*
|
||||
* Grabs all the pointer events coming from the device @id for @actor.
|
||||
*
|
||||
* If @id is -1 then this function is equivalent to clutter_grab_pointer().
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_input_device_grab() instead.
|
||||
*/
|
||||
void
|
||||
clutter_grab_pointer_for_device (ClutterActor *actor,
|
||||
gint id_)
|
||||
{
|
||||
ClutterDeviceManager *manager;
|
||||
ClutterInputDevice *dev;
|
||||
|
||||
g_return_if_fail (actor == NULL || CLUTTER_IS_ACTOR (actor));
|
||||
|
||||
/* essentially a global grab */
|
||||
if (id_ == -1)
|
||||
{
|
||||
if (actor == NULL)
|
||||
clutter_ungrab_pointer ();
|
||||
else
|
||||
clutter_grab_pointer (actor);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
manager = clutter_device_manager_get_default ();
|
||||
if (manager == NULL)
|
||||
return;
|
||||
|
||||
dev = clutter_device_manager_get_device (manager, id_);
|
||||
if (dev == NULL)
|
||||
return;
|
||||
|
||||
if (dev->device_type != CLUTTER_POINTER_DEVICE)
|
||||
return;
|
||||
|
||||
if (actor == NULL)
|
||||
clutter_input_device_ungrab (dev);
|
||||
else
|
||||
clutter_input_device_grab (dev, actor);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* clutter_ungrab_pointer:
|
||||
*
|
||||
@@ -2895,32 +2607,6 @@ clutter_ungrab_pointer (void)
|
||||
clutter_grab_pointer (NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_ungrab_pointer_for_device:
|
||||
* @id_: a device id
|
||||
*
|
||||
* Removes an existing grab of the pointer events for device @id_.
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_input_device_ungrab() instead.
|
||||
*/
|
||||
void
|
||||
clutter_ungrab_pointer_for_device (gint id_)
|
||||
{
|
||||
ClutterDeviceManager *manager;
|
||||
ClutterInputDevice *device;
|
||||
|
||||
manager = clutter_device_manager_get_default ();
|
||||
if (manager == NULL)
|
||||
return;
|
||||
|
||||
device = clutter_device_manager_get_device (manager, id_);
|
||||
if (device != NULL)
|
||||
clutter_input_device_ungrab (device);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* clutter_get_pointer_grab:
|
||||
*
|
||||
@@ -3020,170 +2706,6 @@ clutter_get_keyboard_grab (void)
|
||||
return context->keyboard_grab_actor;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_clear_glyph_cache:
|
||||
*
|
||||
* Clears the internal cache of glyphs used by the Pango
|
||||
* renderer. This will free up some memory and GL texture
|
||||
* resources. The cache will be automatically refilled as more text is
|
||||
* drawn.
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_get_font_map() and
|
||||
* cogl_pango_font_map_clear_glyph_cache() instead.
|
||||
*/
|
||||
void
|
||||
clutter_clear_glyph_cache (void)
|
||||
{
|
||||
CoglPangoFontMap *font_map;
|
||||
|
||||
font_map = clutter_context_get_pango_fontmap ();
|
||||
cogl_pango_font_map_clear_glyph_cache (font_map);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_set_font_flags:
|
||||
* @flags: The new flags
|
||||
*
|
||||
* Sets the font quality options for subsequent text rendering
|
||||
* operations.
|
||||
*
|
||||
* Using mipmapped textures will improve the quality for scaled down
|
||||
* text but will use more texture memory.
|
||||
*
|
||||
* Enabling hinting improves text quality for static text but may
|
||||
* introduce some artifacts if the text is animated.
|
||||
*
|
||||
* Since: 1.0
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_backend_set_font_options() and the
|
||||
* #cairo_font_option_t API.
|
||||
*/
|
||||
void
|
||||
clutter_set_font_flags (ClutterFontFlags flags)
|
||||
{
|
||||
CoglPangoFontMap *font_map;
|
||||
ClutterFontFlags old_flags, changed_flags;
|
||||
const cairo_font_options_t *font_options;
|
||||
cairo_font_options_t *new_font_options;
|
||||
cairo_hint_style_t hint_style;
|
||||
gboolean use_mipmapping;
|
||||
ClutterBackend *backend;
|
||||
|
||||
backend = clutter_get_default_backend ();
|
||||
font_map = clutter_context_get_pango_fontmap ();
|
||||
font_options = clutter_backend_get_font_options (backend);
|
||||
old_flags = 0;
|
||||
|
||||
if (cogl_pango_font_map_get_use_mipmapping (font_map))
|
||||
old_flags |= CLUTTER_FONT_MIPMAPPING;
|
||||
|
||||
hint_style = cairo_font_options_get_hint_style (font_options);
|
||||
if (hint_style != CAIRO_HINT_STYLE_DEFAULT &&
|
||||
hint_style != CAIRO_HINT_STYLE_NONE)
|
||||
old_flags |= CLUTTER_FONT_HINTING;
|
||||
|
||||
if (old_flags == flags)
|
||||
return;
|
||||
|
||||
new_font_options = cairo_font_options_copy (font_options);
|
||||
|
||||
/* Only set the font options that have actually changed so we don't
|
||||
override a detailed setting from the backend */
|
||||
changed_flags = old_flags ^ flags;
|
||||
|
||||
if ((changed_flags & CLUTTER_FONT_MIPMAPPING))
|
||||
{
|
||||
use_mipmapping = (changed_flags & CLUTTER_FONT_MIPMAPPING) != 0;
|
||||
|
||||
cogl_pango_font_map_set_use_mipmapping (font_map, use_mipmapping);
|
||||
}
|
||||
|
||||
if ((changed_flags & CLUTTER_FONT_HINTING))
|
||||
{
|
||||
hint_style = (flags & CLUTTER_FONT_HINTING)
|
||||
? CAIRO_HINT_STYLE_FULL
|
||||
: CAIRO_HINT_STYLE_NONE;
|
||||
|
||||
cairo_font_options_set_hint_style (new_font_options, hint_style);
|
||||
}
|
||||
|
||||
clutter_backend_set_font_options (backend, new_font_options);
|
||||
|
||||
cairo_font_options_destroy (new_font_options);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_font_flags:
|
||||
*
|
||||
* Gets the current font flags for rendering text. See
|
||||
* clutter_set_font_flags().
|
||||
*
|
||||
* Return value: The font flags
|
||||
*
|
||||
* Since: 1.0
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_backend_get_font_options() and the
|
||||
* #cairo_font_options_t API.
|
||||
*/
|
||||
ClutterFontFlags
|
||||
clutter_get_font_flags (void)
|
||||
{
|
||||
CoglPangoFontMap *font_map = NULL;
|
||||
const cairo_font_options_t *font_options;
|
||||
ClutterFontFlags flags = 0;
|
||||
cairo_hint_style_t hint_style;
|
||||
|
||||
font_map = clutter_context_get_pango_fontmap ();
|
||||
if (cogl_pango_font_map_get_use_mipmapping (font_map))
|
||||
flags |= CLUTTER_FONT_MIPMAPPING;
|
||||
|
||||
font_options =
|
||||
clutter_backend_get_font_options (clutter_get_default_backend ());
|
||||
|
||||
hint_style = cairo_font_options_get_hint_style (font_options);
|
||||
if (hint_style != CAIRO_HINT_STYLE_DEFAULT &&
|
||||
hint_style != CAIRO_HINT_STYLE_NONE)
|
||||
flags |= CLUTTER_FONT_HINTING;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_input_device_for_id:
|
||||
* @id_: the unique id for a device
|
||||
*
|
||||
* Retrieves the #ClutterInputDevice from its @id_. This is a convenience
|
||||
* wrapper for clutter_device_manager_get_device() and it is functionally
|
||||
* equivalent to:
|
||||
*
|
||||
* |[
|
||||
* ClutterDeviceManager *manager;
|
||||
* ClutterInputDevice *device;
|
||||
*
|
||||
* manager = clutter_device_manager_get_default ();
|
||||
* device = clutter_device_manager_get_device (manager, id);
|
||||
* ]|
|
||||
*
|
||||
* Return value: (transfer none): a #ClutterInputDevice, or %NULL
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_device_manager_get_device() instead.
|
||||
*/
|
||||
ClutterInputDevice *
|
||||
clutter_get_input_device_for_id (gint id_)
|
||||
{
|
||||
ClutterDeviceManager *manager;
|
||||
|
||||
manager = clutter_device_manager_get_default ();
|
||||
if (manager == NULL)
|
||||
return NULL;
|
||||
|
||||
return clutter_device_manager_get_device (manager, id_);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_font_map:
|
||||
*
|
||||
@@ -3518,43 +3040,6 @@ _clutter_context_get_pick_mode (void)
|
||||
return context->pick_mode;
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_context_push_shader_stack (ClutterActor *actor)
|
||||
{
|
||||
ClutterMainContext *context = _clutter_context_get_default ();
|
||||
|
||||
context->shaders = g_slist_prepend (context->shaders, actor);
|
||||
}
|
||||
|
||||
ClutterActor *
|
||||
_clutter_context_peek_shader_stack (void)
|
||||
{
|
||||
ClutterMainContext *context = _clutter_context_get_default ();
|
||||
|
||||
if (context->shaders != NULL)
|
||||
return context->shaders->data;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ClutterActor *
|
||||
_clutter_context_pop_shader_stack (ClutterActor *actor)
|
||||
{
|
||||
ClutterMainContext *context = _clutter_context_get_default ();
|
||||
|
||||
context->shaders = g_slist_remove (context->shaders, actor);
|
||||
|
||||
return _clutter_context_peek_shader_stack ();
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_context_get_motion_events_enabled (void)
|
||||
{
|
||||
ClutterMainContext *context = _clutter_context_get_default ();
|
||||
|
||||
return context->motion_events_per_actor;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_check_windowing_backend:
|
||||
* @backend_type: the name of the backend to check
|
||||
|
@@ -117,9 +117,6 @@ void clutter_disable_accessibility (void);
|
||||
|
||||
/* Threading functions */
|
||||
CLUTTER_EXPORT
|
||||
void clutter_threads_set_lock_functions (GCallback enter_fn,
|
||||
GCallback leave_fn);
|
||||
CLUTTER_EXPORT
|
||||
guint clutter_threads_add_idle (GSourceFunc func,
|
||||
gpointer data);
|
||||
CLUTTER_EXPORT
|
||||
|
@@ -23,6 +23,7 @@ VOID:FLOAT,FLOAT
|
||||
VOID:INT,INT,INT,INT
|
||||
VOID:OBJECT
|
||||
VOID:OBJECT,FLAGS
|
||||
VOID:OBJECT,FLAGS,UINT
|
||||
VOID:OBJECT,FLOAT,FLOAT
|
||||
VOID:OBJECT,FLOAT,FLOAT,FLAGS
|
||||
VOID:OBJECT,OBJECT
|
||||
|
@@ -64,9 +64,6 @@ struct _ClutterMasterClockDefault
|
||||
/* the current state of the clock, in usecs */
|
||||
gint64 cur_tick;
|
||||
|
||||
/* the previous state of the clock, in usecs, used to compute the delta */
|
||||
gint64 prev_tick;
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
gint64 frame_budget;
|
||||
gint64 remaining_budget;
|
||||
@@ -77,12 +74,6 @@ struct _ClutterMasterClockDefault
|
||||
*/
|
||||
GSource *source;
|
||||
|
||||
/* If the master clock is idle that means it has
|
||||
* fallen back to idle polling for timeline
|
||||
* progressions and it may have been some time since
|
||||
* the last real stage update.
|
||||
*/
|
||||
guint idle : 1;
|
||||
guint ensure_next_iteration : 1;
|
||||
|
||||
guint paused : 1;
|
||||
@@ -275,78 +266,12 @@ master_clock_reschedule_stage_updates (ClutterMasterClockDefault *master_clock,
|
||||
static gint
|
||||
master_clock_next_frame_delay (ClutterMasterClockDefault *master_clock)
|
||||
{
|
||||
gint64 now, next;
|
||||
gint swap_delay;
|
||||
|
||||
if (!master_clock_is_running (master_clock))
|
||||
return -1;
|
||||
|
||||
/* If all of the stages are busy waiting for a swap-buffers to complete
|
||||
* then we wait for one to be ready.. */
|
||||
swap_delay = master_clock_get_swap_wait_time (master_clock);
|
||||
if (swap_delay != 0)
|
||||
return swap_delay;
|
||||
|
||||
/* When we have sync-to-vblank, we count on swap-buffer requests (or
|
||||
* swap-buffer-complete events if supported in the backend) to throttle our
|
||||
* frame rate so no additional delay is needed to start the next frame.
|
||||
*
|
||||
* If the master-clock has become idle due to no timeline progression causing
|
||||
* redraws then we can no longer rely on vblank synchronization because the
|
||||
* last real stage update/redraw may have happened a long time ago and so we
|
||||
* fallback to polling for timeline progressions every 1/frame_rate seconds.
|
||||
*
|
||||
* (NB: if there aren't even any timelines running then the master clock will
|
||||
* be completely stopped in master_clock_is_running())
|
||||
*/
|
||||
if (clutter_feature_available (CLUTTER_FEATURE_SWAP_THROTTLE) &&
|
||||
!master_clock->idle)
|
||||
{
|
||||
CLUTTER_NOTE (SCHEDULER, "swap throttling available and updated stages");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (master_clock->prev_tick == 0)
|
||||
{
|
||||
/* If we weren't previously running, then draw the next frame
|
||||
* immediately
|
||||
*/
|
||||
CLUTTER_NOTE (SCHEDULER, "draw the first frame immediately");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Otherwise, wait at least 1/frame_rate seconds since we last
|
||||
* started a frame
|
||||
*/
|
||||
now = g_source_get_time (master_clock->source);
|
||||
|
||||
next = master_clock->prev_tick;
|
||||
|
||||
/* If time has gone backwards then there's no way of knowing how
|
||||
long we should wait so let's just dispatch immediately */
|
||||
if (now <= next)
|
||||
{
|
||||
CLUTTER_NOTE (SCHEDULER, "Time has gone backwards");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
next += (1000000L / clutter_get_default_frame_rate ());
|
||||
|
||||
if (next <= now)
|
||||
{
|
||||
CLUTTER_NOTE (SCHEDULER, "Less than %lu microsecs",
|
||||
1000000L / (gulong) clutter_get_default_frame_rate ());
|
||||
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
CLUTTER_NOTE (SCHEDULER, "Waiting %" G_GINT64_FORMAT " msecs",
|
||||
(next - now) / 1000);
|
||||
|
||||
return (next - now) / 1000;
|
||||
}
|
||||
return master_clock_get_swap_wait_time (master_clock);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -412,8 +337,7 @@ master_clock_advance_timelines (ClutterMasterClockDefault *master_clock)
|
||||
for (l = timelines; l != NULL; l = l->next)
|
||||
_clutter_timeline_do_tick (l->data, master_clock->cur_tick / 1000);
|
||||
|
||||
g_slist_foreach (timelines, (GFunc) g_object_unref, NULL);
|
||||
g_slist_free (timelines);
|
||||
g_slist_free_full (timelines, g_object_unref);
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
if (_clutter_diagnostic_enabled ())
|
||||
@@ -531,7 +455,6 @@ clutter_clock_dispatch (GSource *source,
|
||||
{
|
||||
ClutterClockSource *clock_source = (ClutterClockSource *) source;
|
||||
ClutterMasterClockDefault *master_clock = clock_source->master_clock;
|
||||
gboolean stages_updated = FALSE;
|
||||
GSList *stages;
|
||||
|
||||
CLUTTER_NOTE (SCHEDULER, "Master clock [tick]");
|
||||
@@ -551,8 +474,6 @@ clutter_clock_dispatch (GSource *source,
|
||||
*/
|
||||
stages = master_clock_list_ready_stages (master_clock);
|
||||
|
||||
master_clock->idle = FALSE;
|
||||
|
||||
/* Each frame is split into three separate phases: */
|
||||
|
||||
/* 1. process all the events; each stage goes through its events queue
|
||||
@@ -565,19 +486,11 @@ clutter_clock_dispatch (GSource *source,
|
||||
master_clock_advance_timelines (master_clock);
|
||||
|
||||
/* 3. relayout and redraw the stages */
|
||||
stages_updated = master_clock_update_stages (master_clock, stages);
|
||||
|
||||
/* The master clock goes idle if no stages were updated and falls back
|
||||
* to polling for timeline progressions... */
|
||||
if (!stages_updated)
|
||||
master_clock->idle = TRUE;
|
||||
master_clock_update_stages (master_clock, stages);
|
||||
|
||||
master_clock_reschedule_stage_updates (master_clock, stages);
|
||||
|
||||
g_slist_foreach (stages, (GFunc) g_object_unref, NULL);
|
||||
g_slist_free (stages);
|
||||
|
||||
master_clock->prev_tick = master_clock->cur_tick;
|
||||
g_slist_free_full (stages, g_object_unref);
|
||||
|
||||
_clutter_threads_release_lock ();
|
||||
|
||||
@@ -610,7 +523,6 @@ clutter_master_clock_default_init (ClutterMasterClockDefault *self)
|
||||
source = clutter_clock_source_new (self);
|
||||
self->source = source;
|
||||
|
||||
self->idle = FALSE;
|
||||
self->ensure_next_iteration = FALSE;
|
||||
self->paused = FALSE;
|
||||
|
||||
|
@@ -86,7 +86,7 @@ struct _ClutterOffscreenEffectPrivate
|
||||
ClutterActor *actor;
|
||||
ClutterActor *stage;
|
||||
|
||||
graphene_point3d_t position;
|
||||
ClutterVertex position;
|
||||
|
||||
int fbo_offset_x;
|
||||
int fbo_offset_y;
|
||||
@@ -250,11 +250,9 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
||||
gfloat target_width = -1, target_height = -1;
|
||||
gfloat resource_scale;
|
||||
gfloat ceiled_resource_scale;
|
||||
graphene_point3d_t local_offset;
|
||||
ClutterVertex local_offset = { 0.f, 0.f, 0.f };
|
||||
gfloat old_viewport[4];
|
||||
|
||||
local_offset = GRAPHENE_POINT3D_INIT (0.0f, 0.0f, 0.0f);
|
||||
|
||||
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))
|
||||
return FALSE;
|
||||
|
||||
@@ -325,7 +323,7 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
||||
* contents on screen...
|
||||
*/
|
||||
clutter_actor_get_transform (priv->stage, &modelview);
|
||||
cogl_framebuffer_set_modelview_matrix (priv->offscreen, &modelview);
|
||||
cogl_set_modelview_matrix (&modelview);
|
||||
|
||||
/* Save the original viewport for calculating priv->position */
|
||||
_clutter_stage_get_viewport (CLUTTER_STAGE (priv->stage),
|
||||
@@ -337,11 +335,10 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
||||
/* Set up the viewport so that it has the same size as the stage (avoid
|
||||
* distortion), but translated to account for the FBO offset...
|
||||
*/
|
||||
cogl_framebuffer_set_viewport (priv->offscreen,
|
||||
-priv->fbo_offset_x,
|
||||
-priv->fbo_offset_y,
|
||||
stage_width,
|
||||
stage_height);
|
||||
cogl_set_viewport (-priv->fbo_offset_x,
|
||||
-priv->fbo_offset_y,
|
||||
stage_width,
|
||||
stage_height);
|
||||
|
||||
/* Copy the stage's projection matrix across to the framebuffer */
|
||||
_clutter_stage_get_projection_matrix (CLUTTER_STAGE (priv->stage),
|
||||
@@ -358,15 +355,14 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
||||
&priv->position,
|
||||
1);
|
||||
|
||||
cogl_framebuffer_set_projection_matrix (priv->offscreen, &projection);
|
||||
cogl_set_projection_matrix (&projection);
|
||||
|
||||
cogl_color_init_from_4ub (&transparent, 0, 0, 0, 0);
|
||||
cogl_framebuffer_clear (priv->offscreen,
|
||||
COGL_BUFFER_BIT_COLOR |
|
||||
COGL_BUFFER_BIT_DEPTH,
|
||||
&transparent);
|
||||
cogl_clear (&transparent,
|
||||
COGL_BUFFER_BIT_COLOR |
|
||||
COGL_BUFFER_BIT_DEPTH);
|
||||
|
||||
cogl_framebuffer_push_matrix (priv->offscreen);
|
||||
cogl_push_matrix ();
|
||||
|
||||
/* Override the actor's opacity to fully opaque - we paint the offscreen
|
||||
* texture with the actor's paint opacity, so we need to do this to avoid
|
||||
@@ -412,16 +408,15 @@ static void
|
||||
clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect)
|
||||
{
|
||||
ClutterOffscreenEffectPrivate *priv = effect->priv;
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
CoglMatrix modelview;
|
||||
float resource_scale;
|
||||
|
||||
cogl_framebuffer_push_matrix (framebuffer);
|
||||
cogl_push_matrix ();
|
||||
|
||||
/* The current modelview matrix is *almost* perfect already. It's only
|
||||
* missing a correction for the expanded FBO and offset rendering within...
|
||||
*/
|
||||
cogl_framebuffer_get_modelview_matrix (framebuffer, &modelview);
|
||||
cogl_get_modelview_matrix (&modelview);
|
||||
|
||||
if (clutter_actor_get_resource_scale (priv->actor, &resource_scale) &&
|
||||
resource_scale != 1.0f)
|
||||
@@ -434,15 +429,14 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect)
|
||||
priv->fbo_offset_x,
|
||||
priv->fbo_offset_y,
|
||||
0.0f);
|
||||
|
||||
cogl_framebuffer_set_modelview_matrix (framebuffer, &modelview);
|
||||
cogl_set_modelview_matrix (&modelview);
|
||||
|
||||
/* paint the target material; this is virtualized for
|
||||
* sub-classes that require special hand-holding
|
||||
*/
|
||||
clutter_offscreen_effect_paint_target (effect);
|
||||
|
||||
cogl_framebuffer_pop_matrix (framebuffer);
|
||||
cogl_pop_matrix ();
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -459,7 +453,7 @@ clutter_offscreen_effect_post_paint (ClutterEffect *effect)
|
||||
/* Restore the previous opacity override */
|
||||
clutter_actor_set_opacity_override (priv->actor, priv->old_opacity_override);
|
||||
|
||||
cogl_framebuffer_pop_matrix (priv->offscreen);
|
||||
cogl_pop_matrix ();
|
||||
cogl_pop_framebuffer ();
|
||||
|
||||
clutter_offscreen_effect_paint_texture (self);
|
||||
@@ -688,7 +682,7 @@ clutter_offscreen_effect_get_target_size (ClutterOffscreenEffect *effect,
|
||||
*/
|
||||
gboolean
|
||||
clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
||||
graphene_rect_t *rect)
|
||||
ClutterRect *rect)
|
||||
{
|
||||
ClutterOffscreenEffectPrivate *priv;
|
||||
|
||||
@@ -700,11 +694,11 @@ clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
||||
if (priv->texture == NULL)
|
||||
return FALSE;
|
||||
|
||||
graphene_rect_init (rect,
|
||||
priv->position.x,
|
||||
priv->position.y,
|
||||
cogl_texture_get_width (priv->texture),
|
||||
cogl_texture_get_height (priv->texture));
|
||||
clutter_rect_init (rect,
|
||||
priv->position.x,
|
||||
priv->position.y,
|
||||
cogl_texture_get_width (priv->texture),
|
||||
cogl_texture_get_height (priv->texture));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -114,7 +114,7 @@ gboolean clutter_offscreen_effect_get_target_size (ClutterOffscree
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
||||
graphene_rect_t *rect);
|
||||
ClutterRect *rect);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -75,8 +75,7 @@ _clutter_paint_node_init_types (void)
|
||||
cogl_pipeline_set_color (default_color_pipeline, &cogl_color);
|
||||
|
||||
default_texture_pipeline = cogl_pipeline_new (ctx);
|
||||
cogl_pipeline_set_layer_null_texture (default_texture_pipeline, 0,
|
||||
COGL_TEXTURE_TYPE_2D);
|
||||
cogl_pipeline_set_layer_null_texture (default_texture_pipeline, 0);
|
||||
cogl_pipeline_set_color (default_texture_pipeline, &cogl_color);
|
||||
cogl_pipeline_set_layer_wrap_mode (default_texture_pipeline, 0,
|
||||
COGL_PIPELINE_WRAP_MODE_AUTOMATIC);
|
||||
|
@@ -58,7 +58,7 @@ struct _ClutterPaintVolume
|
||||
* elements 4, 5, 6 and 7 most of the time for 2D actors when
|
||||
* calculating the projected paint box.
|
||||
*/
|
||||
graphene_point3d_t vertices[8];
|
||||
ClutterVertex vertices[8];
|
||||
|
||||
/* As an optimization for internally managed PaintVolumes we allow
|
||||
* initializing ClutterPaintVolume variables allocated on the stack
|
||||
|
@@ -63,7 +63,7 @@ _clutter_paint_volume_new (ClutterActor *actor)
|
||||
|
||||
pv->actor = actor;
|
||||
|
||||
memset (pv->vertices, 0, 8 * sizeof (graphene_point3d_t));
|
||||
memset (pv->vertices, 0, 8 * sizeof (ClutterVertex));
|
||||
|
||||
pv->is_static = FALSE;
|
||||
pv->is_empty = TRUE;
|
||||
@@ -96,7 +96,7 @@ _clutter_paint_volume_init_static (ClutterPaintVolume *pv,
|
||||
{
|
||||
pv->actor = actor;
|
||||
|
||||
memset (pv->vertices, 0, 8 * sizeof (graphene_point3d_t));
|
||||
memset (pv->vertices, 0, 8 * sizeof (ClutterVertex));
|
||||
|
||||
pv->is_static = TRUE;
|
||||
pv->is_empty = TRUE;
|
||||
@@ -170,7 +170,7 @@ clutter_paint_volume_free (ClutterPaintVolume *pv)
|
||||
/**
|
||||
* clutter_paint_volume_set_origin:
|
||||
* @pv: a #ClutterPaintVolume
|
||||
* @origin: a #graphene_point3d_t
|
||||
* @origin: a #ClutterVertex
|
||||
*
|
||||
* Sets the origin of the paint volume.
|
||||
*
|
||||
@@ -183,7 +183,7 @@ clutter_paint_volume_free (ClutterPaintVolume *pv)
|
||||
*/
|
||||
void
|
||||
clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||
const graphene_point3d_t *origin)
|
||||
const ClutterVertex *origin)
|
||||
{
|
||||
static const int key_vertices[4] = { 0, 1, 3, 4 };
|
||||
float dx, dy, dz;
|
||||
@@ -210,7 +210,7 @@ clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||
/**
|
||||
* clutter_paint_volume_get_origin:
|
||||
* @pv: a #ClutterPaintVolume
|
||||
* @vertex: (out): the return location for a #graphene_point3d_t
|
||||
* @vertex: (out): the return location for a #ClutterVertex
|
||||
*
|
||||
* Retrieves the origin of the #ClutterPaintVolume.
|
||||
*
|
||||
@@ -218,7 +218,7 @@ clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||
*/
|
||||
void
|
||||
clutter_paint_volume_get_origin (const ClutterPaintVolume *pv,
|
||||
graphene_point3d_t *vertex)
|
||||
ClutterVertex *vertex)
|
||||
{
|
||||
g_return_if_fail (pv != NULL);
|
||||
g_return_if_fail (vertex != NULL);
|
||||
@@ -659,7 +659,7 @@ clutter_paint_volume_union_box (ClutterPaintVolume *pv,
|
||||
const ClutterActorBox *box)
|
||||
{
|
||||
ClutterPaintVolume volume;
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
|
||||
g_return_if_fail (pv != NULL);
|
||||
g_return_if_fail (box != NULL);
|
||||
@@ -757,7 +757,7 @@ _clutter_paint_volume_get_bounding_box (ClutterPaintVolume *pv,
|
||||
ClutterActorBox *box)
|
||||
{
|
||||
gfloat x_min, y_min, x_max, y_max;
|
||||
graphene_point3d_t *vertices;
|
||||
ClutterVertex *vertices;
|
||||
int count;
|
||||
gint i;
|
||||
|
||||
@@ -878,9 +878,9 @@ _clutter_paint_volume_transform (ClutterPaintVolume *pv,
|
||||
|
||||
cogl_matrix_transform_points (matrix,
|
||||
3,
|
||||
sizeof (graphene_point3d_t),
|
||||
sizeof (ClutterVertex),
|
||||
pv->vertices,
|
||||
sizeof (graphene_point3d_t),
|
||||
sizeof (ClutterVertex),
|
||||
pv->vertices,
|
||||
transform_count);
|
||||
|
||||
@@ -896,7 +896,7 @@ _clutter_paint_volume_axis_align (ClutterPaintVolume *pv)
|
||||
{
|
||||
int count;
|
||||
int i;
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
float max_x;
|
||||
float max_y;
|
||||
float max_z;
|
||||
@@ -1075,7 +1075,7 @@ _clutter_paint_volume_cull (ClutterPaintVolume *pv,
|
||||
const ClutterPlane *planes)
|
||||
{
|
||||
int vertex_count;
|
||||
graphene_point3d_t *vertices = pv->vertices;
|
||||
ClutterVertex *vertices = pv->vertices;
|
||||
gboolean partial = FALSE;
|
||||
int i;
|
||||
int j;
|
||||
@@ -1097,18 +1097,24 @@ _clutter_paint_volume_cull (ClutterPaintVolume *pv,
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
const ClutterPlane *plane = &planes[i];
|
||||
int out = 0;
|
||||
for (j = 0; j < vertex_count; j++)
|
||||
{
|
||||
graphene_vec3_t v;
|
||||
ClutterVertex p;
|
||||
float distance;
|
||||
|
||||
graphene_vec3_init (&v,
|
||||
vertices[j].x - graphene_vec3_get_x (&plane->v0),
|
||||
vertices[j].y - graphene_vec3_get_y (&plane->v0),
|
||||
vertices[j].z - graphene_vec3_get_z (&plane->v0));
|
||||
/* XXX: for perspective projections this can be optimized
|
||||
* out because all the planes should pass through the origin
|
||||
* so (0,0,0) is a valid v0. */
|
||||
p.x = vertices[j].x - planes[i].v0[0];
|
||||
p.y = vertices[j].y - planes[i].v0[1];
|
||||
p.z = vertices[j].z - planes[i].v0[2];
|
||||
|
||||
if (graphene_vec3_dot (&plane->n, &v) < 0)
|
||||
distance = (planes[i].n[0] * p.x +
|
||||
planes[i].n[1] * p.y +
|
||||
planes[i].n[2] * p.z);
|
||||
|
||||
if (distance < 0)
|
||||
out++;
|
||||
}
|
||||
|
||||
|
@@ -295,8 +295,7 @@ clutter_path_clear (ClutterPath *path)
|
||||
{
|
||||
ClutterPathPrivate *priv = path->priv;
|
||||
|
||||
g_slist_foreach (priv->nodes, (GFunc) clutter_path_node_full_free, NULL);
|
||||
g_slist_free (priv->nodes);
|
||||
g_slist_free_full (priv->nodes, (GDestroyNotify) clutter_path_node_full_free);
|
||||
|
||||
priv->nodes = priv->nodes_tail = NULL;
|
||||
priv->nodes_dirty = TRUE;
|
||||
@@ -659,8 +658,7 @@ clutter_path_parse_description (const gchar *p,
|
||||
return TRUE;
|
||||
|
||||
fail:
|
||||
g_slist_foreach (nodes, (GFunc) clutter_path_node_full_free, NULL);
|
||||
g_slist_free (nodes);
|
||||
g_slist_free_full (nodes, (GDestroyNotify) clutter_path_node_full_free);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@@ -146,9 +146,6 @@ struct _ClutterMainContext
|
||||
ClutterActor *pointer_grab_actor;
|
||||
ClutterActor *keyboard_grab_actor;
|
||||
|
||||
/* stack of actors with shaders during paint */
|
||||
GSList *shaders;
|
||||
|
||||
/* fb bit masks for col<->id mapping in picking */
|
||||
gint fb_r_mask;
|
||||
gint fb_g_mask;
|
||||
@@ -173,7 +170,6 @@ struct _ClutterMainContext
|
||||
|
||||
/* boolean flags */
|
||||
guint is_initialized : 1;
|
||||
guint motion_events_per_actor : 1;
|
||||
guint defer_display_setup : 1;
|
||||
guint options_parsed : 1;
|
||||
guint show_fps : 1;
|
||||
@@ -198,10 +194,6 @@ void _clutter_context_lock (void);
|
||||
void _clutter_context_unlock (void);
|
||||
gboolean _clutter_context_is_initialized (void);
|
||||
ClutterPickMode _clutter_context_get_pick_mode (void);
|
||||
void _clutter_context_push_shader_stack (ClutterActor *actor);
|
||||
ClutterActor * _clutter_context_pop_shader_stack (ClutterActor *actor);
|
||||
ClutterActor * _clutter_context_peek_shader_stack (void);
|
||||
gboolean _clutter_context_get_motion_events_enabled (void);
|
||||
gboolean _clutter_context_get_show_fps (void);
|
||||
|
||||
gboolean _clutter_feature_init (GError **error);
|
||||
@@ -239,17 +231,17 @@ void _clutter_run_repaint_functions (ClutterRepaintFlags flags);
|
||||
|
||||
GType _clutter_layout_manager_get_child_meta_type (ClutterLayoutManager *manager);
|
||||
|
||||
void _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
const CoglMatrix *projection,
|
||||
const float *viewport,
|
||||
const graphene_point3d_t *vertices_in,
|
||||
graphene_point3d_t *vertices_out,
|
||||
int n_vertices);
|
||||
void _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
const CoglMatrix *projection,
|
||||
const float *viewport,
|
||||
const ClutterVertex *vertices_in,
|
||||
ClutterVertex *vertices_out,
|
||||
int n_vertices);
|
||||
|
||||
void _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
||||
graphene_rect_t *dest);
|
||||
ClutterRect *dest);
|
||||
|
||||
void _clutter_util_rectangle_int_extents (const graphene_rect_t *src,
|
||||
void _clutter_util_rectangle_int_extents (const ClutterRect *src,
|
||||
cairo_rectangle_int_t *dest);
|
||||
|
||||
void _clutter_util_rectangle_offset (const cairo_rectangle_int_t *src,
|
||||
@@ -274,6 +266,12 @@ struct _ClutterVertex4
|
||||
float w;
|
||||
};
|
||||
|
||||
void
|
||||
_clutter_util_vertex4_interpolate (const ClutterVertex4 *a,
|
||||
const ClutterVertex4 *b,
|
||||
double progress,
|
||||
ClutterVertex4 *res);
|
||||
|
||||
#define CLUTTER_MATRIX_INIT_IDENTITY { \
|
||||
1.0f, 0.0f, 0.0f, 0.0f, \
|
||||
0.0f, 1.0f, 0.0f, 0.0f, \
|
||||
@@ -281,10 +279,31 @@ struct _ClutterVertex4
|
||||
0.0f, 0.0f, 0.0f, 1.0f, \
|
||||
}
|
||||
|
||||
float _clutter_util_matrix_determinant (const ClutterMatrix *matrix);
|
||||
|
||||
void _clutter_util_matrix_skew_xy (ClutterMatrix *matrix,
|
||||
float factor);
|
||||
void _clutter_util_matrix_skew_xz (ClutterMatrix *matrix,
|
||||
float factor);
|
||||
void _clutter_util_matrix_skew_yz (ClutterMatrix *matrix,
|
||||
float factor);
|
||||
|
||||
gboolean _clutter_util_matrix_decompose (const ClutterMatrix *src,
|
||||
ClutterVertex *scale_p,
|
||||
float shear_p[3],
|
||||
ClutterVertex *rotate_p,
|
||||
ClutterVertex *translate_p,
|
||||
ClutterVertex4 *perspective_p);
|
||||
|
||||
PangoDirection _clutter_pango_unichar_direction (gunichar ch);
|
||||
|
||||
PangoDirection _clutter_pango_find_base_dir (const gchar *text,
|
||||
gint length);
|
||||
|
||||
typedef struct _ClutterPlane
|
||||
{
|
||||
graphene_vec3_t v0;
|
||||
graphene_vec3_t n;
|
||||
float v0[3];
|
||||
float n[3];
|
||||
} ClutterPlane;
|
||||
|
||||
typedef enum _ClutterCullResult
|
||||
|
@@ -352,64 +352,63 @@ _clutter_script_parse_knot (ClutterScript *script,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_rect_from_array (JsonArray *array,
|
||||
graphene_rect_t *rect)
|
||||
parse_geometry_from_array (JsonArray *array,
|
||||
ClutterGeometry *geometry)
|
||||
{
|
||||
if (json_array_get_length (array) != 4)
|
||||
return FALSE;
|
||||
|
||||
graphene_rect_init (rect,
|
||||
json_array_get_int_element (array, 0),
|
||||
json_array_get_int_element (array, 1),
|
||||
json_array_get_int_element (array, 2),
|
||||
json_array_get_int_element (array, 3));
|
||||
geometry->x = json_array_get_int_element (array, 0);
|
||||
geometry->y = json_array_get_int_element (array, 1);
|
||||
geometry->width = json_array_get_int_element (array, 2);
|
||||
geometry->height = json_array_get_int_element (array, 3);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_rect_from_object (JsonObject *object,
|
||||
graphene_rect_t *rect)
|
||||
parse_geometry_from_object (JsonObject *object,
|
||||
ClutterGeometry *geometry)
|
||||
{
|
||||
if (json_object_has_member (object, "x"))
|
||||
rect->origin.x = json_object_get_int_member (object, "x");
|
||||
geometry->x = json_object_get_int_member (object, "x");
|
||||
else
|
||||
rect->origin.x = 0;
|
||||
geometry->x = 0;
|
||||
|
||||
if (json_object_has_member (object, "y"))
|
||||
rect->origin.y = json_object_get_int_member (object, "y");
|
||||
geometry->y = json_object_get_int_member (object, "y");
|
||||
else
|
||||
rect->origin.y = 0;
|
||||
geometry->y = 0;
|
||||
|
||||
if (json_object_has_member (object, "width"))
|
||||
rect->size.width = json_object_get_int_member (object, "width");
|
||||
geometry->width = json_object_get_int_member (object, "width");
|
||||
else
|
||||
rect->size.width = 0;
|
||||
geometry->width = 0;
|
||||
|
||||
if (json_object_has_member (object, "height"))
|
||||
rect->size.height = json_object_get_int_member (object, "height");
|
||||
geometry->height = json_object_get_int_member (object, "height");
|
||||
else
|
||||
rect->size.height = 0;
|
||||
geometry->height = 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_script_parse_rect (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_rect_t *rect)
|
||||
_clutter_script_parse_geometry (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterGeometry *geometry)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
||||
g_return_val_if_fail (node != NULL, FALSE);
|
||||
g_return_val_if_fail (rect != NULL, FALSE);
|
||||
g_return_val_if_fail (geometry != NULL, FALSE);
|
||||
|
||||
switch (JSON_NODE_TYPE (node))
|
||||
{
|
||||
case JSON_NODE_ARRAY:
|
||||
return parse_rect_from_array (json_node_get_array (node), rect);
|
||||
return parse_geometry_from_array (json_node_get_array (node), geometry);
|
||||
|
||||
case JSON_NODE_OBJECT:
|
||||
return parse_rect_from_object (json_node_get_object (node), rect);
|
||||
return parse_geometry_from_object (json_node_get_object (node), geometry);
|
||||
|
||||
default:
|
||||
break;
|
||||
@@ -493,8 +492,8 @@ _clutter_script_parse_color (ClutterScript *script,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_point_from_array (JsonArray *array,
|
||||
graphene_point_t *point)
|
||||
parse_point_from_array (JsonArray *array,
|
||||
ClutterPoint *point)
|
||||
{
|
||||
if (json_array_get_length (array) != 2)
|
||||
return FALSE;
|
||||
@@ -506,8 +505,8 @@ parse_point_from_array (JsonArray *array,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_point_from_object (JsonObject *object,
|
||||
graphene_point_t *point)
|
||||
parse_point_from_object (JsonObject *object,
|
||||
ClutterPoint *point)
|
||||
{
|
||||
if (json_object_has_member (object, "x"))
|
||||
point->x = json_object_get_double_member (object, "x");
|
||||
@@ -523,9 +522,9 @@ parse_point_from_object (JsonObject *object,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_script_parse_point (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_point_t *point)
|
||||
_clutter_script_parse_point (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterPoint *point)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
||||
g_return_val_if_fail (node != NULL, FALSE);
|
||||
@@ -547,8 +546,8 @@ _clutter_script_parse_point (ClutterScript *script,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_size_from_array (JsonArray *array,
|
||||
graphene_size_t *size)
|
||||
parse_size_from_array (JsonArray *array,
|
||||
ClutterSize *size)
|
||||
{
|
||||
if (json_array_get_length (array) != 2)
|
||||
return FALSE;
|
||||
@@ -560,8 +559,8 @@ parse_size_from_array (JsonArray *array,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_size_from_object (JsonObject *object,
|
||||
graphene_size_t *size)
|
||||
parse_size_from_object (JsonObject *object,
|
||||
ClutterSize *size)
|
||||
{
|
||||
if (json_object_has_member (object, "width"))
|
||||
size->width = json_object_get_double_member (object, "width");
|
||||
@@ -577,9 +576,9 @@ parse_size_from_object (JsonObject *object,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_script_parse_size (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_size_t *size)
|
||||
_clutter_script_parse_size (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterSize *size)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
||||
g_return_val_if_fail (node != NULL, FALSE);
|
||||
@@ -1329,11 +1328,11 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (p_type == GRAPHENE_TYPE_RECT)
|
||||
else if (p_type == CLUTTER_TYPE_GEOMETRY)
|
||||
{
|
||||
graphene_rect_t rect = GRAPHENE_RECT_INIT (0, 0, 0, 0);
|
||||
ClutterGeometry geom = { 0, };
|
||||
|
||||
/* rect := {
|
||||
/* geometry := {
|
||||
* "x" : (int),
|
||||
* "y" : (int),
|
||||
* "width" : (int),
|
||||
@@ -1341,9 +1340,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
* }
|
||||
*/
|
||||
|
||||
if (_clutter_script_parse_rect (script, node, &rect))
|
||||
if (_clutter_script_parse_geometry (script, node, &geom))
|
||||
{
|
||||
g_value_set_boxed (value, &rect);
|
||||
g_value_set_boxed (value, &geom);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -1365,9 +1364,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (p_type == GRAPHENE_TYPE_POINT)
|
||||
else if (p_type == CLUTTER_TYPE_POINT)
|
||||
{
|
||||
graphene_point_t point = GRAPHENE_POINT_INIT_ZERO;
|
||||
ClutterPoint point = CLUTTER_POINT_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_point (script, node, &point))
|
||||
{
|
||||
@@ -1375,9 +1374,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (p_type == GRAPHENE_TYPE_SIZE)
|
||||
else if (p_type == CLUTTER_TYPE_SIZE)
|
||||
{
|
||||
graphene_size_t size = GRAPHENE_SIZE_INIT_ZERO;
|
||||
ClutterSize size = CLUTTER_SIZE_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_size (script, node, &size))
|
||||
{
|
||||
@@ -1418,15 +1417,15 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_RECT))
|
||||
else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_GEOMETRY))
|
||||
{
|
||||
graphene_rect_t rect = GRAPHENE_RECT_INIT (0, 0, 0, 0);
|
||||
ClutterGeometry geom = { 0, };
|
||||
|
||||
/* rect := [ (int), (int), (int), (int) ] */
|
||||
/* geometry := [ (int), (int), (int), (int) ] */
|
||||
|
||||
if (_clutter_script_parse_rect (script, node, &rect))
|
||||
if (_clutter_script_parse_geometry (script, node, &geom))
|
||||
{
|
||||
g_value_set_boxed (value, &rect);
|
||||
g_value_set_boxed (value, &geom);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -1442,9 +1441,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_POINT))
|
||||
else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_POINT))
|
||||
{
|
||||
graphene_point_t point = GRAPHENE_POINT_INIT_ZERO;
|
||||
ClutterPoint point = CLUTTER_POINT_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_point (script, node, &point))
|
||||
{
|
||||
@@ -1452,9 +1451,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_SIZE))
|
||||
else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_SIZE))
|
||||
{
|
||||
graphene_size_t size = GRAPHENE_SIZE_INIT_ZERO;
|
||||
ClutterSize size = CLUTTER_SIZE_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_size (script, node, &size))
|
||||
{
|
||||
@@ -1637,14 +1636,17 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
GObject *object,
|
||||
const gchar *name,
|
||||
GList *properties,
|
||||
GArray **params)
|
||||
GPtrArray **param_names,
|
||||
GArray **param_values)
|
||||
{
|
||||
ClutterScriptable *scriptable = NULL;
|
||||
ClutterScriptableIface *iface = NULL;
|
||||
GList *l, *unparsed;
|
||||
gboolean parse_custom = FALSE;
|
||||
|
||||
*params = g_array_new (FALSE, FALSE, sizeof (GParameter));
|
||||
*param_names = g_ptr_array_new_with_free_func (g_free);
|
||||
*param_values = g_array_new (FALSE, FALSE, sizeof (GValue));
|
||||
g_array_set_clear_func (*param_values, (GDestroyNotify) g_value_unset);
|
||||
|
||||
if (CLUTTER_IS_SCRIPTABLE (object))
|
||||
{
|
||||
@@ -1660,7 +1662,7 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
for (l = properties; l != NULL; l = l->next)
|
||||
{
|
||||
PropertyInfo *pinfo = l->data;
|
||||
GParameter param = { NULL };
|
||||
GValue value = G_VALUE_INIT;
|
||||
gboolean res = FALSE;
|
||||
|
||||
if (pinfo->is_child || pinfo->is_layout)
|
||||
@@ -1677,12 +1679,12 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
pinfo->name);
|
||||
|
||||
if (parse_custom)
|
||||
res = iface->parse_custom_node (scriptable, script, ¶m.value,
|
||||
res = iface->parse_custom_node (scriptable, script, &value,
|
||||
pinfo->name,
|
||||
pinfo->node);
|
||||
|
||||
if (!res)
|
||||
res = _clutter_script_parse_node (script, ¶m.value,
|
||||
res = _clutter_script_parse_node (script, &value,
|
||||
pinfo->name,
|
||||
pinfo->node,
|
||||
pinfo->pspec);
|
||||
@@ -1694,9 +1696,8 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
continue;
|
||||
}
|
||||
|
||||
param.name = g_strdup (pinfo->name);
|
||||
|
||||
g_array_append_val (*params, param);
|
||||
g_ptr_array_add (*param_names, g_strdup (pinfo->name));
|
||||
g_array_append_val (*param_values, value);
|
||||
|
||||
property_info_free (pinfo);
|
||||
}
|
||||
@@ -1711,7 +1712,8 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
GType gtype,
|
||||
const gchar *name,
|
||||
GList *properties,
|
||||
GArray **construct_params)
|
||||
GPtrArray **construct_param_names,
|
||||
GArray **construct_param_values)
|
||||
{
|
||||
GObjectClass *klass;
|
||||
GList *l, *unparsed;
|
||||
@@ -1719,14 +1721,17 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
klass = g_type_class_ref (gtype);
|
||||
g_assert (klass != NULL);
|
||||
|
||||
*construct_params = g_array_new (FALSE, FALSE, sizeof (GParameter));
|
||||
*construct_param_names = g_ptr_array_new_with_free_func (g_free);
|
||||
*construct_param_values = g_array_new (FALSE, FALSE, sizeof (GValue));
|
||||
g_array_set_clear_func (*construct_param_values,
|
||||
(GDestroyNotify) g_value_unset);
|
||||
|
||||
unparsed = NULL;
|
||||
|
||||
for (l = properties; l != NULL; l = l->next)
|
||||
{
|
||||
PropertyInfo *pinfo = l->data;
|
||||
GParameter param = { NULL };
|
||||
GValue value = G_VALUE_INIT;
|
||||
GParamSpec *pspec = NULL;
|
||||
|
||||
/* we allow custom property names for classes, so if we
|
||||
@@ -1750,9 +1755,7 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
continue;
|
||||
}
|
||||
|
||||
param.name = g_strdup (pinfo->name);
|
||||
|
||||
if (!_clutter_script_parse_node (script, ¶m.value,
|
||||
if (!_clutter_script_parse_node (script, &value,
|
||||
pinfo->name,
|
||||
pinfo->node,
|
||||
pinfo->pspec))
|
||||
@@ -1761,7 +1764,8 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
continue;
|
||||
}
|
||||
|
||||
g_array_append_val (*construct_params, param);
|
||||
g_ptr_array_add (*construct_param_names, g_strdup (pinfo->name));
|
||||
g_array_append_val (*construct_param_values, value);
|
||||
|
||||
property_info_free (pinfo);
|
||||
}
|
||||
@@ -2022,8 +2026,7 @@ add_children (ClutterScript *script,
|
||||
clutter_container_add_actor (container, CLUTTER_ACTOR (object));
|
||||
}
|
||||
|
||||
g_list_foreach (oinfo->children, (GFunc) g_free, NULL);
|
||||
g_list_free (oinfo->children);
|
||||
g_list_free_full (oinfo->children, g_free);
|
||||
|
||||
oinfo->children = unresolved;
|
||||
}
|
||||
@@ -2089,7 +2092,8 @@ _clutter_script_apply_properties (ClutterScript *script,
|
||||
gboolean set_custom_property = FALSE;
|
||||
GObject *object = oinfo->object;
|
||||
GList *properties;
|
||||
GArray *params;
|
||||
g_autoptr (GPtrArray) param_names = NULL;
|
||||
g_autoptr (GArray) param_values = NULL;
|
||||
guint i;
|
||||
|
||||
if (!oinfo->has_unresolved)
|
||||
@@ -2113,34 +2117,31 @@ _clutter_script_apply_properties (ClutterScript *script,
|
||||
object,
|
||||
oinfo->id,
|
||||
properties,
|
||||
¶ms);
|
||||
¶m_names,
|
||||
¶m_values);
|
||||
|
||||
/* consume all the properties we could translate in this pass */
|
||||
for (i = 0; i < params->len; i++)
|
||||
for (i = 0; i < param_names->len; i++)
|
||||
{
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
char *name = g_ptr_array_index (param_names, i);
|
||||
GValue *value = &g_array_index (param_values, GValue, i);
|
||||
|
||||
CLUTTER_NOTE (SCRIPT,
|
||||
"Setting %s property '%s' (type:%s) to object '%s' (id:%s)",
|
||||
set_custom_property ? "custom" : "regular",
|
||||
param->name,
|
||||
g_type_name (G_VALUE_TYPE (¶m->value)),
|
||||
name,
|
||||
g_type_name (G_VALUE_TYPE (value)),
|
||||
g_type_name (oinfo->gtype),
|
||||
oinfo->id);
|
||||
|
||||
if (set_custom_property)
|
||||
iface->set_custom_property (scriptable, script,
|
||||
param->name,
|
||||
¶m->value);
|
||||
name,
|
||||
value);
|
||||
else
|
||||
g_object_set_property (object, param->name, ¶m->value);
|
||||
|
||||
g_free ((gchar *) param->name);
|
||||
g_value_unset (¶m->value);
|
||||
g_object_set_property (object, name, value);
|
||||
}
|
||||
|
||||
g_array_free (params, TRUE);
|
||||
|
||||
_clutter_script_check_unresolved (script, oinfo);
|
||||
}
|
||||
|
||||
@@ -2148,8 +2149,8 @@ void
|
||||
_clutter_script_construct_object (ClutterScript *script,
|
||||
ObjectInfo *oinfo)
|
||||
{
|
||||
GArray *params = NULL;
|
||||
guint i;
|
||||
g_autoptr (GPtrArray) param_names = NULL;
|
||||
g_autoptr (GArray) param_values = NULL;
|
||||
|
||||
/* we have completely updated the object */
|
||||
if (oinfo->object != NULL)
|
||||
@@ -2192,25 +2193,14 @@ _clutter_script_construct_object (ClutterScript *script,
|
||||
oinfo->gtype,
|
||||
oinfo->id,
|
||||
properties,
|
||||
¶ms);
|
||||
¶m_names,
|
||||
¶m_values);
|
||||
|
||||
default_stage = clutter_stage_manager_get_default_stage (manager);
|
||||
oinfo->object = G_OBJECT (default_stage);
|
||||
|
||||
for (i = 0; i < params->len; i++)
|
||||
{
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
|
||||
g_free ((gchar *) param->name);
|
||||
g_value_unset (¶m->value);
|
||||
}
|
||||
|
||||
g_array_free (params, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_autoptr (GPtrArray) param_names = NULL;
|
||||
GArray *param_values;
|
||||
GList *properties = oinfo->properties;
|
||||
|
||||
/* every other object: first, we get the construction parameters */
|
||||
@@ -2219,22 +2209,11 @@ _clutter_script_construct_object (ClutterScript *script,
|
||||
oinfo->gtype,
|
||||
oinfo->id,
|
||||
properties,
|
||||
¶ms);
|
||||
|
||||
/* Convert GParameter → (GStrv, GValue[]) */
|
||||
param_names = g_ptr_array_sized_new (params->len);
|
||||
param_values = g_array_sized_new (TRUE, FALSE, sizeof (GValue), params->len);
|
||||
for (i = 0; i < params->len; i++)
|
||||
{
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
|
||||
g_ptr_array_add (param_names, (gchar *) param->name);
|
||||
g_array_append_val (param_values, param->value);
|
||||
}
|
||||
g_ptr_array_add (param_names, NULL);
|
||||
¶m_names,
|
||||
¶m_values);
|
||||
|
||||
oinfo->object = g_object_new_with_properties (oinfo->gtype,
|
||||
params->len,
|
||||
param_names->len,
|
||||
(const gchar **) param_names->pdata,
|
||||
(const GValue *) param_values->data);
|
||||
|
||||
@@ -2243,17 +2222,6 @@ _clutter_script_construct_object (ClutterScript *script,
|
||||
* else too or only by this ClutterScript object.
|
||||
*/
|
||||
g_object_ref_sink (oinfo->object);
|
||||
|
||||
for (i = 0; i < params->len; i++)
|
||||
{
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
|
||||
g_free ((gchar *) param->name);
|
||||
g_value_unset (¶m->value);
|
||||
}
|
||||
|
||||
g_array_free (param_values, FALSE);
|
||||
g_array_free (params, TRUE);
|
||||
}
|
||||
|
||||
g_assert (oinfo->object != NULL);
|
||||
|
@@ -122,9 +122,9 @@ gboolean _clutter_script_flags_from_string (GType gtype,
|
||||
gboolean _clutter_script_parse_knot (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterKnot *knot);
|
||||
gboolean _clutter_script_parse_rect (ClutterScript *script,
|
||||
gboolean _clutter_script_parse_geometry (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_rect_t *rect);
|
||||
ClutterGeometry *geometry);
|
||||
gboolean _clutter_script_parse_color (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterColor *color);
|
||||
@@ -132,10 +132,10 @@ GObject *_clutter_script_parse_alpha (ClutterScript *script,
|
||||
JsonNode *node);
|
||||
gboolean _clutter_script_parse_point (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_point_t *point);
|
||||
ClutterPoint *point);
|
||||
gboolean _clutter_script_parse_size (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_size_t *size);
|
||||
ClutterSize *size);
|
||||
|
||||
gboolean _clutter_script_parse_translatable_string (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
|
@@ -263,8 +263,6 @@ enum
|
||||
|
||||
static GParamSpec *obj_props[PROP_LAST];
|
||||
|
||||
#define CLUTTER_SCRIPT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_SCRIPT, ClutterScriptPrivate))
|
||||
|
||||
struct _ClutterScriptPrivate
|
||||
{
|
||||
GHashTable *objects;
|
||||
@@ -346,15 +344,12 @@ object_info_free (gpointer data)
|
||||
g_free (oinfo->class_name);
|
||||
g_free (oinfo->type_func);
|
||||
|
||||
g_list_foreach (oinfo->properties, (GFunc) property_info_free, NULL);
|
||||
g_list_free (oinfo->properties);
|
||||
g_list_free_full (oinfo->properties, property_info_free);
|
||||
|
||||
g_list_foreach (oinfo->signals, (GFunc) signal_info_free, NULL);
|
||||
g_list_free (oinfo->signals);
|
||||
g_list_free_full (oinfo->signals, signal_info_free);
|
||||
|
||||
/* these are ids */
|
||||
g_list_foreach (oinfo->children, (GFunc) g_free, NULL);
|
||||
g_list_free (oinfo->children);
|
||||
g_list_free_full (oinfo->children, g_free);
|
||||
|
||||
/* we unref top-level objects and leave the actors alone,
|
||||
* unless we are unmerging in which case we have to destroy
|
||||
@@ -380,7 +375,7 @@ object_info_free (gpointer data)
|
||||
static void
|
||||
clutter_script_finalize (GObject *gobject)
|
||||
{
|
||||
ClutterScriptPrivate *priv = CLUTTER_SCRIPT_GET_PRIVATE (gobject);
|
||||
ClutterScriptPrivate *priv = CLUTTER_SCRIPT (gobject)->priv;
|
||||
|
||||
g_object_unref (priv->parser);
|
||||
g_hash_table_destroy (priv->objects);
|
||||
@@ -846,8 +841,7 @@ clutter_script_unmerge_objects (ClutterScript *script,
|
||||
for (l = data.ids; l != NULL; l = l->next)
|
||||
g_hash_table_remove (priv->objects, l->data);
|
||||
|
||||
g_slist_foreach (data.ids, (GFunc) g_free, NULL);
|
||||
g_slist_free (data.ids);
|
||||
g_slist_free_full (data.ids, g_free);
|
||||
|
||||
clutter_script_ensure_objects (script);
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@
|
||||
|
||||
struct _ClutterScrollActorPrivate
|
||||
{
|
||||
graphene_point_t scroll_to;
|
||||
ClutterPoint scroll_to;
|
||||
|
||||
ClutterScrollMode scroll_mode;
|
||||
|
||||
@@ -94,19 +94,19 @@ G_DEFINE_TYPE_WITH_CODE (ClutterScrollActor, clutter_scroll_actor, CLUTTER_TYPE_
|
||||
clutter_animatable_iface_init))
|
||||
|
||||
static void
|
||||
clutter_scroll_actor_set_scroll_to_internal (ClutterScrollActor *self,
|
||||
const graphene_point_t *point)
|
||||
clutter_scroll_actor_set_scroll_to_internal (ClutterScrollActor *self,
|
||||
const ClutterPoint *point)
|
||||
{
|
||||
ClutterScrollActorPrivate *priv = self->priv;
|
||||
ClutterActor *actor = CLUTTER_ACTOR (self);
|
||||
ClutterMatrix m = CLUTTER_MATRIX_INIT_IDENTITY;
|
||||
float dx, dy;
|
||||
|
||||
if (graphene_point_equal (&priv->scroll_to, point))
|
||||
if (clutter_point_equals (&priv->scroll_to, point))
|
||||
return;
|
||||
|
||||
if (point == NULL)
|
||||
graphene_point_init (&priv->scroll_to, 0.f, 0.f);
|
||||
clutter_point_init (&priv->scroll_to, 0.f, 0.f);
|
||||
else
|
||||
priv->scroll_to = *point;
|
||||
|
||||
@@ -216,7 +216,7 @@ clutter_scroll_actor_set_final_state (ClutterAnimatable *animatable,
|
||||
if (strcmp (property_name, "scroll-to") == 0)
|
||||
{
|
||||
ClutterScrollActor *self = CLUTTER_SCROLL_ACTOR (animatable);
|
||||
const graphene_point_t *point = g_value_get_boxed (value);
|
||||
const ClutterPoint *point = g_value_get_boxed (value);
|
||||
|
||||
clutter_scroll_actor_set_scroll_to_internal (self, point);
|
||||
}
|
||||
@@ -248,7 +248,7 @@ clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
|
||||
g_param_spec_boxed ("scroll-to",
|
||||
"Scroll To",
|
||||
"The point to scroll the actor to",
|
||||
GRAPHENE_TYPE_POINT,
|
||||
CLUTTER_TYPE_POINT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
CLUTTER_PARAM_ANIMATABLE);
|
||||
@@ -322,7 +322,7 @@ clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor)
|
||||
/**
|
||||
* clutter_scroll_actor_scroll_to_point:
|
||||
* @actor: a #ClutterScrollActor
|
||||
* @point: a #graphene_point_t
|
||||
* @point: a #ClutterPoint
|
||||
*
|
||||
* Scrolls the contents of @actor so that @point is the new origin
|
||||
* of the visible area.
|
||||
@@ -335,8 +335,8 @@ clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor)
|
||||
* Since: 1.12
|
||||
*/
|
||||
void
|
||||
clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
const graphene_point_t *point)
|
||||
clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
const ClutterPoint *point)
|
||||
{
|
||||
ClutterScrollActorPrivate *priv;
|
||||
const ClutterAnimationInfo *info;
|
||||
@@ -390,10 +390,10 @@ clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
|
||||
/* if a transition already exist, update its bounds */
|
||||
clutter_transition_set_from (priv->transition,
|
||||
GRAPHENE_TYPE_POINT,
|
||||
CLUTTER_TYPE_POINT,
|
||||
&priv->scroll_to);
|
||||
clutter_transition_set_to (priv->transition,
|
||||
GRAPHENE_TYPE_POINT,
|
||||
CLUTTER_TYPE_POINT,
|
||||
point);
|
||||
|
||||
/* always use the current easing state */
|
||||
@@ -417,10 +417,10 @@ clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
* Since: 1.12
|
||||
*/
|
||||
void
|
||||
clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
const graphene_rect_t *rect)
|
||||
clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
const ClutterRect *rect)
|
||||
{
|
||||
graphene_rect_t n_rect;
|
||||
ClutterRect n_rect;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_SCROLL_ACTOR (actor));
|
||||
g_return_if_fail (rect != NULL);
|
||||
@@ -428,7 +428,7 @@ clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
n_rect = *rect;
|
||||
|
||||
/* normalize, so that we have a valid origin */
|
||||
graphene_rect_normalize (&n_rect);
|
||||
clutter_rect_normalize (&n_rect);
|
||||
|
||||
clutter_scroll_actor_scroll_to_point (actor, &n_rect.origin);
|
||||
}
|
||||
|
@@ -86,11 +86,11 @@ CLUTTER_EXPORT
|
||||
ClutterScrollMode clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
const graphene_point_t *point);
|
||||
void clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
const ClutterPoint *point);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
const graphene_rect_t *rect);
|
||||
void clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
const ClutterRect *rect);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -89,8 +89,8 @@ clutter_stage_manager_dispose (GObject *gobject)
|
||||
|
||||
stage_manager = CLUTTER_STAGE_MANAGER (gobject);
|
||||
|
||||
g_slist_foreach (stage_manager->stages, (GFunc) clutter_actor_destroy, NULL);
|
||||
g_slist_free (stage_manager->stages);
|
||||
g_slist_free_full (stage_manager->stages,
|
||||
(GDestroyNotify) clutter_actor_destroy);
|
||||
stage_manager->stages = NULL;
|
||||
|
||||
G_OBJECT_CLASS (clutter_stage_manager_parent_class)->dispose (gobject);
|
||||
|
@@ -40,6 +40,7 @@ void _clutter_stage_paint_view (ClutterStage
|
||||
ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip);
|
||||
|
||||
void _clutter_stage_emit_after_paint (ClutterStage *stage);
|
||||
void _clutter_stage_set_window (ClutterStage *stage,
|
||||
ClutterStageWindow *stage_window);
|
||||
ClutterStageWindow *_clutter_stage_get_window (ClutterStage *stage);
|
||||
@@ -117,16 +118,15 @@ void _clutter_stage_remove_touch_drag_actor (ClutterStage *st
|
||||
|
||||
ClutterStageState _clutter_stage_get_state (ClutterStage *stage);
|
||||
gboolean _clutter_stage_is_activated (ClutterStage *stage);
|
||||
gboolean _clutter_stage_is_fullscreen (ClutterStage *stage);
|
||||
gboolean _clutter_stage_update_state (ClutterStage *stage,
|
||||
ClutterStageState unset_state,
|
||||
ClutterStageState set_state);
|
||||
|
||||
void _clutter_stage_set_scale_factor (ClutterStage *stage,
|
||||
int factor);
|
||||
gboolean _clutter_stage_get_max_view_scale_factor_for_rect (ClutterStage *stage,
|
||||
graphene_rect_t *rect,
|
||||
float *view_scale);
|
||||
gboolean _clutter_stage_get_max_view_scale_factor_for_rect (ClutterStage *stage,
|
||||
ClutterRect *rect,
|
||||
float *view_scale);
|
||||
|
||||
void _clutter_stage_presented (ClutterStage *stage,
|
||||
CoglFrameEvent frame_event,
|
||||
|
37
clutter/clutter/clutter-stage-view-private.h
Normal file
37
clutter/clutter/clutter-stage-view-private.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#ifndef __CLUTTER_STAGE_VIEW_PRIVATE_H__
|
||||
#define __CLUTTER_STAGE_VIEW_PRIVATE_H__
|
||||
|
||||
#include "clutter/clutter-stage-view.h"
|
||||
|
||||
void clutter_stage_view_blit_offscreen (ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip);
|
||||
|
||||
gboolean clutter_stage_view_is_dirty_viewport (ClutterStageView *view);
|
||||
|
||||
void clutter_stage_view_set_dirty_viewport (ClutterStageView *view,
|
||||
gboolean dirty);
|
||||
|
||||
gboolean clutter_stage_view_is_dirty_projection (ClutterStageView *view);
|
||||
|
||||
void clutter_stage_view_set_dirty_projection (ClutterStageView *view,
|
||||
gboolean dirty);
|
||||
|
||||
|
||||
#endif /* __CLUTTER_STAGE_VIEW_PRIVATE_H__ */
|
@@ -18,6 +18,7 @@
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter/clutter-stage-view.h"
|
||||
#include "clutter/clutter-stage-view-private.h"
|
||||
|
||||
#include <cairo-gobject.h>
|
||||
#include <math.h>
|
||||
@@ -61,6 +62,14 @@ clutter_stage_view_get_layout (ClutterStageView *view,
|
||||
*rect = priv->layout;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_stage_view_get_framebuffer:
|
||||
* @view: a #ClutterStageView
|
||||
*
|
||||
* Retrieves the framebuffer of @view to draw to.
|
||||
*
|
||||
* Returns: (transfer none): a #CoglFramebuffer
|
||||
*/
|
||||
CoglFramebuffer *
|
||||
clutter_stage_view_get_framebuffer (ClutterStageView *view)
|
||||
{
|
||||
@@ -73,6 +82,14 @@ clutter_stage_view_get_framebuffer (ClutterStageView *view)
|
||||
return priv->framebuffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_stage_view_get_onscreen:
|
||||
* @view: a #ClutterStageView
|
||||
*
|
||||
* Retrieves the onscreen framebuffer of @view if available.
|
||||
*
|
||||
* Returns: (transfer none): a #CoglFramebuffer
|
||||
*/
|
||||
CoglFramebuffer *
|
||||
clutter_stage_view_get_onscreen (ClutterStageView *view)
|
||||
{
|
||||
@@ -133,8 +150,8 @@ clutter_stage_view_blit_offscreen (ClutterStageView *view,
|
||||
* the bottom right corner.
|
||||
*/
|
||||
cogl_matrix_init_identity (&matrix);
|
||||
cogl_matrix_scale (&matrix, 2, -2, 0);
|
||||
cogl_matrix_translate (&matrix, -1, 1, 0);
|
||||
cogl_matrix_scale (&matrix, 2, -2, 0);
|
||||
cogl_framebuffer_set_projection_matrix (priv->framebuffer, &matrix);
|
||||
|
||||
cogl_framebuffer_draw_rectangle (priv->framebuffer,
|
||||
|
@@ -18,6 +18,10 @@
|
||||
#ifndef __CLUTTER_STAGE_VIEW_H__
|
||||
#define __CLUTTER_STAGE_VIEW_H__
|
||||
|
||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <clutter/clutter.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <cairo.h>
|
||||
#include <glib-object.h>
|
||||
#include <cogl/cogl.h>
|
||||
@@ -57,22 +61,9 @@ void clutter_stage_view_transform_to_onscreen (ClutterStageView *vie
|
||||
gfloat *x,
|
||||
gfloat *y);
|
||||
|
||||
void clutter_stage_view_blit_offscreen (ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
float clutter_stage_view_get_scale (ClutterStageView *view);
|
||||
|
||||
gboolean clutter_stage_view_is_dirty_viewport (ClutterStageView *view);
|
||||
|
||||
void clutter_stage_view_set_dirty_viewport (ClutterStageView *view,
|
||||
gboolean dirty);
|
||||
|
||||
gboolean clutter_stage_view_is_dirty_projection (ClutterStageView *view);
|
||||
|
||||
void clutter_stage_view_set_dirty_projection (ClutterStageView *view,
|
||||
gboolean dirty);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView *view,
|
||||
CoglMatrix *matrix);
|
||||
|
@@ -62,16 +62,6 @@ _clutter_stage_window_set_title (ClutterStageWindow *window,
|
||||
iface->set_title (window, title);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_stage_window_set_fullscreen (ClutterStageWindow *window,
|
||||
gboolean is_fullscreen)
|
||||
{
|
||||
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||
|
||||
if (iface->set_fullscreen)
|
||||
iface->set_fullscreen (window, is_fullscreen);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
|
||||
gboolean is_visible)
|
||||
@@ -82,14 +72,6 @@ _clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
|
||||
iface->set_cursor_visible (window, is_visible);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_stage_window_set_user_resizable (ClutterStageWindow *window,
|
||||
gboolean is_resizable)
|
||||
{
|
||||
CLUTTER_STAGE_WINDOW_GET_IFACE (window)->set_user_resizable (window,
|
||||
is_resizable);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_stage_window_realize (ClutterStageWindow *window)
|
||||
{
|
||||
|
@@ -30,12 +30,8 @@ struct _ClutterStageWindowInterface
|
||||
|
||||
void (* set_title) (ClutterStageWindow *stage_window,
|
||||
const gchar *title);
|
||||
void (* set_fullscreen) (ClutterStageWindow *stage_window,
|
||||
gboolean is_fullscreen);
|
||||
void (* set_cursor_visible) (ClutterStageWindow *stage_window,
|
||||
gboolean cursor_visible);
|
||||
void (* set_user_resizable) (ClutterStageWindow *stage_window,
|
||||
gboolean is_resizable);
|
||||
|
||||
gboolean (* realize) (ClutterStageWindow *stage_window);
|
||||
void (* unrealize) (ClutterStageWindow *stage_window);
|
||||
@@ -83,12 +79,8 @@ ClutterActor * _clutter_stage_window_get_wrapper (ClutterStageWindow *
|
||||
|
||||
void _clutter_stage_window_set_title (ClutterStageWindow *window,
|
||||
const gchar *title);
|
||||
void _clutter_stage_window_set_fullscreen (ClutterStageWindow *window,
|
||||
gboolean is_fullscreen);
|
||||
void _clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
|
||||
gboolean is_visible);
|
||||
void _clutter_stage_window_set_user_resizable (ClutterStageWindow *window,
|
||||
gboolean is_resizable);
|
||||
|
||||
gboolean _clutter_stage_window_realize (ClutterStageWindow *window);
|
||||
void _clutter_stage_window_unrealize (ClutterStageWindow *window);
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -30,6 +30,7 @@
|
||||
|
||||
#include <clutter/clutter-types.h>
|
||||
#include <clutter/clutter-group.h>
|
||||
#include <clutter/clutter-stage-view.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -61,8 +62,6 @@ struct _ClutterStage
|
||||
};
|
||||
/**
|
||||
* ClutterStageClass:
|
||||
* @fullscreen: handler for the #ClutterStage::fullscreen signal
|
||||
* @unfullscreen: handler for the #ClutterStage::unfullscreen signal
|
||||
* @activate: handler for the #ClutterStage::activate signal
|
||||
* @deactivate: handler for the #ClutterStage::deactivate signal
|
||||
* @delete_event: handler for the #ClutterStage::delete-event signal
|
||||
@@ -79,17 +78,18 @@ struct _ClutterStageClass
|
||||
|
||||
/*< public >*/
|
||||
/* signals */
|
||||
void (* fullscreen) (ClutterStage *stage);
|
||||
void (* unfullscreen) (ClutterStage *stage);
|
||||
void (* activate) (ClutterStage *stage);
|
||||
void (* deactivate) (ClutterStage *stage);
|
||||
|
||||
gboolean (* delete_event) (ClutterStage *stage,
|
||||
ClutterEvent *event);
|
||||
|
||||
void (* paint_view) (ClutterStage *stage,
|
||||
ClutterStageView *view);
|
||||
|
||||
/*< private >*/
|
||||
/* padding for future expansion */
|
||||
gpointer _padding_dummy[31];
|
||||
gpointer _padding_dummy[30];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -115,6 +115,26 @@ struct _ClutterPerspective
|
||||
gfloat z_far;
|
||||
};
|
||||
|
||||
/**
|
||||
* ClutterFog:
|
||||
* @z_near: starting distance from the viewer to the near clipping
|
||||
* plane (always positive)
|
||||
* @z_far: final distance from the viewer to the far clipping
|
||||
* plane (always positive)
|
||||
*
|
||||
* Fog settings used to create the depth cueing effect.
|
||||
*
|
||||
* Since: 0.6
|
||||
*
|
||||
* Deprecated: 1.10: The fog-related API in #ClutterStage has been
|
||||
* deprecated as well.
|
||||
*/
|
||||
struct _ClutterFog
|
||||
{
|
||||
gfloat z_near;
|
||||
gfloat z_far;
|
||||
};
|
||||
|
||||
/**
|
||||
* ClutterFrameInfo: (skip)
|
||||
*/
|
||||
@@ -133,6 +153,8 @@ typedef struct _ClutterCapture
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_perspective_get_type (void) G_GNUC_CONST;
|
||||
CLUTTER_DEPRECATED
|
||||
GType clutter_fog_get_type (void) G_GNUC_CONST;
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_stage_get_type (void) G_GNUC_CONST;
|
||||
|
||||
@@ -146,11 +168,6 @@ CLUTTER_EXPORT
|
||||
void clutter_stage_get_perspective (ClutterStage *stage,
|
||||
ClutterPerspective *perspective);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_set_fullscreen (ClutterStage *stage,
|
||||
gboolean fullscreen);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_stage_get_fullscreen (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_show_cursor (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_hide_cursor (ClutterStage *stage);
|
||||
@@ -159,11 +176,6 @@ void clutter_stage_set_title (ClutterStage
|
||||
const gchar *title);
|
||||
CLUTTER_EXPORT
|
||||
const gchar * clutter_stage_get_title (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_set_user_resizable (ClutterStage *stage,
|
||||
gboolean resizable);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_stage_get_user_resizable (ClutterStage *stage);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_set_minimum_size (ClutterStage *stage,
|
||||
@@ -252,6 +264,10 @@ gboolean clutter_stage_capture (ClutterStage *stage,
|
||||
cairo_rectangle_int_t *rect,
|
||||
ClutterCapture **captures,
|
||||
int *n_captures);
|
||||
CLUTTER_EXPORT
|
||||
ClutterStageView * clutter_stage_get_view_at (ClutterStage *stage,
|
||||
float x,
|
||||
float y);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -273,7 +273,7 @@ clutter_test_run (void)
|
||||
typedef struct {
|
||||
ClutterActor *stage;
|
||||
|
||||
graphene_point_t point;
|
||||
ClutterPoint point;
|
||||
|
||||
gpointer result;
|
||||
|
||||
@@ -348,10 +348,10 @@ on_key_press_event (ClutterActor *stage,
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
clutter_test_check_actor_at_point (ClutterActor *stage,
|
||||
const graphene_point_t *point,
|
||||
ClutterActor *actor,
|
||||
ClutterActor **result)
|
||||
clutter_test_check_actor_at_point (ClutterActor *stage,
|
||||
const ClutterPoint *point,
|
||||
ClutterActor *actor,
|
||||
ClutterActor **result)
|
||||
{
|
||||
ValidateData *data;
|
||||
guint press_id = 0;
|
||||
@@ -410,10 +410,10 @@ clutter_test_check_actor_at_point (ClutterActor *stage,
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
clutter_test_check_color_at_point (ClutterActor *stage,
|
||||
const graphene_point_t *point,
|
||||
const ClutterColor *color,
|
||||
ClutterColor *result)
|
||||
clutter_test_check_color_at_point (ClutterActor *stage,
|
||||
const ClutterPoint *point,
|
||||
const ClutterColor *color,
|
||||
ClutterColor *result)
|
||||
{
|
||||
ValidateData *data;
|
||||
gboolean retval;
|
||||
|
@@ -112,7 +112,7 @@ ClutterActor * clutter_test_get_stage (void);
|
||||
|
||||
#define clutter_test_assert_actor_at_point(stage,point,actor) \
|
||||
G_STMT_START { \
|
||||
const graphene_point_t *__p = (point); \
|
||||
const ClutterPoint *__p = (point); \
|
||||
ClutterActor *__actor = (actor); \
|
||||
ClutterActor *__stage = (stage); \
|
||||
ClutterActor *__res; \
|
||||
@@ -132,7 +132,7 @@ G_STMT_START { \
|
||||
|
||||
#define clutter_test_assert_color_at_point(stage,point,color) \
|
||||
G_STMT_START { \
|
||||
const graphene_point_t *__p = (point); \
|
||||
const ClutterPoint *__p = (point); \
|
||||
const ClutterColor *__c = (color); \
|
||||
ClutterActor *__stage = (stage); \
|
||||
ClutterColor __res; \
|
||||
@@ -149,15 +149,15 @@ G_STMT_START { \
|
||||
} G_STMT_END
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_test_check_actor_at_point (ClutterActor *stage,
|
||||
const graphene_point_t *point,
|
||||
ClutterActor *actor,
|
||||
ClutterActor **result);
|
||||
gboolean clutter_test_check_actor_at_point (ClutterActor *stage,
|
||||
const ClutterPoint *point,
|
||||
ClutterActor *actor,
|
||||
ClutterActor **result);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_test_check_color_at_point (ClutterActor *stage,
|
||||
const graphene_point_t *point,
|
||||
const ClutterColor *color,
|
||||
ClutterColor *result);
|
||||
gboolean clutter_test_check_color_at_point (ClutterActor *stage,
|
||||
const ClutterPoint *point,
|
||||
const ClutterColor *color,
|
||||
ClutterColor *result);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -171,7 +171,7 @@ clutter_text_buffer_normal_insert_text (ClutterTextBuffer *buffer,
|
||||
|
||||
/* Actual text insertion */
|
||||
at = g_utf8_offset_to_pointer (pv->normal_text, position) - pv->normal_text;
|
||||
g_memmove (pv->normal_text + at + n_bytes, pv->normal_text + at, pv->normal_text_bytes - at);
|
||||
memmove (pv->normal_text + at + n_bytes, pv->normal_text + at, pv->normal_text_bytes - at);
|
||||
memcpy (pv->normal_text + at, chars, n_bytes);
|
||||
|
||||
/* Book keeping */
|
||||
@@ -201,7 +201,7 @@ clutter_text_buffer_normal_delete_text (ClutterTextBuffer *buffer,
|
||||
start = g_utf8_offset_to_pointer (pv->normal_text, position) - pv->normal_text;
|
||||
end = g_utf8_offset_to_pointer (pv->normal_text, position + n_chars) - pv->normal_text;
|
||||
|
||||
g_memmove (pv->normal_text + start, pv->normal_text + end, pv->normal_text_bytes + 1 - end);
|
||||
memmove (pv->normal_text + start, pv->normal_text + end, pv->normal_text_bytes + 1 - end);
|
||||
pv->normal_text_chars -= n_chars;
|
||||
pv->normal_text_bytes -= (end - start);
|
||||
|
||||
|
@@ -157,7 +157,7 @@ struct _ClutterTextPrivate
|
||||
gint text_logical_y;
|
||||
|
||||
/* Where to draw the cursor */
|
||||
graphene_rect_t cursor_rect;
|
||||
ClutterRect cursor_rect;
|
||||
ClutterColor cursor_color;
|
||||
guint cursor_size;
|
||||
|
||||
@@ -751,7 +751,7 @@ clutter_text_create_layout_no_cache (ClutterText *text,
|
||||
if (priv->password_char != 0)
|
||||
pango_dir = PANGO_DIRECTION_NEUTRAL;
|
||||
else
|
||||
pango_dir = pango_find_base_dir (contents, contents_len);
|
||||
pango_dir = _clutter_pango_find_base_dir (contents, contents_len);
|
||||
|
||||
if (pango_dir == PANGO_DIRECTION_NEUTRAL)
|
||||
{
|
||||
@@ -1304,7 +1304,7 @@ static inline void
|
||||
update_cursor_location (ClutterText *self)
|
||||
{
|
||||
ClutterTextPrivate *priv = self->priv;
|
||||
graphene_rect_t rect;
|
||||
ClutterRect rect;
|
||||
float x, y;
|
||||
|
||||
if (!priv->editable)
|
||||
@@ -1312,7 +1312,7 @@ update_cursor_location (ClutterText *self)
|
||||
|
||||
rect = priv->cursor_rect;
|
||||
clutter_actor_get_transformed_position (CLUTTER_ACTOR (self), &x, &y);
|
||||
graphene_rect_offset (&rect, x, y);
|
||||
clutter_rect_offset (&rect, x, y);
|
||||
clutter_input_focus_set_cursor_location (priv->input_focus, &rect);
|
||||
}
|
||||
|
||||
@@ -1322,7 +1322,7 @@ clutter_text_ensure_cursor_position (ClutterText *self,
|
||||
{
|
||||
ClutterTextPrivate *priv = self->priv;
|
||||
gfloat x, y, cursor_height;
|
||||
graphene_rect_t cursor_rect = GRAPHENE_RECT_INIT (0, 0, 0, 0);
|
||||
ClutterRect cursor_rect = CLUTTER_RECT_INIT_ZERO;
|
||||
gint position;
|
||||
|
||||
position = priv->position;
|
||||
@@ -1345,17 +1345,25 @@ clutter_text_ensure_cursor_position (ClutterText *self,
|
||||
&x, &y,
|
||||
&cursor_height);
|
||||
|
||||
graphene_rect_init (&cursor_rect,
|
||||
x,
|
||||
y + CURSOR_Y_PADDING * scale,
|
||||
priv->cursor_size * scale,
|
||||
cursor_height - 2 * CURSOR_Y_PADDING * scale);
|
||||
clutter_rect_init (&cursor_rect,
|
||||
x,
|
||||
y + CURSOR_Y_PADDING * scale,
|
||||
priv->cursor_size * scale,
|
||||
cursor_height - 2 * CURSOR_Y_PADDING * scale);
|
||||
|
||||
if (!graphene_rect_equal (&priv->cursor_rect, &cursor_rect))
|
||||
if (!clutter_rect_equals (&priv->cursor_rect, &cursor_rect))
|
||||
{
|
||||
ClutterGeometry cursor_pos;
|
||||
|
||||
priv->cursor_rect = cursor_rect;
|
||||
|
||||
g_signal_emit (self, text_signals[CURSOR_EVENT], 0, &cursor_rect);
|
||||
/* XXX:2.0 - remove */
|
||||
cursor_pos.x = clutter_rect_get_x (&priv->cursor_rect);
|
||||
cursor_pos.y = clutter_rect_get_y (&priv->cursor_rect);
|
||||
cursor_pos.width = clutter_rect_get_width (&priv->cursor_rect);
|
||||
cursor_pos.height = clutter_rect_get_height (&priv->cursor_rect);
|
||||
g_signal_emit (self, text_signals[CURSOR_EVENT], 0, &cursor_pos);
|
||||
|
||||
g_signal_emit (self, text_signals[CURSOR_CHANGED], 0);
|
||||
|
||||
update_cursor_location (self);
|
||||
@@ -1967,6 +1975,7 @@ selection_paint (ClutterText *self,
|
||||
else
|
||||
{
|
||||
/* Paint selection background first */
|
||||
CoglPipeline *color_pipeline = cogl_pipeline_copy (default_color_pipeline);
|
||||
PangoLayout *layout = clutter_text_get_layout (self);
|
||||
CoglPath *selection_path = cogl_path_new ();
|
||||
CoglColor cogl_color = { 0, };
|
||||
@@ -1979,11 +1988,19 @@ selection_paint (ClutterText *self,
|
||||
else
|
||||
color = &priv->text_color;
|
||||
|
||||
cogl_color_init_from_4ub (&cogl_color,
|
||||
color->red,
|
||||
color->green,
|
||||
color->blue,
|
||||
paint_opacity * color->alpha / 255);
|
||||
cogl_color_premultiply (&cogl_color);
|
||||
cogl_pipeline_set_color (color_pipeline, &cogl_color);
|
||||
|
||||
clutter_text_foreach_selection_rectangle_prescaled (self,
|
||||
add_selection_rectangle_to_path,
|
||||
selection_path);
|
||||
|
||||
cogl_path_fill (selection_path);
|
||||
cogl_framebuffer_fill_path (fb, color_pipeline, selection_path);
|
||||
|
||||
/* Paint selected text */
|
||||
cogl_framebuffer_push_path_clip (fb, selection_path);
|
||||
@@ -2692,7 +2709,7 @@ clutter_text_paint (ClutterActor *self)
|
||||
|
||||
if (actor_width < text_width)
|
||||
{
|
||||
gint cursor_x = graphene_rect_get_x (&priv->cursor_rect);
|
||||
gint cursor_x = clutter_rect_get_x (&priv->cursor_rect);
|
||||
|
||||
if (priv->position == -1)
|
||||
{
|
||||
@@ -2779,7 +2796,7 @@ add_selection_to_paint_volume (ClutterText *text,
|
||||
{
|
||||
ClutterPaintVolume *total_volume = user_data;
|
||||
ClutterPaintVolume rect_volume;
|
||||
graphene_point3d_t vertex;
|
||||
ClutterVertex vertex;
|
||||
|
||||
_clutter_paint_volume_init_static (&rect_volume, CLUTTER_ACTOR (text));
|
||||
|
||||
@@ -2801,7 +2818,7 @@ clutter_text_get_paint_volume_for_cursor (ClutterText *text,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
ClutterTextPrivate *priv = text->priv;
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
|
||||
clutter_text_ensure_cursor_position (text, resource_scale);
|
||||
|
||||
@@ -2844,7 +2861,7 @@ clutter_text_get_paint_volume (ClutterActor *self,
|
||||
{
|
||||
PangoLayout *layout;
|
||||
PangoRectangle ink_rect;
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
float resource_scale;
|
||||
|
||||
/* If the text is single line editable then it gets clipped to
|
||||
@@ -4380,10 +4397,10 @@ clutter_text_class_init (ClutterTextClass *klass)
|
||||
/**
|
||||
* ClutterText::cursor-event:
|
||||
* @self: the #ClutterText that emitted the signal
|
||||
* @rect: the coordinates of the cursor
|
||||
* @geometry: the coordinates of the cursor
|
||||
*
|
||||
* The ::cursor-event signal is emitted whenever the cursor position
|
||||
* changes inside a #ClutterText actor. Inside @rect it is stored
|
||||
* changes inside a #ClutterText actor. Inside @geometry it is stored
|
||||
* the current position and size of the cursor, relative to the actor
|
||||
* itself.
|
||||
*
|
||||
@@ -4399,7 +4416,7 @@ clutter_text_class_init (ClutterTextClass *klass)
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__BOXED,
|
||||
G_TYPE_NONE, 1,
|
||||
GRAPHENE_TYPE_RECT | G_SIGNAL_TYPE_STATIC_SCOPE);
|
||||
CLUTTER_TYPE_GEOMETRY | G_SIGNAL_TYPE_STATIC_SCOPE);
|
||||
|
||||
/**
|
||||
* ClutterText::cursor-changed:
|
||||
@@ -6764,8 +6781,8 @@ clutter_text_get_layout_offsets (ClutterText *self,
|
||||
* Since: 1.16
|
||||
*/
|
||||
void
|
||||
clutter_text_get_cursor_rect (ClutterText *self,
|
||||
graphene_rect_t *rect)
|
||||
clutter_text_get_cursor_rect (ClutterText *self,
|
||||
ClutterRect *rect)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_TEXT (self));
|
||||
g_return_if_fail (rect != NULL);
|
||||
|
@@ -82,7 +82,7 @@ struct _ClutterTextClass
|
||||
void (* text_changed) (ClutterText *self);
|
||||
void (* activate) (ClutterText *self);
|
||||
void (* cursor_event) (ClutterText *self,
|
||||
const graphene_rect_t *rect);
|
||||
const ClutterGeometry *geometry);
|
||||
void (* cursor_changed) (ClutterText *self);
|
||||
|
||||
/*< private >*/
|
||||
@@ -230,7 +230,7 @@ CLUTTER_EXPORT
|
||||
guint clutter_text_get_cursor_size (ClutterText *self);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_text_get_cursor_rect (ClutterText *self,
|
||||
graphene_rect_t *rect);
|
||||
ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_text_set_selectable (ClutterText *self,
|
||||
gboolean selectable);
|
||||
|
@@ -145,8 +145,8 @@ struct _ClutterTimelinePrivate
|
||||
ClutterStepMode step_mode;
|
||||
|
||||
/* cubic-bezier() parameters */
|
||||
graphene_point_t cb_1;
|
||||
graphene_point_t cb_2;
|
||||
ClutterPoint cb_1;
|
||||
ClutterPoint cb_2;
|
||||
|
||||
guint is_playing : 1;
|
||||
|
||||
@@ -850,8 +850,8 @@ clutter_timeline_init (ClutterTimeline *self)
|
||||
self->priv->step_mode = CLUTTER_STEP_MODE_END;
|
||||
|
||||
/* default cubic-bezier() paramereters are (0, 0, 1, 1) */
|
||||
graphene_point_init (&self->priv->cb_1, 0, 0);
|
||||
graphene_point_init (&self->priv->cb_2, 1, 1);
|
||||
clutter_point_init (&self->priv->cb_1, 0, 0);
|
||||
clutter_point_init (&self->priv->cb_2, 1, 1);
|
||||
}
|
||||
|
||||
struct CheckIfMarkerHitClosure
|
||||
@@ -2493,9 +2493,9 @@ clutter_timeline_get_step_progress (ClutterTimeline *timeline,
|
||||
* Since: 1.12
|
||||
*/
|
||||
void
|
||||
clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
const graphene_point_t *c_1,
|
||||
const graphene_point_t *c_2)
|
||||
clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
const ClutterPoint *c_1,
|
||||
const ClutterPoint *c_2)
|
||||
{
|
||||
ClutterTimelinePrivate *priv;
|
||||
|
||||
@@ -2530,9 +2530,9 @@ clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
* Since: 1.12
|
||||
*/
|
||||
gboolean
|
||||
clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
graphene_point_t *c_1,
|
||||
graphene_point_t *c_2)
|
||||
clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
ClutterPoint *c_1,
|
||||
ClutterPoint *c_2)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), FALSE);
|
||||
|
||||
|
@@ -209,12 +209,12 @@ gboolean clutter_timeline_get_step_progress
|
||||
ClutterStepMode *step_mode);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
const graphene_point_t *c_1,
|
||||
const graphene_point_t *c_2);
|
||||
const ClutterPoint *c_1,
|
||||
const ClutterPoint *c_2);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
graphene_point_t *c_1,
|
||||
graphene_point_t *c_2);
|
||||
ClutterPoint *c_1,
|
||||
ClutterPoint *c_2);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gint64 clutter_timeline_get_duration_hint (ClutterTimeline *timeline);
|
||||
|
@@ -33,16 +33,20 @@
|
||||
#include <clutter/clutter-macros.h>
|
||||
#include <clutter/clutter-enums.h>
|
||||
|
||||
#include <graphene-gobject.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_ACTOR_BOX (clutter_actor_box_get_type ())
|
||||
#define CLUTTER_TYPE_FOG (clutter_fog_get_type ())
|
||||
#define CLUTTER_TYPE_GEOMETRY (clutter_geometry_get_type ())
|
||||
#define CLUTTER_TYPE_KNOT (clutter_knot_get_type ())
|
||||
#define CLUTTER_TYPE_MARGIN (clutter_margin_get_type ())
|
||||
#define CLUTTER_TYPE_MATRIX (clutter_matrix_get_type ())
|
||||
#define CLUTTER_TYPE_PAINT_VOLUME (clutter_paint_volume_get_type ())
|
||||
#define CLUTTER_TYPE_PERSPECTIVE (clutter_perspective_get_type ())
|
||||
#define CLUTTER_TYPE_VERTEX (clutter_vertex_get_type ())
|
||||
#define CLUTTER_TYPE_POINT (clutter_point_get_type ())
|
||||
#define CLUTTER_TYPE_SIZE (clutter_size_get_type ())
|
||||
#define CLUTTER_TYPE_RECT (clutter_rect_get_type ())
|
||||
|
||||
typedef struct _ClutterActor ClutterActor;
|
||||
|
||||
@@ -75,9 +79,14 @@ typedef struct _ClutterPathNode ClutterPathNode;
|
||||
|
||||
typedef struct _ClutterActorBox ClutterActorBox;
|
||||
typedef struct _ClutterColor ClutterColor;
|
||||
typedef struct _ClutterGeometry ClutterGeometry; /* XXX:2.0 - remove */
|
||||
typedef struct _ClutterKnot ClutterKnot;
|
||||
typedef struct _ClutterMargin ClutterMargin;
|
||||
typedef struct _ClutterPerspective ClutterPerspective;
|
||||
typedef struct _ClutterPoint ClutterPoint;
|
||||
typedef struct _ClutterRect ClutterRect;
|
||||
typedef struct _ClutterSize ClutterSize;
|
||||
typedef struct _ClutterVertex ClutterVertex;
|
||||
|
||||
typedef struct _ClutterAlpha ClutterAlpha;
|
||||
typedef struct _ClutterAnimation ClutterAnimation;
|
||||
@@ -104,6 +113,7 @@ typedef union _ClutterEvent ClutterEvent;
|
||||
*/
|
||||
typedef struct _ClutterEventSequence ClutterEventSequence;
|
||||
|
||||
typedef struct _ClutterFog ClutterFog; /* deprecated */
|
||||
typedef struct _ClutterBehaviour ClutterBehaviour; /* deprecated */
|
||||
typedef struct _ClutterShader ClutterShader; /* deprecated */
|
||||
|
||||
@@ -127,6 +137,307 @@ typedef struct _ClutterShader ClutterShader; /* deprecated */
|
||||
*/
|
||||
typedef struct _ClutterPaintVolume ClutterPaintVolume;
|
||||
|
||||
/**
|
||||
* ClutterPoint:
|
||||
* @x: X coordinate, in pixels
|
||||
* @y: Y coordinate, in pixels
|
||||
*
|
||||
* A point in 2D space.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
struct _ClutterPoint
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
|
||||
/**
|
||||
* CLUTTER_POINT_INIT:
|
||||
* @x: X coordinate
|
||||
* @y: Y coordinate
|
||||
*
|
||||
* A simple macro for initializing a #ClutterPoint when declaring it, e.g.:
|
||||
*
|
||||
* |[
|
||||
* ClutterPoint p = CLUTTER_POINT_INIT (100, 100);
|
||||
* ]|
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
#define CLUTTER_POINT_INIT(x,y) { (x), (y) }
|
||||
|
||||
/**
|
||||
* CLUTTER_POINT_INIT_ZERO:
|
||||
*
|
||||
* A simple macro for initializing a #ClutterPoint to (0, 0) when
|
||||
* declaring it.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
#define CLUTTER_POINT_INIT_ZERO CLUTTER_POINT_INIT (0.f, 0.f)
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_point_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
const ClutterPoint * clutter_point_zero (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterPoint * clutter_point_alloc (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterPoint * clutter_point_init (ClutterPoint *point,
|
||||
float x,
|
||||
float y);
|
||||
CLUTTER_EXPORT
|
||||
ClutterPoint * clutter_point_copy (const ClutterPoint *point);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_point_free (ClutterPoint *point);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_point_equals (const ClutterPoint *a,
|
||||
const ClutterPoint *b);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_point_distance (const ClutterPoint *a,
|
||||
const ClutterPoint *b,
|
||||
float *x_distance,
|
||||
float *y_distance);
|
||||
|
||||
/**
|
||||
* ClutterSize:
|
||||
* @width: the width, in pixels
|
||||
* @height: the height, in pixels
|
||||
*
|
||||
* A size, in 2D space.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
struct _ClutterSize
|
||||
{
|
||||
float width;
|
||||
float height;
|
||||
};
|
||||
|
||||
/**
|
||||
* CLUTTER_SIZE_INIT:
|
||||
* @width: the width
|
||||
* @height: the height
|
||||
*
|
||||
* A simple macro for initializing a #ClutterSize when declaring it, e.g.:
|
||||
*
|
||||
* |[
|
||||
* ClutterSize s = CLUTTER_SIZE_INIT (200, 200);
|
||||
* ]|
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
#define CLUTTER_SIZE_INIT(width,height) { (width), (height) }
|
||||
|
||||
/**
|
||||
* CLUTTER_SIZE_INIT_ZERO:
|
||||
*
|
||||
* A simple macro for initializing a #ClutterSize to (0, 0) when
|
||||
* declaring it.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
#define CLUTTER_SIZE_INIT_ZERO CLUTTER_SIZE_INIT (0.f, 0.f)
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_size_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterSize * clutter_size_alloc (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterSize * clutter_size_init (ClutterSize *size,
|
||||
float width,
|
||||
float height);
|
||||
CLUTTER_EXPORT
|
||||
ClutterSize * clutter_size_copy (const ClutterSize *size);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_size_free (ClutterSize *size);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_size_equals (const ClutterSize *a,
|
||||
const ClutterSize *b);
|
||||
|
||||
/**
|
||||
* ClutterRect:
|
||||
* @origin: the origin of the rectangle
|
||||
* @size: the size of the rectangle
|
||||
*
|
||||
* The location and size of a rectangle.
|
||||
*
|
||||
* The width and height of a #ClutterRect can be negative; Clutter considers
|
||||
* a rectangle with an origin of [ 0.0, 0.0 ] and a size of [ 10.0, 10.0 ] to
|
||||
* be equivalent to a rectangle with origin of [ 10.0, 10.0 ] and size of
|
||||
* [ -10.0, -10.0 ].
|
||||
*
|
||||
* Application code can normalize rectangles using clutter_rect_normalize():
|
||||
* this function will ensure that the width and height of a #ClutterRect are
|
||||
* positive values. All functions taking a #ClutterRect as an argument will
|
||||
* implicitly normalize it before computing eventual results. For this reason
|
||||
* it is safer to access the contents of a #ClutterRect by using the provided
|
||||
* API at all times, instead of directly accessing the structure members.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
struct _ClutterRect
|
||||
{
|
||||
ClutterPoint origin;
|
||||
ClutterSize size;
|
||||
};
|
||||
|
||||
/**
|
||||
* CLUTTER_RECT_INIT:
|
||||
* @x: the X coordinate
|
||||
* @y: the Y coordinate
|
||||
* @width: the width
|
||||
* @height: the height
|
||||
*
|
||||
* A simple macro for initializing a #ClutterRect when declaring it, e.g.:
|
||||
*
|
||||
* |[
|
||||
* ClutterRect r = CLUTTER_RECT_INIT (100, 100, 200, 200);
|
||||
* ]|
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
#define CLUTTER_RECT_INIT(x,y,width,height) { { (x), (y) }, { (width), (height) } }
|
||||
|
||||
/**
|
||||
* CLUTTER_RECT_INIT_ZERO:
|
||||
*
|
||||
* A simple macro for initializing a #ClutterRect to (0, 0, 0, 0) when
|
||||
* declaring it.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
#define CLUTTER_RECT_INIT_ZERO CLUTTER_RECT_INIT (0.f, 0.f, 0.f, 0.f)
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_rect_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
const ClutterRect * clutter_rect_zero (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterRect * clutter_rect_alloc (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterRect * clutter_rect_init (ClutterRect *rect,
|
||||
float x,
|
||||
float y,
|
||||
float width,
|
||||
float height);
|
||||
CLUTTER_EXPORT
|
||||
ClutterRect * clutter_rect_copy (const ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_rect_free (ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_rect_equals (ClutterRect *a,
|
||||
ClutterRect *b);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterRect * clutter_rect_normalize (ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_rect_get_center (ClutterRect *rect,
|
||||
ClutterPoint *center);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_rect_contains_point (ClutterRect *rect,
|
||||
ClutterPoint *point);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_rect_contains_rect (ClutterRect *a,
|
||||
ClutterRect *b);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_rect_union (ClutterRect *a,
|
||||
ClutterRect *b,
|
||||
ClutterRect *res);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_rect_intersection (ClutterRect *a,
|
||||
ClutterRect *b,
|
||||
ClutterRect *res);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_rect_offset (ClutterRect *rect,
|
||||
float d_x,
|
||||
float d_y);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_rect_inset (ClutterRect *rect,
|
||||
float d_x,
|
||||
float d_y);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_rect_scale (ClutterRect *rect,
|
||||
float s_x,
|
||||
float s_y);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_rect_clamp_to_pixel (ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_rect_get_x (ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_rect_get_y (ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_rect_get_width (ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_rect_get_height (ClutterRect *rect);
|
||||
|
||||
/**
|
||||
* ClutterVertex:
|
||||
* @x: X coordinate of the vertex
|
||||
* @y: Y coordinate of the vertex
|
||||
* @z: Z coordinate of the vertex
|
||||
*
|
||||
* A point in 3D space, expressed in pixels
|
||||
*
|
||||
* Since: 0.4
|
||||
*/
|
||||
struct _ClutterVertex
|
||||
{
|
||||
gfloat x;
|
||||
gfloat y;
|
||||
gfloat z;
|
||||
};
|
||||
|
||||
/**
|
||||
* CLUTTER_VERTEX_INIT:
|
||||
* @x: the X coordinate of the vertex
|
||||
* @y: the Y coordinate of the vertex
|
||||
* @z: the Z coordinate of the vertex
|
||||
*
|
||||
* A simple macro for initializing a #ClutterVertex when declaring it, e.g.:
|
||||
*
|
||||
* |[
|
||||
* ClutterVertex v = CLUTTER_VERTEX_INIT (x, y, z);
|
||||
* ]|
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
#define CLUTTER_VERTEX_INIT(x,y,z) { (x), (y), (z) }
|
||||
|
||||
/**
|
||||
* CLUTTER_VERTEX_INIT_ZERO:
|
||||
*
|
||||
* A simple macro for initializing a #ClutterVertex to (0, 0, 0).
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
#define CLUTTER_VERTEX_INIT_ZERO CLUTTER_VERTEX_INIT (0.f, 0.f, 0.f)
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_vertex_get_type (void) G_GNUC_CONST;
|
||||
CLUTTER_EXPORT
|
||||
ClutterVertex *clutter_vertex_new (gfloat x,
|
||||
gfloat y,
|
||||
gfloat z);
|
||||
CLUTTER_EXPORT
|
||||
ClutterVertex *clutter_vertex_alloc (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterVertex *clutter_vertex_init (ClutterVertex *vertex,
|
||||
gfloat x,
|
||||
gfloat y,
|
||||
gfloat z);
|
||||
CLUTTER_EXPORT
|
||||
ClutterVertex *clutter_vertex_copy (const ClutterVertex *vertex);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_vertex_free (ClutterVertex *vertex);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_vertex_equal (const ClutterVertex *vertex_a,
|
||||
const ClutterVertex *vertex_b);
|
||||
|
||||
/**
|
||||
* ClutterActorBox:
|
||||
* @x1: X coordinate of the top left corner
|
||||
@@ -231,7 +542,7 @@ gboolean clutter_actor_box_contains (const ClutterActorBox *box,
|
||||
gfloat y);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_box_from_vertices (ClutterActorBox *box,
|
||||
const graphene_point3d_t verts[]);
|
||||
const ClutterVertex verts[]);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_box_interpolate (const ClutterActorBox *initial,
|
||||
const ClutterActorBox *final,
|
||||
@@ -257,6 +568,41 @@ CLUTTER_EXPORT
|
||||
void clutter_actor_box_scale (ClutterActorBox *box,
|
||||
gfloat scale);
|
||||
|
||||
/**
|
||||
* ClutterGeometry:
|
||||
* @x: X coordinate of the top left corner of an actor
|
||||
* @y: Y coordinate of the top left corner of an actor
|
||||
* @width: width of an actor
|
||||
* @height: height of an actor
|
||||
*
|
||||
* The rectangle containing an actor's bounding box, measured in pixels.
|
||||
*
|
||||
* You should not use #ClutterGeometry, or operate on its fields
|
||||
* directly; you should use #cairo_rectangle_int_t or #ClutterRect if you
|
||||
* need a rectangle type, depending on the precision required.
|
||||
*
|
||||
* Deprecated: 1.16
|
||||
*/
|
||||
struct _ClutterGeometry
|
||||
{
|
||||
/*< public >*/
|
||||
gint x;
|
||||
gint y;
|
||||
guint width;
|
||||
guint height;
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_geometry_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_geometry_union (const ClutterGeometry *geometry_a,
|
||||
const ClutterGeometry *geometry_b,
|
||||
ClutterGeometry *result);
|
||||
CLUTTER_DEPRECATED
|
||||
gboolean clutter_geometry_intersects (const ClutterGeometry *geometry0,
|
||||
const ClutterGeometry *geometry1);
|
||||
|
||||
/**
|
||||
* ClutterKnot:
|
||||
* @x: X coordinate of the knot
|
||||
@@ -328,10 +674,10 @@ void clutter_paint_volume_free (ClutterPaintVolume
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||
const graphene_point3d_t *origin);
|
||||
const ClutterVertex *origin);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_volume_get_origin (const ClutterPaintVolume *pv,
|
||||
graphene_point3d_t *vertex);
|
||||
ClutterVertex *vertex);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_volume_set_width (ClutterPaintVolume *pv,
|
||||
gfloat width);
|
||||
|
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include <fribidi.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "clutter-debug.h"
|
||||
@@ -50,8 +51,8 @@ void
|
||||
_clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
const CoglMatrix *projection,
|
||||
const float *viewport,
|
||||
const graphene_point3d_t *vertices_in,
|
||||
graphene_point3d_t *vertices_out,
|
||||
const ClutterVertex *vertices_in,
|
||||
ClutterVertex *vertices_out,
|
||||
int n_vertices)
|
||||
{
|
||||
CoglMatrix modelview_projection;
|
||||
@@ -68,7 +69,7 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
modelview);
|
||||
cogl_matrix_project_points (&modelview_projection,
|
||||
3,
|
||||
sizeof (graphene_point3d_t),
|
||||
sizeof (ClutterVertex),
|
||||
vertices_in,
|
||||
sizeof (ClutterVertex4),
|
||||
vertices_tmp,
|
||||
@@ -78,7 +79,7 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
{
|
||||
cogl_matrix_transform_points (modelview,
|
||||
3,
|
||||
sizeof (graphene_point3d_t),
|
||||
sizeof (ClutterVertex),
|
||||
vertices_in,
|
||||
sizeof (ClutterVertex4),
|
||||
vertices_tmp,
|
||||
@@ -96,7 +97,7 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
for (i = 0; i < n_vertices; i++)
|
||||
{
|
||||
ClutterVertex4 vertex_tmp = vertices_tmp[i];
|
||||
graphene_point3d_t *vertex_out = &vertices_out[i];
|
||||
ClutterVertex *vertex_out = &vertices_out[i];
|
||||
/* Finally translate from OpenGL coords to window coords */
|
||||
vertex_out->x = MTX_GL_SCALE_X (vertex_tmp.x, vertex_tmp.w,
|
||||
viewport[2], viewport[0]);
|
||||
@@ -105,10 +106,11 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
}
|
||||
}
|
||||
|
||||
void _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
||||
graphene_rect_t *dest)
|
||||
void
|
||||
_clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
||||
ClutterRect *dest)
|
||||
{
|
||||
*dest = (graphene_rect_t) {
|
||||
*dest = (ClutterRect) {
|
||||
.origin = {
|
||||
.x = src->x,
|
||||
.y = src->y
|
||||
@@ -120,12 +122,13 @@ void _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
||||
};
|
||||
}
|
||||
|
||||
void _clutter_util_rectangle_int_extents (const graphene_rect_t *src,
|
||||
cairo_rectangle_int_t *dest)
|
||||
void
|
||||
_clutter_util_rectangle_int_extents (const ClutterRect *src,
|
||||
cairo_rectangle_int_t *dest)
|
||||
{
|
||||
graphene_rect_t tmp = *src;
|
||||
ClutterRect tmp = *src;
|
||||
|
||||
graphene_rect_round (&tmp, &tmp);
|
||||
clutter_rect_clamp_to_pixel (&tmp);
|
||||
|
||||
*dest = (cairo_rectangle_int_t) {
|
||||
.x = tmp.origin.x,
|
||||
@@ -135,10 +138,11 @@ void _clutter_util_rectangle_int_extents (const graphene_rect_t *src,
|
||||
};
|
||||
}
|
||||
|
||||
void _clutter_util_rectangle_offset (const cairo_rectangle_int_t *src,
|
||||
int x,
|
||||
int y,
|
||||
cairo_rectangle_int_t *dest)
|
||||
void
|
||||
_clutter_util_rectangle_offset (const cairo_rectangle_int_t *src,
|
||||
int x,
|
||||
int y,
|
||||
cairo_rectangle_int_t *dest)
|
||||
{
|
||||
*dest = *src;
|
||||
|
||||
@@ -210,6 +214,346 @@ _clutter_util_rectangle_intersection (const cairo_rectangle_int_t *src1,
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
_clutter_util_matrix_determinant (const ClutterMatrix *matrix)
|
||||
{
|
||||
return matrix->xw * matrix->yz * matrix->zy * matrix->wz
|
||||
- matrix->xz * matrix->yw * matrix->zy * matrix->wz
|
||||
- matrix->xw * matrix->yy * matrix->zz * matrix->wz
|
||||
+ matrix->xy * matrix->yw * matrix->zz * matrix->wz
|
||||
+ matrix->xz * matrix->yy * matrix->zw * matrix->wz
|
||||
- matrix->xy * matrix->yz * matrix->zw * matrix->wz
|
||||
- matrix->xw * matrix->yz * matrix->zx * matrix->wy
|
||||
+ matrix->xz * matrix->yw * matrix->zx * matrix->wy
|
||||
+ matrix->xw * matrix->yx * matrix->zz * matrix->wy
|
||||
- matrix->xx * matrix->yw * matrix->zz * matrix->wy
|
||||
- matrix->xz * matrix->yx * matrix->zw * matrix->wy
|
||||
+ matrix->xx * matrix->yz * matrix->zw * matrix->wy
|
||||
+ matrix->xw * matrix->yy * matrix->zx * matrix->wz
|
||||
- matrix->xy * matrix->yw * matrix->zx * matrix->wz
|
||||
- matrix->xw * matrix->yx * matrix->zy * matrix->wz
|
||||
+ matrix->xx * matrix->yw * matrix->zy * matrix->wz
|
||||
+ matrix->xy * matrix->yx * matrix->zw * matrix->wz
|
||||
- matrix->xx * matrix->yy * matrix->zw * matrix->wz
|
||||
- matrix->xz * matrix->yy * matrix->zx * matrix->ww
|
||||
+ matrix->xy * matrix->yz * matrix->zx * matrix->ww
|
||||
+ matrix->xz * matrix->yx * matrix->zy * matrix->ww
|
||||
- matrix->xx * matrix->yz * matrix->zy * matrix->ww
|
||||
- matrix->xy * matrix->yx * matrix->zz * matrix->ww
|
||||
+ matrix->xx * matrix->yy * matrix->zz * matrix->ww;
|
||||
}
|
||||
|
||||
static void
|
||||
_clutter_util_matrix_transpose_vector4_transform (const ClutterMatrix *matrix,
|
||||
const ClutterVertex4 *point,
|
||||
ClutterVertex4 *res)
|
||||
{
|
||||
res->x = matrix->xx * point->x
|
||||
+ matrix->xy * point->y
|
||||
+ matrix->xz * point->z
|
||||
+ matrix->xw * point->w;
|
||||
|
||||
res->y = matrix->yx * point->x
|
||||
+ matrix->yy * point->y
|
||||
+ matrix->yz * point->z
|
||||
+ matrix->yw * point->w;
|
||||
|
||||
res->z = matrix->zx * point->x
|
||||
+ matrix->zy * point->y
|
||||
+ matrix->zz * point->z
|
||||
+ matrix->zw * point->w;
|
||||
|
||||
res->w = matrix->wz * point->x
|
||||
+ matrix->wy * point->w
|
||||
+ matrix->wz * point->z
|
||||
+ matrix->ww * point->w;
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_util_matrix_skew_xy (ClutterMatrix *matrix,
|
||||
float factor)
|
||||
{
|
||||
matrix->yx += matrix->xx * factor;
|
||||
matrix->yy += matrix->xy * factor;
|
||||
matrix->yz += matrix->xz * factor;
|
||||
matrix->yw += matrix->xw * factor;
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_util_matrix_skew_xz (ClutterMatrix *matrix,
|
||||
float factor)
|
||||
{
|
||||
matrix->zx += matrix->xx * factor;
|
||||
matrix->zy += matrix->xy * factor;
|
||||
matrix->zz += matrix->xz * factor;
|
||||
matrix->zw += matrix->xw * factor;
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_util_matrix_skew_yz (ClutterMatrix *matrix,
|
||||
float factor)
|
||||
{
|
||||
matrix->zx += matrix->yx * factor;
|
||||
matrix->zy += matrix->yy * factor;
|
||||
matrix->zz += matrix->yz * factor;
|
||||
matrix->zw += matrix->yw * factor;
|
||||
}
|
||||
|
||||
static float
|
||||
_clutter_util_vertex_length (const ClutterVertex *vertex)
|
||||
{
|
||||
return sqrtf (vertex->x * vertex->x + vertex->y * vertex->y + vertex->z * vertex->z);
|
||||
}
|
||||
|
||||
static void
|
||||
_clutter_util_vertex_normalize (ClutterVertex *vertex)
|
||||
{
|
||||
float factor = _clutter_util_vertex_length (vertex);
|
||||
|
||||
if (factor == 0.f)
|
||||
return;
|
||||
|
||||
vertex->x /= factor;
|
||||
vertex->y /= factor;
|
||||
vertex->z /= factor;
|
||||
}
|
||||
|
||||
static float
|
||||
_clutter_util_vertex_dot (const ClutterVertex *v1,
|
||||
const ClutterVertex *v2)
|
||||
{
|
||||
return v1->x * v2->x + v1->y * v2->y + v1->z * v2->z;
|
||||
}
|
||||
|
||||
static void
|
||||
_clutter_util_vertex_cross (const ClutterVertex *v1,
|
||||
const ClutterVertex *v2,
|
||||
ClutterVertex *res)
|
||||
{
|
||||
res->x = v1->y * v2->z - v2->y * v1->z;
|
||||
res->y = v1->z * v2->x - v2->z * v1->x;
|
||||
res->z = v1->x * v2->y - v2->x * v1->y;
|
||||
}
|
||||
|
||||
static void
|
||||
_clutter_util_vertex_combine (const ClutterVertex *a,
|
||||
const ClutterVertex *b,
|
||||
double ascl,
|
||||
double bscl,
|
||||
ClutterVertex *res)
|
||||
{
|
||||
res->x = (ascl * a->x) + (bscl * b->x);
|
||||
res->y = (ascl * a->y) + (bscl * b->y);
|
||||
res->z = (ascl * a->z) + (bscl * b->z);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_util_vertex4_interpolate (const ClutterVertex4 *a,
|
||||
const ClutterVertex4 *b,
|
||||
double progress,
|
||||
ClutterVertex4 *res)
|
||||
{
|
||||
res->x = a->x + (b->x - a->x) * progress;
|
||||
res->y = a->y + (b->y - a->y) * progress;
|
||||
res->z = a->z + (b->z - a->z) * progress;
|
||||
res->w = a->w + (b->w - a->w) * progress;
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* clutter_util_matrix_decompose:
|
||||
* @src: the matrix to decompose
|
||||
* @scale_p: (out caller-allocates): return location for a vertex containing
|
||||
* the scaling factors
|
||||
* @shear_p: (out) (array length=3): return location for an array of 3
|
||||
* elements containing the skew factors (XY, XZ, and YZ respectively)
|
||||
* @rotate_p: (out caller-allocates): return location for a vertex containing
|
||||
* the Euler angles
|
||||
* @translate_p: (out caller-allocates): return location for a vertex
|
||||
* containing the translation vector
|
||||
* @perspective_p: (out caller-allocates: return location for a 4D vertex
|
||||
* containing the perspective
|
||||
*
|
||||
* Decomposes a #ClutterMatrix into the transformations that compose it.
|
||||
*
|
||||
* This code is based on the matrix decomposition algorithm as published in
|
||||
* the CSS Transforms specification by the W3C CSS working group, available
|
||||
* at http://www.w3.org/TR/css3-transforms/.
|
||||
*
|
||||
* The algorithm, in turn, is based on the "unmatrix" method published in
|
||||
* "Graphics Gems II, edited by Jim Arvo", which is available at:
|
||||
* http://tog.acm.org/resources/GraphicsGems/gemsii/unmatrix.c
|
||||
*
|
||||
* Return value: %TRUE if the decomposition was successful, and %FALSE
|
||||
* if the matrix is singular
|
||||
*/
|
||||
gboolean
|
||||
_clutter_util_matrix_decompose (const ClutterMatrix *src,
|
||||
ClutterVertex *scale_p,
|
||||
float shear_p[3],
|
||||
ClutterVertex *rotate_p,
|
||||
ClutterVertex *translate_p,
|
||||
ClutterVertex4 *perspective_p)
|
||||
{
|
||||
CoglMatrix matrix = *src;
|
||||
CoglMatrix perspective;
|
||||
ClutterVertex4 vertex_tmp;
|
||||
ClutterVertex row[3], pdum;
|
||||
int i, j;
|
||||
|
||||
#define XY_SHEAR 0
|
||||
#define XZ_SHEAR 1
|
||||
#define YZ_SHEAR 2
|
||||
#define MAT(m,r,c) ((float *)(m))[(c) * 4 + (r)]
|
||||
|
||||
/* normalize the matrix */
|
||||
if (matrix.ww == 0.f)
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
MAT (&matrix, j, i) /= MAT (&matrix, 3, 3);
|
||||
}
|
||||
}
|
||||
|
||||
/* perspective is used to solve for perspective, but it also provides
|
||||
* an easy way to test for singularity of the upper 3x3 component
|
||||
*/
|
||||
perspective = matrix;
|
||||
|
||||
/* transpose */
|
||||
MAT (&perspective, 3, 0) = 0.f;
|
||||
MAT (&perspective, 3, 1) = 0.f;
|
||||
MAT (&perspective, 3, 2) = 0.f;
|
||||
MAT (&perspective, 3, 3) = 1.f;
|
||||
|
||||
if (_clutter_util_matrix_determinant (&perspective) == 0.f)
|
||||
return FALSE;
|
||||
|
||||
if (MAT (&matrix, 3, 0) != 0.f ||
|
||||
MAT (&matrix, 3, 1) != 0.f ||
|
||||
MAT (&matrix, 3, 2) != 0.f)
|
||||
{
|
||||
CoglMatrix perspective_inv;
|
||||
ClutterVertex4 p;
|
||||
|
||||
vertex_tmp.x = MAT (&matrix, 3, 0);
|
||||
vertex_tmp.y = MAT (&matrix, 3, 1);
|
||||
vertex_tmp.z = MAT (&matrix, 3, 2);
|
||||
vertex_tmp.w = MAT (&matrix, 3, 3);
|
||||
|
||||
/* solve the equation by inverting perspective... */
|
||||
cogl_matrix_get_inverse (&perspective, &perspective_inv);
|
||||
|
||||
/* ... and multiplying vertex_tmp by the inverse */
|
||||
_clutter_util_matrix_transpose_vector4_transform (&perspective_inv,
|
||||
&vertex_tmp,
|
||||
&p);
|
||||
|
||||
*perspective_p = p;
|
||||
|
||||
/* clear the perspective part */
|
||||
MAT (&matrix, 3, 0) = 0.0f;
|
||||
MAT (&matrix, 3, 1) = 0.0f;
|
||||
MAT (&matrix, 3, 2) = 0.0f;
|
||||
MAT (&matrix, 3, 3) = 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* no perspective */
|
||||
perspective_p->x = 0.0f;
|
||||
perspective_p->y = 0.0f;
|
||||
perspective_p->z = 0.0f;
|
||||
perspective_p->w = 1.0f;
|
||||
}
|
||||
|
||||
/* translation */
|
||||
translate_p->x = MAT (&matrix, 0, 3);
|
||||
MAT (&matrix, 0, 3) = 0.f;
|
||||
translate_p->y = MAT (&matrix, 1, 3);
|
||||
MAT (&matrix, 1, 3) = 0.f;
|
||||
translate_p->z = MAT (&matrix, 2, 3);
|
||||
MAT (&matrix, 2, 3) = 0.f;
|
||||
|
||||
/* scale and shear; we split the upper 3x3 matrix into rows */
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
row[i].x = MAT (&matrix, i, 0);
|
||||
row[i].y = MAT (&matrix, i, 1);
|
||||
row[i].z = MAT (&matrix, i, 2);
|
||||
}
|
||||
|
||||
/* compute scale.x and normalize the first row */
|
||||
scale_p->x = _clutter_util_vertex_length (&row[0]);
|
||||
_clutter_util_vertex_normalize (&row[0]);
|
||||
|
||||
/* compute XY shear and make the second row orthogonal to the first */
|
||||
shear_p[XY_SHEAR] = _clutter_util_vertex_dot (&row[0], &row[1]);
|
||||
_clutter_util_vertex_combine (&row[1], &row[0],
|
||||
1.0, -shear_p[XY_SHEAR],
|
||||
&row[1]);
|
||||
|
||||
/* compute the Y scale and normalize the second row */
|
||||
scale_p->y = _clutter_util_vertex_length (&row[1]);
|
||||
_clutter_util_vertex_normalize (&row[1]);
|
||||
shear_p[XY_SHEAR] /= scale_p->y;
|
||||
|
||||
/* compute XZ and YZ shears, orthogonalize the third row */
|
||||
shear_p[XZ_SHEAR] = _clutter_util_vertex_dot (&row[0], &row[2]);
|
||||
_clutter_util_vertex_combine (&row[2], &row[0],
|
||||
1.0, -shear_p[XZ_SHEAR],
|
||||
&row[2]);
|
||||
|
||||
shear_p[YZ_SHEAR] = _clutter_util_vertex_dot (&row[1], &row[2]);
|
||||
_clutter_util_vertex_combine (&row[2], &row[1],
|
||||
1.0, -shear_p[YZ_SHEAR],
|
||||
&row[2]);
|
||||
|
||||
/* get the Z scale and normalize the third row*/
|
||||
scale_p->z = _clutter_util_vertex_length (&row[2]);
|
||||
_clutter_util_vertex_normalize (&row[2]);
|
||||
shear_p[XZ_SHEAR] /= scale_p->z;
|
||||
shear_p[YZ_SHEAR] /= scale_p->z;
|
||||
|
||||
/* at this point, the matrix (inside row[]) is orthonormal.
|
||||
* check for a coordinate system flip; if the determinant
|
||||
* is -1, then negate the matrix and scaling factors
|
||||
*/
|
||||
_clutter_util_vertex_cross (&row[1], &row[2], &pdum);
|
||||
if (_clutter_util_vertex_dot (&row[0], &pdum) < 0.f)
|
||||
{
|
||||
scale_p->x *= -1.f;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
row[i].x *= -1.f;
|
||||
row[i].y *= -1.f;
|
||||
row[i].z *= -1.f;
|
||||
}
|
||||
}
|
||||
|
||||
/* now get the rotations out */
|
||||
rotate_p->y = asinf (-row[0].z);
|
||||
if (cosf (rotate_p->y) != 0.f)
|
||||
{
|
||||
rotate_p->x = atan2f (row[1].z, row[2].z);
|
||||
rotate_p->z = atan2f (row[0].y, row[0].x);
|
||||
}
|
||||
else
|
||||
{
|
||||
rotate_p->x = atan2f (-row[2].x, row[1].y);
|
||||
rotate_p->z = 0.f;
|
||||
}
|
||||
|
||||
#undef XY_SHEAR
|
||||
#undef XZ_SHEAR
|
||||
#undef YZ_SHEAR
|
||||
#undef MAT
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GType value_type;
|
||||
@@ -356,3 +700,45 @@ clutter_interval_register_progress_func (GType value_type,
|
||||
|
||||
G_UNLOCK (progress_funcs);
|
||||
}
|
||||
|
||||
PangoDirection
|
||||
_clutter_pango_unichar_direction (gunichar ch)
|
||||
{
|
||||
FriBidiCharType fribidi_ch_type;
|
||||
|
||||
G_STATIC_ASSERT (sizeof (FriBidiChar) == sizeof (gunichar));
|
||||
|
||||
fribidi_ch_type = fribidi_get_bidi_type (ch);
|
||||
|
||||
if (!FRIBIDI_IS_STRONG (fribidi_ch_type))
|
||||
return PANGO_DIRECTION_NEUTRAL;
|
||||
else if (FRIBIDI_IS_RTL (fribidi_ch_type))
|
||||
return PANGO_DIRECTION_RTL;
|
||||
else
|
||||
return PANGO_DIRECTION_LTR;
|
||||
}
|
||||
|
||||
PangoDirection
|
||||
_clutter_pango_find_base_dir (const gchar *text,
|
||||
gint length)
|
||||
{
|
||||
PangoDirection dir = PANGO_DIRECTION_NEUTRAL;
|
||||
const gchar *p;
|
||||
|
||||
g_return_val_if_fail (text != NULL || length == 0, PANGO_DIRECTION_NEUTRAL);
|
||||
|
||||
p = text;
|
||||
while ((length < 0 || p < text + length) && *p)
|
||||
{
|
||||
gunichar wc = g_utf8_get_char (p);
|
||||
|
||||
dir = _clutter_pango_unichar_direction (wc);
|
||||
|
||||
if (dir != PANGO_DIRECTION_NEUTRAL)
|
||||
break;
|
||||
|
||||
p = g_utf8_next_char (p);
|
||||
}
|
||||
|
||||
return dir;
|
||||
}
|
||||
|
@@ -80,9 +80,9 @@ struct _ClutterZoomActionPrivate
|
||||
|
||||
ZoomPoint points[2];
|
||||
|
||||
graphene_point_t initial_focal_point;
|
||||
graphene_point_t focal_point;
|
||||
graphene_point_t transformed_focal_point;
|
||||
ClutterPoint initial_focal_point;
|
||||
ClutterPoint focal_point;
|
||||
ClutterPoint transformed_focal_point;
|
||||
|
||||
gfloat initial_x;
|
||||
gfloat initial_y;
|
||||
@@ -238,13 +238,13 @@ clutter_zoom_action_gesture_cancel (ClutterGestureAction *action,
|
||||
static gboolean
|
||||
clutter_zoom_action_real_zoom (ClutterZoomAction *action,
|
||||
ClutterActor *actor,
|
||||
graphene_point_t *focal_point,
|
||||
ClutterPoint *focal_point,
|
||||
gdouble factor)
|
||||
{
|
||||
ClutterZoomActionPrivate *priv = action->priv;
|
||||
gfloat x, y, z;
|
||||
gdouble scale_x, scale_y;
|
||||
graphene_point3d_t out, in;
|
||||
ClutterVertex out, in;
|
||||
|
||||
in.x = priv->transformed_focal_point.x;
|
||||
in.y = priv->transformed_focal_point.y;
|
||||
@@ -400,7 +400,7 @@ clutter_zoom_action_class_init (ClutterZoomActionClass *klass)
|
||||
_clutter_marshal_BOOLEAN__OBJECT_BOXED_DOUBLE,
|
||||
G_TYPE_BOOLEAN, 3,
|
||||
CLUTTER_TYPE_ACTOR,
|
||||
GRAPHENE_TYPE_POINT,
|
||||
CLUTTER_TYPE_POINT,
|
||||
G_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
@@ -478,7 +478,7 @@ clutter_zoom_action_get_zoom_axis (ClutterZoomAction *action)
|
||||
/**
|
||||
* clutter_zoom_action_get_focal_point:
|
||||
* @action: a #ClutterZoomAction
|
||||
* @point: (out): a #graphene_point_t
|
||||
* @point: (out): a #ClutterPoint
|
||||
*
|
||||
* Retrieves the focal point of the current zoom
|
||||
*
|
||||
@@ -486,7 +486,7 @@ clutter_zoom_action_get_zoom_axis (ClutterZoomAction *action)
|
||||
*/
|
||||
void
|
||||
clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
|
||||
graphene_point_t *point)
|
||||
ClutterPoint *point)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_ZOOM_ACTION (action));
|
||||
g_return_if_fail (point != NULL);
|
||||
@@ -497,7 +497,7 @@ clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
|
||||
/**
|
||||
* clutter_zoom_action_get_transformed_focal_point:
|
||||
* @action: a #ClutterZoomAction
|
||||
* @point: (out): a #graphene_point_t
|
||||
* @point: (out): a #ClutterPoint
|
||||
*
|
||||
* Retrieves the focal point relative to the actor's coordinates of
|
||||
* the current zoom
|
||||
@@ -506,7 +506,7 @@ clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
|
||||
*/
|
||||
void
|
||||
clutter_zoom_action_get_transformed_focal_point (ClutterZoomAction *action,
|
||||
graphene_point_t *point)
|
||||
ClutterPoint *point)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_ZOOM_ACTION (action));
|
||||
g_return_if_fail (point != NULL);
|
||||
|
@@ -79,7 +79,7 @@ struct _ClutterZoomActionClass
|
||||
/*< public >*/
|
||||
gboolean (* zoom) (ClutterZoomAction *action,
|
||||
ClutterActor *actor,
|
||||
graphene_point_t *focal_point,
|
||||
ClutterPoint *focal_point,
|
||||
gdouble factor);
|
||||
|
||||
/*< private >*/
|
||||
@@ -104,10 +104,10 @@ ClutterZoomAxis clutter_zoom_action_get_zoom_axis (ClutterZoomActi
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
|
||||
graphene_point_t *point);
|
||||
ClutterPoint *point);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_zoom_action_get_transformed_focal_point (ClutterZoomAction *action,
|
||||
graphene_point_t *point);
|
||||
ClutterPoint *point);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -101,6 +101,7 @@
|
||||
#include "clutter-snap-constraint.h"
|
||||
#include "clutter-stage.h"
|
||||
#include "clutter-stage-manager.h"
|
||||
#include "clutter-stage-view.h"
|
||||
#include "clutter-tap-action.h"
|
||||
#include "clutter-test-utils.h"
|
||||
#include "clutter-texture.h"
|
||||
|
@@ -45,6 +45,9 @@
|
||||
#include "clutter-main.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-stage-private.h"
|
||||
#include "clutter-stage-view-private.h"
|
||||
|
||||
#include "cogl/cogl-trace.h"
|
||||
|
||||
typedef struct _ClutterStageViewCoglPrivate
|
||||
{
|
||||
@@ -77,6 +80,10 @@ enum
|
||||
PROP_LAST
|
||||
};
|
||||
|
||||
static void
|
||||
clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window,
|
||||
gint sync_delay);
|
||||
|
||||
static void
|
||||
clutter_stage_cogl_unrealize (ClutterStageWindow *stage_window)
|
||||
{
|
||||
@@ -122,6 +129,16 @@ _clutter_stage_cogl_presented (ClutterStageCogl *stage_cogl,
|
||||
}
|
||||
|
||||
_clutter_stage_presented (stage_cogl->wrapper, frame_event, frame_info);
|
||||
|
||||
if (frame_event == COGL_FRAME_EVENT_COMPLETE &&
|
||||
stage_cogl->update_time != -1)
|
||||
{
|
||||
ClutterStageWindow *stage_window = CLUTTER_STAGE_WINDOW (stage_cogl);
|
||||
|
||||
stage_cogl->update_time = -1;
|
||||
clutter_stage_cogl_schedule_update (stage_window,
|
||||
stage_cogl->last_sync_delay);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -152,10 +169,15 @@ clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window,
|
||||
gint64 now;
|
||||
float refresh_rate;
|
||||
gint64 refresh_interval;
|
||||
int64_t min_render_time_allowed;
|
||||
int64_t max_render_time_allowed;
|
||||
int64_t next_presentation_time;
|
||||
|
||||
if (stage_cogl->update_time != -1)
|
||||
return;
|
||||
|
||||
stage_cogl->last_sync_delay = sync_delay;
|
||||
|
||||
now = g_get_monotonic_time ();
|
||||
|
||||
if (sync_delay < 0)
|
||||
@@ -164,30 +186,56 @@ clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window,
|
||||
return;
|
||||
}
|
||||
|
||||
/* We only extrapolate presentation times for 150ms - this is somewhat
|
||||
* arbitrary. The reasons it might not be accurate for larger times are
|
||||
* that the refresh interval might be wrong or the vertical refresh
|
||||
* might be downclocked if nothing is going on onscreen.
|
||||
*/
|
||||
if (stage_cogl->last_presentation_time == 0||
|
||||
stage_cogl->last_presentation_time < now - 150000)
|
||||
refresh_rate = stage_cogl->refresh_rate;
|
||||
if (refresh_rate <= 0.0)
|
||||
refresh_rate = clutter_get_default_frame_rate ();
|
||||
|
||||
refresh_interval = (gint64) (0.5 + G_USEC_PER_SEC / refresh_rate);
|
||||
if (refresh_interval == 0)
|
||||
{
|
||||
stage_cogl->update_time = now;
|
||||
return;
|
||||
}
|
||||
|
||||
refresh_rate = stage_cogl->refresh_rate;
|
||||
if (refresh_rate == 0.0)
|
||||
refresh_rate = 60.0;
|
||||
min_render_time_allowed = refresh_interval / 2;
|
||||
max_render_time_allowed = refresh_interval - 1000 * sync_delay;
|
||||
|
||||
refresh_interval = (gint64) (0.5 + 1000000 / refresh_rate);
|
||||
if (refresh_interval == 0)
|
||||
refresh_interval = 16667; /* 1/60th second */
|
||||
/* Be robust in the case of incredibly bogus refresh rate */
|
||||
if (max_render_time_allowed <= 0)
|
||||
{
|
||||
g_warning ("Unsupported monitor refresh rate detected. "
|
||||
"(Refresh rate: %.3f, refresh interval: %ld)",
|
||||
refresh_rate,
|
||||
refresh_interval);
|
||||
stage_cogl->update_time = now;
|
||||
return;
|
||||
}
|
||||
|
||||
stage_cogl->update_time = stage_cogl->last_presentation_time + 1000 * sync_delay;
|
||||
if (min_render_time_allowed > max_render_time_allowed)
|
||||
min_render_time_allowed = max_render_time_allowed;
|
||||
|
||||
while (stage_cogl->update_time < now)
|
||||
stage_cogl->update_time += refresh_interval;
|
||||
next_presentation_time = stage_cogl->last_presentation_time + refresh_interval;
|
||||
|
||||
/* Get next_presentation_time closer to its final value, to reduce
|
||||
* the number of while iterations below.
|
||||
*/
|
||||
if (next_presentation_time < now)
|
||||
{
|
||||
int64_t last_virtual_presentation_time = now - now % refresh_interval;
|
||||
int64_t hardware_clock_phase =
|
||||
stage_cogl->last_presentation_time % refresh_interval;
|
||||
|
||||
next_presentation_time =
|
||||
last_virtual_presentation_time + hardware_clock_phase;
|
||||
}
|
||||
|
||||
while (next_presentation_time < now + min_render_time_allowed)
|
||||
next_presentation_time += refresh_interval;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
static gint64
|
||||
@@ -206,6 +254,7 @@ clutter_stage_cogl_clear_update_time (ClutterStageWindow *stage_window)
|
||||
{
|
||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
||||
|
||||
stage_cogl->last_update_time = stage_cogl->update_time;
|
||||
stage_cogl->update_time = -1;
|
||||
}
|
||||
|
||||
@@ -273,7 +322,7 @@ clutter_stage_cogl_ignoring_redraw_clips (ClutterStageWindow *stage_window)
|
||||
}
|
||||
|
||||
/* A redraw clip represents (in stage coordinates) the bounding box of
|
||||
* something that needs to be redraw. Typically they are added to the
|
||||
* 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.
|
||||
@@ -502,8 +551,8 @@ fill_current_damage_history_and_step (ClutterStageView *view)
|
||||
*current_fb_damage = (cairo_rectangle_int_t) {
|
||||
.x = 0,
|
||||
.y = 0,
|
||||
.width = view_rect.width * fb_scale,
|
||||
.height = view_rect.height * fb_scale
|
||||
.width = ceilf (view_rect.width * fb_scale),
|
||||
.height = ceilf (view_rect.height * fb_scale)
|
||||
};
|
||||
view_priv->damage_index++;
|
||||
}
|
||||
@@ -576,14 +625,14 @@ is_buffer_age_enabled (void)
|
||||
}
|
||||
|
||||
static void
|
||||
scale_and_clamp_rect (const graphene_rect_t *rect,
|
||||
scale_and_clamp_rect (const ClutterRect *rect,
|
||||
float scale,
|
||||
cairo_rectangle_int_t *dest)
|
||||
|
||||
{
|
||||
graphene_rect_t tmp = *rect;
|
||||
ClutterRect tmp = *rect;
|
||||
|
||||
graphene_rect_scale (&tmp, scale, scale, &tmp);
|
||||
clutter_rect_scale (&tmp, scale, scale);
|
||||
_clutter_util_rectangle_int_extents (&tmp, dest);
|
||||
}
|
||||
|
||||
@@ -650,12 +699,12 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
* frames when starting up... */
|
||||
cogl_onscreen_get_frame_counter (COGL_ONSCREEN (fb)) > 3)
|
||||
{
|
||||
graphene_rect_t rect;
|
||||
ClutterRect rect;
|
||||
|
||||
may_use_clipped_redraw = TRUE;
|
||||
|
||||
_clutter_util_rect_from_rectangle (&redraw_clip, &rect);
|
||||
graphene_rect_offset (&rect, -view_rect.x, -view_rect.y);
|
||||
clutter_rect_offset (&rect, -view_rect.x, -view_rect.y);
|
||||
scale_and_clamp_rect (&rect, fb_scale, &fb_clip_region);
|
||||
|
||||
if (fb_scale != floorf (fb_scale))
|
||||
@@ -693,7 +742,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
|
||||
if (valid_buffer_age (view_cogl, age))
|
||||
{
|
||||
graphene_rect_t rect;
|
||||
ClutterRect rect;
|
||||
cairo_rectangle_int_t damage_region;
|
||||
|
||||
*current_fb_damage = fb_clip_region;
|
||||
@@ -753,7 +802,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
}
|
||||
else if (use_clipped_redraw)
|
||||
{
|
||||
graphene_rect_t rect;
|
||||
ClutterRect rect;
|
||||
cairo_rectangle_int_t scissor_rect;
|
||||
cairo_rectangle_int_t paint_rect;
|
||||
|
||||
@@ -799,7 +848,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
may_use_clipped_redraw &&
|
||||
!clip_region_empty)
|
||||
{
|
||||
graphene_rect_t rect;
|
||||
ClutterRect rect;
|
||||
cairo_rectangle_int_t scissor_rect;
|
||||
cairo_rectangle_int_t paint_rect;
|
||||
|
||||
@@ -878,26 +927,16 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
*/
|
||||
if (use_clipped_redraw)
|
||||
{
|
||||
if (use_clipped_redraw && clip_region_empty)
|
||||
if (clip_region_empty)
|
||||
{
|
||||
do_swap_buffer = FALSE;
|
||||
}
|
||||
else if (use_clipped_redraw)
|
||||
else
|
||||
{
|
||||
swap_region = fb_clip_region;
|
||||
g_assert (swap_region.width > 0);
|
||||
do_swap_buffer = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
swap_region = (cairo_rectangle_int_t) {
|
||||
.x = 0,
|
||||
.y = 0,
|
||||
.width = view_rect.width * fb_scale,
|
||||
.height = view_rect.height * fb_scale,
|
||||
};
|
||||
do_swap_buffer = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -907,6 +946,9 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
|
||||
if (do_swap_buffer)
|
||||
{
|
||||
COGL_TRACE_BEGIN_SCOPED (ClutterStageCoglRedrawViewSwapFramebuffer,
|
||||
"Paint (swap framebuffer)");
|
||||
|
||||
if (clutter_stage_view_get_onscreen (view) !=
|
||||
clutter_stage_view_get_framebuffer (view))
|
||||
{
|
||||
@@ -931,6 +973,8 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
|
||||
gboolean swap_event = FALSE;
|
||||
GList *l;
|
||||
|
||||
COGL_TRACE_BEGIN (ClutterStageCoglRedraw, "Paint (Cogl Redraw)");
|
||||
|
||||
for (l = _clutter_stage_window_get_views (stage_window); l; l = l->next)
|
||||
{
|
||||
ClutterStageView *view = l->data;
|
||||
@@ -939,6 +983,8 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
|
||||
clutter_stage_cogl_redraw_view (stage_window, view) || swap_event;
|
||||
}
|
||||
|
||||
_clutter_stage_emit_after_paint (stage_cogl->wrapper);
|
||||
|
||||
_clutter_stage_window_finish_frame (stage_window);
|
||||
|
||||
if (swap_event)
|
||||
@@ -954,6 +1000,8 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
|
||||
stage_cogl->initialized_redraw_clip = FALSE;
|
||||
|
||||
stage_cogl->frame_count++;
|
||||
|
||||
COGL_TRACE_END (ClutterStageCoglRedraw);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -53,12 +53,15 @@ struct _ClutterStageCogl
|
||||
|
||||
gint64 last_presentation_time;
|
||||
gint64 update_time;
|
||||
int64_t last_update_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
|
||||
* junk frames to start with. */
|
||||
unsigned int frame_count;
|
||||
|
||||
gint last_sync_delay;
|
||||
|
||||
cairo_rectangle_int_t bounding_redraw_clip;
|
||||
|
||||
guint initialized_redraw_clip : 1;
|
||||
|
44
clutter/clutter/deprecated/clutter-actor-deprecated.c
Normal file
44
clutter/clutter/deprecated/clutter-actor-deprecated.c
Normal file
@@ -0,0 +1,44 @@
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
#include "deprecated/clutter-actor.h"
|
||||
|
||||
#include "clutter-actor-private.h"
|
||||
#include "clutter-private.h"
|
||||
|
||||
/**
|
||||
* clutter_actor_get_allocation_geometry:
|
||||
* @self: A #ClutterActor
|
||||
* @geom: (out): allocation geometry in pixels
|
||||
*
|
||||
* Gets the layout box an actor has been assigned. The allocation can
|
||||
* only be assumed valid inside a paint() method; anywhere else, it
|
||||
* may be out-of-date.
|
||||
*
|
||||
* An allocation does not incorporate the actor's scale or anchor point;
|
||||
* those transformations do not affect layout, only rendering.
|
||||
*
|
||||
* The returned rectangle is in pixels.
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
* Deprecated: 1.12: Use clutter_actor_get_allocation_box() instead.
|
||||
*/
|
||||
void
|
||||
clutter_actor_get_allocation_geometry (ClutterActor *self,
|
||||
ClutterGeometry *geom)
|
||||
{
|
||||
ClutterActorBox box;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||
g_return_if_fail (geom != NULL);
|
||||
|
||||
clutter_actor_get_allocation_box (self, &box);
|
||||
|
||||
geom->x = CLUTTER_NEARBYINT (clutter_actor_box_get_x (&box));
|
||||
geom->y = CLUTTER_NEARBYINT (clutter_actor_box_get_y (&box));
|
||||
geom->width = CLUTTER_NEARBYINT (clutter_actor_box_get_width (&box));
|
||||
geom->height = CLUTTER_NEARBYINT (clutter_actor_box_get_height (&box));
|
||||
}
|
@@ -145,6 +145,10 @@ CLUTTER_DEPRECATED
|
||||
void clutter_actor_get_transformation_matrix (ClutterActor *self,
|
||||
ClutterMatrix *matrix);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR (clutter_actor_get_allocation_box)
|
||||
void clutter_actor_get_allocation_geometry (ClutterActor *self,
|
||||
ClutterGeometry *geom);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_ACTOR_DEPRECATED_H__ */
|
||||
|
@@ -2222,7 +2222,7 @@ clutter_actor_animate_with_timeline (ClutterActor *actor,
|
||||
*
|
||||
* Will animate the "rotation-angle-z" property between the current value
|
||||
* and 360 degrees, and set the "rotation-center-z" property to the fixed
|
||||
* value of the #graphene_point3d_t "center".
|
||||
* value of the #ClutterVertex "center".
|
||||
*
|
||||
* This function will implicitly create a #ClutterAnimation object which
|
||||
* will be assigned to the @actor and will be returned to the developer
|
||||
|
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright (C) 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/>.
|
||||
*/
|
||||
|
||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <clutter/clutter.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __CLUTTER_MAIN_DEPRECATED_H__
|
||||
#define __CLUTTER_MAIN_DEPRECATED_H__
|
||||
|
||||
#include <clutter/clutter-types.h>
|
||||
#include <clutter/clutter-input-device.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_threads_init (void);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_threads_enter (void);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_threads_leave (void);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_stage_set_motion_events_enabled)
|
||||
void clutter_set_motion_events_enabled (gboolean enable);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_stage_get_motion_events_enabled)
|
||||
gboolean clutter_get_motion_events_enabled (void);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_stage_ensure_redraw)
|
||||
void clutter_redraw (ClutterStage *stage);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(cogl_pango_font_map_clear_glyph_cache)
|
||||
void clutter_clear_glyph_cache (void);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_backend_set_font_options)
|
||||
void clutter_set_font_flags (ClutterFontFlags flags);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_backend_get_font_options)
|
||||
ClutterFontFlags clutter_get_font_flags (void);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_device_manager_get_device)
|
||||
ClutterInputDevice * clutter_get_input_device_for_id (gint id_);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_input_device_grab)
|
||||
void clutter_grab_pointer_for_device (ClutterActor *actor,
|
||||
gint id_);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_input_device_ungrab)
|
||||
void clutter_ungrab_pointer_for_device (gint id_);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_set_default_frame_rate (guint frames_per_sec);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
gulong clutter_get_timestamp (void);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
gboolean clutter_get_debug_enabled (void);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
gboolean clutter_get_show_fps (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_MAIN_DEPRECATED_H__ */
|
@@ -84,7 +84,7 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
static CoglPipeline *default_color_pipeline = NULL;
|
||||
CoglPipeline *content_pipeline;
|
||||
ClutterActorBox alloc;
|
||||
ClutterGeometry geom;
|
||||
CoglColor color;
|
||||
guint8 tmp_alpha;
|
||||
|
||||
@@ -92,7 +92,7 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
"painting rect '%s'",
|
||||
clutter_actor_get_name (self) ? clutter_actor_get_name (self)
|
||||
: "unknown");
|
||||
clutter_actor_get_allocation_box (self, &alloc);
|
||||
clutter_actor_get_allocation_geometry (self, &geom);
|
||||
|
||||
if (G_UNLIKELY (default_color_pipeline == NULL))
|
||||
{
|
||||
@@ -140,41 +140,40 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
/* We paint the border and the content only if the rectangle
|
||||
* is big enough to show them
|
||||
*/
|
||||
if ((priv->border_width * 2) < clutter_actor_box_get_width (&alloc) &&
|
||||
(priv->border_width * 2) < clutter_actor_box_get_height (&alloc))
|
||||
if ((priv->border_width * 2) < geom.width &&
|
||||
(priv->border_width * 2) < geom.height)
|
||||
{
|
||||
/* paint the border. this sucks, but it's the only way to make a border */
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
border_pipeline,
|
||||
priv->border_width, 0,
|
||||
clutter_actor_box_get_width (&alloc),
|
||||
geom.width,
|
||||
priv->border_width);
|
||||
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
border_pipeline,
|
||||
clutter_actor_box_get_width (&alloc) - priv->border_width,
|
||||
geom.width - priv->border_width,
|
||||
priv->border_width,
|
||||
clutter_actor_box_get_width (&alloc),
|
||||
clutter_actor_box_get_height (&alloc));
|
||||
geom.width, geom.height);
|
||||
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
border_pipeline,
|
||||
0, clutter_actor_box_get_height (&alloc) - priv->border_width,
|
||||
clutter_actor_box_get_width (&alloc) - priv->border_width,
|
||||
clutter_actor_box_get_height (&alloc));
|
||||
0, geom.height - priv->border_width,
|
||||
geom.width - priv->border_width,
|
||||
geom.height);
|
||||
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
border_pipeline,
|
||||
0, 0,
|
||||
priv->border_width,
|
||||
clutter_actor_box_get_height (&alloc) - priv->border_width);
|
||||
geom.height - priv->border_width);
|
||||
|
||||
/* now paint the rectangle */
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
content_pipeline,
|
||||
priv->border_width, priv->border_width,
|
||||
clutter_actor_box_get_width (&alloc) - priv->border_width,
|
||||
clutter_actor_box_get_height (&alloc) - priv->border_width);
|
||||
geom.width - priv->border_width,
|
||||
geom.height - priv->border_width);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -184,9 +183,7 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
*/
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
border_pipeline,
|
||||
0, 0,
|
||||
clutter_actor_box_get_width (&alloc),
|
||||
clutter_actor_box_get_height (&alloc));
|
||||
0, 0, geom.width, geom.height);
|
||||
}
|
||||
|
||||
cogl_object_unref (border_pipeline);
|
||||
@@ -195,9 +192,7 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
{
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
content_pipeline,
|
||||
0, 0,
|
||||
clutter_actor_box_get_width (&alloc),
|
||||
clutter_actor_box_get_height (&alloc));
|
||||
0, 0, geom.width, geom.height);
|
||||
}
|
||||
|
||||
cogl_object_unref (content_pipeline);
|
||||
|
@@ -74,6 +74,20 @@ gboolean clutter_stage_is_default (ClutterStage *stage);
|
||||
CLUTTER_DEPRECATED_FOR(clutter_actor_queue_redraw)
|
||||
void clutter_stage_queue_redraw (ClutterStage *stage);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_stage_set_use_fog (ClutterStage *stage,
|
||||
gboolean fog);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
gboolean clutter_stage_get_use_fog (ClutterStage *stage);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_stage_set_fog (ClutterStage *stage,
|
||||
ClutterFog *fog);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_stage_get_fog (ClutterStage *stage,
|
||||
ClutterFog *fog);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_actor_set_background_color)
|
||||
void clutter_stage_set_color (ClutterStage *stage,
|
||||
|
@@ -438,7 +438,7 @@ set_viewport_with_buffer_under_fbo_source (ClutterActor *fbo_source,
|
||||
* falling back to a stage sized fbo with an offset of (0,0)
|
||||
*/
|
||||
|
||||
graphene_point3d_t verts[4];
|
||||
ClutterVertex verts[4];
|
||||
float x_min = G_MAXFLOAT, y_min = G_MAXFLOAT;
|
||||
int i;
|
||||
|
||||
@@ -1277,9 +1277,7 @@ clutter_texture_init (ClutterTexture *self)
|
||||
|
||||
texture_template_pipeline = cogl_pipeline_new (ctx);
|
||||
pipeline = COGL_PIPELINE (texture_template_pipeline);
|
||||
cogl_pipeline_set_layer_null_texture (pipeline,
|
||||
0, /* layer_index */
|
||||
COGL_TEXTURE_TYPE_2D);
|
||||
cogl_pipeline_set_layer_null_texture (pipeline, 0);
|
||||
}
|
||||
|
||||
g_assert (texture_template_pipeline != NULL);
|
||||
|
@@ -405,7 +405,7 @@ notify_pinch_gesture_event (ClutterInputDevice *input_device,
|
||||
ClutterSeatEvdev *seat;
|
||||
ClutterStage *stage;
|
||||
ClutterEvent *event = NULL;
|
||||
graphene_point_t pos;
|
||||
ClutterPoint pos;
|
||||
|
||||
/* We can drop the event on the floor if no stage has been
|
||||
* associated with the device yet. */
|
||||
@@ -452,7 +452,7 @@ notify_swipe_gesture_event (ClutterInputDevice *input_device,
|
||||
ClutterSeatEvdev *seat;
|
||||
ClutterStage *stage;
|
||||
ClutterEvent *event = NULL;
|
||||
graphene_point_t pos;
|
||||
ClutterPoint pos;
|
||||
|
||||
/* We can drop the event on the floor if no stage has been
|
||||
* associated with the device yet. */
|
||||
|
@@ -676,7 +676,7 @@ stop_toggle_slowkeys (ClutterInputDeviceEvdev *device)
|
||||
}
|
||||
|
||||
static void
|
||||
handle_togglekeys_press (ClutterEvent *event,
|
||||
handle_enablekeys_press (ClutterEvent *event,
|
||||
ClutterInputDeviceEvdev *device)
|
||||
{
|
||||
if (event->key.keyval == XKB_KEY_Shift_L || event->key.keyval == XKB_KEY_Shift_R)
|
||||
@@ -698,7 +698,7 @@ handle_togglekeys_press (ClutterEvent *event,
|
||||
}
|
||||
|
||||
static void
|
||||
handle_togglekeys_release (ClutterEvent *event,
|
||||
handle_enablekeys_release (ClutterEvent *event,
|
||||
ClutterInputDeviceEvdev *device)
|
||||
{
|
||||
if (event->key.keyval == XKB_KEY_Shift_L || event->key.keyval == XKB_KEY_Shift_R)
|
||||
@@ -739,31 +739,33 @@ get_button_index (gint button)
|
||||
}
|
||||
|
||||
static void
|
||||
emulate_button_press (ClutterInputDeviceEvdev *device)
|
||||
emulate_button_press (ClutterInputDeviceEvdev *device_evdev)
|
||||
{
|
||||
gint btn = device->mousekeys_btn;
|
||||
ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_evdev);
|
||||
gint btn = device_evdev->mousekeys_btn;
|
||||
|
||||
if (device->mousekeys_btn_states[get_button_index (btn)])
|
||||
if (device_evdev->mousekeys_btn_states[get_button_index (btn)])
|
||||
return;
|
||||
|
||||
clutter_virtual_input_device_notify_button (device->mousekeys_virtual_device,
|
||||
clutter_virtual_input_device_notify_button (device->accessibility_virtual_device,
|
||||
g_get_monotonic_time (), btn,
|
||||
CLUTTER_BUTTON_STATE_PRESSED);
|
||||
device->mousekeys_btn_states[get_button_index (btn)] = CLUTTER_BUTTON_STATE_PRESSED;
|
||||
device_evdev->mousekeys_btn_states[get_button_index (btn)] = CLUTTER_BUTTON_STATE_PRESSED;
|
||||
}
|
||||
|
||||
static void
|
||||
emulate_button_release (ClutterInputDeviceEvdev *device)
|
||||
emulate_button_release (ClutterInputDeviceEvdev *device_evdev)
|
||||
{
|
||||
gint btn = device->mousekeys_btn;
|
||||
ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_evdev);
|
||||
gint btn = device_evdev->mousekeys_btn;
|
||||
|
||||
if (device->mousekeys_btn_states[get_button_index (btn)] == CLUTTER_BUTTON_STATE_RELEASED)
|
||||
if (device_evdev->mousekeys_btn_states[get_button_index (btn)] == CLUTTER_BUTTON_STATE_RELEASED)
|
||||
return;
|
||||
|
||||
clutter_virtual_input_device_notify_button (device->mousekeys_virtual_device,
|
||||
clutter_virtual_input_device_notify_button (device->accessibility_virtual_device,
|
||||
g_get_monotonic_time (), btn,
|
||||
CLUTTER_BUTTON_STATE_RELEASED);
|
||||
device->mousekeys_btn_states[get_button_index (btn)] = CLUTTER_BUTTON_STATE_RELEASED;
|
||||
device_evdev->mousekeys_btn_states[get_button_index (btn)] = CLUTTER_BUTTON_STATE_RELEASED;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -830,17 +832,18 @@ mousekeys_get_speed_factor (ClutterInputDeviceEvdev *device,
|
||||
#undef MOUSEKEYS_CURVE
|
||||
|
||||
static void
|
||||
emulate_pointer_motion (ClutterInputDeviceEvdev *device,
|
||||
emulate_pointer_motion (ClutterInputDeviceEvdev *device_evdev,
|
||||
gint dx,
|
||||
gint dy)
|
||||
{
|
||||
ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_evdev);
|
||||
gdouble dx_motion;
|
||||
gdouble dy_motion;
|
||||
gdouble speed;
|
||||
gint64 time_us;
|
||||
|
||||
time_us = g_get_monotonic_time ();
|
||||
speed = mousekeys_get_speed_factor (device, time_us);
|
||||
speed = mousekeys_get_speed_factor (device_evdev, time_us);
|
||||
|
||||
if (dx < 0)
|
||||
dx_motion = floor (((gdouble) dx) * speed);
|
||||
@@ -852,56 +855,66 @@ emulate_pointer_motion (ClutterInputDeviceEvdev *device,
|
||||
else
|
||||
dy_motion = ceil (((gdouble) dy) * speed);
|
||||
|
||||
clutter_virtual_input_device_notify_relative_motion (device->mousekeys_virtual_device,
|
||||
clutter_virtual_input_device_notify_relative_motion (device->accessibility_virtual_device,
|
||||
time_us, dx_motion, dy_motion);
|
||||
}
|
||||
static gboolean
|
||||
is_numlock_active (ClutterInputDeviceEvdev *device)
|
||||
{
|
||||
ClutterSeatEvdev *seat = device->seat;
|
||||
return xkb_state_mod_name_is_active (seat->xkb,
|
||||
"Mod2",
|
||||
XKB_STATE_MODS_LOCKED);
|
||||
}
|
||||
|
||||
static void
|
||||
enable_mousekeys (ClutterInputDeviceEvdev *device)
|
||||
enable_mousekeys (ClutterInputDeviceEvdev *device_evdev)
|
||||
{
|
||||
ClutterDeviceManager *manager;
|
||||
ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_evdev);
|
||||
ClutterDeviceManager *manager = device->device_manager;
|
||||
|
||||
device->mousekeys_btn = CLUTTER_BUTTON_PRIMARY;
|
||||
device->move_mousekeys_timer = 0;
|
||||
device->mousekeys_first_motion_time = 0;
|
||||
device->mousekeys_last_motion_time = 0;
|
||||
device->last_mousekeys_key = 0;
|
||||
device_evdev->mousekeys_btn = CLUTTER_BUTTON_PRIMARY;
|
||||
device_evdev->move_mousekeys_timer = 0;
|
||||
device_evdev->mousekeys_first_motion_time = 0;
|
||||
device_evdev->mousekeys_last_motion_time = 0;
|
||||
device_evdev->last_mousekeys_key = 0;
|
||||
|
||||
if (device->mousekeys_virtual_device)
|
||||
if (device->accessibility_virtual_device)
|
||||
return;
|
||||
|
||||
manager = CLUTTER_INPUT_DEVICE (device)->device_manager;
|
||||
device->mousekeys_virtual_device =
|
||||
device->accessibility_virtual_device =
|
||||
clutter_device_manager_create_virtual_device (manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
}
|
||||
|
||||
static void
|
||||
disable_mousekeys (ClutterInputDeviceEvdev *device)
|
||||
disable_mousekeys (ClutterInputDeviceEvdev *device_evdev)
|
||||
{
|
||||
stop_mousekeys_move (device);
|
||||
ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_evdev);
|
||||
|
||||
stop_mousekeys_move (device_evdev);
|
||||
|
||||
/* Make sure we don't leave button pressed behind... */
|
||||
if (device->mousekeys_btn_states[get_button_index (CLUTTER_BUTTON_PRIMARY)])
|
||||
if (device_evdev->mousekeys_btn_states[get_button_index (CLUTTER_BUTTON_PRIMARY)])
|
||||
{
|
||||
device->mousekeys_btn = CLUTTER_BUTTON_PRIMARY;
|
||||
emulate_button_release (device);
|
||||
device_evdev->mousekeys_btn = CLUTTER_BUTTON_PRIMARY;
|
||||
emulate_button_release (device_evdev);
|
||||
}
|
||||
|
||||
if (device->mousekeys_btn_states[get_button_index (CLUTTER_BUTTON_MIDDLE)])
|
||||
if (device_evdev->mousekeys_btn_states[get_button_index (CLUTTER_BUTTON_MIDDLE)])
|
||||
{
|
||||
device->mousekeys_btn = CLUTTER_BUTTON_MIDDLE;
|
||||
emulate_button_release (device);
|
||||
device_evdev->mousekeys_btn = CLUTTER_BUTTON_MIDDLE;
|
||||
emulate_button_release (device_evdev);
|
||||
}
|
||||
|
||||
if (device->mousekeys_btn_states[get_button_index (CLUTTER_BUTTON_SECONDARY)])
|
||||
if (device_evdev->mousekeys_btn_states[get_button_index (CLUTTER_BUTTON_SECONDARY)])
|
||||
{
|
||||
device->mousekeys_btn = CLUTTER_BUTTON_SECONDARY;
|
||||
emulate_button_release (device);
|
||||
device_evdev->mousekeys_btn = CLUTTER_BUTTON_SECONDARY;
|
||||
emulate_button_release (device_evdev);
|
||||
}
|
||||
|
||||
if (device->mousekeys_virtual_device)
|
||||
g_clear_object (&device->mousekeys_virtual_device);
|
||||
if (device->accessibility_virtual_device)
|
||||
g_clear_object (&device->accessibility_virtual_device);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -1013,6 +1026,10 @@ handle_mousekeys_press (ClutterEvent *event,
|
||||
if (!(event->key.flags & CLUTTER_EVENT_FLAG_SYNTHETIC))
|
||||
stop_mousekeys_move (device);
|
||||
|
||||
/* Do not handle mousekeys if NumLock is ON */
|
||||
if (is_numlock_active (device))
|
||||
return FALSE;
|
||||
|
||||
/* Button selection */
|
||||
switch (event->key.keyval)
|
||||
{
|
||||
@@ -1084,6 +1101,10 @@ static gboolean
|
||||
handle_mousekeys_release (ClutterEvent *event,
|
||||
ClutterInputDeviceEvdev *device)
|
||||
{
|
||||
/* Do not handle mousekeys if NumLock is ON */
|
||||
if (is_numlock_active (device))
|
||||
return FALSE;
|
||||
|
||||
switch (event->key.keyval)
|
||||
{
|
||||
case XKB_KEY_KP_0:
|
||||
@@ -1132,8 +1153,13 @@ clutter_input_device_evdev_process_kbd_a11y_event (ClutterEvent *e
|
||||
if (event->key.flags & CLUTTER_EVENT_FLAG_INPUT_METHOD)
|
||||
goto emit_event;
|
||||
|
||||
if (!device_evdev->a11y_flags & CLUTTER_A11Y_KEYBOARD_ENABLED)
|
||||
goto emit_event;
|
||||
if (device_evdev->a11y_flags & CLUTTER_A11Y_KEYBOARD_ENABLED)
|
||||
{
|
||||
if (event->type == CLUTTER_KEY_PRESS)
|
||||
handle_enablekeys_press (event, device_evdev);
|
||||
else
|
||||
handle_enablekeys_release (event, device_evdev);
|
||||
}
|
||||
|
||||
if (device_evdev->a11y_flags & CLUTTER_A11Y_MOUSE_KEYS_ENABLED)
|
||||
{
|
||||
@@ -1145,14 +1171,6 @@ clutter_input_device_evdev_process_kbd_a11y_event (ClutterEvent *e
|
||||
return; /* swallow event */
|
||||
}
|
||||
|
||||
if (device_evdev->a11y_flags & CLUTTER_A11Y_TOGGLE_KEYS_ENABLED)
|
||||
{
|
||||
if (event->type == CLUTTER_KEY_PRESS)
|
||||
handle_togglekeys_press (event, device_evdev);
|
||||
else
|
||||
handle_togglekeys_release (event, device_evdev);
|
||||
}
|
||||
|
||||
if ((device_evdev->a11y_flags & CLUTTER_A11Y_BOUNCE_KEYS_ENABLED) &&
|
||||
(get_debounce_delay (device) != 0))
|
||||
{
|
||||
@@ -1207,7 +1225,7 @@ clutter_input_device_evdev_apply_kbd_a11y_settings (ClutterInputDeviceEvdev *dev
|
||||
update_internal_xkb_state (device, 0, 0);
|
||||
}
|
||||
|
||||
if (changed_flags & (CLUTTER_A11Y_KEYBOARD_ENABLED | CLUTTER_A11Y_TOGGLE_KEYS_ENABLED))
|
||||
if (changed_flags & CLUTTER_A11Y_KEYBOARD_ENABLED)
|
||||
{
|
||||
device->toggle_slowkeys_timer = 0;
|
||||
device->shift_count = 0;
|
||||
@@ -1228,6 +1246,13 @@ clutter_input_device_evdev_apply_kbd_a11y_settings (ClutterInputDeviceEvdev *dev
|
||||
device->a11y_flags = settings->controls;
|
||||
}
|
||||
|
||||
void
|
||||
clutter_evdev_a11y_maybe_notify_toggle_keys (ClutterInputDeviceEvdev *device)
|
||||
{
|
||||
if (device->a11y_flags & CLUTTER_A11Y_TOGGLE_KEYS_ENABLED)
|
||||
clutter_input_device_evdev_bell_notify ();
|
||||
}
|
||||
|
||||
static void
|
||||
release_device_touch_slot (gpointer value)
|
||||
{
|
||||
@@ -1266,18 +1291,6 @@ clutter_input_device_evdev_release_touch_state (ClutterInputDeviceEvdev *device,
|
||||
GINT_TO_POINTER (touch_state->device_slot));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_input_device_evdev_get_physical_size (ClutterInputDevice *device,
|
||||
gdouble *width,
|
||||
gdouble *height)
|
||||
{
|
||||
struct libinput_device *libinput_device;
|
||||
|
||||
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
|
||||
|
||||
return libinput_device_get_size (libinput_device, width, height) == 0;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_input_device_evdev_class_init (ClutterInputDeviceEvdevClass *klass)
|
||||
{
|
||||
@@ -1293,7 +1306,6 @@ clutter_input_device_evdev_class_init (ClutterInputDeviceEvdevClass *klass)
|
||||
klass->get_group_n_modes = clutter_input_device_evdev_get_group_n_modes;
|
||||
klass->is_grouped = clutter_input_device_evdev_is_grouped;
|
||||
klass->process_kbd_a11y_event = clutter_input_device_evdev_process_kbd_a11y_event;
|
||||
klass->get_physical_size = clutter_input_device_evdev_get_physical_size;
|
||||
|
||||
obj_props[PROP_DEVICE_MATRIX] =
|
||||
g_param_spec_boxed ("device-matrix",
|
||||
|
@@ -94,7 +94,6 @@ struct _ClutterInputDeviceEvdev
|
||||
gdouble mousekeys_curve_factor;
|
||||
guint move_mousekeys_timer;
|
||||
guint16 last_mousekeys_key;
|
||||
ClutterVirtualInputDevice *mousekeys_virtual_device;
|
||||
};
|
||||
|
||||
GType _clutter_input_device_evdev_get_type (void) G_GNUC_CONST;
|
||||
@@ -151,6 +150,7 @@ void clutter_input_device_evdev_release_touch_state (Clutte
|
||||
void clutter_input_device_evdev_release_touch_slots (ClutterInputDeviceEvdev *device_evdev,
|
||||
uint64_t time_us);
|
||||
|
||||
void clutter_evdev_a11y_maybe_notify_toggle_keys (ClutterInputDeviceEvdev *);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -326,6 +326,7 @@ clutter_seat_evdev_notify_key (ClutterSeatEvdev *seat,
|
||||
backend = clutter_get_default_backend ();
|
||||
g_signal_emit_by_name (clutter_backend_get_keymap (backend), "state-changed");
|
||||
clutter_seat_evdev_sync_leds (seat);
|
||||
clutter_evdev_a11y_maybe_notify_toggle_keys (CLUTTER_INPUT_DEVICE_EVDEV (seat->core_keyboard));
|
||||
}
|
||||
|
||||
if (state == 0 || /* key release */
|
||||
@@ -568,7 +569,7 @@ clutter_seat_evdev_notify_button (ClutterSeatEvdev *seat,
|
||||
|
||||
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
|
||||
{
|
||||
graphene_point_t point;
|
||||
ClutterPoint point;
|
||||
|
||||
clutter_input_device_get_coords (input_device, NULL, &point);
|
||||
event->button.x = point.x;
|
||||
|
@@ -42,7 +42,7 @@ struct _ClutterTouchState
|
||||
|
||||
int device_slot;
|
||||
int seat_slot;
|
||||
graphene_point_t coords;
|
||||
ClutterPoint coords;
|
||||
};
|
||||
|
||||
struct _ClutterSeatEvdev
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user