Compare commits
305 Commits
3.34.0
...
wip/carlos
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4d6f99c95d | ||
![]() |
9e54e404ee | ||
![]() |
6ec6ea7d3c | ||
![]() |
d8c4d78f4a | ||
![]() |
b7a662bfdd | ||
![]() |
9d61e6e56f | ||
![]() |
231d9e3c31 | ||
![]() |
8907a29912 | ||
![]() |
a5f986259f | ||
![]() |
bcc519e4ee | ||
![]() |
044238b503 | ||
![]() |
03b59f9e19 | ||
![]() |
7193938d27 | ||
![]() |
5afec87b96 | ||
![]() |
a4f51da184 | ||
![]() |
0545b93232 | ||
![]() |
9cbf83d59c | ||
![]() |
07ca100130 | ||
![]() |
6944839ab6 | ||
![]() |
4a76f66a54 | ||
![]() |
bacbbbd628 | ||
![]() |
c85fb107c0 | ||
![]() |
13f10e36e4 | ||
![]() |
2644e54c51 | ||
![]() |
0e5a5df5fe | ||
![]() |
806ebc464a | ||
![]() |
54ac1f6b59 | ||
![]() |
9b16b74b5d | ||
![]() |
9172901458 | ||
![]() |
ffa0a24848 | ||
![]() |
efe5bed5b4 | ||
![]() |
e865fcc460 | ||
![]() |
16eb461054 | ||
![]() |
c11ef6ef07 | ||
![]() |
95eda361c1 | ||
![]() |
662c76c4fc | ||
![]() |
ff799a1abe | ||
![]() |
155b7bf569 | ||
![]() |
47155ed524 | ||
![]() |
db91439bb0 | ||
![]() |
77aad0869f | ||
![]() |
dc1a28c42a | ||
![]() |
955b27637c | ||
![]() |
1f5b403524 | ||
![]() |
5e87d67e5f | ||
![]() |
f133de2dd4 | ||
![]() |
60800d2313 | ||
![]() |
db90c0d509 | ||
![]() |
e5b0f474ab | ||
![]() |
1688cf7c44 | ||
![]() |
2202c0d02e | ||
![]() |
dbb95cbe5f | ||
![]() |
ae238d1d4d | ||
![]() |
6051712919 | ||
![]() |
6bfa61a3a7 | ||
![]() |
cf89e4d2cd | ||
![]() |
d47324e8d7 | ||
![]() |
ee4638ef5c | ||
![]() |
6ee7c0f486 | ||
![]() |
f4f7e31303 | ||
![]() |
7c036c5896 | ||
![]() |
793c2ac58d | ||
![]() |
13d9e4db30 | ||
![]() |
e84dbd7faf | ||
![]() |
711023ea93 | ||
![]() |
468dc99dc9 | ||
![]() |
6b8ee80fd0 | ||
![]() |
17e39ad79c | ||
![]() |
46aeb9634f | ||
![]() |
3f9c5d04d4 | ||
![]() |
40a76590dd | ||
![]() |
f2b3dd318f | ||
![]() |
942883577e | ||
![]() |
23fa59b77c | ||
![]() |
9678fd5306 | ||
![]() |
563e7139b6 | ||
![]() |
2e9faaf67a | ||
![]() |
4918893326 | ||
![]() |
3e5960b5a2 | ||
![]() |
b294e62aed | ||
![]() |
c63f54b7a7 | ||
![]() |
3186e45ae5 | ||
![]() |
ed7afd9e80 | ||
![]() |
683f18639e | ||
![]() |
e17494f3bd | ||
![]() |
c36c865987 | ||
![]() |
a99f579127 | ||
![]() |
acc7b83322 | ||
![]() |
95662fd3d8 | ||
![]() |
b3980f7a94 | ||
![]() |
ac626f7334 | ||
![]() |
b622a8b55d | ||
![]() |
b6170dbe7b | ||
![]() |
d6bf4800ed | ||
![]() |
a60457c2d8 | ||
![]() |
33d1bae03f | ||
![]() |
013b336690 | ||
![]() |
096d78479b | ||
![]() |
68fca552d7 | ||
![]() |
18e0a8f7bf | ||
![]() |
cd2ee44216 | ||
![]() |
ebf9ac091d | ||
![]() |
cf791c09f0 | ||
![]() |
1d8807a171 | ||
![]() |
f18e2d2e62 | ||
![]() |
71c3f4af31 | ||
![]() |
3078394951 | ||
![]() |
a7f4f5b291 | ||
![]() |
bd1630a12c | ||
![]() |
67d5ebb187 | ||
![]() |
ba7b8a5de3 | ||
![]() |
d54c548aac | ||
![]() |
f01db80387 | ||
![]() |
5e0989532e | ||
![]() |
673f4295e8 | ||
![]() |
1f04b1ae69 | ||
![]() |
26a7387f40 | ||
![]() |
bd5266a05e | ||
![]() |
eb3ffeff0a | ||
![]() |
0731eb629c | ||
![]() |
34a38827b7 | ||
![]() |
3076895e98 | ||
![]() |
0e4c23c985 | ||
![]() |
fb49e9def7 | ||
![]() |
45e77c1d87 | ||
![]() |
cf107c89b8 | ||
![]() |
6a8830a551 | ||
![]() |
4523251849 | ||
![]() |
5f4e8789df | ||
![]() |
eaf0aa1f07 | ||
![]() |
96da0c60bd | ||
![]() |
da36575d7f | ||
![]() |
7716a418ce | ||
![]() |
6ab2e30fff | ||
![]() |
8b0289a5ba | ||
![]() |
d810c0576d | ||
![]() |
82f56054d4 | ||
![]() |
de362537c6 | ||
![]() |
ba9fb16048 | ||
![]() |
148cba3270 | ||
![]() |
c5bb2e3f56 | ||
![]() |
049e7882b7 | ||
![]() |
f297a5faa5 | ||
![]() |
40e6aa7d94 | ||
![]() |
668be1f4bd | ||
![]() |
a444a4c5f5 | ||
![]() |
05da4a6094 | ||
![]() |
db8fcc0537 | ||
![]() |
86a5358812 | ||
![]() |
ff8ed70f84 | ||
![]() |
179d5ba6a6 | ||
![]() |
98892391d7 | ||
![]() |
45a8806e65 | ||
![]() |
e1fa0734a9 | ||
![]() |
8665084df1 | ||
![]() |
62072838c9 | ||
![]() |
c5b7d73ce2 | ||
![]() |
0556138b9f | ||
![]() |
d57dbe1d4c | ||
![]() |
5d646a5d6f | ||
![]() |
e82a657cd9 | ||
![]() |
8c89ea5f0a | ||
![]() |
8cfa8dc0c1 | ||
![]() |
bdf5e3f357 | ||
![]() |
94682e69aa | ||
![]() |
160cc9182d | ||
![]() |
cd293f764e | ||
![]() |
a5d0cfe8fb | ||
![]() |
ba0f17f5b1 | ||
![]() |
16875340cb | ||
![]() |
959a418cc3 | ||
![]() |
7c7ccb2e43 | ||
![]() |
cada2b54fe | ||
![]() |
3ecae81809 | ||
![]() |
4f2b217a6a | ||
![]() |
b1a1d4e13d | ||
![]() |
f7315c9a36 | ||
![]() |
9ac52f0340 | ||
![]() |
f059466337 | ||
![]() |
dcd0f4322a | ||
![]() |
65d8f27b6b | ||
![]() |
bdceb3acdb | ||
![]() |
8e204e036a | ||
![]() |
553211dd81 | ||
![]() |
97010ac64d | ||
![]() |
c2d03bf73e | ||
![]() |
22c8f179d2 | ||
![]() |
d4ff5e2d31 | ||
![]() |
2773e8adf8 | ||
![]() |
e17d70a592 | ||
![]() |
da213febdc | ||
![]() |
7c2e926c44 | ||
![]() |
c474ad6a53 | ||
![]() |
877ecc1bb4 | ||
![]() |
0d0286d59e | ||
![]() |
23f77a1b63 | ||
![]() |
317ce05a27 | ||
![]() |
a8155a0471 | ||
![]() |
5e7fa20f06 | ||
![]() |
3a688988e0 | ||
![]() |
34ff206604 | ||
![]() |
5c1be2233d | ||
![]() |
e1751ad9ee | ||
![]() |
84cc89e19a | ||
![]() |
ea4665bf51 | ||
![]() |
227d272049 | ||
![]() |
e53db92a7b | ||
![]() |
dd2b1278a0 | ||
![]() |
f2e2fcf758 | ||
![]() |
dfd44ff971 | ||
![]() |
943b069996 | ||
![]() |
2a56de80a2 | ||
![]() |
69a0c1dc80 | ||
![]() |
1b4709794e | ||
![]() |
1cc249fe18 | ||
![]() |
446bd04b6c | ||
![]() |
9234fcb624 | ||
![]() |
59a697f773 | ||
![]() |
d49d10b14f | ||
![]() |
4c15d32b55 | ||
![]() |
73eaf51770 | ||
![]() |
81ee8886ce | ||
![]() |
658c741420 | ||
![]() |
65cc8c1ea2 | ||
![]() |
d9597d2148 | ||
![]() |
fc3831c797 | ||
![]() |
ce86f90efb | ||
![]() |
b5f50028f2 | ||
![]() |
2c388e2155 | ||
![]() |
fb6e2743ec | ||
![]() |
6ee006c851 | ||
![]() |
107e521553 | ||
![]() |
7735a919d1 | ||
![]() |
9f617ae43d | ||
![]() |
104bdde746 | ||
![]() |
2a990cc140 | ||
![]() |
3e41568074 | ||
![]() |
66ae09b670 | ||
![]() |
7b97c7b35e | ||
![]() |
ca318c1520 | ||
![]() |
cbb4f6c892 | ||
![]() |
092b3edb51 | ||
![]() |
8d6d2d07dd | ||
![]() |
fa461525ee | ||
![]() |
8e510a07c4 | ||
![]() |
e153524748 | ||
![]() |
eb8a1f42bc | ||
![]() |
89cd9d382d | ||
![]() |
488991b0f6 | ||
![]() |
e2330617ac | ||
![]() |
5e6d98e79f | ||
![]() |
5eaf655224 | ||
![]() |
2c1553570f | ||
![]() |
c937dd5ba3 | ||
![]() |
26b76ee95d | ||
![]() |
006eb6d81e | ||
![]() |
0cdf13ac12 | ||
![]() |
0a3f25c303 | ||
![]() |
105a3f757a | ||
![]() |
f376a318ba | ||
![]() |
4b88c1832a | ||
![]() |
fc8aa1cdb1 | ||
![]() |
7049b2f274 | ||
![]() |
0f51ae7cf0 | ||
![]() |
437f6b3d59 | ||
![]() |
05e1a6c2ca | ||
![]() |
25c1a85384 | ||
![]() |
bba8f6c53e | ||
![]() |
dbe9daeb76 | ||
![]() |
8fd55fef85 | ||
![]() |
acfd03da30 | ||
![]() |
f352c3d79d | ||
![]() |
4bf0bd3f55 | ||
![]() |
76f2579e44 | ||
![]() |
0706e021f5 | ||
![]() |
b5775e3d85 | ||
![]() |
cd70595b50 | ||
![]() |
1d2913d9b9 | ||
![]() |
b8a49a682e | ||
![]() |
82901f89d5 | ||
![]() |
c9c53cb55f | ||
![]() |
1e637bd7e1 | ||
![]() |
63a0b702c9 | ||
![]() |
031003a5dc | ||
![]() |
b69d2aa6a0 | ||
![]() |
d7d2612218 | ||
![]() |
7a0340c57d | ||
![]() |
0863bd2408 | ||
![]() |
594cc7c7d6 | ||
![]() |
0b19078b2b | ||
![]() |
7811865e84 | ||
![]() |
0e69fe0781 | ||
![]() |
26b08d87a8 | ||
![]() |
321ab3b367 | ||
![]() |
4d0869e206 | ||
![]() |
d13cea6ccb | ||
![]() |
6922f0e16a | ||
![]() |
31df06d94e | ||
![]() |
ecec9a7eaa | ||
![]() |
ab7af2d0c5 | ||
![]() |
f92e0bec0b | ||
![]() |
7a22f6fd3f | ||
![]() |
850ef51879 | ||
![]() |
ef2e04a613 | ||
![]() |
e16b75a0b7 |
@@ -1,4 +1,4 @@
|
|||||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v2
|
image: registry.gitlab.gnome.org/gnome/mutter/master:v3
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- review
|
- review
|
||||||
@@ -28,10 +28,10 @@ build-mutter:
|
|||||||
- merge_requests
|
- merge_requests
|
||||||
- /^.*$/
|
- /^.*$/
|
||||||
|
|
||||||
build-without-native-backend:
|
build-without-native-backend-and-wayland:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- meson . build -Dbuildtype=debugoptimized -Dnative_backend=false -Dudev=false --werror --prefix /usr
|
- meson . build -Dbuildtype=debugoptimized -Dnative_backend=false -Dudev=false -Dwayland=false -Dcore_tests=false --werror --prefix /usr
|
||||||
- ninja -C build
|
- ninja -C build
|
||||||
- ninja -C build install
|
- ninja -C build install
|
||||||
artifacts:
|
artifacts:
|
||||||
|
@@ -1,39 +1,28 @@
|
|||||||
# Rebuild and push with
|
# Rebuild and push with
|
||||||
#
|
#
|
||||||
# cd .gitlab-ci/
|
# cd .gitlab-ci/
|
||||||
# docker build --no-cache -t registry.gitlab.gnome.org/gnome/mutter/master:v2 .
|
# docker build --no-cache -t registry.gitlab.gnome.org/gnome/mutter/master:v3 .
|
||||||
# docker push registry.gitlab.gnome.org/gnome/mutter/master:v2
|
# docker push registry.gitlab.gnome.org/gnome/mutter/master:v3
|
||||||
#
|
#
|
||||||
|
|
||||||
FROM fedora:30
|
FROM fedora:31
|
||||||
|
|
||||||
RUN dnf -y update && dnf -y upgrade && \
|
RUN dnf -y update && dnf -y upgrade && \
|
||||||
dnf install -y 'dnf-command(builddep)' && \
|
dnf install -y 'dnf-command(builddep)' && \
|
||||||
dnf install -y 'dnf-command(copr)' && \
|
dnf install -y 'dnf-command(copr)' && \
|
||||||
dnf copr enable -y fmuellner/gnome-shell-ci && \
|
dnf copr enable -y fmuellner/gnome-shell-ci && \
|
||||||
dnf copr enable -y jadahl/mutter-ci && \
|
|
||||||
dnf copr enable -y hergertme/sysprof-3 && \
|
|
||||||
dnf -y update && dnf -y upgrade && \
|
dnf -y update && dnf -y upgrade && \
|
||||||
|
|
||||||
dnf builddep -y mutter && \
|
dnf builddep -y mutter && \
|
||||||
|
|
||||||
# Until Fedora catches up with meson build-deps
|
# Until Fedora catches up with new build-deps
|
||||||
dnf install -y meson xorg-x11-server-Xorg gnome-settings-daemon-devel egl-wayland-devel xorg-x11-server-Xwayland && \
|
dnf install -y 'pkgconfig(graphene-gobject-1.0)' 'pkgconfig(sysprof-capture-3)' 'pkgconfig(libcap-ng)' && \
|
||||||
|
|
||||||
# Until Fedora catches up with mesa bug fixes
|
|
||||||
dnf upgrade -y mesa-dri-drivers mesa-libEGL && \
|
|
||||||
|
|
||||||
# For running unit tests
|
# For running unit tests
|
||||||
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 '*/xvfb-run' gdm-lib accountsservice-libs && \
|
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 '*/xvfb-run' gdm-lib accountsservice-libs gnome-control-center && \
|
||||||
|
|
||||||
dnf install -y sysprof-devel && \
|
|
||||||
|
|
||||||
dnf install -y intltool redhat-rpm-config make && \
|
|
||||||
|
|
||||||
# GNOME Shell
|
# GNOME Shell
|
||||||
dnf builddep -y gnome-shell --setopt=install_weak_deps=False && \
|
dnf builddep -y gnome-shell --setopt=install_weak_deps=False && \
|
||||||
# New dep this cycle
|
|
||||||
dnf install -y 'pkgconfig(gnome-autoar-0)' && \
|
|
||||||
dnf remove -y gnome-bluetooth-libs-devel dbus-glib-devel upower-devel python3-devel && \
|
dnf remove -y gnome-bluetooth-libs-devel dbus-glib-devel upower-devel python3-devel && \
|
||||||
dnf remove -y --noautoremove mutter mutter-devel && \
|
dnf remove -y --noautoremove mutter mutter-devel && \
|
||||||
|
|
||||||
|
@@ -40,11 +40,12 @@ function commit_message_subject_is_compliant() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RET=0
|
||||||
for commit in $commits; do
|
for commit in $commits; do
|
||||||
commit_short=$(echo $commit | cut -c -8)
|
commit_short=$(echo $commit | cut -c -8)
|
||||||
|
|
||||||
if ! commit_message_has_url $commit; then
|
if ! commit_message_has_url $commit; then
|
||||||
echo "Missing merge request or issue URL on commit $commit_short"
|
echo "Commit $commit_short needs a merge request or issue URL"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -52,6 +53,8 @@ for commit in $commits; do
|
|||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
echo "Commit message for $commit_short is not compliant:"
|
echo "Commit message for $commit_short is not compliant:"
|
||||||
echo "$errors"
|
echo "$errors"
|
||||||
exit 1
|
RET=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
exit $RET
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
|
|
||||||
mutter_branch=$(git describe --contains --all HEAD)
|
|
||||||
gnome_shell_target=
|
gnome_shell_target=
|
||||||
|
|
||||||
git clone https://gitlab.gnome.org/GNOME/gnome-shell.git
|
git clone https://gitlab.gnome.org/GNOME/gnome-shell.git
|
||||||
@@ -26,8 +25,7 @@ if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$gnome_shell_target" ]; then
|
if [ -z "$gnome_shell_target" ]; then
|
||||||
gnome_shell_target=$(git branch -r -l origin/$mutter_branch)
|
gnome_shell_target=$(git branch -r -l origin/$CI_COMMIT_REF_NAME)
|
||||||
gnome_shell_target=${gnome_shell_target:-$(git branch -r -l ${mutter_branch#remotes/})}
|
|
||||||
gnome_shell_target=${gnome_shell_target:-origin/master}
|
gnome_shell_target=${gnome_shell_target:-origin/master}
|
||||||
echo Using $gnome_shell_target instead
|
echo Using $gnome_shell_target instead
|
||||||
fi
|
fi
|
||||||
|
45
NEWS
45
NEWS
@@ -1,3 +1,48 @@
|
|||||||
|
3.35.1
|
||||||
|
======
|
||||||
|
* Fix immediate screen blank after releaseing inhibitor [Tim; #573]
|
||||||
|
* Respond to frame callbacks regardless of damage [Jonas; !839]
|
||||||
|
* selection [Carlos; !842]
|
||||||
|
* Fix Night Light on wayland [Jonas; !840]
|
||||||
|
* Fix various copy+paste/DND regressions [Carlos; !848, #789, #842,
|
||||||
|
#793, #845, #854]
|
||||||
|
* Misc. bug fixes and cleanups [Daniel, Marco, Jonas, Georges;
|
||||||
|
!841, !764, !837, !846]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Marco Trevisan (Treviño), Carlos Garnacho, Tim Klocke,
|
||||||
|
Georges Basile Stavracas Neto, Daniel van Vugt, Jonas Ådahl
|
||||||
|
|
||||||
|
3.34.1
|
||||||
|
======
|
||||||
|
* Fix startup of X11 session services on wayland [Carlos; #771]
|
||||||
|
* Fix _NET_ACTIVE_WINDOW emission [Carlos; #751]
|
||||||
|
* Fix initial view perspective [Marco; !803]
|
||||||
|
* Fix screenshots and window animations when scaled [Robert; !758]
|
||||||
|
* Re-enable coredumps when capabilities are set [Jonas; !811]
|
||||||
|
* Fix scaling of DND surface actors [Robert; !780]
|
||||||
|
* Optimize blitting of untransformed offscreen stage views [Olivier; !809, !820]
|
||||||
|
* Fix freeze of pointer event delivery on X11 [Olivier; !821]
|
||||||
|
* Fix scaling of stylus input coordinates with HiDPI [Dorian; !830]
|
||||||
|
* Fix memory leak when using implicit animations [Jonas; !828]
|
||||||
|
* Fix numlock state for native backend [Carlos; #769]
|
||||||
|
* Fixed crashes [Marco, Olivier, Jonas Å.; !805, #823, !808, !825,
|
||||||
|
#844, !826, #779]
|
||||||
|
* Misc. bug fixes and cleanups [Jonas Å., Georges, Jonas D., Michal, Daniel,
|
||||||
|
Iain, Adam, Marco, Carlos, Ting-Wei, Hans, Robert; !787, !795, !791, !797,
|
||||||
|
!772, !775, !799, !778, !785, !782, !796, #819, !814, !769, !817, !783, !786,
|
||||||
|
!829, !774, #822]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Marco Trevisan (Treviño), Jonas Dreßler, Olivier Fourdan, Carlos Garnacho,
|
||||||
|
Hans de Goede, Adam Jackson, Ting-Wei Lan, Iain Lane, Michal Lazo,
|
||||||
|
Robert Mader, Georges Basile Stavracas Neto, Dorian Stoll, Daniel van Vugt,
|
||||||
|
Jonas Ådahl
|
||||||
|
|
||||||
|
Translators:
|
||||||
|
Milo Casagrande [it], Nathan Follens [nl], Matej Urbančič [sl],
|
||||||
|
Ask Hjorth Larsen [da], Alan Mortensen [da], Jordi Mas [ca]
|
||||||
|
|
||||||
3.34.0
|
3.34.0
|
||||||
======
|
======
|
||||||
* Fix xdg-output v3 support [Olivier; !771]
|
* Fix xdg-output v3 support [Olivier; !771]
|
||||||
|
@@ -657,7 +657,7 @@ cally_actor_get_extents (AtkComponent *component,
|
|||||||
ClutterActor *actor = NULL;
|
ClutterActor *actor = NULL;
|
||||||
gint top_level_x, top_level_y;
|
gint top_level_x, top_level_y;
|
||||||
gfloat f_width, f_height;
|
gfloat f_width, f_height;
|
||||||
ClutterVertex verts[4];
|
graphene_point3d_t verts[4];
|
||||||
ClutterActor *stage = NULL;
|
ClutterActor *stage = NULL;
|
||||||
|
|
||||||
g_return_if_fail (CALLY_IS_ACTOR (component));
|
g_return_if_fail (CALLY_IS_ACTOR (component));
|
||||||
|
@@ -1438,7 +1438,7 @@ static void cally_text_get_character_extents (AtkText *text,
|
|||||||
PangoLayout *layout;
|
PangoLayout *layout;
|
||||||
PangoRectangle extents;
|
PangoRectangle extents;
|
||||||
const gchar *text_value;
|
const gchar *text_value;
|
||||||
ClutterVertex verts[4];
|
graphene_point3d_t verts[4];
|
||||||
|
|
||||||
actor = CALLY_GET_CLUTTER_ACTOR (text);
|
actor = CALLY_GET_CLUTTER_ACTOR (text);
|
||||||
if (actor == NULL) /* State is defunct */
|
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 index, x_window, y_window, x_toplevel, y_toplevel;
|
||||||
gint x_temp, y_temp;
|
gint x_temp, y_temp;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
ClutterVertex verts[4];
|
graphene_point3d_t verts[4];
|
||||||
PangoLayout *layout;
|
PangoLayout *layout;
|
||||||
gint x_layout, y_layout;
|
gint x_layout, y_layout;
|
||||||
|
|
||||||
|
@@ -340,7 +340,7 @@ clutter_actor_box_contains (const ClutterActorBox *box,
|
|||||||
/**
|
/**
|
||||||
* clutter_actor_box_from_vertices:
|
* clutter_actor_box_from_vertices:
|
||||||
* @box: a #ClutterActorBox
|
* @box: a #ClutterActorBox
|
||||||
* @verts: (array fixed-size=4): array of four #ClutterVertex
|
* @verts: (array fixed-size=4): array of four #graphene_point3d_t
|
||||||
*
|
*
|
||||||
* Calculates the bounding box represented by the four vertices; for details
|
* Calculates the bounding box represented by the four vertices; for details
|
||||||
* of the vertex array see clutter_actor_get_abs_allocation_vertices().
|
* of the vertex array see clutter_actor_get_abs_allocation_vertices().
|
||||||
@@ -348,8 +348,8 @@ clutter_actor_box_contains (const ClutterActorBox *box,
|
|||||||
* Since: 1.0
|
* Since: 1.0
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_actor_box_from_vertices (ClutterActorBox *box,
|
clutter_actor_box_from_vertices (ClutterActorBox *box,
|
||||||
const ClutterVertex verts[])
|
const graphene_point3d_t verts[])
|
||||||
{
|
{
|
||||||
gfloat x_1, x_2, y_1, y_2;
|
gfloat x_1, x_2, y_1, y_2;
|
||||||
|
|
||||||
|
@@ -135,7 +135,7 @@ struct _AnchorCoord
|
|||||||
} fraction;
|
} fraction;
|
||||||
|
|
||||||
/* Use when is_fractional == FALSE */
|
/* Use when is_fractional == FALSE */
|
||||||
ClutterVertex units;
|
graphene_point3d_t units;
|
||||||
} v;
|
} v;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ struct _SizeRequest
|
|||||||
struct _ClutterLayoutInfo
|
struct _ClutterLayoutInfo
|
||||||
{
|
{
|
||||||
/* fixed position coordinates */
|
/* fixed position coordinates */
|
||||||
ClutterPoint fixed_pos;
|
graphene_point_t fixed_pos;
|
||||||
|
|
||||||
ClutterMargin margin;
|
ClutterMargin margin;
|
||||||
|
|
||||||
@@ -173,8 +173,8 @@ struct _ClutterLayoutInfo
|
|||||||
guint x_expand : 1;
|
guint x_expand : 1;
|
||||||
guint y_expand : 1;
|
guint y_expand : 1;
|
||||||
|
|
||||||
ClutterSize minimum;
|
graphene_size_t minimum;
|
||||||
ClutterSize natural;
|
graphene_size_t natural;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ClutterLayoutInfo * _clutter_actor_get_layout_info_or_defaults (ClutterActor *self);
|
const ClutterLayoutInfo * _clutter_actor_get_layout_info_or_defaults (ClutterActor *self);
|
||||||
@@ -203,13 +203,13 @@ struct _ClutterTransformInfo
|
|||||||
AnchorCoord anchor;
|
AnchorCoord anchor;
|
||||||
|
|
||||||
/* translation */
|
/* translation */
|
||||||
ClutterVertex translation;
|
graphene_point3d_t translation;
|
||||||
|
|
||||||
/* z_position */
|
/* z_position */
|
||||||
gfloat z_position;
|
gfloat z_position;
|
||||||
|
|
||||||
/* transformation center */
|
/* transformation center */
|
||||||
ClutterPoint pivot;
|
graphene_point_t pivot;
|
||||||
gfloat pivot_z;
|
gfloat pivot_z;
|
||||||
|
|
||||||
CoglMatrix transform;
|
CoglMatrix transform;
|
||||||
@@ -242,9 +242,6 @@ ClutterAnimationInfo * _clutter_actor_get_animation_info
|
|||||||
ClutterTransition * _clutter_actor_create_transition (ClutterActor *self,
|
ClutterTransition * _clutter_actor_create_transition (ClutterActor *self,
|
||||||
GParamSpec *pspec,
|
GParamSpec *pspec,
|
||||||
...);
|
...);
|
||||||
ClutterTransition * _clutter_actor_get_transition (ClutterActor *self,
|
|
||||||
GParamSpec *pspec);
|
|
||||||
|
|
||||||
gboolean _clutter_actor_foreach_child (ClutterActor *self,
|
gboolean _clutter_actor_foreach_child (ClutterActor *self,
|
||||||
ClutterForeachCallback callback,
|
ClutterForeachCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
@@ -277,6 +274,9 @@ void _clutter_actor_set_enable_paint_unmapped
|
|||||||
void _clutter_actor_set_has_pointer (ClutterActor *self,
|
void _clutter_actor_set_has_pointer (ClutterActor *self,
|
||||||
gboolean has_pointer);
|
gboolean has_pointer);
|
||||||
|
|
||||||
|
void _clutter_actor_set_has_key_focus (ClutterActor *self,
|
||||||
|
gboolean has_key_focus);
|
||||||
|
|
||||||
void _clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
void _clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||||
ClutterRedrawFlags flags,
|
ClutterRedrawFlags flags,
|
||||||
const ClutterPaintVolume *clip_volume);
|
const ClutterPaintVolume *clip_volume);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -233,8 +233,7 @@ struct _ClutterActorClass
|
|||||||
ClutterActor *old_parent);
|
ClutterActor *old_parent);
|
||||||
|
|
||||||
void (* destroy) (ClutterActor *self);
|
void (* destroy) (ClutterActor *self);
|
||||||
void (* pick) (ClutterActor *actor,
|
void (* pick) (ClutterActor *actor);
|
||||||
const ClutterColor *color);
|
|
||||||
|
|
||||||
gboolean (* queue_redraw) (ClutterActor *actor,
|
gboolean (* queue_redraw) (ClutterActor *actor,
|
||||||
ClutterActor *leaf_that_queued,
|
ClutterActor *leaf_that_queued,
|
||||||
@@ -354,6 +353,10 @@ void clutter_actor_paint
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_actor_continue_paint (ClutterActor *self);
|
void clutter_actor_continue_paint (ClutterActor *self);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
|
void clutter_actor_pick (ClutterActor *actor);
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
void clutter_actor_continue_pick (ClutterActor *actor);
|
||||||
|
CLUTTER_EXPORT
|
||||||
void clutter_actor_queue_redraw (ClutterActor *self);
|
void clutter_actor_queue_redraw (ClutterActor *self);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
void clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||||
@@ -431,7 +434,7 @@ void clutter_actor_get_allocation_box
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_actor_get_allocation_vertices (ClutterActor *self,
|
void clutter_actor_get_allocation_vertices (ClutterActor *self,
|
||||||
ClutterActor *ancestor,
|
ClutterActor *ancestor,
|
||||||
ClutterVertex verts[]);
|
graphene_point3d_t *verts);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_actor_has_allocation (ClutterActor *self);
|
gboolean clutter_actor_has_allocation (ClutterActor *self);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
@@ -817,16 +820,16 @@ gboolean clutter_actor_transform_stage_point
|
|||||||
gfloat *y_out);
|
gfloat *y_out);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_actor_get_abs_allocation_vertices (ClutterActor *self,
|
void clutter_actor_get_abs_allocation_vertices (ClutterActor *self,
|
||||||
ClutterVertex verts[]);
|
graphene_point3d_t *verts);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_actor_apply_transform_to_point (ClutterActor *self,
|
void clutter_actor_apply_transform_to_point (ClutterActor *self,
|
||||||
const ClutterVertex *point,
|
const graphene_point3d_t *point,
|
||||||
ClutterVertex *vertex);
|
graphene_point3d_t *vertex);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
|
void clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
|
||||||
ClutterActor *ancestor,
|
ClutterActor *ancestor,
|
||||||
const ClutterVertex *point,
|
const graphene_point3d_t *point,
|
||||||
ClutterVertex *vertex);
|
graphene_point3d_t *vertex);
|
||||||
|
|
||||||
/* Implicit animations */
|
/* Implicit animations */
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
|
@@ -93,10 +93,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterMatrix, clutter_matrix_free)
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintNode, clutter_paint_node_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintNode, clutter_paint_node_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintVolume, clutter_paint_volume_free)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintVolume, clutter_paint_volume_free)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPathNode, clutter_path_node_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__ */
|
#endif /* __GI_SCANNER__ */
|
||||||
|
|
||||||
|
@@ -627,7 +627,7 @@ clutter_backend_init (ClutterBackend *self)
|
|||||||
self->units_per_em = -1.0;
|
self->units_per_em = -1.0;
|
||||||
self->units_serial = 1;
|
self->units_serial = 1;
|
||||||
|
|
||||||
self->dummy_onscreen = COGL_INVALID_HANDLE;
|
self->dummy_onscreen = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1012,7 +1012,7 @@ _clutter_backend_get_keymap_direction (ClutterBackend *backend)
|
|||||||
void
|
void
|
||||||
_clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
|
_clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
|
||||||
{
|
{
|
||||||
if (backend->dummy_onscreen == COGL_INVALID_HANDLE)
|
if (backend->dummy_onscreen == NULL)
|
||||||
{
|
{
|
||||||
GError *internal_error = NULL;
|
GError *internal_error = NULL;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -152,7 +152,9 @@ clutter_bind_constraint_update_allocation (ClutterConstraint *constraint,
|
|||||||
ClutterBindConstraint *bind = CLUTTER_BIND_CONSTRAINT (constraint);
|
ClutterBindConstraint *bind = CLUTTER_BIND_CONSTRAINT (constraint);
|
||||||
gfloat source_width, source_height;
|
gfloat source_width, source_height;
|
||||||
gfloat actor_width, actor_height;
|
gfloat actor_width, actor_height;
|
||||||
ClutterVertex source_position = { 0., };
|
graphene_point3d_t source_position;
|
||||||
|
|
||||||
|
source_position = GRAPHENE_POINT3D_INIT (0.f, 0.f, 0.f);
|
||||||
|
|
||||||
if (bind->source == NULL)
|
if (bind->source == NULL)
|
||||||
return;
|
return;
|
||||||
|
@@ -182,7 +182,7 @@ clutter_blur_effect_modify_paint_volume (ClutterEffect *effect,
|
|||||||
ClutterPaintVolume *volume)
|
ClutterPaintVolume *volume)
|
||||||
{
|
{
|
||||||
gfloat cur_width, cur_height;
|
gfloat cur_width, cur_height;
|
||||||
ClutterVertex origin;
|
graphene_point3d_t origin;
|
||||||
|
|
||||||
clutter_paint_volume_get_origin (volume, &origin);
|
clutter_paint_volume_get_origin (volume, &origin);
|
||||||
cur_width = clutter_paint_volume_get_width (volume);
|
cur_width = clutter_paint_volume_get_width (volume);
|
||||||
|
@@ -118,37 +118,6 @@ container_real_remove (ClutterContainer *container,
|
|||||||
clutter_actor_remove_child (CLUTTER_ACTOR (container), actor);
|
clutter_actor_remove_child (CLUTTER_ACTOR (container), actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
ClutterCallback callback;
|
|
||||||
gpointer data;
|
|
||||||
} ForeachClosure;
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
foreach_cb (ClutterActor *actor,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
ForeachClosure *clos = data;
|
|
||||||
|
|
||||||
clos->callback (actor, clos->data);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
container_real_foreach (ClutterContainer *container,
|
|
||||||
ClutterCallback callback,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
ForeachClosure clos;
|
|
||||||
|
|
||||||
clos.callback = callback;
|
|
||||||
clos.data = user_data;
|
|
||||||
|
|
||||||
_clutter_actor_foreach_child (CLUTTER_ACTOR (container),
|
|
||||||
foreach_cb,
|
|
||||||
&clos);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
container_real_raise (ClutterContainer *container,
|
container_real_raise (ClutterContainer *container,
|
||||||
ClutterActor *child,
|
ClutterActor *child,
|
||||||
@@ -243,7 +212,6 @@ clutter_container_default_init (ClutterContainerInterface *iface)
|
|||||||
|
|
||||||
iface->add = container_real_add;
|
iface->add = container_real_add;
|
||||||
iface->remove = container_real_remove;
|
iface->remove = container_real_remove;
|
||||||
iface->foreach = container_real_foreach;
|
|
||||||
iface->raise = container_real_raise;
|
iface->raise = container_real_raise;
|
||||||
iface->lower = container_real_lower;
|
iface->lower = container_real_lower;
|
||||||
iface->sort_depth_order = container_real_sort_depth_order;
|
iface->sort_depth_order = container_real_sort_depth_order;
|
||||||
@@ -533,15 +501,6 @@ clutter_container_remove_valist (ClutterContainer *container,
|
|||||||
container_remove_valist (container, first_actor, var_args);
|
container_remove_valist (container, first_actor, var_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
get_children_cb (ClutterActor *child,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
GList **children = data;
|
|
||||||
|
|
||||||
*children = g_list_prepend (*children, child);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_container_get_children:
|
* clutter_container_get_children:
|
||||||
* @container: a #ClutterContainer
|
* @container: a #ClutterContainer
|
||||||
@@ -559,108 +518,9 @@ get_children_cb (ClutterActor *child,
|
|||||||
GList *
|
GList *
|
||||||
clutter_container_get_children (ClutterContainer *container)
|
clutter_container_get_children (ClutterContainer *container)
|
||||||
{
|
{
|
||||||
GList *retval;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_CONTAINER (container), NULL);
|
g_return_val_if_fail (CLUTTER_IS_CONTAINER (container), NULL);
|
||||||
|
|
||||||
retval = NULL;
|
return clutter_actor_get_children (CLUTTER_ACTOR (container));
|
||||||
clutter_container_foreach (container, get_children_cb, &retval);
|
|
||||||
|
|
||||||
return g_list_reverse (retval);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_container_foreach:
|
|
||||||
* @container: a #ClutterContainer
|
|
||||||
* @callback: (scope call): a function to be called for each child
|
|
||||||
* @user_data: data to be passed to the function, or %NULL
|
|
||||||
*
|
|
||||||
* Calls @callback for each child of @container that was added
|
|
||||||
* by the application (with clutter_container_add_actor()). Does
|
|
||||||
* not iterate over "internal" children that are part of the
|
|
||||||
* container's own implementation, if any.
|
|
||||||
*
|
|
||||||
* This function calls the #ClutterContainerIface.foreach()
|
|
||||||
* virtual function, which has been deprecated.
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.10: Use clutter_actor_get_first_child() or
|
|
||||||
* clutter_actor_get_last_child() to retrieve the beginning of
|
|
||||||
* the list of children, and clutter_actor_get_next_sibling()
|
|
||||||
* and clutter_actor_get_previous_sibling() to iterate over it;
|
|
||||||
* alternatively, use the #ClutterActorIter API.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_container_foreach (ClutterContainer *container,
|
|
||||||
ClutterCallback callback,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
|
|
||||||
g_return_if_fail (callback != NULL);
|
|
||||||
|
|
||||||
#ifdef CLUTTER_ENABLE_DEBUG
|
|
||||||
if (G_UNLIKELY (_clutter_diagnostic_enabled ()))
|
|
||||||
{
|
|
||||||
ClutterContainerIface *iface = CLUTTER_CONTAINER_GET_IFACE (container);
|
|
||||||
|
|
||||||
if (iface->foreach != container_real_foreach)
|
|
||||||
_clutter_diagnostic_message ("The ClutterContainer::foreach() "
|
|
||||||
"virtual function has been deprecated "
|
|
||||||
"and it should not be overridden by "
|
|
||||||
"newly written code");
|
|
||||||
}
|
|
||||||
#endif /* CLUTTER_ENABLE_DEBUG */
|
|
||||||
|
|
||||||
CLUTTER_CONTAINER_GET_IFACE (container)->foreach (container,
|
|
||||||
callback,
|
|
||||||
user_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_container_foreach_with_internals:
|
|
||||||
* @container: a #ClutterContainer
|
|
||||||
* @callback: (scope call): a function to be called for each child
|
|
||||||
* @user_data: data to be passed to the function, or %NULL
|
|
||||||
*
|
|
||||||
* Calls @callback for each child of @container, including "internal"
|
|
||||||
* children built in to the container itself that were never added
|
|
||||||
* by the application.
|
|
||||||
*
|
|
||||||
* This function calls the #ClutterContainerIface.foreach_with_internals()
|
|
||||||
* virtual function, which has been deprecated.
|
|
||||||
*
|
|
||||||
* Since: 1.0
|
|
||||||
*
|
|
||||||
* Deprecated: 1.10: See clutter_container_foreach().
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_container_foreach_with_internals (ClutterContainer *container,
|
|
||||||
ClutterCallback callback,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
ClutterContainerIface *iface;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
|
|
||||||
g_return_if_fail (callback != NULL);
|
|
||||||
|
|
||||||
iface = CLUTTER_CONTAINER_GET_IFACE (container);
|
|
||||||
|
|
||||||
#ifdef CLUTTER_ENABLE_DEBUG
|
|
||||||
if (G_UNLIKELY (_clutter_diagnostic_enabled ()))
|
|
||||||
{
|
|
||||||
if (iface->foreach_with_internals != NULL)
|
|
||||||
_clutter_diagnostic_message ("The ClutterContainer::foreach_with_internals() "
|
|
||||||
"virtual function has been deprecated "
|
|
||||||
"and it should not be overridden by "
|
|
||||||
"newly written code");
|
|
||||||
}
|
|
||||||
#endif /* CLUTTER_ENABLE_DEBUG */
|
|
||||||
|
|
||||||
if (iface->foreach_with_internals != NULL)
|
|
||||||
iface->foreach_with_internals (container, callback, user_data);
|
|
||||||
else
|
|
||||||
iface->foreach (container, callback, user_data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -59,14 +59,6 @@ typedef struct _ClutterContainerIface ClutterContainerIface;
|
|||||||
* function is deprecated, and it should not be overridden.
|
* function is deprecated, and it should not be overridden.
|
||||||
* @remove: virtual function for removing an actor from the container. This
|
* @remove: virtual function for removing an actor from the container. This
|
||||||
* virtual function is deprecated, and it should not be overridden.
|
* virtual function is deprecated, and it should not be overridden.
|
||||||
* @foreach: virtual function for iterating over the container's children.
|
|
||||||
* This virtual function is deprecated, and it should not be overridden.
|
|
||||||
* @foreach_with_internals: virtual functions for iterating over the
|
|
||||||
* container's children, both added using the #ClutterContainer API
|
|
||||||
* and internal children. The implementation of this virtual function
|
|
||||||
* is required only if the #ClutterContainer implementation has
|
|
||||||
* internal children. This virtual function is deprecated, and it should
|
|
||||||
* not be overridden.
|
|
||||||
* @raise: virtual function for raising a child. This virtual function is
|
* @raise: virtual function for raising a child. This virtual function is
|
||||||
* deprecated and it should not be overridden.
|
* deprecated and it should not be overridden.
|
||||||
* @lower: virtual function for lowering a child. This virtual function is
|
* @lower: virtual function for lowering a child. This virtual function is
|
||||||
@@ -88,7 +80,7 @@ typedef struct _ClutterContainerIface ClutterContainerIface;
|
|||||||
* @actor_removed: class handler for #ClutterContainer::actor-removed
|
* @actor_removed: class handler for #ClutterContainer::actor-removed
|
||||||
* @child_notify: class handler for #ClutterContainer::child-notify
|
* @child_notify: class handler for #ClutterContainer::child-notify
|
||||||
*
|
*
|
||||||
* Base interface for container actors. The @add, @remove and @foreach
|
* Base interface for container actors. The @add and @remove
|
||||||
* virtual functions must be provided by any implementation; the other
|
* virtual functions must be provided by any implementation; the other
|
||||||
* virtual functions are optional.
|
* virtual functions are optional.
|
||||||
*
|
*
|
||||||
@@ -104,13 +96,6 @@ struct _ClutterContainerIface
|
|||||||
ClutterActor *actor);
|
ClutterActor *actor);
|
||||||
void (* remove) (ClutterContainer *container,
|
void (* remove) (ClutterContainer *container,
|
||||||
ClutterActor *actor);
|
ClutterActor *actor);
|
||||||
void (* foreach) (ClutterContainer *container,
|
|
||||||
ClutterCallback callback,
|
|
||||||
gpointer user_data);
|
|
||||||
|
|
||||||
void (* foreach_with_internals) (ClutterContainer *container,
|
|
||||||
ClutterCallback callback,
|
|
||||||
gpointer user_data);
|
|
||||||
|
|
||||||
/* child stacking */
|
/* child stacking */
|
||||||
void (* raise) (ClutterContainer *container,
|
void (* raise) (ClutterContainer *container,
|
||||||
|
@@ -6,45 +6,6 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
CLUTTER_DEBUG_MISC = 1 << 0,
|
|
||||||
CLUTTER_DEBUG_ACTOR = 1 << 1,
|
|
||||||
CLUTTER_DEBUG_TEXTURE = 1 << 2,
|
|
||||||
CLUTTER_DEBUG_EVENT = 1 << 3,
|
|
||||||
CLUTTER_DEBUG_PAINT = 1 << 4,
|
|
||||||
CLUTTER_DEBUG_PANGO = 1 << 5,
|
|
||||||
CLUTTER_DEBUG_BACKEND = 1 << 6,
|
|
||||||
CLUTTER_DEBUG_SCHEDULER = 1 << 7,
|
|
||||||
CLUTTER_DEBUG_SCRIPT = 1 << 8,
|
|
||||||
CLUTTER_DEBUG_SHADER = 1 << 9,
|
|
||||||
CLUTTER_DEBUG_MULTISTAGE = 1 << 10,
|
|
||||||
CLUTTER_DEBUG_ANIMATION = 1 << 11,
|
|
||||||
CLUTTER_DEBUG_LAYOUT = 1 << 12,
|
|
||||||
CLUTTER_DEBUG_PICK = 1 << 13,
|
|
||||||
CLUTTER_DEBUG_EVENTLOOP = 1 << 14,
|
|
||||||
CLUTTER_DEBUG_CLIPPING = 1 << 15,
|
|
||||||
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 16
|
|
||||||
} ClutterDebugFlag;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
CLUTTER_DEBUG_NOP_PICKING = 1 << 0,
|
|
||||||
} ClutterPickDebugFlag;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
CLUTTER_DEBUG_DISABLE_SWAP_EVENTS = 1 << 0,
|
|
||||||
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS = 1 << 1,
|
|
||||||
CLUTTER_DEBUG_REDRAWS = 1 << 2,
|
|
||||||
CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3,
|
|
||||||
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
|
|
||||||
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
|
|
||||||
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
|
|
||||||
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7,
|
|
||||||
CLUTTER_DEBUG_PAINT_DAMAGE_REGION = 1 << 8,
|
|
||||||
} ClutterDrawDebugFlag;
|
|
||||||
|
|
||||||
#ifdef CLUTTER_ENABLE_DEBUG
|
#ifdef CLUTTER_ENABLE_DEBUG
|
||||||
|
|
||||||
#define CLUTTER_HAS_DEBUG(type) ((clutter_debug_flags & CLUTTER_DEBUG_##type) != FALSE)
|
#define CLUTTER_HAS_DEBUG(type) ((clutter_debug_flags & CLUTTER_DEBUG_##type) != FALSE)
|
||||||
|
@@ -177,7 +177,7 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
|
|||||||
|
|
||||||
if (priv->is_dirty)
|
if (priv->is_dirty)
|
||||||
{
|
{
|
||||||
ClutterRect rect;
|
graphene_rect_t rect;
|
||||||
gboolean mapped_buffer;
|
gboolean mapped_buffer;
|
||||||
CoglVertexP3T2C4 *verts;
|
CoglVertexP3T2C4 *verts;
|
||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
@@ -193,8 +193,8 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
|
|||||||
*/
|
*/
|
||||||
if (clutter_offscreen_effect_get_target_rect (effect, &rect))
|
if (clutter_offscreen_effect_get_target_rect (effect, &rect))
|
||||||
{
|
{
|
||||||
width = clutter_rect_get_width (&rect);
|
width = graphene_rect_get_width (&rect);
|
||||||
height = clutter_rect_get_height (&rect);
|
height = graphene_rect_get_height (&rect);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
clutter_actor_get_size (actor, &width, &height);
|
clutter_actor_get_size (actor, &width, &height);
|
||||||
|
@@ -7,10 +7,6 @@
|
|||||||
#include "deprecated/clutter-alpha.h"
|
#include "deprecated/clutter-alpha.h"
|
||||||
#include "deprecated/clutter-animatable.h"
|
#include "deprecated/clutter-animatable.h"
|
||||||
#include "deprecated/clutter-animation.h"
|
#include "deprecated/clutter-animation.h"
|
||||||
#include "deprecated/clutter-behaviour.h"
|
|
||||||
#include "deprecated/clutter-behaviour-depth.h"
|
|
||||||
#include "deprecated/clutter-behaviour-opacity.h"
|
|
||||||
#include "deprecated/clutter-behaviour-scale.h"
|
|
||||||
#include "deprecated/clutter-bin-layout.h"
|
#include "deprecated/clutter-bin-layout.h"
|
||||||
#include "deprecated/clutter-box.h"
|
#include "deprecated/clutter-box.h"
|
||||||
#include "deprecated/clutter-cairo-texture.h"
|
#include "deprecated/clutter-cairo-texture.h"
|
||||||
|
@@ -81,7 +81,7 @@ struct _ClutterDragActionPrivate
|
|||||||
gint y_drag_threshold;
|
gint y_drag_threshold;
|
||||||
ClutterActor *drag_handle;
|
ClutterActor *drag_handle;
|
||||||
ClutterDragAxis drag_axis;
|
ClutterDragAxis drag_axis;
|
||||||
ClutterRect drag_area;
|
graphene_rect_t drag_area;
|
||||||
|
|
||||||
ClutterInputDevice *device;
|
ClutterInputDevice *device;
|
||||||
ClutterEventSequence *sequence;
|
ClutterEventSequence *sequence;
|
||||||
@@ -542,7 +542,7 @@ clutter_drag_action_real_drag_motion (ClutterDragAction *action,
|
|||||||
|
|
||||||
if (action->priv->drag_area_set)
|
if (action->priv->drag_area_set)
|
||||||
{
|
{
|
||||||
ClutterRect *drag_area = &action->priv->drag_area;
|
graphene_rect_t *drag_area = &action->priv->drag_area;
|
||||||
|
|
||||||
x = CLAMP (x, drag_area->origin.x, drag_area->origin.x + drag_area->size.width);
|
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);
|
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",
|
g_param_spec_boxed ("drag-area",
|
||||||
P_("Drag Area"),
|
P_("Drag Area"),
|
||||||
P_("Constrains the dragging to a rectangle"),
|
P_("Constrains the dragging to a rectangle"),
|
||||||
CLUTTER_TYPE_RECT,
|
GRAPHENE_TYPE_RECT,
|
||||||
CLUTTER_PARAM_READWRITE);
|
CLUTTER_PARAM_READWRITE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1267,10 +1267,10 @@ clutter_drag_action_get_motion_coords (ClutterDragAction *action,
|
|||||||
/**
|
/**
|
||||||
* clutter_drag_action_get_drag_area:
|
* clutter_drag_action_get_drag_area:
|
||||||
* @action: a #ClutterDragAction
|
* @action: a #ClutterDragAction
|
||||||
* @drag_area: (out caller-allocates): a #ClutterRect to be filled
|
* @drag_area: (out caller-allocates): a #graphene_rect_t to be filled
|
||||||
*
|
*
|
||||||
* Retrieves the "drag area" associated with @action, that
|
* Retrieves the "drag area" associated with @action, that
|
||||||
* is a #ClutterRect that constrains the actor movements,
|
* is a #graphene_rect_t that constrains the actor movements,
|
||||||
* in parents coordinates.
|
* in parents coordinates.
|
||||||
*
|
*
|
||||||
* Returns: %TRUE if the actor is actually constrained (and thus
|
* Returns: %TRUE if the actor is actually constrained (and thus
|
||||||
@@ -1278,7 +1278,7 @@ clutter_drag_action_get_motion_coords (ClutterDragAction *action,
|
|||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
clutter_drag_action_get_drag_area (ClutterDragAction *action,
|
clutter_drag_action_get_drag_area (ClutterDragAction *action,
|
||||||
ClutterRect *drag_area)
|
graphene_rect_t *drag_area)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (CLUTTER_IS_DRAG_ACTION (action), FALSE);
|
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.
|
* If @drag_area is %NULL, the actor is not constrained.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||||
const ClutterRect *drag_area)
|
const graphene_rect_t *drag_area)
|
||||||
{
|
{
|
||||||
ClutterDragActionPrivate *priv;
|
ClutterDragActionPrivate *priv;
|
||||||
|
|
||||||
|
@@ -141,11 +141,11 @@ void clutter_drag_action_get_motion_coords (ClutterDragAction *actio
|
|||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_drag_action_get_drag_area (ClutterDragAction *action,
|
gboolean clutter_drag_action_get_drag_area (ClutterDragAction *action,
|
||||||
ClutterRect *drag_area);
|
graphene_rect_t *drag_area);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
void clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||||
const ClutterRect *drag_area);
|
const graphene_rect_t *drag_area);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@@ -12,8 +12,7 @@ gboolean _clutter_effect_modify_paint_volume (ClutterEffect
|
|||||||
gboolean _clutter_effect_has_custom_paint_volume (ClutterEffect *effect);
|
gboolean _clutter_effect_has_custom_paint_volume (ClutterEffect *effect);
|
||||||
void _clutter_effect_paint (ClutterEffect *effect,
|
void _clutter_effect_paint (ClutterEffect *effect,
|
||||||
ClutterEffectPaintFlags flags);
|
ClutterEffectPaintFlags flags);
|
||||||
void _clutter_effect_pick (ClutterEffect *effect,
|
void _clutter_effect_pick (ClutterEffect *effect);
|
||||||
ClutterEffectPaintFlags flags);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@@ -100,13 +100,13 @@
|
|||||||
* // Clear the previous state //
|
* // Clear the previous state //
|
||||||
* if (self->rect_1)
|
* if (self->rect_1)
|
||||||
* {
|
* {
|
||||||
* cogl_handle_unref (self->rect_1);
|
* cogl_object_unref (self->rect_1);
|
||||||
* self->rect_1 = NULL;
|
* self->rect_1 = NULL;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* if (self->rect_2)
|
* if (self->rect_2)
|
||||||
* {
|
* {
|
||||||
* cogl_handle_unref (self->rect_2);
|
* cogl_object_unref (self->rect_2);
|
||||||
* self->rect_2 = NULL;
|
* self->rect_2 = NULL;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
@@ -216,14 +216,13 @@ clutter_effect_real_paint (ClutterEffect *effect,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_effect_real_pick (ClutterEffect *effect,
|
clutter_effect_real_pick (ClutterEffect *effect)
|
||||||
ClutterEffectPaintFlags flags)
|
|
||||||
{
|
{
|
||||||
ClutterActorMeta *actor_meta = CLUTTER_ACTOR_META (effect);
|
ClutterActorMeta *actor_meta = CLUTTER_ACTOR_META (effect);
|
||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
|
|
||||||
actor = clutter_actor_meta_get_actor (actor_meta);
|
actor = clutter_actor_meta_get_actor (actor_meta);
|
||||||
clutter_actor_continue_paint (actor);
|
clutter_actor_continue_pick (actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -288,12 +287,11 @@ _clutter_effect_paint (ClutterEffect *effect,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_clutter_effect_pick (ClutterEffect *effect,
|
_clutter_effect_pick (ClutterEffect *effect)
|
||||||
ClutterEffectPaintFlags flags)
|
|
||||||
{
|
{
|
||||||
g_return_if_fail (CLUTTER_IS_EFFECT (effect));
|
g_return_if_fail (CLUTTER_IS_EFFECT (effect));
|
||||||
|
|
||||||
CLUTTER_EFFECT_GET_CLASS (effect)->pick (effect, flags);
|
CLUTTER_EFFECT_GET_CLASS (effect)->pick (effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@@ -82,8 +82,7 @@ struct _ClutterEffectClass
|
|||||||
|
|
||||||
void (* paint) (ClutterEffect *effect,
|
void (* paint) (ClutterEffect *effect,
|
||||||
ClutterEffectPaintFlags flags);
|
ClutterEffectPaintFlags flags);
|
||||||
void (* pick) (ClutterEffect *effect,
|
void (* pick) (ClutterEffect *effect);
|
||||||
ClutterEffectPaintFlags flags);
|
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
void (* _clutter_effect4) (void);
|
void (* _clutter_effect4) (void);
|
||||||
|
@@ -970,8 +970,6 @@ typedef enum
|
|||||||
/**
|
/**
|
||||||
* ClutterFeatureFlags:
|
* ClutterFeatureFlags:
|
||||||
* @CLUTTER_FEATURE_SWAP_THROTTLE: Set if backend throttles buffer swaps.
|
* @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_STATIC: Set if stage size if fixed (i.e framebuffer)
|
||||||
* @CLUTTER_FEATURE_STAGE_CURSOR: Set if stage has a graphical cursor.
|
* @CLUTTER_FEATURE_STAGE_CURSOR: Set if stage has a graphical cursor.
|
||||||
* @CLUTTER_FEATURE_SHADERS_GLSL: Set if the backend supports GLSL shaders.
|
* @CLUTTER_FEATURE_SHADERS_GLSL: Set if the backend supports GLSL shaders.
|
||||||
@@ -987,8 +985,6 @@ typedef enum
|
|||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
CLUTTER_FEATURE_SWAP_THROTTLE = (1 << 3),
|
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_STATIC = (1 << 6),
|
||||||
CLUTTER_FEATURE_STAGE_CURSOR = (1 << 8),
|
CLUTTER_FEATURE_STAGE_CURSOR = (1 << 8),
|
||||||
CLUTTER_FEATURE_SHADERS_GLSL = (1 << 9),
|
CLUTTER_FEATURE_SHADERS_GLSL = (1 << 9),
|
||||||
@@ -1217,8 +1213,7 @@ typedef enum
|
|||||||
* @CLUTTER_TEXTURE_RGB_FLAG_PREMULT: Unused flag
|
* @CLUTTER_TEXTURE_RGB_FLAG_PREMULT: Unused flag
|
||||||
* @CLUTTER_TEXTURE_YUV_FLAG_YUV2: Unused flag
|
* @CLUTTER_TEXTURE_YUV_FLAG_YUV2: Unused flag
|
||||||
*
|
*
|
||||||
* Flags for clutter_texture_set_from_rgb_data() and
|
* Flags for clutter_texture_set_from_rgb_data().
|
||||||
* clutter_texture_set_from_yuv_data().
|
|
||||||
*
|
*
|
||||||
* Since: 0.4
|
* Since: 0.4
|
||||||
*
|
*
|
||||||
|
@@ -370,7 +370,7 @@ clutter_event_get_coords (const ClutterEvent *event,
|
|||||||
gfloat *x,
|
gfloat *x,
|
||||||
gfloat *y)
|
gfloat *y)
|
||||||
{
|
{
|
||||||
ClutterPoint coords;
|
graphene_point_t coords;
|
||||||
|
|
||||||
g_return_if_fail (event != NULL);
|
g_return_if_fail (event != NULL);
|
||||||
|
|
||||||
@@ -386,15 +386,15 @@ clutter_event_get_coords (const ClutterEvent *event,
|
|||||||
/**
|
/**
|
||||||
* clutter_event_get_position:
|
* clutter_event_get_position:
|
||||||
* @event: a #ClutterEvent
|
* @event: a #ClutterEvent
|
||||||
* @position: a #ClutterPoint
|
* @position: a #graphene_point_t
|
||||||
*
|
*
|
||||||
* Retrieves the event coordinates as a #ClutterPoint.
|
* Retrieves the event coordinates as a #graphene_point_t.
|
||||||
*
|
*
|
||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_event_get_position (const ClutterEvent *event,
|
clutter_event_get_position (const ClutterEvent *event,
|
||||||
ClutterPoint *position)
|
graphene_point_t *position)
|
||||||
{
|
{
|
||||||
g_return_if_fail (event != NULL);
|
g_return_if_fail (event != NULL);
|
||||||
g_return_if_fail (position != 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_BUTTON_RELEASE:
|
||||||
case CLUTTER_PAD_STRIP:
|
case CLUTTER_PAD_STRIP:
|
||||||
case CLUTTER_PAD_RING:
|
case CLUTTER_PAD_RING:
|
||||||
clutter_point_init (position, 0.f, 0.f);
|
graphene_point_init (position, 0.f, 0.f);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLUTTER_ENTER:
|
case CLUTTER_ENTER:
|
||||||
case CLUTTER_LEAVE:
|
case CLUTTER_LEAVE:
|
||||||
clutter_point_init (position, event->crossing.x, event->crossing.y);
|
graphene_point_init (position, event->crossing.x, event->crossing.y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLUTTER_BUTTON_PRESS:
|
case CLUTTER_BUTTON_PRESS:
|
||||||
case CLUTTER_BUTTON_RELEASE:
|
case CLUTTER_BUTTON_RELEASE:
|
||||||
clutter_point_init (position, event->button.x, event->button.y);
|
graphene_point_init (position, event->button.x, event->button.y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLUTTER_MOTION:
|
case CLUTTER_MOTION:
|
||||||
clutter_point_init (position, event->motion.x, event->motion.y);
|
graphene_point_init (position, event->motion.x, event->motion.y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLUTTER_TOUCH_BEGIN:
|
case CLUTTER_TOUCH_BEGIN:
|
||||||
case CLUTTER_TOUCH_UPDATE:
|
case CLUTTER_TOUCH_UPDATE:
|
||||||
case CLUTTER_TOUCH_END:
|
case CLUTTER_TOUCH_END:
|
||||||
case CLUTTER_TOUCH_CANCEL:
|
case CLUTTER_TOUCH_CANCEL:
|
||||||
clutter_point_init (position, event->touch.x, event->touch.y);
|
graphene_point_init (position, event->touch.x, event->touch.y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLUTTER_SCROLL:
|
case CLUTTER_SCROLL:
|
||||||
clutter_point_init (position, event->scroll.x, event->scroll.y);
|
graphene_point_init (position, event->scroll.x, event->scroll.y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLUTTER_TOUCHPAD_PINCH:
|
case CLUTTER_TOUCHPAD_PINCH:
|
||||||
clutter_point_init (position, event->touchpad_pinch.x,
|
graphene_point_init (position, event->touchpad_pinch.x,
|
||||||
event->touchpad_pinch.y);
|
event->touchpad_pinch.y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLUTTER_TOUCHPAD_SWIPE:
|
case CLUTTER_TOUCHPAD_SWIPE:
|
||||||
clutter_point_init (position, event->touchpad_swipe.x,
|
graphene_point_init (position, event->touchpad_swipe.x,
|
||||||
event->touchpad_swipe.y);
|
event->touchpad_swipe.y);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1796,12 +1796,12 @@ float
|
|||||||
clutter_event_get_distance (const ClutterEvent *source,
|
clutter_event_get_distance (const ClutterEvent *source,
|
||||||
const ClutterEvent *target)
|
const ClutterEvent *target)
|
||||||
{
|
{
|
||||||
ClutterPoint p0, p1;
|
graphene_point_t p0, p1;
|
||||||
|
|
||||||
clutter_event_get_position (source, &p0);
|
clutter_event_get_position (source, &p0);
|
||||||
clutter_event_get_position (source, &p1);
|
clutter_event_get_position (source, &p1);
|
||||||
|
|
||||||
return clutter_point_distance (&p0, &p1, NULL, NULL);
|
return graphene_point_distance (&p0, &p1, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1822,17 +1822,17 @@ double
|
|||||||
clutter_event_get_angle (const ClutterEvent *source,
|
clutter_event_get_angle (const ClutterEvent *source,
|
||||||
const ClutterEvent *target)
|
const ClutterEvent *target)
|
||||||
{
|
{
|
||||||
ClutterPoint p0, p1;
|
graphene_point_t p0, p1;
|
||||||
float x_distance, y_distance;
|
float x_distance, y_distance;
|
||||||
double angle;
|
double angle;
|
||||||
|
|
||||||
clutter_event_get_position (source, &p0);
|
clutter_event_get_position (source, &p0);
|
||||||
clutter_event_get_position (target, &p1);
|
clutter_event_get_position (target, &p1);
|
||||||
|
|
||||||
if (clutter_point_equals (&p0, &p1))
|
if (graphene_point_equal (&p0, &p1))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
clutter_point_distance (&p0, &p1, &x_distance, &y_distance);
|
graphene_point_distance (&p0, &p1, &x_distance, &y_distance);
|
||||||
|
|
||||||
angle = atan2 (x_distance, y_distance);
|
angle = atan2 (x_distance, y_distance);
|
||||||
|
|
||||||
@@ -2161,9 +2161,9 @@ clutter_event_get_scroll_source (const ClutterEvent *event)
|
|||||||
ClutterScrollFinishFlags
|
ClutterScrollFinishFlags
|
||||||
clutter_event_get_scroll_finish_flags (const ClutterEvent *event)
|
clutter_event_get_scroll_finish_flags (const ClutterEvent *event)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (event != NULL, CLUTTER_SCROLL_SOURCE_UNKNOWN);
|
g_return_val_if_fail (event != NULL, CLUTTER_SCROLL_FINISHED_NONE);
|
||||||
g_return_val_if_fail (event->type == CLUTTER_SCROLL,
|
g_return_val_if_fail (event->type == CLUTTER_SCROLL,
|
||||||
CLUTTER_SCROLL_SOURCE_UNKNOWN);
|
CLUTTER_SCROLL_FINISHED_NONE);
|
||||||
|
|
||||||
return event->scroll.finish_flags;
|
return event->scroll.finish_flags;
|
||||||
}
|
}
|
||||||
|
@@ -686,7 +686,7 @@ void clutter_event_get_coords (const ClutterEv
|
|||||||
gfloat *y);
|
gfloat *y);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_event_get_position (const ClutterEvent *event,
|
void clutter_event_get_position (const ClutterEvent *event,
|
||||||
ClutterPoint *position);
|
graphene_point_t *position);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
float clutter_event_get_distance (const ClutterEvent *source,
|
float clutter_event_get_distance (const ClutterEvent *source,
|
||||||
const ClutterEvent *target);
|
const ClutterEvent *target);
|
||||||
|
@@ -33,8 +33,6 @@
|
|||||||
*
|
*
|
||||||
* It is possible to ask whether Clutter has support for specific features at
|
* It is possible to ask whether Clutter has support for specific features at
|
||||||
* run-time.
|
* run-time.
|
||||||
*
|
|
||||||
* See also cogl_get_features() and #CoglFeatureFlags
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "clutter-build-config.h"
|
#include "clutter-build-config.h"
|
||||||
@@ -60,20 +58,13 @@ typedef struct ClutterFeatures
|
|||||||
static ClutterFeatures* __features = NULL;
|
static ClutterFeatures* __features = NULL;
|
||||||
|
|
||||||
static ClutterFeatureFlags
|
static ClutterFeatureFlags
|
||||||
clutter_features_from_cogl (guint cogl_flags)
|
clutter_features_from_cogl (void)
|
||||||
{
|
{
|
||||||
ClutterFeatureFlags clutter_flags = 0;
|
ClutterFeatureFlags clutter_flags = 0;
|
||||||
|
|
||||||
if (cogl_flags & COGL_FEATURE_TEXTURE_YUV)
|
|
||||||
clutter_flags |= CLUTTER_FEATURE_TEXTURE_YUV;
|
|
||||||
|
|
||||||
if (cogl_flags & COGL_FEATURE_TEXTURE_READ_PIXELS)
|
|
||||||
clutter_flags |= CLUTTER_FEATURE_TEXTURE_READ_PIXELS;
|
|
||||||
|
|
||||||
clutter_flags |= CLUTTER_FEATURE_SHADERS_GLSL;
|
clutter_flags |= CLUTTER_FEATURE_SHADERS_GLSL;
|
||||||
|
|
||||||
if (cogl_flags & COGL_FEATURE_OFFSCREEN)
|
clutter_flags |= CLUTTER_FEATURE_OFFSCREEN;
|
||||||
clutter_flags |= CLUTTER_FEATURE_OFFSCREEN;
|
|
||||||
|
|
||||||
return clutter_flags;
|
return clutter_flags;
|
||||||
}
|
}
|
||||||
@@ -101,7 +92,7 @@ _clutter_feature_init (GError **error)
|
|||||||
if (!_clutter_backend_create_context (context->backend, error))
|
if (!_clutter_backend_create_context (context->backend, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
__features->flags = (clutter_features_from_cogl (cogl_get_features ())
|
__features->flags = (clutter_features_from_cogl ()
|
||||||
| _clutter_backend_get_features (context->backend));
|
| _clutter_backend_get_features (context->backend));
|
||||||
|
|
||||||
__features->features_set = TRUE;
|
__features->features_set = TRUE;
|
||||||
|
111
clutter/clutter/clutter-graphene.c
Normal file
111
clutter/clutter/clutter-graphene.c
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
/*
|
||||||
|
* Clutter.
|
||||||
|
*
|
||||||
|
* An OpenGL based 'interactive canvas' library.
|
||||||
|
*
|
||||||
|
* Authored By Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
|
||||||
|
*
|
||||||
|
* Copyright (C) 2019 Endless, Inc
|
||||||
|
* Copyright (C) 2009, 2010 Intel Corp
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "clutter-build-config.h"
|
||||||
|
|
||||||
|
#include "clutter-graphene.h"
|
||||||
|
|
||||||
|
#include "clutter-private.h"
|
||||||
|
#include "clutter-types.h"
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
graphene_point_progress (const GValue *a,
|
||||||
|
const GValue *b,
|
||||||
|
double progress,
|
||||||
|
GValue *retval)
|
||||||
|
{
|
||||||
|
const graphene_point_t *ap = g_value_get_boxed (a);
|
||||||
|
const graphene_point_t *bp = g_value_get_boxed (b);
|
||||||
|
graphene_point_t res;
|
||||||
|
|
||||||
|
graphene_point_interpolate (ap, bp, progress, &res);
|
||||||
|
|
||||||
|
g_value_set_boxed (retval, &res);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
graphene_point3d_progress (const GValue *a,
|
||||||
|
const GValue *b,
|
||||||
|
double progress,
|
||||||
|
GValue *retval)
|
||||||
|
{
|
||||||
|
const graphene_point3d_t *av = g_value_get_boxed (a);
|
||||||
|
const graphene_point3d_t *bv = g_value_get_boxed (b);
|
||||||
|
graphene_point3d_t res;
|
||||||
|
|
||||||
|
graphene_point3d_interpolate (av, bv, progress, &res);
|
||||||
|
|
||||||
|
g_value_set_boxed (retval, &res);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
graphene_rect_progress (const GValue *a,
|
||||||
|
const GValue *b,
|
||||||
|
double progress,
|
||||||
|
GValue *retval)
|
||||||
|
{
|
||||||
|
const graphene_rect_t *rect_a = g_value_get_boxed (a);
|
||||||
|
const graphene_rect_t *rect_b = g_value_get_boxed (b);
|
||||||
|
graphene_rect_t res;
|
||||||
|
|
||||||
|
graphene_rect_interpolate (rect_a, rect_b, progress, &res);
|
||||||
|
|
||||||
|
g_value_set_boxed (retval, &res);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
graphene_size_progress (const GValue *a,
|
||||||
|
const GValue *b,
|
||||||
|
double progress,
|
||||||
|
GValue *retval)
|
||||||
|
{
|
||||||
|
const graphene_size_t *as = g_value_get_boxed (a);
|
||||||
|
const graphene_size_t *bs = g_value_get_boxed (b);
|
||||||
|
graphene_size_t res;
|
||||||
|
|
||||||
|
graphene_size_interpolate (as, bs, progress, &res);
|
||||||
|
|
||||||
|
g_value_set_boxed (retval, &res);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
clutter_graphene_init (void)
|
||||||
|
{
|
||||||
|
clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT,
|
||||||
|
graphene_point_progress);
|
||||||
|
clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT3D,
|
||||||
|
graphene_point3d_progress);
|
||||||
|
clutter_interval_register_progress_func (GRAPHENE_TYPE_RECT,
|
||||||
|
graphene_rect_progress);
|
||||||
|
clutter_interval_register_progress_func (GRAPHENE_TYPE_SIZE,
|
||||||
|
graphene_size_progress);
|
||||||
|
}
|
30
clutter/clutter/clutter-graphene.h
Normal file
30
clutter/clutter/clutter-graphene.h
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Clutter.
|
||||||
|
*
|
||||||
|
* An OpenGL based 'interactive canvas' library.
|
||||||
|
*
|
||||||
|
* Authored By Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
|
||||||
|
*
|
||||||
|
* Copyright (C) 2019 Endless, Inc
|
||||||
|
* Copyright (C) 2009, 2010 Intel Corp
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CLUTTER_GRAPHENE_H
|
||||||
|
#define CLUTTER_GRAPHENE_H
|
||||||
|
|
||||||
|
void clutter_graphene_init (void);
|
||||||
|
|
||||||
|
#endif
|
@@ -991,7 +991,7 @@ clutter_input_device_get_enabled (ClutterInputDevice *device)
|
|||||||
gboolean
|
gboolean
|
||||||
clutter_input_device_get_coords (ClutterInputDevice *device,
|
clutter_input_device_get_coords (ClutterInputDevice *device,
|
||||||
ClutterEventSequence *sequence,
|
ClutterEventSequence *sequence,
|
||||||
ClutterPoint *point)
|
graphene_point_t *point)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
||||||
g_return_val_if_fail (point != NULL, FALSE);
|
g_return_val_if_fail (point != NULL, FALSE);
|
||||||
@@ -1038,7 +1038,7 @@ _clutter_input_device_update (ClutterInputDevice *device,
|
|||||||
ClutterStage *stage;
|
ClutterStage *stage;
|
||||||
ClutterActor *new_cursor_actor;
|
ClutterActor *new_cursor_actor;
|
||||||
ClutterActor *old_cursor_actor;
|
ClutterActor *old_cursor_actor;
|
||||||
ClutterPoint point = { -1, -1 };
|
graphene_point_t point = GRAPHENE_POINT_INIT (-1.0f, -1.0f);
|
||||||
ClutterInputDeviceType device_type = device->device_type;
|
ClutterInputDeviceType device_type = device->device_type;
|
||||||
|
|
||||||
g_assert (device_type != CLUTTER_KEYBOARD_DEVICE &&
|
g_assert (device_type != CLUTTER_KEYBOARD_DEVICE &&
|
||||||
|
@@ -58,7 +58,7 @@ gint clutter_input_device_get_device_id (ClutterInputDev
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_input_device_get_coords (ClutterInputDevice *device,
|
gboolean clutter_input_device_get_coords (ClutterInputDevice *device,
|
||||||
ClutterEventSequence *sequence,
|
ClutterEventSequence *sequence,
|
||||||
ClutterPoint *point);
|
graphene_point_t *point);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
ClutterModifierType clutter_input_device_get_modifier_state (ClutterInputDevice *device);
|
ClutterModifierType clutter_input_device_get_modifier_state (ClutterInputDevice *device);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
|
@@ -89,8 +89,8 @@ clutter_input_focus_reset (ClutterInputFocus *focus)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||||
const ClutterRect *rect)
|
const graphene_rect_t *rect)
|
||||||
{
|
{
|
||||||
ClutterInputFocusPrivate *priv;
|
ClutterInputFocusPrivate *priv;
|
||||||
|
|
||||||
|
@@ -57,8 +57,8 @@ gboolean clutter_input_focus_is_focused (ClutterInputFocus *focus);
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_input_focus_reset (ClutterInputFocus *focus);
|
void clutter_input_focus_reset (ClutterInputFocus *focus);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
void clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||||
const ClutterRect *rect);
|
const graphene_rect_t *rect);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_input_focus_set_surrounding (ClutterInputFocus *focus,
|
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_reset (ClutterInputMethod *method);
|
||||||
|
|
||||||
void clutter_input_method_set_cursor_location (ClutterInputMethod *method,
|
void clutter_input_method_set_cursor_location (ClutterInputMethod *method,
|
||||||
const ClutterRect *rect);
|
const graphene_rect_t *rect);
|
||||||
void clutter_input_method_set_surrounding (ClutterInputMethod *method,
|
void clutter_input_method_set_surrounding (ClutterInputMethod *method,
|
||||||
const gchar *text,
|
const gchar *text,
|
||||||
guint cursor,
|
guint cursor,
|
||||||
|
@@ -187,7 +187,7 @@ clutter_input_method_class_init (ClutterInputMethodClass *klass)
|
|||||||
G_TYPE_FROM_CLASS (object_class),
|
G_TYPE_FROM_CLASS (object_class),
|
||||||
G_SIGNAL_RUN_LAST,
|
G_SIGNAL_RUN_LAST,
|
||||||
0, NULL, NULL, NULL,
|
0, NULL, NULL, NULL,
|
||||||
G_TYPE_NONE, 1, CLUTTER_TYPE_RECT);
|
G_TYPE_NONE, 1, GRAPHENE_TYPE_RECT);
|
||||||
|
|
||||||
pspecs[PROP_CONTENT_HINTS] =
|
pspecs[PROP_CONTENT_HINTS] =
|
||||||
g_param_spec_flags ("content-hints",
|
g_param_spec_flags ("content-hints",
|
||||||
@@ -377,8 +377,8 @@ clutter_input_method_reset (ClutterInputMethod *im)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
clutter_input_method_set_cursor_location (ClutterInputMethod *im,
|
clutter_input_method_set_cursor_location (ClutterInputMethod *im,
|
||||||
const ClutterRect *rect)
|
const graphene_rect_t *rect)
|
||||||
{
|
{
|
||||||
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im));
|
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im));
|
||||||
|
|
||||||
|
@@ -42,8 +42,8 @@ struct _ClutterInputMethodClass
|
|||||||
|
|
||||||
void (* reset) (ClutterInputMethod *im);
|
void (* reset) (ClutterInputMethod *im);
|
||||||
|
|
||||||
void (* set_cursor_location) (ClutterInputMethod *im,
|
void (* set_cursor_location) (ClutterInputMethod *im,
|
||||||
const ClutterRect *rect);
|
const graphene_rect_t *rect);
|
||||||
void (* set_surrounding) (ClutterInputMethod *im,
|
void (* set_surrounding) (ClutterInputMethod *im,
|
||||||
const gchar *text,
|
const gchar *text,
|
||||||
guint cursor,
|
guint cursor,
|
||||||
|
@@ -329,9 +329,6 @@ layout_manager_real_begin_animation (ClutterLayoutManager *manager,
|
|||||||
/* let the alpha take ownership of the timeline */
|
/* let the alpha take ownership of the timeline */
|
||||||
g_object_unref (timeline);
|
g_object_unref (timeline);
|
||||||
|
|
||||||
g_signal_connect_swapped (timeline, "completed",
|
|
||||||
G_CALLBACK (clutter_layout_manager_end_animation),
|
|
||||||
manager);
|
|
||||||
g_signal_connect_swapped (timeline, "new-frame",
|
g_signal_connect_swapped (timeline, "new-frame",
|
||||||
G_CALLBACK (clutter_layout_manager_layout_changed),
|
G_CALLBACK (clutter_layout_manager_layout_changed),
|
||||||
manager);
|
manager);
|
||||||
@@ -375,9 +372,6 @@ layout_manager_real_end_animation (ClutterLayoutManager *manager)
|
|||||||
if (clutter_timeline_is_playing (timeline))
|
if (clutter_timeline_is_playing (timeline))
|
||||||
clutter_timeline_stop (timeline);
|
clutter_timeline_stop (timeline);
|
||||||
|
|
||||||
g_signal_handlers_disconnect_by_func (timeline,
|
|
||||||
G_CALLBACK (clutter_layout_manager_end_animation),
|
|
||||||
manager);
|
|
||||||
g_signal_handlers_disconnect_by_func (timeline,
|
g_signal_handlers_disconnect_by_func (timeline,
|
||||||
G_CALLBACK (clutter_layout_manager_layout_changed),
|
G_CALLBACK (clutter_layout_manager_layout_changed),
|
||||||
manager);
|
manager);
|
||||||
|
@@ -213,15 +213,6 @@ void clutter_layout_manager_child_get_property (ClutterLayoutMa
|
|||||||
const gchar *property_name,
|
const gchar *property_name,
|
||||||
GValue *value);
|
GValue *value);
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
ClutterAlpha * clutter_layout_manager_begin_animation (ClutterLayoutManager *manager,
|
|
||||||
guint duration,
|
|
||||||
gulong mode);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_layout_manager_end_animation (ClutterLayoutManager *manager);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gdouble clutter_layout_manager_get_animation_progress (ClutterLayoutManager *manager);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_LAYOUT_MANAGER_H__ */
|
#endif /* __CLUTTER_LAYOUT_MANAGER_H__ */
|
||||||
|
@@ -59,6 +59,7 @@
|
|||||||
#include "clutter-event-private.h"
|
#include "clutter-event-private.h"
|
||||||
#include "clutter-feature.h"
|
#include "clutter-feature.h"
|
||||||
#include "clutter-input-pointer-a11y-private.h"
|
#include "clutter-input-pointer-a11y-private.h"
|
||||||
|
#include "clutter-graphene.h"
|
||||||
#include "clutter-main.h"
|
#include "clutter-main.h"
|
||||||
#include "clutter-master-clock.h"
|
#include "clutter-master-clock.h"
|
||||||
#include "clutter-mutter.h"
|
#include "clutter-mutter.h"
|
||||||
@@ -2194,6 +2195,8 @@ clutter_base_init (void)
|
|||||||
|
|
||||||
/* initialise the Big Clutter Lock™ if necessary */
|
/* initialise the Big Clutter Lock™ if necessary */
|
||||||
clutter_threads_init_default ();
|
clutter_threads_init_default ();
|
||||||
|
|
||||||
|
clutter_graphene_init ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2602,6 +2605,36 @@ clutter_check_windowing_backend (const char *backend_type)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_add_debug_flags: (skip)
|
||||||
|
*
|
||||||
|
* Adds the debug flags passed to the list of debug flags.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_add_debug_flags (ClutterDebugFlag debug_flags,
|
||||||
|
ClutterDrawDebugFlag draw_flags,
|
||||||
|
ClutterPickDebugFlag pick_flags)
|
||||||
|
{
|
||||||
|
clutter_debug_flags |= debug_flags;
|
||||||
|
clutter_paint_debug_flags |= draw_flags;
|
||||||
|
clutter_pick_debug_flags |= pick_flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_remove_debug_flags: (skip)
|
||||||
|
*
|
||||||
|
* Removes the debug flags passed from the list of debug flags.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_remove_debug_flags (ClutterDebugFlag debug_flags,
|
||||||
|
ClutterDrawDebugFlag draw_flags,
|
||||||
|
ClutterPickDebugFlag pick_flags)
|
||||||
|
{
|
||||||
|
clutter_debug_flags &= ~debug_flags;
|
||||||
|
clutter_paint_debug_flags &= ~draw_flags;
|
||||||
|
clutter_pick_debug_flags &= ~pick_flags;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_clutter_set_sync_to_vblank (gboolean sync_to_vblank)
|
_clutter_set_sync_to_vblank (gboolean sync_to_vblank)
|
||||||
{
|
{
|
||||||
|
@@ -34,6 +34,45 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
CLUTTER_DEBUG_MISC = 1 << 0,
|
||||||
|
CLUTTER_DEBUG_ACTOR = 1 << 1,
|
||||||
|
CLUTTER_DEBUG_TEXTURE = 1 << 2,
|
||||||
|
CLUTTER_DEBUG_EVENT = 1 << 3,
|
||||||
|
CLUTTER_DEBUG_PAINT = 1 << 4,
|
||||||
|
CLUTTER_DEBUG_PANGO = 1 << 5,
|
||||||
|
CLUTTER_DEBUG_BACKEND = 1 << 6,
|
||||||
|
CLUTTER_DEBUG_SCHEDULER = 1 << 7,
|
||||||
|
CLUTTER_DEBUG_SCRIPT = 1 << 8,
|
||||||
|
CLUTTER_DEBUG_SHADER = 1 << 9,
|
||||||
|
CLUTTER_DEBUG_MULTISTAGE = 1 << 10,
|
||||||
|
CLUTTER_DEBUG_ANIMATION = 1 << 11,
|
||||||
|
CLUTTER_DEBUG_LAYOUT = 1 << 12,
|
||||||
|
CLUTTER_DEBUG_PICK = 1 << 13,
|
||||||
|
CLUTTER_DEBUG_EVENTLOOP = 1 << 14,
|
||||||
|
CLUTTER_DEBUG_CLIPPING = 1 << 15,
|
||||||
|
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 16,
|
||||||
|
} ClutterDebugFlag;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
CLUTTER_DEBUG_NOP_PICKING = 1 << 0,
|
||||||
|
} ClutterPickDebugFlag;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
CLUTTER_DEBUG_DISABLE_SWAP_EVENTS = 1 << 0,
|
||||||
|
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS = 1 << 1,
|
||||||
|
CLUTTER_DEBUG_REDRAWS = 1 << 2,
|
||||||
|
CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3,
|
||||||
|
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
|
||||||
|
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
|
||||||
|
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
|
||||||
|
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7,
|
||||||
|
CLUTTER_DEBUG_PAINT_DAMAGE_REGION = 1 << 8,
|
||||||
|
} ClutterDrawDebugFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CLUTTER_INIT_ERROR:
|
* CLUTTER_INIT_ERROR:
|
||||||
*
|
*
|
||||||
@@ -158,6 +197,15 @@ guint clutter_get_default_frame_rate (void);
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_check_windowing_backend (const char *backend_type);
|
gboolean clutter_check_windowing_backend (const char *backend_type);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
void clutter_add_debug_flags (ClutterDebugFlag debug_flags,
|
||||||
|
ClutterDrawDebugFlag draw_flags,
|
||||||
|
ClutterPickDebugFlag pick_flags);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
void clutter_remove_debug_flags (ClutterDebugFlag debug_flags,
|
||||||
|
ClutterDrawDebugFlag draw_flags,
|
||||||
|
ClutterPickDebugFlag pick_flags);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@@ -86,7 +86,7 @@ struct _ClutterOffscreenEffectPrivate
|
|||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
ClutterActor *stage;
|
ClutterActor *stage;
|
||||||
|
|
||||||
ClutterVertex position;
|
graphene_point3d_t position;
|
||||||
|
|
||||||
int fbo_offset_x;
|
int fbo_offset_x;
|
||||||
int fbo_offset_y;
|
int fbo_offset_y;
|
||||||
@@ -119,7 +119,7 @@ clutter_offscreen_effect_set_actor (ClutterActorMeta *meta,
|
|||||||
/* clear out the previous state */
|
/* clear out the previous state */
|
||||||
if (priv->offscreen != NULL)
|
if (priv->offscreen != NULL)
|
||||||
{
|
{
|
||||||
cogl_handle_unref (priv->offscreen);
|
cogl_object_unref (priv->offscreen);
|
||||||
priv->offscreen = NULL;
|
priv->offscreen = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,13 +199,13 @@ update_fbo (ClutterEffect *effect,
|
|||||||
|
|
||||||
if (priv->texture != NULL)
|
if (priv->texture != NULL)
|
||||||
{
|
{
|
||||||
cogl_handle_unref (priv->texture);
|
cogl_object_unref (priv->texture);
|
||||||
priv->texture = NULL;
|
priv->texture = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->offscreen != NULL)
|
if (priv->offscreen != NULL)
|
||||||
{
|
{
|
||||||
cogl_handle_unref (priv->offscreen);
|
cogl_object_unref (priv->offscreen);
|
||||||
priv->offscreen = NULL;
|
priv->offscreen = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ update_fbo (ClutterEffect *effect,
|
|||||||
{
|
{
|
||||||
g_warning ("%s: Unable to create an Offscreen buffer", G_STRLOC);
|
g_warning ("%s: Unable to create an Offscreen buffer", G_STRLOC);
|
||||||
|
|
||||||
cogl_handle_unref (priv->target);
|
cogl_object_unref (priv->target);
|
||||||
priv->target = NULL;
|
priv->target = NULL;
|
||||||
|
|
||||||
priv->target_width = 0;
|
priv->target_width = 0;
|
||||||
@@ -250,9 +250,11 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
|||||||
gfloat target_width = -1, target_height = -1;
|
gfloat target_width = -1, target_height = -1;
|
||||||
gfloat resource_scale;
|
gfloat resource_scale;
|
||||||
gfloat ceiled_resource_scale;
|
gfloat ceiled_resource_scale;
|
||||||
ClutterVertex local_offset = { 0.f, 0.f, 0.f };
|
graphene_point3d_t local_offset;
|
||||||
gfloat old_viewport[4];
|
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)))
|
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@@ -487,13 +489,13 @@ clutter_offscreen_effect_finalize (GObject *gobject)
|
|||||||
ClutterOffscreenEffectPrivate *priv = self->priv;
|
ClutterOffscreenEffectPrivate *priv = self->priv;
|
||||||
|
|
||||||
if (priv->offscreen)
|
if (priv->offscreen)
|
||||||
cogl_handle_unref (priv->offscreen);
|
cogl_object_unref (priv->offscreen);
|
||||||
|
|
||||||
if (priv->target)
|
if (priv->target)
|
||||||
cogl_handle_unref (priv->target);
|
cogl_object_unref (priv->target);
|
||||||
|
|
||||||
if (priv->texture)
|
if (priv->texture)
|
||||||
cogl_handle_unref (priv->texture);
|
cogl_object_unref (priv->texture);
|
||||||
|
|
||||||
G_OBJECT_CLASS (clutter_offscreen_effect_parent_class)->finalize (gobject);
|
G_OBJECT_CLASS (clutter_offscreen_effect_parent_class)->finalize (gobject);
|
||||||
}
|
}
|
||||||
@@ -537,7 +539,7 @@ clutter_offscreen_effect_init (ClutterOffscreenEffect *self)
|
|||||||
* used instead of clutter_offscreen_effect_get_target() when the
|
* used instead of clutter_offscreen_effect_get_target() when the
|
||||||
* effect subclass wants to paint using its own material.
|
* effect subclass wants to paint using its own material.
|
||||||
*
|
*
|
||||||
* Return value: (transfer none): a #CoglHandle or %COGL_INVALID_HANDLE. The
|
* Return value: (transfer none): a #CoglHandle or %NULL. The
|
||||||
* returned texture is owned by Clutter and it should not be
|
* returned texture is owned by Clutter and it should not be
|
||||||
* modified or freed
|
* modified or freed
|
||||||
*
|
*
|
||||||
@@ -602,7 +604,7 @@ clutter_offscreen_effect_paint_target (ClutterOffscreenEffect *effect)
|
|||||||
* Calls the create_texture() virtual function of the @effect
|
* Calls the create_texture() virtual function of the @effect
|
||||||
*
|
*
|
||||||
* Return value: (transfer full): a handle to a Cogl texture, or
|
* Return value: (transfer full): a handle to a Cogl texture, or
|
||||||
* %COGL_INVALID_HANDLE. The returned handle has its reference
|
* %NULL. The returned handle has its reference
|
||||||
* count increased.
|
* count increased.
|
||||||
*
|
*
|
||||||
* Since: 1.4
|
* Since: 1.4
|
||||||
@@ -682,7 +684,7 @@ clutter_offscreen_effect_get_target_size (ClutterOffscreenEffect *effect,
|
|||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
||||||
ClutterRect *rect)
|
graphene_rect_t *rect)
|
||||||
{
|
{
|
||||||
ClutterOffscreenEffectPrivate *priv;
|
ClutterOffscreenEffectPrivate *priv;
|
||||||
|
|
||||||
@@ -694,11 +696,11 @@ clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
|||||||
if (priv->texture == NULL)
|
if (priv->texture == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
clutter_rect_init (rect,
|
graphene_rect_init (rect,
|
||||||
priv->position.x,
|
priv->position.x,
|
||||||
priv->position.y,
|
priv->position.y,
|
||||||
cogl_texture_get_width (priv->texture),
|
cogl_texture_get_width (priv->texture),
|
||||||
cogl_texture_get_height (priv->texture));
|
cogl_texture_get_height (priv->texture));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@@ -114,7 +114,7 @@ gboolean clutter_offscreen_effect_get_target_size (ClutterOffscree
|
|||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
gboolean clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
||||||
ClutterRect *rect);
|
graphene_rect_t *rect);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@@ -139,30 +139,6 @@ ClutterPaintNode * clutter_paint_node_get_last_child (Clutter
|
|||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
ClutterPaintNode * clutter_paint_node_get_parent (ClutterPaintNode *node);
|
ClutterPaintNode * clutter_paint_node_get_parent (ClutterPaintNode *node);
|
||||||
|
|
||||||
#define CLUTTER_TYPE_LAYER_NODE (_clutter_layer_node_get_type ())
|
|
||||||
#define CLUTTER_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_LAYER_NODE, ClutterLayerNode))
|
|
||||||
#define CLUTTER_IS_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_LAYER_NODE))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ClutterLayerNode:
|
|
||||||
*
|
|
||||||
* The #ClutterLayerNode structure is an opaque
|
|
||||||
* type whose members cannot be directly accessed.
|
|
||||||
*
|
|
||||||
* Since: 1.10
|
|
||||||
*/
|
|
||||||
typedef struct _ClutterLayerNode ClutterLayerNode;
|
|
||||||
typedef struct _ClutterLayerNodeClass ClutterLayerNodeClass;
|
|
||||||
|
|
||||||
GType _clutter_layer_node_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
ClutterPaintNode * _clutter_layer_node_new (const CoglMatrix *projection,
|
|
||||||
const cairo_rectangle_t *viewport,
|
|
||||||
float width,
|
|
||||||
float height,
|
|
||||||
guint8 opacity);
|
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_PAINT_NODE_PRIVATE_H__ */
|
#endif /* __CLUTTER_PAINT_NODE_PRIVATE_H__ */
|
||||||
|
@@ -1099,12 +1099,12 @@ clutter_paint_node_to_json (ClutterPaintNode *node)
|
|||||||
|
|
||||||
case PAINT_OP_PATH:
|
case PAINT_OP_PATH:
|
||||||
json_builder_set_member_name (builder, "path");
|
json_builder_set_member_name (builder, "path");
|
||||||
json_builder_add_int_value (builder, (gint64) op->op.path);
|
json_builder_add_int_value (builder, (intptr_t) op->op.path);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PAINT_OP_PRIMITIVE:
|
case PAINT_OP_PRIMITIVE:
|
||||||
json_builder_set_member_name (builder, "primitive");
|
json_builder_set_member_name (builder, "primitive");
|
||||||
json_builder_add_int_value (builder, (gint64) op->op.primitive);
|
json_builder_add_int_value (builder, (intptr_t) op->op.primitive);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PAINT_OP_INVALID:
|
case PAINT_OP_INVALID:
|
||||||
|
@@ -183,35 +183,31 @@ clutter_root_node_new (CoglFramebuffer *framebuffer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Transform node
|
* ClutterTransformNode
|
||||||
*
|
|
||||||
* A private PaintNode, that changes the modelview of its child
|
|
||||||
* nodes.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define clutter_transform_node_get_type _clutter_transform_node_get_type
|
struct _ClutterTransformNode
|
||||||
|
{
|
||||||
typedef struct _ClutterTransformNode {
|
|
||||||
ClutterPaintNode parent_instance;
|
ClutterPaintNode parent_instance;
|
||||||
|
|
||||||
CoglMatrix modelview;
|
CoglMatrix transform;
|
||||||
} ClutterTransformNode;
|
};
|
||||||
|
|
||||||
typedef struct _ClutterPaintNodeClass ClutterTransformNodeClass;
|
struct _ClutterTransformNodeClass
|
||||||
|
{
|
||||||
|
ClutterPaintNodeClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (ClutterTransformNode, clutter_transform_node, CLUTTER_TYPE_PAINT_NODE)
|
G_DEFINE_TYPE (ClutterTransformNode, clutter_transform_node, CLUTTER_TYPE_PAINT_NODE)
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
clutter_transform_node_pre_draw (ClutterPaintNode *node)
|
clutter_transform_node_pre_draw (ClutterPaintNode *node)
|
||||||
{
|
{
|
||||||
ClutterTransformNode *tnode = (ClutterTransformNode *) node;
|
ClutterTransformNode *transform_node = (ClutterTransformNode *) node;
|
||||||
CoglMatrix matrix;
|
CoglFramebuffer *fb = cogl_get_draw_framebuffer ();
|
||||||
|
|
||||||
cogl_push_matrix ();
|
cogl_framebuffer_push_matrix (fb);
|
||||||
|
cogl_framebuffer_transform (fb, &transform_node->transform);
|
||||||
cogl_get_modelview_matrix (&matrix);
|
|
||||||
cogl_matrix_multiply (&matrix, &matrix, &tnode->modelview);
|
|
||||||
cogl_set_modelview_matrix (&matrix);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -219,7 +215,9 @@ clutter_transform_node_pre_draw (ClutterPaintNode *node)
|
|||||||
static void
|
static void
|
||||||
clutter_transform_node_post_draw (ClutterPaintNode *node)
|
clutter_transform_node_post_draw (ClutterPaintNode *node)
|
||||||
{
|
{
|
||||||
cogl_pop_matrix ();
|
CoglFramebuffer *fb = cogl_get_draw_framebuffer ();
|
||||||
|
|
||||||
|
cogl_framebuffer_pop_matrix (fb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -235,18 +233,24 @@ clutter_transform_node_class_init (ClutterTransformNodeClass *klass)
|
|||||||
static void
|
static void
|
||||||
clutter_transform_node_init (ClutterTransformNode *self)
|
clutter_transform_node_init (ClutterTransformNode *self)
|
||||||
{
|
{
|
||||||
cogl_matrix_init_identity (&self->modelview);
|
cogl_matrix_init_identity (&self->transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* clutter_transform_node_new:
|
||||||
|
* @transform: (nullable): the transform matrix to apply
|
||||||
|
*
|
||||||
|
* Return value: (transfer full): the newly created #ClutterTransformNode.
|
||||||
|
* Use clutter_paint_node_unref() when done.
|
||||||
|
*/
|
||||||
ClutterPaintNode *
|
ClutterPaintNode *
|
||||||
_clutter_transform_node_new (const CoglMatrix *modelview)
|
clutter_transform_node_new (const CoglMatrix *transform)
|
||||||
{
|
{
|
||||||
ClutterTransformNode *res;
|
ClutterTransformNode *res;
|
||||||
|
|
||||||
res = _clutter_paint_node_create (_clutter_transform_node_get_type ());
|
res = _clutter_paint_node_create (CLUTTER_TYPE_TRANSFORM_NODE);
|
||||||
|
if (transform)
|
||||||
if (modelview != NULL)
|
res->transform = *transform;
|
||||||
res->modelview = *modelview;
|
|
||||||
|
|
||||||
return (ClutterPaintNode *) res;
|
return (ClutterPaintNode *) res;
|
||||||
}
|
}
|
||||||
@@ -1078,10 +1082,114 @@ clutter_clip_node_new (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ClutterLayerNode (private)
|
* ClutterActorNode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define clutter_layer_node_get_type _clutter_layer_node_get_type
|
struct _ClutterActorNode
|
||||||
|
{
|
||||||
|
ClutterPaintNode parent_instance;
|
||||||
|
|
||||||
|
ClutterActor *actor;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _ClutterActorNodeClass
|
||||||
|
{
|
||||||
|
ClutterPaintNodeClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (ClutterActorNode, clutter_actor_node, CLUTTER_TYPE_PAINT_NODE)
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
clutter_actor_node_pre_draw (ClutterPaintNode *node)
|
||||||
|
{
|
||||||
|
ClutterActorNode *actor_node = CLUTTER_ACTOR_NODE (node);
|
||||||
|
|
||||||
|
CLUTTER_SET_PRIVATE_FLAGS (actor_node->actor, CLUTTER_IN_PAINT);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_actor_node_draw (ClutterPaintNode *node)
|
||||||
|
{
|
||||||
|
ClutterActorNode *actor_node = CLUTTER_ACTOR_NODE (node);
|
||||||
|
|
||||||
|
clutter_actor_continue_paint (actor_node->actor);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_actor_node_post_draw (ClutterPaintNode *node)
|
||||||
|
{
|
||||||
|
ClutterActorNode *actor_node = CLUTTER_ACTOR_NODE (node);
|
||||||
|
|
||||||
|
CLUTTER_UNSET_PRIVATE_FLAGS (actor_node->actor, CLUTTER_IN_PAINT);
|
||||||
|
}
|
||||||
|
|
||||||
|
static JsonNode *
|
||||||
|
clutter_actor_node_serialize (ClutterPaintNode *node)
|
||||||
|
{
|
||||||
|
ClutterActorNode *actor_node = CLUTTER_ACTOR_NODE (node);
|
||||||
|
g_autoptr (JsonBuilder) builder = NULL;
|
||||||
|
const char *debug_name;
|
||||||
|
|
||||||
|
debug_name = _clutter_actor_get_debug_name (actor_node->actor);
|
||||||
|
|
||||||
|
builder = json_builder_new ();
|
||||||
|
|
||||||
|
json_builder_begin_object (builder);
|
||||||
|
json_builder_set_member_name (builder, "actor");
|
||||||
|
json_builder_add_string_value (builder, debug_name);
|
||||||
|
json_builder_end_object (builder);
|
||||||
|
|
||||||
|
return json_builder_get_root (builder);
|
||||||
|
}
|
||||||
|
static void
|
||||||
|
clutter_actor_node_class_init (ClutterActorNodeClass *klass)
|
||||||
|
{
|
||||||
|
ClutterPaintNodeClass *node_class;
|
||||||
|
|
||||||
|
node_class = CLUTTER_PAINT_NODE_CLASS (klass);
|
||||||
|
node_class->pre_draw = clutter_actor_node_pre_draw;
|
||||||
|
node_class->draw = clutter_actor_node_draw;
|
||||||
|
node_class->post_draw = clutter_actor_node_post_draw;
|
||||||
|
node_class->serialize = clutter_actor_node_serialize;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_actor_node_init (ClutterActorNode *self)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* clutter_actor_node_new:
|
||||||
|
* @actor: the actor to paint
|
||||||
|
*
|
||||||
|
* Creates a new #ClutterActorNode.
|
||||||
|
*
|
||||||
|
* The actor is painted together with any effects
|
||||||
|
* applied to it. Children of this node will draw
|
||||||
|
* over the actor contents.
|
||||||
|
*
|
||||||
|
* Return value: (transfer full): the newly created #ClutterActorNode.
|
||||||
|
* Use clutter_paint_node_unref() when done.
|
||||||
|
*/
|
||||||
|
ClutterPaintNode *
|
||||||
|
clutter_actor_node_new (ClutterActor *actor)
|
||||||
|
{
|
||||||
|
ClutterActorNode *res;
|
||||||
|
|
||||||
|
g_assert (actor != NULL);
|
||||||
|
|
||||||
|
res = _clutter_paint_node_create (CLUTTER_TYPE_ACTOR_NODE);
|
||||||
|
res->actor = actor;
|
||||||
|
|
||||||
|
return (ClutterPaintNode *) res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ClutterLayerNode
|
||||||
|
*/
|
||||||
|
|
||||||
struct _ClutterLayerNode
|
struct _ClutterLayerNode
|
||||||
{
|
{
|
||||||
@@ -1268,11 +1376,11 @@ clutter_layer_node_init (ClutterLayerNode *self)
|
|||||||
* Since: 1.10
|
* Since: 1.10
|
||||||
*/
|
*/
|
||||||
ClutterPaintNode *
|
ClutterPaintNode *
|
||||||
_clutter_layer_node_new (const CoglMatrix *projection,
|
clutter_layer_node_new (const CoglMatrix *projection,
|
||||||
const cairo_rectangle_t *viewport,
|
const cairo_rectangle_t *viewport,
|
||||||
float width,
|
float width,
|
||||||
float height,
|
float height,
|
||||||
guint8 opacity)
|
guint8 opacity)
|
||||||
{
|
{
|
||||||
ClutterLayerNode *res;
|
ClutterLayerNode *res;
|
||||||
CoglColor color;
|
CoglColor color;
|
||||||
|
@@ -143,6 +143,25 @@ CLUTTER_EXPORT
|
|||||||
ClutterPaintNode * clutter_text_node_new (PangoLayout *layout,
|
ClutterPaintNode * clutter_text_node_new (PangoLayout *layout,
|
||||||
const ClutterColor *color);
|
const ClutterColor *color);
|
||||||
|
|
||||||
|
#define CLUTTER_TYPE_ACTOR_NODE (clutter_actor_node_get_type ())
|
||||||
|
#define CLUTTER_ACTOR_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ACTOR_NODE, ClutterActorNode))
|
||||||
|
#define CLUTTER_IS_ACTOR_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ACTOR_NODE))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterActorNode:
|
||||||
|
*
|
||||||
|
* The #ClutterActorNode structure is an opaque
|
||||||
|
* type whose members cannot be directly accessed.
|
||||||
|
*/
|
||||||
|
typedef struct _ClutterActorNode ClutterActorNode;
|
||||||
|
typedef struct _ClutterActorNode ClutterActorNodeClass;
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
GType clutter_actor_node_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
ClutterPaintNode * clutter_actor_node_new (ClutterActor *actor);
|
||||||
|
|
||||||
#define CLUTTER_TYPE_ROOT_NODE (clutter_root_node_get_type ())
|
#define CLUTTER_TYPE_ROOT_NODE (clutter_root_node_get_type ())
|
||||||
#define CLUTTER_ROOT_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ROOT_NODE, ClutterRootNode))
|
#define CLUTTER_ROOT_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ROOT_NODE, ClutterRootNode))
|
||||||
#define CLUTTER_IS_ROOT_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ROOT_NODE))
|
#define CLUTTER_IS_ROOT_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ROOT_NODE))
|
||||||
@@ -163,6 +182,54 @@ CLUTTER_EXPORT
|
|||||||
ClutterPaintNode * clutter_root_node_new (CoglFramebuffer *framebuffer,
|
ClutterPaintNode * clutter_root_node_new (CoglFramebuffer *framebuffer,
|
||||||
const ClutterColor *clear_color,
|
const ClutterColor *clear_color,
|
||||||
CoglBufferBit clear_flags);
|
CoglBufferBit clear_flags);
|
||||||
|
|
||||||
|
#define CLUTTER_TYPE_LAYER_NODE (clutter_layer_node_get_type ())
|
||||||
|
#define CLUTTER_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_LAYER_NODE, ClutterLayerNode))
|
||||||
|
#define CLUTTER_IS_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_LAYER_NODE))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ClutterLayerNode:
|
||||||
|
*
|
||||||
|
* The #ClutterLayerNode structure is an opaque
|
||||||
|
* type whose members cannot be directly accessed.
|
||||||
|
*
|
||||||
|
* Since: 1.10
|
||||||
|
*/
|
||||||
|
typedef struct _ClutterLayerNode ClutterLayerNode;
|
||||||
|
typedef struct _ClutterLayerNodeClass ClutterLayerNodeClass;
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
GType clutter_layer_node_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
ClutterPaintNode * clutter_layer_node_new (const CoglMatrix *projection,
|
||||||
|
const cairo_rectangle_t *viewport,
|
||||||
|
float width,
|
||||||
|
float height,
|
||||||
|
guint8 opacity);
|
||||||
|
|
||||||
|
|
||||||
|
#define CLUTTER_TYPE_TRANSFORM_NODE (clutter_transform_node_get_type ())
|
||||||
|
#define CLUTTER_TRANSFORM_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_TRANSFORM_NODE, ClutterTransformNode))
|
||||||
|
#define CLUTTER_IS_TRANSFORM_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_TRANSFORM_NODE))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ClutterTransformNode:
|
||||||
|
*
|
||||||
|
* The #ClutterLayerNode structure is an opaque
|
||||||
|
* type whose members cannot be directly accessed.
|
||||||
|
*
|
||||||
|
* Since: 1.10
|
||||||
|
*/
|
||||||
|
typedef struct _ClutterTransformNode ClutterTransformNode;
|
||||||
|
typedef struct _ClutterPaintNodeClass ClutterTransformNodeClass;
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
GType clutter_transform_node_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
ClutterPaintNode * clutter_transform_node_new (const CoglMatrix *projection);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_PAINT_NODES_H__ */
|
#endif /* __CLUTTER_PAINT_NODES_H__ */
|
||||||
|
@@ -58,7 +58,7 @@ struct _ClutterPaintVolume
|
|||||||
* elements 4, 5, 6 and 7 most of the time for 2D actors when
|
* elements 4, 5, 6 and 7 most of the time for 2D actors when
|
||||||
* calculating the projected paint box.
|
* calculating the projected paint box.
|
||||||
*/
|
*/
|
||||||
ClutterVertex vertices[8];
|
graphene_point3d_t vertices[8];
|
||||||
|
|
||||||
/* As an optimization for internally managed PaintVolumes we allow
|
/* As an optimization for internally managed PaintVolumes we allow
|
||||||
* initializing ClutterPaintVolume variables allocated on the stack
|
* initializing ClutterPaintVolume variables allocated on the stack
|
||||||
|
@@ -63,7 +63,7 @@ _clutter_paint_volume_new (ClutterActor *actor)
|
|||||||
|
|
||||||
pv->actor = actor;
|
pv->actor = actor;
|
||||||
|
|
||||||
memset (pv->vertices, 0, 8 * sizeof (ClutterVertex));
|
memset (pv->vertices, 0, 8 * sizeof (graphene_point3d_t));
|
||||||
|
|
||||||
pv->is_static = FALSE;
|
pv->is_static = FALSE;
|
||||||
pv->is_empty = TRUE;
|
pv->is_empty = TRUE;
|
||||||
@@ -96,7 +96,7 @@ _clutter_paint_volume_init_static (ClutterPaintVolume *pv,
|
|||||||
{
|
{
|
||||||
pv->actor = actor;
|
pv->actor = actor;
|
||||||
|
|
||||||
memset (pv->vertices, 0, 8 * sizeof (ClutterVertex));
|
memset (pv->vertices, 0, 8 * sizeof (graphene_point3d_t));
|
||||||
|
|
||||||
pv->is_static = TRUE;
|
pv->is_static = TRUE;
|
||||||
pv->is_empty = TRUE;
|
pv->is_empty = TRUE;
|
||||||
@@ -170,7 +170,7 @@ clutter_paint_volume_free (ClutterPaintVolume *pv)
|
|||||||
/**
|
/**
|
||||||
* clutter_paint_volume_set_origin:
|
* clutter_paint_volume_set_origin:
|
||||||
* @pv: a #ClutterPaintVolume
|
* @pv: a #ClutterPaintVolume
|
||||||
* @origin: a #ClutterVertex
|
* @origin: a #graphene_point3d_t
|
||||||
*
|
*
|
||||||
* Sets the origin of the paint volume.
|
* Sets the origin of the paint volume.
|
||||||
*
|
*
|
||||||
@@ -182,8 +182,8 @@ clutter_paint_volume_free (ClutterPaintVolume *pv)
|
|||||||
* Since: 1.6
|
* Since: 1.6
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||||
const ClutterVertex *origin)
|
const graphene_point3d_t *origin)
|
||||||
{
|
{
|
||||||
static const int key_vertices[4] = { 0, 1, 3, 4 };
|
static const int key_vertices[4] = { 0, 1, 3, 4 };
|
||||||
float dx, dy, dz;
|
float dx, dy, dz;
|
||||||
@@ -210,7 +210,7 @@ clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
|||||||
/**
|
/**
|
||||||
* clutter_paint_volume_get_origin:
|
* clutter_paint_volume_get_origin:
|
||||||
* @pv: a #ClutterPaintVolume
|
* @pv: a #ClutterPaintVolume
|
||||||
* @vertex: (out): the return location for a #ClutterVertex
|
* @vertex: (out): the return location for a #graphene_point3d_t
|
||||||
*
|
*
|
||||||
* Retrieves the origin of the #ClutterPaintVolume.
|
* Retrieves the origin of the #ClutterPaintVolume.
|
||||||
*
|
*
|
||||||
@@ -218,7 +218,7 @@ clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_paint_volume_get_origin (const ClutterPaintVolume *pv,
|
clutter_paint_volume_get_origin (const ClutterPaintVolume *pv,
|
||||||
ClutterVertex *vertex)
|
graphene_point3d_t *vertex)
|
||||||
{
|
{
|
||||||
g_return_if_fail (pv != NULL);
|
g_return_if_fail (pv != NULL);
|
||||||
g_return_if_fail (vertex != NULL);
|
g_return_if_fail (vertex != NULL);
|
||||||
@@ -659,7 +659,7 @@ clutter_paint_volume_union_box (ClutterPaintVolume *pv,
|
|||||||
const ClutterActorBox *box)
|
const ClutterActorBox *box)
|
||||||
{
|
{
|
||||||
ClutterPaintVolume volume;
|
ClutterPaintVolume volume;
|
||||||
ClutterVertex origin;
|
graphene_point3d_t origin;
|
||||||
|
|
||||||
g_return_if_fail (pv != NULL);
|
g_return_if_fail (pv != NULL);
|
||||||
g_return_if_fail (box != NULL);
|
g_return_if_fail (box != NULL);
|
||||||
@@ -757,7 +757,7 @@ _clutter_paint_volume_get_bounding_box (ClutterPaintVolume *pv,
|
|||||||
ClutterActorBox *box)
|
ClutterActorBox *box)
|
||||||
{
|
{
|
||||||
gfloat x_min, y_min, x_max, y_max;
|
gfloat x_min, y_min, x_max, y_max;
|
||||||
ClutterVertex *vertices;
|
graphene_point3d_t *vertices;
|
||||||
int count;
|
int count;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
@@ -878,9 +878,9 @@ _clutter_paint_volume_transform (ClutterPaintVolume *pv,
|
|||||||
|
|
||||||
cogl_matrix_transform_points (matrix,
|
cogl_matrix_transform_points (matrix,
|
||||||
3,
|
3,
|
||||||
sizeof (ClutterVertex),
|
sizeof (graphene_point3d_t),
|
||||||
pv->vertices,
|
pv->vertices,
|
||||||
sizeof (ClutterVertex),
|
sizeof (graphene_point3d_t),
|
||||||
pv->vertices,
|
pv->vertices,
|
||||||
transform_count);
|
transform_count);
|
||||||
|
|
||||||
@@ -896,7 +896,7 @@ _clutter_paint_volume_axis_align (ClutterPaintVolume *pv)
|
|||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
int i;
|
int i;
|
||||||
ClutterVertex origin;
|
graphene_point3d_t origin;
|
||||||
float max_x;
|
float max_x;
|
||||||
float max_y;
|
float max_y;
|
||||||
float max_z;
|
float max_z;
|
||||||
@@ -1075,7 +1075,7 @@ _clutter_paint_volume_cull (ClutterPaintVolume *pv,
|
|||||||
const ClutterPlane *planes)
|
const ClutterPlane *planes)
|
||||||
{
|
{
|
||||||
int vertex_count;
|
int vertex_count;
|
||||||
ClutterVertex *vertices = pv->vertices;
|
graphene_point3d_t *vertices = pv->vertices;
|
||||||
gboolean partial = FALSE;
|
gboolean partial = FALSE;
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
@@ -1097,24 +1097,18 @@ _clutter_paint_volume_cull (ClutterPaintVolume *pv,
|
|||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
|
const ClutterPlane *plane = &planes[i];
|
||||||
int out = 0;
|
int out = 0;
|
||||||
for (j = 0; j < vertex_count; j++)
|
for (j = 0; j < vertex_count; j++)
|
||||||
{
|
{
|
||||||
ClutterVertex p;
|
graphene_vec3_t v;
|
||||||
float distance;
|
|
||||||
|
|
||||||
/* XXX: for perspective projections this can be optimized
|
graphene_vec3_init (&v,
|
||||||
* out because all the planes should pass through the origin
|
vertices[j].x - graphene_vec3_get_x (&plane->v0),
|
||||||
* so (0,0,0) is a valid v0. */
|
vertices[j].y - graphene_vec3_get_y (&plane->v0),
|
||||||
p.x = vertices[j].x - planes[i].v0[0];
|
vertices[j].z - graphene_vec3_get_z (&plane->v0));
|
||||||
p.y = vertices[j].y - planes[i].v0[1];
|
|
||||||
p.z = vertices[j].z - planes[i].v0[2];
|
|
||||||
|
|
||||||
distance = (planes[i].n[0] * p.x +
|
if (graphene_vec3_dot (&plane->n, &v) < 0)
|
||||||
planes[i].n[1] * p.y +
|
|
||||||
planes[i].n[2] * p.z);
|
|
||||||
|
|
||||||
if (distance < 0)
|
|
||||||
out++;
|
out++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -27,8 +27,7 @@
|
|||||||
* and bezier curves.
|
* and bezier curves.
|
||||||
*
|
*
|
||||||
* A #ClutterPath contains a description of a path consisting of
|
* A #ClutterPath contains a description of a path consisting of
|
||||||
* straight lines and bezier curves. This can be used in a
|
* straight lines and bezier curves.
|
||||||
* #ClutterBehaviourPath to animate an actor moving along the path.
|
|
||||||
*
|
*
|
||||||
* The path consists of a series of nodes. Each node is one of the
|
* The path consists of a series of nodes. Each node is one of the
|
||||||
* following four types:
|
* following four types:
|
||||||
@@ -244,9 +243,6 @@ clutter_path_finalize (GObject *object)
|
|||||||
*
|
*
|
||||||
* Creates a new #ClutterPath instance with no nodes.
|
* Creates a new #ClutterPath instance with no nodes.
|
||||||
*
|
*
|
||||||
* The object has a floating reference so if you add it to a
|
|
||||||
* #ClutterBehaviourPath then you do not need to unref it.
|
|
||||||
*
|
|
||||||
* Return value: the newly created #ClutterPath
|
* Return value: the newly created #ClutterPath
|
||||||
*
|
*
|
||||||
* Since: 1.0
|
* Since: 1.0
|
||||||
@@ -267,9 +263,6 @@ clutter_path_new (void)
|
|||||||
* @desc. See clutter_path_add_string() for details of the format of
|
* @desc. See clutter_path_add_string() for details of the format of
|
||||||
* the string.
|
* the string.
|
||||||
*
|
*
|
||||||
* The object has a floating reference so if you add it to a
|
|
||||||
* #ClutterBehaviourPath then you do not need to unref it.
|
|
||||||
*
|
|
||||||
* Return value: the newly created #ClutterPath
|
* Return value: the newly created #ClutterPath
|
||||||
*
|
*
|
||||||
* Since: 1.0
|
* Since: 1.0
|
||||||
|
@@ -64,10 +64,10 @@ typedef struct _ClutterVertex4 ClutterVertex4;
|
|||||||
#define CLUTTER_UNSET_PRIVATE_FLAGS(a,f) (CLUTTER_PRIVATE_FLAGS (a) &= ~(f))
|
#define CLUTTER_UNSET_PRIVATE_FLAGS(a,f) (CLUTTER_PRIVATE_FLAGS (a) &= ~(f))
|
||||||
|
|
||||||
#define CLUTTER_ACTOR_IS_TOPLEVEL(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IS_TOPLEVEL) != FALSE)
|
#define CLUTTER_ACTOR_IS_TOPLEVEL(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IS_TOPLEVEL) != FALSE)
|
||||||
#define CLUTTER_ACTOR_IS_INTERNAL_CHILD(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_INTERNAL_CHILD) != FALSE)
|
|
||||||
#define CLUTTER_ACTOR_IN_DESTRUCTION(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_DESTRUCTION) != FALSE)
|
#define CLUTTER_ACTOR_IN_DESTRUCTION(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_DESTRUCTION) != FALSE)
|
||||||
#define CLUTTER_ACTOR_IN_REPARENT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_REPARENT) != FALSE)
|
#define CLUTTER_ACTOR_IN_REPARENT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_REPARENT) != FALSE)
|
||||||
#define CLUTTER_ACTOR_IN_PAINT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PAINT) != FALSE)
|
#define CLUTTER_ACTOR_IN_PAINT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PAINT) != FALSE)
|
||||||
|
#define CLUTTER_ACTOR_IN_PICK(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PICK) != FALSE)
|
||||||
#define CLUTTER_ACTOR_IN_RELAYOUT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_RELAYOUT) != FALSE)
|
#define CLUTTER_ACTOR_IN_RELAYOUT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_RELAYOUT) != FALSE)
|
||||||
#define CLUTTER_ACTOR_IN_PREF_WIDTH(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PREF_WIDTH) != FALSE)
|
#define CLUTTER_ACTOR_IN_PREF_WIDTH(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PREF_WIDTH) != FALSE)
|
||||||
#define CLUTTER_ACTOR_IN_PREF_HEIGHT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PREF_HEIGHT) != FALSE)
|
#define CLUTTER_ACTOR_IN_PREF_HEIGHT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PREF_HEIGHT) != FALSE)
|
||||||
@@ -105,12 +105,10 @@ typedef enum
|
|||||||
|
|
||||||
/* Used to avoid recursion */
|
/* Used to avoid recursion */
|
||||||
CLUTTER_IN_PAINT = 1 << 5,
|
CLUTTER_IN_PAINT = 1 << 5,
|
||||||
|
CLUTTER_IN_PICK = 1 << 6,
|
||||||
|
|
||||||
/* Used to avoid recursion */
|
/* Used to avoid recursion */
|
||||||
CLUTTER_IN_RELAYOUT = 1 << 6,
|
CLUTTER_IN_RELAYOUT = 1 << 7,
|
||||||
|
|
||||||
/* a flag for internal children of Containers (DEPRECATED) */
|
|
||||||
CLUTTER_INTERNAL_CHILD = 1 << 7
|
|
||||||
} ClutterPrivateFlags;
|
} ClutterPrivateFlags;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -224,17 +222,17 @@ void _clutter_run_repaint_functions (ClutterRepaintFlags flags);
|
|||||||
|
|
||||||
GType _clutter_layout_manager_get_child_meta_type (ClutterLayoutManager *manager);
|
GType _clutter_layout_manager_get_child_meta_type (ClutterLayoutManager *manager);
|
||||||
|
|
||||||
void _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
void _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||||
const CoglMatrix *projection,
|
const CoglMatrix *projection,
|
||||||
const float *viewport,
|
const float *viewport,
|
||||||
const ClutterVertex *vertices_in,
|
const graphene_point3d_t *vertices_in,
|
||||||
ClutterVertex *vertices_out,
|
graphene_point3d_t *vertices_out,
|
||||||
int n_vertices);
|
int n_vertices);
|
||||||
|
|
||||||
void _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
void _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
||||||
ClutterRect *dest);
|
graphene_rect_t *dest);
|
||||||
|
|
||||||
void _clutter_util_rectangle_int_extents (const ClutterRect *src,
|
void _clutter_util_rectangle_int_extents (const graphene_rect_t *src,
|
||||||
cairo_rectangle_int_t *dest);
|
cairo_rectangle_int_t *dest);
|
||||||
|
|
||||||
void _clutter_util_rectangle_offset (const cairo_rectangle_int_t *src,
|
void _clutter_util_rectangle_offset (const cairo_rectangle_int_t *src,
|
||||||
@@ -282,10 +280,10 @@ void _clutter_util_matrix_skew_yz (ClutterMatrix *matrix,
|
|||||||
float factor);
|
float factor);
|
||||||
|
|
||||||
gboolean _clutter_util_matrix_decompose (const ClutterMatrix *src,
|
gboolean _clutter_util_matrix_decompose (const ClutterMatrix *src,
|
||||||
ClutterVertex *scale_p,
|
graphene_point3d_t *scale_p,
|
||||||
float shear_p[3],
|
float shear_p[3],
|
||||||
ClutterVertex *rotate_p,
|
graphene_point3d_t *rotate_p,
|
||||||
ClutterVertex *translate_p,
|
graphene_point3d_t *translate_p,
|
||||||
ClutterVertex4 *perspective_p);
|
ClutterVertex4 *perspective_p);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
@@ -296,8 +294,8 @@ PangoDirection _clutter_pango_find_base_dir (const gchar *text,
|
|||||||
|
|
||||||
typedef struct _ClutterPlane
|
typedef struct _ClutterPlane
|
||||||
{
|
{
|
||||||
float v0[3];
|
graphene_vec3_t v0;
|
||||||
float n[3];
|
graphene_vec3_t n;
|
||||||
} ClutterPlane;
|
} ClutterPlane;
|
||||||
|
|
||||||
typedef enum _ClutterCullResult
|
typedef enum _ClutterCullResult
|
||||||
@@ -315,6 +313,8 @@ gboolean _clutter_run_progress_function (GType gtype,
|
|||||||
gdouble progress,
|
gdouble progress,
|
||||||
GValue *retval);
|
GValue *retval);
|
||||||
|
|
||||||
|
void clutter_timeline_cancel_delay (ClutterTimeline *timeline);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_PRIVATE_H__ */
|
#endif /* __CLUTTER_PRIVATE_H__ */
|
||||||
|
@@ -352,63 +352,64 @@ _clutter_script_parse_knot (ClutterScript *script,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
parse_geometry_from_array (JsonArray *array,
|
parse_rect_from_array (JsonArray *array,
|
||||||
ClutterGeometry *geometry)
|
graphene_rect_t *rect)
|
||||||
{
|
{
|
||||||
if (json_array_get_length (array) != 4)
|
if (json_array_get_length (array) != 4)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
geometry->x = json_array_get_int_element (array, 0);
|
graphene_rect_init (rect,
|
||||||
geometry->y = json_array_get_int_element (array, 1);
|
json_array_get_int_element (array, 0),
|
||||||
geometry->width = json_array_get_int_element (array, 2);
|
json_array_get_int_element (array, 1),
|
||||||
geometry->height = json_array_get_int_element (array, 3);
|
json_array_get_int_element (array, 2),
|
||||||
|
json_array_get_int_element (array, 3));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
parse_geometry_from_object (JsonObject *object,
|
parse_rect_from_object (JsonObject *object,
|
||||||
ClutterGeometry *geometry)
|
graphene_rect_t *rect)
|
||||||
{
|
{
|
||||||
if (json_object_has_member (object, "x"))
|
if (json_object_has_member (object, "x"))
|
||||||
geometry->x = json_object_get_int_member (object, "x");
|
rect->origin.x = json_object_get_int_member (object, "x");
|
||||||
else
|
else
|
||||||
geometry->x = 0;
|
rect->origin.x = 0;
|
||||||
|
|
||||||
if (json_object_has_member (object, "y"))
|
if (json_object_has_member (object, "y"))
|
||||||
geometry->y = json_object_get_int_member (object, "y");
|
rect->origin.y = json_object_get_int_member (object, "y");
|
||||||
else
|
else
|
||||||
geometry->y = 0;
|
rect->origin.y = 0;
|
||||||
|
|
||||||
if (json_object_has_member (object, "width"))
|
if (json_object_has_member (object, "width"))
|
||||||
geometry->width = json_object_get_int_member (object, "width");
|
rect->size.width = json_object_get_int_member (object, "width");
|
||||||
else
|
else
|
||||||
geometry->width = 0;
|
rect->size.width = 0;
|
||||||
|
|
||||||
if (json_object_has_member (object, "height"))
|
if (json_object_has_member (object, "height"))
|
||||||
geometry->height = json_object_get_int_member (object, "height");
|
rect->size.height = json_object_get_int_member (object, "height");
|
||||||
else
|
else
|
||||||
geometry->height = 0;
|
rect->size.height = 0;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_clutter_script_parse_geometry (ClutterScript *script,
|
_clutter_script_parse_rect (ClutterScript *script,
|
||||||
JsonNode *node,
|
JsonNode *node,
|
||||||
ClutterGeometry *geometry)
|
graphene_rect_t *rect)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
||||||
g_return_val_if_fail (node != NULL, FALSE);
|
g_return_val_if_fail (node != NULL, FALSE);
|
||||||
g_return_val_if_fail (geometry != NULL, FALSE);
|
g_return_val_if_fail (rect != NULL, FALSE);
|
||||||
|
|
||||||
switch (JSON_NODE_TYPE (node))
|
switch (JSON_NODE_TYPE (node))
|
||||||
{
|
{
|
||||||
case JSON_NODE_ARRAY:
|
case JSON_NODE_ARRAY:
|
||||||
return parse_geometry_from_array (json_node_get_array (node), geometry);
|
return parse_rect_from_array (json_node_get_array (node), rect);
|
||||||
|
|
||||||
case JSON_NODE_OBJECT:
|
case JSON_NODE_OBJECT:
|
||||||
return parse_geometry_from_object (json_node_get_object (node), geometry);
|
return parse_rect_from_object (json_node_get_object (node), rect);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -492,8 +493,8 @@ _clutter_script_parse_color (ClutterScript *script,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
parse_point_from_array (JsonArray *array,
|
parse_point_from_array (JsonArray *array,
|
||||||
ClutterPoint *point)
|
graphene_point_t *point)
|
||||||
{
|
{
|
||||||
if (json_array_get_length (array) != 2)
|
if (json_array_get_length (array) != 2)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -505,8 +506,8 @@ parse_point_from_array (JsonArray *array,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
parse_point_from_object (JsonObject *object,
|
parse_point_from_object (JsonObject *object,
|
||||||
ClutterPoint *point)
|
graphene_point_t *point)
|
||||||
{
|
{
|
||||||
if (json_object_has_member (object, "x"))
|
if (json_object_has_member (object, "x"))
|
||||||
point->x = json_object_get_double_member (object, "x");
|
point->x = json_object_get_double_member (object, "x");
|
||||||
@@ -522,9 +523,9 @@ parse_point_from_object (JsonObject *object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_clutter_script_parse_point (ClutterScript *script,
|
_clutter_script_parse_point (ClutterScript *script,
|
||||||
JsonNode *node,
|
JsonNode *node,
|
||||||
ClutterPoint *point)
|
graphene_point_t *point)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
||||||
g_return_val_if_fail (node != NULL, FALSE);
|
g_return_val_if_fail (node != NULL, FALSE);
|
||||||
@@ -546,8 +547,8 @@ _clutter_script_parse_point (ClutterScript *script,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
parse_size_from_array (JsonArray *array,
|
parse_size_from_array (JsonArray *array,
|
||||||
ClutterSize *size)
|
graphene_size_t *size)
|
||||||
{
|
{
|
||||||
if (json_array_get_length (array) != 2)
|
if (json_array_get_length (array) != 2)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -559,8 +560,8 @@ parse_size_from_array (JsonArray *array,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
parse_size_from_object (JsonObject *object,
|
parse_size_from_object (JsonObject *object,
|
||||||
ClutterSize *size)
|
graphene_size_t *size)
|
||||||
{
|
{
|
||||||
if (json_object_has_member (object, "width"))
|
if (json_object_has_member (object, "width"))
|
||||||
size->width = json_object_get_double_member (object, "width");
|
size->width = json_object_get_double_member (object, "width");
|
||||||
@@ -576,9 +577,9 @@ parse_size_from_object (JsonObject *object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_clutter_script_parse_size (ClutterScript *script,
|
_clutter_script_parse_size (ClutterScript *script,
|
||||||
JsonNode *node,
|
JsonNode *node,
|
||||||
ClutterSize *size)
|
graphene_size_t *size)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
||||||
g_return_val_if_fail (node != NULL, FALSE);
|
g_return_val_if_fail (node != NULL, FALSE);
|
||||||
@@ -1328,11 +1329,11 @@ _clutter_script_parse_node (ClutterScript *script,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (p_type == CLUTTER_TYPE_GEOMETRY)
|
else if (p_type == GRAPHENE_TYPE_RECT)
|
||||||
{
|
{
|
||||||
ClutterGeometry geom = { 0, };
|
graphene_rect_t rect = GRAPHENE_RECT_INIT_ZERO;
|
||||||
|
|
||||||
/* geometry := {
|
/* rect := {
|
||||||
* "x" : (int),
|
* "x" : (int),
|
||||||
* "y" : (int),
|
* "y" : (int),
|
||||||
* "width" : (int),
|
* "width" : (int),
|
||||||
@@ -1340,9 +1341,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
|||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (_clutter_script_parse_geometry (script, node, &geom))
|
if (_clutter_script_parse_rect (script, node, &rect))
|
||||||
{
|
{
|
||||||
g_value_set_boxed (value, &geom);
|
g_value_set_boxed (value, &rect);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1364,9 +1365,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (p_type == CLUTTER_TYPE_POINT)
|
else if (p_type == GRAPHENE_TYPE_POINT)
|
||||||
{
|
{
|
||||||
ClutterPoint point = CLUTTER_POINT_INIT_ZERO;
|
graphene_point_t point = GRAPHENE_POINT_INIT_ZERO;
|
||||||
|
|
||||||
if (_clutter_script_parse_point (script, node, &point))
|
if (_clutter_script_parse_point (script, node, &point))
|
||||||
{
|
{
|
||||||
@@ -1374,9 +1375,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (p_type == CLUTTER_TYPE_SIZE)
|
else if (p_type == GRAPHENE_TYPE_SIZE)
|
||||||
{
|
{
|
||||||
ClutterSize size = CLUTTER_SIZE_INIT_ZERO;
|
graphene_size_t size = GRAPHENE_SIZE_INIT_ZERO;
|
||||||
|
|
||||||
if (_clutter_script_parse_size (script, node, &size))
|
if (_clutter_script_parse_size (script, node, &size))
|
||||||
{
|
{
|
||||||
@@ -1417,15 +1418,15 @@ _clutter_script_parse_node (ClutterScript *script,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_GEOMETRY))
|
else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_RECT))
|
||||||
{
|
{
|
||||||
ClutterGeometry geom = { 0, };
|
graphene_rect_t rect = GRAPHENE_RECT_INIT_ZERO;
|
||||||
|
|
||||||
/* geometry := [ (int), (int), (int), (int) ] */
|
/* rect := [ (int), (int), (int), (int) ] */
|
||||||
|
|
||||||
if (_clutter_script_parse_geometry (script, node, &geom))
|
if (_clutter_script_parse_rect (script, node, &rect))
|
||||||
{
|
{
|
||||||
g_value_set_boxed (value, &geom);
|
g_value_set_boxed (value, &rect);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1441,9 +1442,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_POINT))
|
else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_POINT))
|
||||||
{
|
{
|
||||||
ClutterPoint point = CLUTTER_POINT_INIT_ZERO;
|
graphene_point_t point = GRAPHENE_POINT_INIT_ZERO;
|
||||||
|
|
||||||
if (_clutter_script_parse_point (script, node, &point))
|
if (_clutter_script_parse_point (script, node, &point))
|
||||||
{
|
{
|
||||||
@@ -1451,9 +1452,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_SIZE))
|
else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_SIZE))
|
||||||
{
|
{
|
||||||
ClutterSize size = CLUTTER_SIZE_INIT_ZERO;
|
graphene_size_t size = GRAPHENE_SIZE_INIT_ZERO;
|
||||||
|
|
||||||
if (_clutter_script_parse_size (script, node, &size))
|
if (_clutter_script_parse_size (script, node, &size))
|
||||||
{
|
{
|
||||||
|
@@ -122,20 +122,20 @@ gboolean _clutter_script_flags_from_string (GType gtype,
|
|||||||
gboolean _clutter_script_parse_knot (ClutterScript *script,
|
gboolean _clutter_script_parse_knot (ClutterScript *script,
|
||||||
JsonNode *node,
|
JsonNode *node,
|
||||||
ClutterKnot *knot);
|
ClutterKnot *knot);
|
||||||
gboolean _clutter_script_parse_geometry (ClutterScript *script,
|
gboolean _clutter_script_parse_rect (ClutterScript *script,
|
||||||
JsonNode *node,
|
JsonNode *node,
|
||||||
ClutterGeometry *geometry);
|
graphene_rect_t *rect);
|
||||||
gboolean _clutter_script_parse_color (ClutterScript *script,
|
gboolean _clutter_script_parse_color (ClutterScript *script,
|
||||||
JsonNode *node,
|
JsonNode *node,
|
||||||
ClutterColor *color);
|
ClutterColor *color);
|
||||||
GObject *_clutter_script_parse_alpha (ClutterScript *script,
|
GObject *_clutter_script_parse_alpha (ClutterScript *script,
|
||||||
JsonNode *node);
|
JsonNode *node);
|
||||||
gboolean _clutter_script_parse_point (ClutterScript *script,
|
gboolean _clutter_script_parse_point (ClutterScript *script,
|
||||||
JsonNode *node,
|
JsonNode *node,
|
||||||
ClutterPoint *point);
|
graphene_point_t *point);
|
||||||
gboolean _clutter_script_parse_size (ClutterScript *script,
|
gboolean _clutter_script_parse_size (ClutterScript *script,
|
||||||
JsonNode *node,
|
JsonNode *node,
|
||||||
ClutterSize *size);
|
graphene_size_t *size);
|
||||||
|
|
||||||
gboolean _clutter_script_parse_translatable_string (ClutterScript *script,
|
gboolean _clutter_script_parse_translatable_string (ClutterScript *script,
|
||||||
JsonNode *node,
|
JsonNode *node,
|
||||||
|
@@ -75,65 +75,6 @@
|
|||||||
* packing rules of Clutter still apply, and an actor cannot be packed
|
* packing rules of Clutter still apply, and an actor cannot be packed
|
||||||
* in multiple containers without unparenting it in between).
|
* in multiple containers without unparenting it in between).
|
||||||
*
|
*
|
||||||
* Behaviours and timelines can also be defined inside a UI definition
|
|
||||||
* buffer:
|
|
||||||
*
|
|
||||||
* <informalexample><programlisting><![CDATA[
|
|
||||||
* {
|
|
||||||
* "id" : "rotate-behaviour",
|
|
||||||
* "type" : "ClutterBehaviourRotate",
|
|
||||||
* "angle-start" : 0.0,
|
|
||||||
* "angle-end" : 360.0,
|
|
||||||
* "axis" : "z-axis",
|
|
||||||
* "alpha" : {
|
|
||||||
* "timeline" : { "duration" : 4000, "loop" : true },
|
|
||||||
* "mode" : "easeInSine"
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* ]]></programlisting></informalexample>
|
|
||||||
*
|
|
||||||
* And then to apply a defined behaviour to an actor defined inside the
|
|
||||||
* definition of an actor, the "behaviour" member can be used:
|
|
||||||
*
|
|
||||||
* <informalexample><programlisting><![CDATA[
|
|
||||||
* {
|
|
||||||
* "id" : "my-rotating-actor",
|
|
||||||
* "type" : "ClutterTexture",
|
|
||||||
* ...
|
|
||||||
* "behaviours" : [ "rotate-behaviour" ]
|
|
||||||
* }
|
|
||||||
* ]]></programlisting></informalexample>
|
|
||||||
*
|
|
||||||
* A #ClutterAlpha belonging to a #ClutterBehaviour can only be defined
|
|
||||||
* implicitly like in the example above, or explicitly by setting the
|
|
||||||
* "alpha" property to point to a previously defined #ClutterAlpha, e.g.:
|
|
||||||
*
|
|
||||||
* <informalexample><programlisting><![CDATA[
|
|
||||||
* {
|
|
||||||
* "id" : "rotate-behaviour",
|
|
||||||
* "type" : "ClutterBehaviourRotate",
|
|
||||||
* "angle-start" : 0.0,
|
|
||||||
* "angle-end" : 360.0,
|
|
||||||
* "axis" : "z-axis",
|
|
||||||
* "alpha" : {
|
|
||||||
* "id" : "rotate-alpha",
|
|
||||||
* "type" : "ClutterAlpha",
|
|
||||||
* "timeline" : {
|
|
||||||
* "id" : "rotate-timeline",
|
|
||||||
* "type : "ClutterTimeline",
|
|
||||||
* "duration" : 4000,
|
|
||||||
* "loop" : true
|
|
||||||
* },
|
|
||||||
* "function" : "custom_sine_alpha"
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* ]]></programlisting></informalexample>
|
|
||||||
*
|
|
||||||
* Implicitely defined #ClutterAlpha<!-- -->s and #ClutterTimeline<!-- -->s
|
|
||||||
* can omit the `id`, as well as the `type` members, but will not be available
|
|
||||||
* using clutter_script_get_object() (they can, however, be extracted using the
|
|
||||||
* #ClutterBehaviour and #ClutterAlpha API respectively).
|
|
||||||
*
|
|
||||||
* Signal handlers can be defined inside a Clutter UI definition file and
|
* Signal handlers can be defined inside a Clutter UI definition file and
|
||||||
* then autoconnected to their respective signals using the
|
* then autoconnected to their respective signals using the
|
||||||
* clutter_script_connect_signals() function:
|
* clutter_script_connect_signals() function:
|
||||||
@@ -210,7 +151,6 @@
|
|||||||
* function
|
* function
|
||||||
* "type_func" := the GType function name, for non-standard classes
|
* "type_func" := the GType function name, for non-standard classes
|
||||||
* "children" := an array of names or objects to add as children
|
* "children" := an array of names or objects to add as children
|
||||||
* "behaviours" := an array of names or objects to apply to an actor
|
|
||||||
* "signals" := an array of signal definitions to connect to an object
|
* "signals" := an array of signal definitions to connect to an object
|
||||||
* "is-default" := a boolean flag used when defining the #ClutterStage;
|
* "is-default" := a boolean flag used when defining the #ClutterStage;
|
||||||
* if set to "true" the default stage will be used instead
|
* if set to "true" the default stage will be used instead
|
||||||
@@ -246,7 +186,6 @@
|
|||||||
#include "clutter-debug.h"
|
#include "clutter-debug.h"
|
||||||
|
|
||||||
#include "deprecated/clutter-alpha.h"
|
#include "deprecated/clutter-alpha.h"
|
||||||
#include "deprecated/clutter-behaviour.h"
|
|
||||||
#include "deprecated/clutter-container.h"
|
#include "deprecated/clutter-container.h"
|
||||||
#include "deprecated/clutter-state.h"
|
#include "deprecated/clutter-state.h"
|
||||||
|
|
||||||
@@ -524,11 +463,10 @@ clutter_script_init (ClutterScript *script)
|
|||||||
/**
|
/**
|
||||||
* clutter_script_new:
|
* clutter_script_new:
|
||||||
*
|
*
|
||||||
* Creates a new #ClutterScript instance. #ClutterScript can be used
|
* Creates a new #ClutterScript instance. #ClutterScript can be used to load
|
||||||
* to load objects definitions for scenegraph elements, like actors,
|
* objects definitions for scenegraph elements, like actors, or behavioural
|
||||||
* or behavioural elements, like behaviours and timelines. The
|
* elements, like timelines. The definitions must be encoded using the
|
||||||
* definitions must be encoded using the JavaScript Object Notation (JSON)
|
* JavaScript Object Notation (JSON) language.
|
||||||
* language.
|
|
||||||
*
|
*
|
||||||
* Return value: the newly created #ClutterScript instance. Use
|
* Return value: the newly created #ClutterScript instance. Use
|
||||||
* g_object_unref() when done.
|
* g_object_unref() when done.
|
||||||
@@ -863,9 +801,7 @@ construct_each_objects (gpointer key,
|
|||||||
if (oinfo->object == NULL)
|
if (oinfo->object == NULL)
|
||||||
_clutter_script_construct_object (script, oinfo);
|
_clutter_script_construct_object (script, oinfo);
|
||||||
|
|
||||||
/* this will take care of setting up properties,
|
/* this will take care of setting up properties and adding children */
|
||||||
* adding children and applying behaviours
|
|
||||||
*/
|
|
||||||
_clutter_script_apply_properties (script, oinfo);
|
_clutter_script_apply_properties (script, oinfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
struct _ClutterScrollActorPrivate
|
struct _ClutterScrollActorPrivate
|
||||||
{
|
{
|
||||||
ClutterPoint scroll_to;
|
graphene_point_t scroll_to;
|
||||||
|
|
||||||
ClutterScrollMode scroll_mode;
|
ClutterScrollMode scroll_mode;
|
||||||
|
|
||||||
@@ -94,19 +94,19 @@ G_DEFINE_TYPE_WITH_CODE (ClutterScrollActor, clutter_scroll_actor, CLUTTER_TYPE_
|
|||||||
clutter_animatable_iface_init))
|
clutter_animatable_iface_init))
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_scroll_actor_set_scroll_to_internal (ClutterScrollActor *self,
|
clutter_scroll_actor_set_scroll_to_internal (ClutterScrollActor *self,
|
||||||
const ClutterPoint *point)
|
const graphene_point_t *point)
|
||||||
{
|
{
|
||||||
ClutterScrollActorPrivate *priv = self->priv;
|
ClutterScrollActorPrivate *priv = self->priv;
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (self);
|
ClutterActor *actor = CLUTTER_ACTOR (self);
|
||||||
ClutterMatrix m = CLUTTER_MATRIX_INIT_IDENTITY;
|
ClutterMatrix m = CLUTTER_MATRIX_INIT_IDENTITY;
|
||||||
float dx, dy;
|
float dx, dy;
|
||||||
|
|
||||||
if (clutter_point_equals (&priv->scroll_to, point))
|
if (graphene_point_equal (&priv->scroll_to, point))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (point == NULL)
|
if (point == NULL)
|
||||||
clutter_point_init (&priv->scroll_to, 0.f, 0.f);
|
graphene_point_init (&priv->scroll_to, 0.f, 0.f);
|
||||||
else
|
else
|
||||||
priv->scroll_to = *point;
|
priv->scroll_to = *point;
|
||||||
|
|
||||||
@@ -216,7 +216,7 @@ clutter_scroll_actor_set_final_state (ClutterAnimatable *animatable,
|
|||||||
if (strcmp (property_name, "scroll-to") == 0)
|
if (strcmp (property_name, "scroll-to") == 0)
|
||||||
{
|
{
|
||||||
ClutterScrollActor *self = CLUTTER_SCROLL_ACTOR (animatable);
|
ClutterScrollActor *self = CLUTTER_SCROLL_ACTOR (animatable);
|
||||||
const ClutterPoint *point = g_value_get_boxed (value);
|
const graphene_point_t *point = g_value_get_boxed (value);
|
||||||
|
|
||||||
clutter_scroll_actor_set_scroll_to_internal (self, point);
|
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",
|
g_param_spec_boxed ("scroll-to",
|
||||||
"Scroll To",
|
"Scroll To",
|
||||||
"The point to scroll the actor to",
|
"The point to scroll the actor to",
|
||||||
CLUTTER_TYPE_POINT,
|
GRAPHENE_TYPE_POINT,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS |
|
G_PARAM_STATIC_STRINGS |
|
||||||
CLUTTER_PARAM_ANIMATABLE);
|
CLUTTER_PARAM_ANIMATABLE);
|
||||||
@@ -322,7 +322,7 @@ clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor)
|
|||||||
/**
|
/**
|
||||||
* clutter_scroll_actor_scroll_to_point:
|
* clutter_scroll_actor_scroll_to_point:
|
||||||
* @actor: a #ClutterScrollActor
|
* @actor: a #ClutterScrollActor
|
||||||
* @point: a #ClutterPoint
|
* @point: a #graphene_point_t
|
||||||
*
|
*
|
||||||
* Scrolls the contents of @actor so that @point is the new origin
|
* Scrolls the contents of @actor so that @point is the new origin
|
||||||
* of the visible area.
|
* of the visible area.
|
||||||
@@ -335,8 +335,8 @@ clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor)
|
|||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||||
const ClutterPoint *point)
|
const graphene_point_t *point)
|
||||||
{
|
{
|
||||||
ClutterScrollActorPrivate *priv;
|
ClutterScrollActorPrivate *priv;
|
||||||
const ClutterAnimationInfo *info;
|
const ClutterAnimationInfo *info;
|
||||||
@@ -390,10 +390,10 @@ clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
|||||||
|
|
||||||
/* if a transition already exist, update its bounds */
|
/* if a transition already exist, update its bounds */
|
||||||
clutter_transition_set_from (priv->transition,
|
clutter_transition_set_from (priv->transition,
|
||||||
CLUTTER_TYPE_POINT,
|
GRAPHENE_TYPE_POINT,
|
||||||
&priv->scroll_to);
|
&priv->scroll_to);
|
||||||
clutter_transition_set_to (priv->transition,
|
clutter_transition_set_to (priv->transition,
|
||||||
CLUTTER_TYPE_POINT,
|
GRAPHENE_TYPE_POINT,
|
||||||
point);
|
point);
|
||||||
|
|
||||||
/* always use the current easing state */
|
/* always use the current easing state */
|
||||||
@@ -417,10 +417,10 @@ clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
|||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||||
const ClutterRect *rect)
|
const graphene_rect_t *rect)
|
||||||
{
|
{
|
||||||
ClutterRect n_rect;
|
graphene_rect_t n_rect;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_SCROLL_ACTOR (actor));
|
g_return_if_fail (CLUTTER_IS_SCROLL_ACTOR (actor));
|
||||||
g_return_if_fail (rect != NULL);
|
g_return_if_fail (rect != NULL);
|
||||||
@@ -428,7 +428,7 @@ clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
|||||||
n_rect = *rect;
|
n_rect = *rect;
|
||||||
|
|
||||||
/* normalize, so that we have a valid origin */
|
/* normalize, so that we have a valid origin */
|
||||||
clutter_rect_normalize (&n_rect);
|
graphene_rect_normalize (&n_rect);
|
||||||
|
|
||||||
clutter_scroll_actor_scroll_to_point (actor, &n_rect.origin);
|
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);
|
ClutterScrollMode clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
void clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||||
const ClutterPoint *point);
|
const graphene_point_t *point);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
void clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||||
const ClutterRect *rect);
|
const graphene_rect_t *rect);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@@ -177,18 +177,18 @@ clutter_shader_effect_clear (ClutterShaderEffect *self,
|
|||||||
{
|
{
|
||||||
ClutterShaderEffectPrivate *priv = self->priv;
|
ClutterShaderEffectPrivate *priv = self->priv;
|
||||||
|
|
||||||
if (priv->shader != COGL_INVALID_HANDLE)
|
if (priv->shader != NULL)
|
||||||
{
|
{
|
||||||
cogl_handle_unref (priv->shader);
|
cogl_object_unref (priv->shader);
|
||||||
|
|
||||||
priv->shader = COGL_INVALID_HANDLE;
|
priv->shader = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->program != COGL_INVALID_HANDLE)
|
if (priv->program != NULL)
|
||||||
{
|
{
|
||||||
cogl_handle_unref (priv->program);
|
cogl_object_unref (priv->program);
|
||||||
|
|
||||||
priv->program = COGL_INVALID_HANDLE;
|
priv->program = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reset_uniforms && priv->uniforms != NULL)
|
if (reset_uniforms && priv->uniforms != NULL)
|
||||||
@@ -208,7 +208,7 @@ clutter_shader_effect_update_uniforms (ClutterShaderEffect *effect)
|
|||||||
gpointer key, value;
|
gpointer key, value;
|
||||||
gsize size;
|
gsize size;
|
||||||
|
|
||||||
if (priv->program == COGL_INVALID_HANDLE)
|
if (priv->program == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (priv->uniforms == NULL)
|
if (priv->uniforms == NULL)
|
||||||
@@ -333,7 +333,7 @@ clutter_shader_effect_create_shader (ClutterShaderEffect *self)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
return COGL_INVALID_HANDLE;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,7 +353,7 @@ clutter_shader_effect_try_static_source (ClutterShaderEffect *self)
|
|||||||
CLUTTER_TYPE_SHADER_EFFECT,
|
CLUTTER_TYPE_SHADER_EFFECT,
|
||||||
ClutterShaderEffectClassPrivate);
|
ClutterShaderEffectClassPrivate);
|
||||||
|
|
||||||
if (class_priv->shader == COGL_INVALID_HANDLE)
|
if (class_priv->shader == NULL)
|
||||||
{
|
{
|
||||||
gchar *source;
|
gchar *source;
|
||||||
|
|
||||||
@@ -387,10 +387,10 @@ clutter_shader_effect_try_static_source (ClutterShaderEffect *self)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->shader = cogl_handle_ref (class_priv->shader);
|
priv->shader = cogl_object_ref (class_priv->shader);
|
||||||
|
|
||||||
if (class_priv->program != COGL_INVALID_HANDLE)
|
if (class_priv->program != NULL)
|
||||||
priv->program = cogl_handle_ref (class_priv->program);
|
priv->program = cogl_object_ref (class_priv->program);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,13 +404,13 @@ clutter_shader_effect_paint_target (ClutterOffscreenEffect *effect)
|
|||||||
|
|
||||||
/* If the source hasn't been set then we'll try to get it from the
|
/* If the source hasn't been set then we'll try to get it from the
|
||||||
static source instead */
|
static source instead */
|
||||||
if (priv->shader == COGL_INVALID_HANDLE)
|
if (priv->shader == NULL)
|
||||||
clutter_shader_effect_try_static_source (self);
|
clutter_shader_effect_try_static_source (self);
|
||||||
|
|
||||||
/* we haven't been prepared or we don't have support for
|
/* we haven't been prepared or we don't have support for
|
||||||
* GLSL shaders in Clutter
|
* GLSL shaders in Clutter
|
||||||
*/
|
*/
|
||||||
if (priv->program == COGL_INVALID_HANDLE)
|
if (priv->program == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
CLUTTER_NOTE (SHADER, "Applying the shader effect of type '%s'",
|
CLUTTER_NOTE (SHADER, "Applying the shader effect of type '%s'",
|
||||||
@@ -500,6 +500,7 @@ static void
|
|||||||
clutter_shader_effect_init (ClutterShaderEffect *effect)
|
clutter_shader_effect_init (ClutterShaderEffect *effect)
|
||||||
{
|
{
|
||||||
effect->priv = clutter_shader_effect_get_instance_private (effect);
|
effect->priv = clutter_shader_effect_get_instance_private (effect);
|
||||||
|
effect->priv->shader_type = CLUTTER_FRAGMENT_SHADER;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -533,7 +534,7 @@ clutter_shader_effect_new (ClutterShaderType shader_type)
|
|||||||
* Retrieves a pointer to the shader's handle
|
* Retrieves a pointer to the shader's handle
|
||||||
*
|
*
|
||||||
* Return value: (transfer none): a pointer to the shader's handle,
|
* Return value: (transfer none): a pointer to the shader's handle,
|
||||||
* or %COGL_INVALID_HANDLE
|
* or %NULL
|
||||||
*
|
*
|
||||||
* Since: 1.4
|
* Since: 1.4
|
||||||
*/
|
*/
|
||||||
@@ -541,7 +542,7 @@ CoglHandle
|
|||||||
clutter_shader_effect_get_shader (ClutterShaderEffect *effect)
|
clutter_shader_effect_get_shader (ClutterShaderEffect *effect)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (CLUTTER_IS_SHADER_EFFECT (effect),
|
g_return_val_if_fail (CLUTTER_IS_SHADER_EFFECT (effect),
|
||||||
COGL_INVALID_HANDLE);
|
NULL);
|
||||||
|
|
||||||
return effect->priv->shader;
|
return effect->priv->shader;
|
||||||
}
|
}
|
||||||
@@ -553,7 +554,7 @@ clutter_shader_effect_get_shader (ClutterShaderEffect *effect)
|
|||||||
* Retrieves a pointer to the program's handle
|
* Retrieves a pointer to the program's handle
|
||||||
*
|
*
|
||||||
* Return value: (transfer none): a pointer to the program's handle,
|
* Return value: (transfer none): a pointer to the program's handle,
|
||||||
* or %COGL_INVALID_HANDLE
|
* or %NULL
|
||||||
*
|
*
|
||||||
* Since: 1.4
|
* Since: 1.4
|
||||||
*/
|
*/
|
||||||
@@ -561,7 +562,7 @@ CoglHandle
|
|||||||
clutter_shader_effect_get_program (ClutterShaderEffect *effect)
|
clutter_shader_effect_get_program (ClutterShaderEffect *effect)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (CLUTTER_IS_SHADER_EFFECT (effect),
|
g_return_val_if_fail (CLUTTER_IS_SHADER_EFFECT (effect),
|
||||||
COGL_INVALID_HANDLE);
|
NULL);
|
||||||
|
|
||||||
return effect->priv->program;
|
return effect->priv->program;
|
||||||
}
|
}
|
||||||
@@ -891,7 +892,7 @@ clutter_shader_effect_set_shader_source (ClutterShaderEffect *effect,
|
|||||||
|
|
||||||
priv = effect->priv;
|
priv = effect->priv;
|
||||||
|
|
||||||
if (priv->shader != COGL_INVALID_HANDLE)
|
if (priv->shader != NULL)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
priv->shader = clutter_shader_effect_create_shader (effect);
|
priv->shader = clutter_shader_effect_create_shader (effect);
|
||||||
|
@@ -79,18 +79,18 @@ gint64 _clutter_stage_get_update_time (ClutterStage *stage);
|
|||||||
void _clutter_stage_clear_update_time (ClutterStage *stage);
|
void _clutter_stage_clear_update_time (ClutterStage *stage);
|
||||||
gboolean _clutter_stage_has_full_redraw_queued (ClutterStage *stage);
|
gboolean _clutter_stage_has_full_redraw_queued (ClutterStage *stage);
|
||||||
|
|
||||||
void clutter_stage_log_pick (ClutterStage *stage,
|
void clutter_stage_log_pick (ClutterStage *stage,
|
||||||
const ClutterPoint *vertices,
|
const graphene_point_t *vertices,
|
||||||
ClutterActor *actor);
|
ClutterActor *actor);
|
||||||
|
|
||||||
void clutter_stage_push_pick_clip (ClutterStage *stage,
|
void clutter_stage_push_pick_clip (ClutterStage *stage,
|
||||||
const ClutterPoint *vertices);
|
const graphene_point_t *vertices);
|
||||||
|
|
||||||
void clutter_stage_pop_pick_clip (ClutterStage *stage);
|
void clutter_stage_pop_pick_clip (ClutterStage *stage);
|
||||||
|
|
||||||
ClutterActor *_clutter_stage_do_pick (ClutterStage *stage,
|
ClutterActor *_clutter_stage_do_pick (ClutterStage *stage,
|
||||||
gint x,
|
float x,
|
||||||
gint y,
|
float y,
|
||||||
ClutterPickMode mode);
|
ClutterPickMode mode);
|
||||||
|
|
||||||
ClutterPaintVolume *_clutter_stage_paint_volume_stack_allocate (ClutterStage *stage);
|
ClutterPaintVolume *_clutter_stage_paint_volume_stack_allocate (ClutterStage *stage);
|
||||||
@@ -133,9 +133,9 @@ gboolean _clutter_stage_update_state (ClutterStage *stag
|
|||||||
|
|
||||||
void _clutter_stage_set_scale_factor (ClutterStage *stage,
|
void _clutter_stage_set_scale_factor (ClutterStage *stage,
|
||||||
int factor);
|
int factor);
|
||||||
gboolean _clutter_stage_get_max_view_scale_factor_for_rect (ClutterStage *stage,
|
gboolean _clutter_stage_get_max_view_scale_factor_for_rect (ClutterStage *stage,
|
||||||
ClutterRect *rect,
|
graphene_rect_t *rect,
|
||||||
float *view_scale);
|
float *view_scale);
|
||||||
|
|
||||||
void _clutter_stage_presented (ClutterStage *stage,
|
void _clutter_stage_presented (ClutterStage *stage,
|
||||||
CoglFrameEvent frame_event,
|
CoglFrameEvent frame_event,
|
||||||
|
@@ -20,8 +20,8 @@
|
|||||||
|
|
||||||
#include "clutter/clutter-stage-view.h"
|
#include "clutter/clutter-stage-view.h"
|
||||||
|
|
||||||
void clutter_stage_view_blit_offscreen (ClutterStageView *view,
|
void clutter_stage_view_after_paint (ClutterStageView *view,
|
||||||
const cairo_rectangle_int_t *clip);
|
const cairo_rectangle_int_t *clip);
|
||||||
|
|
||||||
gboolean clutter_stage_view_is_dirty_viewport (ClutterStageView *view);
|
gboolean clutter_stage_view_is_dirty_viewport (ClutterStageView *view);
|
||||||
|
|
||||||
|
@@ -30,6 +30,7 @@ enum
|
|||||||
PROP_LAYOUT,
|
PROP_LAYOUT,
|
||||||
PROP_FRAMEBUFFER,
|
PROP_FRAMEBUFFER,
|
||||||
PROP_OFFSCREEN,
|
PROP_OFFSCREEN,
|
||||||
|
PROP_SHADOWFB,
|
||||||
PROP_SCALE,
|
PROP_SCALE,
|
||||||
|
|
||||||
PROP_LAST
|
PROP_LAST
|
||||||
@@ -44,7 +45,10 @@ typedef struct _ClutterStageViewPrivate
|
|||||||
CoglFramebuffer *framebuffer;
|
CoglFramebuffer *framebuffer;
|
||||||
|
|
||||||
CoglOffscreen *offscreen;
|
CoglOffscreen *offscreen;
|
||||||
CoglPipeline *pipeline;
|
CoglPipeline *offscreen_pipeline;
|
||||||
|
|
||||||
|
CoglOffscreen *shadowfb;
|
||||||
|
CoglPipeline *shadowfb_pipeline;
|
||||||
|
|
||||||
guint dirty_viewport : 1;
|
guint dirty_viewport : 1;
|
||||||
guint dirty_projection : 1;
|
guint dirty_projection : 1;
|
||||||
@@ -78,6 +82,8 @@ clutter_stage_view_get_framebuffer (ClutterStageView *view)
|
|||||||
|
|
||||||
if (priv->offscreen)
|
if (priv->offscreen)
|
||||||
return priv->offscreen;
|
return priv->offscreen;
|
||||||
|
else if (priv->shadowfb)
|
||||||
|
return priv->shadowfb;
|
||||||
else
|
else
|
||||||
return priv->framebuffer;
|
return priv->framebuffer;
|
||||||
}
|
}
|
||||||
@@ -99,6 +105,24 @@ clutter_stage_view_get_onscreen (ClutterStageView *view)
|
|||||||
return priv->framebuffer;
|
return priv->framebuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static CoglPipeline *
|
||||||
|
clutter_stage_view_create_framebuffer_pipeline (CoglFramebuffer *framebuffer)
|
||||||
|
{
|
||||||
|
CoglPipeline *pipeline;
|
||||||
|
|
||||||
|
pipeline = cogl_pipeline_new (cogl_framebuffer_get_context (framebuffer));
|
||||||
|
|
||||||
|
cogl_pipeline_set_layer_filters (pipeline, 0,
|
||||||
|
COGL_PIPELINE_FILTER_NEAREST,
|
||||||
|
COGL_PIPELINE_FILTER_NEAREST);
|
||||||
|
cogl_pipeline_set_layer_texture (pipeline, 0,
|
||||||
|
cogl_offscreen_get_texture (framebuffer));
|
||||||
|
cogl_pipeline_set_layer_wrap_mode (pipeline, 0,
|
||||||
|
COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE);
|
||||||
|
|
||||||
|
return pipeline;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_view_ensure_offscreen_blit_pipeline (ClutterStageView *view)
|
clutter_stage_view_ensure_offscreen_blit_pipeline (ClutterStageView *view)
|
||||||
{
|
{
|
||||||
@@ -109,21 +133,27 @@ clutter_stage_view_ensure_offscreen_blit_pipeline (ClutterStageView *view)
|
|||||||
|
|
||||||
g_assert (priv->offscreen != NULL);
|
g_assert (priv->offscreen != NULL);
|
||||||
|
|
||||||
if (priv->pipeline)
|
if (priv->offscreen_pipeline)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
priv->pipeline =
|
priv->offscreen_pipeline =
|
||||||
cogl_pipeline_new (cogl_framebuffer_get_context (priv->offscreen));
|
clutter_stage_view_create_framebuffer_pipeline (priv->offscreen);
|
||||||
cogl_pipeline_set_layer_filters (priv->pipeline, 0,
|
|
||||||
COGL_PIPELINE_FILTER_NEAREST,
|
|
||||||
COGL_PIPELINE_FILTER_NEAREST);
|
|
||||||
cogl_pipeline_set_layer_texture (priv->pipeline, 0,
|
|
||||||
cogl_offscreen_get_texture (priv->offscreen));
|
|
||||||
cogl_pipeline_set_layer_wrap_mode (priv->pipeline, 0,
|
|
||||||
COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE);
|
|
||||||
|
|
||||||
if (view_class->setup_offscreen_blit_pipeline)
|
if (view_class->setup_offscreen_blit_pipeline)
|
||||||
view_class->setup_offscreen_blit_pipeline (view, priv->pipeline);
|
view_class->setup_offscreen_blit_pipeline (view, priv->offscreen_pipeline);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_stage_view_ensure_shadowfb_blit_pipeline (ClutterStageView *view)
|
||||||
|
{
|
||||||
|
ClutterStageViewPrivate *priv =
|
||||||
|
clutter_stage_view_get_instance_private (view);
|
||||||
|
|
||||||
|
if (priv->shadowfb_pipeline)
|
||||||
|
return;
|
||||||
|
|
||||||
|
priv->shadowfb_pipeline =
|
||||||
|
clutter_stage_view_create_framebuffer_pipeline (priv->shadowfb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -132,33 +162,93 @@ clutter_stage_view_invalidate_offscreen_blit_pipeline (ClutterStageView *view)
|
|||||||
ClutterStageViewPrivate *priv =
|
ClutterStageViewPrivate *priv =
|
||||||
clutter_stage_view_get_instance_private (view);
|
clutter_stage_view_get_instance_private (view);
|
||||||
|
|
||||||
g_clear_pointer (&priv->pipeline, cogl_object_unref);
|
g_clear_pointer (&priv->offscreen_pipeline, cogl_object_unref);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
clutter_stage_view_blit_offscreen (ClutterStageView *view,
|
clutter_stage_view_copy_to_framebuffer (ClutterStageView *view,
|
||||||
const cairo_rectangle_int_t *rect)
|
const cairo_rectangle_int_t *rect,
|
||||||
|
CoglPipeline *pipeline,
|
||||||
|
CoglFramebuffer *src_framebuffer,
|
||||||
|
CoglFramebuffer *dst_framebuffer,
|
||||||
|
gboolean can_blit)
|
||||||
{
|
{
|
||||||
ClutterStageViewPrivate *priv =
|
|
||||||
clutter_stage_view_get_instance_private (view);
|
|
||||||
CoglMatrix matrix;
|
CoglMatrix matrix;
|
||||||
|
|
||||||
clutter_stage_view_ensure_offscreen_blit_pipeline (view);
|
/* First, try with blit */
|
||||||
cogl_framebuffer_push_matrix (priv->framebuffer);
|
if (can_blit)
|
||||||
|
{
|
||||||
|
if (cogl_blit_framebuffer (src_framebuffer,
|
||||||
|
dst_framebuffer,
|
||||||
|
0, 0,
|
||||||
|
0, 0,
|
||||||
|
cogl_framebuffer_get_width (dst_framebuffer),
|
||||||
|
cogl_framebuffer_get_height (dst_framebuffer),
|
||||||
|
NULL))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If blit fails, fallback to the slower painting method */
|
||||||
|
cogl_framebuffer_push_matrix (dst_framebuffer);
|
||||||
|
|
||||||
/* Set transform so 0,0 is on the top left corner and 1,1 on
|
|
||||||
* the bottom right corner.
|
|
||||||
*/
|
|
||||||
cogl_matrix_init_identity (&matrix);
|
cogl_matrix_init_identity (&matrix);
|
||||||
cogl_matrix_translate (&matrix, -1, 1, 0);
|
cogl_matrix_translate (&matrix, -1, 1, 0);
|
||||||
cogl_matrix_scale (&matrix, 2, -2, 0);
|
cogl_matrix_scale (&matrix, 2, -2, 0);
|
||||||
cogl_framebuffer_set_projection_matrix (priv->framebuffer, &matrix);
|
cogl_framebuffer_set_projection_matrix (dst_framebuffer, &matrix);
|
||||||
|
|
||||||
cogl_framebuffer_draw_rectangle (priv->framebuffer,
|
cogl_framebuffer_draw_rectangle (dst_framebuffer,
|
||||||
priv->pipeline,
|
pipeline,
|
||||||
0, 0, 1, 1);
|
0, 0, 1, 1);
|
||||||
|
|
||||||
cogl_framebuffer_pop_matrix (priv->framebuffer);
|
cogl_framebuffer_pop_matrix (dst_framebuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
clutter_stage_view_after_paint (ClutterStageView *view,
|
||||||
|
const cairo_rectangle_int_t *rect)
|
||||||
|
{
|
||||||
|
ClutterStageViewPrivate *priv =
|
||||||
|
clutter_stage_view_get_instance_private (view);
|
||||||
|
|
||||||
|
if (priv->offscreen)
|
||||||
|
{
|
||||||
|
gboolean can_blit;
|
||||||
|
CoglMatrix matrix;
|
||||||
|
|
||||||
|
clutter_stage_view_ensure_offscreen_blit_pipeline (view);
|
||||||
|
clutter_stage_view_get_offscreen_transformation_matrix (view, &matrix);
|
||||||
|
can_blit = cogl_matrix_is_identity (&matrix);
|
||||||
|
|
||||||
|
if (priv->shadowfb)
|
||||||
|
{
|
||||||
|
clutter_stage_view_copy_to_framebuffer (view,
|
||||||
|
rect,
|
||||||
|
priv->offscreen_pipeline,
|
||||||
|
priv->offscreen,
|
||||||
|
priv->shadowfb,
|
||||||
|
can_blit);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
clutter_stage_view_copy_to_framebuffer (view,
|
||||||
|
rect,
|
||||||
|
priv->offscreen_pipeline,
|
||||||
|
priv->offscreen,
|
||||||
|
priv->framebuffer,
|
||||||
|
can_blit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (priv->shadowfb)
|
||||||
|
{
|
||||||
|
clutter_stage_view_ensure_shadowfb_blit_pipeline (view);
|
||||||
|
clutter_stage_view_copy_to_framebuffer (view,
|
||||||
|
rect,
|
||||||
|
priv->shadowfb_pipeline,
|
||||||
|
priv->shadowfb,
|
||||||
|
priv->framebuffer,
|
||||||
|
TRUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float
|
float
|
||||||
@@ -258,6 +348,9 @@ clutter_stage_view_get_property (GObject *object,
|
|||||||
case PROP_OFFSCREEN:
|
case PROP_OFFSCREEN:
|
||||||
g_value_set_boxed (value, priv->offscreen);
|
g_value_set_boxed (value, priv->offscreen);
|
||||||
break;
|
break;
|
||||||
|
case PROP_SHADOWFB:
|
||||||
|
g_value_set_boxed (value, priv->shadowfb);
|
||||||
|
break;
|
||||||
case PROP_SCALE:
|
case PROP_SCALE:
|
||||||
g_value_set_float (value, priv->scale);
|
g_value_set_float (value, priv->scale);
|
||||||
break;
|
break;
|
||||||
@@ -303,6 +396,9 @@ clutter_stage_view_set_property (GObject *object,
|
|||||||
case PROP_OFFSCREEN:
|
case PROP_OFFSCREEN:
|
||||||
priv->offscreen = g_value_dup_boxed (value);
|
priv->offscreen = g_value_dup_boxed (value);
|
||||||
break;
|
break;
|
||||||
|
case PROP_SHADOWFB:
|
||||||
|
priv->shadowfb = g_value_dup_boxed (value);
|
||||||
|
break;
|
||||||
case PROP_SCALE:
|
case PROP_SCALE:
|
||||||
priv->scale = g_value_get_float (value);
|
priv->scale = g_value_get_float (value);
|
||||||
break;
|
break;
|
||||||
@@ -319,8 +415,10 @@ clutter_stage_view_dispose (GObject *object)
|
|||||||
clutter_stage_view_get_instance_private (view);
|
clutter_stage_view_get_instance_private (view);
|
||||||
|
|
||||||
g_clear_pointer (&priv->framebuffer, cogl_object_unref);
|
g_clear_pointer (&priv->framebuffer, cogl_object_unref);
|
||||||
|
g_clear_pointer (&priv->shadowfb, cogl_object_unref);
|
||||||
g_clear_pointer (&priv->offscreen, cogl_object_unref);
|
g_clear_pointer (&priv->offscreen, cogl_object_unref);
|
||||||
g_clear_pointer (&priv->pipeline, cogl_object_unref);
|
g_clear_pointer (&priv->offscreen_pipeline, cogl_object_unref);
|
||||||
|
g_clear_pointer (&priv->shadowfb_pipeline, cogl_object_unref);
|
||||||
|
|
||||||
G_OBJECT_CLASS (clutter_stage_view_parent_class)->dispose (object);
|
G_OBJECT_CLASS (clutter_stage_view_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
@@ -375,6 +473,15 @@ clutter_stage_view_class_init (ClutterStageViewClass *klass)
|
|||||||
G_PARAM_CONSTRUCT_ONLY |
|
G_PARAM_CONSTRUCT_ONLY |
|
||||||
G_PARAM_STATIC_STRINGS);
|
G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
obj_props[PROP_SHADOWFB] =
|
||||||
|
g_param_spec_boxed ("shadowfb",
|
||||||
|
"Shadow framebuffer",
|
||||||
|
"Framebuffer used as intermediate shadow buffer",
|
||||||
|
COGL_TYPE_HANDLE,
|
||||||
|
G_PARAM_READWRITE |
|
||||||
|
G_PARAM_CONSTRUCT_ONLY |
|
||||||
|
G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
obj_props[PROP_SCALE] =
|
obj_props[PROP_SCALE] =
|
||||||
g_param_spec_float ("scale",
|
g_param_spec_float ("scale",
|
||||||
"View scale",
|
"View scale",
|
||||||
|
@@ -235,19 +235,35 @@ _clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
cairo_region_t *
|
||||||
_clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
|
_clutter_stage_window_get_redraw_clip (ClutterStageWindow *window)
|
||||||
cairo_rectangle_int_t *stage_clip)
|
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowInterface *iface;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
||||||
|
|
||||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||||
if (iface->get_redraw_clip_bounds != NULL)
|
if (iface->get_redraw_clip != NULL)
|
||||||
return iface->get_redraw_clip_bounds (window, stage_clip);
|
return iface->get_redraw_clip (window);
|
||||||
|
|
||||||
return FALSE;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
_clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
|
||||||
|
cairo_rectangle_int_t *stage_clip)
|
||||||
|
{
|
||||||
|
cairo_region_t *redraw_clip;
|
||||||
|
|
||||||
|
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
||||||
|
|
||||||
|
redraw_clip = _clutter_stage_window_get_redraw_clip (window);
|
||||||
|
if (!redraw_clip)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
cairo_region_get_extents (redraw_clip, stage_clip);
|
||||||
|
cairo_region_destroy (redraw_clip);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -55,9 +55,7 @@ struct _ClutterStageWindowInterface
|
|||||||
cairo_rectangle_int_t *stage_rectangle);
|
cairo_rectangle_int_t *stage_rectangle);
|
||||||
gboolean (* has_redraw_clips) (ClutterStageWindow *stage_window);
|
gboolean (* has_redraw_clips) (ClutterStageWindow *stage_window);
|
||||||
gboolean (* ignoring_redraw_clips) (ClutterStageWindow *stage_window);
|
gboolean (* ignoring_redraw_clips) (ClutterStageWindow *stage_window);
|
||||||
gboolean (* get_redraw_clip_bounds) (ClutterStageWindow *stage_window,
|
cairo_region_t * (* get_redraw_clip) (ClutterStageWindow *stage_window);
|
||||||
cairo_rectangle_int_t *clip);
|
|
||||||
|
|
||||||
|
|
||||||
void (* set_accept_focus) (ClutterStageWindow *stage_window,
|
void (* set_accept_focus) (ClutterStageWindow *stage_window,
|
||||||
gboolean accept_focus);
|
gboolean accept_focus);
|
||||||
@@ -102,6 +100,7 @@ gboolean _clutter_stage_window_has_redraw_clips (ClutterStageWin
|
|||||||
gboolean _clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window);
|
gboolean _clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window);
|
||||||
gboolean _clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
|
gboolean _clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
|
||||||
cairo_rectangle_int_t *clip);
|
cairo_rectangle_int_t *clip);
|
||||||
|
cairo_region_t * _clutter_stage_window_get_redraw_clip (ClutterStageWindow *window);
|
||||||
|
|
||||||
void _clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
|
void _clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
|
||||||
gboolean accept_focus);
|
gboolean accept_focus);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -115,26 +115,6 @@ struct _ClutterPerspective
|
|||||||
gfloat z_far;
|
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)
|
* ClutterFrameInfo: (skip)
|
||||||
*/
|
*/
|
||||||
@@ -153,8 +133,6 @@ typedef struct _ClutterCapture
|
|||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
GType clutter_perspective_get_type (void) G_GNUC_CONST;
|
GType clutter_perspective_get_type (void) G_GNUC_CONST;
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GType clutter_fog_get_type (void) G_GNUC_CONST;
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
GType clutter_stage_get_type (void) G_GNUC_CONST;
|
GType clutter_stage_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
@@ -186,11 +164,6 @@ void clutter_stage_get_minimum_size (ClutterStage
|
|||||||
guint *width,
|
guint *width,
|
||||||
guint *height);
|
guint *height);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_stage_set_no_clear_hint (ClutterStage *stage,
|
|
||||||
gboolean no_clear);
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean clutter_stage_get_no_clear_hint (ClutterStage *stage);
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void clutter_stage_set_use_alpha (ClutterStage *stage,
|
void clutter_stage_set_use_alpha (ClutterStage *stage,
|
||||||
gboolean use_alpha);
|
gboolean use_alpha);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
@@ -223,8 +196,8 @@ gboolean clutter_stage_event (ClutterStage
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
ClutterActor * clutter_stage_get_actor_at_pos (ClutterStage *stage,
|
ClutterActor * clutter_stage_get_actor_at_pos (ClutterStage *stage,
|
||||||
ClutterPickMode pick_mode,
|
ClutterPickMode pick_mode,
|
||||||
gint x,
|
float x,
|
||||||
gint y);
|
float y);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
guchar * clutter_stage_read_pixels (ClutterStage *stage,
|
guchar * clutter_stage_read_pixels (ClutterStage *stage,
|
||||||
gint x,
|
gint x,
|
||||||
@@ -236,6 +209,8 @@ CLUTTER_EXPORT
|
|||||||
void clutter_stage_get_redraw_clip_bounds (ClutterStage *stage,
|
void clutter_stage_get_redraw_clip_bounds (ClutterStage *stage,
|
||||||
cairo_rectangle_int_t *clip);
|
cairo_rectangle_int_t *clip);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
|
cairo_region_t * clutter_stage_get_redraw_clip (ClutterStage *stage);
|
||||||
|
CLUTTER_EXPORT
|
||||||
void clutter_stage_ensure_viewport (ClutterStage *stage);
|
void clutter_stage_ensure_viewport (ClutterStage *stage);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_stage_ensure_redraw (ClutterStage *stage);
|
void clutter_stage_ensure_redraw (ClutterStage *stage);
|
||||||
|
@@ -157,7 +157,7 @@ struct _ClutterTextPrivate
|
|||||||
gint text_logical_y;
|
gint text_logical_y;
|
||||||
|
|
||||||
/* Where to draw the cursor */
|
/* Where to draw the cursor */
|
||||||
ClutterRect cursor_rect;
|
graphene_rect_t cursor_rect;
|
||||||
ClutterColor cursor_color;
|
ClutterColor cursor_color;
|
||||||
guint cursor_size;
|
guint cursor_size;
|
||||||
|
|
||||||
@@ -1304,7 +1304,7 @@ static inline void
|
|||||||
update_cursor_location (ClutterText *self)
|
update_cursor_location (ClutterText *self)
|
||||||
{
|
{
|
||||||
ClutterTextPrivate *priv = self->priv;
|
ClutterTextPrivate *priv = self->priv;
|
||||||
ClutterRect rect;
|
graphene_rect_t rect;
|
||||||
float x, y;
|
float x, y;
|
||||||
|
|
||||||
if (!priv->editable)
|
if (!priv->editable)
|
||||||
@@ -1312,7 +1312,7 @@ update_cursor_location (ClutterText *self)
|
|||||||
|
|
||||||
rect = priv->cursor_rect;
|
rect = priv->cursor_rect;
|
||||||
clutter_actor_get_transformed_position (CLUTTER_ACTOR (self), &x, &y);
|
clutter_actor_get_transformed_position (CLUTTER_ACTOR (self), &x, &y);
|
||||||
clutter_rect_offset (&rect, x, y);
|
graphene_rect_offset (&rect, x, y);
|
||||||
clutter_input_focus_set_cursor_location (priv->input_focus, &rect);
|
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;
|
ClutterTextPrivate *priv = self->priv;
|
||||||
gfloat x, y, cursor_height;
|
gfloat x, y, cursor_height;
|
||||||
ClutterRect cursor_rect = CLUTTER_RECT_INIT_ZERO;
|
graphene_rect_t cursor_rect = GRAPHENE_RECT_INIT_ZERO;
|
||||||
gint position;
|
gint position;
|
||||||
|
|
||||||
position = priv->position;
|
position = priv->position;
|
||||||
@@ -1345,25 +1345,17 @@ clutter_text_ensure_cursor_position (ClutterText *self,
|
|||||||
&x, &y,
|
&x, &y,
|
||||||
&cursor_height);
|
&cursor_height);
|
||||||
|
|
||||||
clutter_rect_init (&cursor_rect,
|
graphene_rect_init (&cursor_rect,
|
||||||
x,
|
x,
|
||||||
y + CURSOR_Y_PADDING * scale,
|
y + CURSOR_Y_PADDING * scale,
|
||||||
priv->cursor_size * scale,
|
priv->cursor_size * scale,
|
||||||
cursor_height - 2 * CURSOR_Y_PADDING * scale);
|
cursor_height - 2 * CURSOR_Y_PADDING * scale);
|
||||||
|
|
||||||
if (!clutter_rect_equals (&priv->cursor_rect, &cursor_rect))
|
if (!graphene_rect_equal (&priv->cursor_rect, &cursor_rect))
|
||||||
{
|
{
|
||||||
ClutterGeometry cursor_pos;
|
|
||||||
|
|
||||||
priv->cursor_rect = cursor_rect;
|
priv->cursor_rect = cursor_rect;
|
||||||
|
|
||||||
/* XXX:2.0 - remove */
|
g_signal_emit (self, text_signals[CURSOR_EVENT], 0, &cursor_rect);
|
||||||
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);
|
g_signal_emit (self, text_signals[CURSOR_CHANGED], 0);
|
||||||
|
|
||||||
update_cursor_location (self);
|
update_cursor_location (self);
|
||||||
@@ -2712,7 +2704,7 @@ clutter_text_paint (ClutterActor *self)
|
|||||||
|
|
||||||
if (actor_width < text_width)
|
if (actor_width < text_width)
|
||||||
{
|
{
|
||||||
gint cursor_x = clutter_rect_get_x (&priv->cursor_rect);
|
gint cursor_x = graphene_rect_get_x (&priv->cursor_rect);
|
||||||
|
|
||||||
if (priv->position == -1)
|
if (priv->position == -1)
|
||||||
{
|
{
|
||||||
@@ -2799,7 +2791,7 @@ add_selection_to_paint_volume (ClutterText *text,
|
|||||||
{
|
{
|
||||||
ClutterPaintVolume *total_volume = user_data;
|
ClutterPaintVolume *total_volume = user_data;
|
||||||
ClutterPaintVolume rect_volume;
|
ClutterPaintVolume rect_volume;
|
||||||
ClutterVertex vertex;
|
graphene_point3d_t vertex;
|
||||||
|
|
||||||
_clutter_paint_volume_init_static (&rect_volume, CLUTTER_ACTOR (text));
|
_clutter_paint_volume_init_static (&rect_volume, CLUTTER_ACTOR (text));
|
||||||
|
|
||||||
@@ -2821,7 +2813,7 @@ clutter_text_get_paint_volume_for_cursor (ClutterText *text,
|
|||||||
ClutterPaintVolume *volume)
|
ClutterPaintVolume *volume)
|
||||||
{
|
{
|
||||||
ClutterTextPrivate *priv = text->priv;
|
ClutterTextPrivate *priv = text->priv;
|
||||||
ClutterVertex origin;
|
graphene_point3d_t origin;
|
||||||
|
|
||||||
clutter_text_ensure_cursor_position (text, resource_scale);
|
clutter_text_ensure_cursor_position (text, resource_scale);
|
||||||
|
|
||||||
@@ -2864,7 +2856,7 @@ clutter_text_get_paint_volume (ClutterActor *self,
|
|||||||
{
|
{
|
||||||
PangoLayout *layout;
|
PangoLayout *layout;
|
||||||
PangoRectangle ink_rect;
|
PangoRectangle ink_rect;
|
||||||
ClutterVertex origin;
|
graphene_point3d_t origin;
|
||||||
float resource_scale;
|
float resource_scale;
|
||||||
|
|
||||||
/* If the text is single line editable then it gets clipped to
|
/* If the text is single line editable then it gets clipped to
|
||||||
@@ -4399,10 +4391,10 @@ clutter_text_class_init (ClutterTextClass *klass)
|
|||||||
/**
|
/**
|
||||||
* ClutterText::cursor-event:
|
* ClutterText::cursor-event:
|
||||||
* @self: the #ClutterText that emitted the signal
|
* @self: the #ClutterText that emitted the signal
|
||||||
* @geometry: the coordinates of the cursor
|
* @rect: the coordinates of the cursor
|
||||||
*
|
*
|
||||||
* The ::cursor-event signal is emitted whenever the cursor position
|
* The ::cursor-event signal is emitted whenever the cursor position
|
||||||
* changes inside a #ClutterText actor. Inside @geometry it is stored
|
* changes inside a #ClutterText actor. Inside @rect it is stored
|
||||||
* the current position and size of the cursor, relative to the actor
|
* the current position and size of the cursor, relative to the actor
|
||||||
* itself.
|
* itself.
|
||||||
*
|
*
|
||||||
@@ -4417,7 +4409,7 @@ clutter_text_class_init (ClutterTextClass *klass)
|
|||||||
G_STRUCT_OFFSET (ClutterTextClass, cursor_event),
|
G_STRUCT_OFFSET (ClutterTextClass, cursor_event),
|
||||||
NULL, NULL, NULL,
|
NULL, NULL, NULL,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
CLUTTER_TYPE_GEOMETRY | G_SIGNAL_TYPE_STATIC_SCOPE);
|
GRAPHENE_TYPE_RECT | G_SIGNAL_TYPE_STATIC_SCOPE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterText::cursor-changed:
|
* ClutterText::cursor-changed:
|
||||||
@@ -6780,8 +6772,8 @@ clutter_text_get_layout_offsets (ClutterText *self,
|
|||||||
* Since: 1.16
|
* Since: 1.16
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_text_get_cursor_rect (ClutterText *self,
|
clutter_text_get_cursor_rect (ClutterText *self,
|
||||||
ClutterRect *rect)
|
graphene_rect_t *rect)
|
||||||
{
|
{
|
||||||
g_return_if_fail (CLUTTER_IS_TEXT (self));
|
g_return_if_fail (CLUTTER_IS_TEXT (self));
|
||||||
g_return_if_fail (rect != NULL);
|
g_return_if_fail (rect != NULL);
|
||||||
|
@@ -82,7 +82,7 @@ struct _ClutterTextClass
|
|||||||
void (* text_changed) (ClutterText *self);
|
void (* text_changed) (ClutterText *self);
|
||||||
void (* activate) (ClutterText *self);
|
void (* activate) (ClutterText *self);
|
||||||
void (* cursor_event) (ClutterText *self,
|
void (* cursor_event) (ClutterText *self,
|
||||||
const ClutterGeometry *geometry);
|
const graphene_rect_t *rect);
|
||||||
void (* cursor_changed) (ClutterText *self);
|
void (* cursor_changed) (ClutterText *self);
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
@@ -230,7 +230,7 @@ CLUTTER_EXPORT
|
|||||||
guint clutter_text_get_cursor_size (ClutterText *self);
|
guint clutter_text_get_cursor_size (ClutterText *self);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_text_get_cursor_rect (ClutterText *self,
|
void clutter_text_get_cursor_rect (ClutterText *self,
|
||||||
ClutterRect *rect);
|
graphene_rect_t *rect);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_text_set_selectable (ClutterText *self,
|
void clutter_text_set_selectable (ClutterText *self,
|
||||||
gboolean selectable);
|
gboolean selectable);
|
||||||
|
@@ -46,8 +46,7 @@ G_BEGIN_DECLS
|
|||||||
* @CLUTTER_TEXTURE_ERROR_NO_YUV: YUV operation attempted but no YUV support
|
* @CLUTTER_TEXTURE_ERROR_NO_YUV: YUV operation attempted but no YUV support
|
||||||
* found
|
* found
|
||||||
* @CLUTTER_TEXTURE_ERROR_BAD_FORMAT: The requested format for
|
* @CLUTTER_TEXTURE_ERROR_BAD_FORMAT: The requested format for
|
||||||
* clutter_texture_set_from_rgb_data or
|
* clutter_texture_set_from_rgb_data is unsupported.
|
||||||
* clutter_texture_set_from_yuv_data is unsupported.
|
|
||||||
*
|
*
|
||||||
* Error enumeration for #ClutterTexture
|
* Error enumeration for #ClutterTexture
|
||||||
*
|
*
|
||||||
|
@@ -145,8 +145,8 @@ struct _ClutterTimelinePrivate
|
|||||||
ClutterStepMode step_mode;
|
ClutterStepMode step_mode;
|
||||||
|
|
||||||
/* cubic-bezier() parameters */
|
/* cubic-bezier() parameters */
|
||||||
ClutterPoint cb_1;
|
graphene_point_t cb_1;
|
||||||
ClutterPoint cb_2;
|
graphene_point_t cb_2;
|
||||||
|
|
||||||
guint is_playing : 1;
|
guint is_playing : 1;
|
||||||
|
|
||||||
@@ -424,6 +424,11 @@ clutter_timeline_set_custom_property (ClutterScriptable *scriptable,
|
|||||||
g_object_set_property (G_OBJECT (scriptable), name, value);
|
g_object_set_property (G_OBJECT (scriptable), name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
clutter_timeline_cancel_delay (ClutterTimeline *timeline)
|
||||||
|
{
|
||||||
|
g_clear_handle_id (&timeline->priv->delay_id, g_source_remove);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_scriptable_iface_init (ClutterScriptableIface *iface)
|
clutter_scriptable_iface_init (ClutterScriptableIface *iface)
|
||||||
@@ -550,11 +555,7 @@ clutter_timeline_dispose (GObject *object)
|
|||||||
|
|
||||||
priv = self->priv;
|
priv = self->priv;
|
||||||
|
|
||||||
if (priv->delay_id)
|
clutter_timeline_cancel_delay (self);
|
||||||
{
|
|
||||||
g_source_remove (priv->delay_id);
|
|
||||||
priv->delay_id = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->progress_notify != NULL)
|
if (priv->progress_notify != NULL)
|
||||||
{
|
{
|
||||||
@@ -845,8 +846,8 @@ clutter_timeline_init (ClutterTimeline *self)
|
|||||||
self->priv->step_mode = CLUTTER_STEP_MODE_END;
|
self->priv->step_mode = CLUTTER_STEP_MODE_END;
|
||||||
|
|
||||||
/* default cubic-bezier() paramereters are (0, 0, 1, 1) */
|
/* default cubic-bezier() paramereters are (0, 0, 1, 1) */
|
||||||
clutter_point_init (&self->priv->cb_1, 0, 0);
|
graphene_point_init (&self->priv->cb_1, 0, 0);
|
||||||
clutter_point_init (&self->priv->cb_2, 1, 1);
|
graphene_point_init (&self->priv->cb_2, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct CheckIfMarkerHitClosure
|
struct CheckIfMarkerHitClosure
|
||||||
@@ -1213,14 +1214,10 @@ clutter_timeline_pause (ClutterTimeline *timeline)
|
|||||||
|
|
||||||
priv = timeline->priv;
|
priv = timeline->priv;
|
||||||
|
|
||||||
if (priv->delay_id == 0 && !priv->is_playing)
|
clutter_timeline_cancel_delay (timeline);
|
||||||
return;
|
|
||||||
|
|
||||||
if (priv->delay_id)
|
if (!priv->is_playing)
|
||||||
{
|
return;
|
||||||
g_source_remove (priv->delay_id);
|
|
||||||
priv->delay_id = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
priv->msecs_delta = 0;
|
priv->msecs_delta = 0;
|
||||||
set_is_playing (timeline, FALSE);
|
set_is_playing (timeline, FALSE);
|
||||||
@@ -2488,9 +2485,9 @@ clutter_timeline_get_step_progress (ClutterTimeline *timeline,
|
|||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||||
const ClutterPoint *c_1,
|
const graphene_point_t *c_1,
|
||||||
const ClutterPoint *c_2)
|
const graphene_point_t *c_2)
|
||||||
{
|
{
|
||||||
ClutterTimelinePrivate *priv;
|
ClutterTimelinePrivate *priv;
|
||||||
|
|
||||||
@@ -2525,9 +2522,9 @@ clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
|||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
|
clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||||
ClutterPoint *c_1,
|
graphene_point_t *c_1,
|
||||||
ClutterPoint *c_2)
|
graphene_point_t *c_2)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), FALSE);
|
||||||
|
|
||||||
|
@@ -208,13 +208,13 @@ gboolean clutter_timeline_get_step_progress
|
|||||||
gint *n_steps,
|
gint *n_steps,
|
||||||
ClutterStepMode *step_mode);
|
ClutterStepMode *step_mode);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
void clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||||
const ClutterPoint *c_1,
|
const graphene_point_t *c_1,
|
||||||
const ClutterPoint *c_2);
|
const graphene_point_t *c_2);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
|
gboolean clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||||
ClutterPoint *c_1,
|
graphene_point_t *c_1,
|
||||||
ClutterPoint *c_2);
|
graphene_point_t *c_2);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gint64 clutter_timeline_get_duration_hint (ClutterTimeline *timeline);
|
gint64 clutter_timeline_get_duration_hint (ClutterTimeline *timeline);
|
||||||
|
@@ -134,7 +134,6 @@ clutter_transition_stopped (ClutterTimeline *timeline,
|
|||||||
clutter_transition_detach (CLUTTER_TRANSITION (timeline),
|
clutter_transition_detach (CLUTTER_TRANSITION (timeline),
|
||||||
priv->animatable);
|
priv->animatable);
|
||||||
g_clear_object (&priv->animatable);
|
g_clear_object (&priv->animatable);
|
||||||
g_object_unref (timeline);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,20 +33,16 @@
|
|||||||
#include <clutter/clutter-macros.h>
|
#include <clutter/clutter-macros.h>
|
||||||
#include <clutter/clutter-enums.h>
|
#include <clutter/clutter-enums.h>
|
||||||
|
|
||||||
|
#include <graphene-gobject.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define CLUTTER_TYPE_ACTOR_BOX (clutter_actor_box_get_type ())
|
#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_KNOT (clutter_knot_get_type ())
|
||||||
#define CLUTTER_TYPE_MARGIN (clutter_margin_get_type ())
|
#define CLUTTER_TYPE_MARGIN (clutter_margin_get_type ())
|
||||||
#define CLUTTER_TYPE_MATRIX (clutter_matrix_get_type ())
|
#define CLUTTER_TYPE_MATRIX (clutter_matrix_get_type ())
|
||||||
#define CLUTTER_TYPE_PAINT_VOLUME (clutter_paint_volume_get_type ())
|
#define CLUTTER_TYPE_PAINT_VOLUME (clutter_paint_volume_get_type ())
|
||||||
#define CLUTTER_TYPE_PERSPECTIVE (clutter_perspective_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;
|
typedef struct _ClutterActor ClutterActor;
|
||||||
|
|
||||||
@@ -79,14 +75,9 @@ typedef struct _ClutterPathNode ClutterPathNode;
|
|||||||
|
|
||||||
typedef struct _ClutterActorBox ClutterActorBox;
|
typedef struct _ClutterActorBox ClutterActorBox;
|
||||||
typedef struct _ClutterColor ClutterColor;
|
typedef struct _ClutterColor ClutterColor;
|
||||||
typedef struct _ClutterGeometry ClutterGeometry; /* XXX:2.0 - remove */
|
|
||||||
typedef struct _ClutterKnot ClutterKnot;
|
typedef struct _ClutterKnot ClutterKnot;
|
||||||
typedef struct _ClutterMargin ClutterMargin;
|
typedef struct _ClutterMargin ClutterMargin;
|
||||||
typedef struct _ClutterPerspective ClutterPerspective;
|
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 _ClutterAlpha ClutterAlpha;
|
||||||
typedef struct _ClutterAnimation ClutterAnimation;
|
typedef struct _ClutterAnimation ClutterAnimation;
|
||||||
@@ -113,8 +104,6 @@ typedef union _ClutterEvent ClutterEvent;
|
|||||||
*/
|
*/
|
||||||
typedef struct _ClutterEventSequence ClutterEventSequence;
|
typedef struct _ClutterEventSequence ClutterEventSequence;
|
||||||
|
|
||||||
typedef struct _ClutterFog ClutterFog; /* deprecated */
|
|
||||||
typedef struct _ClutterBehaviour ClutterBehaviour; /* deprecated */
|
|
||||||
typedef struct _ClutterShader ClutterShader; /* deprecated */
|
typedef struct _ClutterShader ClutterShader; /* deprecated */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -137,310 +126,6 @@ typedef struct _ClutterShader ClutterShader; /* deprecated */
|
|||||||
*/
|
*/
|
||||||
typedef struct _ClutterPaintVolume ClutterPaintVolume;
|
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);
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean clutter_point_inside_quadrilateral (const ClutterPoint *point,
|
|
||||||
const ClutterPoint *vertices);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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:
|
* ClutterActorBox:
|
||||||
* @x1: X coordinate of the top left corner
|
* @x1: X coordinate of the top left corner
|
||||||
@@ -544,8 +229,8 @@ gboolean clutter_actor_box_contains (const ClutterActorBox *box,
|
|||||||
gfloat x,
|
gfloat x,
|
||||||
gfloat y);
|
gfloat y);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_actor_box_from_vertices (ClutterActorBox *box,
|
void clutter_actor_box_from_vertices (ClutterActorBox *box,
|
||||||
const ClutterVertex verts[]);
|
const graphene_point3d_t verts[]);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_actor_box_interpolate (const ClutterActorBox *initial,
|
void clutter_actor_box_interpolate (const ClutterActorBox *initial,
|
||||||
const ClutterActorBox *final,
|
const ClutterActorBox *final,
|
||||||
@@ -571,41 +256,6 @@ CLUTTER_EXPORT
|
|||||||
void clutter_actor_box_scale (ClutterActorBox *box,
|
void clutter_actor_box_scale (ClutterActorBox *box,
|
||||||
gfloat scale);
|
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:
|
* ClutterKnot:
|
||||||
* @x: X coordinate of the knot
|
* @x: X coordinate of the knot
|
||||||
@@ -677,10 +327,10 @@ void clutter_paint_volume_free (ClutterPaintVolume
|
|||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
void clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||||
const ClutterVertex *origin);
|
const graphene_point3d_t *origin);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_paint_volume_get_origin (const ClutterPaintVolume *pv,
|
void clutter_paint_volume_get_origin (const ClutterPaintVolume *pv,
|
||||||
ClutterVertex *vertex);
|
graphene_point3d_t *vertex);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_paint_volume_set_width (ClutterPaintVolume *pv,
|
void clutter_paint_volume_set_width (ClutterPaintVolume *pv,
|
||||||
gfloat width);
|
gfloat width);
|
||||||
|
@@ -51,8 +51,8 @@ void
|
|||||||
_clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
_clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||||
const CoglMatrix *projection,
|
const CoglMatrix *projection,
|
||||||
const float *viewport,
|
const float *viewport,
|
||||||
const ClutterVertex *vertices_in,
|
const graphene_point3d_t *vertices_in,
|
||||||
ClutterVertex *vertices_out,
|
graphene_point3d_t *vertices_out,
|
||||||
int n_vertices)
|
int n_vertices)
|
||||||
{
|
{
|
||||||
CoglMatrix modelview_projection;
|
CoglMatrix modelview_projection;
|
||||||
@@ -69,7 +69,7 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
|||||||
modelview);
|
modelview);
|
||||||
cogl_matrix_project_points (&modelview_projection,
|
cogl_matrix_project_points (&modelview_projection,
|
||||||
3,
|
3,
|
||||||
sizeof (ClutterVertex),
|
sizeof (graphene_point3d_t),
|
||||||
vertices_in,
|
vertices_in,
|
||||||
sizeof (ClutterVertex4),
|
sizeof (ClutterVertex4),
|
||||||
vertices_tmp,
|
vertices_tmp,
|
||||||
@@ -79,7 +79,7 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
|||||||
{
|
{
|
||||||
cogl_matrix_transform_points (modelview,
|
cogl_matrix_transform_points (modelview,
|
||||||
3,
|
3,
|
||||||
sizeof (ClutterVertex),
|
sizeof (graphene_point3d_t),
|
||||||
vertices_in,
|
vertices_in,
|
||||||
sizeof (ClutterVertex4),
|
sizeof (ClutterVertex4),
|
||||||
vertices_tmp,
|
vertices_tmp,
|
||||||
@@ -97,7 +97,7 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
|||||||
for (i = 0; i < n_vertices; i++)
|
for (i = 0; i < n_vertices; i++)
|
||||||
{
|
{
|
||||||
ClutterVertex4 vertex_tmp = vertices_tmp[i];
|
ClutterVertex4 vertex_tmp = vertices_tmp[i];
|
||||||
ClutterVertex *vertex_out = &vertices_out[i];
|
graphene_point3d_t *vertex_out = &vertices_out[i];
|
||||||
/* Finally translate from OpenGL coords to window coords */
|
/* Finally translate from OpenGL coords to window coords */
|
||||||
vertex_out->x = MTX_GL_SCALE_X (vertex_tmp.x, vertex_tmp.w,
|
vertex_out->x = MTX_GL_SCALE_X (vertex_tmp.x, vertex_tmp.w,
|
||||||
viewport[2], viewport[0]);
|
viewport[2], viewport[0]);
|
||||||
@@ -108,9 +108,9 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
|||||||
|
|
||||||
void
|
void
|
||||||
_clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
_clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
||||||
ClutterRect *dest)
|
graphene_rect_t *dest)
|
||||||
{
|
{
|
||||||
*dest = (ClutterRect) {
|
*dest = (graphene_rect_t) {
|
||||||
.origin = {
|
.origin = {
|
||||||
.x = src->x,
|
.x = src->x,
|
||||||
.y = src->y
|
.y = src->y
|
||||||
@@ -123,12 +123,12 @@ _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_clutter_util_rectangle_int_extents (const ClutterRect *src,
|
_clutter_util_rectangle_int_extents (const graphene_rect_t *src,
|
||||||
cairo_rectangle_int_t *dest)
|
cairo_rectangle_int_t *dest)
|
||||||
{
|
{
|
||||||
ClutterRect tmp = *src;
|
graphene_rect_t tmp = *src;
|
||||||
|
|
||||||
clutter_rect_clamp_to_pixel (&tmp);
|
graphene_rect_round_extents (&tmp, &tmp);
|
||||||
|
|
||||||
*dest = (cairo_rectangle_int_t) {
|
*dest = (cairo_rectangle_int_t) {
|
||||||
.x = tmp.origin.x,
|
.x = tmp.origin.x,
|
||||||
@@ -299,48 +299,12 @@ _clutter_util_matrix_skew_yz (ClutterMatrix *matrix,
|
|||||||
matrix->zw += matrix->yw * 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
|
static void
|
||||||
_clutter_util_vertex_normalize (ClutterVertex *vertex)
|
_clutter_util_vertex_combine (const graphene_point3d_t *a,
|
||||||
{
|
const graphene_point3d_t *b,
|
||||||
float factor = _clutter_util_vertex_length (vertex);
|
double ascl,
|
||||||
|
double bscl,
|
||||||
if (factor == 0.f)
|
graphene_point3d_t *res)
|
||||||
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->x = (ascl * a->x) + (bscl * b->x);
|
||||||
res->y = (ascl * a->y) + (bscl * b->y);
|
res->y = (ascl * a->y) + (bscl * b->y);
|
||||||
@@ -388,16 +352,16 @@ _clutter_util_vertex4_interpolate (const ClutterVertex4 *a,
|
|||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
_clutter_util_matrix_decompose (const ClutterMatrix *src,
|
_clutter_util_matrix_decompose (const ClutterMatrix *src,
|
||||||
ClutterVertex *scale_p,
|
graphene_point3d_t *scale_p,
|
||||||
float shear_p[3],
|
float shear_p[3],
|
||||||
ClutterVertex *rotate_p,
|
graphene_point3d_t *rotate_p,
|
||||||
ClutterVertex *translate_p,
|
graphene_point3d_t *translate_p,
|
||||||
ClutterVertex4 *perspective_p)
|
ClutterVertex4 *perspective_p)
|
||||||
{
|
{
|
||||||
CoglMatrix matrix = *src;
|
CoglMatrix matrix = *src;
|
||||||
CoglMatrix perspective;
|
CoglMatrix perspective;
|
||||||
ClutterVertex4 vertex_tmp;
|
ClutterVertex4 vertex_tmp;
|
||||||
ClutterVertex row[3], pdum;
|
graphene_point3d_t row[3], pdum;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
#define XY_SHEAR 0
|
#define XY_SHEAR 0
|
||||||
@@ -485,34 +449,34 @@ _clutter_util_matrix_decompose (const ClutterMatrix *src,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* compute scale.x and normalize the first row */
|
/* compute scale.x and normalize the first row */
|
||||||
scale_p->x = _clutter_util_vertex_length (&row[0]);
|
scale_p->x = graphene_point3d_length (&row[0]);
|
||||||
_clutter_util_vertex_normalize (&row[0]);
|
graphene_point3d_normalize (&row[0], &row[0]);
|
||||||
|
|
||||||
/* compute XY shear and make the second row orthogonal to the first */
|
/* compute XY shear and make the second row orthogonal to the first */
|
||||||
shear_p[XY_SHEAR] = _clutter_util_vertex_dot (&row[0], &row[1]);
|
shear_p[XY_SHEAR] = graphene_point3d_dot (&row[0], &row[1]);
|
||||||
_clutter_util_vertex_combine (&row[1], &row[0],
|
_clutter_util_vertex_combine (&row[1], &row[0],
|
||||||
1.0, -shear_p[XY_SHEAR],
|
1.0, -shear_p[XY_SHEAR],
|
||||||
&row[1]);
|
&row[1]);
|
||||||
|
|
||||||
/* compute the Y scale and normalize the second row */
|
/* compute the Y scale and normalize the second row */
|
||||||
scale_p->y = _clutter_util_vertex_length (&row[1]);
|
scale_p->y = graphene_point3d_length (&row[1]);
|
||||||
_clutter_util_vertex_normalize (&row[1]);
|
graphene_point3d_normalize (&row[1], &row[1]);
|
||||||
shear_p[XY_SHEAR] /= scale_p->y;
|
shear_p[XY_SHEAR] /= scale_p->y;
|
||||||
|
|
||||||
/* compute XZ and YZ shears, orthogonalize the third row */
|
/* compute XZ and YZ shears, orthogonalize the third row */
|
||||||
shear_p[XZ_SHEAR] = _clutter_util_vertex_dot (&row[0], &row[2]);
|
shear_p[XZ_SHEAR] = graphene_point3d_dot (&row[0], &row[2]);
|
||||||
_clutter_util_vertex_combine (&row[2], &row[0],
|
_clutter_util_vertex_combine (&row[2], &row[0],
|
||||||
1.0, -shear_p[XZ_SHEAR],
|
1.0, -shear_p[XZ_SHEAR],
|
||||||
&row[2]);
|
&row[2]);
|
||||||
|
|
||||||
shear_p[YZ_SHEAR] = _clutter_util_vertex_dot (&row[1], &row[2]);
|
shear_p[YZ_SHEAR] = graphene_point3d_dot (&row[1], &row[2]);
|
||||||
_clutter_util_vertex_combine (&row[2], &row[1],
|
_clutter_util_vertex_combine (&row[2], &row[1],
|
||||||
1.0, -shear_p[YZ_SHEAR],
|
1.0, -shear_p[YZ_SHEAR],
|
||||||
&row[2]);
|
&row[2]);
|
||||||
|
|
||||||
/* get the Z scale and normalize the third row*/
|
/* get the Z scale and normalize the third row*/
|
||||||
scale_p->z = _clutter_util_vertex_length (&row[2]);
|
scale_p->z = graphene_point3d_length (&row[2]);
|
||||||
_clutter_util_vertex_normalize (&row[2]);
|
graphene_point3d_normalize (&row[2], &row[2]);
|
||||||
shear_p[XZ_SHEAR] /= scale_p->z;
|
shear_p[XZ_SHEAR] /= scale_p->z;
|
||||||
shear_p[YZ_SHEAR] /= scale_p->z;
|
shear_p[YZ_SHEAR] /= scale_p->z;
|
||||||
|
|
||||||
@@ -520,8 +484,8 @@ _clutter_util_matrix_decompose (const ClutterMatrix *src,
|
|||||||
* check for a coordinate system flip; if the determinant
|
* check for a coordinate system flip; if the determinant
|
||||||
* is -1, then negate the matrix and scaling factors
|
* is -1, then negate the matrix and scaling factors
|
||||||
*/
|
*/
|
||||||
_clutter_util_vertex_cross (&row[1], &row[2], &pdum);
|
graphene_point3d_cross (&row[1], &row[2], &pdum);
|
||||||
if (_clutter_util_vertex_dot (&row[0], &pdum) < 0.f)
|
if (graphene_point3d_dot (&row[0], &pdum) < 0.f)
|
||||||
{
|
{
|
||||||
scale_p->x *= -1.f;
|
scale_p->x *= -1.f;
|
||||||
|
|
||||||
|
@@ -80,9 +80,9 @@ struct _ClutterZoomActionPrivate
|
|||||||
|
|
||||||
ZoomPoint points[2];
|
ZoomPoint points[2];
|
||||||
|
|
||||||
ClutterPoint initial_focal_point;
|
graphene_point_t initial_focal_point;
|
||||||
ClutterPoint focal_point;
|
graphene_point_t focal_point;
|
||||||
ClutterPoint transformed_focal_point;
|
graphene_point_t transformed_focal_point;
|
||||||
|
|
||||||
gfloat initial_x;
|
gfloat initial_x;
|
||||||
gfloat initial_y;
|
gfloat initial_y;
|
||||||
@@ -238,13 +238,13 @@ clutter_zoom_action_gesture_cancel (ClutterGestureAction *action,
|
|||||||
static gboolean
|
static gboolean
|
||||||
clutter_zoom_action_real_zoom (ClutterZoomAction *action,
|
clutter_zoom_action_real_zoom (ClutterZoomAction *action,
|
||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
ClutterPoint *focal_point,
|
graphene_point_t *focal_point,
|
||||||
gdouble factor)
|
gdouble factor)
|
||||||
{
|
{
|
||||||
ClutterZoomActionPrivate *priv = action->priv;
|
ClutterZoomActionPrivate *priv = action->priv;
|
||||||
gfloat x, y, z;
|
gfloat x, y, z;
|
||||||
gdouble scale_x, scale_y;
|
gdouble scale_x, scale_y;
|
||||||
ClutterVertex out, in;
|
graphene_point3d_t out, in;
|
||||||
|
|
||||||
in.x = priv->transformed_focal_point.x;
|
in.x = priv->transformed_focal_point.x;
|
||||||
in.y = priv->transformed_focal_point.y;
|
in.y = priv->transformed_focal_point.y;
|
||||||
@@ -400,7 +400,7 @@ clutter_zoom_action_class_init (ClutterZoomActionClass *klass)
|
|||||||
_clutter_marshal_BOOLEAN__OBJECT_BOXED_DOUBLE,
|
_clutter_marshal_BOOLEAN__OBJECT_BOXED_DOUBLE,
|
||||||
G_TYPE_BOOLEAN, 3,
|
G_TYPE_BOOLEAN, 3,
|
||||||
CLUTTER_TYPE_ACTOR,
|
CLUTTER_TYPE_ACTOR,
|
||||||
CLUTTER_TYPE_POINT,
|
GRAPHENE_TYPE_POINT,
|
||||||
G_TYPE_DOUBLE);
|
G_TYPE_DOUBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -478,7 +478,7 @@ clutter_zoom_action_get_zoom_axis (ClutterZoomAction *action)
|
|||||||
/**
|
/**
|
||||||
* clutter_zoom_action_get_focal_point:
|
* clutter_zoom_action_get_focal_point:
|
||||||
* @action: a #ClutterZoomAction
|
* @action: a #ClutterZoomAction
|
||||||
* @point: (out): a #ClutterPoint
|
* @point: (out): a #graphene_point_t
|
||||||
*
|
*
|
||||||
* Retrieves the focal point of the current zoom
|
* Retrieves the focal point of the current zoom
|
||||||
*
|
*
|
||||||
@@ -486,7 +486,7 @@ clutter_zoom_action_get_zoom_axis (ClutterZoomAction *action)
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
|
clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
|
||||||
ClutterPoint *point)
|
graphene_point_t *point)
|
||||||
{
|
{
|
||||||
g_return_if_fail (CLUTTER_IS_ZOOM_ACTION (action));
|
g_return_if_fail (CLUTTER_IS_ZOOM_ACTION (action));
|
||||||
g_return_if_fail (point != NULL);
|
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:
|
* clutter_zoom_action_get_transformed_focal_point:
|
||||||
* @action: a #ClutterZoomAction
|
* @action: a #ClutterZoomAction
|
||||||
* @point: (out): a #ClutterPoint
|
* @point: (out): a #graphene_point_t
|
||||||
*
|
*
|
||||||
* Retrieves the focal point relative to the actor's coordinates of
|
* Retrieves the focal point relative to the actor's coordinates of
|
||||||
* the current zoom
|
* the current zoom
|
||||||
@@ -506,7 +506,7 @@ clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_zoom_action_get_transformed_focal_point (ClutterZoomAction *action,
|
clutter_zoom_action_get_transformed_focal_point (ClutterZoomAction *action,
|
||||||
ClutterPoint *point)
|
graphene_point_t *point)
|
||||||
{
|
{
|
||||||
g_return_if_fail (CLUTTER_IS_ZOOM_ACTION (action));
|
g_return_if_fail (CLUTTER_IS_ZOOM_ACTION (action));
|
||||||
g_return_if_fail (point != NULL);
|
g_return_if_fail (point != NULL);
|
||||||
|
@@ -79,7 +79,7 @@ struct _ClutterZoomActionClass
|
|||||||
/*< public >*/
|
/*< public >*/
|
||||||
gboolean (* zoom) (ClutterZoomAction *action,
|
gboolean (* zoom) (ClutterZoomAction *action,
|
||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
ClutterPoint *focal_point,
|
graphene_point_t *focal_point,
|
||||||
gdouble factor);
|
gdouble factor);
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
@@ -104,10 +104,10 @@ ClutterZoomAxis clutter_zoom_action_get_zoom_axis (ClutterZoomActi
|
|||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
|
void clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
|
||||||
ClutterPoint *point);
|
graphene_point_t *point);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_zoom_action_get_transformed_focal_point (ClutterZoomAction *action,
|
void clutter_zoom_action_get_transformed_focal_point (ClutterZoomAction *action,
|
||||||
ClutterPoint *point);
|
graphene_point_t *point);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@@ -56,7 +56,7 @@ typedef struct _ClutterStageViewCoglPrivate
|
|||||||
*/
|
*/
|
||||||
#define DAMAGE_HISTORY_MAX 16
|
#define DAMAGE_HISTORY_MAX 16
|
||||||
#define DAMAGE_HISTORY(x) ((x) & (DAMAGE_HISTORY_MAX - 1))
|
#define DAMAGE_HISTORY(x) ((x) & (DAMAGE_HISTORY_MAX - 1))
|
||||||
cairo_rectangle_int_t damage_history[DAMAGE_HISTORY_MAX];
|
cairo_region_t * damage_history[DAMAGE_HISTORY_MAX];
|
||||||
unsigned int damage_index;
|
unsigned int damage_index;
|
||||||
} ClutterStageViewCoglPrivate;
|
} ClutterStageViewCoglPrivate;
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window,
|
|||||||
if (max_render_time_allowed <= 0)
|
if (max_render_time_allowed <= 0)
|
||||||
{
|
{
|
||||||
g_warning ("Unsupported monitor refresh rate detected. "
|
g_warning ("Unsupported monitor refresh rate detected. "
|
||||||
"(Refresh rate: %.3f, refresh interval: %ld)",
|
"(Refresh rate: %.3f, refresh interval: %" G_GINT64_FORMAT ")",
|
||||||
refresh_rate,
|
refresh_rate,
|
||||||
refresh_interval);
|
refresh_interval);
|
||||||
stage_cogl->update_time = now;
|
stage_cogl->update_time = now;
|
||||||
@@ -296,13 +296,10 @@ clutter_stage_cogl_has_redraw_clips (ClutterStageWindow *stage_window)
|
|||||||
/* NB: at the start of each new frame there is an implied clip that
|
/* NB: at the start of each new frame there is an implied clip that
|
||||||
* clips everything (i.e. nothing would be drawn) so we need to make
|
* clips everything (i.e. nothing would be drawn) so we need to make
|
||||||
* sure we return True in the un-initialized case here.
|
* sure we return True in the un-initialized case here.
|
||||||
*
|
|
||||||
* NB: a clip width of 0 means a full stage redraw has been queued
|
|
||||||
* so we effectively don't have any redraw clips in that case.
|
|
||||||
*/
|
*/
|
||||||
if (!stage_cogl->initialized_redraw_clip ||
|
if (!stage_cogl->initialized_redraw_clip ||
|
||||||
(stage_cogl->initialized_redraw_clip &&
|
(stage_cogl->initialized_redraw_clip &&
|
||||||
stage_cogl->bounding_redraw_clip.width != 0))
|
stage_cogl->redraw_clip))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -313,9 +310,9 @@ clutter_stage_cogl_ignoring_redraw_clips (ClutterStageWindow *stage_window)
|
|||||||
{
|
{
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
||||||
|
|
||||||
/* NB: a clip width of 0 means a full stage redraw is required */
|
/* NB: a NULL clip means a full stage redraw is required */
|
||||||
if (stage_cogl->initialized_redraw_clip &&
|
if (stage_cogl->initialized_redraw_clip &&
|
||||||
stage_cogl->bounding_redraw_clip.width == 0)
|
!stage_cogl->redraw_clip)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -346,11 +343,11 @@ clutter_stage_cogl_add_redraw_clip (ClutterStageWindow *stage_window,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* A NULL stage clip means a full stage redraw has been queued and
|
/* A NULL stage clip means a full stage redraw has been queued and
|
||||||
* we keep track of this by setting a zero width
|
* we keep track of this by setting a NULL redraw_clip.
|
||||||
* stage_cogl->bounding_redraw_clip */
|
*/
|
||||||
if (stage_clip == NULL)
|
if (stage_clip == NULL)
|
||||||
{
|
{
|
||||||
stage_cogl->bounding_redraw_clip.width = 0;
|
g_clear_pointer (&stage_cogl->redraw_clip, cairo_region_destroy);
|
||||||
stage_cogl->initialized_redraw_clip = TRUE;
|
stage_cogl->initialized_redraw_clip = TRUE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -359,34 +356,27 @@ clutter_stage_cogl_add_redraw_clip (ClutterStageWindow *stage_window,
|
|||||||
if (stage_clip->width == 0 || stage_clip->height == 0)
|
if (stage_clip->width == 0 || stage_clip->height == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!stage_cogl->initialized_redraw_clip)
|
if (!stage_cogl->redraw_clip)
|
||||||
{
|
{
|
||||||
stage_cogl->bounding_redraw_clip = *stage_clip;
|
stage_cogl->redraw_clip = cairo_region_create_rectangle (stage_clip);
|
||||||
}
|
}
|
||||||
else if (stage_cogl->bounding_redraw_clip.width > 0)
|
else
|
||||||
{
|
{
|
||||||
_clutter_util_rectangle_union (&stage_cogl->bounding_redraw_clip,
|
cairo_region_union_rectangle (stage_cogl->redraw_clip, stage_clip);
|
||||||
stage_clip,
|
|
||||||
&stage_cogl->bounding_redraw_clip);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stage_cogl->initialized_redraw_clip = TRUE;
|
stage_cogl->initialized_redraw_clip = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static cairo_region_t *
|
||||||
clutter_stage_cogl_get_redraw_clip_bounds (ClutterStageWindow *stage_window,
|
clutter_stage_cogl_get_redraw_clip (ClutterStageWindow *stage_window)
|
||||||
cairo_rectangle_int_t *stage_clip)
|
|
||||||
{
|
{
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
||||||
|
|
||||||
if (stage_cogl->using_clipped_redraw)
|
if (stage_cogl->using_clipped_redraw && stage_cogl->redraw_clip)
|
||||||
{
|
return cairo_region_copy (stage_cogl->redraw_clip);
|
||||||
*stage_clip = stage_cogl->bounding_redraw_clip;
|
|
||||||
|
|
||||||
return TRUE;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline gboolean
|
static inline gboolean
|
||||||
@@ -403,37 +393,47 @@ valid_buffer_age (ClutterStageViewCogl *view_cogl,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
paint_damage_region (ClutterStageWindow *stage_window,
|
paint_damage_region (ClutterStageWindow *stage_window,
|
||||||
ClutterStageView *view,
|
ClutterStageView *view,
|
||||||
cairo_rectangle_int_t *swap_region)
|
cairo_region_t *swap_region)
|
||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view);
|
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view);
|
||||||
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
|
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
|
||||||
static CoglPipeline *overlay_blue = NULL;
|
static CoglPipeline *overlay_blue = NULL;
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (stage_cogl->wrapper);
|
ClutterActor *actor = CLUTTER_ACTOR (stage_cogl->wrapper);
|
||||||
float x_1 = swap_region->x;
|
CoglMatrix transform;
|
||||||
float x_2 = swap_region->x + swap_region->width;
|
int n_rects, i;
|
||||||
float y_1 = swap_region->y;
|
|
||||||
float y_2 = swap_region->y + swap_region->height;
|
|
||||||
CoglMatrix modelview;
|
|
||||||
|
|
||||||
|
cogl_framebuffer_push_matrix (framebuffer);
|
||||||
|
clutter_actor_get_transform (actor, &transform);
|
||||||
|
cogl_framebuffer_transform (framebuffer, &transform);
|
||||||
|
|
||||||
|
/* Blue for the swap region */
|
||||||
if (G_UNLIKELY (overlay_blue == NULL))
|
if (G_UNLIKELY (overlay_blue == NULL))
|
||||||
{
|
{
|
||||||
overlay_blue = cogl_pipeline_new (ctx);
|
overlay_blue = cogl_pipeline_new (ctx);
|
||||||
cogl_pipeline_set_color4ub (overlay_blue, 0x00, 0x00, 0x33, 0x33);
|
cogl_pipeline_set_color4ub (overlay_blue, 0x00, 0x00, 0x33, 0x33);
|
||||||
}
|
}
|
||||||
|
|
||||||
cogl_framebuffer_push_matrix (framebuffer);
|
n_rects = cairo_region_num_rectangles (swap_region);
|
||||||
cogl_matrix_init_identity (&modelview);
|
for (i = 0; i < n_rects; i++)
|
||||||
_clutter_actor_apply_modelview_transform (actor, &modelview);
|
{
|
||||||
cogl_framebuffer_set_modelview_matrix (framebuffer, &modelview);
|
cairo_rectangle_int_t rect;
|
||||||
|
float x_1, x_2, y_1, y_2;
|
||||||
|
|
||||||
/* Blue for the swap region */
|
cairo_region_get_rectangle (swap_region, i, &rect);
|
||||||
cogl_framebuffer_draw_rectangle (framebuffer, overlay_blue, x_1, y_1, x_2, y_2);
|
x_1 = rect.x;
|
||||||
|
x_2 = rect.x + rect.width;
|
||||||
|
y_1 = rect.y;
|
||||||
|
y_2 = rect.y + rect.height;
|
||||||
|
|
||||||
|
cogl_framebuffer_draw_rectangle (framebuffer, overlay_blue, x_1, y_1, x_2, y_2);
|
||||||
|
}
|
||||||
|
|
||||||
/* Red for the clip */
|
/* Red for the clip */
|
||||||
if (stage_cogl->initialized_redraw_clip)
|
if (stage_cogl->initialized_redraw_clip &&
|
||||||
|
stage_cogl->redraw_clip)
|
||||||
{
|
{
|
||||||
static CoglPipeline *overlay_red = NULL;
|
static CoglPipeline *overlay_red = NULL;
|
||||||
|
|
||||||
@@ -443,55 +443,63 @@ paint_damage_region (ClutterStageWindow *stage_window,
|
|||||||
cogl_pipeline_set_color4ub (overlay_red, 0x33, 0x00, 0x00, 0x33);
|
cogl_pipeline_set_color4ub (overlay_red, 0x33, 0x00, 0x00, 0x33);
|
||||||
}
|
}
|
||||||
|
|
||||||
x_1 = stage_cogl->bounding_redraw_clip.x;
|
n_rects = cairo_region_num_rectangles (stage_cogl->redraw_clip);
|
||||||
x_2 = stage_cogl->bounding_redraw_clip.x + stage_cogl->bounding_redraw_clip.width;
|
for (i = 0; i < n_rects; i++)
|
||||||
y_1 = stage_cogl->bounding_redraw_clip.y;
|
{
|
||||||
y_2 = stage_cogl->bounding_redraw_clip.y + stage_cogl->bounding_redraw_clip.height;
|
cairo_rectangle_int_t rect;
|
||||||
|
float x_1, x_2, y_1, y_2;
|
||||||
|
|
||||||
cogl_framebuffer_draw_rectangle (framebuffer, overlay_red, x_1, y_1, x_2, y_2);
|
cairo_region_get_rectangle (stage_cogl->redraw_clip, i, &rect);
|
||||||
|
x_1 = rect.x;
|
||||||
|
x_2 = rect.x + rect.width;
|
||||||
|
y_1 = rect.y;
|
||||||
|
y_2 = rect.y + rect.height;
|
||||||
|
|
||||||
|
cogl_framebuffer_draw_rectangle (framebuffer, overlay_red, x_1, y_1, x_2, y_2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cogl_framebuffer_pop_matrix (framebuffer);
|
cogl_framebuffer_pop_matrix (framebuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
swap_framebuffer (ClutterStageWindow *stage_window,
|
swap_framebuffer (ClutterStageWindow *stage_window,
|
||||||
ClutterStageView *view,
|
ClutterStageView *view,
|
||||||
cairo_rectangle_int_t *swap_region,
|
cairo_region_t *swap_region,
|
||||||
gboolean swap_with_damage)
|
gboolean swap_with_damage)
|
||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view);
|
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view);
|
||||||
int damage[4], ndamage;
|
int *damage, n_rects, i;
|
||||||
|
|
||||||
damage[0] = swap_region->x;
|
|
||||||
damage[1] = swap_region->y;
|
|
||||||
damage[2] = swap_region->width;
|
|
||||||
damage[3] = swap_region->height;
|
|
||||||
|
|
||||||
if (swap_region->width != 0)
|
|
||||||
ndamage = 1;
|
|
||||||
else
|
|
||||||
ndamage = 0;
|
|
||||||
|
|
||||||
if (G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION)))
|
if (G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION)))
|
||||||
paint_damage_region (stage_window, view, swap_region);
|
paint_damage_region (stage_window, view, swap_region);
|
||||||
|
|
||||||
|
n_rects = cairo_region_num_rectangles (swap_region);
|
||||||
|
damage = g_newa (int, n_rects * 4);
|
||||||
|
for (i = 0; i < n_rects; i++)
|
||||||
|
{
|
||||||
|
cairo_rectangle_int_t rect;
|
||||||
|
|
||||||
|
cairo_region_get_rectangle (swap_region, i, &rect);
|
||||||
|
damage[i * 4] = rect.x;
|
||||||
|
damage[i * 4 + 1] = rect.y;
|
||||||
|
damage[i * 4 + 2] = rect.width;
|
||||||
|
damage[i * 4 + 3] = rect.height;
|
||||||
|
}
|
||||||
|
|
||||||
if (cogl_is_onscreen (framebuffer))
|
if (cogl_is_onscreen (framebuffer))
|
||||||
{
|
{
|
||||||
CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer);
|
CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer);
|
||||||
|
|
||||||
/* push on the screen */
|
/* push on the screen */
|
||||||
if (ndamage == 1 && !swap_with_damage)
|
if (n_rects > 0 && !swap_with_damage)
|
||||||
{
|
{
|
||||||
CLUTTER_NOTE (BACKEND,
|
CLUTTER_NOTE (BACKEND,
|
||||||
"cogl_onscreen_swap_region (onscreen: %p, "
|
"cogl_onscreen_swap_region (onscreen: %p)",
|
||||||
"x: %d, y: %d, "
|
onscreen);
|
||||||
"width: %d, height: %d)",
|
|
||||||
onscreen,
|
|
||||||
damage[0], damage[1], damage[2], damage[3]);
|
|
||||||
|
|
||||||
cogl_onscreen_swap_region (onscreen,
|
cogl_onscreen_swap_region (onscreen,
|
||||||
damage, ndamage);
|
damage, n_rects);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -501,7 +509,7 @@ swap_framebuffer (ClutterStageWindow *stage_window,
|
|||||||
onscreen);
|
onscreen);
|
||||||
|
|
||||||
cogl_onscreen_swap_buffers_with_damage (onscreen,
|
cogl_onscreen_swap_buffers_with_damage (onscreen,
|
||||||
damage, ndamage);
|
damage, n_rects);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -517,80 +525,121 @@ swap_framebuffer (ClutterStageWindow *stage_window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
paint_stage (ClutterStageCogl *stage_cogl,
|
scale_and_clamp_rect (const graphene_rect_t *rect,
|
||||||
ClutterStageView *view,
|
float scale,
|
||||||
const cairo_rectangle_int_t *clip)
|
cairo_rectangle_int_t *dest)
|
||||||
|
|
||||||
{
|
{
|
||||||
ClutterStage *stage = stage_cogl->wrapper;
|
graphene_rect_t tmp = *rect;
|
||||||
|
|
||||||
_clutter_stage_maybe_setup_viewport (stage, view);
|
graphene_rect_scale (&tmp, scale, scale, &tmp);
|
||||||
_clutter_stage_paint_view (stage, view, clip);
|
_clutter_util_rectangle_int_extents (&tmp, dest);
|
||||||
|
|
||||||
if (clutter_stage_view_get_onscreen (view) !=
|
|
||||||
clutter_stage_view_get_framebuffer (view))
|
|
||||||
{
|
|
||||||
clutter_stage_view_blit_offscreen (view, clip);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fill_current_damage_history_and_step (ClutterStageView *view)
|
paint_stage (ClutterStageCogl *stage_cogl,
|
||||||
|
ClutterStageView *view,
|
||||||
|
cairo_region_t *clip)
|
||||||
|
{
|
||||||
|
ClutterStage *stage = stage_cogl->wrapper;
|
||||||
|
cairo_rectangle_int_t clip_rect;
|
||||||
|
cairo_rectangle_int_t paint_rect;
|
||||||
|
cairo_rectangle_int_t view_rect;
|
||||||
|
graphene_rect_t rect;
|
||||||
|
float fb_scale;
|
||||||
|
|
||||||
|
clutter_stage_view_get_layout (view, &view_rect);
|
||||||
|
fb_scale = clutter_stage_view_get_scale (view);
|
||||||
|
|
||||||
|
cairo_region_get_extents (clip, &clip_rect);
|
||||||
|
|
||||||
|
_clutter_util_rect_from_rectangle (&clip_rect, &rect);
|
||||||
|
scale_and_clamp_rect (&rect, 1.0f / fb_scale, &paint_rect);
|
||||||
|
_clutter_util_rectangle_offset (&paint_rect,
|
||||||
|
view_rect.x,
|
||||||
|
view_rect.y,
|
||||||
|
&paint_rect);
|
||||||
|
|
||||||
|
_clutter_stage_maybe_setup_viewport (stage, view);
|
||||||
|
_clutter_stage_paint_view (stage, view, &paint_rect);
|
||||||
|
|
||||||
|
clutter_stage_view_after_paint (view, &paint_rect);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
fill_current_damage_history (ClutterStageView *view,
|
||||||
|
cairo_region_t *damage)
|
||||||
{
|
{
|
||||||
ClutterStageViewCogl *view_cogl = CLUTTER_STAGE_VIEW_COGL (view);
|
ClutterStageViewCogl *view_cogl = CLUTTER_STAGE_VIEW_COGL (view);
|
||||||
ClutterStageViewCoglPrivate *view_priv =
|
ClutterStageViewCoglPrivate *view_priv =
|
||||||
clutter_stage_view_cogl_get_instance_private (view_cogl);
|
clutter_stage_view_cogl_get_instance_private (view_cogl);
|
||||||
cairo_rectangle_int_t view_rect;
|
cairo_region_t **current_fb_damage;
|
||||||
float fb_scale;
|
|
||||||
cairo_rectangle_int_t *current_fb_damage;
|
|
||||||
|
|
||||||
current_fb_damage =
|
current_fb_damage =
|
||||||
&view_priv->damage_history[DAMAGE_HISTORY (view_priv->damage_index)];
|
&view_priv->damage_history[DAMAGE_HISTORY (view_priv->damage_index)];
|
||||||
clutter_stage_view_get_layout (view, &view_rect);
|
|
||||||
fb_scale = clutter_stage_view_get_scale (view);
|
|
||||||
|
|
||||||
*current_fb_damage = (cairo_rectangle_int_t) {
|
g_clear_pointer (current_fb_damage, cairo_region_destroy);
|
||||||
.x = 0,
|
*current_fb_damage = cairo_region_copy (damage);
|
||||||
.y = 0,
|
|
||||||
.width = ceilf (view_rect.width * fb_scale),
|
|
||||||
.height = ceilf (view_rect.height * fb_scale)
|
|
||||||
};
|
|
||||||
view_priv->damage_index++;
|
view_priv->damage_index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
transform_swap_region_to_onscreen (ClutterStageView *view,
|
fill_current_damage_history_rectangle (ClutterStageView *view,
|
||||||
cairo_rectangle_int_t *swap_region)
|
const cairo_rectangle_int_t *rect)
|
||||||
|
{
|
||||||
|
cairo_region_t *damage;
|
||||||
|
|
||||||
|
damage = cairo_region_create_rectangle (rect);
|
||||||
|
fill_current_damage_history (view, damage);
|
||||||
|
cairo_region_destroy (damage);
|
||||||
|
}
|
||||||
|
|
||||||
|
static cairo_region_t *
|
||||||
|
transform_swap_region_to_onscreen (ClutterStageView *view,
|
||||||
|
cairo_region_t *swap_region)
|
||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer;
|
CoglFramebuffer *framebuffer;
|
||||||
cairo_rectangle_int_t layout;
|
cairo_rectangle_int_t layout;
|
||||||
gfloat x1, y1, x2, y2;
|
|
||||||
gint width, height;
|
gint width, height;
|
||||||
|
int n_rects, i;
|
||||||
|
cairo_rectangle_int_t *rects;
|
||||||
|
cairo_region_t *transformed_region;
|
||||||
|
|
||||||
framebuffer = clutter_stage_view_get_onscreen (view);
|
framebuffer = clutter_stage_view_get_onscreen (view);
|
||||||
clutter_stage_view_get_layout (view, &layout);
|
clutter_stage_view_get_layout (view, &layout);
|
||||||
|
|
||||||
x1 = (float) swap_region->x / layout.width;
|
|
||||||
y1 = (float) swap_region->y / layout.height;
|
|
||||||
x2 = (float) (swap_region->x + swap_region->width) / layout.width;
|
|
||||||
y2 = (float) (swap_region->y + swap_region->height) / layout.height;
|
|
||||||
|
|
||||||
clutter_stage_view_transform_to_onscreen (view, &x1, &y1);
|
|
||||||
clutter_stage_view_transform_to_onscreen (view, &x2, &y2);
|
|
||||||
|
|
||||||
width = cogl_framebuffer_get_width (framebuffer);
|
width = cogl_framebuffer_get_width (framebuffer);
|
||||||
height = cogl_framebuffer_get_height (framebuffer);
|
height = cogl_framebuffer_get_height (framebuffer);
|
||||||
|
|
||||||
x1 = floor (x1 * width);
|
n_rects = cairo_region_num_rectangles (swap_region);
|
||||||
y1 = floor (height - (y1 * height));
|
rects = g_newa (cairo_rectangle_int_t, n_rects);
|
||||||
x2 = ceil (x2 * width);
|
for (i = 0; i < n_rects; i++)
|
||||||
y2 = ceil (height - (y2 * height));
|
{
|
||||||
|
gfloat x1, y1, x2, y2;
|
||||||
|
|
||||||
*swap_region = (cairo_rectangle_int_t) {
|
cairo_region_get_rectangle (swap_region, i, &rects[i]);
|
||||||
.x = x1,
|
|
||||||
.y = y1,
|
x1 = (float) rects[i].x / layout.width;
|
||||||
.width = x2 - x1,
|
y1 = (float) rects[i].y / layout.height;
|
||||||
.height = y2 - y1
|
x2 = (float) (rects[i].x + rects[i].width) / layout.width;
|
||||||
};
|
y2 = (float) (rects[i].y + rects[i].height) / layout.height;
|
||||||
|
|
||||||
|
clutter_stage_view_transform_to_onscreen (view, &x1, &y1);
|
||||||
|
clutter_stage_view_transform_to_onscreen (view, &x2, &y2);
|
||||||
|
|
||||||
|
x1 = floor (x1 * width);
|
||||||
|
y1 = floor (height - (y1 * height));
|
||||||
|
x2 = ceil (x2 * width);
|
||||||
|
y2 = ceil (height - (y2 * height));
|
||||||
|
|
||||||
|
rects[i].x = x1;
|
||||||
|
rects[i].y = y1;
|
||||||
|
rects[i].width = x2 - x1;
|
||||||
|
rects[i].height = y2 - y1;
|
||||||
|
}
|
||||||
|
transformed_region = cairo_region_create_rectangles (rects, n_rects);
|
||||||
|
|
||||||
|
return transformed_region;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -624,18 +673,6 @@ is_buffer_age_enabled (void)
|
|||||||
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
|
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
scale_and_clamp_rect (const ClutterRect *rect,
|
|
||||||
float scale,
|
|
||||||
cairo_rectangle_int_t *dest)
|
|
||||||
|
|
||||||
{
|
|
||||||
ClutterRect tmp = *rect;
|
|
||||||
|
|
||||||
clutter_rect_scale (&tmp, scale, scale);
|
|
||||||
_clutter_util_rectangle_int_extents (&tmp, dest);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||||
ClutterStageView *view)
|
ClutterStageView *view)
|
||||||
@@ -654,9 +691,10 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
gboolean do_swap_buffer;
|
gboolean do_swap_buffer;
|
||||||
gboolean swap_with_damage;
|
gboolean swap_with_damage;
|
||||||
ClutterActor *wrapper;
|
ClutterActor *wrapper;
|
||||||
cairo_rectangle_int_t redraw_clip;
|
cairo_region_t *redraw_clip;
|
||||||
cairo_rectangle_int_t swap_region;
|
cairo_region_t *fb_clip_region;
|
||||||
cairo_rectangle_int_t fb_clip_region;
|
cairo_region_t *swap_region;
|
||||||
|
cairo_rectangle_int_t redraw_rect;
|
||||||
gboolean clip_region_empty;
|
gboolean clip_region_empty;
|
||||||
float fb_scale;
|
float fb_scale;
|
||||||
int subpixel_compensation = 0;
|
int subpixel_compensation = 0;
|
||||||
@@ -675,20 +713,19 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
|
|
||||||
has_buffer_age = cogl_is_onscreen (fb) && is_buffer_age_enabled ();
|
has_buffer_age = cogl_is_onscreen (fb) && is_buffer_age_enabled ();
|
||||||
|
|
||||||
/* NB: a zero width redraw clip == full stage redraw */
|
/* NB: a NULL redraw clip == full stage redraw */
|
||||||
if (stage_cogl->bounding_redraw_clip.width == 0)
|
if (!stage_cogl->redraw_clip)
|
||||||
have_clip = FALSE;
|
have_clip = FALSE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
redraw_clip = stage_cogl->bounding_redraw_clip;
|
cairo_region_t *view_region;
|
||||||
_clutter_util_rectangle_intersection (&redraw_clip,
|
redraw_clip = cairo_region_copy (stage_cogl->redraw_clip);
|
||||||
&view_rect,
|
|
||||||
&redraw_clip);
|
|
||||||
|
|
||||||
have_clip = !(redraw_clip.x == view_rect.x &&
|
view_region = cairo_region_create_rectangle (&view_rect);
|
||||||
redraw_clip.y == view_rect.y &&
|
cairo_region_intersect (redraw_clip, view_region);
|
||||||
redraw_clip.width == view_rect.width &&
|
|
||||||
redraw_clip.height == view_rect.height);
|
have_clip = !cairo_region_equal (redraw_clip, view_region);
|
||||||
|
cairo_region_destroy (view_region);
|
||||||
}
|
}
|
||||||
|
|
||||||
may_use_clipped_redraw = FALSE;
|
may_use_clipped_redraw = FALSE;
|
||||||
@@ -699,26 +736,53 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
* frames when starting up... */
|
* frames when starting up... */
|
||||||
cogl_onscreen_get_frame_counter (COGL_ONSCREEN (fb)) > 3)
|
cogl_onscreen_get_frame_counter (COGL_ONSCREEN (fb)) > 3)
|
||||||
{
|
{
|
||||||
ClutterRect rect;
|
graphene_rect_t rect;
|
||||||
|
cairo_rectangle_int_t *rects;
|
||||||
|
int n_rects, i;
|
||||||
|
|
||||||
may_use_clipped_redraw = TRUE;
|
may_use_clipped_redraw = TRUE;
|
||||||
|
|
||||||
_clutter_util_rect_from_rectangle (&redraw_clip, &rect);
|
fb_clip_region = cairo_region_create ();
|
||||||
clutter_rect_offset (&rect, -view_rect.x, -view_rect.y);
|
|
||||||
scale_and_clamp_rect (&rect, fb_scale, &fb_clip_region);
|
n_rects = cairo_region_num_rectangles (redraw_clip);
|
||||||
|
rects = g_new (cairo_rectangle_int_t, n_rects);
|
||||||
|
for (i = 0; i < n_rects; i++)
|
||||||
|
{
|
||||||
|
cairo_rectangle_int_t new_fb_clip_rect;
|
||||||
|
|
||||||
|
cairo_region_get_rectangle (redraw_clip, i, &rects[i]);
|
||||||
|
|
||||||
|
_clutter_util_rect_from_rectangle (&rects[i], &rect);
|
||||||
|
graphene_rect_offset (&rect, -view_rect.x, -view_rect.y);
|
||||||
|
scale_and_clamp_rect (&rect, fb_scale, &new_fb_clip_rect);
|
||||||
|
|
||||||
|
cairo_region_union_rectangle (fb_clip_region, &new_fb_clip_rect);
|
||||||
|
}
|
||||||
|
g_free (rects);
|
||||||
|
|
||||||
if (fb_scale != floorf (fb_scale))
|
if (fb_scale != floorf (fb_scale))
|
||||||
{
|
{
|
||||||
subpixel_compensation = ceilf (fb_scale);
|
subpixel_compensation = ceilf (fb_scale);
|
||||||
fb_clip_region.x -= subpixel_compensation;
|
|
||||||
fb_clip_region.y -= subpixel_compensation;
|
n_rects = cairo_region_num_rectangles (fb_clip_region);
|
||||||
fb_clip_region.width += 2 * subpixel_compensation;
|
rects = g_newa (cairo_rectangle_int_t, n_rects);
|
||||||
fb_clip_region.height += 2 * subpixel_compensation;
|
for (i = 0; i < n_rects; i++)
|
||||||
|
{
|
||||||
|
cairo_region_get_rectangle (fb_clip_region, i, &rects[i]);
|
||||||
|
rects[i].x -= subpixel_compensation;
|
||||||
|
rects[i].y -= subpixel_compensation;
|
||||||
|
rects[i].width += 2 * subpixel_compensation;
|
||||||
|
rects[i].height += 2 * subpixel_compensation;
|
||||||
|
}
|
||||||
|
cairo_region_destroy (fb_clip_region);
|
||||||
|
fb_clip_region = cairo_region_create_rectangles (rects, n_rects);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fb_clip_region = (cairo_rectangle_int_t) { 0 };
|
cairo_rectangle_int_t rect = { 0, 0, view_rect.width, view_rect.height };
|
||||||
|
fb_clip_region = cairo_region_create_rectangle (&rect);
|
||||||
|
redraw_clip = cairo_region_copy (fb_clip_region);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (may_use_clipped_redraw &&
|
if (may_use_clipped_redraw &&
|
||||||
@@ -727,71 +791,81 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
else
|
else
|
||||||
use_clipped_redraw = FALSE;
|
use_clipped_redraw = FALSE;
|
||||||
|
|
||||||
clip_region_empty = may_use_clipped_redraw && fb_clip_region.width == 0;
|
clip_region_empty = may_use_clipped_redraw && cairo_region_is_empty (fb_clip_region);
|
||||||
|
|
||||||
swap_with_damage = FALSE;
|
swap_with_damage = FALSE;
|
||||||
if (has_buffer_age)
|
if (has_buffer_age)
|
||||||
{
|
{
|
||||||
if (use_clipped_redraw && !clip_region_empty)
|
if (use_clipped_redraw && !clip_region_empty)
|
||||||
{
|
{
|
||||||
int age, i;
|
int age;
|
||||||
cairo_rectangle_int_t *current_fb_damage =
|
|
||||||
&view_priv->damage_history[DAMAGE_HISTORY (view_priv->damage_index++)];
|
|
||||||
|
|
||||||
age = cogl_onscreen_get_buffer_age (COGL_ONSCREEN (fb));
|
age = cogl_onscreen_get_buffer_age (COGL_ONSCREEN (fb));
|
||||||
|
|
||||||
if (valid_buffer_age (view_cogl, age))
|
if (valid_buffer_age (view_cogl, age))
|
||||||
{
|
{
|
||||||
ClutterRect rect;
|
graphene_rect_t rect;
|
||||||
cairo_rectangle_int_t damage_region;
|
cairo_rectangle_int_t damage_region;
|
||||||
|
cairo_rectangle_int_t *rects;
|
||||||
|
int n_rects, i;
|
||||||
|
|
||||||
*current_fb_damage = fb_clip_region;
|
fill_current_damage_history (view, fb_clip_region);
|
||||||
|
|
||||||
for (i = 1; i <= age; i++)
|
for (i = 1; i <= age; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t *fb_damage =
|
cairo_region_t *fb_damage =
|
||||||
&view_priv->damage_history[DAMAGE_HISTORY (view_priv->damage_index - i - 1)];
|
view_priv->damage_history[DAMAGE_HISTORY (view_priv->damage_index - i - 1)];
|
||||||
|
cairo_region_union (fb_clip_region, fb_damage);
|
||||||
_clutter_util_rectangle_union (&fb_clip_region,
|
|
||||||
fb_damage,
|
|
||||||
&fb_clip_region);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update the bounding redraw clip state with the extra damage. */
|
/* Update the redraw clip state with the extra damage. */
|
||||||
_clutter_util_rect_from_rectangle (&fb_clip_region, &rect);
|
n_rects = cairo_region_num_rectangles (fb_clip_region);
|
||||||
scale_and_clamp_rect (&rect, 1.0f / fb_scale, &damage_region);
|
rects = g_newa (cairo_rectangle_int_t, n_rects);
|
||||||
_clutter_util_rectangle_offset (&damage_region,
|
for (i = 0; i < n_rects; i++)
|
||||||
view_rect.x,
|
{
|
||||||
view_rect.y,
|
cairo_region_get_rectangle (fb_clip_region, i, &rects[i]);
|
||||||
&damage_region);
|
_clutter_util_rect_from_rectangle (&rects[i], &rect);
|
||||||
_clutter_util_rectangle_union (&stage_cogl->bounding_redraw_clip,
|
scale_and_clamp_rect (&rect, 1.0f / fb_scale, &damage_region);
|
||||||
&damage_region,
|
_clutter_util_rectangle_offset (&damage_region,
|
||||||
&stage_cogl->bounding_redraw_clip);
|
view_rect.x,
|
||||||
|
view_rect.y,
|
||||||
|
&damage_region);
|
||||||
|
cairo_region_union_rectangle (stage_cogl->redraw_clip,
|
||||||
|
&damage_region);
|
||||||
|
}
|
||||||
|
|
||||||
CLUTTER_NOTE (CLIPPING, "Reusing back buffer(age=%d) - repairing region: x=%d, y=%d, width=%d, height=%d\n",
|
CLUTTER_NOTE (CLIPPING, "Reusing back buffer(age=%d) - repairing region: num rects: %d\n",
|
||||||
age,
|
age,
|
||||||
fb_clip_region.x,
|
cairo_region_num_rectangles (fb_clip_region));
|
||||||
fb_clip_region.y,
|
|
||||||
fb_clip_region.width,
|
|
||||||
fb_clip_region.height);
|
|
||||||
|
|
||||||
swap_with_damage = TRUE;
|
swap_with_damage = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
cairo_rectangle_int_t fb_damage;
|
||||||
|
|
||||||
CLUTTER_NOTE (CLIPPING, "Invalid back buffer(age=%d): forcing full redraw\n", age);
|
CLUTTER_NOTE (CLIPPING, "Invalid back buffer(age=%d): forcing full redraw\n", age);
|
||||||
use_clipped_redraw = FALSE;
|
use_clipped_redraw = FALSE;
|
||||||
*current_fb_damage = (cairo_rectangle_int_t) {
|
fb_damage = (cairo_rectangle_int_t) {
|
||||||
.x = 0,
|
.x = 0,
|
||||||
.y = 0,
|
.y = 0,
|
||||||
.width = view_rect.width * fb_scale,
|
.width = ceilf (view_rect.width * fb_scale),
|
||||||
.height = view_rect.height * fb_scale
|
.height = ceilf (view_rect.height * fb_scale)
|
||||||
};
|
};
|
||||||
|
fill_current_damage_history_rectangle (view, &fb_damage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!use_clipped_redraw)
|
else if (!use_clipped_redraw)
|
||||||
{
|
{
|
||||||
fill_current_damage_history_and_step (view);
|
cairo_rectangle_int_t fb_damage;
|
||||||
|
|
||||||
|
fb_damage = (cairo_rectangle_int_t) {
|
||||||
|
.x = 0,
|
||||||
|
.y = 0,
|
||||||
|
.width = ceilf (view_rect.width * fb_scale),
|
||||||
|
.height = ceilf (view_rect.height * fb_scale)
|
||||||
|
};
|
||||||
|
fill_current_damage_history_rectangle (view, &fb_damage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -802,11 +876,12 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
}
|
}
|
||||||
else if (use_clipped_redraw)
|
else if (use_clipped_redraw)
|
||||||
{
|
{
|
||||||
ClutterRect rect;
|
cairo_rectangle_int_t clip_rect;
|
||||||
cairo_rectangle_int_t scissor_rect;
|
cairo_rectangle_int_t scissor_rect;
|
||||||
cairo_rectangle_int_t paint_rect;
|
|
||||||
|
|
||||||
calculate_scissor_region (&fb_clip_region,
|
cairo_region_get_extents (fb_clip_region, &clip_rect);
|
||||||
|
|
||||||
|
calculate_scissor_region (&clip_rect,
|
||||||
subpixel_compensation,
|
subpixel_compensation,
|
||||||
fb_width, fb_height,
|
fb_width, fb_height,
|
||||||
&scissor_rect);
|
&scissor_rect);
|
||||||
@@ -826,14 +901,8 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
scissor_rect.width,
|
scissor_rect.width,
|
||||||
scissor_rect.height);
|
scissor_rect.height);
|
||||||
|
|
||||||
_clutter_util_rect_from_rectangle (&fb_clip_region, &rect);
|
paint_stage (stage_cogl, view, fb_clip_region);
|
||||||
scale_and_clamp_rect (&rect, 1.0f / fb_scale, &paint_rect);
|
|
||||||
_clutter_util_rectangle_offset (&paint_rect,
|
|
||||||
view_rect.x,
|
|
||||||
view_rect.y,
|
|
||||||
&paint_rect);
|
|
||||||
|
|
||||||
paint_stage (stage_cogl, view, &paint_rect);
|
|
||||||
cogl_framebuffer_pop_clip (fb);
|
cogl_framebuffer_pop_clip (fb);
|
||||||
|
|
||||||
stage_cogl->using_clipped_redraw = FALSE;
|
stage_cogl->using_clipped_redraw = FALSE;
|
||||||
@@ -843,16 +912,17 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
CLUTTER_NOTE (CLIPPING, "Unclipped stage paint\n");
|
CLUTTER_NOTE (CLIPPING, "Unclipped stage paint\n");
|
||||||
|
|
||||||
/* If we are trying to debug redraw issues then we want to pass
|
/* If we are trying to debug redraw issues then we want to pass
|
||||||
* the bounding_redraw_clip so it can be visualized */
|
* the redraw_clip so it can be visualized */
|
||||||
if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS) &&
|
if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS) &&
|
||||||
may_use_clipped_redraw &&
|
may_use_clipped_redraw &&
|
||||||
!clip_region_empty)
|
!clip_region_empty)
|
||||||
{
|
{
|
||||||
ClutterRect rect;
|
cairo_rectangle_int_t clip_rect;
|
||||||
cairo_rectangle_int_t scissor_rect;
|
cairo_rectangle_int_t scissor_rect;
|
||||||
cairo_rectangle_int_t paint_rect;
|
|
||||||
|
|
||||||
calculate_scissor_region (&fb_clip_region,
|
cairo_region_get_extents (fb_clip_region, &clip_rect);
|
||||||
|
|
||||||
|
calculate_scissor_region (&clip_rect,
|
||||||
subpixel_compensation,
|
subpixel_compensation,
|
||||||
fb_width, fb_height,
|
fb_width, fb_height,
|
||||||
&scissor_rect);
|
&scissor_rect);
|
||||||
@@ -863,31 +933,40 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
scissor_rect.width,
|
scissor_rect.width,
|
||||||
scissor_rect.height);
|
scissor_rect.height);
|
||||||
|
|
||||||
_clutter_util_rect_from_rectangle (&fb_clip_region, &rect);
|
paint_stage (stage_cogl, view, fb_clip_region);
|
||||||
scale_and_clamp_rect (&rect, 1.0f / fb_scale, &paint_rect);
|
|
||||||
_clutter_util_rectangle_offset (&paint_rect,
|
|
||||||
view_rect.x,
|
|
||||||
view_rect.y,
|
|
||||||
&paint_rect);
|
|
||||||
|
|
||||||
paint_stage (stage_cogl, view, &paint_rect);
|
|
||||||
cogl_framebuffer_pop_clip (fb);
|
cogl_framebuffer_pop_clip (fb);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
paint_stage (stage_cogl, view, &view_rect);
|
{
|
||||||
|
cairo_rectangle_int_t clip;
|
||||||
|
cairo_region_t *view_region;
|
||||||
|
|
||||||
|
clip = (cairo_rectangle_int_t) {
|
||||||
|
.x = 0,
|
||||||
|
.y = 0,
|
||||||
|
.width = ceilf (view_rect.width * fb_scale),
|
||||||
|
.height = ceilf (view_rect.height * fb_scale)
|
||||||
|
};
|
||||||
|
view_region = cairo_region_create_rectangle (&clip);
|
||||||
|
paint_stage (stage_cogl, view, view_region);
|
||||||
|
cairo_region_destroy (view_region);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cogl_pop_framebuffer ();
|
cogl_pop_framebuffer ();
|
||||||
|
|
||||||
|
cairo_region_get_extents (redraw_clip, &redraw_rect);
|
||||||
|
|
||||||
if (may_use_clipped_redraw &&
|
if (may_use_clipped_redraw &&
|
||||||
G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_REDRAWS)))
|
G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_REDRAWS)))
|
||||||
{
|
{
|
||||||
CoglContext *ctx = cogl_framebuffer_get_context (fb);
|
CoglContext *ctx = cogl_framebuffer_get_context (fb);
|
||||||
static CoglPipeline *outline = NULL;
|
static CoglPipeline *outline = NULL;
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (wrapper);
|
ClutterActor *actor = CLUTTER_ACTOR (wrapper);
|
||||||
float x_1 = redraw_clip.x;
|
float x_1 = redraw_rect.x;
|
||||||
float x_2 = redraw_clip.x + redraw_clip.width;
|
float x_2 = redraw_rect.x + redraw_rect.width;
|
||||||
float y_1 = redraw_clip.y;
|
float y_1 = redraw_rect.y;
|
||||||
float y_2 = redraw_clip.y + redraw_clip.height;
|
float y_2 = redraw_rect.y + redraw_rect.height;
|
||||||
CoglVertexP2 quad[4] = {
|
CoglVertexP2 quad[4] = {
|
||||||
{ x_1, y_1 },
|
{ x_1, y_1 },
|
||||||
{ x_2, y_1 },
|
{ x_2, y_1 },
|
||||||
@@ -933,32 +1012,47 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
swap_region = fb_clip_region;
|
swap_region = cairo_region_copy (fb_clip_region);
|
||||||
g_assert (swap_region.width > 0);
|
|
||||||
do_swap_buffer = TRUE;
|
do_swap_buffer = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
swap_region = (cairo_rectangle_int_t) { 0 };
|
swap_region = cairo_region_create ();
|
||||||
do_swap_buffer = TRUE;
|
do_swap_buffer = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (redraw_clip)
|
||||||
|
cairo_region_destroy (redraw_clip);
|
||||||
|
if (fb_clip_region)
|
||||||
|
cairo_region_destroy (fb_clip_region);
|
||||||
|
|
||||||
if (do_swap_buffer)
|
if (do_swap_buffer)
|
||||||
{
|
{
|
||||||
|
gboolean res;
|
||||||
|
|
||||||
COGL_TRACE_BEGIN_SCOPED (ClutterStageCoglRedrawViewSwapFramebuffer,
|
COGL_TRACE_BEGIN_SCOPED (ClutterStageCoglRedrawViewSwapFramebuffer,
|
||||||
"Paint (swap framebuffer)");
|
"Paint (swap framebuffer)");
|
||||||
|
|
||||||
if (clutter_stage_view_get_onscreen (view) !=
|
if (clutter_stage_view_get_onscreen (view) !=
|
||||||
clutter_stage_view_get_framebuffer (view))
|
clutter_stage_view_get_framebuffer (view))
|
||||||
{
|
{
|
||||||
transform_swap_region_to_onscreen (view, &swap_region);
|
cairo_region_t *transformed_swap_region;
|
||||||
|
|
||||||
|
transformed_swap_region =
|
||||||
|
transform_swap_region_to_onscreen (view, swap_region);
|
||||||
|
cairo_region_destroy (swap_region);
|
||||||
|
swap_region = transformed_swap_region;
|
||||||
}
|
}
|
||||||
|
|
||||||
return swap_framebuffer (stage_window,
|
res = swap_framebuffer (stage_window,
|
||||||
view,
|
view,
|
||||||
&swap_region,
|
swap_region,
|
||||||
swap_with_damage);
|
swap_with_damage);
|
||||||
|
|
||||||
|
cairo_region_destroy (swap_region);
|
||||||
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -998,6 +1092,7 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
|
|||||||
|
|
||||||
/* reset the redraw clipping for the next paint... */
|
/* reset the redraw clipping for the next paint... */
|
||||||
stage_cogl->initialized_redraw_clip = FALSE;
|
stage_cogl->initialized_redraw_clip = FALSE;
|
||||||
|
g_clear_pointer (&stage_cogl->redraw_clip, cairo_region_destroy);
|
||||||
|
|
||||||
stage_cogl->frame_count++;
|
stage_cogl->frame_count++;
|
||||||
|
|
||||||
@@ -1019,7 +1114,7 @@ clutter_stage_window_iface_init (ClutterStageWindowInterface *iface)
|
|||||||
iface->add_redraw_clip = clutter_stage_cogl_add_redraw_clip;
|
iface->add_redraw_clip = clutter_stage_cogl_add_redraw_clip;
|
||||||
iface->has_redraw_clips = clutter_stage_cogl_has_redraw_clips;
|
iface->has_redraw_clips = clutter_stage_cogl_has_redraw_clips;
|
||||||
iface->ignoring_redraw_clips = clutter_stage_cogl_ignoring_redraw_clips;
|
iface->ignoring_redraw_clips = clutter_stage_cogl_ignoring_redraw_clips;
|
||||||
iface->get_redraw_clip_bounds = clutter_stage_cogl_get_redraw_clip_bounds;
|
iface->get_redraw_clip = clutter_stage_cogl_get_redraw_clip;
|
||||||
iface->redraw = clutter_stage_cogl_redraw;
|
iface->redraw = clutter_stage_cogl_redraw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -62,7 +62,7 @@ struct _ClutterStageCogl
|
|||||||
|
|
||||||
gint last_sync_delay;
|
gint last_sync_delay;
|
||||||
|
|
||||||
cairo_rectangle_int_t bounding_redraw_clip;
|
cairo_region_t *redraw_clip;
|
||||||
|
|
||||||
guint initialized_redraw_clip : 1;
|
guint initialized_redraw_clip : 1;
|
||||||
|
|
||||||
|
@@ -1,44 +0,0 @@
|
|||||||
#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,10 +145,6 @@ CLUTTER_DEPRECATED
|
|||||||
void clutter_actor_get_transformation_matrix (ClutterActor *self,
|
void clutter_actor_get_transformation_matrix (ClutterActor *self,
|
||||||
ClutterMatrix *matrix);
|
ClutterMatrix *matrix);
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR (clutter_actor_get_allocation_box)
|
|
||||||
void clutter_actor_get_allocation_geometry (ClutterActor *self,
|
|
||||||
ClutterGeometry *geom);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_ACTOR_DEPRECATED_H__ */
|
#endif /* __CLUTTER_ACTOR_DEPRECATED_H__ */
|
||||||
|
@@ -39,9 +39,7 @@
|
|||||||
* be available any more in the next major version of Clutter.
|
* be available any more in the next major version of Clutter.
|
||||||
*
|
*
|
||||||
* A #ClutterAlpha binds a #ClutterTimeline to a progress function which
|
* A #ClutterAlpha binds a #ClutterTimeline to a progress function which
|
||||||
* translates the time T into an adimensional factor alpha. The factor can
|
* translates the time T into an adimensional factor alpha.
|
||||||
* then be used to drive a #ClutterBehaviour, which will translate the
|
|
||||||
* alpha value into something meaningful for a #ClutterActor.
|
|
||||||
*
|
*
|
||||||
* You should provide a #ClutterTimeline and bind it to the #ClutterAlpha
|
* You should provide a #ClutterTimeline and bind it to the #ClutterAlpha
|
||||||
* instance using clutter_alpha_set_timeline(). You should also set an
|
* instance using clutter_alpha_set_timeline(). You should also set an
|
||||||
@@ -59,9 +57,6 @@
|
|||||||
* pause, stop or resume the #ClutterAlpha from calling the alpha function by
|
* pause, stop or resume the #ClutterAlpha from calling the alpha function by
|
||||||
* using the appropriate functions of the #ClutterTimeline object.
|
* using the appropriate functions of the #ClutterTimeline object.
|
||||||
*
|
*
|
||||||
* #ClutterAlpha is used to "drive" a #ClutterBehaviour instance, and it
|
|
||||||
* is internally used by the #ClutterAnimation API.
|
|
||||||
*
|
|
||||||
* #ClutterAlpha is available since Clutter 0.2.
|
* #ClutterAlpha is available since Clutter 0.2.
|
||||||
*
|
*
|
||||||
* #ClutterAlpha is deprecated since Clutter 1.12. #ClutterTimeline and
|
* #ClutterAlpha is deprecated since Clutter 1.12. #ClutterTimeline and
|
||||||
@@ -78,9 +73,7 @@
|
|||||||
*
|
*
|
||||||
* The following JSON fragment defines a #ClutterAlpha
|
* The following JSON fragment defines a #ClutterAlpha
|
||||||
* using a #ClutterTimeline with id "sine-timeline" and an alpha
|
* using a #ClutterTimeline with id "sine-timeline" and an alpha
|
||||||
* function called `my_sine_alpha`. The defined #ClutterAlpha
|
* function called `my_sine_alpha`.
|
||||||
* instance can be reused in multiple #ClutterBehaviour
|
|
||||||
* definitions or for #ClutterAnimation definitions.
|
|
||||||
*
|
*
|
||||||
* |[
|
* |[
|
||||||
* {
|
* {
|
||||||
@@ -645,9 +638,6 @@ clutter_alpha_get_timeline (ClutterAlpha *alpha)
|
|||||||
* bind a #ClutterTimeline object to the #ClutterAlpha instance
|
* bind a #ClutterTimeline object to the #ClutterAlpha instance
|
||||||
* using clutter_alpha_set_timeline().
|
* using clutter_alpha_set_timeline().
|
||||||
*
|
*
|
||||||
* You should use the newly created #ClutterAlpha instance inside
|
|
||||||
* a #ClutterBehaviour object.
|
|
||||||
*
|
|
||||||
* Return value: the newly created empty #ClutterAlpha instance.
|
* Return value: the newly created empty #ClutterAlpha instance.
|
||||||
*
|
*
|
||||||
* Since: 0.2
|
* Since: 0.2
|
||||||
|
@@ -57,13 +57,6 @@
|
|||||||
* #ClutterAnimatable interface it is possible for that instance to
|
* #ClutterAnimatable interface it is possible for that instance to
|
||||||
* control the way the initial and final states are interpolated.
|
* control the way the initial and final states are interpolated.
|
||||||
*
|
*
|
||||||
* #ClutterAnimations are distinguished from #ClutterBehaviours
|
|
||||||
* because the former can only control #GObject properties of a single
|
|
||||||
* #GObject instance, while the latter can control multiple properties
|
|
||||||
* using accessor functions inside the #ClutterBehaviour
|
|
||||||
* `alpha_notify` virtual function, and can control multiple #ClutterActors
|
|
||||||
* as well.
|
|
||||||
*
|
|
||||||
* For convenience, it is possible to use the clutter_actor_animate()
|
* For convenience, it is possible to use the clutter_actor_animate()
|
||||||
* function call which will take care of setting up and tearing down
|
* function call which will take care of setting up and tearing down
|
||||||
* a #ClutterAnimation instance and animate an actor between its current
|
* a #ClutterAnimation instance and animate an actor between its current
|
||||||
@@ -2220,7 +2213,7 @@ clutter_actor_animate_with_timeline (ClutterActor *actor,
|
|||||||
*
|
*
|
||||||
* Will animate the "rotation-angle-z" property between the current value
|
* Will animate the "rotation-angle-z" property between the current value
|
||||||
* and 360 degrees, and set the "rotation-center-z" property to the fixed
|
* and 360 degrees, and set the "rotation-center-z" property to the fixed
|
||||||
* value of the #ClutterVertex "center".
|
* value of the #graphene_point3d_t "center".
|
||||||
*
|
*
|
||||||
* This function will implicitly create a #ClutterAnimation object which
|
* This function will implicitly create a #ClutterAnimation object which
|
||||||
* will be assigned to the @actor and will be returned to the developer
|
* will be assigned to the @actor and will be returned to the developer
|
||||||
|
@@ -1,303 +0,0 @@
|
|||||||
/*
|
|
||||||
* Clutter.
|
|
||||||
*
|
|
||||||
* An OpenGL based 'interactive canvas' library.
|
|
||||||
*
|
|
||||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
|
||||||
* Jorn Baayen <jorn@openedhand.com>
|
|
||||||
* Emmanuele Bassi <ebassi@openedhand.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 OpenedHand
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "clutter-build-config.h"
|
|
||||||
|
|
||||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
|
||||||
|
|
||||||
#include "deprecated/clutter-actor.h"
|
|
||||||
#include "clutter-alpha.h"
|
|
||||||
#include "clutter-behaviour.h"
|
|
||||||
#include "clutter-behaviour-depth.h"
|
|
||||||
#include "clutter-enum-types.h"
|
|
||||||
#include "clutter-main.h"
|
|
||||||
#include "clutter-debug.h"
|
|
||||||
#include "clutter-private.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SECTION:clutter-behaviour-depth
|
|
||||||
* @Title: ClutterBehaviourDepth
|
|
||||||
* @short_description: A behaviour controlling the Z position
|
|
||||||
* @Deprecated: 1.6: Use clutter_actor_animate() instead
|
|
||||||
*
|
|
||||||
* #ClutterBehaviourDepth is a simple #ClutterBehaviour controlling the
|
|
||||||
* depth of a set of actors between a start and end depth.
|
|
||||||
*
|
|
||||||
* #ClutterBehaviourDepth is available since Clutter 0.4.
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: Use the #ClutterActor:depth property and
|
|
||||||
* clutter_actor_animate(), or #ClutterAnimator, or #ClutterState
|
|
||||||
* instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct _ClutterBehaviourDepthPrivate
|
|
||||||
{
|
|
||||||
gint depth_start;
|
|
||||||
gint depth_end;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
PROP_0,
|
|
||||||
|
|
||||||
PROP_DEPTH_START,
|
|
||||||
PROP_DEPTH_END
|
|
||||||
};
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_PRIVATE (ClutterBehaviourDepth,
|
|
||||||
clutter_behaviour_depth,
|
|
||||||
CLUTTER_TYPE_BEHAVIOUR)
|
|
||||||
|
|
||||||
static void
|
|
||||||
alpha_notify_foreach (ClutterBehaviour *behaviour,
|
|
||||||
ClutterActor *actor,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
clutter_actor_set_depth (actor, GPOINTER_TO_INT (user_data));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_depth_alpha_notify (ClutterBehaviour *behaviour,
|
|
||||||
gdouble alpha_value)
|
|
||||||
{
|
|
||||||
ClutterBehaviourDepthPrivate *priv;
|
|
||||||
gint depth;
|
|
||||||
|
|
||||||
priv = CLUTTER_BEHAVIOUR_DEPTH (behaviour)->priv;
|
|
||||||
|
|
||||||
/* Need to create factor as to avoid borking signedness */
|
|
||||||
depth = (alpha_value * (priv->depth_end - priv->depth_start))
|
|
||||||
+ priv->depth_start;
|
|
||||||
|
|
||||||
CLUTTER_NOTE (ANIMATION, "alpha: %.4f, depth: %d", alpha_value, depth);
|
|
||||||
|
|
||||||
clutter_behaviour_actors_foreach (behaviour,
|
|
||||||
alpha_notify_foreach,
|
|
||||||
GINT_TO_POINTER (depth));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_depth_applied (ClutterBehaviour *behaviour,
|
|
||||||
ClutterActor *actor)
|
|
||||||
{
|
|
||||||
ClutterBehaviourDepth *depth = CLUTTER_BEHAVIOUR_DEPTH (behaviour);
|
|
||||||
|
|
||||||
clutter_actor_set_depth (actor, depth->priv->depth_start);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_depth_set_property (GObject *gobject,
|
|
||||||
guint prop_id,
|
|
||||||
const GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
ClutterBehaviourDepth *depth = CLUTTER_BEHAVIOUR_DEPTH (gobject);
|
|
||||||
|
|
||||||
switch (prop_id)
|
|
||||||
{
|
|
||||||
case PROP_DEPTH_START:
|
|
||||||
depth->priv->depth_start = g_value_get_int (value);
|
|
||||||
break;
|
|
||||||
case PROP_DEPTH_END:
|
|
||||||
depth->priv->depth_end = g_value_get_int (value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_depth_get_property (GObject *gobject,
|
|
||||||
guint prop_id,
|
|
||||||
GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
ClutterBehaviourDepth *depth = CLUTTER_BEHAVIOUR_DEPTH (gobject);
|
|
||||||
|
|
||||||
switch (prop_id)
|
|
||||||
{
|
|
||||||
case PROP_DEPTH_START:
|
|
||||||
g_value_set_int (value, depth->priv->depth_start);
|
|
||||||
break;
|
|
||||||
case PROP_DEPTH_END:
|
|
||||||
g_value_set_int (value, depth->priv->depth_end);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_depth_class_init (ClutterBehaviourDepthClass *klass)
|
|
||||||
{
|
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
|
||||||
ClutterBehaviourClass *behaviour_class = CLUTTER_BEHAVIOUR_CLASS (klass);
|
|
||||||
|
|
||||||
gobject_class->set_property = clutter_behaviour_depth_set_property;
|
|
||||||
gobject_class->get_property = clutter_behaviour_depth_get_property;
|
|
||||||
|
|
||||||
behaviour_class->alpha_notify = clutter_behaviour_depth_alpha_notify;
|
|
||||||
behaviour_class->applied = clutter_behaviour_depth_applied;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourDepth:depth-start:
|
|
||||||
*
|
|
||||||
* Start depth level to apply to the actors.
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
g_object_class_install_property (gobject_class,
|
|
||||||
PROP_DEPTH_START,
|
|
||||||
g_param_spec_int ("depth-start",
|
|
||||||
P_("Start Depth"),
|
|
||||||
P_("Initial depth to apply"),
|
|
||||||
G_MININT, G_MAXINT, 0,
|
|
||||||
CLUTTER_PARAM_READWRITE));
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourDepth:depth-end:
|
|
||||||
*
|
|
||||||
* End depth level to apply to the actors.
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
g_object_class_install_property (gobject_class,
|
|
||||||
PROP_DEPTH_END,
|
|
||||||
g_param_spec_int ("depth-end",
|
|
||||||
P_("End Depth"),
|
|
||||||
P_("Final depth to apply"),
|
|
||||||
G_MININT, G_MAXINT, 0,
|
|
||||||
CLUTTER_PARAM_READWRITE));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_depth_init (ClutterBehaviourDepth *depth)
|
|
||||||
{
|
|
||||||
depth->priv = clutter_behaviour_depth_get_instance_private (depth);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_depth_new:
|
|
||||||
* @alpha: (allow-none): a #ClutterAlpha instance, or %NULL
|
|
||||||
* @depth_start: initial value of the depth
|
|
||||||
* @depth_end: final value of the depth
|
|
||||||
*
|
|
||||||
* Creates a new #ClutterBehaviourDepth which can be used to control
|
|
||||||
* the ClutterActor:depth property of a set of #ClutterActor<!-- -->s.
|
|
||||||
*
|
|
||||||
* If @alpha is not %NULL, the #ClutterBehaviour will take ownership
|
|
||||||
* of the #ClutterAlpha instance. In the case when @alpha is %NULL,
|
|
||||||
* it can be set later with clutter_behaviour_set_alpha().
|
|
||||||
*
|
|
||||||
* Return value: (transfer full): the newly created behaviour
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
ClutterBehaviour *
|
|
||||||
clutter_behaviour_depth_new (ClutterAlpha *alpha,
|
|
||||||
gint depth_start,
|
|
||||||
gint depth_end)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (alpha == NULL || CLUTTER_IS_ALPHA (alpha), NULL);
|
|
||||||
|
|
||||||
return g_object_new (CLUTTER_TYPE_BEHAVIOUR_DEPTH,
|
|
||||||
"alpha", alpha,
|
|
||||||
"depth-start", depth_start,
|
|
||||||
"depth-end", depth_end,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_depth_set_bounds:
|
|
||||||
* @behaviour: a #ClutterBehaviourDepth
|
|
||||||
* @depth_start: initial value of the depth
|
|
||||||
* @depth_end: final value of the depth
|
|
||||||
*
|
|
||||||
* Sets the boundaries of the @behaviour.
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_behaviour_depth_set_bounds (ClutterBehaviourDepth *behaviour,
|
|
||||||
gint depth_start,
|
|
||||||
gint depth_end)
|
|
||||||
{
|
|
||||||
ClutterBehaviourDepthPrivate *priv;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_DEPTH (behaviour));
|
|
||||||
|
|
||||||
priv = behaviour->priv;
|
|
||||||
|
|
||||||
g_object_freeze_notify (G_OBJECT (behaviour));
|
|
||||||
|
|
||||||
if (priv->depth_start != depth_start)
|
|
||||||
{
|
|
||||||
priv->depth_start = depth_start;
|
|
||||||
g_object_notify (G_OBJECT (behaviour), "depth-start");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->depth_end != depth_end)
|
|
||||||
{
|
|
||||||
priv->depth_end = depth_end;
|
|
||||||
g_object_notify (G_OBJECT (behaviour), "depth-end");
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_thaw_notify (G_OBJECT (behaviour));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_depth_get_bounds:
|
|
||||||
* @behaviour: a #ClutterBehaviourDepth
|
|
||||||
* @depth_start: (out): return location for the initial depth value, or %NULL
|
|
||||||
* @depth_end: (out): return location for the final depth value, or %NULL
|
|
||||||
*
|
|
||||||
* Gets the boundaries of the @behaviour
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_behaviour_depth_get_bounds (ClutterBehaviourDepth *behaviour,
|
|
||||||
gint *depth_start,
|
|
||||||
gint *depth_end)
|
|
||||||
{
|
|
||||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_DEPTH (behaviour));
|
|
||||||
|
|
||||||
if (depth_start)
|
|
||||||
*depth_start = behaviour->priv->depth_start;
|
|
||||||
|
|
||||||
if (depth_end)
|
|
||||||
*depth_end = behaviour->priv->depth_end;
|
|
||||||
}
|
|
@@ -1,101 +0,0 @@
|
|||||||
/*
|
|
||||||
* Clutter.
|
|
||||||
*
|
|
||||||
* An OpenGL based 'interactive canvas' library.
|
|
||||||
*
|
|
||||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
|
||||||
* Jorn Baayen <jorn@openedhand.com>
|
|
||||||
* Emmanuele Bassi <ebassi@openedhand.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 OpenedHand
|
|
||||||
*
|
|
||||||
* 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_BEHAVIOUR_DEPTH__
|
|
||||||
#define __CLUTTER_BEHAVIOUR_DEPTH__
|
|
||||||
|
|
||||||
#include <clutter/clutter-types.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define CLUTTER_TYPE_BEHAVIOUR_DEPTH (clutter_behaviour_depth_get_type ())
|
|
||||||
#define CLUTTER_BEHAVIOUR_DEPTH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BEHAVIOUR_DEPTH, ClutterBehaviourDepth))
|
|
||||||
#define CLUTTER_IS_BEHAVIOUR_DEPTH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BEHAVIOUR_DEPTH))
|
|
||||||
#define CLUTTER_BEHAVIOUR_DEPTH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BEHAVIOUR_DEPTH, ClutterBehaviourDepthClass))
|
|
||||||
#define CLUTTER_IS_BEHAVIOUR_DEPTH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BEHAVIOUR_DEPTH))
|
|
||||||
#define CLUTTER_BEHAVIOUR_DEPTH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BEHAVIOUR_DEPTH, ClutterBehaviourDepthClass))
|
|
||||||
|
|
||||||
typedef struct _ClutterBehaviourDepth ClutterBehaviourDepth;
|
|
||||||
typedef struct _ClutterBehaviourDepthPrivate ClutterBehaviourDepthPrivate;
|
|
||||||
typedef struct _ClutterBehaviourDepthClass ClutterBehaviourDepthClass;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourDepth:
|
|
||||||
*
|
|
||||||
* The #ClutterBehaviourDepth structure contains only private data
|
|
||||||
* and should be accessed using the provided API
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: Use clutter_actor_animate() with #ClutterActor:depth
|
|
||||||
* instead.
|
|
||||||
*/
|
|
||||||
struct _ClutterBehaviourDepth
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
ClutterBehaviour parent_instance;
|
|
||||||
|
|
||||||
ClutterBehaviourDepthPrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourDepthClass:
|
|
||||||
*
|
|
||||||
* The #ClutterBehaviourDepthClass structure contains only private data
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
struct _ClutterBehaviourDepthClass
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
ClutterBehaviourClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GType clutter_behaviour_depth_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(clutter_actor_animate and ClutterActor:depth)
|
|
||||||
ClutterBehaviour *clutter_behaviour_depth_new (ClutterAlpha *alpha,
|
|
||||||
gint depth_start,
|
|
||||||
gint depth_end);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_behaviour_depth_set_bounds (ClutterBehaviourDepth *behaviour,
|
|
||||||
gint depth_start,
|
|
||||||
gint depth_end);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_behaviour_depth_get_bounds (ClutterBehaviourDepth *behaviour,
|
|
||||||
gint *depth_start,
|
|
||||||
gint *depth_end);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __CLUTTER_BEHAVIOUR_DEPTH__ */
|
|
@@ -1,310 +0,0 @@
|
|||||||
/*
|
|
||||||
* Clutter.
|
|
||||||
*
|
|
||||||
* An OpenGL based 'interactive canvas' library.
|
|
||||||
*
|
|
||||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 OpenedHand
|
|
||||||
*
|
|
||||||
* 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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SECTION:clutter-behaviour-opacity
|
|
||||||
* @Title: ClutterBehaviourOpacity
|
|
||||||
* @short_description: A behaviour controlling opacity
|
|
||||||
* @Deprecated: 1.6: Use clutter_actor_animate() instead.
|
|
||||||
*
|
|
||||||
* #ClutterBehaviourOpacity controls the opacity of a set of actors.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: Use the #ClutterActor:opacity property and
|
|
||||||
* clutter_actor_animate(), or #ClutterAnimator, or #ClutterState
|
|
||||||
* instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "clutter-build-config.h"
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
|
||||||
|
|
||||||
#include "clutter-alpha.h"
|
|
||||||
#include "clutter-behaviour.h"
|
|
||||||
#include "clutter-behaviour-opacity.h"
|
|
||||||
#include "clutter-private.h"
|
|
||||||
#include "clutter-debug.h"
|
|
||||||
|
|
||||||
struct _ClutterBehaviourOpacityPrivate
|
|
||||||
{
|
|
||||||
guint8 opacity_start;
|
|
||||||
guint8 opacity_end;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
PROP_0,
|
|
||||||
|
|
||||||
PROP_OPACITY_START,
|
|
||||||
PROP_OPACITY_END,
|
|
||||||
|
|
||||||
PROP_LAST
|
|
||||||
};
|
|
||||||
|
|
||||||
static GParamSpec *obj_props[PROP_LAST];
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_PRIVATE (ClutterBehaviourOpacity,
|
|
||||||
clutter_behaviour_opacity,
|
|
||||||
CLUTTER_TYPE_BEHAVIOUR)
|
|
||||||
|
|
||||||
static void
|
|
||||||
alpha_notify_foreach (ClutterBehaviour *behaviour,
|
|
||||||
ClutterActor *actor,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
clutter_actor_set_opacity (actor, GPOINTER_TO_UINT(data));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_alpha_notify (ClutterBehaviour *behave,
|
|
||||||
gdouble alpha_value)
|
|
||||||
{
|
|
||||||
ClutterBehaviourOpacityPrivate *priv;
|
|
||||||
guint8 opacity;
|
|
||||||
|
|
||||||
priv = CLUTTER_BEHAVIOUR_OPACITY (behave)->priv;
|
|
||||||
|
|
||||||
opacity = alpha_value
|
|
||||||
* (priv->opacity_end - priv->opacity_start)
|
|
||||||
+ priv->opacity_start;
|
|
||||||
|
|
||||||
CLUTTER_NOTE (ANIMATION, "alpha: %.4f, opacity: %u",
|
|
||||||
alpha_value,
|
|
||||||
opacity);
|
|
||||||
|
|
||||||
clutter_behaviour_actors_foreach (behave,
|
|
||||||
alpha_notify_foreach,
|
|
||||||
GUINT_TO_POINTER ((guint) opacity));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_opacity_set_property (GObject *gobject,
|
|
||||||
guint prop_id,
|
|
||||||
const GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
ClutterBehaviourOpacity *self = CLUTTER_BEHAVIOUR_OPACITY (gobject);
|
|
||||||
|
|
||||||
switch (prop_id)
|
|
||||||
{
|
|
||||||
case PROP_OPACITY_START:
|
|
||||||
clutter_behaviour_opacity_set_bounds (self,
|
|
||||||
g_value_get_uint (value),
|
|
||||||
self->priv->opacity_end);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_OPACITY_END:
|
|
||||||
clutter_behaviour_opacity_set_bounds (self,
|
|
||||||
self->priv->opacity_start,
|
|
||||||
g_value_get_uint (value));
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_opacity_get_property (GObject *gobject,
|
|
||||||
guint prop_id,
|
|
||||||
GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
ClutterBehaviourOpacity *self = CLUTTER_BEHAVIOUR_OPACITY (gobject);
|
|
||||||
|
|
||||||
switch (prop_id)
|
|
||||||
{
|
|
||||||
case PROP_OPACITY_START:
|
|
||||||
g_value_set_uint (value, self->priv->opacity_start);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_OPACITY_END:
|
|
||||||
g_value_set_uint (value, self->priv->opacity_end);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_opacity_class_init (ClutterBehaviourOpacityClass *klass)
|
|
||||||
{
|
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
|
||||||
ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass);
|
|
||||||
GParamSpec *pspec;
|
|
||||||
|
|
||||||
gobject_class->set_property = clutter_behaviour_opacity_set_property;
|
|
||||||
gobject_class->get_property = clutter_behaviour_opacity_get_property;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourOpacity:opacity-start:
|
|
||||||
*
|
|
||||||
* Initial opacity level of the behaviour.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_uint ("opacity-start",
|
|
||||||
P_("Opacity Start"),
|
|
||||||
P_("Initial opacity level"),
|
|
||||||
0, 255,
|
|
||||||
0,
|
|
||||||
CLUTTER_PARAM_READWRITE);
|
|
||||||
obj_props[PROP_OPACITY_START] = pspec;
|
|
||||||
g_object_class_install_property (gobject_class, PROP_OPACITY_START, pspec);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourOpacity:opacity-end:
|
|
||||||
*
|
|
||||||
* Final opacity level of the behaviour.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_uint ("opacity-end",
|
|
||||||
P_("Opacity End"),
|
|
||||||
P_("Final opacity level"),
|
|
||||||
0, 255,
|
|
||||||
0,
|
|
||||||
CLUTTER_PARAM_READWRITE);
|
|
||||||
obj_props[PROP_OPACITY_END] = pspec;
|
|
||||||
g_object_class_install_property (gobject_class, PROP_OPACITY_END, pspec);
|
|
||||||
|
|
||||||
behave_class->alpha_notify = clutter_behaviour_alpha_notify;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_opacity_init (ClutterBehaviourOpacity *self)
|
|
||||||
{
|
|
||||||
self->priv = clutter_behaviour_opacity_get_instance_private (self);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_opacity_new:
|
|
||||||
* @alpha: (allow-none): a #ClutterAlpha instance, or %NULL
|
|
||||||
* @opacity_start: minimum level of opacity
|
|
||||||
* @opacity_end: maximum level of opacity
|
|
||||||
*
|
|
||||||
* Creates a new #ClutterBehaviourOpacity object, driven by @alpha
|
|
||||||
* which controls the opacity property of every actor, making it
|
|
||||||
* change in the interval between @opacity_start and @opacity_end.
|
|
||||||
*
|
|
||||||
* If @alpha is not %NULL, the #ClutterBehaviour will take ownership
|
|
||||||
* of the #ClutterAlpha instance. In the case when @alpha is %NULL,
|
|
||||||
* it can be set later with clutter_behaviour_set_alpha().
|
|
||||||
*
|
|
||||||
* Return value: the newly created #ClutterBehaviourOpacity
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
ClutterBehaviour *
|
|
||||||
clutter_behaviour_opacity_new (ClutterAlpha *alpha,
|
|
||||||
guint8 opacity_start,
|
|
||||||
guint8 opacity_end)
|
|
||||||
{
|
|
||||||
return g_object_new (CLUTTER_TYPE_BEHAVIOUR_OPACITY,
|
|
||||||
"alpha", alpha,
|
|
||||||
"opacity-start", opacity_start,
|
|
||||||
"opacity-end", opacity_end,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_opacity_set_bounds:
|
|
||||||
* @behaviour: a #ClutterBehaviourOpacity
|
|
||||||
* @opacity_start: minimum level of opacity
|
|
||||||
* @opacity_end: maximum level of opacity
|
|
||||||
*
|
|
||||||
* Sets the initial and final levels of the opacity applied by @behaviour
|
|
||||||
* on each actor it controls.
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_behaviour_opacity_set_bounds (ClutterBehaviourOpacity *behaviour,
|
|
||||||
guint8 opacity_start,
|
|
||||||
guint8 opacity_end)
|
|
||||||
{
|
|
||||||
ClutterBehaviourOpacityPrivate *priv;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_OPACITY (behaviour));
|
|
||||||
|
|
||||||
priv = behaviour->priv;
|
|
||||||
|
|
||||||
g_object_freeze_notify (G_OBJECT (behaviour));
|
|
||||||
|
|
||||||
if (priv->opacity_start != opacity_start)
|
|
||||||
{
|
|
||||||
priv->opacity_start = opacity_start;
|
|
||||||
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (behaviour), obj_props[PROP_OPACITY_START]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->opacity_end != opacity_end)
|
|
||||||
{
|
|
||||||
priv->opacity_end = opacity_end;
|
|
||||||
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (behaviour), obj_props[PROP_OPACITY_END]);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_thaw_notify (G_OBJECT (behaviour));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_opacity_get_bounds:
|
|
||||||
* @behaviour: a #ClutterBehaviourOpacity
|
|
||||||
* @opacity_start: (out): return location for the minimum level of opacity, or %NULL
|
|
||||||
* @opacity_end: (out): return location for the maximum level of opacity, or %NULL
|
|
||||||
*
|
|
||||||
* Gets the initial and final levels of the opacity applied by @behaviour
|
|
||||||
* on each actor it controls.
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_behaviour_opacity_get_bounds (ClutterBehaviourOpacity *behaviour,
|
|
||||||
guint8 *opacity_start,
|
|
||||||
guint8 *opacity_end)
|
|
||||||
{
|
|
||||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_OPACITY (behaviour));
|
|
||||||
|
|
||||||
if (opacity_start)
|
|
||||||
*opacity_start = behaviour->priv->opacity_start;
|
|
||||||
|
|
||||||
if (opacity_end)
|
|
||||||
*opacity_end = behaviour->priv->opacity_end;
|
|
||||||
}
|
|
@@ -1,115 +0,0 @@
|
|||||||
/*
|
|
||||||
* Clutter.
|
|
||||||
*
|
|
||||||
* An OpenGL based 'interactive canvas' library.
|
|
||||||
*
|
|
||||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
|
||||||
* Jorn Baayen <jorn@openedhand.com>
|
|
||||||
* Emmanuele Bassi <ebassi@openedhand.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 OpenedHand
|
|
||||||
*
|
|
||||||
* 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_BEHAVIOUR_OPACITY_H__
|
|
||||||
#define __CLUTTER_BEHAVIOUR_OPACITY_H__
|
|
||||||
|
|
||||||
#include <clutter/clutter-types.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define CLUTTER_TYPE_BEHAVIOUR_OPACITY (clutter_behaviour_opacity_get_type ())
|
|
||||||
|
|
||||||
#define CLUTTER_BEHAVIOUR_OPACITY(obj) \
|
|
||||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
|
||||||
CLUTTER_TYPE_BEHAVIOUR_OPACITY, ClutterBehaviourOpacity))
|
|
||||||
|
|
||||||
#define CLUTTER_BEHAVIOUR_OPACITY_CLASS(klass) \
|
|
||||||
(G_TYPE_CHECK_CLASS_CAST ((klass), \
|
|
||||||
CLUTTER_TYPE_BEHAVIOUR_OPACITY, ClutterBehaviourOpacityClass))
|
|
||||||
|
|
||||||
#define CLUTTER_IS_BEHAVIOUR_OPACITY(obj) \
|
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
|
|
||||||
CLUTTER_TYPE_BEHAVIOUR_OPACITY))
|
|
||||||
|
|
||||||
#define CLUTTER_IS_BEHAVIOUR_OPACITY_CLASS(klass) \
|
|
||||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
|
|
||||||
CLUTTER_TYPE_BEHAVIOUR_OPACITY))
|
|
||||||
|
|
||||||
#define CLUTTER_BEHAVIOUR_OPACITY_GET_CLASS(obj) \
|
|
||||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
|
|
||||||
CLUTTER_TYPE_BEHAVIOUR_OPACITY, ClutterBehaviourOpacityClass))
|
|
||||||
|
|
||||||
typedef struct _ClutterBehaviourOpacity ClutterBehaviourOpacity;
|
|
||||||
typedef struct _ClutterBehaviourOpacityPrivate ClutterBehaviourOpacityPrivate;
|
|
||||||
typedef struct _ClutterBehaviourOpacityClass ClutterBehaviourOpacityClass;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourOpacity:
|
|
||||||
*
|
|
||||||
* The #ClutterBehaviourOpacity structure contains only private data and
|
|
||||||
* should be accessed using the provided API
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: Use clutter_actor_animate() and #ClutterActor:opacity
|
|
||||||
* instead.
|
|
||||||
*/
|
|
||||||
struct _ClutterBehaviourOpacity
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
ClutterBehaviour parent;
|
|
||||||
ClutterBehaviourOpacityPrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourOpacityClass:
|
|
||||||
*
|
|
||||||
* The #ClutterBehaviourOpacityClass structure contains only private data
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
struct _ClutterBehaviourOpacityClass
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
ClutterBehaviourClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GType clutter_behaviour_opacity_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(clutter_actor_animate and ClutterActor:opacity)
|
|
||||||
ClutterBehaviour *clutter_behaviour_opacity_new (ClutterAlpha *alpha,
|
|
||||||
guint8 opacity_start,
|
|
||||||
guint8 opacity_end);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_behaviour_opacity_set_bounds (ClutterBehaviourOpacity *behaviour,
|
|
||||||
guint8 opacity_start,
|
|
||||||
guint8 opacity_end);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_behaviour_opacity_get_bounds (ClutterBehaviourOpacity *behaviour,
|
|
||||||
guint8 *opacity_start,
|
|
||||||
guint8 *opacity_end);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __CLUTTER_BEHAVIOUR_OPACITY_H__ */
|
|
@@ -1,437 +0,0 @@
|
|||||||
/*
|
|
||||||
* Clutter.
|
|
||||||
*
|
|
||||||
* An OpenGL based 'interactive canvas' library.
|
|
||||||
*
|
|
||||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 OpenedHand
|
|
||||||
*
|
|
||||||
* 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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SECTION:clutter-behaviour-scale
|
|
||||||
* @Title: ClutterBehaviourScale
|
|
||||||
* @short_description: A behaviour controlling scale
|
|
||||||
* @Deprecated: 1.6: Use clutter_actor_animate() with #ClutterActor:scale-x
|
|
||||||
* and #ClutterActor:scale-y instead.
|
|
||||||
*
|
|
||||||
* A #ClutterBehaviourScale interpolates actors size between two values.
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: Use the #ClutterActor:scale-x and #ClutterActor:scale-y
|
|
||||||
* properties, and clutter_actor_animate(), or #ClutterAnimator or
|
|
||||||
* #ClutterState instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "clutter-build-config.h"
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
|
||||||
#include "deprecated/clutter-actor.h"
|
|
||||||
|
|
||||||
#include "clutter-alpha.h"
|
|
||||||
#include "clutter-behaviour.h"
|
|
||||||
#include "clutter-behaviour-scale.h"
|
|
||||||
#include "clutter-debug.h"
|
|
||||||
#include "clutter-main.h"
|
|
||||||
#include "clutter-private.h"
|
|
||||||
|
|
||||||
struct _ClutterBehaviourScalePrivate
|
|
||||||
{
|
|
||||||
gdouble x_scale_start;
|
|
||||||
gdouble y_scale_start;
|
|
||||||
|
|
||||||
gdouble x_scale_end;
|
|
||||||
gdouble y_scale_end;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
PROP_0,
|
|
||||||
|
|
||||||
PROP_X_SCALE_START,
|
|
||||||
PROP_Y_SCALE_START,
|
|
||||||
PROP_X_SCALE_END,
|
|
||||||
PROP_Y_SCALE_END,
|
|
||||||
|
|
||||||
PROP_LAST
|
|
||||||
};
|
|
||||||
|
|
||||||
static GParamSpec *obj_props[PROP_LAST];
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_PRIVATE (ClutterBehaviourScale,
|
|
||||||
clutter_behaviour_scale,
|
|
||||||
CLUTTER_TYPE_BEHAVIOUR)
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
gdouble scale_x;
|
|
||||||
gdouble scale_y;
|
|
||||||
} ScaleFrameClosure;
|
|
||||||
|
|
||||||
static void
|
|
||||||
scale_frame_foreach (ClutterBehaviour *behaviour,
|
|
||||||
ClutterActor *actor,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
ScaleFrameClosure *closure = data;
|
|
||||||
|
|
||||||
clutter_actor_set_scale (actor, closure->scale_x, closure->scale_y);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_scale_alpha_notify (ClutterBehaviour *behave,
|
|
||||||
gdouble alpha_value)
|
|
||||||
{
|
|
||||||
ClutterBehaviourScalePrivate *priv;
|
|
||||||
ScaleFrameClosure closure = { 0, };
|
|
||||||
|
|
||||||
priv = CLUTTER_BEHAVIOUR_SCALE (behave)->priv;
|
|
||||||
|
|
||||||
/* Fix the start/end values, avoids potential rounding errors on large
|
|
||||||
* values.
|
|
||||||
*/
|
|
||||||
if (alpha_value == 1.0)
|
|
||||||
{
|
|
||||||
closure.scale_x = priv->x_scale_end;
|
|
||||||
closure.scale_y = priv->y_scale_end;
|
|
||||||
}
|
|
||||||
else if (alpha_value == 0)
|
|
||||||
{
|
|
||||||
closure.scale_x = priv->x_scale_start;
|
|
||||||
closure.scale_y = priv->y_scale_start;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
closure.scale_x = (priv->x_scale_end - priv->x_scale_start)
|
|
||||||
* alpha_value
|
|
||||||
+ priv->x_scale_start;
|
|
||||||
|
|
||||||
closure.scale_y = (priv->y_scale_end - priv->y_scale_start)
|
|
||||||
* alpha_value
|
|
||||||
+ priv->y_scale_start;
|
|
||||||
}
|
|
||||||
|
|
||||||
clutter_behaviour_actors_foreach (behave,
|
|
||||||
scale_frame_foreach,
|
|
||||||
&closure);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_scale_set_property (GObject *gobject,
|
|
||||||
guint prop_id,
|
|
||||||
const GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
ClutterBehaviourScalePrivate *priv;
|
|
||||||
|
|
||||||
priv = CLUTTER_BEHAVIOUR_SCALE (gobject)->priv;
|
|
||||||
|
|
||||||
switch (prop_id)
|
|
||||||
{
|
|
||||||
case PROP_X_SCALE_START:
|
|
||||||
priv->x_scale_start = g_value_get_double (value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_X_SCALE_END:
|
|
||||||
priv->x_scale_end = g_value_get_double (value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_Y_SCALE_START:
|
|
||||||
priv->y_scale_start = g_value_get_double (value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_Y_SCALE_END:
|
|
||||||
priv->y_scale_end = g_value_get_double (value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_scale_get_property (GObject *gobject,
|
|
||||||
guint prop_id,
|
|
||||||
GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
ClutterBehaviourScalePrivate *priv;
|
|
||||||
|
|
||||||
priv = CLUTTER_BEHAVIOUR_SCALE (gobject)->priv;
|
|
||||||
|
|
||||||
switch (prop_id)
|
|
||||||
{
|
|
||||||
case PROP_X_SCALE_START:
|
|
||||||
g_value_set_double (value, priv->x_scale_start);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_X_SCALE_END:
|
|
||||||
g_value_set_double (value, priv->x_scale_end);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_Y_SCALE_START:
|
|
||||||
g_value_set_double (value, priv->y_scale_start);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_Y_SCALE_END:
|
|
||||||
g_value_set_double (value, priv->y_scale_end);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_scale_class_init (ClutterBehaviourScaleClass *klass)
|
|
||||||
{
|
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
|
||||||
ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass);
|
|
||||||
GParamSpec *pspec = NULL;
|
|
||||||
|
|
||||||
gobject_class->set_property = clutter_behaviour_scale_set_property;
|
|
||||||
gobject_class->get_property = clutter_behaviour_scale_get_property;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourScale:x-scale-start:
|
|
||||||
*
|
|
||||||
* The initial scaling factor on the X axis for the actors.
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_double ("x-scale-start",
|
|
||||||
P_("X Start Scale"),
|
|
||||||
P_("Initial scale on the X axis"),
|
|
||||||
0.0, G_MAXDOUBLE,
|
|
||||||
1.0,
|
|
||||||
CLUTTER_PARAM_READWRITE);
|
|
||||||
obj_props[PROP_X_SCALE_START] = pspec;
|
|
||||||
g_object_class_install_property (gobject_class,
|
|
||||||
PROP_X_SCALE_START,
|
|
||||||
pspec);
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourScale:x-scale-end:
|
|
||||||
*
|
|
||||||
* The final scaling factor on the X axis for the actors.
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_double ("x-scale-end",
|
|
||||||
P_("X End Scale"),
|
|
||||||
P_("Final scale on the X axis"),
|
|
||||||
0.0, G_MAXDOUBLE,
|
|
||||||
1.0,
|
|
||||||
CLUTTER_PARAM_READWRITE);
|
|
||||||
obj_props[PROP_X_SCALE_END] = pspec;
|
|
||||||
g_object_class_install_property (gobject_class,
|
|
||||||
PROP_X_SCALE_END,
|
|
||||||
pspec);
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourScale:y-scale-start:
|
|
||||||
*
|
|
||||||
* The initial scaling factor on the Y axis for the actors.
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_double ("y-scale-start",
|
|
||||||
P_("Y Start Scale"),
|
|
||||||
P_("Initial scale on the Y axis"),
|
|
||||||
0.0, G_MAXDOUBLE,
|
|
||||||
1.0,
|
|
||||||
CLUTTER_PARAM_READWRITE);
|
|
||||||
obj_props[PROP_Y_SCALE_START] = pspec;
|
|
||||||
g_object_class_install_property (gobject_class,
|
|
||||||
PROP_Y_SCALE_START,
|
|
||||||
pspec);
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourScale:y-scale-end:
|
|
||||||
*
|
|
||||||
* The final scaling factor on the Y axis for the actors.
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_double ("y-scale-end",
|
|
||||||
P_("Y End Scale"),
|
|
||||||
P_("Final scale on the Y axis"),
|
|
||||||
0.0, G_MAXDOUBLE,
|
|
||||||
1.0,
|
|
||||||
CLUTTER_PARAM_READWRITE);
|
|
||||||
obj_props[PROP_Y_SCALE_END] = pspec;
|
|
||||||
g_object_class_install_property (gobject_class,
|
|
||||||
PROP_Y_SCALE_END,
|
|
||||||
pspec);
|
|
||||||
|
|
||||||
behave_class->alpha_notify = clutter_behaviour_scale_alpha_notify;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_scale_init (ClutterBehaviourScale *self)
|
|
||||||
{
|
|
||||||
ClutterBehaviourScalePrivate *priv;
|
|
||||||
|
|
||||||
self->priv = priv = clutter_behaviour_scale_get_instance_private (self);
|
|
||||||
|
|
||||||
priv->x_scale_start = priv->x_scale_end = 1.0;
|
|
||||||
priv->y_scale_start = priv->y_scale_end = 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_scale_new:
|
|
||||||
* @alpha: (allow-none): a #ClutterAlpha instance, or %NULL
|
|
||||||
* @x_scale_start: initial scale factor on the X axis
|
|
||||||
* @y_scale_start: initial scale factor on the Y axis
|
|
||||||
* @x_scale_end: final scale factor on the X axis
|
|
||||||
* @y_scale_end: final scale factor on the Y axis
|
|
||||||
*
|
|
||||||
* Creates a new #ClutterBehaviourScale instance.
|
|
||||||
*
|
|
||||||
* If @alpha is not %NULL, the #ClutterBehaviour will take ownership
|
|
||||||
* of the #ClutterAlpha instance. In the case when @alpha is %NULL,
|
|
||||||
* it can be set later with clutter_behaviour_set_alpha().
|
|
||||||
*
|
|
||||||
* Return value: (transfer full): the newly created #ClutterBehaviourScale
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
ClutterBehaviour *
|
|
||||||
clutter_behaviour_scale_new (ClutterAlpha *alpha,
|
|
||||||
gdouble x_scale_start,
|
|
||||||
gdouble y_scale_start,
|
|
||||||
gdouble x_scale_end,
|
|
||||||
gdouble y_scale_end)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (alpha == NULL || CLUTTER_IS_ALPHA (alpha), NULL);
|
|
||||||
|
|
||||||
return g_object_new (CLUTTER_TYPE_BEHAVIOUR_SCALE,
|
|
||||||
"alpha", alpha,
|
|
||||||
"x-scale-start", x_scale_start,
|
|
||||||
"y-scale-start", y_scale_start,
|
|
||||||
"x-scale-end", x_scale_end,
|
|
||||||
"y-scale-end", y_scale_end,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_scale_set_bounds:
|
|
||||||
* @scale: a #ClutterBehaviourScale
|
|
||||||
* @x_scale_start: initial scale factor on the X axis
|
|
||||||
* @y_scale_start: initial scale factor on the Y axis
|
|
||||||
* @x_scale_end: final scale factor on the X axis
|
|
||||||
* @y_scale_end: final scale factor on the Y axis
|
|
||||||
*
|
|
||||||
* Sets the bounds used by scale behaviour.
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_behaviour_scale_set_bounds (ClutterBehaviourScale *scale,
|
|
||||||
gdouble x_scale_start,
|
|
||||||
gdouble y_scale_start,
|
|
||||||
gdouble x_scale_end,
|
|
||||||
gdouble y_scale_end)
|
|
||||||
{
|
|
||||||
ClutterBehaviourScalePrivate *priv;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_SCALE (scale));
|
|
||||||
|
|
||||||
priv = scale->priv;
|
|
||||||
|
|
||||||
g_object_freeze_notify (G_OBJECT (scale));
|
|
||||||
|
|
||||||
if (priv->x_scale_start != x_scale_start)
|
|
||||||
{
|
|
||||||
priv->x_scale_start = x_scale_start;
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (scale), obj_props[PROP_X_SCALE_START]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->y_scale_start != y_scale_start)
|
|
||||||
{
|
|
||||||
priv->y_scale_start = y_scale_start;
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (scale), obj_props[PROP_Y_SCALE_START]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->x_scale_end != x_scale_end)
|
|
||||||
{
|
|
||||||
priv->x_scale_end = x_scale_end;
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (scale), obj_props[PROP_X_SCALE_END]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->y_scale_end != y_scale_end)
|
|
||||||
{
|
|
||||||
priv->y_scale_end = y_scale_end;
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (scale), obj_props[PROP_Y_SCALE_END]);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_thaw_notify (G_OBJECT (scale));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_scale_get_bounds:
|
|
||||||
* @scale: a #ClutterBehaviourScale
|
|
||||||
* @x_scale_start: (out): return location for the initial scale factor on the X
|
|
||||||
* axis, or %NULL
|
|
||||||
* @y_scale_start: (out): return location for the initial scale factor on the Y
|
|
||||||
* axis, or %NULL
|
|
||||||
* @x_scale_end: (out): return location for the final scale factor on the X axis,
|
|
||||||
* or %NULL
|
|
||||||
* @y_scale_end: (out): return location for the final scale factor on the Y axis,
|
|
||||||
* or %NULL
|
|
||||||
*
|
|
||||||
* Retrieves the bounds used by scale behaviour.
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_behaviour_scale_get_bounds (ClutterBehaviourScale *scale,
|
|
||||||
gdouble *x_scale_start,
|
|
||||||
gdouble *y_scale_start,
|
|
||||||
gdouble *x_scale_end,
|
|
||||||
gdouble *y_scale_end)
|
|
||||||
{
|
|
||||||
ClutterBehaviourScalePrivate *priv;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_SCALE (scale));
|
|
||||||
|
|
||||||
priv = scale->priv;
|
|
||||||
|
|
||||||
if (x_scale_start)
|
|
||||||
*x_scale_start = priv->x_scale_start;
|
|
||||||
|
|
||||||
if (x_scale_end)
|
|
||||||
*x_scale_end = priv->x_scale_end;
|
|
||||||
|
|
||||||
if (y_scale_start)
|
|
||||||
*y_scale_start = priv->y_scale_start;
|
|
||||||
|
|
||||||
if (y_scale_end)
|
|
||||||
*y_scale_end = priv->y_scale_end;
|
|
||||||
}
|
|
@@ -1,107 +0,0 @@
|
|||||||
/*
|
|
||||||
* Clutter.
|
|
||||||
*
|
|
||||||
* An OpenGL based 'interactive canvas' library.
|
|
||||||
*
|
|
||||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
|
||||||
* Jorn Baayen <jorn@openedhand.com>
|
|
||||||
* Emmanuele Bassi <ebassi@openedhand.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 OpenedHand
|
|
||||||
*
|
|
||||||
* 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_BEHAVIOUR_SCALE_H__
|
|
||||||
#define __CLUTTER_BEHAVIOUR_SCALE_H__
|
|
||||||
|
|
||||||
#include <clutter/clutter-types.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define CLUTTER_TYPE_BEHAVIOUR_SCALE (clutter_behaviour_scale_get_type ())
|
|
||||||
#define CLUTTER_BEHAVIOUR_SCALE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BEHAVIOUR_SCALE, ClutterBehaviourScale))
|
|
||||||
#define CLUTTER_BEHAVIOUR_SCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BEHAVIOUR_SCALE, ClutterBehaviourScaleClass))
|
|
||||||
#define CLUTTER_IS_BEHAVIOUR_SCALE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BEHAVIOUR_SCALE))
|
|
||||||
#define CLUTTER_IS_BEHAVIOUR_SCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BEHAVIOUR_SCALE))
|
|
||||||
#define CLUTTER_BEHAVIOUR_SCALE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BEHAVIOUR_SCALE, ClutterBehaviourScaleClass))
|
|
||||||
|
|
||||||
typedef struct _ClutterBehaviourScale ClutterBehaviourScale;
|
|
||||||
typedef struct _ClutterBehaviourScalePrivate ClutterBehaviourScalePrivate;
|
|
||||||
typedef struct _ClutterBehaviourScaleClass ClutterBehaviourScaleClass;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourScale:
|
|
||||||
*
|
|
||||||
* The #ClutterBehaviourScale struct contains only private data and
|
|
||||||
* should be accessed using the provided API
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: Use clutter_actor_animate() with #ClutterActor:scale-x
|
|
||||||
* and #ClutterActor:scale-y instead.
|
|
||||||
*/
|
|
||||||
struct _ClutterBehaviourScale
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
ClutterBehaviour parent_instance;
|
|
||||||
|
|
||||||
ClutterBehaviourScalePrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourScaleClass:
|
|
||||||
*
|
|
||||||
* The #ClutterBehaviourScaleClass struct contains only private data
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
struct _ClutterBehaviourScaleClass
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
ClutterBehaviourClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GType clutter_behaviour_scale_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(clutter_actor_animate with ClutterActor:scale-x and ClutterActor:scale-y)
|
|
||||||
ClutterBehaviour *clutter_behaviour_scale_new (ClutterAlpha *alpha,
|
|
||||||
gdouble x_scale_start,
|
|
||||||
gdouble y_scale_start,
|
|
||||||
gdouble x_scale_end,
|
|
||||||
gdouble y_scale_end);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_behaviour_scale_set_bounds (ClutterBehaviourScale *scale,
|
|
||||||
gdouble x_scale_start,
|
|
||||||
gdouble y_scale_start,
|
|
||||||
gdouble x_scale_end,
|
|
||||||
gdouble y_scale_end);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_behaviour_scale_get_bounds (ClutterBehaviourScale *scale,
|
|
||||||
gdouble *x_scale_start,
|
|
||||||
gdouble *y_scale_start,
|
|
||||||
gdouble *x_scale_end,
|
|
||||||
gdouble *y_scale_end);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __CLUTTER_BEHAVIOUR_SCALE_H__ */
|
|
@@ -1,657 +0,0 @@
|
|||||||
/*
|
|
||||||
* Clutter.
|
|
||||||
*
|
|
||||||
* An OpenGL based 'interactive canvas' library.
|
|
||||||
*
|
|
||||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 OpenedHand
|
|
||||||
*
|
|
||||||
* 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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SECTION:clutter-behaviour
|
|
||||||
* @Title: ClutterBehaviour
|
|
||||||
* @short_description: Class for providing behaviours to actors
|
|
||||||
* @Deprecated: 1.6: Use clutter_actor_animate(), #ClutterAnimator or
|
|
||||||
* #ClutterState instead
|
|
||||||
*
|
|
||||||
* #ClutterBehaviour is the base class for implementing behaviours. A
|
|
||||||
* behaviour is a controller object for #ClutterActor<!-- -->s; you can
|
|
||||||
* use a behaviour to control one or more properties of an actor (such
|
|
||||||
* as its opacity, or its position). A #ClutterBehaviour is driven by
|
|
||||||
* an "alpha function" stored inside a #ClutterAlpha object; an alpha
|
|
||||||
* function is a function depending solely on time. The alpha function
|
|
||||||
* computes a value which is then applied to the properties of the
|
|
||||||
* actors driven by a behaviour.
|
|
||||||
*
|
|
||||||
* Clutter provides some pre-defined behaviours, like #ClutterBehaviourPath,
|
|
||||||
* which controls the position of a set of actors making them "walk" along
|
|
||||||
* a set of nodes; #ClutterBehaviourOpacity, which controls the opacity
|
|
||||||
* of a set of actors; #ClutterBehaviourScale, which controls the width
|
|
||||||
* and height of a set of actors.
|
|
||||||
*
|
|
||||||
* To visualize the effects of different alpha functions on a
|
|
||||||
* #ClutterBehaviour implementation it is possible to take the
|
|
||||||
* #ClutterBehaviourPath as an example:
|
|
||||||
*
|
|
||||||
* 
|
|
||||||
*
|
|
||||||
* The actors position between the path's end points directly correlates
|
|
||||||
* to the #ClutterAlpha's current alpha value driving the behaviour. With
|
|
||||||
* the #ClutterAlpha's function set to a linear ramp the actor
|
|
||||||
* will follow the path at a constant velocity, but when changing to
|
|
||||||
* a sine wave the actor initially accelerates before quickly
|
|
||||||
* decelerating.
|
|
||||||
*
|
|
||||||
* In order to implement a new behaviour you should subclass #ClutterBehaviour
|
|
||||||
* and override the "alpha_notify" virtual function; inside the overridden
|
|
||||||
* function you should obtain the alpha value from the #ClutterAlpha
|
|
||||||
* instance bound to the behaviour and apply it to the desiderd property
|
|
||||||
* (or properties) of every actor controlled by the behaviour.
|
|
||||||
*
|
|
||||||
* #ClutterBehaviour is available since Clutter 0.2.
|
|
||||||
*
|
|
||||||
* #ClutterBehaviour and its sub-classes have been discouraged sing Clutter
|
|
||||||
* 1.0, and formally deprecated since Clutter 1.6. You should use the
|
|
||||||
* [implicit animation][clutter-actor-animation] support inside #ClutterActor
|
|
||||||
* if you still have code using #ClutterBehaviour.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "clutter-build-config.h"
|
|
||||||
|
|
||||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
|
||||||
#include "clutter-behaviour.h"
|
|
||||||
#include "clutter-alpha.h"
|
|
||||||
|
|
||||||
#include "clutter-debug.h"
|
|
||||||
#include "clutter-main.h"
|
|
||||||
#include "clutter-marshal.h"
|
|
||||||
#include "clutter-private.h"
|
|
||||||
#include "clutter-scriptable.h"
|
|
||||||
#include "clutter-script-private.h"
|
|
||||||
|
|
||||||
struct _ClutterBehaviourPrivate
|
|
||||||
{
|
|
||||||
ClutterAlpha *alpha;
|
|
||||||
|
|
||||||
guint notify_id;
|
|
||||||
GSList *actors;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
PROP_0,
|
|
||||||
PROP_ALPHA,
|
|
||||||
|
|
||||||
PROP_LAST
|
|
||||||
};
|
|
||||||
|
|
||||||
static GParamSpec *obj_props[PROP_LAST];
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
APPLIED,
|
|
||||||
REMOVED,
|
|
||||||
LAST_SIGNAL
|
|
||||||
};
|
|
||||||
|
|
||||||
static guint behave_signals[LAST_SIGNAL] = { 0 };
|
|
||||||
|
|
||||||
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
|
|
||||||
|
|
||||||
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (ClutterBehaviour,
|
|
||||||
clutter_behaviour,
|
|
||||||
G_TYPE_OBJECT,
|
|
||||||
G_ADD_PRIVATE (ClutterBehaviour)
|
|
||||||
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_SCRIPTABLE,
|
|
||||||
clutter_scriptable_iface_init))
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
clutter_behaviour_parse_custom_node (ClutterScriptable *scriptable,
|
|
||||||
ClutterScript *script,
|
|
||||||
GValue *value,
|
|
||||||
const gchar *name,
|
|
||||||
JsonNode *node)
|
|
||||||
{
|
|
||||||
if (strncmp (name, "alpha", 5) == 0)
|
|
||||||
{
|
|
||||||
GObject *alpha;
|
|
||||||
|
|
||||||
alpha = _clutter_script_parse_alpha (script, node);
|
|
||||||
if (alpha != NULL)
|
|
||||||
{
|
|
||||||
g_value_init (value, CLUTTER_TYPE_ALPHA);
|
|
||||||
g_value_set_object (value, alpha);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_scriptable_iface_init (ClutterScriptableIface *iface)
|
|
||||||
{
|
|
||||||
iface->parse_custom_node = clutter_behaviour_parse_custom_node;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_dispose (GObject *gobject)
|
|
||||||
{
|
|
||||||
ClutterBehaviour *self = CLUTTER_BEHAVIOUR (gobject);
|
|
||||||
|
|
||||||
clutter_behaviour_set_alpha (self, NULL);
|
|
||||||
clutter_behaviour_remove_all (self);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (clutter_behaviour_parent_class)->dispose (gobject);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_set_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
const GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
ClutterBehaviour *behaviour = CLUTTER_BEHAVIOUR (object);
|
|
||||||
|
|
||||||
switch (prop_id)
|
|
||||||
{
|
|
||||||
case PROP_ALPHA:
|
|
||||||
clutter_behaviour_set_alpha (behaviour, g_value_get_object (value));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_get_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
ClutterBehaviour *behaviour = CLUTTER_BEHAVIOUR (object);
|
|
||||||
ClutterBehaviourPrivate *priv = behaviour->priv;
|
|
||||||
|
|
||||||
switch (prop_id)
|
|
||||||
{
|
|
||||||
case PROP_ALPHA:
|
|
||||||
g_value_set_object (value, priv->alpha);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_alpha_notify_unimplemented (ClutterBehaviour *behaviour,
|
|
||||||
gdouble alpha_value)
|
|
||||||
{
|
|
||||||
g_warning ("ClutterBehaviourClass::alpha_notify not implemented for '%s'",
|
|
||||||
g_type_name (G_TYPE_FROM_INSTANCE (behaviour)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_class_init (ClutterBehaviourClass *klass)
|
|
||||||
{
|
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
||||||
|
|
||||||
object_class->dispose = clutter_behaviour_dispose;
|
|
||||||
object_class->set_property = clutter_behaviour_set_property;
|
|
||||||
object_class->get_property = clutter_behaviour_get_property;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterBehaviour:alpha:
|
|
||||||
*
|
|
||||||
* The #ClutterAlpha object used to drive this behaviour. A #ClutterAlpha
|
|
||||||
* object binds a #ClutterTimeline and a function which computes a value
|
|
||||||
* (the "alpha") depending on the time. Each time the alpha value changes
|
|
||||||
* the alpha-notify virtual function is called.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
obj_props[PROP_ALPHA] =
|
|
||||||
g_param_spec_object ("alpha",
|
|
||||||
P_("Alpha"),
|
|
||||||
P_("Alpha Object to drive the behaviour"),
|
|
||||||
CLUTTER_TYPE_ALPHA,
|
|
||||||
CLUTTER_PARAM_READWRITE);
|
|
||||||
|
|
||||||
g_object_class_install_properties (object_class,
|
|
||||||
PROP_LAST,
|
|
||||||
obj_props);
|
|
||||||
|
|
||||||
klass->alpha_notify = clutter_behaviour_alpha_notify_unimplemented;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterBehaviour::applied:
|
|
||||||
* @behaviour: the #ClutterBehaviour that received the signal
|
|
||||||
* @actor: the actor the behaviour was applied to.
|
|
||||||
*
|
|
||||||
* The ::apply signal is emitted each time the behaviour is applied
|
|
||||||
* to an actor.
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
behave_signals[APPLIED] =
|
|
||||||
g_signal_new ("applied",
|
|
||||||
G_OBJECT_CLASS_TYPE (object_class),
|
|
||||||
G_SIGNAL_RUN_FIRST,
|
|
||||||
G_STRUCT_OFFSET (ClutterBehaviourClass, applied),
|
|
||||||
NULL, NULL, NULL,
|
|
||||||
G_TYPE_NONE, 1,
|
|
||||||
CLUTTER_TYPE_ACTOR);
|
|
||||||
/**
|
|
||||||
* ClutterBehaviour::removed:
|
|
||||||
* @behaviour: the #ClutterBehaviour that received the signal
|
|
||||||
* @actor: the removed actor
|
|
||||||
*
|
|
||||||
* The ::removed signal is emitted each time a behaviour is not applied
|
|
||||||
* to an actor anymore.
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
behave_signals[REMOVED] =
|
|
||||||
g_signal_new ("removed",
|
|
||||||
G_OBJECT_CLASS_TYPE (object_class),
|
|
||||||
G_SIGNAL_RUN_FIRST,
|
|
||||||
G_STRUCT_OFFSET (ClutterBehaviourClass, removed),
|
|
||||||
NULL, NULL, NULL,
|
|
||||||
G_TYPE_NONE, 1,
|
|
||||||
CLUTTER_TYPE_ACTOR);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_behaviour_init (ClutterBehaviour *self)
|
|
||||||
{
|
|
||||||
self->priv = clutter_behaviour_get_instance_private (self);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
remove_actor_on_destroy (ClutterActor *actor,
|
|
||||||
ClutterBehaviour *behaviour)
|
|
||||||
{
|
|
||||||
clutter_behaviour_remove (behaviour, actor);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_apply:
|
|
||||||
* @behave: a #ClutterBehaviour
|
|
||||||
* @actor: a #ClutterActor
|
|
||||||
*
|
|
||||||
* Applies @behave to @actor. This function adds a reference on
|
|
||||||
* the actor.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_behaviour_apply (ClutterBehaviour *behave,
|
|
||||||
ClutterActor *actor)
|
|
||||||
{
|
|
||||||
ClutterBehaviourPrivate *priv;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR (behave));
|
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
|
|
||||||
|
|
||||||
priv = behave->priv;
|
|
||||||
|
|
||||||
if (g_slist_find (priv->actors, actor))
|
|
||||||
{
|
|
||||||
g_warning ("The behaviour of type %s already applies "
|
|
||||||
"to the actor of type %s",
|
|
||||||
g_type_name (G_OBJECT_TYPE (behave)),
|
|
||||||
g_type_name (G_OBJECT_TYPE (actor)));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
priv->actors = g_slist_append (priv->actors, g_object_ref (actor));
|
|
||||||
g_signal_connect (actor, "destroy",
|
|
||||||
G_CALLBACK (remove_actor_on_destroy),
|
|
||||||
behave);
|
|
||||||
|
|
||||||
g_signal_emit (behave, behave_signals[APPLIED], 0, actor);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_is_applied:
|
|
||||||
* @behave: a #ClutterBehaviour
|
|
||||||
* @actor: a #ClutterActor
|
|
||||||
*
|
|
||||||
* Check if @behave applied to @actor.
|
|
||||||
*
|
|
||||||
* Return value: TRUE if actor has behaviour. FALSE otherwise.
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
clutter_behaviour_is_applied (ClutterBehaviour *behave,
|
|
||||||
ClutterActor *actor)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR (behave), FALSE);
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), FALSE);
|
|
||||||
|
|
||||||
return (g_slist_find (behave->priv->actors, actor) != NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_remove:
|
|
||||||
* @behave: a #ClutterBehaviour
|
|
||||||
* @actor: a #ClutterActor
|
|
||||||
*
|
|
||||||
* Removes @actor from the list of #ClutterActor<!-- -->s to which
|
|
||||||
* @behave applies. This function removes a reference on the actor.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_behaviour_remove (ClutterBehaviour *behave,
|
|
||||||
ClutterActor *actor)
|
|
||||||
{
|
|
||||||
ClutterBehaviourPrivate *priv;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR (behave));
|
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
|
|
||||||
|
|
||||||
priv = behave->priv;
|
|
||||||
|
|
||||||
if (!g_slist_find (priv->actors, actor))
|
|
||||||
{
|
|
||||||
g_warning ("The behaviour of type %s is not applied "
|
|
||||||
"to the actor of type %s",
|
|
||||||
g_type_name (G_OBJECT_TYPE (behave)),
|
|
||||||
g_type_name (G_OBJECT_TYPE (actor)));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_signal_handlers_disconnect_by_func (actor,
|
|
||||||
G_CALLBACK (remove_actor_on_destroy),
|
|
||||||
behave);
|
|
||||||
|
|
||||||
priv->actors = g_slist_remove (priv->actors, actor);
|
|
||||||
|
|
||||||
g_signal_emit (behave, behave_signals[REMOVED], 0, actor);
|
|
||||||
|
|
||||||
g_object_unref (actor);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_get_n_actors:
|
|
||||||
* @behave: a #ClutterBehaviour
|
|
||||||
*
|
|
||||||
* Gets the number of actors this behaviour is applied too.
|
|
||||||
*
|
|
||||||
* Return value: The number of applied actors
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
gint
|
|
||||||
clutter_behaviour_get_n_actors (ClutterBehaviour *behave)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR (behave), 0);
|
|
||||||
|
|
||||||
return g_slist_length (behave->priv->actors);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_get_nth_actor:
|
|
||||||
* @behave: a #ClutterBehaviour
|
|
||||||
* @index_: the index of an actor this behaviour is applied too.
|
|
||||||
*
|
|
||||||
* Gets an actor the behaviour was applied to referenced by index num.
|
|
||||||
*
|
|
||||||
* Return value: (transfer none): A Clutter actor or NULL if @index_ is invalid.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
ClutterActor *
|
|
||||||
clutter_behaviour_get_nth_actor (ClutterBehaviour *behave,
|
|
||||||
gint index_)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR (behave), NULL);
|
|
||||||
|
|
||||||
return g_slist_nth_data (behave->priv->actors, index_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_actors_foreach:
|
|
||||||
* @behave: a #ClutterBehaviour
|
|
||||||
* @func: (scope call): a function called for each actor
|
|
||||||
* @data: optional data to be passed to the function, or %NULL
|
|
||||||
*
|
|
||||||
* Calls @func for every actor driven by @behave.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_behaviour_actors_foreach (ClutterBehaviour *behave,
|
|
||||||
ClutterBehaviourForeachFunc func,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
GSList *l;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR (behave));
|
|
||||||
g_return_if_fail (func != NULL);
|
|
||||||
|
|
||||||
for (l = behave->priv->actors; l != NULL; l = l->next)
|
|
||||||
{
|
|
||||||
ClutterActor *actor = l->data;
|
|
||||||
|
|
||||||
g_assert (CLUTTER_IS_ACTOR (actor));
|
|
||||||
|
|
||||||
func (behave, actor, data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_get_alpha:
|
|
||||||
* @behave: a #ClutterBehaviour
|
|
||||||
*
|
|
||||||
* Retrieves the #ClutterAlpha object bound to @behave.
|
|
||||||
*
|
|
||||||
* Return value: (transfer none): a #ClutterAlpha object, or %NULL if no alpha
|
|
||||||
* object has been bound to this behaviour.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
ClutterAlpha *
|
|
||||||
clutter_behaviour_get_alpha (ClutterBehaviour *behave)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR (behave), NULL);
|
|
||||||
|
|
||||||
return behave->priv->alpha;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
notify_cb (GObject *object,
|
|
||||||
GParamSpec *param_spec,
|
|
||||||
ClutterBehaviour *behave)
|
|
||||||
{
|
|
||||||
ClutterBehaviourClass *klass;
|
|
||||||
|
|
||||||
klass = CLUTTER_BEHAVIOUR_GET_CLASS (behave);
|
|
||||||
|
|
||||||
CLUTTER_NOTE (ANIMATION, "notify::alpha");
|
|
||||||
|
|
||||||
/* no actors, we can stop right here */
|
|
||||||
if (behave->priv->actors == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (klass->alpha_notify != NULL)
|
|
||||||
{
|
|
||||||
gdouble alpha_value = clutter_alpha_get_alpha (behave->priv->alpha);
|
|
||||||
|
|
||||||
CLUTTER_NOTE (ANIMATION, "calling %s::alpha_notify (%p, %.4f)",
|
|
||||||
g_type_name (G_TYPE_FROM_CLASS (klass)),
|
|
||||||
behave, alpha_value);
|
|
||||||
|
|
||||||
klass->alpha_notify (behave, alpha_value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_set_alpha:
|
|
||||||
* @behave: a #ClutterBehaviour
|
|
||||||
* @alpha: a #ClutterAlpha or %NULL to unset a previously set alpha
|
|
||||||
*
|
|
||||||
* Binds @alpha to a #ClutterBehaviour. The #ClutterAlpha object
|
|
||||||
* is what makes a behaviour work: for each tick of the timeline
|
|
||||||
* used by #ClutterAlpha a new value of the alpha parameter is
|
|
||||||
* computed by the alpha function; the value should be used by
|
|
||||||
* the #ClutterBehaviour to update one or more properties of the
|
|
||||||
* actors to which the behaviour applies.
|
|
||||||
*
|
|
||||||
* If @alpha is not %NULL, the #ClutterBehaviour will take ownership
|
|
||||||
* of the #ClutterAlpha instance.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_behaviour_set_alpha (ClutterBehaviour *behave,
|
|
||||||
ClutterAlpha *alpha)
|
|
||||||
{
|
|
||||||
ClutterBehaviourPrivate *priv;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR (behave));
|
|
||||||
g_return_if_fail (alpha == NULL || CLUTTER_IS_ALPHA (alpha));
|
|
||||||
|
|
||||||
priv = behave->priv;
|
|
||||||
|
|
||||||
if (priv->alpha == alpha)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (priv->notify_id)
|
|
||||||
{
|
|
||||||
CLUTTER_NOTE (ANIMATION, "removing previous notify-id (%d)",
|
|
||||||
priv->notify_id);
|
|
||||||
|
|
||||||
g_signal_handler_disconnect (priv->alpha, priv->notify_id);
|
|
||||||
priv->notify_id = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->alpha != NULL)
|
|
||||||
{
|
|
||||||
CLUTTER_NOTE (ANIMATION, "removing previous alpha object");
|
|
||||||
|
|
||||||
g_object_unref (priv->alpha);
|
|
||||||
priv->alpha = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (alpha != NULL)
|
|
||||||
{
|
|
||||||
priv->alpha = g_object_ref_sink (alpha);
|
|
||||||
|
|
||||||
priv->notify_id = g_signal_connect (priv->alpha, "notify::alpha",
|
|
||||||
G_CALLBACK(notify_cb),
|
|
||||||
behave);
|
|
||||||
|
|
||||||
CLUTTER_NOTE (ANIMATION, "setting new alpha object (%p, notify:%d)",
|
|
||||||
priv->alpha, priv->notify_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (behave), obj_props[PROP_ALPHA]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_get_actors:
|
|
||||||
* @behave: a #ClutterBehaviour
|
|
||||||
*
|
|
||||||
* Retrieves all the actors to which @behave applies. It is not recommended
|
|
||||||
* for derived classes to use this in there alpha notify method but use
|
|
||||||
* #clutter_behaviour_actors_foreach as it avoids alot of needless allocations.
|
|
||||||
*
|
|
||||||
* Return value: (transfer container) (element-type Clutter.Actor): a list of
|
|
||||||
* actors. You should free the returned list with g_slist_free() when
|
|
||||||
* finished using it.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
GSList *
|
|
||||||
clutter_behaviour_get_actors (ClutterBehaviour *behave)
|
|
||||||
{
|
|
||||||
ClutterBehaviourPrivate *priv;
|
|
||||||
GSList *retval, *l;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_BEHAVIOUR (behave), NULL);
|
|
||||||
|
|
||||||
priv = behave->priv;
|
|
||||||
retval = NULL;
|
|
||||||
for (l = priv->actors; l != NULL; l = l->next)
|
|
||||||
retval = g_slist_prepend (retval, l->data);
|
|
||||||
|
|
||||||
return g_slist_reverse (retval);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_behaviour_remove_all:
|
|
||||||
* @behave: a #ClutterBehaviour
|
|
||||||
*
|
|
||||||
* Removes every actor from the list that @behave holds.
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_behaviour_remove_all (ClutterBehaviour *behave)
|
|
||||||
{
|
|
||||||
ClutterBehaviourPrivate *priv;
|
|
||||||
GSList *l;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR (behave));
|
|
||||||
|
|
||||||
priv = behave->priv;
|
|
||||||
for (l = priv->actors; l != NULL; l = l->next)
|
|
||||||
{
|
|
||||||
ClutterActor *actor = l->data;
|
|
||||||
|
|
||||||
g_signal_emit (behave, behave_signals[REMOVED], 0, actor);
|
|
||||||
g_signal_handlers_disconnect_by_func (actor,
|
|
||||||
G_CALLBACK (remove_actor_on_destroy),
|
|
||||||
behave);
|
|
||||||
g_object_unref (actor);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_slist_free (priv->actors);
|
|
||||||
priv->actors = NULL;
|
|
||||||
}
|
|
@@ -1,170 +0,0 @@
|
|||||||
/*
|
|
||||||
* Clutter.
|
|
||||||
*
|
|
||||||
* An OpenGL based 'interactive canvas' library.
|
|
||||||
*
|
|
||||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
|
||||||
* Jorn Baayen <jorn@openedhand.com>
|
|
||||||
* Emmanuele Bassi <ebassi@openedhand.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 OpenedHand
|
|
||||||
*
|
|
||||||
* 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_BEHAVIOUR_H__
|
|
||||||
#define __CLUTTER_BEHAVIOUR_H__
|
|
||||||
|
|
||||||
#include <clutter/clutter-types.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define CLUTTER_TYPE_BEHAVIOUR clutter_behaviour_get_type()
|
|
||||||
|
|
||||||
#define CLUTTER_BEHAVIOUR(obj) \
|
|
||||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
|
||||||
CLUTTER_TYPE_BEHAVIOUR, ClutterBehaviour))
|
|
||||||
|
|
||||||
#define CLUTTER_BEHAVIOUR_CLASS(klass) \
|
|
||||||
(G_TYPE_CHECK_CLASS_CAST ((klass), \
|
|
||||||
CLUTTER_TYPE_BEHAVIOUR, ClutterBehaviourClass))
|
|
||||||
|
|
||||||
#define CLUTTER_IS_BEHAVIOUR(obj) \
|
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
|
|
||||||
CLUTTER_TYPE_BEHAVIOUR))
|
|
||||||
|
|
||||||
#define CLUTTER_IS_BEHAVIOUR_CLASS(klass) \
|
|
||||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
|
|
||||||
CLUTTER_TYPE_BEHAVIOUR))
|
|
||||||
|
|
||||||
#define CLUTTER_BEHAVIOUR_GET_CLASS(obj) \
|
|
||||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
|
|
||||||
CLUTTER_TYPE_BEHAVIOUR, ClutterBehaviourClass))
|
|
||||||
|
|
||||||
typedef struct _ClutterBehaviourPrivate ClutterBehaviourPrivate;
|
|
||||||
typedef struct _ClutterBehaviourClass ClutterBehaviourClass;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourForeachFunc:
|
|
||||||
* @behaviour: the #ClutterBehaviour
|
|
||||||
* @actor: an actor driven by @behaviour
|
|
||||||
* @data: (closure): optional data passed to the function
|
|
||||||
*
|
|
||||||
* This function is passed to clutter_behaviour_actors_foreach() and
|
|
||||||
* will be called for each actor driven by @behaviour.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
typedef void (*ClutterBehaviourForeachFunc) (ClutterBehaviour *behaviour,
|
|
||||||
ClutterActor *actor,
|
|
||||||
gpointer data);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterBehaviour:
|
|
||||||
*
|
|
||||||
* #ClutterBehaviour-struct contains only private data and should
|
|
||||||
* be accessed with the functions below.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
struct _ClutterBehaviour
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
GObject parent;
|
|
||||||
ClutterBehaviourPrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterBehaviourClass:
|
|
||||||
* @alpha_notify: virtual function, called each time the #ClutterAlpha
|
|
||||||
* computes a new alpha value; the actors to which the behaviour applies
|
|
||||||
* should be changed in this function. Every subclass of #ClutterBehaviour
|
|
||||||
* must implement this virtual function
|
|
||||||
* @applied: signal class handler for the ClutterBehaviour::applied signal
|
|
||||||
* @removed: signal class handler for the ClutterBehaviour::removed signal
|
|
||||||
*
|
|
||||||
* Base class for behaviours.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
struct _ClutterBehaviourClass
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
GObjectClass parent_class;
|
|
||||||
|
|
||||||
/*< public >*/
|
|
||||||
/* vfunc, not signal */
|
|
||||||
void (*alpha_notify) (ClutterBehaviour *behave,
|
|
||||||
gdouble alpha_value);
|
|
||||||
|
|
||||||
/* signals */
|
|
||||||
void (*applied) (ClutterBehaviour *behave,
|
|
||||||
ClutterActor *actor);
|
|
||||||
void (*removed) (ClutterBehaviour *behave,
|
|
||||||
ClutterActor *actor);
|
|
||||||
|
|
||||||
/*< private >*/
|
|
||||||
/* padding, for future expansion */
|
|
||||||
void (*_clutter_behaviour1) (void);
|
|
||||||
void (*_clutter_behaviour2) (void);
|
|
||||||
void (*_clutter_behaviour3) (void);
|
|
||||||
void (*_clutter_behaviour4) (void);
|
|
||||||
void (*_clutter_behaviour5) (void);
|
|
||||||
void (*_clutter_behaviour6) (void);
|
|
||||||
};
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GType clutter_behaviour_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_behaviour_apply (ClutterBehaviour *behave,
|
|
||||||
ClutterActor *actor);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_behaviour_remove (ClutterBehaviour *behave,
|
|
||||||
ClutterActor *actor);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_behaviour_remove_all (ClutterBehaviour *behave);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_behaviour_actors_foreach (ClutterBehaviour *behave,
|
|
||||||
ClutterBehaviourForeachFunc func,
|
|
||||||
gpointer data);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gint clutter_behaviour_get_n_actors (ClutterBehaviour *behave);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
ClutterActor *clutter_behaviour_get_nth_actor (ClutterBehaviour *behave,
|
|
||||||
gint index_);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GSList * clutter_behaviour_get_actors (ClutterBehaviour *behave);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
ClutterAlpha *clutter_behaviour_get_alpha (ClutterBehaviour *behave);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_behaviour_set_alpha (ClutterBehaviour *behave,
|
|
||||||
ClutterAlpha *alpha);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gboolean clutter_behaviour_is_applied (ClutterBehaviour *behave,
|
|
||||||
ClutterActor *actor);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __CLUTTER_BEHAVIOUR_H__ */
|
|
@@ -294,7 +294,7 @@ clutter_cairo_texture_context_destroy (void *data)
|
|||||||
cogl_texture = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (cairo));
|
cogl_texture = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (cairo));
|
||||||
if (cairo_width == 0 ||
|
if (cairo_width == 0 ||
|
||||||
cairo_height == 0 ||
|
cairo_height == 0 ||
|
||||||
cogl_texture == COGL_INVALID_HANDLE)
|
cogl_texture == NULL)
|
||||||
{
|
{
|
||||||
draw_context_destroy (ctxt);
|
draw_context_destroy (ctxt);
|
||||||
return;
|
return;
|
||||||
@@ -507,7 +507,7 @@ clutter_cairo_texture_create_surface (ClutterCairoTexture *self,
|
|||||||
cairo_stride,
|
cairo_stride,
|
||||||
cairo_data);
|
cairo_data);
|
||||||
clutter_texture_set_cogl_texture (CLUTTER_TEXTURE (self), cogl_texture);
|
clutter_texture_set_cogl_texture (CLUTTER_TEXTURE (self), cogl_texture);
|
||||||
cogl_handle_unref (cogl_texture);
|
cogl_object_unref (cogl_texture);
|
||||||
|
|
||||||
return surface;
|
return surface;
|
||||||
}
|
}
|
||||||
|
@@ -65,16 +65,6 @@ void clutter_container_remove_valist (ClutterContaine
|
|||||||
CLUTTER_DEPRECATED_FOR(clutter_actor_get_children)
|
CLUTTER_DEPRECATED_FOR(clutter_actor_get_children)
|
||||||
GList * clutter_container_get_children (ClutterContainer *container);
|
GList * clutter_container_get_children (ClutterContainer *container);
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_container_foreach (ClutterContainer *container,
|
|
||||||
ClutterCallback callback,
|
|
||||||
gpointer user_data);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_container_foreach_with_internals (ClutterContainer *container,
|
|
||||||
ClutterCallback callback,
|
|
||||||
gpointer user_data);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(clutter_actor_set_child_above_sibling)
|
CLUTTER_DEPRECATED_FOR(clutter_actor_set_child_above_sibling)
|
||||||
void clutter_container_raise_child (ClutterContainer *container,
|
void clutter_container_raise_child (ClutterContainer *container,
|
||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
|
@@ -170,20 +170,6 @@ clutter_group_real_actor_removed (ClutterContainer *container,
|
|||||||
priv->children = g_list_remove (priv->children, actor);
|
priv->children = g_list_remove (priv->children, actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_group_real_foreach (ClutterContainer *container,
|
|
||||||
ClutterCallback callback,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
ClutterGroupPrivate *priv = CLUTTER_GROUP (container)->priv;
|
|
||||||
|
|
||||||
/* Using g_list_foreach instead of iterating the list manually
|
|
||||||
because it has better protection against the current node being
|
|
||||||
removed. This will happen for example if someone calls
|
|
||||||
clutter_container_foreach(container, clutter_actor_destroy) */
|
|
||||||
g_list_foreach (priv->children, (GFunc) callback, user_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_group_real_raise (ClutterContainer *container,
|
clutter_group_real_raise (ClutterContainer *container,
|
||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
@@ -285,7 +271,6 @@ clutter_container_iface_init (ClutterContainerIface *iface)
|
|||||||
iface->actor_added = clutter_group_real_actor_added;
|
iface->actor_added = clutter_group_real_actor_added;
|
||||||
iface->remove = clutter_group_real_remove;
|
iface->remove = clutter_group_real_remove;
|
||||||
iface->actor_removed = clutter_group_real_actor_removed;
|
iface->actor_removed = clutter_group_real_actor_removed;
|
||||||
iface->foreach = clutter_group_real_foreach;
|
|
||||||
iface->raise = clutter_group_real_raise;
|
iface->raise = clutter_group_real_raise;
|
||||||
iface->lower = clutter_group_real_lower;
|
iface->lower = clutter_group_real_lower;
|
||||||
iface->sort_depth_order = clutter_group_real_sort_depth_order;
|
iface->sort_depth_order = clutter_group_real_sort_depth_order;
|
||||||
@@ -306,15 +291,14 @@ clutter_group_real_paint (ClutterActor *actor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_group_real_pick (ClutterActor *actor,
|
clutter_group_real_pick (ClutterActor *actor)
|
||||||
const ClutterColor *pick)
|
|
||||||
{
|
{
|
||||||
ClutterGroupPrivate *priv = CLUTTER_GROUP (actor)->priv;
|
ClutterGroupPrivate *priv = CLUTTER_GROUP (actor)->priv;
|
||||||
|
|
||||||
/* Chain up so we get a bounding box pained (if we are reactive) */
|
/* Chain up so we get a bounding box pained (if we are reactive) */
|
||||||
CLUTTER_ACTOR_CLASS (clutter_group_parent_class)->pick (actor, pick);
|
CLUTTER_ACTOR_CLASS (clutter_group_parent_class)->pick (actor);
|
||||||
|
|
||||||
g_list_foreach (priv->children, (GFunc) clutter_actor_paint, NULL);
|
g_list_foreach (priv->children, (GFunc) clutter_actor_pick, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -391,21 +375,28 @@ clutter_group_dispose (GObject *object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_group_real_show_all (ClutterActor *actor)
|
clutter_group_real_show_all (ClutterActor *self)
|
||||||
{
|
{
|
||||||
clutter_container_foreach (CLUTTER_CONTAINER (actor),
|
ClutterActorIter iter;
|
||||||
CLUTTER_CALLBACK (clutter_actor_show),
|
ClutterActor *actor;
|
||||||
NULL);
|
|
||||||
clutter_actor_show (actor);
|
clutter_actor_iter_init (&iter, self);
|
||||||
|
while (clutter_actor_iter_next (&iter, &actor))
|
||||||
|
clutter_actor_show (actor);
|
||||||
|
|
||||||
|
clutter_actor_show (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_group_real_hide_all (ClutterActor *actor)
|
clutter_group_real_hide_all (ClutterActor *actor)
|
||||||
{
|
{
|
||||||
|
ClutterActorIter iter;
|
||||||
|
|
||||||
clutter_actor_hide (actor);
|
clutter_actor_hide (actor);
|
||||||
clutter_container_foreach (CLUTTER_CONTAINER (actor),
|
|
||||||
CLUTTER_CALLBACK (clutter_actor_hide),
|
clutter_actor_iter_init (&iter, actor);
|
||||||
NULL);
|
while (clutter_actor_iter_next (&iter, &actor))
|
||||||
|
clutter_actor_hide (actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@@ -1,87 +0,0 @@
|
|||||||
#include "clutter-build-config.h"
|
|
||||||
|
|
||||||
#include "clutter-layout-manager.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_layout_manager_begin_animation:
|
|
||||||
* @manager: a #ClutterLayoutManager
|
|
||||||
* @duration: the duration of the animation, in milliseconds
|
|
||||||
* @mode: the easing mode of the animation
|
|
||||||
*
|
|
||||||
* Begins an animation of @duration milliseconds, using the provided
|
|
||||||
* easing @mode
|
|
||||||
*
|
|
||||||
* The easing mode can be specified either as a #ClutterAnimationMode
|
|
||||||
* or as a logical id returned by clutter_alpha_register_func()
|
|
||||||
*
|
|
||||||
* The result of this function depends on the @manager implementation
|
|
||||||
*
|
|
||||||
* Return value: (transfer none): The #ClutterAlpha created by the
|
|
||||||
* layout manager; the returned instance is owned by the layout
|
|
||||||
* manager and should not be unreferenced
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
ClutterAlpha *
|
|
||||||
clutter_layout_manager_begin_animation (ClutterLayoutManager *manager,
|
|
||||||
guint duration,
|
|
||||||
gulong mode)
|
|
||||||
{
|
|
||||||
ClutterLayoutManagerClass *klass;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager), NULL);
|
|
||||||
|
|
||||||
klass = CLUTTER_LAYOUT_MANAGER_GET_CLASS (manager);
|
|
||||||
|
|
||||||
return klass->begin_animation (manager, duration, mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_layout_manager_end_animation:
|
|
||||||
* @manager: a #ClutterLayoutManager
|
|
||||||
*
|
|
||||||
* Ends an animation started by clutter_layout_manager_begin_animation()
|
|
||||||
*
|
|
||||||
* The result of this call depends on the @manager implementation
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_layout_manager_end_animation (ClutterLayoutManager *manager)
|
|
||||||
{
|
|
||||||
g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager));
|
|
||||||
|
|
||||||
CLUTTER_LAYOUT_MANAGER_GET_CLASS (manager)->end_animation (manager);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_layout_manager_get_animation_progress:
|
|
||||||
* @manager: a #ClutterLayoutManager
|
|
||||||
*
|
|
||||||
* Retrieves the progress of the animation, if one has been started by
|
|
||||||
* clutter_layout_manager_begin_animation()
|
|
||||||
*
|
|
||||||
* The returned value has the same semantics of the #ClutterAlpha:alpha
|
|
||||||
* value
|
|
||||||
*
|
|
||||||
* Return value: the progress of the animation
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
gdouble
|
|
||||||
clutter_layout_manager_get_animation_progress (ClutterLayoutManager *manager)
|
|
||||||
{
|
|
||||||
ClutterLayoutManagerClass *klass;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager), 1.0);
|
|
||||||
|
|
||||||
klass = CLUTTER_LAYOUT_MANAGER_GET_CLASS (manager);
|
|
||||||
|
|
||||||
return klass->get_animation_progress (manager);
|
|
||||||
}
|
|
@@ -84,7 +84,7 @@ clutter_rectangle_paint (ClutterActor *self)
|
|||||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||||
static CoglPipeline *default_color_pipeline = NULL;
|
static CoglPipeline *default_color_pipeline = NULL;
|
||||||
CoglPipeline *content_pipeline;
|
CoglPipeline *content_pipeline;
|
||||||
ClutterGeometry geom;
|
ClutterActorBox alloc;
|
||||||
CoglColor color;
|
CoglColor color;
|
||||||
guint8 tmp_alpha;
|
guint8 tmp_alpha;
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ clutter_rectangle_paint (ClutterActor *self)
|
|||||||
"painting rect '%s'",
|
"painting rect '%s'",
|
||||||
clutter_actor_get_name (self) ? clutter_actor_get_name (self)
|
clutter_actor_get_name (self) ? clutter_actor_get_name (self)
|
||||||
: "unknown");
|
: "unknown");
|
||||||
clutter_actor_get_allocation_geometry (self, &geom);
|
clutter_actor_get_allocation_box (self, &alloc);
|
||||||
|
|
||||||
if (G_UNLIKELY (default_color_pipeline == NULL))
|
if (G_UNLIKELY (default_color_pipeline == NULL))
|
||||||
{
|
{
|
||||||
@@ -140,40 +140,41 @@ clutter_rectangle_paint (ClutterActor *self)
|
|||||||
/* We paint the border and the content only if the rectangle
|
/* We paint the border and the content only if the rectangle
|
||||||
* is big enough to show them
|
* is big enough to show them
|
||||||
*/
|
*/
|
||||||
if ((priv->border_width * 2) < geom.width &&
|
if ((priv->border_width * 2) < clutter_actor_box_get_width (&alloc) &&
|
||||||
(priv->border_width * 2) < geom.height)
|
(priv->border_width * 2) < clutter_actor_box_get_height (&alloc))
|
||||||
{
|
{
|
||||||
/* paint the border. this sucks, but it's the only way to make a border */
|
/* paint the border. this sucks, but it's the only way to make a border */
|
||||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||||
border_pipeline,
|
border_pipeline,
|
||||||
priv->border_width, 0,
|
priv->border_width, 0,
|
||||||
geom.width,
|
clutter_actor_box_get_width (&alloc),
|
||||||
priv->border_width);
|
priv->border_width);
|
||||||
|
|
||||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||||
border_pipeline,
|
border_pipeline,
|
||||||
geom.width - priv->border_width,
|
clutter_actor_box_get_width (&alloc) - priv->border_width,
|
||||||
priv->border_width,
|
priv->border_width,
|
||||||
geom.width, geom.height);
|
clutter_actor_box_get_width (&alloc),
|
||||||
|
clutter_actor_box_get_height (&alloc));
|
||||||
|
|
||||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||||
border_pipeline,
|
border_pipeline,
|
||||||
0, geom.height - priv->border_width,
|
0, clutter_actor_box_get_height (&alloc) - priv->border_width,
|
||||||
geom.width - priv->border_width,
|
clutter_actor_box_get_width (&alloc) - priv->border_width,
|
||||||
geom.height);
|
clutter_actor_box_get_height (&alloc));
|
||||||
|
|
||||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||||
border_pipeline,
|
border_pipeline,
|
||||||
0, 0,
|
0, 0,
|
||||||
priv->border_width,
|
priv->border_width,
|
||||||
geom.height - priv->border_width);
|
clutter_actor_box_get_height (&alloc) - priv->border_width);
|
||||||
|
|
||||||
/* now paint the rectangle */
|
/* now paint the rectangle */
|
||||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||||
content_pipeline,
|
content_pipeline,
|
||||||
priv->border_width, priv->border_width,
|
priv->border_width, priv->border_width,
|
||||||
geom.width - priv->border_width,
|
clutter_actor_box_get_width (&alloc) - priv->border_width,
|
||||||
geom.height - priv->border_width);
|
clutter_actor_box_get_height (&alloc) - priv->border_width);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -183,7 +184,9 @@ clutter_rectangle_paint (ClutterActor *self)
|
|||||||
*/
|
*/
|
||||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||||
border_pipeline,
|
border_pipeline,
|
||||||
0, 0, geom.width, geom.height);
|
0, 0,
|
||||||
|
clutter_actor_box_get_width (&alloc),
|
||||||
|
clutter_actor_box_get_height (&alloc));
|
||||||
}
|
}
|
||||||
|
|
||||||
cogl_object_unref (border_pipeline);
|
cogl_object_unref (border_pipeline);
|
||||||
@@ -192,7 +195,9 @@ clutter_rectangle_paint (ClutterActor *self)
|
|||||||
{
|
{
|
||||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||||
content_pipeline,
|
content_pipeline,
|
||||||
0, 0, geom.width, geom.height);
|
0, 0,
|
||||||
|
clutter_actor_box_get_width (&alloc),
|
||||||
|
clutter_actor_box_get_height (&alloc));
|
||||||
}
|
}
|
||||||
|
|
||||||
cogl_object_unref (content_pipeline);
|
cogl_object_unref (content_pipeline);
|
||||||
|
@@ -74,20 +74,6 @@ gboolean clutter_stage_is_default (ClutterStage *stage);
|
|||||||
CLUTTER_DEPRECATED_FOR(clutter_actor_queue_redraw)
|
CLUTTER_DEPRECATED_FOR(clutter_actor_queue_redraw)
|
||||||
void clutter_stage_queue_redraw (ClutterStage *stage);
|
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)
|
CLUTTER_DEPRECATED_FOR(clutter_actor_set_background_color)
|
||||||
void clutter_stage_set_color (ClutterStage *stage,
|
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)
|
* falling back to a stage sized fbo with an offset of (0,0)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ClutterVertex verts[4];
|
graphene_point3d_t verts[4];
|
||||||
float x_min = G_MAXFLOAT, y_min = G_MAXFLOAT;
|
float x_min = G_MAXFLOAT, y_min = G_MAXFLOAT;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -1229,7 +1229,7 @@ clutter_texture_get_cogl_material (ClutterTexture *texture)
|
|||||||
* Replaces the underlying Cogl material drawn by this actor with
|
* Replaces the underlying Cogl material drawn by this actor with
|
||||||
* @cogl_material. A reference to the material is taken so if the
|
* @cogl_material. A reference to the material is taken so if the
|
||||||
* handle is no longer needed it should be deref'd with
|
* handle is no longer needed it should be deref'd with
|
||||||
* cogl_handle_unref. Texture data is attached to the material so
|
* cogl_object_unref. Texture data is attached to the material so
|
||||||
* calling this function also replaces the Cogl
|
* calling this function also replaces the Cogl
|
||||||
* texture. #ClutterTexture requires that the material have a texture
|
* texture. #ClutterTexture requires that the material have a texture
|
||||||
* layer so you should set one on the material before calling this
|
* layer so you should set one on the material before calling this
|
||||||
@@ -1302,7 +1302,7 @@ get_first_layer_index (CoglPipeline *pipeline, int *layer_index)
|
|||||||
*
|
*
|
||||||
* Retrieves the handle to the underlying COGL texture used for drawing
|
* Retrieves the handle to the underlying COGL texture used for drawing
|
||||||
* the actor. No extra reference is taken so if you need to keep the
|
* the actor. No extra reference is taken so if you need to keep the
|
||||||
* handle then you should call cogl_handle_ref() on it.
|
* handle then you should call cogl_object_ref() on it.
|
||||||
*
|
*
|
||||||
* The texture handle returned is the first layer of the material
|
* The texture handle returned is the first layer of the material
|
||||||
* handle used by the #ClutterTexture. If you need to access the other
|
* handle used by the #ClutterTexture. If you need to access the other
|
||||||
@@ -1342,7 +1342,7 @@ clutter_texture_get_cogl_texture (ClutterTexture *texture)
|
|||||||
*
|
*
|
||||||
* Replaces the underlying COGL texture drawn by this actor with
|
* Replaces the underlying COGL texture drawn by this actor with
|
||||||
* @cogl_tex. A reference to the texture is taken so if the handle is
|
* @cogl_tex. A reference to the texture is taken so if the handle is
|
||||||
* no longer needed it should be deref'd with cogl_handle_unref.
|
* no longer needed it should be deref'd with cogl_object_unref.
|
||||||
*
|
*
|
||||||
* Since: 0.8
|
* Since: 0.8
|
||||||
*
|
*
|
||||||
@@ -1595,67 +1595,6 @@ clutter_texture_set_from_rgb_data (ClutterTexture *texture,
|
|||||||
error);
|
error);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_texture_set_from_yuv_data:
|
|
||||||
* @texture: A #ClutterTexture
|
|
||||||
* @data: (array): Image data in YUV type colorspace.
|
|
||||||
* @width: Width in pixels of image data.
|
|
||||||
* @height: Height in pixels of image data
|
|
||||||
* @flags: #ClutterTextureFlags
|
|
||||||
* @error: Return location for a #GError, or %NULL.
|
|
||||||
*
|
|
||||||
* Sets a #ClutterTexture from YUV image data. If an error occurred,
|
|
||||||
* %FALSE is returned and @error is set.
|
|
||||||
*
|
|
||||||
* The YUV support depends on the driver; the format supported by the
|
|
||||||
* few drivers exposing this capability are not really useful.
|
|
||||||
*
|
|
||||||
* The proper way to convert image data in any YUV colorspace to any
|
|
||||||
* RGB colorspace is to use a fragment shader associated with the
|
|
||||||
* #ClutterTexture material.
|
|
||||||
*
|
|
||||||
* Return value: %TRUE if the texture was successfully updated
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.10: Use a custom #ClutterContent implementation and
|
|
||||||
* set up the Cogl pipeline using a #ClutterPipelineNode with a
|
|
||||||
* fragment shader instead.
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
clutter_texture_set_from_yuv_data (ClutterTexture *texture,
|
|
||||||
const guchar *data,
|
|
||||||
gint width,
|
|
||||||
gint height,
|
|
||||||
ClutterTextureFlags flags,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), FALSE);
|
|
||||||
|
|
||||||
if (!clutter_feature_available (CLUTTER_FEATURE_TEXTURE_YUV))
|
|
||||||
{
|
|
||||||
g_set_error (error, CLUTTER_TEXTURE_ERROR,
|
|
||||||
CLUTTER_TEXTURE_ERROR_NO_YUV,
|
|
||||||
"YUV textures are not supported");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Convert the flags to a CoglPixelFormat */
|
|
||||||
if ((flags & CLUTTER_TEXTURE_YUV_FLAG_YUV2))
|
|
||||||
{
|
|
||||||
g_set_error (error, CLUTTER_TEXTURE_ERROR,
|
|
||||||
CLUTTER_TEXTURE_ERROR_BAD_FORMAT,
|
|
||||||
"YUV2 textures are not supported");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return clutter_texture_set_from_data (texture, data,
|
|
||||||
COGL_PIXEL_FORMAT_YUV,
|
|
||||||
width, height,
|
|
||||||
width * 3, 3,
|
|
||||||
error);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* clutter_texture_async_load_complete:
|
* clutter_texture_async_load_complete:
|
||||||
* @self: a #ClutterTexture
|
* @self: a #ClutterTexture
|
||||||
|
@@ -123,14 +123,6 @@ gboolean clutter_texture_get_pick_with_alpha (ClutterTexture
|
|||||||
CLUTTER_DEPRECATED_FOR(ClutterOffscreenEffect)
|
CLUTTER_DEPRECATED_FOR(ClutterOffscreenEffect)
|
||||||
ClutterActor * clutter_texture_new_from_actor (ClutterActor *actor);
|
ClutterActor * clutter_texture_new_from_actor (ClutterActor *actor);
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gboolean clutter_texture_set_from_yuv_data (ClutterTexture *texture,
|
|
||||||
const guchar *data,
|
|
||||||
gint width,
|
|
||||||
gint height,
|
|
||||||
ClutterTextureFlags flags,
|
|
||||||
GError **error);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_TEXTURE_DEPRECATED_H__ */
|
#endif /* __CLUTTER_TEXTURE_DEPRECATED_H__ */
|
||||||
|
@@ -127,6 +127,7 @@ clutter_sources = [
|
|||||||
'clutter-flatten-effect.c',
|
'clutter-flatten-effect.c',
|
||||||
'clutter-flow-layout.c',
|
'clutter-flow-layout.c',
|
||||||
'clutter-gesture-action.c',
|
'clutter-gesture-action.c',
|
||||||
|
'clutter-graphene.c',
|
||||||
'clutter-grid-layout.c',
|
'clutter-grid-layout.c',
|
||||||
'clutter-image.c',
|
'clutter-image.c',
|
||||||
'clutter-input-device.c',
|
'clutter-input-device.c',
|
||||||
@@ -191,6 +192,7 @@ clutter_private_headers = [
|
|||||||
'clutter-effect-private.h',
|
'clutter-effect-private.h',
|
||||||
'clutter-event-private.h',
|
'clutter-event-private.h',
|
||||||
'clutter-flatten-effect.h',
|
'clutter-flatten-effect.h',
|
||||||
|
'clutter-graphene.h',
|
||||||
'clutter-gesture-action-private.h',
|
'clutter-gesture-action-private.h',
|
||||||
'clutter-id-pool.h',
|
'clutter-id-pool.h',
|
||||||
'clutter-input-focus-private.h',
|
'clutter-input-focus-private.h',
|
||||||
@@ -220,10 +222,6 @@ clutter_deprecated_headers = [
|
|||||||
'deprecated/clutter-alpha.h',
|
'deprecated/clutter-alpha.h',
|
||||||
'deprecated/clutter-animatable.h',
|
'deprecated/clutter-animatable.h',
|
||||||
'deprecated/clutter-animation.h',
|
'deprecated/clutter-animation.h',
|
||||||
'deprecated/clutter-behaviour.h',
|
|
||||||
'deprecated/clutter-behaviour-depth.h',
|
|
||||||
'deprecated/clutter-behaviour-opacity.h',
|
|
||||||
'deprecated/clutter-behaviour-scale.h',
|
|
||||||
'deprecated/clutter-bin-layout.h',
|
'deprecated/clutter-bin-layout.h',
|
||||||
'deprecated/clutter-box.h',
|
'deprecated/clutter-box.h',
|
||||||
'deprecated/clutter-cairo-texture.h',
|
'deprecated/clutter-cairo-texture.h',
|
||||||
@@ -240,17 +238,11 @@ clutter_deprecated_headers = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
clutter_deprecated_sources = [
|
clutter_deprecated_sources = [
|
||||||
'deprecated/clutter-actor-deprecated.c',
|
|
||||||
'deprecated/clutter-alpha.c',
|
'deprecated/clutter-alpha.c',
|
||||||
'deprecated/clutter-animation.c',
|
'deprecated/clutter-animation.c',
|
||||||
'deprecated/clutter-behaviour.c',
|
|
||||||
'deprecated/clutter-behaviour-depth.c',
|
|
||||||
'deprecated/clutter-behaviour-opacity.c',
|
|
||||||
'deprecated/clutter-behaviour-scale.c',
|
|
||||||
'deprecated/clutter-box.c',
|
'deprecated/clutter-box.c',
|
||||||
'deprecated/clutter-cairo-texture.c',
|
'deprecated/clutter-cairo-texture.c',
|
||||||
'deprecated/clutter-group.c',
|
'deprecated/clutter-group.c',
|
||||||
'deprecated/clutter-layout-manager-deprecated.c',
|
|
||||||
'deprecated/clutter-rectangle.c',
|
'deprecated/clutter-rectangle.c',
|
||||||
'deprecated/clutter-state.c',
|
'deprecated/clutter-state.c',
|
||||||
'deprecated/clutter-table-layout.c',
|
'deprecated/clutter-table-layout.c',
|
||||||
@@ -454,6 +446,7 @@ libmutter_clutter = shared_library(libmutter_clutter_name,
|
|||||||
libmutter_clutter_dep = declare_dependency(
|
libmutter_clutter_dep = declare_dependency(
|
||||||
sources: [clutter_enum_types[1]],
|
sources: [clutter_enum_types[1]],
|
||||||
link_with: libmutter_clutter,
|
link_with: libmutter_clutter,
|
||||||
|
dependencies: clutter_deps,
|
||||||
)
|
)
|
||||||
|
|
||||||
if have_introspection
|
if have_introspection
|
||||||
|
@@ -276,6 +276,7 @@ emit_vertex_buffer_geometry (CoglFramebuffer *fb,
|
|||||||
gboolean allocated = FALSE;
|
gboolean allocated = FALSE;
|
||||||
CoglAttribute *attributes[2];
|
CoglAttribute *attributes[2];
|
||||||
CoglPrimitive *prim;
|
CoglPrimitive *prim;
|
||||||
|
CoglIndices *indices;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
n_verts = node->d.texture.rectangles->len * 4;
|
n_verts = node->d.texture.rectangles->len * 4;
|
||||||
@@ -354,22 +355,11 @@ emit_vertex_buffer_geometry (CoglFramebuffer *fb,
|
|||||||
attributes,
|
attributes,
|
||||||
2 /* n_attributes */);
|
2 /* n_attributes */);
|
||||||
|
|
||||||
#ifdef CLUTTER_COGL_HAS_GL
|
indices =
|
||||||
if (_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_QUADS))
|
cogl_get_rectangle_indices (ctx, node->d.texture.rectangles->len);
|
||||||
cogl_primitive_set_mode (prim, GL_QUADS);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
/* GLES doesn't support GL_QUADS so instead we use a VBO
|
|
||||||
with indexed vertices to generate GL_TRIANGLES from the
|
|
||||||
quads */
|
|
||||||
|
|
||||||
CoglIndices *indices =
|
cogl_primitive_set_indices (prim, indices,
|
||||||
cogl_get_rectangle_indices (ctx, node->d.texture.rectangles->len);
|
node->d.texture.rectangles->len * 6);
|
||||||
|
|
||||||
cogl_primitive_set_indices (prim, indices,
|
|
||||||
node->d.texture.rectangles->len * 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
node->d.texture.primitive = prim;
|
node->d.texture.primitive = prim;
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user