Compare commits
324 Commits
wip/3-moni
...
wip/fmuell
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9622733140 | ||
![]() |
16a2eab290 | ||
![]() |
41a69f194d | ||
![]() |
b77e6f0c98 | ||
![]() |
b67394dcd1 | ||
![]() |
f9e33a89fd | ||
![]() |
39e9e53871 | ||
![]() |
7f3fda6df6 | ||
![]() |
73ce5b3a8d | ||
![]() |
53319a121f | ||
![]() |
cf2d06e9b9 | ||
![]() |
d39211f438 | ||
![]() |
909464f749 | ||
![]() |
5669b64021 | ||
![]() |
8f0b4767de | ||
![]() |
9e75ce2ad7 | ||
![]() |
c010a3b195 | ||
![]() |
7c807c6e2a | ||
![]() |
9a20271f90 | ||
![]() |
1760a6e560 | ||
![]() |
8c2b805d88 | ||
![]() |
2f01418d45 | ||
![]() |
a76107a19f | ||
![]() |
6372e3e4db | ||
![]() |
c80ba819e7 | ||
![]() |
14c6a347c1 | ||
![]() |
11bd847896 | ||
![]() |
870f38542d | ||
![]() |
c22edeff1f | ||
![]() |
183de60d91 | ||
![]() |
176b508029 | ||
![]() |
9be189daa7 | ||
![]() |
bf12a2497b | ||
![]() |
55d168d01a | ||
![]() |
8a9a78ec8a | ||
![]() |
803ffc19a4 | ||
![]() |
ddd2ce3a88 | ||
![]() |
979e689278 | ||
![]() |
2c1ab8b3cc | ||
![]() |
252e64a0ea | ||
![]() |
d2f1edd6c6 | ||
![]() |
944a4763f6 | ||
![]() |
22a296f971 | ||
![]() |
ef2153739c | ||
![]() |
9e1c8e2c22 | ||
![]() |
fca0e6abb1 | ||
![]() |
6975c8b424 | ||
![]() |
f4f823f238 | ||
![]() |
1c67260bd4 | ||
![]() |
79f90c147c | ||
![]() |
4e751a3b58 | ||
![]() |
1c2e8fcf06 | ||
![]() |
00ca387ec7 | ||
![]() |
5688f1cf6e | ||
![]() |
7bd668e6d0 | ||
![]() |
1dc602e289 | ||
![]() |
ec518c4f24 | ||
![]() |
0d9295523e | ||
![]() |
a4443885a3 | ||
![]() |
ef8f2876e3 | ||
![]() |
75071aba68 | ||
![]() |
a81435ab5f | ||
![]() |
6fe46cac60 | ||
![]() |
c3b9ef7bf5 | ||
![]() |
b70c0eb9a5 | ||
![]() |
f3dd97e67b | ||
![]() |
77fb0a0003 | ||
![]() |
58d2a674c4 | ||
![]() |
9e2ed4104d | ||
![]() |
3f9b4a1ab5 | ||
![]() |
2aa0ec004a | ||
![]() |
f798912cbd | ||
![]() |
3bf80a967c | ||
![]() |
6c3b0cfc36 | ||
![]() |
43633d6b2f | ||
![]() |
fdd531f307 | ||
![]() |
70c45f8941 | ||
![]() |
b82fa2c610 | ||
![]() |
eaacbb3289 | ||
![]() |
54fdd633fe | ||
![]() |
29ed84e921 | ||
![]() |
d587fc1ef4 | ||
![]() |
285d717ceb | ||
![]() |
616a149917 | ||
![]() |
f578c4daaa | ||
![]() |
830495b7c6 | ||
![]() |
4d02f68057 | ||
![]() |
31c5a0009f | ||
![]() |
c91d9df481 | ||
![]() |
e64cbfcc3f | ||
![]() |
3c2d85b544 | ||
![]() |
96c4dd817e | ||
![]() |
ba7af4f7d3 | ||
![]() |
edfe5cc3b7 | ||
![]() |
07e65a6ef2 | ||
![]() |
d574cf59f1 | ||
![]() |
47402d848d | ||
![]() |
922f14276a | ||
![]() |
8c5ad7ea2d | ||
![]() |
20c5e2525e | ||
![]() |
325fec31da | ||
![]() |
cbb2a286f2 | ||
![]() |
e9eaa37401 | ||
![]() |
dbe73c3296 | ||
![]() |
b4ae6cdd62 | ||
![]() |
317414ab26 | ||
![]() |
b63e104561 | ||
![]() |
02b184bfd7 | ||
![]() |
d8c7583922 | ||
![]() |
25f36b3892 | ||
![]() |
0f0b411f6e | ||
![]() |
5a71ed4411 | ||
![]() |
de76074336 | ||
![]() |
f63b69bb23 | ||
![]() |
a54f9e835c | ||
![]() |
7a941138de | ||
![]() |
2c5404532b | ||
![]() |
be259117f5 | ||
![]() |
6932b3cbb3 | ||
![]() |
b76bf20092 | ||
![]() |
a62dbc6680 | ||
![]() |
442dcc7855 | ||
![]() |
23e7a0a099 | ||
![]() |
7f2dbb6c44 | ||
![]() |
8a0d0ce987 | ||
![]() |
0789c3fb9f | ||
![]() |
31d99c51cb | ||
![]() |
30550ef688 | ||
![]() |
b04cca9eab | ||
![]() |
e0fd7a6d05 | ||
![]() |
923751aa39 | ||
![]() |
6de81b0513 | ||
![]() |
7ae698795e | ||
![]() |
72692b1144 | ||
![]() |
177b4df217 | ||
![]() |
a08d7cf48a | ||
![]() |
3fa6a92cc5 | ||
![]() |
d5a7bbd094 | ||
![]() |
de41f3ea28 | ||
![]() |
5c3ec27b4b | ||
![]() |
8655bc5d8d | ||
![]() |
2e53ce8e75 | ||
![]() |
2528a39781 | ||
![]() |
e02fef8e2f | ||
![]() |
e352011830 | ||
![]() |
7f551ba776 | ||
![]() |
3838341d83 | ||
![]() |
adc5670ea9 | ||
![]() |
08130912f0 | ||
![]() |
371b97af27 | ||
![]() |
562cf14258 | ||
![]() |
c57ae7fc9c | ||
![]() |
6c91683380 | ||
![]() |
25f416c13d | ||
![]() |
8d91135926 | ||
![]() |
1bbb5c8107 | ||
![]() |
12a42a9295 | ||
![]() |
01cea0d9ef | ||
![]() |
f615eea7ee | ||
![]() |
cbbd3e366a | ||
![]() |
ede10dded0 | ||
![]() |
982d135ace | ||
![]() |
548c0f16f4 | ||
![]() |
bbd295ae09 | ||
![]() |
c55004864d | ||
![]() |
54685091f1 | ||
![]() |
d4a9535f04 | ||
![]() |
44477390a9 | ||
![]() |
caf27c4c16 | ||
![]() |
576e7a43df | ||
![]() |
c242558398 | ||
![]() |
8c9e827aab | ||
![]() |
2bcc9e2b86 | ||
![]() |
5c66afbf63 | ||
![]() |
84aeb8f715 | ||
![]() |
3738579dd3 | ||
![]() |
1ca60f424a | ||
![]() |
ff507273d2 | ||
![]() |
f033d0e846 | ||
![]() |
ca67d52cac | ||
![]() |
60d22b7cd0 | ||
![]() |
e9778eba18 | ||
![]() |
56d260cfb3 | ||
![]() |
c45d5f53ff | ||
![]() |
4e402b3972 | ||
![]() |
79d99cbe3f | ||
![]() |
328eff7352 | ||
![]() |
ed5c1f433b | ||
![]() |
7ac2083134 | ||
![]() |
bd97b11414 | ||
![]() |
0da0207eed | ||
![]() |
08229a6f5d | ||
![]() |
50071303af | ||
![]() |
2b2d77dc3e | ||
![]() |
a0909c3440 | ||
![]() |
22f865122c | ||
![]() |
60ac2838b5 | ||
![]() |
dfde2f59da | ||
![]() |
3d2ca9a67f | ||
![]() |
9182c8b801 | ||
![]() |
1def099047 | ||
![]() |
ddb0ef1e8d | ||
![]() |
a56a59feee | ||
![]() |
174df4eaeb | ||
![]() |
e3e933c47a | ||
![]() |
fda2e798bb | ||
![]() |
fb38738fe9 | ||
![]() |
5eb749d690 | ||
![]() |
763ae36cee | ||
![]() |
582b67a2f1 | ||
![]() |
f740e8ed79 | ||
![]() |
d360b25b81 | ||
![]() |
3693f6f630 | ||
![]() |
ebfc6184b2 | ||
![]() |
8715f7481b | ||
![]() |
12f8325cbc | ||
![]() |
956ab4bd58 | ||
![]() |
58b5dee869 | ||
![]() |
b448ced8e4 | ||
![]() |
73ddd7cd48 | ||
![]() |
e7fb45364a | ||
![]() |
0478c225b7 | ||
![]() |
93c29318b2 | ||
![]() |
51e4fe7fef | ||
![]() |
d52081bed4 | ||
![]() |
686b7f8baa | ||
![]() |
b7a9c7e7d3 | ||
![]() |
676a8da005 | ||
![]() |
490f27efcb | ||
![]() |
173867c12b | ||
![]() |
df1384a856 | ||
![]() |
5fbeecaac6 | ||
![]() |
54febd1419 | ||
![]() |
7952808469 | ||
![]() |
0442fc8ddc | ||
![]() |
80e3c1de57 | ||
![]() |
ac2f8cad0c | ||
![]() |
7e8fc13504 | ||
![]() |
60f7ff3a69 | ||
![]() |
2fe05d7c35 | ||
![]() |
012691bebf | ||
![]() |
c84d7ebc6d | ||
![]() |
f9118fb99b | ||
![]() |
d3301d6b53 | ||
![]() |
1755a8b8de | ||
![]() |
36b46af92f | ||
![]() |
e1370ee209 | ||
![]() |
37e36e8208 | ||
![]() |
eac18647c3 | ||
![]() |
c681ccef3c | ||
![]() |
b329256113 | ||
![]() |
177d0c2d63 | ||
![]() |
f7d4a727a8 | ||
![]() |
d539fe28d5 | ||
![]() |
7759adf8e9 | ||
![]() |
7a75692e11 | ||
![]() |
9bd427a74c | ||
![]() |
ebb6c56f67 | ||
![]() |
dcb525397c | ||
![]() |
05ab8eebe8 | ||
![]() |
981b045459 | ||
![]() |
6502735f01 | ||
![]() |
1d73533f78 | ||
![]() |
697aeae2ad | ||
![]() |
2e79d05e04 | ||
![]() |
4139907a7e | ||
![]() |
3c6a518d40 | ||
![]() |
a7df459416 | ||
![]() |
9f3d321bf2 | ||
![]() |
49c2be40bb | ||
![]() |
781ec74fd2 | ||
![]() |
7a5e0c7824 | ||
![]() |
c786b6c13c | ||
![]() |
bbcb66ddf4 | ||
![]() |
ec25f3a6b7 | ||
![]() |
dbe7279c7f | ||
![]() |
931934511c | ||
![]() |
20c9ca25c0 | ||
![]() |
f64eba57ce | ||
![]() |
149e4d6934 | ||
![]() |
8d514095cb | ||
![]() |
bdf8d0f1c3 | ||
![]() |
8e9184b62e | ||
![]() |
b34bb773a4 | ||
![]() |
efd9f86efe | ||
![]() |
7a9805554c | ||
![]() |
ffca9b999d | ||
![]() |
d30301c00a | ||
![]() |
faf89ff35f | ||
![]() |
87858a4e01 | ||
![]() |
08a5e660d3 | ||
![]() |
df48b94889 | ||
![]() |
2b938ce795 | ||
![]() |
df284f9c9d | ||
![]() |
7d20101198 | ||
![]() |
ae4d3bc27d | ||
![]() |
fe0a394e69 | ||
![]() |
1f3e9176fc | ||
![]() |
ffaec917e5 | ||
![]() |
bf4ccd21c1 | ||
![]() |
9a843857b3 | ||
![]() |
9004253c4e | ||
![]() |
c5471e5b8b | ||
![]() |
eacf2f2187 | ||
![]() |
7821256f5c | ||
![]() |
4baefe46b3 | ||
![]() |
c388a8fc9d | ||
![]() |
e4a2d15171 | ||
![]() |
4786cc85bd | ||
![]() |
666bef7af9 | ||
![]() |
19e3c21667 | ||
![]() |
da5a2d3cb8 | ||
![]() |
7226c5c7bf | ||
![]() |
acacd3dd64 | ||
![]() |
20b271fa49 | ||
![]() |
e4de9ed580 | ||
![]() |
452ef4d5bb | ||
![]() |
1467b6b02a | ||
![]() |
9ca6c74267 | ||
![]() |
319500e4f3 | ||
![]() |
b2e75b5da0 | ||
![]() |
365ea2fd56 | ||
![]() |
88f8228425 | ||
![]() |
f8cd1e55a4 |
29
.gitignore
vendored
29
.gitignore
vendored
@@ -1,25 +1,9 @@
|
|||||||
Makefile
|
|
||||||
Makefile.in
|
|
||||||
Makefile.in.in
|
|
||||||
aclocal.m4
|
|
||||||
autom4te.cache
|
|
||||||
build-aux
|
build-aux
|
||||||
compile
|
compile
|
||||||
config.guess
|
|
||||||
config.h
|
config.h
|
||||||
config.h.in
|
config.h.in
|
||||||
config.log
|
|
||||||
config.status
|
|
||||||
config.sub
|
|
||||||
configure
|
|
||||||
depcomp
|
|
||||||
install-sh
|
|
||||||
intltool-extract.in
|
|
||||||
intltool-merge.in
|
|
||||||
libtool
|
|
||||||
ltmain.sh
|
ltmain.sh
|
||||||
missing
|
missing
|
||||||
.deps
|
|
||||||
50-mutter-navigation.xml
|
50-mutter-navigation.xml
|
||||||
50-mutter-system.xml
|
50-mutter-system.xml
|
||||||
50-mutter-windows.xml
|
50-mutter-windows.xml
|
||||||
@@ -33,15 +17,11 @@ mutter-wayland.desktop
|
|||||||
*.swp
|
*.swp
|
||||||
*.gir
|
*.gir
|
||||||
*.typelib
|
*.typelib
|
||||||
stamp-h1
|
|
||||||
*.gmo
|
*.gmo
|
||||||
*.make
|
*.make
|
||||||
*.log
|
*.log
|
||||||
*.trs
|
*.trs
|
||||||
*~
|
*~
|
||||||
stamp-it
|
|
||||||
.intltool-merge-cache
|
|
||||||
ABOUT-NLS
|
|
||||||
POTFILES
|
POTFILES
|
||||||
Makevars.template
|
Makevars.template
|
||||||
po/*.header
|
po/*.header
|
||||||
@@ -64,9 +44,7 @@ org.gnome.mutter.wayland.gschema.xml
|
|||||||
testasyncgetprop
|
testasyncgetprop
|
||||||
testboxes
|
testboxes
|
||||||
testgradient
|
testgradient
|
||||||
m4/*
|
|
||||||
INSTALL
|
INSTALL
|
||||||
mkinstalldirs
|
|
||||||
meta-enum-types.[ch]
|
meta-enum-types.[ch]
|
||||||
src/stamp-meta-enum-types.h
|
src/stamp-meta-enum-types.h
|
||||||
src/meta-dbus-display-config.[ch]
|
src/meta-dbus-display-config.[ch]
|
||||||
@@ -122,13 +100,6 @@ doc/reference/meta-undocumented.txt
|
|||||||
doc/reference/meta-unused.txt
|
doc/reference/meta-unused.txt
|
||||||
doc/reference/meta-docs.sgml
|
doc/reference/meta-docs.sgml
|
||||||
doc/reference/meta.types
|
doc/reference/meta.types
|
||||||
gtk-doc.m4
|
|
||||||
intltool.m4
|
|
||||||
libtool.m4
|
|
||||||
ltoptions.m4
|
|
||||||
ltsugar.m4
|
|
||||||
ltversion.m4
|
|
||||||
lt~obsolete.m4
|
|
||||||
.dirstamp
|
.dirstamp
|
||||||
**/tags.*
|
**/tags.*
|
||||||
build/
|
build/
|
||||||
|
@@ -1,20 +1,44 @@
|
|||||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v1
|
image: registry.gitlab.gnome.org/gnome/mutter/master:v1
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
- review
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
|
|
||||||
|
check-commit-log:
|
||||||
|
stage: review
|
||||||
|
script:
|
||||||
|
- ./.gitlab-ci/check-commit-log.sh
|
||||||
|
only:
|
||||||
|
- merge_requests
|
||||||
|
|
||||||
build-mutter:
|
build-mutter:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- meson . build -Degl_device=true -Dwayland_eglstream=true
|
- meson . build -Dbuildtype=debugoptimized -Degl_device=true -Dwayland_eglstream=true --werror
|
||||||
- ninja -C build
|
- ninja -C build
|
||||||
- ninja -C build install
|
- ninja -C build install
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 day
|
||||||
|
paths:
|
||||||
|
- build
|
||||||
|
only:
|
||||||
|
- merge_requests
|
||||||
|
- /^.*$/
|
||||||
|
|
||||||
test-mutter:
|
test-mutter:
|
||||||
stage: test
|
stage: test
|
||||||
|
dependencies:
|
||||||
|
- build-mutter
|
||||||
|
variables:
|
||||||
|
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
|
||||||
|
GSETTINGS_SCHEMA_DIR: "$CI_PROJECT_DIR/build/data"
|
||||||
script:
|
script:
|
||||||
- meson . build -Degl_device=true -Dwayland_eglstream=true
|
- mkdir -m 700 $XDG_RUNTIME_DIR
|
||||||
- ninja -C build
|
- glib-compile-schemas $GSETTINGS_SCHEMA_DIR
|
||||||
- glib-compile-schemas $PWD/build/data
|
- >
|
||||||
- env XDG_RUNTIME_DIR=/tmp/ GSETTINGS_SCHEMA_DIR=$PWD/build/data dbus-run-session -- xvfb-run -s '+iglx -noreset' meson test -C build -t 10 --verbose --no-stdsplit --wrap catchsegv
|
dbus-run-session -- xvfb-run -s '+iglx -noreset'
|
||||||
|
meson test -C build --no-rebuild -t 10 --verbose --no-stdsplit --wrap catchsegv
|
||||||
|
only:
|
||||||
|
- merge_requests
|
||||||
|
- /^.*$/
|
||||||
|
@@ -10,5 +10,8 @@ RUN dnf -y update && dnf -y upgrade && \
|
|||||||
# For running unit tests
|
# For running unit tests
|
||||||
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 && \
|
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 && \
|
||||||
|
|
||||||
|
# Unpackaged versions
|
||||||
|
dnf install -y https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00848426-gsettings-desktop-schemas/gsettings-desktop-schemas-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00848426-gsettings-desktop-schemas/gsettings-desktop-schemas-devel-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm && \
|
||||||
|
|
||||||
dnf install -y intltool redhat-rpm-config make && \
|
dnf install -y intltool redhat-rpm-config make && \
|
||||||
dnf clean all
|
dnf clean all
|
||||||
|
31
.gitlab-ci/check-commit-log.sh
Executable file
31
.gitlab-ci/check-commit-log.sh
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [ -z "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ]; then
|
||||||
|
echo Cannot review non-merge request
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
git fetch $CI_MERGE_REQUEST_PROJECT_URL.git $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
|
||||||
|
|
||||||
|
branch_point=$(git merge-base HEAD FETCH_HEAD)
|
||||||
|
|
||||||
|
commits=$(git log --format='format:%H' $branch_point..$CI_COMMIT_SHA)
|
||||||
|
|
||||||
|
if [ -z "$commits" ]; then
|
||||||
|
echo Commit range empty
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
function commit_message_has_url() {
|
||||||
|
commit=$1
|
||||||
|
commit_message=$(git show -s --format='format:%b' $commit)
|
||||||
|
echo "$commit_message" | grep -qe "\($CI_MERGE_REQUEST_PROJECT_URL/\(issues\|merge_requests\)/[0-9]\+\|https://bugzilla.gnome.org/show_bug.cgi?id=[0-9]\+\)"
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
for commit in $commits; do
|
||||||
|
if ! commit_message_has_url $commit; then
|
||||||
|
echo "Missing merge request or issue URL on commit $(echo $commit | cut -c -8)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
13
Makefile.am
13
Makefile.am
@@ -1,13 +0,0 @@
|
|||||||
pkgdatadir = $(datadir)/mutter-$(LIBMUTTER_API_VERSION)
|
|
||||||
pkglibdir = $(libdir)/mutter-$(LIBMUTTER_API_VERSION)
|
|
||||||
|
|
||||||
SUBDIRS = cogl clutter data src po doc
|
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
|
||||||
|
|
||||||
DISTCLEANFILES = \
|
|
||||||
intltool-extract \
|
|
||||||
intltool-merge \
|
|
||||||
intltool-update \
|
|
||||||
po/stamp-it \
|
|
||||||
po/.intltool-merge-cache
|
|
77
NEWS
77
NEWS
@@ -1,3 +1,80 @@
|
|||||||
|
3.31.91
|
||||||
|
=======
|
||||||
|
* Fix infinite loop in EDID matching [Marco; #459]
|
||||||
|
* wayland: Don't resetin text-input state prematurely [Carlos; !410]
|
||||||
|
* wayland: Don't maximize windows if minimum size is too big [Olivier; #463]
|
||||||
|
* Fix crash when using "restore shortcuts" without focus window [Olivier; #464]
|
||||||
|
* Add flag parameter to grab accelerator API [Andrea; !169]
|
||||||
|
* Reuse old CRTC if possible to avoid flicker on hotplug [Pekka, Emilio; #373]
|
||||||
|
* Misc. bug fixes and cleanups [Marco, Jonas, Niels, Adam, Olivier; !436,
|
||||||
|
!421, #462, !439, !440, !444, !321, !445, !456]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Jonas Ådahl, Andrea Azzarone, Olivier Fourdan, Carlos Garnacho,
|
||||||
|
Niels De Graef, Adam Jackson, Emilio Pozuelo Monfort, Pekka Paalanen,
|
||||||
|
Marco Trevisan (Treviño)
|
||||||
|
|
||||||
|
Translators:
|
||||||
|
Jiri Grönroos [fi], Charles Monzat [fr], Claude Paroz [fr], Fran Dieguez [gl],
|
||||||
|
Emin Tufan Çetin [tr], Aurimas Černius [lt], Anders Jonsson [sv],
|
||||||
|
Matej Urbančič [sl], Marek Cernocky [cs], Daniel Șerbănescu [ro],
|
||||||
|
Alan Mortensen [da], Baurzhan Muftakhidinov [kk], Yi-Jyun Pan [zh_TW],
|
||||||
|
Daniel Mustieles [es], Rafael Fontenelle [pt_BR]
|
||||||
|
|
||||||
|
3.31.90
|
||||||
|
=======
|
||||||
|
* Fix support of extended characters in on-screen keyboard [Andrea; #109]
|
||||||
|
* Improve selection of the primary GPU [Pekka, Emilio; !271]
|
||||||
|
* Screen-cast cursor updates as PipeWire stream metadata [Jonas; !357]
|
||||||
|
* Fix rendering glitches in magnifier [Daniel; gnome-shell#387]
|
||||||
|
* Fix monitor recording on HiDPI [Jonas; !415]
|
||||||
|
* Honour secondary GPU supported pixel formats [Pekka; !341]
|
||||||
|
* Fall back to CPU copy path when using a software renderer [Emilio; !325]
|
||||||
|
* Remove fallback app menu [Florian; gnome-shell#624]
|
||||||
|
* wayland: Add support for viewporter protocol [Robert; !323]
|
||||||
|
* Misc. bug fixes and cleanups [Florian, Carlos, Olivier, Marco, Robert,
|
||||||
|
Daniel, Pekka, Jonas, Ole, Georges; !391, #335, #442, !406, !395, #447,
|
||||||
|
!375, gnome-shell#349, #451, !416, #784199, !408, !181, !405]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Jonas Ådahl, Andrea Azzarone, Ole Jørgen Brønner, Piotr Drąg, Olivier Fourdan,
|
||||||
|
Dariusz Gadomski, Carlos Garnacho, Antoine Jacoutot, Iain Lane, Robert Mader,
|
||||||
|
Emilio Pozuelo Monfort, Florian Müllner, Georges Basile Stavracas Neto,
|
||||||
|
Pekka Paalanen, Marco Trevisan (Treviño), Josh Triplett, Daniel van Vugt
|
||||||
|
|
||||||
|
Translators:
|
||||||
|
Fabio Tomat [fur], Balázs Úr [hu], Daniel Mustieles [es], Kukuh Syafaat [id],
|
||||||
|
Jordi Mas [ca], Piotr Drąg [pl]
|
||||||
|
|
||||||
|
3.31.4
|
||||||
|
======
|
||||||
|
* keybindings: Limit corner move to current monitor [Jānis; #320]
|
||||||
|
* xdg-output: Report rotated physical dimensions [Olivier; #369]
|
||||||
|
* Add continuous integration pipeline [Jonas; #193]
|
||||||
|
* Improve performance on secondary GPUs [Pekka; #323, !313]
|
||||||
|
* Use the actual hardware refresh rate [Daniel; #781296]
|
||||||
|
* Remove hide-titlebar-when-maximized support [Florian; !221]
|
||||||
|
* wayland: Implement buffer transforms [Robert; !322]
|
||||||
|
* Remove ability to externally set sync-to-vblank [Georges; !191]
|
||||||
|
* Turn off touchscreens together with DPMS [Carlos; gnome-settings-daemon#29]
|
||||||
|
* Mipmap the wallpaper when shrinking [Daniel; gnome-shell#254]
|
||||||
|
* Implement RecordWindow method for screen-casts [Olivier; !306]
|
||||||
|
* Fix EGLStream texture downloading [Jonas; !362]
|
||||||
|
* Split out display-server-specific code from MetaWindowActor [Georges; !368]
|
||||||
|
* Improve render performance on some KMS devices with software GL [Jonas; #106]
|
||||||
|
* Fix damage area of transformed surfaces [Robert; !366]
|
||||||
|
* Remove autotools support [George]
|
||||||
|
* Misc. bug fixes and cleanups [Jonas, Alan, Olivier, Carlos, Javier, Peter,
|
||||||
|
Daniel, Robert, Florian; !309, #790207, #272, #393, #276, #404, #104, !343,
|
||||||
|
#765011, #786663, #342, !356, #414, #782344, #781034, #423, !374, !382, !383]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Jonas Ådahl, Nikita Churaev, Alan Coopersmith, Jānis Džeriņš, Olivier Fourdan,
|
||||||
|
Carlos Garnacho, Niels De Graef, Peter Hutterer, Javier Jardón,
|
||||||
|
Abderrahim Kitouni, Andre Klapper, Ting-Wei Lan, Robert Mader,
|
||||||
|
Emilio Pozuelo Monfort, Florian Müllner, Georges Basile Stavracas Neto,
|
||||||
|
Pekka Paalanen, Daniel Stone, Marco Trevisan (Treviño), Daniel van Vugt
|
||||||
|
|
||||||
3.31.2
|
3.31.2
|
||||||
======
|
======
|
||||||
* Fix handling of non-UTF8 encodings [Florian; !227]
|
* Fix handling of non-UTF8 encodings [Florian; !227]
|
||||||
|
14
README.md
14
README.md
@@ -22,6 +22,20 @@ by Gala, elementary OS's window manager. It can also be run standalone, using
|
|||||||
the command "mutter", but just running plain mutter is only intended for
|
the command "mutter", but just running plain mutter is only intended for
|
||||||
debugging purposes.
|
debugging purposes.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
To contribute, open merge requests at https://gitlab.gnome.org/GNOME/mutter.
|
||||||
|
|
||||||
|
The coding style used is primarily the GNU flavor of the [GNOME coding
|
||||||
|
style](https://developer.gnome.org/programming-guidelines/stable/c-coding-style.html.en)
|
||||||
|
with some minor additions such as preferring `stdint.h` types over GLib
|
||||||
|
fundamental types, and a soft 80 character line limit. However, in general,
|
||||||
|
look at the file you're editing for inspiration.
|
||||||
|
|
||||||
|
Commit messages should follow the [GNOME commit message
|
||||||
|
guidelines](https://wiki.gnome.org/Git/CommitMessages). We require an URL
|
||||||
|
to either an issue or a merge request in each commit.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Mutter is distributed under the terms of the GNU General Public License,
|
Mutter is distributed under the terms of the GNU General Public License,
|
||||||
|
28
autogen.sh
28
autogen.sh
@@ -1,28 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Run this to generate all the initial makefiles, etc.
|
|
||||||
|
|
||||||
srcdir=`dirname $0`
|
|
||||||
test -z "$srcdir" && srcdir=.
|
|
||||||
|
|
||||||
REQUIRED_AUTOMAKE_VERSION=1.11
|
|
||||||
|
|
||||||
olddir="$(pwd)"
|
|
||||||
|
|
||||||
cd "${srcdir}"
|
|
||||||
|
|
||||||
(test -f configure.ac \
|
|
||||||
&& test -d src) || {
|
|
||||||
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
|
|
||||||
echo " top-level mutter directory"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
aclocal --install || exit 1
|
|
||||||
intltoolize --force --copy --automake || exit 1
|
|
||||||
autoreconf --verbose --force --install || exit 1
|
|
||||||
|
|
||||||
cd "${olddir}"
|
|
||||||
|
|
||||||
if [ "$NOCONFIGURE" = "" ]; then
|
|
||||||
"${srcdir}/configure" "$@" || exit 1
|
|
||||||
fi
|
|
@@ -1,49 +0,0 @@
|
|||||||
NULL =
|
|
||||||
|
|
||||||
SUBDIRS = build clutter tests
|
|
||||||
|
|
||||||
DIST_SUBDIRS = clutter tests build
|
|
||||||
|
|
||||||
# XXX - this is a massive hack to make autoreconf honour the ACLOCAL_FLAGS
|
|
||||||
# that jhbuild sets while still retaining build/autotools as the authoritative
|
|
||||||
# source for m4 macros
|
|
||||||
ACLOCAL_AMFLAGS = -I build/autotools ${ACLOCAL_FLAGS}
|
|
||||||
|
|
||||||
CLEANFILES = $(pcfiles)
|
|
||||||
|
|
||||||
DISTCLEANFILES =
|
|
||||||
|
|
||||||
DISTCHECK_CONFIGURE_FLAGS = --enable-maintainer-flags
|
|
||||||
|
|
||||||
# proxy rules for tests
|
|
||||||
test-report full-report:
|
|
||||||
$(MAKE) -C tests/conform $(@)
|
|
||||||
|
|
||||||
perf-report:
|
|
||||||
$(MAKE) -C tests/performance $(@)
|
|
||||||
|
|
||||||
if ENABLE_GCOV
|
|
||||||
# use recursive makes in order to ignore errors during check/perf
|
|
||||||
lcov:
|
|
||||||
-$(MAKE) $(AM_MAKEFLAGS) -C clutter check
|
|
||||||
-$(MAKE) $(AM_MAKEFLAGS) -C tests/conform test
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) genlcov
|
|
||||||
|
|
||||||
# we have to massage the lcov.info file slightly to hide the effect of libtool
|
|
||||||
# placing the objects files in the .libs/ directory separate from the *.c
|
|
||||||
genlcov:
|
|
||||||
$(LTP) --directory $(top_builddir) --capture --output-file clutter-lcov.info --test-name CLUTTER_TEST --no-checksum
|
|
||||||
$(SED) -e 's#.libs/##' < clutter-lcov.info > clutter-lcov.info.tmp
|
|
||||||
LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory clutter-lcov --title "Clutter Code Coverage" --show-details clutter-lcov.info.tmp
|
|
||||||
rm -f clutter-lcov.info.tmp
|
|
||||||
|
|
||||||
lcov-clean:
|
|
||||||
-$(LTP) --directory $(top_builddir) -z
|
|
||||||
-$(RM) -rf clutter-lcov.info clutter-lcov
|
|
||||||
else
|
|
||||||
lcov genlcov lcov-clean:
|
|
||||||
@echo You need to configure Clutter with support for gcov enabled.
|
|
||||||
@echo e.g., ./configure --enable-gcov
|
|
||||||
endif
|
|
||||||
|
|
||||||
.PHONY: test-report full-report perf-report lcov genlcov lcov-clean
|
|
@@ -1 +0,0 @@
|
|||||||
SUBDIRS = autotools
|
|
8
clutter/build/autotools/.gitignore
vendored
8
clutter/build/autotools/.gitignore
vendored
@@ -1,8 +0,0 @@
|
|||||||
gtk-doc.m4
|
|
||||||
libtool.m4
|
|
||||||
ltoptions.m4
|
|
||||||
ltsugar.m4
|
|
||||||
ltversion.m4
|
|
||||||
lt~obsolete.m4
|
|
||||||
shave
|
|
||||||
shave-libtool
|
|
@@ -1,10 +0,0 @@
|
|||||||
NULL =
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
|
||||||
introspection.m4 \
|
|
||||||
as-compiler-flag.m4 \
|
|
||||||
glibtests.m4 \
|
|
||||||
glib-tap.mk \
|
|
||||||
tap-driver.sh \
|
|
||||||
tap-test \
|
|
||||||
$(NULL)
|
|
@@ -1,62 +0,0 @@
|
|||||||
dnl as-compiler-flag.m4 0.1.0
|
|
||||||
|
|
||||||
dnl autostars m4 macro for detection of compiler flags
|
|
||||||
|
|
||||||
dnl David Schleef <ds@schleef.org>
|
|
||||||
|
|
||||||
dnl $Id: as-compiler-flag.m4,v 1.1 2005/12/15 23:35:19 ds Exp $
|
|
||||||
|
|
||||||
dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
|
|
||||||
dnl Tries to compile with the given CFLAGS.
|
|
||||||
dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
|
|
||||||
dnl and ACTION-IF-NOT-ACCEPTED otherwise.
|
|
||||||
|
|
||||||
AC_DEFUN([AS_COMPILER_FLAG],
|
|
||||||
[
|
|
||||||
AC_MSG_CHECKING([to see if compiler understands $1])
|
|
||||||
|
|
||||||
save_CFLAGS="$CFLAGS"
|
|
||||||
CFLAGS="$CFLAGS $1"
|
|
||||||
|
|
||||||
AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
|
|
||||||
CFLAGS="$save_CFLAGS"
|
|
||||||
|
|
||||||
if test "X$flag_ok" = Xyes ; then
|
|
||||||
m4_ifvaln([$2],[$2])
|
|
||||||
true
|
|
||||||
else
|
|
||||||
m4_ifvaln([$3],[$3])
|
|
||||||
true
|
|
||||||
fi
|
|
||||||
AC_MSG_RESULT([$flag_ok])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl AS_COMPILER_FLAGS(VAR, FLAGS)
|
|
||||||
dnl Tries to compile with the given CFLAGS.
|
|
||||||
|
|
||||||
AC_DEFUN([AS_COMPILER_FLAGS],
|
|
||||||
[
|
|
||||||
list=$2
|
|
||||||
flags_supported=""
|
|
||||||
flags_unsupported=""
|
|
||||||
AC_MSG_CHECKING([for supported compiler flags])
|
|
||||||
for each in $list
|
|
||||||
do
|
|
||||||
save_CFLAGS="$CFLAGS"
|
|
||||||
CFLAGS="$CFLAGS $each"
|
|
||||||
AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
|
|
||||||
CFLAGS="$save_CFLAGS"
|
|
||||||
|
|
||||||
if test "X$flag_ok" = Xyes ; then
|
|
||||||
flags_supported="$flags_supported $each"
|
|
||||||
else
|
|
||||||
flags_unsupported="$flags_unsupported $each"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
AC_MSG_RESULT([$flags_supported])
|
|
||||||
if test "X$flags_unsupported" != X ; then
|
|
||||||
AC_MSG_WARN([unsupported compiler flags: $flags_unsupported])
|
|
||||||
fi
|
|
||||||
$1="$$1 $flags_supported"
|
|
||||||
])
|
|
||||||
|
|
@@ -1,134 +0,0 @@
|
|||||||
# GLIB - Library of useful C routines
|
|
||||||
|
|
||||||
TESTS_ENVIRONMENT= \
|
|
||||||
G_TEST_SRCDIR="$(abs_srcdir)" \
|
|
||||||
G_TEST_BUILDDIR="$(abs_builddir)" \
|
|
||||||
G_DEBUG=gc-friendly \
|
|
||||||
MALLOC_CHECK_=2 \
|
|
||||||
MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256))
|
|
||||||
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/build/autotools/tap-driver.sh
|
|
||||||
LOG_COMPILER = $(top_srcdir)/build/autotools/tap-test
|
|
||||||
|
|
||||||
NULL =
|
|
||||||
|
|
||||||
# initialize variables for unconditional += appending
|
|
||||||
BUILT_SOURCES =
|
|
||||||
BUILT_EXTRA_DIST =
|
|
||||||
CLEANFILES = *.log *.trs
|
|
||||||
DISTCLEANFILES =
|
|
||||||
MAINTAINERCLEANFILES =
|
|
||||||
EXTRA_DIST =
|
|
||||||
TESTS =
|
|
||||||
|
|
||||||
installed_test_LTLIBRARIES =
|
|
||||||
installed_test_PROGRAMS =
|
|
||||||
installed_test_SCRIPTS =
|
|
||||||
nobase_installed_test_DATA =
|
|
||||||
|
|
||||||
noinst_LTLIBRARIES =
|
|
||||||
noinst_PROGRAMS =
|
|
||||||
noinst_SCRIPTS =
|
|
||||||
noinst_DATA =
|
|
||||||
|
|
||||||
check_LTLIBRARIES =
|
|
||||||
check_PROGRAMS =
|
|
||||||
check_SCRIPTS =
|
|
||||||
check_DATA =
|
|
||||||
|
|
||||||
# We support a fairly large range of possible variables. It is expected that all types of files in a test suite
|
|
||||||
# will belong in exactly one of the following variables.
|
|
||||||
#
|
|
||||||
# First, we support the usual automake suffixes, but in lowercase, with the customary meaning:
|
|
||||||
#
|
|
||||||
# test_programs, test_scripts, test_data, test_ltlibraries
|
|
||||||
#
|
|
||||||
# The above are used to list files that are involved in both uninstalled and installed testing. The
|
|
||||||
# test_programs and test_scripts are taken to be actual testcases and will be run as part of the test suite.
|
|
||||||
# Note that _data is always used with the nobase_ automake variable name to ensure that installed test data is
|
|
||||||
# installed in the same way as it appears in the package layout.
|
|
||||||
#
|
|
||||||
# In order to mark a particular file as being only for one type of testing, use 'installed' or 'uninstalled',
|
|
||||||
# like so:
|
|
||||||
#
|
|
||||||
# installed_test_programs, uninstalled_test_programs
|
|
||||||
# installed_test_scripts, uninstalled_test_scripts
|
|
||||||
# installed_test_data, uninstalled_test_data
|
|
||||||
# installed_test_ltlibraries, uninstalled_test_ltlibraries
|
|
||||||
#
|
|
||||||
# Additionally, we support 'extra' infixes for programs and scripts. This is used for support programs/scripts
|
|
||||||
# that should not themselves be run as testcases (but exist to be used from other testcases):
|
|
||||||
#
|
|
||||||
# test_extra_programs, installed_test_extra_programs, uninstalled_test_extra_programs
|
|
||||||
# test_extra_scripts, installed_test_extra_scripts, uninstalled_test_extra_scripts
|
|
||||||
#
|
|
||||||
# Additionally, for _scripts and _data, we support the customary dist_ prefix so that the named script or data
|
|
||||||
# file automatically end up in the tarball.
|
|
||||||
#
|
|
||||||
# dist_test_scripts, dist_test_data, dist_test_extra_scripts
|
|
||||||
# dist_installed_test_scripts, dist_installed_test_data, dist_installed_test_extra_scripts
|
|
||||||
# dist_uninstalled_test_scripts, dist_uninstalled_test_data, dist_uninstalled_test_extra_scripts
|
|
||||||
#
|
|
||||||
# Note that no file is automatically disted unless it appears in one of the dist_ variables. This follows the
|
|
||||||
# standard automake convention of not disting programs scripts or data by default.
|
|
||||||
#
|
|
||||||
# test_programs, test_scripts, uninstalled_test_programs and uninstalled_test_scripts (as well as their disted
|
|
||||||
# variants) will be run as part of the in-tree 'make check'. These are all assumed to be runnable under
|
|
||||||
# gtester. That's a bit strange for scripts, but it's possible.
|
|
||||||
|
|
||||||
TESTS += $(test_programs) $(test_scripts) $(uninstalled_test_programs) $(uninstalled_test_scripts) \
|
|
||||||
$(dist_test_scripts) $(dist_uninstalled_test_scripts)
|
|
||||||
|
|
||||||
# Note: build even the installed-only targets during 'make check' to ensure that they still work.
|
|
||||||
# We need to do a bit of trickery here and manage disting via EXTRA_DIST instead of using dist_ prefixes to
|
|
||||||
# prevent automake from mistreating gmake functions like $(wildcard ...) and $(addprefix ...) as if they were
|
|
||||||
# filenames, including removing duplicate instances of the opening part before the space, eg. '$(addprefix'.
|
|
||||||
all_test_programs = $(test_programs) $(uninstalled_test_programs) $(installed_test_programs) \
|
|
||||||
$(test_extra_programs) $(uninstalled_test_extra_programs) $(installed_test_extra_programs)
|
|
||||||
all_test_scripts = $(test_scripts) $(uninstalled_test_scripts) $(installed_test_scripts) \
|
|
||||||
$(test_extra_scripts) $(uninstalled_test_extra_scripts) $(installed_test_extra_scripts)
|
|
||||||
all_dist_test_scripts = $(dist_test_scripts) $(dist_uninstalled_test_scripts) $(dist_installed_test_scripts) \
|
|
||||||
$(dist_test_extra_scripts) $(dist_uninstalled_test_extra_scripts) $(dist_installed_test_extra_scripts)
|
|
||||||
all_test_scripts += $(all_dist_test_scripts)
|
|
||||||
EXTRA_DIST += $(all_dist_test_scripts)
|
|
||||||
all_test_data = $(test_data) $(uninstalled_test_data) $(installed_test_data)
|
|
||||||
all_dist_test_data = $(dist_test_data) $(dist_uninstalled_test_data) $(dist_installed_test_data)
|
|
||||||
all_test_data += $(all_dist_test_data)
|
|
||||||
EXTRA_DIST += $(all_dist_test_data)
|
|
||||||
all_test_ltlibs = $(test_ltlibraries) $(uninstalled_test_ltlibraries) $(installed_test_ltlibraries)
|
|
||||||
|
|
||||||
if ENABLE_ALWAYS_BUILD_TESTS
|
|
||||||
noinst_LTLIBRARIES += $(all_test_ltlibs)
|
|
||||||
noinst_PROGRAMS += $(all_test_programs)
|
|
||||||
noinst_SCRIPTS += $(all_test_scripts)
|
|
||||||
noinst_DATA += $(all_test_data)
|
|
||||||
else
|
|
||||||
check_LTLIBRARIES += $(all_test_ltlibs)
|
|
||||||
check_PROGRAMS += $(all_test_programs)
|
|
||||||
check_SCRIPTS += $(all_test_scripts)
|
|
||||||
check_DATA += $(all_test_data)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if ENABLE_INSTALLED_TESTS
|
|
||||||
installed_test_PROGRAMS += $(test_programs) $(installed_test_programs) \
|
|
||||||
$(test_extra_programs) $(installed_test_extra_programs)
|
|
||||||
installed_test_SCRIPTS += $(test_scripts) $(installed_test_scripts) \
|
|
||||||
$(test_extra_scripts) $(test_installed_extra_scripts)
|
|
||||||
installed_test_SCRIPTS += $(dist_test_scripts) $(dist_test_extra_scripts) \
|
|
||||||
$(dist_installed_test_scripts) $(dist_installed_test_extra_scripts)
|
|
||||||
nobase_installed_test_DATA += $(test_data) $(installed_test_data)
|
|
||||||
nobase_installed_test_DATA += $(dist_test_data) $(dist_installed_test_data)
|
|
||||||
installed_test_LTLIBRARIES += $(test_ltlibraries) $(installed_test_ltlibraries)
|
|
||||||
installed_testcases = $(test_programs) $(installed_test_programs) \
|
|
||||||
$(test_scripts) $(installed_test_scripts) \
|
|
||||||
$(dist_test_scripts) $(dist_installed_test_scripts)
|
|
||||||
|
|
||||||
installed_test_meta_DATA = $(installed_testcases:=.test)
|
|
||||||
|
|
||||||
%.test: %$(EXEEXT) Makefile
|
|
||||||
$(AM_V_GEN) (echo '[Test]' > $@.tmp; \
|
|
||||||
echo 'Type=session' >> $@.tmp; \
|
|
||||||
echo 'Exec=env G_ENABLE_DIAGNOSTIC=0 CLUTTER_ENABLE_DIAGNOSTIC=0 $(installed_testdir)/$<' >> $@.tmp; \
|
|
||||||
mv $@.tmp $@)
|
|
||||||
|
|
||||||
CLEANFILES += $(installed_test_meta_DATA)
|
|
||||||
endif
|
|
@@ -1,28 +0,0 @@
|
|||||||
dnl GLIB_TESTS
|
|
||||||
dnl
|
|
||||||
|
|
||||||
AC_DEFUN([GLIB_TESTS],
|
|
||||||
[
|
|
||||||
AC_ARG_ENABLE(installed-tests,
|
|
||||||
AS_HELP_STRING([--enable-installed-tests],
|
|
||||||
[Enable installation of some test cases]),
|
|
||||||
[case ${enableval} in
|
|
||||||
yes) ENABLE_INSTALLED_TESTS="1" ;;
|
|
||||||
no) ENABLE_INSTALLED_TESTS="" ;;
|
|
||||||
*) AC_MSG_ERROR([bad value ${enableval} for --enable-installed-tests]) ;;
|
|
||||||
esac])
|
|
||||||
AM_CONDITIONAL([ENABLE_INSTALLED_TESTS], test "$ENABLE_INSTALLED_TESTS" = "1")
|
|
||||||
AC_ARG_ENABLE(always-build-tests,
|
|
||||||
AS_HELP_STRING([--enable-always-build-tests],
|
|
||||||
[Enable always building tests during 'make all']),
|
|
||||||
[case ${enableval} in
|
|
||||||
yes) ENABLE_ALWAYS_BUILD_TESTS="1" ;;
|
|
||||||
no) ENABLE_ALWAYS_BUILD_TESTS="" ;;
|
|
||||||
*) AC_MSG_ERROR([bad value ${enableval} for --enable-always-build-tests]) ;;
|
|
||||||
esac])
|
|
||||||
AM_CONDITIONAL([ENABLE_ALWAYS_BUILD_TESTS], test "$ENABLE_ALWAYS_BUILD_TESTS" = "1")
|
|
||||||
if test "$ENABLE_INSTALLED_TESTS" = "1"; then
|
|
||||||
AC_SUBST(installed_test_metadir, [${datadir}/installed-tests/]AC_PACKAGE_NAME)
|
|
||||||
AC_SUBST(installed_testdir, [${libexecdir}/installed-tests/]AC_PACKAGE_NAME)
|
|
||||||
fi
|
|
||||||
])
|
|
@@ -1,96 +0,0 @@
|
|||||||
dnl -*- mode: autoconf -*-
|
|
||||||
dnl Copyright 2009 Johan Dahlin
|
|
||||||
dnl
|
|
||||||
dnl This file is free software; the author(s) gives unlimited
|
|
||||||
dnl permission to copy and/or distribute it, with or without
|
|
||||||
dnl modifications, as long as this notice is preserved.
|
|
||||||
dnl
|
|
||||||
|
|
||||||
# serial 1
|
|
||||||
|
|
||||||
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
|
|
||||||
[
|
|
||||||
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
|
|
||||||
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
|
|
||||||
AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
|
|
||||||
|
|
||||||
dnl enable/disable introspection
|
|
||||||
m4_if([$2], [require],
|
|
||||||
[dnl
|
|
||||||
enable_introspection=yes
|
|
||||||
],[dnl
|
|
||||||
AC_ARG_ENABLE(introspection,
|
|
||||||
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
|
|
||||||
[Enable introspection for this build]),,
|
|
||||||
[enable_introspection=auto])
|
|
||||||
])dnl
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([for gobject-introspection])
|
|
||||||
|
|
||||||
dnl presence/version checking
|
|
||||||
AS_CASE([$enable_introspection],
|
|
||||||
[no], [dnl
|
|
||||||
found_introspection="no (disabled, use --enable-introspection to enable)"
|
|
||||||
],dnl
|
|
||||||
[yes],[dnl
|
|
||||||
PKG_CHECK_EXISTS([gobject-introspection-1.0],,
|
|
||||||
AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
|
|
||||||
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
|
|
||||||
found_introspection=yes,
|
|
||||||
AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
|
|
||||||
],dnl
|
|
||||||
[auto],[dnl
|
|
||||||
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
|
|
||||||
dnl Canonicalize enable_introspection
|
|
||||||
enable_introspection=$found_introspection
|
|
||||||
],dnl
|
|
||||||
[dnl
|
|
||||||
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
|
|
||||||
])dnl
|
|
||||||
|
|
||||||
AC_MSG_RESULT([$found_introspection])
|
|
||||||
|
|
||||||
INTROSPECTION_SCANNER=
|
|
||||||
INTROSPECTION_COMPILER=
|
|
||||||
INTROSPECTION_GENERATE=
|
|
||||||
INTROSPECTION_GIRDIR=
|
|
||||||
INTROSPECTION_TYPELIBDIR=
|
|
||||||
if test "x$found_introspection" = "xyes"; then
|
|
||||||
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
|
|
||||||
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
|
|
||||||
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
|
|
||||||
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
|
|
||||||
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
|
|
||||||
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
|
|
||||||
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
|
|
||||||
INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
|
|
||||||
fi
|
|
||||||
AC_SUBST(INTROSPECTION_SCANNER)
|
|
||||||
AC_SUBST(INTROSPECTION_COMPILER)
|
|
||||||
AC_SUBST(INTROSPECTION_GENERATE)
|
|
||||||
AC_SUBST(INTROSPECTION_GIRDIR)
|
|
||||||
AC_SUBST(INTROSPECTION_TYPELIBDIR)
|
|
||||||
AC_SUBST(INTROSPECTION_CFLAGS)
|
|
||||||
AC_SUBST(INTROSPECTION_LIBS)
|
|
||||||
AC_SUBST(INTROSPECTION_MAKEFILE)
|
|
||||||
|
|
||||||
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
dnl Usage:
|
|
||||||
dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
|
|
||||||
|
|
||||||
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
|
|
||||||
[
|
|
||||||
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl Usage:
|
|
||||||
dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
|
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
|
|
||||||
[
|
|
||||||
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
|
|
||||||
])
|
|
@@ -1,652 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# Copyright (C) 2011-2013 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
|
||||||
# distribute this file as part of a program that contains a
|
|
||||||
# configuration script generated by Autoconf, you may include it under
|
|
||||||
# the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
# This file is maintained in Automake, please report
|
|
||||||
# bugs to <bug-automake@gnu.org> or send patches to
|
|
||||||
# <automake-patches@gnu.org>.
|
|
||||||
|
|
||||||
scriptversion=2011-12-27.17; # UTC
|
|
||||||
|
|
||||||
# Make unconditional expansion of undefined variables an error. This
|
|
||||||
# helps a lot in preventing typo-related bugs.
|
|
||||||
set -u
|
|
||||||
|
|
||||||
me=tap-driver.sh
|
|
||||||
|
|
||||||
fatal ()
|
|
||||||
{
|
|
||||||
echo "$me: fatal: $*" >&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
usage_error ()
|
|
||||||
{
|
|
||||||
echo "$me: $*" >&2
|
|
||||||
print_usage >&2
|
|
||||||
exit 2
|
|
||||||
}
|
|
||||||
|
|
||||||
print_usage ()
|
|
||||||
{
|
|
||||||
cat <<END
|
|
||||||
Usage:
|
|
||||||
tap-driver.sh --test-name=NAME --log-file=PATH --trs-file=PATH
|
|
||||||
[--expect-failure={yes|no}] [--color-tests={yes|no}]
|
|
||||||
[--enable-hard-errors={yes|no}] [--ignore-exit]
|
|
||||||
[--diagnostic-string=STRING] [--merge|--no-merge]
|
|
||||||
[--comments|--no-comments] [--] TEST-COMMAND
|
|
||||||
The \`--test-name', \`--log-file' and \`--trs-file' options are mandatory.
|
|
||||||
END
|
|
||||||
}
|
|
||||||
|
|
||||||
# TODO: better error handling in option parsing (in particular, ensure
|
|
||||||
# TODO: $log_file, $trs_file and $test_name are defined).
|
|
||||||
test_name= # Used for reporting.
|
|
||||||
log_file= # Where to save the result and output of the test script.
|
|
||||||
trs_file= # Where to save the metadata of the test run.
|
|
||||||
expect_failure=0
|
|
||||||
color_tests=0
|
|
||||||
merge=0
|
|
||||||
ignore_exit=0
|
|
||||||
comments=0
|
|
||||||
diag_string='#'
|
|
||||||
while test $# -gt 0; do
|
|
||||||
case $1 in
|
|
||||||
--help) print_usage; exit $?;;
|
|
||||||
--version) echo "$me $scriptversion"; exit $?;;
|
|
||||||
--test-name) test_name=$2; shift;;
|
|
||||||
--log-file) log_file=$2; shift;;
|
|
||||||
--trs-file) trs_file=$2; shift;;
|
|
||||||
--color-tests) color_tests=$2; shift;;
|
|
||||||
--expect-failure) expect_failure=$2; shift;;
|
|
||||||
--enable-hard-errors) shift;; # No-op.
|
|
||||||
--merge) merge=1;;
|
|
||||||
--no-merge) merge=0;;
|
|
||||||
--ignore-exit) ignore_exit=1;;
|
|
||||||
--comments) comments=1;;
|
|
||||||
--no-comments) comments=0;;
|
|
||||||
--diagnostic-string) diag_string=$2; shift;;
|
|
||||||
--) shift; break;;
|
|
||||||
-*) usage_error "invalid option: '$1'";;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
test $# -gt 0 || usage_error "missing test command"
|
|
||||||
|
|
||||||
case $expect_failure in
|
|
||||||
yes) expect_failure=1;;
|
|
||||||
*) expect_failure=0;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test $color_tests = yes; then
|
|
||||||
init_colors='
|
|
||||||
color_map["red"]="[0;31m" # Red.
|
|
||||||
color_map["grn"]="[0;32m" # Green.
|
|
||||||
color_map["lgn"]="[1;32m" # Light green.
|
|
||||||
color_map["blu"]="[1;34m" # Blue.
|
|
||||||
color_map["mgn"]="[0;35m" # Magenta.
|
|
||||||
color_map["std"]="[m" # No color.
|
|
||||||
color_for_result["ERROR"] = "mgn"
|
|
||||||
color_for_result["PASS"] = "grn"
|
|
||||||
color_for_result["XPASS"] = "red"
|
|
||||||
color_for_result["FAIL"] = "red"
|
|
||||||
color_for_result["XFAIL"] = "lgn"
|
|
||||||
color_for_result["SKIP"] = "blu"'
|
|
||||||
else
|
|
||||||
init_colors=''
|
|
||||||
fi
|
|
||||||
|
|
||||||
# :; is there to work around a bug in bash 3.2 (and earlier) which
|
|
||||||
# does not always set '$?' properly on redirection failure.
|
|
||||||
# See the Autoconf manual for more details.
|
|
||||||
:;{
|
|
||||||
(
|
|
||||||
# Ignore common signals (in this subshell only!), to avoid potential
|
|
||||||
# problems with Korn shells. Some Korn shells are known to propagate
|
|
||||||
# to themselves signals that have killed a child process they were
|
|
||||||
# waiting for; this is done at least for SIGINT (and usually only for
|
|
||||||
# it, in truth). Without the `trap' below, such a behaviour could
|
|
||||||
# cause a premature exit in the current subshell, e.g., in case the
|
|
||||||
# test command it runs gets terminated by a SIGINT. Thus, the awk
|
|
||||||
# script we are piping into would never seen the exit status it
|
|
||||||
# expects on its last input line (which is displayed below by the
|
|
||||||
# last `echo $?' statement), and would thus die reporting an internal
|
|
||||||
# error.
|
|
||||||
# For more information, see the Autoconf manual and the threads:
|
|
||||||
# <http://lists.gnu.org/archive/html/bug-autoconf/2011-09/msg00004.html>
|
|
||||||
# <http://mail.opensolaris.org/pipermail/ksh93-integration-discuss/2009-February/004121.html>
|
|
||||||
trap : 1 3 2 13 15
|
|
||||||
if test $merge -gt 0; then
|
|
||||||
exec 2>&1
|
|
||||||
else
|
|
||||||
exec 2>&3
|
|
||||||
fi
|
|
||||||
"$@"
|
|
||||||
echo $?
|
|
||||||
) | LC_ALL=C ${AM_TAP_AWK-awk} \
|
|
||||||
-v me="$me" \
|
|
||||||
-v test_script_name="$test_name" \
|
|
||||||
-v log_file="$log_file" \
|
|
||||||
-v trs_file="$trs_file" \
|
|
||||||
-v expect_failure="$expect_failure" \
|
|
||||||
-v merge="$merge" \
|
|
||||||
-v ignore_exit="$ignore_exit" \
|
|
||||||
-v comments="$comments" \
|
|
||||||
-v diag_string="$diag_string" \
|
|
||||||
'
|
|
||||||
# FIXME: the usages of "cat >&3" below could be optimized when using
|
|
||||||
# FIXME: GNU awk, and/on on systems that supports /dev/fd/.
|
|
||||||
|
|
||||||
# Implementation note: in what follows, `result_obj` will be an
|
|
||||||
# associative array that (partly) simulates a TAP result object
|
|
||||||
# from the `TAP::Parser` perl module.
|
|
||||||
|
|
||||||
## ----------- ##
|
|
||||||
## FUNCTIONS ##
|
|
||||||
## ----------- ##
|
|
||||||
|
|
||||||
function fatal(msg)
|
|
||||||
{
|
|
||||||
print me ": " msg | "cat >&2"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
function abort(where)
|
|
||||||
{
|
|
||||||
fatal("internal error " where)
|
|
||||||
}
|
|
||||||
|
|
||||||
# Convert a boolean to a "yes"/"no" string.
|
|
||||||
function yn(bool)
|
|
||||||
{
|
|
||||||
return bool ? "yes" : "no";
|
|
||||||
}
|
|
||||||
|
|
||||||
function add_test_result(result)
|
|
||||||
{
|
|
||||||
if (!test_results_index)
|
|
||||||
test_results_index = 0
|
|
||||||
test_results_list[test_results_index] = result
|
|
||||||
test_results_index += 1
|
|
||||||
test_results_seen[result] = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Whether the test script should be re-run by "make recheck".
|
|
||||||
function must_recheck()
|
|
||||||
{
|
|
||||||
for (k in test_results_seen)
|
|
||||||
if (k != "XFAIL" && k != "PASS" && k != "SKIP")
|
|
||||||
return 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Whether the content of the log file associated to this test should
|
|
||||||
# be copied into the "global" test-suite.log.
|
|
||||||
function copy_in_global_log()
|
|
||||||
{
|
|
||||||
for (k in test_results_seen)
|
|
||||||
if (k != "PASS")
|
|
||||||
return 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# FIXME: this can certainly be improved ...
|
|
||||||
function get_global_test_result()
|
|
||||||
{
|
|
||||||
if ("ERROR" in test_results_seen)
|
|
||||||
return "ERROR"
|
|
||||||
if ("FAIL" in test_results_seen || "XPASS" in test_results_seen)
|
|
||||||
return "FAIL"
|
|
||||||
all_skipped = 1
|
|
||||||
for (k in test_results_seen)
|
|
||||||
if (k != "SKIP")
|
|
||||||
all_skipped = 0
|
|
||||||
if (all_skipped)
|
|
||||||
return "SKIP"
|
|
||||||
return "PASS";
|
|
||||||
}
|
|
||||||
|
|
||||||
function stringify_result_obj(result_obj)
|
|
||||||
{
|
|
||||||
if (result_obj["is_unplanned"] || result_obj["number"] != testno)
|
|
||||||
return "ERROR"
|
|
||||||
|
|
||||||
if (plan_seen == LATE_PLAN)
|
|
||||||
return "ERROR"
|
|
||||||
|
|
||||||
if (result_obj["directive"] == "TODO")
|
|
||||||
return result_obj["is_ok"] ? "XPASS" : "XFAIL"
|
|
||||||
|
|
||||||
if (result_obj["directive"] == "SKIP")
|
|
||||||
return result_obj["is_ok"] ? "SKIP" : COOKED_FAIL;
|
|
||||||
|
|
||||||
if (length(result_obj["directive"]))
|
|
||||||
abort("in function stringify_result_obj()")
|
|
||||||
|
|
||||||
return result_obj["is_ok"] ? COOKED_PASS : COOKED_FAIL
|
|
||||||
}
|
|
||||||
|
|
||||||
function decorate_result(result)
|
|
||||||
{
|
|
||||||
color_name = color_for_result[result]
|
|
||||||
if (color_name)
|
|
||||||
return color_map[color_name] "" result "" color_map["std"]
|
|
||||||
# If we are not using colorized output, or if we do not know how
|
|
||||||
# to colorize the given result, we should return it unchanged.
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
function report(result, details)
|
|
||||||
{
|
|
||||||
if (result ~ /^(X?(PASS|FAIL)|SKIP|ERROR)/)
|
|
||||||
{
|
|
||||||
msg = ": " test_script_name
|
|
||||||
add_test_result(result)
|
|
||||||
}
|
|
||||||
else if (result == "#")
|
|
||||||
{
|
|
||||||
msg = " " test_script_name ":"
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
abort("in function report()")
|
|
||||||
}
|
|
||||||
if (length(details))
|
|
||||||
msg = msg " " details
|
|
||||||
# Output on console might be colorized.
|
|
||||||
print decorate_result(result) msg
|
|
||||||
# Log the result in the log file too, to help debugging (this is
|
|
||||||
# especially true when said result is a TAP error or "Bail out!").
|
|
||||||
print result msg | "cat >&3";
|
|
||||||
}
|
|
||||||
|
|
||||||
function testsuite_error(error_message)
|
|
||||||
{
|
|
||||||
report("ERROR", "- " error_message)
|
|
||||||
}
|
|
||||||
|
|
||||||
function handle_tap_result()
|
|
||||||
{
|
|
||||||
details = result_obj["number"];
|
|
||||||
if (length(result_obj["description"]))
|
|
||||||
details = details " " result_obj["description"]
|
|
||||||
|
|
||||||
if (plan_seen == LATE_PLAN)
|
|
||||||
{
|
|
||||||
details = details " # AFTER LATE PLAN";
|
|
||||||
}
|
|
||||||
else if (result_obj["is_unplanned"])
|
|
||||||
{
|
|
||||||
details = details " # UNPLANNED";
|
|
||||||
}
|
|
||||||
else if (result_obj["number"] != testno)
|
|
||||||
{
|
|
||||||
details = sprintf("%s # OUT-OF-ORDER (expecting %d)",
|
|
||||||
details, testno);
|
|
||||||
}
|
|
||||||
else if (result_obj["directive"])
|
|
||||||
{
|
|
||||||
details = details " # " result_obj["directive"];
|
|
||||||
if (length(result_obj["explanation"]))
|
|
||||||
details = details " " result_obj["explanation"]
|
|
||||||
}
|
|
||||||
|
|
||||||
report(stringify_result_obj(result_obj), details)
|
|
||||||
}
|
|
||||||
|
|
||||||
# `skip_reason` should be empty whenever planned > 0.
|
|
||||||
function handle_tap_plan(planned, skip_reason)
|
|
||||||
{
|
|
||||||
planned += 0 # Avoid getting confused if, say, `planned` is "00"
|
|
||||||
if (length(skip_reason) && planned > 0)
|
|
||||||
abort("in function handle_tap_plan()")
|
|
||||||
if (plan_seen)
|
|
||||||
{
|
|
||||||
# Error, only one plan per stream is acceptable.
|
|
||||||
testsuite_error("multiple test plans")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
planned_tests = planned
|
|
||||||
# The TAP plan can come before or after *all* the TAP results; we speak
|
|
||||||
# respectively of an "early" or a "late" plan. If we see the plan line
|
|
||||||
# after at least one TAP result has been seen, assume we have a late
|
|
||||||
# plan; in this case, any further test result seen after the plan will
|
|
||||||
# be flagged as an error.
|
|
||||||
plan_seen = (testno >= 1 ? LATE_PLAN : EARLY_PLAN)
|
|
||||||
# If testno > 0, we have an error ("too many tests run") that will be
|
|
||||||
# automatically dealt with later, so do not worry about it here. If
|
|
||||||
# $plan_seen is true, we have an error due to a repeated plan, and that
|
|
||||||
# has already been dealt with above. Otherwise, we have a valid "plan
|
|
||||||
# with SKIP" specification, and should report it as a particular kind
|
|
||||||
# of SKIP result.
|
|
||||||
if (planned == 0 && testno == 0)
|
|
||||||
{
|
|
||||||
if (length(skip_reason))
|
|
||||||
skip_reason = "- " skip_reason;
|
|
||||||
report("SKIP", skip_reason);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function extract_tap_comment(line)
|
|
||||||
{
|
|
||||||
if (index(line, diag_string) == 1)
|
|
||||||
{
|
|
||||||
# Strip leading `diag_string` from `line`.
|
|
||||||
line = substr(line, length(diag_string) + 1)
|
|
||||||
# And strip any leading and trailing whitespace left.
|
|
||||||
sub("^[ \t]*", "", line)
|
|
||||||
sub("[ \t]*$", "", line)
|
|
||||||
# Return what is left (if any).
|
|
||||||
return line;
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
# When this function is called, we know that line is a TAP result line,
|
|
||||||
# so that it matches the (perl) RE "^(not )?ok\b".
|
|
||||||
function setup_result_obj(line)
|
|
||||||
{
|
|
||||||
# Get the result, and remove it from the line.
|
|
||||||
result_obj["is_ok"] = (substr(line, 1, 2) == "ok" ? 1 : 0)
|
|
||||||
sub("^(not )?ok[ \t]*", "", line)
|
|
||||||
|
|
||||||
# If the result has an explicit number, get it and strip it; otherwise,
|
|
||||||
# automatically assing the next progresive number to it.
|
|
||||||
if (line ~ /^[0-9]+$/ || line ~ /^[0-9]+[^a-zA-Z0-9_]/)
|
|
||||||
{
|
|
||||||
match(line, "^[0-9]+")
|
|
||||||
# The final `+ 0` is to normalize numbers with leading zeros.
|
|
||||||
result_obj["number"] = substr(line, 1, RLENGTH) + 0
|
|
||||||
line = substr(line, RLENGTH + 1)
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result_obj["number"] = testno
|
|
||||||
}
|
|
||||||
|
|
||||||
if (plan_seen == LATE_PLAN)
|
|
||||||
# No further test results are acceptable after a "late" TAP plan
|
|
||||||
# has been seen.
|
|
||||||
result_obj["is_unplanned"] = 1
|
|
||||||
else if (plan_seen && testno > planned_tests)
|
|
||||||
result_obj["is_unplanned"] = 1
|
|
||||||
else
|
|
||||||
result_obj["is_unplanned"] = 0
|
|
||||||
|
|
||||||
# Strip trailing and leading whitespace.
|
|
||||||
sub("^[ \t]*", "", line)
|
|
||||||
sub("[ \t]*$", "", line)
|
|
||||||
|
|
||||||
# This will have to be corrected if we have a "TODO"/"SKIP" directive.
|
|
||||||
result_obj["description"] = line
|
|
||||||
result_obj["directive"] = ""
|
|
||||||
result_obj["explanation"] = ""
|
|
||||||
|
|
||||||
if (index(line, "#") == 0)
|
|
||||||
return # No possible directive, nothing more to do.
|
|
||||||
|
|
||||||
# Directives are case-insensitive.
|
|
||||||
rx = "[ \t]*#[ \t]*([tT][oO][dD][oO]|[sS][kK][iI][pP])[ \t]*"
|
|
||||||
|
|
||||||
# See whether we have the directive, and if yes, where.
|
|
||||||
pos = match(line, rx "$")
|
|
||||||
if (!pos)
|
|
||||||
pos = match(line, rx "[^a-zA-Z0-9_]")
|
|
||||||
|
|
||||||
# If there was no TAP directive, we have nothing more to do.
|
|
||||||
if (!pos)
|
|
||||||
return
|
|
||||||
|
|
||||||
# Let`s now see if the TAP directive has been escaped. For example:
|
|
||||||
# escaped: ok \# SKIP
|
|
||||||
# not escaped: ok \\# SKIP
|
|
||||||
# escaped: ok \\\\\# SKIP
|
|
||||||
# not escaped: ok \ # SKIP
|
|
||||||
if (substr(line, pos, 1) == "#")
|
|
||||||
{
|
|
||||||
bslash_count = 0
|
|
||||||
for (i = pos; i > 1 && substr(line, i - 1, 1) == "\\"; i--)
|
|
||||||
bslash_count += 1
|
|
||||||
if (bslash_count % 2)
|
|
||||||
return # Directive was escaped.
|
|
||||||
}
|
|
||||||
|
|
||||||
# Strip the directive and its explanation (if any) from the test
|
|
||||||
# description.
|
|
||||||
result_obj["description"] = substr(line, 1, pos - 1)
|
|
||||||
# Now remove the test description from the line, that has been dealt
|
|
||||||
# with already.
|
|
||||||
line = substr(line, pos)
|
|
||||||
# Strip the directive, and save its value (normalized to upper case).
|
|
||||||
sub("^[ \t]*#[ \t]*", "", line)
|
|
||||||
result_obj["directive"] = toupper(substr(line, 1, 4))
|
|
||||||
line = substr(line, 5)
|
|
||||||
# Now get the explanation for the directive (if any), with leading
|
|
||||||
# and trailing whitespace removed.
|
|
||||||
sub("^[ \t]*", "", line)
|
|
||||||
sub("[ \t]*$", "", line)
|
|
||||||
result_obj["explanation"] = line
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_test_exit_message(status)
|
|
||||||
{
|
|
||||||
if (status == 0)
|
|
||||||
return ""
|
|
||||||
if (status !~ /^[1-9][0-9]*$/)
|
|
||||||
abort("getting exit status")
|
|
||||||
if (status < 127)
|
|
||||||
exit_details = ""
|
|
||||||
else if (status == 127)
|
|
||||||
exit_details = " (command not found?)"
|
|
||||||
else if (status >= 128 && status <= 255)
|
|
||||||
exit_details = sprintf(" (terminated by signal %d?)", status - 128)
|
|
||||||
else if (status > 256 && status <= 384)
|
|
||||||
# We used to report an "abnormal termination" here, but some Korn
|
|
||||||
# shells, when a child process die due to signal number n, can leave
|
|
||||||
# in $? an exit status of 256+n instead of the more standard 128+n.
|
|
||||||
# Apparently, both behaviours are allowed by POSIX (2008), so be
|
|
||||||
# prepared to handle them both. See also Austing Group report ID
|
|
||||||
# 0000051 <http://www.austingroupbugs.net/view.php?id=51>
|
|
||||||
exit_details = sprintf(" (terminated by signal %d?)", status - 256)
|
|
||||||
else
|
|
||||||
# Never seen in practice.
|
|
||||||
exit_details = " (abnormal termination)"
|
|
||||||
return sprintf("exited with status %d%s", status, exit_details)
|
|
||||||
}
|
|
||||||
|
|
||||||
function write_test_results()
|
|
||||||
{
|
|
||||||
print ":global-test-result: " get_global_test_result() > trs_file
|
|
||||||
print ":recheck: " yn(must_recheck()) > trs_file
|
|
||||||
print ":copy-in-global-log: " yn(copy_in_global_log()) > trs_file
|
|
||||||
for (i = 0; i < test_results_index; i += 1)
|
|
||||||
print ":test-result: " test_results_list[i] > trs_file
|
|
||||||
close(trs_file);
|
|
||||||
}
|
|
||||||
|
|
||||||
BEGIN {
|
|
||||||
|
|
||||||
## ------- ##
|
|
||||||
## SETUP ##
|
|
||||||
## ------- ##
|
|
||||||
|
|
||||||
'"$init_colors"'
|
|
||||||
|
|
||||||
# Properly initialized once the TAP plan is seen.
|
|
||||||
planned_tests = 0
|
|
||||||
|
|
||||||
COOKED_PASS = expect_failure ? "XPASS": "PASS";
|
|
||||||
COOKED_FAIL = expect_failure ? "XFAIL": "FAIL";
|
|
||||||
|
|
||||||
# Enumeration-like constants to remember which kind of plan (if any)
|
|
||||||
# has been seen. It is important that NO_PLAN evaluates "false" as
|
|
||||||
# a boolean.
|
|
||||||
NO_PLAN = 0
|
|
||||||
EARLY_PLAN = 1
|
|
||||||
LATE_PLAN = 2
|
|
||||||
|
|
||||||
testno = 0 # Number of test results seen so far.
|
|
||||||
bailed_out = 0 # Whether a "Bail out!" directive has been seen.
|
|
||||||
|
|
||||||
# Whether the TAP plan has been seen or not, and if yes, which kind
|
|
||||||
# it is ("early" is seen before any test result, "late" otherwise).
|
|
||||||
plan_seen = NO_PLAN
|
|
||||||
|
|
||||||
## --------- ##
|
|
||||||
## PARSING ##
|
|
||||||
## --------- ##
|
|
||||||
|
|
||||||
is_first_read = 1
|
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
# Involutions required so that we are able to read the exit status
|
|
||||||
# from the last input line.
|
|
||||||
st = getline
|
|
||||||
if (st < 0) # I/O error.
|
|
||||||
fatal("I/O error while reading from input stream")
|
|
||||||
else if (st == 0) # End-of-input
|
|
||||||
{
|
|
||||||
if (is_first_read)
|
|
||||||
abort("in input loop: only one input line")
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if (is_first_read)
|
|
||||||
{
|
|
||||||
is_first_read = 0
|
|
||||||
nextline = $0
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
curline = nextline
|
|
||||||
nextline = $0
|
|
||||||
$0 = curline
|
|
||||||
}
|
|
||||||
# Copy any input line verbatim into the log file.
|
|
||||||
print | "cat >&3"
|
|
||||||
# Parsing of TAP input should stop after a "Bail out!" directive.
|
|
||||||
if (bailed_out)
|
|
||||||
continue
|
|
||||||
|
|
||||||
# TAP test result.
|
|
||||||
if ($0 ~ /^(not )?ok$/ || $0 ~ /^(not )?ok[^a-zA-Z0-9_]/)
|
|
||||||
{
|
|
||||||
testno += 1
|
|
||||||
setup_result_obj($0)
|
|
||||||
handle_tap_result()
|
|
||||||
}
|
|
||||||
# TAP plan (normal or "SKIP" without explanation).
|
|
||||||
else if ($0 ~ /^1\.\.[0-9]+[ \t]*$/)
|
|
||||||
{
|
|
||||||
# The next two lines will put the number of planned tests in $0.
|
|
||||||
sub("^1\\.\\.", "")
|
|
||||||
sub("[^0-9]*$", "")
|
|
||||||
handle_tap_plan($0, "")
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
# TAP "SKIP" plan, with an explanation.
|
|
||||||
else if ($0 ~ /^1\.\.0+[ \t]*#/)
|
|
||||||
{
|
|
||||||
# The next lines will put the skip explanation in $0, stripping
|
|
||||||
# any leading and trailing whitespace. This is a little more
|
|
||||||
# tricky in truth, since we want to also strip a potential leading
|
|
||||||
# "SKIP" string from the message.
|
|
||||||
sub("^[^#]*#[ \t]*(SKIP[: \t][ \t]*)?", "")
|
|
||||||
sub("[ \t]*$", "");
|
|
||||||
handle_tap_plan(0, $0)
|
|
||||||
}
|
|
||||||
# "Bail out!" magic.
|
|
||||||
# Older versions of prove and TAP::Harness (e.g., 3.17) did not
|
|
||||||
# recognize a "Bail out!" directive when preceded by leading
|
|
||||||
# whitespace, but more modern versions (e.g., 3.23) do. So we
|
|
||||||
# emulate the latter, "more modern" behaviour.
|
|
||||||
else if ($0 ~ /^[ \t]*Bail out!/)
|
|
||||||
{
|
|
||||||
bailed_out = 1
|
|
||||||
# Get the bailout message (if any), with leading and trailing
|
|
||||||
# whitespace stripped. The message remains stored in `$0`.
|
|
||||||
sub("^[ \t]*Bail out![ \t]*", "");
|
|
||||||
sub("[ \t]*$", "");
|
|
||||||
# Format the error message for the
|
|
||||||
bailout_message = "Bail out!"
|
|
||||||
if (length($0))
|
|
||||||
bailout_message = bailout_message " " $0
|
|
||||||
testsuite_error(bailout_message)
|
|
||||||
}
|
|
||||||
# Maybe we have too look for dianogtic comments too.
|
|
||||||
else if (comments != 0)
|
|
||||||
{
|
|
||||||
comment = extract_tap_comment($0);
|
|
||||||
if (length(comment))
|
|
||||||
report("#", comment);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
## -------- ##
|
|
||||||
## FINISH ##
|
|
||||||
## -------- ##
|
|
||||||
|
|
||||||
# A "Bail out!" directive should cause us to ignore any following TAP
|
|
||||||
# error, as well as a non-zero exit status from the TAP producer.
|
|
||||||
if (!bailed_out)
|
|
||||||
{
|
|
||||||
if (!plan_seen)
|
|
||||||
{
|
|
||||||
testsuite_error("missing test plan")
|
|
||||||
}
|
|
||||||
else if (planned_tests != testno)
|
|
||||||
{
|
|
||||||
bad_amount = testno > planned_tests ? "many" : "few"
|
|
||||||
testsuite_error(sprintf("too %s tests run (expected %d, got %d)",
|
|
||||||
bad_amount, planned_tests, testno))
|
|
||||||
}
|
|
||||||
if (!ignore_exit)
|
|
||||||
{
|
|
||||||
# Fetch exit status from the last line.
|
|
||||||
exit_message = get_test_exit_message(nextline)
|
|
||||||
if (exit_message)
|
|
||||||
testsuite_error(exit_message)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
write_test_results()
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
} # End of "BEGIN" block.
|
|
||||||
'
|
|
||||||
|
|
||||||
# TODO: document that we consume the file descriptor 3 :-(
|
|
||||||
} 3>"$log_file"
|
|
||||||
|
|
||||||
test $? -eq 0 || fatal "I/O or internal error"
|
|
||||||
|
|
||||||
# Local Variables:
|
|
||||||
# mode: shell-script
|
|
||||||
# sh-indentation: 2
|
|
||||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
|
||||||
# time-stamp-start: "scriptversion="
|
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
|
||||||
# time-stamp-time-zone: "UTC"
|
|
||||||
# time-stamp-end: "; # UTC"
|
|
||||||
# End:
|
|
@@ -1,5 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
|
|
||||||
# run a GTest in tap mode. The test binary is passed as $1
|
|
||||||
|
|
||||||
$1 -k --tap
|
|
@@ -1,710 +0,0 @@
|
|||||||
AUTOMAKE_OPTIONS = subdir-objects
|
|
||||||
|
|
||||||
# preamble
|
|
||||||
NULL =
|
|
||||||
|
|
||||||
# common definitions
|
|
||||||
CLEANFILES =
|
|
||||||
DISTCLEANFILES =
|
|
||||||
EXTRA_DIST =
|
|
||||||
BUILT_SOURCES =
|
|
||||||
|
|
||||||
AM_CPPFLAGS = \
|
|
||||||
-DCLUTTER_SYSCONFDIR=\""$(sysconfdir)"\" \
|
|
||||||
-DCLUTTER_COMPILATION=1 \
|
|
||||||
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
|
|
||||||
-DG_LOG_DOMAIN=\"Clutter\" \
|
|
||||||
-fvisibility=hidden \
|
|
||||||
-I$(top_srcdir) \
|
|
||||||
-I$(top_srcdir)/clutter \
|
|
||||||
-I$(top_builddir) \
|
|
||||||
-I$(top_builddir)/clutter \
|
|
||||||
-I$(top_srcdir)/../cogl \
|
|
||||||
-I$(top_builddir)/../cogl \
|
|
||||||
-I$(top_builddir)/../cogl/cogl \
|
|
||||||
$(CLUTTER_DEPRECATED_CFLAGS) \
|
|
||||||
$(CLUTTER_DEBUG_CFLAGS) \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
|
|
||||||
|
|
||||||
# these are the gir files we generate using g-ir-scanner
|
|
||||||
INTROSPECTION_GIRS =
|
|
||||||
|
|
||||||
# the base include path for headers
|
|
||||||
clutter_base_includedir = $(includedir)/mutter-$(LIBMUTTER_API_VERSION)/clutter
|
|
||||||
clutter_includedir = $(clutter_base_includedir)/clutter
|
|
||||||
clutter_deprecateddir = $(clutter_base_includedir)/clutter/deprecated
|
|
||||||
|
|
||||||
# pkg-config files
|
|
||||||
pc_files =
|
|
||||||
|
|
||||||
# common sources - please, keep these sorted alphabetically
|
|
||||||
source_h = \
|
|
||||||
clutter-action.h \
|
|
||||||
clutter-actor-meta.h \
|
|
||||||
clutter-actor.h \
|
|
||||||
clutter-align-constraint.h \
|
|
||||||
clutter-animatable.h \
|
|
||||||
clutter-backend.h \
|
|
||||||
clutter-bind-constraint.h \
|
|
||||||
clutter-binding-pool.h \
|
|
||||||
clutter-bin-layout.h \
|
|
||||||
clutter-blur-effect.h \
|
|
||||||
clutter-box-layout.h \
|
|
||||||
clutter-brightness-contrast-effect.h \
|
|
||||||
clutter-cairo.h \
|
|
||||||
clutter-canvas.h \
|
|
||||||
clutter-child-meta.h \
|
|
||||||
clutter-click-action.h \
|
|
||||||
clutter-clone.h \
|
|
||||||
clutter-color-static.h \
|
|
||||||
clutter-color.h \
|
|
||||||
clutter-colorize-effect.h \
|
|
||||||
clutter-constraint.h \
|
|
||||||
clutter-container.h \
|
|
||||||
clutter-content.h \
|
|
||||||
clutter-deform-effect.h \
|
|
||||||
clutter-deprecated.h \
|
|
||||||
clutter-desaturate-effect.h \
|
|
||||||
clutter-device-manager.h \
|
|
||||||
clutter-drag-action.h \
|
|
||||||
clutter-drop-action.h \
|
|
||||||
clutter-effect.h \
|
|
||||||
clutter-enums.h \
|
|
||||||
clutter-event.h \
|
|
||||||
clutter-feature.h \
|
|
||||||
clutter-fixed-layout.h \
|
|
||||||
clutter-flow-layout.h \
|
|
||||||
clutter-gesture-action.h \
|
|
||||||
clutter-grid-layout.h \
|
|
||||||
clutter-group.h \
|
|
||||||
clutter-image.h \
|
|
||||||
clutter-input-device.h \
|
|
||||||
clutter-input-device-tool.h \
|
|
||||||
clutter-input-focus.h \
|
|
||||||
clutter-input-method.h \
|
|
||||||
clutter-interval.h \
|
|
||||||
clutter-keyframe-transition.h \
|
|
||||||
clutter-keysyms.h \
|
|
||||||
clutter-layout-manager.h \
|
|
||||||
clutter-layout-meta.h \
|
|
||||||
clutter-macros.h \
|
|
||||||
clutter-main.h \
|
|
||||||
clutter-offscreen-effect.h \
|
|
||||||
clutter-page-turn-effect.h \
|
|
||||||
clutter-paint-nodes.h \
|
|
||||||
clutter-paint-node.h \
|
|
||||||
clutter-pan-action.h \
|
|
||||||
clutter-path-constraint.h \
|
|
||||||
clutter-path.h \
|
|
||||||
clutter-property-transition.h \
|
|
||||||
clutter-rotate-action.h \
|
|
||||||
clutter-script.h \
|
|
||||||
clutter-scriptable.h \
|
|
||||||
clutter-scroll-actor.h \
|
|
||||||
clutter-settings.h \
|
|
||||||
clutter-shader-effect.h \
|
|
||||||
clutter-shader-types.h \
|
|
||||||
clutter-swipe-action.h \
|
|
||||||
clutter-snap-constraint.h \
|
|
||||||
clutter-stage.h \
|
|
||||||
clutter-stage-manager.h \
|
|
||||||
clutter-tap-action.h \
|
|
||||||
clutter-test-utils.h \
|
|
||||||
clutter-texture.h \
|
|
||||||
clutter-text.h \
|
|
||||||
clutter-text-buffer.h \
|
|
||||||
clutter-timeline.h \
|
|
||||||
clutter-transition-group.h \
|
|
||||||
clutter-transition.h \
|
|
||||||
clutter-types.h \
|
|
||||||
clutter-units.h \
|
|
||||||
clutter-virtual-input-device.h \
|
|
||||||
clutter-zoom-action.h \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
source_c = \
|
|
||||||
clutter-action.c \
|
|
||||||
clutter-actor-box.c \
|
|
||||||
clutter-actor-meta.c \
|
|
||||||
clutter-actor.c \
|
|
||||||
clutter-align-constraint.c \
|
|
||||||
clutter-animatable.c \
|
|
||||||
clutter-backend.c \
|
|
||||||
clutter-base-types.c \
|
|
||||||
clutter-bezier.c \
|
|
||||||
clutter-bind-constraint.c \
|
|
||||||
clutter-binding-pool.c \
|
|
||||||
clutter-bin-layout.c \
|
|
||||||
clutter-blur-effect.c \
|
|
||||||
clutter-box-layout.c \
|
|
||||||
clutter-brightness-contrast-effect.c \
|
|
||||||
clutter-cairo.c \
|
|
||||||
clutter-canvas.c \
|
|
||||||
clutter-child-meta.c \
|
|
||||||
clutter-click-action.c \
|
|
||||||
clutter-clone.c \
|
|
||||||
clutter-color.c \
|
|
||||||
clutter-colorize-effect.c \
|
|
||||||
clutter-constraint.c \
|
|
||||||
clutter-container.c \
|
|
||||||
clutter-content.c \
|
|
||||||
clutter-deform-effect.c \
|
|
||||||
clutter-desaturate-effect.c \
|
|
||||||
clutter-device-manager.c \
|
|
||||||
clutter-drag-action.c \
|
|
||||||
clutter-drop-action.c \
|
|
||||||
clutter-effect.c \
|
|
||||||
clutter-event.c \
|
|
||||||
clutter-feature.c \
|
|
||||||
clutter-fixed-layout.c \
|
|
||||||
clutter-flatten-effect.c \
|
|
||||||
clutter-flow-layout.c \
|
|
||||||
clutter-gesture-action.c \
|
|
||||||
clutter-grid-layout.c \
|
|
||||||
clutter-image.c \
|
|
||||||
clutter-input-device.c \
|
|
||||||
clutter-input-device-tool.c \
|
|
||||||
clutter-input-focus.c \
|
|
||||||
clutter-input-method.c \
|
|
||||||
clutter-virtual-input-device.c \
|
|
||||||
clutter-interval.c \
|
|
||||||
clutter-keyframe-transition.c \
|
|
||||||
clutter-keysyms-table.c \
|
|
||||||
clutter-layout-manager.c \
|
|
||||||
clutter-layout-meta.c \
|
|
||||||
clutter-main.c \
|
|
||||||
clutter-master-clock.c \
|
|
||||||
clutter-master-clock-default.c \
|
|
||||||
clutter-offscreen-effect.c \
|
|
||||||
clutter-page-turn-effect.c \
|
|
||||||
clutter-paint-nodes.c \
|
|
||||||
clutter-paint-node.c \
|
|
||||||
clutter-pan-action.c \
|
|
||||||
clutter-path-constraint.c \
|
|
||||||
clutter-path.c \
|
|
||||||
clutter-property-transition.c \
|
|
||||||
clutter-rotate-action.c \
|
|
||||||
clutter-script.c \
|
|
||||||
clutter-script-parser.c \
|
|
||||||
clutter-scriptable.c \
|
|
||||||
clutter-scroll-actor.c \
|
|
||||||
clutter-settings.c \
|
|
||||||
clutter-shader-effect.c \
|
|
||||||
clutter-shader-types.c \
|
|
||||||
clutter-swipe-action.c \
|
|
||||||
clutter-snap-constraint.c \
|
|
||||||
clutter-stage.c \
|
|
||||||
clutter-stage-manager.c \
|
|
||||||
clutter-stage-window.c \
|
|
||||||
clutter-tap-action.c \
|
|
||||||
clutter-test-utils.c \
|
|
||||||
clutter-text.c \
|
|
||||||
clutter-text-buffer.c \
|
|
||||||
clutter-transition-group.c \
|
|
||||||
clutter-transition.c \
|
|
||||||
clutter-timeline.c \
|
|
||||||
clutter-units.c \
|
|
||||||
clutter-util.c \
|
|
||||||
clutter-paint-volume.c \
|
|
||||||
clutter-zoom-action.c \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
# private headers; these should not be distributed or introspected
|
|
||||||
source_h_priv = \
|
|
||||||
clutter-actor-meta-private.h \
|
|
||||||
clutter-actor-private.h \
|
|
||||||
clutter-backend-private.h \
|
|
||||||
clutter-bezier.h \
|
|
||||||
clutter-constraint-private.h \
|
|
||||||
clutter-content-private.h \
|
|
||||||
clutter-debug.h \
|
|
||||||
clutter-device-manager-private.h \
|
|
||||||
clutter-easing.h \
|
|
||||||
clutter-effect-private.h \
|
|
||||||
clutter-event-translator.h \
|
|
||||||
clutter-event-private.h \
|
|
||||||
clutter-flatten-effect.h \
|
|
||||||
clutter-gesture-action-private.h \
|
|
||||||
clutter-id-pool.h \
|
|
||||||
clutter-input-focus-private.h \
|
|
||||||
clutter-input-method-private.h \
|
|
||||||
clutter-master-clock.h \
|
|
||||||
clutter-master-clock-default.h \
|
|
||||||
clutter-offscreen-effect-private.h \
|
|
||||||
clutter-paint-node-private.h \
|
|
||||||
clutter-paint-volume-private.h \
|
|
||||||
clutter-private.h \
|
|
||||||
clutter-script-private.h \
|
|
||||||
clutter-settings-private.h \
|
|
||||||
clutter-stage-manager-private.h \
|
|
||||||
clutter-stage-private.h \
|
|
||||||
clutter-stage-view.h \
|
|
||||||
clutter-stage-window.h \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
# private source code; these should not be introspected
|
|
||||||
source_c_priv = \
|
|
||||||
clutter-easing.c \
|
|
||||||
clutter-event-translator.c \
|
|
||||||
clutter-id-pool.c \
|
|
||||||
clutter-stage-view.c \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
# deprecated installed headers
|
|
||||||
deprecated_h = \
|
|
||||||
deprecated/clutter-actor.h \
|
|
||||||
deprecated/clutter-alpha.h \
|
|
||||||
deprecated/clutter-animatable.h \
|
|
||||||
deprecated/clutter-animation.h \
|
|
||||||
deprecated/clutter-animator.h \
|
|
||||||
deprecated/clutter-backend.h \
|
|
||||||
deprecated/clutter-behaviour.h \
|
|
||||||
deprecated/clutter-behaviour-depth.h \
|
|
||||||
deprecated/clutter-behaviour-ellipse.h \
|
|
||||||
deprecated/clutter-behaviour-opacity.h \
|
|
||||||
deprecated/clutter-behaviour-path.h \
|
|
||||||
deprecated/clutter-behaviour-rotate.h \
|
|
||||||
deprecated/clutter-behaviour-scale.h \
|
|
||||||
deprecated/clutter-bin-layout.h \
|
|
||||||
deprecated/clutter-box.h \
|
|
||||||
deprecated/clutter-cairo-texture.h \
|
|
||||||
deprecated/clutter-container.h \
|
|
||||||
deprecated/clutter-frame-source.h \
|
|
||||||
deprecated/clutter-group.h \
|
|
||||||
deprecated/clutter-input-device.h \
|
|
||||||
deprecated/clutter-keysyms.h \
|
|
||||||
deprecated/clutter-list-model.h \
|
|
||||||
deprecated/clutter-main.h \
|
|
||||||
deprecated/clutter-media.h \
|
|
||||||
deprecated/clutter-model.h \
|
|
||||||
deprecated/clutter-rectangle.h \
|
|
||||||
deprecated/clutter-score.h \
|
|
||||||
deprecated/clutter-shader.h \
|
|
||||||
deprecated/clutter-stage-manager.h \
|
|
||||||
deprecated/clutter-stage.h \
|
|
||||||
deprecated/clutter-state.h \
|
|
||||||
deprecated/clutter-table-layout.h \
|
|
||||||
deprecated/clutter-texture.h \
|
|
||||||
deprecated/clutter-timeline.h \
|
|
||||||
deprecated/clutter-timeout-pool.h \
|
|
||||||
deprecated/clutter-util.h \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
# deprecated source code
|
|
||||||
deprecated_c = \
|
|
||||||
deprecated/clutter-actor-deprecated.c \
|
|
||||||
deprecated/clutter-alpha.c \
|
|
||||||
deprecated/clutter-animation.c \
|
|
||||||
deprecated/clutter-animator.c \
|
|
||||||
deprecated/clutter-behaviour.c \
|
|
||||||
deprecated/clutter-behaviour-depth.c \
|
|
||||||
deprecated/clutter-behaviour-ellipse.c \
|
|
||||||
deprecated/clutter-behaviour-opacity.c \
|
|
||||||
deprecated/clutter-behaviour-path.c \
|
|
||||||
deprecated/clutter-behaviour-rotate.c \
|
|
||||||
deprecated/clutter-behaviour-scale.c \
|
|
||||||
deprecated/clutter-box.c \
|
|
||||||
deprecated/clutter-cairo-texture.c \
|
|
||||||
deprecated/clutter-frame-source.c \
|
|
||||||
deprecated/clutter-group.c \
|
|
||||||
deprecated/clutter-input-device-deprecated.c \
|
|
||||||
deprecated/clutter-layout-manager-deprecated.c \
|
|
||||||
deprecated/clutter-list-model.c \
|
|
||||||
deprecated/clutter-media.c \
|
|
||||||
deprecated/clutter-model.c \
|
|
||||||
deprecated/clutter-rectangle.c \
|
|
||||||
deprecated/clutter-score.c \
|
|
||||||
deprecated/clutter-shader.c \
|
|
||||||
deprecated/clutter-state.c \
|
|
||||||
deprecated/clutter-table-layout.c \
|
|
||||||
deprecated/clutter-texture.c \
|
|
||||||
deprecated/clutter-timeout-pool.c \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
# deprecated private headers; these should not be installed
|
|
||||||
deprecated_h_priv = \
|
|
||||||
deprecated/clutter-model-private.h \
|
|
||||||
deprecated/clutter-timeout-interval.h \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
# deprecated private source code; these should not be introspected
|
|
||||||
deprecated_c_priv = \
|
|
||||||
deprecated/clutter-timeout-interval.c \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
# built sources
|
|
||||||
built_source_c = \
|
|
||||||
clutter-enum-types.c \
|
|
||||||
clutter-marshal.c \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
# built headers
|
|
||||||
built_source_h = \
|
|
||||||
clutter-enum-types.h \
|
|
||||||
clutter-marshal.h \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
# config header
|
|
||||||
DISTCLEANFILES += clutter-config.h
|
|
||||||
EXTRA_DIST += clutter-config.h.in
|
|
||||||
|
|
||||||
# key symbol update script
|
|
||||||
EXTRA_DIST += clutter-keysyms-update.pl
|
|
||||||
|
|
||||||
pc_files += mutter-clutter-$(LIBMUTTER_API_VERSION).pc
|
|
||||||
|
|
||||||
# in order to be compatible with Clutter < 1.10, when we shipped a single
|
|
||||||
# shared library whose name was determined by the single backend it
|
|
||||||
# supported, we need to install symbolic links so that existing applications
|
|
||||||
# using Clutter won't break in the Brave New World of multi-backend support
|
|
||||||
# in the same shared object.
|
|
||||||
compat_libs =
|
|
||||||
|
|
||||||
# backends source listings
|
|
||||||
#
|
|
||||||
# backend_source_c := source code
|
|
||||||
# backend_source_h := installed public headers
|
|
||||||
# backend_source_c_priv := source that should not be scanned by g-i
|
|
||||||
# backend_source_h_priv := private headers
|
|
||||||
# backend_source_built := built sources
|
|
||||||
#
|
|
||||||
backend_source_c =
|
|
||||||
backend_source_h =
|
|
||||||
backend_source_c_priv =
|
|
||||||
backend_source_h_priv =
|
|
||||||
backend_source_built =
|
|
||||||
|
|
||||||
# X11 backend rules
|
|
||||||
x11_source_c = \
|
|
||||||
x11/clutter-backend-x11.c \
|
|
||||||
x11/clutter-device-manager-core-x11.c \
|
|
||||||
x11/clutter-event-x11.c \
|
|
||||||
x11/clutter-input-device-core-x11.c \
|
|
||||||
x11/clutter-keymap-x11.c \
|
|
||||||
x11/clutter-stage-x11.c \
|
|
||||||
x11/clutter-x11-texture-pixmap.c \
|
|
||||||
x11/clutter-xkb-a11y-x11.c \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
x11_source_h = \
|
|
||||||
x11/clutter-x11.h \
|
|
||||||
x11/clutter-x11-texture-pixmap.h \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
x11_source_h_priv = \
|
|
||||||
x11/clutter-backend-x11.h \
|
|
||||||
x11/clutter-device-manager-core-x11.h \
|
|
||||||
x11/clutter-input-device-core-x11.h \
|
|
||||||
x11/clutter-keymap-x11.h \
|
|
||||||
x11/clutter-settings-x11.h \
|
|
||||||
x11/clutter-stage-x11.h \
|
|
||||||
x11/clutter-xkb-a11y-x11.h \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
x11_source_c_priv = \
|
|
||||||
x11/xsettings/xsettings-client.c \
|
|
||||||
x11/xsettings/xsettings-client.h \
|
|
||||||
x11/xsettings/xsettings-common.c \
|
|
||||||
x11/xsettings/xsettings-common.h \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
x11_source_c += \
|
|
||||||
x11/clutter-device-manager-xi2.c \
|
|
||||||
x11/clutter-input-device-xi2.c \
|
|
||||||
x11/clutter-input-device-tool-xi2.c \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
x11_source_h_priv += \
|
|
||||||
x11/clutter-device-manager-xi2.h \
|
|
||||||
x11/clutter-input-device-xi2.h \
|
|
||||||
x11/clutter-input-device-tool-xi2.h \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
x11_source_c += \
|
|
||||||
x11/clutter-virtual-input-device-x11.c \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
x11_source_h_priv += \
|
|
||||||
x11/clutter-virtual-input-device-x11.h \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
backend_source_h += $(x11_source_h)
|
|
||||||
backend_source_c += $(x11_source_c)
|
|
||||||
backend_source_h_priv += $(x11_source_h_priv)
|
|
||||||
backend_source_c_priv += $(x11_source_c_priv)
|
|
||||||
|
|
||||||
# the list of files we want to introspect on X11
|
|
||||||
x11_introspection = $(x11_source_c) $(x11_source_h)
|
|
||||||
|
|
||||||
clutterx11_includedir = $(clutter_includedir)/x11
|
|
||||||
clutterx11_include_HEADERS = $(x11_source_h)
|
|
||||||
|
|
||||||
mutter-clutter-x11-@LIBMUTTER_API_VERSION@.pc: mutter-clutter-$(LIBMUTTER_API_VERSION).pc
|
|
||||||
$(QUIET_GEN)cp -f $< $(@F)
|
|
||||||
|
|
||||||
pc_files += mutter-clutter-x11-$(LIBMUTTER_API_VERSION).pc
|
|
||||||
|
|
||||||
# Shared cogl backend files
|
|
||||||
cogl_source_h =
|
|
||||||
|
|
||||||
cogl_source_c = \
|
|
||||||
cogl/clutter-stage-cogl.c \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
cogl_source_h_priv = \
|
|
||||||
cogl/clutter-stage-cogl.h \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
cogl_source_c_priv =
|
|
||||||
|
|
||||||
backend_source_h += $(cogl_source_h)
|
|
||||||
backend_source_c += $(cogl_source_c)
|
|
||||||
backend_source_h_priv += $(cogl_source_h_priv)
|
|
||||||
backend_source_c_priv += $(cogl_source_c_priv)
|
|
||||||
|
|
||||||
backend_source_h += $(glx_source_h)
|
|
||||||
backend_source_c += $(glx_source_c)
|
|
||||||
|
|
||||||
evdev_c_priv = \
|
|
||||||
evdev/clutter-device-manager-evdev.c \
|
|
||||||
evdev/clutter-input-device-evdev.c \
|
|
||||||
evdev/clutter-seat-evdev.c \
|
|
||||||
evdev/clutter-virtual-input-device-evdev.c \
|
|
||||||
evdev/clutter-event-evdev.c \
|
|
||||||
evdev/clutter-input-device-tool-evdev.c \
|
|
||||||
$(NULL)
|
|
||||||
evdev_h_priv = \
|
|
||||||
evdev/clutter-device-manager-evdev.h \
|
|
||||||
evdev/clutter-input-device-evdev.h \
|
|
||||||
evdev/clutter-seat-evdev.h \
|
|
||||||
evdev/clutter-input-device-tool-evdev.h \
|
|
||||||
evdev/clutter-virtual-input-device-evdev.h \
|
|
||||||
$(NULL)
|
|
||||||
evdev_h = evdev/clutter-evdev.h
|
|
||||||
|
|
||||||
if SUPPORT_WAYLAND
|
|
||||||
backend_source_c_priv += $(evdev_c_priv)
|
|
||||||
backend_source_h_priv += $(evdev_h_priv)
|
|
||||||
backend_source_h += $(evdev_h)
|
|
||||||
|
|
||||||
backend_source_c += evdev/clutter-xkb-utils.c
|
|
||||||
backend_source_h_priv += evdev/clutter-xkb-utils.h
|
|
||||||
|
|
||||||
# EGL backend rules
|
|
||||||
egl_source_h = \
|
|
||||||
egl/clutter-egl-headers.h \
|
|
||||||
egl/clutter-egl.h \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
egl_source_h_priv = egl/clutter-backend-eglnative.h
|
|
||||||
egl_source_c = egl/clutter-backend-eglnative.c
|
|
||||||
|
|
||||||
wayland_compositor_source_h = \
|
|
||||||
wayland/clutter-wayland-compositor.h \
|
|
||||||
wayland/clutter-wayland-surface.h
|
|
||||||
backend_source_h += $(wayland_compositor_source_h)
|
|
||||||
backend_source_c += \
|
|
||||||
wayland/clutter-wayland-surface.c
|
|
||||||
|
|
||||||
backend_source_h += $(egl_source_h)
|
|
||||||
backend_source_c += $(egl_source_c)
|
|
||||||
backend_source_h_priv += $(egl_source_h_priv)
|
|
||||||
|
|
||||||
endif # SUPPORT_WAYLAND
|
|
||||||
|
|
||||||
# cally
|
|
||||||
cally_sources_h = \
|
|
||||||
cally/cally-actor.h \
|
|
||||||
cally/cally-clone.h \
|
|
||||||
cally/cally-factory.h \
|
|
||||||
cally/cally-group.h \
|
|
||||||
cally/cally.h \
|
|
||||||
cally/cally-main.h \
|
|
||||||
cally/cally-rectangle.h \
|
|
||||||
cally/cally-root.h \
|
|
||||||
cally/cally-stage.h \
|
|
||||||
cally/cally-text.h \
|
|
||||||
cally/cally-texture.h \
|
|
||||||
cally/cally-util.h \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
cally_sources_c = \
|
|
||||||
cally/cally-actor.c \
|
|
||||||
cally/cally.c \
|
|
||||||
cally/cally-clone.c \
|
|
||||||
cally/cally-group.c \
|
|
||||||
cally/cally-rectangle.c \
|
|
||||||
cally/cally-root.c \
|
|
||||||
cally/cally-stage.c \
|
|
||||||
cally/cally-text.c \
|
|
||||||
cally/cally-texture.c \
|
|
||||||
cally/cally-util.c \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
cally_sources_private = \
|
|
||||||
cally/cally-actor-private.h \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
cally_includedir = $(clutter_base_includedir)/cally
|
|
||||||
cally_include_HEADERS = $(cally_sources_h)
|
|
||||||
|
|
||||||
# general build rules:
|
|
||||||
# you should not need to modify anything below this point
|
|
||||||
|
|
||||||
# glib-genmarshal rules
|
|
||||||
glib_marshal_list = clutter-marshal.list
|
|
||||||
glib_marshal_prefix = _clutter_marshal
|
|
||||||
include $(srcdir)/Makefile.am.marshal
|
|
||||||
|
|
||||||
# glib-mkenums rules
|
|
||||||
glib_enum_h = clutter-enum-types.h
|
|
||||||
glib_enum_c = clutter-enum-types.c
|
|
||||||
glib_enum_headers = $(source_h) $(deprecated_h)
|
|
||||||
include $(srcdir)/Makefile.am.enums
|
|
||||||
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
|
||||||
pkgconfig_DATA = $(pc_files)
|
|
||||||
DISTCLEANFILES += $(pc_files)
|
|
||||||
|
|
||||||
clutter_include_HEADERS = $(source_h) clutter.h clutter-autocleanups.h clutter-mutter.h
|
|
||||||
nodist_clutter_include_HEADERS = clutter-config.h $(built_source_h)
|
|
||||||
|
|
||||||
clutter_deprecated_HEADERS = $(deprecated_h)
|
|
||||||
|
|
||||||
mutterlibdir = $(libdir)/mutter-@LIBMUTTER_API_VERSION@
|
|
||||||
mutterlib_LTLIBRARIES = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
|
|
||||||
|
|
||||||
libmutter_clutter_@LIBMUTTER_API_VERSION@_la_LIBADD = \
|
|
||||||
$(LIBM) \
|
|
||||||
$(CLUTTER_LIBS) \
|
|
||||||
$(top_builddir)/../cogl/cogl/libmutter-cogl-$(LIBMUTTER_API_VERSION).la \
|
|
||||||
$(top_builddir)/../cogl/cogl-pango/libmutter-cogl-pango-$(LIBMUTTER_API_VERSION).la \
|
|
||||||
$(top_builddir)/../cogl/cogl-path/libmutter-cogl-path-$(LIBMUTTER_API_VERSION).la \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
libmutter_clutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
|
||||||
$(backend_source_c) \
|
|
||||||
$(backend_source_h) \
|
|
||||||
$(backend_source_c_priv) \
|
|
||||||
$(backend_source_h_priv) \
|
|
||||||
$(source_c) \
|
|
||||||
$(source_h) \
|
|
||||||
$(source_c_priv) \
|
|
||||||
$(source_h_priv) \
|
|
||||||
$(deprecated_c) \
|
|
||||||
$(deprecated_h) \
|
|
||||||
$(deprecated_c_priv) \
|
|
||||||
$(deprecated_h_priv) \
|
|
||||||
$(cally_sources_c) \
|
|
||||||
$(cally_sources_h) \
|
|
||||||
$(cally_sources_private) \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
nodist_libmutter_clutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
|
||||||
$(backend_source_built) \
|
|
||||||
$(built_source_c) \
|
|
||||||
$(built_source_h)
|
|
||||||
|
|
||||||
libmutter_clutter_@LIBMUTTER_API_VERSION@_la_LDFLAGS = \
|
|
||||||
$(CLUTTER_LINK_FLAGS) \
|
|
||||||
$(CLUTTER_LT_LDFLAGS) \
|
|
||||||
-export-dynamic \
|
|
||||||
-rpath $(mutterlibdir) \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
install-exec-local:
|
|
||||||
test -z "$(mutterlibdir)" || $(MKDIR_P) "$(DESTDIR)$(mutterlibdir)"
|
|
||||||
for lib in `echo $(compat_libs)`; do \
|
|
||||||
(cd $(DESTDIR)$(mutterlibdir) && \
|
|
||||||
rm -f $$lib.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION); \
|
|
||||||
) ; \
|
|
||||||
(cd $(DESTDIR)$(mutterlibdir) && \
|
|
||||||
{ ln -s -f libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib.0 || \
|
|
||||||
{ rm -f $$lib.0 && ln -s libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib.0; }; \
|
|
||||||
} \
|
|
||||||
) ; \
|
|
||||||
(cd $(DESTDIR)$(mutterlibdir) && \
|
|
||||||
{ ln -s -f libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib || \
|
|
||||||
{ rm -f $$lib && ln -s libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib; }; \
|
|
||||||
} \
|
|
||||||
) ; \
|
|
||||||
done
|
|
||||||
|
|
||||||
# gobject-introspection rules
|
|
||||||
-include $(INTROSPECTION_MAKEFILE)
|
|
||||||
|
|
||||||
INTROSPECTION_SCANNER_ARGS = \
|
|
||||||
--add-include-path=$(top_builddir)/../cogl/cogl \
|
|
||||||
--add-include-path=$(top_builddir)/../cogl/cogl-pango
|
|
||||||
INTROSPECTION_COMPILER_ARGS = \
|
|
||||||
--includedir=$(top_builddir)/../cogl/cogl \
|
|
||||||
--includedir=$(top_builddir)/../cogl/cogl-pango
|
|
||||||
INTROSPECTION_SCANNER_ENV = \
|
|
||||||
PKG_CONFIG_PATH=$(top_builddir)/../cogl/cogl/:$(top_builddir)/../cogl/cogl-pango/:$${PKG_CONFIG_PATH}
|
|
||||||
|
|
||||||
Clutter-@LIBMUTTER_API_VERSION@.gir: libmutter-clutter-@LIBMUTTER_API_VERSION@.la Makefile
|
|
||||||
|
|
||||||
Clutter_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = Clutter
|
|
||||||
Clutter_@LIBMUTTER_API_VERSION@_gir_VERSION = @LIBMUTTER_API_VERSION@
|
|
||||||
Clutter_@LIBMUTTER_API_VERSION@_gir_LIBS = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
|
|
||||||
Clutter_@LIBMUTTER_API_VERSION@_gir_FILES = \
|
|
||||||
$(clutter_include_HEADERS) \
|
|
||||||
$(clutter_deprecated_HEADERS) \
|
|
||||||
$(nodist_clutter_include_HEADERS) \
|
|
||||||
$(source_c) \
|
|
||||||
$(deprecated_c) \
|
|
||||||
$(built_source_c)
|
|
||||||
Clutter_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
|
|
||||||
Clutter_@LIBMUTTER_API_VERSION@_gir_INCLUDES = GL-1.0 GObject-2.0 cairo-1.0 Cogl-@LIBMUTTER_API_VERSION@ CoglPango-@LIBMUTTER_API_VERSION@ Atk-1.0 Json-1.0
|
|
||||||
Clutter_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
|
|
||||||
--warn-all \
|
|
||||||
--c-include='clutter/clutter.h' \
|
|
||||||
--pkg-export=mutter-clutter-@LIBMUTTER_API_VERSION@
|
|
||||||
|
|
||||||
INTROSPECTION_GIRS += Clutter-@LIBMUTTER_API_VERSION@.gir
|
|
||||||
|
|
||||||
Cally-@LIBMUTTER_API_VERSION@.gir: Makefile Clutter-@LIBMUTTER_API_VERSION@.gir
|
|
||||||
|
|
||||||
Cally_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = Cally
|
|
||||||
Cally_@LIBMUTTER_API_VERSION@_gir_VERSION = @LIBMUTTER_API_VERSION@
|
|
||||||
Cally_@LIBMUTTER_API_VERSION@_gir_LIBS = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
|
|
||||||
Cally_@LIBMUTTER_API_VERSION@_gir_FILES = $(cally_sources_h) $(cally_sources_c)
|
|
||||||
Cally_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
|
|
||||||
Cally_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
|
|
||||||
--warn-all \
|
|
||||||
--c-include='cally/cally.h' \
|
|
||||||
--pkg-export=mutter-clutter-@LIBMUTTER_API_VERSION@ \
|
|
||||||
--include-uninstalled=$(top_builddir)/clutter/Clutter-@LIBMUTTER_API_VERSION@.gir
|
|
||||||
|
|
||||||
INTROSPECTION_GIRS += Cally-@LIBMUTTER_API_VERSION@.gir
|
|
||||||
|
|
||||||
ClutterX11-@LIBMUTTER_API_VERSION@.gir: Makefile Clutter-@LIBMUTTER_API_VERSION@.gir
|
|
||||||
|
|
||||||
ClutterX11_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = ClutterX11
|
|
||||||
ClutterX11_@LIBMUTTER_API_VERSION@_gir_INCLUDES = xlib-2.0
|
|
||||||
ClutterX11_@LIBMUTTER_API_VERSION@_gir_LIBS = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
|
|
||||||
ClutterX11_@LIBMUTTER_API_VERSION@_gir_FILES = $(x11_introspection)
|
|
||||||
ClutterX11_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
|
|
||||||
ClutterX11_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
|
|
||||||
--warn-all \
|
|
||||||
--c-include='clutter/x11/clutter-x11.h' \
|
|
||||||
--pkg-export=mutter-clutter-x11-@LIBMUTTER_API_VERSION@ \
|
|
||||||
--include-uninstalled=$(top_builddir)/clutter/Clutter-@LIBMUTTER_API_VERSION@.gir
|
|
||||||
|
|
||||||
INTROSPECTION_GIRS += ClutterX11-@LIBMUTTER_API_VERSION@.gir
|
|
||||||
|
|
||||||
# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
|
|
||||||
# install anything - we need to install inside our prefix.
|
|
||||||
girdir = $(mutterlibdir)
|
|
||||||
gir_DATA = $(INTROSPECTION_GIRS)
|
|
||||||
|
|
||||||
typelibdir = $(mutterlibdir)
|
|
||||||
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
|
|
||||||
|
|
||||||
EXTRA_DIST += \
|
|
||||||
Makefile.am.marshal \
|
|
||||||
Makefile.am.enums
|
|
||||||
|
|
||||||
CLEANFILES += $(gir_DATA) $(typelib_DATA)
|
|
@@ -1,52 +0,0 @@
|
|||||||
# Rules for generating enumeration types using glib-mkenums
|
|
||||||
#
|
|
||||||
# Define:
|
|
||||||
# glib_enum_h = header template file
|
|
||||||
# glib_enum_c = source template file
|
|
||||||
# glib_enum_headers = list of headers to parse
|
|
||||||
#
|
|
||||||
# before including Makefile.am.enums. You will also need to have
|
|
||||||
# the following targets already defined:
|
|
||||||
#
|
|
||||||
# CLEANFILES
|
|
||||||
# DISTCLEANFILES
|
|
||||||
# BUILT_SOURCES
|
|
||||||
# EXTRA_DIST
|
|
||||||
#
|
|
||||||
# Author: Emmanuele Bassi <ebassi@linux.intel.com>
|
|
||||||
|
|
||||||
# Basic sanity checks
|
|
||||||
$(if $(GLIB_MKENUMS),,$(error Need to define GLIB_MKENUMS))
|
|
||||||
|
|
||||||
$(if $(or $(glib_enum_h), \
|
|
||||||
$(glib_enum_c)),, \
|
|
||||||
$(error Need to define glib_enum_h and glib_enum_c))
|
|
||||||
|
|
||||||
$(if $(glib_enum_headers),,$(error Need to define glib_enum_headers))
|
|
||||||
|
|
||||||
enum_tmpl_h=$(addprefix $(srcdir)/, $(glib_enum_h:.h=.h.in))
|
|
||||||
enum_tmpl_c=$(addprefix $(srcdir)/, $(glib_enum_c:.c=.c.in))
|
|
||||||
enum_headers=$(addprefix $(srcdir)/, $(glib_enum_headers))
|
|
||||||
|
|
||||||
CLEANFILES += stamp-enum-types
|
|
||||||
DISTCLEANFILES += $(glib_enum_h) $(glib_enum_c)
|
|
||||||
BUILT_SOURCES += $(glib_enum_h) $(glib_enum_c)
|
|
||||||
EXTRA_DIST += $(enum_tmpl_h) $(enum_tmpl_c)
|
|
||||||
|
|
||||||
stamp-enum-types: $(enum_headers) $(enum_tmpl_h)
|
|
||||||
$(AM_V_GEN)$(GLIB_MKENUMS) \
|
|
||||||
--template $(enum_tmpl_h) \
|
|
||||||
$(enum_headers) > xgen-eh \
|
|
||||||
&& (cmp -s xgen-eh $(glib_enum_h) || cp -f xgen-eh $(glib_enum_h)) \
|
|
||||||
&& rm -f xgen-eh \
|
|
||||||
&& echo timestamp > $(@F)
|
|
||||||
|
|
||||||
$(glib_enum_h): stamp-enum-types
|
|
||||||
@true
|
|
||||||
|
|
||||||
$(glib_enum_c): $(enum_headers) $(enum_tmpl_h) $(enum_tmpl_c)
|
|
||||||
$(AM_V_GEN)$(GLIB_MKENUMS) \
|
|
||||||
--template $(enum_tmpl_c) \
|
|
||||||
$(enum_headers) > xgen-ec \
|
|
||||||
&& cp -f xgen-ec $(glib_enum_c) \
|
|
||||||
&& rm -f xgen-ec
|
|
@@ -1,54 +0,0 @@
|
|||||||
# Rules for generating marshal files using glib-genmarshal
|
|
||||||
#
|
|
||||||
# Define:
|
|
||||||
# glib_marshal_list = marshal list file
|
|
||||||
# glib_marshal_prefix = prefix for marshal functions
|
|
||||||
#
|
|
||||||
# before including Makefile.am.marshal. You will also need to have
|
|
||||||
# the following targets already defined:
|
|
||||||
#
|
|
||||||
# CLEANFILES
|
|
||||||
# DISTCLEANFILES
|
|
||||||
# BUILT_SOURCES
|
|
||||||
# EXTRA_DIST
|
|
||||||
#
|
|
||||||
# Author: Emmanuele Bassi <ebassi@linux.intel.com>
|
|
||||||
|
|
||||||
# Basic sanity checks
|
|
||||||
$(if $(GLIB_GENMARSHAL),,$(error Need to define GLIB_GENMARSHAL))
|
|
||||||
|
|
||||||
$(if $(or $(glib_marshal_list), \
|
|
||||||
$(glib_marshal_prefix)),, \
|
|
||||||
$(error Need to define glib_marshal_list and glib_marshal_prefix))
|
|
||||||
|
|
||||||
marshal_h = $(glib_marshal_list:.list=.h)
|
|
||||||
marshal_c = $(glib_marshal_list:.list=.c)
|
|
||||||
marshal_list = $(addprefix $(srcdir)/, $(glib_marshal_list))
|
|
||||||
|
|
||||||
CLEANFILES += stamp-marshal
|
|
||||||
DISTCLEANFILES += $(marshal_h) $(marshal_c)
|
|
||||||
BUILT_SOURCES += $(marshal_h) $(marshal_c)
|
|
||||||
EXTRA_DIST += $(marshal_list)
|
|
||||||
|
|
||||||
stamp-marshal: $(marshal_list)
|
|
||||||
$(AM_V_GEN)$(GLIB_GENMARSHAL) \
|
|
||||||
--prefix=$(glib_marshal_prefix) \
|
|
||||||
--header \
|
|
||||||
--valist-marshallers \
|
|
||||||
$(marshal_list) > xgen-mh \
|
|
||||||
&& (cmp -s xgen-mh $(marshal_h) || cp -f xgen-mh $(marshal_h)) \
|
|
||||||
&& rm -f xgen-mh \
|
|
||||||
&& echo timestamp > $(@F)
|
|
||||||
|
|
||||||
$(marshal_h): stamp-marshal
|
|
||||||
@true
|
|
||||||
|
|
||||||
$(marshal_c): $(marshal_h)
|
|
||||||
$(AM_V_GEN)$(GLIB_GENMARSHAL) \
|
|
||||||
--prefix=$(glib_marshal_prefix) \
|
|
||||||
--body \
|
|
||||||
--valist-marshallers \
|
|
||||||
--prototypes \
|
|
||||||
$(marshal_list) > xgen-mc \
|
|
||||||
&& (cmp -s xgen-mc $(marshal_c) || cp -f xgen-mc $(marshal_c)) \
|
|
||||||
&& rm -f xgen-mc
|
|
12
clutter/clutter/clutter-actor-box-private.h
Normal file
12
clutter/clutter/clutter-actor-box-private.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#ifndef __CLUTTER_ACTOR_BOX_PRIVATE_H__
|
||||||
|
#define __CLUTTER_ACTOR_BOX_PRIVATE_H__
|
||||||
|
|
||||||
|
#include <clutter/clutter-types.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
void _clutter_actor_box_enlarge_for_effects (ClutterActorBox *box);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __CLUTTER_ACTOR_BOX_PRIVATE_H__ */
|
@@ -5,6 +5,7 @@
|
|||||||
#include "clutter-types.h"
|
#include "clutter-types.h"
|
||||||
#include "clutter-interval.h"
|
#include "clutter-interval.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
|
#include "clutter-actor-box-private.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_actor_box_new:
|
* clutter_actor_box_new:
|
||||||
@@ -542,6 +543,57 @@ clutter_actor_box_set_size (ClutterActorBox *box,
|
|||||||
box->y2 = box->y1 + height;
|
box->y2 = box->y1 + height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_clutter_actor_box_enlarge_for_effects (ClutterActorBox *box)
|
||||||
|
{
|
||||||
|
float width, height;
|
||||||
|
|
||||||
|
/* The aim here is that for a given rectangle defined with floating point
|
||||||
|
* coordinates we want to determine a stable quantized size in pixels
|
||||||
|
* that doesn't vary due to the original box's sub-pixel position.
|
||||||
|
*
|
||||||
|
* The reason this is important is because effects will use this
|
||||||
|
* API to determine the size of offscreen framebuffers and so for
|
||||||
|
* a fixed-size object that may be animated accross the screen we
|
||||||
|
* want to make sure that the stage paint-box has an equally stable
|
||||||
|
* size so that effects aren't made to continuously re-allocate
|
||||||
|
* a corresponding fbo.
|
||||||
|
*
|
||||||
|
* The other thing we consider is that the calculation of this box is
|
||||||
|
* subject to floating point precision issues that might be slightly
|
||||||
|
* different to the precision issues involved with actually painting the
|
||||||
|
* actor, which might result in painting slightly leaking outside the
|
||||||
|
* user's calculated paint-volume. For this we simply aim to pad out the
|
||||||
|
* paint-volume by at least half a pixel all the way around.
|
||||||
|
*/
|
||||||
|
width = box->x2 - box->x1;
|
||||||
|
height = box->y2 - box->y1;
|
||||||
|
width = CLUTTER_NEARBYINT (width);
|
||||||
|
height = CLUTTER_NEARBYINT (height);
|
||||||
|
/* XXX: NB the width/height may now be up to 0.5px too small so we
|
||||||
|
* must also pad by 0.25px all around to account for this. In total we
|
||||||
|
* must padd by at least 0.75px around all sides. */
|
||||||
|
|
||||||
|
/* XXX: The furthest that we can overshoot the bottom right corner by
|
||||||
|
* here is 1.75px in total if you consider that the 0.75 padding could
|
||||||
|
* just cross an integer boundary and so ceil will effectively add 1.
|
||||||
|
*/
|
||||||
|
box->x2 = ceilf (box->x2 + 0.75);
|
||||||
|
box->y2 = ceilf (box->y2 + 0.75);
|
||||||
|
|
||||||
|
/* Now we redefine the top-left relative to the bottom right based on the
|
||||||
|
* rounded width/height determined above + a constant so that the overall
|
||||||
|
* size of the box will be stable and not dependant on the box's
|
||||||
|
* position.
|
||||||
|
*
|
||||||
|
* Adding 3px to the width/height will ensure we cover the maximum of
|
||||||
|
* 1.75px padding on the bottom/right and still ensure we have > 0.75px
|
||||||
|
* padding on the top/left.
|
||||||
|
*/
|
||||||
|
box->x1 = box->x2 - width - 3;
|
||||||
|
box->y1 = box->y2 - height - 3;
|
||||||
|
}
|
||||||
|
|
||||||
G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterActorBox, clutter_actor_box,
|
G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterActorBox, clutter_actor_box,
|
||||||
clutter_actor_box_copy,
|
clutter_actor_box_copy,
|
||||||
clutter_actor_box_free,
|
clutter_actor_box_free,
|
||||||
|
@@ -275,17 +275,14 @@ 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_queue_redraw_with_clip (ClutterActor *self,
|
void _clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||||
ClutterRedrawFlags flags,
|
ClutterRedrawFlags flags,
|
||||||
ClutterPaintVolume *clip_volume);
|
const ClutterPaintVolume *clip_volume);
|
||||||
void _clutter_actor_queue_redraw_full (ClutterActor *self,
|
void _clutter_actor_queue_redraw_full (ClutterActor *self,
|
||||||
ClutterRedrawFlags flags,
|
ClutterRedrawFlags flags,
|
||||||
ClutterPaintVolume *volume,
|
const ClutterPaintVolume *volume,
|
||||||
ClutterEffect *effect);
|
ClutterEffect *effect);
|
||||||
|
|
||||||
ClutterPaintVolume * _clutter_actor_get_queue_redraw_clip (ClutterActor *self);
|
|
||||||
void _clutter_actor_set_queue_redraw_clip (ClutterActor *self,
|
|
||||||
ClutterPaintVolume *clip_volume);
|
|
||||||
void _clutter_actor_finish_queue_redraw (ClutterActor *self,
|
void _clutter_actor_finish_queue_redraw (ClutterActor *self,
|
||||||
ClutterPaintVolume *clip);
|
ClutterPaintVolume *clip);
|
||||||
|
|
||||||
|
@@ -635,6 +635,7 @@
|
|||||||
#include "clutter-interval.h"
|
#include "clutter-interval.h"
|
||||||
#include "clutter-main.h"
|
#include "clutter-main.h"
|
||||||
#include "clutter-marshal.h"
|
#include "clutter-marshal.h"
|
||||||
|
#include "clutter-mutter.h"
|
||||||
#include "clutter-paint-nodes.h"
|
#include "clutter-paint-nodes.h"
|
||||||
#include "clutter-paint-node-private.h"
|
#include "clutter-paint-node-private.h"
|
||||||
#include "clutter-paint-volume-private.h"
|
#include "clutter-paint-volume-private.h"
|
||||||
@@ -1022,7 +1023,7 @@ typedef struct _TransitionClosure
|
|||||||
|
|
||||||
static void clutter_container_iface_init (ClutterContainerIface *iface);
|
static void clutter_container_iface_init (ClutterContainerIface *iface);
|
||||||
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
|
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
|
||||||
static void clutter_animatable_iface_init (ClutterAnimatableIface *iface);
|
static void clutter_animatable_iface_init (ClutterAnimatableInterface *iface);
|
||||||
static void atk_implementor_iface_init (AtkImplementorIface *iface);
|
static void atk_implementor_iface_init (AtkImplementorIface *iface);
|
||||||
|
|
||||||
/* These setters are all static for now, maybe they should be in the
|
/* These setters are all static for now, maybe they should be in the
|
||||||
@@ -1108,7 +1109,6 @@ static void clutter_actor_pop_in_cloned_branch (ClutterActor *self,
|
|||||||
{ _transform; } \
|
{ _transform; } \
|
||||||
cogl_matrix_translate ((m), -_tx, -_ty, -_tz); } G_STMT_END
|
cogl_matrix_translate ((m), -_tx, -_ty, -_tz); } G_STMT_END
|
||||||
|
|
||||||
static GQuark quark_shader_data = 0;
|
|
||||||
static GQuark quark_actor_layout_info = 0;
|
static GQuark quark_actor_layout_info = 0;
|
||||||
static GQuark quark_actor_transform_info = 0;
|
static GQuark quark_actor_transform_info = 0;
|
||||||
static GQuark quark_actor_animation_info = 0;
|
static GQuark quark_actor_animation_info = 0;
|
||||||
@@ -1722,6 +1722,22 @@ set_show_on_set_parent (ClutterActor *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_actor_queue_redraw_on_parent (ClutterActor *self)
|
||||||
|
{
|
||||||
|
const ClutterPaintVolume *pv;
|
||||||
|
|
||||||
|
if (!self->priv->parent)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* A relayout/redraw is underway */
|
||||||
|
if (self->priv->needs_allocation)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pv = clutter_actor_get_transformed_paint_volume (self, self->priv->parent);
|
||||||
|
_clutter_actor_queue_redraw_with_clip (self->priv->parent, 0, pv);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_actor_show:
|
* clutter_actor_show:
|
||||||
* @self: A #ClutterActor
|
* @self: A #ClutterActor
|
||||||
@@ -1777,7 +1793,7 @@ clutter_actor_show (ClutterActor *self)
|
|||||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_VISIBLE]);
|
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_VISIBLE]);
|
||||||
|
|
||||||
if (priv->parent != NULL)
|
if (priv->parent != NULL)
|
||||||
clutter_actor_queue_redraw (priv->parent);
|
clutter_actor_queue_redraw (self);
|
||||||
|
|
||||||
g_object_thaw_notify (G_OBJECT (self));
|
g_object_thaw_notify (G_OBJECT (self));
|
||||||
}
|
}
|
||||||
@@ -1902,8 +1918,10 @@ clutter_actor_hide (ClutterActor *self)
|
|||||||
g_signal_emit (self, actor_signals[HIDE], 0);
|
g_signal_emit (self, actor_signals[HIDE], 0);
|
||||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_VISIBLE]);
|
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_VISIBLE]);
|
||||||
|
|
||||||
if (priv->parent != NULL)
|
if (priv->parent != NULL && priv->needs_allocation)
|
||||||
clutter_actor_queue_redraw (priv->parent);
|
clutter_actor_queue_redraw (priv->parent);
|
||||||
|
else
|
||||||
|
clutter_actor_queue_redraw_on_parent (self);
|
||||||
|
|
||||||
g_object_thaw_notify (G_OBJECT (self));
|
g_object_thaw_notify (G_OBJECT (self));
|
||||||
}
|
}
|
||||||
@@ -2671,9 +2689,12 @@ clutter_actor_real_allocate (ClutterActor *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_clutter_actor_signal_queue_redraw (ClutterActor *self,
|
_clutter_actor_propagate_queue_redraw (ClutterActor *self,
|
||||||
ClutterActor *origin)
|
ClutterActor *origin,
|
||||||
|
ClutterPaintVolume *pv)
|
||||||
{
|
{
|
||||||
|
gboolean stop = FALSE;
|
||||||
|
|
||||||
/* no point in queuing a redraw on a destroyed actor */
|
/* no point in queuing a redraw on a destroyed actor */
|
||||||
if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
|
if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
|
||||||
return;
|
return;
|
||||||
@@ -2682,27 +2703,33 @@ _clutter_actor_signal_queue_redraw (ClutterActor *self,
|
|||||||
* the actor bas been cloned. In this case the clone will need to
|
* the actor bas been cloned. In this case the clone will need to
|
||||||
* receive the signal so it can queue its own redraw.
|
* receive the signal so it can queue its own redraw.
|
||||||
*/
|
*/
|
||||||
|
while (self)
|
||||||
|
{
|
||||||
|
_clutter_actor_queue_redraw_on_clones (self);
|
||||||
|
|
||||||
_clutter_actor_queue_redraw_on_clones (self);
|
/* calls klass->queue_redraw in default handler */
|
||||||
|
if (g_signal_has_handler_pending (self, actor_signals[QUEUE_REDRAW],
|
||||||
/* calls klass->queue_redraw in default handler */
|
|
||||||
if (g_signal_has_handler_pending (self, actor_signals[QUEUE_REDRAW],
|
|
||||||
0, TRUE))
|
0, TRUE))
|
||||||
{
|
{
|
||||||
g_signal_emit (self, actor_signals[QUEUE_REDRAW], 0, origin);
|
g_signal_emit (self, actor_signals[QUEUE_REDRAW], 0, origin, pv, &stop);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLUTTER_ACTOR_GET_CLASS (self)->queue_redraw (self, origin);
|
stop = CLUTTER_ACTOR_GET_CLASS (self)->queue_redraw (self, origin, pv);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stop)
|
||||||
|
break;
|
||||||
|
|
||||||
|
self = clutter_actor_get_parent (self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static gboolean
|
||||||
clutter_actor_real_queue_redraw (ClutterActor *self,
|
clutter_actor_real_queue_redraw (ClutterActor *self,
|
||||||
ClutterActor *origin)
|
ClutterActor *origin,
|
||||||
|
ClutterPaintVolume *paint_volume)
|
||||||
{
|
{
|
||||||
ClutterActor *parent;
|
|
||||||
|
|
||||||
CLUTTER_NOTE (PAINT, "Redraw queued on '%s' (from: '%s')",
|
CLUTTER_NOTE (PAINT, "Redraw queued on '%s' (from: '%s')",
|
||||||
_clutter_actor_get_debug_name (self),
|
_clutter_actor_get_debug_name (self),
|
||||||
origin != NULL ? _clutter_actor_get_debug_name (origin)
|
origin != NULL ? _clutter_actor_get_debug_name (origin)
|
||||||
@@ -2710,7 +2737,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
|
|||||||
|
|
||||||
/* no point in queuing a redraw on a destroyed actor */
|
/* no point in queuing a redraw on a destroyed actor */
|
||||||
if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
|
if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
|
||||||
return;
|
return TRUE;
|
||||||
|
|
||||||
/* If the queue redraw is coming from a child then the actor has
|
/* If the queue redraw is coming from a child then the actor has
|
||||||
become dirty and any queued effect is no longer valid */
|
become dirty and any queued effect is no longer valid */
|
||||||
@@ -2725,7 +2752,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
|
|||||||
* won't change so we don't have to propagate up the hierarchy.
|
* won't change so we don't have to propagate up the hierarchy.
|
||||||
*/
|
*/
|
||||||
if (!CLUTTER_ACTOR_IS_VISIBLE (self))
|
if (!CLUTTER_ACTOR_IS_VISIBLE (self))
|
||||||
return;
|
return TRUE;
|
||||||
|
|
||||||
/* Although we could determine here that a full stage redraw
|
/* Although we could determine here that a full stage redraw
|
||||||
* has already been queued and immediately bail out, we actually
|
* has already been queued and immediately bail out, we actually
|
||||||
@@ -2739,7 +2766,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
|
|||||||
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
|
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
|
||||||
if (stage != NULL &&
|
if (stage != NULL &&
|
||||||
_clutter_stage_has_full_redraw_queued (CLUTTER_STAGE (stage)))
|
_clutter_stage_has_full_redraw_queued (CLUTTER_STAGE (stage)))
|
||||||
return;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
self->priv->propagated_one_redraw = TRUE;
|
self->priv->propagated_one_redraw = TRUE;
|
||||||
@@ -2747,12 +2774,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
|
|||||||
/* notify parents, if they are all visible eventually we'll
|
/* notify parents, if they are all visible eventually we'll
|
||||||
* queue redraw on the stage, which queues the redraw idle.
|
* queue redraw on the stage, which queues the redraw idle.
|
||||||
*/
|
*/
|
||||||
parent = clutter_actor_get_parent (self);
|
return FALSE;
|
||||||
if (parent != NULL)
|
|
||||||
{
|
|
||||||
/* this will go up recursively */
|
|
||||||
_clutter_actor_signal_queue_redraw (parent, origin);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -3543,12 +3565,6 @@ _clutter_actor_update_last_paint_volume (ClutterActor *self)
|
|||||||
priv->last_paint_volume_valid = TRUE;
|
priv->last_paint_volume_valid = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline gboolean
|
|
||||||
actor_has_shader_data (ClutterActor *self)
|
|
||||||
{
|
|
||||||
return g_object_get_qdata (G_OBJECT (self), quark_shader_data) != NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
guint32
|
guint32
|
||||||
_clutter_actor_get_pick_id (ClutterActor *self)
|
_clutter_actor_get_pick_id (ClutterActor *self)
|
||||||
{
|
{
|
||||||
@@ -3722,7 +3738,7 @@ clutter_actor_paint_node (ClutterActor *actor,
|
|||||||
if (!clutter_stage_get_no_clear_hint (CLUTTER_STAGE (actor)))
|
if (!clutter_stage_get_no_clear_hint (CLUTTER_STAGE (actor)))
|
||||||
clear_flags |= COGL_BUFFER_BIT_COLOR;
|
clear_flags |= COGL_BUFFER_BIT_COLOR;
|
||||||
|
|
||||||
node = _clutter_root_node_new (fb, &bg_color, clear_flags);
|
node = clutter_root_node_new (fb, &bg_color, clear_flags);
|
||||||
clutter_paint_node_set_name (node, "stageClear");
|
clutter_paint_node_set_name (node, "stageClear");
|
||||||
clutter_paint_node_add_rectangle (node, &box);
|
clutter_paint_node_add_rectangle (node, &box);
|
||||||
clutter_paint_node_add_child (root, node);
|
clutter_paint_node_add_child (root, node);
|
||||||
@@ -3761,7 +3777,7 @@ clutter_actor_paint_node (ClutterActor *actor,
|
|||||||
}
|
}
|
||||||
#endif /* CLUTTER_ENABLE_DEBUG */
|
#endif /* CLUTTER_ENABLE_DEBUG */
|
||||||
|
|
||||||
_clutter_paint_node_paint (root);
|
clutter_paint_node_paint (root);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -3790,7 +3806,6 @@ clutter_actor_paint (ClutterActor *self)
|
|||||||
ClutterActorPrivate *priv;
|
ClutterActorPrivate *priv;
|
||||||
ClutterPickMode pick_mode;
|
ClutterPickMode pick_mode;
|
||||||
gboolean clip_set = FALSE;
|
gboolean clip_set = FALSE;
|
||||||
gboolean shader_applied = FALSE;
|
|
||||||
ClutterStage *stage;
|
ClutterStage *stage;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||||
@@ -3960,25 +3975,13 @@ clutter_actor_paint (ClutterActor *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (priv->effects == NULL)
|
if (priv->effects == NULL)
|
||||||
{
|
priv->next_effect_to_paint = NULL;
|
||||||
if (pick_mode == CLUTTER_PICK_NONE &&
|
|
||||||
actor_has_shader_data (self))
|
|
||||||
{
|
|
||||||
_clutter_actor_shader_pre_paint (self, FALSE);
|
|
||||||
shader_applied = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
priv->next_effect_to_paint = NULL;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
priv->next_effect_to_paint =
|
priv->next_effect_to_paint =
|
||||||
_clutter_meta_group_peek_metas (priv->effects);
|
_clutter_meta_group_peek_metas (priv->effects);
|
||||||
|
|
||||||
clutter_actor_continue_paint (self);
|
clutter_actor_continue_paint (self);
|
||||||
|
|
||||||
if (shader_applied)
|
|
||||||
_clutter_actor_shader_post_paint (self);
|
|
||||||
|
|
||||||
if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_VOLUMES &&
|
if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_VOLUMES &&
|
||||||
pick_mode == CLUTTER_PICK_NONE))
|
pick_mode == CLUTTER_PICK_NONE))
|
||||||
_clutter_actor_draw_paint_volume (self);
|
_clutter_actor_draw_paint_volume (self);
|
||||||
@@ -4862,7 +4865,8 @@ clutter_actor_set_scale_factor (ClutterActor *self,
|
|||||||
g_assert (pspec != NULL);
|
g_assert (pspec != NULL);
|
||||||
g_assert (scale_p != NULL);
|
g_assert (scale_p != NULL);
|
||||||
|
|
||||||
_clutter_actor_create_transition (self, pspec, *scale_p, factor);
|
if (*scale_p != factor)
|
||||||
|
_clutter_actor_create_transition (self, pspec, *scale_p, factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
@@ -6318,7 +6322,6 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
quark_shader_data = g_quark_from_static_string ("-clutter-actor-shader-data");
|
|
||||||
quark_actor_layout_info = g_quark_from_static_string ("-clutter-actor-layout-info");
|
quark_actor_layout_info = g_quark_from_static_string ("-clutter-actor-layout-info");
|
||||||
quark_actor_transform_info = g_quark_from_static_string ("-clutter-actor-transform-info");
|
quark_actor_transform_info = g_quark_from_static_string ("-clutter-actor-transform-info");
|
||||||
quark_actor_animation_info = g_quark_from_static_string ("-clutter-actor-animation-info");
|
quark_actor_animation_info = g_quark_from_static_string ("-clutter-actor-animation-info");
|
||||||
@@ -7991,6 +7994,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
|||||||
* ClutterActor::queue-redraw:
|
* ClutterActor::queue-redraw:
|
||||||
* @actor: the actor we're bubbling the redraw request through
|
* @actor: the actor we're bubbling the redraw request through
|
||||||
* @origin: the actor which initiated the redraw request
|
* @origin: the actor which initiated the redraw request
|
||||||
|
* @volume: paint volume to redraw
|
||||||
*
|
*
|
||||||
* The ::queue_redraw signal is emitted when clutter_actor_queue_redraw()
|
* The ::queue_redraw signal is emitted when clutter_actor_queue_redraw()
|
||||||
* is called on @origin.
|
* is called on @origin.
|
||||||
@@ -8044,10 +8048,12 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
|||||||
G_SIGNAL_RUN_LAST |
|
G_SIGNAL_RUN_LAST |
|
||||||
G_SIGNAL_NO_HOOKS,
|
G_SIGNAL_NO_HOOKS,
|
||||||
G_STRUCT_OFFSET (ClutterActorClass, queue_redraw),
|
G_STRUCT_OFFSET (ClutterActorClass, queue_redraw),
|
||||||
NULL, NULL,
|
g_signal_accumulator_true_handled,
|
||||||
_clutter_marshal_VOID__OBJECT,
|
NULL,
|
||||||
G_TYPE_NONE, 1,
|
_clutter_marshal_BOOLEAN__OBJECT_BOXED,
|
||||||
CLUTTER_TYPE_ACTOR);
|
G_TYPE_BOOLEAN, 2,
|
||||||
|
CLUTTER_TYPE_ACTOR,
|
||||||
|
CLUTTER_TYPE_PAINT_VOLUME);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterActor::queue-relayout:
|
* ClutterActor::queue-relayout:
|
||||||
@@ -8646,8 +8652,7 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self,
|
|||||||
ClutterPaintVolume *clip)
|
ClutterPaintVolume *clip)
|
||||||
{
|
{
|
||||||
ClutterActorPrivate *priv = self->priv;
|
ClutterActorPrivate *priv = self->priv;
|
||||||
ClutterPaintVolume *pv;
|
ClutterPaintVolume *pv = NULL;
|
||||||
gboolean clipped;
|
|
||||||
|
|
||||||
/* Remove queue entry early in the process, otherwise a new
|
/* Remove queue entry early in the process, otherwise a new
|
||||||
queue_redraw() during signal handling could put back this
|
queue_redraw() during signal handling could put back this
|
||||||
@@ -8674,8 +8679,7 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self,
|
|||||||
*/
|
*/
|
||||||
if (clip)
|
if (clip)
|
||||||
{
|
{
|
||||||
_clutter_actor_set_queue_redraw_clip (self, clip);
|
pv = clip;
|
||||||
clipped = TRUE;
|
|
||||||
}
|
}
|
||||||
else if (G_LIKELY (priv->last_paint_volume_valid))
|
else if (G_LIKELY (priv->last_paint_volume_valid))
|
||||||
{
|
{
|
||||||
@@ -8685,36 +8689,12 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self,
|
|||||||
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
|
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
|
||||||
|
|
||||||
/* make sure we redraw the actors old position... */
|
/* make sure we redraw the actors old position... */
|
||||||
_clutter_actor_set_queue_redraw_clip (stage,
|
_clutter_actor_propagate_queue_redraw (stage, stage,
|
||||||
&priv->last_paint_volume);
|
&priv->last_paint_volume);
|
||||||
_clutter_actor_signal_queue_redraw (stage, stage);
|
|
||||||
_clutter_actor_set_queue_redraw_clip (stage, NULL);
|
|
||||||
|
|
||||||
/* XXX: Ideally the redraw signal would take a clip volume
|
|
||||||
* argument, but that would be an ABI break. Until we can
|
|
||||||
* break the ABI we pass the argument out-of-band
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* setup the clip for the actors new position... */
|
|
||||||
_clutter_actor_set_queue_redraw_clip (self, pv);
|
|
||||||
clipped = TRUE;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
clipped = FALSE;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
clipped = FALSE;
|
|
||||||
|
|
||||||
_clutter_actor_signal_queue_redraw (self, self);
|
_clutter_actor_propagate_queue_redraw (self, self, pv);
|
||||||
|
|
||||||
/* Just in case anyone is manually firing redraw signals without
|
|
||||||
* using the public queue_redraw() API we are careful to ensure that
|
|
||||||
* our out-of-band clip member is cleared before returning...
|
|
||||||
*
|
|
||||||
* Note: A NULL clip denotes a full-stage, un-clipped redraw
|
|
||||||
*/
|
|
||||||
if (G_LIKELY (clipped))
|
|
||||||
_clutter_actor_set_queue_redraw_clip (self, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -8744,15 +8724,14 @@ _clutter_actor_get_allocation_clip (ClutterActor *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_clutter_actor_queue_redraw_full (ClutterActor *self,
|
_clutter_actor_queue_redraw_full (ClutterActor *self,
|
||||||
ClutterRedrawFlags flags,
|
ClutterRedrawFlags flags,
|
||||||
ClutterPaintVolume *volume,
|
const ClutterPaintVolume *volume,
|
||||||
ClutterEffect *effect)
|
ClutterEffect *effect)
|
||||||
{
|
{
|
||||||
ClutterActorPrivate *priv = self->priv;
|
ClutterActorPrivate *priv = self->priv;
|
||||||
ClutterPaintVolume allocation_pv;
|
ClutterPaintVolume allocation_pv;
|
||||||
ClutterPaintVolume *pv;
|
ClutterPaintVolume *pv = NULL;
|
||||||
gboolean should_free_pv;
|
|
||||||
ClutterActor *stage;
|
ClutterActor *stage;
|
||||||
|
|
||||||
/* Here's an outline of the actor queue redraw mechanism:
|
/* Here's an outline of the actor queue redraw mechanism:
|
||||||
@@ -8875,8 +8854,7 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
|
|||||||
{
|
{
|
||||||
/* NB: NULL denotes an undefined clip which will result in a
|
/* NB: NULL denotes an undefined clip which will result in a
|
||||||
* full redraw... */
|
* full redraw... */
|
||||||
_clutter_actor_set_queue_redraw_clip (self, NULL);
|
_clutter_actor_propagate_queue_redraw (self, self, NULL);
|
||||||
_clutter_actor_signal_queue_redraw (self, self);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8894,21 +8872,15 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
|
|||||||
clutter_paint_volume_set_height (pv,
|
clutter_paint_volume_set_height (pv,
|
||||||
allocation_clip.y2 -
|
allocation_clip.y2 -
|
||||||
allocation_clip.y1);
|
allocation_clip.y1);
|
||||||
should_free_pv = TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pv = volume;
|
|
||||||
should_free_pv = FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self->priv->queue_redraw_entry =
|
self->priv->queue_redraw_entry =
|
||||||
_clutter_stage_queue_actor_redraw (CLUTTER_STAGE (stage),
|
_clutter_stage_queue_actor_redraw (CLUTTER_STAGE (stage),
|
||||||
priv->queue_redraw_entry,
|
priv->queue_redraw_entry,
|
||||||
self,
|
self,
|
||||||
pv);
|
pv ? pv : volume);
|
||||||
|
|
||||||
if (should_free_pv)
|
if (pv)
|
||||||
clutter_paint_volume_free (pv);
|
clutter_paint_volume_free (pv);
|
||||||
|
|
||||||
/* If this is the first redraw queued then we can directly use the
|
/* If this is the first redraw queued then we can directly use the
|
||||||
@@ -9022,9 +8994,9 @@ clutter_actor_queue_redraw (ClutterActor *self)
|
|||||||
* picking of your actor.
|
* picking of your actor.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
_clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||||
ClutterRedrawFlags flags,
|
ClutterRedrawFlags flags,
|
||||||
ClutterPaintVolume *volume)
|
const ClutterPaintVolume *volume)
|
||||||
{
|
{
|
||||||
_clutter_actor_queue_redraw_full (self,
|
_clutter_actor_queue_redraw_full (self,
|
||||||
flags, /* flags */
|
flags, /* flags */
|
||||||
@@ -10301,9 +10273,10 @@ clutter_actor_set_position (ClutterActor *self,
|
|||||||
cur_position.x = clutter_actor_get_x (self);
|
cur_position.x = clutter_actor_get_x (self);
|
||||||
cur_position.y = clutter_actor_get_y (self);
|
cur_position.y = clutter_actor_get_y (self);
|
||||||
|
|
||||||
_clutter_actor_create_transition (self, obj_props[PROP_POSITION],
|
if (!clutter_point_equals (&cur_position, &new_position))
|
||||||
&cur_position,
|
_clutter_actor_create_transition (self, obj_props[PROP_POSITION],
|
||||||
&new_position);
|
&cur_position,
|
||||||
|
&new_position);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13662,7 +13635,7 @@ clutter_actor_set_child_above_sibling (ClutterActor *self,
|
|||||||
sibling);
|
sibling);
|
||||||
g_object_unref(child);
|
g_object_unref(child);
|
||||||
|
|
||||||
clutter_actor_queue_relayout (self);
|
clutter_actor_queue_redraw_on_parent (child);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13709,7 +13682,7 @@ clutter_actor_set_child_below_sibling (ClutterActor *self,
|
|||||||
sibling);
|
sibling);
|
||||||
g_object_unref(child);
|
g_object_unref(child);
|
||||||
|
|
||||||
clutter_actor_queue_relayout (self);
|
clutter_actor_queue_redraw_on_parent (child);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15146,7 +15119,7 @@ clutter_actor_set_final_state (ClutterAnimatable *animatable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_animatable_iface_init (ClutterAnimatableIface *iface)
|
clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
|
||||||
{
|
{
|
||||||
iface->find_property = clutter_actor_find_property;
|
iface->find_property = clutter_actor_find_property;
|
||||||
iface->get_initial_state = clutter_actor_get_initial_state;
|
iface->get_initial_state = clutter_actor_get_initial_state;
|
||||||
@@ -16474,6 +16447,12 @@ clutter_actor_is_in_clone_paint (ClutterActor *self)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
clutter_actor_has_damage (ClutterActor *actor)
|
||||||
|
{
|
||||||
|
return actor->priv->is_dirty;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
set_direction_recursive (ClutterActor *actor,
|
set_direction_recursive (ClutterActor *actor,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
@@ -16691,26 +16670,6 @@ clutter_actor_has_pointer (ClutterActor *self)
|
|||||||
return self->priv->has_pointer;
|
return self->priv->has_pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX: This is a workaround for not being able to break the ABI of
|
|
||||||
* the QUEUE_REDRAW signal. It is an out-of-band argument. See
|
|
||||||
* clutter_actor_queue_clipped_redraw() for details.
|
|
||||||
*/
|
|
||||||
ClutterPaintVolume *
|
|
||||||
_clutter_actor_get_queue_redraw_clip (ClutterActor *self)
|
|
||||||
{
|
|
||||||
return g_object_get_data (G_OBJECT (self),
|
|
||||||
"-clutter-actor-queue-redraw-clip");
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
_clutter_actor_set_queue_redraw_clip (ClutterActor *self,
|
|
||||||
ClutterPaintVolume *clip)
|
|
||||||
{
|
|
||||||
g_object_set_data (G_OBJECT (self),
|
|
||||||
"-clutter-actor-queue-redraw-clip",
|
|
||||||
clip);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_actor_has_allocation:
|
* clutter_actor_has_allocation:
|
||||||
* @self: a #ClutterActor
|
* @self: a #ClutterActor
|
||||||
@@ -18454,6 +18413,10 @@ clutter_actor_set_margin_top (ClutterActor *self,
|
|||||||
g_return_if_fail (margin >= 0.f);
|
g_return_if_fail (margin >= 0.f);
|
||||||
|
|
||||||
info = _clutter_actor_get_layout_info_or_defaults (self);
|
info = _clutter_actor_get_layout_info_or_defaults (self);
|
||||||
|
|
||||||
|
if (info->margin.top == margin)
|
||||||
|
return;
|
||||||
|
|
||||||
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_TOP],
|
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_TOP],
|
||||||
info->margin.top,
|
info->margin.top,
|
||||||
margin);
|
margin);
|
||||||
@@ -18498,6 +18461,10 @@ clutter_actor_set_margin_bottom (ClutterActor *self,
|
|||||||
g_return_if_fail (margin >= 0.f);
|
g_return_if_fail (margin >= 0.f);
|
||||||
|
|
||||||
info = _clutter_actor_get_layout_info_or_defaults (self);
|
info = _clutter_actor_get_layout_info_or_defaults (self);
|
||||||
|
|
||||||
|
if (info->margin.bottom == margin)
|
||||||
|
return;
|
||||||
|
|
||||||
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_BOTTOM],
|
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_BOTTOM],
|
||||||
info->margin.bottom,
|
info->margin.bottom,
|
||||||
margin);
|
margin);
|
||||||
@@ -18542,6 +18509,10 @@ clutter_actor_set_margin_left (ClutterActor *self,
|
|||||||
g_return_if_fail (margin >= 0.f);
|
g_return_if_fail (margin >= 0.f);
|
||||||
|
|
||||||
info = _clutter_actor_get_layout_info_or_defaults (self);
|
info = _clutter_actor_get_layout_info_or_defaults (self);
|
||||||
|
|
||||||
|
if (info->margin.left == margin)
|
||||||
|
return;
|
||||||
|
|
||||||
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_LEFT],
|
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_LEFT],
|
||||||
info->margin.left,
|
info->margin.left,
|
||||||
margin);
|
margin);
|
||||||
@@ -18586,6 +18557,10 @@ clutter_actor_set_margin_right (ClutterActor *self,
|
|||||||
g_return_if_fail (margin >= 0.f);
|
g_return_if_fail (margin >= 0.f);
|
||||||
|
|
||||||
info = _clutter_actor_get_layout_info_or_defaults (self);
|
info = _clutter_actor_get_layout_info_or_defaults (self);
|
||||||
|
|
||||||
|
if (info->margin.right == margin)
|
||||||
|
return;
|
||||||
|
|
||||||
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_RIGHT],
|
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_RIGHT],
|
||||||
info->margin.right,
|
info->margin.right,
|
||||||
margin);
|
margin);
|
||||||
|
@@ -236,8 +236,9 @@ struct _ClutterActorClass
|
|||||||
void (* pick) (ClutterActor *actor,
|
void (* pick) (ClutterActor *actor,
|
||||||
const ClutterColor *color);
|
const ClutterColor *color);
|
||||||
|
|
||||||
void (* queue_redraw) (ClutterActor *actor,
|
gboolean (* queue_redraw) (ClutterActor *actor,
|
||||||
ClutterActor *leaf_that_queued);
|
ClutterActor *leaf_that_queued,
|
||||||
|
ClutterPaintVolume *paint_volume);
|
||||||
|
|
||||||
/* size negotiation */
|
/* size negotiation */
|
||||||
void (* get_preferred_width) (ClutterActor *self,
|
void (* get_preferred_width) (ClutterActor *self,
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
* to control how a #ClutterAnimation will animate a property.
|
* to control how a #ClutterAnimation will animate a property.
|
||||||
*
|
*
|
||||||
* Each #ClutterAnimatable should implement the
|
* Each #ClutterAnimatable should implement the
|
||||||
* #ClutterAnimatableIface.interpolate_property() virtual function of the
|
* #ClutterAnimatableInterface.interpolate_property() virtual function of the
|
||||||
* interface to compute the animation state between two values of an interval
|
* interface to compute the animation state between two values of an interval
|
||||||
* depending on a progress factor, expressed as a floating point value.
|
* depending on a progress factor, expressed as a floating point value.
|
||||||
*
|
*
|
||||||
@@ -57,7 +57,6 @@
|
|||||||
#include "deprecated/clutter-animatable.h"
|
#include "deprecated/clutter-animatable.h"
|
||||||
#include "deprecated/clutter-animation.h"
|
#include "deprecated/clutter-animation.h"
|
||||||
|
|
||||||
typedef ClutterAnimatableIface ClutterAnimatableInterface;
|
|
||||||
G_DEFINE_INTERFACE (ClutterAnimatable, clutter_animatable, G_TYPE_OBJECT);
|
G_DEFINE_INTERFACE (ClutterAnimatable, clutter_animatable, G_TYPE_OBJECT);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -101,7 +100,7 @@ clutter_animatable_animate_property (ClutterAnimatable *animatable,
|
|||||||
gdouble progress,
|
gdouble progress,
|
||||||
GValue *value)
|
GValue *value)
|
||||||
{
|
{
|
||||||
ClutterAnimatableIface *iface;
|
ClutterAnimatableInterface *iface;
|
||||||
gboolean res;
|
gboolean res;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE);
|
||||||
@@ -155,7 +154,7 @@ GParamSpec *
|
|||||||
clutter_animatable_find_property (ClutterAnimatable *animatable,
|
clutter_animatable_find_property (ClutterAnimatable *animatable,
|
||||||
const gchar *property_name)
|
const gchar *property_name)
|
||||||
{
|
{
|
||||||
ClutterAnimatableIface *iface;
|
ClutterAnimatableInterface *iface;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), NULL);
|
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), NULL);
|
||||||
g_return_val_if_fail (property_name != NULL, NULL);
|
g_return_val_if_fail (property_name != NULL, NULL);
|
||||||
@@ -185,7 +184,7 @@ clutter_animatable_get_initial_state (ClutterAnimatable *animatable,
|
|||||||
const gchar *property_name,
|
const gchar *property_name,
|
||||||
GValue *value)
|
GValue *value)
|
||||||
{
|
{
|
||||||
ClutterAnimatableIface *iface;
|
ClutterAnimatableInterface *iface;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ANIMATABLE (animatable));
|
g_return_if_fail (CLUTTER_IS_ANIMATABLE (animatable));
|
||||||
g_return_if_fail (property_name != NULL);
|
g_return_if_fail (property_name != NULL);
|
||||||
@@ -214,7 +213,7 @@ clutter_animatable_set_final_state (ClutterAnimatable *animatable,
|
|||||||
const gchar *property_name,
|
const gchar *property_name,
|
||||||
const GValue *value)
|
const GValue *value)
|
||||||
{
|
{
|
||||||
ClutterAnimatableIface *iface;
|
ClutterAnimatableInterface *iface;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ANIMATABLE (animatable));
|
g_return_if_fail (CLUTTER_IS_ANIMATABLE (animatable));
|
||||||
g_return_if_fail (property_name != NULL);
|
g_return_if_fail (property_name != NULL);
|
||||||
@@ -260,7 +259,7 @@ clutter_animatable_interpolate_value (ClutterAnimatable *animatable,
|
|||||||
gdouble progress,
|
gdouble progress,
|
||||||
GValue *value)
|
GValue *value)
|
||||||
{
|
{
|
||||||
ClutterAnimatableIface *iface;
|
ClutterAnimatableInterface *iface;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE);
|
||||||
g_return_val_if_fail (property_name != NULL, FALSE);
|
g_return_val_if_fail (property_name != NULL, FALSE);
|
||||||
|
@@ -33,24 +33,15 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define CLUTTER_TYPE_ANIMATABLE (clutter_animatable_get_type ())
|
#define CLUTTER_TYPE_ANIMATABLE (clutter_animatable_get_type ())
|
||||||
#define CLUTTER_ANIMATABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ANIMATABLE, ClutterAnimatable))
|
|
||||||
#define CLUTTER_IS_ANIMATABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ANIMATABLE))
|
|
||||||
#define CLUTTER_ANIMATABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_ANIMATABLE, ClutterAnimatableIface))
|
|
||||||
|
|
||||||
typedef struct _ClutterAnimatableIface ClutterAnimatableIface;
|
CLUTTER_EXPORT
|
||||||
|
G_DECLARE_INTERFACE (ClutterAnimatable, clutter_animatable,
|
||||||
|
CLUTTER, ANIMATABLE,
|
||||||
|
GObject)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterAnimatable:
|
* ClutterAnimatableInterface:
|
||||||
*
|
|
||||||
* #ClutterAnimatable is an opaque structure whose members cannot be directly
|
|
||||||
* accessed
|
|
||||||
*
|
|
||||||
* Since: 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterAnimatableIface:
|
|
||||||
* @animate_property: virtual function for custom interpolation of a
|
* @animate_property: virtual function for custom interpolation of a
|
||||||
* property. This virtual function is deprecated
|
* property. This virtual function is deprecated
|
||||||
* @find_property: virtual function for retrieving the #GParamSpec of
|
* @find_property: virtual function for retrieving the #GParamSpec of
|
||||||
@@ -67,7 +58,7 @@ typedef struct _ClutterAnimatableIface ClutterAnimatableIface;
|
|||||||
*
|
*
|
||||||
* Since: 1.0
|
* Since: 1.0
|
||||||
*/
|
*/
|
||||||
struct _ClutterAnimatableIface
|
struct _ClutterAnimatableInterface
|
||||||
{
|
{
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
GTypeInterface parent_iface;
|
GTypeInterface parent_iface;
|
||||||
@@ -95,9 +86,6 @@ struct _ClutterAnimatableIface
|
|||||||
GValue *value);
|
GValue *value);
|
||||||
};
|
};
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
GType clutter_animatable_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
GParamSpec *clutter_animatable_find_property (ClutterAnimatable *animatable,
|
GParamSpec *clutter_animatable_find_property (ClutterAnimatable *animatable,
|
||||||
const gchar *property_name);
|
const gchar *property_name);
|
||||||
|
@@ -34,7 +34,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAction, g_object_unref)
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActor, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActor, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActorMeta, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActorMeta, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAlignConstraint, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAlignConstraint, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAnimatable, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBackend, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBackend, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBindConstraint, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBindConstraint, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBindingPool, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBindingPool, g_object_unref)
|
||||||
@@ -49,7 +48,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterClone, g_object_unref)
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterColorizeEffect, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterColorizeEffect, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterConstraint, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterConstraint, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterContainer, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterContainer, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterContent, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeformEffect, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeformEffect, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDesaturateEffect, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDesaturateEffect, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeviceManager, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeviceManager, g_object_unref)
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include <clutter/clutter-backend.h>
|
#include <clutter/clutter-backend.h>
|
||||||
#include <clutter/clutter-device-manager.h>
|
#include <clutter/clutter-device-manager.h>
|
||||||
|
#include <clutter/clutter-keymap.h>
|
||||||
#include <clutter/clutter-stage-window.h>
|
#include <clutter/clutter-stage-window.h>
|
||||||
|
|
||||||
#include "clutter-event-translator.h"
|
#include "clutter-event-translator.h"
|
||||||
@@ -60,6 +61,8 @@ struct _ClutterBackend
|
|||||||
GList *event_translators;
|
GList *event_translators;
|
||||||
|
|
||||||
ClutterInputMethod *input_method;
|
ClutterInputMethod *input_method;
|
||||||
|
|
||||||
|
ClutterKeymap *keymap;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _ClutterBackendClass
|
struct _ClutterBackendClass
|
||||||
@@ -104,6 +107,8 @@ struct _ClutterBackendClass
|
|||||||
|
|
||||||
void (* bell_notify) (ClutterBackend *backend);
|
void (* bell_notify) (ClutterBackend *backend);
|
||||||
|
|
||||||
|
ClutterKeymap * (* get_keymap) (ClutterBackend *backend);
|
||||||
|
|
||||||
/* signals */
|
/* signals */
|
||||||
void (* resolution_changed) (ClutterBackend *backend);
|
void (* resolution_changed) (ClutterBackend *backend);
|
||||||
void (* font_changed) (ClutterBackend *backend);
|
void (* font_changed) (ClutterBackend *backend);
|
||||||
|
@@ -53,9 +53,6 @@
|
|||||||
#include "clutter-stage-window.h"
|
#include "clutter-stage-window.h"
|
||||||
#include "clutter-device-manager-private.h"
|
#include "clutter-device-manager-private.h"
|
||||||
|
|
||||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
|
||||||
#include "deprecated/clutter-backend.h"
|
|
||||||
|
|
||||||
#ifdef CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT
|
#ifdef CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT
|
||||||
#include "wayland/clutter-wayland-compositor.h"
|
#include "wayland/clutter-wayland-compositor.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -430,7 +427,7 @@ clutter_backend_real_get_features (ClutterBackend *backend)
|
|||||||
if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_THROTTLE))
|
if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_THROTTLE))
|
||||||
{
|
{
|
||||||
CLUTTER_NOTE (BACKEND, "Cogl supports swap buffers throttling");
|
CLUTTER_NOTE (BACKEND, "Cogl supports swap buffers throttling");
|
||||||
flags |= CLUTTER_FEATURE_SYNC_TO_VBLANK;
|
flags |= CLUTTER_FEATURE_SWAP_THROTTLE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CLUTTER_NOTE (BACKEND, "Cogl doesn't support swap buffers throttling");
|
CLUTTER_NOTE (BACKEND, "Cogl doesn't support swap buffers throttling");
|
||||||
@@ -577,6 +574,18 @@ clutter_backend_real_get_device_manager (ClutterBackend *backend)
|
|||||||
return backend->device_manager;
|
return backend->device_manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ClutterKeymap *
|
||||||
|
clutter_backend_real_get_keymap (ClutterBackend *backend)
|
||||||
|
{
|
||||||
|
if (G_UNLIKELY (backend->keymap == NULL))
|
||||||
|
{
|
||||||
|
g_critical ("No keymap available, expect broken keyboard input");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return backend->keymap;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
clutter_backend_real_translate_event (ClutterBackend *backend,
|
clutter_backend_real_translate_event (ClutterBackend *backend,
|
||||||
gpointer native,
|
gpointer native,
|
||||||
@@ -675,6 +684,7 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
|||||||
klass->translate_event = clutter_backend_real_translate_event;
|
klass->translate_event = clutter_backend_real_translate_event;
|
||||||
klass->create_context = clutter_backend_real_create_context;
|
klass->create_context = clutter_backend_real_create_context;
|
||||||
klass->get_features = clutter_backend_real_get_features;
|
klass->get_features = clutter_backend_real_get_features;
|
||||||
|
klass->get_keymap = clutter_backend_real_get_keymap;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -890,129 +900,6 @@ clutter_get_default_backend (void)
|
|||||||
return clutter_context->backend;
|
return clutter_context->backend;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_backend_set_double_click_time:
|
|
||||||
* @backend: a #ClutterBackend
|
|
||||||
* @msec: milliseconds between two button press events
|
|
||||||
*
|
|
||||||
* Sets the maximum time between two button press events, used to
|
|
||||||
* verify whether it's a double click event or not.
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.4: Use #ClutterSettings:double-click-time instead
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_backend_set_double_click_time (ClutterBackend *backend,
|
|
||||||
guint msec)
|
|
||||||
{
|
|
||||||
ClutterSettings *settings = clutter_settings_get_default ();
|
|
||||||
|
|
||||||
g_object_set (settings, "double-click-time", msec, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_backend_get_double_click_time:
|
|
||||||
* @backend: a #ClutterBackend
|
|
||||||
*
|
|
||||||
* Gets the maximum time between two button press events, as set
|
|
||||||
* by clutter_backend_set_double_click_time().
|
|
||||||
*
|
|
||||||
* Return value: a time in milliseconds
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.4: Use #ClutterSettings:double-click-time instead
|
|
||||||
*/
|
|
||||||
guint
|
|
||||||
clutter_backend_get_double_click_time (ClutterBackend *backend)
|
|
||||||
{
|
|
||||||
ClutterSettings *settings = clutter_settings_get_default ();
|
|
||||||
gint retval;
|
|
||||||
|
|
||||||
g_object_get (settings, "double-click-time", &retval, NULL);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_backend_set_double_click_distance:
|
|
||||||
* @backend: a #ClutterBackend
|
|
||||||
* @distance: a distance, in pixels
|
|
||||||
*
|
|
||||||
* Sets the maximum distance used to verify a double click event.
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.4: Use #ClutterSettings:double-click-distance instead
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_backend_set_double_click_distance (ClutterBackend *backend,
|
|
||||||
guint distance)
|
|
||||||
{
|
|
||||||
ClutterSettings *settings = clutter_settings_get_default ();
|
|
||||||
|
|
||||||
g_object_set (settings, "double-click-distance", distance, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_backend_get_double_click_distance:
|
|
||||||
* @backend: a #ClutterBackend
|
|
||||||
*
|
|
||||||
* Retrieves the distance used to verify a double click event
|
|
||||||
*
|
|
||||||
* Return value: a distance, in pixels.
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.4: Use #ClutterSettings:double-click-distance instead
|
|
||||||
*/
|
|
||||||
guint
|
|
||||||
clutter_backend_get_double_click_distance (ClutterBackend *backend)
|
|
||||||
{
|
|
||||||
ClutterSettings *settings = clutter_settings_get_default ();
|
|
||||||
gint retval;
|
|
||||||
|
|
||||||
g_object_get (settings, "double-click-distance", &retval, NULL);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_backend_set_resolution:
|
|
||||||
* @backend: a #ClutterBackend
|
|
||||||
* @dpi: the resolution in "dots per inch" (Physical inches aren't
|
|
||||||
* actually involved; the terminology is conventional).
|
|
||||||
*
|
|
||||||
* Sets the resolution for font handling on the screen. This is a
|
|
||||||
* scale factor between points specified in a #PangoFontDescription
|
|
||||||
* and cairo units. The default value is 96, meaning that a 10 point
|
|
||||||
* font will be 13 units high. (10 * 96. / 72. = 13.3).
|
|
||||||
*
|
|
||||||
* Applications should never need to call this function.
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.4: Use #ClutterSettings:font-dpi instead
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_backend_set_resolution (ClutterBackend *backend,
|
|
||||||
gdouble dpi)
|
|
||||||
{
|
|
||||||
ClutterSettings *settings;
|
|
||||||
gint resolution;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_BACKEND (backend));
|
|
||||||
|
|
||||||
if (dpi < 0)
|
|
||||||
resolution = -1;
|
|
||||||
else
|
|
||||||
resolution = dpi * 1024;
|
|
||||||
|
|
||||||
settings = clutter_settings_get_default ();
|
|
||||||
g_object_set (settings, "font-dpi", resolution, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_backend_get_resolution:
|
* clutter_backend_get_resolution:
|
||||||
* @backend: a #ClutterBackend
|
* @backend: a #ClutterBackend
|
||||||
@@ -1118,61 +1005,6 @@ clutter_backend_get_font_options (ClutterBackend *backend)
|
|||||||
return backend->font_options;
|
return backend->font_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_backend_set_font_name:
|
|
||||||
* @backend: a #ClutterBackend
|
|
||||||
* @font_name: the name of the font
|
|
||||||
*
|
|
||||||
* Sets the default font to be used by Clutter. The @font_name string
|
|
||||||
* must either be %NULL, which means that the font name from the
|
|
||||||
* default #ClutterBackend will be used; or be something that can
|
|
||||||
* be parsed by the pango_font_description_from_string() function.
|
|
||||||
*
|
|
||||||
* Since: 1.0
|
|
||||||
*
|
|
||||||
* Deprecated: 1.4: Use #ClutterSettings:font-name instead
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_backend_set_font_name (ClutterBackend *backend,
|
|
||||||
const gchar *font_name)
|
|
||||||
{
|
|
||||||
ClutterSettings *settings = clutter_settings_get_default ();
|
|
||||||
|
|
||||||
g_object_set (settings, "font-name", font_name, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_backend_get_font_name:
|
|
||||||
* @backend: a #ClutterBackend
|
|
||||||
*
|
|
||||||
* Retrieves the default font name as set by
|
|
||||||
* clutter_backend_set_font_name().
|
|
||||||
*
|
|
||||||
* Return value: the font name for the backend. The returned string is
|
|
||||||
* owned by the #ClutterBackend and should never be modified or freed
|
|
||||||
*
|
|
||||||
* Since: 1.0
|
|
||||||
*
|
|
||||||
* Deprecated: 1.4: Use #ClutterSettings:font-name instead
|
|
||||||
*/
|
|
||||||
const gchar *
|
|
||||||
clutter_backend_get_font_name (ClutterBackend *backend)
|
|
||||||
{
|
|
||||||
ClutterSettings *settings;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_BACKEND (backend), NULL);
|
|
||||||
|
|
||||||
settings = clutter_settings_get_default ();
|
|
||||||
|
|
||||||
/* XXX yuck. but we return a const pointer, so we need to
|
|
||||||
* store it in the backend
|
|
||||||
*/
|
|
||||||
g_free (backend->font_name);
|
|
||||||
g_object_get (settings, "font-name", &backend->font_name, NULL);
|
|
||||||
|
|
||||||
return backend->font_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
gint32
|
gint32
|
||||||
_clutter_backend_get_units_serial (ClutterBackend *backend)
|
_clutter_backend_get_units_serial (ClutterBackend *backend)
|
||||||
{
|
{
|
||||||
@@ -1399,3 +1231,17 @@ clutter_backend_set_input_method (ClutterBackend *backend,
|
|||||||
{
|
{
|
||||||
g_set_object (&backend->input_method, method);
|
g_set_object (&backend->input_method, method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_backend_get_keymap:
|
||||||
|
* @backend: the #ClutterBackend
|
||||||
|
*
|
||||||
|
* Gets the keymap used by Clutter
|
||||||
|
*
|
||||||
|
* Returns: (transfer none): the keymap
|
||||||
|
**/
|
||||||
|
ClutterKeymap *
|
||||||
|
clutter_backend_get_keymap (ClutterBackend *backend)
|
||||||
|
{
|
||||||
|
return CLUTTER_BACKEND_GET_CLASS (backend)->get_keymap (backend);
|
||||||
|
}
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
#include <cogl/cogl.h>
|
#include <cogl/cogl.h>
|
||||||
|
|
||||||
#include <clutter/clutter-config.h>
|
#include <clutter/clutter-config.h>
|
||||||
|
#include <clutter/clutter-keymap.h>
|
||||||
#include <clutter/clutter-types.h>
|
#include <clutter/clutter-types.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
@@ -83,6 +84,9 @@ ClutterInputMethod * clutter_backend_get_input_method (Clutter
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_backend_set_input_method (ClutterBackend *backend,
|
void clutter_backend_set_input_method (ClutterBackend *backend,
|
||||||
ClutterInputMethod *method);
|
ClutterInputMethod *method);
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
ClutterKeymap * clutter_backend_get_keymap (ClutterBackend *backend);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_BACKEND_H__ */
|
#endif /* __CLUTTER_BACKEND_H__ */
|
||||||
|
@@ -36,7 +36,7 @@ G_BEGIN_DECLS
|
|||||||
|
|
||||||
typedef struct _ClutterBezier ClutterBezier;
|
typedef struct _ClutterBezier ClutterBezier;
|
||||||
|
|
||||||
ClutterBezier *_clutter_bezier_new ();
|
ClutterBezier *_clutter_bezier_new (void);
|
||||||
|
|
||||||
void _clutter_bezier_free (ClutterBezier * b);
|
void _clutter_bezier_free (ClutterBezier * b);
|
||||||
|
|
||||||
|
@@ -150,9 +150,9 @@ typedef struct _RequestedSize
|
|||||||
gfloat natural_size;
|
gfloat natural_size;
|
||||||
} RequestedSize;
|
} RequestedSize;
|
||||||
|
|
||||||
static gint distribute_natural_allocation (gint extra_space,
|
static float distribute_natural_allocation (float extra_space,
|
||||||
guint n_requested_sizes,
|
unsigned int n_requested_sizes,
|
||||||
RequestedSize *sizes);
|
RequestedSize *sizes);
|
||||||
static void count_expand_children (ClutterLayoutManager *layout,
|
static void count_expand_children (ClutterLayoutManager *layout,
|
||||||
ClutterContainer *container,
|
ClutterContainer *container,
|
||||||
gint *visible_children,
|
gint *visible_children,
|
||||||
@@ -624,7 +624,19 @@ get_preferred_size_for_opposite_orientation (ClutterBoxLayout *self,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Bring children up to size first */
|
/* Bring children up to size first */
|
||||||
size = distribute_natural_allocation (MAX (0, size), nvis_children, sizes);
|
if (isnormal (size) || size == 0)
|
||||||
|
{
|
||||||
|
size = distribute_natural_allocation (MAX (0, size),
|
||||||
|
nvis_children,
|
||||||
|
sizes);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_critical ("Actor %s (%p) received the invalid "
|
||||||
|
"value %f as minimum/natural size\n",
|
||||||
|
G_OBJECT_TYPE_NAME (container), container, size);
|
||||||
|
size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Calculate space which hasn't distributed yet,
|
/* Calculate space which hasn't distributed yet,
|
||||||
* and is available for expanding children.
|
* and is available for expanding children.
|
||||||
@@ -879,17 +891,18 @@ compare_gap (gconstpointer p1,
|
|||||||
*
|
*
|
||||||
* Pulled from gtksizerequest.c from Gtk+
|
* Pulled from gtksizerequest.c from Gtk+
|
||||||
*/
|
*/
|
||||||
static gint
|
static float
|
||||||
distribute_natural_allocation (gint extra_space,
|
distribute_natural_allocation (float extra_space,
|
||||||
guint n_requested_sizes,
|
unsigned int n_requested_sizes,
|
||||||
RequestedSize *sizes)
|
RequestedSize *sizes)
|
||||||
{
|
{
|
||||||
guint *spreading;
|
unsigned int *spreading;
|
||||||
gint i;
|
int i;
|
||||||
|
|
||||||
|
g_return_val_if_fail (isnormal (extra_space) || extra_space == 0, 0);
|
||||||
g_return_val_if_fail (extra_space >= 0, 0);
|
g_return_val_if_fail (extra_space >= 0, 0);
|
||||||
|
|
||||||
spreading = g_newa (guint, n_requested_sizes);
|
spreading = g_newa (unsigned int, n_requested_sizes);
|
||||||
|
|
||||||
for (i = 0; i < n_requested_sizes; i++)
|
for (i = 0; i < n_requested_sizes; i++)
|
||||||
spreading[i] = i;
|
spreading[i] = i;
|
||||||
@@ -913,7 +926,7 @@ distribute_natural_allocation (gint extra_space,
|
|||||||
|
|
||||||
/* Sort descending by gap and position. */
|
/* Sort descending by gap and position. */
|
||||||
g_qsort_with_data (spreading,
|
g_qsort_with_data (spreading,
|
||||||
n_requested_sizes, sizeof (guint),
|
n_requested_sizes, sizeof (unsigned int),
|
||||||
compare_gap, sizes);
|
compare_gap, sizes);
|
||||||
|
|
||||||
/* Distribute available space.
|
/* Distribute available space.
|
||||||
@@ -925,11 +938,11 @@ distribute_natural_allocation (gint extra_space,
|
|||||||
* Sort order and reducing remaining space by assigned space
|
* Sort order and reducing remaining space by assigned space
|
||||||
* ensures that space is distributed equally.
|
* ensures that space is distributed equally.
|
||||||
*/
|
*/
|
||||||
gint glue = (extra_space + i) / (i + 1);
|
int glue = (extra_space + i) / (i + 1);
|
||||||
gint gap = sizes[(spreading[i])].natural_size
|
int gap = sizes[(spreading[i])].natural_size
|
||||||
- sizes[(spreading[i])].minimum_size;
|
- sizes[(spreading[i])].minimum_size;
|
||||||
|
|
||||||
gint extra = MIN (glue, gap);
|
int extra = MIN (glue, gap);
|
||||||
|
|
||||||
sizes[spreading[i]].minimum_size += extra;
|
sizes[spreading[i]].minimum_size += extra;
|
||||||
|
|
||||||
@@ -1056,7 +1069,9 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Bring children up to size first */
|
/* Bring children up to size first */
|
||||||
size = distribute_natural_allocation (MAX (0, size), nvis_children, sizes);
|
size = (gint) distribute_natural_allocation (MAX (0, (float) size),
|
||||||
|
nvis_children,
|
||||||
|
sizes);
|
||||||
|
|
||||||
/* Calculate space which hasn't distributed yet,
|
/* Calculate space which hasn't distributed yet,
|
||||||
* and is available for expanding children.
|
* and is available for expanding children.
|
||||||
|
@@ -97,7 +97,7 @@ enum
|
|||||||
|
|
||||||
static guint canvas_signals[LAST_SIGNAL] = { 0, };
|
static guint canvas_signals[LAST_SIGNAL] = { 0, };
|
||||||
|
|
||||||
static void clutter_content_iface_init (ClutterContentIface *iface);
|
static void clutter_content_iface_init (ClutterContentInterface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (ClutterCanvas, clutter_canvas, G_TYPE_OBJECT,
|
G_DEFINE_TYPE_WITH_CODE (ClutterCanvas, clutter_canvas, G_TYPE_OBJECT,
|
||||||
G_ADD_PRIVATE (ClutterCanvas)
|
G_ADD_PRIVATE (ClutterCanvas)
|
||||||
@@ -457,7 +457,7 @@ clutter_canvas_get_preferred_size (ClutterContent *content,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_content_iface_init (ClutterContentIface *iface)
|
clutter_content_iface_init (ClutterContentInterface *iface)
|
||||||
{
|
{
|
||||||
iface->invalidate = clutter_canvas_invalidate;
|
iface->invalidate = clutter_canvas_invalidate;
|
||||||
iface->paint_content = clutter_canvas_paint_content;
|
iface->paint_content = clutter_canvas_paint_content;
|
||||||
|
@@ -38,14 +38,13 @@
|
|||||||
|
|
||||||
#include "clutter-build-config.h"
|
#include "clutter-build-config.h"
|
||||||
|
|
||||||
|
#include "clutter-actor-private.h"
|
||||||
#include "clutter-content-private.h"
|
#include "clutter-content-private.h"
|
||||||
|
|
||||||
#include "clutter-debug.h"
|
#include "clutter-debug.h"
|
||||||
#include "clutter-marshal.h"
|
#include "clutter-marshal.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
|
|
||||||
typedef struct _ClutterContentIface ClutterContentInterface;
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ATTACHED,
|
ATTACHED,
|
||||||
@@ -91,6 +90,11 @@ clutter_content_real_invalidate (ClutterContent *content)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_content_real_invalidate_size (ClutterContent *content)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_content_real_paint_content (ClutterContent *content,
|
clutter_content_real_paint_content (ClutterContent *content,
|
||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
@@ -108,6 +112,7 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
|||||||
iface->attached = clutter_content_real_attached;
|
iface->attached = clutter_content_real_attached;
|
||||||
iface->detached = clutter_content_real_detached;
|
iface->detached = clutter_content_real_detached;
|
||||||
iface->invalidate = clutter_content_real_invalidate;
|
iface->invalidate = clutter_content_real_invalidate;
|
||||||
|
iface->invalidate_size = clutter_content_real_invalidate_size;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterContent::attached:
|
* ClutterContent::attached:
|
||||||
@@ -123,7 +128,7 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
|||||||
g_signal_new (I_("attached"),
|
g_signal_new (I_("attached"),
|
||||||
G_TYPE_FROM_INTERFACE (iface),
|
G_TYPE_FROM_INTERFACE (iface),
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (ClutterContentIface, attached),
|
G_STRUCT_OFFSET (ClutterContentInterface, attached),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
_clutter_marshal_VOID__OBJECT,
|
_clutter_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
@@ -143,7 +148,7 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
|||||||
g_signal_new (I_("detached"),
|
g_signal_new (I_("detached"),
|
||||||
G_TYPE_FROM_INTERFACE (iface),
|
G_TYPE_FROM_INTERFACE (iface),
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (ClutterContentIface, detached),
|
G_STRUCT_OFFSET (ClutterContentInterface, detached),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
_clutter_marshal_VOID__OBJECT,
|
_clutter_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
@@ -188,6 +193,45 @@ clutter_content_invalidate (ClutterContent *content)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_content_invalidate_size:
|
||||||
|
* @content: a #ClutterContent
|
||||||
|
*
|
||||||
|
* Signals that @content's size changed. Attached actors with request mode
|
||||||
|
* set to %CLUTTER_REQUEST_CONTENT_SIZE will have a relayout queued.
|
||||||
|
*
|
||||||
|
* Attached actors with other request modes are not redrawn. To redraw them
|
||||||
|
* too, use clutter_content_invalidate().
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_content_invalidate_size (ClutterContent *content)
|
||||||
|
{
|
||||||
|
ClutterActor *actor;
|
||||||
|
GHashTable *actors;
|
||||||
|
GHashTableIter iter;
|
||||||
|
|
||||||
|
g_return_if_fail (CLUTTER_IS_CONTENT (content));
|
||||||
|
|
||||||
|
CLUTTER_CONTENT_GET_IFACE (content)->invalidate_size (content);
|
||||||
|
|
||||||
|
actors = g_object_get_qdata (G_OBJECT (content), quark_content_actors);
|
||||||
|
if (actors == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
g_hash_table_iter_init (&iter, actors);
|
||||||
|
while (g_hash_table_iter_next (&iter, (gpointer *) &actor, NULL))
|
||||||
|
{
|
||||||
|
ClutterRequestMode request_mode;
|
||||||
|
|
||||||
|
g_assert (actor != NULL);
|
||||||
|
|
||||||
|
request_mode = clutter_actor_get_request_mode (actor);
|
||||||
|
|
||||||
|
if (request_mode == CLUTTER_REQUEST_CONTENT_SIZE)
|
||||||
|
_clutter_actor_queue_only_relayout (actor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*< private >
|
/*< private >
|
||||||
* _clutter_content_attached:
|
* _clutter_content_attached:
|
||||||
* @content: a #ClutterContent
|
* @content: a #ClutterContent
|
||||||
@@ -199,7 +243,7 @@ clutter_content_invalidate (ClutterContent *content)
|
|||||||
* is associated to a #ClutterContent, to set up a backpointer from
|
* is associated to a #ClutterContent, to set up a backpointer from
|
||||||
* the @content to the @actor.
|
* the @content to the @actor.
|
||||||
*
|
*
|
||||||
* This function will invoke the #ClutterContentIface.attached() virtual
|
* This function will invoke the #ClutterContentInterface.attached() virtual
|
||||||
* function.
|
* function.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
@@ -233,7 +277,7 @@ _clutter_content_attached (ClutterContent *content,
|
|||||||
* This function should be used internally every time a #ClutterActor
|
* This function should be used internally every time a #ClutterActor
|
||||||
* removes the association with a #ClutterContent.
|
* removes the association with a #ClutterContent.
|
||||||
*
|
*
|
||||||
* This function will invoke the #ClutterContentIface.detached() virtual
|
* This function will invoke the #ClutterContentInterface.detached() virtual
|
||||||
* function.
|
* function.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
@@ -262,7 +306,7 @@ _clutter_content_detached (ClutterContent *content,
|
|||||||
*
|
*
|
||||||
* Creates the render tree for the @content and @actor.
|
* Creates the render tree for the @content and @actor.
|
||||||
*
|
*
|
||||||
* This function will invoke the #ClutterContentIface.paint_content()
|
* This function will invoke the #ClutterContentInterface.paint_content()
|
||||||
* virtual function.
|
* virtual function.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
|
@@ -33,24 +33,13 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define CLUTTER_TYPE_CONTENT (clutter_content_get_type ())
|
#define CLUTTER_TYPE_CONTENT (clutter_content_get_type ())
|
||||||
#define CLUTTER_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_CONTENT, ClutterContent))
|
|
||||||
#define CLUTTER_IS_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_CONTENT))
|
|
||||||
#define CLUTTER_CONTENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_CONTENT, ClutterContentIface))
|
|
||||||
|
|
||||||
typedef struct _ClutterContentIface ClutterContentIface;
|
CLUTTER_EXPORT
|
||||||
|
G_DECLARE_INTERFACE (ClutterContent, clutter_content, CLUTTER, CONTENT, GObject)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterContent:
|
* ClutterContentInterface:
|
||||||
*
|
|
||||||
* The #ClutterContent structure is an opaque type
|
|
||||||
* whose members cannot be acccessed directly.
|
|
||||||
*
|
|
||||||
* Since: 1.10
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterContentIface:
|
|
||||||
* @get_preferred_size: virtual function; should be overridden by subclasses
|
* @get_preferred_size: virtual function; should be overridden by subclasses
|
||||||
* of #ClutterContent that have a natural size
|
* of #ClutterContent that have a natural size
|
||||||
* @paint_content: virtual function; called each time the content needs to
|
* @paint_content: virtual function; called each time the content needs to
|
||||||
@@ -62,12 +51,12 @@ typedef struct _ClutterContentIface ClutterContentIface;
|
|||||||
* @invalidate: virtual function; called each time a #ClutterContent state
|
* @invalidate: virtual function; called each time a #ClutterContent state
|
||||||
* is changed.
|
* is changed.
|
||||||
*
|
*
|
||||||
* The #ClutterContentIface structure contains only
|
* The #ClutterContentInterface structure contains only
|
||||||
* private data.
|
* private data.
|
||||||
*
|
*
|
||||||
* Since: 1.10
|
* Since: 1.10
|
||||||
*/
|
*/
|
||||||
struct _ClutterContentIface
|
struct _ClutterContentInterface
|
||||||
{
|
{
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
GTypeInterface g_iface;
|
GTypeInterface g_iface;
|
||||||
@@ -86,10 +75,9 @@ struct _ClutterContentIface
|
|||||||
ClutterActor *actor);
|
ClutterActor *actor);
|
||||||
|
|
||||||
void (* invalidate) (ClutterContent *content);
|
void (* invalidate) (ClutterContent *content);
|
||||||
};
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
void (* invalidate_size) (ClutterContent *content);
|
||||||
GType clutter_content_get_type (void) G_GNUC_CONST;
|
};
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_content_get_preferred_size (ClutterContent *content,
|
gboolean clutter_content_get_preferred_size (ClutterContent *content,
|
||||||
@@ -98,6 +86,9 @@ gboolean clutter_content_get_preferred_size (ClutterContent *content
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_content_invalidate (ClutterContent *content);
|
void clutter_content_invalidate (ClutterContent *content);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
void clutter_content_invalidate_size (ClutterContent *content);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_CONTENT_H__ */
|
#endif /* __CLUTTER_CONTENT_H__ */
|
||||||
|
@@ -39,7 +39,8 @@ typedef enum {
|
|||||||
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
|
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
|
||||||
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
|
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
|
||||||
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
|
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
|
||||||
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7
|
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7,
|
||||||
|
CLUTTER_DEBUG_PAINT_DAMAGE_REGION = 1 << 8,
|
||||||
} ClutterDrawDebugFlag;
|
} ClutterDrawDebugFlag;
|
||||||
|
|
||||||
#ifdef CLUTTER_ENABLE_DEBUG
|
#ifdef CLUTTER_ENABLE_DEBUG
|
||||||
@@ -79,9 +80,9 @@ extern guint clutter_pick_debug_flags;
|
|||||||
extern guint clutter_paint_debug_flags;
|
extern guint clutter_paint_debug_flags;
|
||||||
|
|
||||||
void _clutter_debug_messagev (const char *format,
|
void _clutter_debug_messagev (const char *format,
|
||||||
va_list var_args);
|
va_list var_args) G_GNUC_PRINTF (1, 0);
|
||||||
void _clutter_debug_message (const char *format,
|
void _clutter_debug_message (const char *format,
|
||||||
...);
|
...) G_GNUC_PRINTF (1, 2);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@@ -7,8 +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-animator.h"
|
|
||||||
#include "deprecated/clutter-backend.h"
|
|
||||||
#include "deprecated/clutter-behaviour.h"
|
#include "deprecated/clutter-behaviour.h"
|
||||||
#include "deprecated/clutter-behaviour-depth.h"
|
#include "deprecated/clutter-behaviour-depth.h"
|
||||||
#include "deprecated/clutter-behaviour-ellipse.h"
|
#include "deprecated/clutter-behaviour-ellipse.h"
|
||||||
@@ -20,16 +18,13 @@
|
|||||||
#include "deprecated/clutter-box.h"
|
#include "deprecated/clutter-box.h"
|
||||||
#include "deprecated/clutter-cairo-texture.h"
|
#include "deprecated/clutter-cairo-texture.h"
|
||||||
#include "deprecated/clutter-container.h"
|
#include "deprecated/clutter-container.h"
|
||||||
#include "deprecated/clutter-frame-source.h"
|
|
||||||
#include "deprecated/clutter-group.h"
|
#include "deprecated/clutter-group.h"
|
||||||
#include "deprecated/clutter-input-device.h"
|
#include "deprecated/clutter-input-device.h"
|
||||||
#include "deprecated/clutter-keysyms.h"
|
#include "deprecated/clutter-keysyms.h"
|
||||||
#include "deprecated/clutter-list-model.h"
|
#include "deprecated/clutter-list-model.h"
|
||||||
#include "deprecated/clutter-main.h"
|
#include "deprecated/clutter-main.h"
|
||||||
#include "deprecated/clutter-media.h"
|
|
||||||
#include "deprecated/clutter-model.h"
|
#include "deprecated/clutter-model.h"
|
||||||
#include "deprecated/clutter-rectangle.h"
|
#include "deprecated/clutter-rectangle.h"
|
||||||
#include "deprecated/clutter-score.h"
|
|
||||||
#include "deprecated/clutter-shader.h"
|
#include "deprecated/clutter-shader.h"
|
||||||
#include "deprecated/clutter-stage-manager.h"
|
#include "deprecated/clutter-stage-manager.h"
|
||||||
#include "deprecated/clutter-stage.h"
|
#include "deprecated/clutter-stage.h"
|
||||||
@@ -37,8 +32,6 @@
|
|||||||
#include "deprecated/clutter-table-layout.h"
|
#include "deprecated/clutter-table-layout.h"
|
||||||
#include "deprecated/clutter-texture.h"
|
#include "deprecated/clutter-texture.h"
|
||||||
#include "deprecated/clutter-timeline.h"
|
#include "deprecated/clutter-timeline.h"
|
||||||
#include "deprecated/clutter-timeout-pool.h"
|
|
||||||
#include "deprecated/clutter-util.h"
|
|
||||||
|
|
||||||
#undef __CLUTTER_DEPRECATED_H_INSIDE__
|
#undef __CLUTTER_DEPRECATED_H_INSIDE__
|
||||||
|
|
||||||
|
@@ -167,6 +167,10 @@ struct _ClutterInputDeviceClass
|
|||||||
gboolean (* is_grouped) (ClutterInputDevice *device,
|
gboolean (* is_grouped) (ClutterInputDevice *device,
|
||||||
ClutterInputDevice *other_device);
|
ClutterInputDevice *other_device);
|
||||||
|
|
||||||
|
gboolean (* get_physical_size) (ClutterInputDevice *device,
|
||||||
|
gdouble *width,
|
||||||
|
gdouble *height);
|
||||||
|
|
||||||
/* Keyboard accessbility */
|
/* Keyboard accessbility */
|
||||||
void (* process_kbd_a11y_event) (ClutterEvent *event,
|
void (* process_kbd_a11y_event) (ClutterEvent *event,
|
||||||
ClutterInputDevice *device,
|
ClutterInputDevice *device,
|
||||||
|
@@ -884,7 +884,7 @@ typedef enum {
|
|||||||
/**
|
/**
|
||||||
* ClutterFeatureFlags:
|
* ClutterFeatureFlags:
|
||||||
* @CLUTTER_FEATURE_TEXTURE_NPOT: Set if NPOTS textures supported.
|
* @CLUTTER_FEATURE_TEXTURE_NPOT: Set if NPOTS textures supported.
|
||||||
* @CLUTTER_FEATURE_SYNC_TO_VBLANK: Set if vblank syncing supported.
|
* @CLUTTER_FEATURE_SWAP_THROTTLE: Set if backend throttles buffer swaps.
|
||||||
* @CLUTTER_FEATURE_TEXTURE_YUV: Set if YUV based textures supported.
|
* @CLUTTER_FEATURE_TEXTURE_YUV: Set if YUV based textures supported.
|
||||||
* @CLUTTER_FEATURE_TEXTURE_READ_PIXELS: Set if texture pixels can be read.
|
* @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)
|
||||||
@@ -903,7 +903,7 @@ typedef enum {
|
|||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
CLUTTER_FEATURE_TEXTURE_NPOT = (1 << 2),
|
CLUTTER_FEATURE_TEXTURE_NPOT = (1 << 2),
|
||||||
CLUTTER_FEATURE_SYNC_TO_VBLANK = (1 << 3),
|
CLUTTER_FEATURE_SWAP_THROTTLE = (1 << 3),
|
||||||
CLUTTER_FEATURE_TEXTURE_YUV = (1 << 4),
|
CLUTTER_FEATURE_TEXTURE_YUV = (1 << 4),
|
||||||
CLUTTER_FEATURE_TEXTURE_READ_PIXELS = (1 << 5),
|
CLUTTER_FEATURE_TEXTURE_READ_PIXELS = (1 << 5),
|
||||||
CLUTTER_FEATURE_STAGE_STATIC = (1 << 6),
|
CLUTTER_FEATURE_STAGE_STATIC = (1 << 6),
|
||||||
|
@@ -772,7 +772,10 @@ void clutter_event_get_gesture_motion_delta (const Clut
|
|||||||
gdouble *dx,
|
gdouble *dx,
|
||||||
gdouble *dy);
|
gdouble *dy);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
ClutterScrollSource clutter_event_get_scroll_source (const ClutterEvent *event);
|
ClutterScrollSource clutter_event_get_scroll_source (const ClutterEvent *event);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
ClutterScrollFinishFlags clutter_event_get_scroll_finish_flags (const ClutterEvent *event);
|
ClutterScrollFinishFlags clutter_event_get_scroll_finish_flags (const ClutterEvent *event);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
|
@@ -53,9 +53,11 @@
|
|||||||
struct _ClutterImagePrivate
|
struct _ClutterImagePrivate
|
||||||
{
|
{
|
||||||
CoglTexture *texture;
|
CoglTexture *texture;
|
||||||
|
gint width;
|
||||||
|
gint height;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void clutter_content_iface_init (ClutterContentIface *iface);
|
static void clutter_content_iface_init (ClutterContentInterface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (ClutterImage, clutter_image, G_TYPE_OBJECT,
|
G_DEFINE_TYPE_WITH_CODE (ClutterImage, clutter_image, G_TYPE_OBJECT,
|
||||||
G_ADD_PRIVATE (ClutterImage)
|
G_ADD_PRIVATE (ClutterImage)
|
||||||
@@ -68,6 +70,27 @@ clutter_image_error_quark (void)
|
|||||||
return g_quark_from_static_string ("clutter-image-error-quark");
|
return g_quark_from_static_string ("clutter-image-error-quark");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
update_image_size (ClutterImage *self)
|
||||||
|
{
|
||||||
|
gint width, height;
|
||||||
|
|
||||||
|
if (self->priv->texture == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
width = cogl_texture_get_width (self->priv->texture);
|
||||||
|
height = cogl_texture_get_height (self->priv->texture);
|
||||||
|
|
||||||
|
if (self->priv->width == width &&
|
||||||
|
self->priv->height == height)
|
||||||
|
return;
|
||||||
|
|
||||||
|
self->priv->width = width;
|
||||||
|
self->priv->height = height;
|
||||||
|
|
||||||
|
clutter_content_invalidate_size (CLUTTER_CONTENT (self));
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_image_finalize (GObject *gobject)
|
clutter_image_finalize (GObject *gobject)
|
||||||
{
|
{
|
||||||
@@ -131,7 +154,7 @@ clutter_image_get_preferred_size (ClutterContent *content,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_content_iface_init (ClutterContentIface *iface)
|
clutter_content_iface_init (ClutterContentInterface *iface)
|
||||||
{
|
{
|
||||||
iface->get_preferred_size = clutter_image_get_preferred_size;
|
iface->get_preferred_size = clutter_image_get_preferred_size;
|
||||||
iface->paint_content = clutter_image_paint_content;
|
iface->paint_content = clutter_image_paint_content;
|
||||||
@@ -238,6 +261,7 @@ clutter_image_set_data (ClutterImage *image,
|
|||||||
}
|
}
|
||||||
|
|
||||||
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
||||||
|
update_image_size (image);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -306,6 +330,7 @@ clutter_image_set_bytes (ClutterImage *image,
|
|||||||
}
|
}
|
||||||
|
|
||||||
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
||||||
|
update_image_size (image);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -399,6 +424,7 @@ clutter_image_set_area (ClutterImage *image,
|
|||||||
}
|
}
|
||||||
|
|
||||||
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
||||||
|
update_image_size (image);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@@ -2284,3 +2284,15 @@ clutter_input_device_is_grouped (ClutterInputDevice *device,
|
|||||||
|
|
||||||
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->is_grouped (device, other_device);
|
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->is_grouped (device, other_device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
clutter_input_device_get_physical_size (ClutterInputDevice *device,
|
||||||
|
gdouble *width,
|
||||||
|
gdouble *height)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
||||||
|
|
||||||
|
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->get_physical_size (device,
|
||||||
|
width,
|
||||||
|
height);
|
||||||
|
}
|
||||||
|
@@ -171,6 +171,10 @@ void clutter_input_device_set_mapping_mode (ClutterInputDev
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_input_device_is_grouped (ClutterInputDevice *device,
|
gboolean clutter_input_device_is_grouped (ClutterInputDevice *device,
|
||||||
ClutterInputDevice *other_device);
|
ClutterInputDevice *other_device);
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
gboolean clutter_input_device_get_physical_size (ClutterInputDevice *device,
|
||||||
|
gdouble *width,
|
||||||
|
gdouble *height);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
64
clutter/clutter/clutter-keymap.c
Normal file
64
clutter/clutter/clutter-keymap.c
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 Red Hat
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
|
* 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* Author: Carlos Garnacho <carlosg@gnome.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "clutter-build-config.h"
|
||||||
|
|
||||||
|
#include "clutter-keymap.h"
|
||||||
|
#include "clutter-private.h"
|
||||||
|
|
||||||
|
G_DEFINE_ABSTRACT_TYPE (ClutterKeymap, clutter_keymap, G_TYPE_OBJECT)
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
STATE_CHANGED,
|
||||||
|
N_SIGNALS
|
||||||
|
};
|
||||||
|
|
||||||
|
static guint signals[N_SIGNALS] = { 0, };
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_keymap_class_init (ClutterKeymapClass *klass)
|
||||||
|
{
|
||||||
|
signals[STATE_CHANGED] =
|
||||||
|
g_signal_new (I_("state-changed"),
|
||||||
|
G_TYPE_FROM_CLASS (klass),
|
||||||
|
G_SIGNAL_RUN_FIRST,
|
||||||
|
0, NULL, NULL,
|
||||||
|
g_cclosure_marshal_VOID__VOID,
|
||||||
|
G_TYPE_NONE, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_keymap_init (ClutterKeymap *keymap)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
clutter_keymap_get_num_lock_state (ClutterKeymap *keymap)
|
||||||
|
{
|
||||||
|
return CLUTTER_KEYMAP_GET_CLASS (keymap)->get_num_lock_state (keymap);
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
clutter_keymap_get_caps_lock_state (ClutterKeymap *keymap)
|
||||||
|
{
|
||||||
|
return CLUTTER_KEYMAP_GET_CLASS (keymap)->get_caps_lock_state (keymap);
|
||||||
|
}
|
56
clutter/clutter/clutter-keymap.h
Normal file
56
clutter/clutter/clutter-keymap.h
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 Red Hat
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
|
* 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* Author: Carlos Garnacho <carlosg@gnome.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CLUTTER_KEYMAP_H
|
||||||
|
#define CLUTTER_KEYMAP_H
|
||||||
|
|
||||||
|
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||||
|
#error "Only <clutter/clutter.h> can be included directly."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <clutter/clutter-macros.h>
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
typedef struct _ClutterKeymap ClutterKeymap;
|
||||||
|
typedef struct _ClutterKeymapClass ClutterKeymapClass;
|
||||||
|
|
||||||
|
struct _ClutterKeymapClass
|
||||||
|
{
|
||||||
|
GObjectClass parent_class;
|
||||||
|
|
||||||
|
gboolean (* get_num_lock_state) (ClutterKeymap *keymap);
|
||||||
|
gboolean (* get_caps_lock_state) (ClutterKeymap *keymap);
|
||||||
|
};
|
||||||
|
|
||||||
|
#define CLUTTER_TYPE_KEYMAP (clutter_keymap_get_type ())
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
G_DECLARE_DERIVABLE_TYPE (ClutterKeymap, clutter_keymap,
|
||||||
|
CLUTTER, KEYMAP,
|
||||||
|
GObject)
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
gboolean clutter_keymap_get_num_lock_state (ClutterKeymap *keymap);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
gboolean clutter_keymap_get_caps_lock_state (ClutterKeymap *keymap);
|
||||||
|
|
||||||
|
#endif /* CLUTTER_KEYMAP_H */
|
@@ -142,6 +142,7 @@ static const GDebugKey clutter_paint_debug_keys[] = {
|
|||||||
{ "disable-offscreen-redirect", CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT },
|
{ "disable-offscreen-redirect", CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT },
|
||||||
{ "continuous-redraw", CLUTTER_DEBUG_CONTINUOUS_REDRAW },
|
{ "continuous-redraw", CLUTTER_DEBUG_CONTINUOUS_REDRAW },
|
||||||
{ "paint-deform-tiles", CLUTTER_DEBUG_PAINT_DEFORM_TILES },
|
{ "paint-deform-tiles", CLUTTER_DEBUG_PAINT_DEFORM_TILES },
|
||||||
|
{ "damage-region", CLUTTER_DEBUG_PAINT_DAMAGE_REGION },
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -254,16 +255,6 @@ clutter_config_read_from_key_file (GKeyFile *keyfile)
|
|||||||
else
|
else
|
||||||
clutter_enable_accessibility = bool_value;
|
clutter_enable_accessibility = bool_value;
|
||||||
|
|
||||||
bool_value =
|
|
||||||
g_key_file_get_boolean (keyfile, ENVIRONMENT_GROUP,
|
|
||||||
"SyncToVblank",
|
|
||||||
&key_error);
|
|
||||||
|
|
||||||
if (key_error != NULL)
|
|
||||||
g_clear_error (&key_error);
|
|
||||||
else
|
|
||||||
clutter_sync_to_vblank = bool_value;
|
|
||||||
|
|
||||||
int_value =
|
int_value =
|
||||||
g_key_file_get_integer (keyfile, ENVIRONMENT_GROUP,
|
g_key_file_get_integer (keyfile, ENVIRONMENT_GROUP,
|
||||||
"DefaultFps",
|
"DefaultFps",
|
||||||
@@ -1365,6 +1356,9 @@ clutter_init_real (GError **error)
|
|||||||
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS | CLUTTER_DEBUG_DISABLE_CULLING;
|
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS | CLUTTER_DEBUG_DISABLE_CULLING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION)
|
||||||
|
g_message ("Enabling damaged region");
|
||||||
|
|
||||||
/* this will take care of initializing Cogl's state and
|
/* this will take care of initializing Cogl's state and
|
||||||
* query the GL machinery for features
|
* query the GL machinery for features
|
||||||
*/
|
*/
|
||||||
@@ -1487,10 +1481,6 @@ pre_parse_hook (GOptionContext *context,
|
|||||||
if (env_string)
|
if (env_string)
|
||||||
clutter_use_fuzzy_picking = TRUE;
|
clutter_use_fuzzy_picking = TRUE;
|
||||||
|
|
||||||
env_string = g_getenv ("CLUTTER_VBLANK");
|
|
||||||
if (g_strcmp0 (env_string, "none") == 0)
|
|
||||||
clutter_sync_to_vblank = FALSE;
|
|
||||||
|
|
||||||
return _clutter_backend_pre_parse (backend, error);
|
return _clutter_backend_pre_parse (backend, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3631,12 +3621,6 @@ _clutter_set_sync_to_vblank (gboolean sync_to_vblank)
|
|||||||
clutter_sync_to_vblank = !!sync_to_vblank;
|
clutter_sync_to_vblank = !!sync_to_vblank;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
_clutter_get_sync_to_vblank (void)
|
|
||||||
{
|
|
||||||
return clutter_sync_to_vblank;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_clutter_debug_messagev (const char *format,
|
_clutter_debug_messagev (const char *format,
|
||||||
va_list var_args)
|
va_list var_args)
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
BOOLEAN:BOXED
|
BOOLEAN:BOXED
|
||||||
BOOLEAN:BOXED,INT,INT
|
BOOLEAN:BOXED,INT,INT
|
||||||
BOOLEAN:OBJECT,BOOLEAN
|
BOOLEAN:OBJECT,BOOLEAN
|
||||||
|
BOOLEAN:OBJECT,BOXED
|
||||||
BOOLEAN:OBJECT,BOXED,DOUBLE
|
BOOLEAN:OBJECT,BOXED,DOUBLE
|
||||||
BOOLEAN:OBJECT,DOUBLE
|
BOOLEAN:OBJECT,DOUBLE
|
||||||
BOOLEAN:OBJECT,ENUM
|
BOOLEAN:OBJECT,ENUM
|
||||||
|
@@ -109,7 +109,8 @@ static GSourceFuncs clock_funcs = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static void clutter_master_clock_iface_init (ClutterMasterClockIface *iface);
|
static void
|
||||||
|
clutter_master_clock_iface_init (ClutterMasterClockInterface *iface);
|
||||||
|
|
||||||
#define clutter_master_clock_default_get_type _clutter_master_clock_default_get_type
|
#define clutter_master_clock_default_get_type _clutter_master_clock_default_get_type
|
||||||
|
|
||||||
@@ -298,10 +299,10 @@ master_clock_next_frame_delay (ClutterMasterClockDefault *master_clock)
|
|||||||
* (NB: if there aren't even any timelines running then the master clock will
|
* (NB: if there aren't even any timelines running then the master clock will
|
||||||
* be completely stopped in master_clock_is_running())
|
* be completely stopped in master_clock_is_running())
|
||||||
*/
|
*/
|
||||||
if (clutter_feature_available (CLUTTER_FEATURE_SYNC_TO_VBLANK) &&
|
if (clutter_feature_available (CLUTTER_FEATURE_SWAP_THROTTLE) &&
|
||||||
!master_clock->idle)
|
!master_clock->idle)
|
||||||
{
|
{
|
||||||
CLUTTER_NOTE (SCHEDULER, "vblank available and updated stages");
|
CLUTTER_NOTE (SCHEDULER, "swap throttling available and updated stages");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -689,7 +690,7 @@ clutter_master_clock_default_set_paused (ClutterMasterClock *clock,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_master_clock_iface_init (ClutterMasterClockIface *iface)
|
clutter_master_clock_iface_init (ClutterMasterClockInterface *iface)
|
||||||
{
|
{
|
||||||
iface->add_timeline = clutter_master_clock_default_add_timeline;
|
iface->add_timeline = clutter_master_clock_default_add_timeline;
|
||||||
iface->remove_timeline = clutter_master_clock_default_remove_timeline;
|
iface->remove_timeline = clutter_master_clock_default_remove_timeline;
|
||||||
|
@@ -37,10 +37,6 @@
|
|||||||
#include "clutter-master-clock-default.h"
|
#include "clutter-master-clock-default.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
|
|
||||||
#define clutter_master_clock_get_type _clutter_master_clock_get_type
|
|
||||||
|
|
||||||
typedef ClutterMasterClockIface ClutterMasterClockInterface;
|
|
||||||
|
|
||||||
G_DEFINE_INTERFACE (ClutterMasterClock, clutter_master_clock, G_TYPE_OBJECT)
|
G_DEFINE_INTERFACE (ClutterMasterClock, clutter_master_clock, G_TYPE_OBJECT)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -28,15 +28,12 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define CLUTTER_TYPE_MASTER_CLOCK (_clutter_master_clock_get_type ())
|
#define CLUTTER_TYPE_MASTER_CLOCK (clutter_master_clock_get_type ())
|
||||||
#define CLUTTER_MASTER_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_MASTER_CLOCK, ClutterMasterClock))
|
G_DECLARE_INTERFACE (ClutterMasterClock, clutter_master_clock,
|
||||||
#define CLUTTER_IS_MASTER_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_MASTER_CLOCK))
|
CLUTTER, MASTER_CLOCK,
|
||||||
#define CLUTTER_MASTER_CLOCK_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_MASTER_CLOCK, ClutterMasterClockIface))
|
GObject)
|
||||||
|
|
||||||
typedef struct _ClutterMasterClock ClutterMasterClock; /* dummy */
|
struct _ClutterMasterClockInterface
|
||||||
typedef struct _ClutterMasterClockIface ClutterMasterClockIface;
|
|
||||||
|
|
||||||
struct _ClutterMasterClockIface
|
|
||||||
{
|
{
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
GTypeInterface parent_iface;
|
GTypeInterface parent_iface;
|
||||||
@@ -51,8 +48,6 @@ struct _ClutterMasterClockIface
|
|||||||
gboolean paused);
|
gboolean paused);
|
||||||
};
|
};
|
||||||
|
|
||||||
GType _clutter_master_clock_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
ClutterMasterClock * _clutter_master_clock_get_default (void);
|
ClutterMasterClock * _clutter_master_clock_get_default (void);
|
||||||
void _clutter_master_clock_add_timeline (ClutterMasterClock *master_clock,
|
void _clutter_master_clock_add_timeline (ClutterMasterClock *master_clock,
|
||||||
ClutterTimeline *timeline);
|
ClutterTimeline *timeline);
|
||||||
|
@@ -34,9 +34,6 @@
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_set_custom_backend_func (ClutterBackend *(* func) (void));
|
void clutter_set_custom_backend_func (ClutterBackend *(* func) (void));
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean _clutter_get_sync_to_vblank (void);
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
int64_t clutter_stage_get_frame_counter (ClutterStage *stage);
|
int64_t clutter_stage_get_frame_counter (ClutterStage *stage);
|
||||||
|
|
||||||
@@ -52,6 +49,9 @@ void clutter_stage_freeze_updates (ClutterStage *stage);
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_stage_thaw_updates (ClutterStage *stage);
|
void clutter_stage_thaw_updates (ClutterStage *stage);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
gboolean clutter_actor_has_damage (ClutterActor *actor);
|
||||||
|
|
||||||
#undef __CLUTTER_H_INSIDE__
|
#undef __CLUTTER_H_INSIDE__
|
||||||
|
|
||||||
#endif /* __CLUTTER_MUTTER_H__ */
|
#endif /* __CLUTTER_MUTTER_H__ */
|
||||||
|
@@ -72,6 +72,8 @@
|
|||||||
#include "clutter-debug.h"
|
#include "clutter-debug.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
#include "clutter-stage-private.h"
|
#include "clutter-stage-private.h"
|
||||||
|
#include "clutter-paint-volume-private.h"
|
||||||
|
#include "clutter-actor-box-private.h"
|
||||||
|
|
||||||
struct _ClutterOffscreenEffectPrivate
|
struct _ClutterOffscreenEffectPrivate
|
||||||
{
|
{
|
||||||
@@ -82,8 +84,10 @@ struct _ClutterOffscreenEffectPrivate
|
|||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
ClutterActor *stage;
|
ClutterActor *stage;
|
||||||
|
|
||||||
gfloat x_offset;
|
ClutterVertex position;
|
||||||
gfloat y_offset;
|
|
||||||
|
int fbo_offset_x;
|
||||||
|
int fbo_offset_y;
|
||||||
|
|
||||||
/* This is the calculated size of the fbo before being passed
|
/* This is the calculated size of the fbo before being passed
|
||||||
through create_texture(). This needs to be tracked separately so
|
through create_texture(). This needs to be tracked separately so
|
||||||
@@ -93,16 +97,6 @@ struct _ClutterOffscreenEffectPrivate
|
|||||||
int fbo_height;
|
int fbo_height;
|
||||||
|
|
||||||
gint old_opacity_override;
|
gint old_opacity_override;
|
||||||
|
|
||||||
/* The matrix that was current the last time the fbo was updated. We
|
|
||||||
need to keep track of this to detect when we can reuse the
|
|
||||||
contents of the fbo without redrawing the actor. We need the
|
|
||||||
actual matrix rather than just detecting queued redraws on the
|
|
||||||
actor because any change in the parent hierarchy (even just a
|
|
||||||
translation) could cause the actor to look completely different
|
|
||||||
and it won't cause a redraw to be queued on the parent's
|
|
||||||
children. */
|
|
||||||
CoglMatrix last_matrix_drawn;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterOffscreenEffect,
|
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterOffscreenEffect,
|
||||||
@@ -222,15 +216,15 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
|||||||
{
|
{
|
||||||
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
|
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
|
||||||
ClutterOffscreenEffectPrivate *priv = self->priv;
|
ClutterOffscreenEffectPrivate *priv = self->priv;
|
||||||
ClutterActorBox box;
|
ClutterActorBox raw_box, box;
|
||||||
ClutterActor *stage;
|
ClutterActor *stage;
|
||||||
CoglMatrix projection;
|
CoglMatrix projection, old_modelview, modelview;
|
||||||
|
const ClutterPaintVolume *volume;
|
||||||
CoglColor transparent;
|
CoglColor transparent;
|
||||||
gfloat stage_width, stage_height;
|
gfloat stage_width, stage_height;
|
||||||
gfloat fbo_width = -1, fbo_height = -1;
|
gfloat fbo_width = -1, fbo_height = -1;
|
||||||
gfloat width, height;
|
ClutterVertex local_offset = { 0.f, 0.f, 0.f };
|
||||||
gfloat xexpand, yexpand;
|
gfloat old_viewport[4];
|
||||||
int texture_width, texture_height;
|
|
||||||
|
|
||||||
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))
|
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -241,92 +235,82 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
|||||||
stage = _clutter_actor_get_stage_internal (priv->actor);
|
stage = _clutter_actor_get_stage_internal (priv->actor);
|
||||||
clutter_actor_get_size (stage, &stage_width, &stage_height);
|
clutter_actor_get_size (stage, &stage_width, &stage_height);
|
||||||
|
|
||||||
/* The paint box is the bounding box of the actor's paint volume in
|
/* Get the minimal bounding box for what we want to paint, relative to the
|
||||||
* stage coordinates. This will give us the size for the framebuffer
|
* parent of priv->actor. Note that we may actually be painting a clone of
|
||||||
* we need to redirect its rendering offscreen and its position will
|
* priv->actor so we need to be careful to avoid querying the transformation
|
||||||
* be used to setup an offset viewport */
|
* of priv->actor (like clutter_actor_get_paint_box would). Just stay in
|
||||||
if (clutter_actor_get_paint_box (priv->actor, &box))
|
* local coordinates for now...
|
||||||
|
*/
|
||||||
|
volume = clutter_actor_get_paint_volume (priv->actor);
|
||||||
|
if (volume)
|
||||||
{
|
{
|
||||||
clutter_actor_box_get_size (&box, &fbo_width, &fbo_height);
|
ClutterPaintVolume mutable_volume;
|
||||||
clutter_actor_box_get_origin (&box, &priv->x_offset, &priv->y_offset);
|
|
||||||
|
|
||||||
fbo_width = MIN (fbo_width, stage_width);
|
_clutter_paint_volume_copy_static (volume, &mutable_volume);
|
||||||
fbo_height = MIN (fbo_height, stage_height);
|
_clutter_paint_volume_get_bounding_box (&mutable_volume, &raw_box);
|
||||||
|
clutter_paint_volume_free (&mutable_volume);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fbo_width = stage_width;
|
clutter_actor_get_allocation_box (priv->actor, &raw_box);
|
||||||
fbo_height = stage_height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fbo_width == stage_width)
|
box = raw_box;
|
||||||
priv->x_offset = 0.0f;
|
_clutter_actor_box_enlarge_for_effects (&box);
|
||||||
if (fbo_height == stage_height)
|
|
||||||
priv->y_offset = 0.0f;
|
priv->fbo_offset_x = box.x1 - raw_box.x1;
|
||||||
|
priv->fbo_offset_y = box.y1 - raw_box.y1;
|
||||||
|
|
||||||
|
clutter_actor_box_get_size (&box, &fbo_width, &fbo_height);
|
||||||
|
|
||||||
/* First assert that the framebuffer is the right size... */
|
/* First assert that the framebuffer is the right size... */
|
||||||
if (!update_fbo (effect, fbo_width, fbo_height))
|
if (!update_fbo (effect, fbo_width, fbo_height))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
texture_width = cogl_texture_get_width (priv->texture);
|
cogl_get_modelview_matrix (&old_modelview);
|
||||||
texture_height = cogl_texture_get_height (priv->texture);
|
|
||||||
|
|
||||||
/* get the current modelview matrix so that we can copy it to the
|
|
||||||
* framebuffer. We also store the matrix that was last used when we
|
|
||||||
* updated the FBO so that we can detect when we don't need to
|
|
||||||
* update the FBO to paint a second time */
|
|
||||||
cogl_get_modelview_matrix (&priv->last_matrix_drawn);
|
|
||||||
|
|
||||||
/* let's draw offscreen */
|
/* let's draw offscreen */
|
||||||
cogl_push_framebuffer (priv->offscreen);
|
cogl_push_framebuffer (priv->offscreen);
|
||||||
|
|
||||||
/* Copy the modelview that would have been used if rendering onscreen */
|
/* We don't want the FBO contents to be transformed. That could waste memory
|
||||||
cogl_set_modelview_matrix (&priv->last_matrix_drawn);
|
* (e.g. during zoom), or result in something that's not rectangular (clipped
|
||||||
|
* incorrectly). So drop the modelview matrix of the current paint chain.
|
||||||
/* Set up the viewport so that it has the same size as the stage,
|
* This is fine since paint_texture runs with the same modelview matrix,
|
||||||
* but offset it so that the actor of interest lands on our
|
* so it will come out correctly whenever that is used to put the FBO
|
||||||
* framebuffer. */
|
* contents on screen...
|
||||||
clutter_actor_get_size (priv->stage, &width, &height);
|
|
||||||
|
|
||||||
/* Expand the viewport if the actor is partially off-stage,
|
|
||||||
* otherwise the actor will end up clipped to the stage viewport
|
|
||||||
*/
|
*/
|
||||||
xexpand = 0.f;
|
clutter_actor_get_transform (priv->stage, &modelview);
|
||||||
if (priv->x_offset < 0.f)
|
cogl_set_modelview_matrix (&modelview);
|
||||||
xexpand = -priv->x_offset;
|
|
||||||
if (priv->x_offset + texture_width > width)
|
|
||||||
xexpand = MAX (xexpand, (priv->x_offset + texture_width) - width);
|
|
||||||
|
|
||||||
yexpand = 0.f;
|
/* Save the original viewport for calculating priv->position */
|
||||||
if (priv->y_offset < 0.f)
|
_clutter_stage_get_viewport (CLUTTER_STAGE (priv->stage),
|
||||||
yexpand = -priv->y_offset;
|
&old_viewport[0],
|
||||||
if (priv->y_offset + texture_height > height)
|
&old_viewport[1],
|
||||||
yexpand = MAX (yexpand, (priv->y_offset + texture_height) - height);
|
&old_viewport[2],
|
||||||
|
&old_viewport[3]);
|
||||||
|
|
||||||
/* Set the viewport */
|
/* Set up the viewport so that it has the same size as the stage (avoid
|
||||||
cogl_set_viewport (-(priv->x_offset + xexpand), -(priv->y_offset + yexpand),
|
* distortion), but translated to account for the FBO offset...
|
||||||
width + (2 * xexpand), height + (2 * yexpand));
|
*/
|
||||||
|
cogl_set_viewport (-priv->fbo_offset_x,
|
||||||
|
-priv->fbo_offset_y,
|
||||||
|
stage_width,
|
||||||
|
stage_height);
|
||||||
|
|
||||||
/* Copy the stage's projection matrix across to the framebuffer */
|
/* Copy the stage's projection matrix across to the framebuffer */
|
||||||
_clutter_stage_get_projection_matrix (CLUTTER_STAGE (priv->stage),
|
_clutter_stage_get_projection_matrix (CLUTTER_STAGE (priv->stage),
|
||||||
&projection);
|
&projection);
|
||||||
|
|
||||||
/* If we've expanded the viewport, make sure to scale the projection
|
/* Now save the global position of the effect (not just of the actor).
|
||||||
* matrix accordingly (as it's been initialised to work with the
|
* It doesn't appear anyone actually uses this yet, but get_target_rect is
|
||||||
* original viewport and not our expanded one).
|
* documented as returning it. So we should...
|
||||||
*/
|
*/
|
||||||
if (xexpand > 0.f || yexpand > 0.f)
|
_clutter_util_fully_transform_vertices (&old_modelview,
|
||||||
{
|
&projection,
|
||||||
gfloat new_width, new_height;
|
old_viewport,
|
||||||
|
&local_offset,
|
||||||
new_width = width + (2 * xexpand);
|
&priv->position,
|
||||||
new_height = height + (2 * yexpand);
|
1);
|
||||||
|
|
||||||
cogl_matrix_scale (&projection,
|
|
||||||
width / new_width,
|
|
||||||
height / new_height,
|
|
||||||
1);
|
|
||||||
}
|
|
||||||
|
|
||||||
cogl_set_projection_matrix (&projection);
|
cogl_set_projection_matrix (&projection);
|
||||||
|
|
||||||
@@ -385,13 +369,14 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect)
|
|||||||
|
|
||||||
cogl_push_matrix ();
|
cogl_push_matrix ();
|
||||||
|
|
||||||
/* Now reset the modelview to put us in stage coordinates so
|
/* The current modelview matrix is *almost* perfect already. It's only
|
||||||
* we can drawn the result of our offscreen render as a textured
|
* missing a correction for the expanded FBO and offset rendering within...
|
||||||
* quad... */
|
*/
|
||||||
|
cogl_get_modelview_matrix (&modelview);
|
||||||
cogl_matrix_init_identity (&modelview);
|
cogl_matrix_translate (&modelview,
|
||||||
_clutter_actor_apply_modelview_transform (priv->stage, &modelview);
|
priv->fbo_offset_x,
|
||||||
cogl_matrix_translate (&modelview, priv->x_offset, priv->y_offset, 0.0f);
|
priv->fbo_offset_y,
|
||||||
|
0.0f);
|
||||||
cogl_set_modelview_matrix (&modelview);
|
cogl_set_modelview_matrix (&modelview);
|
||||||
|
|
||||||
/* paint the target material; this is virtualized for
|
/* paint the target material; this is virtualized for
|
||||||
@@ -428,16 +413,11 @@ clutter_offscreen_effect_paint (ClutterEffect *effect,
|
|||||||
{
|
{
|
||||||
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
|
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
|
||||||
ClutterOffscreenEffectPrivate *priv = self->priv;
|
ClutterOffscreenEffectPrivate *priv = self->priv;
|
||||||
CoglMatrix matrix;
|
|
||||||
|
|
||||||
cogl_get_modelview_matrix (&matrix);
|
/* If we've already got a cached image and the actor hasn't been redrawn
|
||||||
|
* then we can just use the cached image in the FBO.
|
||||||
/* If we've already got a cached image for the same matrix and the
|
*/
|
||||||
actor hasn't been redrawn then we can just use the cached image
|
if (priv->offscreen == NULL || (flags & CLUTTER_EFFECT_PAINT_ACTOR_DIRTY))
|
||||||
in the fbo */
|
|
||||||
if (priv->offscreen == NULL ||
|
|
||||||
(flags & CLUTTER_EFFECT_PAINT_ACTOR_DIRTY) ||
|
|
||||||
!cogl_matrix_equal (&matrix, &priv->last_matrix_drawn))
|
|
||||||
{
|
{
|
||||||
/* Chain up to the parent paint method which will call the pre and
|
/* Chain up to the parent paint method which will call the pre and
|
||||||
post paint functions to update the image */
|
post paint functions to update the image */
|
||||||
@@ -663,8 +643,8 @@ clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
clutter_rect_init (rect,
|
clutter_rect_init (rect,
|
||||||
priv->x_offset,
|
priv->position.x,
|
||||||
priv->y_offset,
|
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));
|
||||||
|
|
||||||
|
@@ -77,6 +77,7 @@ struct _ClutterPaintNodeClass
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
PAINT_OP_INVALID = 0,
|
PAINT_OP_INVALID = 0,
|
||||||
PAINT_OP_TEX_RECT,
|
PAINT_OP_TEX_RECT,
|
||||||
|
PAINT_OP_MULTITEX_RECT,
|
||||||
PAINT_OP_PATH,
|
PAINT_OP_PATH,
|
||||||
PAINT_OP_PRIMITIVE
|
PAINT_OP_PRIMITIVE
|
||||||
} PaintOpCode;
|
} PaintOpCode;
|
||||||
@@ -85,6 +86,8 @@ struct _ClutterPaintOperation
|
|||||||
{
|
{
|
||||||
PaintOpCode opcode;
|
PaintOpCode opcode;
|
||||||
|
|
||||||
|
GArray *multitex_coords;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
float texrect[8];
|
float texrect[8];
|
||||||
|
|
||||||
@@ -94,7 +97,6 @@ struct _ClutterPaintOperation
|
|||||||
} op;
|
} op;
|
||||||
};
|
};
|
||||||
|
|
||||||
GType _clutter_root_node_get_type (void) G_GNUC_CONST;
|
|
||||||
GType _clutter_transform_node_get_type (void) G_GNUC_CONST;
|
GType _clutter_transform_node_get_type (void) G_GNUC_CONST;
|
||||||
GType _clutter_dummy_node_get_type (void) G_GNUC_CONST;
|
GType _clutter_dummy_node_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
@@ -107,13 +109,9 @@ void _clutter_paint_operation_paint_primitive (const C
|
|||||||
void _clutter_paint_node_init_types (void);
|
void _clutter_paint_node_init_types (void);
|
||||||
gpointer _clutter_paint_node_create (GType gtype);
|
gpointer _clutter_paint_node_create (GType gtype);
|
||||||
|
|
||||||
ClutterPaintNode * _clutter_root_node_new (CoglFramebuffer *framebuffer,
|
|
||||||
const ClutterColor *clear_color,
|
|
||||||
CoglBufferBit clear_flags);
|
|
||||||
ClutterPaintNode * _clutter_transform_node_new (const CoglMatrix *matrix);
|
ClutterPaintNode * _clutter_transform_node_new (const CoglMatrix *matrix);
|
||||||
ClutterPaintNode * _clutter_dummy_node_new (ClutterActor *actor);
|
ClutterPaintNode * _clutter_dummy_node_new (ClutterActor *actor);
|
||||||
|
|
||||||
void _clutter_paint_node_paint (ClutterPaintNode *root);
|
|
||||||
void _clutter_paint_node_dump_tree (ClutterPaintNode *root);
|
void _clutter_paint_node_dump_tree (ClutterPaintNode *root);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
|
@@ -761,6 +761,11 @@ clutter_paint_operation_clear (ClutterPaintOperation *op)
|
|||||||
case PAINT_OP_TEX_RECT:
|
case PAINT_OP_TEX_RECT:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PAINT_OP_MULTITEX_RECT:
|
||||||
|
if (op->multitex_coords != NULL)
|
||||||
|
g_array_unref (op->multitex_coords);
|
||||||
|
break;
|
||||||
|
|
||||||
case PAINT_OP_PATH:
|
case PAINT_OP_PATH:
|
||||||
if (op->op.path != NULL)
|
if (op->op.path != NULL)
|
||||||
cogl_object_unref (op->op.path);
|
cogl_object_unref (op->op.path);
|
||||||
@@ -794,6 +799,27 @@ clutter_paint_op_init_tex_rect (ClutterPaintOperation *op,
|
|||||||
op->op.texrect[7] = y_2;
|
op->op.texrect[7] = y_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
clutter_paint_op_init_multitex_rect (ClutterPaintOperation *op,
|
||||||
|
const ClutterActorBox *rect,
|
||||||
|
const float *tex_coords,
|
||||||
|
unsigned int tex_coords_len)
|
||||||
|
{
|
||||||
|
clutter_paint_operation_clear (op);
|
||||||
|
|
||||||
|
op->opcode = PAINT_OP_MULTITEX_RECT;
|
||||||
|
op->multitex_coords = g_array_sized_new (FALSE, FALSE,
|
||||||
|
sizeof (float),
|
||||||
|
tex_coords_len);
|
||||||
|
|
||||||
|
g_array_append_vals (op->multitex_coords, tex_coords, tex_coords_len);
|
||||||
|
|
||||||
|
op->op.texrect[0] = rect->x1;
|
||||||
|
op->op.texrect[1] = rect->y1;
|
||||||
|
op->op.texrect[2] = rect->x2;
|
||||||
|
op->op.texrect[3] = rect->y2;
|
||||||
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
clutter_paint_op_init_path (ClutterPaintOperation *op,
|
clutter_paint_op_init_path (ClutterPaintOperation *op,
|
||||||
CoglPath *path)
|
CoglPath *path)
|
||||||
@@ -881,6 +907,33 @@ clutter_paint_node_add_texture_rectangle (ClutterPaintNode *node,
|
|||||||
g_array_append_val (node->operations, operation);
|
g_array_append_val (node->operations, operation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_paint_node_add_multitexture_rectangle:
|
||||||
|
* @node: a #ClutterPaintNode
|
||||||
|
* @rect: a #ClutterActorBox
|
||||||
|
* @text_coords: array of multitexture values
|
||||||
|
* @text_coords_len: number of items of @text_coords
|
||||||
|
*
|
||||||
|
* Adds a rectangle region to the @node, with multitexture coordinates.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_paint_node_add_multitexture_rectangle (ClutterPaintNode *node,
|
||||||
|
const ClutterActorBox *rect,
|
||||||
|
const float *text_coords,
|
||||||
|
unsigned int text_coords_len)
|
||||||
|
{
|
||||||
|
ClutterPaintOperation operation = PAINT_OP_INIT;
|
||||||
|
|
||||||
|
g_return_if_fail (CLUTTER_IS_PAINT_NODE (node));
|
||||||
|
g_return_if_fail (rect != NULL);
|
||||||
|
|
||||||
|
clutter_paint_node_maybe_init_operations (node);
|
||||||
|
|
||||||
|
clutter_paint_op_init_multitex_rect (&operation, rect, text_coords, text_coords_len);
|
||||||
|
g_array_append_val (node->operations, operation);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_paint_node_add_path: (skip)
|
* clutter_paint_node_add_path: (skip)
|
||||||
* @node: a #ClutterPaintNode
|
* @node: a #ClutterPaintNode
|
||||||
@@ -936,15 +989,15 @@ clutter_paint_node_add_primitive (ClutterPaintNode *node,
|
|||||||
g_array_append_val (node->operations, operation);
|
g_array_append_val (node->operations, operation);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*< private >
|
/**
|
||||||
* _clutter_paint_node_paint:
|
* clutter_paint_node_paint:
|
||||||
* @node: a #ClutterPaintNode
|
* @node: a #ClutterPaintNode
|
||||||
*
|
*
|
||||||
* Paints the @node using the class implementation, traversing
|
* Paints the @node using the class implementation, traversing
|
||||||
* its children, if any.
|
* its children, if any.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_clutter_paint_node_paint (ClutterPaintNode *node)
|
clutter_paint_node_paint (ClutterPaintNode *node)
|
||||||
{
|
{
|
||||||
ClutterPaintNodeClass *klass = CLUTTER_PAINT_NODE_GET_CLASS (node);
|
ClutterPaintNodeClass *klass = CLUTTER_PAINT_NODE_GET_CLASS (node);
|
||||||
ClutterPaintNode *iter;
|
ClutterPaintNode *iter;
|
||||||
@@ -961,7 +1014,7 @@ _clutter_paint_node_paint (ClutterPaintNode *node)
|
|||||||
iter != NULL;
|
iter != NULL;
|
||||||
iter = iter->next_sibling)
|
iter = iter->next_sibling)
|
||||||
{
|
{
|
||||||
_clutter_paint_node_paint (iter);
|
clutter_paint_node_paint (iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res)
|
if (res)
|
||||||
@@ -1006,7 +1059,7 @@ clutter_paint_node_to_json (ClutterPaintNode *node)
|
|||||||
|
|
||||||
if (node->operations != NULL)
|
if (node->operations != NULL)
|
||||||
{
|
{
|
||||||
guint i;
|
guint i, j;
|
||||||
|
|
||||||
for (i = 0; i < node->operations->len; i++)
|
for (i = 0; i < node->operations->len; i++)
|
||||||
{
|
{
|
||||||
@@ -1031,6 +1084,19 @@ clutter_paint_node_to_json (ClutterPaintNode *node)
|
|||||||
json_builder_end_array (builder);
|
json_builder_end_array (builder);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PAINT_OP_MULTITEX_RECT:
|
||||||
|
json_builder_set_member_name (builder, "texrect");
|
||||||
|
json_builder_begin_array (builder);
|
||||||
|
|
||||||
|
for (j = 0; i < op->multitex_coords->len; j++)
|
||||||
|
{
|
||||||
|
float coord = g_array_index (op->multitex_coords, float, j);
|
||||||
|
json_builder_add_double_value (builder, coord);
|
||||||
|
}
|
||||||
|
|
||||||
|
json_builder_end_array (builder);
|
||||||
|
break;
|
||||||
|
|
||||||
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, (gint64) op->op.path);
|
||||||
|
@@ -49,6 +49,9 @@ ClutterPaintNode * clutter_paint_node_ref (Clutter
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_paint_node_unref (ClutterPaintNode *node);
|
void clutter_paint_node_unref (ClutterPaintNode *node);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
void clutter_paint_node_paint (ClutterPaintNode *node);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_paint_node_set_name (ClutterPaintNode *node,
|
void clutter_paint_node_set_name (ClutterPaintNode *node,
|
||||||
const char *name);
|
const char *name);
|
||||||
@@ -67,6 +70,12 @@ void clutter_paint_node_add_texture_rectangle (Clutter
|
|||||||
float x_2,
|
float x_2,
|
||||||
float y_2);
|
float y_2);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
void clutter_paint_node_add_multitexture_rectangle (ClutterPaintNode *node,
|
||||||
|
const ClutterActorBox *rect,
|
||||||
|
const float *text_coords,
|
||||||
|
unsigned int text_coords_len);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_paint_node_add_path (ClutterPaintNode *node,
|
void clutter_paint_node_add_path (ClutterPaintNode *node,
|
||||||
CoglPath *path);
|
CoglPath *path);
|
||||||
|
@@ -83,16 +83,13 @@ _clutter_paint_node_init_types (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Root node, private
|
* Root node
|
||||||
*
|
*
|
||||||
* any frame can only have a since RootNode instance for each
|
* any frame can only have a since RootNode instance for each
|
||||||
* top-level actor.
|
* top-level actor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define clutter_root_node_get_type _clutter_root_node_get_type
|
#define clutter_root_node_get_type clutter_root_node_get_type
|
||||||
|
|
||||||
typedef struct _ClutterRootNode ClutterRootNode;
|
|
||||||
typedef struct _ClutterPaintNodeClass ClutterRootNodeClass;
|
|
||||||
|
|
||||||
struct _ClutterRootNode
|
struct _ClutterRootNode
|
||||||
{
|
{
|
||||||
@@ -111,6 +108,8 @@ clutter_root_node_pre_draw (ClutterPaintNode *node)
|
|||||||
{
|
{
|
||||||
ClutterRootNode *rnode = (ClutterRootNode *) node;
|
ClutterRootNode *rnode = (ClutterRootNode *) node;
|
||||||
|
|
||||||
|
cogl_push_framebuffer (rnode->framebuffer);
|
||||||
|
|
||||||
cogl_framebuffer_clear (rnode->framebuffer,
|
cogl_framebuffer_clear (rnode->framebuffer,
|
||||||
rnode->clear_flags,
|
rnode->clear_flags,
|
||||||
&rnode->clear_color);
|
&rnode->clear_color);
|
||||||
@@ -121,6 +120,7 @@ clutter_root_node_pre_draw (ClutterPaintNode *node)
|
|||||||
static void
|
static void
|
||||||
clutter_root_node_post_draw (ClutterPaintNode *node)
|
clutter_root_node_post_draw (ClutterPaintNode *node)
|
||||||
{
|
{
|
||||||
|
cogl_pop_framebuffer ();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -158,13 +158,13 @@ clutter_root_node_init (ClutterRootNode *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ClutterPaintNode *
|
ClutterPaintNode *
|
||||||
_clutter_root_node_new (CoglFramebuffer *framebuffer,
|
clutter_root_node_new (CoglFramebuffer *framebuffer,
|
||||||
const ClutterColor *clear_color,
|
const ClutterColor *clear_color,
|
||||||
CoglBufferBit clear_flags)
|
CoglBufferBit clear_flags)
|
||||||
{
|
{
|
||||||
ClutterRootNode *res;
|
ClutterRootNode *res;
|
||||||
|
|
||||||
res = _clutter_paint_node_create (_clutter_root_node_get_type ());
|
res = _clutter_paint_node_create (CLUTTER_TYPE_ROOT_NODE);
|
||||||
|
|
||||||
cogl_color_init_from_4ub (&res->clear_color,
|
cogl_color_init_from_4ub (&res->clear_color,
|
||||||
clear_color->red,
|
clear_color->red,
|
||||||
@@ -431,6 +431,17 @@ clutter_pipeline_node_draw (ClutterPaintNode *node)
|
|||||||
op->op.texrect[7]);
|
op->op.texrect[7]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PAINT_OP_MULTITEX_RECT:
|
||||||
|
cogl_framebuffer_draw_multitextured_rectangle (cogl_get_draw_framebuffer (),
|
||||||
|
pnode->pipeline,
|
||||||
|
op->op.texrect[0],
|
||||||
|
op->op.texrect[1],
|
||||||
|
op->op.texrect[2],
|
||||||
|
op->op.texrect[3],
|
||||||
|
(float*) op->multitex_coords->data,
|
||||||
|
op->multitex_coords->len);
|
||||||
|
break;
|
||||||
|
|
||||||
case PAINT_OP_PATH:
|
case PAINT_OP_PATH:
|
||||||
cogl_path_fill (op->op.path);
|
cogl_path_fill (op->op.path);
|
||||||
break;
|
break;
|
||||||
@@ -827,6 +838,7 @@ clutter_text_node_draw (ClutterPaintNode *node)
|
|||||||
cogl_framebuffer_pop_clip (fb);
|
cogl_framebuffer_pop_clip (fb);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PAINT_OP_MULTITEX_RECT:
|
||||||
case PAINT_OP_PATH:
|
case PAINT_OP_PATH:
|
||||||
case PAINT_OP_PRIMITIVE:
|
case PAINT_OP_PRIMITIVE:
|
||||||
case PAINT_OP_INVALID:
|
case PAINT_OP_INVALID:
|
||||||
@@ -992,6 +1004,7 @@ clutter_clip_node_pre_draw (ClutterPaintNode *node)
|
|||||||
retval = TRUE;
|
retval = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PAINT_OP_MULTITEX_RECT:
|
||||||
case PAINT_OP_PRIMITIVE:
|
case PAINT_OP_PRIMITIVE:
|
||||||
case PAINT_OP_INVALID:
|
case PAINT_OP_INVALID:
|
||||||
break;
|
break;
|
||||||
@@ -1025,6 +1038,7 @@ clutter_clip_node_post_draw (ClutterPaintNode *node)
|
|||||||
cogl_framebuffer_pop_clip (fb);
|
cogl_framebuffer_pop_clip (fb);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PAINT_OP_MULTITEX_RECT:
|
||||||
case PAINT_OP_PRIMITIVE:
|
case PAINT_OP_PRIMITIVE:
|
||||||
case PAINT_OP_INVALID:
|
case PAINT_OP_INVALID:
|
||||||
break;
|
break;
|
||||||
@@ -1180,6 +1194,17 @@ clutter_layer_node_post_draw (ClutterPaintNode *node)
|
|||||||
cogl_pop_source ();
|
cogl_pop_source ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PAINT_OP_MULTITEX_RECT:
|
||||||
|
cogl_framebuffer_draw_multitextured_rectangle (cogl_get_draw_framebuffer (),
|
||||||
|
lnode->state,
|
||||||
|
op->op.texrect[0],
|
||||||
|
op->op.texrect[1],
|
||||||
|
op->op.texrect[2],
|
||||||
|
op->op.texrect[3],
|
||||||
|
(float*) op->multitex_coords->data,
|
||||||
|
op->multitex_coords->len);
|
||||||
|
break;
|
||||||
|
|
||||||
case PAINT_OP_PATH:
|
case PAINT_OP_PATH:
|
||||||
cogl_push_source (lnode->state);
|
cogl_push_source (lnode->state);
|
||||||
cogl_path_fill (op->op.path);
|
cogl_path_fill (op->op.path);
|
||||||
|
@@ -143,6 +143,26 @@ 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_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_IS_ROOT_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ROOT_NODE))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterRootNode:
|
||||||
|
*
|
||||||
|
* The #ClutterRootNode structure is an opaque
|
||||||
|
* type whose members cannot be directly accessed.
|
||||||
|
*/
|
||||||
|
typedef struct _ClutterRootNode ClutterRootNode;
|
||||||
|
typedef struct _ClutterPaintNodeClass ClutterRootNodeClass;
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
GType clutter_root_node_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
ClutterPaintNode * clutter_root_node_new (CoglFramebuffer *framebuffer,
|
||||||
|
const ClutterColor *clear_color,
|
||||||
|
CoglBufferBit clear_flags);
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_PAINT_NODES_H__ */
|
#endif /* __CLUTTER_PAINT_NODES_H__ */
|
||||||
|
@@ -35,6 +35,7 @@
|
|||||||
#include "clutter-paint-volume-private.h"
|
#include "clutter-paint-volume-private.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
#include "clutter-stage-private.h"
|
#include "clutter-stage-private.h"
|
||||||
|
#include "clutter-actor-box-private.h"
|
||||||
|
|
||||||
G_DEFINE_BOXED_TYPE (ClutterPaintVolume, clutter_paint_volume,
|
G_DEFINE_BOXED_TYPE (ClutterPaintVolume, clutter_paint_volume,
|
||||||
clutter_paint_volume_copy,
|
clutter_paint_volume_copy,
|
||||||
@@ -1138,8 +1139,6 @@ _clutter_paint_volume_get_stage_paint_box (ClutterPaintVolume *pv,
|
|||||||
CoglMatrix modelview;
|
CoglMatrix modelview;
|
||||||
CoglMatrix projection;
|
CoglMatrix projection;
|
||||||
float viewport[4];
|
float viewport[4];
|
||||||
float width;
|
|
||||||
float height;
|
|
||||||
|
|
||||||
_clutter_paint_volume_copy_static (pv, &projected_pv);
|
_clutter_paint_volume_copy_static (pv, &projected_pv);
|
||||||
|
|
||||||
@@ -1164,50 +1163,22 @@ _clutter_paint_volume_get_stage_paint_box (ClutterPaintVolume *pv,
|
|||||||
|
|
||||||
_clutter_paint_volume_get_bounding_box (&projected_pv, box);
|
_clutter_paint_volume_get_bounding_box (&projected_pv, box);
|
||||||
|
|
||||||
/* The aim here is that for a given rectangle defined with floating point
|
if (pv->is_2d && pv->actor &&
|
||||||
* coordinates we want to determine a stable quantized size in pixels
|
clutter_actor_get_z_position (pv->actor) == 0)
|
||||||
* that doesn't vary due to the original box's sub-pixel position.
|
{
|
||||||
*
|
/* If the volume/actor are perfectly 2D, take the bounding box as
|
||||||
* The reason this is important is because effects will use this
|
* good. We won't need to add any extra room for sub-pixel positioning
|
||||||
* API to determine the size of offscreen framebuffers and so for
|
* in this case.
|
||||||
* a fixed-size object that may be animated accross the screen we
|
*/
|
||||||
* want to make sure that the stage paint-box has an equally stable
|
clutter_paint_volume_free (&projected_pv);
|
||||||
* size so that effects aren't made to continuously re-allocate
|
box->x1 = CLUTTER_NEARBYINT (box->x1);
|
||||||
* a corresponding fbo.
|
box->y1 = CLUTTER_NEARBYINT (box->y1);
|
||||||
*
|
box->x2 = CLUTTER_NEARBYINT (box->x2);
|
||||||
* The other thing we consider is that the calculation of this box is
|
box->y2 = CLUTTER_NEARBYINT (box->y2);
|
||||||
* subject to floating point precision issues that might be slightly
|
return;
|
||||||
* different to the precision issues involved with actually painting the
|
}
|
||||||
* actor, which might result in painting slightly leaking outside the
|
|
||||||
* user's calculated paint-volume. For this we simply aim to pad out the
|
|
||||||
* paint-volume by at least half a pixel all the way around.
|
|
||||||
*/
|
|
||||||
width = box->x2 - box->x1;
|
|
||||||
height = box->y2 - box->y1;
|
|
||||||
width = CLUTTER_NEARBYINT (width);
|
|
||||||
height = CLUTTER_NEARBYINT (height);
|
|
||||||
/* XXX: NB the width/height may now be up to 0.5px too small so we
|
|
||||||
* must also pad by 0.25px all around to account for this. In total we
|
|
||||||
* must padd by at least 0.75px around all sides. */
|
|
||||||
|
|
||||||
/* XXX: The furthest that we can overshoot the bottom right corner by
|
_clutter_actor_box_enlarge_for_effects (box);
|
||||||
* here is 1.75px in total if you consider that the 0.75 padding could
|
|
||||||
* just cross an integer boundary and so ceil will effectively add 1.
|
|
||||||
*/
|
|
||||||
box->x2 = ceilf (box->x2 + 0.75);
|
|
||||||
box->y2 = ceilf (box->y2 + 0.75);
|
|
||||||
|
|
||||||
/* Now we redefine the top-left relative to the bottom right based on the
|
|
||||||
* rounded width/height determined above + a constant so that the overall
|
|
||||||
* size of the box will be stable and not dependant on the box's
|
|
||||||
* position.
|
|
||||||
*
|
|
||||||
* Adding 3px to the width/height will ensure we cover the maximum of
|
|
||||||
* 1.75px padding on the bottom/right and still ensure we have > 0.75px
|
|
||||||
* padding on the top/left.
|
|
||||||
*/
|
|
||||||
box->x1 = box->x2 - width - 3;
|
|
||||||
box->y1 = box->y2 - height - 3;
|
|
||||||
|
|
||||||
clutter_paint_volume_free (&projected_pv);
|
clutter_paint_volume_free (&projected_pv);
|
||||||
}
|
}
|
||||||
|
@@ -961,6 +961,7 @@ clutter_pan_action_get_motion_delta (ClutterPanAction *self,
|
|||||||
return clutter_pan_action_get_interpolated_delta (self, delta_x, delta_y);
|
return clutter_pan_action_get_interpolated_delta (self, delta_x, delta_y);
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
|
return 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -202,7 +202,7 @@ gboolean _clutter_feature_init (GError **error);
|
|||||||
|
|
||||||
/* Diagnostic mode */
|
/* Diagnostic mode */
|
||||||
gboolean _clutter_diagnostic_enabled (void);
|
gboolean _clutter_diagnostic_enabled (void);
|
||||||
void _clutter_diagnostic_message (const char *fmt, ...);
|
void _clutter_diagnostic_message (const char *fmt, ...) G_GNUC_PRINTF (1, 2);
|
||||||
|
|
||||||
/* Picking code */
|
/* Picking code */
|
||||||
guint _clutter_pixel_to_id (guchar pixel[4]);
|
guint _clutter_pixel_to_id (guchar pixel[4]);
|
||||||
|
@@ -84,9 +84,9 @@ enum
|
|||||||
static GParamSpec *obj_props[PROP_LAST] = { NULL, };
|
static GParamSpec *obj_props[PROP_LAST] = { NULL, };
|
||||||
static GParamSpec *animatable_props[ANIM_PROP_LAST] = { NULL, };
|
static GParamSpec *animatable_props[ANIM_PROP_LAST] = { NULL, };
|
||||||
|
|
||||||
static ClutterAnimatableIface *parent_animatable_iface = NULL;
|
static ClutterAnimatableInterface *parent_animatable_iface = NULL;
|
||||||
|
|
||||||
static void clutter_animatable_iface_init (ClutterAnimatableIface *iface);
|
static void clutter_animatable_iface_init (ClutterAnimatableInterface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (ClutterScrollActor, clutter_scroll_actor, CLUTTER_TYPE_ACTOR,
|
G_DEFINE_TYPE_WITH_CODE (ClutterScrollActor, clutter_scroll_actor, CLUTTER_TYPE_ACTOR,
|
||||||
G_ADD_PRIVATE (ClutterScrollActor)
|
G_ADD_PRIVATE (ClutterScrollActor)
|
||||||
@@ -240,7 +240,7 @@ clutter_scroll_actor_get_initial_state (ClutterAnimatable *animatable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_animatable_iface_init (ClutterAnimatableIface *iface)
|
clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
|
||||||
{
|
{
|
||||||
parent_animatable_iface = g_type_interface_peek_parent (iface);
|
parent_animatable_iface = g_type_interface_peek_parent (iface);
|
||||||
|
|
||||||
|
@@ -333,6 +333,7 @@ clutter_shader_effect_create_shader (ClutterShaderEffect *self)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
|
return COGL_INVALID_HANDLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -87,7 +87,7 @@ const ClutterPlane *_clutter_stage_get_clip (ClutterStage *stage);
|
|||||||
ClutterStageQueueRedrawEntry *_clutter_stage_queue_actor_redraw (ClutterStage *stage,
|
ClutterStageQueueRedrawEntry *_clutter_stage_queue_actor_redraw (ClutterStage *stage,
|
||||||
ClutterStageQueueRedrawEntry *entry,
|
ClutterStageQueueRedrawEntry *entry,
|
||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
ClutterPaintVolume *clip);
|
const ClutterPaintVolume *clip);
|
||||||
void _clutter_stage_queue_redraw_entry_invalidate (ClutterStageQueueRedrawEntry *entry);
|
void _clutter_stage_queue_redraw_entry_invalidate (ClutterStageQueueRedrawEntry *entry);
|
||||||
|
|
||||||
CoglFramebuffer *_clutter_stage_get_active_framebuffer (ClutterStage *stage);
|
CoglFramebuffer *_clutter_stage_get_active_framebuffer (ClutterStage *stage);
|
||||||
|
@@ -6,9 +6,13 @@
|
|||||||
#include "clutter-stage-window.h"
|
#include "clutter-stage-window.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
|
|
||||||
#define clutter_stage_window_get_type _clutter_stage_window_get_type
|
/**
|
||||||
|
* SECTION:clutter-stage-window
|
||||||
typedef ClutterStageWindowIface ClutterStageWindowInterface;
|
* @short_description: Handles the implementation for ClutterStage
|
||||||
|
*
|
||||||
|
* #ClutterStageWindow is an interface that provides the implementation for the
|
||||||
|
* #ClutterStage actor, abstracting away the specifics of the windowing system.
|
||||||
|
*/
|
||||||
|
|
||||||
G_DEFINE_INTERFACE (ClutterStageWindow, clutter_stage_window, G_TYPE_OBJECT);
|
G_DEFINE_INTERFACE (ClutterStageWindow, clutter_stage_window, G_TYPE_OBJECT);
|
||||||
|
|
||||||
@@ -36,6 +40,12 @@ clutter_stage_window_default_init (ClutterStageWindowInterface *iface)
|
|||||||
g_object_interface_install_property (iface, pspec);
|
g_object_interface_install_property (iface, pspec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* _clutter_stage_window_get_wrapper:
|
||||||
|
* @window: a #ClutterStageWindow object
|
||||||
|
*
|
||||||
|
* Returns the pointer to the #ClutterStage it's part of.
|
||||||
|
*/
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
_clutter_stage_window_get_wrapper (ClutterStageWindow *window)
|
_clutter_stage_window_get_wrapper (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
@@ -46,7 +56,7 @@ void
|
|||||||
_clutter_stage_window_set_title (ClutterStageWindow *window,
|
_clutter_stage_window_set_title (ClutterStageWindow *window,
|
||||||
const gchar *title)
|
const gchar *title)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||||
|
|
||||||
if (iface->set_title)
|
if (iface->set_title)
|
||||||
iface->set_title (window, title);
|
iface->set_title (window, title);
|
||||||
@@ -56,7 +66,7 @@ void
|
|||||||
_clutter_stage_window_set_fullscreen (ClutterStageWindow *window,
|
_clutter_stage_window_set_fullscreen (ClutterStageWindow *window,
|
||||||
gboolean is_fullscreen)
|
gboolean is_fullscreen)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||||
|
|
||||||
if (iface->set_fullscreen)
|
if (iface->set_fullscreen)
|
||||||
iface->set_fullscreen (window, is_fullscreen);
|
iface->set_fullscreen (window, is_fullscreen);
|
||||||
@@ -66,7 +76,7 @@ void
|
|||||||
_clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
|
_clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
|
||||||
gboolean is_visible)
|
gboolean is_visible)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||||
|
|
||||||
if (iface->set_cursor_visible)
|
if (iface->set_cursor_visible)
|
||||||
iface->set_cursor_visible (window, is_visible);
|
iface->set_cursor_visible (window, is_visible);
|
||||||
@@ -124,7 +134,7 @@ void
|
|||||||
_clutter_stage_window_schedule_update (ClutterStageWindow *window,
|
_clutter_stage_window_schedule_update (ClutterStageWindow *window,
|
||||||
int sync_delay)
|
int sync_delay)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *iface;
|
ClutterStageWindowInterface *iface;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
||||||
|
|
||||||
@@ -138,10 +148,18 @@ _clutter_stage_window_schedule_update (ClutterStageWindow *window,
|
|||||||
iface->schedule_update (window, sync_delay);
|
iface->schedule_update (window, sync_delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* _clutter_stage_window_get_update_time:
|
||||||
|
* @window: a #ClutterStageWindow object
|
||||||
|
*
|
||||||
|
* See _clutter_stage_get_update_time() for more info.
|
||||||
|
*
|
||||||
|
* Returns: The timestamp of the update time
|
||||||
|
*/
|
||||||
gint64
|
gint64
|
||||||
_clutter_stage_window_get_update_time (ClutterStageWindow *window)
|
_clutter_stage_window_get_update_time (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *iface;
|
ClutterStageWindowInterface *iface;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), 0);
|
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), 0);
|
||||||
|
|
||||||
@@ -155,10 +173,16 @@ _clutter_stage_window_get_update_time (ClutterStageWindow *window)
|
|||||||
return iface->get_update_time (window);
|
return iface->get_update_time (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* _clutter_stage_window_clear_update_time:
|
||||||
|
* @window: a #ClutterStageWindow object
|
||||||
|
*
|
||||||
|
* Clears the update time. See _clutter_stage_clear_update_time() for more info.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
_clutter_stage_window_clear_update_time (ClutterStageWindow *window)
|
_clutter_stage_window_clear_update_time (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *iface;
|
ClutterStageWindowInterface *iface;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
||||||
|
|
||||||
@@ -176,7 +200,7 @@ void
|
|||||||
_clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
|
_clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
|
||||||
cairo_rectangle_int_t *stage_clip)
|
cairo_rectangle_int_t *stage_clip)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *iface;
|
ClutterStageWindowInterface *iface;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
||||||
|
|
||||||
@@ -196,7 +220,7 @@ _clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
|
|||||||
gboolean
|
gboolean
|
||||||
_clutter_stage_window_has_redraw_clips (ClutterStageWindow *window)
|
_clutter_stage_window_has_redraw_clips (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *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);
|
||||||
|
|
||||||
@@ -218,7 +242,7 @@ _clutter_stage_window_has_redraw_clips (ClutterStageWindow *window)
|
|||||||
gboolean
|
gboolean
|
||||||
_clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window)
|
_clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *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);
|
||||||
|
|
||||||
@@ -233,7 +257,7 @@ gboolean
|
|||||||
_clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
|
_clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
|
||||||
cairo_rectangle_int_t *stage_clip)
|
cairo_rectangle_int_t *stage_clip)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *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);
|
||||||
|
|
||||||
@@ -248,7 +272,7 @@ void
|
|||||||
_clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
|
_clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
|
||||||
gboolean accept_focus)
|
gboolean accept_focus)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *iface;
|
ClutterStageWindowInterface *iface;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
||||||
|
|
||||||
@@ -260,7 +284,7 @@ _clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
|
|||||||
void
|
void
|
||||||
_clutter_stage_window_redraw (ClutterStageWindow *window)
|
_clutter_stage_window_redraw (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *iface;
|
ClutterStageWindowInterface *iface;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
||||||
|
|
||||||
@@ -275,7 +299,7 @@ _clutter_stage_window_get_dirty_pixel (ClutterStageWindow *window,
|
|||||||
ClutterStageView *view,
|
ClutterStageView *view,
|
||||||
int *x, int *y)
|
int *x, int *y)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *iface;
|
ClutterStageWindowInterface *iface;
|
||||||
|
|
||||||
*x = 0;
|
*x = 0;
|
||||||
*y = 0;
|
*y = 0;
|
||||||
@@ -290,7 +314,7 @@ _clutter_stage_window_get_dirty_pixel (ClutterStageWindow *window,
|
|||||||
gboolean
|
gboolean
|
||||||
_clutter_stage_window_can_clip_redraws (ClutterStageWindow *window)
|
_clutter_stage_window_can_clip_redraws (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *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);
|
||||||
|
|
||||||
@@ -304,7 +328,7 @@ _clutter_stage_window_can_clip_redraws (ClutterStageWindow *window)
|
|||||||
GList *
|
GList *
|
||||||
_clutter_stage_window_get_views (ClutterStageWindow *window)
|
_clutter_stage_window_get_views (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||||
|
|
||||||
return iface->get_views (window);
|
return iface->get_views (window);
|
||||||
}
|
}
|
||||||
@@ -312,7 +336,7 @@ _clutter_stage_window_get_views (ClutterStageWindow *window)
|
|||||||
void
|
void
|
||||||
_clutter_stage_window_finish_frame (ClutterStageWindow *window)
|
_clutter_stage_window_finish_frame (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||||
|
|
||||||
if (iface->finish_frame)
|
if (iface->finish_frame)
|
||||||
iface->finish_frame (window);
|
iface->finish_frame (window);
|
||||||
@@ -321,7 +345,7 @@ _clutter_stage_window_finish_frame (ClutterStageWindow *window)
|
|||||||
int64_t
|
int64_t
|
||||||
_clutter_stage_window_get_frame_counter (ClutterStageWindow *window)
|
_clutter_stage_window_get_frame_counter (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||||
|
|
||||||
if (iface->get_frame_counter)
|
if (iface->get_frame_counter)
|
||||||
return iface->get_frame_counter (window);
|
return iface->get_frame_counter (window);
|
||||||
|
@@ -7,30 +7,21 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define CLUTTER_TYPE_STAGE_WINDOW (_clutter_stage_window_get_type ())
|
#define CLUTTER_TYPE_STAGE_WINDOW (clutter_stage_window_get_type ())
|
||||||
#define CLUTTER_STAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_STAGE_WINDOW, ClutterStageWindow))
|
|
||||||
#define CLUTTER_IS_STAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_STAGE_WINDOW))
|
CLUTTER_EXPORT
|
||||||
#define CLUTTER_STAGE_WINDOW_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_STAGE_WINDOW, ClutterStageWindowIface))
|
G_DECLARE_INTERFACE (ClutterStageWindow, clutter_stage_window,
|
||||||
|
CLUTTER, STAGE_WINDOW,
|
||||||
|
GObject)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ClutterStageWindow: (skip)
|
* ClutterStageWindowInterface: (skip)
|
||||||
*
|
|
||||||
* #ClutterStageWindow is an opaque structure
|
|
||||||
* whose members should not be accessed directly
|
|
||||||
*
|
|
||||||
* Since: 0.8
|
|
||||||
*/
|
|
||||||
typedef struct _ClutterStageWindow ClutterStageWindow; /* dummy */
|
|
||||||
typedef struct _ClutterStageWindowIface ClutterStageWindowIface;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ClutterStageWindowIface: (skip)
|
|
||||||
*
|
*
|
||||||
* The interface implemented by backends for stage windows
|
* The interface implemented by backends for stage windows
|
||||||
*
|
*
|
||||||
* Since: 0.8
|
* Since: 0.8
|
||||||
*/
|
*/
|
||||||
struct _ClutterStageWindowIface
|
struct _ClutterStageWindowInterface
|
||||||
{
|
{
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
GTypeInterface parent_iface;
|
GTypeInterface parent_iface;
|
||||||
@@ -88,9 +79,6 @@ struct _ClutterStageWindowIface
|
|||||||
void (* finish_frame) (ClutterStageWindow *stage_window);
|
void (* finish_frame) (ClutterStageWindow *stage_window);
|
||||||
};
|
};
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
GType _clutter_stage_window_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
ClutterActor * _clutter_stage_window_get_wrapper (ClutterStageWindow *window);
|
ClutterActor * _clutter_stage_window_get_wrapper (ClutterStageWindow *window);
|
||||||
|
|
||||||
void _clutter_stage_window_set_title (ClutterStageWindow *window,
|
void _clutter_stage_window_set_title (ClutterStageWindow *window,
|
||||||
|
@@ -36,10 +36,10 @@
|
|||||||
* using clutter_actor_destroy(), which will take care of destroying all the
|
* using clutter_actor_destroy(), which will take care of destroying all the
|
||||||
* actors contained inside them.
|
* actors contained inside them.
|
||||||
*
|
*
|
||||||
* #ClutterStage is a proxy actor, wrapping the backend-specific
|
* #ClutterStage is a proxy actor, wrapping the backend-specific implementation
|
||||||
* implementation of the windowing system. It is possible to subclass
|
* (a #StageWindow) of the windowing system. It is possible to subclass
|
||||||
* #ClutterStage, as long as every overridden virtual function chains up to
|
* #ClutterStage, as long as every overridden virtual function chains up to the
|
||||||
* the parent class corresponding function.
|
* parent class corresponding function.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "clutter-build-config.h"
|
#include "clutter-build-config.h"
|
||||||
@@ -1274,45 +1274,44 @@ clutter_stage_real_queue_relayout (ClutterActor *self)
|
|||||||
parent_class->queue_relayout (self);
|
parent_class->queue_relayout (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static gboolean
|
||||||
clutter_stage_real_queue_redraw (ClutterActor *actor,
|
clutter_stage_real_queue_redraw (ClutterActor *actor,
|
||||||
ClutterActor *leaf)
|
ClutterActor *leaf,
|
||||||
|
ClutterPaintVolume *redraw_clip)
|
||||||
{
|
{
|
||||||
ClutterStage *stage = CLUTTER_STAGE (actor);
|
ClutterStage *stage = CLUTTER_STAGE (actor);
|
||||||
ClutterStageWindow *stage_window;
|
ClutterStageWindow *stage_window;
|
||||||
ClutterPaintVolume *redraw_clip;
|
|
||||||
ClutterActorBox bounding_box;
|
ClutterActorBox bounding_box;
|
||||||
ClutterActorBox intersection_box;
|
ClutterActorBox intersection_box;
|
||||||
cairo_rectangle_int_t geom, stage_clip;
|
cairo_rectangle_int_t geom, stage_clip;
|
||||||
|
|
||||||
if (CLUTTER_ACTOR_IN_DESTRUCTION (actor))
|
if (CLUTTER_ACTOR_IN_DESTRUCTION (actor))
|
||||||
return;
|
return TRUE;
|
||||||
|
|
||||||
/* If the backend can't do anything with redraw clips (e.g. it already knows
|
/* If the backend can't do anything with redraw clips (e.g. it already knows
|
||||||
* it needs to redraw everything anyway) then don't spend time transforming
|
* it needs to redraw everything anyway) then don't spend time transforming
|
||||||
* any clip volume into stage coordinates... */
|
* any clip volume into stage coordinates... */
|
||||||
stage_window = _clutter_stage_get_window (stage);
|
stage_window = _clutter_stage_get_window (stage);
|
||||||
if (stage_window == NULL)
|
if (stage_window == NULL)
|
||||||
return;
|
return TRUE;
|
||||||
|
|
||||||
if (_clutter_stage_window_ignoring_redraw_clips (stage_window))
|
if (_clutter_stage_window_ignoring_redraw_clips (stage_window))
|
||||||
{
|
{
|
||||||
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
|
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
|
||||||
return;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert the clip volume into stage coordinates and then into an
|
/* Convert the clip volume into stage coordinates and then into an
|
||||||
* axis aligned stage coordinates bounding box...
|
* axis aligned stage coordinates bounding box...
|
||||||
*/
|
*/
|
||||||
redraw_clip = _clutter_actor_get_queue_redraw_clip (leaf);
|
|
||||||
if (redraw_clip == NULL)
|
if (redraw_clip == NULL)
|
||||||
{
|
{
|
||||||
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
|
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
|
||||||
return;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (redraw_clip->is_empty)
|
if (redraw_clip->is_empty)
|
||||||
return;
|
return TRUE;
|
||||||
|
|
||||||
_clutter_paint_volume_get_stage_paint_box (redraw_clip,
|
_clutter_paint_volume_get_stage_paint_box (redraw_clip,
|
||||||
stage,
|
stage,
|
||||||
@@ -1328,7 +1327,7 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
|
|||||||
/* There is no need to track degenerate/empty redraw clips */
|
/* There is no need to track degenerate/empty redraw clips */
|
||||||
if (intersection_box.x2 <= intersection_box.x1 ||
|
if (intersection_box.x2 <= intersection_box.x1 ||
|
||||||
intersection_box.y2 <= intersection_box.y1)
|
intersection_box.y2 <= intersection_box.y1)
|
||||||
return;
|
return TRUE;
|
||||||
|
|
||||||
/* when converting to integer coordinates make sure we round the edges of the
|
/* when converting to integer coordinates make sure we round the edges of the
|
||||||
* clip rectangle outwards... */
|
* clip rectangle outwards... */
|
||||||
@@ -1338,6 +1337,7 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
|
|||||||
stage_clip.height = intersection_box.y2 - stage_clip.y;
|
stage_clip.height = intersection_box.y2 - stage_clip.y;
|
||||||
|
|
||||||
_clutter_stage_window_add_redraw_clip (stage_window, &stage_clip);
|
_clutter_stage_window_add_redraw_clip (stage_window, &stage_clip);
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@@ -1474,8 +1474,8 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
|
|||||||
if (G_LIKELY (!(clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS)))
|
if (G_LIKELY (!(clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS)))
|
||||||
{
|
{
|
||||||
CLUTTER_NOTE (PICK, "Pushing pick scissor clip x: %d, y: %d, 1x1",
|
CLUTTER_NOTE (PICK, "Pushing pick scissor clip x: %d, y: %d, 1x1",
|
||||||
(int) dirty_x * fb_scale,
|
(int) (dirty_x * fb_scale),
|
||||||
(int) dirty_y * fb_scale);
|
(int) (dirty_y * fb_scale));
|
||||||
cogl_framebuffer_push_scissor_clip (fb, dirty_x * fb_scale, dirty_y * fb_scale, 1, 1);
|
cogl_framebuffer_push_scissor_clip (fb, dirty_x * fb_scale, dirty_y * fb_scale, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1495,7 +1495,7 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
|
|||||||
read_x = dirty_x * fb_scale;
|
read_x = dirty_x * fb_scale;
|
||||||
read_y = dirty_y * fb_scale;
|
read_y = dirty_y * fb_scale;
|
||||||
|
|
||||||
CLUTTER_NOTE (PICK, "Performing pick at %i,%i on view %dx%d+%d+%d s: %d",
|
CLUTTER_NOTE (PICK, "Performing pick at %i,%i on view %dx%d+%d+%d s: %f",
|
||||||
x, y,
|
x, y,
|
||||||
view_layout.width, view_layout.height,
|
view_layout.width, view_layout.height,
|
||||||
view_layout.x, view_layout.y, fb_scale);
|
view_layout.x, view_layout.y, fb_scale);
|
||||||
@@ -1511,7 +1511,8 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
|
|||||||
* are drawn offscreen (as we never swap buffers)
|
* are drawn offscreen (as we never swap buffers)
|
||||||
*/
|
*/
|
||||||
context->pick_mode = mode;
|
context->pick_mode = mode;
|
||||||
_clutter_stage_paint_view (stage, view, NULL);
|
|
||||||
|
clutter_stage_do_paint_view (stage, view, NULL);
|
||||||
context->pick_mode = CLUTTER_PICK_NONE;
|
context->pick_mode = CLUTTER_PICK_NONE;
|
||||||
|
|
||||||
/* Read the color of the screen co-ords pixel. RGBA_8888_PRE is used
|
/* Read the color of the screen co-ords pixel. RGBA_8888_PRE is used
|
||||||
@@ -2248,6 +2249,8 @@ clutter_stage_class_init (ClutterStageClass *klass)
|
|||||||
* @stage: the stage that received the event
|
* @stage: the stage that received the event
|
||||||
* @frame_event: a #CoglFrameEvent
|
* @frame_event: a #CoglFrameEvent
|
||||||
* @frame_info: a #ClutterFrameInfo
|
* @frame_info: a #ClutterFrameInfo
|
||||||
|
*
|
||||||
|
* Signals that the #ClutterStage was presented on the screen to the user.
|
||||||
*/
|
*/
|
||||||
stage_signals[PRESENTED] =
|
stage_signals[PRESENTED] =
|
||||||
g_signal_new (I_("presented"),
|
g_signal_new (I_("presented"),
|
||||||
@@ -2739,7 +2742,7 @@ clutter_stage_set_fullscreen (ClutterStage *stage,
|
|||||||
if (priv->is_fullscreen != fullscreen)
|
if (priv->is_fullscreen != fullscreen)
|
||||||
{
|
{
|
||||||
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
||||||
ClutterStageWindowIface *iface;
|
ClutterStageWindowInterface *iface;
|
||||||
|
|
||||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
||||||
|
|
||||||
@@ -2804,7 +2807,7 @@ clutter_stage_set_user_resizable (ClutterStage *stage,
|
|||||||
&& priv->is_user_resizable != resizable)
|
&& priv->is_user_resizable != resizable)
|
||||||
{
|
{
|
||||||
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
||||||
ClutterStageWindowIface *iface;
|
ClutterStageWindowInterface *iface;
|
||||||
|
|
||||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
||||||
if (iface->set_user_resizable)
|
if (iface->set_user_resizable)
|
||||||
@@ -2853,7 +2856,7 @@ clutter_stage_show_cursor (ClutterStage *stage)
|
|||||||
if (!priv->is_cursor_visible)
|
if (!priv->is_cursor_visible)
|
||||||
{
|
{
|
||||||
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
||||||
ClutterStageWindowIface *iface;
|
ClutterStageWindowInterface *iface;
|
||||||
|
|
||||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
||||||
if (iface->set_cursor_visible)
|
if (iface->set_cursor_visible)
|
||||||
@@ -2886,7 +2889,7 @@ clutter_stage_hide_cursor (ClutterStage *stage)
|
|||||||
if (priv->is_cursor_visible)
|
if (priv->is_cursor_visible)
|
||||||
{
|
{
|
||||||
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
||||||
ClutterStageWindowIface *iface;
|
ClutterStageWindowInterface *iface;
|
||||||
|
|
||||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
||||||
if (iface->set_cursor_visible)
|
if (iface->set_cursor_visible)
|
||||||
@@ -3627,6 +3630,10 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
|
|||||||
float fb_scale;
|
float fb_scale;
|
||||||
float viewport_offset_x;
|
float viewport_offset_x;
|
||||||
float viewport_offset_y;
|
float viewport_offset_y;
|
||||||
|
float viewport_x;
|
||||||
|
float viewport_y;
|
||||||
|
float viewport_width;
|
||||||
|
float viewport_height;
|
||||||
float z_2d;
|
float z_2d;
|
||||||
|
|
||||||
CLUTTER_NOTE (PAINT,
|
CLUTTER_NOTE (PAINT,
|
||||||
@@ -3639,11 +3646,13 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
|
|||||||
|
|
||||||
viewport_offset_x = view_layout.x * fb_scale;
|
viewport_offset_x = view_layout.x * fb_scale;
|
||||||
viewport_offset_y = view_layout.y * fb_scale;
|
viewport_offset_y = view_layout.y * fb_scale;
|
||||||
|
viewport_x = roundf (priv->viewport[0] * fb_scale - viewport_offset_x);
|
||||||
|
viewport_y = roundf (priv->viewport[1] * fb_scale - viewport_offset_y);
|
||||||
|
viewport_width = roundf (priv->viewport[2] * fb_scale);
|
||||||
|
viewport_height = roundf (priv->viewport[3] * fb_scale);
|
||||||
cogl_framebuffer_set_viewport (fb,
|
cogl_framebuffer_set_viewport (fb,
|
||||||
priv->viewport[0] * fb_scale - viewport_offset_x,
|
viewport_x, viewport_y,
|
||||||
priv->viewport[1] * fb_scale - viewport_offset_y,
|
viewport_width, viewport_height);
|
||||||
priv->viewport[2] * fb_scale,
|
|
||||||
priv->viewport[3] * fb_scale);
|
|
||||||
|
|
||||||
perspective = priv->perspective;
|
perspective = priv->perspective;
|
||||||
|
|
||||||
@@ -3722,6 +3731,17 @@ clutter_stage_ensure_redraw (ClutterStage *stage)
|
|||||||
_clutter_master_clock_start_running (master_clock);
|
_clutter_master_clock_start_running (master_clock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_stage_is_redraw_queued: (skip)
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
clutter_stage_is_redraw_queued (ClutterStage *stage)
|
||||||
|
{
|
||||||
|
ClutterStagePrivate *priv = stage->priv;
|
||||||
|
|
||||||
|
return priv->redraw_pending;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_stage_queue_redraw:
|
* clutter_stage_queue_redraw:
|
||||||
* @stage: the #ClutterStage
|
* @stage: the #ClutterStage
|
||||||
@@ -3982,6 +4002,12 @@ clutter_stage_get_minimum_size (ClutterStage *stage,
|
|||||||
*height_p = (guint) height;
|
*height_p = (guint) height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* _clutter_stage_schedule_update:
|
||||||
|
* @window: a #ClutterStage actor
|
||||||
|
*
|
||||||
|
* Schedules a redraw of the #ClutterStage at the next optimal timestamp.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
_clutter_stage_schedule_update (ClutterStage *stage)
|
_clutter_stage_schedule_update (ClutterStage *stage)
|
||||||
{
|
{
|
||||||
@@ -3998,7 +4024,18 @@ _clutter_stage_schedule_update (ClutterStage *stage)
|
|||||||
stage->priv->sync_delay);
|
stage->priv->sync_delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the earliest time the stage is ready to update */
|
/**
|
||||||
|
* _clutter_stage_get_update_time:
|
||||||
|
* @stage: a #ClutterStage actor
|
||||||
|
*
|
||||||
|
* Returns the earliest time in which the stage is ready to update. The update
|
||||||
|
* time is set when _clutter_stage_schedule_update() is called. This can then
|
||||||
|
* be used by e.g. the #ClutterMasterClock to know when the stage needs to be
|
||||||
|
* redrawn.
|
||||||
|
*
|
||||||
|
* Returns: -1 if no redraw is needed; 0 if the backend doesn't know, or the
|
||||||
|
* timestamp (in microseconds) otherwise.
|
||||||
|
*/
|
||||||
gint64
|
gint64
|
||||||
_clutter_stage_get_update_time (ClutterStage *stage)
|
_clutter_stage_get_update_time (ClutterStage *stage)
|
||||||
{
|
{
|
||||||
@@ -4014,6 +4051,13 @@ _clutter_stage_get_update_time (ClutterStage *stage)
|
|||||||
return _clutter_stage_window_get_update_time (stage_window);
|
return _clutter_stage_window_get_update_time (stage_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* _clutter_stage_clear_update_time:
|
||||||
|
* @stage: a #ClutterStage actor
|
||||||
|
*
|
||||||
|
* Resets the update time. Call this after a redraw, so that the update time
|
||||||
|
* can again be updated.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
_clutter_stage_clear_update_time (ClutterStage *stage)
|
_clutter_stage_clear_update_time (ClutterStage *stage)
|
||||||
{
|
{
|
||||||
@@ -4139,10 +4183,10 @@ _clutter_stage_get_clip (ClutterStage *stage)
|
|||||||
* didn't explicitly do so.
|
* didn't explicitly do so.
|
||||||
*/
|
*/
|
||||||
ClutterStageQueueRedrawEntry *
|
ClutterStageQueueRedrawEntry *
|
||||||
_clutter_stage_queue_actor_redraw (ClutterStage *stage,
|
_clutter_stage_queue_actor_redraw (ClutterStage *stage,
|
||||||
ClutterStageQueueRedrawEntry *entry,
|
ClutterStageQueueRedrawEntry *entry,
|
||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
ClutterPaintVolume *clip)
|
const ClutterPaintVolume *clip)
|
||||||
{
|
{
|
||||||
ClutterStagePrivate *priv = stage->priv;
|
ClutterStagePrivate *priv = stage->priv;
|
||||||
|
|
||||||
|
@@ -250,6 +250,9 @@ void clutter_stage_ensure_viewport (ClutterStage
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_stage_ensure_redraw (ClutterStage *stage);
|
void clutter_stage_ensure_redraw (ClutterStage *stage);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
gboolean clutter_stage_is_redraw_queued (ClutterStage *stage);
|
||||||
|
|
||||||
#ifdef CLUTTER_ENABLE_EXPERIMENTAL_API
|
#ifdef CLUTTER_ENABLE_EXPERIMENTAL_API
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_stage_set_sync_delay (ClutterStage *stage,
|
void clutter_stage_set_sync_delay (ClutterStage *stage,
|
||||||
|
@@ -279,7 +279,7 @@ static const ClutterColor default_selected_text_color = { 0, 0, 0, 255 };
|
|||||||
|
|
||||||
static CoglPipeline *default_color_pipeline = NULL;
|
static CoglPipeline *default_color_pipeline = NULL;
|
||||||
|
|
||||||
static ClutterAnimatableIface *parent_animatable_iface = NULL;
|
static ClutterAnimatableInterface *parent_animatable_iface = NULL;
|
||||||
static ClutterScriptableIface *parent_scriptable_iface = NULL;
|
static ClutterScriptableIface *parent_scriptable_iface = NULL;
|
||||||
|
|
||||||
/* ClutterTextInputFocus */
|
/* ClutterTextInputFocus */
|
||||||
@@ -389,7 +389,7 @@ clutter_text_input_focus_new (ClutterText *text)
|
|||||||
|
|
||||||
/* ClutterText */
|
/* ClutterText */
|
||||||
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
|
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
|
||||||
static void clutter_animatable_iface_init (ClutterAnimatableIface *iface);
|
static void clutter_animatable_iface_init (ClutterAnimatableInterface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (ClutterText,
|
G_DEFINE_TYPE_WITH_CODE (ClutterText,
|
||||||
clutter_text,
|
clutter_text,
|
||||||
@@ -3547,7 +3547,7 @@ clutter_text_set_final_state (ClutterAnimatable *animatable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_animatable_iface_init (ClutterAnimatableIface *iface)
|
clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
|
||||||
{
|
{
|
||||||
parent_animatable_iface = g_type_interface_peek_parent (iface);
|
parent_animatable_iface = g_type_interface_peek_parent (iface);
|
||||||
|
|
||||||
|
@@ -90,7 +90,6 @@ typedef struct _ClutterVertex ClutterVertex;
|
|||||||
|
|
||||||
typedef struct _ClutterAlpha ClutterAlpha;
|
typedef struct _ClutterAlpha ClutterAlpha;
|
||||||
typedef struct _ClutterAnimation ClutterAnimation;
|
typedef struct _ClutterAnimation ClutterAnimation;
|
||||||
typedef struct _ClutterAnimator ClutterAnimator;
|
|
||||||
typedef struct _ClutterState ClutterState;
|
typedef struct _ClutterState ClutterState;
|
||||||
|
|
||||||
typedef struct _ClutterInputDeviceTool ClutterInputDeviceTool;
|
typedef struct _ClutterInputDeviceTool ClutterInputDeviceTool;
|
||||||
|
@@ -39,29 +39,6 @@
|
|||||||
#include "clutter-interval.h"
|
#include "clutter-interval.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
|
|
||||||
#include "deprecated/clutter-util.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_util_next_p2:
|
|
||||||
* @a: Value to get the next power
|
|
||||||
*
|
|
||||||
* Calculates the nearest power of two, greater than or equal to @a.
|
|
||||||
*
|
|
||||||
* Return value: The nearest power of two, greater or equal to @a.
|
|
||||||
*
|
|
||||||
* Deprecated: 1.2
|
|
||||||
*/
|
|
||||||
gint
|
|
||||||
clutter_util_next_p2 (gint a)
|
|
||||||
{
|
|
||||||
int rval = 1;
|
|
||||||
|
|
||||||
while (rval < a)
|
|
||||||
rval <<= 1;
|
|
||||||
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Help macros to scale from OpenGL <-1,1> coordinates system to
|
/* Help macros to scale from OpenGL <-1,1> coordinates system to
|
||||||
* window coordinates ranging [0,window-size]
|
* window coordinates ranging [0,window-size]
|
||||||
*/
|
*/
|
||||||
|
@@ -76,6 +76,7 @@
|
|||||||
#include "clutter-input-focus.h"
|
#include "clutter-input-focus.h"
|
||||||
#include "clutter-interval.h"
|
#include "clutter-interval.h"
|
||||||
#include "clutter-keyframe-transition.h"
|
#include "clutter-keyframe-transition.h"
|
||||||
|
#include "clutter-keymap.h"
|
||||||
#include "clutter-keysyms.h"
|
#include "clutter-keysyms.h"
|
||||||
#include "clutter-layout-manager.h"
|
#include "clutter-layout-manager.h"
|
||||||
#include "clutter-layout-meta.h"
|
#include "clutter-layout-meta.h"
|
||||||
|
@@ -60,7 +60,8 @@ typedef struct _ClutterStageViewCoglPrivate
|
|||||||
G_DEFINE_TYPE_WITH_PRIVATE (ClutterStageViewCogl, clutter_stage_view_cogl,
|
G_DEFINE_TYPE_WITH_PRIVATE (ClutterStageViewCogl, clutter_stage_view_cogl,
|
||||||
CLUTTER_TYPE_STAGE_VIEW)
|
CLUTTER_TYPE_STAGE_VIEW)
|
||||||
|
|
||||||
static void clutter_stage_window_iface_init (ClutterStageWindowIface *iface);
|
static void
|
||||||
|
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (ClutterStageCogl,
|
G_DEFINE_TYPE_WITH_CODE (ClutterStageCogl,
|
||||||
_clutter_stage_cogl,
|
_clutter_stage_cogl,
|
||||||
@@ -351,6 +352,58 @@ valid_buffer_age (ClutterStageViewCogl *view_cogl,
|
|||||||
return age < MIN (view_priv->damage_index, DAMAGE_HISTORY_MAX);
|
return age < MIN (view_priv->damage_index, DAMAGE_HISTORY_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
paint_damage_region (ClutterStageWindow *stage_window,
|
||||||
|
ClutterStageView *view,
|
||||||
|
cairo_rectangle_int_t *swap_region)
|
||||||
|
{
|
||||||
|
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view);
|
||||||
|
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
|
||||||
|
static CoglPipeline *overlay_blue = NULL;
|
||||||
|
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
||||||
|
ClutterActor *actor = CLUTTER_ACTOR (stage_cogl->wrapper);
|
||||||
|
float x_1 = swap_region->x;
|
||||||
|
float x_2 = swap_region->x + swap_region->width;
|
||||||
|
float y_1 = swap_region->y;
|
||||||
|
float y_2 = swap_region->y + swap_region->height;
|
||||||
|
CoglMatrix modelview;
|
||||||
|
|
||||||
|
if (G_UNLIKELY (overlay_blue == NULL))
|
||||||
|
{
|
||||||
|
overlay_blue = cogl_pipeline_new (ctx);
|
||||||
|
cogl_pipeline_set_color4ub (overlay_blue, 0x00, 0x00, 0x33, 0x33);
|
||||||
|
}
|
||||||
|
|
||||||
|
cogl_framebuffer_push_matrix (framebuffer);
|
||||||
|
cogl_matrix_init_identity (&modelview);
|
||||||
|
_clutter_actor_apply_modelview_transform (actor, &modelview);
|
||||||
|
cogl_framebuffer_set_modelview_matrix (framebuffer, &modelview);
|
||||||
|
|
||||||
|
/* Blue for the swap region */
|
||||||
|
cogl_framebuffer_draw_rectangle (framebuffer, overlay_blue, x_1, y_1, x_2, y_2);
|
||||||
|
|
||||||
|
/* Red for the clip */
|
||||||
|
if (stage_cogl->initialized_redraw_clip)
|
||||||
|
{
|
||||||
|
static CoglPipeline *overlay_red = NULL;
|
||||||
|
|
||||||
|
if (G_UNLIKELY (overlay_red == NULL))
|
||||||
|
{
|
||||||
|
overlay_red = cogl_pipeline_new (ctx);
|
||||||
|
cogl_pipeline_set_color4ub (overlay_red, 0x33, 0x00, 0x00, 0x33);
|
||||||
|
}
|
||||||
|
|
||||||
|
x_1 = stage_cogl->bounding_redraw_clip.x;
|
||||||
|
x_2 = stage_cogl->bounding_redraw_clip.x + stage_cogl->bounding_redraw_clip.width;
|
||||||
|
y_1 = stage_cogl->bounding_redraw_clip.y;
|
||||||
|
y_2 = stage_cogl->bounding_redraw_clip.y + stage_cogl->bounding_redraw_clip.height;
|
||||||
|
|
||||||
|
cogl_framebuffer_draw_rectangle (framebuffer, overlay_red, x_1, y_1, x_2, y_2);
|
||||||
|
}
|
||||||
|
|
||||||
|
cogl_framebuffer_pop_matrix (framebuffer);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
swap_framebuffer (ClutterStageWindow *stage_window,
|
swap_framebuffer (ClutterStageWindow *stage_window,
|
||||||
ClutterStageView *view,
|
ClutterStageView *view,
|
||||||
@@ -370,6 +423,9 @@ swap_framebuffer (ClutterStageWindow *stage_window,
|
|||||||
else
|
else
|
||||||
ndamage = 0;
|
ndamage = 0;
|
||||||
|
|
||||||
|
if (G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION)))
|
||||||
|
paint_damage_region (stage_window, view, swap_region);
|
||||||
|
|
||||||
if (cogl_is_onscreen (framebuffer))
|
if (cogl_is_onscreen (framebuffer))
|
||||||
{
|
{
|
||||||
CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer);
|
CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer);
|
||||||
@@ -521,6 +577,15 @@ calculate_scissor_region (cairo_rectangle_int_t *fb_clip_region,
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline gboolean
|
||||||
|
is_buffer_age_enabled (void)
|
||||||
|
{
|
||||||
|
/* Buffer age is disabled when running with CLUTTER_PAINT=damage-region,
|
||||||
|
* to ensure the red damage represents the currently damaged area */
|
||||||
|
return !(clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION) &&
|
||||||
|
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||||
ClutterStageView *view)
|
ClutterStageView *view)
|
||||||
@@ -558,9 +623,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
cogl_is_onscreen (fb) &&
|
cogl_is_onscreen (fb) &&
|
||||||
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_REGION);
|
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_REGION);
|
||||||
|
|
||||||
has_buffer_age =
|
has_buffer_age = cogl_is_onscreen (fb) && is_buffer_age_enabled ();
|
||||||
cogl_is_onscreen (fb) &&
|
|
||||||
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
|
|
||||||
|
|
||||||
/* NB: a zero width redraw clip == full stage redraw */
|
/* NB: a zero width redraw clip == full stage redraw */
|
||||||
if (stage_cogl->bounding_redraw_clip.width == 0)
|
if (stage_cogl->bounding_redraw_clip.width == 0)
|
||||||
@@ -891,7 +954,7 @@ clutter_stage_cogl_get_dirty_pixel (ClutterStageWindow *stage_window,
|
|||||||
CoglFramebuffer *framebuffer = clutter_stage_view_get_framebuffer (view);
|
CoglFramebuffer *framebuffer = clutter_stage_view_get_framebuffer (view);
|
||||||
gboolean has_buffer_age =
|
gboolean has_buffer_age =
|
||||||
cogl_is_onscreen (framebuffer) &&
|
cogl_is_onscreen (framebuffer) &&
|
||||||
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
|
is_buffer_age_enabled ();
|
||||||
float fb_scale;
|
float fb_scale;
|
||||||
gboolean scale_is_fractional;
|
gboolean scale_is_fractional;
|
||||||
|
|
||||||
@@ -932,7 +995,7 @@ clutter_stage_cogl_get_dirty_pixel (ClutterStageWindow *stage_window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_window_iface_init (ClutterStageWindowIface *iface)
|
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface)
|
||||||
{
|
{
|
||||||
iface->realize = clutter_stage_cogl_realize;
|
iface->realize = clutter_stage_cogl_realize;
|
||||||
iface->unrealize = clutter_stage_cogl_unrealize;
|
iface->unrealize = clutter_stage_cogl_unrealize;
|
||||||
|
@@ -9,370 +9,6 @@
|
|||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
#include "clutter-shader.h"
|
#include "clutter-shader.h"
|
||||||
|
|
||||||
typedef struct _ShaderData ShaderData;
|
|
||||||
|
|
||||||
struct _ShaderData
|
|
||||||
{
|
|
||||||
ClutterShader *shader;
|
|
||||||
|
|
||||||
/* back pointer to the actor */
|
|
||||||
ClutterActor *actor;
|
|
||||||
|
|
||||||
/* list of values that should be set on the shader
|
|
||||||
* before each paint cycle
|
|
||||||
*/
|
|
||||||
GHashTable *value_hash;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
|
||||||
shader_value_free (gpointer data)
|
|
||||||
{
|
|
||||||
GValue *var = data;
|
|
||||||
g_value_unset (var);
|
|
||||||
g_slice_free (GValue, var);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
destroy_shader_data (gpointer data)
|
|
||||||
{
|
|
||||||
ShaderData *shader_data = data;
|
|
||||||
|
|
||||||
if (shader_data == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (shader_data->shader != NULL)
|
|
||||||
{
|
|
||||||
g_object_unref (shader_data->shader);
|
|
||||||
shader_data->shader = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shader_data->value_hash != NULL)
|
|
||||||
{
|
|
||||||
g_hash_table_destroy (shader_data->value_hash);
|
|
||||||
shader_data->value_hash = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_slice_free (ShaderData, shader_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_actor_get_shader:
|
|
||||||
* @self: a #ClutterActor
|
|
||||||
*
|
|
||||||
* Queries the currently set #ClutterShader on @self.
|
|
||||||
*
|
|
||||||
* Return value: (transfer none): The currently set #ClutterShader
|
|
||||||
* or %NULL if no shader is set.
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*
|
|
||||||
* Deprecated: 1.8: Use clutter_actor_get_effect() instead.
|
|
||||||
*/
|
|
||||||
ClutterShader *
|
|
||||||
clutter_actor_get_shader (ClutterActor *self)
|
|
||||||
{
|
|
||||||
ShaderData *shader_data;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), NULL);
|
|
||||||
|
|
||||||
shader_data = g_object_get_data (G_OBJECT (self), "-clutter-actor-shader-data");
|
|
||||||
if (shader_data != NULL)
|
|
||||||
return shader_data->shader;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_actor_set_shader:
|
|
||||||
* @self: a #ClutterActor
|
|
||||||
* @shader: (allow-none): a #ClutterShader or %NULL to unset the shader.
|
|
||||||
*
|
|
||||||
* Sets the #ClutterShader to be used when rendering @self.
|
|
||||||
*
|
|
||||||
* If @shader is %NULL this function will unset any currently set shader
|
|
||||||
* for the actor.
|
|
||||||
*
|
|
||||||
* Any #ClutterEffect applied to @self will take the precedence
|
|
||||||
* over the #ClutterShader set using this function.
|
|
||||||
*
|
|
||||||
* Return value: %TRUE if the shader was successfully applied
|
|
||||||
* or removed
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*
|
|
||||||
* Deprecated: 1.8: Use #ClutterShaderEffect and
|
|
||||||
* clutter_actor_add_effect() instead.
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
clutter_actor_set_shader (ClutterActor *self,
|
|
||||||
ClutterShader *shader)
|
|
||||||
{
|
|
||||||
ShaderData *shader_data;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE);
|
|
||||||
g_return_val_if_fail (shader == NULL || CLUTTER_IS_SHADER (shader), FALSE);
|
|
||||||
|
|
||||||
if (shader != NULL)
|
|
||||||
g_object_ref (shader);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* if shader passed in is NULL we destroy the shader */
|
|
||||||
g_object_set_data (G_OBJECT (self), "-clutter-actor-shader-data", NULL);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
shader_data = g_object_get_data (G_OBJECT (self), "-clutter-actor-shader-data");
|
|
||||||
if (shader_data == NULL)
|
|
||||||
{
|
|
||||||
shader_data = g_slice_new (ShaderData);
|
|
||||||
shader_data->actor = self;
|
|
||||||
shader_data->shader = NULL;
|
|
||||||
shader_data->value_hash =
|
|
||||||
g_hash_table_new_full (g_str_hash, g_str_equal,
|
|
||||||
g_free,
|
|
||||||
shader_value_free);
|
|
||||||
|
|
||||||
g_object_set_data_full (G_OBJECT (self), "-clutter-actor-shader-data",
|
|
||||||
shader_data,
|
|
||||||
destroy_shader_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shader_data->shader != NULL)
|
|
||||||
g_object_unref (shader_data->shader);
|
|
||||||
|
|
||||||
shader_data->shader = shader;
|
|
||||||
|
|
||||||
clutter_actor_queue_redraw (self);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
set_each_param (gpointer key,
|
|
||||||
gpointer value,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
ClutterShader *shader = user_data;
|
|
||||||
const gchar *uniform = key;
|
|
||||||
GValue *var = value;
|
|
||||||
|
|
||||||
clutter_shader_set_uniform (shader, uniform, var);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
_clutter_actor_shader_pre_paint (ClutterActor *actor,
|
|
||||||
gboolean repeat)
|
|
||||||
{
|
|
||||||
ShaderData *shader_data;
|
|
||||||
ClutterShader *shader;
|
|
||||||
|
|
||||||
shader_data = g_object_get_data (G_OBJECT (actor), "-clutter-actor-shader-data");
|
|
||||||
if (shader_data == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
shader = shader_data->shader;
|
|
||||||
if (shader != NULL)
|
|
||||||
{
|
|
||||||
clutter_shader_set_is_enabled (shader, TRUE);
|
|
||||||
|
|
||||||
g_hash_table_foreach (shader_data->value_hash, set_each_param, shader);
|
|
||||||
|
|
||||||
if (!repeat)
|
|
||||||
_clutter_context_push_shader_stack (actor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
_clutter_actor_shader_post_paint (ClutterActor *actor)
|
|
||||||
{
|
|
||||||
ShaderData *shader_data;
|
|
||||||
ClutterShader *shader;
|
|
||||||
|
|
||||||
shader_data = g_object_get_data (G_OBJECT (actor), "-clutter-actor-shader-data");
|
|
||||||
if (G_LIKELY (shader_data == NULL))
|
|
||||||
return;
|
|
||||||
|
|
||||||
shader = shader_data->shader;
|
|
||||||
if (shader != NULL)
|
|
||||||
{
|
|
||||||
ClutterActor *head;
|
|
||||||
|
|
||||||
clutter_shader_set_is_enabled (shader, FALSE);
|
|
||||||
|
|
||||||
/* remove the actor from the shaders stack; if there is another
|
|
||||||
* actor inside it, then call pre-paint again to set its shader
|
|
||||||
* but this time with the second argument being TRUE, indicating
|
|
||||||
* that we are re-applying an existing shader and thus should it
|
|
||||||
* not be prepended to the stack
|
|
||||||
*/
|
|
||||||
head = _clutter_context_pop_shader_stack (actor);
|
|
||||||
if (head != NULL)
|
|
||||||
_clutter_actor_shader_pre_paint (head, TRUE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
clutter_actor_set_shader_param_internal (ClutterActor *self,
|
|
||||||
const gchar *param,
|
|
||||||
const GValue *value)
|
|
||||||
{
|
|
||||||
ShaderData *shader_data;
|
|
||||||
GValue *var;
|
|
||||||
|
|
||||||
shader_data = g_object_get_data (G_OBJECT (self), "-clutter-actor-shader-data");
|
|
||||||
if (shader_data == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var = g_slice_new0 (GValue);
|
|
||||||
g_value_init (var, G_VALUE_TYPE (value));
|
|
||||||
g_value_copy (value, var);
|
|
||||||
g_hash_table_insert (shader_data->value_hash, g_strdup (param), var);
|
|
||||||
|
|
||||||
clutter_actor_queue_redraw (self);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_actor_set_shader_param:
|
|
||||||
* @self: a #ClutterActor
|
|
||||||
* @param: the name of the parameter
|
|
||||||
* @value: the value of the parameter
|
|
||||||
*
|
|
||||||
* Sets the value for a named parameter of the shader applied
|
|
||||||
* to @actor.
|
|
||||||
*
|
|
||||||
* Since: 1.0
|
|
||||||
*
|
|
||||||
* Deprecated: 1.8: Use clutter_shader_effect_set_uniform_value() instead
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_actor_set_shader_param (ClutterActor *self,
|
|
||||||
const gchar *param,
|
|
||||||
const GValue *value)
|
|
||||||
{
|
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
|
||||||
g_return_if_fail (param != NULL);
|
|
||||||
g_return_if_fail (CLUTTER_VALUE_HOLDS_SHADER_FLOAT (value) ||
|
|
||||||
CLUTTER_VALUE_HOLDS_SHADER_INT (value) ||
|
|
||||||
CLUTTER_VALUE_HOLDS_SHADER_MATRIX (value) ||
|
|
||||||
G_VALUE_HOLDS_FLOAT (value) ||
|
|
||||||
G_VALUE_HOLDS_INT (value));
|
|
||||||
|
|
||||||
clutter_actor_set_shader_param_internal (self, param, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_actor_set_shader_param_float:
|
|
||||||
* @self: a #ClutterActor
|
|
||||||
* @param: the name of the parameter
|
|
||||||
* @value: the value of the parameter
|
|
||||||
*
|
|
||||||
* Sets the value for a named float parameter of the shader applied
|
|
||||||
* to @actor.
|
|
||||||
*
|
|
||||||
* Since: 0.8
|
|
||||||
*
|
|
||||||
* Deprecated: 1.8: Use clutter_shader_effect_set_uniform() instead
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_actor_set_shader_param_float (ClutterActor *self,
|
|
||||||
const gchar *param,
|
|
||||||
gfloat value)
|
|
||||||
{
|
|
||||||
GValue var = { 0, };
|
|
||||||
|
|
||||||
g_value_init (&var, G_TYPE_FLOAT);
|
|
||||||
g_value_set_float (&var, value);
|
|
||||||
|
|
||||||
clutter_actor_set_shader_param_internal (self, param, &var);
|
|
||||||
|
|
||||||
g_value_unset (&var);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_actor_set_shader_param_int:
|
|
||||||
* @self: a #ClutterActor
|
|
||||||
* @param: the name of the parameter
|
|
||||||
* @value: the value of the parameter
|
|
||||||
*
|
|
||||||
* Sets the value for a named int parameter of the shader applied to
|
|
||||||
* @actor.
|
|
||||||
*
|
|
||||||
* Since: 0.8
|
|
||||||
*
|
|
||||||
* Deprecated: 1.8: Use clutter_shader_effect_set_uniform() instead
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_actor_set_shader_param_int (ClutterActor *self,
|
|
||||||
const gchar *param,
|
|
||||||
gint value)
|
|
||||||
{
|
|
||||||
GValue var = { 0, };
|
|
||||||
|
|
||||||
g_value_init (&var, G_TYPE_INT);
|
|
||||||
g_value_set_int (&var, value);
|
|
||||||
|
|
||||||
clutter_actor_set_shader_param_internal (self, param, &var);
|
|
||||||
|
|
||||||
g_value_unset (&var);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_actor_set_geometry:
|
|
||||||
* @self: A #ClutterActor
|
|
||||||
* @geometry: A #ClutterGeometry
|
|
||||||
*
|
|
||||||
* Sets the actor's fixed position and forces its minimum and natural
|
|
||||||
* size, in pixels. This means the untransformed actor will have the
|
|
||||||
* given geometry. This is the same as calling clutter_actor_set_position()
|
|
||||||
* and clutter_actor_set_size().
|
|
||||||
*
|
|
||||||
* Deprecated: 1.10: Use clutter_actor_set_position() and
|
|
||||||
* clutter_actor_set_size() instead.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_actor_set_geometry (ClutterActor *self,
|
|
||||||
const ClutterGeometry *geometry)
|
|
||||||
{
|
|
||||||
g_object_freeze_notify (G_OBJECT (self));
|
|
||||||
|
|
||||||
clutter_actor_set_position (self, geometry->x, geometry->y);
|
|
||||||
clutter_actor_set_size (self, geometry->width, geometry->height);
|
|
||||||
|
|
||||||
g_object_thaw_notify (G_OBJECT (self));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_actor_get_geometry:
|
|
||||||
* @self: A #ClutterActor
|
|
||||||
* @geometry: (out caller-allocates): A location to store actors #ClutterGeometry
|
|
||||||
*
|
|
||||||
* Gets the size and position of an actor relative to its parent
|
|
||||||
* actor. This is the same as calling clutter_actor_get_position() and
|
|
||||||
* clutter_actor_get_size(). It tries to "do what you mean" and get the
|
|
||||||
* requested size and position if the actor's allocation is invalid.
|
|
||||||
*
|
|
||||||
* Deprecated: 1.10: Use clutter_actor_get_position() and
|
|
||||||
* clutter_actor_get_size(), or clutter_actor_get_allocation_geometry()
|
|
||||||
* instead.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_actor_get_geometry (ClutterActor *self,
|
|
||||||
ClutterGeometry *geometry)
|
|
||||||
{
|
|
||||||
gfloat x, y, width, height;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
|
||||||
g_return_if_fail (geometry != NULL);
|
|
||||||
|
|
||||||
clutter_actor_get_position (self, &x, &y);
|
|
||||||
clutter_actor_get_size (self, &width, &height);
|
|
||||||
|
|
||||||
geometry->x = (int) x;
|
|
||||||
geometry->y = (int) y;
|
|
||||||
geometry->width = (int) width;
|
|
||||||
geometry->height = (int) height;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_actor_get_allocation_geometry:
|
* clutter_actor_get_allocation_geometry:
|
||||||
* @self: A #ClutterActor
|
* @self: A #ClutterActor
|
||||||
|
@@ -33,13 +33,6 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_actor_set_geometry (ClutterActor *self,
|
|
||||||
const ClutterGeometry *geometry);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(clutter_actor_get_allocation_geometry)
|
|
||||||
void clutter_actor_get_geometry (ClutterActor *self,
|
|
||||||
ClutterGeometry *geometry);
|
|
||||||
CLUTTER_DEPRECATED
|
CLUTTER_DEPRECATED
|
||||||
guint32 clutter_actor_get_gid (ClutterActor *self);
|
guint32 clutter_actor_get_gid (ClutterActor *self);
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,188 +0,0 @@
|
|||||||
/*
|
|
||||||
* Clutter.
|
|
||||||
*
|
|
||||||
* An OpenGL based 'interactive canvas' library.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2010 Intel Corporation
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* Author:
|
|
||||||
* Øyvind Kolås <pippin@linux.intel.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
|
||||||
#error "Only <clutter/clutter.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CLUTTER_ANIMATOR_H__
|
|
||||||
#define __CLUTTER_ANIMATOR_H__
|
|
||||||
|
|
||||||
#include <clutter/clutter-types.h>
|
|
||||||
#include <clutter/clutter-timeline.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define CLUTTER_TYPE_ANIMATOR (clutter_animator_get_type ())
|
|
||||||
#define CLUTTER_TYPE_ANIMATOR_KEY (clutter_animator_key_get_type ())
|
|
||||||
|
|
||||||
#define CLUTTER_ANIMATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ANIMATOR, ClutterAnimator))
|
|
||||||
#define CLUTTER_ANIMATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_ANIMATOR, ClutterAnimatorClass))
|
|
||||||
#define CLUTTER_IS_ANIMATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ANIMATOR))
|
|
||||||
#define CLUTTER_IS_ANIMATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_ANIMATOR))
|
|
||||||
#define CLUTTER_ANIMATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_ANIMATOR, ClutterAnimatorClass))
|
|
||||||
|
|
||||||
/* ClutterAnimator is typedef in clutter-types.h */
|
|
||||||
|
|
||||||
typedef struct _ClutterAnimatorClass ClutterAnimatorClass;
|
|
||||||
typedef struct _ClutterAnimatorPrivate ClutterAnimatorPrivate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterAnimatorKey:
|
|
||||||
*
|
|
||||||
* A key frame inside a #ClutterAnimator
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
typedef struct _ClutterAnimatorKey ClutterAnimatorKey;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterAnimator:
|
|
||||||
*
|
|
||||||
* The #ClutterAnimator structure contains only private data and
|
|
||||||
* should be accessed using the provided API
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
struct _ClutterAnimator
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
GObject parent_instance;
|
|
||||||
|
|
||||||
ClutterAnimatorPrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterAnimatorClass:
|
|
||||||
*
|
|
||||||
* The #ClutterAnimatorClass structure contains only private data
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
struct _ClutterAnimatorClass
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
GObjectClass parent_class;
|
|
||||||
|
|
||||||
/* padding for future expansion */
|
|
||||||
gpointer _padding_dummy[16];
|
|
||||||
};
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GType clutter_animator_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
ClutterAnimator * clutter_animator_new (void);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
ClutterAnimator * clutter_animator_set_key (ClutterAnimator *animator,
|
|
||||||
GObject *object,
|
|
||||||
const gchar *property_name,
|
|
||||||
guint mode,
|
|
||||||
gdouble progress,
|
|
||||||
const GValue *value);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_animator_set (ClutterAnimator *animator,
|
|
||||||
gpointer first_object,
|
|
||||||
const gchar *first_property_name,
|
|
||||||
guint first_mode,
|
|
||||||
gdouble first_progress,
|
|
||||||
...) G_GNUC_NULL_TERMINATED;
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GList * clutter_animator_get_keys (ClutterAnimator *animator,
|
|
||||||
GObject *object,
|
|
||||||
const gchar *property_name,
|
|
||||||
gdouble progress);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_animator_remove_key (ClutterAnimator *animator,
|
|
||||||
GObject *object,
|
|
||||||
const gchar *property_name,
|
|
||||||
gdouble progress);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
ClutterTimeline * clutter_animator_start (ClutterAnimator *animator);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gboolean clutter_animator_compute_value (ClutterAnimator *animator,
|
|
||||||
GObject *object,
|
|
||||||
const gchar *property_name,
|
|
||||||
gdouble progress,
|
|
||||||
GValue *value);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
ClutterTimeline * clutter_animator_get_timeline (ClutterAnimator *animator);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_animator_set_timeline (ClutterAnimator *animator,
|
|
||||||
ClutterTimeline *timeline);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
guint clutter_animator_get_duration (ClutterAnimator *animator);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_animator_set_duration (ClutterAnimator *animator,
|
|
||||||
guint duration);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gboolean clutter_animator_property_get_ease_in (ClutterAnimator *animator,
|
|
||||||
GObject *object,
|
|
||||||
const gchar *property_name);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_animator_property_set_ease_in (ClutterAnimator *animator,
|
|
||||||
GObject *object,
|
|
||||||
const gchar *property_name,
|
|
||||||
gboolean ease_in);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
ClutterInterpolation clutter_animator_property_get_interpolation (ClutterAnimator *animator,
|
|
||||||
GObject *object,
|
|
||||||
const gchar *property_name);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_animator_property_set_interpolation (ClutterAnimator *animator,
|
|
||||||
GObject *object,
|
|
||||||
const gchar *property_name,
|
|
||||||
ClutterInterpolation interpolation);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GType clutter_animator_key_get_type (void) G_GNUC_CONST;
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GObject * clutter_animator_key_get_object (const ClutterAnimatorKey *key);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
const gchar * clutter_animator_key_get_property_name (const ClutterAnimatorKey *key);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GType clutter_animator_key_get_property_type (const ClutterAnimatorKey *key);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gulong clutter_animator_key_get_mode (const ClutterAnimatorKey *key);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gdouble clutter_animator_key_get_progress (const ClutterAnimatorKey *key);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gboolean clutter_animator_key_get_value (const ClutterAnimatorKey *key,
|
|
||||||
GValue *value);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __CLUTTER_ANIMATOR_H__ */
|
|
@@ -1,64 +0,0 @@
|
|||||||
/*
|
|
||||||
* Clutter.
|
|
||||||
*
|
|
||||||
* An OpenGL based 'interactive canvas' library.
|
|
||||||
*
|
|
||||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006, 2007, 2008 OpenedHand Ltd
|
|
||||||
* 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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
|
||||||
#error "Only <clutter/clutter.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CLUTTER_BACKEND_DEPRECATED_H__
|
|
||||||
#define __CLUTTER_BACKEND_DEPRECATED_H__
|
|
||||||
|
|
||||||
#include <clutter/clutter-types.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(ClutterSettings:font_dpi)
|
|
||||||
void clutter_backend_set_resolution (ClutterBackend *backend,
|
|
||||||
gdouble dpi);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_time)
|
|
||||||
void clutter_backend_set_double_click_time (ClutterBackend *backend,
|
|
||||||
guint msec);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_time)
|
|
||||||
guint clutter_backend_get_double_click_time (ClutterBackend *backend);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_distance)
|
|
||||||
void clutter_backend_set_double_click_distance (ClutterBackend *backend,
|
|
||||||
guint distance);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_distance)
|
|
||||||
guint clutter_backend_get_double_click_distance (ClutterBackend *backend);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(ClutterSettings:font_name)
|
|
||||||
void clutter_backend_set_font_name (ClutterBackend *backend,
|
|
||||||
const gchar *font_name);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(ClutterSettings:font_name)
|
|
||||||
const gchar * clutter_backend_get_font_name (ClutterBackend *backend);
|
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __CLUTTER_BACKEND_DEPRECATED_H__ */
|
|
@@ -1,261 +0,0 @@
|
|||||||
/*
|
|
||||||
* Clutter.
|
|
||||||
*
|
|
||||||
* An OpenGL based 'interactive canvas' library.
|
|
||||||
*
|
|
||||||
* Authored By Neil Roberts <neil@linux.intel.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2008 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 "clutter-main.h"
|
|
||||||
#include "clutter-private.h"
|
|
||||||
|
|
||||||
#include "deprecated/clutter-frame-source.h"
|
|
||||||
#include "deprecated/clutter-timeout-interval.h"
|
|
||||||
|
|
||||||
typedef struct _ClutterFrameSource ClutterFrameSource;
|
|
||||||
|
|
||||||
struct _ClutterFrameSource
|
|
||||||
{
|
|
||||||
GSource source;
|
|
||||||
|
|
||||||
ClutterTimeoutInterval timeout;
|
|
||||||
};
|
|
||||||
|
|
||||||
static gboolean clutter_frame_source_prepare (GSource *source,
|
|
||||||
gint *timeout);
|
|
||||||
static gboolean clutter_frame_source_check (GSource *source);
|
|
||||||
static gboolean clutter_frame_source_dispatch (GSource *source,
|
|
||||||
GSourceFunc callback,
|
|
||||||
gpointer user_data);
|
|
||||||
|
|
||||||
static GSourceFuncs clutter_frame_source_funcs =
|
|
||||||
{
|
|
||||||
clutter_frame_source_prepare,
|
|
||||||
clutter_frame_source_check,
|
|
||||||
clutter_frame_source_dispatch,
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_frame_source_add_full: (rename-to clutter_frame_source_add)
|
|
||||||
* @priority: the priority of the frame source. Typically this will be in the
|
|
||||||
* range between %G_PRIORITY_DEFAULT and %G_PRIORITY_HIGH.
|
|
||||||
* @fps: the number of times per second to call the function
|
|
||||||
* @func: function to call
|
|
||||||
* @data: data to pass to the function
|
|
||||||
* @notify: function to call when the timeout source is removed
|
|
||||||
*
|
|
||||||
* Sets a function to be called at regular intervals with the given
|
|
||||||
* priority. The function is called repeatedly until it returns
|
|
||||||
* %FALSE, at which point the timeout is automatically destroyed and
|
|
||||||
* the function will not be called again. The @notify function is
|
|
||||||
* called when the timeout is destroyed. The first call to the
|
|
||||||
* function will be at the end of the first @interval.
|
|
||||||
*
|
|
||||||
* This function is similar to g_timeout_add_full() except that it
|
|
||||||
* will try to compensate for delays. For example, if @func takes half
|
|
||||||
* the interval time to execute then the function will be called again
|
|
||||||
* half the interval time after it finished. In contrast
|
|
||||||
* g_timeout_add_full() would not fire until a full interval after the
|
|
||||||
* function completes so the delay between calls would be 1.0 / @fps *
|
|
||||||
* 1.5. This function does not however try to invoke the function
|
|
||||||
* multiple times to catch up missing frames if @func takes more than
|
|
||||||
* @interval ms to execute.
|
|
||||||
*
|
|
||||||
* Return value: the ID (greater than 0) of the event source.
|
|
||||||
*
|
|
||||||
* Since: 0.8
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: There is no direct replacement for this API.
|
|
||||||
*/
|
|
||||||
guint
|
|
||||||
clutter_frame_source_add_full (gint priority,
|
|
||||||
guint fps,
|
|
||||||
GSourceFunc func,
|
|
||||||
gpointer data,
|
|
||||||
GDestroyNotify notify)
|
|
||||||
{
|
|
||||||
guint ret;
|
|
||||||
GSource *source = g_source_new (&clutter_frame_source_funcs,
|
|
||||||
sizeof (ClutterFrameSource));
|
|
||||||
ClutterFrameSource *frame_source = (ClutterFrameSource *) source;
|
|
||||||
|
|
||||||
_clutter_timeout_interval_init (&frame_source->timeout, fps);
|
|
||||||
|
|
||||||
if (priority != G_PRIORITY_DEFAULT)
|
|
||||||
g_source_set_priority (source, priority);
|
|
||||||
|
|
||||||
g_source_set_name (source, "Clutter frame timeout");
|
|
||||||
g_source_set_callback (source, func, data, notify);
|
|
||||||
|
|
||||||
ret = g_source_attach (source, NULL);
|
|
||||||
|
|
||||||
g_source_unref (source);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_frame_source_add: (skip)
|
|
||||||
* @fps: the number of times per second to call the function
|
|
||||||
* @func: function to call
|
|
||||||
* @data: data to pass to the function
|
|
||||||
*
|
|
||||||
* Simple wrapper around clutter_frame_source_add_full().
|
|
||||||
*
|
|
||||||
* Return value: the ID (greater than 0) of the event source.
|
|
||||||
*
|
|
||||||
* Since: 0.8
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: There is no direct replacement for this API
|
|
||||||
*/
|
|
||||||
guint
|
|
||||||
clutter_frame_source_add (guint fps,
|
|
||||||
GSourceFunc func,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
return clutter_frame_source_add_full (G_PRIORITY_DEFAULT,
|
|
||||||
fps, func, data, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
clutter_frame_source_prepare (GSource *source,
|
|
||||||
gint *delay)
|
|
||||||
{
|
|
||||||
ClutterFrameSource *frame_source = (ClutterFrameSource *) source;
|
|
||||||
gint64 current_time;
|
|
||||||
|
|
||||||
#if GLIB_CHECK_VERSION (2, 27, 3)
|
|
||||||
current_time = g_source_get_time (source) / 1000;
|
|
||||||
#else
|
|
||||||
{
|
|
||||||
GTimeVal source_time;
|
|
||||||
g_source_get_current_time (source, &source_time);
|
|
||||||
current_time = source_time.tv_sec * 1000 + source_time.tv_usec / 1000;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return _clutter_timeout_interval_prepare (current_time,
|
|
||||||
&frame_source->timeout,
|
|
||||||
delay);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
clutter_frame_source_check (GSource *source)
|
|
||||||
{
|
|
||||||
return clutter_frame_source_prepare (source, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
clutter_frame_source_dispatch (GSource *source,
|
|
||||||
GSourceFunc callback,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
ClutterFrameSource *frame_source = (ClutterFrameSource *) source;
|
|
||||||
|
|
||||||
return _clutter_timeout_interval_dispatch (&frame_source->timeout,
|
|
||||||
callback, user_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_threads_add_frame_source_full: (rename-to clutter_threads_add_frame_source)
|
|
||||||
* @priority: the priority of the frame source. Typically this will be in the
|
|
||||||
* range between %G_PRIORITY_DEFAULT and %G_PRIORITY_HIGH.
|
|
||||||
* @fps: the number of times per second to call the function
|
|
||||||
* @func: function to call
|
|
||||||
* @data: data to pass to the function
|
|
||||||
* @notify: function to call when the timeout source is removed
|
|
||||||
*
|
|
||||||
* Sets a function to be called at regular intervals holding the Clutter
|
|
||||||
* threads lock, with the given priority. The function is called repeatedly
|
|
||||||
* until it returns %FALSE, at which point the timeout is automatically
|
|
||||||
* removed and the function will not be called again. The @notify function
|
|
||||||
* is called when the timeout is removed.
|
|
||||||
*
|
|
||||||
* This function is similar to clutter_threads_add_timeout_full()
|
|
||||||
* except that it will try to compensate for delays. For example, if
|
|
||||||
* @func takes half the interval time to execute then the function
|
|
||||||
* will be called again half the interval time after it finished. In
|
|
||||||
* contrast clutter_threads_add_timeout_full() would not fire until a
|
|
||||||
* full interval after the function completes so the delay between
|
|
||||||
* calls would be @interval * 1.5. This function does not however try
|
|
||||||
* to invoke the function multiple times to catch up missing frames if
|
|
||||||
* @func takes more than @interval ms to execute.
|
|
||||||
*
|
|
||||||
* See also clutter_threads_add_idle_full().
|
|
||||||
*
|
|
||||||
* Return value: the ID (greater than 0) of the event source.
|
|
||||||
*
|
|
||||||
* Since: 0.8
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: There is no direct replacement for this API
|
|
||||||
*/
|
|
||||||
guint
|
|
||||||
clutter_threads_add_frame_source_full (gint priority,
|
|
||||||
guint fps,
|
|
||||||
GSourceFunc func,
|
|
||||||
gpointer data,
|
|
||||||
GDestroyNotify notify)
|
|
||||||
{
|
|
||||||
ClutterThreadsDispatch *dispatch;
|
|
||||||
|
|
||||||
g_return_val_if_fail (func != NULL, 0);
|
|
||||||
|
|
||||||
dispatch = g_slice_new (ClutterThreadsDispatch);
|
|
||||||
dispatch->func = func;
|
|
||||||
dispatch->data = data;
|
|
||||||
dispatch->notify = notify;
|
|
||||||
|
|
||||||
return clutter_frame_source_add_full (priority,
|
|
||||||
fps,
|
|
||||||
_clutter_threads_dispatch, dispatch,
|
|
||||||
_clutter_threads_dispatch_free);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_threads_add_frame_source: (skip)
|
|
||||||
* @fps: the number of times per second to call the function
|
|
||||||
* @func: function to call
|
|
||||||
* @data: data to pass to the function
|
|
||||||
*
|
|
||||||
* Simple wrapper around clutter_threads_add_frame_source_full().
|
|
||||||
*
|
|
||||||
* Return value: the ID (greater than 0) of the event source.
|
|
||||||
*
|
|
||||||
* Since: 0.8
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: There is no direct replacement for this API
|
|
||||||
*/
|
|
||||||
guint
|
|
||||||
clutter_threads_add_frame_source (guint fps,
|
|
||||||
GSourceFunc func,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (func != NULL, 0);
|
|
||||||
|
|
||||||
return clutter_threads_add_frame_source_full (G_PRIORITY_DEFAULT,
|
|
||||||
fps,
|
|
||||||
func, data,
|
|
||||||
NULL);
|
|
||||||
}
|
|
@@ -1,49 +0,0 @@
|
|||||||
/*
|
|
||||||
* Clutter.
|
|
||||||
*
|
|
||||||
* An OpenGL based 'interactive canvas' library.
|
|
||||||
*
|
|
||||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2008 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_FRAME_SOURCE_H__
|
|
||||||
#define __CLUTTER_FRAME_SOURCE_H__
|
|
||||||
|
|
||||||
#include <clutter/clutter-types.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
guint clutter_frame_source_add (guint fps,
|
|
||||||
GSourceFunc func,
|
|
||||||
gpointer data);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
guint clutter_frame_source_add_full (gint priority,
|
|
||||||
guint fps,
|
|
||||||
GSourceFunc func,
|
|
||||||
gpointer data,
|
|
||||||
GDestroyNotify notify);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __CLUTTER_FRAME_SOURCE_H__ */
|
|
@@ -40,17 +40,6 @@ void clutter_threads_enter (void);
|
|||||||
CLUTTER_DEPRECATED
|
CLUTTER_DEPRECATED
|
||||||
void clutter_threads_leave (void);
|
void clutter_threads_leave (void);
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
guint clutter_threads_add_frame_source (guint fps,
|
|
||||||
GSourceFunc func,
|
|
||||||
gpointer data);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
guint clutter_threads_add_frame_source_full (gint priority,
|
|
||||||
guint fps,
|
|
||||||
GSourceFunc func,
|
|
||||||
gpointer data,
|
|
||||||
GDestroyNotify notify);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(clutter_stage_set_motion_events_enabled)
|
CLUTTER_DEPRECATED_FOR(clutter_stage_set_motion_events_enabled)
|
||||||
void clutter_set_motion_events_enabled (gboolean enable);
|
void clutter_set_motion_events_enabled (gboolean enable);
|
||||||
|
|
||||||
|
@@ -1,664 +0,0 @@
|
|||||||
/*
|
|
||||||
* Clutter.
|
|
||||||
*
|
|
||||||
* An OpenGL based 'interactive canvas' library.
|
|
||||||
*
|
|
||||||
* Authored By: Matthew Allum <mallum@openedhand.com>
|
|
||||||
* Emmanuele Bassi <ebassi@linux.intel.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 OpenedHand
|
|
||||||
* Copyright (C) 2009 Intel Corp.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SECTION:clutter-media
|
|
||||||
* @short_description: An interface for controlling playback of media data
|
|
||||||
*
|
|
||||||
* #ClutterMedia is an interface for controlling playback of media sources.
|
|
||||||
*
|
|
||||||
* Clutter core does not provide an implementation of this interface, but
|
|
||||||
* other integration libraries like Clutter-GStreamer implement it to offer
|
|
||||||
* a uniform API for applications.
|
|
||||||
*
|
|
||||||
* #ClutterMedia is available since Clutter 0.2
|
|
||||||
*
|
|
||||||
* #ClutterMedia is deprecated since Clutter 1.12. Use the Clutter-GStreamer
|
|
||||||
* API directly instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "clutter-build-config.h"
|
|
||||||
|
|
||||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
|
||||||
|
|
||||||
#include "clutter-debug.h"
|
|
||||||
#include "clutter-enum-types.h"
|
|
||||||
#include "clutter-marshal.h"
|
|
||||||
#include "clutter-media.h"
|
|
||||||
#include "clutter-main.h"
|
|
||||||
#include "clutter-private.h" /* for DBG */
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
EOS_SIGNAL,
|
|
||||||
ERROR_SIGNAL, /* can't be called 'ERROR' otherwise it clashes with wingdi.h */
|
|
||||||
|
|
||||||
LAST_SIGNAL
|
|
||||||
};
|
|
||||||
|
|
||||||
static guint media_signals[LAST_SIGNAL] = { 0, };
|
|
||||||
|
|
||||||
typedef ClutterMediaIface ClutterMediaInterface;
|
|
||||||
|
|
||||||
G_DEFINE_INTERFACE (ClutterMedia, clutter_media, G_TYPE_OBJECT);
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_media_default_init (ClutterMediaInterface *iface)
|
|
||||||
{
|
|
||||||
GParamSpec *pspec = NULL;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterMedia:uri:
|
|
||||||
*
|
|
||||||
* The location of a media file, expressed as a valid URI.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_string ("uri",
|
|
||||||
P_("URI"),
|
|
||||||
P_("URI of a media file"),
|
|
||||||
NULL,
|
|
||||||
CLUTTER_PARAM_READWRITE |
|
|
||||||
G_PARAM_DEPRECATED);
|
|
||||||
g_object_interface_install_property (iface, pspec);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterMedia:playing:
|
|
||||||
*
|
|
||||||
* Whether the #ClutterMedia actor is playing.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_boolean ("playing",
|
|
||||||
P_("Playing"),
|
|
||||||
P_("Whether the actor is playing"),
|
|
||||||
FALSE,
|
|
||||||
CLUTTER_PARAM_READWRITE |
|
|
||||||
G_PARAM_DEPRECATED);
|
|
||||||
g_object_interface_install_property (iface, pspec);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterMedia:progress:
|
|
||||||
*
|
|
||||||
* The current progress of the playback, as a normalized
|
|
||||||
* value between 0.0 and 1.0.
|
|
||||||
*
|
|
||||||
* Since: 1.0
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_double ("progress",
|
|
||||||
P_("Progress"),
|
|
||||||
P_("Current progress of the playback"),
|
|
||||||
0.0, 1.0, 0.0,
|
|
||||||
CLUTTER_PARAM_READWRITE |
|
|
||||||
G_PARAM_DEPRECATED);
|
|
||||||
g_object_interface_install_property (iface, pspec);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterMedia:subtitle-uri:
|
|
||||||
*
|
|
||||||
* The location of a subtitle file, expressed as a valid URI.
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_string ("subtitle-uri",
|
|
||||||
P_("Subtitle URI"),
|
|
||||||
P_("URI of a subtitle file"),
|
|
||||||
NULL,
|
|
||||||
CLUTTER_PARAM_READWRITE |
|
|
||||||
G_PARAM_DEPRECATED);
|
|
||||||
g_object_interface_install_property (iface, pspec);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterMedia:subtitle-font-name:
|
|
||||||
*
|
|
||||||
* The font used to display subtitles. The font description has to
|
|
||||||
* follow the same grammar as the one recognized by
|
|
||||||
* pango_font_description_from_string().
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_string ("subtitle-font-name",
|
|
||||||
P_("Subtitle Font Name"),
|
|
||||||
P_("The font used to display subtitles"),
|
|
||||||
NULL,
|
|
||||||
CLUTTER_PARAM_READWRITE |
|
|
||||||
G_PARAM_DEPRECATED);
|
|
||||||
g_object_interface_install_property (iface, pspec);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterMedia:audio-volume:
|
|
||||||
*
|
|
||||||
* The volume of the audio, as a normalized value between
|
|
||||||
* 0.0 and 1.0.
|
|
||||||
*
|
|
||||||
* Since: 1.0
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_double ("audio-volume",
|
|
||||||
P_("Audio Volume"),
|
|
||||||
P_("The volume of the audio"),
|
|
||||||
0.0, 1.0, 0.5,
|
|
||||||
CLUTTER_PARAM_READWRITE |
|
|
||||||
G_PARAM_DEPRECATED);
|
|
||||||
g_object_interface_install_property (iface, pspec);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterMedia:can-seek:
|
|
||||||
*
|
|
||||||
* Whether the current stream is seekable.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_boolean ("can-seek",
|
|
||||||
P_("Can Seek"),
|
|
||||||
P_("Whether the current stream is seekable"),
|
|
||||||
FALSE,
|
|
||||||
CLUTTER_PARAM_READABLE |
|
|
||||||
G_PARAM_DEPRECATED);
|
|
||||||
g_object_interface_install_property (iface, pspec);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterMedia:buffer-fill:
|
|
||||||
*
|
|
||||||
* The fill level of the buffer for the current stream,
|
|
||||||
* as a value between 0.0 and 1.0.
|
|
||||||
*
|
|
||||||
* Since: 1.0
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_double ("buffer-fill",
|
|
||||||
P_("Buffer Fill"),
|
|
||||||
P_("The fill level of the buffer"),
|
|
||||||
0.0, 1.0, 0.0,
|
|
||||||
CLUTTER_PARAM_READABLE |
|
|
||||||
G_PARAM_DEPRECATED);
|
|
||||||
g_object_interface_install_property (iface, pspec);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterMedia:duration:
|
|
||||||
*
|
|
||||||
* The duration of the current stream, in seconds
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_double ("duration",
|
|
||||||
P_("Duration"),
|
|
||||||
P_("The duration of the stream, in seconds"),
|
|
||||||
0, G_MAXDOUBLE, 0,
|
|
||||||
CLUTTER_PARAM_READABLE);
|
|
||||||
g_object_interface_install_property (iface, pspec);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterMedia::eos:
|
|
||||||
* @media: the #ClutterMedia instance that received the signal
|
|
||||||
*
|
|
||||||
* The ::eos signal is emitted each time the media stream ends.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
media_signals[EOS_SIGNAL] =
|
|
||||||
g_signal_new (I_("eos"),
|
|
||||||
CLUTTER_TYPE_MEDIA,
|
|
||||||
G_SIGNAL_RUN_LAST,
|
|
||||||
G_STRUCT_OFFSET (ClutterMediaIface, eos),
|
|
||||||
NULL, NULL,
|
|
||||||
_clutter_marshal_VOID__VOID,
|
|
||||||
G_TYPE_NONE, 0);
|
|
||||||
/**
|
|
||||||
* ClutterMedia::error:
|
|
||||||
* @media: the #ClutterMedia instance that received the signal
|
|
||||||
* @error: the #GError
|
|
||||||
*
|
|
||||||
* The ::error signal is emitted each time an error occurred.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
media_signals[ERROR_SIGNAL] =
|
|
||||||
g_signal_new (I_("error"),
|
|
||||||
CLUTTER_TYPE_MEDIA,
|
|
||||||
G_SIGNAL_RUN_LAST,
|
|
||||||
G_STRUCT_OFFSET (ClutterMediaIface, error),
|
|
||||||
NULL, NULL,
|
|
||||||
_clutter_marshal_VOID__BOXED,
|
|
||||||
G_TYPE_NONE, 1,
|
|
||||||
G_TYPE_ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_set_uri:
|
|
||||||
* @media: a #ClutterMedia
|
|
||||||
* @uri: the URI of the media stream
|
|
||||||
*
|
|
||||||
* Sets the URI of @media to @uri.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_media_set_uri (ClutterMedia *media,
|
|
||||||
const gchar *uri)
|
|
||||||
{
|
|
||||||
g_return_if_fail (CLUTTER_IS_MEDIA(media));
|
|
||||||
|
|
||||||
g_object_set (G_OBJECT (media), "uri", uri, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_get_uri:
|
|
||||||
* @media: a #ClutterMedia
|
|
||||||
*
|
|
||||||
* Retrieves the URI from @media.
|
|
||||||
*
|
|
||||||
* Return value: the URI of the media stream. Use g_free()
|
|
||||||
* to free the returned string
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
gchar *
|
|
||||||
clutter_media_get_uri (ClutterMedia *media)
|
|
||||||
{
|
|
||||||
gchar *retval = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_MEDIA(media), NULL);
|
|
||||||
|
|
||||||
g_object_get (G_OBJECT (media), "uri", &retval, NULL);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_set_playing:
|
|
||||||
* @media: a #ClutterMedia
|
|
||||||
* @playing: %TRUE to start playing
|
|
||||||
*
|
|
||||||
* Starts or stops playing of @media.
|
|
||||||
|
|
||||||
* The implementation might be asynchronous, so the way to know whether
|
|
||||||
* the actual playing state of the @media is to use the #GObject::notify
|
|
||||||
* signal on the #ClutterMedia:playing property and then retrieve the
|
|
||||||
* current state with clutter_media_get_playing(). ClutterGstVideoTexture
|
|
||||||
* in clutter-gst is an example of such an asynchronous implementation.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_media_set_playing (ClutterMedia *media,
|
|
||||||
gboolean playing)
|
|
||||||
{
|
|
||||||
g_return_if_fail (CLUTTER_IS_MEDIA(media));
|
|
||||||
|
|
||||||
g_object_set (G_OBJECT (media), "playing", playing, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_get_playing:
|
|
||||||
* @media: A #ClutterMedia object
|
|
||||||
*
|
|
||||||
* Retrieves the playing status of @media.
|
|
||||||
*
|
|
||||||
* Return value: %TRUE if playing, %FALSE if stopped.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
clutter_media_get_playing (ClutterMedia *media)
|
|
||||||
{
|
|
||||||
gboolean is_playing = FALSE;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_MEDIA (media), FALSE);
|
|
||||||
|
|
||||||
g_object_get (G_OBJECT (media), "playing", &is_playing, NULL);
|
|
||||||
|
|
||||||
return is_playing;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_set_progress:
|
|
||||||
* @media: a #ClutterMedia
|
|
||||||
* @progress: the progress of the playback, between 0.0 and 1.0
|
|
||||||
*
|
|
||||||
* Sets the playback progress of @media. The @progress is
|
|
||||||
* a normalized value between 0.0 (begin) and 1.0 (end).
|
|
||||||
*
|
|
||||||
* Since: 1.0
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_media_set_progress (ClutterMedia *media,
|
|
||||||
gdouble progress)
|
|
||||||
{
|
|
||||||
g_return_if_fail (CLUTTER_IS_MEDIA (media));
|
|
||||||
|
|
||||||
g_object_set (G_OBJECT (media), "progress", progress, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_get_progress:
|
|
||||||
* @media: a #ClutterMedia
|
|
||||||
*
|
|
||||||
* Retrieves the playback progress of @media.
|
|
||||||
*
|
|
||||||
* Return value: the playback progress, between 0.0 and 1.0
|
|
||||||
*
|
|
||||||
* Since: 1.0
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
gdouble
|
|
||||||
clutter_media_get_progress (ClutterMedia *media)
|
|
||||||
{
|
|
||||||
gdouble retval = 0.0;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_MEDIA (media), 0);
|
|
||||||
|
|
||||||
g_object_get (G_OBJECT (media), "progress", &retval, NULL);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_set_subtitle_uri:
|
|
||||||
* @media: a #ClutterMedia
|
|
||||||
* @uri: the URI of a subtitle file
|
|
||||||
*
|
|
||||||
* Sets the location of a subtitle file to display while playing @media.
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_media_set_subtitle_uri (ClutterMedia *media,
|
|
||||||
const char *uri)
|
|
||||||
{
|
|
||||||
g_return_if_fail (CLUTTER_IS_MEDIA (media));
|
|
||||||
|
|
||||||
g_object_set (G_OBJECT (media), "subtitle-uri", uri, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_get_subtitle_uri:
|
|
||||||
* @media: a #ClutterMedia
|
|
||||||
*
|
|
||||||
* Retrieves the URI of the subtitle file in use.
|
|
||||||
*
|
|
||||||
* Return value: the URI of the subtitle file. Use g_free()
|
|
||||||
* to free the returned string
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
gchar *
|
|
||||||
clutter_media_get_subtitle_uri (ClutterMedia *media)
|
|
||||||
{
|
|
||||||
gchar *retval = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_MEDIA(media), NULL);
|
|
||||||
|
|
||||||
g_object_get (G_OBJECT (media), "subtitle-uri", &retval, NULL);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_set_subtitle_font_name:
|
|
||||||
* @media: a #ClutterMedia
|
|
||||||
* @font_name: a font name, or %NULL to set the default font name
|
|
||||||
*
|
|
||||||
* Sets the font used by the subtitle renderer. The @font_name string must be
|
|
||||||
* either %NULL, which means that the default font name of the underlying
|
|
||||||
* implementation will be used; or must follow the grammar recognized by
|
|
||||||
* pango_font_description_from_string() like:
|
|
||||||
*
|
|
||||||
* |[
|
|
||||||
* clutter_media_set_subtitle_font_name (media, "Sans 24pt");
|
|
||||||
* ]|
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_media_set_subtitle_font_name (ClutterMedia *media,
|
|
||||||
const char *font_name)
|
|
||||||
{
|
|
||||||
g_return_if_fail (CLUTTER_IS_MEDIA (media));
|
|
||||||
|
|
||||||
g_object_set (G_OBJECT (media), "subtitle-font-name", font_name, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_get_subtitle_font_name:
|
|
||||||
* @media: a #ClutterMedia
|
|
||||||
*
|
|
||||||
* Retrieves the font name currently used.
|
|
||||||
*
|
|
||||||
* Return value: a string containing the font name. Use g_free()
|
|
||||||
* to free the returned string
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
gchar *
|
|
||||||
clutter_media_get_subtitle_font_name (ClutterMedia *media)
|
|
||||||
{
|
|
||||||
gchar *retval = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_MEDIA(media), NULL);
|
|
||||||
|
|
||||||
g_object_get (G_OBJECT (media), "subtitle-font-name", &retval, NULL);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_set_audio_volume:
|
|
||||||
* @media: a #ClutterMedia
|
|
||||||
* @volume: the volume as a double between 0.0 and 1.0
|
|
||||||
*
|
|
||||||
* Sets the playback volume of @media to @volume.
|
|
||||||
*
|
|
||||||
* Since: 1.0
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_media_set_audio_volume (ClutterMedia *media,
|
|
||||||
gdouble volume)
|
|
||||||
{
|
|
||||||
g_return_if_fail (CLUTTER_IS_MEDIA(media));
|
|
||||||
|
|
||||||
g_object_set (G_OBJECT (media), "audio-volume", volume, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_get_audio_volume:
|
|
||||||
* @media: a #ClutterMedia
|
|
||||||
*
|
|
||||||
* Retrieves the playback volume of @media.
|
|
||||||
*
|
|
||||||
* Return value: The playback volume between 0.0 and 1.0
|
|
||||||
*
|
|
||||||
* Since: 1.0
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
gdouble
|
|
||||||
clutter_media_get_audio_volume (ClutterMedia *media)
|
|
||||||
{
|
|
||||||
gdouble retval = 0.0;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_MEDIA (media), 0.0);
|
|
||||||
|
|
||||||
g_object_get (G_OBJECT (media), "audio-volume", &retval, NULL);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_get_can_seek:
|
|
||||||
* @media: a #ClutterMedia
|
|
||||||
*
|
|
||||||
* Retrieves whether @media is seekable or not.
|
|
||||||
*
|
|
||||||
* Return value: %TRUE if @media can seek, %FALSE otherwise.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
clutter_media_get_can_seek (ClutterMedia *media)
|
|
||||||
{
|
|
||||||
gboolean retval = FALSE;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_MEDIA (media), FALSE);
|
|
||||||
|
|
||||||
g_object_get (G_OBJECT (media), "can-seek", &retval, NULL);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_get_buffer_fill:
|
|
||||||
* @media: a #ClutterMedia
|
|
||||||
*
|
|
||||||
* Retrieves the amount of the stream that is buffered.
|
|
||||||
*
|
|
||||||
* Return value: the fill level, between 0.0 and 1.0
|
|
||||||
*
|
|
||||||
* Since: 1.0
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
gdouble
|
|
||||||
clutter_media_get_buffer_fill (ClutterMedia *media)
|
|
||||||
{
|
|
||||||
gdouble retval = 0.0;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_MEDIA (media), 0);
|
|
||||||
|
|
||||||
g_object_get (G_OBJECT (media), "buffer-fill", &retval, NULL);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_get_duration:
|
|
||||||
* @media: a #ClutterMedia
|
|
||||||
*
|
|
||||||
* Retrieves the duration of the media stream that @media represents.
|
|
||||||
*
|
|
||||||
* Return value: the duration of the media stream, in seconds
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
gdouble
|
|
||||||
clutter_media_get_duration (ClutterMedia *media)
|
|
||||||
{
|
|
||||||
gdouble retval = 0;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_MEDIA(media), 0);
|
|
||||||
|
|
||||||
g_object_get (G_OBJECT (media), "duration", &retval, NULL);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* helper funcs */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_media_set_filename:
|
|
||||||
* @media: a #ClutterMedia
|
|
||||||
* @filename: A filename
|
|
||||||
*
|
|
||||||
* Sets the source of @media using a file path.
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*
|
|
||||||
* Deprecated: 1.12
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_media_set_filename (ClutterMedia *media,
|
|
||||||
const gchar *filename)
|
|
||||||
{
|
|
||||||
gchar *uri;
|
|
||||||
GError *uri_error = NULL;
|
|
||||||
|
|
||||||
if (!g_path_is_absolute (filename))
|
|
||||||
{
|
|
||||||
gchar *abs_path;
|
|
||||||
|
|
||||||
abs_path = g_build_filename (g_get_current_dir (), filename, NULL);
|
|
||||||
uri = g_filename_to_uri (abs_path, NULL, &uri_error);
|
|
||||||
g_free (abs_path);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
uri = g_filename_to_uri (filename, NULL, &uri_error);
|
|
||||||
|
|
||||||
if (uri_error)
|
|
||||||
{
|
|
||||||
g_signal_emit (media, media_signals[ERROR_SIGNAL], 0, uri_error);
|
|
||||||
g_error_free (uri_error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
clutter_media_set_uri (media, uri);
|
|
||||||
|
|
||||||
g_free (uri);
|
|
||||||
}
|
|
@@ -1,121 +0,0 @@
|
|||||||
/*
|
|
||||||
* Clutter.
|
|
||||||
*
|
|
||||||
* An OpenGL based 'interactive canvas' library.
|
|
||||||
*
|
|
||||||
* Authored By: Matthew Allum <mallum@openedhand.com>
|
|
||||||
* Emmanuele Bassi <ebassi@linux.intel.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 OpenedHand
|
|
||||||
* Copyright (C) 2009 Intel Corp.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
|
||||||
#error "Only <clutter/clutter.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CLUTTER_MEDIA_H__
|
|
||||||
#define __CLUTTER_MEDIA_H__
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define CLUTTER_TYPE_MEDIA (clutter_media_get_type ())
|
|
||||||
#define CLUTTER_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_MEDIA, ClutterMedia))
|
|
||||||
#define CLUTTER_IS_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_MEDIA))
|
|
||||||
#define CLUTTER_MEDIA_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_MEDIA, ClutterMediaIface))
|
|
||||||
|
|
||||||
typedef struct _ClutterMedia ClutterMedia; /* dummy typedef */
|
|
||||||
typedef struct _ClutterMediaIface ClutterMediaIface;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterMedia:
|
|
||||||
*
|
|
||||||
* #ClutterMedia is an opaque structure whose members cannot be directly
|
|
||||||
* accessed
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterMediaIface:
|
|
||||||
* @eos: handler for the #ClutterMedia::eos signal
|
|
||||||
* @error: handler for the #ClutterMedia::error signal
|
|
||||||
*
|
|
||||||
* Interface vtable for #ClutterMedia implementations
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*/
|
|
||||||
struct _ClutterMediaIface
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
GTypeInterface base_iface;
|
|
||||||
|
|
||||||
/*< public >*/
|
|
||||||
/* signals */
|
|
||||||
void (* eos) (ClutterMedia *media);
|
|
||||||
void (* error) (ClutterMedia *media,
|
|
||||||
const GError *error);
|
|
||||||
};
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GType clutter_media_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_media_set_uri (ClutterMedia *media,
|
|
||||||
const gchar *uri);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gchar * clutter_media_get_uri (ClutterMedia *media);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_media_set_filename (ClutterMedia *media,
|
|
||||||
const gchar *filename);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_media_set_playing (ClutterMedia *media,
|
|
||||||
gboolean playing);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gboolean clutter_media_get_playing (ClutterMedia *media);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_media_set_progress (ClutterMedia *media,
|
|
||||||
gdouble progress);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gdouble clutter_media_get_progress (ClutterMedia *media);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_media_set_subtitle_uri (ClutterMedia *media,
|
|
||||||
const gchar *uri);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gchar * clutter_media_get_subtitle_uri (ClutterMedia *media);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_media_set_subtitle_font_name (ClutterMedia *media,
|
|
||||||
const char *font_name);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gchar * clutter_media_get_subtitle_font_name (ClutterMedia *media);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_media_set_audio_volume (ClutterMedia *media,
|
|
||||||
gdouble volume);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gdouble clutter_media_get_audio_volume (ClutterMedia *media);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gboolean clutter_media_get_can_seek (ClutterMedia *media);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gdouble clutter_media_get_buffer_fill (ClutterMedia *media);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gdouble clutter_media_get_duration (ClutterMedia *media);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __CLUTTER_MEDIA_H__ */
|
|
File diff suppressed because it is too large
Load Diff
@@ -1,144 +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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
|
||||||
#error "Only <clutter/clutter.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CLUTTER_SCORE_H__
|
|
||||||
#define __CLUTTER_SCORE_H__
|
|
||||||
|
|
||||||
#include <clutter/clutter-timeline.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define CLUTTER_TYPE_SCORE (clutter_score_get_type ())
|
|
||||||
|
|
||||||
#define CLUTTER_SCORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_SCORE, ClutterScore))
|
|
||||||
#define CLUTTER_SCORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_SCORE, ClutterScoreClass))
|
|
||||||
#define CLUTTER_IS_SCORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_SCORE))
|
|
||||||
#define CLUTTER_IS_SCORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_SCORE))
|
|
||||||
#define CLUTTER_SCORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_SCORE, ClutterScoreClass))
|
|
||||||
|
|
||||||
typedef struct _ClutterScore ClutterScore;
|
|
||||||
typedef struct _ClutterScorePrivate ClutterScorePrivate;
|
|
||||||
typedef struct _ClutterScoreClass ClutterScoreClass;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterScore:
|
|
||||||
*
|
|
||||||
* The #ClutterScore structure contains only private data
|
|
||||||
* and should be accessed using the provided API
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*/
|
|
||||||
struct _ClutterScore
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
GObject parent;
|
|
||||||
ClutterScorePrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterScoreClass:
|
|
||||||
* @timeline_started: handler for the #ClutterScore::timeline-started signal
|
|
||||||
* @timeline_completed: handler for the #ClutterScore::timeline-completed
|
|
||||||
* signal
|
|
||||||
* @started: handler for the #ClutterScore::started signal
|
|
||||||
* @completed: handler for the #ClutterScore::completed signal
|
|
||||||
* @paused: handler for the #ClutterScore::paused signal
|
|
||||||
*
|
|
||||||
* The #ClutterScoreClass structure contains only private data
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*/
|
|
||||||
struct _ClutterScoreClass
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
GObjectClass parent_class;
|
|
||||||
|
|
||||||
/*< public >*/
|
|
||||||
void (* timeline_started) (ClutterScore *score,
|
|
||||||
ClutterTimeline *timeline);
|
|
||||||
void (* timeline_completed) (ClutterScore *score,
|
|
||||||
ClutterTimeline *timeline);
|
|
||||||
|
|
||||||
void (* started) (ClutterScore *score);
|
|
||||||
void (* completed) (ClutterScore *score);
|
|
||||||
void (* paused) (ClutterScore *score);
|
|
||||||
|
|
||||||
/*< private >*/
|
|
||||||
/* padding for future expansion */
|
|
||||||
void (*_clutter_score_1) (void);
|
|
||||||
void (*_clutter_score_2) (void);
|
|
||||||
void (*_clutter_score_3) (void);
|
|
||||||
void (*_clutter_score_4) (void);
|
|
||||||
void (*_clutter_score_5) (void);
|
|
||||||
};
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GType clutter_score_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
ClutterScore * clutter_score_new (void);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_score_set_loop (ClutterScore *score,
|
|
||||||
gboolean loop);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gboolean clutter_score_get_loop (ClutterScore *score);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gulong clutter_score_append (ClutterScore *score,
|
|
||||||
ClutterTimeline *parent,
|
|
||||||
ClutterTimeline *timeline);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gulong clutter_score_append_at_marker (ClutterScore *score,
|
|
||||||
ClutterTimeline *parent,
|
|
||||||
const gchar *marker_name,
|
|
||||||
ClutterTimeline *timeline);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_score_remove (ClutterScore *score,
|
|
||||||
gulong id_);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_score_remove_all (ClutterScore *score);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
ClutterTimeline *clutter_score_get_timeline (ClutterScore *score,
|
|
||||||
gulong id_);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GSList * clutter_score_list_timelines (ClutterScore *score);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_score_start (ClutterScore *score);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_score_stop (ClutterScore *score);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_score_pause (ClutterScore *score);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_score_rewind (ClutterScore *score);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gboolean clutter_score_is_playing (ClutterScore *score);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __CLUTTER_SCORE_H__ */
|
|
@@ -153,30 +153,6 @@ CoglHandle clutter_shader_get_cogl_fragment_shader (ClutterShader
|
|||||||
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
||||||
CoglHandle clutter_shader_get_cogl_vertex_shader (ClutterShader *shader);
|
CoglHandle clutter_shader_get_cogl_vertex_shader (ClutterShader *shader);
|
||||||
|
|
||||||
/* ClutterActor methods */
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(clutter_actor_add_effect)
|
|
||||||
gboolean clutter_actor_set_shader (ClutterActor *self,
|
|
||||||
ClutterShader *shader);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(clutter_actor_get_effect)
|
|
||||||
ClutterShader * clutter_actor_get_shader (ClutterActor *self);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(clutter_shader_effect_set_uniform_value)
|
|
||||||
void clutter_actor_set_shader_param (ClutterActor *self,
|
|
||||||
const gchar *param,
|
|
||||||
const GValue *value);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(clutter_shader_effect_set_uniform)
|
|
||||||
void clutter_actor_set_shader_param_int (ClutterActor *self,
|
|
||||||
const gchar *param,
|
|
||||||
gint value);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(clutter_shader_effect_set_uniform)
|
|
||||||
void clutter_actor_set_shader_param_float (ClutterActor *self,
|
|
||||||
const gchar *param,
|
|
||||||
gfloat value);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_SHADER_H__ */
|
#endif /* __CLUTTER_SHADER_H__ */
|
||||||
|
@@ -131,7 +131,6 @@
|
|||||||
* "source" : "source-state",
|
* "source" : "source-state",
|
||||||
* "target" : "target-state",
|
* "target" : "target-state",
|
||||||
* "duration" : milliseconds,
|
* "duration" : milliseconds,
|
||||||
* "animator" : "animator-definition"
|
|
||||||
* },
|
* },
|
||||||
* ...
|
* ...
|
||||||
* ]
|
* ]
|
||||||
@@ -142,7 +141,7 @@
|
|||||||
* as clutter_state_set_key() function arguments.
|
* as clutter_state_set_key() function arguments.
|
||||||
*
|
*
|
||||||
* The source and target values control the source and target state of the
|
* The source and target values control the source and target state of the
|
||||||
* transition. The key and animator properties are mutually exclusive.
|
* transition.
|
||||||
*
|
*
|
||||||
* The pre-delay and post-delay values are optional.
|
* The pre-delay and post-delay values are optional.
|
||||||
*
|
*
|
||||||
@@ -189,7 +188,6 @@
|
|||||||
|
|
||||||
#include "clutter-alpha.h"
|
#include "clutter-alpha.h"
|
||||||
#include "clutter-animatable.h"
|
#include "clutter-animatable.h"
|
||||||
#include "clutter-animator.h"
|
|
||||||
#include "clutter-enum-types.h"
|
#include "clutter-enum-types.h"
|
||||||
#include "clutter-interval.h"
|
#include "clutter-interval.h"
|
||||||
#include "clutter-marshal.h"
|
#include "clutter-marshal.h"
|
||||||
@@ -197,11 +195,6 @@
|
|||||||
#include "clutter-scriptable.h"
|
#include "clutter-scriptable.h"
|
||||||
#include "clutter-script-private.h"
|
#include "clutter-script-private.h"
|
||||||
|
|
||||||
typedef struct StateAnimator {
|
|
||||||
const gchar *source_state_name; /* interned string identifying entry */
|
|
||||||
ClutterAnimator *animator; /* pointer to animator itself */
|
|
||||||
} StateAnimator;
|
|
||||||
|
|
||||||
typedef struct State
|
typedef struct State
|
||||||
{
|
{
|
||||||
const gchar *name; /* interned string for this state name */
|
const gchar *name; /* interned string for this state name */
|
||||||
@@ -209,8 +202,6 @@ typedef struct State
|
|||||||
names */
|
names */
|
||||||
GList *keys; /* list of all keys pertaining to transitions
|
GList *keys; /* list of all keys pertaining to transitions
|
||||||
from other states to this one */
|
from other states to this one */
|
||||||
GArray *animators; /* list of animators for transitioning from
|
|
||||||
* specific source states */
|
|
||||||
ClutterState *clutter_state; /* the ClutterState object this state belongs to
|
ClutterState *clutter_state; /* the ClutterState object this state belongs to
|
||||||
*/
|
*/
|
||||||
} State;
|
} State;
|
||||||
@@ -227,8 +218,6 @@ struct _ClutterStatePrivate
|
|||||||
State *source_state; /* current source_state */
|
State *source_state; /* current source_state */
|
||||||
const gchar *target_state_name; /* current target state */
|
const gchar *target_state_name; /* current target state */
|
||||||
State *target_state; /* target state name */
|
State *target_state; /* target state name */
|
||||||
ClutterAnimator *current_animator; /* !NULL if the current transition is
|
|
||||||
overriden by an animator */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SLAVE_TIMELINE_LENGTH 10000
|
#define SLAVE_TIMELINE_LENGTH 10000
|
||||||
@@ -496,7 +485,6 @@ state_free (gpointer data)
|
|||||||
state->keys = g_list_remove (state->keys, state->keys->data))
|
state->keys = g_list_remove (state->keys, state->keys->data))
|
||||||
clutter_state_key_free (state->keys->data);
|
clutter_state_key_free (state->keys->data);
|
||||||
|
|
||||||
g_array_free (state->animators, TRUE);
|
|
||||||
g_hash_table_destroy (state->durations);
|
g_hash_table_destroy (state->durations);
|
||||||
g_free (state);
|
g_free (state);
|
||||||
}
|
}
|
||||||
@@ -510,7 +498,6 @@ state_new (ClutterState *clutter_state,
|
|||||||
state = g_new0 (State, 1);
|
state = g_new0 (State, 1);
|
||||||
state->clutter_state = clutter_state;
|
state->clutter_state = clutter_state;
|
||||||
state->name = name;
|
state->name = name;
|
||||||
state->animators = g_array_new (TRUE, TRUE, sizeof (StateAnimator));
|
|
||||||
state->durations = g_hash_table_new (g_direct_hash, g_direct_equal);
|
state->durations = g_hash_table_new (g_direct_hash, g_direct_equal);
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
@@ -533,14 +520,6 @@ static void
|
|||||||
clutter_state_completed (ClutterTimeline *timeline,
|
clutter_state_completed (ClutterTimeline *timeline,
|
||||||
ClutterState *state)
|
ClutterState *state)
|
||||||
{
|
{
|
||||||
ClutterStatePrivate *priv = state->priv;
|
|
||||||
|
|
||||||
if (priv->current_animator)
|
|
||||||
{
|
|
||||||
clutter_animator_set_timeline (priv->current_animator, NULL);
|
|
||||||
priv->current_animator = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_signal_emit (state, state_signals[COMPLETED], 0);
|
g_signal_emit (state, state_signals[COMPLETED], 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -556,9 +535,6 @@ clutter_state_new_frame (ClutterTimeline *timeline,
|
|||||||
GObject *curobj = NULL;
|
GObject *curobj = NULL;
|
||||||
gboolean found_specific = FALSE;
|
gboolean found_specific = FALSE;
|
||||||
|
|
||||||
if (priv->current_animator)
|
|
||||||
return;
|
|
||||||
|
|
||||||
progress = clutter_timeline_get_progress (timeline);
|
progress = clutter_timeline_get_progress (timeline);
|
||||||
|
|
||||||
for (k = priv->target_state->keys; k; k = k->next)
|
for (k = priv->target_state->keys; k; k = k->next)
|
||||||
@@ -649,7 +625,6 @@ clutter_state_change (ClutterState *state,
|
|||||||
gboolean animate)
|
gboolean animate)
|
||||||
{
|
{
|
||||||
ClutterStatePrivate *priv;
|
ClutterStatePrivate *priv;
|
||||||
ClutterAnimator *animator;
|
|
||||||
State *new_state;
|
State *new_state;
|
||||||
guint duration;
|
guint duration;
|
||||||
GList *k;
|
GList *k;
|
||||||
@@ -673,12 +648,6 @@ clutter_state_change (ClutterState *state,
|
|||||||
clutter_timeline_stop (priv->timeline);
|
clutter_timeline_stop (priv->timeline);
|
||||||
clutter_timeline_rewind (priv->timeline);
|
clutter_timeline_rewind (priv->timeline);
|
||||||
|
|
||||||
if (priv->current_animator)
|
|
||||||
{
|
|
||||||
clutter_animator_set_timeline (priv->current_animator, NULL);
|
|
||||||
priv->current_animator = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -694,12 +663,6 @@ clutter_state_change (ClutterState *state,
|
|||||||
return priv->timeline;
|
return priv->timeline;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->current_animator != NULL)
|
|
||||||
{
|
|
||||||
clutter_animator_set_timeline (priv->current_animator, NULL);
|
|
||||||
priv->current_animator = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
priv->source_state_name = priv->target_state_name;
|
priv->source_state_name = priv->target_state_name;
|
||||||
priv->target_state_name = target_state_name;
|
priv->target_state_name = target_state_name;
|
||||||
|
|
||||||
@@ -718,55 +681,37 @@ clutter_state_change (ClutterState *state,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
animator = clutter_state_get_animator (state,
|
for (k = new_state->keys; k != NULL; k = k->next)
|
||||||
priv->source_state_name,
|
|
||||||
priv->target_state_name);
|
|
||||||
priv->target_state = new_state;
|
|
||||||
|
|
||||||
if (animator == NULL && new_state->keys == NULL)
|
|
||||||
animator = clutter_state_get_animator (state, NULL,
|
|
||||||
priv->target_state_name);
|
|
||||||
|
|
||||||
if (animator != NULL)
|
|
||||||
{
|
{
|
||||||
/* we've got an animator overriding the tweened animation */
|
ClutterStateKey *key = k->data;
|
||||||
priv->current_animator = animator;
|
GValue initial = G_VALUE_INIT;
|
||||||
clutter_animator_set_timeline (animator, priv->timeline);
|
|
||||||
}
|
/* Reset the pre-pre-delay - this is only used for setting keys
|
||||||
else
|
* during transitions.
|
||||||
{
|
*/
|
||||||
for (k = new_state->keys; k != NULL; k = k->next)
|
key->pre_pre_delay = 0;
|
||||||
|
|
||||||
|
g_value_init (&initial, clutter_interval_get_value_type (key->interval));
|
||||||
|
|
||||||
|
if (key->is_animatable)
|
||||||
{
|
{
|
||||||
ClutterStateKey *key = k->data;
|
ClutterAnimatable *animatable;
|
||||||
GValue initial = G_VALUE_INIT;
|
|
||||||
|
|
||||||
/* Reset the pre-pre-delay - this is only used for setting keys
|
animatable = CLUTTER_ANIMATABLE (key->object);
|
||||||
* during transitions.
|
clutter_animatable_get_initial_state (animatable,
|
||||||
*/
|
key->property_name,
|
||||||
key->pre_pre_delay = 0;
|
&initial);
|
||||||
|
|
||||||
g_value_init (&initial, clutter_interval_get_value_type (key->interval));
|
|
||||||
|
|
||||||
if (key->is_animatable)
|
|
||||||
{
|
|
||||||
ClutterAnimatable *animatable;
|
|
||||||
|
|
||||||
animatable = CLUTTER_ANIMATABLE (key->object);
|
|
||||||
clutter_animatable_get_initial_state (animatable,
|
|
||||||
key->property_name,
|
|
||||||
&initial);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
g_object_get_property (key->object, key->property_name, &initial);
|
|
||||||
|
|
||||||
if (clutter_alpha_get_mode (key->alpha) != key->mode)
|
|
||||||
clutter_alpha_set_mode (key->alpha, key->mode);
|
|
||||||
|
|
||||||
clutter_interval_set_initial_value (key->interval, &initial);
|
|
||||||
clutter_interval_set_final_value (key->interval, &key->value);
|
|
||||||
|
|
||||||
g_value_unset (&initial);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
g_object_get_property (key->object, key->property_name, &initial);
|
||||||
|
|
||||||
|
if (clutter_alpha_get_mode (key->alpha) != key->mode)
|
||||||
|
clutter_alpha_set_mode (key->alpha, key->mode);
|
||||||
|
|
||||||
|
clutter_interval_set_initial_value (key->interval, &initial);
|
||||||
|
clutter_interval_set_final_value (key->interval, &key->value);
|
||||||
|
|
||||||
|
g_value_unset (&initial);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!animate)
|
if (!animate)
|
||||||
@@ -1549,126 +1494,6 @@ clutter_state_init (ClutterState *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_state_get_animator:
|
|
||||||
* @state: a #ClutterState instance.
|
|
||||||
* @source_state_name: the name of a source state
|
|
||||||
* @target_state_name: the name of a target state
|
|
||||||
*
|
|
||||||
* Retrieves the #ClutterAnimator that is being used for transitioning
|
|
||||||
* between the two states, if any has been set
|
|
||||||
*
|
|
||||||
* Return value: (transfer none): a #ClutterAnimator instance, or %NULL
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
* Deprecated: 1.12: Use #ClutterKeyframeTransition and
|
|
||||||
* #ClutterTransitionGroup instead
|
|
||||||
*/
|
|
||||||
ClutterAnimator *
|
|
||||||
clutter_state_get_animator (ClutterState *state,
|
|
||||||
const gchar *source_state_name,
|
|
||||||
const gchar *target_state_name)
|
|
||||||
{
|
|
||||||
State *target_state;
|
|
||||||
guint i;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_STATE (state), NULL);
|
|
||||||
|
|
||||||
source_state_name = g_intern_string (source_state_name);
|
|
||||||
if (source_state_name == g_intern_static_string (""))
|
|
||||||
source_state_name = NULL;
|
|
||||||
|
|
||||||
target_state_name = g_intern_string (target_state_name);
|
|
||||||
|
|
||||||
target_state = clutter_state_fetch_state (state, target_state_name, FALSE);
|
|
||||||
if (target_state == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
for (i = 0; i < target_state->animators->len; i++)
|
|
||||||
{
|
|
||||||
const StateAnimator *animator;
|
|
||||||
|
|
||||||
animator = &g_array_index (target_state->animators, StateAnimator, i);
|
|
||||||
if (animator->source_state_name == source_state_name)
|
|
||||||
return animator->animator;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_state_set_animator:
|
|
||||||
* @state: a #ClutterState instance.
|
|
||||||
* @source_state_name: the name of a source state
|
|
||||||
* @target_state_name: the name of a target state
|
|
||||||
* @animator: (allow-none): a #ClutterAnimator instance, or %NULL to
|
|
||||||
* unset an existing #ClutterAnimator
|
|
||||||
*
|
|
||||||
* Specifies a #ClutterAnimator to be used when transitioning between
|
|
||||||
* the two named states.
|
|
||||||
*
|
|
||||||
* The @animator allows specifying a transition between the state that is
|
|
||||||
* more elaborate than the basic transitions allowed by the tweening of
|
|
||||||
* properties defined in the #ClutterState keys.
|
|
||||||
*
|
|
||||||
* If @animator is %NULL it will unset an existing animator.
|
|
||||||
*
|
|
||||||
* #ClutterState will take a reference on the passed @animator, if any
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
* Deprecated: 1.12: Use #ClutterKeyframeTransition and
|
|
||||||
* #ClutterTransitionGroup instead
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_state_set_animator (ClutterState *state,
|
|
||||||
const gchar *source_state_name,
|
|
||||||
const gchar *target_state_name,
|
|
||||||
ClutterAnimator *animator)
|
|
||||||
{
|
|
||||||
State *target_state;
|
|
||||||
guint i;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STATE (state));
|
|
||||||
|
|
||||||
source_state_name = g_intern_string (source_state_name);
|
|
||||||
target_state_name = g_intern_string (target_state_name);
|
|
||||||
|
|
||||||
target_state = clutter_state_fetch_state (state, target_state_name, TRUE);
|
|
||||||
if (target_state == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (i = 0; target_state->animators->len; i++)
|
|
||||||
{
|
|
||||||
StateAnimator *a;
|
|
||||||
|
|
||||||
a = &g_array_index (target_state->animators, StateAnimator, i);
|
|
||||||
if (a->source_state_name == source_state_name)
|
|
||||||
{
|
|
||||||
g_object_unref (a->animator);
|
|
||||||
|
|
||||||
if (animator != NULL)
|
|
||||||
a->animator = g_object_ref (animator);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* remove the matched animator if passed NULL */
|
|
||||||
g_array_remove_index (target_state->animators, i);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (animator != NULL)
|
|
||||||
{
|
|
||||||
StateAnimator state_animator = {
|
|
||||||
source_state_name,
|
|
||||||
g_object_ref (animator)
|
|
||||||
};
|
|
||||||
|
|
||||||
g_array_append_val (target_state->animators, state_animator);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static gpointer
|
static gpointer
|
||||||
clutter_state_key_copy (gpointer boxed)
|
clutter_state_key_copy (gpointer boxed)
|
||||||
{
|
{
|
||||||
@@ -2107,12 +1932,10 @@ parse_state_transition (JsonArray *array,
|
|||||||
|
|
||||||
if (!json_object_has_member (object, "source") ||
|
if (!json_object_has_member (object, "source") ||
|
||||||
!json_object_has_member (object, "target") ||
|
!json_object_has_member (object, "target") ||
|
||||||
!(json_object_has_member (object, "keys") ||
|
!(json_object_has_member (object, "keys")))
|
||||||
json_object_has_member (object, "animator")))
|
|
||||||
{
|
{
|
||||||
g_warning ("The transition description at index %d is missing one "
|
g_warning ("The transition description at index %d is missing one "
|
||||||
"of the mandatory members: source, target and keys or "
|
"of the mandatory members: source, target and keys", index_);
|
||||||
"animator", index_);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2131,29 +1954,11 @@ parse_state_transition (JsonArray *array,
|
|||||||
duration);
|
duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (json_object_has_member (object, "animator"))
|
|
||||||
{
|
|
||||||
const gchar *id_ = json_object_get_string_member (object, "animator");
|
|
||||||
GObject *animator;
|
|
||||||
|
|
||||||
animator = clutter_script_get_object (clos->script, id_);
|
|
||||||
if (animator == NULL)
|
|
||||||
{
|
|
||||||
g_warning ("No object with id '%s' has been defined.", id_);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
clutter_state_set_animator (clos->state,
|
|
||||||
source_name,
|
|
||||||
target_name,
|
|
||||||
CLUTTER_ANIMATOR (animator));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!json_object_has_member (object, "keys"))
|
if (!json_object_has_member (object, "keys"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
keys = json_object_get_array_member (object, "keys");
|
keys = json_object_get_array_member (object, "keys");
|
||||||
if (keys == NULL && !json_object_has_member (object, "animator"))
|
if (keys == NULL)
|
||||||
{
|
{
|
||||||
g_warning ("The transition description at index %d has an invalid "
|
g_warning ("The transition description at index %d has an invalid "
|
||||||
"key member of type '%s' when an array was expected.",
|
"key member of type '%s' when an array was expected.",
|
||||||
|
@@ -145,15 +145,6 @@ void clutter_state_remove_key (ClutterState *state,
|
|||||||
CLUTTER_DEPRECATED
|
CLUTTER_DEPRECATED
|
||||||
ClutterTimeline * clutter_state_get_timeline (ClutterState *state);
|
ClutterTimeline * clutter_state_get_timeline (ClutterState *state);
|
||||||
CLUTTER_DEPRECATED
|
CLUTTER_DEPRECATED
|
||||||
void clutter_state_set_animator (ClutterState *state,
|
|
||||||
const gchar *source_state_name,
|
|
||||||
const gchar *target_state_name,
|
|
||||||
ClutterAnimator *animator);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
ClutterAnimator * clutter_state_get_animator (ClutterState *state,
|
|
||||||
const gchar *source_state_name,
|
|
||||||
const gchar *target_state_name);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
const gchar * clutter_state_get_state (ClutterState *state);
|
const gchar * clutter_state_get_state (ClutterState *state);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -66,7 +66,6 @@
|
|||||||
|
|
||||||
#include "deprecated/clutter-shader.h"
|
#include "deprecated/clutter-shader.h"
|
||||||
#include "deprecated/clutter-texture.h"
|
#include "deprecated/clutter-texture.h"
|
||||||
#include "deprecated/clutter-util.h"
|
|
||||||
|
|
||||||
typedef struct _ClutterTextureAsyncData ClutterTextureAsyncData;
|
typedef struct _ClutterTextureAsyncData ClutterTextureAsyncData;
|
||||||
|
|
||||||
@@ -480,22 +479,10 @@ update_fbo (ClutterActor *self)
|
|||||||
{
|
{
|
||||||
ClutterTexture *texture = CLUTTER_TEXTURE (self);
|
ClutterTexture *texture = CLUTTER_TEXTURE (self);
|
||||||
ClutterTexturePrivate *priv = texture->priv;
|
ClutterTexturePrivate *priv = texture->priv;
|
||||||
ClutterActor *head;
|
|
||||||
ClutterShader *shader = NULL;
|
|
||||||
ClutterActor *stage = NULL;
|
ClutterActor *stage = NULL;
|
||||||
CoglMatrix projection;
|
CoglMatrix projection;
|
||||||
CoglColor transparent_col;
|
CoglColor transparent_col;
|
||||||
|
|
||||||
head = _clutter_context_peek_shader_stack ();
|
|
||||||
if (head != NULL)
|
|
||||||
shader = clutter_actor_get_shader (head);
|
|
||||||
|
|
||||||
/* Temporarily turn off the shader on the top of the context's
|
|
||||||
* shader stack, to restore the GL pipeline to it's natural state.
|
|
||||||
*/
|
|
||||||
if (shader != NULL)
|
|
||||||
clutter_shader_set_is_enabled (shader, FALSE);
|
|
||||||
|
|
||||||
/* Redirect drawing to the fbo */
|
/* Redirect drawing to the fbo */
|
||||||
cogl_push_framebuffer (priv->fbo_handle);
|
cogl_push_framebuffer (priv->fbo_handle);
|
||||||
|
|
||||||
@@ -554,10 +541,6 @@ update_fbo (ClutterActor *self)
|
|||||||
|
|
||||||
/* Restore drawing to the previous framebuffer */
|
/* Restore drawing to the previous framebuffer */
|
||||||
cogl_pop_framebuffer ();
|
cogl_pop_framebuffer ();
|
||||||
|
|
||||||
/* If there is a shader on top of the shader stack, turn it back on. */
|
|
||||||
if (shader != NULL)
|
|
||||||
clutter_shader_set_is_enabled (shader, TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -1,498 +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/>.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* ClutterTimeoutPool: pool of timeout functions using the same slice of
|
|
||||||
* the GLib main loop
|
|
||||||
*
|
|
||||||
* Author: Emmanuele Bassi <ebassi@openedhand.com>
|
|
||||||
*
|
|
||||||
* Based on similar code by Tristan van Berkom
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "clutter-build-config.h"
|
|
||||||
|
|
||||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
|
||||||
#include "deprecated/clutter-main.h"
|
|
||||||
|
|
||||||
#include "clutter-timeout-pool.h"
|
|
||||||
|
|
||||||
#include "clutter-debug.h"
|
|
||||||
#include "clutter-timeout-interval.h"
|
|
||||||
|
|
||||||
typedef struct _ClutterTimeout ClutterTimeout;
|
|
||||||
typedef enum {
|
|
||||||
CLUTTER_TIMEOUT_NONE = 0,
|
|
||||||
CLUTTER_TIMEOUT_READY = 1 << 1
|
|
||||||
} ClutterTimeoutFlags;
|
|
||||||
|
|
||||||
struct _ClutterTimeout
|
|
||||||
{
|
|
||||||
guint id;
|
|
||||||
ClutterTimeoutFlags flags;
|
|
||||||
gint refcount;
|
|
||||||
|
|
||||||
ClutterTimeoutInterval interval;
|
|
||||||
|
|
||||||
GSourceFunc func;
|
|
||||||
gpointer data;
|
|
||||||
GDestroyNotify notify;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _ClutterTimeoutPool
|
|
||||||
{
|
|
||||||
GSource source;
|
|
||||||
|
|
||||||
guint next_id;
|
|
||||||
|
|
||||||
GList *timeouts;
|
|
||||||
GList *dispatched_timeouts;
|
|
||||||
|
|
||||||
gint ready;
|
|
||||||
|
|
||||||
guint id;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define TIMEOUT_READY(timeout) (timeout->flags & CLUTTER_TIMEOUT_READY)
|
|
||||||
|
|
||||||
static gboolean clutter_timeout_pool_prepare (GSource *source,
|
|
||||||
gint *next_timeout);
|
|
||||||
static gboolean clutter_timeout_pool_check (GSource *source);
|
|
||||||
static gboolean clutter_timeout_pool_dispatch (GSource *source,
|
|
||||||
GSourceFunc callback,
|
|
||||||
gpointer data);
|
|
||||||
static void clutter_timeout_pool_finalize (GSource *source);
|
|
||||||
|
|
||||||
static GSourceFuncs clutter_timeout_pool_funcs =
|
|
||||||
{
|
|
||||||
clutter_timeout_pool_prepare,
|
|
||||||
clutter_timeout_pool_check,
|
|
||||||
clutter_timeout_pool_dispatch,
|
|
||||||
clutter_timeout_pool_finalize
|
|
||||||
};
|
|
||||||
|
|
||||||
static gint
|
|
||||||
clutter_timeout_sort (gconstpointer a,
|
|
||||||
gconstpointer b)
|
|
||||||
{
|
|
||||||
const ClutterTimeout *t_a = a;
|
|
||||||
const ClutterTimeout *t_b = b;
|
|
||||||
|
|
||||||
/* Keep 'ready' timeouts at the front */
|
|
||||||
if (TIMEOUT_READY (t_a))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (TIMEOUT_READY (t_b))
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
return _clutter_timeout_interval_compare_expiration (&t_a->interval,
|
|
||||||
&t_b->interval);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gint
|
|
||||||
clutter_timeout_find_by_id (gconstpointer a,
|
|
||||||
gconstpointer b)
|
|
||||||
{
|
|
||||||
const ClutterTimeout *t_a = a;
|
|
||||||
|
|
||||||
return t_a->id == GPOINTER_TO_UINT (b) ? 0 : 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ClutterTimeout *
|
|
||||||
clutter_timeout_new (guint fps)
|
|
||||||
{
|
|
||||||
ClutterTimeout *timeout;
|
|
||||||
|
|
||||||
timeout = g_slice_new0 (ClutterTimeout);
|
|
||||||
_clutter_timeout_interval_init (&timeout->interval, fps);
|
|
||||||
timeout->flags = CLUTTER_TIMEOUT_NONE;
|
|
||||||
timeout->refcount = 1;
|
|
||||||
|
|
||||||
return timeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
clutter_timeout_prepare (ClutterTimeoutPool *pool,
|
|
||||||
ClutterTimeout *timeout,
|
|
||||||
gint *next_timeout)
|
|
||||||
{
|
|
||||||
GSource *source = (GSource *) pool;
|
|
||||||
gint64 now;
|
|
||||||
|
|
||||||
#if GLIB_CHECK_VERSION (2, 27, 3)
|
|
||||||
now = g_source_get_time (source) / 1000;
|
|
||||||
#else
|
|
||||||
{
|
|
||||||
GTimeVal source_time;
|
|
||||||
g_source_get_current_time (source, &source_time);
|
|
||||||
now = source_time.tv_sec * 1000 + source_time.tv_usec / 1000;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return _clutter_timeout_interval_prepare (now,
|
|
||||||
&timeout->interval,
|
|
||||||
next_timeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ref and unref are always called under the main Clutter lock, so there
|
|
||||||
* is not need for us to use g_atomic_int_* API.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static ClutterTimeout *
|
|
||||||
clutter_timeout_ref (ClutterTimeout *timeout)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (timeout != NULL, timeout);
|
|
||||||
g_return_val_if_fail (timeout->refcount > 0, timeout);
|
|
||||||
|
|
||||||
timeout->refcount += 1;
|
|
||||||
|
|
||||||
return timeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_timeout_unref (ClutterTimeout *timeout)
|
|
||||||
{
|
|
||||||
g_return_if_fail (timeout != NULL);
|
|
||||||
g_return_if_fail (timeout->refcount > 0);
|
|
||||||
|
|
||||||
timeout->refcount -= 1;
|
|
||||||
|
|
||||||
if (timeout->refcount == 0)
|
|
||||||
{
|
|
||||||
if (timeout->notify)
|
|
||||||
timeout->notify (timeout->data);
|
|
||||||
|
|
||||||
g_slice_free (ClutterTimeout, timeout);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_timeout_free (ClutterTimeout *timeout)
|
|
||||||
{
|
|
||||||
if (G_LIKELY (timeout))
|
|
||||||
{
|
|
||||||
if (timeout->notify)
|
|
||||||
timeout->notify (timeout->data);
|
|
||||||
|
|
||||||
g_slice_free (ClutterTimeout, timeout);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
clutter_timeout_pool_prepare (GSource *source,
|
|
||||||
gint *next_timeout)
|
|
||||||
{
|
|
||||||
ClutterTimeoutPool *pool = (ClutterTimeoutPool *) source;
|
|
||||||
GList *l = pool->timeouts;
|
|
||||||
|
|
||||||
/* the pool is ready if the first timeout is ready */
|
|
||||||
if (l && l->data)
|
|
||||||
{
|
|
||||||
ClutterTimeout *timeout = l->data;
|
|
||||||
return clutter_timeout_prepare (pool, timeout, next_timeout);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
*next_timeout = -1;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
clutter_timeout_pool_check (GSource *source)
|
|
||||||
{
|
|
||||||
ClutterTimeoutPool *pool = (ClutterTimeoutPool *) source;
|
|
||||||
GList *l;
|
|
||||||
|
|
||||||
clutter_threads_enter ();
|
|
||||||
|
|
||||||
for (l = pool->timeouts; l; l = l->next)
|
|
||||||
{
|
|
||||||
ClutterTimeout *timeout = l->data;
|
|
||||||
|
|
||||||
/* since the timeouts are sorted by expiration, as soon
|
|
||||||
* as we get a check returning FALSE we know that the
|
|
||||||
* following timeouts are not expiring, so we break as
|
|
||||||
* soon as possible
|
|
||||||
*/
|
|
||||||
if (clutter_timeout_prepare (pool, timeout, NULL))
|
|
||||||
{
|
|
||||||
timeout->flags |= CLUTTER_TIMEOUT_READY;
|
|
||||||
pool->ready += 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
clutter_threads_leave ();
|
|
||||||
|
|
||||||
return (pool->ready > 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
clutter_timeout_pool_dispatch (GSource *source,
|
|
||||||
GSourceFunc func,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
ClutterTimeoutPool *pool = (ClutterTimeoutPool *) source;
|
|
||||||
GList *dispatched_timeouts;
|
|
||||||
|
|
||||||
/* the main loop might have predicted this, so we repeat the
|
|
||||||
* check for ready timeouts.
|
|
||||||
*/
|
|
||||||
if (!pool->ready)
|
|
||||||
clutter_timeout_pool_check (source);
|
|
||||||
|
|
||||||
clutter_threads_enter ();
|
|
||||||
|
|
||||||
/* Iterate by moving the actual start of the list along so that it
|
|
||||||
* can cope with adds and removes while a timeout is being dispatched
|
|
||||||
*/
|
|
||||||
while (pool->timeouts && pool->timeouts->data && pool->ready-- > 0)
|
|
||||||
{
|
|
||||||
ClutterTimeout *timeout = pool->timeouts->data;
|
|
||||||
GList *l;
|
|
||||||
|
|
||||||
/* One of the ready timeouts may have been removed during dispatch,
|
|
||||||
* in which case pool->ready will be wrong, but the ready timeouts
|
|
||||||
* are always kept at the start of the list so we can stop once
|
|
||||||
* we've reached the first non-ready timeout
|
|
||||||
*/
|
|
||||||
if (!(TIMEOUT_READY (timeout)))
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* Add a reference to the timeout so it can't disappear
|
|
||||||
* while it's being dispatched
|
|
||||||
*/
|
|
||||||
clutter_timeout_ref (timeout);
|
|
||||||
|
|
||||||
timeout->flags &= ~CLUTTER_TIMEOUT_READY;
|
|
||||||
|
|
||||||
/* Move the list node to a list of dispatched timeouts */
|
|
||||||
l = pool->timeouts;
|
|
||||||
if (l->next)
|
|
||||||
l->next->prev = NULL;
|
|
||||||
|
|
||||||
pool->timeouts = l->next;
|
|
||||||
|
|
||||||
if (pool->dispatched_timeouts)
|
|
||||||
pool->dispatched_timeouts->prev = l;
|
|
||||||
|
|
||||||
l->prev = NULL;
|
|
||||||
l->next = pool->dispatched_timeouts;
|
|
||||||
pool->dispatched_timeouts = l;
|
|
||||||
|
|
||||||
if (!_clutter_timeout_interval_dispatch (&timeout->interval,
|
|
||||||
timeout->func, timeout->data))
|
|
||||||
{
|
|
||||||
/* The timeout may have already been removed, but nothing
|
|
||||||
* can be added to the dispatched_timeout list except in this
|
|
||||||
* function so it will always either be at the head of the
|
|
||||||
* dispatched list or have been removed
|
|
||||||
*/
|
|
||||||
if (pool->dispatched_timeouts &&
|
|
||||||
pool->dispatched_timeouts->data == timeout)
|
|
||||||
{
|
|
||||||
pool->dispatched_timeouts =
|
|
||||||
g_list_delete_link (pool->dispatched_timeouts,
|
|
||||||
pool->dispatched_timeouts);
|
|
||||||
|
|
||||||
/* Remove the reference that was held by it being in the list */
|
|
||||||
clutter_timeout_unref (timeout);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
clutter_timeout_unref (timeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Re-insert the dispatched timeouts in sorted order */
|
|
||||||
dispatched_timeouts = pool->dispatched_timeouts;
|
|
||||||
while (dispatched_timeouts)
|
|
||||||
{
|
|
||||||
ClutterTimeout *timeout = dispatched_timeouts->data;
|
|
||||||
GList *next = dispatched_timeouts->next;
|
|
||||||
|
|
||||||
if (timeout)
|
|
||||||
pool->timeouts = g_list_insert_sorted (pool->timeouts, timeout,
|
|
||||||
clutter_timeout_sort);
|
|
||||||
|
|
||||||
dispatched_timeouts = next;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_list_free (pool->dispatched_timeouts);
|
|
||||||
pool->dispatched_timeouts = NULL;
|
|
||||||
|
|
||||||
pool->ready = 0;
|
|
||||||
|
|
||||||
clutter_threads_leave ();
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_timeout_pool_finalize (GSource *source)
|
|
||||||
{
|
|
||||||
ClutterTimeoutPool *pool = (ClutterTimeoutPool *) source;
|
|
||||||
|
|
||||||
/* force destruction */
|
|
||||||
g_list_foreach (pool->timeouts, (GFunc) clutter_timeout_free, NULL);
|
|
||||||
g_list_free (pool->timeouts);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_timeout_pool_new:
|
|
||||||
* @priority: the priority of the timeout pool. Typically this will
|
|
||||||
* be #G_PRIORITY_DEFAULT
|
|
||||||
*
|
|
||||||
* Creates a new timeout pool source. A timeout pool should be used when
|
|
||||||
* multiple timeout functions, running at the same priority, are needed and
|
|
||||||
* the g_timeout_add() API might lead to starvation of the time slice of
|
|
||||||
* the main loop. A timeout pool allocates a single time slice of the main
|
|
||||||
* loop and runs every timeout function inside it. The timeout pool is
|
|
||||||
* always sorted, so that the extraction of the next timeout function is
|
|
||||||
* a constant time operation.
|
|
||||||
*
|
|
||||||
* Return value: the newly created #ClutterTimeoutPool. The created pool
|
|
||||||
* is owned by the GLib default context and will be automatically
|
|
||||||
* destroyed when the context is destroyed. It is possible to force
|
|
||||||
* the destruction of the timeout pool using g_source_destroy()
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: There is no direct replacement for this API
|
|
||||||
*/
|
|
||||||
ClutterTimeoutPool *
|
|
||||||
clutter_timeout_pool_new (gint priority)
|
|
||||||
{
|
|
||||||
ClutterTimeoutPool *pool;
|
|
||||||
GSource *source;
|
|
||||||
|
|
||||||
source = g_source_new (&clutter_timeout_pool_funcs,
|
|
||||||
sizeof (ClutterTimeoutPool));
|
|
||||||
if (!source)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
g_source_set_name (source, "Clutter timeout pool");
|
|
||||||
|
|
||||||
if (priority != G_PRIORITY_DEFAULT)
|
|
||||||
g_source_set_priority (source, priority);
|
|
||||||
|
|
||||||
pool = (ClutterTimeoutPool *) source;
|
|
||||||
pool->next_id = 1;
|
|
||||||
pool->id = g_source_attach (source, NULL);
|
|
||||||
|
|
||||||
/* let the default GLib context manage the pool */
|
|
||||||
g_source_unref (source);
|
|
||||||
|
|
||||||
return pool;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_timeout_pool_add:
|
|
||||||
* @pool: a #ClutterTimeoutPool
|
|
||||||
* @fps: the time between calls to the function, in frames per second
|
|
||||||
* @func: function to call
|
|
||||||
* @data: (closure): data to pass to the function, or %NULL
|
|
||||||
* @notify: function to call when the timeout is removed, or %NULL
|
|
||||||
*
|
|
||||||
* Sets a function to be called at regular intervals, and puts it inside
|
|
||||||
* the @pool. The function is repeatedly called until it returns %FALSE,
|
|
||||||
* at which point the timeout is automatically destroyed and the function
|
|
||||||
* won't be called again. If @notify is not %NULL, the @notify function
|
|
||||||
* will be called. The first call to @func will be at the end of @interval.
|
|
||||||
*
|
|
||||||
* Since Clutter 0.8 this will try to compensate for delays. For
|
|
||||||
* example, if @func takes half the interval time to execute then the
|
|
||||||
* function will be called again half the interval time after it
|
|
||||||
* finished. Before version 0.8 it would not fire until a full
|
|
||||||
* interval after the function completes so the delay between calls
|
|
||||||
* would be @interval * 1.5. This function does not however try to
|
|
||||||
* invoke the function multiple times to catch up missing frames if
|
|
||||||
* @func takes more than @interval ms to execute.
|
|
||||||
*
|
|
||||||
* Return value: the ID (greater than 0) of the timeout inside the pool.
|
|
||||||
* Use clutter_timeout_pool_remove() to stop the timeout.
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: There is no direct replacement for this API
|
|
||||||
*/
|
|
||||||
guint
|
|
||||||
clutter_timeout_pool_add (ClutterTimeoutPool *pool,
|
|
||||||
guint fps,
|
|
||||||
GSourceFunc func,
|
|
||||||
gpointer data,
|
|
||||||
GDestroyNotify notify)
|
|
||||||
{
|
|
||||||
ClutterTimeout *timeout;
|
|
||||||
guint retval = 0;
|
|
||||||
|
|
||||||
timeout = clutter_timeout_new (fps);
|
|
||||||
|
|
||||||
retval = timeout->id = pool->next_id++;
|
|
||||||
|
|
||||||
timeout->func = func;
|
|
||||||
timeout->data = data;
|
|
||||||
timeout->notify = notify;
|
|
||||||
|
|
||||||
pool->timeouts = g_list_insert_sorted (pool->timeouts, timeout,
|
|
||||||
clutter_timeout_sort);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_timeout_pool_remove:
|
|
||||||
* @pool: a #ClutterTimeoutPool
|
|
||||||
* @id_: the id of the timeout to remove
|
|
||||||
*
|
|
||||||
* Removes a timeout function with @id_ from the timeout pool. The id
|
|
||||||
* is the same returned when adding a function to the timeout pool with
|
|
||||||
* clutter_timeout_pool_add().
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: There is no direct replacement for this API
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_timeout_pool_remove (ClutterTimeoutPool *pool,
|
|
||||||
guint id_)
|
|
||||||
{
|
|
||||||
GList *l;
|
|
||||||
|
|
||||||
if ((l = g_list_find_custom (pool->timeouts, GUINT_TO_POINTER (id_),
|
|
||||||
clutter_timeout_find_by_id)))
|
|
||||||
{
|
|
||||||
clutter_timeout_unref (l->data);
|
|
||||||
pool->timeouts = g_list_delete_link (pool->timeouts, l);
|
|
||||||
}
|
|
||||||
else if ((l = g_list_find_custom (pool->dispatched_timeouts,
|
|
||||||
GUINT_TO_POINTER (id_),
|
|
||||||
clutter_timeout_find_by_id)))
|
|
||||||
{
|
|
||||||
clutter_timeout_unref (l->data);
|
|
||||||
|
|
||||||
pool->dispatched_timeouts =
|
|
||||||
g_list_delete_link (pool->dispatched_timeouts, l);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,69 +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/>.
|
|
||||||
*
|
|
||||||
* ClutterTimeoutPool: pool of timeout functions using the same slice of
|
|
||||||
* the GLib main loop
|
|
||||||
*
|
|
||||||
* Author: Emmanuele Bassi <ebassi@openedhand.com>
|
|
||||||
*
|
|
||||||
* Based on similar code by Tristan van Berkom
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
|
||||||
#error "Only <clutter/clutter.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CLUTTER_TIMEOUT_POOL_H__
|
|
||||||
#define __CLUTTER_TIMEOUT_POOL_H__
|
|
||||||
|
|
||||||
#include <clutter/clutter-types.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterTimeoutPool: (skip)
|
|
||||||
*
|
|
||||||
* #ClutterTimeoutPool is an opaque structure
|
|
||||||
* whose members cannot be directly accessed.
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6
|
|
||||||
*/
|
|
||||||
typedef struct _ClutterTimeoutPool ClutterTimeoutPool;
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
ClutterTimeoutPool *clutter_timeout_pool_new (gint priority);
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
guint clutter_timeout_pool_add (ClutterTimeoutPool *pool,
|
|
||||||
guint fps,
|
|
||||||
GSourceFunc func,
|
|
||||||
gpointer data,
|
|
||||||
GDestroyNotify notify);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_timeout_pool_remove (ClutterTimeoutPool *pool,
|
|
||||||
guint id_);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __CLUTTER_TIMEOUT_POOL_H__ */
|
|
@@ -1,40 +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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
|
||||||
#error "Only <clutter/clutter.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CLUTTER_UTIL_H__
|
|
||||||
#define __CLUTTER_UTIL_H__
|
|
||||||
|
|
||||||
#include <clutter/clutter-types.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gint clutter_util_next_p2 (gint a);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __CLUTTER_UTIL_H__ */
|
|
@@ -264,40 +264,6 @@ clutter_backend_egl_native_new (void)
|
|||||||
return g_object_new (CLUTTER_TYPE_BACKEND_EGL_NATIVE, NULL);
|
return g_object_new (CLUTTER_TYPE_BACKEND_EGL_NATIVE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_eglx_display:
|
|
||||||
*
|
|
||||||
* Retrieves the EGL display used by Clutter.
|
|
||||||
*
|
|
||||||
* Return value: the EGL display, or 0
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: Use clutter_egl_get_egl_display() instead.
|
|
||||||
*/
|
|
||||||
EGLDisplay
|
|
||||||
clutter_eglx_display (void)
|
|
||||||
{
|
|
||||||
return clutter_egl_get_egl_display ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_egl_display:
|
|
||||||
*
|
|
||||||
* Retrieves the EGL display used by Clutter.
|
|
||||||
*
|
|
||||||
* Return value: the EGL display used by Clutter, or 0
|
|
||||||
*
|
|
||||||
* Since: 0.6
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: Use clutter_egl_get_egl_display() instead.
|
|
||||||
*/
|
|
||||||
EGLDisplay
|
|
||||||
clutter_egl_display (void)
|
|
||||||
{
|
|
||||||
return clutter_egl_get_egl_display ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_egl_get_egl_display:
|
* clutter_egl_get_egl_display:
|
||||||
*
|
*
|
||||||
|
@@ -48,33 +48,6 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_eglx_display:
|
|
||||||
*
|
|
||||||
* Retrieves the #EGLDisplay used by Clutter,
|
|
||||||
* if Clutter has been compiled with EGL and X11 support.
|
|
||||||
*
|
|
||||||
* Return value: the EGL display
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: Use clutter_egl_get_egl_display() instead
|
|
||||||
*/
|
|
||||||
CLUTTER_DEPRECATED_FOR(clutter_egl_get_egl_display)
|
|
||||||
EGLDisplay clutter_eglx_display (void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_egl_display:
|
|
||||||
*
|
|
||||||
* Retrieves the #EGLDisplay used by Clutter
|
|
||||||
*
|
|
||||||
* Return value: the EGL display
|
|
||||||
*
|
|
||||||
* Deprecated: 1.6: Use clutter_egl_get_egl_display() instead
|
|
||||||
*/
|
|
||||||
CLUTTER_DEPRECATED_FOR(clutter_egl_get_egl_display)
|
|
||||||
EGLDisplay clutter_egl_display (void);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_egl_get_egl_display:
|
* clutter_egl_get_egl_display:
|
||||||
*
|
*
|
||||||
|
@@ -44,6 +44,7 @@
|
|||||||
#include "clutter-device-manager-private.h"
|
#include "clutter-device-manager-private.h"
|
||||||
#include "clutter-event-private.h"
|
#include "clutter-event-private.h"
|
||||||
#include "clutter-input-device-evdev.h"
|
#include "clutter-input-device-evdev.h"
|
||||||
|
#include "clutter-keymap-evdev.h"
|
||||||
#include "clutter-seat-evdev.h"
|
#include "clutter-seat-evdev.h"
|
||||||
#include "clutter-virtual-input-device-evdev.h"
|
#include "clutter-virtual-input-device-evdev.h"
|
||||||
#include "clutter-main.h"
|
#include "clutter-main.h"
|
||||||
@@ -91,7 +92,6 @@ struct _ClutterDeviceManagerEvdevPrivate
|
|||||||
GSList *seats;
|
GSList *seats;
|
||||||
|
|
||||||
ClutterSeatEvdev *main_seat;
|
ClutterSeatEvdev *main_seat;
|
||||||
struct xkb_keymap *keymap;
|
|
||||||
|
|
||||||
ClutterPointerConstrainCallback constrain_callback;
|
ClutterPointerConstrainCallback constrain_callback;
|
||||||
gpointer constrain_data;
|
gpointer constrain_data;
|
||||||
@@ -147,10 +147,6 @@ static const char *device_type_str[] = {
|
|||||||
* appear and disappear from the system.
|
* appear and disappear from the system.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static const char *option_xkb_layout = "us";
|
|
||||||
static const char *option_xkb_variant = "";
|
|
||||||
static const char *option_xkb_options = "";
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_device_manager_evdev_copy_event_data (ClutterEventExtender *event_extender,
|
clutter_device_manager_evdev_copy_event_data (ClutterEventExtender *event_extender,
|
||||||
const ClutterEvent *src,
|
const ClutterEvent *src,
|
||||||
@@ -1933,8 +1929,6 @@ clutter_device_manager_evdev_constructed (GObject *gobject)
|
|||||||
ClutterDeviceManagerEvdevPrivate *priv;
|
ClutterDeviceManagerEvdevPrivate *priv;
|
||||||
ClutterEventSource *source;
|
ClutterEventSource *source;
|
||||||
struct udev *udev;
|
struct udev *udev;
|
||||||
struct xkb_context *ctx;
|
|
||||||
struct xkb_rule_names names;
|
|
||||||
|
|
||||||
udev = udev_new ();
|
udev = udev_new ();
|
||||||
if (G_UNLIKELY (udev == NULL))
|
if (G_UNLIKELY (udev == NULL))
|
||||||
@@ -1966,17 +1960,6 @@ clutter_device_manager_evdev_constructed (GObject *gobject)
|
|||||||
|
|
||||||
udev_unref (udev);
|
udev_unref (udev);
|
||||||
|
|
||||||
names.rules = "evdev";
|
|
||||||
names.model = "pc105";
|
|
||||||
names.layout = option_xkb_layout;
|
|
||||||
names.variant = option_xkb_variant;
|
|
||||||
names.options = option_xkb_options;
|
|
||||||
|
|
||||||
ctx = xkb_context_new (0);
|
|
||||||
g_assert (ctx);
|
|
||||||
priv->keymap = xkb_keymap_new_from_names (ctx, &names, 0);
|
|
||||||
xkb_context_unref (ctx);
|
|
||||||
|
|
||||||
priv->main_seat = clutter_seat_evdev_new (manager_evdev);
|
priv->main_seat = clutter_seat_evdev_new (manager_evdev);
|
||||||
priv->seats = g_slist_append (priv->seats, priv->main_seat);
|
priv->seats = g_slist_append (priv->seats, priv->main_seat);
|
||||||
|
|
||||||
@@ -2030,9 +2013,6 @@ clutter_device_manager_evdev_finalize (GObject *object)
|
|||||||
g_slist_free_full (priv->seats, (GDestroyNotify) clutter_seat_evdev_free);
|
g_slist_free_full (priv->seats, (GDestroyNotify) clutter_seat_evdev_free);
|
||||||
g_slist_free (priv->devices);
|
g_slist_free (priv->devices);
|
||||||
|
|
||||||
if (priv->keymap)
|
|
||||||
xkb_keymap_unref (priv->keymap);
|
|
||||||
|
|
||||||
if (priv->event_source != NULL)
|
if (priv->event_source != NULL)
|
||||||
clutter_event_source_free (priv->event_source);
|
clutter_event_source_free (priv->event_source);
|
||||||
|
|
||||||
@@ -2156,6 +2136,7 @@ _clutter_events_evdev_init (ClutterBackend *backend)
|
|||||||
{
|
{
|
||||||
CLUTTER_NOTE (EVENT, "Initializing evdev backend");
|
CLUTTER_NOTE (EVENT, "Initializing evdev backend");
|
||||||
|
|
||||||
|
backend->keymap = g_object_new (CLUTTER_TYPE_KEYMAP_EVDEV, NULL);
|
||||||
backend->device_manager = g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_EVDEV,
|
backend->device_manager = g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_EVDEV,
|
||||||
"backend", backend,
|
"backend", backend,
|
||||||
NULL);
|
NULL);
|
||||||
@@ -2218,14 +2199,6 @@ _clutter_device_manager_evdev_release_device_id (ClutterDeviceManagerEvdev *mana
|
|||||||
compare_ids);
|
compare_ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct xkb_keymap *
|
|
||||||
_clutter_device_manager_evdev_get_keymap (ClutterDeviceManagerEvdev *manager_evdev)
|
|
||||||
{
|
|
||||||
ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
|
|
||||||
|
|
||||||
return priv->keymap;
|
|
||||||
}
|
|
||||||
|
|
||||||
ClutterStage *
|
ClutterStage *
|
||||||
_clutter_device_manager_evdev_get_stage (ClutterDeviceManagerEvdev *manager_evdev)
|
_clutter_device_manager_evdev_get_stage (ClutterDeviceManagerEvdev *manager_evdev)
|
||||||
{
|
{
|
||||||
@@ -2288,6 +2261,11 @@ clutter_evdev_update_xkb_state (ClutterDeviceManagerEvdev *manager_evdev)
|
|||||||
ClutterSeatEvdev *seat;
|
ClutterSeatEvdev *seat;
|
||||||
xkb_mod_mask_t latched_mods;
|
xkb_mod_mask_t latched_mods;
|
||||||
xkb_mod_mask_t locked_mods;
|
xkb_mod_mask_t locked_mods;
|
||||||
|
struct xkb_keymap *xkb_keymap;
|
||||||
|
ClutterKeymap *keymap;
|
||||||
|
|
||||||
|
keymap = clutter_backend_get_keymap (clutter_get_default_backend ());
|
||||||
|
xkb_keymap = clutter_keymap_evdev_get_keyboard_map (CLUTTER_KEYMAP_EVDEV (keymap));
|
||||||
|
|
||||||
priv = manager_evdev->priv;
|
priv = manager_evdev->priv;
|
||||||
|
|
||||||
@@ -2300,7 +2278,7 @@ clutter_evdev_update_xkb_state (ClutterDeviceManagerEvdev *manager_evdev)
|
|||||||
locked_mods = xkb_state_serialize_mods (seat->xkb,
|
locked_mods = xkb_state_serialize_mods (seat->xkb,
|
||||||
XKB_STATE_MODS_LOCKED);
|
XKB_STATE_MODS_LOCKED);
|
||||||
xkb_state_unref (seat->xkb);
|
xkb_state_unref (seat->xkb);
|
||||||
seat->xkb = xkb_state_new (priv->keymap);
|
seat->xkb = xkb_state_new (xkb_keymap);
|
||||||
|
|
||||||
xkb_state_update_mask (seat->xkb,
|
xkb_state_update_mask (seat->xkb,
|
||||||
0, /* depressed */
|
0, /* depressed */
|
||||||
@@ -2308,9 +2286,9 @@ clutter_evdev_update_xkb_state (ClutterDeviceManagerEvdev *manager_evdev)
|
|||||||
locked_mods,
|
locked_mods,
|
||||||
0, 0, seat->layout_idx);
|
0, 0, seat->layout_idx);
|
||||||
|
|
||||||
seat->caps_lock_led = xkb_keymap_led_get_index (priv->keymap, XKB_LED_NAME_CAPS);
|
seat->caps_lock_led = xkb_keymap_led_get_index (xkb_keymap, XKB_LED_NAME_CAPS);
|
||||||
seat->num_lock_led = xkb_keymap_led_get_index (priv->keymap, XKB_LED_NAME_NUM);
|
seat->num_lock_led = xkb_keymap_led_get_index (xkb_keymap, XKB_LED_NAME_NUM);
|
||||||
seat->scroll_lock_led = xkb_keymap_led_get_index (priv->keymap, XKB_LED_NAME_SCROLL);
|
seat->scroll_lock_led = xkb_keymap_led_get_index (xkb_keymap, XKB_LED_NAME_SCROLL);
|
||||||
|
|
||||||
clutter_seat_evdev_sync_leds (seat);
|
clutter_seat_evdev_sync_leds (seat);
|
||||||
}
|
}
|
||||||
@@ -2395,20 +2373,18 @@ clutter_evdev_set_device_callbacks (ClutterOpenDeviceCallback open_callback,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_evdev_set_keyboard_map (ClutterDeviceManager *evdev,
|
clutter_evdev_set_keyboard_map (ClutterDeviceManager *evdev,
|
||||||
struct xkb_keymap *keymap)
|
struct xkb_keymap *xkb_keymap)
|
||||||
{
|
{
|
||||||
ClutterDeviceManagerEvdev *manager_evdev;
|
ClutterDeviceManagerEvdev *manager_evdev;
|
||||||
ClutterDeviceManagerEvdevPrivate *priv;
|
ClutterKeymap *keymap;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev));
|
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev));
|
||||||
|
|
||||||
|
keymap = clutter_backend_get_keymap (clutter_get_default_backend ());
|
||||||
|
clutter_keymap_evdev_set_keyboard_map (CLUTTER_KEYMAP_EVDEV (keymap),
|
||||||
|
xkb_keymap);
|
||||||
|
|
||||||
manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
|
manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
|
||||||
priv = manager_evdev->priv;
|
|
||||||
|
|
||||||
if (priv->keymap)
|
|
||||||
xkb_keymap_unref (priv->keymap);
|
|
||||||
|
|
||||||
priv->keymap = xkb_keymap_ref (keymap);
|
|
||||||
clutter_evdev_update_xkb_state (manager_evdev);
|
clutter_evdev_update_xkb_state (manager_evdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2503,12 +2479,18 @@ clutter_evdev_set_keyboard_numlock (ClutterDeviceManager *evdev,
|
|||||||
ClutterDeviceManagerEvdevPrivate *priv;
|
ClutterDeviceManagerEvdevPrivate *priv;
|
||||||
GSList *iter;
|
GSList *iter;
|
||||||
xkb_mod_mask_t numlock;
|
xkb_mod_mask_t numlock;
|
||||||
|
struct xkb_keymap *xkb_keymap;
|
||||||
|
ClutterKeymap *keymap;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev));
|
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev));
|
||||||
|
|
||||||
manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
|
manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
|
||||||
priv = manager_evdev->priv;
|
priv = manager_evdev->priv;
|
||||||
numlock = (1 << xkb_keymap_mod_get_index(priv->keymap, "Mod2"));
|
|
||||||
|
keymap = clutter_backend_get_keymap (clutter_get_default_backend ());
|
||||||
|
xkb_keymap = clutter_keymap_evdev_get_keyboard_map (CLUTTER_KEYMAP_EVDEV (keymap));
|
||||||
|
|
||||||
|
numlock = (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod2"));
|
||||||
|
|
||||||
for (iter = priv->seats; iter; iter = iter->next)
|
for (iter = priv->seats; iter; iter = iter->next)
|
||||||
{
|
{
|
||||||
@@ -2759,3 +2741,9 @@ clutter_evdev_set_seat_id (const gchar *seat_id)
|
|||||||
g_free (evdev_seat_id);
|
g_free (evdev_seat_id);
|
||||||
evdev_seat_id = g_strdup (seat_id);
|
evdev_seat_id = g_strdup (seat_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct xkb_state *
|
||||||
|
_clutter_device_manager_evdev_get_xkb_state (ClutterDeviceManagerEvdev *manager_evdev)
|
||||||
|
{
|
||||||
|
return manager_evdev->priv->main_seat->xkb;
|
||||||
|
}
|
||||||
|
@@ -64,8 +64,6 @@ gint _clutter_device_manager_evdev_acquire_device_id (ClutterDeviceManagerEvdev
|
|||||||
void _clutter_device_manager_evdev_release_device_id (ClutterDeviceManagerEvdev *manager_evdev,
|
void _clutter_device_manager_evdev_release_device_id (ClutterDeviceManagerEvdev *manager_evdev,
|
||||||
ClutterInputDevice *device);
|
ClutterInputDevice *device);
|
||||||
|
|
||||||
struct xkb_keymap * _clutter_device_manager_evdev_get_keymap (ClutterDeviceManagerEvdev *manager_evdev);
|
|
||||||
|
|
||||||
ClutterStage * _clutter_device_manager_evdev_get_stage (ClutterDeviceManagerEvdev *manager_evdev);
|
ClutterStage * _clutter_device_manager_evdev_get_stage (ClutterDeviceManagerEvdev *manager_evdev);
|
||||||
|
|
||||||
void _clutter_device_manager_evdev_constrain_pointer (ClutterDeviceManagerEvdev *manager_evdev,
|
void _clutter_device_manager_evdev_constrain_pointer (ClutterDeviceManagerEvdev *manager_evdev,
|
||||||
@@ -85,6 +83,8 @@ void _clutter_device_manager_evdev_filter_relative_motion (ClutterDeviceManagerE
|
|||||||
|
|
||||||
void _clutter_device_manager_evdev_dispatch (ClutterDeviceManagerEvdev *manager_evdev);
|
void _clutter_device_manager_evdev_dispatch (ClutterDeviceManagerEvdev *manager_evdev);
|
||||||
|
|
||||||
|
struct xkb_state * _clutter_device_manager_evdev_get_xkb_state (ClutterDeviceManagerEvdev *manager_evdev);
|
||||||
|
|
||||||
static inline guint64
|
static inline guint64
|
||||||
us (guint64 us)
|
us (guint64 us)
|
||||||
{
|
{
|
||||||
|
@@ -1265,6 +1265,18 @@ clutter_input_device_evdev_release_touch_state (ClutterInputDeviceEvdev *device,
|
|||||||
GINT_TO_POINTER (touch_state->device_slot));
|
GINT_TO_POINTER (touch_state->device_slot));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
clutter_input_device_evdev_get_physical_size (ClutterInputDevice *device,
|
||||||
|
gdouble *width,
|
||||||
|
gdouble *height)
|
||||||
|
{
|
||||||
|
struct libinput_device *libinput_device;
|
||||||
|
|
||||||
|
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
|
||||||
|
|
||||||
|
return libinput_device_get_size (libinput_device, width, height) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_input_device_evdev_class_init (ClutterInputDeviceEvdevClass *klass)
|
clutter_input_device_evdev_class_init (ClutterInputDeviceEvdevClass *klass)
|
||||||
{
|
{
|
||||||
@@ -1280,6 +1292,7 @@ clutter_input_device_evdev_class_init (ClutterInputDeviceEvdevClass *klass)
|
|||||||
klass->get_group_n_modes = clutter_input_device_evdev_get_group_n_modes;
|
klass->get_group_n_modes = clutter_input_device_evdev_get_group_n_modes;
|
||||||
klass->is_grouped = clutter_input_device_evdev_is_grouped;
|
klass->is_grouped = clutter_input_device_evdev_is_grouped;
|
||||||
klass->process_kbd_a11y_event = clutter_input_device_evdev_process_kbd_a11y_event;
|
klass->process_kbd_a11y_event = clutter_input_device_evdev_process_kbd_a11y_event;
|
||||||
|
klass->get_physical_size = clutter_input_device_evdev_get_physical_size;
|
||||||
|
|
||||||
obj_props[PROP_DEVICE_MATRIX] =
|
obj_props[PROP_DEVICE_MATRIX] =
|
||||||
g_param_spec_boxed ("device-matrix",
|
g_param_spec_boxed ("device-matrix",
|
||||||
|
128
clutter/clutter/evdev/clutter-keymap-evdev.c
Normal file
128
clutter/clutter/evdev/clutter-keymap-evdev.c
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 Red Hat
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
|
* 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* Author: Carlos Garnacho <carlosg@gnome.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "clutter-build-config.h"
|
||||||
|
|
||||||
|
#include "clutter-device-manager-evdev.h"
|
||||||
|
#include "clutter-keymap-evdev.h"
|
||||||
|
|
||||||
|
static const char *option_xkb_layout = "us";
|
||||||
|
static const char *option_xkb_variant = "";
|
||||||
|
static const char *option_xkb_options = "";
|
||||||
|
|
||||||
|
typedef struct _ClutterKeymapEvdev ClutterKeymapEvdev;
|
||||||
|
|
||||||
|
struct _ClutterKeymapEvdev
|
||||||
|
{
|
||||||
|
ClutterKeymap parent_instance;
|
||||||
|
|
||||||
|
struct xkb_keymap *keymap;
|
||||||
|
};
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (ClutterKeymapEvdev, clutter_keymap_evdev,
|
||||||
|
CLUTTER_TYPE_KEYMAP)
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_keymap_evdev_finalize (GObject *object)
|
||||||
|
{
|
||||||
|
ClutterKeymapEvdev *keymap = CLUTTER_KEYMAP_EVDEV (object);
|
||||||
|
|
||||||
|
xkb_keymap_unref (keymap->keymap);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (clutter_keymap_evdev_parent_class)->finalize (object);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
clutter_keymap_evdev_get_num_lock_state (ClutterKeymap *keymap)
|
||||||
|
{
|
||||||
|
ClutterDeviceManagerEvdev *device_manager;
|
||||||
|
struct xkb_state *xkb_state;
|
||||||
|
|
||||||
|
device_manager =
|
||||||
|
CLUTTER_DEVICE_MANAGER_EVDEV (clutter_device_manager_get_default ());
|
||||||
|
xkb_state = _clutter_device_manager_evdev_get_xkb_state (device_manager);
|
||||||
|
|
||||||
|
return xkb_state_mod_name_is_active (xkb_state,
|
||||||
|
XKB_MOD_NAME_NUM,
|
||||||
|
XKB_STATE_MODS_LATCHED ||
|
||||||
|
XKB_STATE_MODS_LOCKED);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
clutter_keymap_evdev_get_caps_lock_state (ClutterKeymap *keymap)
|
||||||
|
{
|
||||||
|
ClutterDeviceManagerEvdev *device_manager;
|
||||||
|
struct xkb_state *xkb_state;
|
||||||
|
|
||||||
|
device_manager =
|
||||||
|
CLUTTER_DEVICE_MANAGER_EVDEV (clutter_device_manager_get_default ());
|
||||||
|
xkb_state = _clutter_device_manager_evdev_get_xkb_state (device_manager);
|
||||||
|
|
||||||
|
return xkb_state_mod_name_is_active (xkb_state,
|
||||||
|
XKB_MOD_NAME_CAPS,
|
||||||
|
XKB_STATE_MODS_LATCHED ||
|
||||||
|
XKB_STATE_MODS_LOCKED);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_keymap_evdev_class_init (ClutterKeymapEvdevClass *klass)
|
||||||
|
{
|
||||||
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
ClutterKeymapClass *keymap_class = CLUTTER_KEYMAP_CLASS (klass);
|
||||||
|
|
||||||
|
object_class->finalize = clutter_keymap_evdev_finalize;
|
||||||
|
|
||||||
|
keymap_class->get_num_lock_state = clutter_keymap_evdev_get_num_lock_state;
|
||||||
|
keymap_class->get_caps_lock_state = clutter_keymap_evdev_get_caps_lock_state;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_keymap_evdev_init (ClutterKeymapEvdev *keymap)
|
||||||
|
{
|
||||||
|
struct xkb_context *ctx;
|
||||||
|
struct xkb_rule_names names;
|
||||||
|
|
||||||
|
names.rules = "evdev";
|
||||||
|
names.model = "pc105";
|
||||||
|
names.layout = option_xkb_layout;
|
||||||
|
names.variant = option_xkb_variant;
|
||||||
|
names.options = option_xkb_options;
|
||||||
|
|
||||||
|
ctx = xkb_context_new (0);
|
||||||
|
g_assert (ctx);
|
||||||
|
keymap->keymap = xkb_keymap_new_from_names (ctx, &names, 0);
|
||||||
|
xkb_context_unref (ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
clutter_keymap_evdev_set_keyboard_map (ClutterKeymapEvdev *keymap,
|
||||||
|
struct xkb_keymap *xkb_keymap)
|
||||||
|
{
|
||||||
|
if (keymap->keymap)
|
||||||
|
xkb_keymap_unref (keymap->keymap);
|
||||||
|
keymap->keymap = xkb_keymap_ref (xkb_keymap);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct xkb_keymap *
|
||||||
|
clutter_keymap_evdev_get_keyboard_map (ClutterKeymapEvdev *keymap)
|
||||||
|
{
|
||||||
|
return keymap->keymap;
|
||||||
|
}
|
32
clutter/clutter/evdev/clutter-keymap-evdev.h
Normal file
32
clutter/clutter/evdev/clutter-keymap-evdev.h
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 Red Hat
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
|
* 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* Author: Carlos Garnacho <carlosg@gnome.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "clutter-xkb-utils.h"
|
||||||
|
#include "clutter-keymap.h"
|
||||||
|
|
||||||
|
#define CLUTTER_TYPE_KEYMAP_EVDEV (clutter_keymap_evdev_get_type ())
|
||||||
|
G_DECLARE_FINAL_TYPE (ClutterKeymapEvdev, clutter_keymap_evdev,
|
||||||
|
CLUTTER, KEYMAP_EVDEV,
|
||||||
|
ClutterKeymap)
|
||||||
|
|
||||||
|
void clutter_keymap_evdev_set_keyboard_map (ClutterKeymapEvdev *keymap,
|
||||||
|
struct xkb_keymap *xkb_keymap);
|
||||||
|
struct xkb_keymap * clutter_keymap_evdev_get_keyboard_map (ClutterKeymapEvdev *keymap);
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user