Compare commits
320 Commits
wip/nielsd
...
gbsneto/cl
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0c4fdb2d31 | ||
![]() |
4504a313f7 | ||
![]() |
ed7fc825e1 | ||
![]() |
43307c6b84 | ||
![]() |
b4d55325d7 | ||
![]() |
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 | ||
![]() |
f6f188dad4 | ||
![]() |
262a3ecbd6 | ||
![]() |
231aadd3f0 | ||
![]() |
c8db8bbe22 | ||
![]() |
f67e1a55ee | ||
![]() |
169022cbb0 | ||
![]() |
0d29609aec | ||
![]() |
00619f3a1c | ||
![]() |
bc5e76c76f | ||
![]() |
557b2a0e8c | ||
![]() |
49cb691bb5 | ||
![]() |
6e1b14b26b | ||
![]() |
ca7c5c1223 | ||
![]() |
e11ee44236 | ||
![]() |
6b7bd91610 | ||
![]() |
92349a4668 | ||
![]() |
7635d0631b | ||
![]() |
ec6a536d36 | ||
![]() |
4d92979b43 | ||
![]() |
4a69a0d7f7 | ||
![]() |
8a10196382 | ||
![]() |
91ce24d4b4 | ||
![]() |
26fbd56a95 | ||
![]() |
576cd08088 | ||
![]() |
e8c27603dd | ||
![]() |
e9e4b2b72e | ||
![]() |
6834bedb95 | ||
![]() |
bf8a3b1c1c | ||
![]() |
3a4a858ce3 | ||
![]() |
0a178a01b3 | ||
![]() |
332360be7c | ||
![]() |
718ddc9c96 | ||
![]() |
f795725aaf | ||
![]() |
70741a051b | ||
![]() |
ad7d6e4a37 | ||
![]() |
a6178990cd | ||
![]() |
081842bac6 | ||
![]() |
63a6ead7d9 | ||
![]() |
1c044a8fa0 | ||
![]() |
d4bea60e1a | ||
![]() |
8c4743ee2a | ||
![]() |
cbbd6d71bf | ||
![]() |
4aa1e221e4 | ||
![]() |
ac6039bd2a | ||
![]() |
97230a2b64 | ||
![]() |
791bec3cf7 | ||
![]() |
fb8dc91893 | ||
![]() |
5e005316ef | ||
![]() |
4bc6a64d47 | ||
![]() |
91d4f30ebd | ||
![]() |
c585b214b8 | ||
![]() |
0304433b20 | ||
![]() |
fcd1ff9c56 | ||
![]() |
a227e4078b | ||
![]() |
cabcad1856 | ||
![]() |
4c3d9fccc1 | ||
![]() |
203725bfd3 | ||
![]() |
c1b6184e0a | ||
![]() |
dd82fbebf6 | ||
![]() |
605f35dd25 | ||
![]() |
aecf588d8d | ||
![]() |
740c2298c6 |
29
.gitignore
vendored
29
.gitignore
vendored
@@ -1,25 +1,9 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
Makefile.in.in
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
build-aux
|
||||
compile
|
||||
config.guess
|
||||
config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
depcomp
|
||||
install-sh
|
||||
intltool-extract.in
|
||||
intltool-merge.in
|
||||
libtool
|
||||
ltmain.sh
|
||||
missing
|
||||
.deps
|
||||
50-mutter-navigation.xml
|
||||
50-mutter-system.xml
|
||||
50-mutter-windows.xml
|
||||
@@ -33,15 +17,11 @@ mutter-wayland.desktop
|
||||
*.swp
|
||||
*.gir
|
||||
*.typelib
|
||||
stamp-h1
|
||||
*.gmo
|
||||
*.make
|
||||
*.log
|
||||
*.trs
|
||||
*~
|
||||
stamp-it
|
||||
.intltool-merge-cache
|
||||
ABOUT-NLS
|
||||
POTFILES
|
||||
Makevars.template
|
||||
po/*.header
|
||||
@@ -64,9 +44,7 @@ org.gnome.mutter.wayland.gschema.xml
|
||||
testasyncgetprop
|
||||
testboxes
|
||||
testgradient
|
||||
m4/*
|
||||
INSTALL
|
||||
mkinstalldirs
|
||||
meta-enum-types.[ch]
|
||||
src/stamp-meta-enum-types.h
|
||||
src/meta-dbus-display-config.[ch]
|
||||
@@ -122,13 +100,6 @@ doc/reference/meta-undocumented.txt
|
||||
doc/reference/meta-unused.txt
|
||||
doc/reference/meta-docs.sgml
|
||||
doc/reference/meta.types
|
||||
gtk-doc.m4
|
||||
intltool.m4
|
||||
libtool.m4
|
||||
ltoptions.m4
|
||||
ltsugar.m4
|
||||
ltversion.m4
|
||||
lt~obsolete.m4
|
||||
.dirstamp
|
||||
**/tags.*
|
||||
build/
|
||||
|
@@ -7,18 +7,24 @@ stages:
|
||||
build-mutter:
|
||||
stage: build
|
||||
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 install
|
||||
artifacts:
|
||||
expire_in: 1 day
|
||||
paths:
|
||||
- build
|
||||
|
||||
test-mutter:
|
||||
stage: test
|
||||
dependencies:
|
||||
- build-mutter
|
||||
variables:
|
||||
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
|
||||
GSETTINGS_SCHEMA_DIR: "$CI_PROJECT_DIR/build/data"
|
||||
script:
|
||||
- meson . build -Degl_device=true -Dwayland_eglstream=true
|
||||
- ninja -C build
|
||||
- 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 --verbose --no-stdsplit
|
||||
artifacts:
|
||||
paths:
|
||||
- build/meson-logs
|
||||
when: on_failure
|
||||
- mkdir -m 700 $XDG_RUNTIME_DIR
|
||||
- glib-compile-schemas $GSETTINGS_SCHEMA_DIR
|
||||
- >
|
||||
dbus-run-session -- xvfb-run -s '+iglx -noreset'
|
||||
meson test -C build --no-rebuild -t 10 --verbose --no-stdsplit --wrap catchsegv
|
||||
|
@@ -10,5 +10,8 @@ RUN dnf -y update && dnf -y upgrade && \
|
||||
# For running unit tests
|
||||
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 clean all
|
||||
|
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
|
54
NEWS
54
NEWS
@@ -1,3 +1,57 @@
|
||||
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
|
||||
======
|
||||
* Fix handling of non-UTF8 encodings [Florian; !227]
|
||||
|
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-interval.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-actor-box-private.h"
|
||||
|
||||
/**
|
||||
* clutter_actor_box_new:
|
||||
@@ -542,6 +543,57 @@ clutter_actor_box_set_size (ClutterActorBox *box,
|
||||
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,
|
||||
clutter_actor_box_copy,
|
||||
clutter_actor_box_free,
|
||||
|
@@ -275,13 +275,13 @@ void _clutter_actor_set_enable_paint_unmapped
|
||||
void _clutter_actor_set_has_pointer (ClutterActor *self,
|
||||
gboolean has_pointer);
|
||||
|
||||
void _clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||
ClutterRedrawFlags flags,
|
||||
ClutterPaintVolume *clip_volume);
|
||||
void _clutter_actor_queue_redraw_full (ClutterActor *self,
|
||||
ClutterRedrawFlags flags,
|
||||
ClutterPaintVolume *volume,
|
||||
ClutterEffect *effect);
|
||||
void _clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||
ClutterRedrawFlags flags,
|
||||
const ClutterPaintVolume *clip_volume);
|
||||
void _clutter_actor_queue_redraw_full (ClutterActor *self,
|
||||
ClutterRedrawFlags flags,
|
||||
const ClutterPaintVolume *volume,
|
||||
ClutterEffect *effect);
|
||||
|
||||
ClutterPaintVolume * _clutter_actor_get_queue_redraw_clip (ClutterActor *self);
|
||||
void _clutter_actor_set_queue_redraw_clip (ClutterActor *self,
|
||||
|
@@ -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:
|
||||
* @self: A #ClutterActor
|
||||
@@ -1777,7 +1793,7 @@ clutter_actor_show (ClutterActor *self)
|
||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_VISIBLE]);
|
||||
|
||||
if (priv->parent != NULL)
|
||||
clutter_actor_queue_redraw (priv->parent);
|
||||
clutter_actor_queue_redraw (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_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);
|
||||
else
|
||||
clutter_actor_queue_redraw_on_parent (self);
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (self));
|
||||
}
|
||||
@@ -2227,25 +2245,46 @@ static void
|
||||
clutter_actor_real_pick (ClutterActor *self,
|
||||
const ClutterColor *color)
|
||||
{
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
|
||||
/* the default implementation is just to paint a rectangle
|
||||
* with the same size of the actor using the passed color
|
||||
*/
|
||||
if (clutter_actor_should_pick_paint (self))
|
||||
{
|
||||
static CoglPipeline *default_pick_pipeline = NULL;
|
||||
ClutterActorBox box = { 0, };
|
||||
CoglPipeline *pick_pipeline;
|
||||
float width, height;
|
||||
|
||||
if (G_UNLIKELY (default_pick_pipeline == NULL))
|
||||
{
|
||||
CoglContext *ctx =
|
||||
clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||
|
||||
default_pick_pipeline = cogl_pipeline_new (ctx);
|
||||
}
|
||||
|
||||
g_assert (default_pick_pipeline != NULL);
|
||||
pick_pipeline = cogl_pipeline_copy (default_pick_pipeline);
|
||||
|
||||
clutter_actor_get_allocation_box (self, &box);
|
||||
|
||||
width = box.x2 - box.x1;
|
||||
height = box.y2 - box.y1;
|
||||
|
||||
cogl_set_source_color4ub (color->red,
|
||||
color->green,
|
||||
color->blue,
|
||||
color->alpha);
|
||||
cogl_pipeline_set_color4ub (pick_pipeline,
|
||||
color->red,
|
||||
color->green,
|
||||
color->blue,
|
||||
color->alpha);
|
||||
|
||||
cogl_rectangle (0, 0, width, height);
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
pick_pipeline,
|
||||
0, 0,
|
||||
width, height);
|
||||
|
||||
cogl_object_unref (pick_pipeline);
|
||||
}
|
||||
|
||||
/* XXX - this thoroughly sucks, but we need to maintain compatibility
|
||||
@@ -3701,7 +3740,7 @@ clutter_actor_paint_node (ClutterActor *actor,
|
||||
if (!clutter_stage_get_no_clear_hint (CLUTTER_STAGE (actor)))
|
||||
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_add_rectangle (node, &box);
|
||||
clutter_paint_node_add_child (root, node);
|
||||
@@ -3740,7 +3779,7 @@ clutter_actor_paint_node (ClutterActor *actor,
|
||||
}
|
||||
#endif /* CLUTTER_ENABLE_DEBUG */
|
||||
|
||||
_clutter_paint_node_paint (root);
|
||||
clutter_paint_node_paint (root);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -4841,7 +4880,8 @@ clutter_actor_set_scale_factor (ClutterActor *self,
|
||||
g_assert (pspec != 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
|
||||
@@ -8723,15 +8763,14 @@ _clutter_actor_get_allocation_clip (ClutterActor *self,
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_actor_queue_redraw_full (ClutterActor *self,
|
||||
ClutterRedrawFlags flags,
|
||||
ClutterPaintVolume *volume,
|
||||
ClutterEffect *effect)
|
||||
_clutter_actor_queue_redraw_full (ClutterActor *self,
|
||||
ClutterRedrawFlags flags,
|
||||
const ClutterPaintVolume *volume,
|
||||
ClutterEffect *effect)
|
||||
{
|
||||
ClutterActorPrivate *priv = self->priv;
|
||||
ClutterPaintVolume allocation_pv;
|
||||
ClutterPaintVolume *pv;
|
||||
gboolean should_free_pv;
|
||||
ClutterPaintVolume *pv = NULL;
|
||||
ClutterActor *stage;
|
||||
|
||||
/* Here's an outline of the actor queue redraw mechanism:
|
||||
@@ -8873,21 +8912,15 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
|
||||
clutter_paint_volume_set_height (pv,
|
||||
allocation_clip.y2 -
|
||||
allocation_clip.y1);
|
||||
should_free_pv = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
pv = volume;
|
||||
should_free_pv = FALSE;
|
||||
}
|
||||
|
||||
self->priv->queue_redraw_entry =
|
||||
_clutter_stage_queue_actor_redraw (CLUTTER_STAGE (stage),
|
||||
priv->queue_redraw_entry,
|
||||
self,
|
||||
pv);
|
||||
pv ? pv : volume);
|
||||
|
||||
if (should_free_pv)
|
||||
if (pv)
|
||||
clutter_paint_volume_free (pv);
|
||||
|
||||
/* If this is the first redraw queued then we can directly use the
|
||||
@@ -9001,9 +9034,9 @@ clutter_actor_queue_redraw (ClutterActor *self)
|
||||
* picking of your actor.
|
||||
*/
|
||||
void
|
||||
_clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||
ClutterRedrawFlags flags,
|
||||
ClutterPaintVolume *volume)
|
||||
_clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||
ClutterRedrawFlags flags,
|
||||
const ClutterPaintVolume *volume)
|
||||
{
|
||||
_clutter_actor_queue_redraw_full (self,
|
||||
flags, /* flags */
|
||||
@@ -10280,9 +10313,10 @@ clutter_actor_set_position (ClutterActor *self,
|
||||
cur_position.x = clutter_actor_get_x (self);
|
||||
cur_position.y = clutter_actor_get_y (self);
|
||||
|
||||
_clutter_actor_create_transition (self, obj_props[PROP_POSITION],
|
||||
&cur_position,
|
||||
&new_position);
|
||||
if (!clutter_point_equals (&cur_position, &new_position))
|
||||
_clutter_actor_create_transition (self, obj_props[PROP_POSITION],
|
||||
&cur_position,
|
||||
&new_position);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -13641,7 +13675,7 @@ clutter_actor_set_child_above_sibling (ClutterActor *self,
|
||||
sibling);
|
||||
g_object_unref(child);
|
||||
|
||||
clutter_actor_queue_relayout (self);
|
||||
clutter_actor_queue_redraw_on_parent (child);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -13688,7 +13722,7 @@ clutter_actor_set_child_below_sibling (ClutterActor *self,
|
||||
sibling);
|
||||
g_object_unref(child);
|
||||
|
||||
clutter_actor_queue_relayout (self);
|
||||
clutter_actor_queue_redraw_on_parent (child);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -15190,9 +15224,8 @@ clutter_actor_transform_stage_point (ClutterActor *self,
|
||||
* http://www.cs.cmu.edu/~ph/src/texfund/
|
||||
*
|
||||
* Our texture is a rectangle with origin [0, 0], so we are mapping from
|
||||
* quad to rectangle only, which significantly simplifies things; the
|
||||
* function calls have been unrolled, and most of the math is done in fixed
|
||||
* point.
|
||||
* quad to rectangle only, which significantly simplifies things.
|
||||
* Function calls have been unrolled.
|
||||
*/
|
||||
clutter_actor_get_abs_allocation_vertices (self, v);
|
||||
|
||||
@@ -18434,6 +18467,10 @@ clutter_actor_set_margin_top (ClutterActor *self,
|
||||
g_return_if_fail (margin >= 0.f);
|
||||
|
||||
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],
|
||||
info->margin.top,
|
||||
margin);
|
||||
@@ -18478,6 +18515,10 @@ clutter_actor_set_margin_bottom (ClutterActor *self,
|
||||
g_return_if_fail (margin >= 0.f);
|
||||
|
||||
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],
|
||||
info->margin.bottom,
|
||||
margin);
|
||||
@@ -18522,6 +18563,10 @@ clutter_actor_set_margin_left (ClutterActor *self,
|
||||
g_return_if_fail (margin >= 0.f);
|
||||
|
||||
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],
|
||||
info->margin.left,
|
||||
margin);
|
||||
@@ -18566,6 +18611,10 @@ clutter_actor_set_margin_right (ClutterActor *self,
|
||||
g_return_if_fail (margin >= 0.f);
|
||||
|
||||
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],
|
||||
info->margin.right,
|
||||
margin);
|
||||
|
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <clutter/clutter-backend.h>
|
||||
#include <clutter/clutter-device-manager.h>
|
||||
#include <clutter/clutter-keymap.h>
|
||||
#include <clutter/clutter-stage-window.h>
|
||||
|
||||
#include "clutter-event-translator.h"
|
||||
@@ -60,6 +61,8 @@ struct _ClutterBackend
|
||||
GList *event_translators;
|
||||
|
||||
ClutterInputMethod *input_method;
|
||||
|
||||
ClutterKeymap *keymap;
|
||||
};
|
||||
|
||||
struct _ClutterBackendClass
|
||||
@@ -104,6 +107,8 @@ struct _ClutterBackendClass
|
||||
|
||||
void (* bell_notify) (ClutterBackend *backend);
|
||||
|
||||
ClutterKeymap * (* get_keymap) (ClutterBackend *backend);
|
||||
|
||||
/* signals */
|
||||
void (* resolution_changed) (ClutterBackend *backend);
|
||||
void (* font_changed) (ClutterBackend *backend);
|
||||
|
@@ -430,7 +430,7 @@ clutter_backend_real_get_features (ClutterBackend *backend)
|
||||
if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_THROTTLE))
|
||||
{
|
||||
CLUTTER_NOTE (BACKEND, "Cogl supports swap buffers throttling");
|
||||
flags |= CLUTTER_FEATURE_SYNC_TO_VBLANK;
|
||||
flags |= CLUTTER_FEATURE_SWAP_THROTTLE;
|
||||
}
|
||||
else
|
||||
CLUTTER_NOTE (BACKEND, "Cogl doesn't support swap buffers throttling");
|
||||
@@ -577,6 +577,18 @@ clutter_backend_real_get_device_manager (ClutterBackend *backend)
|
||||
return backend->device_manager;
|
||||
}
|
||||
|
||||
static ClutterKeymap *
|
||||
clutter_backend_real_get_keymap (ClutterBackend *backend)
|
||||
{
|
||||
if (G_UNLIKELY (backend->keymap == NULL))
|
||||
{
|
||||
g_critical ("No keymap available, expect broken keyboard input");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return backend->keymap;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_backend_real_translate_event (ClutterBackend *backend,
|
||||
gpointer native,
|
||||
@@ -675,6 +687,7 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
klass->translate_event = clutter_backend_real_translate_event;
|
||||
klass->create_context = clutter_backend_real_create_context;
|
||||
klass->get_features = clutter_backend_real_get_features;
|
||||
klass->get_keymap = clutter_backend_real_get_keymap;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1399,3 +1412,17 @@ clutter_backend_set_input_method (ClutterBackend *backend,
|
||||
{
|
||||
g_set_object (&backend->input_method, method);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_backend_get_keymap:
|
||||
* @backend: the #ClutterBackend
|
||||
*
|
||||
* Gets the keymap used by Clutter
|
||||
*
|
||||
* Returns: (transfer none): the keymap
|
||||
**/
|
||||
ClutterKeymap *
|
||||
clutter_backend_get_keymap (ClutterBackend *backend)
|
||||
{
|
||||
return CLUTTER_BACKEND_GET_CLASS (backend)->get_keymap (backend);
|
||||
}
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#include <cogl/cogl.h>
|
||||
|
||||
#include <clutter/clutter-config.h>
|
||||
#include <clutter/clutter-keymap.h>
|
||||
#include <clutter/clutter-types.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
@@ -83,6 +84,9 @@ ClutterInputMethod * clutter_backend_get_input_method (Clutter
|
||||
CLUTTER_EXPORT
|
||||
void clutter_backend_set_input_method (ClutterBackend *backend,
|
||||
ClutterInputMethod *method);
|
||||
CLUTTER_EXPORT
|
||||
ClutterKeymap * clutter_backend_get_keymap (ClutterBackend *backend);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_BACKEND_H__ */
|
||||
|
@@ -36,7 +36,7 @@ G_BEGIN_DECLS
|
||||
|
||||
typedef struct _ClutterBezier ClutterBezier;
|
||||
|
||||
ClutterBezier *_clutter_bezier_new ();
|
||||
ClutterBezier *_clutter_bezier_new (void);
|
||||
|
||||
void _clutter_bezier_free (ClutterBezier * b);
|
||||
|
||||
|
@@ -160,6 +160,7 @@ static void
|
||||
clutter_blur_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
{
|
||||
ClutterBlurEffect *self = CLUTTER_BLUR_EFFECT (effect);
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
guint8 paint_opacity;
|
||||
|
||||
paint_opacity = clutter_actor_get_paint_opacity (self->actor);
|
||||
@@ -169,11 +170,11 @@ clutter_blur_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
paint_opacity,
|
||||
paint_opacity,
|
||||
paint_opacity);
|
||||
cogl_push_source (self->pipeline);
|
||||
|
||||
cogl_rectangle (0, 0, self->tex_width, self->tex_height);
|
||||
|
||||
cogl_pop_source ();
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
self->pipeline,
|
||||
0, 0,
|
||||
self->tex_width, self->tex_height);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@@ -150,9 +150,9 @@ typedef struct _RequestedSize
|
||||
gfloat natural_size;
|
||||
} RequestedSize;
|
||||
|
||||
static gint distribute_natural_allocation (gint extra_space,
|
||||
guint n_requested_sizes,
|
||||
RequestedSize *sizes);
|
||||
static float distribute_natural_allocation (float extra_space,
|
||||
unsigned int n_requested_sizes,
|
||||
RequestedSize *sizes);
|
||||
static void count_expand_children (ClutterLayoutManager *layout,
|
||||
ClutterContainer *container,
|
||||
gint *visible_children,
|
||||
@@ -624,7 +624,19 @@ get_preferred_size_for_opposite_orientation (ClutterBoxLayout *self,
|
||||
else
|
||||
{
|
||||
/* 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,
|
||||
* and is available for expanding children.
|
||||
@@ -879,17 +891,18 @@ compare_gap (gconstpointer p1,
|
||||
*
|
||||
* Pulled from gtksizerequest.c from Gtk+
|
||||
*/
|
||||
static gint
|
||||
distribute_natural_allocation (gint extra_space,
|
||||
guint n_requested_sizes,
|
||||
static float
|
||||
distribute_natural_allocation (float extra_space,
|
||||
unsigned int n_requested_sizes,
|
||||
RequestedSize *sizes)
|
||||
{
|
||||
guint *spreading;
|
||||
gint i;
|
||||
unsigned int *spreading;
|
||||
int i;
|
||||
|
||||
g_return_val_if_fail (isnormal (extra_space) || 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++)
|
||||
spreading[i] = i;
|
||||
@@ -913,7 +926,7 @@ distribute_natural_allocation (gint extra_space,
|
||||
|
||||
/* Sort descending by gap and position. */
|
||||
g_qsort_with_data (spreading,
|
||||
n_requested_sizes, sizeof (guint),
|
||||
n_requested_sizes, sizeof (unsigned int),
|
||||
compare_gap, sizes);
|
||||
|
||||
/* Distribute available space.
|
||||
@@ -925,11 +938,11 @@ distribute_natural_allocation (gint extra_space,
|
||||
* Sort order and reducing remaining space by assigned space
|
||||
* ensures that space is distributed equally.
|
||||
*/
|
||||
gint glue = (extra_space + i) / (i + 1);
|
||||
gint gap = sizes[(spreading[i])].natural_size
|
||||
- sizes[(spreading[i])].minimum_size;
|
||||
int glue = (extra_space + i) / (i + 1);
|
||||
int gap = sizes[(spreading[i])].natural_size
|
||||
- sizes[(spreading[i])].minimum_size;
|
||||
|
||||
gint extra = MIN (glue, gap);
|
||||
int extra = MIN (glue, gap);
|
||||
|
||||
sizes[spreading[i]].minimum_size += extra;
|
||||
|
||||
@@ -1056,7 +1069,9 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout,
|
||||
else
|
||||
{
|
||||
/* 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,
|
||||
* and is available for expanding children.
|
||||
|
@@ -178,6 +178,7 @@ static void
|
||||
clutter_brightness_contrast_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
{
|
||||
ClutterBrightnessContrastEffect *self = CLUTTER_BRIGHTNESS_CONTRAST_EFFECT (effect);
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
ClutterActor *actor;
|
||||
guint8 paint_opacity;
|
||||
|
||||
@@ -189,11 +190,11 @@ clutter_brightness_contrast_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
paint_opacity,
|
||||
paint_opacity,
|
||||
paint_opacity);
|
||||
cogl_push_source (self->pipeline);
|
||||
|
||||
cogl_rectangle (0, 0, self->tex_width, self->tex_height);
|
||||
|
||||
cogl_pop_source ();
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
self->pipeline,
|
||||
0, 0,
|
||||
self->tex_width, self->tex_height);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -148,6 +148,7 @@ static void
|
||||
clutter_colorize_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
{
|
||||
ClutterColorizeEffect *self = CLUTTER_COLORIZE_EFFECT (effect);
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
ClutterActor *actor;
|
||||
guint8 paint_opacity;
|
||||
|
||||
@@ -159,11 +160,11 @@ clutter_colorize_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
paint_opacity,
|
||||
paint_opacity,
|
||||
paint_opacity);
|
||||
cogl_push_source (self->pipeline);
|
||||
|
||||
cogl_rectangle (0, 0, self->tex_width, self->tex_height);
|
||||
|
||||
cogl_pop_source ();
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
self->pipeline,
|
||||
0, 0,
|
||||
self->tex_width, self->tex_height);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -38,6 +38,7 @@
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-actor-private.h"
|
||||
#include "clutter-content-private.h"
|
||||
|
||||
#include "clutter-debug.h"
|
||||
@@ -91,6 +92,11 @@ clutter_content_real_invalidate (ClutterContent *content)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_content_real_invalidate_size (ClutterContent *content)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_content_real_paint_content (ClutterContent *content,
|
||||
ClutterActor *actor,
|
||||
@@ -108,6 +114,7 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
||||
iface->attached = clutter_content_real_attached;
|
||||
iface->detached = clutter_content_real_detached;
|
||||
iface->invalidate = clutter_content_real_invalidate;
|
||||
iface->invalidate_size = clutter_content_real_invalidate_size;
|
||||
|
||||
/**
|
||||
* ClutterContent::attached:
|
||||
@@ -188,6 +195,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 >
|
||||
* _clutter_content_attached:
|
||||
* @content: a #ClutterContent
|
||||
|
@@ -86,6 +86,8 @@ struct _ClutterContentIface
|
||||
ClutterActor *actor);
|
||||
|
||||
void (* invalidate) (ClutterContent *content);
|
||||
|
||||
void (* invalidate_size) (ClutterContent *content);
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
@@ -98,6 +100,9 @@ gboolean clutter_content_get_preferred_size (ClutterContent *content
|
||||
CLUTTER_EXPORT
|
||||
void clutter_content_invalidate (ClutterContent *content);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_content_invalidate_size (ClutterContent *content);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_CONTENT_H__ */
|
||||
|
@@ -39,7 +39,8 @@ typedef enum {
|
||||
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
|
||||
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
|
||||
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
|
||||
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7
|
||||
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7,
|
||||
CLUTTER_DEBUG_PAINT_DAMAGE_REGION = 1 << 8,
|
||||
} ClutterDrawDebugFlag;
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
@@ -79,9 +80,9 @@ extern guint clutter_pick_debug_flags;
|
||||
extern guint clutter_paint_debug_flags;
|
||||
|
||||
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,
|
||||
...);
|
||||
...) G_GNUC_PRINTF (1, 2);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -26,7 +26,6 @@
|
||||
#include "deprecated/clutter-keysyms.h"
|
||||
#include "deprecated/clutter-list-model.h"
|
||||
#include "deprecated/clutter-main.h"
|
||||
#include "deprecated/clutter-media.h"
|
||||
#include "deprecated/clutter-model.h"
|
||||
#include "deprecated/clutter-rectangle.h"
|
||||
#include "deprecated/clutter-score.h"
|
||||
|
@@ -155,6 +155,7 @@ static void
|
||||
clutter_desaturate_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
{
|
||||
ClutterDesaturateEffect *self = CLUTTER_DESATURATE_EFFECT (effect);
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
ClutterActor *actor;
|
||||
CoglHandle texture;
|
||||
guint8 paint_opacity;
|
||||
@@ -170,13 +171,12 @@ clutter_desaturate_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
paint_opacity,
|
||||
paint_opacity,
|
||||
paint_opacity);
|
||||
cogl_push_source (self->pipeline);
|
||||
|
||||
cogl_rectangle (0, 0,
|
||||
cogl_texture_get_width (texture),
|
||||
cogl_texture_get_height (texture));
|
||||
|
||||
cogl_pop_source ();
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
self->pipeline,
|
||||
0, 0,
|
||||
cogl_texture_get_width (texture),
|
||||
cogl_texture_get_height (texture));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -167,6 +167,10 @@ struct _ClutterInputDeviceClass
|
||||
gboolean (* is_grouped) (ClutterInputDevice *device,
|
||||
ClutterInputDevice *other_device);
|
||||
|
||||
gboolean (* get_physical_size) (ClutterInputDevice *device,
|
||||
gdouble *width,
|
||||
gdouble *height);
|
||||
|
||||
/* Keyboard accessbility */
|
||||
void (* process_kbd_a11y_event) (ClutterEvent *event,
|
||||
ClutterInputDevice *device,
|
||||
|
@@ -884,7 +884,7 @@ typedef enum {
|
||||
/**
|
||||
* ClutterFeatureFlags:
|
||||
* @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_READ_PIXELS: Set if texture pixels can be read.
|
||||
* @CLUTTER_FEATURE_STAGE_STATIC: Set if stage size if fixed (i.e framebuffer)
|
||||
@@ -903,7 +903,7 @@ typedef enum {
|
||||
typedef enum
|
||||
{
|
||||
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_READ_PIXELS = (1 << 5),
|
||||
CLUTTER_FEATURE_STAGE_STATIC = (1 << 6),
|
||||
|
@@ -1093,7 +1093,7 @@ clutter_event_set_device (ClutterEvent *event,
|
||||
{
|
||||
ClutterEventPrivate *real_event = (ClutterEventPrivate *) event;
|
||||
|
||||
real_event->device = device;
|
||||
g_set_object (&real_event->device, device);
|
||||
}
|
||||
|
||||
switch (event->type)
|
||||
@@ -1362,8 +1362,8 @@ clutter_event_copy (const ClutterEvent *event)
|
||||
{
|
||||
ClutterEventPrivate *real_event = (ClutterEventPrivate *) event;
|
||||
|
||||
new_real_event->device = real_event->device;
|
||||
new_real_event->source_device = real_event->source_device;
|
||||
g_set_object (&new_real_event->device, real_event->device);
|
||||
g_set_object (&new_real_event->source_device, real_event->source_device);
|
||||
new_real_event->delta_x = real_event->delta_x;
|
||||
new_real_event->delta_y = real_event->delta_y;
|
||||
new_real_event->is_pointer_emulated = real_event->is_pointer_emulated;
|
||||
@@ -1433,6 +1433,14 @@ clutter_event_free (ClutterEvent *event)
|
||||
{
|
||||
_clutter_backend_free_event_data (clutter_get_default_backend (), event);
|
||||
|
||||
if (is_event_allocated (event))
|
||||
{
|
||||
ClutterEventPrivate *real_event = (ClutterEventPrivate *) event;
|
||||
|
||||
g_clear_object (&real_event->device);
|
||||
g_clear_object (&real_event->source_device);
|
||||
}
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
@@ -1687,7 +1695,7 @@ clutter_event_set_source_device (ClutterEvent *event,
|
||||
return;
|
||||
|
||||
real_event = (ClutterEventPrivate *) event;
|
||||
real_event->source_device = device;
|
||||
g_set_object (&real_event->source_device, device);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -772,7 +772,10 @@ void clutter_event_get_gesture_motion_delta (const Clut
|
||||
gdouble *dx,
|
||||
gdouble *dy);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterScrollSource clutter_event_get_scroll_source (const ClutterEvent *event);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterScrollFinishFlags clutter_event_get_scroll_finish_flags (const ClutterEvent *event);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
|
@@ -53,6 +53,8 @@
|
||||
struct _ClutterImagePrivate
|
||||
{
|
||||
CoglTexture *texture;
|
||||
gint width;
|
||||
gint height;
|
||||
};
|
||||
|
||||
static void clutter_content_iface_init (ClutterContentIface *iface);
|
||||
@@ -68,6 +70,27 @@ clutter_image_error_quark (void)
|
||||
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
|
||||
clutter_image_finalize (GObject *gobject)
|
||||
{
|
||||
@@ -238,6 +261,7 @@ clutter_image_set_data (ClutterImage *image,
|
||||
}
|
||||
|
||||
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
||||
update_image_size (image);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -306,6 +330,7 @@ clutter_image_set_bytes (ClutterImage *image,
|
||||
}
|
||||
|
||||
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
||||
update_image_size (image);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -399,6 +424,7 @@ clutter_image_set_area (ClutterImage *image,
|
||||
}
|
||||
|
||||
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
||||
update_image_size (image);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
gboolean clutter_input_device_is_grouped (ClutterInputDevice *device,
|
||||
ClutterInputDevice *other_device);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_input_device_get_physical_size (ClutterInputDevice *device,
|
||||
gdouble *width,
|
||||
gdouble *height);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
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 },
|
||||
{ "continuous-redraw", CLUTTER_DEBUG_CONTINUOUS_REDRAW },
|
||||
{ "paint-deform-tiles", CLUTTER_DEBUG_PAINT_DEFORM_TILES },
|
||||
{ "damage-region", CLUTTER_DEBUG_PAINT_DAMAGE_REGION },
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -254,16 +255,6 @@ clutter_config_read_from_key_file (GKeyFile *keyfile)
|
||||
else
|
||||
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 =
|
||||
g_key_file_get_integer (keyfile, ENVIRONMENT_GROUP,
|
||||
"DefaultFps",
|
||||
@@ -1365,6 +1356,9 @@ clutter_init_real (GError **error)
|
||||
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
|
||||
* query the GL machinery for features
|
||||
*/
|
||||
@@ -1487,10 +1481,6 @@ pre_parse_hook (GOptionContext *context,
|
||||
if (env_string)
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -3631,12 +3621,6 @@ _clutter_set_sync_to_vblank (gboolean sync_to_vblank)
|
||||
clutter_sync_to_vblank = !!sync_to_vblank;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_get_sync_to_vblank (void)
|
||||
{
|
||||
return clutter_sync_to_vblank;
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_debug_messagev (const char *format,
|
||||
va_list var_args)
|
||||
|
@@ -298,10 +298,10 @@ master_clock_next_frame_delay (ClutterMasterClockDefault *master_clock)
|
||||
* (NB: if there aren't even any timelines running then the master clock will
|
||||
* be completely stopped in master_clock_is_running())
|
||||
*/
|
||||
if (clutter_feature_available (CLUTTER_FEATURE_SYNC_TO_VBLANK) &&
|
||||
if (clutter_feature_available (CLUTTER_FEATURE_SWAP_THROTTLE) &&
|
||||
!master_clock->idle)
|
||||
{
|
||||
CLUTTER_NOTE (SCHEDULER, "vblank available and updated stages");
|
||||
CLUTTER_NOTE (SCHEDULER, "swap throttling available and updated stages");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -34,9 +34,6 @@
|
||||
CLUTTER_EXPORT
|
||||
void clutter_set_custom_backend_func (ClutterBackend *(* func) (void));
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_get_sync_to_vblank (void);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
int64_t clutter_stage_get_frame_counter (ClutterStage *stage);
|
||||
|
||||
|
@@ -72,6 +72,8 @@
|
||||
#include "clutter-debug.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-stage-private.h"
|
||||
#include "clutter-paint-volume-private.h"
|
||||
#include "clutter-actor-box-private.h"
|
||||
|
||||
struct _ClutterOffscreenEffectPrivate
|
||||
{
|
||||
@@ -82,8 +84,10 @@ struct _ClutterOffscreenEffectPrivate
|
||||
ClutterActor *actor;
|
||||
ClutterActor *stage;
|
||||
|
||||
gfloat x_offset;
|
||||
gfloat y_offset;
|
||||
ClutterVertex position;
|
||||
|
||||
int fbo_offset_x;
|
||||
int fbo_offset_y;
|
||||
|
||||
/* This is the calculated size of the fbo before being passed
|
||||
through create_texture(). This needs to be tracked separately so
|
||||
@@ -93,16 +97,6 @@ struct _ClutterOffscreenEffectPrivate
|
||||
int fbo_height;
|
||||
|
||||
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,
|
||||
@@ -222,15 +216,15 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
||||
{
|
||||
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
|
||||
ClutterOffscreenEffectPrivate *priv = self->priv;
|
||||
ClutterActorBox box;
|
||||
ClutterActorBox raw_box, box;
|
||||
ClutterActor *stage;
|
||||
CoglMatrix projection;
|
||||
CoglMatrix projection, old_modelview, modelview;
|
||||
const ClutterPaintVolume *volume;
|
||||
CoglColor transparent;
|
||||
gfloat stage_width, stage_height;
|
||||
gfloat fbo_width = -1, fbo_height = -1;
|
||||
gfloat width, height;
|
||||
gfloat xexpand, yexpand;
|
||||
int texture_width, texture_height;
|
||||
ClutterVertex local_offset = { 0.f, 0.f, 0.f };
|
||||
gfloat old_viewport[4];
|
||||
|
||||
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))
|
||||
return FALSE;
|
||||
@@ -241,92 +235,82 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
||||
stage = _clutter_actor_get_stage_internal (priv->actor);
|
||||
clutter_actor_get_size (stage, &stage_width, &stage_height);
|
||||
|
||||
/* The paint box is the bounding box of the actor's paint volume in
|
||||
* stage coordinates. This will give us the size for the framebuffer
|
||||
* we need to redirect its rendering offscreen and its position will
|
||||
* be used to setup an offset viewport */
|
||||
if (clutter_actor_get_paint_box (priv->actor, &box))
|
||||
/* Get the minimal bounding box for what we want to paint, relative to the
|
||||
* parent of priv->actor. Note that we may actually be painting a clone of
|
||||
* priv->actor so we need to be careful to avoid querying the transformation
|
||||
* of priv->actor (like clutter_actor_get_paint_box would). Just stay in
|
||||
* local coordinates for now...
|
||||
*/
|
||||
volume = clutter_actor_get_paint_volume (priv->actor);
|
||||
if (volume)
|
||||
{
|
||||
clutter_actor_box_get_size (&box, &fbo_width, &fbo_height);
|
||||
clutter_actor_box_get_origin (&box, &priv->x_offset, &priv->y_offset);
|
||||
ClutterPaintVolume mutable_volume;
|
||||
|
||||
fbo_width = MIN (fbo_width, stage_width);
|
||||
fbo_height = MIN (fbo_height, stage_height);
|
||||
_clutter_paint_volume_copy_static (volume, &mutable_volume);
|
||||
_clutter_paint_volume_get_bounding_box (&mutable_volume, &raw_box);
|
||||
clutter_paint_volume_free (&mutable_volume);
|
||||
}
|
||||
else
|
||||
{
|
||||
fbo_width = stage_width;
|
||||
fbo_height = stage_height;
|
||||
clutter_actor_get_allocation_box (priv->actor, &raw_box);
|
||||
}
|
||||
|
||||
if (fbo_width == stage_width)
|
||||
priv->x_offset = 0.0f;
|
||||
if (fbo_height == stage_height)
|
||||
priv->y_offset = 0.0f;
|
||||
box = raw_box;
|
||||
_clutter_actor_box_enlarge_for_effects (&box);
|
||||
|
||||
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... */
|
||||
if (!update_fbo (effect, fbo_width, fbo_height))
|
||||
return FALSE;
|
||||
|
||||
texture_width = cogl_texture_get_width (priv->texture);
|
||||
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);
|
||||
cogl_get_modelview_matrix (&old_modelview);
|
||||
|
||||
/* let's draw offscreen */
|
||||
cogl_push_framebuffer (priv->offscreen);
|
||||
|
||||
/* Copy the modelview that would have been used if rendering onscreen */
|
||||
cogl_set_modelview_matrix (&priv->last_matrix_drawn);
|
||||
|
||||
/* Set up the viewport so that it has the same size as the stage,
|
||||
* but offset it so that the actor of interest lands on our
|
||||
* framebuffer. */
|
||||
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
|
||||
/* We don't want the FBO contents to be transformed. That could waste memory
|
||||
* (e.g. during zoom), or result in something that's not rectangular (clipped
|
||||
* incorrectly). So drop the modelview matrix of the current paint chain.
|
||||
* This is fine since paint_texture runs with the same modelview matrix,
|
||||
* so it will come out correctly whenever that is used to put the FBO
|
||||
* contents on screen...
|
||||
*/
|
||||
xexpand = 0.f;
|
||||
if (priv->x_offset < 0.f)
|
||||
xexpand = -priv->x_offset;
|
||||
if (priv->x_offset + texture_width > width)
|
||||
xexpand = MAX (xexpand, (priv->x_offset + texture_width) - width);
|
||||
clutter_actor_get_transform (priv->stage, &modelview);
|
||||
cogl_set_modelview_matrix (&modelview);
|
||||
|
||||
yexpand = 0.f;
|
||||
if (priv->y_offset < 0.f)
|
||||
yexpand = -priv->y_offset;
|
||||
if (priv->y_offset + texture_height > height)
|
||||
yexpand = MAX (yexpand, (priv->y_offset + texture_height) - height);
|
||||
/* Save the original viewport for calculating priv->position */
|
||||
_clutter_stage_get_viewport (CLUTTER_STAGE (priv->stage),
|
||||
&old_viewport[0],
|
||||
&old_viewport[1],
|
||||
&old_viewport[2],
|
||||
&old_viewport[3]);
|
||||
|
||||
/* Set the viewport */
|
||||
cogl_set_viewport (-(priv->x_offset + xexpand), -(priv->y_offset + yexpand),
|
||||
width + (2 * xexpand), height + (2 * yexpand));
|
||||
/* Set up the viewport so that it has the same size as the stage (avoid
|
||||
* distortion), but translated to account for the FBO offset...
|
||||
*/
|
||||
cogl_set_viewport (-priv->fbo_offset_x,
|
||||
-priv->fbo_offset_y,
|
||||
stage_width,
|
||||
stage_height);
|
||||
|
||||
/* Copy the stage's projection matrix across to the framebuffer */
|
||||
_clutter_stage_get_projection_matrix (CLUTTER_STAGE (priv->stage),
|
||||
&projection);
|
||||
|
||||
/* If we've expanded the viewport, make sure to scale the projection
|
||||
* matrix accordingly (as it's been initialised to work with the
|
||||
* original viewport and not our expanded one).
|
||||
/* Now save the global position of the effect (not just of the actor).
|
||||
* It doesn't appear anyone actually uses this yet, but get_target_rect is
|
||||
* documented as returning it. So we should...
|
||||
*/
|
||||
if (xexpand > 0.f || yexpand > 0.f)
|
||||
{
|
||||
gfloat new_width, new_height;
|
||||
|
||||
new_width = width + (2 * xexpand);
|
||||
new_height = height + (2 * yexpand);
|
||||
|
||||
cogl_matrix_scale (&projection,
|
||||
width / new_width,
|
||||
height / new_height,
|
||||
1);
|
||||
}
|
||||
_clutter_util_fully_transform_vertices (&old_modelview,
|
||||
&projection,
|
||||
old_viewport,
|
||||
&local_offset,
|
||||
&priv->position,
|
||||
1);
|
||||
|
||||
cogl_set_projection_matrix (&projection);
|
||||
|
||||
@@ -352,6 +336,7 @@ static void
|
||||
clutter_offscreen_effect_real_paint_target (ClutterOffscreenEffect *effect)
|
||||
{
|
||||
ClutterOffscreenEffectPrivate *priv = effect->priv;
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
guint8 paint_opacity;
|
||||
|
||||
paint_opacity = clutter_actor_get_paint_opacity (priv->actor);
|
||||
@@ -361,18 +346,19 @@ clutter_offscreen_effect_real_paint_target (ClutterOffscreenEffect *effect)
|
||||
paint_opacity,
|
||||
paint_opacity,
|
||||
paint_opacity);
|
||||
cogl_set_source (priv->target);
|
||||
|
||||
/* At this point we are in stage coordinates translated so if
|
||||
* we draw our texture using a textured quad the size of the paint
|
||||
* box then we will overlay where the actor would have drawn if it
|
||||
* hadn't been redirected offscreen.
|
||||
*/
|
||||
cogl_rectangle_with_texture_coords (0, 0,
|
||||
cogl_texture_get_width (priv->texture),
|
||||
cogl_texture_get_height (priv->texture),
|
||||
0.0, 0.0,
|
||||
1.0, 1.0);
|
||||
cogl_framebuffer_draw_textured_rectangle (framebuffer,
|
||||
priv->target,
|
||||
0, 0,
|
||||
cogl_texture_get_width (priv->texture),
|
||||
cogl_texture_get_height (priv->texture),
|
||||
0.0, 0.0,
|
||||
1.0, 1.0);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -383,13 +369,14 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect)
|
||||
|
||||
cogl_push_matrix ();
|
||||
|
||||
/* Now reset the modelview to put us in stage coordinates so
|
||||
* we can drawn the result of our offscreen render as a textured
|
||||
* quad... */
|
||||
|
||||
cogl_matrix_init_identity (&modelview);
|
||||
_clutter_actor_apply_modelview_transform (priv->stage, &modelview);
|
||||
cogl_matrix_translate (&modelview, priv->x_offset, priv->y_offset, 0.0f);
|
||||
/* The current modelview matrix is *almost* perfect already. It's only
|
||||
* missing a correction for the expanded FBO and offset rendering within...
|
||||
*/
|
||||
cogl_get_modelview_matrix (&modelview);
|
||||
cogl_matrix_translate (&modelview,
|
||||
priv->fbo_offset_x,
|
||||
priv->fbo_offset_y,
|
||||
0.0f);
|
||||
cogl_set_modelview_matrix (&modelview);
|
||||
|
||||
/* paint the target material; this is virtualized for
|
||||
@@ -426,16 +413,11 @@ clutter_offscreen_effect_paint (ClutterEffect *effect,
|
||||
{
|
||||
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
|
||||
ClutterOffscreenEffectPrivate *priv = self->priv;
|
||||
CoglMatrix matrix;
|
||||
|
||||
cogl_get_modelview_matrix (&matrix);
|
||||
|
||||
/* 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
|
||||
in the fbo */
|
||||
if (priv->offscreen == NULL ||
|
||||
(flags & CLUTTER_EFFECT_PAINT_ACTOR_DIRTY) ||
|
||||
!cogl_matrix_equal (&matrix, &priv->last_matrix_drawn))
|
||||
/* If we've already got a cached image and the actor hasn't been redrawn
|
||||
* then we can just use the cached image in the FBO.
|
||||
*/
|
||||
if (priv->offscreen == NULL || (flags & CLUTTER_EFFECT_PAINT_ACTOR_DIRTY))
|
||||
{
|
||||
/* Chain up to the parent paint method which will call the pre and
|
||||
post paint functions to update the image */
|
||||
@@ -661,8 +643,8 @@ clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
||||
return FALSE;
|
||||
|
||||
clutter_rect_init (rect,
|
||||
priv->x_offset,
|
||||
priv->y_offset,
|
||||
priv->position.x,
|
||||
priv->position.y,
|
||||
cogl_texture_get_width (priv->texture),
|
||||
cogl_texture_get_height (priv->texture));
|
||||
|
||||
|
@@ -77,6 +77,7 @@ struct _ClutterPaintNodeClass
|
||||
typedef enum {
|
||||
PAINT_OP_INVALID = 0,
|
||||
PAINT_OP_TEX_RECT,
|
||||
PAINT_OP_MULTITEX_RECT,
|
||||
PAINT_OP_PATH,
|
||||
PAINT_OP_PRIMITIVE
|
||||
} PaintOpCode;
|
||||
@@ -85,6 +86,8 @@ struct _ClutterPaintOperation
|
||||
{
|
||||
PaintOpCode opcode;
|
||||
|
||||
GArray *multitex_coords;
|
||||
|
||||
union {
|
||||
float texrect[8];
|
||||
|
||||
@@ -94,7 +97,6 @@ struct _ClutterPaintOperation
|
||||
} op;
|
||||
};
|
||||
|
||||
GType _clutter_root_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;
|
||||
|
||||
@@ -107,13 +109,9 @@ void _clutter_paint_operation_paint_primitive (const C
|
||||
void _clutter_paint_node_init_types (void);
|
||||
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_dummy_node_new (ClutterActor *actor);
|
||||
|
||||
void _clutter_paint_node_paint (ClutterPaintNode *root);
|
||||
void _clutter_paint_node_dump_tree (ClutterPaintNode *root);
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
|
@@ -761,6 +761,11 @@ clutter_paint_operation_clear (ClutterPaintOperation *op)
|
||||
case PAINT_OP_TEX_RECT:
|
||||
break;
|
||||
|
||||
case PAINT_OP_MULTITEX_RECT:
|
||||
if (op->multitex_coords != NULL)
|
||||
g_array_unref (op->multitex_coords);
|
||||
break;
|
||||
|
||||
case PAINT_OP_PATH:
|
||||
if (op->op.path != NULL)
|
||||
cogl_object_unref (op->op.path);
|
||||
@@ -794,6 +799,27 @@ clutter_paint_op_init_tex_rect (ClutterPaintOperation *op,
|
||||
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
|
||||
clutter_paint_op_init_path (ClutterPaintOperation *op,
|
||||
CoglPath *path)
|
||||
@@ -881,6 +907,33 @@ clutter_paint_node_add_texture_rectangle (ClutterPaintNode *node,
|
||||
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)
|
||||
* @node: a #ClutterPaintNode
|
||||
@@ -936,15 +989,15 @@ clutter_paint_node_add_primitive (ClutterPaintNode *node,
|
||||
g_array_append_val (node->operations, operation);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* _clutter_paint_node_paint:
|
||||
/**
|
||||
* clutter_paint_node_paint:
|
||||
* @node: a #ClutterPaintNode
|
||||
*
|
||||
* Paints the @node using the class implementation, traversing
|
||||
* its children, if any.
|
||||
*/
|
||||
void
|
||||
_clutter_paint_node_paint (ClutterPaintNode *node)
|
||||
clutter_paint_node_paint (ClutterPaintNode *node)
|
||||
{
|
||||
ClutterPaintNodeClass *klass = CLUTTER_PAINT_NODE_GET_CLASS (node);
|
||||
ClutterPaintNode *iter;
|
||||
@@ -961,7 +1014,7 @@ _clutter_paint_node_paint (ClutterPaintNode *node)
|
||||
iter != NULL;
|
||||
iter = iter->next_sibling)
|
||||
{
|
||||
_clutter_paint_node_paint (iter);
|
||||
clutter_paint_node_paint (iter);
|
||||
}
|
||||
|
||||
if (res)
|
||||
@@ -1006,7 +1059,7 @@ clutter_paint_node_to_json (ClutterPaintNode *node)
|
||||
|
||||
if (node->operations != NULL)
|
||||
{
|
||||
guint i;
|
||||
guint i, j;
|
||||
|
||||
for (i = 0; i < node->operations->len; i++)
|
||||
{
|
||||
@@ -1031,6 +1084,19 @@ clutter_paint_node_to_json (ClutterPaintNode *node)
|
||||
json_builder_end_array (builder);
|
||||
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:
|
||||
json_builder_set_member_name (builder, "path");
|
||||
json_builder_add_int_value (builder, (gint64) op->op.path);
|
||||
|
@@ -49,6 +49,9 @@ ClutterPaintNode * clutter_paint_node_ref (Clutter
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_node_unref (ClutterPaintNode *node);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_node_paint (ClutterPaintNode *node);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_node_set_name (ClutterPaintNode *node,
|
||||
const char *name);
|
||||
@@ -67,6 +70,12 @@ void clutter_paint_node_add_texture_rectangle (Clutter
|
||||
float x_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
|
||||
void clutter_paint_node_add_path (ClutterPaintNode *node,
|
||||
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
|
||||
* top-level actor.
|
||||
*/
|
||||
|
||||
#define clutter_root_node_get_type _clutter_root_node_get_type
|
||||
|
||||
typedef struct _ClutterRootNode ClutterRootNode;
|
||||
typedef struct _ClutterPaintNodeClass ClutterRootNodeClass;
|
||||
#define clutter_root_node_get_type clutter_root_node_get_type
|
||||
|
||||
struct _ClutterRootNode
|
||||
{
|
||||
@@ -111,6 +108,8 @@ clutter_root_node_pre_draw (ClutterPaintNode *node)
|
||||
{
|
||||
ClutterRootNode *rnode = (ClutterRootNode *) node;
|
||||
|
||||
cogl_push_framebuffer (rnode->framebuffer);
|
||||
|
||||
cogl_framebuffer_clear (rnode->framebuffer,
|
||||
rnode->clear_flags,
|
||||
&rnode->clear_color);
|
||||
@@ -121,6 +120,7 @@ clutter_root_node_pre_draw (ClutterPaintNode *node)
|
||||
static void
|
||||
clutter_root_node_post_draw (ClutterPaintNode *node)
|
||||
{
|
||||
cogl_pop_framebuffer ();
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -158,13 +158,13 @@ clutter_root_node_init (ClutterRootNode *self)
|
||||
}
|
||||
|
||||
ClutterPaintNode *
|
||||
_clutter_root_node_new (CoglFramebuffer *framebuffer,
|
||||
const ClutterColor *clear_color,
|
||||
CoglBufferBit clear_flags)
|
||||
clutter_root_node_new (CoglFramebuffer *framebuffer,
|
||||
const ClutterColor *clear_color,
|
||||
CoglBufferBit clear_flags)
|
||||
{
|
||||
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,
|
||||
clear_color->red,
|
||||
@@ -431,6 +431,17 @@ clutter_pipeline_node_draw (ClutterPaintNode *node)
|
||||
op->op.texrect[7]);
|
||||
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:
|
||||
cogl_path_fill (op->op.path);
|
||||
break;
|
||||
@@ -827,6 +838,7 @@ clutter_text_node_draw (ClutterPaintNode *node)
|
||||
cogl_framebuffer_pop_clip (fb);
|
||||
break;
|
||||
|
||||
case PAINT_OP_MULTITEX_RECT:
|
||||
case PAINT_OP_PATH:
|
||||
case PAINT_OP_PRIMITIVE:
|
||||
case PAINT_OP_INVALID:
|
||||
@@ -992,6 +1004,7 @@ clutter_clip_node_pre_draw (ClutterPaintNode *node)
|
||||
retval = TRUE;
|
||||
break;
|
||||
|
||||
case PAINT_OP_MULTITEX_RECT:
|
||||
case PAINT_OP_PRIMITIVE:
|
||||
case PAINT_OP_INVALID:
|
||||
break;
|
||||
@@ -1025,6 +1038,7 @@ clutter_clip_node_post_draw (ClutterPaintNode *node)
|
||||
cogl_framebuffer_pop_clip (fb);
|
||||
break;
|
||||
|
||||
case PAINT_OP_MULTITEX_RECT:
|
||||
case PAINT_OP_PRIMITIVE:
|
||||
case PAINT_OP_INVALID:
|
||||
break;
|
||||
@@ -1180,6 +1194,17 @@ clutter_layer_node_post_draw (ClutterPaintNode *node)
|
||||
cogl_pop_source ();
|
||||
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:
|
||||
cogl_push_source (lnode->state);
|
||||
cogl_path_fill (op->op.path);
|
||||
|
@@ -143,6 +143,26 @@ CLUTTER_EXPORT
|
||||
ClutterPaintNode * clutter_text_node_new (PangoLayout *layout,
|
||||
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
|
||||
|
||||
#endif /* __CLUTTER_PAINT_NODES_H__ */
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include "clutter-paint-volume-private.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-stage-private.h"
|
||||
#include "clutter-actor-box-private.h"
|
||||
|
||||
G_DEFINE_BOXED_TYPE (ClutterPaintVolume, clutter_paint_volume,
|
||||
clutter_paint_volume_copy,
|
||||
@@ -1138,8 +1139,6 @@ _clutter_paint_volume_get_stage_paint_box (ClutterPaintVolume *pv,
|
||||
CoglMatrix modelview;
|
||||
CoglMatrix projection;
|
||||
float viewport[4];
|
||||
float width;
|
||||
float height;
|
||||
|
||||
_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);
|
||||
|
||||
/* 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. */
|
||||
if (pv->is_2d && pv->actor &&
|
||||
clutter_actor_get_z_position (pv->actor) == 0)
|
||||
{
|
||||
/* If the volume/actor are perfectly 2D, take the bounding box as
|
||||
* good. We won't need to add any extra room for sub-pixel positioning
|
||||
* in this case.
|
||||
*/
|
||||
clutter_paint_volume_free (&projected_pv);
|
||||
box->x1 = CLUTTER_NEARBYINT (box->x1);
|
||||
box->y1 = CLUTTER_NEARBYINT (box->y1);
|
||||
box->x2 = CLUTTER_NEARBYINT (box->x2);
|
||||
box->y2 = CLUTTER_NEARBYINT (box->y2);
|
||||
return;
|
||||
}
|
||||
|
||||
/* 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;
|
||||
_clutter_actor_box_enlarge_for_effects (box);
|
||||
|
||||
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);
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -202,7 +202,7 @@ gboolean _clutter_feature_init (GError **error);
|
||||
|
||||
/* Diagnostic mode */
|
||||
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 */
|
||||
guint _clutter_pixel_to_id (guchar pixel[4]);
|
||||
|
@@ -333,6 +333,7 @@ clutter_shader_effect_create_shader (ClutterShaderEffect *self)
|
||||
|
||||
default:
|
||||
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 *entry,
|
||||
ClutterActor *actor,
|
||||
ClutterPaintVolume *clip);
|
||||
const ClutterPaintVolume *clip);
|
||||
void _clutter_stage_queue_redraw_entry_invalidate (ClutterStageQueueRedrawEntry *entry);
|
||||
|
||||
CoglFramebuffer *_clutter_stage_get_active_framebuffer (ClutterStage *stage);
|
||||
|
@@ -6,6 +6,14 @@
|
||||
#include "clutter-stage-window.h"
|
||||
#include "clutter-private.h"
|
||||
|
||||
/**
|
||||
* SECTION:clutter-stage-window
|
||||
* @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.
|
||||
*/
|
||||
|
||||
#define clutter_stage_window_get_type _clutter_stage_window_get_type
|
||||
|
||||
typedef ClutterStageWindowIface ClutterStageWindowInterface;
|
||||
@@ -36,6 +44,12 @@ clutter_stage_window_default_init (ClutterStageWindowInterface *iface)
|
||||
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 *
|
||||
_clutter_stage_window_get_wrapper (ClutterStageWindow *window)
|
||||
{
|
||||
@@ -138,6 +152,14 @@ _clutter_stage_window_schedule_update (ClutterStageWindow *window,
|
||||
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
|
||||
_clutter_stage_window_get_update_time (ClutterStageWindow *window)
|
||||
{
|
||||
@@ -155,6 +177,12 @@ _clutter_stage_window_get_update_time (ClutterStageWindow *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
|
||||
_clutter_stage_window_clear_update_time (ClutterStageWindow *window)
|
||||
{
|
||||
|
@@ -36,10 +36,10 @@
|
||||
* using clutter_actor_destroy(), which will take care of destroying all the
|
||||
* actors contained inside them.
|
||||
*
|
||||
* #ClutterStage is a proxy actor, wrapping the backend-specific
|
||||
* implementation of the windowing system. It is possible to subclass
|
||||
* #ClutterStage, as long as every overridden virtual function chains up to
|
||||
* the parent class corresponding function.
|
||||
* #ClutterStage is a proxy actor, wrapping the backend-specific implementation
|
||||
* (a #StageWindow) of the windowing system. It is possible to subclass
|
||||
* #ClutterStage, as long as every overridden virtual function chains up to the
|
||||
* parent class corresponding function.
|
||||
*/
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
@@ -1391,11 +1391,12 @@ clutter_stage_get_redraw_clip_bounds (ClutterStage *stage,
|
||||
}
|
||||
|
||||
static void
|
||||
read_pixels_to_file (char *filename_stem,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height)
|
||||
read_pixels_to_file (CoglFramebuffer *fb,
|
||||
char *filename_stem,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
guint8 *data;
|
||||
cairo_surface_t *surface;
|
||||
@@ -1405,10 +1406,10 @@ read_pixels_to_file (char *filename_stem,
|
||||
read_count);
|
||||
|
||||
data = g_malloc (4 * width * height);
|
||||
cogl_read_pixels (x, y, width, height,
|
||||
COGL_READ_PIXELS_COLOR_BUFFER,
|
||||
CLUTTER_CAIRO_FORMAT_ARGB32,
|
||||
data);
|
||||
cogl_framebuffer_read_pixels (fb,
|
||||
x, y, width, height,
|
||||
CLUTTER_CAIRO_FORMAT_ARGB32,
|
||||
data);
|
||||
|
||||
surface = cairo_image_surface_create_for_data (data, CAIRO_FORMAT_RGB24,
|
||||
width, height,
|
||||
@@ -1473,8 +1474,8 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
|
||||
if (G_LIKELY (!(clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS)))
|
||||
{
|
||||
CLUTTER_NOTE (PICK, "Pushing pick scissor clip x: %d, y: %d, 1x1",
|
||||
(int) dirty_x * fb_scale,
|
||||
(int) dirty_y * fb_scale);
|
||||
(int) (dirty_x * fb_scale),
|
||||
(int) (dirty_y * fb_scale));
|
||||
cogl_framebuffer_push_scissor_clip (fb, dirty_x * fb_scale, dirty_y * fb_scale, 1, 1);
|
||||
}
|
||||
|
||||
@@ -1494,13 +1495,13 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
|
||||
read_x = dirty_x * 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,
|
||||
view_layout.width, view_layout.height,
|
||||
view_layout.x, view_layout.y, fb_scale);
|
||||
|
||||
cogl_color_init_from_4ub (&stage_pick_id, 255, 255, 255, 255);
|
||||
cogl_clear (&stage_pick_id, COGL_BUFFER_BIT_COLOR | COGL_BUFFER_BIT_DEPTH);
|
||||
cogl_framebuffer_clear (fb, COGL_BUFFER_BIT_COLOR | COGL_BUFFER_BIT_DEPTH, &stage_pick_id);
|
||||
|
||||
/* Disable dithering (if any) when doing the painting in pick mode */
|
||||
dither_enabled_save = cogl_framebuffer_get_dither_enabled (fb);
|
||||
@@ -1510,7 +1511,8 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
|
||||
* are drawn offscreen (as we never swap buffers)
|
||||
*/
|
||||
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;
|
||||
|
||||
/* Read the color of the screen co-ords pixel. RGBA_8888_PRE is used
|
||||
@@ -1532,7 +1534,7 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
|
||||
_clutter_actor_get_debug_name (actor),
|
||||
view_layout.x);
|
||||
|
||||
read_pixels_to_file (file_name, 0, 0, fb_width, fb_height);
|
||||
read_pixels_to_file (fb, file_name, 0, 0, fb_width, fb_height);
|
||||
|
||||
g_free (file_name);
|
||||
}
|
||||
@@ -2247,6 +2249,8 @@ clutter_stage_class_init (ClutterStageClass *klass)
|
||||
* @stage: the stage that received the event
|
||||
* @frame_event: a #CoglFrameEvent
|
||||
* @frame_info: a #ClutterFrameInfo
|
||||
*
|
||||
* Signals that the #ClutterStage was presented on the screen to the user.
|
||||
*/
|
||||
stage_signals[PRESENTED] =
|
||||
g_signal_new (I_("presented"),
|
||||
@@ -3626,6 +3630,10 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
|
||||
float fb_scale;
|
||||
float viewport_offset_x;
|
||||
float viewport_offset_y;
|
||||
float viewport_x;
|
||||
float viewport_y;
|
||||
float viewport_width;
|
||||
float viewport_height;
|
||||
float z_2d;
|
||||
|
||||
CLUTTER_NOTE (PAINT,
|
||||
@@ -3638,11 +3646,13 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
|
||||
|
||||
viewport_offset_x = view_layout.x * 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,
|
||||
priv->viewport[0] * fb_scale - viewport_offset_x,
|
||||
priv->viewport[1] * fb_scale - viewport_offset_y,
|
||||
priv->viewport[2] * fb_scale,
|
||||
priv->viewport[3] * fb_scale);
|
||||
viewport_x, viewport_y,
|
||||
viewport_width, viewport_height);
|
||||
|
||||
perspective = priv->perspective;
|
||||
|
||||
@@ -3721,6 +3731,17 @@ clutter_stage_ensure_redraw (ClutterStage *stage)
|
||||
_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:
|
||||
* @stage: the #ClutterStage
|
||||
@@ -3981,6 +4002,12 @@ clutter_stage_get_minimum_size (ClutterStage *stage,
|
||||
*height_p = (guint) height;
|
||||
}
|
||||
|
||||
/**
|
||||
* _clutter_stage_schedule_update:
|
||||
* @window: a #ClutterStage actor
|
||||
*
|
||||
* Schedules a redraw of the #ClutterStage at the next optimal timestamp.
|
||||
*/
|
||||
void
|
||||
_clutter_stage_schedule_update (ClutterStage *stage)
|
||||
{
|
||||
@@ -3997,7 +4024,18 @@ _clutter_stage_schedule_update (ClutterStage *stage)
|
||||
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
|
||||
_clutter_stage_get_update_time (ClutterStage *stage)
|
||||
{
|
||||
@@ -4013,6 +4051,13 @@ _clutter_stage_get_update_time (ClutterStage *stage)
|
||||
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
|
||||
_clutter_stage_clear_update_time (ClutterStage *stage)
|
||||
{
|
||||
@@ -4138,10 +4183,10 @@ _clutter_stage_get_clip (ClutterStage *stage)
|
||||
* didn't explicitly do so.
|
||||
*/
|
||||
ClutterStageQueueRedrawEntry *
|
||||
_clutter_stage_queue_actor_redraw (ClutterStage *stage,
|
||||
_clutter_stage_queue_actor_redraw (ClutterStage *stage,
|
||||
ClutterStageQueueRedrawEntry *entry,
|
||||
ClutterActor *actor,
|
||||
ClutterPaintVolume *clip)
|
||||
ClutterActor *actor,
|
||||
const ClutterPaintVolume *clip)
|
||||
{
|
||||
ClutterStagePrivate *priv = stage->priv;
|
||||
|
||||
|
@@ -250,6 +250,9 @@ void clutter_stage_ensure_viewport (ClutterStage
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_ensure_redraw (ClutterStage *stage);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_stage_is_redraw_queued (ClutterStage *stage);
|
||||
|
||||
#ifdef CLUTTER_ENABLE_EXPERIMENTAL_API
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_set_sync_delay (ClutterStage *stage,
|
||||
|
@@ -277,6 +277,8 @@ static const ClutterColor default_selection_color = { 0, 0, 0, 255 };
|
||||
static const ClutterColor default_text_color = { 0, 0, 0, 255 };
|
||||
static const ClutterColor default_selected_text_color = { 0, 0, 0, 255 };
|
||||
|
||||
static CoglPipeline *default_color_pipeline = NULL;
|
||||
|
||||
static ClutterAnimatableIface *parent_animatable_iface = NULL;
|
||||
static ClutterScriptableIface *parent_scriptable_iface = NULL;
|
||||
|
||||
@@ -1744,7 +1746,8 @@ add_selection_rectangle_to_path (ClutterText *text,
|
||||
|
||||
/* Draws the selected text, its background, and the cursor */
|
||||
static void
|
||||
selection_paint (ClutterText *self)
|
||||
selection_paint (ClutterText *self,
|
||||
CoglFramebuffer *fb)
|
||||
{
|
||||
ClutterTextPrivate *priv = self->priv;
|
||||
ClutterActor *actor = CLUTTER_ACTOR (self);
|
||||
@@ -1756,21 +1759,30 @@ selection_paint (ClutterText *self)
|
||||
|
||||
if (priv->position == priv->selection_bound)
|
||||
{
|
||||
CoglPipeline *color_pipeline = cogl_pipeline_copy (default_color_pipeline);
|
||||
CoglColor cogl_color;
|
||||
|
||||
/* No selection, just draw the cursor */
|
||||
if (priv->cursor_color_set)
|
||||
color = &priv->cursor_color;
|
||||
else
|
||||
color = &priv->text_color;
|
||||
|
||||
cogl_set_source_color4ub (color->red,
|
||||
|
||||
cogl_color_init_from_4ub (&cogl_color,
|
||||
color->red,
|
||||
color->green,
|
||||
color->blue,
|
||||
paint_opacity * color->alpha / 255);
|
||||
cogl_color_premultiply (&cogl_color);
|
||||
cogl_pipeline_set_color (color_pipeline, &cogl_color);
|
||||
|
||||
cogl_rectangle (priv->cursor_rect.origin.x,
|
||||
priv->cursor_rect.origin.y,
|
||||
priv->cursor_rect.origin.x + priv->cursor_rect.size.width,
|
||||
priv->cursor_rect.origin.y + priv->cursor_rect.size.height);
|
||||
cogl_framebuffer_draw_rectangle (fb,
|
||||
color_pipeline,
|
||||
priv->cursor_rect.origin.x,
|
||||
priv->cursor_rect.origin.y,
|
||||
priv->cursor_rect.origin.x + priv->cursor_rect.size.width,
|
||||
priv->cursor_rect.origin.y + priv->cursor_rect.size.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1778,11 +1790,6 @@ selection_paint (ClutterText *self)
|
||||
PangoLayout *layout = clutter_text_get_layout (self);
|
||||
CoglPath *selection_path = cogl_path_new ();
|
||||
CoglColor cogl_color = { 0, };
|
||||
CoglFramebuffer *fb;
|
||||
|
||||
fb = cogl_get_draw_framebuffer ();
|
||||
if (G_UNLIKELY (fb == NULL))
|
||||
return;
|
||||
|
||||
/* Paint selection background */
|
||||
if (priv->selection_color_set)
|
||||
@@ -1792,11 +1799,6 @@ selection_paint (ClutterText *self)
|
||||
else
|
||||
color = &priv->text_color;
|
||||
|
||||
cogl_set_source_color4ub (color->red,
|
||||
color->green,
|
||||
color->blue,
|
||||
paint_opacity * color->alpha / 255);
|
||||
|
||||
clutter_text_foreach_selection_rectangle (self,
|
||||
add_selection_rectangle_to_path,
|
||||
selection_path);
|
||||
@@ -2400,9 +2402,19 @@ clutter_text_paint (ClutterActor *self)
|
||||
alloc_width = alloc.x2 - alloc.x1;
|
||||
alloc_height = alloc.y2 - alloc.y1;
|
||||
|
||||
if (G_UNLIKELY (default_color_pipeline == NULL))
|
||||
{
|
||||
CoglContext *ctx =
|
||||
clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||
default_color_pipeline = cogl_pipeline_new (ctx);
|
||||
}
|
||||
|
||||
g_assert (default_color_pipeline != NULL);
|
||||
|
||||
g_object_get (self, "background-color-set", &bg_color_set, NULL);
|
||||
if (bg_color_set)
|
||||
{
|
||||
CoglPipeline *color_pipeline = cogl_pipeline_copy (default_color_pipeline);
|
||||
ClutterColor bg_color;
|
||||
|
||||
clutter_actor_get_background_color (self, &bg_color);
|
||||
@@ -2410,11 +2422,20 @@ clutter_text_paint (ClutterActor *self)
|
||||
* bg_color.alpha
|
||||
/ 255;
|
||||
|
||||
cogl_set_source_color4ub (bg_color.red,
|
||||
cogl_color_init_from_4ub (&color,
|
||||
bg_color.red,
|
||||
bg_color.green,
|
||||
bg_color.blue,
|
||||
bg_color.alpha);
|
||||
cogl_rectangle (0, 0, alloc_width, alloc_height);
|
||||
cogl_color_premultiply (&color);
|
||||
cogl_pipeline_set_color (color_pipeline, &color);
|
||||
|
||||
cogl_framebuffer_draw_rectangle (fb,
|
||||
color_pipeline,
|
||||
0, 0,
|
||||
alloc_width, alloc_height);
|
||||
|
||||
cogl_object_unref (color_pipeline);
|
||||
}
|
||||
|
||||
/* don't bother painting an empty text actor, unless it's
|
||||
@@ -2546,7 +2567,7 @@ clutter_text_paint (ClutterActor *self)
|
||||
real_opacity);
|
||||
cogl_pango_render_layout (layout, priv->text_x, priv->text_y, &color, 0);
|
||||
|
||||
selection_paint (text);
|
||||
selection_paint (text, fb);
|
||||
|
||||
if (clip_set)
|
||||
cogl_framebuffer_pop_clip (fb);
|
||||
|
@@ -76,6 +76,7 @@
|
||||
#include "clutter-input-focus.h"
|
||||
#include "clutter-interval.h"
|
||||
#include "clutter-keyframe-transition.h"
|
||||
#include "clutter-keymap.h"
|
||||
#include "clutter-keysyms.h"
|
||||
#include "clutter-layout-manager.h"
|
||||
#include "clutter-layout-meta.h"
|
||||
|
@@ -351,6 +351,58 @@ valid_buffer_age (ClutterStageViewCogl *view_cogl,
|
||||
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
|
||||
swap_framebuffer (ClutterStageWindow *stage_window,
|
||||
ClutterStageView *view,
|
||||
@@ -370,6 +422,9 @@ swap_framebuffer (ClutterStageWindow *stage_window,
|
||||
else
|
||||
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))
|
||||
{
|
||||
CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer);
|
||||
@@ -521,6 +576,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
|
||||
clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
ClutterStageView *view)
|
||||
@@ -558,9 +622,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
cogl_is_onscreen (fb) &&
|
||||
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_REGION);
|
||||
|
||||
has_buffer_age =
|
||||
cogl_is_onscreen (fb) &&
|
||||
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
|
||||
has_buffer_age = cogl_is_onscreen (fb) && is_buffer_age_enabled ();
|
||||
|
||||
/* NB: a zero width redraw clip == full stage redraw */
|
||||
if (stage_cogl->bounding_redraw_clip.width == 0)
|
||||
@@ -891,7 +953,7 @@ clutter_stage_cogl_get_dirty_pixel (ClutterStageWindow *stage_window,
|
||||
CoglFramebuffer *framebuffer = clutter_stage_view_get_framebuffer (view);
|
||||
gboolean has_buffer_age =
|
||||
cogl_is_onscreen (framebuffer) &&
|
||||
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
|
||||
is_buffer_age_enabled ();
|
||||
float fb_scale;
|
||||
gboolean scale_is_fractional;
|
||||
|
||||
|
@@ -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__ */
|
@@ -81,7 +81,11 @@ static void
|
||||
clutter_rectangle_paint (ClutterActor *self)
|
||||
{
|
||||
ClutterRectanglePrivate *priv = CLUTTER_RECTANGLE (self)->priv;
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
static CoglPipeline *default_color_pipeline = NULL;
|
||||
CoglPipeline *content_pipeline;
|
||||
ClutterGeometry geom;
|
||||
CoglColor color;
|
||||
guint8 tmp_alpha;
|
||||
|
||||
CLUTTER_NOTE (PAINT,
|
||||
@@ -90,58 +94,86 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
: "unknown");
|
||||
clutter_actor_get_allocation_geometry (self, &geom);
|
||||
|
||||
if (G_UNLIKELY (default_color_pipeline == NULL))
|
||||
{
|
||||
CoglContext *ctx =
|
||||
clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||
default_color_pipeline = cogl_pipeline_new (ctx);
|
||||
}
|
||||
|
||||
g_assert (default_color_pipeline != NULL);
|
||||
content_pipeline = cogl_pipeline_copy (default_color_pipeline);
|
||||
|
||||
/* compute the composited opacity of the actor taking into
|
||||
* account the opacity of the color set by the user
|
||||
*/
|
||||
tmp_alpha = clutter_actor_get_paint_opacity (self)
|
||||
* priv->color.alpha
|
||||
/ 255;
|
||||
|
||||
cogl_color_init_from_4ub (&color,
|
||||
priv->color.red,
|
||||
priv->color.green,
|
||||
priv->color.blue,
|
||||
tmp_alpha);
|
||||
cogl_color_premultiply (&color);
|
||||
cogl_pipeline_set_color (content_pipeline, &color);
|
||||
|
||||
if (priv->has_border)
|
||||
{
|
||||
CoglPipeline *border_pipeline;
|
||||
|
||||
border_pipeline = cogl_pipeline_copy (default_color_pipeline);
|
||||
|
||||
tmp_alpha = clutter_actor_get_paint_opacity (self)
|
||||
* priv->border_color.alpha
|
||||
/ 255;
|
||||
|
||||
cogl_color_init_from_4ub (&color,
|
||||
priv->border_color.red,
|
||||
priv->border_color.green,
|
||||
priv->border_color.blue,
|
||||
tmp_alpha);
|
||||
cogl_color_premultiply (&color);
|
||||
cogl_pipeline_set_color (border_pipeline, &color);
|
||||
|
||||
/* We paint the border and the content only if the rectangle
|
||||
* is big enough to show them
|
||||
*/
|
||||
if ((priv->border_width * 2) < geom.width &&
|
||||
(priv->border_width * 2) < geom.height)
|
||||
{
|
||||
/* compute the composited opacity of the actor taking into
|
||||
* account the opacity of the color set by the user
|
||||
*/
|
||||
tmp_alpha = clutter_actor_get_paint_opacity (self)
|
||||
* priv->border_color.alpha
|
||||
/ 255;
|
||||
/* paint the border. this sucks, but it's the only way to make a border */
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
border_pipeline,
|
||||
priv->border_width, 0,
|
||||
geom.width,
|
||||
priv->border_width);
|
||||
|
||||
/* paint the border */
|
||||
cogl_set_source_color4ub (priv->border_color.red,
|
||||
priv->border_color.green,
|
||||
priv->border_color.blue,
|
||||
tmp_alpha);
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
border_pipeline,
|
||||
geom.width - priv->border_width,
|
||||
priv->border_width,
|
||||
geom.width, geom.height);
|
||||
|
||||
/* this sucks, but it's the only way to make a border */
|
||||
cogl_rectangle (priv->border_width, 0,
|
||||
geom.width,
|
||||
priv->border_width);
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
border_pipeline,
|
||||
0, geom.height - priv->border_width,
|
||||
geom.width - priv->border_width,
|
||||
geom.height);
|
||||
|
||||
cogl_rectangle (geom.width - priv->border_width,
|
||||
priv->border_width,
|
||||
geom.width,
|
||||
geom.height);
|
||||
|
||||
cogl_rectangle (0, geom.height - priv->border_width,
|
||||
geom.width - priv->border_width,
|
||||
geom.height);
|
||||
|
||||
cogl_rectangle (0, 0,
|
||||
priv->border_width,
|
||||
geom.height - priv->border_width);
|
||||
|
||||
tmp_alpha = clutter_actor_get_paint_opacity (self)
|
||||
* priv->color.alpha
|
||||
/ 255;
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
border_pipeline,
|
||||
0, 0,
|
||||
priv->border_width,
|
||||
geom.height - priv->border_width);
|
||||
|
||||
/* now paint the rectangle */
|
||||
cogl_set_source_color4ub (priv->color.red,
|
||||
priv->color.green,
|
||||
priv->color.blue,
|
||||
tmp_alpha);
|
||||
|
||||
cogl_rectangle (priv->border_width, priv->border_width,
|
||||
geom.width - priv->border_width,
|
||||
geom.height - priv->border_width);
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
content_pipeline,
|
||||
priv->border_width, priv->border_width,
|
||||
geom.width - priv->border_width,
|
||||
geom.height - priv->border_width);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -149,34 +181,21 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
* as the border, since we can only fit that into the
|
||||
* allocation.
|
||||
*/
|
||||
tmp_alpha = clutter_actor_get_paint_opacity (self)
|
||||
* priv->border_color.alpha
|
||||
/ 255;
|
||||
|
||||
cogl_set_source_color4ub (priv->border_color.red,
|
||||
priv->border_color.green,
|
||||
priv->border_color.blue,
|
||||
tmp_alpha);
|
||||
|
||||
cogl_rectangle (0, 0, geom.width, geom.height);
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
border_pipeline,
|
||||
0, 0, geom.width, geom.height);
|
||||
}
|
||||
|
||||
cogl_object_unref (border_pipeline);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* compute the composited opacity of the actor taking into
|
||||
* account the opacity of the color set by the user
|
||||
*/
|
||||
tmp_alpha = clutter_actor_get_paint_opacity (self)
|
||||
* priv->color.alpha
|
||||
/ 255;
|
||||
|
||||
cogl_set_source_color4ub (priv->color.red,
|
||||
priv->color.green,
|
||||
priv->color.blue,
|
||||
tmp_alpha);
|
||||
|
||||
cogl_rectangle (0, 0, geom.width, geom.height);
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
content_pipeline,
|
||||
0, 0, geom.width, geom.height);
|
||||
}
|
||||
|
||||
cogl_object_unref (content_pipeline);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@@ -561,7 +561,9 @@ update_fbo (ClutterActor *self)
|
||||
}
|
||||
|
||||
static void
|
||||
gen_texcoords_and_draw_cogl_rectangle (ClutterActor *self)
|
||||
gen_texcoords_and_draw_cogl_rectangle (ClutterActor *self,
|
||||
CoglPipeline *pipeline,
|
||||
CoglFramebuffer *framebuffer)
|
||||
{
|
||||
ClutterTexture *texture = CLUTTER_TEXTURE (self);
|
||||
ClutterTexturePrivate *priv = texture->priv;
|
||||
@@ -580,10 +582,12 @@ gen_texcoords_and_draw_cogl_rectangle (ClutterActor *self)
|
||||
else
|
||||
t_h = 1.0;
|
||||
|
||||
cogl_rectangle_with_texture_coords (0, 0,
|
||||
box.x2 - box.x1,
|
||||
box.y2 - box.y1,
|
||||
0, 0, t_w, t_h);
|
||||
cogl_framebuffer_draw_textured_rectangle (framebuffer,
|
||||
pipeline,
|
||||
0, 0,
|
||||
box.x2 - box.x1,
|
||||
box.y2 - box.y1,
|
||||
0, 0, t_w, t_h);
|
||||
}
|
||||
|
||||
static CoglPipeline *
|
||||
@@ -625,6 +629,7 @@ clutter_texture_pick (ClutterActor *self,
|
||||
{
|
||||
ClutterTexture *texture = CLUTTER_TEXTURE (self);
|
||||
ClutterTexturePrivate *priv = texture->priv;
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
|
||||
if (!clutter_actor_should_pick_paint (self))
|
||||
return;
|
||||
@@ -656,8 +661,7 @@ clutter_texture_pick (ClutterActor *self,
|
||||
0, &pick_color);
|
||||
cogl_pipeline_set_layer_texture (priv->pick_pipeline, 0,
|
||||
clutter_texture_get_cogl_texture (texture));
|
||||
cogl_set_source (priv->pick_pipeline);
|
||||
gen_texcoords_and_draw_cogl_rectangle (self);
|
||||
gen_texcoords_and_draw_cogl_rectangle (self, priv->pick_pipeline, framebuffer);
|
||||
}
|
||||
else
|
||||
CLUTTER_ACTOR_CLASS (clutter_texture_parent_class)->pick (self, color);
|
||||
@@ -669,6 +673,7 @@ clutter_texture_paint (ClutterActor *self)
|
||||
ClutterTexture *texture = CLUTTER_TEXTURE (self);
|
||||
ClutterTexturePrivate *priv = texture->priv;
|
||||
guint8 paint_opacity = clutter_actor_get_paint_opacity (self);
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
|
||||
CLUTTER_NOTE (PAINT,
|
||||
"painting texture '%s'",
|
||||
@@ -683,9 +688,8 @@ clutter_texture_paint (ClutterActor *self)
|
||||
paint_opacity,
|
||||
paint_opacity,
|
||||
paint_opacity);
|
||||
cogl_set_source (priv->pipeline);
|
||||
|
||||
gen_texcoords_and_draw_cogl_rectangle (self);
|
||||
gen_texcoords_and_draw_cogl_rectangle (self, priv->pipeline, framebuffer);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@@ -44,6 +44,7 @@
|
||||
#include "clutter-device-manager-private.h"
|
||||
#include "clutter-event-private.h"
|
||||
#include "clutter-input-device-evdev.h"
|
||||
#include "clutter-keymap-evdev.h"
|
||||
#include "clutter-seat-evdev.h"
|
||||
#include "clutter-virtual-input-device-evdev.h"
|
||||
#include "clutter-main.h"
|
||||
@@ -91,7 +92,6 @@ struct _ClutterDeviceManagerEvdevPrivate
|
||||
GSList *seats;
|
||||
|
||||
ClutterSeatEvdev *main_seat;
|
||||
struct xkb_keymap *keymap;
|
||||
|
||||
ClutterPointerConstrainCallback constrain_callback;
|
||||
gpointer constrain_data;
|
||||
@@ -147,10 +147,6 @@ static const char *device_type_str[] = {
|
||||
* 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
|
||||
clutter_device_manager_evdev_copy_event_data (ClutterEventExtender *event_extender,
|
||||
const ClutterEvent *src,
|
||||
@@ -322,7 +318,6 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
|
||||
_clutter_evdev_event_set_time_usec (event, time_us);
|
||||
event->motion.time = us2ms (time_us);
|
||||
event->motion.stage = stage;
|
||||
event->motion.device = seat->core_pointer;
|
||||
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
|
||||
event->motion.x = x;
|
||||
event->motion.y = y;
|
||||
@@ -330,6 +325,7 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
|
||||
&event->motion.x,
|
||||
&event->motion.y);
|
||||
event->motion.axes = axes;
|
||||
clutter_event_set_device (event, seat->core_pointer);
|
||||
clutter_event_set_source_device (event, input_device);
|
||||
|
||||
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
|
||||
@@ -517,7 +513,6 @@ notify_proximity (ClutterInputDevice *input_device,
|
||||
|
||||
event->proximity.time = us2ms (time_us);
|
||||
event->proximity.stage = CLUTTER_STAGE (stage);
|
||||
event->proximity.device = seat->core_pointer;
|
||||
clutter_event_set_device_tool (event, device_evdev->last_tool);
|
||||
clutter_event_set_device (event, seat->core_pointer);
|
||||
clutter_event_set_source_device (event, input_device);
|
||||
@@ -1934,8 +1929,6 @@ clutter_device_manager_evdev_constructed (GObject *gobject)
|
||||
ClutterDeviceManagerEvdevPrivate *priv;
|
||||
ClutterEventSource *source;
|
||||
struct udev *udev;
|
||||
struct xkb_context *ctx;
|
||||
struct xkb_rule_names names;
|
||||
|
||||
udev = udev_new ();
|
||||
if (G_UNLIKELY (udev == NULL))
|
||||
@@ -1967,17 +1960,6 @@ clutter_device_manager_evdev_constructed (GObject *gobject)
|
||||
|
||||
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->seats = g_slist_append (priv->seats, priv->main_seat);
|
||||
|
||||
@@ -2031,9 +2013,6 @@ clutter_device_manager_evdev_finalize (GObject *object)
|
||||
g_slist_free_full (priv->seats, (GDestroyNotify) clutter_seat_evdev_free);
|
||||
g_slist_free (priv->devices);
|
||||
|
||||
if (priv->keymap)
|
||||
xkb_keymap_unref (priv->keymap);
|
||||
|
||||
if (priv->event_source != NULL)
|
||||
clutter_event_source_free (priv->event_source);
|
||||
|
||||
@@ -2157,6 +2136,7 @@ _clutter_events_evdev_init (ClutterBackend *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", backend,
|
||||
NULL);
|
||||
@@ -2219,14 +2199,6 @@ _clutter_device_manager_evdev_release_device_id (ClutterDeviceManagerEvdev *mana
|
||||
compare_ids);
|
||||
}
|
||||
|
||||
struct xkb_keymap *
|
||||
_clutter_device_manager_evdev_get_keymap (ClutterDeviceManagerEvdev *manager_evdev)
|
||||
{
|
||||
ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
|
||||
|
||||
return priv->keymap;
|
||||
}
|
||||
|
||||
ClutterStage *
|
||||
_clutter_device_manager_evdev_get_stage (ClutterDeviceManagerEvdev *manager_evdev)
|
||||
{
|
||||
@@ -2289,6 +2261,11 @@ clutter_evdev_update_xkb_state (ClutterDeviceManagerEvdev *manager_evdev)
|
||||
ClutterSeatEvdev *seat;
|
||||
xkb_mod_mask_t latched_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;
|
||||
|
||||
@@ -2301,7 +2278,7 @@ clutter_evdev_update_xkb_state (ClutterDeviceManagerEvdev *manager_evdev)
|
||||
locked_mods = xkb_state_serialize_mods (seat->xkb,
|
||||
XKB_STATE_MODS_LOCKED);
|
||||
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,
|
||||
0, /* depressed */
|
||||
@@ -2309,9 +2286,9 @@ clutter_evdev_update_xkb_state (ClutterDeviceManagerEvdev *manager_evdev)
|
||||
locked_mods,
|
||||
0, 0, seat->layout_idx);
|
||||
|
||||
seat->caps_lock_led = xkb_keymap_led_get_index (priv->keymap, XKB_LED_NAME_CAPS);
|
||||
seat->num_lock_led = xkb_keymap_led_get_index (priv->keymap, XKB_LED_NAME_NUM);
|
||||
seat->scroll_lock_led = xkb_keymap_led_get_index (priv->keymap, XKB_LED_NAME_SCROLL);
|
||||
seat->caps_lock_led = xkb_keymap_led_get_index (xkb_keymap, XKB_LED_NAME_CAPS);
|
||||
seat->num_lock_led = xkb_keymap_led_get_index (xkb_keymap, XKB_LED_NAME_NUM);
|
||||
seat->scroll_lock_led = xkb_keymap_led_get_index (xkb_keymap, XKB_LED_NAME_SCROLL);
|
||||
|
||||
clutter_seat_evdev_sync_leds (seat);
|
||||
}
|
||||
@@ -2396,20 +2373,18 @@ clutter_evdev_set_device_callbacks (ClutterOpenDeviceCallback open_callback,
|
||||
*/
|
||||
void
|
||||
clutter_evdev_set_keyboard_map (ClutterDeviceManager *evdev,
|
||||
struct xkb_keymap *keymap)
|
||||
struct xkb_keymap *xkb_keymap)
|
||||
{
|
||||
ClutterDeviceManagerEvdev *manager_evdev;
|
||||
ClutterDeviceManagerEvdevPrivate *priv;
|
||||
ClutterKeymap *keymap;
|
||||
|
||||
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);
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -2504,12 +2479,18 @@ clutter_evdev_set_keyboard_numlock (ClutterDeviceManager *evdev,
|
||||
ClutterDeviceManagerEvdevPrivate *priv;
|
||||
GSList *iter;
|
||||
xkb_mod_mask_t numlock;
|
||||
struct xkb_keymap *xkb_keymap;
|
||||
ClutterKeymap *keymap;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev));
|
||||
|
||||
manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
|
||||
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)
|
||||
{
|
||||
@@ -2760,3 +2741,9 @@ clutter_evdev_set_seat_id (const gchar *seat_id)
|
||||
g_free (evdev_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,
|
||||
ClutterInputDevice *device);
|
||||
|
||||
struct xkb_keymap * _clutter_device_manager_evdev_get_keymap (ClutterDeviceManagerEvdev *manager_evdev);
|
||||
|
||||
ClutterStage * _clutter_device_manager_evdev_get_stage (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);
|
||||
|
||||
struct xkb_state * _clutter_device_manager_evdev_get_xkb_state (ClutterDeviceManagerEvdev *manager_evdev);
|
||||
|
||||
static inline guint64
|
||||
us (guint64 us)
|
||||
{
|
||||
|
@@ -1265,6 +1265,18 @@ clutter_input_device_evdev_release_touch_state (ClutterInputDeviceEvdev *device,
|
||||
GINT_TO_POINTER (touch_state->device_slot));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_input_device_evdev_get_physical_size (ClutterInputDevice *device,
|
||||
gdouble *width,
|
||||
gdouble *height)
|
||||
{
|
||||
struct libinput_device *libinput_device;
|
||||
|
||||
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
|
||||
|
||||
return libinput_device_get_size (libinput_device, width, height) == 0;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_input_device_evdev_class_init (ClutterInputDeviceEvdevClass *klass)
|
||||
{
|
||||
@@ -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->is_grouped = clutter_input_device_evdev_is_grouped;
|
||||
klass->process_kbd_a11y_event = clutter_input_device_evdev_process_kbd_a11y_event;
|
||||
klass->get_physical_size = clutter_input_device_evdev_get_physical_size;
|
||||
|
||||
obj_props[PROP_DEVICE_MATRIX] =
|
||||
g_param_spec_boxed ("device-matrix",
|
||||
|
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);
|
@@ -34,6 +34,7 @@
|
||||
#include "clutter-event-private.h"
|
||||
#include "clutter-input-device-evdev.h"
|
||||
#include "clutter-input-device-tool-evdev.h"
|
||||
#include "clutter-keymap-evdev.h"
|
||||
#include "clutter-main.h"
|
||||
|
||||
/* Try to keep the pointer inside the stage. Hopefully no one is using
|
||||
@@ -152,7 +153,8 @@ clutter_seat_evdev_new (ClutterDeviceManagerEvdev *manager_evdev)
|
||||
ClutterSeatEvdev *seat;
|
||||
ClutterInputDevice *device;
|
||||
ClutterStage *stage;
|
||||
struct xkb_keymap *keymap;
|
||||
ClutterKeymap *keymap;
|
||||
struct xkb_keymap *xkb_keymap;
|
||||
|
||||
seat = g_new0 (ClutterSeatEvdev, 1);
|
||||
if (!seat)
|
||||
@@ -183,17 +185,19 @@ clutter_seat_evdev_new (ClutterDeviceManagerEvdev *manager_evdev)
|
||||
seat->repeat_delay = 250; /* ms */
|
||||
seat->repeat_interval = 33; /* ms */
|
||||
|
||||
keymap = _clutter_device_manager_evdev_get_keymap (manager_evdev);
|
||||
if (keymap)
|
||||
keymap = clutter_backend_get_keymap (clutter_get_default_backend ());
|
||||
xkb_keymap = clutter_keymap_evdev_get_keyboard_map (CLUTTER_KEYMAP_EVDEV (keymap));
|
||||
|
||||
if (xkb_keymap)
|
||||
{
|
||||
seat->xkb = xkb_state_new (keymap);
|
||||
seat->xkb = xkb_state_new (xkb_keymap);
|
||||
|
||||
seat->caps_lock_led =
|
||||
xkb_keymap_led_get_index (keymap, XKB_LED_NAME_CAPS);
|
||||
xkb_keymap_led_get_index (xkb_keymap, XKB_LED_NAME_CAPS);
|
||||
seat->num_lock_led =
|
||||
xkb_keymap_led_get_index (keymap, XKB_LED_NAME_NUM);
|
||||
xkb_keymap_led_get_index (xkb_keymap, XKB_LED_NAME_NUM);
|
||||
seat->scroll_lock_led =
|
||||
xkb_keymap_led_get_index (keymap, XKB_LED_NAME_SCROLL);
|
||||
xkb_keymap_led_get_index (xkb_keymap, XKB_LED_NAME_SCROLL);
|
||||
}
|
||||
|
||||
return seat;
|
||||
@@ -316,7 +320,13 @@ clutter_seat_evdev_notify_key (ClutterSeatEvdev *seat,
|
||||
queue_event (event);
|
||||
|
||||
if (update_keys && (changed_state & XKB_STATE_LEDS))
|
||||
clutter_seat_evdev_sync_leds (seat);
|
||||
{
|
||||
ClutterBackend *backend;
|
||||
|
||||
backend = clutter_get_default_backend ();
|
||||
g_signal_emit_by_name (clutter_backend_get_keymap (backend), "state-changed");
|
||||
clutter_seat_evdev_sync_leds (seat);
|
||||
}
|
||||
|
||||
if (state == 0 || /* key release */
|
||||
!seat->repeat ||
|
||||
@@ -385,7 +395,6 @@ new_absolute_motion_event (ClutterSeatEvdev *seat,
|
||||
_clutter_evdev_event_set_time_usec (event, time_us);
|
||||
event->motion.time = us2ms (time_us);
|
||||
event->motion.stage = stage;
|
||||
event->motion.device = seat->core_pointer;
|
||||
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
|
||||
event->motion.x = x;
|
||||
event->motion.y = y;
|
||||
@@ -631,7 +640,6 @@ notify_scroll (ClutterInputDevice *input_device,
|
||||
_clutter_evdev_event_set_time_usec (event, time_us);
|
||||
event->scroll.time = us2ms (time_us);
|
||||
event->scroll.stage = CLUTTER_STAGE (stage);
|
||||
event->scroll.device = seat->core_pointer;
|
||||
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
|
||||
|
||||
/* libinput pointer axis events are in pointer motion coordinate space.
|
||||
@@ -684,7 +692,6 @@ notify_discrete_scroll (ClutterInputDevice *input_device,
|
||||
_clutter_evdev_event_set_time_usec (event, time_us);
|
||||
event->scroll.time = us2ms (time_us);
|
||||
event->scroll.stage = CLUTTER_STAGE (stage);
|
||||
event->scroll.device = seat->core_pointer;
|
||||
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
|
||||
|
||||
event->scroll.direction = direction;
|
||||
@@ -769,6 +776,7 @@ discrete_to_direction (double discrete_dx,
|
||||
return CLUTTER_SCROLL_UP;
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -813,7 +821,6 @@ clutter_seat_evdev_notify_touch_event (ClutterSeatEvdev *seat,
|
||||
_clutter_evdev_event_set_time_usec (event, time_us);
|
||||
event->touch.time = us2ms (time_us);
|
||||
event->touch.stage = CLUTTER_STAGE (stage);
|
||||
event->touch.device = seat->core_pointer;
|
||||
event->touch.x = x;
|
||||
event->touch.y = y;
|
||||
clutter_input_device_evdev_translate_coordinates (input_device, stage,
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-virtual-input-device.h"
|
||||
#include "evdev/clutter-input-device-evdev.h"
|
||||
#include "evdev/clutter-keymap-evdev.h"
|
||||
#include "evdev/clutter-seat-evdev.h"
|
||||
#include "evdev/clutter-virtual-input-device-evdev.h"
|
||||
|
||||
@@ -286,14 +287,14 @@ pick_keycode_for_keyval_in_current_group (ClutterVirtualInputDevice *virtual_dev
|
||||
{
|
||||
ClutterVirtualInputDeviceEvdev *virtual_evdev =
|
||||
CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
|
||||
ClutterDeviceManager *manager;
|
||||
ClutterKeymap *keymap;
|
||||
struct xkb_keymap *xkb_keymap;
|
||||
struct xkb_state *state;
|
||||
guint keycode, layout;
|
||||
xkb_keycode_t min_keycode, max_keycode;
|
||||
|
||||
manager = clutter_virtual_input_device_get_manager (virtual_device);
|
||||
xkb_keymap = _clutter_device_manager_evdev_get_keymap (CLUTTER_DEVICE_MANAGER_EVDEV (manager));
|
||||
keymap = clutter_backend_get_keymap (clutter_get_default_backend ());
|
||||
xkb_keymap = clutter_keymap_evdev_get_keyboard_map (CLUTTER_KEYMAP_EVDEV (keymap));
|
||||
state = virtual_evdev->seat->xkb;
|
||||
|
||||
layout = xkb_state_serialize_layout (state, XKB_STATE_LAYOUT_EFFECTIVE);
|
||||
|
@@ -76,12 +76,12 @@ _clutter_key_event_new_from_evdev (ClutterInputDevice *device,
|
||||
else
|
||||
sym = XKB_KEY_NoSymbol;
|
||||
|
||||
event->key.device = core_device;
|
||||
event->key.stage = stage;
|
||||
event->key.time = _time;
|
||||
_clutter_xkb_translate_state (event, xkb_state, button_state);
|
||||
event->key.hardware_keycode = key;
|
||||
event->key.keyval = sym;
|
||||
clutter_event_set_device (event, core_device);
|
||||
clutter_event_set_source_device (event, device);
|
||||
|
||||
n = xkb_keysym_to_utf8 (sym, buffer, sizeof (buffer));
|
||||
|
@@ -48,6 +48,7 @@ clutter_headers = [
|
||||
'clutter-input-method.h',
|
||||
'clutter-interval.h',
|
||||
'clutter-keyframe-transition.h',
|
||||
'clutter-keymap.h',
|
||||
'clutter-keysyms.h',
|
||||
'clutter-layout-manager.h',
|
||||
'clutter-layout-meta.h',
|
||||
@@ -134,6 +135,7 @@ clutter_sources = [
|
||||
'clutter-virtual-input-device.c',
|
||||
'clutter-interval.c',
|
||||
'clutter-keyframe-transition.c',
|
||||
'clutter-keymap.c',
|
||||
'clutter-keysyms-table.c',
|
||||
'clutter-layout-manager.c',
|
||||
'clutter-layout-meta.c',
|
||||
@@ -237,7 +239,6 @@ clutter_deprecated_headers = [
|
||||
'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',
|
||||
@@ -271,7 +272,6 @@ clutter_deprecated_sources = [
|
||||
'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',
|
||||
@@ -358,6 +358,7 @@ if have_native_backend
|
||||
'evdev/clutter-event-evdev.c',
|
||||
'evdev/clutter-input-device-evdev.c',
|
||||
'evdev/clutter-input-device-tool-evdev.c',
|
||||
'evdev/clutter-keymap-evdev.c',
|
||||
'evdev/clutter-seat-evdev.c',
|
||||
'evdev/clutter-virtual-input-device-evdev.c',
|
||||
'evdev/clutter-xkb-utils.c',
|
||||
@@ -369,6 +370,7 @@ if have_native_backend
|
||||
'evdev/clutter-device-manager-evdev.h',
|
||||
'evdev/clutter-input-device-evdev.h',
|
||||
'evdev/clutter-input-device-tool-evdev.h',
|
||||
'evdev/clutter-keymap-evdev.h',
|
||||
'evdev/clutter-seat-evdev.h',
|
||||
'evdev/clutter-virtual-input-device-evdev.h',
|
||||
'evdev/clutter-xkb-utils.h',
|
||||
@@ -493,7 +495,7 @@ clutter_marshal = gnome.genmarshal('clutter-marshal',
|
||||
prefix: '_clutter_marshal',
|
||||
sources: 'clutter-marshal.list',
|
||||
valist_marshallers: true,
|
||||
extra_args: ['--prototypes'],
|
||||
extra_args: ['--quiet'],
|
||||
install_dir: clutter_clutter_includedir,
|
||||
install_header: true,
|
||||
)
|
||||
@@ -521,10 +523,12 @@ libmutter_clutter = shared_library(libmutter_clutter_name,
|
||||
cally_headers,
|
||||
cally_private_headers,
|
||||
],
|
||||
soversion: '0.0.0',
|
||||
version: '0.0.0',
|
||||
soversion: 0,
|
||||
c_args: clutter_c_args,
|
||||
include_directories: clutter_includes,
|
||||
dependencies: [clutter_deps],
|
||||
gnu_symbol_visibility: 'hidden',
|
||||
link_with: [
|
||||
libmutter_cogl,
|
||||
libmutter_cogl_pango,
|
||||
@@ -540,10 +544,7 @@ libmutter_clutter_dep = declare_dependency(
|
||||
)
|
||||
|
||||
if have_introspection
|
||||
clutter_introspection_args = clutter_c_args + [
|
||||
'-U_GNU_SOURCE', # _GNU_SOURCE triggers warnings in g-ir-scanner
|
||||
'--quiet',
|
||||
]
|
||||
clutter_introspection_args = introspection_args + clutter_c_args
|
||||
|
||||
libmutter_clutter_gir = gnome.generate_gir(libmutter_clutter,
|
||||
sources: [
|
||||
@@ -628,28 +629,30 @@ install_headers(clutter_deprecated_headers,
|
||||
install_headers(clutter_x11_headers,
|
||||
subdir: join_paths(clutter_clutter_includedir, 'x11'))
|
||||
|
||||
pkg.generate(
|
||||
pkg.generate(libmutter_clutter,
|
||||
name: 'Mutters Clutter',
|
||||
filebase: libmutter_clutter_name,
|
||||
description: 'Mutters Clutter Private Library',
|
||||
libraries: [libmutter_clutter, m_dep],
|
||||
libraries: [m_dep],
|
||||
subdirs: join_paths(pkgname, 'clutter'),
|
||||
requires: [clutter_pkg_deps, libmutter_cogl_name],
|
||||
version: meson.project_version(),
|
||||
variables: [
|
||||
'apiversion=' + libmutter_api_version,
|
||||
],
|
||||
install_dir: pcdir,
|
||||
)
|
||||
|
||||
pkg.generate(
|
||||
pkg.generate(libmutter_clutter,
|
||||
name: 'Mutters ClutterX11',
|
||||
filebase: 'mutter-clutter-x11-' + libmutter_api_version,
|
||||
description: 'Mutters ClutterX11 Private Library',
|
||||
libraries: [libmutter_clutter, m_dep],
|
||||
libraries: [m_dep],
|
||||
subdirs: join_paths(pkgname, 'clutter'),
|
||||
requires: [clutter_pkg_deps, libmutter_cogl_name],
|
||||
version: meson.project_version(),
|
||||
variables: [
|
||||
'apiversion=' + libmutter_api_version,
|
||||
],
|
||||
install_dir: pcdir,
|
||||
)
|
||||
|
@@ -321,11 +321,13 @@ static void
|
||||
clutter_wayland_surface_paint (ClutterActor *self)
|
||||
{
|
||||
ClutterWaylandSurfacePrivate *priv;
|
||||
CoglFramebuffer *framebuffer;
|
||||
ClutterActorBox box;
|
||||
|
||||
g_return_if_fail (CLUTTER_WAYLAND_IS_SURFACE (self));
|
||||
|
||||
priv = CLUTTER_WAYLAND_SURFACE (self)->priv;
|
||||
framebuffer = cogl_get_draw_framebuffer ();
|
||||
|
||||
if (G_UNLIKELY (priv->pipeline == NULL))
|
||||
{
|
||||
@@ -343,9 +345,11 @@ clutter_wayland_surface_paint (ClutterActor *self)
|
||||
COGL_TEXTURE (priv->buffer));
|
||||
}
|
||||
|
||||
cogl_set_source (priv->pipeline);
|
||||
clutter_actor_get_allocation_box (self, &box);
|
||||
cogl_rectangle (0, 0, box.x2 - box.x1, box.y2 - box.y1);
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
priv->pipeline,
|
||||
0, 0,
|
||||
box.x2 - box.x1, box.y2 - box.y1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -807,6 +807,14 @@ clutter_backend_x11_get_keymap_direction (ClutterBackend *backend)
|
||||
return _clutter_keymap_x11_get_direction (backend_x11->keymap);
|
||||
}
|
||||
|
||||
static ClutterKeymap *
|
||||
clutter_backend_x11_get_keymap (ClutterBackend *backend)
|
||||
{
|
||||
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend);
|
||||
|
||||
return CLUTTER_KEYMAP (backend_x11->keymap);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_backend_x11_class_init (ClutterBackendX11Class *klass)
|
||||
{
|
||||
@@ -829,6 +837,7 @@ clutter_backend_x11_class_init (ClutterBackendX11Class *klass)
|
||||
backend_class->get_display = clutter_backend_x11_get_display;
|
||||
|
||||
backend_class->get_keymap_direction = clutter_backend_x11_get_keymap_direction;
|
||||
backend_class->get_keymap = clutter_backend_x11_get_keymap;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -97,9 +97,9 @@ translate_key_event (ClutterBackendX11 *backend_x11,
|
||||
_clutter_keymap_x11_get_is_modifier (backend_x11->keymap,
|
||||
event->key.hardware_keycode);
|
||||
event_x11->num_lock_set =
|
||||
_clutter_keymap_x11_get_num_lock_state (backend_x11->keymap);
|
||||
clutter_keymap_get_num_lock_state (CLUTTER_KEYMAP (backend_x11->keymap));
|
||||
event_x11->caps_lock_set =
|
||||
_clutter_keymap_x11_get_caps_lock_state (backend_x11->keymap);
|
||||
clutter_keymap_get_caps_lock_state (CLUTTER_KEYMAP (backend_x11->keymap));
|
||||
|
||||
/* unicode_value is the printable representation */
|
||||
n = XLookupString (&xevent->xkey, buffer, sizeof (buffer) - 1, NULL, NULL);
|
||||
|
@@ -67,6 +67,23 @@ static const char *clutter_input_axis_atom_names[] = {
|
||||
|
||||
#define N_AXIS_ATOMS G_N_ELEMENTS (clutter_input_axis_atom_names)
|
||||
|
||||
static const char *wacom_type_atoms[] = {
|
||||
"STYLUS",
|
||||
"CURSOR",
|
||||
"ERASER",
|
||||
"PAD",
|
||||
"TOUCH"
|
||||
};
|
||||
#define N_WACOM_TYPE_ATOMS G_N_ELEMENTS (wacom_type_atoms)
|
||||
|
||||
enum {
|
||||
WACOM_TYPE_STYLUS,
|
||||
WACOM_TYPE_CURSOR,
|
||||
WACOM_TYPE_ERASER,
|
||||
WACOM_TYPE_PAD,
|
||||
WACOM_TYPE_TOUCH,
|
||||
};
|
||||
|
||||
enum {
|
||||
PAD_AXIS_FIRST = 3, /* First axes are always x/y/pressure, ignored in pads */
|
||||
PAD_AXIS_STRIP1 = PAD_AXIS_FIRST,
|
||||
@@ -394,6 +411,86 @@ get_pad_features (XIDeviceInfo *info,
|
||||
*n_strips = strips;
|
||||
}
|
||||
|
||||
/* The Wacom driver exports the tool type as property. Use that over
|
||||
guessing based on the device name */
|
||||
static gboolean
|
||||
guess_source_from_wacom_type (ClutterBackendX11 *backend_x11,
|
||||
XIDeviceInfo *info,
|
||||
ClutterInputDeviceType *source_out)
|
||||
{
|
||||
gulong nitems, bytes_after;
|
||||
guint32 *data = NULL;
|
||||
int rc, format;
|
||||
Atom type;
|
||||
Atom prop;
|
||||
Atom device_type;
|
||||
Atom types[N_WACOM_TYPE_ATOMS];
|
||||
|
||||
prop = XInternAtom (backend_x11->xdpy, "Wacom Tool Type", True);
|
||||
if (prop == None)
|
||||
return FALSE;
|
||||
|
||||
clutter_x11_trap_x_errors ();
|
||||
rc = XIGetProperty (backend_x11->xdpy,
|
||||
info->deviceid,
|
||||
prop,
|
||||
0, 1, False, XA_ATOM, &type, &format, &nitems, &bytes_after,
|
||||
(guchar **) &data);
|
||||
clutter_x11_untrap_x_errors ();
|
||||
|
||||
|
||||
if (rc != Success || type != XA_ATOM || format != 32 || nitems != 1)
|
||||
{
|
||||
XFree (data);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
device_type = *data;
|
||||
XFree (data);
|
||||
|
||||
if (device_type == 0)
|
||||
return FALSE;
|
||||
|
||||
rc = XInternAtoms (backend_x11->xdpy,
|
||||
(char **)wacom_type_atoms,
|
||||
N_WACOM_TYPE_ATOMS,
|
||||
False,
|
||||
types);
|
||||
if (rc == 0)
|
||||
return FALSE;
|
||||
|
||||
if (device_type == types[WACOM_TYPE_STYLUS])
|
||||
{
|
||||
*source_out = CLUTTER_PEN_DEVICE;
|
||||
}
|
||||
else if (device_type == types[WACOM_TYPE_CURSOR])
|
||||
{
|
||||
*source_out = CLUTTER_CURSOR_DEVICE;
|
||||
}
|
||||
else if (device_type == types[WACOM_TYPE_ERASER])
|
||||
{
|
||||
*source_out = CLUTTER_ERASER_DEVICE;
|
||||
}
|
||||
else if (device_type == types[WACOM_TYPE_PAD])
|
||||
{
|
||||
*source_out = CLUTTER_PAD_DEVICE;
|
||||
}
|
||||
else if (device_type == types[WACOM_TYPE_TOUCH])
|
||||
{
|
||||
guint num_touches = 0;
|
||||
|
||||
if (!is_touch_device (info->classes, info->num_classes,
|
||||
source_out, &num_touches))
|
||||
*source_out = CLUTTER_TOUCHSCREEN_DEVICE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static ClutterInputDevice *
|
||||
create_device (ClutterDeviceManagerXI2 *manager_xi2,
|
||||
ClutterBackendX11 *backend_x11,
|
||||
@@ -421,7 +518,7 @@ create_device (ClutterDeviceManagerXI2 *manager_xi2,
|
||||
{
|
||||
source = touch_source;
|
||||
}
|
||||
else
|
||||
else if (!guess_source_from_wacom_type (backend_x11, info, &source))
|
||||
{
|
||||
gchar *name;
|
||||
|
||||
@@ -1289,9 +1386,9 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
|
||||
_clutter_keymap_x11_get_is_modifier (backend_x11->keymap,
|
||||
event->key.hardware_keycode);
|
||||
event_x11->num_lock_set =
|
||||
_clutter_keymap_x11_get_num_lock_state (backend_x11->keymap);
|
||||
clutter_keymap_get_num_lock_state (CLUTTER_KEYMAP (backend_x11->keymap));
|
||||
event_x11->caps_lock_set =
|
||||
_clutter_keymap_x11_get_caps_lock_state (backend_x11->keymap);
|
||||
clutter_keymap_get_caps_lock_state (CLUTTER_KEYMAP (backend_x11->keymap));
|
||||
|
||||
source_device = g_hash_table_lookup (manager_xi2->devices_by_id,
|
||||
GINT_TO_POINTER (xev->sourceid));
|
||||
|
@@ -180,6 +180,56 @@ clutter_input_device_xi2_is_mode_switch_button (ClutterInputDevice *device,
|
||||
return button_group == (int) group;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_input_device_xi2_get_physical_size (ClutterInputDevice *device,
|
||||
gdouble *width,
|
||||
gdouble *height)
|
||||
{
|
||||
Display *xdisplay;
|
||||
XIDeviceInfo *dev_info;
|
||||
gdouble w = 0, h = 0;
|
||||
int i, n_info, device_id;
|
||||
|
||||
xdisplay = clutter_x11_get_default_display ();
|
||||
device_id = clutter_input_device_get_device_id (device);
|
||||
|
||||
clutter_x11_trap_x_errors ();
|
||||
dev_info = XIQueryDevice (xdisplay, device_id, &n_info);
|
||||
if (clutter_x11_untrap_x_errors ())
|
||||
return FALSE;
|
||||
|
||||
if (!dev_info)
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i < dev_info->num_classes; i++)
|
||||
{
|
||||
XIValuatorClassInfo *valuator;
|
||||
gdouble *value;
|
||||
|
||||
if (dev_info->classes[i]->type != XIValuatorClass)
|
||||
continue;
|
||||
|
||||
valuator = (XIValuatorClassInfo *) dev_info->classes[i];
|
||||
|
||||
if (valuator->label == XInternAtom (xdisplay, "Abs X", True) ||
|
||||
valuator->label == XInternAtom (xdisplay, "Abs MT Position X", True))
|
||||
value = &w;
|
||||
else if (valuator->label == XInternAtom (xdisplay, "Abs Y", True) ||
|
||||
valuator->label == XInternAtom (xdisplay, "Abs MT Position Y", True))
|
||||
value = &h;
|
||||
else
|
||||
continue;
|
||||
|
||||
*value = (valuator->max - valuator->min) * 1000 / valuator->resolution;
|
||||
}
|
||||
|
||||
XIFreeDeviceInfo (dev_info);
|
||||
*width = w;
|
||||
*height = h;
|
||||
|
||||
return (w > 0 && h > 0);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_input_device_xi2_class_init (ClutterInputDeviceXI2Class *klass)
|
||||
{
|
||||
@@ -193,6 +243,7 @@ clutter_input_device_xi2_class_init (ClutterInputDeviceXI2Class *klass)
|
||||
device_class->is_grouped = clutter_input_device_xi2_is_grouped;
|
||||
device_class->get_group_n_modes = clutter_input_device_xi2_get_group_n_modes;
|
||||
device_class->is_mode_switch_button = clutter_input_device_xi2_is_mode_switch_button;
|
||||
device_class->get_physical_size = clutter_input_device_xi2_get_physical_size;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -53,7 +53,7 @@ struct _DirectionCacheEntry
|
||||
|
||||
struct _ClutterKeymapX11
|
||||
{
|
||||
GObject parent_instance;
|
||||
ClutterKeymap parent_instance;
|
||||
|
||||
ClutterBackend *backend;
|
||||
|
||||
@@ -76,6 +76,9 @@ struct _ClutterKeymapX11
|
||||
DirectionCacheEntry group_direction_cache[4];
|
||||
int current_group;
|
||||
|
||||
GHashTable *reserved_keycodes;
|
||||
GQueue *available_keycodes;
|
||||
|
||||
guint caps_lock_state : 1;
|
||||
guint num_lock_state : 1;
|
||||
guint has_direction : 1;
|
||||
@@ -83,7 +86,7 @@ struct _ClutterKeymapX11
|
||||
|
||||
struct _ClutterKeymapX11Class
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
ClutterKeymapClass parent_class;
|
||||
};
|
||||
|
||||
enum
|
||||
@@ -101,7 +104,8 @@ static void clutter_event_translator_iface_init (ClutterEventTranslatorIface *if
|
||||
|
||||
#define clutter_keymap_x11_get_type _clutter_keymap_x11_get_type
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (ClutterKeymapX11, clutter_keymap_x11, G_TYPE_OBJECT,
|
||||
G_DEFINE_TYPE_WITH_CODE (ClutterKeymapX11, clutter_keymap_x11,
|
||||
CLUTTER_TYPE_KEYMAP,
|
||||
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_EVENT_TRANSLATOR,
|
||||
clutter_event_translator_iface_init));
|
||||
|
||||
@@ -212,12 +216,10 @@ static void
|
||||
update_locked_mods (ClutterKeymapX11 *keymap_x11,
|
||||
gint locked_mods)
|
||||
{
|
||||
#if 0
|
||||
gboolean old_caps_lock_state, old_num_lock_state;
|
||||
|
||||
old_caps_lock_state = keymap_x11->caps_lock_state;
|
||||
old_num_lock_state = keymap_x11->num_lock_state;
|
||||
#endif
|
||||
|
||||
keymap_x11->caps_lock_state = (locked_mods & CLUTTER_LOCK_MASK) != 0;
|
||||
keymap_x11->num_lock_state = (locked_mods & keymap_x11->num_lock_mask) != 0;
|
||||
@@ -226,12 +228,9 @@ update_locked_mods (ClutterKeymapX11 *keymap_x11,
|
||||
keymap_x11->num_lock_state ? "set" : "unset",
|
||||
keymap_x11->caps_lock_state ? "set" : "unset");
|
||||
|
||||
#if 0
|
||||
/* Add signal to ClutterBackend? */
|
||||
if ((keymap_x11->caps_lock_state != old_caps_lock_state) ||
|
||||
(keymap_x11->num_lock_state != old_num_lock_state))
|
||||
g_signal_emit_by_name (keymap_x11->backend, "key-lock-changed");
|
||||
#endif
|
||||
g_signal_emit_by_name (keymap_x11, "state-changed");
|
||||
}
|
||||
|
||||
/* the code to retrieve the keymap direction and cache it
|
||||
@@ -422,15 +421,97 @@ clutter_keymap_x11_set_property (GObject *gobject,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_keymap_x11_refresh_reserved_keycodes (ClutterKeymapX11 *keymap_x11)
|
||||
{
|
||||
Display *dpy = clutter_x11_get_default_display ();
|
||||
GHashTableIter iter;
|
||||
gpointer key, value;
|
||||
|
||||
g_hash_table_iter_init (&iter, keymap_x11->reserved_keycodes);
|
||||
while (g_hash_table_iter_next (&iter, &key, &value))
|
||||
{
|
||||
guint reserved_keycode = GPOINTER_TO_UINT (key);
|
||||
guint reserved_keysym = GPOINTER_TO_UINT (value);
|
||||
guint actual_keysym = XkbKeycodeToKeysym (dpy, reserved_keycode, 0, 0);
|
||||
|
||||
/* If an available keycode is no longer mapped to the stored keysym, then
|
||||
* the keycode should not be considered available anymore and should be
|
||||
* removed both from the list of available and reserved keycodes.
|
||||
*/
|
||||
if (reserved_keysym != actual_keysym)
|
||||
{
|
||||
g_hash_table_iter_remove (&iter);
|
||||
g_queue_remove (keymap_x11->available_keycodes, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_keymap_x11_replace_keycode (ClutterKeymapX11 *keymap_x11,
|
||||
KeyCode keycode,
|
||||
KeySym keysym)
|
||||
{
|
||||
if (CLUTTER_BACKEND_X11 (keymap_x11->backend)->use_xkb)
|
||||
{
|
||||
Display *dpy = clutter_x11_get_default_display ();
|
||||
XkbDescPtr xkb = get_xkb (keymap_x11);
|
||||
XkbMapChangesRec changes;
|
||||
|
||||
XFlush (dpy);
|
||||
|
||||
xkb->device_spec = XkbUseCoreKbd;
|
||||
memset (&changes, 0, sizeof(changes));
|
||||
|
||||
if (keysym != NoSymbol)
|
||||
{
|
||||
int types[XkbNumKbdGroups] = { XkbOneLevelIndex };
|
||||
XkbChangeTypesOfKey (xkb, keycode, 1, XkbGroup1Mask, types, &changes);
|
||||
XkbKeySymEntry (xkb, keycode, 0, 0) = keysym;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Reset to NoSymbol */
|
||||
XkbChangeTypesOfKey (xkb, keycode, 0, XkbGroup1Mask, NULL, &changes);
|
||||
}
|
||||
|
||||
changes.changed = XkbKeySymsMask | XkbKeyTypesMask;
|
||||
changes.first_key_sym = keycode;
|
||||
changes.num_key_syms = 1;
|
||||
changes.first_type = 0;
|
||||
changes.num_types = xkb->map->num_types;
|
||||
XkbChangeMap (dpy, xkb, &changes);
|
||||
|
||||
XFlush (dpy);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_keymap_x11_finalize (GObject *gobject)
|
||||
{
|
||||
ClutterKeymapX11 *keymap;
|
||||
ClutterEventTranslator *translator;
|
||||
GHashTableIter iter;
|
||||
gpointer key, value;
|
||||
|
||||
keymap = CLUTTER_KEYMAP_X11 (gobject);
|
||||
translator = CLUTTER_EVENT_TRANSLATOR (keymap);
|
||||
|
||||
clutter_keymap_x11_refresh_reserved_keycodes (keymap);
|
||||
g_hash_table_iter_init (&iter, keymap->reserved_keycodes);
|
||||
while (g_hash_table_iter_next (&iter, &key, &value))
|
||||
{
|
||||
guint keycode = GPOINTER_TO_UINT (key);
|
||||
clutter_keymap_x11_replace_keycode (keymap, keycode, NoSymbol);
|
||||
}
|
||||
|
||||
g_hash_table_destroy (keymap->reserved_keycodes);
|
||||
g_queue_free (keymap->available_keycodes);
|
||||
|
||||
_clutter_backend_remove_event_translator (keymap->backend, translator);
|
||||
|
||||
if (keymap->xkb_desc != NULL)
|
||||
@@ -439,10 +520,27 @@ clutter_keymap_x11_finalize (GObject *gobject)
|
||||
G_OBJECT_CLASS (clutter_keymap_x11_parent_class)->finalize (gobject);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_keymap_x11_get_num_lock_state (ClutterKeymap *keymap)
|
||||
{
|
||||
ClutterKeymapX11 *keymap_x11 = CLUTTER_KEYMAP_X11 (keymap);
|
||||
|
||||
return keymap_x11->num_lock_state;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_keymap_x11_get_caps_lock_state (ClutterKeymap *keymap)
|
||||
{
|
||||
ClutterKeymapX11 *keymap_x11 = CLUTTER_KEYMAP_X11 (keymap);
|
||||
|
||||
return keymap_x11->caps_lock_state;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_keymap_x11_class_init (ClutterKeymapX11Class *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
ClutterKeymapClass *keymap_class = CLUTTER_KEYMAP_CLASS (klass);
|
||||
|
||||
obj_props[PROP_BACKEND] =
|
||||
g_param_spec_object ("backend",
|
||||
@@ -454,6 +552,10 @@ clutter_keymap_x11_class_init (ClutterKeymapX11Class *klass)
|
||||
gobject_class->constructed = clutter_keymap_x11_constructed;
|
||||
gobject_class->set_property = clutter_keymap_x11_set_property;
|
||||
gobject_class->finalize = clutter_keymap_x11_finalize;
|
||||
|
||||
keymap_class->get_num_lock_state = clutter_keymap_x11_get_num_lock_state;
|
||||
keymap_class->get_caps_lock_state = clutter_keymap_x11_get_caps_lock_state;
|
||||
|
||||
g_object_class_install_properties (gobject_class, PROP_LAST, obj_props);
|
||||
}
|
||||
|
||||
@@ -462,6 +564,8 @@ clutter_keymap_x11_init (ClutterKeymapX11 *keymap)
|
||||
{
|
||||
keymap->current_direction = PANGO_DIRECTION_NEUTRAL;
|
||||
keymap->current_group = -1;
|
||||
keymap->reserved_keycodes = g_hash_table_new (NULL, NULL);
|
||||
keymap->available_keycodes = g_queue_new ();
|
||||
}
|
||||
|
||||
static ClutterTranslateReturn
|
||||
@@ -525,22 +629,6 @@ _clutter_keymap_x11_get_key_group (ClutterKeymapX11 *keymap,
|
||||
return XkbGroupForCoreState (state);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_keymap_x11_get_num_lock_state (ClutterKeymapX11 *keymap)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_KEYMAP_X11 (keymap), FALSE);
|
||||
|
||||
return keymap->num_lock_state;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_keymap_x11_get_caps_lock_state (ClutterKeymapX11 *keymap)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_KEYMAP_X11 (keymap), FALSE);
|
||||
|
||||
return keymap->caps_lock_state;
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
/* XXX - yes, I know that XKeycodeToKeysym() has been deprecated; hopefully,
|
||||
@@ -731,6 +819,72 @@ clutter_keymap_x11_get_entries_for_keyval (ClutterKeymapX11 *keymap_x11,
|
||||
}
|
||||
}
|
||||
|
||||
static guint
|
||||
clutter_keymap_x11_get_available_keycode (ClutterKeymapX11 *keymap_x11)
|
||||
{
|
||||
if (CLUTTER_BACKEND_X11 (keymap_x11->backend)->use_xkb)
|
||||
{
|
||||
clutter_keymap_x11_refresh_reserved_keycodes (keymap_x11);
|
||||
|
||||
if (g_hash_table_size (keymap_x11->reserved_keycodes) < 5)
|
||||
{
|
||||
Display *dpy = clutter_x11_get_default_display ();
|
||||
XkbDescPtr xkb = get_xkb (keymap_x11);
|
||||
guint i;
|
||||
|
||||
for (i = xkb->max_key_code; i >= xkb->min_key_code; --i)
|
||||
{
|
||||
if (XkbKeycodeToKeysym (dpy, i, 0, 0) == NoSymbol)
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return GPOINTER_TO_UINT (g_queue_pop_head (keymap_x11->available_keycodes));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
gboolean clutter_keymap_x11_reserve_keycode (ClutterKeymapX11 *keymap_x11,
|
||||
guint keyval,
|
||||
guint *keycode_out)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_KEYMAP_X11 (keymap_x11), FALSE);
|
||||
g_return_val_if_fail (keyval != 0, FALSE);
|
||||
g_return_val_if_fail (keycode_out != NULL, FALSE);
|
||||
|
||||
*keycode_out = clutter_keymap_x11_get_available_keycode (keymap_x11);
|
||||
|
||||
if (*keycode_out == NoSymbol)
|
||||
{
|
||||
g_warning ("Cannot reserve a keycode for keyval %d: no available keycode", keyval);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!clutter_keymap_x11_replace_keycode (keymap_x11, *keycode_out, keyval))
|
||||
{
|
||||
g_warning ("Failed to remap keycode %d to keyval %d", *keycode_out, keyval);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_hash_table_insert (keymap_x11->reserved_keycodes, GUINT_TO_POINTER (*keycode_out), GUINT_TO_POINTER (keyval));
|
||||
g_queue_remove (keymap_x11->available_keycodes, GUINT_TO_POINTER (*keycode_out));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void clutter_keymap_x11_release_keycode_if_needed (ClutterKeymapX11 *keymap_x11,
|
||||
guint keycode)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_KEYMAP_X11 (keymap_x11));
|
||||
|
||||
if (!g_hash_table_contains (keymap_x11->reserved_keycodes, GUINT_TO_POINTER (keycode)) ||
|
||||
g_queue_index (keymap_x11->available_keycodes, GUINT_TO_POINTER (keycode)) != -1)
|
||||
return;
|
||||
|
||||
g_queue_push_tail (keymap_x11->available_keycodes, GUINT_TO_POINTER (keycode));
|
||||
}
|
||||
|
||||
void
|
||||
clutter_keymap_x11_latch_modifiers (ClutterKeymapX11 *keymap_x11,
|
||||
uint32_t level,
|
||||
|
@@ -58,7 +58,11 @@ gboolean clutter_keymap_x11_keycode_for_keyval (ClutterKeymapX11 *keymap_x11,
|
||||
void clutter_keymap_x11_latch_modifiers (ClutterKeymapX11 *keymap_x11,
|
||||
uint32_t level,
|
||||
gboolean enable);
|
||||
|
||||
gboolean clutter_keymap_x11_reserve_keycode (ClutterKeymapX11 *keymap_x11,
|
||||
guint keyval,
|
||||
guint *keycode_out);
|
||||
void clutter_keymap_x11_release_keycode_if_needed (ClutterKeymapX11 *keymap_x11,
|
||||
guint keycode);
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_KEYMAP_X11_H__ */
|
||||
|
@@ -631,8 +631,6 @@ clutter_stage_x11_realize (ClutterStageWindow *stage_window)
|
||||
|
||||
stage_x11->onscreen = cogl_onscreen_new (backend->cogl_context, width, height);
|
||||
|
||||
cogl_onscreen_set_swap_throttled (stage_x11->onscreen,
|
||||
_clutter_get_sync_to_vblank ());
|
||||
stage_x11->frame_closure =
|
||||
cogl_onscreen_add_frame_callback (stage_x11->onscreen,
|
||||
frame_cb,
|
||||
|
@@ -141,8 +141,13 @@ clutter_virtual_input_device_x11_notify_keyval (ClutterVirtualInputDevice *virtu
|
||||
|
||||
if (!clutter_keymap_x11_keycode_for_keyval (keymap, keyval, &keycode, &level))
|
||||
{
|
||||
g_warning ("No keycode found for keyval %x in current group", keyval);
|
||||
return;
|
||||
level = 0;
|
||||
|
||||
if (!clutter_keymap_x11_reserve_keycode (keymap, keyval, &keycode))
|
||||
{
|
||||
g_warning ("No keycode found for keyval %x in current group", keyval);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!_clutter_keymap_x11_get_is_modifier (keymap, keycode) &&
|
||||
@@ -153,9 +158,13 @@ clutter_virtual_input_device_x11_notify_keyval (ClutterVirtualInputDevice *virtu
|
||||
(KeyCode) keycode,
|
||||
key_state == CLUTTER_KEY_STATE_PRESSED, 0);
|
||||
|
||||
if (!_clutter_keymap_x11_get_is_modifier (keymap, keycode) &&
|
||||
key_state == CLUTTER_KEY_STATE_RELEASED)
|
||||
clutter_keymap_x11_latch_modifiers (keymap, level, FALSE);
|
||||
|
||||
if (key_state == CLUTTER_KEY_STATE_RELEASED)
|
||||
{
|
||||
if (!_clutter_keymap_x11_get_is_modifier (keymap, keycode))
|
||||
clutter_keymap_x11_latch_modifiers (keymap, level, FALSE);
|
||||
clutter_keymap_x11_release_keycode_if_needed (keymap, keycode);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -480,7 +480,7 @@ xsettings_client_new_with_grab_funcs (Display *display,
|
||||
{
|
||||
XSettingsClient *client;
|
||||
char buffer[256];
|
||||
char *atom_names[3];
|
||||
const char *atom_names[3];
|
||||
Atom atoms[3];
|
||||
|
||||
client = malloc (sizeof *client);
|
||||
|
@@ -1,705 +0,0 @@
|
||||
AC_PREREQ([2.63])
|
||||
|
||||
AC_INIT([clutter],
|
||||
[0.1],
|
||||
[http://bugzilla.gnome.org/enter_bug.cgi?product=clutter],
|
||||
[clutter],
|
||||
[http://www.clutter-project.org])
|
||||
|
||||
AC_CONFIG_SRCDIR([clutter/clutter.h])
|
||||
AC_CONFIG_HEADERS([clutter/clutter-build-config.h])
|
||||
AC_CONFIG_AUX_DIR([build])
|
||||
AC_CONFIG_MACRO_DIR([build/autotools])
|
||||
|
||||
AM_INIT_AUTOMAKE([1.11 foreign -Wno-portability no-define no-dist-gzip dist-xz tar-ustar])
|
||||
AM_SILENT_RULES([yes])
|
||||
|
||||
dnl = Check that we are configured by mutter ==============================
|
||||
|
||||
AC_ARG_VAR([MUTTER_VERSION])
|
||||
AC_ARG_VAR([LIBMUTTER_API_VERSION])
|
||||
|
||||
AS_IF([test "x$MUTTER_VERSION" = "x"],
|
||||
[AC_MSG_ERROR([Clutter can only be configured by mutter])],)
|
||||
|
||||
AC_DEFINE_UNQUOTED(MUTTER_VERSION, "$MUTTER_VERSION", [Mutter version])
|
||||
|
||||
AC_PROG_SED
|
||||
|
||||
dnl = Preliminary platform checks =============================================
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
AC_CACHE_SAVE
|
||||
|
||||
dnl = Dependencies =========================================================
|
||||
|
||||
# Checks for programs.
|
||||
AM_PROG_CC_C_O
|
||||
|
||||
# require libtool >= 2.2
|
||||
LT_PREREQ([2.2.6])
|
||||
LT_INIT([disable-static])
|
||||
LT_LIB_M
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
||||
# required versions for dependencies
|
||||
m4_define([glib_req_version], [2.53.2])
|
||||
m4_define([cogl_req_version], [1.21.2])
|
||||
m4_define([json_glib_req_version], [0.12.0])
|
||||
m4_define([atk_req_version], [2.5.3])
|
||||
m4_define([cairo_req_version], [1.14.0])
|
||||
m4_define([pango_req_version], [1.30])
|
||||
m4_define([gi_req_version], [1.39.0])
|
||||
m4_define([xcomposite_req_version], [0.4])
|
||||
m4_define([libinput_req_version], [1.4.0])
|
||||
m4_define([libudev_req_version], [136])
|
||||
m4_define([libwacom_req_version], [0.13])
|
||||
|
||||
AC_SUBST([GLIB_REQ_VERSION], [glib_req_version])
|
||||
AC_SUBST([COGL_REQ_VERSION], [cogl_req_version])
|
||||
AC_SUBST([JSON_GLIB_REQ_VERSION], [json_glib_req_version])
|
||||
AC_SUBST([ATK_REQ_VERSION], [atk_req_version])
|
||||
AC_SUBST([CAIRO_REQ_VERSION], [cairo_req_version])
|
||||
AC_SUBST([PANGO_REQ_VERSION], [pango_req_version])
|
||||
AC_SUBST([GI_REQ_VERSION], [gi_req_version])
|
||||
AC_SUBST([XCOMPOSITE_REQ_VERSION], [xcomposite_req_version])
|
||||
AC_SUBST([LIBINPUT_REQ_VERSION], [libinput_req_version])
|
||||
AC_SUBST([LIBUDEV_REQ_VERSION], [libudev_req_version])
|
||||
AC_SUBST([LIBWACOM_REQ_VERSION], [libwacom_req_version])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AM_PATH_GLIB_2_0([glib_req_version],
|
||||
[],
|
||||
[AC_MSG_ERROR([glib-2.0 is required])],
|
||||
[gobject gio gthread gmodule-no-export])
|
||||
|
||||
# Check for -Bsymbolic-functions to avoid intra-library PLT jumps
|
||||
AC_ARG_ENABLE([Bsymbolic],
|
||||
[AS_HELP_STRING([--disable-Bsymbolic],
|
||||
[Avoid linking with -Bsymbolic])],
|
||||
[],
|
||||
[
|
||||
saved_LDFLAGS="${LDFLAGS}"
|
||||
AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
|
||||
LDFLAGS=-Wl,-Bsymbolic-functions
|
||||
AC_TRY_LINK([], [return 0],
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
enable_Bsymbolic=yes
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT([no])
|
||||
enable_Bsymbolic=no
|
||||
])
|
||||
LDFLAGS="${saved_LDFLAGS}"
|
||||
])
|
||||
|
||||
AS_IF([test "x$enable_Bsymbolic" = "xyes"], [CLUTTER_LINK_FLAGS=-Wl[,]-Bsymbolic-functions])
|
||||
AC_SUBST(CLUTTER_LINK_FLAGS)
|
||||
|
||||
AC_CACHE_SAVE
|
||||
|
||||
dnl ========================================================================
|
||||
|
||||
FLAVOUR_LIBS=""
|
||||
FLAVOUR_CFLAGS=""
|
||||
CLUTTER_BACKENDS=""
|
||||
CLUTTER_INPUT_BACKENDS=""
|
||||
CLUTTER_CONFIG_DEFINES=
|
||||
|
||||
# base dependencies for core
|
||||
CLUTTER_BASE_PC_FILES="cairo-gobject >= $CAIRO_REQ_VERSION gio-2.0 >= glib_req_version atk >= $ATK_REQ_VERSION pangocairo >= $PANGO_REQ_VERSION json-glib-1.0 >= $JSON_GLIB_REQ_VERSION"
|
||||
|
||||
# private base dependencies
|
||||
CLUTTER_BASE_PC_FILES_PRIVATE=""
|
||||
|
||||
# backend specific pkg-config files
|
||||
BACKEND_PC_FILES=""
|
||||
|
||||
# private backend specific dependencies
|
||||
BACKEND_PC_FILES_PRIVATE=""
|
||||
|
||||
dnl === Clutter windowing system backend ======================================
|
||||
|
||||
CLUTTER_BACKENDS="$CLUTTER_BACKENDS x11"
|
||||
CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS x11"
|
||||
|
||||
SUPPORT_X11=1
|
||||
SUPPORT_GLX=1
|
||||
SUPPORT_COGL=1
|
||||
|
||||
# we use fontconfig API and pango-ft2 when the fontconfig
|
||||
# configuration changes; we don't expose any API for this
|
||||
# so we add pango-ft2 to the private Requires.
|
||||
PKG_CHECK_EXISTS([pangoft2],
|
||||
[
|
||||
AC_DEFINE([HAVE_PANGO_FT2], [1], [Supports PangoFt2])
|
||||
BACKEND_PC_FILES_PRIVATE="$BACKEND_PC_FILES_PRIVATE pangoft2"
|
||||
],
|
||||
[])
|
||||
|
||||
AC_ARG_ENABLE(
|
||||
[wayland-egl-server],
|
||||
[AC_HELP_STRING([--enable-wayland-egl-server=@<:@no/yes@:>@], [Enable server side wayland support @<:@default=no@:>@])],
|
||||
[],
|
||||
enable_wayland_egl_server=yes
|
||||
)
|
||||
|
||||
AS_IF([test "x$enable_wayland_egl_server" = "xyes"],
|
||||
[
|
||||
CLUTTER_BACKENDS="$CLUTTER_BACKENDS egl"
|
||||
SUPPORT_EGL=1
|
||||
|
||||
BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-egl wayland-server"
|
||||
|
||||
SUPPORT_WAYLAND_COMPOSITOR=1
|
||||
CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
|
||||
#define CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT 1"
|
||||
|
||||
CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS evdev"
|
||||
|
||||
SUPPORT_EVDEV=1
|
||||
BACKEND_PC_FILES_PRIVATE="$BACKEND_PC_FILES_PRIVATE libudev >= $LIBUDEV_REQ_VERSION libinput >= $LIBINPUT_REQ_VERSION xkbcommon"
|
||||
AC_DEFINE([HAVE_EVDEV], [1], [Have evdev support for input handling])
|
||||
])
|
||||
|
||||
AM_CONDITIONAL(SUPPORT_WAYLAND, [test "x$enable_wayland_egl_server" = "xyes"])
|
||||
|
||||
AC_DEFINE_UNQUOTED([CLUTTER_DRIVERS], ["*"], [List of Cogl drivers])
|
||||
|
||||
dnl strip leading spaces
|
||||
CLUTTER_BACKENDS=${CLUTTER_BACKENDS#* }
|
||||
AC_SUBST(CLUTTER_BACKENDS)
|
||||
|
||||
CLUTTER_INPUT_BACKENDS=${CLUTTER_INPUT_BACKENDS#* }
|
||||
AC_SUBST(CLUTTER_INPUT_BACKENDS)
|
||||
|
||||
AC_CACHE_SAVE
|
||||
|
||||
dnl === Clutter configuration =================================================
|
||||
|
||||
# windowing systems
|
||||
AS_IF([test "x$SUPPORT_X11" = "x1"],
|
||||
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
|
||||
#define CLUTTER_WINDOWING_X11 \"x11\"
|
||||
#define CLUTTER_INPUT_X11 \"x11\""])
|
||||
AS_IF([test "x$SUPPORT_GLX" = "x1"],
|
||||
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
|
||||
#define CLUTTER_WINDOWING_GLX \"glx\""])
|
||||
AS_IF([test "x$SUPPORT_EGL" = "x1"],
|
||||
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
|
||||
#define CLUTTER_WINDOWING_EGL \"eglnative\""])
|
||||
AS_IF([test "x$SUPPORT_EVDEV" = "x1"],
|
||||
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
|
||||
#define CLUTTER_INPUT_EVDEV \"evdev\""])
|
||||
|
||||
# the 'null' input backend is special
|
||||
CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
|
||||
#define CLUTTER_INPUT_NULL \"null\""
|
||||
|
||||
AC_SUBST([CLUTTER_CONFIG_DEFINES])
|
||||
|
||||
dnl === Clutter substitutions kept for backwards compatibility ================
|
||||
AC_SUBST([CLUTTER_WINSYS], [deprecated])
|
||||
AC_SUBST([CLUTTER_WINSYS_BASE], [deprecated])
|
||||
AC_SUBST([CLUTTER_STAGE_TYPE], [deprecated])
|
||||
AC_SUBST([CLUTTER_SONAME_INFIX], [deprecated])
|
||||
AC_SUBST([CLUTTER_FLAVOUR], [deprecated])
|
||||
AC_SUBST([CLUTTER_COGL], [deprecated])
|
||||
AC_SUBST([COGL_DRIVER], [deprecated])
|
||||
|
||||
dnl === X11 checks, only for X11-based backends ===============================
|
||||
X11_PC_FILES=""
|
||||
X11_EXTS=""
|
||||
x11_tests=no
|
||||
|
||||
AS_IF([test "x$SUPPORT_X11" = "x1"],
|
||||
[
|
||||
# base X11 includes and libraries
|
||||
AC_MSG_CHECKING([for X11])
|
||||
|
||||
# start with pkg-config
|
||||
PKG_CHECK_EXISTS([x11], [have_x11=yes], [have_x11=no])
|
||||
AS_IF([test "x$have_x11" = "xyes"],
|
||||
[
|
||||
X11_PC_FILES="x11"
|
||||
|
||||
# we actually need to ask for CFLAGS and LIBS
|
||||
X11_CFLAGS=`$PKG_CONFIG --cflags $X11_PC_FILES`
|
||||
X11_LIBS=`$PKG_CONFIG --libs $X11_PC_FILES`
|
||||
|
||||
AC_MSG_RESULT([found])
|
||||
],
|
||||
[
|
||||
# no pkg-config, let's go old school
|
||||
AC_PATH_X
|
||||
|
||||
AS_IF([test "x$no_x" = "xyes"],
|
||||
[AC_MSG_ERROR([No X11 Libraries found])],
|
||||
[
|
||||
AS_IF([test "x$x_includes" != "xNONE" && test -n "$x_includes"],
|
||||
[X11_CFLAGS=-I`echo $x_includes | sed -e "s/:/ -I/g"`])
|
||||
|
||||
AS_IF([test "x$x_libraries" != "xNONE" && test -n "$x_libraries"],
|
||||
[X11_LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`])
|
||||
|
||||
AC_MSG_RESULT([found])
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
# XEXT (required)
|
||||
AC_MSG_CHECKING([for XEXT extension])
|
||||
PKG_CHECK_EXISTS([xext], [have_xext=yes], [have_xext=no])
|
||||
AS_IF([test "x$have_xext" = "xyes"],
|
||||
[
|
||||
AC_DEFINE(HAVE_XEXT, [1], [Define to 1 if we have the XEXT X extension])
|
||||
|
||||
X11_LIBS="$X11_LIBS -lXext"
|
||||
X11_PC_FILES="$X11_PC_FILES xext"
|
||||
X11_EXTS="$X11_EXTS xext"
|
||||
|
||||
AC_MSG_RESULT([found])
|
||||
],
|
||||
[AC_MSG_ERROR([Not found])]
|
||||
)
|
||||
|
||||
# XDAMAGE (required)
|
||||
AC_MSG_CHECKING([for XDAMAGE extension])
|
||||
PKG_CHECK_EXISTS([xdamage], [have_xdamage=yes], [have_xdamage=no])
|
||||
AS_IF([test "x$have_xdamage" = "xyes"],
|
||||
[
|
||||
AC_DEFINE(HAVE_XDAMAGE, [1], [Define to 1 if we have the XDAMAGE X extension])
|
||||
|
||||
X11_LIBS="$X11_LIBS -lXdamage"
|
||||
X11_PC_FILES="$X11_PC_FILES xdamage"
|
||||
X11_EXTS="$X11_EXTS xdamage"
|
||||
|
||||
AC_MSG_RESULT([found])
|
||||
],
|
||||
[AC_MSG_ERROR([not found])]
|
||||
)
|
||||
|
||||
# XCOMPOSITE (required)
|
||||
AC_MSG_CHECKING([for XCOMPOSITE extension >= $XCOMPOSITE_REQ_VERSION])
|
||||
PKG_CHECK_EXISTS([xcomposite >= $XCOMPOSITE_REQ_VERSION], [have_xcomposite=yes], [have_xcomposite=no])
|
||||
AS_IF([test "x$have_xcomposite" = "xyes"],
|
||||
[
|
||||
X11_LIBS="$X11_LIBS -lXcomposite"
|
||||
X11_PC_FILES="$X11_PC_FILES xcomposite >= $XCOMPOSITE_REQ_VERSION"
|
||||
X11_EXTS="$X11_EXTS xcomposite"
|
||||
|
||||
AC_MSG_RESULT([found])
|
||||
],
|
||||
[AC_MSG_ERROR([not found])]
|
||||
)
|
||||
|
||||
# XTEST (required)
|
||||
AC_MSG_CHECKING([for XTest extension])
|
||||
PKG_CHECK_EXISTS([xtst], [have_xtest=yes], [have_xtest=no])
|
||||
AS_IF([test "x$have_xtest" = "xyes"],
|
||||
[
|
||||
AC_DEFINE(HAVE_XTEST, [1], [Define to 1 if we have the XTest X extension])
|
||||
|
||||
X11_LIBS="$X11_LIBS -lXtst"
|
||||
X11_PC_FILES="$X11_PC_FILES xtst"
|
||||
X11_EXTS="$X11_EXTS xtst"
|
||||
|
||||
AC_MSG_RESULT([found])
|
||||
],
|
||||
[AC_MSG_ERROR([Not found])]
|
||||
)
|
||||
|
||||
# X Generic Extensions (optional)
|
||||
clutter_save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
|
||||
|
||||
clutter_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $X11_LIBS"
|
||||
|
||||
CPPFLAGS="$clutter_save_CPPFLAGS"
|
||||
LIBS="$clutter_save_LIBS"
|
||||
|
||||
PKG_CHECK_EXISTS([xi], [have_xinput=yes], AC_MSG_ERROR([XI support not found]))
|
||||
AC_CHECK_HEADERS([X11/extensions/XInput2.h],
|
||||
[],
|
||||
AC_MSG_ERROR([XI2 not found]))
|
||||
AC_CHECK_FUNC([XIAllowTouchEvents],
|
||||
[
|
||||
AC_CHECK_MEMBER([XIScrollClassInfo.number],
|
||||
[],
|
||||
AC_MSG_ERROR([XIScrollClasSInfo.number member missing in XI2]),
|
||||
[[#include <X11/extensions/XInput2.h>]])
|
||||
])
|
||||
LIBS="$clutter_save_LIBS"
|
||||
|
||||
X11_LIBS="$X11_LIBS $XINPUT_LIBS"
|
||||
X11_PC_FILES="$X11_PC_FILES xi"
|
||||
|
||||
AS_IF([test "x$have_xinput_2_2" = "xyes"],
|
||||
[X11_EXTS="$X11_EXTS xi2.2"],
|
||||
[X11_EXTS="$X11_EXTS xi2.0"])
|
||||
|
||||
# XKB
|
||||
clutter_save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
|
||||
|
||||
clutter_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $X11_LIBS"
|
||||
|
||||
AC_CHECK_FUNC([XkbQueryExtension],
|
||||
[],
|
||||
[AC_MSG_ERROR([XKB support not found])])
|
||||
|
||||
CPPFLAGS="$clutter_save_CPPFLAGS"
|
||||
LIBS="$clutter_save_LIBS"
|
||||
|
||||
x11_tests=yes
|
||||
BACKEND_PC_FILES="$BACKEND_PC_FILES $X11_PC_FILES"
|
||||
FLAVOUR_LIBS="$FLAVOUR_LIBS $X11_LIBS"
|
||||
FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $X11_CFLAGS"
|
||||
]
|
||||
)
|
||||
|
||||
AM_CONDITIONAL([BUILD_XI2], [test "x$have_xinput2" = "xyes"])
|
||||
AM_CONDITIONAL([X11_TESTS], [test "x$x11_tests" = "xyes"])
|
||||
|
||||
X11_EXTS=${X11_EXTS#* }
|
||||
|
||||
AC_CACHE_SAVE
|
||||
|
||||
dnl === Libwacom support for X11 ===============================================
|
||||
AC_ARG_WITH(libwacom,
|
||||
AC_HELP_STRING([--without-libwacom],
|
||||
[disable the use of libwacom for advanced tablet management]),,
|
||||
with_libwacom=auto)
|
||||
|
||||
have_libwacom=no
|
||||
AC_MSG_CHECKING([libwacom])
|
||||
if test x$with_libwacom = xno ; then
|
||||
AC_MSG_RESULT([disabled])
|
||||
else
|
||||
if $PKG_CONFIG --exists libwacom '>=' $LIBWACOM_REQ_VERSION; then
|
||||
have_libwacom=yes
|
||||
AC_MSG_RESULT(yes)
|
||||
PKG_CHECK_MODULES([LIBWACOM], [libwacom])
|
||||
AC_SUBST(LIBWACOM_CFLAGS)
|
||||
AC_SUBST(LIBWACOM_LIBS)
|
||||
AC_DEFINE([HAVE_LIBWACOM], 1, [Building with libwacom for advanced tablet management])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test x$with_libwacom = xyes ; then
|
||||
AC_MSG_ERROR([libwacom forced but not found])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl === Check for GDK-Pixbuf in tests =========================================
|
||||
|
||||
PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0])
|
||||
AC_SUBST(GDK_PIXBUF_CFLAGS)
|
||||
AC_SUBST(GDK_PIXBUF_LIBS)
|
||||
|
||||
dnl === Enable debug level ====================================================
|
||||
|
||||
m4_define([debug_default], [minimum])
|
||||
AC_ARG_ENABLE([debug],
|
||||
[AS_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
|
||||
[Control Clutter debugging level @<:@default=]debug_default[@:>@])],
|
||||
[],
|
||||
[enable_debug=debug_default])
|
||||
|
||||
AS_CASE([$enable_debug],
|
||||
|
||||
[yes],
|
||||
[
|
||||
test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
|
||||
CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG"
|
||||
],
|
||||
|
||||
[minimum],
|
||||
[CLUTTER_DEBUG_CFLAGS="-DG_DISABLE_CAST_CHECKS"],
|
||||
|
||||
[no],
|
||||
[CLUTTER_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"],
|
||||
|
||||
[AC_MSG_ERROR([Unknown argument for --enable-debug])]
|
||||
)
|
||||
|
||||
AC_SUBST(CLUTTER_DEBUG_CFLAGS)
|
||||
|
||||
dnl === Enable deprecation guards ==================================================
|
||||
|
||||
m4_define([deprecated_default],
|
||||
[yes])
|
||||
|
||||
AC_ARG_ENABLE([deprecated],
|
||||
[AS_HELP_STRING([--enable-deprecated=@<:@no/yes@:>@],
|
||||
[Whether deprecated symbols should be disabled when compiling Clutter @<:@default=]deprecated_default[@:>@])],
|
||||
[],
|
||||
[enable_deprecated=deprecated_default])
|
||||
|
||||
AS_CASE([$enable_deprecated],
|
||||
|
||||
[no],
|
||||
[
|
||||
CLUTTER_DEPRECATED_CFLAGS="-DG_DISABLE_SINGLE_INCLUDES -DCOGL_DISABLE_DEPRECATED"
|
||||
],
|
||||
|
||||
[yes],
|
||||
[
|
||||
CLUTTER_DEPRECATED_CFLAGS="-DGLIB_DISABLE_DEPRECATION_WARNINGS"
|
||||
],
|
||||
|
||||
[AC_MSG_ERROR([Unknown argument for --enable-deprecated])]
|
||||
)
|
||||
|
||||
AC_SUBST([CLUTTER_DEPRECATED_CFLAGS])
|
||||
|
||||
dnl === Enable strict compiler flags ==========================================
|
||||
|
||||
# use strict compiler flags only when building from git; the rules for
|
||||
# distcheck will take care of turning this on when making a release
|
||||
m4_define([maintainer_flags_default], [no])
|
||||
AC_ARG_ENABLE([maintainer-flags],
|
||||
[AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes/error@:>@],
|
||||
[Use strict compiler flags @<:@default=]maintainer_flags_default[@:>@])],
|
||||
[],
|
||||
[enable_maintainer_flags=maintainer_flags_default])
|
||||
|
||||
MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS
|
||||
-Wall
|
||||
-Wcast-align
|
||||
-Wuninitialized
|
||||
-Wno-strict-aliasing
|
||||
-Wshadow"
|
||||
|
||||
AC_ARG_ENABLE([Werror],
|
||||
[AS_HELP_STRING([--disable-Werror], [Removes -Werror from compiler flags])],
|
||||
[],
|
||||
[enable_Werror=yes])
|
||||
|
||||
AS_IF([test "x$enable_Werror" = xyes], [
|
||||
MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS
|
||||
-Werror=logical-op
|
||||
-Werror=pointer-arith
|
||||
-Werror=missing-declarations
|
||||
-Werror=redundant-decls
|
||||
-Werror=empty-body
|
||||
-Werror=format
|
||||
-Werror=format-security
|
||||
-Werror=format-nonliteral
|
||||
-Werror=init-self
|
||||
-Werror=declaration-after-statement
|
||||
-Werror=vla"
|
||||
])
|
||||
|
||||
AS_CASE([$enable_maintainer_flags],
|
||||
[yes],
|
||||
[
|
||||
AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
|
||||
],
|
||||
|
||||
[no],
|
||||
[
|
||||
],
|
||||
|
||||
[error],
|
||||
[
|
||||
MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS -Werror"
|
||||
AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
|
||||
],
|
||||
|
||||
[*],
|
||||
[AC_MSG_ERROR([Invalid option for --enable-maintainer-flags])]
|
||||
)
|
||||
|
||||
# strip leading spaces
|
||||
MAINTAINER_CFLAGS=${MAINTAINER_CFLAGS#* }
|
||||
AC_SUBST(MAINTAINER_CFLAGS)
|
||||
|
||||
dnl === Dependencies, compiler flags and linker libraries =====================
|
||||
# strip leading space
|
||||
BACKEND_PC_FILES=${BACKEND_PC_FILES#* }
|
||||
|
||||
# public dependencies, will fill the Requires: field of clutter.pc
|
||||
CLUTTER_REQUIRES="$CLUTTER_BASE_PC_FILES $BACKEND_PC_FILES"
|
||||
PKG_CHECK_MODULES(CLUTTER_DEPS, [$CLUTTER_REQUIRES])
|
||||
|
||||
# private dependencies, will fill the Requires.private: field of clutter.pc
|
||||
AS_IF([test "x$CLUTTER_BASE_PC_FILES_PRIVATE" = "x" && test "x$BACKEND_PC_FILES_PRIVATE" = "x"],
|
||||
[
|
||||
CLUTTER_REQUIRES_PRIVATE=""
|
||||
CLUTTER_DEPS_PRIVATE_CFLAGS=""
|
||||
CLUTTER_DEPS_PRIVATE_LIBS=""
|
||||
],
|
||||
[
|
||||
CLUTTER_REQUIRES_PRIVATE="$CLUTTER_BASE_PC_FILES_PRIVATE $BACKEND_PC_FILES_PRIVATE"
|
||||
PKG_CHECK_MODULES(CLUTTER_DEPS_PRIVATE, [$CLUTTER_REQUIRES_PRIVATE])
|
||||
])
|
||||
|
||||
AC_SUBST(CLUTTER_REQUIRES)
|
||||
AC_SUBST(CLUTTER_REQUIRES_PRIVATE)
|
||||
|
||||
CLUTTER_CFLAGS="$FLAVOUR_CFLAGS $CLUTTER_DEPS_CFLAGS $CLUTTER_DEPS_PRIVATE_CFLAGS $GLIB_CFLAGS $LIBWACOM_CFLAGS"
|
||||
CLUTTER_LIBS="$FLAVOUR_LIBS $CLUTTER_DEPS_LIBS $CLUTTER_DEPS_PRIVATE_LIBS $GLIB_LIBS $LIBWACOM_LIBS"
|
||||
AC_SUBST(CLUTTER_CFLAGS)
|
||||
AC_SUBST(CLUTTER_LIBS)
|
||||
|
||||
dnl === Test coverage =========================================================
|
||||
|
||||
AC_ARG_ENABLE([gcov],
|
||||
[AS_HELP_STRING([--enable-gcov], [Enable gcov])],
|
||||
[use_gcov=$enableval],
|
||||
[use_gcov=no])
|
||||
|
||||
AS_IF([test "x$use_gcov" = "xyes"],
|
||||
[
|
||||
dnl we need gcc:
|
||||
AS_IF([test "$GCC" != "yes"], [AC_MSG_ERROR([GCC is required for --enable-gcov])])
|
||||
|
||||
dnl Check if ccache is being used
|
||||
AC_CHECK_PROG(SHTOOL, shtool, shtool)
|
||||
AS_CASE([`$SHTOOL path $CC`],
|
||||
[*ccache*], [gcc_ccache=yes],
|
||||
[gcc_ccache=no])
|
||||
|
||||
if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
|
||||
AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
|
||||
fi
|
||||
|
||||
ltp_version_list="1.6 1.7 1.8 1.9 1.10"
|
||||
AC_CHECK_PROG(LTP, lcov, lcov)
|
||||
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
|
||||
|
||||
if test "$LTP"; then
|
||||
AC_CACHE_CHECK([for ltp version], clutter_cv_ltp_version,
|
||||
[
|
||||
clutter_cv_ltp_version=invalid
|
||||
ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
|
||||
for ltp_check_version in $ltp_version_list; do
|
||||
if test "$ltp_version" = "$ltp_check_version"; then
|
||||
clutter_cv_ltp_version="$ltp_check_version (ok)"
|
||||
fi
|
||||
done
|
||||
])
|
||||
else
|
||||
ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
|
||||
AC_MSG_ERROR([$ltp_msg])
|
||||
fi
|
||||
|
||||
case $clutter_cv_ltp_version in
|
||||
""|invalid[)]
|
||||
ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
|
||||
AC_MSG_ERROR([$ltp_msg])
|
||||
LTP="exit 0;"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$LTP_GENHTML"; then
|
||||
AC_MSG_ERROR([Could not find genhtml from the LTP package])
|
||||
fi
|
||||
|
||||
dnl Remove all optimization flags from CFLAGS
|
||||
changequote({,})
|
||||
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
|
||||
CLUTTER_CFLAGS=`echo "$CLUTTER_CFLAGS" | $SED -e 's/-O[0-9]*//g'`
|
||||
changequote([,])
|
||||
|
||||
dnl Define the special gcc flags
|
||||
CLUTTER_GCOV_CFLAGS="-O0 -fprofile-arcs -ftest-coverage"
|
||||
CLUTTER_GCOV_LDADD="-lgcov"
|
||||
|
||||
AC_SUBST(CLUTTER_GCOV_CFLAGS)
|
||||
AC_SUBST(CLUTTER_GCOV_LDADD)
|
||||
|
||||
CLUTTER_CFLAGS="$CLUTTER_CFLAGS $CLUTTER_GCOV_CFLAGS"
|
||||
CLUTTER_LIBS="$CLUTTER_LIBS $CLUTTER_GCOV_LDADD"
|
||||
])
|
||||
|
||||
AM_CONDITIONAL(ENABLE_GCOV, test "x$use_gcov" = "xyes")
|
||||
|
||||
dnl === GObject-Introspection check ===========================================
|
||||
|
||||
GOBJECT_INTROSPECTION_CHECK([gi_req_version])
|
||||
|
||||
dnl === Conformance test suite ================================================
|
||||
|
||||
GLIB_TESTS
|
||||
|
||||
dnl ===========================================================================
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
|
||||
build/Makefile
|
||||
build/autotools/Makefile
|
||||
|
||||
clutter/Makefile
|
||||
clutter/clutter-config.h
|
||||
clutter/mutter-clutter-$LIBMUTTER_API_VERSION.pc:clutter/mutter-clutter.pc.in
|
||||
|
||||
tests/Makefile
|
||||
tests/accessibility/Makefile
|
||||
tests/conform/Makefile
|
||||
tests/interactive/Makefile
|
||||
tests/interactive/wrapper.sh
|
||||
tests/micro-bench/Makefile
|
||||
tests/performance/Makefile
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
dnl === Summary ===============================================================
|
||||
|
||||
echo ""
|
||||
echo "Clutter - $VERSION (${CLUTTER_RELEASE_STATUS})"
|
||||
|
||||
# Global flags
|
||||
echo ""
|
||||
echo " • Global:"
|
||||
echo " Prefix: ${prefix}"
|
||||
echo " Libdir: ${libdir}"
|
||||
echo " Sysconfdir: ${sysconfdir}"
|
||||
|
||||
# Compiler/Debug related flags
|
||||
echo ""
|
||||
echo " • Compiler options:"
|
||||
echo " Clutter debug level: ${enable_debug}"
|
||||
echo " Compiler flags: ${CFLAGS} ${MAINTAINER_CFLAGS}"
|
||||
echo " Enable coverage tests: ${use_gcov}"
|
||||
echo " Enable deprecated symbols: ${enable_deprecated}"
|
||||
|
||||
# Miscellaneous
|
||||
echo ""
|
||||
echo " • Extra:"
|
||||
echo " Build introspection data: ${enable_introspection}"
|
||||
if test "x$x11_tests" = "xyes"; then
|
||||
echo " Build X11-specific tests: ${x11_tests}"
|
||||
fi
|
||||
if test "x$pixbuf_tests" = "xyes"; then
|
||||
echo " Build tests using GDK-Pixbuf: ${pixbuf_tests}"
|
||||
fi
|
||||
echo " Install test suites: ${enable_installed_tests}"
|
||||
|
||||
# Clutter backend related flags
|
||||
echo ""
|
||||
echo " • Clutter Backends:"
|
||||
echo " Windowing systems: ${CLUTTER_BACKENDS}"
|
||||
echo " Input backends: ${CLUTTER_INPUT_BACKENDS}"
|
||||
|
||||
if test "x$SUPPORT_X11" = "x1"; then
|
||||
echo ""
|
||||
echo " - X11 backend options:"
|
||||
echo " Enabled extensions: ${X11_EXTS}"
|
||||
fi
|
||||
|
||||
if test "x$SUPPORT_WAYLAND_COMPOSITOR" = "x1"; then
|
||||
echo ""
|
||||
echo " - Wayland compositor support enabled"
|
||||
fi
|
||||
|
||||
echo ""
|
@@ -29,26 +29,30 @@ endif
|
||||
clutter_c_args += clutter_debug_c_args
|
||||
|
||||
clutter_pkg_deps = [
|
||||
gdk_pixbuf_dep,
|
||||
atk_dep,
|
||||
cairo_gobject_dep,
|
||||
glib_dep,
|
||||
gobject_dep,
|
||||
gio_dep,
|
||||
json_glib_dep,
|
||||
pango_dep,
|
||||
]
|
||||
|
||||
clutter_pkg_private_deps = [
|
||||
gdk_pixbuf_dep,
|
||||
gthread_dep,
|
||||
gmodule_no_export_dep,
|
||||
atk_dep,
|
||||
pangocairo_dep,
|
||||
json_glib_dep,
|
||||
]
|
||||
|
||||
if have_pango_ft2
|
||||
clutter_pkg_deps += [
|
||||
clutter_pkg_private_deps += [
|
||||
pangoft2_dep,
|
||||
]
|
||||
endif
|
||||
|
||||
if have_wayland
|
||||
clutter_pkg_deps += [
|
||||
clutter_pkg_private_deps += [
|
||||
wayland_egl_dep,
|
||||
wayland_server_dep,
|
||||
]
|
||||
@@ -57,6 +61,8 @@ endif
|
||||
if have_x11
|
||||
clutter_pkg_deps += [
|
||||
x11_dep,
|
||||
]
|
||||
clutter_pkg_private_deps += [
|
||||
xext_dep,
|
||||
xdamage_dep,
|
||||
xcomposite_dep,
|
||||
@@ -66,7 +72,7 @@ if have_x11
|
||||
endif
|
||||
|
||||
if have_native_backend
|
||||
clutter_pkg_deps += [
|
||||
clutter_pkg_private_deps += [
|
||||
libudev_dep,
|
||||
libinput_dep,
|
||||
xkbcommon_dep,
|
||||
@@ -74,13 +80,14 @@ if have_native_backend
|
||||
endif
|
||||
|
||||
if have_libwacom
|
||||
clutter_pkg_deps += [
|
||||
clutter_pkg_private_deps += [
|
||||
libwacom_dep,
|
||||
]
|
||||
endif
|
||||
|
||||
clutter_deps = [
|
||||
clutter_pkg_deps,
|
||||
clutter_pkg_private_deps,
|
||||
libmutter_cogl_dep,
|
||||
m_dep
|
||||
]
|
||||
|
@@ -1,3 +0,0 @@
|
||||
SUBDIRS = accessibility conform interactive micro-bench performance
|
||||
|
||||
EXTRA_DIST = README clutter-1.0.suppressions
|
@@ -1,37 +0,0 @@
|
||||
common_ldadd = \
|
||||
$(top_builddir)/clutter/libmutter-clutter-@LIBMUTTER_API_VERSION@.la
|
||||
|
||||
common_sources = \
|
||||
cally-examples-util.c \
|
||||
cally-examples-util.h
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-DPREFIXDIR=\"$(libdir)\" \
|
||||
-DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
|
||||
-DGLIB_DISABLE_DEPRECATION_WARNINGS \
|
||||
-I$(top_srcdir)/../cogl \
|
||||
-I$(top_builddir)/../cogl \
|
||||
-I$(top_builddir)/../cogl/cogl \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/clutter \
|
||||
-I$(top_builddir)/clutter \
|
||||
-I$(top_srcdir)/tests/accessibility
|
||||
|
||||
AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
|
||||
LDADD = $(common_ldadd) $(CLUTTER_LIBS)
|
||||
|
||||
check_PROGRAMS = \
|
||||
cally-atkcomponent-example \
|
||||
cally-atkeditabletext-example \
|
||||
cally-atkevents-example \
|
||||
cally-atktext-example \
|
||||
cally-clone-example
|
||||
|
||||
cally_atkcomponent_example_SOURCES = $(common_sources) cally-atkcomponent-example.c
|
||||
cally_atktext_example_SOURCES = $(common_sources) cally-atktext-example.c
|
||||
cally_atkevents_example_SOURCES = $(common_sources) cally-atkevents-example.c
|
||||
cally_atkeditabletext_example_SOURCES = $(common_sources) cally-atkeditabletext-example.c
|
||||
cally_clone_example_SOURCES = $(common_sources) cally-clone-example.c
|
||||
|
||||
DISTCLEANFILES =
|
@@ -1,97 +0,0 @@
|
||||
installed_test_metadir = $(datadir)/installed-tests/mutter-clutter
|
||||
installed_testdir = $(libexecdir)/installed-tests/mutter-clutter
|
||||
include $(top_srcdir)/build/autotools/glib-tap.mk
|
||||
|
||||
AM_CFLAGS = -g $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
|
||||
LDADD = $(top_builddir)/../cogl/cogl/libmutter-cogl-@LIBMUTTER_API_VERSION@.la $(top_builddir)/clutter/libmutter-clutter-@LIBMUTTER_API_VERSION@.la $(CLUTTER_LIBS) $(LIBM)
|
||||
AM_LDFLAGS = -export-dynamic
|
||||
AM_CPPFLAGS = \
|
||||
-DG_LOG_DOMAIN=\"Clutter-Conform\" \
|
||||
-I$(top_srcdir)/../cogl \
|
||||
-I$(top_builddir)/../cogl \
|
||||
-I$(top_builddir)/../cogl/cogl \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir) \
|
||||
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
|
||||
$(CLUTTER_DEPRECATED_CFLAGS) \
|
||||
$(CLUTTER_DEBUG_CFLAGS)
|
||||
|
||||
# Basic actor API
|
||||
actor_tests = \
|
||||
actor-anchors \
|
||||
actor-destroy \
|
||||
actor-graph \
|
||||
actor-invariants \
|
||||
actor-iter \
|
||||
actor-layout \
|
||||
actor-meta \
|
||||
actor-offscreen-limit-max-size \
|
||||
actor-offscreen-redirect \
|
||||
actor-paint-opacity \
|
||||
actor-pick \
|
||||
actor-shader-effect \
|
||||
actor-size \
|
||||
$(NULL)
|
||||
|
||||
# Actor classes
|
||||
classes_tests = \
|
||||
text \
|
||||
$(NULL)
|
||||
|
||||
# General API
|
||||
general_tests = \
|
||||
binding-pool \
|
||||
color \
|
||||
interval \
|
||||
model \
|
||||
script-parser \
|
||||
units \
|
||||
$(NULL)
|
||||
|
||||
# Test for deprecated functionality
|
||||
deprecated_tests = \
|
||||
animator \
|
||||
behaviours \
|
||||
group \
|
||||
rectangle \
|
||||
texture \
|
||||
$(NULL)
|
||||
|
||||
test_programs = $(actor_tests) $(general_tests) $(classes_tests) $(deprecated_tests)
|
||||
|
||||
dist_test_data = $(script_ui_files)
|
||||
script_ui_files = $(addprefix scripts/,$(script_tests))
|
||||
script_tests = \
|
||||
test-animator-1.json \
|
||||
test-animator-2.json \
|
||||
test-animator-3.json \
|
||||
test-script-animation.json \
|
||||
test-script-child.json \
|
||||
test-script-implicit-alpha.json \
|
||||
test-script-interval.json \
|
||||
test-script-layout-property.json \
|
||||
test-script-margin.json \
|
||||
test-script-model.json \
|
||||
test-script-named-object.json \
|
||||
test-script-object-property.json \
|
||||
test-script-single.json \
|
||||
test-script-timeline-markers.json \
|
||||
test-state-1.json
|
||||
|
||||
TESTS_ENVIRONMENT += G_ENABLE_DIAGNOSTIC=0 CLUTTER_ENABLE_DIAGNOSTIC=0 CLUTTER_SCALE=1
|
||||
|
||||
# simple rules for generating a Git ignore file for the conformance test suite
|
||||
$(srcdir)/.gitignore: Makefile
|
||||
$(AM_V_GEN)( echo "/*.trs" ; \
|
||||
echo "/*.log" ; \
|
||||
echo "/*.test" ; \
|
||||
echo "/.gitignore" ; \
|
||||
for p in $(test_programs); do \
|
||||
echo "/$$p" ; \
|
||||
done ) > $(@F)
|
||||
|
||||
gitignore: $(srcdir)/.gitignore
|
||||
|
||||
all-am: gitignore
|
||||
|
||||
DISTCLEANFILES += .gitignore
|
@@ -407,8 +407,7 @@ test_scale_center (TestState *state)
|
||||
g_assert (scale_x == 4.0);
|
||||
g_assert (scale_y == 2.0);
|
||||
g_assert (gravity == CLUTTER_GRAVITY_NONE);
|
||||
assert_notifications (NOTIFY_SCALE_X | NOTIFY_SCALE_Y
|
||||
| NOTIFY_SCALE_CENTER_X | NOTIFY_SCALE_CENTER_Y
|
||||
assert_notifications (NOTIFY_SCALE_CENTER_X | NOTIFY_SCALE_CENTER_Y
|
||||
| NOTIFY_SCALE_GRAVITY);
|
||||
assert_coords (state, 100 + 10 - 10 * 4, 200 + 20 - 20 * 2,
|
||||
100 + 10 + (RECT_WIDTH - 10) * 4,
|
||||
|
@@ -1,119 +0,0 @@
|
||||
#define CLUTTER_ENABLE_EXPERIMENTAL_API
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#define STAGE_WIDTH (300)
|
||||
#define STAGE_HEIGHT (300)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ClutterActor *stage;
|
||||
|
||||
ClutterActor *actor_group1;
|
||||
ClutterEffect *blur_effect1;
|
||||
|
||||
ClutterActor *actor_group2;
|
||||
ClutterEffect *blur_effect2;
|
||||
} Data;
|
||||
|
||||
static void
|
||||
check_results (ClutterStage *stage, gpointer user_data)
|
||||
{
|
||||
Data *data = user_data;
|
||||
gfloat width, height;
|
||||
ClutterRect rect;
|
||||
|
||||
clutter_offscreen_effect_get_target_rect (CLUTTER_OFFSCREEN_EFFECT (data->blur_effect1),
|
||||
&rect);
|
||||
|
||||
width = clutter_rect_get_width (&rect);
|
||||
height = clutter_rect_get_height (&rect);
|
||||
|
||||
if (g_test_verbose ())
|
||||
g_print ("Checking effect1 size: %.2f x %.2f\n",
|
||||
clutter_rect_get_width (&rect),
|
||||
clutter_rect_get_height (&rect));
|
||||
|
||||
g_assert_cmpint (width, <, STAGE_WIDTH);
|
||||
g_assert_cmpint (height, <, STAGE_HEIGHT);
|
||||
|
||||
clutter_offscreen_effect_get_target_rect (CLUTTER_OFFSCREEN_EFFECT (data->blur_effect2),
|
||||
&rect);
|
||||
|
||||
width = clutter_rect_get_width (&rect);
|
||||
height = clutter_rect_get_height (&rect);
|
||||
|
||||
if (g_test_verbose ())
|
||||
g_print ("Checking effect2 size: %.2f x %.2f\n", width, height);
|
||||
|
||||
g_assert_cmpint (width, ==, STAGE_WIDTH);
|
||||
g_assert_cmpint (height, ==, STAGE_HEIGHT);
|
||||
|
||||
|
||||
clutter_main_quit ();
|
||||
}
|
||||
|
||||
static ClutterActor *
|
||||
create_actor (gfloat x, gfloat y,
|
||||
gfloat width, gfloat height,
|
||||
const ClutterColor *color)
|
||||
{
|
||||
return g_object_new (CLUTTER_TYPE_ACTOR,
|
||||
"x", x,
|
||||
"y", y,
|
||||
"width", width,
|
||||
"height", height,
|
||||
"background-color", color,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
actor_offscreen_limit_max_size (void)
|
||||
{
|
||||
Data data;
|
||||
|
||||
if (!cogl_features_available (COGL_FEATURE_OFFSCREEN))
|
||||
return;
|
||||
|
||||
data.stage = clutter_test_get_stage ();
|
||||
g_signal_connect (data.stage, "after-paint",
|
||||
G_CALLBACK (check_results), &data);
|
||||
clutter_actor_set_size (data.stage, STAGE_WIDTH, STAGE_HEIGHT);
|
||||
|
||||
data.actor_group1 = clutter_actor_new ();
|
||||
clutter_actor_add_child (data.stage, data.actor_group1);
|
||||
data.blur_effect1 = clutter_blur_effect_new ();
|
||||
clutter_actor_add_effect (data.actor_group1, data.blur_effect1);
|
||||
clutter_actor_add_child (data.actor_group1,
|
||||
create_actor (10, 10,
|
||||
100, 100,
|
||||
CLUTTER_COLOR_Blue));
|
||||
clutter_actor_add_child (data.actor_group1,
|
||||
create_actor (100, 100,
|
||||
100, 100,
|
||||
CLUTTER_COLOR_Gray));
|
||||
|
||||
data.actor_group2 = clutter_actor_new ();
|
||||
clutter_actor_add_child (data.stage, data.actor_group2);
|
||||
data.blur_effect2 = clutter_blur_effect_new ();
|
||||
clutter_actor_add_effect (data.actor_group2, data.blur_effect2);
|
||||
clutter_actor_add_child (data.actor_group2,
|
||||
create_actor (-10, -10,
|
||||
100, 100,
|
||||
CLUTTER_COLOR_Yellow));
|
||||
clutter_actor_add_child (data.actor_group2,
|
||||
create_actor (250, 10,
|
||||
100, 100,
|
||||
CLUTTER_COLOR_ScarletRed));
|
||||
clutter_actor_add_child (data.actor_group2,
|
||||
create_actor (10, 250,
|
||||
100, 100,
|
||||
CLUTTER_COLOR_Yellow));
|
||||
|
||||
clutter_actor_show (data.stage);
|
||||
|
||||
clutter_main ();
|
||||
}
|
||||
|
||||
CLUTTER_TEST_SUITE (
|
||||
CLUTTER_TEST_UNIT ("/actor/offscreen/limit-max-size", actor_offscreen_limit_max_size)
|
||||
)
|
@@ -189,10 +189,11 @@ verify_redraws (gpointer user_data)
|
||||
clutter_actor_queue_redraw (data->child);
|
||||
verify_redraw (data, 1);
|
||||
|
||||
/* Modifying the transformation on the parent should cause a
|
||||
redraw */
|
||||
/* Modifying the transformation on the parent should not cause a redraw,
|
||||
since the FBO stores pre-transformed rendering that can be reused with
|
||||
any transformation. */
|
||||
clutter_actor_set_anchor_point (data->parent_container, 0, 1);
|
||||
verify_redraw (data, 1);
|
||||
verify_redraw (data, 0);
|
||||
|
||||
/* Redrawing an unrelated actor shouldn't cause a redraw */
|
||||
clutter_actor_set_position (data->unrelated_actor, 0, 1);
|
||||
|
@@ -230,13 +230,13 @@ paint_cb (ClutterStage *stage,
|
||||
gboolean *was_painted = data;
|
||||
|
||||
/* old shader effect */
|
||||
g_assert_cmpint (get_pixel (50, 50), ==, 0xff0000);
|
||||
g_assert_cmpint (get_pixel (0, 25), ==, 0xff0000);
|
||||
/* new shader effect */
|
||||
g_assert_cmpint (get_pixel (150, 50), ==, 0x00ffff);
|
||||
g_assert_cmpint (get_pixel (100, 25), ==, 0x00ffff);
|
||||
/* another new shader effect */
|
||||
g_assert_cmpint (get_pixel (250, 50), ==, 0xff00ff);
|
||||
g_assert_cmpint (get_pixel (200, 25), ==, 0xff00ff);
|
||||
/* new shader effect */
|
||||
g_assert_cmpint (get_pixel (350, 50), ==, 0x00ffff);
|
||||
g_assert_cmpint (get_pixel (300, 25), ==, 0x00ffff);
|
||||
|
||||
*was_painted = TRUE;
|
||||
}
|
||||
|
@@ -19,7 +19,6 @@ clutter_conform_tests_actor_tests = [
|
||||
'actor-iter',
|
||||
'actor-layout',
|
||||
'actor-meta',
|
||||
'actor-offscreen-limit-max-size',
|
||||
'actor-offscreen-redirect',
|
||||
'actor-paint-opacity',
|
||||
'actor-pick',
|
||||
|
@@ -1,143 +0,0 @@
|
||||
UNIT_TESTS = \
|
||||
test-texture-slicing.c \
|
||||
test-texture-async.c \
|
||||
test-texture-material.c \
|
||||
test-events.c \
|
||||
test-scale.c \
|
||||
test-actors.c \
|
||||
test-shader-effects.c \
|
||||
test-script.c \
|
||||
test-grab.c \
|
||||
test-cogl-shader-glsl.c \
|
||||
test-animator.c \
|
||||
test-state.c \
|
||||
test-state-animator.c \
|
||||
test-fbo.c \
|
||||
test-multistage.c \
|
||||
test-cogl-tex-tile.c \
|
||||
test-cogl-tex-convert.c \
|
||||
test-cogl-tex-foreign.c \
|
||||
test-cogl-offscreen.c \
|
||||
test-cogl-tex-polygon.c \
|
||||
test-cogl-multitexture.c \
|
||||
test-stage-read-pixels.c \
|
||||
test-paint-wrapper.c \
|
||||
test-texture-quality.c \
|
||||
test-layout.c \
|
||||
test-animation.c \
|
||||
test-easing.c \
|
||||
test-binding-pool.c \
|
||||
test-text.c \
|
||||
test-text-field.c \
|
||||
test-cairo-clock.c \
|
||||
test-cairo-flowers.c \
|
||||
test-cogl-vertex-buffer.c \
|
||||
test-stage-sizing.c \
|
||||
test-scrolling.c \
|
||||
test-swipe-action.c \
|
||||
test-cogl-point-sprites.c \
|
||||
test-table-layout.c \
|
||||
test-path-constraint.c \
|
||||
test-state-script.c \
|
||||
test-devices.c \
|
||||
test-content.c \
|
||||
test-keyframe-transition.c \
|
||||
test-bind-constraint.c \
|
||||
test-touch-events.c \
|
||||
test-rotate-zoom.c \
|
||||
test-image.c
|
||||
|
||||
if X11_TESTS
|
||||
UNIT_TESTS += test-pixmap.c
|
||||
endif
|
||||
|
||||
SHEXT = $(EXEEXT)
|
||||
|
||||
# For convenience, this provides a way to easily run individual unit tests:
|
||||
wrappers: stamp-test-interactive
|
||||
@true
|
||||
|
||||
GIT_IGNORE_EXTRA = \
|
||||
stamp-test-interactive \
|
||||
stamp-test-unit-names \
|
||||
test-unit-names.h \
|
||||
$(UNIT_TESTS:.c=$(SHEXT))
|
||||
|
||||
stamp-test-interactive: Makefile
|
||||
@wrapper=$(abs_builddir)/wrapper.sh ; \
|
||||
chmod +x $$wrapper && \
|
||||
for i in $(UNIT_TESTS); \
|
||||
do \
|
||||
test_bin=$${i%*.c} ; \
|
||||
echo " GEN $$test_bin" ; \
|
||||
( echo "#!/bin/sh" ; \
|
||||
echo "$$wrapper $$test_bin \$$@" \
|
||||
) > $$test_bin$(SHEXT) ; \
|
||||
chmod +x $$test_bin$(SHEXT) ; \
|
||||
done \
|
||||
&& echo timestamp > $(@F)
|
||||
|
||||
test-unit-names.h: stamp-test-unit-names
|
||||
@true
|
||||
|
||||
stamp-test-unit-names: Makefile
|
||||
@( echo "/* ** This file is autogenerated. Do not edit. ** */" ; \
|
||||
echo "" ; \
|
||||
echo "const char *test_unit_names[] = {" ) > test-unit-names.h ; \
|
||||
for i in $(UNIT_TESTS); \
|
||||
do \
|
||||
test_bin=$${i%*.c} ; \
|
||||
echo " \"$$test_bin\"," >> test-unit-names.h ; \
|
||||
done \
|
||||
&& echo "};" >> test-unit-names.h \
|
||||
&& echo timestamp > $(@F)
|
||||
|
||||
clean-wrappers:
|
||||
@for i in $(UNIT_TESTS); \
|
||||
do \
|
||||
test_bin=$${i%*.c} ; \
|
||||
echo " RM $$test_bin"; \
|
||||
rm -f $$test_bin$(SHEXT); \
|
||||
done \
|
||||
&& rm -f stamp-test-unit-names \
|
||||
&& rm -f stamp-test-interactive
|
||||
|
||||
.PHONY: wrappers clean-wrappers
|
||||
|
||||
common_ldadd = \
|
||||
$(top_builddir)/clutter/libmutter-clutter-@LIBMUTTER_API_VERSION@.la \
|
||||
$(top_builddir)/../cogl/cogl/libmutter-cogl-@LIBMUTTER_API_VERSION@.la
|
||||
|
||||
check_PROGRAMS = test-interactive
|
||||
check_SCRIPTS = wrappers
|
||||
|
||||
test_interactive_SOURCES = test-main.c $(UNIT_TESTS)
|
||||
nodist_test_interactive_SOURCES = test-unit-names.h
|
||||
test_interactive_CFLAGS = $(CLUTTER_CFLAGS) $(GDK_PIXBUF_CFLAGS)
|
||||
test_interactive_CPPFLAGS = \
|
||||
-DTESTS_DATADIR=\""$(abs_srcdir)"\" \
|
||||
-DG_DISABLE_SINGLE_INCLUDES \
|
||||
-DGLIB_DISABLE_DEPRECATION_WARNINGS \
|
||||
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
|
||||
-DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
|
||||
-I$(top_srcdir)/../cogl \
|
||||
-I$(top_builddir)/../cogl \
|
||||
-I$(top_builddir)/../cogl/cogl \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/clutter \
|
||||
-I$(top_builddir)/clutter
|
||||
test_interactive_LDFLAGS = -export-dynamic
|
||||
test_interactive_LDADD = $(CLUTTER_LIBS) $(GDK_PIXBUF_LIBS) $(common_ldadd) $(LIBM)
|
||||
|
||||
EXTRA_DIST = \
|
||||
wrapper.sh.in \
|
||||
test-script.json \
|
||||
test-script-signals.json \
|
||||
redhand.png
|
||||
|
||||
DISTCLEANFILES = wrapper.sh .gitignore test-unit-names.h
|
||||
|
||||
BUILT_SOURCES = test-unit-names.h
|
||||
|
||||
clean-local: clean-wrappers
|
@@ -1,15 +1,14 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
outputfile=$1
|
||||
shift
|
||||
test_source_files="$@"
|
||||
|
||||
echo '/* ** This file is autogenerated. Do not edit. ** */' > $outputfile
|
||||
echo '' >> $outputfile
|
||||
echo 'const char *test_unit_names[] = {' >> $outputfile
|
||||
echo '/* ** This file is autogenerated. Do not edit. ** */' > "$outputfile"
|
||||
echo '' >> "$outputfile"
|
||||
echo 'const char *test_unit_names[] = {' >> "$outputfile"
|
||||
|
||||
for test_source_file in $test_source_files; do
|
||||
echo " \"$(echo $test_source_file | sed 's/.*\(test-[a-z0-9\-]\+\)\.c/\1/')\"," >> $outputfile
|
||||
for test_source_file in "$@"; do
|
||||
echo " \"$(echo "$test_source_file" | sed 's/.*\(test-[a-z0-9\-]\+\)\.c/\1/')\"," >> "$outputfile"
|
||||
done
|
||||
|
||||
echo '};' >> $outputfile
|
||||
echo '};' >> "$outputfile"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user