Compare commits
6 Commits
3.35.1
...
wip/nielsd
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5f1410f968 | ||
![]() |
156aa3dd99 | ||
![]() |
b590c90e90 | ||
![]() |
a8ee0d8b80 | ||
![]() |
19137361d7 | ||
![]() |
1c7472b24d |
29
.gitignore
vendored
29
.gitignore
vendored
@@ -1,9 +1,25 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
Makefile.in.in
|
||||||
|
aclocal.m4
|
||||||
|
autom4te.cache
|
||||||
build-aux
|
build-aux
|
||||||
compile
|
compile
|
||||||
|
config.guess
|
||||||
config.h
|
config.h
|
||||||
config.h.in
|
config.h.in
|
||||||
|
config.log
|
||||||
|
config.status
|
||||||
|
config.sub
|
||||||
|
configure
|
||||||
|
depcomp
|
||||||
|
install-sh
|
||||||
|
intltool-extract.in
|
||||||
|
intltool-merge.in
|
||||||
|
libtool
|
||||||
ltmain.sh
|
ltmain.sh
|
||||||
missing
|
missing
|
||||||
|
.deps
|
||||||
50-mutter-navigation.xml
|
50-mutter-navigation.xml
|
||||||
50-mutter-system.xml
|
50-mutter-system.xml
|
||||||
50-mutter-windows.xml
|
50-mutter-windows.xml
|
||||||
@@ -17,11 +33,15 @@ mutter-wayland.desktop
|
|||||||
*.swp
|
*.swp
|
||||||
*.gir
|
*.gir
|
||||||
*.typelib
|
*.typelib
|
||||||
|
stamp-h1
|
||||||
*.gmo
|
*.gmo
|
||||||
*.make
|
*.make
|
||||||
*.log
|
*.log
|
||||||
*.trs
|
*.trs
|
||||||
*~
|
*~
|
||||||
|
stamp-it
|
||||||
|
.intltool-merge-cache
|
||||||
|
ABOUT-NLS
|
||||||
POTFILES
|
POTFILES
|
||||||
Makevars.template
|
Makevars.template
|
||||||
po/*.header
|
po/*.header
|
||||||
@@ -44,7 +64,9 @@ org.gnome.mutter.wayland.gschema.xml
|
|||||||
testasyncgetprop
|
testasyncgetprop
|
||||||
testboxes
|
testboxes
|
||||||
testgradient
|
testgradient
|
||||||
|
m4/*
|
||||||
INSTALL
|
INSTALL
|
||||||
|
mkinstalldirs
|
||||||
meta-enum-types.[ch]
|
meta-enum-types.[ch]
|
||||||
src/stamp-meta-enum-types.h
|
src/stamp-meta-enum-types.h
|
||||||
src/meta-dbus-display-config.[ch]
|
src/meta-dbus-display-config.[ch]
|
||||||
@@ -100,6 +122,13 @@ doc/reference/meta-undocumented.txt
|
|||||||
doc/reference/meta-unused.txt
|
doc/reference/meta-unused.txt
|
||||||
doc/reference/meta-docs.sgml
|
doc/reference/meta-docs.sgml
|
||||||
doc/reference/meta.types
|
doc/reference/meta.types
|
||||||
|
gtk-doc.m4
|
||||||
|
intltool.m4
|
||||||
|
libtool.m4
|
||||||
|
ltoptions.m4
|
||||||
|
ltsugar.m4
|
||||||
|
ltversion.m4
|
||||||
|
lt~obsolete.m4
|
||||||
.dirstamp
|
.dirstamp
|
||||||
**/tags.*
|
**/tags.*
|
||||||
build/
|
build/
|
||||||
|
@@ -1,79 +1,24 @@
|
|||||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v2
|
image: registry.gitlab.gnome.org/gnome/mutter/master:v1
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- review
|
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
|
|
||||||
check-commit-log:
|
|
||||||
stage: review
|
|
||||||
variables:
|
|
||||||
GIT_DEPTH: "100"
|
|
||||||
script:
|
|
||||||
- ./.gitlab-ci/check-commit-log.sh
|
|
||||||
only:
|
|
||||||
- merge_requests
|
|
||||||
|
|
||||||
build-mutter:
|
build-mutter:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- meson . build -Dbuildtype=debugoptimized -Degl_device=true -Dwayland_eglstream=true --werror --prefix /usr
|
- meson . build -Degl_device=true -Dwayland_eglstream=true
|
||||||
- ninja -C build
|
- ninja -C build
|
||||||
- ninja -C build install
|
- ninja -C build install
|
||||||
artifacts:
|
|
||||||
expire_in: 1 day
|
|
||||||
paths:
|
|
||||||
- build
|
|
||||||
only:
|
|
||||||
- merge_requests
|
|
||||||
- /^.*$/
|
|
||||||
|
|
||||||
build-without-native-backend-and-wayland:
|
|
||||||
stage: build
|
|
||||||
script:
|
|
||||||
- meson . build -Dbuildtype=debugoptimized -Dnative_backend=false -Dudev=false -Dwayland=false -Dcore_tests=false --werror --prefix /usr
|
|
||||||
- ninja -C build
|
|
||||||
- ninja -C build install
|
|
||||||
artifacts:
|
|
||||||
expire_in: 1 day
|
|
||||||
paths:
|
|
||||||
- build
|
|
||||||
only:
|
|
||||||
- merge_requests
|
|
||||||
- /^.*$/
|
|
||||||
|
|
||||||
test-mutter:
|
test-mutter:
|
||||||
stage: test
|
stage: test
|
||||||
dependencies:
|
|
||||||
- build-mutter
|
|
||||||
variables:
|
|
||||||
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
|
|
||||||
GSETTINGS_SCHEMA_DIR: "$CI_PROJECT_DIR/build/data"
|
|
||||||
G_SLICE: "always-malloc"
|
|
||||||
MALLOC_CHECK_: "3"
|
|
||||||
NO_AT_BRIDGE: "1"
|
|
||||||
MALLOC_PERTURB_: "123"
|
|
||||||
script:
|
script:
|
||||||
- dconf update
|
- meson . build -Degl_device=true -Dwayland_eglstream=true
|
||||||
- mkdir -m 700 $XDG_RUNTIME_DIR
|
- ninja -C build
|
||||||
- glib-compile-schemas $GSETTINGS_SCHEMA_DIR
|
- glib-compile-schemas $PWD/build/data
|
||||||
- >
|
- env XDG_RUNTIME_DIR=/tmp/ GSETTINGS_SCHEMA_DIR=$PWD/build/data dbus-run-session -- xvfb-run -s '+iglx -noreset' meson test -C build --verbose --no-stdsplit
|
||||||
dbus-run-session -- xvfb-run -s '+iglx -noreset'
|
artifacts:
|
||||||
meson test -C build --no-rebuild -t 10 --verbose --no-stdsplit --print-errorlogs --wrap catchsegv
|
paths:
|
||||||
only:
|
- build/meson-logs
|
||||||
- merge_requests
|
when: on_failure
|
||||||
- /^.*$/
|
|
||||||
|
|
||||||
can-build-gnome-shell:
|
|
||||||
stage: test
|
|
||||||
dependencies:
|
|
||||||
- build-mutter
|
|
||||||
before_script:
|
|
||||||
- meson install --no-rebuild -C build
|
|
||||||
script:
|
|
||||||
- .gitlab-ci/checkout-gnome-shell.sh
|
|
||||||
- meson gnome-shell gnome-shell/build --prefix /usr -Dman=false
|
|
||||||
- ninja -C gnome-shell/build install
|
|
||||||
only:
|
|
||||||
- merge_requests
|
|
||||||
- /^.*$/
|
|
||||||
|
@@ -1,40 +1,14 @@
|
|||||||
# Rebuild and push with
|
FROM fedora:29
|
||||||
#
|
|
||||||
# cd .gitlab-ci/
|
|
||||||
# docker build --no-cache -t registry.gitlab.gnome.org/gnome/mutter/master:v2 .
|
|
||||||
# docker push registry.gitlab.gnome.org/gnome/mutter/master:v2
|
|
||||||
#
|
|
||||||
|
|
||||||
FROM fedora:30
|
|
||||||
|
|
||||||
RUN dnf -y update && dnf -y upgrade && \
|
RUN dnf -y update && dnf -y upgrade && \
|
||||||
dnf install -y 'dnf-command(builddep)' && \
|
dnf install -y 'dnf-command(builddep)' && \
|
||||||
dnf install -y 'dnf-command(copr)' && \
|
|
||||||
dnf copr enable -y fmuellner/gnome-shell-ci && \
|
|
||||||
dnf copr enable -y jadahl/mutter-ci && \
|
|
||||||
dnf copr enable -y hergertme/sysprof-3 && \
|
|
||||||
dnf -y update && dnf -y upgrade && \
|
|
||||||
|
|
||||||
dnf builddep -y mutter && \
|
dnf builddep -y mutter && \
|
||||||
|
|
||||||
# Until Fedora catches up with meson build-deps
|
# Until Fedora catches up with meson build-deps
|
||||||
dnf install -y meson xorg-x11-server-Xorg gnome-settings-daemon-devel egl-wayland-devel xorg-x11-server-Xwayland && \
|
dnf install -y meson xorg-x11-server-Xorg gnome-settings-daemon-devel egl-wayland-devel xorg-x11-server-Xwayland && \
|
||||||
|
|
||||||
# Until Fedora catches up with mesa bug fixes
|
|
||||||
dnf upgrade -y mesa-dri-drivers mesa-libEGL && \
|
|
||||||
|
|
||||||
# For running unit tests
|
# For running unit tests
|
||||||
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 '*/xvfb-run' gdm-lib accountsservice-libs && \
|
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 && \
|
||||||
|
|
||||||
dnf install -y sysprof-devel && \
|
|
||||||
|
|
||||||
dnf install -y intltool redhat-rpm-config make && \
|
dnf install -y intltool redhat-rpm-config make && \
|
||||||
|
|
||||||
# GNOME Shell
|
|
||||||
dnf builddep -y gnome-shell --setopt=install_weak_deps=False && \
|
|
||||||
# New dep this cycle
|
|
||||||
dnf install -y 'pkgconfig(gnome-autoar-0)' && \
|
|
||||||
dnf remove -y gnome-bluetooth-libs-devel dbus-glib-devel upower-devel python3-devel && \
|
|
||||||
dnf remove -y --noautoremove mutter mutter-devel && \
|
|
||||||
|
|
||||||
dnf clean all
|
dnf clean all
|
||||||
|
@@ -1,57 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
if [ -z "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ]; then
|
|
||||||
echo Cannot review non-merge request
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
git fetch $CI_MERGE_REQUEST_PROJECT_URL.git $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
|
|
||||||
|
|
||||||
branch_point=$(git merge-base HEAD FETCH_HEAD)
|
|
||||||
|
|
||||||
commits=$(git log --format='format:%H' $branch_point..$CI_COMMIT_SHA)
|
|
||||||
|
|
||||||
if [ -z "$commits" ]; then
|
|
||||||
echo Commit range empty
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
function commit_message_has_url() {
|
|
||||||
commit=$1
|
|
||||||
commit_message=$(git show -s --format='format:%b' $commit)
|
|
||||||
echo "$commit_message" | grep -qe "\($CI_MERGE_REQUEST_PROJECT_URL/\(issues\|merge_requests\)/[0-9]\+\|https://bugzilla.gnome.org/show_bug.cgi?id=[0-9]\+\)"
|
|
||||||
return $?
|
|
||||||
}
|
|
||||||
|
|
||||||
function commit_message_subject_is_compliant() {
|
|
||||||
commit=$1
|
|
||||||
commit_message_subject=$(git show -s --format='format:%s' $commit)
|
|
||||||
|
|
||||||
if echo "$commit_message_subject" | grep -qe "\(^meta-\|^Meta\)"; then
|
|
||||||
echo " - message subject should not be prefixed with 'meta-' or 'Meta'"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if echo "$commit_message_subject" | grep -qe "\.[ch]:"; then
|
|
||||||
echo " - message subject prefix should not include .c, .h, etc."
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
for commit in $commits; do
|
|
||||||
commit_short=$(echo $commit | cut -c -8)
|
|
||||||
|
|
||||||
if ! commit_message_has_url $commit; then
|
|
||||||
echo "Missing merge request or issue URL on commit $commit_short"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
errors=$(commit_message_subject_is_compliant $commit)
|
|
||||||
if [ $? != 0 ]; then
|
|
||||||
echo "Commit message for $commit_short is not compliant:"
|
|
||||||
echo "$errors"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
@@ -1,35 +0,0 @@
|
|||||||
#!/usr/bin/bash
|
|
||||||
|
|
||||||
mutter_branch=$(git describe --contains --all HEAD)
|
|
||||||
gnome_shell_target=
|
|
||||||
|
|
||||||
git clone https://gitlab.gnome.org/GNOME/gnome-shell.git
|
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo Checkout failed
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd gnome-shell
|
|
||||||
|
|
||||||
if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ]; then
|
|
||||||
merge_request_remote=${CI_MERGE_REQUEST_SOURCE_PROJECT_URL//mutter/gnome-shell}
|
|
||||||
merge_request_branch=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
|
|
||||||
|
|
||||||
echo Looking for $merge_request_branch on remote ...
|
|
||||||
if git fetch -q $merge_request_remote $merge_request_branch 2>/dev/null; then
|
|
||||||
gnome_shell_target=FETCH_HEAD
|
|
||||||
else
|
|
||||||
gnome_shell_target=origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
|
|
||||||
echo Using $gnome_shell_target instead
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$gnome_shell_target" ]; then
|
|
||||||
gnome_shell_target=$(git branch -r -l origin/$mutter_branch)
|
|
||||||
gnome_shell_target=${gnome_shell_target:-$(git branch -r -l ${mutter_branch#remotes/})}
|
|
||||||
gnome_shell_target=${gnome_shell_target:-origin/master}
|
|
||||||
echo Using $gnome_shell_target instead
|
|
||||||
fi
|
|
||||||
|
|
||||||
git checkout -q $gnome_shell_target
|
|
13
Makefile.am
Normal file
13
Makefile.am
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
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
|
372
NEWS
372
NEWS
@@ -1,375 +1,3 @@
|
|||||||
3.35.1
|
|
||||||
======
|
|
||||||
* Fix immediate screen blank after releaseing inhibitor [Tim; #573]
|
|
||||||
* Respond to frame callbacks regardless of damage [Jonas; !839]
|
|
||||||
* selection [Carlos; !842]
|
|
||||||
* Fix Night Light on wayland [Jonas; !840]
|
|
||||||
* Fix various copy+paste/DND regressions [Carlos; !848, #789, #842,
|
|
||||||
#793, #845, #854]
|
|
||||||
* Misc. bug fixes and cleanups [Daniel, Marco, Jonas, Georges;
|
|
||||||
!841, !764, !837, !846]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Marco Trevisan (Treviño), Carlos Garnacho, Tim Klocke,
|
|
||||||
Georges Basile Stavracas Neto, Daniel van Vugt, Jonas Ådahl
|
|
||||||
|
|
||||||
3.34.1
|
|
||||||
======
|
|
||||||
* Fix startup of X11 session services on wayland [Carlos; #771]
|
|
||||||
* Fix _NET_ACTIVE_WINDOW emission [Carlos; #751]
|
|
||||||
* Fix initial view perspective [Marco; !803]
|
|
||||||
* Fix screenshots and window animations when scaled [Robert; !758]
|
|
||||||
* Re-enable coredumps when capabilities are set [Jonas; !811]
|
|
||||||
* Fix scaling of DND surface actors [Robert; !780]
|
|
||||||
* Optimize blitting of untransformed offscreen stage views [Olivier; !809, !820]
|
|
||||||
* Fix freeze of pointer event delivery on X11 [Olivier; !821]
|
|
||||||
* Fix scaling of stylus input coordinates with HiDPI [Dorian; !830]
|
|
||||||
* Fix memory leak when using implicit animations [Jonas; !828]
|
|
||||||
* Fix numlock state for native backend [Carlos; #769]
|
|
||||||
* Fixed crashes [Marco, Olivier, Jonas Å.; !805, #823, !808, !825,
|
|
||||||
#844, !826, #779]
|
|
||||||
* Misc. bug fixes and cleanups [Jonas Å., Georges, Jonas D., Michal, Daniel,
|
|
||||||
Iain, Adam, Marco, Carlos, Ting-Wei, Hans, Robert; !787, !795, !791, !797,
|
|
||||||
!772, !775, !799, !778, !785, !782, !796, #819, !814, !769, !817, !783, !786,
|
|
||||||
!829, !774, #822]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Marco Trevisan (Treviño), Jonas Dreßler, Olivier Fourdan, Carlos Garnacho,
|
|
||||||
Hans de Goede, Adam Jackson, Ting-Wei Lan, Iain Lane, Michal Lazo,
|
|
||||||
Robert Mader, Georges Basile Stavracas Neto, Dorian Stoll, Daniel van Vugt,
|
|
||||||
Jonas Ådahl
|
|
||||||
|
|
||||||
Translators:
|
|
||||||
Milo Casagrande [it], Nathan Follens [nl], Matej Urbančič [sl],
|
|
||||||
Ask Hjorth Larsen [da], Alan Mortensen [da], Jordi Mas [ca]
|
|
||||||
|
|
||||||
3.34.0
|
|
||||||
======
|
|
||||||
* Fix xdg-output v3 support [Olivier; !771]
|
|
||||||
* Fix crash when changing decoration state [Jonas; !773]
|
|
||||||
* Add and remove connectors on hot-plug [Jonas; !743]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Olivier Fourdan, Jonas Ådahl
|
|
||||||
|
|
||||||
Translators:
|
|
||||||
Rafael Fontenelle [pt_BR], Gwan-gyeong Mun [ko], Christian Kirbach [de],
|
|
||||||
Claude Paroz [fr], Milo Casagrande [it], Emin Tufan Çetin [tr],
|
|
||||||
Ryuta Fujii [ja]
|
|
||||||
|
|
||||||
3.33.92
|
|
||||||
=======
|
|
||||||
* Turn MetaShapedTexture into a ClutterContent implementation [Georges; !409]
|
|
||||||
* Restore inhibit shortcut for overlay key [Olivier; #734]
|
|
||||||
* Misc. pointer a11y improvements [Jonas D., Olivier; !746, !747, !745, !761]
|
|
||||||
* Fix position of drag surfaces [Robert; !684]
|
|
||||||
* Implement subsurface.place_below() for parents [Robert; !664]
|
|
||||||
* Add meta_window_actor_get_image() [Jonas Å.; !752]
|
|
||||||
* Revert faulty optimization from !719 [Jonas Å.; #735]
|
|
||||||
* Add additional sysprof trace points [Jonas Å.; !757, !765]
|
|
||||||
* Remove GLX "threaded swap wait" used on Nvidia [Daniel; !602]
|
|
||||||
* Implement geometric picking [Daniel; !189]
|
|
||||||
* Fix lost keyboard focus after DND [Olivier; #747]
|
|
||||||
* Misc. bug fixes and cleanups [Florian, Carlos, Piotr, Hans, Georges, Robert,
|
|
||||||
Ray, Mart, Rémi; !740, !672, !749, !751, !753, !730, !755, !756, !750, !715,
|
|
||||||
#738944, !657, !768]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Jonas Ådahl, Rémi Bernon, Piotr Drąg, Jonas Dreßler, Olivier Fourdan,
|
|
||||||
Carlos Garnacho, Hans de Goede, Robert Mader, Florian Müllner,
|
|
||||||
Georges Basile Stavracas Neto, Mart Raudsepp, Ray Strode, Daniel van Vugt
|
|
||||||
|
|
||||||
Translators:
|
|
||||||
Piotr Drąg [pl], Марко Костић [sr], Rūdolfs Mazurs [lv], Matej Urbančič [sl],
|
|
||||||
Balázs Úr [hu], Fran Dieguez [gl], Jordi Mas [ca], Anders Jonsson [sv],
|
|
||||||
Trần Ngọc Quân [vi], Tim Sabsch [de], Fabio Tomat [fur], Goran Vidović [hr],
|
|
||||||
Marek Černocký [cs]
|
|
||||||
|
|
||||||
3.33.91
|
|
||||||
=======
|
|
||||||
* Fix primary selection copy and paste between X11 and wayland [Hans; #702]
|
|
||||||
* Improve monitor hotplug support [Hans; !713]
|
|
||||||
* Remove a source of frame skips [Daniel; !719]
|
|
||||||
* Fix windows being lowered after unmaximizing with double click [Olivier; #88]
|
|
||||||
* Remove Clutter API for global grabs [Jonas D.; !536]
|
|
||||||
* Improve processing of incompressible events [Daniel; !711]
|
|
||||||
* Add xdg-output v3 support [Olivier; !704]
|
|
||||||
* Misc. bug fixes and cleanups [Jonas Å., Marco, Carlos, Adam, Albert, Niels,
|
|
||||||
Olivier, Florian; !722, !385, !728, !726, !500, !731, !727, !700, !735, !738]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Jonas Ådahl, Albert Vaca Cintora, Jonas Dreßler, Olivier Fourdan,
|
|
||||||
Carlos Garnacho, Hans de Goede, Niels De Graef, Adam Jackson, Florian Müllner,
|
|
||||||
Marco Trevisan (Treviño), Daniel van Vugt
|
|
||||||
|
|
||||||
Translators:
|
|
||||||
Asier Sarasua Garmendia [eu], Kukuh Syafaat [id], Florentina Mușat [ro],
|
|
||||||
Aurimas Černius [lt], Daniel Mustieles [es]
|
|
||||||
|
|
||||||
3.33.90
|
|
||||||
=======
|
|
||||||
* Fix visibility of clones with hidden source [Florian; #683]
|
|
||||||
* Reduce freezes when opening some popup windows [Carlos; #556]
|
|
||||||
* Be more thorough when excluding obscured areas from painting [Carlos; !698]
|
|
||||||
* Make it possible to start Xwayland on demand [Carlos; !709]
|
|
||||||
* clutter: Expose layout_manager to transitions [Florian; !716]
|
|
||||||
* Misc. bug fixes and cleanups [Mark, Florian, Iain, Niels, Carlos, Ray; !671,
|
|
||||||
!691, !694, !696, !703, !707, !697, !710, !708, !714, #719, !721]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Mark Blakeney, Carlos Garnacho, Niels De Graef, Iain Lane, Florian Müllner,
|
|
||||||
Ray Strode
|
|
||||||
|
|
||||||
Translators:
|
|
||||||
Asier Sarasua Garmendia [eu], Rafael Fontenelle [pt_BR], Fabio Tomat [fur],
|
|
||||||
Florentina Mușat [ro]
|
|
||||||
|
|
||||||
3.33.4
|
|
||||||
======
|
|
||||||
* Discard page flip retries on hotplug [Jonas; !630]
|
|
||||||
* Add xdg-output v2 support [Olivier; #645]
|
|
||||||
* Restore DRM format fallbacks [Jonas; !662]
|
|
||||||
* Don't emit ::size-changed when only position changed [Daniel; !568]
|
|
||||||
* Expose workspace layout properties [Florian; !618]
|
|
||||||
* Don't use grab modifiers when shortcuts are inhibited [Olivier; #642]
|
|
||||||
* Fix stuttering due to unchanged power save mode notifications [Georges; !674]
|
|
||||||
* Add API to reorder workspaces [Adam; !670]
|
|
||||||
* Make picking a new focus window more reliable [Marco; !669]
|
|
||||||
* Defer actor allocation till shown [Carlos; !677]
|
|
||||||
* Try to use primary GPU for copy instead of glReadPixels [Pekka; !615]
|
|
||||||
* Unset pointer focus when the cursor is hidden [Jonas D.; !448]
|
|
||||||
* Fix modifier-drag on wayland subsurfaces [Robert; !604]
|
|
||||||
* Fix background corruption on Nvidia after resuming from suspend [Daniel; !600]
|
|
||||||
* Only grab the locate-pointer key when necessary [Olivier; !685, #647]
|
|
||||||
* Misc. bug fixes and cleanups [Florian, Jonas, Daniel, Robert, Olivier,
|
|
||||||
Georges, Marco, Carlos, Emmanuele; !648, !650, !647, !656, !658, !637,
|
|
||||||
!663, !660, !659, !665, !666, !668, !667, #667, !676, !678, #672, !680,
|
|
||||||
!683, !688, !689, !687]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Jonas Ådahl, Emmanuele Bassi, Adam Bieńkowski, Piotr Drąg, Jonas Dreßler,
|
|
||||||
Olivier Fourdan, Carlos Garnacho, Robert Mader, Florian Müllner,
|
|
||||||
Georges Basile Stavracas Neto, Pekka Paalanen, Marco Trevisan (Treviño),
|
|
||||||
Daniel van Vugt
|
|
||||||
|
|
||||||
Translators:
|
|
||||||
Fabio Tomat [fur], Kukuh Syafaat [id]
|
|
||||||
|
|
||||||
3.33.3
|
|
||||||
======
|
|
||||||
* Prepare for running Xwayland on demand [Carlos; !420]
|
|
||||||
* Fix text selection color rendering [Florian; #494]
|
|
||||||
* Fix black shadows when using fractional scaling [Robert; #609]
|
|
||||||
* Honor startup sequence workspace on wayland [Carlos; gnome-shell#674]
|
|
||||||
* Only emit 'grab-op-end` signal after dropping grabs [Marco; !596]
|
|
||||||
* Add a Sysprof-based profiler [Jonas, Georges; !197, !603]
|
|
||||||
* Relax "xwayland-allow-grabs" setting [Olivier; #597]
|
|
||||||
* Implement locate-pointer accessibility feature [Olivier; !453]
|
|
||||||
* Implement mouse accessibility [Olivier; !512]
|
|
||||||
* Consolidate frame throttling [Daniel, Georges; !363]
|
|
||||||
* Fix setting blank cursor under wayland [Jonas; #630]
|
|
||||||
* Pixel-align OpenGL cursors [Jonas; !610]
|
|
||||||
* Handle returning from fullscreen/maximization better [Jonas; !621]
|
|
||||||
* Improve screencast support on multi-monitor systems [Georges; !623]
|
|
||||||
* Fix running X11 applications with sudo under wayland [Hans; #643]
|
|
||||||
* Implement toggle-keys notification [Olivier; #637]
|
|
||||||
* Add initial KMS transactional support [Jonas; !525]
|
|
||||||
* Improve finding new focus window when the old one is closed [Marco; #308]
|
|
||||||
* Misc. bug fixes and cleanups [Jonas, Carlos, Marco, Florian, Pekka, Robert,
|
|
||||||
Douglas, Georges, Daniel, Emil, Niels, Hans, Olivier, Ting-Wei, Corentin;
|
|
||||||
!591, #398, !592, !581, !597, !598, !593, !497, #591, !545, gtk#1675, !601,
|
|
||||||
#568, !564, !605, !609, !115, !214, !611, !617, !616, !619, !624, !622, !627,
|
|
||||||
!628, !629, !632, !633, !631, !636, !639, !638, !634, !640, !529, !644, !590]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Jonas Ådahl, Piotr Drąg, Olivier Fourdan, Carlos Garnacho, Hans de Goede,
|
|
||||||
Niels De Graef, Ting-Wei Lan, Robert Mader, Florian Müllner,
|
|
||||||
Georges Basile Stavracas Neto, Corentin Noël, Pekka Paalanen, Douglas R. Reno,
|
|
||||||
Marco Trevisan (Treviño), Emil Velikov, Daniel van Vugt
|
|
||||||
|
|
||||||
Translators:
|
|
||||||
Balázs Úr [hu], Daniel Mustieles [es], Nathan Follens [nl], Goran Vidović [hr]
|
|
||||||
|
|
||||||
3.33.2
|
|
||||||
======
|
|
||||||
* Fix rendering lag on Xorg [Daniel; !520, !281]
|
|
||||||
* Misc. bug fixes and cleanups [Carlos, Marco, Jonas D., Florian, Niels,
|
|
||||||
Daniel, Benjamin, Jonas Å., Ignacio, Vasilis; #598, !576, !547, !578,
|
|
||||||
!583, !582, !469, !524, !119, !571, !584, !585, !586, #425]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Jonas Ådahl, Benjamin Berg, Jonas Dreßler, Carlos Garnacho, Niels De Graef,
|
|
||||||
Vasilis Liaskovitis, Florian Müllner, Ignacio Casal Quinteiro,
|
|
||||||
Marco Trevisan (Treviño), Daniel van Vugt
|
|
||||||
|
|
||||||
Translators:
|
|
||||||
Daniel Mustieles [es]
|
|
||||||
|
|
||||||
3.33.1
|
|
||||||
======
|
|
||||||
* Remove unused APIs and outdated driver support
|
|
||||||
[Adam; !481, !468, !489, !487, !546]
|
|
||||||
* Enable EGL_IMG_context_priority [Adam; !454]
|
|
||||||
* Disable mouse keys with Numlock on [Olivier; #530]
|
|
||||||
* Fix crash when restarting on X11 [Marco; #576]
|
|
||||||
* Implement clipboard manager [Carlos; !320]
|
|
||||||
* Fix spurious idle signals that prevent session unblank [Jonas Å.; !543]
|
|
||||||
* Fix mapping of touchscreens that don't report dimensions [Carlos; #581]
|
|
||||||
* Fix propagating fractional scaling factor [Robert; !537]
|
|
||||||
* Add experimental RT scheduling support [Carlos; !460]
|
|
||||||
* Misc. bug fixes and cleanups [Robert, Carlos, Olivier, Ray, Marco, Jonas D.,
|
|
||||||
Georges, Daniel V., Daniel M; !467, !504, !551, !552, #575, #556, !557, !442,
|
|
||||||
!562, !535, !548, #586, !567, !396, !422, !507]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Jonas Ådahl, Piotr Drąg, Jonas Dreßler, Olivier Fourdan, Carlos Garnacho,
|
|
||||||
Adam Jackson, Robert Mader, Daniel García Moreno, Florian Müllner,
|
|
||||||
Georges Basile Stavracas Neto, Ray Strode, Marco Trevisan (Treviño),
|
|
||||||
Daniel van Vugt
|
|
||||||
|
|
||||||
Translators:
|
|
||||||
Daniel Mustieles [es], Fabio Tomat [fur], Kukuh Syafaat [id]
|
|
||||||
|
|
||||||
3.32.1
|
|
||||||
======
|
|
||||||
* Fix fallback app menu on wayland [Florian; #493]
|
|
||||||
* Fix elogind support [Tom; !491]
|
|
||||||
* Fix startup notifications not timing out [Carlos; #501]
|
|
||||||
* Fix keyboard accessibility toggle from keys
|
|
||||||
[Olivier, Carlos; !501, #529, !531]
|
|
||||||
* Fix touchscreen input on rotated displays [Carlos; #514]
|
|
||||||
* Work around hangul text input bug [Carlos; #1365]
|
|
||||||
* Fix blurry wallpaper scaling [Daniel; !505]
|
|
||||||
* Fix placement of window menu when using fractional scaling [Jan; #527]
|
|
||||||
* Fix repaint issues of offscreen effects on secondary monitors [Daniel; !511]
|
|
||||||
* Fix windows not getting focus after launch [Daniel; #505]
|
|
||||||
* Properly advertise support for 'underscan' property [Jonas; !507]
|
|
||||||
* Improve power-saving handling [Jonas; !506]
|
|
||||||
* Fix moving windows by super+touch [Jonas D.; !495]
|
|
||||||
* Misc. bug fixes and cleanups [Benjamin, Florian, Adam, Marco, Pablo,
|
|
||||||
Erik, Jonas, Heiher, Pekka, Daniel, Olivier, Carlos; !478, !475, !480,
|
|
||||||
!482, #490, !488, #491, #480, !477, !496, !492, !485, !515, !519, !521,
|
|
||||||
!216, !538, #541, #523]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Jonas Ådahl, Pablo Barciela, Benjamin Berg, Tom Briden, Jonas Dreßler,
|
|
||||||
Olivier Fourdan, Carlos Garnacho, Jan Alexander Steffens (heftig), Heiher,
|
|
||||||
Adam Jackson, Erik Kurzinger, Florian Müllner, Pekka Paalanen,
|
|
||||||
Marco Trevisan (Treviño), Daniel van Vugt
|
|
||||||
|
|
||||||
Translators:
|
|
||||||
Khaled Hosny [ar], Goran Vidović [hr], Daniel Mustieles [es]
|
|
||||||
|
|
||||||
3.32.0
|
|
||||||
======
|
|
||||||
* Fix deadlock when cancelling a theme sound [Andrea; !474]
|
|
||||||
* Stop swizzling BGRA buffers (bye-bye inverted colors in screenshots
|
|
||||||
and animations) [Carlos; !486]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Andrea Azzarone, Carlos Garnacho, Robert Mader
|
|
||||||
|
|
||||||
3.31.92
|
|
||||||
=======
|
|
||||||
* Fix flicker of apps that use multiple SHM buffers [Jonas Å.; #199]
|
|
||||||
* Don't disable page flips after temporary failues [Jonas Å.; #460]
|
|
||||||
* Improve redraw performance [Carlos; !196]
|
|
||||||
* Add cursor-mode support to window screencasting [Jonas Å.; !413]
|
|
||||||
* Add back support for system-wide monitor configurations [Jonas Å.; !253]
|
|
||||||
* Add fractional scaling support [Marco, Jonas Å.; !3]
|
|
||||||
* Consider remapped keys when guessing keycode from keysym [Andrea; #443]
|
|
||||||
* Stop turning on-screen-keyboard off on focus changes [Carlos; !432]
|
|
||||||
* Fix crashes [Robert, Carlos, Jonas D., Florian; !447, #361, !426, #479]
|
|
||||||
* Misc. bug fixes and cleanups [Benjamin, Adam, Olivier, Niels, Piotr; !457,
|
|
||||||
!452, !459, !380, !361, !461, !464, !471, !473, !463]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Jonas Ådahl, Andrea Azzarone, Benjamin Berg, Piotr Drąg, Jonas Dreßler,
|
|
||||||
Olivier Fourdan, Carlos Garnacho, Niels De Graef, Adam Jackson, Robert Mader,
|
|
||||||
Florian Müllner, Marco Trevisan (Treviño)
|
|
||||||
|
|
||||||
Translators:
|
|
||||||
Milo Casagrande [it], Tim Sabsch [de], Trần Ngọc Quân [vi],
|
|
||||||
Gwan-gyeong Mun [ko], Марко Костић [sr], Daniel Mustieles [es],
|
|
||||||
Rūdolfs Mazurs [lv], Nathan Follens [nl]
|
|
||||||
|
|
||||||
3.31.91
|
|
||||||
=======
|
|
||||||
* Fix infinite loop in EDID matching [Marco; #459]
|
|
||||||
* wayland: Don't resetin text-input state prematurely [Carlos; !410]
|
|
||||||
* wayland: Don't maximize windows if minimum size is too big [Olivier; #463]
|
|
||||||
* Fix crash when using "restore shortcuts" without focus window [Olivier; #464]
|
|
||||||
* Add flag parameter to grab accelerator API [Andrea; !169]
|
|
||||||
* Reuse old CRTC if possible to avoid flicker on hotplug [Pekka, Emilio; #373]
|
|
||||||
* Misc. bug fixes and cleanups [Marco, Jonas, Niels, Adam, Olivier; !436,
|
|
||||||
!421, #462, !439, !440, !444, !321, !445, !456]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Jonas Ådahl, Andrea Azzarone, Olivier Fourdan, Carlos Garnacho,
|
|
||||||
Niels De Graef, Adam Jackson, Emilio Pozuelo Monfort, Pekka Paalanen,
|
|
||||||
Marco Trevisan (Treviño)
|
|
||||||
|
|
||||||
Translators:
|
|
||||||
Jiri Grönroos [fi], Charles Monzat [fr], Claude Paroz [fr], Fran Dieguez [gl],
|
|
||||||
Emin Tufan Çetin [tr], Aurimas Černius [lt], Anders Jonsson [sv],
|
|
||||||
Matej Urbančič [sl], Marek Cernocky [cs], Daniel Șerbănescu [ro],
|
|
||||||
Alan Mortensen [da], Baurzhan Muftakhidinov [kk], Yi-Jyun Pan [zh_TW],
|
|
||||||
Daniel Mustieles [es], Rafael Fontenelle [pt_BR]
|
|
||||||
|
|
||||||
3.31.90
|
|
||||||
=======
|
|
||||||
* Fix support of extended characters in on-screen keyboard [Andrea; #109]
|
|
||||||
* Improve selection of the primary GPU [Pekka, Emilio; !271]
|
|
||||||
* Screen-cast cursor updates as PipeWire stream metadata [Jonas; !357]
|
|
||||||
* Fix rendering glitches in magnifier [Daniel; gnome-shell#387]
|
|
||||||
* Fix monitor recording on HiDPI [Jonas; !415]
|
|
||||||
* Honour secondary GPU supported pixel formats [Pekka; !341]
|
|
||||||
* Fall back to CPU copy path when using a software renderer [Emilio; !325]
|
|
||||||
* Remove fallback app menu [Florian; gnome-shell#624]
|
|
||||||
* wayland: Add support for viewporter protocol [Robert; !323]
|
|
||||||
* Misc. bug fixes and cleanups [Florian, Carlos, Olivier, Marco, Robert,
|
|
||||||
Daniel, Pekka, Jonas, Ole, Georges; !391, #335, #442, !406, !395, #447,
|
|
||||||
!375, gnome-shell#349, #451, !416, #784199, !408, !181, !405]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Jonas Ådahl, Andrea Azzarone, Ole Jørgen Brønner, Piotr Drąg, Olivier Fourdan,
|
|
||||||
Dariusz Gadomski, Carlos Garnacho, Antoine Jacoutot, Iain Lane, Robert Mader,
|
|
||||||
Emilio Pozuelo Monfort, Florian Müllner, Georges Basile Stavracas Neto,
|
|
||||||
Pekka Paalanen, Marco Trevisan (Treviño), Josh Triplett, Daniel van Vugt
|
|
||||||
|
|
||||||
Translators:
|
|
||||||
Fabio Tomat [fur], Balázs Úr [hu], Daniel Mustieles [es], Kukuh Syafaat [id],
|
|
||||||
Jordi Mas [ca], Piotr Drąg [pl]
|
|
||||||
|
|
||||||
3.31.4
|
|
||||||
======
|
|
||||||
* keybindings: Limit corner move to current monitor [Jānis; #320]
|
|
||||||
* xdg-output: Report rotated physical dimensions [Olivier; #369]
|
|
||||||
* Add continuous integration pipeline [Jonas; #193]
|
|
||||||
* Improve performance on secondary GPUs [Pekka; #323, !313]
|
|
||||||
* Use the actual hardware refresh rate [Daniel; #781296]
|
|
||||||
* Remove hide-titlebar-when-maximized support [Florian; !221]
|
|
||||||
* wayland: Implement buffer transforms [Robert; !322]
|
|
||||||
* Remove ability to externally set sync-to-vblank [Georges; !191]
|
|
||||||
* Turn off touchscreens together with DPMS [Carlos; gnome-settings-daemon#29]
|
|
||||||
* Mipmap the wallpaper when shrinking [Daniel; gnome-shell#254]
|
|
||||||
* Implement RecordWindow method for screen-casts [Olivier; !306]
|
|
||||||
* Fix EGLStream texture downloading [Jonas; !362]
|
|
||||||
* Split out display-server-specific code from MetaWindowActor [Georges; !368]
|
|
||||||
* Improve render performance on some KMS devices with software GL [Jonas; #106]
|
|
||||||
* Fix damage area of transformed surfaces [Robert; !366]
|
|
||||||
* Remove autotools support [George]
|
|
||||||
* Misc. bug fixes and cleanups [Jonas, Alan, Olivier, Carlos, Javier, Peter,
|
|
||||||
Daniel, Robert, Florian; !309, #790207, #272, #393, #276, #404, #104, !343,
|
|
||||||
#765011, #786663, #342, !356, #414, #782344, #781034, #423, !374, !382, !383]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Jonas Ådahl, Nikita Churaev, Alan Coopersmith, Jānis Džeriņš, Olivier Fourdan,
|
|
||||||
Carlos Garnacho, Niels De Graef, Peter Hutterer, Javier Jardón,
|
|
||||||
Abderrahim Kitouni, Andre Klapper, Ting-Wei Lan, Robert Mader,
|
|
||||||
Emilio Pozuelo Monfort, Florian Müllner, Georges Basile Stavracas Neto,
|
|
||||||
Pekka Paalanen, Daniel Stone, Marco Trevisan (Treviño), Daniel van Vugt
|
|
||||||
|
|
||||||
3.31.2
|
3.31.2
|
||||||
======
|
======
|
||||||
* Fix handling of non-UTF8 encodings [Florian; !227]
|
* Fix handling of non-UTF8 encodings [Florian; !227]
|
||||||
|
14
README.md
14
README.md
@@ -22,20 +22,6 @@ by Gala, elementary OS's window manager. It can also be run standalone, using
|
|||||||
the command "mutter", but just running plain mutter is only intended for
|
the command "mutter", but just running plain mutter is only intended for
|
||||||
debugging purposes.
|
debugging purposes.
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
To contribute, open merge requests at https://gitlab.gnome.org/GNOME/mutter.
|
|
||||||
|
|
||||||
The coding style used is primarily the GNU flavor of the [GNOME coding
|
|
||||||
style](https://developer.gnome.org/programming-guidelines/stable/c-coding-style.html.en)
|
|
||||||
with some minor additions such as preferring `stdint.h` types over GLib
|
|
||||||
fundamental types, and a soft 80 character line limit. However, in general,
|
|
||||||
look at the file you're editing for inspiration.
|
|
||||||
|
|
||||||
Commit messages should follow the [GNOME commit message
|
|
||||||
guidelines](https://wiki.gnome.org/Git/CommitMessages). We require an URL
|
|
||||||
to either an issue or a merge request in each commit.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Mutter is distributed under the terms of the GNU General Public License,
|
Mutter is distributed under the terms of the GNU General Public License,
|
||||||
|
28
autogen.sh
Executable file
28
autogen.sh
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/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
|
49
clutter/Makefile.am
Normal file
49
clutter/Makefile.am
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
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
clutter/build/Makefile.am
Normal file
1
clutter/build/Makefile.am
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SUBDIRS = autotools
|
8
clutter/build/autotools/.gitignore
vendored
Normal file
8
clutter/build/autotools/.gitignore
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
gtk-doc.m4
|
||||||
|
libtool.m4
|
||||||
|
ltoptions.m4
|
||||||
|
ltsugar.m4
|
||||||
|
ltversion.m4
|
||||||
|
lt~obsolete.m4
|
||||||
|
shave
|
||||||
|
shave-libtool
|
10
clutter/build/autotools/Makefile.am
Normal file
10
clutter/build/autotools/Makefile.am
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
NULL =
|
||||||
|
|
||||||
|
EXTRA_DIST = \
|
||||||
|
introspection.m4 \
|
||||||
|
as-compiler-flag.m4 \
|
||||||
|
glibtests.m4 \
|
||||||
|
glib-tap.mk \
|
||||||
|
tap-driver.sh \
|
||||||
|
tap-test \
|
||||||
|
$(NULL)
|
62
clutter/build/autotools/as-compiler-flag.m4
Normal file
62
clutter/build/autotools/as-compiler-flag.m4
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
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"
|
||||||
|
])
|
||||||
|
|
134
clutter/build/autotools/glib-tap.mk
Normal file
134
clutter/build/autotools/glib-tap.mk
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
# 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
|
28
clutter/build/autotools/glibtests.m4
Normal file
28
clutter/build/autotools/glibtests.m4
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
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
|
||||||
|
])
|
96
clutter/build/autotools/introspection.m4
Normal file
96
clutter/build/autotools/introspection.m4
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
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])
|
||||||
|
])
|
652
clutter/build/autotools/tap-driver.sh
Executable file
652
clutter/build/autotools/tap-driver.sh
Executable file
@@ -0,0 +1,652 @@
|
|||||||
|
#! /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:
|
5
clutter/build/autotools/tap-test
Executable file
5
clutter/build/autotools/tap-test
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
# run a GTest in tap mode. The test binary is passed as $1
|
||||||
|
|
||||||
|
$1 -k --tap
|
672
clutter/clutter/Makefile.am
Normal file
672
clutter/clutter/Makefile.am
Normal file
@@ -0,0 +1,672 @@
|
|||||||
|
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-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-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-cairo-texture.h \
|
||||||
|
deprecated/clutter-container.h \
|
||||||
|
deprecated/clutter-input-device.h \
|
||||||
|
deprecated/clutter-keysyms.h \
|
||||||
|
deprecated/clutter-main.h \
|
||||||
|
deprecated/clutter-rectangle.h \
|
||||||
|
deprecated/clutter-stage-manager.h \
|
||||||
|
deprecated/clutter-stage.h \
|
||||||
|
deprecated/clutter-texture.h \
|
||||||
|
deprecated/clutter-timeline.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-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-cairo-texture.c \
|
||||||
|
deprecated/clutter-input-device-deprecated.c \
|
||||||
|
deprecated/clutter-layout-manager-deprecated.c \
|
||||||
|
deprecated/clutter-rectangle.c \
|
||||||
|
deprecated/clutter-texture.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) \
|
||||||
|
$(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)
|
52
clutter/clutter/Makefile.am.enums
Normal file
52
clutter/clutter/Makefile.am.enums
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# 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
|
54
clutter/clutter/Makefile.am.marshal
Normal file
54
clutter/clutter/Makefile.am.marshal
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
# 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
|
@@ -737,7 +737,11 @@ cally_actor_grab_focus (AtkComponent *component)
|
|||||||
*
|
*
|
||||||
* This gets the top level origin, it is, the position of the stage in
|
* This gets the top level origin, it is, the position of the stage in
|
||||||
* the global screen. You can see it as the absolute display position
|
* the global screen. You can see it as the absolute display position
|
||||||
* of the stage. This is 0,0 for a compositor.
|
* of the stage.
|
||||||
|
*
|
||||||
|
* FIXME: only the case with x11 is implemented, other backends are
|
||||||
|
* required
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_cally_actor_get_top_level_origin (ClutterActor *actor,
|
_cally_actor_get_top_level_origin (ClutterActor *actor,
|
||||||
@@ -745,11 +749,54 @@ _cally_actor_get_top_level_origin (ClutterActor *actor,
|
|||||||
gint *yp)
|
gint *yp)
|
||||||
{
|
{
|
||||||
/* default values */
|
/* default values */
|
||||||
|
gint x = 0;
|
||||||
|
gint y = 0;
|
||||||
|
|
||||||
|
#ifdef CLUTTER_WINDOWING_X11
|
||||||
|
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
|
||||||
|
{
|
||||||
|
ClutterActor *stage = NULL;
|
||||||
|
Display *display = NULL;
|
||||||
|
Window root_window;
|
||||||
|
Window stage_window;
|
||||||
|
Window child;
|
||||||
|
gint return_val = 0;
|
||||||
|
|
||||||
|
stage = clutter_actor_get_stage (actor);
|
||||||
|
|
||||||
|
/* FIXME: what happens if you use another display with
|
||||||
|
clutter_backend_x11_set_display ?*/
|
||||||
|
display = clutter_x11_get_default_display ();
|
||||||
|
root_window = clutter_x11_get_root_window ();
|
||||||
|
stage_window = clutter_x11_get_stage_window (CLUTTER_STAGE (stage));
|
||||||
|
|
||||||
|
return_val = XTranslateCoordinates (display, stage_window, root_window,
|
||||||
|
0, 0, &x, &y,
|
||||||
|
&child);
|
||||||
|
|
||||||
|
if (!return_val)
|
||||||
|
g_warning ("[x11] We were not able to get proper absolute "
|
||||||
|
"position of the stage");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
static gboolean yet_warned = FALSE;
|
||||||
|
|
||||||
|
if (!yet_warned)
|
||||||
|
{
|
||||||
|
yet_warned = TRUE;
|
||||||
|
|
||||||
|
g_warning ("The current Clutter backend does not support using "
|
||||||
|
"atk_component_get_extents() with ATK_XY_SCREEN.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (xp)
|
if (xp)
|
||||||
*xp = 0;
|
*xp = x;
|
||||||
|
|
||||||
if (yp)
|
if (yp)
|
||||||
*yp = 0;
|
*yp = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* AtkAction implementation */
|
/* AtkAction implementation */
|
||||||
@@ -997,8 +1044,10 @@ _cally_actor_clean_action_list (CallyActor *cally_actor)
|
|||||||
|
|
||||||
if (priv->action_list)
|
if (priv->action_list)
|
||||||
{
|
{
|
||||||
g_list_free_full (priv->action_list,
|
g_list_foreach (priv->action_list,
|
||||||
(GDestroyNotify) _cally_actor_destroy_action_info);
|
(GFunc) _cally_actor_destroy_action_info,
|
||||||
|
NULL);
|
||||||
|
g_list_free (priv->action_list);
|
||||||
priv->action_list = NULL;
|
priv->action_list = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,147 +0,0 @@
|
|||||||
/* CALLY - The Clutter Accessibility Implementation Library
|
|
||||||
*
|
|
||||||
* Copyright (C) 2008 Igalia, S.L.
|
|
||||||
*
|
|
||||||
* Author: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
|
|
||||||
*
|
|
||||||
* Based on GailContainer from GAIL
|
|
||||||
* Copyright 2001, 2002, 2003 Sun Microsystems Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the
|
|
||||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
||||||
* Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SECTION:cally-group
|
|
||||||
* @Title: CallyGroup
|
|
||||||
* @short_description: Implementation of the ATK interfaces for a #ClutterGroup
|
|
||||||
* @see_also: #ClutterGroup
|
|
||||||
*
|
|
||||||
* #CallyGroup implements the required ATK interfaces of #ClutterGroup
|
|
||||||
* In particular it exposes each of the Clutter actors contained in the
|
|
||||||
* group.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "clutter-build-config.h"
|
|
||||||
|
|
||||||
#include "cally-group.h"
|
|
||||||
#include "cally-actor-private.h"
|
|
||||||
|
|
||||||
static gint cally_group_get_n_children (AtkObject *obj);
|
|
||||||
static AtkObject* cally_group_ref_child (AtkObject *obj,
|
|
||||||
gint i);
|
|
||||||
static void cally_group_real_initialize (AtkObject *obj,
|
|
||||||
gpointer data);
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (CallyGroup, cally_group, CALLY_TYPE_ACTOR)
|
|
||||||
|
|
||||||
static void
|
|
||||||
cally_group_class_init (CallyGroupClass *klass)
|
|
||||||
{
|
|
||||||
/* GObjectClass *gobject_class = G_OBJECT_CLASS (klass); */
|
|
||||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
|
||||||
|
|
||||||
class->get_n_children = cally_group_get_n_children;
|
|
||||||
class->ref_child = cally_group_ref_child;
|
|
||||||
class->initialize = cally_group_real_initialize;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
cally_group_init (CallyGroup *group)
|
|
||||||
{
|
|
||||||
/* nothing to do yet */
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* cally_group_new:
|
|
||||||
* @actor: a #ClutterGroup
|
|
||||||
*
|
|
||||||
* Creates a #CallyGroup for @actor
|
|
||||||
*
|
|
||||||
* Return value: the newly created #CallyGroup
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
*/
|
|
||||||
AtkObject *
|
|
||||||
cally_group_new (ClutterActor *actor)
|
|
||||||
{
|
|
||||||
GObject *object = NULL;
|
|
||||||
AtkObject *accessible = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_GROUP (actor), NULL);
|
|
||||||
|
|
||||||
object = g_object_new (CALLY_TYPE_GROUP, NULL);
|
|
||||||
|
|
||||||
accessible = ATK_OBJECT (object);
|
|
||||||
atk_object_initialize (accessible, actor);
|
|
||||||
|
|
||||||
return accessible;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gint
|
|
||||||
cally_group_get_n_children (AtkObject *obj)
|
|
||||||
{
|
|
||||||
ClutterActor *actor = NULL;
|
|
||||||
gint count = 0;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CALLY_IS_GROUP (obj), count);
|
|
||||||
|
|
||||||
actor = CALLY_GET_CLUTTER_ACTOR (obj);
|
|
||||||
|
|
||||||
if (actor == NULL) /* defunct */
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_GROUP(actor), count);
|
|
||||||
|
|
||||||
count = clutter_actor_get_n_children (actor);
|
|
||||||
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
|
|
||||||
static AtkObject*
|
|
||||||
cally_group_ref_child (AtkObject *obj,
|
|
||||||
gint i)
|
|
||||||
{
|
|
||||||
AtkObject *accessible = NULL;
|
|
||||||
ClutterActor *actor = NULL;
|
|
||||||
ClutterActor *child = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CALLY_IS_GROUP (obj), NULL);
|
|
||||||
g_return_val_if_fail ((i >= 0), NULL);
|
|
||||||
|
|
||||||
actor = CALLY_GET_CLUTTER_ACTOR (obj);
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_GROUP(actor), NULL);
|
|
||||||
child = clutter_actor_get_child_at_index (actor, i);
|
|
||||||
|
|
||||||
if (!child)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
accessible = clutter_actor_get_accessible (child);
|
|
||||||
|
|
||||||
if (accessible != NULL)
|
|
||||||
g_object_ref (accessible);
|
|
||||||
|
|
||||||
return accessible;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
cally_group_real_initialize (AtkObject *obj,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
ATK_OBJECT_CLASS (cally_group_parent_class)->initialize (obj, data);
|
|
||||||
|
|
||||||
obj->role = ATK_ROLE_PANEL;
|
|
||||||
}
|
|
@@ -1,87 +0,0 @@
|
|||||||
/* CALLY - The Clutter Accessibility Implementation Library
|
|
||||||
*
|
|
||||||
* Copyright (C) 2008 Igalia, S.L.
|
|
||||||
*
|
|
||||||
* Author: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
|
|
||||||
*
|
|
||||||
* Based on GailContainer from GAIL
|
|
||||||
* Copyright 2001, 2002, 2003 Sun Microsystems Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __CALLY_GROUP_H__
|
|
||||||
#define __CALLY_GROUP_H__
|
|
||||||
|
|
||||||
#if !defined(__CALLY_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
|
||||||
#error "Only <cally/cally.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cally/cally-actor.h>
|
|
||||||
#include <clutter/clutter.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define CALLY_TYPE_GROUP (cally_group_get_type ())
|
|
||||||
#define CALLY_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALLY_TYPE_GROUP, CallyGroup))
|
|
||||||
#define CALLY_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CALLY_TYPE_GROUP, CallyGroupClass))
|
|
||||||
#define CALLY_IS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CALLY_TYPE_GROUP))
|
|
||||||
#define CALLY_IS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CALLY_TYPE_GROUP))
|
|
||||||
#define CALLY_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CALLY_TYPE_GROUP, CallyGroupClass))
|
|
||||||
|
|
||||||
typedef struct _CallyGroup CallyGroup;
|
|
||||||
typedef struct _CallyGroupClass CallyGroupClass;
|
|
||||||
typedef struct _CallyGroupPrivate CallyGroupPrivate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* CallyGroup:
|
|
||||||
*
|
|
||||||
* The <structname>CallyGroup</structname> structure contains only
|
|
||||||
* private data and should be accessed using the provided API
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
*/
|
|
||||||
struct _CallyGroup
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
CallyActor parent;
|
|
||||||
|
|
||||||
CallyGroupPrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* CallyGroupClass:
|
|
||||||
*
|
|
||||||
* The <structname>CallyGroupClass</structname> structure contains only
|
|
||||||
* private data
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
*/
|
|
||||||
struct _CallyGroupClass
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
CallyActorClass parent_class;
|
|
||||||
|
|
||||||
/* padding for future expansion */
|
|
||||||
gpointer _padding_dummy[8];
|
|
||||||
};
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
GType cally_group_get_type (void) G_GNUC_CONST;
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
AtkObject* cally_group_new (ClutterActor *actor);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __CALLY_GROUP_H__ */
|
|
@@ -63,7 +63,7 @@ struct _CallyStagePrivate
|
|||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (CallyStage,
|
G_DEFINE_TYPE_WITH_CODE (CallyStage,
|
||||||
cally_stage,
|
cally_stage,
|
||||||
CALLY_TYPE_GROUP,
|
CALLY_TYPE_ACTOR,
|
||||||
G_ADD_PRIVATE (CallyStage)
|
G_ADD_PRIVATE (CallyStage)
|
||||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_WINDOW,
|
G_IMPLEMENT_INTERFACE (ATK_TYPE_WINDOW,
|
||||||
cally_stage_window_interface_init));
|
cally_stage_window_interface_init));
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
#error "Only <cally/cally.h> can be included directly."
|
#error "Only <cally/cally.h> can be included directly."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <cally/cally-group.h>
|
#include <cally/cally-actor.h>
|
||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
@@ -52,7 +52,7 @@ typedef struct _CallyStagePrivate CallyStagePrivate;
|
|||||||
struct _CallyStage
|
struct _CallyStage
|
||||||
{
|
{
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
CallyGroup parent;
|
CallyActor parent;
|
||||||
|
|
||||||
CallyStagePrivate *priv;
|
CallyStagePrivate *priv;
|
||||||
};
|
};
|
||||||
@@ -68,7 +68,7 @@ struct _CallyStage
|
|||||||
struct _CallyStageClass
|
struct _CallyStageClass
|
||||||
{
|
{
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
CallyGroupClass parent_class;
|
CallyActorClass parent_class;
|
||||||
|
|
||||||
/* padding for future expansion */
|
/* padding for future expansion */
|
||||||
gpointer _padding_dummy[16];
|
gpointer _padding_dummy[16];
|
||||||
|
@@ -36,7 +36,6 @@
|
|||||||
#include "cally.h"
|
#include "cally.h"
|
||||||
|
|
||||||
#include "cally-actor.h"
|
#include "cally-actor.h"
|
||||||
#include "cally-group.h"
|
|
||||||
#include "cally-stage.h"
|
#include "cally-stage.h"
|
||||||
#include "cally-text.h"
|
#include "cally-text.h"
|
||||||
#include "cally-texture.h"
|
#include "cally-texture.h"
|
||||||
@@ -53,7 +52,6 @@
|
|||||||
|
|
||||||
/* factories initialization*/
|
/* factories initialization*/
|
||||||
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_ACTOR, cally_actor, cally_actor_new)
|
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_ACTOR, cally_actor, cally_actor_new)
|
||||||
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_GROUP, cally_group, cally_group_new)
|
|
||||||
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_STAGE, cally_stage, cally_stage_new)
|
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_STAGE, cally_stage, cally_stage_new)
|
||||||
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_TEXT, cally_text, cally_text_new)
|
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_TEXT, cally_text, cally_text_new)
|
||||||
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_TEXTURE, cally_texture, cally_texture_new)
|
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_TEXTURE, cally_texture, cally_texture_new)
|
||||||
@@ -75,7 +73,6 @@ cally_accessibility_init (void)
|
|||||||
{
|
{
|
||||||
/* setting the factories */
|
/* setting the factories */
|
||||||
CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_ACTOR, cally_actor);
|
CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_ACTOR, cally_actor);
|
||||||
CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_GROUP, cally_group);
|
|
||||||
CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_STAGE, cally_stage);
|
CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_STAGE, cally_stage);
|
||||||
CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_TEXT, cally_text);
|
CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_TEXT, cally_text);
|
||||||
CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_TEXTURE, cally_texture);
|
CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_TEXTURE, cally_texture);
|
||||||
|
@@ -26,7 +26,6 @@
|
|||||||
#include "cally-actor.h"
|
#include "cally-actor.h"
|
||||||
#include "cally-clone.h"
|
#include "cally-clone.h"
|
||||||
#include "cally-factory.h"
|
#include "cally-factory.h"
|
||||||
#include "cally-group.h"
|
|
||||||
#include "cally-main.h"
|
#include "cally-main.h"
|
||||||
#include "cally-rectangle.h"
|
#include "cally-rectangle.h"
|
||||||
#include "cally-root.h"
|
#include "cally-root.h"
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
#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,7 +5,6 @@
|
|||||||
#include "clutter-types.h"
|
#include "clutter-types.h"
|
||||||
#include "clutter-interval.h"
|
#include "clutter-interval.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
#include "clutter-actor-box-private.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_actor_box_new:
|
* clutter_actor_box_new:
|
||||||
@@ -543,78 +542,6 @@ clutter_actor_box_set_size (ClutterActorBox *box,
|
|||||||
box->y2 = box->y1 + height;
|
box->y2 = box->y1 + height;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
_clutter_actor_box_enlarge_for_effects (ClutterActorBox *box)
|
|
||||||
{
|
|
||||||
float width, height;
|
|
||||||
|
|
||||||
/* The aim here is that for a given rectangle defined with floating point
|
|
||||||
* coordinates we want to determine a stable quantized size in pixels
|
|
||||||
* that doesn't vary due to the original box's sub-pixel position.
|
|
||||||
*
|
|
||||||
* The reason this is important is because effects will use this
|
|
||||||
* API to determine the size of offscreen framebuffers and so for
|
|
||||||
* a fixed-size object that may be animated accross the screen we
|
|
||||||
* want to make sure that the stage paint-box has an equally stable
|
|
||||||
* size so that effects aren't made to continuously re-allocate
|
|
||||||
* a corresponding fbo.
|
|
||||||
*
|
|
||||||
* The other thing we consider is that the calculation of this box is
|
|
||||||
* subject to floating point precision issues that might be slightly
|
|
||||||
* different to the precision issues involved with actually painting the
|
|
||||||
* actor, which might result in painting slightly leaking outside the
|
|
||||||
* user's calculated paint-volume. For this we simply aim to pad out the
|
|
||||||
* paint-volume by at least half a pixel all the way around.
|
|
||||||
*/
|
|
||||||
width = box->x2 - box->x1;
|
|
||||||
height = box->y2 - box->y1;
|
|
||||||
width = CLUTTER_NEARBYINT (width);
|
|
||||||
height = CLUTTER_NEARBYINT (height);
|
|
||||||
/* XXX: NB the width/height may now be up to 0.5px too small so we
|
|
||||||
* must also pad by 0.25px all around to account for this. In total we
|
|
||||||
* must padd by at least 0.75px around all sides. */
|
|
||||||
|
|
||||||
/* XXX: The furthest that we can overshoot the bottom right corner by
|
|
||||||
* here is 1.75px in total if you consider that the 0.75 padding could
|
|
||||||
* just cross an integer boundary and so ceil will effectively add 1.
|
|
||||||
*/
|
|
||||||
box->x2 = ceilf (box->x2 + 0.75);
|
|
||||||
box->y2 = ceilf (box->y2 + 0.75);
|
|
||||||
|
|
||||||
/* Now we redefine the top-left relative to the bottom right based on the
|
|
||||||
* rounded width/height determined above + a constant so that the overall
|
|
||||||
* size of the box will be stable and not dependant on the box's
|
|
||||||
* position.
|
|
||||||
*
|
|
||||||
* Adding 3px to the width/height will ensure we cover the maximum of
|
|
||||||
* 1.75px padding on the bottom/right and still ensure we have > 0.75px
|
|
||||||
* padding on the top/left.
|
|
||||||
*/
|
|
||||||
box->x1 = box->x2 - width - 3;
|
|
||||||
box->y1 = box->y2 - height - 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_actor_box_scale:
|
|
||||||
* @box: a #ClutterActorBox
|
|
||||||
* @scale: scale factor for resizing this box
|
|
||||||
*
|
|
||||||
* Rescale the @box by provided @scale factor.
|
|
||||||
*
|
|
||||||
* Since: 1.6
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_actor_box_scale (ClutterActorBox *box,
|
|
||||||
gfloat scale)
|
|
||||||
{
|
|
||||||
g_return_if_fail (box != NULL);
|
|
||||||
|
|
||||||
box->x1 *= scale;
|
|
||||||
box->x2 *= scale;
|
|
||||||
box->y1 *= scale;
|
|
||||||
box->y2 *= scale;
|
|
||||||
}
|
|
||||||
|
|
||||||
G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterActorBox, clutter_actor_box,
|
G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterActorBox, clutter_actor_box,
|
||||||
clutter_actor_box_copy,
|
clutter_actor_box_copy,
|
||||||
clutter_actor_box_free,
|
clutter_actor_box_free,
|
||||||
|
@@ -577,7 +577,8 @@ _clutter_meta_group_clear_metas (ClutterMetaGroup *group)
|
|||||||
{
|
{
|
||||||
g_list_foreach (group->meta, (GFunc) _clutter_actor_meta_set_actor, NULL);
|
g_list_foreach (group->meta, (GFunc) _clutter_actor_meta_set_actor, NULL);
|
||||||
|
|
||||||
g_list_free_full (group->meta, g_object_unref);
|
g_list_foreach (group->meta, (GFunc) g_object_unref, NULL);
|
||||||
|
g_list_free (group->meta);
|
||||||
group->meta = NULL;
|
group->meta = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -53,8 +53,7 @@ typedef enum
|
|||||||
* Controls some options for how clutter_actor_traverse() iterates
|
* Controls some options for how clutter_actor_traverse() iterates
|
||||||
* through the graph.
|
* through the graph.
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST = 1L<<0,
|
CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST = 1L<<0,
|
||||||
CLUTTER_ACTOR_TRAVERSE_BREADTH_FIRST = 1L<<1
|
CLUTTER_ACTOR_TRAVERSE_BREADTH_FIRST = 1L<<1
|
||||||
} ClutterActorTraverseFlags;
|
} ClutterActorTraverseFlags;
|
||||||
@@ -75,8 +74,7 @@ typedef enum
|
|||||||
* the continuing traversal. It may stop traversal completely, just
|
* the continuing traversal. It may stop traversal completely, just
|
||||||
* skip over children for the current actor or continue as normal.
|
* skip over children for the current actor or continue as normal.
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_ACTOR_TRAVERSE_VISIT_CONTINUE = 1L<<0,
|
CLUTTER_ACTOR_TRAVERSE_VISIT_CONTINUE = 1L<<0,
|
||||||
CLUTTER_ACTOR_TRAVERSE_VISIT_SKIP_CHILDREN = 1L<<1,
|
CLUTTER_ACTOR_TRAVERSE_VISIT_SKIP_CHILDREN = 1L<<1,
|
||||||
CLUTTER_ACTOR_TRAVERSE_VISIT_BREAK = 1L<<2
|
CLUTTER_ACTOR_TRAVERSE_VISIT_BREAK = 1L<<2
|
||||||
@@ -242,6 +240,9 @@ ClutterAnimationInfo * _clutter_actor_get_animation_info
|
|||||||
ClutterTransition * _clutter_actor_create_transition (ClutterActor *self,
|
ClutterTransition * _clutter_actor_create_transition (ClutterActor *self,
|
||||||
GParamSpec *pspec,
|
GParamSpec *pspec,
|
||||||
...);
|
...);
|
||||||
|
ClutterTransition * _clutter_actor_get_transition (ClutterActor *self,
|
||||||
|
GParamSpec *pspec);
|
||||||
|
|
||||||
gboolean _clutter_actor_foreach_child (ClutterActor *self,
|
gboolean _clutter_actor_foreach_child (ClutterActor *self,
|
||||||
ClutterForeachCallback callback,
|
ClutterForeachCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
@@ -274,14 +275,17 @@ void _clutter_actor_set_enable_paint_unmapped
|
|||||||
void _clutter_actor_set_has_pointer (ClutterActor *self,
|
void _clutter_actor_set_has_pointer (ClutterActor *self,
|
||||||
gboolean has_pointer);
|
gboolean has_pointer);
|
||||||
|
|
||||||
void _clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
void _clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||||
ClutterRedrawFlags flags,
|
ClutterRedrawFlags flags,
|
||||||
const ClutterPaintVolume *clip_volume);
|
ClutterPaintVolume *clip_volume);
|
||||||
void _clutter_actor_queue_redraw_full (ClutterActor *self,
|
void _clutter_actor_queue_redraw_full (ClutterActor *self,
|
||||||
ClutterRedrawFlags flags,
|
ClutterRedrawFlags flags,
|
||||||
const ClutterPaintVolume *volume,
|
ClutterPaintVolume *volume,
|
||||||
ClutterEffect *effect);
|
ClutterEffect *effect);
|
||||||
|
|
||||||
|
ClutterPaintVolume * _clutter_actor_get_queue_redraw_clip (ClutterActor *self);
|
||||||
|
void _clutter_actor_set_queue_redraw_clip (ClutterActor *self,
|
||||||
|
ClutterPaintVolume *clip_volume);
|
||||||
void _clutter_actor_finish_queue_redraw (ClutterActor *self,
|
void _clutter_actor_finish_queue_redraw (ClutterActor *self,
|
||||||
ClutterPaintVolume *clip);
|
ClutterPaintVolume *clip);
|
||||||
|
|
||||||
@@ -294,6 +298,8 @@ const gchar * _clutter_actor_get_debug_name
|
|||||||
void _clutter_actor_push_clone_paint (void);
|
void _clutter_actor_push_clone_paint (void);
|
||||||
void _clutter_actor_pop_clone_paint (void);
|
void _clutter_actor_pop_clone_paint (void);
|
||||||
|
|
||||||
|
guint32 _clutter_actor_get_pick_id (ClutterActor *self);
|
||||||
|
|
||||||
void _clutter_actor_shader_pre_paint (ClutterActor *actor,
|
void _clutter_actor_shader_pre_paint (ClutterActor *actor,
|
||||||
gboolean repeat);
|
gboolean repeat);
|
||||||
void _clutter_actor_shader_post_paint (ClutterActor *actor);
|
void _clutter_actor_shader_post_paint (ClutterActor *actor);
|
||||||
@@ -310,11 +316,8 @@ void _clutter_actor_detach_clone
|
|||||||
void _clutter_actor_queue_redraw_on_clones (ClutterActor *actor);
|
void _clutter_actor_queue_redraw_on_clones (ClutterActor *actor);
|
||||||
void _clutter_actor_queue_relayout_on_clones (ClutterActor *actor);
|
void _clutter_actor_queue_relayout_on_clones (ClutterActor *actor);
|
||||||
void _clutter_actor_queue_only_relayout (ClutterActor *actor);
|
void _clutter_actor_queue_only_relayout (ClutterActor *actor);
|
||||||
void _clutter_actor_queue_update_resource_scale_recursive (ClutterActor *actor);
|
|
||||||
|
|
||||||
CoglFramebuffer * _clutter_actor_get_active_framebuffer (ClutterActor *actor);
|
CoglFramebuffer * _clutter_actor_get_active_framebuffer (ClutterActor *actor);
|
||||||
gboolean _clutter_actor_get_real_resource_scale (ClutterActor *actor,
|
|
||||||
float *resource_scale);
|
|
||||||
|
|
||||||
ClutterPaintNode * clutter_actor_create_texture_paint_node (ClutterActor *self,
|
ClutterPaintNode * clutter_actor_create_texture_paint_node (ClutterActor *self,
|
||||||
CoglTexture *texture);
|
CoglTexture *texture);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -236,9 +236,8 @@ struct _ClutterActorClass
|
|||||||
void (* pick) (ClutterActor *actor,
|
void (* pick) (ClutterActor *actor,
|
||||||
const ClutterColor *color);
|
const ClutterColor *color);
|
||||||
|
|
||||||
gboolean (* queue_redraw) (ClutterActor *actor,
|
void (* queue_redraw) (ClutterActor *actor,
|
||||||
ClutterActor *leaf_that_queued,
|
ClutterActor *leaf_that_queued);
|
||||||
ClutterPaintVolume *paint_volume);
|
|
||||||
|
|
||||||
/* size negotiation */
|
/* size negotiation */
|
||||||
void (* get_preferred_width) (ClutterActor *self,
|
void (* get_preferred_width) (ClutterActor *self,
|
||||||
@@ -584,11 +583,6 @@ gboolean clutter_actor_is_in_clone_paint
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_actor_get_paint_box (ClutterActor *self,
|
gboolean clutter_actor_get_paint_box (ClutterActor *self,
|
||||||
ClutterActorBox *box);
|
ClutterActorBox *box);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean clutter_actor_get_resource_scale (ClutterActor *self,
|
|
||||||
gfloat *resource_scale);
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_actor_has_overlaps (ClutterActor *self);
|
gboolean clutter_actor_has_overlaps (ClutterActor *self);
|
||||||
|
|
||||||
@@ -902,10 +896,6 @@ void clutter_actor_bind_model_with_properties
|
|||||||
const char *first_model_property,
|
const char *first_model_property,
|
||||||
...);
|
...);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void clutter_actor_pick_box (ClutterActor *self,
|
|
||||||
const ClutterActorBox *box);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_ACTOR_H__ */
|
#endif /* __CLUTTER_ACTOR_H__ */
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
* to control how a #ClutterAnimation will animate a property.
|
* to control how a #ClutterAnimation will animate a property.
|
||||||
*
|
*
|
||||||
* Each #ClutterAnimatable should implement the
|
* Each #ClutterAnimatable should implement the
|
||||||
* #ClutterAnimatableInterface.interpolate_property() virtual function of the
|
* #ClutterAnimatableIface.interpolate_property() virtual function of the
|
||||||
* interface to compute the animation state between two values of an interval
|
* interface to compute the animation state between two values of an interval
|
||||||
* depending on a progress factor, expressed as a floating point value.
|
* depending on a progress factor, expressed as a floating point value.
|
||||||
*
|
*
|
||||||
@@ -57,6 +57,7 @@
|
|||||||
#include "deprecated/clutter-animatable.h"
|
#include "deprecated/clutter-animatable.h"
|
||||||
#include "deprecated/clutter-animation.h"
|
#include "deprecated/clutter-animation.h"
|
||||||
|
|
||||||
|
typedef ClutterAnimatableIface ClutterAnimatableInterface;
|
||||||
G_DEFINE_INTERFACE (ClutterAnimatable, clutter_animatable, G_TYPE_OBJECT);
|
G_DEFINE_INTERFACE (ClutterAnimatable, clutter_animatable, G_TYPE_OBJECT);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -100,7 +101,7 @@ clutter_animatable_animate_property (ClutterAnimatable *animatable,
|
|||||||
gdouble progress,
|
gdouble progress,
|
||||||
GValue *value)
|
GValue *value)
|
||||||
{
|
{
|
||||||
ClutterAnimatableInterface *iface;
|
ClutterAnimatableIface *iface;
|
||||||
gboolean res;
|
gboolean res;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE);
|
||||||
@@ -154,7 +155,7 @@ GParamSpec *
|
|||||||
clutter_animatable_find_property (ClutterAnimatable *animatable,
|
clutter_animatable_find_property (ClutterAnimatable *animatable,
|
||||||
const gchar *property_name)
|
const gchar *property_name)
|
||||||
{
|
{
|
||||||
ClutterAnimatableInterface *iface;
|
ClutterAnimatableIface *iface;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), NULL);
|
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), NULL);
|
||||||
g_return_val_if_fail (property_name != NULL, NULL);
|
g_return_val_if_fail (property_name != NULL, NULL);
|
||||||
@@ -184,7 +185,7 @@ clutter_animatable_get_initial_state (ClutterAnimatable *animatable,
|
|||||||
const gchar *property_name,
|
const gchar *property_name,
|
||||||
GValue *value)
|
GValue *value)
|
||||||
{
|
{
|
||||||
ClutterAnimatableInterface *iface;
|
ClutterAnimatableIface *iface;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ANIMATABLE (animatable));
|
g_return_if_fail (CLUTTER_IS_ANIMATABLE (animatable));
|
||||||
g_return_if_fail (property_name != NULL);
|
g_return_if_fail (property_name != NULL);
|
||||||
@@ -213,7 +214,7 @@ clutter_animatable_set_final_state (ClutterAnimatable *animatable,
|
|||||||
const gchar *property_name,
|
const gchar *property_name,
|
||||||
const GValue *value)
|
const GValue *value)
|
||||||
{
|
{
|
||||||
ClutterAnimatableInterface *iface;
|
ClutterAnimatableIface *iface;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ANIMATABLE (animatable));
|
g_return_if_fail (CLUTTER_IS_ANIMATABLE (animatable));
|
||||||
g_return_if_fail (property_name != NULL);
|
g_return_if_fail (property_name != NULL);
|
||||||
@@ -259,7 +260,7 @@ clutter_animatable_interpolate_value (ClutterAnimatable *animatable,
|
|||||||
gdouble progress,
|
gdouble progress,
|
||||||
GValue *value)
|
GValue *value)
|
||||||
{
|
{
|
||||||
ClutterAnimatableInterface *iface;
|
ClutterAnimatableIface *iface;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE);
|
||||||
g_return_val_if_fail (property_name != NULL, FALSE);
|
g_return_val_if_fail (property_name != NULL, FALSE);
|
||||||
|
@@ -33,15 +33,24 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define CLUTTER_TYPE_ANIMATABLE (clutter_animatable_get_type ())
|
#define CLUTTER_TYPE_ANIMATABLE (clutter_animatable_get_type ())
|
||||||
|
#define CLUTTER_ANIMATABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ANIMATABLE, ClutterAnimatable))
|
||||||
|
#define CLUTTER_IS_ANIMATABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ANIMATABLE))
|
||||||
|
#define CLUTTER_ANIMATABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_ANIMATABLE, ClutterAnimatableIface))
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
typedef struct _ClutterAnimatableIface ClutterAnimatableIface;
|
||||||
G_DECLARE_INTERFACE (ClutterAnimatable, clutter_animatable,
|
|
||||||
CLUTTER, ANIMATABLE,
|
|
||||||
GObject)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterAnimatableInterface:
|
* ClutterAnimatable:
|
||||||
|
*
|
||||||
|
* #ClutterAnimatable is an opaque structure whose members cannot be directly
|
||||||
|
* accessed
|
||||||
|
*
|
||||||
|
* Since: 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterAnimatableIface:
|
||||||
* @animate_property: virtual function for custom interpolation of a
|
* @animate_property: virtual function for custom interpolation of a
|
||||||
* property. This virtual function is deprecated
|
* property. This virtual function is deprecated
|
||||||
* @find_property: virtual function for retrieving the #GParamSpec of
|
* @find_property: virtual function for retrieving the #GParamSpec of
|
||||||
@@ -58,7 +67,7 @@ G_DECLARE_INTERFACE (ClutterAnimatable, clutter_animatable,
|
|||||||
*
|
*
|
||||||
* Since: 1.0
|
* Since: 1.0
|
||||||
*/
|
*/
|
||||||
struct _ClutterAnimatableInterface
|
struct _ClutterAnimatableIface
|
||||||
{
|
{
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
GTypeInterface parent_iface;
|
GTypeInterface parent_iface;
|
||||||
@@ -86,6 +95,9 @@ struct _ClutterAnimatableInterface
|
|||||||
GValue *value);
|
GValue *value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
GType clutter_animatable_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
GParamSpec *clutter_animatable_find_property (ClutterAnimatable *animatable,
|
GParamSpec *clutter_animatable_find_property (ClutterAnimatable *animatable,
|
||||||
const gchar *property_name);
|
const gchar *property_name);
|
||||||
|
@@ -34,6 +34,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAction, g_object_unref)
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActor, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActor, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActorMeta, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActorMeta, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAlignConstraint, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAlignConstraint, g_object_unref)
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAnimatable, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBackend, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBackend, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBindConstraint, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBindConstraint, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBindingPool, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBindingPool, g_object_unref)
|
||||||
@@ -48,8 +49,10 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterClone, g_object_unref)
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterColorizeEffect, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterColorizeEffect, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterConstraint, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterConstraint, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterContainer, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterContainer, g_object_unref)
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterContent, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeformEffect, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeformEffect, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDesaturateEffect, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDesaturateEffect, g_object_unref)
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeviceManager, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDragAction, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDragAction, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDropAction, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDropAction, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterEffect, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterEffect, g_object_unref)
|
||||||
|
@@ -24,9 +24,10 @@
|
|||||||
|
|
||||||
#include <clutter/clutter-backend.h>
|
#include <clutter/clutter-backend.h>
|
||||||
#include <clutter/clutter-device-manager.h>
|
#include <clutter/clutter-device-manager.h>
|
||||||
#include <clutter/clutter-keymap.h>
|
|
||||||
#include <clutter/clutter-stage-window.h>
|
#include <clutter/clutter-stage-window.h>
|
||||||
|
|
||||||
|
#include "clutter-event-translator.h"
|
||||||
|
|
||||||
#define CLUTTER_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BACKEND, ClutterBackendClass))
|
#define CLUTTER_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BACKEND, ClutterBackendClass))
|
||||||
#define CLUTTER_IS_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BACKEND))
|
#define CLUTTER_IS_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BACKEND))
|
||||||
#define CLUTTER_BACKEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BACKEND, ClutterBackendClass))
|
#define CLUTTER_BACKEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BACKEND, ClutterBackendClass))
|
||||||
@@ -56,11 +57,9 @@ struct _ClutterBackend
|
|||||||
gfloat units_per_em;
|
gfloat units_per_em;
|
||||||
gint32 units_serial;
|
gint32 units_serial;
|
||||||
|
|
||||||
ClutterStageWindow *stage_window;
|
GList *event_translators;
|
||||||
|
|
||||||
ClutterInputMethod *input_method;
|
ClutterInputMethod *input_method;
|
||||||
|
|
||||||
ClutterKeymap *keymap;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _ClutterBackendClass
|
struct _ClutterBackendClass
|
||||||
@@ -91,6 +90,12 @@ struct _ClutterBackendClass
|
|||||||
GError **error);
|
GError **error);
|
||||||
ClutterDeviceManager *(* get_device_manager) (ClutterBackend *backend);
|
ClutterDeviceManager *(* get_device_manager) (ClutterBackend *backend);
|
||||||
|
|
||||||
|
void (* copy_event_data) (ClutterBackend *backend,
|
||||||
|
const ClutterEvent *src,
|
||||||
|
ClutterEvent *dest);
|
||||||
|
void (* free_event_data) (ClutterBackend *backend,
|
||||||
|
ClutterEvent *event);
|
||||||
|
|
||||||
gboolean (* translate_event) (ClutterBackend *backend,
|
gboolean (* translate_event) (ClutterBackend *backend,
|
||||||
gpointer native,
|
gpointer native,
|
||||||
ClutterEvent *event);
|
ClutterEvent *event);
|
||||||
@@ -99,8 +104,6 @@ struct _ClutterBackendClass
|
|||||||
|
|
||||||
void (* bell_notify) (ClutterBackend *backend);
|
void (* bell_notify) (ClutterBackend *backend);
|
||||||
|
|
||||||
ClutterKeymap * (* get_keymap) (ClutterBackend *backend);
|
|
||||||
|
|
||||||
/* signals */
|
/* signals */
|
||||||
void (* resolution_changed) (ClutterBackend *backend);
|
void (* resolution_changed) (ClutterBackend *backend);
|
||||||
void (* font_changed) (ClutterBackend *backend);
|
void (* font_changed) (ClutterBackend *backend);
|
||||||
@@ -128,11 +131,17 @@ void _clutter_backend_copy_event_data (Clutter
|
|||||||
ClutterEvent *dest);
|
ClutterEvent *dest);
|
||||||
void _clutter_backend_free_event_data (ClutterBackend *backend,
|
void _clutter_backend_free_event_data (ClutterBackend *backend,
|
||||||
ClutterEvent *event);
|
ClutterEvent *event);
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean _clutter_backend_translate_event (ClutterBackend *backend,
|
gboolean _clutter_backend_translate_event (ClutterBackend *backend,
|
||||||
gpointer native,
|
gpointer native,
|
||||||
ClutterEvent *event);
|
ClutterEvent *event);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
void _clutter_backend_add_event_translator (ClutterBackend *backend,
|
||||||
|
ClutterEventTranslator *translator);
|
||||||
|
|
||||||
|
void _clutter_backend_remove_event_translator (ClutterBackend *backend,
|
||||||
|
ClutterEventTranslator *translator);
|
||||||
|
|
||||||
ClutterFeatureFlags _clutter_backend_get_features (ClutterBackend *backend);
|
ClutterFeatureFlags _clutter_backend_get_features (ClutterBackend *backend);
|
||||||
|
|
||||||
gfloat _clutter_backend_get_units_per_em (ClutterBackend *backend,
|
gfloat _clutter_backend_get_units_per_em (ClutterBackend *backend,
|
||||||
@@ -146,8 +155,7 @@ void _clutter_backend_reset_cogl_framebuffer (Clutter
|
|||||||
|
|
||||||
void clutter_set_allowed_drivers (const char *drivers);
|
void clutter_set_allowed_drivers (const char *drivers);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
void clutter_try_set_windowing_backend (const char *drivers);
|
||||||
ClutterStageWindow * clutter_backend_get_stage_window (ClutterBackend *backend);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@@ -53,6 +53,9 @@
|
|||||||
#include "clutter-stage-window.h"
|
#include "clutter-stage-window.h"
|
||||||
#include "clutter-device-manager-private.h"
|
#include "clutter-device-manager-private.h"
|
||||||
|
|
||||||
|
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
#include "deprecated/clutter-backend.h"
|
||||||
|
|
||||||
#ifdef CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT
|
#ifdef CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT
|
||||||
#include "wayland/clutter-wayland-compositor.h"
|
#include "wayland/clutter-wayland-compositor.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -62,6 +65,9 @@
|
|||||||
#ifdef CLUTTER_INPUT_X11
|
#ifdef CLUTTER_INPUT_X11
|
||||||
#include "x11/clutter-backend-x11.h"
|
#include "x11/clutter-backend-x11.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CLUTTER_INPUT_EVDEV
|
||||||
|
#include "evdev/clutter-device-manager-evdev.h"
|
||||||
|
#endif
|
||||||
#ifdef CLUTTER_WINDOWING_EGL
|
#ifdef CLUTTER_WINDOWING_EGL
|
||||||
#include "egl/clutter-backend-eglnative.h"
|
#include "egl/clutter-backend-eglnative.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -101,12 +107,10 @@ clutter_backend_dispose (GObject *gobject)
|
|||||||
/* clear the events still in the queue of the main context */
|
/* clear the events still in the queue of the main context */
|
||||||
_clutter_clear_events_queue ();
|
_clutter_clear_events_queue ();
|
||||||
|
|
||||||
|
/* remove all event translators */
|
||||||
|
g_clear_pointer (&backend->event_translators, g_list_free);
|
||||||
|
|
||||||
g_clear_pointer (&backend->dummy_onscreen, cogl_object_unref);
|
g_clear_pointer (&backend->dummy_onscreen, cogl_object_unref);
|
||||||
if (backend->stage_window)
|
|
||||||
{
|
|
||||||
g_object_remove_weak_pointer (G_OBJECT (backend->stage_window),
|
|
||||||
(gpointer *) &backend->stage_window);
|
|
||||||
}
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (clutter_backend_parent_class)->dispose (gobject);
|
G_OBJECT_CLASS (clutter_backend_parent_class)->dispose (gobject);
|
||||||
}
|
}
|
||||||
@@ -396,7 +400,7 @@ clutter_backend_real_create_context (ClutterBackend *backend,
|
|||||||
else
|
else
|
||||||
g_set_error_literal (error, CLUTTER_INIT_ERROR,
|
g_set_error_literal (error, CLUTTER_INIT_ERROR,
|
||||||
CLUTTER_INIT_ERROR_BACKEND,
|
CLUTTER_INIT_ERROR_BACKEND,
|
||||||
"Unable to initialize the Clutter backend: no available drivers found.");
|
_("Unable to initialize the Clutter backend: no available drivers found."));
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -426,7 +430,7 @@ clutter_backend_real_get_features (ClutterBackend *backend)
|
|||||||
if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_THROTTLE))
|
if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_THROTTLE))
|
||||||
{
|
{
|
||||||
CLUTTER_NOTE (BACKEND, "Cogl supports swap buffers throttling");
|
CLUTTER_NOTE (BACKEND, "Cogl supports swap buffers throttling");
|
||||||
flags |= CLUTTER_FEATURE_SWAP_THROTTLE;
|
flags |= CLUTTER_FEATURE_SYNC_TO_VBLANK;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CLUTTER_NOTE (BACKEND, "Cogl doesn't support swap buffers throttling");
|
CLUTTER_NOTE (BACKEND, "Cogl doesn't support swap buffers throttling");
|
||||||
@@ -525,7 +529,40 @@ _clutter_create_backend (void)
|
|||||||
static void
|
static void
|
||||||
clutter_backend_real_init_events (ClutterBackend *backend)
|
clutter_backend_real_init_events (ClutterBackend *backend)
|
||||||
{
|
{
|
||||||
g_error ("Unknown input backend");
|
const char *input_backend = NULL;
|
||||||
|
|
||||||
|
input_backend = g_getenv ("CLUTTER_INPUT_BACKEND");
|
||||||
|
if (input_backend != NULL)
|
||||||
|
input_backend = g_intern_string (input_backend);
|
||||||
|
|
||||||
|
#ifdef CLUTTER_INPUT_X11
|
||||||
|
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11) &&
|
||||||
|
(input_backend == NULL || input_backend == I_(CLUTTER_INPUT_X11)))
|
||||||
|
{
|
||||||
|
_clutter_backend_x11_events_init (backend);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef CLUTTER_INPUT_EVDEV
|
||||||
|
/* Evdev can be used regardless of the windowing system */
|
||||||
|
if ((input_backend != NULL && strcmp (input_backend, CLUTTER_INPUT_EVDEV) == 0)
|
||||||
|
#ifdef CLUTTER_WINDOWING_EGL
|
||||||
|
/* but we do want to always use it for EGL native */
|
||||||
|
|| clutter_check_windowing_backend (CLUTTER_WINDOWING_EGL)
|
||||||
|
#endif
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_clutter_events_evdev_init (backend);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
if (input_backend != NULL)
|
||||||
|
{
|
||||||
|
if (input_backend != I_(CLUTTER_INPUT_NULL))
|
||||||
|
g_error ("Unrecognized input backend '%s'", input_backend);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
g_error ("Unknown input backend");
|
||||||
}
|
}
|
||||||
|
|
||||||
static ClutterDeviceManager *
|
static ClutterDeviceManager *
|
||||||
@@ -540,16 +577,32 @@ clutter_backend_real_get_device_manager (ClutterBackend *backend)
|
|||||||
return backend->device_manager;
|
return backend->device_manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ClutterKeymap *
|
static gboolean
|
||||||
clutter_backend_real_get_keymap (ClutterBackend *backend)
|
clutter_backend_real_translate_event (ClutterBackend *backend,
|
||||||
|
gpointer native,
|
||||||
|
ClutterEvent *event)
|
||||||
{
|
{
|
||||||
if (G_UNLIKELY (backend->keymap == NULL))
|
GList *l;
|
||||||
|
|
||||||
|
for (l = backend->event_translators;
|
||||||
|
l != NULL;
|
||||||
|
l = l->next)
|
||||||
{
|
{
|
||||||
g_critical ("No keymap available, expect broken keyboard input");
|
ClutterEventTranslator *translator = l->data;
|
||||||
return NULL;
|
ClutterTranslateReturn retval;
|
||||||
|
|
||||||
|
retval = _clutter_event_translator_translate_event (translator,
|
||||||
|
native,
|
||||||
|
event);
|
||||||
|
|
||||||
|
if (retval == CLUTTER_TRANSLATE_QUEUE)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
if (retval == CLUTTER_TRANSLATE_REMOVE)
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return backend->keymap;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -574,7 +627,8 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
|||||||
G_TYPE_FROM_CLASS (klass),
|
G_TYPE_FROM_CLASS (klass),
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (ClutterBackendClass, resolution_changed),
|
G_STRUCT_OFFSET (ClutterBackendClass, resolution_changed),
|
||||||
NULL, NULL, NULL,
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__VOID,
|
||||||
G_TYPE_NONE, 0);
|
G_TYPE_NONE, 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -591,7 +645,8 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
|||||||
G_TYPE_FROM_CLASS (klass),
|
G_TYPE_FROM_CLASS (klass),
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (ClutterBackendClass, font_changed),
|
G_STRUCT_OFFSET (ClutterBackendClass, font_changed),
|
||||||
NULL, NULL, NULL,
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__VOID,
|
||||||
G_TYPE_NONE, 0);
|
G_TYPE_NONE, 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -608,7 +663,8 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
|||||||
G_TYPE_FROM_CLASS (klass),
|
G_TYPE_FROM_CLASS (klass),
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (ClutterBackendClass, settings_changed),
|
G_STRUCT_OFFSET (ClutterBackendClass, settings_changed),
|
||||||
NULL, NULL, NULL,
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__VOID,
|
||||||
G_TYPE_NONE, 0);
|
G_TYPE_NONE, 0);
|
||||||
|
|
||||||
klass->resolution_changed = clutter_backend_real_resolution_changed;
|
klass->resolution_changed = clutter_backend_real_resolution_changed;
|
||||||
@@ -616,9 +672,9 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
|||||||
|
|
||||||
klass->init_events = clutter_backend_real_init_events;
|
klass->init_events = clutter_backend_real_init_events;
|
||||||
klass->get_device_manager = clutter_backend_real_get_device_manager;
|
klass->get_device_manager = clutter_backend_real_get_device_manager;
|
||||||
|
klass->translate_event = clutter_backend_real_translate_event;
|
||||||
klass->create_context = clutter_backend_real_create_context;
|
klass->create_context = clutter_backend_real_create_context;
|
||||||
klass->get_features = clutter_backend_real_get_features;
|
klass->get_features = clutter_backend_real_get_features;
|
||||||
klass->get_keymap = clutter_backend_real_get_keymap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -695,10 +751,6 @@ _clutter_backend_create_stage (ClutterBackend *backend,
|
|||||||
|
|
||||||
g_assert (CLUTTER_IS_STAGE_WINDOW (stage_window));
|
g_assert (CLUTTER_IS_STAGE_WINDOW (stage_window));
|
||||||
|
|
||||||
backend->stage_window = stage_window;
|
|
||||||
g_object_add_weak_pointer (G_OBJECT (backend->stage_window),
|
|
||||||
(gpointer *) &backend->stage_window);
|
|
||||||
|
|
||||||
return stage_window;
|
return stage_window;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -783,24 +835,37 @@ _clutter_backend_copy_event_data (ClutterBackend *backend,
|
|||||||
const ClutterEvent *src,
|
const ClutterEvent *src,
|
||||||
ClutterEvent *dest)
|
ClutterEvent *dest)
|
||||||
{
|
{
|
||||||
ClutterDeviceManagerClass *device_manager_class;
|
ClutterEventExtenderInterface *iface;
|
||||||
ClutterDeviceManager *device_manager;
|
ClutterBackendClass *klass;
|
||||||
|
|
||||||
device_manager = clutter_device_manager_get_default ();
|
klass = CLUTTER_BACKEND_GET_CLASS (backend);
|
||||||
device_manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
if (CLUTTER_IS_EVENT_EXTENDER (backend->device_manager))
|
||||||
device_manager_class->copy_event_data (device_manager, src, dest);
|
{
|
||||||
|
iface = CLUTTER_EVENT_EXTENDER_GET_IFACE (backend->device_manager);
|
||||||
|
iface->copy_event_data (CLUTTER_EVENT_EXTENDER (backend->device_manager),
|
||||||
|
src, dest);
|
||||||
|
}
|
||||||
|
else if (klass->copy_event_data != NULL)
|
||||||
|
klass->copy_event_data (backend, src, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_clutter_backend_free_event_data (ClutterBackend *backend,
|
_clutter_backend_free_event_data (ClutterBackend *backend,
|
||||||
ClutterEvent *event)
|
ClutterEvent *event)
|
||||||
{
|
{
|
||||||
ClutterDeviceManagerClass *device_manager_class;
|
ClutterEventExtenderInterface *iface;
|
||||||
ClutterDeviceManager *device_manager;
|
ClutterBackendClass *klass;
|
||||||
|
|
||||||
device_manager = clutter_device_manager_get_default ();
|
klass = CLUTTER_BACKEND_GET_CLASS (backend);
|
||||||
device_manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
|
||||||
device_manager_class->free_event_data (device_manager, event);
|
if (CLUTTER_IS_EVENT_EXTENDER (backend->device_manager))
|
||||||
|
{
|
||||||
|
iface = CLUTTER_EVENT_EXTENDER_GET_IFACE (backend->device_manager);
|
||||||
|
iface->free_event_data (CLUTTER_EVENT_EXTENDER (backend->device_manager),
|
||||||
|
event);
|
||||||
|
}
|
||||||
|
else if (klass->free_event_data != NULL)
|
||||||
|
klass->free_event_data (backend, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -825,6 +890,129 @@ clutter_get_default_backend (void)
|
|||||||
return clutter_context->backend;
|
return clutter_context->backend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_backend_set_double_click_time:
|
||||||
|
* @backend: a #ClutterBackend
|
||||||
|
* @msec: milliseconds between two button press events
|
||||||
|
*
|
||||||
|
* Sets the maximum time between two button press events, used to
|
||||||
|
* verify whether it's a double click event or not.
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*
|
||||||
|
* Deprecated: 1.4: Use #ClutterSettings:double-click-time instead
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_backend_set_double_click_time (ClutterBackend *backend,
|
||||||
|
guint msec)
|
||||||
|
{
|
||||||
|
ClutterSettings *settings = clutter_settings_get_default ();
|
||||||
|
|
||||||
|
g_object_set (settings, "double-click-time", msec, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_backend_get_double_click_time:
|
||||||
|
* @backend: a #ClutterBackend
|
||||||
|
*
|
||||||
|
* Gets the maximum time between two button press events, as set
|
||||||
|
* by clutter_backend_set_double_click_time().
|
||||||
|
*
|
||||||
|
* Return value: a time in milliseconds
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*
|
||||||
|
* Deprecated: 1.4: Use #ClutterSettings:double-click-time instead
|
||||||
|
*/
|
||||||
|
guint
|
||||||
|
clutter_backend_get_double_click_time (ClutterBackend *backend)
|
||||||
|
{
|
||||||
|
ClutterSettings *settings = clutter_settings_get_default ();
|
||||||
|
gint retval;
|
||||||
|
|
||||||
|
g_object_get (settings, "double-click-time", &retval, NULL);
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_backend_set_double_click_distance:
|
||||||
|
* @backend: a #ClutterBackend
|
||||||
|
* @distance: a distance, in pixels
|
||||||
|
*
|
||||||
|
* Sets the maximum distance used to verify a double click event.
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*
|
||||||
|
* Deprecated: 1.4: Use #ClutterSettings:double-click-distance instead
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_backend_set_double_click_distance (ClutterBackend *backend,
|
||||||
|
guint distance)
|
||||||
|
{
|
||||||
|
ClutterSettings *settings = clutter_settings_get_default ();
|
||||||
|
|
||||||
|
g_object_set (settings, "double-click-distance", distance, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_backend_get_double_click_distance:
|
||||||
|
* @backend: a #ClutterBackend
|
||||||
|
*
|
||||||
|
* Retrieves the distance used to verify a double click event
|
||||||
|
*
|
||||||
|
* Return value: a distance, in pixels.
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*
|
||||||
|
* Deprecated: 1.4: Use #ClutterSettings:double-click-distance instead
|
||||||
|
*/
|
||||||
|
guint
|
||||||
|
clutter_backend_get_double_click_distance (ClutterBackend *backend)
|
||||||
|
{
|
||||||
|
ClutterSettings *settings = clutter_settings_get_default ();
|
||||||
|
gint retval;
|
||||||
|
|
||||||
|
g_object_get (settings, "double-click-distance", &retval, NULL);
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_backend_set_resolution:
|
||||||
|
* @backend: a #ClutterBackend
|
||||||
|
* @dpi: the resolution in "dots per inch" (Physical inches aren't
|
||||||
|
* actually involved; the terminology is conventional).
|
||||||
|
*
|
||||||
|
* Sets the resolution for font handling on the screen. This is a
|
||||||
|
* scale factor between points specified in a #PangoFontDescription
|
||||||
|
* and cairo units. The default value is 96, meaning that a 10 point
|
||||||
|
* font will be 13 units high. (10 * 96. / 72. = 13.3).
|
||||||
|
*
|
||||||
|
* Applications should never need to call this function.
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*
|
||||||
|
* Deprecated: 1.4: Use #ClutterSettings:font-dpi instead
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_backend_set_resolution (ClutterBackend *backend,
|
||||||
|
gdouble dpi)
|
||||||
|
{
|
||||||
|
ClutterSettings *settings;
|
||||||
|
gint resolution;
|
||||||
|
|
||||||
|
g_return_if_fail (CLUTTER_IS_BACKEND (backend));
|
||||||
|
|
||||||
|
if (dpi < 0)
|
||||||
|
resolution = -1;
|
||||||
|
else
|
||||||
|
resolution = dpi * 1024;
|
||||||
|
|
||||||
|
settings = clutter_settings_get_default ();
|
||||||
|
g_object_set (settings, "font-dpi", resolution, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_backend_get_resolution:
|
* clutter_backend_get_resolution:
|
||||||
* @backend: a #ClutterBackend
|
* @backend: a #ClutterBackend
|
||||||
@@ -930,6 +1118,61 @@ clutter_backend_get_font_options (ClutterBackend *backend)
|
|||||||
return backend->font_options;
|
return backend->font_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_backend_set_font_name:
|
||||||
|
* @backend: a #ClutterBackend
|
||||||
|
* @font_name: the name of the font
|
||||||
|
*
|
||||||
|
* Sets the default font to be used by Clutter. The @font_name string
|
||||||
|
* must either be %NULL, which means that the font name from the
|
||||||
|
* default #ClutterBackend will be used; or be something that can
|
||||||
|
* be parsed by the pango_font_description_from_string() function.
|
||||||
|
*
|
||||||
|
* Since: 1.0
|
||||||
|
*
|
||||||
|
* Deprecated: 1.4: Use #ClutterSettings:font-name instead
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_backend_set_font_name (ClutterBackend *backend,
|
||||||
|
const gchar *font_name)
|
||||||
|
{
|
||||||
|
ClutterSettings *settings = clutter_settings_get_default ();
|
||||||
|
|
||||||
|
g_object_set (settings, "font-name", font_name, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_backend_get_font_name:
|
||||||
|
* @backend: a #ClutterBackend
|
||||||
|
*
|
||||||
|
* Retrieves the default font name as set by
|
||||||
|
* clutter_backend_set_font_name().
|
||||||
|
*
|
||||||
|
* Return value: the font name for the backend. The returned string is
|
||||||
|
* owned by the #ClutterBackend and should never be modified or freed
|
||||||
|
*
|
||||||
|
* Since: 1.0
|
||||||
|
*
|
||||||
|
* Deprecated: 1.4: Use #ClutterSettings:font-name instead
|
||||||
|
*/
|
||||||
|
const gchar *
|
||||||
|
clutter_backend_get_font_name (ClutterBackend *backend)
|
||||||
|
{
|
||||||
|
ClutterSettings *settings;
|
||||||
|
|
||||||
|
g_return_val_if_fail (CLUTTER_IS_BACKEND (backend), NULL);
|
||||||
|
|
||||||
|
settings = clutter_settings_get_default ();
|
||||||
|
|
||||||
|
/* XXX yuck. but we return a const pointer, so we need to
|
||||||
|
* store it in the backend
|
||||||
|
*/
|
||||||
|
g_free (backend->font_name);
|
||||||
|
g_object_get (settings, "font-name", &backend->font_name, NULL);
|
||||||
|
|
||||||
|
return backend->font_name;
|
||||||
|
}
|
||||||
|
|
||||||
gint32
|
gint32
|
||||||
_clutter_backend_get_units_serial (ClutterBackend *backend)
|
_clutter_backend_get_units_serial (ClutterBackend *backend)
|
||||||
{
|
{
|
||||||
@@ -946,6 +1189,28 @@ _clutter_backend_translate_event (ClutterBackend *backend,
|
|||||||
event);
|
event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_clutter_backend_add_event_translator (ClutterBackend *backend,
|
||||||
|
ClutterEventTranslator *translator)
|
||||||
|
{
|
||||||
|
if (g_list_find (backend->event_translators, translator) != NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
backend->event_translators =
|
||||||
|
g_list_prepend (backend->event_translators, translator);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_clutter_backend_remove_event_translator (ClutterBackend *backend,
|
||||||
|
ClutterEventTranslator *translator)
|
||||||
|
{
|
||||||
|
if (g_list_find (backend->event_translators, translator) == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
backend->event_translators =
|
||||||
|
g_list_remove (backend->event_translators, translator);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_backend_get_cogl_context: (skip)
|
* clutter_backend_get_cogl_context: (skip)
|
||||||
* @backend: a #ClutterBackend
|
* @backend: a #ClutterBackend
|
||||||
@@ -997,6 +1262,61 @@ clutter_wayland_set_compositor_display (void *display)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_set_windowing_backend:
|
||||||
|
* @backend_type: a comma separated list of windowing backends
|
||||||
|
*
|
||||||
|
* Restricts Clutter to only use the specified backend or list of backends.
|
||||||
|
*
|
||||||
|
* You can use one of the `CLUTTER_WINDOWING_*` symbols, e.g.
|
||||||
|
*
|
||||||
|
* |[<!-- language="C" -->
|
||||||
|
* clutter_set_windowing_backend (CLUTTER_WINDOWING_X11);
|
||||||
|
* ]|
|
||||||
|
*
|
||||||
|
* Will force Clutter to use the X11 windowing and input backend, and terminate
|
||||||
|
* if the X11 backend could not be initialized successfully.
|
||||||
|
*
|
||||||
|
* Since Clutter 1.26, you can also use a comma-separated list of windowing
|
||||||
|
* system backends to provide a fallback in case backends are not available or
|
||||||
|
* enabled, e.g.:
|
||||||
|
*
|
||||||
|
* |[<!-- language="C" -->
|
||||||
|
* clutter_set_windowing_backend ("gdk,wayland,x11");
|
||||||
|
* ]|
|
||||||
|
*
|
||||||
|
* Will make Clutter test for the GDK, Wayland, and X11 backends in that order.
|
||||||
|
*
|
||||||
|
* You can use the `*` special value to ask Clutter to use the internally
|
||||||
|
* defined list of backends. For instance:
|
||||||
|
*
|
||||||
|
* |[<!-- language="C" -->
|
||||||
|
* clutter_set_windowing_backend ("x11,wayland,*");
|
||||||
|
* ]|
|
||||||
|
*
|
||||||
|
* Will make Clutter test the X11 and Wayland backends, and then fall back
|
||||||
|
* to the internal list of available backends.
|
||||||
|
*
|
||||||
|
* This function must be called before the first API call to Clutter, including
|
||||||
|
* clutter_get_option_context()
|
||||||
|
*
|
||||||
|
* Since: 1.16
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_set_windowing_backend (const char *backend_type)
|
||||||
|
{
|
||||||
|
g_return_if_fail (backend_type != NULL);
|
||||||
|
|
||||||
|
allowed_backends = g_strdup (backend_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
clutter_try_set_windowing_backend (const char *backend_type)
|
||||||
|
{
|
||||||
|
if (allowed_backends == NULL)
|
||||||
|
clutter_set_windowing_backend (backend_type);
|
||||||
|
}
|
||||||
|
|
||||||
PangoDirection
|
PangoDirection
|
||||||
_clutter_backend_get_keymap_direction (ClutterBackend *backend)
|
_clutter_backend_get_keymap_direction (ClutterBackend *backend)
|
||||||
{
|
{
|
||||||
@@ -1014,7 +1334,7 @@ _clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
|
|||||||
{
|
{
|
||||||
if (backend->dummy_onscreen == COGL_INVALID_HANDLE)
|
if (backend->dummy_onscreen == COGL_INVALID_HANDLE)
|
||||||
{
|
{
|
||||||
GError *internal_error = NULL;
|
CoglError *internal_error = NULL;
|
||||||
|
|
||||||
backend->dummy_onscreen = cogl_onscreen_new (backend->cogl_context, 1, 1);
|
backend->dummy_onscreen = cogl_onscreen_new (backend->cogl_context, 1, 1);
|
||||||
|
|
||||||
@@ -1022,7 +1342,7 @@ _clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
|
|||||||
&internal_error))
|
&internal_error))
|
||||||
{
|
{
|
||||||
g_critical ("Unable to create dummy onscreen: %s", internal_error->message);
|
g_critical ("Unable to create dummy onscreen: %s", internal_error->message);
|
||||||
g_error_free (internal_error);
|
cogl_error_free (internal_error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1079,23 +1399,3 @@ clutter_backend_set_input_method (ClutterBackend *backend,
|
|||||||
{
|
{
|
||||||
g_set_object (&backend->input_method, method);
|
g_set_object (&backend->input_method, method);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_backend_get_keymap:
|
|
||||||
* @backend: the #ClutterBackend
|
|
||||||
*
|
|
||||||
* Gets the keymap used by Clutter
|
|
||||||
*
|
|
||||||
* Returns: (transfer none): the keymap
|
|
||||||
**/
|
|
||||||
ClutterKeymap *
|
|
||||||
clutter_backend_get_keymap (ClutterBackend *backend)
|
|
||||||
{
|
|
||||||
return CLUTTER_BACKEND_GET_CLASS (backend)->get_keymap (backend);
|
|
||||||
}
|
|
||||||
|
|
||||||
ClutterStageWindow *
|
|
||||||
clutter_backend_get_stage_window (ClutterBackend *backend)
|
|
||||||
{
|
|
||||||
return backend->stage_window;
|
|
||||||
}
|
|
||||||
|
@@ -34,7 +34,6 @@
|
|||||||
#include <cogl/cogl.h>
|
#include <cogl/cogl.h>
|
||||||
|
|
||||||
#include <clutter/clutter-config.h>
|
#include <clutter/clutter-config.h>
|
||||||
#include <clutter/clutter-keymap.h>
|
|
||||||
#include <clutter/clutter-types.h>
|
#include <clutter/clutter-types.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
@@ -60,6 +59,9 @@ GType clutter_backend_get_type (void) G_GNUC_CONST;
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
ClutterBackend * clutter_get_default_backend (void);
|
ClutterBackend * clutter_get_default_backend (void);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
void clutter_set_windowing_backend (const char *backend_type);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gdouble clutter_backend_get_resolution (ClutterBackend *backend);
|
gdouble clutter_backend_get_resolution (ClutterBackend *backend);
|
||||||
|
|
||||||
@@ -81,9 +83,6 @@ ClutterInputMethod * clutter_backend_get_input_method (Clutter
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_backend_set_input_method (ClutterBackend *backend,
|
void clutter_backend_set_input_method (ClutterBackend *backend,
|
||||||
ClutterInputMethod *method);
|
ClutterInputMethod *method);
|
||||||
CLUTTER_EXPORT
|
|
||||||
ClutterKeymap * clutter_backend_get_keymap (ClutterBackend *backend);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_BACKEND_H__ */
|
#endif /* __CLUTTER_BACKEND_H__ */
|
||||||
|
@@ -570,68 +570,6 @@ G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterPoint, clutter_point,
|
|||||||
clutter_point_free,
|
clutter_point_free,
|
||||||
CLUTTER_REGISTER_INTERVAL_PROGRESS (clutter_point_progress))
|
CLUTTER_REGISTER_INTERVAL_PROGRESS (clutter_point_progress))
|
||||||
|
|
||||||
static int
|
|
||||||
clutter_point_compare_line (const ClutterPoint *p,
|
|
||||||
const ClutterPoint *a,
|
|
||||||
const ClutterPoint *b)
|
|
||||||
{
|
|
||||||
float x1 = b->x - a->x;
|
|
||||||
float y1 = b->y - a->y;
|
|
||||||
float x2 = p->x - a->x;
|
|
||||||
float y2 = p->y - a->y;
|
|
||||||
float cross_z = x1 * y2 - y1 * x2;
|
|
||||||
|
|
||||||
if (cross_z > 0.f)
|
|
||||||
return 1;
|
|
||||||
else if (cross_z < 0.f)
|
|
||||||
return -1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_point_inside_quadrilateral:
|
|
||||||
* @point: a #ClutterPoint to test
|
|
||||||
* @vertices: array of vertices of the quadrilateral, in either clockwise or
|
|
||||||
* anticlockwise order.
|
|
||||||
*
|
|
||||||
* Determines whether a point is inside the convex quadrilateral provided,
|
|
||||||
* or on any of its edges or vertices.
|
|
||||||
*
|
|
||||||
* Returns: %TRUE if @point is inside or touching the quadrilateral
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
clutter_point_inside_quadrilateral (const ClutterPoint *point,
|
|
||||||
const ClutterPoint *vertices)
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
int first_side;
|
|
||||||
|
|
||||||
first_side = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
|
||||||
{
|
|
||||||
int side;
|
|
||||||
|
|
||||||
side = clutter_point_compare_line (point,
|
|
||||||
&vertices[i],
|
|
||||||
&vertices[(i + 1) % 4]);
|
|
||||||
|
|
||||||
if (side)
|
|
||||||
{
|
|
||||||
if (first_side == 0)
|
|
||||||
first_side = side;
|
|
||||||
else if (side != first_side)
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (first_side == 0)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1208,60 +1146,29 @@ clutter_rect_inset (ClutterRect *rect,
|
|||||||
rect->size.height = 0.f;
|
rect->size.height = 0.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_rect_scale:
|
|
||||||
* @rect: a #ClutterRect
|
|
||||||
* @s_x: an horizontal scale value
|
|
||||||
* @s_y: a vertical scale value
|
|
||||||
*
|
|
||||||
* Scale the rectangle coordinates and size by @s_x horizontally and
|
|
||||||
* @s_y vertically.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_rect_scale (ClutterRect *rect,
|
|
||||||
float s_x,
|
|
||||||
float s_y)
|
|
||||||
{
|
|
||||||
g_return_if_fail (rect != NULL);
|
|
||||||
g_return_if_fail (s_x > 0.f);
|
|
||||||
g_return_if_fail (s_y > 0.f);
|
|
||||||
|
|
||||||
clutter_rect_normalize_internal (rect);
|
|
||||||
|
|
||||||
rect->origin.x *= s_x;
|
|
||||||
rect->origin.y *= s_y;
|
|
||||||
rect->size.width *= s_x;
|
|
||||||
rect->size.height *= s_y;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_rect_clamp_to_pixel:
|
* clutter_rect_clamp_to_pixel:
|
||||||
* @rect: a #ClutterRect
|
* @rect: a #ClutterRect
|
||||||
*
|
*
|
||||||
* Rounds the origin of @rect downwards to the nearest integer, and recompute the
|
* Rounds the origin of @rect downwards to the nearest integer, and rounds
|
||||||
* the size using the @rect origin and size rounded upwards to the nearest integer,
|
* the size of @rect upwards to the nearest integer, so that @rect is
|
||||||
* so that @rect is updated to the smallest rectangle capable of fully containing
|
* updated to the smallest rectangle capable of fully containing the
|
||||||
* the original, fractional rectangle in the coordinates space.
|
* original, fractional rectangle.
|
||||||
*
|
*
|
||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_rect_clamp_to_pixel (ClutterRect *rect)
|
clutter_rect_clamp_to_pixel (ClutterRect *rect)
|
||||||
{
|
{
|
||||||
float x2, y2;
|
|
||||||
|
|
||||||
g_return_if_fail (rect != NULL);
|
g_return_if_fail (rect != NULL);
|
||||||
|
|
||||||
clutter_rect_normalize_internal (rect);
|
clutter_rect_normalize_internal (rect);
|
||||||
|
|
||||||
x2 = rect->origin.x + rect->size.width;
|
|
||||||
y2 = rect->origin.y + rect->size.height;
|
|
||||||
|
|
||||||
rect->origin.x = floorf (rect->origin.x);
|
rect->origin.x = floorf (rect->origin.x);
|
||||||
rect->origin.y = floorf (rect->origin.y);
|
rect->origin.y = floorf (rect->origin.y);
|
||||||
|
|
||||||
rect->size.width = ceilf (x2) - rect->origin.x;
|
rect->size.width = ceilf (rect->size.width);
|
||||||
rect->size.height = ceilf (y2) - rect->origin.y;
|
rect->size.height = ceilf (rect->size.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -36,7 +36,7 @@ G_BEGIN_DECLS
|
|||||||
|
|
||||||
typedef struct _ClutterBezier ClutterBezier;
|
typedef struct _ClutterBezier ClutterBezier;
|
||||||
|
|
||||||
ClutterBezier *_clutter_bezier_new (void);
|
ClutterBezier *_clutter_bezier_new ();
|
||||||
|
|
||||||
void _clutter_bezier_free (ClutterBezier * b);
|
void _clutter_bezier_free (ClutterBezier * b);
|
||||||
|
|
||||||
|
@@ -235,7 +235,8 @@ clutter_binding_pool_finalize (GObject *gobject)
|
|||||||
|
|
||||||
g_hash_table_destroy (pool->entries_hash);
|
g_hash_table_destroy (pool->entries_hash);
|
||||||
|
|
||||||
g_slist_free_full (pool->entries, (GDestroyNotify) binding_entry_free);
|
g_slist_foreach (pool->entries, (GFunc) binding_entry_free, NULL);
|
||||||
|
g_slist_free (pool->entries);
|
||||||
|
|
||||||
G_OBJECT_CLASS (clutter_binding_pool_parent_class)->finalize (gobject);
|
G_OBJECT_CLASS (clutter_binding_pool_parent_class)->finalize (gobject);
|
||||||
}
|
}
|
||||||
|
@@ -160,7 +160,6 @@ static void
|
|||||||
clutter_blur_effect_paint_target (ClutterOffscreenEffect *effect)
|
clutter_blur_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||||
{
|
{
|
||||||
ClutterBlurEffect *self = CLUTTER_BLUR_EFFECT (effect);
|
ClutterBlurEffect *self = CLUTTER_BLUR_EFFECT (effect);
|
||||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
|
||||||
guint8 paint_opacity;
|
guint8 paint_opacity;
|
||||||
|
|
||||||
paint_opacity = clutter_actor_get_paint_opacity (self->actor);
|
paint_opacity = clutter_actor_get_paint_opacity (self->actor);
|
||||||
@@ -170,16 +169,16 @@ clutter_blur_effect_paint_target (ClutterOffscreenEffect *effect)
|
|||||||
paint_opacity,
|
paint_opacity,
|
||||||
paint_opacity,
|
paint_opacity,
|
||||||
paint_opacity);
|
paint_opacity);
|
||||||
|
cogl_push_source (self->pipeline);
|
||||||
|
|
||||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
cogl_rectangle (0, 0, self->tex_width, self->tex_height);
|
||||||
self->pipeline,
|
|
||||||
0, 0,
|
cogl_pop_source ();
|
||||||
self->tex_width, self->tex_height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
clutter_blur_effect_modify_paint_volume (ClutterEffect *effect,
|
clutter_blur_effect_get_paint_volume (ClutterEffect *effect,
|
||||||
ClutterPaintVolume *volume)
|
ClutterPaintVolume *volume)
|
||||||
{
|
{
|
||||||
gfloat cur_width, cur_height;
|
gfloat cur_width, cur_height;
|
||||||
ClutterVertex origin;
|
ClutterVertex origin;
|
||||||
@@ -223,7 +222,7 @@ clutter_blur_effect_class_init (ClutterBlurEffectClass *klass)
|
|||||||
gobject_class->dispose = clutter_blur_effect_dispose;
|
gobject_class->dispose = clutter_blur_effect_dispose;
|
||||||
|
|
||||||
effect_class->pre_paint = clutter_blur_effect_pre_paint;
|
effect_class->pre_paint = clutter_blur_effect_pre_paint;
|
||||||
effect_class->modify_paint_volume = clutter_blur_effect_modify_paint_volume;
|
effect_class->get_paint_volume = clutter_blur_effect_get_paint_volume;
|
||||||
|
|
||||||
offscreen_class = CLUTTER_OFFSCREEN_EFFECT_CLASS (klass);
|
offscreen_class = CLUTTER_OFFSCREEN_EFFECT_CLASS (klass);
|
||||||
offscreen_class->paint_target = clutter_blur_effect_paint_target;
|
offscreen_class->paint_target = clutter_blur_effect_paint_target;
|
||||||
@@ -249,7 +248,9 @@ clutter_blur_effect_init (ClutterBlurEffect *self)
|
|||||||
cogl_pipeline_add_layer_snippet (klass->base_pipeline, 0, snippet);
|
cogl_pipeline_add_layer_snippet (klass->base_pipeline, 0, snippet);
|
||||||
cogl_object_unref (snippet);
|
cogl_object_unref (snippet);
|
||||||
|
|
||||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline, 0);
|
cogl_pipeline_set_layer_null_texture (klass->base_pipeline,
|
||||||
|
0, /* layer number */
|
||||||
|
COGL_TEXTURE_TYPE_2D);
|
||||||
}
|
}
|
||||||
|
|
||||||
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
||||||
|
@@ -150,9 +150,9 @@ typedef struct _RequestedSize
|
|||||||
gfloat natural_size;
|
gfloat natural_size;
|
||||||
} RequestedSize;
|
} RequestedSize;
|
||||||
|
|
||||||
static float distribute_natural_allocation (float extra_space,
|
static gint distribute_natural_allocation (gint extra_space,
|
||||||
unsigned int n_requested_sizes,
|
guint n_requested_sizes,
|
||||||
RequestedSize *sizes);
|
RequestedSize *sizes);
|
||||||
static void count_expand_children (ClutterLayoutManager *layout,
|
static void count_expand_children (ClutterLayoutManager *layout,
|
||||||
ClutterContainer *container,
|
ClutterContainer *container,
|
||||||
gint *visible_children,
|
gint *visible_children,
|
||||||
@@ -624,19 +624,7 @@ get_preferred_size_for_opposite_orientation (ClutterBoxLayout *self,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Bring children up to size first */
|
/* Bring children up to size first */
|
||||||
if (isnormal (size) || size == 0)
|
size = distribute_natural_allocation (MAX (0, size), nvis_children, sizes);
|
||||||
{
|
|
||||||
size = distribute_natural_allocation (MAX (0, size),
|
|
||||||
nvis_children,
|
|
||||||
sizes);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_critical ("Actor %s (%p) received the invalid "
|
|
||||||
"value %f as minimum/natural size\n",
|
|
||||||
G_OBJECT_TYPE_NAME (container), container, size);
|
|
||||||
size = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Calculate space which hasn't distributed yet,
|
/* Calculate space which hasn't distributed yet,
|
||||||
* and is available for expanding children.
|
* and is available for expanding children.
|
||||||
@@ -891,18 +879,17 @@ compare_gap (gconstpointer p1,
|
|||||||
*
|
*
|
||||||
* Pulled from gtksizerequest.c from Gtk+
|
* Pulled from gtksizerequest.c from Gtk+
|
||||||
*/
|
*/
|
||||||
static float
|
static gint
|
||||||
distribute_natural_allocation (float extra_space,
|
distribute_natural_allocation (gint extra_space,
|
||||||
unsigned int n_requested_sizes,
|
guint n_requested_sizes,
|
||||||
RequestedSize *sizes)
|
RequestedSize *sizes)
|
||||||
{
|
{
|
||||||
unsigned int *spreading;
|
guint *spreading;
|
||||||
int i;
|
gint i;
|
||||||
|
|
||||||
g_return_val_if_fail (isnormal (extra_space) || extra_space == 0, 0);
|
|
||||||
g_return_val_if_fail (extra_space >= 0, 0);
|
g_return_val_if_fail (extra_space >= 0, 0);
|
||||||
|
|
||||||
spreading = g_newa (unsigned int, n_requested_sizes);
|
spreading = g_newa (guint, n_requested_sizes);
|
||||||
|
|
||||||
for (i = 0; i < n_requested_sizes; i++)
|
for (i = 0; i < n_requested_sizes; i++)
|
||||||
spreading[i] = i;
|
spreading[i] = i;
|
||||||
@@ -926,7 +913,7 @@ distribute_natural_allocation (float extra_space,
|
|||||||
|
|
||||||
/* Sort descending by gap and position. */
|
/* Sort descending by gap and position. */
|
||||||
g_qsort_with_data (spreading,
|
g_qsort_with_data (spreading,
|
||||||
n_requested_sizes, sizeof (unsigned int),
|
n_requested_sizes, sizeof (guint),
|
||||||
compare_gap, sizes);
|
compare_gap, sizes);
|
||||||
|
|
||||||
/* Distribute available space.
|
/* Distribute available space.
|
||||||
@@ -938,11 +925,11 @@ distribute_natural_allocation (float extra_space,
|
|||||||
* Sort order and reducing remaining space by assigned space
|
* Sort order and reducing remaining space by assigned space
|
||||||
* ensures that space is distributed equally.
|
* ensures that space is distributed equally.
|
||||||
*/
|
*/
|
||||||
int glue = (extra_space + i) / (i + 1);
|
gint glue = (extra_space + i) / (i + 1);
|
||||||
int gap = sizes[(spreading[i])].natural_size
|
gint gap = sizes[(spreading[i])].natural_size
|
||||||
- sizes[(spreading[i])].minimum_size;
|
- sizes[(spreading[i])].minimum_size;
|
||||||
|
|
||||||
int extra = MIN (glue, gap);
|
gint extra = MIN (glue, gap);
|
||||||
|
|
||||||
sizes[spreading[i]].minimum_size += extra;
|
sizes[spreading[i]].minimum_size += extra;
|
||||||
|
|
||||||
@@ -1069,9 +1056,7 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Bring children up to size first */
|
/* Bring children up to size first */
|
||||||
size = (gint) distribute_natural_allocation (MAX (0, (float) size),
|
size = distribute_natural_allocation (MAX (0, size), nvis_children, sizes);
|
||||||
nvis_children,
|
|
||||||
sizes);
|
|
||||||
|
|
||||||
/* Calculate space which hasn't distributed yet,
|
/* Calculate space which hasn't distributed yet,
|
||||||
* and is available for expanding children.
|
* and is available for expanding children.
|
||||||
|
@@ -178,7 +178,6 @@ static void
|
|||||||
clutter_brightness_contrast_effect_paint_target (ClutterOffscreenEffect *effect)
|
clutter_brightness_contrast_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||||
{
|
{
|
||||||
ClutterBrightnessContrastEffect *self = CLUTTER_BRIGHTNESS_CONTRAST_EFFECT (effect);
|
ClutterBrightnessContrastEffect *self = CLUTTER_BRIGHTNESS_CONTRAST_EFFECT (effect);
|
||||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
|
||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
guint8 paint_opacity;
|
guint8 paint_opacity;
|
||||||
|
|
||||||
@@ -190,11 +189,11 @@ clutter_brightness_contrast_effect_paint_target (ClutterOffscreenEffect *effect)
|
|||||||
paint_opacity,
|
paint_opacity,
|
||||||
paint_opacity,
|
paint_opacity,
|
||||||
paint_opacity);
|
paint_opacity);
|
||||||
|
cogl_push_source (self->pipeline);
|
||||||
|
|
||||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
cogl_rectangle (0, 0, self->tex_width, self->tex_height);
|
||||||
self->pipeline,
|
|
||||||
0, 0,
|
cogl_pop_source ();
|
||||||
self->tex_width, self->tex_height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -438,7 +437,9 @@ clutter_brightness_contrast_effect_init (ClutterBrightnessContrastEffect *self)
|
|||||||
cogl_pipeline_add_snippet (klass->base_pipeline, snippet);
|
cogl_pipeline_add_snippet (klass->base_pipeline, snippet);
|
||||||
cogl_object_unref (snippet);
|
cogl_object_unref (snippet);
|
||||||
|
|
||||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline, 0);
|
cogl_pipeline_set_layer_null_texture (klass->base_pipeline,
|
||||||
|
0, /* layer number */
|
||||||
|
COGL_TEXTURE_TYPE_2D);
|
||||||
}
|
}
|
||||||
|
|
||||||
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
||||||
|
@@ -44,7 +44,6 @@
|
|||||||
|
|
||||||
#include "clutter-build-config.h"
|
#include "clutter-build-config.h"
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <cogl/cogl.h>
|
#include <cogl/cogl.h>
|
||||||
#include <cairo-gobject.h>
|
#include <cairo-gobject.h>
|
||||||
|
|
||||||
@@ -70,7 +69,6 @@ struct _ClutterCanvasPrivate
|
|||||||
|
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
float scale_factor;
|
|
||||||
|
|
||||||
CoglTexture *texture;
|
CoglTexture *texture;
|
||||||
gboolean dirty;
|
gboolean dirty;
|
||||||
@@ -84,7 +82,6 @@ enum
|
|||||||
|
|
||||||
PROP_WIDTH,
|
PROP_WIDTH,
|
||||||
PROP_HEIGHT,
|
PROP_HEIGHT,
|
||||||
PROP_SCALE_FACTOR,
|
|
||||||
|
|
||||||
LAST_PROP
|
LAST_PROP
|
||||||
};
|
};
|
||||||
@@ -100,7 +97,7 @@ enum
|
|||||||
|
|
||||||
static guint canvas_signals[LAST_SIGNAL] = { 0, };
|
static guint canvas_signals[LAST_SIGNAL] = { 0, };
|
||||||
|
|
||||||
static void clutter_content_iface_init (ClutterContentInterface *iface);
|
static void clutter_content_iface_init (ClutterContentIface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (ClutterCanvas, clutter_canvas, G_TYPE_OBJECT,
|
G_DEFINE_TYPE_WITH_CODE (ClutterCanvas, clutter_canvas, G_TYPE_OBJECT,
|
||||||
G_ADD_PRIVATE (ClutterCanvas)
|
G_ADD_PRIVATE (ClutterCanvas)
|
||||||
@@ -181,19 +178,6 @@ clutter_canvas_set_property (GObject *gobject,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_SCALE_FACTOR:
|
|
||||||
{
|
|
||||||
gfloat new_scale_factor = g_value_get_float (value);
|
|
||||||
|
|
||||||
if (priv->scale_factor != new_scale_factor)
|
|
||||||
{
|
|
||||||
priv->scale_factor = new_scale_factor;
|
|
||||||
|
|
||||||
clutter_content_invalidate (CLUTTER_CONTENT (gobject));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
@@ -218,10 +202,6 @@ clutter_canvas_get_property (GObject *gobject,
|
|||||||
g_value_set_int (value, priv->height);
|
g_value_set_int (value, priv->height);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_SCALE_FACTOR:
|
|
||||||
g_value_set_float (value, priv->scale_factor);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
@@ -265,19 +245,6 @@ clutter_canvas_class_init (ClutterCanvasClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS);
|
G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterCanvas:scale-factor:
|
|
||||||
*
|
|
||||||
* The height of the canvas.
|
|
||||||
*/
|
|
||||||
obj_props[PROP_SCALE_FACTOR] =
|
|
||||||
g_param_spec_float ("scale-factor",
|
|
||||||
P_("Scale Factor"),
|
|
||||||
P_("The Scale factor of the canvas"),
|
|
||||||
0.01f, G_MAXFLOAT,
|
|
||||||
1.0f,
|
|
||||||
G_PARAM_READWRITE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterCanvas::draw:
|
* ClutterCanvas::draw:
|
||||||
@@ -324,7 +291,6 @@ clutter_canvas_init (ClutterCanvas *self)
|
|||||||
|
|
||||||
self->priv->width = -1;
|
self->priv->width = -1;
|
||||||
self->priv->height = -1;
|
self->priv->height = -1;
|
||||||
self->priv->scale_factor = 1.0f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -374,8 +340,8 @@ clutter_canvas_emit_draw (ClutterCanvas *self)
|
|||||||
|
|
||||||
priv->dirty = TRUE;
|
priv->dirty = TRUE;
|
||||||
|
|
||||||
real_width = ceilf (priv->width * priv->scale_factor);
|
real_width = priv->width;
|
||||||
real_height = ceilf (priv->height * priv->scale_factor);
|
real_height = priv->height;
|
||||||
|
|
||||||
CLUTTER_NOTE (MISC, "Creating Cairo surface with size %d x %d",
|
CLUTTER_NOTE (MISC, "Creating Cairo surface with size %d x %d",
|
||||||
priv->width, priv->height);
|
priv->width, priv->height);
|
||||||
@@ -421,10 +387,6 @@ clutter_canvas_emit_draw (ClutterCanvas *self)
|
|||||||
mapped_buffer = FALSE;
|
mapped_buffer = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
cairo_surface_set_device_scale (surface,
|
|
||||||
priv->scale_factor,
|
|
||||||
priv->scale_factor);
|
|
||||||
|
|
||||||
self->priv->cr = cr = cairo_create (surface);
|
self->priv->cr = cr = cairo_create (surface);
|
||||||
|
|
||||||
g_signal_emit (self, canvas_signals[DRAW], 0,
|
g_signal_emit (self, canvas_signals[DRAW], 0,
|
||||||
@@ -486,16 +448,16 @@ clutter_canvas_get_preferred_size (ClutterContent *content,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (width != NULL)
|
if (width != NULL)
|
||||||
*width = ceilf (priv->width * priv->scale_factor);
|
*width = priv->width;
|
||||||
|
|
||||||
if (height != NULL)
|
if (height != NULL)
|
||||||
*height = ceilf (priv->height * priv->scale_factor);
|
*height = priv->height;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_content_iface_init (ClutterContentInterface *iface)
|
clutter_content_iface_init (ClutterContentIface *iface)
|
||||||
{
|
{
|
||||||
iface->invalidate = clutter_canvas_invalidate;
|
iface->invalidate = clutter_canvas_invalidate;
|
||||||
iface->paint_content = clutter_canvas_paint_content;
|
iface->paint_content = clutter_canvas_paint_content;
|
||||||
@@ -598,48 +560,3 @@ clutter_canvas_set_size (ClutterCanvas *canvas,
|
|||||||
|
|
||||||
return clutter_canvas_invalidate_internal (canvas, width, height);
|
return clutter_canvas_invalidate_internal (canvas, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_canvas_set_scale_factor:
|
|
||||||
* @canvas: a #ClutterCanvas
|
|
||||||
* @scale: the integer scaling factor of the canvas
|
|
||||||
*
|
|
||||||
* Sets the scaling factor of the @canvas, and invalidates the content.
|
|
||||||
*
|
|
||||||
* This function will cause the @canvas to be invalidated only
|
|
||||||
* if the scale factor of the canvas surface has changed.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_canvas_set_scale_factor (ClutterCanvas *canvas,
|
|
||||||
float scale)
|
|
||||||
{
|
|
||||||
g_return_if_fail (CLUTTER_IS_CANVAS (canvas));
|
|
||||||
g_return_if_fail (scale > 0.0f);
|
|
||||||
|
|
||||||
if (canvas->priv->scale_factor != scale)
|
|
||||||
{
|
|
||||||
canvas->priv->scale_factor = scale;
|
|
||||||
|
|
||||||
g_object_freeze_notify (G_OBJECT (canvas));
|
|
||||||
clutter_content_invalidate (CLUTTER_CONTENT (canvas));
|
|
||||||
g_object_thaw_notify (G_OBJECT (canvas));
|
|
||||||
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (canvas), obj_props[PROP_SCALE_FACTOR]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_canvas_get_scale_factor:
|
|
||||||
* @canvas: a #ClutterCanvas
|
|
||||||
*
|
|
||||||
* Gets the scale factor of the @canvas.
|
|
||||||
*
|
|
||||||
* Return value: the current @canvas scale factor or -1 if invalid
|
|
||||||
*/
|
|
||||||
float
|
|
||||||
clutter_canvas_get_scale_factor (ClutterCanvas *canvas)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_CANVAS (canvas), -1.0f);
|
|
||||||
|
|
||||||
return canvas->priv->scale_factor;
|
|
||||||
}
|
|
||||||
|
@@ -97,9 +97,9 @@ gboolean clutter_canvas_set_size (ClutterCanvas *
|
|||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_canvas_set_scale_factor (ClutterCanvas *canvas,
|
void clutter_canvas_set_scale_factor (ClutterCanvas *canvas,
|
||||||
float scale);
|
int scale);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
float clutter_canvas_get_scale_factor (ClutterCanvas *canvas);
|
int clutter_canvas_get_scale_factor (ClutterCanvas *canvas);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@@ -355,10 +355,6 @@ on_captured_event (ClutterActor *stage,
|
|||||||
|
|
||||||
switch (clutter_event_type (event))
|
switch (clutter_event_type (event))
|
||||||
{
|
{
|
||||||
case CLUTTER_TOUCH_CANCEL:
|
|
||||||
clutter_click_action_release (action);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_TOUCH_END:
|
case CLUTTER_TOUCH_END:
|
||||||
has_button = FALSE;
|
has_button = FALSE;
|
||||||
case CLUTTER_BUTTON_RELEASE:
|
case CLUTTER_BUTTON_RELEASE:
|
||||||
@@ -666,7 +662,8 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
|
|||||||
G_TYPE_FROM_CLASS (klass),
|
G_TYPE_FROM_CLASS (klass),
|
||||||
G_SIGNAL_RUN_LAST,
|
G_SIGNAL_RUN_LAST,
|
||||||
G_STRUCT_OFFSET (ClutterClickActionClass, clicked),
|
G_STRUCT_OFFSET (ClutterClickActionClass, clicked),
|
||||||
NULL, NULL, NULL,
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
CLUTTER_TYPE_ACTOR);
|
CLUTTER_TYPE_ACTOR);
|
||||||
|
|
||||||
|
@@ -252,13 +252,6 @@ clutter_clone_allocate (ClutterActor *self,
|
|||||||
if (priv->clone_source == NULL)
|
if (priv->clone_source == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* ClutterActor delays allocating until the actor is shown; however
|
|
||||||
* we cannot paint it correctly in that case, so force an allocation.
|
|
||||||
*/
|
|
||||||
if (clutter_actor_get_parent (priv->clone_source) != NULL &&
|
|
||||||
!clutter_actor_has_allocation (priv->clone_source))
|
|
||||||
clutter_actor_allocate_preferred_size (priv->clone_source, flags);
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* XXX - this is wrong: ClutterClone cannot clone unparented
|
/* XXX - this is wrong: ClutterClone cannot clone unparented
|
||||||
* actors, as it will break all invariants
|
* actors, as it will break all invariants
|
||||||
|
@@ -148,7 +148,6 @@ static void
|
|||||||
clutter_colorize_effect_paint_target (ClutterOffscreenEffect *effect)
|
clutter_colorize_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||||
{
|
{
|
||||||
ClutterColorizeEffect *self = CLUTTER_COLORIZE_EFFECT (effect);
|
ClutterColorizeEffect *self = CLUTTER_COLORIZE_EFFECT (effect);
|
||||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
|
||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
guint8 paint_opacity;
|
guint8 paint_opacity;
|
||||||
|
|
||||||
@@ -160,11 +159,11 @@ clutter_colorize_effect_paint_target (ClutterOffscreenEffect *effect)
|
|||||||
paint_opacity,
|
paint_opacity,
|
||||||
paint_opacity,
|
paint_opacity,
|
||||||
paint_opacity);
|
paint_opacity);
|
||||||
|
cogl_push_source (self->pipeline);
|
||||||
|
|
||||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
cogl_rectangle (0, 0, self->tex_width, self->tex_height);
|
||||||
self->pipeline,
|
|
||||||
0, 0,
|
cogl_pop_source ();
|
||||||
self->tex_width, self->tex_height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -293,7 +292,9 @@ clutter_colorize_effect_init (ClutterColorizeEffect *self)
|
|||||||
cogl_pipeline_add_snippet (klass->base_pipeline, snippet);
|
cogl_pipeline_add_snippet (klass->base_pipeline, snippet);
|
||||||
cogl_object_unref (snippet);
|
cogl_object_unref (snippet);
|
||||||
|
|
||||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline, 0);
|
cogl_pipeline_set_layer_null_texture (klass->base_pipeline,
|
||||||
|
0, /* layer number */
|
||||||
|
COGL_TEXTURE_TYPE_2D);
|
||||||
}
|
}
|
||||||
|
|
||||||
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
*
|
*
|
||||||
* Constraints can be used with fixed layout managers, like
|
* Constraints can be used with fixed layout managers, like
|
||||||
* #ClutterFixedLayout, or with actors implicitly using a fixed layout
|
* #ClutterFixedLayout, or with actors implicitly using a fixed layout
|
||||||
* manager, like #ClutterGroup and #ClutterStage.
|
* manager, like #ClutterStage.
|
||||||
*
|
*
|
||||||
* Constraints provide a way to build user interfaces by using
|
* Constraints provide a way to build user interfaces by using
|
||||||
* relations between #ClutterActors, without explicit fixed
|
* relations between #ClutterActors, without explicit fixed
|
||||||
|
@@ -197,7 +197,8 @@ clutter_container_default_init (ClutterContainerInterface *iface)
|
|||||||
iface_type,
|
iface_type,
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (ClutterContainerIface, actor_added),
|
G_STRUCT_OFFSET (ClutterContainerIface, actor_added),
|
||||||
NULL, NULL, NULL,
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
CLUTTER_TYPE_ACTOR);
|
CLUTTER_TYPE_ACTOR);
|
||||||
/**
|
/**
|
||||||
@@ -215,7 +216,8 @@ clutter_container_default_init (ClutterContainerInterface *iface)
|
|||||||
iface_type,
|
iface_type,
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (ClutterContainerIface, actor_removed),
|
G_STRUCT_OFFSET (ClutterContainerIface, actor_removed),
|
||||||
NULL, NULL, NULL,
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
CLUTTER_TYPE_ACTOR);
|
CLUTTER_TYPE_ACTOR);
|
||||||
|
|
||||||
|
@@ -38,13 +38,14 @@
|
|||||||
|
|
||||||
#include "clutter-build-config.h"
|
#include "clutter-build-config.h"
|
||||||
|
|
||||||
#include "clutter-actor-private.h"
|
|
||||||
#include "clutter-content-private.h"
|
#include "clutter-content-private.h"
|
||||||
|
|
||||||
#include "clutter-debug.h"
|
#include "clutter-debug.h"
|
||||||
#include "clutter-marshal.h"
|
#include "clutter-marshal.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
|
|
||||||
|
typedef struct _ClutterContentIface ClutterContentInterface;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ATTACHED,
|
ATTACHED,
|
||||||
@@ -90,11 +91,6 @@ clutter_content_real_invalidate (ClutterContent *content)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_content_real_invalidate_size (ClutterContent *content)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_content_real_paint_content (ClutterContent *content,
|
clutter_content_real_paint_content (ClutterContent *content,
|
||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
@@ -112,7 +108,6 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
|||||||
iface->attached = clutter_content_real_attached;
|
iface->attached = clutter_content_real_attached;
|
||||||
iface->detached = clutter_content_real_detached;
|
iface->detached = clutter_content_real_detached;
|
||||||
iface->invalidate = clutter_content_real_invalidate;
|
iface->invalidate = clutter_content_real_invalidate;
|
||||||
iface->invalidate_size = clutter_content_real_invalidate_size;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterContent::attached:
|
* ClutterContent::attached:
|
||||||
@@ -128,8 +123,9 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
|||||||
g_signal_new (I_("attached"),
|
g_signal_new (I_("attached"),
|
||||||
G_TYPE_FROM_INTERFACE (iface),
|
G_TYPE_FROM_INTERFACE (iface),
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (ClutterContentInterface, attached),
|
G_STRUCT_OFFSET (ClutterContentIface, attached),
|
||||||
NULL, NULL, NULL,
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
CLUTTER_TYPE_ACTOR);
|
CLUTTER_TYPE_ACTOR);
|
||||||
|
|
||||||
@@ -147,8 +143,9 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
|||||||
g_signal_new (I_("detached"),
|
g_signal_new (I_("detached"),
|
||||||
G_TYPE_FROM_INTERFACE (iface),
|
G_TYPE_FROM_INTERFACE (iface),
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (ClutterContentInterface, detached),
|
G_STRUCT_OFFSET (ClutterContentIface, detached),
|
||||||
NULL, NULL, NULL,
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
CLUTTER_TYPE_ACTOR);
|
CLUTTER_TYPE_ACTOR);
|
||||||
}
|
}
|
||||||
@@ -191,45 +188,6 @@ clutter_content_invalidate (ClutterContent *content)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_content_invalidate_size:
|
|
||||||
* @content: a #ClutterContent
|
|
||||||
*
|
|
||||||
* Signals that @content's size changed. Attached actors with request mode
|
|
||||||
* set to %CLUTTER_REQUEST_CONTENT_SIZE will have a relayout queued.
|
|
||||||
*
|
|
||||||
* Attached actors with other request modes are not redrawn. To redraw them
|
|
||||||
* too, use clutter_content_invalidate().
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_content_invalidate_size (ClutterContent *content)
|
|
||||||
{
|
|
||||||
ClutterActor *actor;
|
|
||||||
GHashTable *actors;
|
|
||||||
GHashTableIter iter;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_CONTENT (content));
|
|
||||||
|
|
||||||
CLUTTER_CONTENT_GET_IFACE (content)->invalidate_size (content);
|
|
||||||
|
|
||||||
actors = g_object_get_qdata (G_OBJECT (content), quark_content_actors);
|
|
||||||
if (actors == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
g_hash_table_iter_init (&iter, actors);
|
|
||||||
while (g_hash_table_iter_next (&iter, (gpointer *) &actor, NULL))
|
|
||||||
{
|
|
||||||
ClutterRequestMode request_mode;
|
|
||||||
|
|
||||||
g_assert (actor != NULL);
|
|
||||||
|
|
||||||
request_mode = clutter_actor_get_request_mode (actor);
|
|
||||||
|
|
||||||
if (request_mode == CLUTTER_REQUEST_CONTENT_SIZE)
|
|
||||||
_clutter_actor_queue_only_relayout (actor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*< private >
|
/*< private >
|
||||||
* _clutter_content_attached:
|
* _clutter_content_attached:
|
||||||
* @content: a #ClutterContent
|
* @content: a #ClutterContent
|
||||||
@@ -241,7 +199,7 @@ clutter_content_invalidate_size (ClutterContent *content)
|
|||||||
* is associated to a #ClutterContent, to set up a backpointer from
|
* is associated to a #ClutterContent, to set up a backpointer from
|
||||||
* the @content to the @actor.
|
* the @content to the @actor.
|
||||||
*
|
*
|
||||||
* This function will invoke the #ClutterContentInterface.attached() virtual
|
* This function will invoke the #ClutterContentIface.attached() virtual
|
||||||
* function.
|
* function.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
@@ -275,7 +233,7 @@ _clutter_content_attached (ClutterContent *content,
|
|||||||
* This function should be used internally every time a #ClutterActor
|
* This function should be used internally every time a #ClutterActor
|
||||||
* removes the association with a #ClutterContent.
|
* removes the association with a #ClutterContent.
|
||||||
*
|
*
|
||||||
* This function will invoke the #ClutterContentInterface.detached() virtual
|
* This function will invoke the #ClutterContentIface.detached() virtual
|
||||||
* function.
|
* function.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
@@ -304,7 +262,7 @@ _clutter_content_detached (ClutterContent *content,
|
|||||||
*
|
*
|
||||||
* Creates the render tree for the @content and @actor.
|
* Creates the render tree for the @content and @actor.
|
||||||
*
|
*
|
||||||
* This function will invoke the #ClutterContentInterface.paint_content()
|
* This function will invoke the #ClutterContentIface.paint_content()
|
||||||
* virtual function.
|
* virtual function.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
|
@@ -33,13 +33,24 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define CLUTTER_TYPE_CONTENT (clutter_content_get_type ())
|
#define CLUTTER_TYPE_CONTENT (clutter_content_get_type ())
|
||||||
|
#define CLUTTER_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_CONTENT, ClutterContent))
|
||||||
|
#define CLUTTER_IS_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_CONTENT))
|
||||||
|
#define CLUTTER_CONTENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_CONTENT, ClutterContentIface))
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
typedef struct _ClutterContentIface ClutterContentIface;
|
||||||
G_DECLARE_INTERFACE (ClutterContent, clutter_content, CLUTTER, CONTENT, GObject)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterContentInterface:
|
* ClutterContent:
|
||||||
|
*
|
||||||
|
* The #ClutterContent structure is an opaque type
|
||||||
|
* whose members cannot be acccessed directly.
|
||||||
|
*
|
||||||
|
* Since: 1.10
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterContentIface:
|
||||||
* @get_preferred_size: virtual function; should be overridden by subclasses
|
* @get_preferred_size: virtual function; should be overridden by subclasses
|
||||||
* of #ClutterContent that have a natural size
|
* of #ClutterContent that have a natural size
|
||||||
* @paint_content: virtual function; called each time the content needs to
|
* @paint_content: virtual function; called each time the content needs to
|
||||||
@@ -51,12 +62,12 @@ G_DECLARE_INTERFACE (ClutterContent, clutter_content, CLUTTER, CONTENT, GObject)
|
|||||||
* @invalidate: virtual function; called each time a #ClutterContent state
|
* @invalidate: virtual function; called each time a #ClutterContent state
|
||||||
* is changed.
|
* is changed.
|
||||||
*
|
*
|
||||||
* The #ClutterContentInterface structure contains only
|
* The #ClutterContentIface structure contains only
|
||||||
* private data.
|
* private data.
|
||||||
*
|
*
|
||||||
* Since: 1.10
|
* Since: 1.10
|
||||||
*/
|
*/
|
||||||
struct _ClutterContentInterface
|
struct _ClutterContentIface
|
||||||
{
|
{
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
GTypeInterface g_iface;
|
GTypeInterface g_iface;
|
||||||
@@ -75,10 +86,11 @@ struct _ClutterContentInterface
|
|||||||
ClutterActor *actor);
|
ClutterActor *actor);
|
||||||
|
|
||||||
void (* invalidate) (ClutterContent *content);
|
void (* invalidate) (ClutterContent *content);
|
||||||
|
|
||||||
void (* invalidate_size) (ClutterContent *content);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
GType clutter_content_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_content_get_preferred_size (ClutterContent *content,
|
gboolean clutter_content_get_preferred_size (ClutterContent *content,
|
||||||
gfloat *width,
|
gfloat *width,
|
||||||
@@ -86,9 +98,6 @@ gboolean clutter_content_get_preferred_size (ClutterContent *content
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_content_invalidate (ClutterContent *content);
|
void clutter_content_invalidate (ClutterContent *content);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void clutter_content_invalidate_size (ClutterContent *content);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_CONTENT_H__ */
|
#endif /* __CLUTTER_CONTENT_H__ */
|
||||||
|
@@ -6,8 +6,7 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_DEBUG_MISC = 1 << 0,
|
CLUTTER_DEBUG_MISC = 1 << 0,
|
||||||
CLUTTER_DEBUG_ACTOR = 1 << 1,
|
CLUTTER_DEBUG_ACTOR = 1 << 1,
|
||||||
CLUTTER_DEBUG_TEXTURE = 1 << 2,
|
CLUTTER_DEBUG_TEXTURE = 1 << 2,
|
||||||
@@ -27,13 +26,12 @@ typedef enum
|
|||||||
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 16
|
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 16
|
||||||
} ClutterDebugFlag;
|
} ClutterDebugFlag;
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_DEBUG_NOP_PICKING = 1 << 0,
|
CLUTTER_DEBUG_NOP_PICKING = 1 << 0,
|
||||||
|
CLUTTER_DEBUG_DUMP_PICK_BUFFERS = 1 << 1
|
||||||
} ClutterPickDebugFlag;
|
} ClutterPickDebugFlag;
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_DEBUG_DISABLE_SWAP_EVENTS = 1 << 0,
|
CLUTTER_DEBUG_DISABLE_SWAP_EVENTS = 1 << 0,
|
||||||
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS = 1 << 1,
|
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS = 1 << 1,
|
||||||
CLUTTER_DEBUG_REDRAWS = 1 << 2,
|
CLUTTER_DEBUG_REDRAWS = 1 << 2,
|
||||||
@@ -41,8 +39,7 @@ typedef enum
|
|||||||
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
|
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
|
||||||
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
|
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
|
||||||
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
|
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
|
||||||
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7,
|
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7
|
||||||
CLUTTER_DEBUG_PAINT_DAMAGE_REGION = 1 << 8,
|
|
||||||
} ClutterDrawDebugFlag;
|
} ClutterDrawDebugFlag;
|
||||||
|
|
||||||
#ifdef CLUTTER_ENABLE_DEBUG
|
#ifdef CLUTTER_ENABLE_DEBUG
|
||||||
@@ -82,9 +79,9 @@ extern guint clutter_pick_debug_flags;
|
|||||||
extern guint clutter_paint_debug_flags;
|
extern guint clutter_paint_debug_flags;
|
||||||
|
|
||||||
void _clutter_debug_messagev (const char *format,
|
void _clutter_debug_messagev (const char *format,
|
||||||
va_list var_args) G_GNUC_PRINTF (1, 0);
|
va_list var_args);
|
||||||
void _clutter_debug_message (const char *format,
|
void _clutter_debug_message (const char *format,
|
||||||
...) G_GNUC_PRINTF (1, 2);
|
...);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@@ -282,7 +282,6 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
|
|||||||
/* enable depth testing */
|
/* enable depth testing */
|
||||||
cogl_depth_state_init (&depth_state);
|
cogl_depth_state_init (&depth_state);
|
||||||
cogl_depth_state_set_test_enabled (&depth_state, TRUE);
|
cogl_depth_state_set_test_enabled (&depth_state, TRUE);
|
||||||
cogl_depth_state_set_test_function (&depth_state, COGL_DEPTH_TEST_FUNCTION_LEQUAL);
|
|
||||||
cogl_pipeline_set_depth_state (pipeline, &depth_state, NULL);
|
cogl_pipeline_set_depth_state (pipeline, &depth_state, NULL);
|
||||||
|
|
||||||
/* enable backface culling if we have a back material */
|
/* enable backface culling if we have a back material */
|
||||||
|
@@ -7,23 +7,26 @@
|
|||||||
#include "deprecated/clutter-alpha.h"
|
#include "deprecated/clutter-alpha.h"
|
||||||
#include "deprecated/clutter-animatable.h"
|
#include "deprecated/clutter-animatable.h"
|
||||||
#include "deprecated/clutter-animation.h"
|
#include "deprecated/clutter-animation.h"
|
||||||
|
#include "deprecated/clutter-backend.h"
|
||||||
#include "deprecated/clutter-behaviour.h"
|
#include "deprecated/clutter-behaviour.h"
|
||||||
#include "deprecated/clutter-behaviour-depth.h"
|
#include "deprecated/clutter-behaviour-depth.h"
|
||||||
|
#include "deprecated/clutter-behaviour-ellipse.h"
|
||||||
#include "deprecated/clutter-behaviour-opacity.h"
|
#include "deprecated/clutter-behaviour-opacity.h"
|
||||||
|
#include "deprecated/clutter-behaviour-path.h"
|
||||||
|
#include "deprecated/clutter-behaviour-rotate.h"
|
||||||
#include "deprecated/clutter-behaviour-scale.h"
|
#include "deprecated/clutter-behaviour-scale.h"
|
||||||
#include "deprecated/clutter-bin-layout.h"
|
#include "deprecated/clutter-bin-layout.h"
|
||||||
#include "deprecated/clutter-box.h"
|
|
||||||
#include "deprecated/clutter-cairo-texture.h"
|
#include "deprecated/clutter-cairo-texture.h"
|
||||||
#include "deprecated/clutter-container.h"
|
#include "deprecated/clutter-container.h"
|
||||||
#include "deprecated/clutter-group.h"
|
#include "deprecated/clutter-input-device.h"
|
||||||
#include "deprecated/clutter-keysyms.h"
|
#include "deprecated/clutter-keysyms.h"
|
||||||
|
#include "deprecated/clutter-main.h"
|
||||||
#include "deprecated/clutter-rectangle.h"
|
#include "deprecated/clutter-rectangle.h"
|
||||||
#include "deprecated/clutter-stage-manager.h"
|
#include "deprecated/clutter-stage-manager.h"
|
||||||
#include "deprecated/clutter-stage.h"
|
#include "deprecated/clutter-stage.h"
|
||||||
#include "deprecated/clutter-state.h"
|
|
||||||
#include "deprecated/clutter-table-layout.h"
|
|
||||||
#include "deprecated/clutter-texture.h"
|
#include "deprecated/clutter-texture.h"
|
||||||
#include "deprecated/clutter-timeline.h"
|
#include "deprecated/clutter-timeline.h"
|
||||||
|
#include "deprecated/clutter-util.h"
|
||||||
|
|
||||||
#undef __CLUTTER_DEPRECATED_H_INSIDE__
|
#undef __CLUTTER_DEPRECATED_H_INSIDE__
|
||||||
|
|
||||||
|
@@ -155,7 +155,6 @@ static void
|
|||||||
clutter_desaturate_effect_paint_target (ClutterOffscreenEffect *effect)
|
clutter_desaturate_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||||
{
|
{
|
||||||
ClutterDesaturateEffect *self = CLUTTER_DESATURATE_EFFECT (effect);
|
ClutterDesaturateEffect *self = CLUTTER_DESATURATE_EFFECT (effect);
|
||||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
|
||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
CoglHandle texture;
|
CoglHandle texture;
|
||||||
guint8 paint_opacity;
|
guint8 paint_opacity;
|
||||||
@@ -171,12 +170,13 @@ clutter_desaturate_effect_paint_target (ClutterOffscreenEffect *effect)
|
|||||||
paint_opacity,
|
paint_opacity,
|
||||||
paint_opacity,
|
paint_opacity,
|
||||||
paint_opacity);
|
paint_opacity);
|
||||||
|
cogl_push_source (self->pipeline);
|
||||||
|
|
||||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
cogl_rectangle (0, 0,
|
||||||
self->pipeline,
|
cogl_texture_get_width (texture),
|
||||||
0, 0,
|
cogl_texture_get_height (texture));
|
||||||
cogl_texture_get_width (texture),
|
|
||||||
cogl_texture_get_height (texture));
|
cogl_pop_source ();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -297,7 +297,9 @@ clutter_desaturate_effect_init (ClutterDesaturateEffect *self)
|
|||||||
cogl_pipeline_add_snippet (klass->base_pipeline, snippet);
|
cogl_pipeline_add_snippet (klass->base_pipeline, snippet);
|
||||||
cogl_object_unref (snippet);
|
cogl_object_unref (snippet);
|
||||||
|
|
||||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline, 0);
|
cogl_pipeline_set_layer_null_texture (klass->base_pipeline,
|
||||||
|
0, /* layer number */
|
||||||
|
COGL_TEXTURE_TYPE_2D);
|
||||||
}
|
}
|
||||||
|
|
||||||
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
||||||
|
@@ -69,23 +69,6 @@ typedef struct _ClutterTouchInfo
|
|||||||
gfloat current_y;
|
gfloat current_y;
|
||||||
} ClutterTouchInfo;
|
} ClutterTouchInfo;
|
||||||
|
|
||||||
typedef struct _ClutterPtrA11yData
|
|
||||||
{
|
|
||||||
int n_btn_pressed;
|
|
||||||
float current_x;
|
|
||||||
float current_y;
|
|
||||||
|
|
||||||
float dwell_x;
|
|
||||||
float dwell_y;
|
|
||||||
gboolean dwell_drag_started;
|
|
||||||
gboolean dwell_gesture_started;
|
|
||||||
guint dwell_timer;
|
|
||||||
guint dwell_position_timer;
|
|
||||||
|
|
||||||
guint secondary_click_timer;
|
|
||||||
gboolean secondary_click_triggered;
|
|
||||||
} ClutterPtrA11yData;
|
|
||||||
|
|
||||||
struct _ClutterInputDevice
|
struct _ClutterInputDevice
|
||||||
{
|
{
|
||||||
GObject parent_instance;
|
GObject parent_instance;
|
||||||
@@ -160,10 +143,6 @@ struct _ClutterInputDevice
|
|||||||
|
|
||||||
guint has_cursor : 1;
|
guint has_cursor : 1;
|
||||||
guint is_enabled : 1;
|
guint is_enabled : 1;
|
||||||
|
|
||||||
/* Accessiblity */
|
|
||||||
ClutterVirtualInputDevice *accessibility_virtual_device;
|
|
||||||
ClutterPtrA11yData *ptr_a11y_data;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (*ClutterEmitInputDeviceEvent) (ClutterEvent *event,
|
typedef void (*ClutterEmitInputDeviceEvent) (ClutterEvent *event,
|
||||||
@@ -194,15 +173,34 @@ struct _ClutterInputDeviceClass
|
|||||||
ClutterEmitInputDeviceEvent emit_event_func);
|
ClutterEmitInputDeviceEvent emit_event_func);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Platform-dependent interface */
|
||||||
|
typedef struct _ClutterEventExtender ClutterEventExtender;
|
||||||
|
typedef struct _ClutterEventExtenderInterface ClutterEventExtenderInterface;
|
||||||
|
|
||||||
|
#define CLUTTER_TYPE_EVENT_EXTENDER (clutter_event_extender_get_type ())
|
||||||
|
#define CLUTTER_EVENT_EXTENDER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CLUTTER_TYPE_EVENT_EXTENDER, ClutterEventExtender))
|
||||||
|
#define CLUTTER_IS_EVENT_EXTENDER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CLUTTER_TYPE_EVENT_EXTENDER))
|
||||||
|
#define CLUTTER_EVENT_EXTENDER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), CLUTTER_TYPE_EVENT_EXTENDER, ClutterEventExtenderInterface))
|
||||||
|
|
||||||
|
struct _ClutterEventExtenderInterface
|
||||||
|
{
|
||||||
|
GTypeInterface g_iface;
|
||||||
|
|
||||||
|
void (* copy_event_data) (ClutterEventExtender *event_extender,
|
||||||
|
const ClutterEvent *src,
|
||||||
|
ClutterEvent *dest);
|
||||||
|
void (* free_event_data) (ClutterEventExtender *event_extender,
|
||||||
|
ClutterEvent *event);
|
||||||
|
};
|
||||||
|
|
||||||
|
GType clutter_event_extender_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
/* device manager */
|
/* device manager */
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_device_manager_add_device (ClutterDeviceManager *device_manager,
|
void _clutter_device_manager_add_device (ClutterDeviceManager *device_manager,
|
||||||
ClutterInputDevice *device);
|
ClutterInputDevice *device);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_device_manager_remove_device (ClutterDeviceManager *device_manager,
|
void _clutter_device_manager_remove_device (ClutterDeviceManager *device_manager,
|
||||||
ClutterInputDevice *device);
|
ClutterInputDevice *device);
|
||||||
void _clutter_device_manager_update_devices (ClutterDeviceManager *device_manager);
|
void _clutter_device_manager_update_devices (ClutterDeviceManager *device_manager);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_device_manager_select_stage_events (ClutterDeviceManager *device_manager,
|
void _clutter_device_manager_select_stage_events (ClutterDeviceManager *device_manager,
|
||||||
ClutterStage *stage);
|
ClutterStage *stage);
|
||||||
ClutterBackend *_clutter_device_manager_get_backend (ClutterDeviceManager *device_manager);
|
ClutterBackend *_clutter_device_manager_get_backend (ClutterDeviceManager *device_manager);
|
||||||
@@ -210,35 +208,25 @@ ClutterBackend *_clutter_device_manager_get_backend (ClutterDeviceMa
|
|||||||
void _clutter_device_manager_compress_motion (ClutterDeviceManager *device_manger,
|
void _clutter_device_manager_compress_motion (ClutterDeviceManager *device_manger,
|
||||||
ClutterEvent *event,
|
ClutterEvent *event,
|
||||||
const ClutterEvent *to_discard);
|
const ClutterEvent *to_discard);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void clutter_device_manager_ensure_a11y_state (ClutterDeviceManager *device_manager);
|
|
||||||
|
|
||||||
/* input device */
|
/* input device */
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean _clutter_input_device_has_sequence (ClutterInputDevice *device,
|
gboolean _clutter_input_device_has_sequence (ClutterInputDevice *device,
|
||||||
ClutterEventSequence *sequence);
|
ClutterEventSequence *sequence);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_device_add_event_sequence (ClutterInputDevice *device,
|
void _clutter_input_device_add_event_sequence (ClutterInputDevice *device,
|
||||||
ClutterEvent *event);
|
ClutterEvent *event);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_device_remove_event_sequence (ClutterInputDevice *device,
|
void _clutter_input_device_remove_event_sequence (ClutterInputDevice *device,
|
||||||
ClutterEvent *event);
|
ClutterEvent *event);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_device_set_coords (ClutterInputDevice *device,
|
void _clutter_input_device_set_coords (ClutterInputDevice *device,
|
||||||
ClutterEventSequence *sequence,
|
ClutterEventSequence *sequence,
|
||||||
gfloat x,
|
gfloat x,
|
||||||
gfloat y,
|
gfloat y,
|
||||||
ClutterStage *stage);
|
ClutterStage *stage);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_device_set_state (ClutterInputDevice *device,
|
void _clutter_input_device_set_state (ClutterInputDevice *device,
|
||||||
ClutterModifierType state);
|
ClutterModifierType state);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_device_set_time (ClutterInputDevice *device,
|
void _clutter_input_device_set_time (ClutterInputDevice *device,
|
||||||
guint32 time_);
|
guint32 time_);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_device_set_stage (ClutterInputDevice *device,
|
void _clutter_input_device_set_stage (ClutterInputDevice *device,
|
||||||
ClutterStage *stage);
|
ClutterStage *stage);
|
||||||
CLUTTER_EXPORT
|
|
||||||
ClutterStage * _clutter_input_device_get_stage (ClutterInputDevice *device);
|
ClutterStage * _clutter_input_device_get_stage (ClutterInputDevice *device);
|
||||||
void _clutter_input_device_set_actor (ClutterInputDevice *device,
|
void _clutter_input_device_set_actor (ClutterInputDevice *device,
|
||||||
ClutterEventSequence *sequence,
|
ClutterEventSequence *sequence,
|
||||||
@@ -247,57 +235,44 @@ void _clutter_input_device_set_actor (ClutterInputDev
|
|||||||
ClutterActor * _clutter_input_device_update (ClutterInputDevice *device,
|
ClutterActor * _clutter_input_device_update (ClutterInputDevice *device,
|
||||||
ClutterEventSequence *sequence,
|
ClutterEventSequence *sequence,
|
||||||
gboolean emit_crossing);
|
gboolean emit_crossing);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_device_set_n_keys (ClutterInputDevice *device,
|
void _clutter_input_device_set_n_keys (ClutterInputDevice *device,
|
||||||
guint n_keys);
|
guint n_keys);
|
||||||
CLUTTER_EXPORT
|
|
||||||
guint _clutter_input_device_add_axis (ClutterInputDevice *device,
|
guint _clutter_input_device_add_axis (ClutterInputDevice *device,
|
||||||
ClutterInputAxis axis,
|
ClutterInputAxis axis,
|
||||||
gdouble min_value,
|
gdouble min_value,
|
||||||
gdouble max_value,
|
gdouble max_value,
|
||||||
gdouble resolution);
|
gdouble resolution);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_device_reset_axes (ClutterInputDevice *device);
|
void _clutter_input_device_reset_axes (ClutterInputDevice *device);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_device_set_associated_device (ClutterInputDevice *device,
|
void _clutter_input_device_set_associated_device (ClutterInputDevice *device,
|
||||||
ClutterInputDevice *associated);
|
ClutterInputDevice *associated);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_device_add_slave (ClutterInputDevice *master,
|
void _clutter_input_device_add_slave (ClutterInputDevice *master,
|
||||||
ClutterInputDevice *slave);
|
ClutterInputDevice *slave);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_device_remove_slave (ClutterInputDevice *master,
|
void _clutter_input_device_remove_slave (ClutterInputDevice *master,
|
||||||
ClutterInputDevice *slave);
|
ClutterInputDevice *slave);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean _clutter_input_device_translate_axis (ClutterInputDevice *device,
|
gboolean _clutter_input_device_translate_axis (ClutterInputDevice *device,
|
||||||
guint index_,
|
guint index_,
|
||||||
gdouble value,
|
gdouble value,
|
||||||
gdouble *axis_value);
|
gdouble *axis_value);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_device_add_scroll_info (ClutterInputDevice *device,
|
void _clutter_input_device_add_scroll_info (ClutterInputDevice *device,
|
||||||
guint index_,
|
guint index_,
|
||||||
ClutterScrollDirection direction,
|
ClutterScrollDirection direction,
|
||||||
gdouble increment);
|
gdouble increment);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_device_reset_scroll_info (ClutterInputDevice *device);
|
void _clutter_input_device_reset_scroll_info (ClutterInputDevice *device);
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean _clutter_input_device_get_scroll_delta (ClutterInputDevice *device,
|
gboolean _clutter_input_device_get_scroll_delta (ClutterInputDevice *device,
|
||||||
guint index_,
|
guint index_,
|
||||||
gdouble value,
|
gdouble value,
|
||||||
ClutterScrollDirection *direction_p,
|
ClutterScrollDirection *direction_p,
|
||||||
gdouble *delta_p);
|
gdouble *delta_p);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
ClutterInputDeviceTool * clutter_input_device_lookup_tool (ClutterInputDevice *device,
|
ClutterInputDeviceTool * clutter_input_device_lookup_tool (ClutterInputDevice *device,
|
||||||
guint64 serial,
|
guint64 serial,
|
||||||
ClutterInputDeviceToolType type);
|
ClutterInputDeviceToolType type);
|
||||||
CLUTTER_EXPORT
|
|
||||||
void clutter_input_device_add_tool (ClutterInputDevice *device,
|
void clutter_input_device_add_tool (ClutterInputDevice *device,
|
||||||
ClutterInputDeviceTool *tool);
|
ClutterInputDeviceTool *tool);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void clutter_input_device_update_from_tool (ClutterInputDevice *device,
|
void clutter_input_device_update_from_tool (ClutterInputDevice *device,
|
||||||
ClutterInputDeviceTool *tool);
|
ClutterInputDeviceTool *tool);
|
||||||
|
|
||||||
|
@@ -47,7 +47,6 @@
|
|||||||
#include "clutter-stage-private.h"
|
#include "clutter-stage-private.h"
|
||||||
#include "clutter-virtual-input-device.h"
|
#include "clutter-virtual-input-device.h"
|
||||||
#include "clutter-input-device-tool.h"
|
#include "clutter-input-device-tool.h"
|
||||||
#include "clutter-input-pointer-a11y-private.h"
|
|
||||||
|
|
||||||
struct _ClutterDeviceManagerPrivate
|
struct _ClutterDeviceManagerPrivate
|
||||||
{
|
{
|
||||||
@@ -56,8 +55,6 @@ struct _ClutterDeviceManagerPrivate
|
|||||||
|
|
||||||
/* Keyboard a11y */
|
/* Keyboard a11y */
|
||||||
ClutterKbdA11ySettings kbd_a11y_settings;
|
ClutterKbdA11ySettings kbd_a11y_settings;
|
||||||
/* Pointer a11y */
|
|
||||||
ClutterPointerA11ySettings pointer_a11y_settings;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@@ -78,9 +75,6 @@ enum
|
|||||||
TOOL_CHANGED,
|
TOOL_CHANGED,
|
||||||
KBD_A11Y_MASK_CHANGED,
|
KBD_A11Y_MASK_CHANGED,
|
||||||
KBD_A11Y_FLAGS_CHANGED,
|
KBD_A11Y_FLAGS_CHANGED,
|
||||||
PTR_A11Y_DWELL_CLICK_TYPE_CHANGED,
|
|
||||||
PTR_A11Y_TIMEOUT_STARTED,
|
|
||||||
PTR_A11Y_TIMEOUT_STOPPED,
|
|
||||||
|
|
||||||
LAST_SIGNAL
|
LAST_SIGNAL
|
||||||
};
|
};
|
||||||
@@ -91,14 +85,22 @@ G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterDeviceManager,
|
|||||||
clutter_device_manager,
|
clutter_device_manager,
|
||||||
G_TYPE_OBJECT)
|
G_TYPE_OBJECT)
|
||||||
|
|
||||||
|
G_DEFINE_INTERFACE (ClutterEventExtender,
|
||||||
|
clutter_event_extender,
|
||||||
|
CLUTTER_TYPE_DEVICE_MANAGER)
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_event_extender_default_init (ClutterEventExtenderInterface *iface)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_device_manager_set_property (GObject *gobject,
|
clutter_device_manager_set_property (GObject *gobject,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
ClutterDeviceManager *self = CLUTTER_DEVICE_MANAGER (gobject);
|
ClutterDeviceManagerPrivate *priv = CLUTTER_DEVICE_MANAGER (gobject)->priv;
|
||||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (self);
|
|
||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
@@ -117,8 +119,7 @@ clutter_device_manager_get_property (GObject *gobject,
|
|||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
ClutterDeviceManager *self = CLUTTER_DEVICE_MANAGER (gobject);
|
ClutterDeviceManagerPrivate *priv = CLUTTER_DEVICE_MANAGER (gobject)->priv;
|
||||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (self);
|
|
||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
@@ -164,7 +165,8 @@ clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
|
|||||||
G_TYPE_FROM_CLASS (klass),
|
G_TYPE_FROM_CLASS (klass),
|
||||||
G_SIGNAL_RUN_LAST,
|
G_SIGNAL_RUN_LAST,
|
||||||
0,
|
0,
|
||||||
NULL, NULL, NULL,
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
CLUTTER_TYPE_INPUT_DEVICE);
|
CLUTTER_TYPE_INPUT_DEVICE);
|
||||||
|
|
||||||
@@ -183,7 +185,8 @@ clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
|
|||||||
G_TYPE_FROM_CLASS (klass),
|
G_TYPE_FROM_CLASS (klass),
|
||||||
G_SIGNAL_RUN_LAST,
|
G_SIGNAL_RUN_LAST,
|
||||||
0,
|
0,
|
||||||
NULL, NULL, NULL,
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
CLUTTER_TYPE_INPUT_DEVICE);
|
CLUTTER_TYPE_INPUT_DEVICE);
|
||||||
|
|
||||||
@@ -236,74 +239,12 @@ clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
|
|||||||
G_TYPE_NONE, 2,
|
G_TYPE_NONE, 2,
|
||||||
G_TYPE_UINT,
|
G_TYPE_UINT,
|
||||||
G_TYPE_UINT);
|
G_TYPE_UINT);
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterDeviceManager::ptr-a11y-dwell-click-type-changed:
|
|
||||||
* @manager: the #ClutterDeviceManager that emitted the signal
|
|
||||||
* @click_type: the new #ClutterPointerA11yDwellClickType mode
|
|
||||||
*
|
|
||||||
* The ::ptr-a11y-dwell-click-type-changed signal is emitted each time
|
|
||||||
* the ClutterPointerA11yDwellClickType mode is changed as the result
|
|
||||||
* of pointer accessibility operations.
|
|
||||||
*/
|
|
||||||
manager_signals[PTR_A11Y_DWELL_CLICK_TYPE_CHANGED] =
|
|
||||||
g_signal_new (I_("ptr-a11y-dwell-click-type-changed"),
|
|
||||||
G_TYPE_FROM_CLASS (klass),
|
|
||||||
G_SIGNAL_RUN_LAST,
|
|
||||||
0, NULL, NULL,
|
|
||||||
g_cclosure_marshal_VOID__FLAGS,
|
|
||||||
G_TYPE_NONE, 1,
|
|
||||||
CLUTTER_TYPE_POINTER_A11Y_DWELL_CLICK_TYPE);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterDeviceManager::ptr-a11y-timeout-started:
|
|
||||||
* @manager: the #ClutterDeviceManager that emitted the signal
|
|
||||||
* @device: the core pointer #ClutterInputDevice
|
|
||||||
* @timeout_type: the type of timeout #ClutterPointerA11yTimeoutType
|
|
||||||
* @delay: the delay in ms before secondary-click is triggered.
|
|
||||||
*
|
|
||||||
* The ::ptr-a11y-timeout-started signal is emitted when a
|
|
||||||
* pointer accessibility timeout delay is started, so that upper
|
|
||||||
* layers can notify the user with some visual feedback.
|
|
||||||
*/
|
|
||||||
manager_signals[PTR_A11Y_TIMEOUT_STARTED] =
|
|
||||||
g_signal_new (I_("ptr-a11y-timeout-started"),
|
|
||||||
G_TYPE_FROM_CLASS (klass),
|
|
||||||
G_SIGNAL_RUN_LAST,
|
|
||||||
0, NULL, NULL,
|
|
||||||
_clutter_marshal_VOID__OBJECT_FLAGS_UINT,
|
|
||||||
G_TYPE_NONE, 3,
|
|
||||||
CLUTTER_TYPE_INPUT_DEVICE,
|
|
||||||
CLUTTER_TYPE_POINTER_A11Y_TIMEOUT_TYPE,
|
|
||||||
G_TYPE_UINT);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterDeviceManager::ptr-a11y-timeout-stopped:
|
|
||||||
* @manager: the #ClutterDeviceManager that emitted the signal
|
|
||||||
* @device: the core pointer #ClutterInputDevice
|
|
||||||
* @timeout_type: the type of timeout #ClutterPointerA11yTimeoutType
|
|
||||||
* @clicked: %TRUE if the timeout finished and triggered a click
|
|
||||||
*
|
|
||||||
* The ::ptr-a11y-timeout-stopped signal is emitted when a running
|
|
||||||
* pointer accessibility timeout delay is stopped, either because
|
|
||||||
* it's triggered at the end of the delay or cancelled, so that
|
|
||||||
* upper layers can notify the user with some visual feedback.
|
|
||||||
*/
|
|
||||||
manager_signals[PTR_A11Y_TIMEOUT_STOPPED] =
|
|
||||||
g_signal_new (I_("ptr-a11y-timeout-stopped"),
|
|
||||||
G_TYPE_FROM_CLASS (klass),
|
|
||||||
G_SIGNAL_RUN_LAST,
|
|
||||||
0, NULL, NULL,
|
|
||||||
_clutter_marshal_VOID__OBJECT_FLAGS_BOOLEAN,
|
|
||||||
G_TYPE_NONE, 3,
|
|
||||||
CLUTTER_TYPE_INPUT_DEVICE,
|
|
||||||
CLUTTER_TYPE_POINTER_A11Y_TIMEOUT_TYPE,
|
|
||||||
G_TYPE_BOOLEAN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_device_manager_init (ClutterDeviceManager *self)
|
clutter_device_manager_init (ClutterDeviceManager *self)
|
||||||
{
|
{
|
||||||
|
self->priv = clutter_device_manager_get_instance_private (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -322,7 +263,7 @@ clutter_device_manager_get_default (void)
|
|||||||
{
|
{
|
||||||
ClutterBackend *backend = clutter_get_default_backend ();
|
ClutterBackend *backend = clutter_get_default_backend ();
|
||||||
|
|
||||||
return CLUTTER_BACKEND_GET_CLASS (backend)->get_device_manager (backend);
|
return backend->device_manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -546,11 +487,9 @@ _clutter_device_manager_update_devices (ClutterDeviceManager *device_manager)
|
|||||||
ClutterBackend *
|
ClutterBackend *
|
||||||
_clutter_device_manager_get_backend (ClutterDeviceManager *manager)
|
_clutter_device_manager_get_backend (ClutterDeviceManager *manager)
|
||||||
{
|
{
|
||||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (manager);
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (manager), NULL);
|
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (manager), NULL);
|
||||||
|
|
||||||
return priv->backend;
|
return manager->priv->backend;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -607,25 +546,17 @@ _clutter_device_manager_compress_motion (ClutterDeviceManager *device_manager,
|
|||||||
manager_class->compress_motion (device_manager, event, to_discard);
|
manager_class->compress_motion (device_manager, event, to_discard);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
clutter_device_manager_ensure_a11y_state (ClutterDeviceManager *device_manager)
|
|
||||||
{
|
|
||||||
ClutterInputDevice *core_pointer;
|
|
||||||
|
|
||||||
core_pointer = clutter_device_manager_get_core_device (device_manager,
|
|
||||||
CLUTTER_POINTER_DEVICE);
|
|
||||||
if (core_pointer)
|
|
||||||
{
|
|
||||||
if (_clutter_is_input_pointer_a11y_enabled (core_pointer))
|
|
||||||
_clutter_input_pointer_a11y_add_device (core_pointer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
are_kbd_a11y_settings_equal (ClutterKbdA11ySettings *a,
|
are_kbd_a11y_settings_equal (ClutterKbdA11ySettings *a,
|
||||||
ClutterKbdA11ySettings *b)
|
ClutterKbdA11ySettings *b)
|
||||||
{
|
{
|
||||||
return (memcmp (a, b, sizeof (ClutterKbdA11ySettings)) == 0);
|
return (a->controls == b->controls &&
|
||||||
|
a->slowkeys_delay == b->slowkeys_delay &&
|
||||||
|
a->debounce_delay == b->debounce_delay &&
|
||||||
|
a->timeout_delay == b->timeout_delay &&
|
||||||
|
a->mousekeys_init_delay == b->mousekeys_init_delay &&
|
||||||
|
a->mousekeys_max_speed == b->mousekeys_max_speed &&
|
||||||
|
a->mousekeys_accel_time == b->mousekeys_accel_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -633,14 +564,13 @@ clutter_device_manager_set_kbd_a11y_settings (ClutterDeviceManager *device_man
|
|||||||
ClutterKbdA11ySettings *settings)
|
ClutterKbdA11ySettings *settings)
|
||||||
{
|
{
|
||||||
ClutterDeviceManagerClass *manager_class;
|
ClutterDeviceManagerClass *manager_class;
|
||||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (device_manager);
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||||
|
|
||||||
if (are_kbd_a11y_settings_equal (&priv->kbd_a11y_settings, settings))
|
if (are_kbd_a11y_settings_equal (&device_manager->priv->kbd_a11y_settings, settings))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
priv->kbd_a11y_settings = *settings;
|
device_manager->priv->kbd_a11y_settings = *settings;
|
||||||
|
|
||||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||||
if (manager_class->apply_kbd_a11y_settings)
|
if (manager_class->apply_kbd_a11y_settings)
|
||||||
@@ -651,103 +581,7 @@ void
|
|||||||
clutter_device_manager_get_kbd_a11y_settings (ClutterDeviceManager *device_manager,
|
clutter_device_manager_get_kbd_a11y_settings (ClutterDeviceManager *device_manager,
|
||||||
ClutterKbdA11ySettings *settings)
|
ClutterKbdA11ySettings *settings)
|
||||||
{
|
{
|
||||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (device_manager);
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||||
|
|
||||||
*settings = priv->kbd_a11y_settings;
|
*settings = device_manager->priv->kbd_a11y_settings;
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
are_pointer_a11y_settings_equal (ClutterPointerA11ySettings *a,
|
|
||||||
ClutterPointerA11ySettings *b)
|
|
||||||
{
|
|
||||||
return (memcmp (a, b, sizeof (ClutterPointerA11ySettings)) == 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_device_manager_enable_pointer_a11y (ClutterDeviceManager *device_manager)
|
|
||||||
{
|
|
||||||
ClutterInputDevice *core_pointer;
|
|
||||||
|
|
||||||
core_pointer = clutter_device_manager_get_core_device (device_manager,
|
|
||||||
CLUTTER_POINTER_DEVICE);
|
|
||||||
|
|
||||||
_clutter_input_pointer_a11y_add_device (core_pointer);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_device_manager_disable_pointer_a11y (ClutterDeviceManager *device_manager)
|
|
||||||
{
|
|
||||||
ClutterInputDevice *core_pointer;
|
|
||||||
|
|
||||||
core_pointer = clutter_device_manager_get_core_device (device_manager,
|
|
||||||
CLUTTER_POINTER_DEVICE);
|
|
||||||
|
|
||||||
_clutter_input_pointer_a11y_remove_device (core_pointer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_device_manager_set_pointer_a11y_settings:
|
|
||||||
* @device_manager: a #ClutterDeviceManager
|
|
||||||
* @settings: a pointer to a #ClutterPointerA11ySettings
|
|
||||||
*
|
|
||||||
* Sets the pointer accessibility settings
|
|
||||||
**/
|
|
||||||
void
|
|
||||||
clutter_device_manager_set_pointer_a11y_settings (ClutterDeviceManager *device_manager,
|
|
||||||
ClutterPointerA11ySettings *settings)
|
|
||||||
{
|
|
||||||
ClutterDeviceManagerPrivate *priv =
|
|
||||||
clutter_device_manager_get_instance_private (device_manager);
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
|
||||||
|
|
||||||
if (are_pointer_a11y_settings_equal (&priv->pointer_a11y_settings, settings))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (priv->pointer_a11y_settings.controls == 0 && settings->controls != 0)
|
|
||||||
clutter_device_manager_enable_pointer_a11y (device_manager);
|
|
||||||
else if (priv->pointer_a11y_settings.controls != 0 && settings->controls == 0)
|
|
||||||
clutter_device_manager_disable_pointer_a11y (device_manager);
|
|
||||||
|
|
||||||
priv->pointer_a11y_settings = *settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_device_manager_get_pointer_a11y_settings:
|
|
||||||
* @device_manager: a #ClutterDeviceManager
|
|
||||||
* @settings: a pointer to a #ClutterPointerA11ySettings
|
|
||||||
*
|
|
||||||
* Gets the current pointer accessibility settings
|
|
||||||
**/
|
|
||||||
void
|
|
||||||
clutter_device_manager_get_pointer_a11y_settings (ClutterDeviceManager *device_manager,
|
|
||||||
ClutterPointerA11ySettings *settings)
|
|
||||||
{
|
|
||||||
ClutterDeviceManagerPrivate *priv =
|
|
||||||
clutter_device_manager_get_instance_private (device_manager);
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
|
||||||
|
|
||||||
*settings = priv->pointer_a11y_settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_device_manager_set_pointer_a11y_dwell_click_type:
|
|
||||||
* @device_manager: a #ClutterDeviceManager
|
|
||||||
* @click_type: type of click as #ClutterPointerA11yDwellClickType
|
|
||||||
*
|
|
||||||
* Sets the dwell click type
|
|
||||||
**/
|
|
||||||
void
|
|
||||||
clutter_device_manager_set_pointer_a11y_dwell_click_type (ClutterDeviceManager *device_manager,
|
|
||||||
ClutterPointerA11yDwellClickType click_type)
|
|
||||||
{
|
|
||||||
ClutterDeviceManagerPrivate *priv =
|
|
||||||
clutter_device_manager_get_instance_private (device_manager);
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
|
||||||
|
|
||||||
priv->pointer_a11y_settings.dwell_click_type = click_type;
|
|
||||||
}
|
}
|
||||||
|
@@ -33,12 +33,16 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define CLUTTER_TYPE_DEVICE_MANAGER (clutter_device_manager_get_type ())
|
#define CLUTTER_TYPE_DEVICE_MANAGER (clutter_device_manager_get_type ())
|
||||||
CLUTTER_EXPORT
|
#define CLUTTER_DEVICE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_DEVICE_MANAGER, ClutterDeviceManager))
|
||||||
G_DECLARE_DERIVABLE_TYPE (ClutterDeviceManager, clutter_device_manager,
|
#define CLUTTER_IS_DEVICE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_DEVICE_MANAGER))
|
||||||
CLUTTER, DEVICE_MANAGER, GObject)
|
#define CLUTTER_DEVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_DEVICE_MANAGER, ClutterDeviceManagerClass))
|
||||||
|
#define CLUTTER_IS_DEVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_DEVICE_MANAGER))
|
||||||
|
#define CLUTTER_DEVICE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_DEVICE_MANAGER, ClutterDeviceManagerClass))
|
||||||
|
|
||||||
|
typedef struct _ClutterDeviceManager ClutterDeviceManager;
|
||||||
typedef struct _ClutterDeviceManagerPrivate ClutterDeviceManagerPrivate;
|
typedef struct _ClutterDeviceManagerPrivate ClutterDeviceManagerPrivate;
|
||||||
|
typedef struct _ClutterDeviceManagerClass ClutterDeviceManagerClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterVirtualDeviceType:
|
* ClutterVirtualDeviceType:
|
||||||
@@ -70,25 +74,19 @@ typedef struct _ClutterKbdA11ySettings
|
|||||||
} ClutterKbdA11ySettings;
|
} ClutterKbdA11ySettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterPointerA11ySettings:
|
* ClutterDeviceManager:
|
||||||
*
|
*
|
||||||
* The #ClutterPointerA11ySettings structure contains pointer accessibility
|
* The #ClutterDeviceManager structure contains only private data
|
||||||
* settings
|
|
||||||
*
|
*
|
||||||
|
* Since: 1.2
|
||||||
*/
|
*/
|
||||||
typedef struct _ClutterPointerA11ySettings
|
struct _ClutterDeviceManager
|
||||||
{
|
{
|
||||||
ClutterPointerA11yFlags controls;
|
/*< private >*/
|
||||||
ClutterPointerA11yDwellClickType dwell_click_type;
|
GObject parent_instance;
|
||||||
ClutterPointerA11yDwellMode dwell_mode;
|
|
||||||
ClutterPointerA11yDwellDirection dwell_gesture_single;
|
ClutterDeviceManagerPrivate *priv;
|
||||||
ClutterPointerA11yDwellDirection dwell_gesture_double;
|
};
|
||||||
ClutterPointerA11yDwellDirection dwell_gesture_drag;
|
|
||||||
ClutterPointerA11yDwellDirection dwell_gesture_secondary;
|
|
||||||
gint secondary_click_delay;
|
|
||||||
gint dwell_delay;
|
|
||||||
gint dwell_threshold;
|
|
||||||
} ClutterPointerA11ySettings;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterDeviceManagerClass:
|
* ClutterDeviceManagerClass:
|
||||||
@@ -123,18 +121,13 @@ struct _ClutterDeviceManagerClass
|
|||||||
/* Keyboard accessbility */
|
/* Keyboard accessbility */
|
||||||
void (* apply_kbd_a11y_settings) (ClutterDeviceManager *device_manger,
|
void (* apply_kbd_a11y_settings) (ClutterDeviceManager *device_manger,
|
||||||
ClutterKbdA11ySettings *settings);
|
ClutterKbdA11ySettings *settings);
|
||||||
|
|
||||||
/* Event platform data */
|
|
||||||
void (* copy_event_data) (ClutterDeviceManager *device_manager,
|
|
||||||
const ClutterEvent *src,
|
|
||||||
ClutterEvent *dest);
|
|
||||||
void (* free_event_data) (ClutterDeviceManager *device_manager,
|
|
||||||
ClutterEvent *event);
|
|
||||||
|
|
||||||
/* padding */
|
/* padding */
|
||||||
gpointer _padding[4];
|
gpointer _padding[6];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
GType clutter_device_manager_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
ClutterDeviceManager *clutter_device_manager_get_default (void);
|
ClutterDeviceManager *clutter_device_manager_get_default (void);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
@@ -159,23 +152,10 @@ ClutterVirtualDeviceType clutter_device_manager_get_supported_virtual_device_typ
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_device_manager_set_kbd_a11y_settings (ClutterDeviceManager *device_manager,
|
void clutter_device_manager_set_kbd_a11y_settings (ClutterDeviceManager *device_manager,
|
||||||
ClutterKbdA11ySettings *settings);
|
ClutterKbdA11ySettings *settings);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_device_manager_get_kbd_a11y_settings (ClutterDeviceManager *device_manager,
|
void clutter_device_manager_get_kbd_a11y_settings (ClutterDeviceManager *device_manager,
|
||||||
ClutterKbdA11ySettings *settings);
|
ClutterKbdA11ySettings *settings);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void clutter_device_manager_set_pointer_a11y_settings (ClutterDeviceManager *device_manager,
|
|
||||||
ClutterPointerA11ySettings *settings);
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void clutter_device_manager_get_pointer_a11y_settings (ClutterDeviceManager *device_manager,
|
|
||||||
ClutterPointerA11ySettings *settings);
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void clutter_device_manager_set_pointer_a11y_dwell_click_type (ClutterDeviceManager *device_manager,
|
|
||||||
ClutterPointerA11yDwellClickType click_type);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_DEVICE_MANAGER_H__ */
|
#endif /* __CLUTTER_DEVICE_MANAGER_H__ */
|
||||||
|
@@ -428,7 +428,8 @@ clutter_drop_action_class_init (ClutterDropActionClass *klass)
|
|||||||
G_TYPE_FROM_CLASS (klass),
|
G_TYPE_FROM_CLASS (klass),
|
||||||
G_SIGNAL_RUN_LAST,
|
G_SIGNAL_RUN_LAST,
|
||||||
G_STRUCT_OFFSET (ClutterDropActionClass, over_in),
|
G_STRUCT_OFFSET (ClutterDropActionClass, over_in),
|
||||||
NULL, NULL, NULL,
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
CLUTTER_TYPE_ACTOR);
|
CLUTTER_TYPE_ACTOR);
|
||||||
|
|
||||||
@@ -447,7 +448,8 @@ clutter_drop_action_class_init (ClutterDropActionClass *klass)
|
|||||||
G_TYPE_FROM_CLASS (klass),
|
G_TYPE_FROM_CLASS (klass),
|
||||||
G_SIGNAL_RUN_LAST,
|
G_SIGNAL_RUN_LAST,
|
||||||
G_STRUCT_OFFSET (ClutterDropActionClass, over_out),
|
G_STRUCT_OFFSET (ClutterDropActionClass, over_out),
|
||||||
NULL, NULL, NULL,
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
CLUTTER_TYPE_ACTOR);
|
CLUTTER_TYPE_ACTOR);
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@ G_BEGIN_DECLS
|
|||||||
|
|
||||||
gboolean _clutter_effect_pre_paint (ClutterEffect *effect);
|
gboolean _clutter_effect_pre_paint (ClutterEffect *effect);
|
||||||
void _clutter_effect_post_paint (ClutterEffect *effect);
|
void _clutter_effect_post_paint (ClutterEffect *effect);
|
||||||
gboolean _clutter_effect_modify_paint_volume (ClutterEffect *effect,
|
gboolean _clutter_effect_get_paint_volume (ClutterEffect *effect,
|
||||||
ClutterPaintVolume *volume);
|
ClutterPaintVolume *volume);
|
||||||
gboolean _clutter_effect_has_custom_paint_volume (ClutterEffect *effect);
|
gboolean _clutter_effect_has_custom_paint_volume (ClutterEffect *effect);
|
||||||
void _clutter_effect_paint (ClutterEffect *effect,
|
void _clutter_effect_paint (ClutterEffect *effect,
|
||||||
|
@@ -188,8 +188,8 @@ clutter_effect_real_post_paint (ClutterEffect *effect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
clutter_effect_real_modify_paint_volume (ClutterEffect *effect,
|
clutter_effect_real_get_paint_volume (ClutterEffect *effect,
|
||||||
ClutterPaintVolume *volume)
|
ClutterPaintVolume *volume)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -252,7 +252,7 @@ clutter_effect_class_init (ClutterEffectClass *klass)
|
|||||||
|
|
||||||
klass->pre_paint = clutter_effect_real_pre_paint;
|
klass->pre_paint = clutter_effect_real_pre_paint;
|
||||||
klass->post_paint = clutter_effect_real_post_paint;
|
klass->post_paint = clutter_effect_real_post_paint;
|
||||||
klass->modify_paint_volume = clutter_effect_real_modify_paint_volume;
|
klass->get_paint_volume = clutter_effect_real_get_paint_volume;
|
||||||
klass->paint = clutter_effect_real_paint;
|
klass->paint = clutter_effect_real_paint;
|
||||||
klass->pick = clutter_effect_real_pick;
|
klass->pick = clutter_effect_real_pick;
|
||||||
}
|
}
|
||||||
@@ -297,14 +297,13 @@ _clutter_effect_pick (ClutterEffect *effect,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_clutter_effect_modify_paint_volume (ClutterEffect *effect,
|
_clutter_effect_get_paint_volume (ClutterEffect *effect,
|
||||||
ClutterPaintVolume *volume)
|
ClutterPaintVolume *volume)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (CLUTTER_IS_EFFECT (effect), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_EFFECT (effect), FALSE);
|
||||||
g_return_val_if_fail (volume != NULL, FALSE);
|
g_return_val_if_fail (volume != NULL, FALSE);
|
||||||
|
|
||||||
return CLUTTER_EFFECT_GET_CLASS (effect)->modify_paint_volume (effect,
|
return CLUTTER_EFFECT_GET_CLASS (effect)->get_paint_volume (effect, volume);
|
||||||
volume);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@@ -312,7 +311,7 @@ _clutter_effect_has_custom_paint_volume (ClutterEffect *effect)
|
|||||||
{
|
{
|
||||||
g_return_val_if_fail (CLUTTER_IS_EFFECT (effect), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_EFFECT (effect), FALSE);
|
||||||
|
|
||||||
return CLUTTER_EFFECT_GET_CLASS (effect)->modify_paint_volume != clutter_effect_real_modify_paint_volume;
|
return CLUTTER_EFFECT_GET_CLASS (effect)->get_paint_volume != clutter_effect_real_get_paint_volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -60,7 +60,7 @@ struct _ClutterEffect
|
|||||||
* ClutterEffectClass:
|
* ClutterEffectClass:
|
||||||
* @pre_paint: virtual function
|
* @pre_paint: virtual function
|
||||||
* @post_paint: virtual function
|
* @post_paint: virtual function
|
||||||
* @modify_paint_volume: virtual function
|
* @get_paint_volume: virtual function
|
||||||
* @paint: virtual function
|
* @paint: virtual function
|
||||||
* @pick: virtual function
|
* @pick: virtual function
|
||||||
*
|
*
|
||||||
@@ -74,16 +74,16 @@ struct _ClutterEffectClass
|
|||||||
ClutterActorMetaClass parent_class;
|
ClutterActorMetaClass parent_class;
|
||||||
|
|
||||||
/*< public >*/
|
/*< public >*/
|
||||||
gboolean (* pre_paint) (ClutterEffect *effect);
|
gboolean (* pre_paint) (ClutterEffect *effect);
|
||||||
void (* post_paint) (ClutterEffect *effect);
|
void (* post_paint) (ClutterEffect *effect);
|
||||||
|
|
||||||
gboolean (* modify_paint_volume) (ClutterEffect *effect,
|
gboolean (* get_paint_volume) (ClutterEffect *effect,
|
||||||
ClutterPaintVolume *volume);
|
ClutterPaintVolume *volume);
|
||||||
|
|
||||||
void (* paint) (ClutterEffect *effect,
|
void (* paint) (ClutterEffect *effect,
|
||||||
ClutterEffectPaintFlags flags);
|
ClutterEffectPaintFlags flags);
|
||||||
void (* pick) (ClutterEffect *effect,
|
void (* pick) (ClutterEffect *effect,
|
||||||
ClutterEffectPaintFlags flags);
|
ClutterEffectPaintFlags flags);
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
void (* _clutter_effect4) (void);
|
void (* _clutter_effect4) (void);
|
||||||
|
@@ -13,7 +13,7 @@ G_BEGIN_DECLS
|
|||||||
/*** END file-header ***/
|
/*** END file-header ***/
|
||||||
|
|
||||||
/*** BEGIN file-production ***/
|
/*** BEGIN file-production ***/
|
||||||
/* enumerations from "@basename@" */
|
/* enumerations from "@filename@" */
|
||||||
/*** END file-production ***/
|
/*** END file-production ***/
|
||||||
|
|
||||||
/*** BEGIN value-header ***/
|
/*** BEGIN value-header ***/
|
||||||
|
@@ -51,8 +51,7 @@ G_BEGIN_DECLS
|
|||||||
*
|
*
|
||||||
* Deprecated: 1.22: Use the normalized #ClutterActor pivot point instead
|
* Deprecated: 1.22: Use the normalized #ClutterActor pivot point instead
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_GRAVITY >*/
|
typedef enum { /*< prefix=CLUTTER_GRAVITY >*/
|
||||||
{
|
|
||||||
CLUTTER_GRAVITY_NONE = 0,
|
CLUTTER_GRAVITY_NONE = 0,
|
||||||
CLUTTER_GRAVITY_NORTH,
|
CLUTTER_GRAVITY_NORTH,
|
||||||
CLUTTER_GRAVITY_NORTH_EAST,
|
CLUTTER_GRAVITY_NORTH_EAST,
|
||||||
@@ -75,8 +74,7 @@ typedef enum /*< prefix=CLUTTER_GRAVITY >*/
|
|||||||
*
|
*
|
||||||
* Since: 0.4
|
* Since: 0.4
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER >*/
|
typedef enum { /*< prefix=CLUTTER >*/
|
||||||
{
|
|
||||||
CLUTTER_X_AXIS,
|
CLUTTER_X_AXIS,
|
||||||
CLUTTER_Y_AXIS,
|
CLUTTER_Y_AXIS,
|
||||||
CLUTTER_Z_AXIS
|
CLUTTER_Z_AXIS
|
||||||
@@ -93,8 +91,7 @@ typedef enum /*< prefix=CLUTTER >*/
|
|||||||
*
|
*
|
||||||
* Deprecated: 1.22
|
* Deprecated: 1.22
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_ROTATE >*/
|
typedef enum { /*< prefix=CLUTTER_ROTATE >*/
|
||||||
{
|
|
||||||
CLUTTER_ROTATE_CW,
|
CLUTTER_ROTATE_CW,
|
||||||
CLUTTER_ROTATE_CCW
|
CLUTTER_ROTATE_CCW
|
||||||
} ClutterRotateDirection;
|
} ClutterRotateDirection;
|
||||||
@@ -110,8 +107,7 @@ typedef enum /*< prefix=CLUTTER_ROTATE >*/
|
|||||||
*
|
*
|
||||||
* Since: 0.8
|
* Since: 0.8
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_REQUEST >*/
|
typedef enum { /*< prefix=CLUTTER_REQUEST >*/
|
||||||
{
|
|
||||||
CLUTTER_REQUEST_HEIGHT_FOR_WIDTH,
|
CLUTTER_REQUEST_HEIGHT_FOR_WIDTH,
|
||||||
CLUTTER_REQUEST_WIDTH_FOR_HEIGHT,
|
CLUTTER_REQUEST_WIDTH_FOR_HEIGHT,
|
||||||
CLUTTER_REQUEST_CONTENT_SIZE
|
CLUTTER_REQUEST_CONTENT_SIZE
|
||||||
@@ -204,8 +200,7 @@ typedef enum /*< prefix=CLUTTER_REQUEST >*/
|
|||||||
*
|
*
|
||||||
* Since: 1.0
|
* Since: 1.0
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_CUSTOM_MODE = 0,
|
CLUTTER_CUSTOM_MODE = 0,
|
||||||
|
|
||||||
/* linear */
|
/* linear */
|
||||||
@@ -277,6 +272,23 @@ typedef enum
|
|||||||
CLUTTER_ANIMATION_LAST
|
CLUTTER_ANIMATION_LAST
|
||||||
} ClutterAnimationMode;
|
} ClutterAnimationMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterFontFlags:
|
||||||
|
* @CLUTTER_FONT_MIPMAPPING: Set to use mipmaps for the glyph cache textures.
|
||||||
|
* @CLUTTER_FONT_HINTING: Set to enable hinting on the glyphs.
|
||||||
|
*
|
||||||
|
* Runtime flags to change the font quality. To be used with
|
||||||
|
* clutter_set_font_flags().
|
||||||
|
*
|
||||||
|
* Since: 1.0
|
||||||
|
*
|
||||||
|
* Deprecated: 1.22: Use #cairo_font_options_t instead
|
||||||
|
*/
|
||||||
|
typedef enum { /*< prefix=CLUTTER_FONT >*/
|
||||||
|
CLUTTER_FONT_MIPMAPPING = (1 << 0),
|
||||||
|
CLUTTER_FONT_HINTING = (1 << 1)
|
||||||
|
} ClutterFontFlags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterTextDirection:
|
* ClutterTextDirection:
|
||||||
* @CLUTTER_TEXT_DIRECTION_DEFAULT: Use the default setting, as returned
|
* @CLUTTER_TEXT_DIRECTION_DEFAULT: Use the default setting, as returned
|
||||||
@@ -288,8 +300,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_TEXT_DIRECTION_DEFAULT,
|
CLUTTER_TEXT_DIRECTION_DEFAULT,
|
||||||
CLUTTER_TEXT_DIRECTION_LTR,
|
CLUTTER_TEXT_DIRECTION_LTR,
|
||||||
CLUTTER_TEXT_DIRECTION_RTL
|
CLUTTER_TEXT_DIRECTION_RTL
|
||||||
@@ -304,8 +315,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.4
|
* Since: 1.4
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_VERTEX_SHADER,
|
CLUTTER_VERTEX_SHADER,
|
||||||
CLUTTER_FRAGMENT_SHADER
|
CLUTTER_FRAGMENT_SHADER
|
||||||
} ClutterShaderType;
|
} ClutterShaderType;
|
||||||
@@ -340,8 +350,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 0.4
|
* Since: 0.4
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_SHIFT_MASK = 1 << 0,
|
CLUTTER_SHIFT_MASK = 1 << 0,
|
||||||
CLUTTER_LOCK_MASK = 1 << 1,
|
CLUTTER_LOCK_MASK = 1 << 1,
|
||||||
CLUTTER_CONTROL_MASK = 1 << 2,
|
CLUTTER_CONTROL_MASK = 1 << 2,
|
||||||
@@ -407,8 +416,7 @@ typedef enum
|
|||||||
* Keyboard accessibility features applied to a ClutterInputDevice keyboard.
|
* Keyboard accessibility features applied to a ClutterInputDevice keyboard.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_A11Y_KEYBOARD_ENABLED = 1 << 0,
|
CLUTTER_A11Y_KEYBOARD_ENABLED = 1 << 0,
|
||||||
CLUTTER_A11Y_TIMEOUT_ENABLED = 1 << 1,
|
CLUTTER_A11Y_TIMEOUT_ENABLED = 1 << 1,
|
||||||
CLUTTER_A11Y_MOUSE_KEYS_ENABLED = 1 << 2,
|
CLUTTER_A11Y_MOUSE_KEYS_ENABLED = 1 << 2,
|
||||||
@@ -425,88 +433,6 @@ typedef enum
|
|||||||
CLUTTER_A11Y_FEATURE_STATE_CHANGE_BEEP = 1 << 13,
|
CLUTTER_A11Y_FEATURE_STATE_CHANGE_BEEP = 1 << 13,
|
||||||
} ClutterKeyboardA11yFlags;
|
} ClutterKeyboardA11yFlags;
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterPointerA11yFlags:
|
|
||||||
* @CLUTTER_A11Y_POINTER_ENABLED:
|
|
||||||
* @CLUTTER_A11Y_SECONDARY_CLICK_ENABLED:
|
|
||||||
* @CLUTTER_A11Y_DWELL_ENABLED:
|
|
||||||
*
|
|
||||||
* Pointer accessibility features applied to a ClutterInputDevice pointer.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
typedef enum {
|
|
||||||
CLUTTER_A11Y_SECONDARY_CLICK_ENABLED = 1 << 0,
|
|
||||||
CLUTTER_A11Y_DWELL_ENABLED = 1 << 1,
|
|
||||||
} ClutterPointerA11yFlags;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterPointerA11yDwellClickType:
|
|
||||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE: Internal use only
|
|
||||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY:
|
|
||||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY:
|
|
||||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE:
|
|
||||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE:
|
|
||||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG:
|
|
||||||
*
|
|
||||||
* Dwell click types.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
typedef enum {
|
|
||||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE,
|
|
||||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY,
|
|
||||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY,
|
|
||||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE,
|
|
||||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE,
|
|
||||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG,
|
|
||||||
} ClutterPointerA11yDwellClickType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterPointerA11yDwellDirection:
|
|
||||||
* @CLUTTER_A11Y_DWELL_DIRECTION_NONE:
|
|
||||||
* @CLUTTER_A11Y_DWELL_DIRECTION_LEFT:
|
|
||||||
* @CLUTTER_A11Y_DWELL_DIRECTION_RIGHT:
|
|
||||||
* @CLUTTER_A11Y_DWELL_DIRECTION_UP:
|
|
||||||
* @CLUTTER_A11Y_DWELL_DIRECTION_DOWN:
|
|
||||||
*
|
|
||||||
* Dwell gesture directions.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
typedef enum {
|
|
||||||
CLUTTER_A11Y_DWELL_DIRECTION_NONE,
|
|
||||||
CLUTTER_A11Y_DWELL_DIRECTION_LEFT,
|
|
||||||
CLUTTER_A11Y_DWELL_DIRECTION_RIGHT,
|
|
||||||
CLUTTER_A11Y_DWELL_DIRECTION_UP,
|
|
||||||
CLUTTER_A11Y_DWELL_DIRECTION_DOWN,
|
|
||||||
} ClutterPointerA11yDwellDirection;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterPointerA11yDwellMode:
|
|
||||||
* @CLUTTER_A11Y_DWELL_MODE_WINDOW:
|
|
||||||
* @CLUTTER_A11Y_DWELL_MODE_GESTURE:
|
|
||||||
*
|
|
||||||
* Dwell mode.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
typedef enum {
|
|
||||||
CLUTTER_A11Y_DWELL_MODE_WINDOW,
|
|
||||||
CLUTTER_A11Y_DWELL_MODE_GESTURE,
|
|
||||||
} ClutterPointerA11yDwellMode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterPointerA11yTimeoutType:
|
|
||||||
* @CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK:
|
|
||||||
* @CLUTTER_A11Y_TIMEOUT_TYPE_DWELL:
|
|
||||||
* @CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE:
|
|
||||||
*
|
|
||||||
* Pointer accessibility timeout type.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
typedef enum {
|
|
||||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
|
||||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
|
||||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
|
||||||
} ClutterPointerA11yTimeoutType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterActorFlags:
|
* ClutterActorFlags:
|
||||||
* @CLUTTER_ACTOR_MAPPED: the actor will be painted (is visible, and inside
|
* @CLUTTER_ACTOR_MAPPED: the actor will be painted (is visible, and inside
|
||||||
@@ -522,8 +448,7 @@ typedef enum {
|
|||||||
*
|
*
|
||||||
* Flags used to signal the state of an actor.
|
* Flags used to signal the state of an actor.
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_ACTOR >*/
|
typedef enum { /*< prefix=CLUTTER_ACTOR >*/
|
||||||
{
|
|
||||||
CLUTTER_ACTOR_MAPPED = 1 << 1,
|
CLUTTER_ACTOR_MAPPED = 1 << 1,
|
||||||
CLUTTER_ACTOR_REALIZED = 1 << 2,
|
CLUTTER_ACTOR_REALIZED = 1 << 2,
|
||||||
CLUTTER_ACTOR_REACTIVE = 1 << 3,
|
CLUTTER_ACTOR_REACTIVE = 1 << 3,
|
||||||
@@ -543,8 +468,7 @@ typedef enum /*< prefix=CLUTTER_ACTOR >*/
|
|||||||
*
|
*
|
||||||
* Since: 1.8
|
* Since: 1.8
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_OFFSCREEN_REDIRECT >*/
|
typedef enum { /*< prefix=CLUTTER_OFFSCREEN_REDIRECT >*/
|
||||||
{
|
|
||||||
CLUTTER_OFFSCREEN_REDIRECT_AUTOMATIC_FOR_OPACITY = 1<<0,
|
CLUTTER_OFFSCREEN_REDIRECT_AUTOMATIC_FOR_OPACITY = 1<<0,
|
||||||
CLUTTER_OFFSCREEN_REDIRECT_ALWAYS = 1<<1
|
CLUTTER_OFFSCREEN_REDIRECT_ALWAYS = 1<<1
|
||||||
} ClutterOffscreenRedirect;
|
} ClutterOffscreenRedirect;
|
||||||
@@ -568,8 +492,7 @@ typedef enum /*< prefix=CLUTTER_OFFSCREEN_REDIRECT >*/
|
|||||||
*
|
*
|
||||||
* Since: 1.0
|
* Since: 1.0
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_ALLOCATION_NONE = 0,
|
CLUTTER_ALLOCATION_NONE = 0,
|
||||||
CLUTTER_ABSOLUTE_ORIGIN_CHANGED = 1 << 1,
|
CLUTTER_ABSOLUTE_ORIGIN_CHANGED = 1 << 1,
|
||||||
CLUTTER_DELEGATE_LAYOUT = 1 << 2
|
CLUTTER_DELEGATE_LAYOUT = 1 << 2
|
||||||
@@ -586,8 +509,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.4
|
* Since: 1.4
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_ALIGN >*/
|
typedef enum { /*< prefix=CLUTTER_ALIGN >*/
|
||||||
{
|
|
||||||
CLUTTER_ALIGN_X_AXIS,
|
CLUTTER_ALIGN_X_AXIS,
|
||||||
CLUTTER_ALIGN_Y_AXIS,
|
CLUTTER_ALIGN_Y_AXIS,
|
||||||
CLUTTER_ALIGN_BOTH
|
CLUTTER_ALIGN_BOTH
|
||||||
@@ -604,8 +526,7 @@ typedef enum /*< prefix=CLUTTER_ALIGN >*/
|
|||||||
*
|
*
|
||||||
* Deprecated: 1.22
|
* Deprecated: 1.22
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_INTERPOLATION_LINEAR,
|
CLUTTER_INTERPOLATION_LINEAR,
|
||||||
CLUTTER_INTERPOLATION_CUBIC
|
CLUTTER_INTERPOLATION_CUBIC
|
||||||
} ClutterInterpolation;
|
} ClutterInterpolation;
|
||||||
@@ -630,8 +551,7 @@ typedef enum
|
|||||||
* Deprecated: 1.12: Use #ClutterActorAlign and the #ClutterActor
|
* Deprecated: 1.12: Use #ClutterActorAlign and the #ClutterActor
|
||||||
* API instead
|
* API instead
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_BIN_ALIGNMENT_FIXED,
|
CLUTTER_BIN_ALIGNMENT_FIXED,
|
||||||
CLUTTER_BIN_ALIGNMENT_FILL,
|
CLUTTER_BIN_ALIGNMENT_FILL,
|
||||||
CLUTTER_BIN_ALIGNMENT_START,
|
CLUTTER_BIN_ALIGNMENT_START,
|
||||||
@@ -656,8 +576,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.4
|
* Since: 1.4
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_BIND >*/
|
typedef enum { /*< prefix=CLUTTER_BIND >*/
|
||||||
{
|
|
||||||
CLUTTER_BIND_X,
|
CLUTTER_BIND_X,
|
||||||
CLUTTER_BIND_Y,
|
CLUTTER_BIND_Y,
|
||||||
CLUTTER_BIND_WIDTH,
|
CLUTTER_BIND_WIDTH,
|
||||||
@@ -676,8 +595,7 @@ typedef enum /*< prefix=CLUTTER_BIND >*/
|
|||||||
*
|
*
|
||||||
* Flags passed to the ‘paint’ or ‘pick’ method of #ClutterEffect.
|
* Flags passed to the ‘paint’ or ‘pick’ method of #ClutterEffect.
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_EFFECT_PAINT >*/
|
typedef enum { /*< prefix=CLUTTER_EFFECT_PAINT >*/
|
||||||
{
|
|
||||||
CLUTTER_EFFECT_PAINT_ACTOR_DIRTY = (1 << 0)
|
CLUTTER_EFFECT_PAINT_ACTOR_DIRTY = (1 << 0)
|
||||||
} ClutterEffectPaintFlags;
|
} ClutterEffectPaintFlags;
|
||||||
|
|
||||||
@@ -693,8 +611,7 @@ typedef enum /*< prefix=CLUTTER_EFFECT_PAINT >*/
|
|||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_BOX_ALIGNMENT_START,
|
CLUTTER_BOX_ALIGNMENT_START,
|
||||||
CLUTTER_BOX_ALIGNMENT_END,
|
CLUTTER_BOX_ALIGNMENT_END,
|
||||||
CLUTTER_BOX_ALIGNMENT_CENTER
|
CLUTTER_BOX_ALIGNMENT_CENTER
|
||||||
@@ -711,8 +628,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.8
|
* Since: 1.8
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_LONG_PRESS >*/
|
typedef enum { /*< prefix=CLUTTER_LONG_PRESS >*/
|
||||||
{
|
|
||||||
CLUTTER_LONG_PRESS_QUERY,
|
CLUTTER_LONG_PRESS_QUERY,
|
||||||
CLUTTER_LONG_PRESS_ACTIVATE,
|
CLUTTER_LONG_PRESS_ACTIVATE,
|
||||||
CLUTTER_LONG_PRESS_CANCEL
|
CLUTTER_LONG_PRESS_CANCEL
|
||||||
@@ -770,8 +686,7 @@ typedef enum /*< prefix=CLUTTER_LONG_PRESS >*/
|
|||||||
*
|
*
|
||||||
* Since: 1.6
|
* Since: 1.6
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_COLOR >*/
|
typedef enum { /*< prefix=CLUTTER_COLOR >*/
|
||||||
{
|
|
||||||
/* CGA/EGA-like palette */
|
/* CGA/EGA-like palette */
|
||||||
CLUTTER_COLOR_WHITE = 0,
|
CLUTTER_COLOR_WHITE = 0,
|
||||||
CLUTTER_COLOR_BLACK,
|
CLUTTER_COLOR_BLACK,
|
||||||
@@ -835,8 +750,7 @@ typedef enum /*< prefix=CLUTTER_COLOR >*/
|
|||||||
*
|
*
|
||||||
* Since: 1.4
|
* Since: 1.4
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_DRAG >*/
|
typedef enum { /*< prefix=CLUTTER_DRAG >*/
|
||||||
{
|
|
||||||
CLUTTER_DRAG_AXIS_NONE = 0,
|
CLUTTER_DRAG_AXIS_NONE = 0,
|
||||||
|
|
||||||
CLUTTER_DRAG_X_AXIS,
|
CLUTTER_DRAG_X_AXIS,
|
||||||
@@ -853,8 +767,7 @@ typedef enum /*< prefix=CLUTTER_DRAG >*/
|
|||||||
*
|
*
|
||||||
* Since: 0.6
|
* Since: 0.6
|
||||||
*/
|
*/
|
||||||
typedef enum /*< flags prefix=CLUTTER_EVENT >*/
|
typedef enum { /*< flags prefix=CLUTTER_EVENT >*/
|
||||||
{
|
|
||||||
CLUTTER_EVENT_NONE = 0,
|
CLUTTER_EVENT_NONE = 0,
|
||||||
CLUTTER_EVENT_FLAG_SYNTHETIC = 1 << 0,
|
CLUTTER_EVENT_FLAG_SYNTHETIC = 1 << 0,
|
||||||
CLUTTER_EVENT_FLAG_INPUT_METHOD = 1 << 1,
|
CLUTTER_EVENT_FLAG_INPUT_METHOD = 1 << 1,
|
||||||
@@ -899,8 +812,7 @@ typedef enum /*< flags prefix=CLUTTER_EVENT >*/
|
|||||||
*
|
*
|
||||||
* Since: 0.4
|
* Since: 0.4
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER >*/
|
typedef enum { /*< prefix=CLUTTER >*/
|
||||||
{
|
|
||||||
CLUTTER_NOTHING = 0,
|
CLUTTER_NOTHING = 0,
|
||||||
CLUTTER_KEY_PRESS,
|
CLUTTER_KEY_PRESS,
|
||||||
CLUTTER_KEY_RELEASE,
|
CLUTTER_KEY_RELEASE,
|
||||||
@@ -945,8 +857,7 @@ typedef enum /*< prefix=CLUTTER >*/
|
|||||||
*
|
*
|
||||||
* Since: 0.4
|
* Since: 0.4
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_SCROLL >*/
|
typedef enum { /*< prefix=CLUTTER_SCROLL >*/
|
||||||
{
|
|
||||||
CLUTTER_SCROLL_UP,
|
CLUTTER_SCROLL_UP,
|
||||||
CLUTTER_SCROLL_DOWN,
|
CLUTTER_SCROLL_DOWN,
|
||||||
CLUTTER_SCROLL_LEFT,
|
CLUTTER_SCROLL_LEFT,
|
||||||
@@ -956,23 +867,28 @@ typedef enum /*< prefix=CLUTTER_SCROLL >*/
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterStageState:
|
* ClutterStageState:
|
||||||
|
* @CLUTTER_STAGE_STATE_FULLSCREEN: Fullscreen mask
|
||||||
|
* @CLUTTER_STAGE_STATE_OFFSCREEN: Offscreen mask (deprecated)
|
||||||
* @CLUTTER_STAGE_STATE_ACTIVATED: Activated mask
|
* @CLUTTER_STAGE_STATE_ACTIVATED: Activated mask
|
||||||
*
|
*
|
||||||
* Stage state masks, used by the #ClutterEvent of type %CLUTTER_STAGE_STATE.
|
* Stage state masks, used by the #ClutterEvent of type %CLUTTER_STAGE_STATE.
|
||||||
*
|
*
|
||||||
* Since: 0.4
|
* Since: 0.4
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
CLUTTER_STAGE_STATE_FULLSCREEN = (1 << 1),
|
||||||
|
CLUTTER_STAGE_STATE_OFFSCREEN = (1 << 2),
|
||||||
CLUTTER_STAGE_STATE_ACTIVATED = (1 << 3)
|
CLUTTER_STAGE_STATE_ACTIVATED = (1 << 3)
|
||||||
} ClutterStageState;
|
} ClutterStageState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterFeatureFlags:
|
* ClutterFeatureFlags:
|
||||||
* @CLUTTER_FEATURE_SWAP_THROTTLE: Set if backend throttles buffer swaps.
|
* @CLUTTER_FEATURE_TEXTURE_NPOT: Set if NPOTS textures supported.
|
||||||
|
* @CLUTTER_FEATURE_SYNC_TO_VBLANK: Set if vblank syncing supported.
|
||||||
* @CLUTTER_FEATURE_TEXTURE_YUV: Set if YUV based textures supported.
|
* @CLUTTER_FEATURE_TEXTURE_YUV: Set if YUV based textures supported.
|
||||||
* @CLUTTER_FEATURE_TEXTURE_READ_PIXELS: Set if texture pixels can be read.
|
* @CLUTTER_FEATURE_TEXTURE_READ_PIXELS: Set if texture pixels can be read.
|
||||||
* @CLUTTER_FEATURE_STAGE_STATIC: Set if stage size if fixed (i.e framebuffer)
|
* @CLUTTER_FEATURE_STAGE_STATIC: Set if stage size if fixed (i.e framebuffer)
|
||||||
|
* @CLUTTER_FEATURE_STAGE_USER_RESIZE: Set if stage is able to be user resized.
|
||||||
* @CLUTTER_FEATURE_STAGE_CURSOR: Set if stage has a graphical cursor.
|
* @CLUTTER_FEATURE_STAGE_CURSOR: Set if stage has a graphical cursor.
|
||||||
* @CLUTTER_FEATURE_SHADERS_GLSL: Set if the backend supports GLSL shaders.
|
* @CLUTTER_FEATURE_SHADERS_GLSL: Set if the backend supports GLSL shaders.
|
||||||
* @CLUTTER_FEATURE_OFFSCREEN: Set if the backend supports offscreen rendering.
|
* @CLUTTER_FEATURE_OFFSCREEN: Set if the backend supports offscreen rendering.
|
||||||
@@ -986,10 +902,12 @@ typedef enum
|
|||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
CLUTTER_FEATURE_SWAP_THROTTLE = (1 << 3),
|
CLUTTER_FEATURE_TEXTURE_NPOT = (1 << 2),
|
||||||
|
CLUTTER_FEATURE_SYNC_TO_VBLANK = (1 << 3),
|
||||||
CLUTTER_FEATURE_TEXTURE_YUV = (1 << 4),
|
CLUTTER_FEATURE_TEXTURE_YUV = (1 << 4),
|
||||||
CLUTTER_FEATURE_TEXTURE_READ_PIXELS = (1 << 5),
|
CLUTTER_FEATURE_TEXTURE_READ_PIXELS = (1 << 5),
|
||||||
CLUTTER_FEATURE_STAGE_STATIC = (1 << 6),
|
CLUTTER_FEATURE_STAGE_STATIC = (1 << 6),
|
||||||
|
CLUTTER_FEATURE_STAGE_USER_RESIZE = (1 << 7),
|
||||||
CLUTTER_FEATURE_STAGE_CURSOR = (1 << 8),
|
CLUTTER_FEATURE_STAGE_CURSOR = (1 << 8),
|
||||||
CLUTTER_FEATURE_SHADERS_GLSL = (1 << 9),
|
CLUTTER_FEATURE_SHADERS_GLSL = (1 << 9),
|
||||||
CLUTTER_FEATURE_OFFSCREEN = (1 << 10),
|
CLUTTER_FEATURE_OFFSCREEN = (1 << 10),
|
||||||
@@ -1009,8 +927,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_FLOW >*/
|
typedef enum { /*< prefix=CLUTTER_FLOW >*/
|
||||||
{
|
|
||||||
CLUTTER_FLOW_HORIZONTAL,
|
CLUTTER_FLOW_HORIZONTAL,
|
||||||
CLUTTER_FLOW_VERTICAL
|
CLUTTER_FLOW_VERTICAL
|
||||||
} ClutterFlowOrientation;
|
} ClutterFlowOrientation;
|
||||||
@@ -1037,8 +954,7 @@ typedef enum /*< prefix=CLUTTER_FLOW >*/
|
|||||||
*
|
*
|
||||||
* Since: 1.0
|
* Since: 1.0
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_POINTER_DEVICE,
|
CLUTTER_POINTER_DEVICE,
|
||||||
CLUTTER_KEYBOARD_DEVICE,
|
CLUTTER_KEYBOARD_DEVICE,
|
||||||
CLUTTER_EXTENSION_DEVICE,
|
CLUTTER_EXTENSION_DEVICE,
|
||||||
@@ -1066,8 +982,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.6
|
* Since: 1.6
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_INPUT_MODE_MASTER,
|
CLUTTER_INPUT_MODE_MASTER,
|
||||||
CLUTTER_INPUT_MODE_SLAVE,
|
CLUTTER_INPUT_MODE_SLAVE,
|
||||||
CLUTTER_INPUT_MODE_FLOATING
|
CLUTTER_INPUT_MODE_FLOATING
|
||||||
@@ -1092,8 +1007,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.6
|
* Since: 1.6
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_INPUT_AXIS_IGNORE,
|
CLUTTER_INPUT_AXIS_IGNORE,
|
||||||
|
|
||||||
CLUTTER_INPUT_AXIS_X,
|
CLUTTER_INPUT_AXIS_X,
|
||||||
@@ -1120,8 +1034,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.6
|
* Since: 1.6
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_SNAP_EDGE_TOP,
|
CLUTTER_SNAP_EDGE_TOP,
|
||||||
CLUTTER_SNAP_EDGE_RIGHT,
|
CLUTTER_SNAP_EDGE_RIGHT,
|
||||||
CLUTTER_SNAP_EDGE_BOTTOM,
|
CLUTTER_SNAP_EDGE_BOTTOM,
|
||||||
@@ -1138,8 +1051,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.0
|
* Since: 1.0
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_PICK_NONE = 0,
|
CLUTTER_PICK_NONE = 0,
|
||||||
CLUTTER_PICK_REACTIVE,
|
CLUTTER_PICK_REACTIVE,
|
||||||
CLUTTER_PICK_ALL
|
CLUTTER_PICK_ALL
|
||||||
@@ -1156,8 +1068,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.8
|
* Since: 1.8
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_SWIPE_DIRECTION >*/
|
typedef enum { /*< prefix=CLUTTER_SWIPE_DIRECTION >*/
|
||||||
{
|
|
||||||
CLUTTER_SWIPE_DIRECTION_UP = 1 << 0,
|
CLUTTER_SWIPE_DIRECTION_UP = 1 << 0,
|
||||||
CLUTTER_SWIPE_DIRECTION_DOWN = 1 << 1,
|
CLUTTER_SWIPE_DIRECTION_DOWN = 1 << 1,
|
||||||
CLUTTER_SWIPE_DIRECTION_LEFT = 1 << 2,
|
CLUTTER_SWIPE_DIRECTION_LEFT = 1 << 2,
|
||||||
@@ -1177,8 +1088,7 @@ typedef enum /*< prefix=CLUTTER_SWIPE_DIRECTION >*/
|
|||||||
*
|
*
|
||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_PAN >*/
|
typedef enum { /*< prefix=CLUTTER_PAN >*/
|
||||||
{
|
|
||||||
CLUTTER_PAN_AXIS_NONE = 0,
|
CLUTTER_PAN_AXIS_NONE = 0,
|
||||||
|
|
||||||
CLUTTER_PAN_X_AXIS,
|
CLUTTER_PAN_X_AXIS,
|
||||||
@@ -1203,8 +1113,7 @@ typedef enum /*< prefix=CLUTTER_PAN >*/
|
|||||||
*
|
*
|
||||||
* Deprecated: 1.22: Use the alignment properties of #ClutterActor
|
* Deprecated: 1.22: Use the alignment properties of #ClutterActor
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_TABLE_ALIGNMENT_START,
|
CLUTTER_TABLE_ALIGNMENT_START,
|
||||||
CLUTTER_TABLE_ALIGNMENT_CENTER,
|
CLUTTER_TABLE_ALIGNMENT_CENTER,
|
||||||
CLUTTER_TABLE_ALIGNMENT_END
|
CLUTTER_TABLE_ALIGNMENT_END
|
||||||
@@ -1225,8 +1134,7 @@ typedef enum
|
|||||||
* Deprecated: 1.22: The #ClutterTexture class was the only user of
|
* Deprecated: 1.22: The #ClutterTexture class was the only user of
|
||||||
* this API
|
* this API
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_TEXTURE >*/
|
typedef enum { /*< prefix=CLUTTER_TEXTURE >*/
|
||||||
{
|
|
||||||
CLUTTER_TEXTURE_NONE = 0,
|
CLUTTER_TEXTURE_NONE = 0,
|
||||||
CLUTTER_TEXTURE_RGB_FLAG_BGR = 1 << 1,
|
CLUTTER_TEXTURE_RGB_FLAG_BGR = 1 << 1,
|
||||||
CLUTTER_TEXTURE_RGB_FLAG_PREMULT = 1 << 2, /* FIXME: not handled */
|
CLUTTER_TEXTURE_RGB_FLAG_PREMULT = 1 << 2, /* FIXME: not handled */
|
||||||
@@ -1250,8 +1158,7 @@ typedef enum /*< prefix=CLUTTER_TEXTURE >*/
|
|||||||
* this API; use #ClutterImage and clutter_actor_set_content_scaling_filters()
|
* this API; use #ClutterImage and clutter_actor_set_content_scaling_filters()
|
||||||
* instead.
|
* instead.
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_TEXTURE_QUALITY >*/
|
typedef enum { /*< prefix=CLUTTER_TEXTURE_QUALITY >*/
|
||||||
{
|
|
||||||
CLUTTER_TEXTURE_QUALITY_LOW,
|
CLUTTER_TEXTURE_QUALITY_LOW,
|
||||||
CLUTTER_TEXTURE_QUALITY_MEDIUM,
|
CLUTTER_TEXTURE_QUALITY_MEDIUM,
|
||||||
CLUTTER_TEXTURE_QUALITY_HIGH
|
CLUTTER_TEXTURE_QUALITY_HIGH
|
||||||
@@ -1266,8 +1173,7 @@ typedef enum /*< prefix=CLUTTER_TEXTURE_QUALITY >*/
|
|||||||
*
|
*
|
||||||
* Since: 0.6
|
* Since: 0.6
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_TIMELINE_FORWARD,
|
CLUTTER_TIMELINE_FORWARD,
|
||||||
CLUTTER_TIMELINE_BACKWARD
|
CLUTTER_TIMELINE_BACKWARD
|
||||||
} ClutterTimelineDirection;
|
} ClutterTimelineDirection;
|
||||||
@@ -1286,8 +1192,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.0
|
* Since: 1.0
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_UNIT >*/
|
typedef enum { /*< prefix=CLUTTER_UNIT >*/
|
||||||
{
|
|
||||||
CLUTTER_UNIT_PIXEL,
|
CLUTTER_UNIT_PIXEL,
|
||||||
CLUTTER_UNIT_EM,
|
CLUTTER_UNIT_EM,
|
||||||
CLUTTER_UNIT_MM,
|
CLUTTER_UNIT_MM,
|
||||||
@@ -1317,8 +1222,7 @@ typedef enum /*< prefix=CLUTTER_UNIT >*/
|
|||||||
*
|
*
|
||||||
* Since: 1.0
|
* Since: 1.0
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_PATH_MOVE_TO = 0,
|
CLUTTER_PATH_MOVE_TO = 0,
|
||||||
CLUTTER_PATH_LINE_TO = 1,
|
CLUTTER_PATH_LINE_TO = 1,
|
||||||
CLUTTER_PATH_CURVE_TO = 2,
|
CLUTTER_PATH_CURVE_TO = 2,
|
||||||
@@ -1349,8 +1253,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.10
|
* Since: 1.10
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_ACTOR_ALIGN_FILL,
|
CLUTTER_ACTOR_ALIGN_FILL,
|
||||||
CLUTTER_ACTOR_ALIGN_START,
|
CLUTTER_ACTOR_ALIGN_START,
|
||||||
CLUTTER_ACTOR_ALIGN_CENTER,
|
CLUTTER_ACTOR_ALIGN_CENTER,
|
||||||
@@ -1370,8 +1273,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.10
|
* Since: 1.10
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_REPAINT_FLAGS_PRE_PAINT = 1 << 0,
|
CLUTTER_REPAINT_FLAGS_PRE_PAINT = 1 << 0,
|
||||||
CLUTTER_REPAINT_FLAGS_POST_PAINT = 1 << 1,
|
CLUTTER_REPAINT_FLAGS_POST_PAINT = 1 << 1,
|
||||||
CLUTTER_REPAINT_FLAGS_QUEUE_REDRAW_ON_ADD = 1 << 2
|
CLUTTER_REPAINT_FLAGS_QUEUE_REDRAW_ON_ADD = 1 << 2
|
||||||
@@ -1396,8 +1298,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.10
|
* Since: 1.10
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_CONTENT_GRAVITY_TOP_LEFT,
|
CLUTTER_CONTENT_GRAVITY_TOP_LEFT,
|
||||||
CLUTTER_CONTENT_GRAVITY_TOP,
|
CLUTTER_CONTENT_GRAVITY_TOP,
|
||||||
CLUTTER_CONTENT_GRAVITY_TOP_RIGHT,
|
CLUTTER_CONTENT_GRAVITY_TOP_RIGHT,
|
||||||
@@ -1427,8 +1328,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.10
|
* Since: 1.10
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_SCALING_FILTER_LINEAR,
|
CLUTTER_SCALING_FILTER_LINEAR,
|
||||||
CLUTTER_SCALING_FILTER_NEAREST,
|
CLUTTER_SCALING_FILTER_NEAREST,
|
||||||
CLUTTER_SCALING_FILTER_TRILINEAR
|
CLUTTER_SCALING_FILTER_TRILINEAR
|
||||||
@@ -1443,8 +1343,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_ORIENTATION_HORIZONTAL,
|
CLUTTER_ORIENTATION_HORIZONTAL,
|
||||||
CLUTTER_ORIENTATION_VERTICAL
|
CLUTTER_ORIENTATION_VERTICAL
|
||||||
} ClutterOrientation;
|
} ClutterOrientation;
|
||||||
@@ -1460,8 +1359,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_SCROLL >*/
|
typedef enum { /*< prefix=CLUTTER_SCROLL >*/
|
||||||
{
|
|
||||||
CLUTTER_SCROLL_NONE = 0,
|
CLUTTER_SCROLL_NONE = 0,
|
||||||
|
|
||||||
CLUTTER_SCROLL_HORIZONTALLY = 1 << 0,
|
CLUTTER_SCROLL_HORIZONTALLY = 1 << 0,
|
||||||
@@ -1481,8 +1379,7 @@ typedef enum /*< prefix=CLUTTER_SCROLL >*/
|
|||||||
*
|
*
|
||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_GRID_POSITION_LEFT,
|
CLUTTER_GRID_POSITION_LEFT,
|
||||||
CLUTTER_GRID_POSITION_RIGHT,
|
CLUTTER_GRID_POSITION_RIGHT,
|
||||||
CLUTTER_GRID_POSITION_TOP,
|
CLUTTER_GRID_POSITION_TOP,
|
||||||
@@ -1500,8 +1397,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_REPEAT_NONE = 0,
|
CLUTTER_REPEAT_NONE = 0,
|
||||||
CLUTTER_REPEAT_X_AXIS = 1 << 0,
|
CLUTTER_REPEAT_X_AXIS = 1 << 0,
|
||||||
CLUTTER_REPEAT_Y_AXIS = 1 << 1,
|
CLUTTER_REPEAT_Y_AXIS = 1 << 1,
|
||||||
@@ -1523,8 +1419,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_STEP_MODE_START,
|
CLUTTER_STEP_MODE_START,
|
||||||
CLUTTER_STEP_MODE_END
|
CLUTTER_STEP_MODE_END
|
||||||
} ClutterStepMode;
|
} ClutterStepMode;
|
||||||
@@ -1540,8 +1435,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_ZOOM >*/
|
typedef enum { /*< prefix=CLUTTER_ZOOM >*/
|
||||||
{
|
|
||||||
CLUTTER_ZOOM_X_AXIS,
|
CLUTTER_ZOOM_X_AXIS,
|
||||||
CLUTTER_ZOOM_Y_AXIS,
|
CLUTTER_ZOOM_Y_AXIS,
|
||||||
CLUTTER_ZOOM_BOTH
|
CLUTTER_ZOOM_BOTH
|
||||||
@@ -1564,8 +1458,7 @@ typedef enum /*< prefix=CLUTTER_ZOOM >*/
|
|||||||
*
|
*
|
||||||
* Since: 1.18
|
* Since: 1.18
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_GESTURE_TRIGGER_EDGE_NONE = 0,
|
CLUTTER_GESTURE_TRIGGER_EDGE_NONE = 0,
|
||||||
CLUTTER_GESTURE_TRIGGER_EDGE_AFTER,
|
CLUTTER_GESTURE_TRIGGER_EDGE_AFTER,
|
||||||
CLUTTER_GESTURE_TRIGGER_EDGE_BEFORE
|
CLUTTER_GESTURE_TRIGGER_EDGE_BEFORE
|
||||||
@@ -1601,8 +1494,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.24
|
* Since: 1.24
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_TOUCHPAD_GESTURE_PHASE_BEGIN,
|
CLUTTER_TOUCHPAD_GESTURE_PHASE_BEGIN,
|
||||||
CLUTTER_TOUCHPAD_GESTURE_PHASE_UPDATE,
|
CLUTTER_TOUCHPAD_GESTURE_PHASE_UPDATE,
|
||||||
CLUTTER_TOUCHPAD_GESTURE_PHASE_END,
|
CLUTTER_TOUCHPAD_GESTURE_PHASE_END,
|
||||||
@@ -1624,8 +1516,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.26
|
* Since: 1.26
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_SCROLL_SOURCE_UNKNOWN,
|
CLUTTER_SCROLL_SOURCE_UNKNOWN,
|
||||||
CLUTTER_SCROLL_SOURCE_WHEEL,
|
CLUTTER_SCROLL_SOURCE_WHEEL,
|
||||||
CLUTTER_SCROLL_SOURCE_FINGER,
|
CLUTTER_SCROLL_SOURCE_FINGER,
|
||||||
@@ -1643,8 +1534,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.26
|
* Since: 1.26
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_SCROLL_FINISHED_NONE = 0,
|
CLUTTER_SCROLL_FINISHED_NONE = 0,
|
||||||
CLUTTER_SCROLL_FINISHED_HORIZONTAL = 1 << 0,
|
CLUTTER_SCROLL_FINISHED_HORIZONTAL = 1 << 0,
|
||||||
CLUTTER_SCROLL_FINISHED_VERTICAL = 1 << 1
|
CLUTTER_SCROLL_FINISHED_VERTICAL = 1 << 1
|
||||||
@@ -1665,8 +1555,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 1.28
|
* Since: 1.28
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_INPUT_DEVICE_TOOL_NONE,
|
CLUTTER_INPUT_DEVICE_TOOL_NONE,
|
||||||
CLUTTER_INPUT_DEVICE_TOOL_PEN,
|
CLUTTER_INPUT_DEVICE_TOOL_PEN,
|
||||||
CLUTTER_INPUT_DEVICE_TOOL_ERASER,
|
CLUTTER_INPUT_DEVICE_TOOL_ERASER,
|
||||||
@@ -1677,20 +1566,17 @@ typedef enum
|
|||||||
CLUTTER_INPUT_DEVICE_TOOL_LENS
|
CLUTTER_INPUT_DEVICE_TOOL_LENS
|
||||||
} ClutterInputDeviceToolType;
|
} ClutterInputDeviceToolType;
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_INPUT_DEVICE_PAD_SOURCE_UNKNOWN,
|
CLUTTER_INPUT_DEVICE_PAD_SOURCE_UNKNOWN,
|
||||||
CLUTTER_INPUT_DEVICE_PAD_SOURCE_FINGER,
|
CLUTTER_INPUT_DEVICE_PAD_SOURCE_FINGER,
|
||||||
} ClutterInputDevicePadSource;
|
} ClutterInputDevicePadSource;
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE,
|
CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE,
|
||||||
CLUTTER_INPUT_DEVICE_MAPPING_RELATIVE,
|
CLUTTER_INPUT_DEVICE_MAPPING_RELATIVE,
|
||||||
} ClutterInputDeviceMapping;
|
} ClutterInputDeviceMapping;
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_INPUT_CONTENT_HINT_COMPLETION = 1 << 0,
|
CLUTTER_INPUT_CONTENT_HINT_COMPLETION = 1 << 0,
|
||||||
CLUTTER_INPUT_CONTENT_HINT_SPELLCHECK = 1 << 1,
|
CLUTTER_INPUT_CONTENT_HINT_SPELLCHECK = 1 << 1,
|
||||||
CLUTTER_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION = 1 << 2,
|
CLUTTER_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION = 1 << 2,
|
||||||
@@ -1703,8 +1589,7 @@ typedef enum
|
|||||||
CLUTTER_INPUT_CONTENT_HINT_MULTILINE = 1 << 9,
|
CLUTTER_INPUT_CONTENT_HINT_MULTILINE = 1 << 9,
|
||||||
} ClutterInputContentHintFlags;
|
} ClutterInputContentHintFlags;
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_INPUT_CONTENT_PURPOSE_NORMAL,
|
CLUTTER_INPUT_CONTENT_PURPOSE_NORMAL,
|
||||||
CLUTTER_INPUT_CONTENT_PURPOSE_ALPHA,
|
CLUTTER_INPUT_CONTENT_PURPOSE_ALPHA,
|
||||||
CLUTTER_INPUT_CONTENT_PURPOSE_DIGITS,
|
CLUTTER_INPUT_CONTENT_PURPOSE_DIGITS,
|
||||||
@@ -1720,8 +1605,7 @@ typedef enum
|
|||||||
CLUTTER_INPUT_CONTENT_PURPOSE_TERMINAL,
|
CLUTTER_INPUT_CONTENT_PURPOSE_TERMINAL,
|
||||||
} ClutterInputContentPurpose;
|
} ClutterInputContentPurpose;
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_INPUT_PANEL_STATE_OFF,
|
CLUTTER_INPUT_PANEL_STATE_OFF,
|
||||||
CLUTTER_INPUT_PANEL_STATE_ON,
|
CLUTTER_INPUT_PANEL_STATE_ON,
|
||||||
CLUTTER_INPUT_PANEL_STATE_TOGGLE,
|
CLUTTER_INPUT_PANEL_STATE_TOGGLE,
|
||||||
|
@@ -5,28 +5,22 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_event_set_pointer_emulated (ClutterEvent *event,
|
void _clutter_event_set_pointer_emulated (ClutterEvent *event,
|
||||||
gboolean is_emulated);
|
gboolean is_emulated);
|
||||||
|
|
||||||
/* Reinjecting queued events for processing */
|
/* Reinjecting queued events for processing */
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_process_event (ClutterEvent *event);
|
void _clutter_process_event (ClutterEvent *event);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean _clutter_event_process_filters (ClutterEvent *event);
|
gboolean _clutter_event_process_filters (ClutterEvent *event);
|
||||||
|
|
||||||
/* clears the event queue inside the main context */
|
/* clears the event queue inside the main context */
|
||||||
void _clutter_clear_events_queue (void);
|
void _clutter_clear_events_queue (void);
|
||||||
void _clutter_clear_events_queue_for_stage (ClutterStage *stage);
|
void _clutter_clear_events_queue_for_stage (ClutterStage *stage);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_event_set_platform_data (ClutterEvent *event,
|
void _clutter_event_set_platform_data (ClutterEvent *event,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
CLUTTER_EXPORT
|
|
||||||
gpointer _clutter_event_get_platform_data (const ClutterEvent *event);
|
gpointer _clutter_event_get_platform_data (const ClutterEvent *event);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_event_set_state_full (ClutterEvent *event,
|
void _clutter_event_set_state_full (ClutterEvent *event,
|
||||||
ClutterModifierType button_state,
|
ClutterModifierType button_state,
|
||||||
ClutterModifierType base_state,
|
ClutterModifierType base_state,
|
||||||
@@ -34,7 +28,6 @@ void _clutter_event_set_state_full (ClutterEvent *ev
|
|||||||
ClutterModifierType locked_state,
|
ClutterModifierType locked_state,
|
||||||
ClutterModifierType effective_state);
|
ClutterModifierType effective_state);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_event_push (const ClutterEvent *event,
|
void _clutter_event_push (const ClutterEvent *event,
|
||||||
gboolean do_copy);
|
gboolean do_copy);
|
||||||
|
|
||||||
|
38
clutter/clutter/clutter-event-translator.c
Normal file
38
clutter/clutter/clutter-event-translator.c
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
#include "clutter-build-config.h"
|
||||||
|
|
||||||
|
#include "clutter-event-translator.h"
|
||||||
|
|
||||||
|
#include "clutter-backend.h"
|
||||||
|
#include "clutter-private.h"
|
||||||
|
|
||||||
|
#define clutter_event_translator_get_type _clutter_event_translator_get_type
|
||||||
|
|
||||||
|
typedef ClutterEventTranslatorIface ClutterEventTranslatorInterface;
|
||||||
|
|
||||||
|
G_DEFINE_INTERFACE (ClutterEventTranslator, clutter_event_translator, G_TYPE_OBJECT);
|
||||||
|
|
||||||
|
static ClutterTranslateReturn
|
||||||
|
default_translate_event (ClutterEventTranslator *translator,
|
||||||
|
gpointer native,
|
||||||
|
ClutterEvent *event)
|
||||||
|
{
|
||||||
|
return CLUTTER_TRANSLATE_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_event_translator_default_init (ClutterEventTranslatorIface *iface)
|
||||||
|
{
|
||||||
|
iface->translate_event = default_translate_event;
|
||||||
|
}
|
||||||
|
|
||||||
|
ClutterTranslateReturn
|
||||||
|
_clutter_event_translator_translate_event (ClutterEventTranslator *translator,
|
||||||
|
gpointer native,
|
||||||
|
ClutterEvent *translated)
|
||||||
|
{
|
||||||
|
ClutterEventTranslatorIface *iface;
|
||||||
|
|
||||||
|
iface = CLUTTER_EVENT_TRANSLATOR_GET_IFACE (translator);
|
||||||
|
|
||||||
|
return iface->translate_event (translator, native, translated);
|
||||||
|
}
|
41
clutter/clutter/clutter-event-translator.h
Normal file
41
clutter/clutter/clutter-event-translator.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#ifndef __CLUTTER_EVENT_TRANSLATOR_H__
|
||||||
|
#define __CLUTTER_EVENT_TRANSLATOR_H__
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <clutter/clutter-event.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define CLUTTER_TYPE_EVENT_TRANSLATOR (_clutter_event_translator_get_type ())
|
||||||
|
#define CLUTTER_EVENT_TRANSLATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_EVENT_TRANSLATOR, ClutterEventTranslator))
|
||||||
|
#define CLUTTER_IS_EVENT_TRANSLATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_EVENT_TRANSLATOR))
|
||||||
|
#define CLUTTER_EVENT_TRANSLATOR_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_EVENT_TRANSLATOR, ClutterEventTranslatorIface))
|
||||||
|
|
||||||
|
typedef struct _ClutterEventTranslator ClutterEventTranslator;
|
||||||
|
typedef struct _ClutterEventTranslatorIface ClutterEventTranslatorIface;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
CLUTTER_TRANSLATE_CONTINUE,
|
||||||
|
CLUTTER_TRANSLATE_REMOVE,
|
||||||
|
CLUTTER_TRANSLATE_QUEUE
|
||||||
|
} ClutterTranslateReturn;
|
||||||
|
|
||||||
|
struct _ClutterEventTranslatorIface
|
||||||
|
{
|
||||||
|
GTypeInterface g_iface;
|
||||||
|
|
||||||
|
ClutterTranslateReturn (* translate_event) (ClutterEventTranslator *translator,
|
||||||
|
gpointer native,
|
||||||
|
ClutterEvent *translated);
|
||||||
|
};
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
GType _clutter_event_translator_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
ClutterTranslateReturn _clutter_event_translator_translate_event (ClutterEventTranslator *translator,
|
||||||
|
gpointer native,
|
||||||
|
ClutterEvent *translated);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __CLUTTER_EVENT_TRANSLATOR_H__ */
|
@@ -1021,9 +1021,6 @@ clutter_event_get_event_sequence (const ClutterEvent *event)
|
|||||||
event->type == CLUTTER_TOUCH_END ||
|
event->type == CLUTTER_TOUCH_END ||
|
||||||
event->type == CLUTTER_TOUCH_CANCEL)
|
event->type == CLUTTER_TOUCH_CANCEL)
|
||||||
return event->touch.sequence;
|
return event->touch.sequence;
|
||||||
else if (event->type == CLUTTER_ENTER ||
|
|
||||||
event->type == CLUTTER_LEAVE)
|
|
||||||
return event->crossing.sequence;
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -1096,7 +1093,7 @@ clutter_event_set_device (ClutterEvent *event,
|
|||||||
{
|
{
|
||||||
ClutterEventPrivate *real_event = (ClutterEventPrivate *) event;
|
ClutterEventPrivate *real_event = (ClutterEventPrivate *) event;
|
||||||
|
|
||||||
g_set_object (&real_event->device, device);
|
real_event->device = device;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (event->type)
|
switch (event->type)
|
||||||
@@ -1365,8 +1362,8 @@ clutter_event_copy (const ClutterEvent *event)
|
|||||||
{
|
{
|
||||||
ClutterEventPrivate *real_event = (ClutterEventPrivate *) event;
|
ClutterEventPrivate *real_event = (ClutterEventPrivate *) event;
|
||||||
|
|
||||||
g_set_object (&new_real_event->device, real_event->device);
|
new_real_event->device = real_event->device;
|
||||||
g_set_object (&new_real_event->source_device, real_event->source_device);
|
new_real_event->source_device = real_event->source_device;
|
||||||
new_real_event->delta_x = real_event->delta_x;
|
new_real_event->delta_x = real_event->delta_x;
|
||||||
new_real_event->delta_y = real_event->delta_y;
|
new_real_event->delta_y = real_event->delta_y;
|
||||||
new_real_event->is_pointer_emulated = real_event->is_pointer_emulated;
|
new_real_event->is_pointer_emulated = real_event->is_pointer_emulated;
|
||||||
@@ -1436,14 +1433,6 @@ clutter_event_free (ClutterEvent *event)
|
|||||||
{
|
{
|
||||||
_clutter_backend_free_event_data (clutter_get_default_backend (), 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)
|
switch (event->type)
|
||||||
{
|
{
|
||||||
case CLUTTER_BUTTON_PRESS:
|
case CLUTTER_BUTTON_PRESS:
|
||||||
@@ -1698,7 +1687,7 @@ clutter_event_set_source_device (ClutterEvent *event,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
real_event = (ClutterEventPrivate *) event;
|
real_event = (ClutterEventPrivate *) event;
|
||||||
g_set_object (&real_event->source_device, device);
|
real_event->source_device = device;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -269,7 +269,6 @@ struct _ClutterCrossingEvent
|
|||||||
gfloat x;
|
gfloat x;
|
||||||
gfloat y;
|
gfloat y;
|
||||||
ClutterInputDevice *device;
|
ClutterInputDevice *device;
|
||||||
ClutterEventSequence *sequence;
|
|
||||||
ClutterActor *related;
|
ClutterActor *related;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -773,10 +772,7 @@ void clutter_event_get_gesture_motion_delta (const Clut
|
|||||||
gdouble *dx,
|
gdouble *dx,
|
||||||
gdouble *dy);
|
gdouble *dy);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
ClutterScrollSource clutter_event_get_scroll_source (const ClutterEvent *event);
|
ClutterScrollSource clutter_event_get_scroll_source (const ClutterEvent *event);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
ClutterScrollFinishFlags clutter_event_get_scroll_finish_flags (const ClutterEvent *event);
|
ClutterScrollFinishFlags clutter_event_get_scroll_finish_flags (const ClutterEvent *event);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
|
@@ -64,13 +64,17 @@ clutter_features_from_cogl (guint cogl_flags)
|
|||||||
{
|
{
|
||||||
ClutterFeatureFlags clutter_flags = 0;
|
ClutterFeatureFlags clutter_flags = 0;
|
||||||
|
|
||||||
|
if (cogl_flags & COGL_FEATURE_TEXTURE_NPOT)
|
||||||
|
clutter_flags |= CLUTTER_FEATURE_TEXTURE_NPOT;
|
||||||
|
|
||||||
if (cogl_flags & COGL_FEATURE_TEXTURE_YUV)
|
if (cogl_flags & COGL_FEATURE_TEXTURE_YUV)
|
||||||
clutter_flags |= CLUTTER_FEATURE_TEXTURE_YUV;
|
clutter_flags |= CLUTTER_FEATURE_TEXTURE_YUV;
|
||||||
|
|
||||||
if (cogl_flags & COGL_FEATURE_TEXTURE_READ_PIXELS)
|
if (cogl_flags & COGL_FEATURE_TEXTURE_READ_PIXELS)
|
||||||
clutter_flags |= CLUTTER_FEATURE_TEXTURE_READ_PIXELS;
|
clutter_flags |= CLUTTER_FEATURE_TEXTURE_READ_PIXELS;
|
||||||
|
|
||||||
clutter_flags |= CLUTTER_FEATURE_SHADERS_GLSL;
|
if (cogl_flags & COGL_FEATURE_SHADERS_GLSL)
|
||||||
|
clutter_flags |= CLUTTER_FEATURE_SHADERS_GLSL;
|
||||||
|
|
||||||
if (cogl_flags & COGL_FEATURE_OFFSCREEN)
|
if (cogl_flags & COGL_FEATURE_OFFSCREEN)
|
||||||
clutter_flags |= CLUTTER_FEATURE_OFFSCREEN;
|
clutter_flags |= CLUTTER_FEATURE_OFFSCREEN;
|
||||||
|
@@ -804,7 +804,8 @@ clutter_gesture_action_class_init (ClutterGestureActionClass *klass)
|
|||||||
G_TYPE_FROM_CLASS (klass),
|
G_TYPE_FROM_CLASS (klass),
|
||||||
G_SIGNAL_RUN_LAST,
|
G_SIGNAL_RUN_LAST,
|
||||||
G_STRUCT_OFFSET (ClutterGestureActionClass, gesture_end),
|
G_STRUCT_OFFSET (ClutterGestureActionClass, gesture_end),
|
||||||
NULL, NULL, NULL,
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
CLUTTER_TYPE_ACTOR);
|
CLUTTER_TYPE_ACTOR);
|
||||||
|
|
||||||
@@ -826,7 +827,8 @@ clutter_gesture_action_class_init (ClutterGestureActionClass *klass)
|
|||||||
G_TYPE_FROM_CLASS (klass),
|
G_TYPE_FROM_CLASS (klass),
|
||||||
G_SIGNAL_RUN_LAST,
|
G_SIGNAL_RUN_LAST,
|
||||||
G_STRUCT_OFFSET (ClutterGestureActionClass, gesture_cancel),
|
G_STRUCT_OFFSET (ClutterGestureActionClass, gesture_cancel),
|
||||||
NULL, NULL, NULL,
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
CLUTTER_TYPE_ACTOR);
|
CLUTTER_TYPE_ACTOR);
|
||||||
}
|
}
|
||||||
|
@@ -1,96 +0,0 @@
|
|||||||
/*
|
|
||||||
* Clutter.
|
|
||||||
*
|
|
||||||
* An OpenGL based 'interactive canvas' library.
|
|
||||||
*
|
|
||||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 OpenedHand
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __CLUTTER_GROUP_H__
|
|
||||||
#define __CLUTTER_GROUP_H__
|
|
||||||
|
|
||||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
|
||||||
#error "Only <clutter/clutter.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
|
||||||
#include <clutter/clutter-types.h>
|
|
||||||
#include <clutter/clutter-actor.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define CLUTTER_TYPE_GROUP (clutter_group_get_type ())
|
|
||||||
#define CLUTTER_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_GROUP, ClutterGroup))
|
|
||||||
#define CLUTTER_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_GROUP, ClutterGroupClass))
|
|
||||||
#define CLUTTER_IS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_GROUP))
|
|
||||||
#define CLUTTER_IS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_GROUP))
|
|
||||||
#define CLUTTER_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_GROUP, ClutterGroupClass))
|
|
||||||
|
|
||||||
/* XXX - ClutterGroup is to be considered fully deprecated; the only
|
|
||||||
* reason we keep this header is because ClutterStage inherits from
|
|
||||||
* ClutterGroup, and thus we need to have a structure definition for
|
|
||||||
* the Stage object to expand.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct _ClutterGroup ClutterGroup;
|
|
||||||
typedef struct _ClutterGroupClass ClutterGroupClass;
|
|
||||||
typedef struct _ClutterGroupPrivate ClutterGroupPrivate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterGroup:
|
|
||||||
*
|
|
||||||
* The #ClutterGroup structure contains only private data
|
|
||||||
* and should be accessed using the provided API
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*/
|
|
||||||
struct _ClutterGroup
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
ClutterActor parent_instance;
|
|
||||||
|
|
||||||
ClutterGroupPrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterGroupClass:
|
|
||||||
*
|
|
||||||
* The #ClutterGroupClass structure contains only private data
|
|
||||||
*
|
|
||||||
* Since: 0.2
|
|
||||||
*/
|
|
||||||
struct _ClutterGroupClass
|
|
||||||
{
|
|
||||||
/*< private >*/
|
|
||||||
ClutterActorClass parent_class;
|
|
||||||
|
|
||||||
/* padding for future expansion */
|
|
||||||
void (*_clutter_reserved1) (void);
|
|
||||||
void (*_clutter_reserved2) (void);
|
|
||||||
void (*_clutter_reserved3) (void);
|
|
||||||
void (*_clutter_reserved4) (void);
|
|
||||||
void (*_clutter_reserved5) (void);
|
|
||||||
void (*_clutter_reserved6) (void);
|
|
||||||
};
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
GType clutter_group_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __CLUTTER_GROUP_H__ */
|
|
@@ -53,11 +53,9 @@
|
|||||||
struct _ClutterImagePrivate
|
struct _ClutterImagePrivate
|
||||||
{
|
{
|
||||||
CoglTexture *texture;
|
CoglTexture *texture;
|
||||||
gint width;
|
|
||||||
gint height;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void clutter_content_iface_init (ClutterContentInterface *iface);
|
static void clutter_content_iface_init (ClutterContentIface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (ClutterImage, clutter_image, G_TYPE_OBJECT,
|
G_DEFINE_TYPE_WITH_CODE (ClutterImage, clutter_image, G_TYPE_OBJECT,
|
||||||
G_ADD_PRIVATE (ClutterImage)
|
G_ADD_PRIVATE (ClutterImage)
|
||||||
@@ -70,27 +68,6 @@ clutter_image_error_quark (void)
|
|||||||
return g_quark_from_static_string ("clutter-image-error-quark");
|
return g_quark_from_static_string ("clutter-image-error-quark");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
update_image_size (ClutterImage *self)
|
|
||||||
{
|
|
||||||
gint width, height;
|
|
||||||
|
|
||||||
if (self->priv->texture == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
width = cogl_texture_get_width (self->priv->texture);
|
|
||||||
height = cogl_texture_get_height (self->priv->texture);
|
|
||||||
|
|
||||||
if (self->priv->width == width &&
|
|
||||||
self->priv->height == height)
|
|
||||||
return;
|
|
||||||
|
|
||||||
self->priv->width = width;
|
|
||||||
self->priv->height = height;
|
|
||||||
|
|
||||||
clutter_content_invalidate_size (CLUTTER_CONTENT (self));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_image_finalize (GObject *gobject)
|
clutter_image_finalize (GObject *gobject)
|
||||||
{
|
{
|
||||||
@@ -154,7 +131,7 @@ clutter_image_get_preferred_size (ClutterContent *content,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_content_iface_init (ClutterContentInterface *iface)
|
clutter_content_iface_init (ClutterContentIface *iface)
|
||||||
{
|
{
|
||||||
iface->get_preferred_size = clutter_image_get_preferred_size;
|
iface->get_preferred_size = clutter_image_get_preferred_size;
|
||||||
iface->paint_content = clutter_image_paint_content;
|
iface->paint_content = clutter_image_paint_content;
|
||||||
@@ -256,12 +233,11 @@ clutter_image_set_data (ClutterImage *image,
|
|||||||
{
|
{
|
||||||
g_set_error_literal (error, CLUTTER_IMAGE_ERROR,
|
g_set_error_literal (error, CLUTTER_IMAGE_ERROR,
|
||||||
CLUTTER_IMAGE_ERROR_INVALID_DATA,
|
CLUTTER_IMAGE_ERROR_INVALID_DATA,
|
||||||
"Unable to load image data");
|
_("Unable to load image data"));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
||||||
update_image_size (image);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -325,12 +301,11 @@ clutter_image_set_bytes (ClutterImage *image,
|
|||||||
{
|
{
|
||||||
g_set_error_literal (error, CLUTTER_IMAGE_ERROR,
|
g_set_error_literal (error, CLUTTER_IMAGE_ERROR,
|
||||||
CLUTTER_IMAGE_ERROR_INVALID_DATA,
|
CLUTTER_IMAGE_ERROR_INVALID_DATA,
|
||||||
"Unable to load image data");
|
_("Unable to load image data"));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
||||||
update_image_size (image);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -419,12 +394,11 @@ clutter_image_set_area (ClutterImage *image,
|
|||||||
{
|
{
|
||||||
g_set_error_literal (error, CLUTTER_IMAGE_ERROR,
|
g_set_error_literal (error, CLUTTER_IMAGE_ERROR,
|
||||||
CLUTTER_IMAGE_ERROR_INVALID_DATA,
|
CLUTTER_IMAGE_ERROR_INVALID_DATA,
|
||||||
"Unable to load image data");
|
_("Unable to load image data"));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
||||||
update_image_size (image);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@@ -63,8 +63,7 @@ typedef struct _ClutterImageClass ClutterImageClass;
|
|||||||
*
|
*
|
||||||
* Since: 1.10
|
* Since: 1.10
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_IMAGE_ERROR_INVALID_DATA
|
CLUTTER_IMAGE_ERROR_INVALID_DATA
|
||||||
} ClutterImageError;
|
} ClutterImageError;
|
||||||
|
|
||||||
|
@@ -35,8 +35,7 @@ struct _ClutterInputDeviceToolPrivate
|
|||||||
guint64 id;
|
guint64 id;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum {
|
||||||
{
|
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_TYPE,
|
PROP_TYPE,
|
||||||
PROP_SERIAL,
|
PROP_SERIAL,
|
||||||
|
@@ -107,9 +107,6 @@ clutter_input_device_dispose (GObject *gobject)
|
|||||||
device->associated = NULL;
|
device->associated = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device->accessibility_virtual_device)
|
|
||||||
g_clear_object (&device->accessibility_virtual_device);
|
|
||||||
|
|
||||||
g_clear_pointer (&device->axes, g_array_unref);
|
g_clear_pointer (&device->axes, g_array_unref);
|
||||||
g_clear_pointer (&device->keys, g_array_unref);
|
g_clear_pointer (&device->keys, g_array_unref);
|
||||||
g_clear_pointer (&device->scroll_info, g_array_unref);
|
g_clear_pointer (&device->scroll_info, g_array_unref);
|
||||||
@@ -837,7 +834,6 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
|
|||||||
event->crossing.x = device->current_x;
|
event->crossing.x = device->current_x;
|
||||||
event->crossing.y = device->current_y;
|
event->crossing.y = device->current_y;
|
||||||
event->crossing.related = actor;
|
event->crossing.related = actor;
|
||||||
event->crossing.sequence = sequence;
|
|
||||||
clutter_event_set_device (event, device);
|
clutter_event_set_device (event, device);
|
||||||
|
|
||||||
/* we need to make sure that this event is processed
|
/* we need to make sure that this event is processed
|
||||||
@@ -874,7 +870,6 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
|
|||||||
event->crossing.y = device->current_y;
|
event->crossing.y = device->current_y;
|
||||||
event->crossing.source = actor;
|
event->crossing.source = actor;
|
||||||
event->crossing.related = old_actor;
|
event->crossing.related = old_actor;
|
||||||
event->crossing.sequence = sequence;
|
|
||||||
clutter_event_set_device (event, device);
|
clutter_event_set_device (event, device);
|
||||||
|
|
||||||
/* see above */
|
/* see above */
|
||||||
@@ -1039,10 +1034,9 @@ _clutter_input_device_update (ClutterInputDevice *device,
|
|||||||
ClutterActor *new_cursor_actor;
|
ClutterActor *new_cursor_actor;
|
||||||
ClutterActor *old_cursor_actor;
|
ClutterActor *old_cursor_actor;
|
||||||
ClutterPoint point = { -1, -1 };
|
ClutterPoint point = { -1, -1 };
|
||||||
ClutterInputDeviceType device_type = device->device_type;
|
|
||||||
|
|
||||||
g_assert (device_type != CLUTTER_KEYBOARD_DEVICE &&
|
if (device->device_type == CLUTTER_KEYBOARD_DEVICE)
|
||||||
device_type != CLUTTER_PAD_DEVICE);
|
return NULL;
|
||||||
|
|
||||||
stage = device->stage;
|
stage = device->stage;
|
||||||
if (G_UNLIKELY (stage == NULL))
|
if (G_UNLIKELY (stage == NULL))
|
||||||
@@ -1925,157 +1919,6 @@ _clutter_input_device_reset_scroll_info (ClutterInputDevice *device)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
on_grab_actor_destroy (ClutterActor *actor,
|
|
||||||
ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
switch (device->device_type)
|
|
||||||
{
|
|
||||||
case CLUTTER_POINTER_DEVICE:
|
|
||||||
case CLUTTER_TABLET_DEVICE:
|
|
||||||
device->pointer_grab_actor = NULL;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_KEYBOARD_DEVICE:
|
|
||||||
device->keyboard_grab_actor = NULL;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
g_assert_not_reached ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_input_device_grab:
|
|
||||||
* @device: a #ClutterInputDevice
|
|
||||||
* @actor: a #ClutterActor
|
|
||||||
*
|
|
||||||
* Acquires a grab on @actor for the given @device.
|
|
||||||
*
|
|
||||||
* Any event coming from @device will be delivered to @actor, bypassing
|
|
||||||
* the usual event delivery mechanism, until the grab is released by
|
|
||||||
* calling clutter_input_device_ungrab().
|
|
||||||
*
|
|
||||||
* The grab is client-side: even if the windowing system used by the Clutter
|
|
||||||
* backend has the concept of "device grabs", Clutter will not use them.
|
|
||||||
*
|
|
||||||
* Only #ClutterInputDevice of types %CLUTTER_POINTER_DEVICE,
|
|
||||||
* %CLUTTER_TABLET_DEVICE and %CLUTTER_KEYBOARD_DEVICE can hold a grab.
|
|
||||||
*
|
|
||||||
* Since: 1.10
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_input_device_grab (ClutterInputDevice *device,
|
|
||||||
ClutterActor *actor)
|
|
||||||
{
|
|
||||||
ClutterActor **grab_actor;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
|
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
|
|
||||||
|
|
||||||
switch (device->device_type)
|
|
||||||
{
|
|
||||||
case CLUTTER_POINTER_DEVICE:
|
|
||||||
case CLUTTER_TABLET_DEVICE:
|
|
||||||
grab_actor = &device->pointer_grab_actor;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_KEYBOARD_DEVICE:
|
|
||||||
grab_actor = &device->keyboard_grab_actor;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
g_critical ("Only pointer and keyboard devices can grab an actor");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (*grab_actor != NULL)
|
|
||||||
{
|
|
||||||
g_signal_handlers_disconnect_by_func (*grab_actor,
|
|
||||||
G_CALLBACK (on_grab_actor_destroy),
|
|
||||||
device);
|
|
||||||
}
|
|
||||||
|
|
||||||
*grab_actor = actor;
|
|
||||||
|
|
||||||
g_signal_connect (*grab_actor,
|
|
||||||
"destroy",
|
|
||||||
G_CALLBACK (on_grab_actor_destroy),
|
|
||||||
device);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_input_device_ungrab:
|
|
||||||
* @device: a #ClutterInputDevice
|
|
||||||
*
|
|
||||||
* Releases the grab on the @device, if one is in place.
|
|
||||||
*
|
|
||||||
* Since: 1.10
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_input_device_ungrab (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
ClutterActor **grab_actor;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
|
|
||||||
|
|
||||||
switch (device->device_type)
|
|
||||||
{
|
|
||||||
case CLUTTER_POINTER_DEVICE:
|
|
||||||
case CLUTTER_TABLET_DEVICE:
|
|
||||||
grab_actor = &device->pointer_grab_actor;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_KEYBOARD_DEVICE:
|
|
||||||
grab_actor = &device->keyboard_grab_actor;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (*grab_actor == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
g_signal_handlers_disconnect_by_func (*grab_actor,
|
|
||||||
G_CALLBACK (on_grab_actor_destroy),
|
|
||||||
device);
|
|
||||||
|
|
||||||
*grab_actor = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_input_device_get_grabbed_actor:
|
|
||||||
* @device: a #ClutterInputDevice
|
|
||||||
*
|
|
||||||
* Retrieves a pointer to the #ClutterActor currently grabbing all
|
|
||||||
* the events coming from @device.
|
|
||||||
*
|
|
||||||
* Return value: (transfer none): a #ClutterActor, or %NULL
|
|
||||||
*
|
|
||||||
* Since: 1.10
|
|
||||||
*/
|
|
||||||
ClutterActor *
|
|
||||||
clutter_input_device_get_grabbed_actor (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
|
|
||||||
|
|
||||||
switch (device->device_type)
|
|
||||||
{
|
|
||||||
case CLUTTER_POINTER_DEVICE:
|
|
||||||
case CLUTTER_TABLET_DEVICE:
|
|
||||||
return device->pointer_grab_actor;
|
|
||||||
|
|
||||||
case CLUTTER_KEYBOARD_DEVICE:
|
|
||||||
return device->keyboard_grab_actor;
|
|
||||||
|
|
||||||
default:
|
|
||||||
g_critical ("Only pointer and keyboard devices can grab an actor");
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_grab_sequence_actor_destroy (ClutterActor *actor,
|
on_grab_sequence_actor_destroy (ClutterActor *actor,
|
||||||
ClutterInputDevice *device)
|
ClutterInputDevice *device)
|
||||||
|
@@ -175,8 +175,7 @@ clutter_input_focus_set_can_show_preedit (ClutterInputFocus *focus,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
clutter_input_focus_set_input_panel_state (ClutterInputFocus *focus,
|
clutter_input_focus_request_toggle_input_panel (ClutterInputFocus *focus)
|
||||||
ClutterInputPanelState state)
|
|
||||||
{
|
{
|
||||||
ClutterInputFocusPrivate *priv;
|
ClutterInputFocusPrivate *priv;
|
||||||
|
|
||||||
@@ -185,7 +184,7 @@ clutter_input_focus_set_input_panel_state (ClutterInputFocus *focus,
|
|||||||
|
|
||||||
priv = clutter_input_focus_get_instance_private (focus);
|
priv = clutter_input_focus_get_instance_private (focus);
|
||||||
|
|
||||||
clutter_input_method_set_input_panel_state (priv->im, state);
|
clutter_input_method_toggle_input_panel (priv->im);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -78,7 +78,6 @@ CLUTTER_EXPORT
|
|||||||
void clutter_input_focus_set_can_show_preedit (ClutterInputFocus *focus,
|
void clutter_input_focus_set_can_show_preedit (ClutterInputFocus *focus,
|
||||||
gboolean can_show_preedit);
|
gboolean can_show_preedit);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_input_focus_set_input_panel_state (ClutterInputFocus *focus,
|
void clutter_input_focus_request_toggle_input_panel (ClutterInputFocus *focus);
|
||||||
ClutterInputPanelState state);
|
|
||||||
|
|
||||||
#endif /* __CLUTTER_INPUT_FOCUS_H__ */
|
#endif /* __CLUTTER_INPUT_FOCUS_H__ */
|
||||||
|
@@ -37,8 +37,7 @@ struct _ClutterInputMethodPrivate
|
|||||||
gboolean can_show_preedit;
|
gboolean can_show_preedit;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum {
|
||||||
{
|
|
||||||
COMMIT,
|
COMMIT,
|
||||||
DELETE_SURROUNDING,
|
DELETE_SURROUNDING,
|
||||||
REQUEST_SURROUNDING,
|
REQUEST_SURROUNDING,
|
||||||
@@ -47,8 +46,7 @@ enum
|
|||||||
N_SIGNALS,
|
N_SIGNALS,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum {
|
||||||
{
|
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_CONTENT_HINTS,
|
PROP_CONTENT_HINTS,
|
||||||
PROP_CONTENT_PURPOSE,
|
PROP_CONTENT_PURPOSE,
|
||||||
@@ -266,6 +264,9 @@ clutter_input_method_focus_out (ClutterInputMethod *im)
|
|||||||
|
|
||||||
klass = CLUTTER_INPUT_METHOD_GET_CLASS (im);
|
klass = CLUTTER_INPUT_METHOD_GET_CLASS (im);
|
||||||
klass->focus_out (im);
|
klass->focus_out (im);
|
||||||
|
|
||||||
|
g_signal_emit (im, signals[INPUT_PANEL_STATE],
|
||||||
|
0, CLUTTER_INPUT_PANEL_STATE_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClutterInputFocus *
|
ClutterInputFocus *
|
||||||
@@ -360,12 +361,12 @@ clutter_input_method_notify_key_event (ClutterInputMethod *im,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
clutter_input_method_set_input_panel_state (ClutterInputMethod *im,
|
clutter_input_method_toggle_input_panel (ClutterInputMethod *im)
|
||||||
ClutterInputPanelState state)
|
|
||||||
{
|
{
|
||||||
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im));
|
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im));
|
||||||
|
|
||||||
g_signal_emit (im, signals[INPUT_PANEL_STATE], 0, state);
|
g_signal_emit (im, signals[INPUT_PANEL_STATE], 0,
|
||||||
|
CLUTTER_INPUT_PANEL_STATE_TOGGLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -83,8 +83,7 @@ void clutter_input_method_notify_key_event (ClutterInputMethod *im,
|
|||||||
const ClutterEvent *event,
|
const ClutterEvent *event,
|
||||||
gboolean filtered);
|
gboolean filtered);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_input_method_set_input_panel_state (ClutterInputMethod *im,
|
void clutter_input_method_request_toggle_input_panel (ClutterInputMethod *im);
|
||||||
ClutterInputPanelState state);
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_input_method_forward_key (ClutterInputMethod *im,
|
void clutter_input_method_forward_key (ClutterInputMethod *im,
|
||||||
|
@@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2019 Red Hat
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
* 02111-1307, USA.
|
|
||||||
*
|
|
||||||
* Author: Olivier Fourdan <ofourdan@redhat.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __CLUTTER_INPUT_POINTER_A11Y_H__
|
|
||||||
#define __CLUTTER_INPUT_POINTER_A11Y_H__
|
|
||||||
|
|
||||||
#include <clutter/clutter-types.h>
|
|
||||||
#include "clutter-enum-types.h"
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_pointer_a11y_add_device (ClutterInputDevice *device);
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_pointer_a11y_remove_device (ClutterInputDevice *device);
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_pointer_a11y_on_motion_event (ClutterInputDevice *device,
|
|
||||||
float x,
|
|
||||||
float y);
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void _clutter_input_pointer_a11y_on_button_event (ClutterInputDevice *device,
|
|
||||||
int button,
|
|
||||||
gboolean pressed);
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean _clutter_is_input_pointer_a11y_enabled (ClutterInputDevice *device);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __CLUTTER_INPUT_POINTER_A11Y_H__ */
|
|
@@ -1,710 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2019 Red Hat
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
* 02111-1307, USA.
|
|
||||||
*
|
|
||||||
* Author: Olivier Fourdan <ofourdan@redhat.com>
|
|
||||||
*
|
|
||||||
* This reimplements in Clutter the same behavior as mousetweaks original
|
|
||||||
* implementation by Gerd Kohlberger <gerdko gmail com>
|
|
||||||
* mousetweaks Copyright (C) 2007-2010 Gerd Kohlberger <gerdko gmail com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "clutter-build-config.h"
|
|
||||||
|
|
||||||
#include "clutter-device-manager.h"
|
|
||||||
#include "clutter-device-manager-private.h"
|
|
||||||
#include "clutter-enum-types.h"
|
|
||||||
#include "clutter-input-device.h"
|
|
||||||
#include "clutter-input-pointer-a11y-private.h"
|
|
||||||
#include "clutter-main.h"
|
|
||||||
#include "clutter-virtual-input-device.h"
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
is_secondary_click_enabled (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
ClutterPointerA11ySettings settings;
|
|
||||||
|
|
||||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
|
||||||
|
|
||||||
return (settings.controls & CLUTTER_A11Y_SECONDARY_CLICK_ENABLED);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
is_dwell_click_enabled (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
ClutterPointerA11ySettings settings;
|
|
||||||
|
|
||||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
|
||||||
|
|
||||||
return (settings.controls & CLUTTER_A11Y_DWELL_ENABLED);
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned int
|
|
||||||
get_secondary_click_delay (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
ClutterPointerA11ySettings settings;
|
|
||||||
|
|
||||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
|
||||||
|
|
||||||
return settings.secondary_click_delay;
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned int
|
|
||||||
get_dwell_delay (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
ClutterPointerA11ySettings settings;
|
|
||||||
|
|
||||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
|
||||||
|
|
||||||
return settings.dwell_delay;
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned int
|
|
||||||
get_dwell_threshold (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
ClutterPointerA11ySettings settings;
|
|
||||||
|
|
||||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
|
||||||
|
|
||||||
return settings.dwell_threshold;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ClutterPointerA11yDwellMode
|
|
||||||
get_dwell_mode (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
ClutterPointerA11ySettings settings;
|
|
||||||
|
|
||||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
|
||||||
|
|
||||||
return settings.dwell_mode;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ClutterPointerA11yDwellClickType
|
|
||||||
get_dwell_click_type (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
ClutterPointerA11ySettings settings;
|
|
||||||
|
|
||||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
|
||||||
|
|
||||||
return settings.dwell_click_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ClutterPointerA11yDwellClickType
|
|
||||||
get_dwell_click_type_for_direction (ClutterInputDevice *device,
|
|
||||||
ClutterPointerA11yDwellDirection direction)
|
|
||||||
{
|
|
||||||
ClutterPointerA11ySettings settings;
|
|
||||||
|
|
||||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
|
||||||
|
|
||||||
if (direction == settings.dwell_gesture_single)
|
|
||||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY;
|
|
||||||
else if (direction == settings.dwell_gesture_double)
|
|
||||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE;
|
|
||||||
else if (direction == settings.dwell_gesture_drag)
|
|
||||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG;
|
|
||||||
else if (direction == settings.dwell_gesture_secondary)
|
|
||||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY;
|
|
||||||
|
|
||||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
emit_button_press (ClutterInputDevice *device,
|
|
||||||
gint button)
|
|
||||||
{
|
|
||||||
clutter_virtual_input_device_notify_button (device->accessibility_virtual_device,
|
|
||||||
g_get_monotonic_time (),
|
|
||||||
button,
|
|
||||||
CLUTTER_BUTTON_STATE_PRESSED);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
emit_button_release (ClutterInputDevice *device,
|
|
||||||
gint button)
|
|
||||||
{
|
|
||||||
clutter_virtual_input_device_notify_button (device->accessibility_virtual_device,
|
|
||||||
g_get_monotonic_time (),
|
|
||||||
button,
|
|
||||||
CLUTTER_BUTTON_STATE_RELEASED);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
emit_button_click (ClutterInputDevice *device,
|
|
||||||
gint button)
|
|
||||||
{
|
|
||||||
emit_button_press (device, button);
|
|
||||||
emit_button_release (device, button);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
restore_dwell_position (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
clutter_virtual_input_device_notify_absolute_motion (device->accessibility_virtual_device,
|
|
||||||
g_get_monotonic_time (),
|
|
||||||
device->ptr_a11y_data->dwell_x,
|
|
||||||
device->ptr_a11y_data->dwell_y);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
trigger_secondary_click (gpointer data)
|
|
||||||
{
|
|
||||||
ClutterInputDevice *device = data;
|
|
||||||
|
|
||||||
device->ptr_a11y_data->secondary_click_triggered = TRUE;
|
|
||||||
device->ptr_a11y_data->secondary_click_timer = 0;
|
|
||||||
|
|
||||||
g_signal_emit_by_name (device->device_manager,
|
|
||||||
"ptr-a11y-timeout-stopped",
|
|
||||||
device,
|
|
||||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
|
||||||
TRUE);
|
|
||||||
|
|
||||||
return G_SOURCE_REMOVE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
start_secondary_click_timeout (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
unsigned int delay = get_secondary_click_delay (device);
|
|
||||||
|
|
||||||
device->ptr_a11y_data->secondary_click_timer =
|
|
||||||
clutter_threads_add_timeout (delay, trigger_secondary_click, device);
|
|
||||||
|
|
||||||
g_signal_emit_by_name (device->device_manager,
|
|
||||||
"ptr-a11y-timeout-started",
|
|
||||||
device,
|
|
||||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
|
||||||
delay);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
stop_secondary_click_timeout (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
if (device->ptr_a11y_data->secondary_click_timer)
|
|
||||||
{
|
|
||||||
g_source_remove (device->ptr_a11y_data->secondary_click_timer);
|
|
||||||
device->ptr_a11y_data->secondary_click_timer = 0;
|
|
||||||
|
|
||||||
g_signal_emit_by_name (device->device_manager,
|
|
||||||
"ptr-a11y-timeout-stopped",
|
|
||||||
device,
|
|
||||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
|
||||||
FALSE);
|
|
||||||
}
|
|
||||||
device->ptr_a11y_data->secondary_click_triggered = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
pointer_has_moved (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
float dx, dy;
|
|
||||||
gint threshold;
|
|
||||||
|
|
||||||
dx = device->ptr_a11y_data->dwell_x - device->ptr_a11y_data->current_x;
|
|
||||||
dy = device->ptr_a11y_data->dwell_y - device->ptr_a11y_data->current_y;
|
|
||||||
threshold = get_dwell_threshold (device);
|
|
||||||
|
|
||||||
/* Pythagorean theorem */
|
|
||||||
return ((dx * dx) + (dy * dy)) > (threshold * threshold);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
is_secondary_click_pending (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
return device->ptr_a11y_data->secondary_click_timer != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
is_secondary_click_triggered (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
return device->ptr_a11y_data->secondary_click_triggered;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
is_dwell_click_pending (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
return device->ptr_a11y_data->dwell_timer != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
is_dwell_dragging (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
return device->ptr_a11y_data->dwell_drag_started;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
is_dwell_gesturing (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
return device->ptr_a11y_data->dwell_gesture_started;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
has_button_pressed (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
return device->ptr_a11y_data->n_btn_pressed > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
should_start_secondary_click_timeout (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
return !is_dwell_dragging (device);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
should_start_dwell (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
/* We should trigger a dwell if we've not already started one, and if
|
|
||||||
* no button is currently pressed or we are in the middle of a dwell
|
|
||||||
* drag action.
|
|
||||||
*/
|
|
||||||
return !is_dwell_click_pending (device) &&
|
|
||||||
(is_dwell_dragging (device) ||
|
|
||||||
!has_button_pressed (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
should_stop_dwell (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
/* We should stop a dwell if the motion exceeds the threshold, unless
|
|
||||||
* we've started a gesture, because we want to keep the original dwell
|
|
||||||
* location to both detect a gesture and restore the original pointer
|
|
||||||
* location once the gesture is finished.
|
|
||||||
*/
|
|
||||||
return pointer_has_moved (device) &&
|
|
||||||
!is_dwell_gesturing (device);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
should_update_dwell_position (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
return !is_dwell_gesturing (device) &&
|
|
||||||
!is_dwell_click_pending (device) &&
|
|
||||||
!is_secondary_click_pending (device);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
update_dwell_click_type (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
ClutterPointerA11ySettings settings;
|
|
||||||
ClutterPointerA11yDwellClickType dwell_click_type;
|
|
||||||
|
|
||||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
|
||||||
|
|
||||||
dwell_click_type = settings.dwell_click_type;
|
|
||||||
switch (dwell_click_type)
|
|
||||||
{
|
|
||||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE:
|
|
||||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY:
|
|
||||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE:
|
|
||||||
dwell_click_type = CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG:
|
|
||||||
if (!is_dwell_dragging (device))
|
|
||||||
dwell_click_type = CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY:
|
|
||||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE:
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dwell_click_type != settings.dwell_click_type)
|
|
||||||
{
|
|
||||||
settings.dwell_click_type = dwell_click_type;
|
|
||||||
clutter_device_manager_set_pointer_a11y_settings (device->device_manager,
|
|
||||||
&settings);
|
|
||||||
|
|
||||||
g_signal_emit_by_name (device->device_manager,
|
|
||||||
"ptr-a11y-dwell-click-type-changed",
|
|
||||||
dwell_click_type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
emit_dwell_click (ClutterInputDevice *device,
|
|
||||||
ClutterPointerA11yDwellClickType dwell_click_type)
|
|
||||||
{
|
|
||||||
switch (dwell_click_type)
|
|
||||||
{
|
|
||||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY:
|
|
||||||
emit_button_click (device, CLUTTER_BUTTON_PRIMARY);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE:
|
|
||||||
emit_button_click (device, CLUTTER_BUTTON_PRIMARY);
|
|
||||||
emit_button_click (device, CLUTTER_BUTTON_PRIMARY);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG:
|
|
||||||
if (is_dwell_dragging (device))
|
|
||||||
{
|
|
||||||
emit_button_release (device, CLUTTER_BUTTON_PRIMARY);
|
|
||||||
device->ptr_a11y_data->dwell_drag_started = FALSE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
emit_button_press (device, CLUTTER_BUTTON_PRIMARY);
|
|
||||||
device->ptr_a11y_data->dwell_drag_started = TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY:
|
|
||||||
emit_button_click (device, CLUTTER_BUTTON_SECONDARY);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE:
|
|
||||||
emit_button_click (device, CLUTTER_BUTTON_MIDDLE);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE:
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static ClutterPointerA11yDwellDirection
|
|
||||||
get_dwell_direction (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
float dx, dy;
|
|
||||||
|
|
||||||
dx = ABS (device->ptr_a11y_data->dwell_x - device->ptr_a11y_data->current_x);
|
|
||||||
dy = ABS (device->ptr_a11y_data->dwell_y - device->ptr_a11y_data->current_y);
|
|
||||||
|
|
||||||
/* The pointer hasn't moved */
|
|
||||||
if (!pointer_has_moved (device))
|
|
||||||
return CLUTTER_A11Y_DWELL_DIRECTION_NONE;
|
|
||||||
|
|
||||||
if (device->ptr_a11y_data->dwell_x < device->ptr_a11y_data->current_x)
|
|
||||||
{
|
|
||||||
if (dx > dy)
|
|
||||||
return CLUTTER_A11Y_DWELL_DIRECTION_LEFT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (dx > dy)
|
|
||||||
return CLUTTER_A11Y_DWELL_DIRECTION_RIGHT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (device->ptr_a11y_data->dwell_y < device->ptr_a11y_data->current_y)
|
|
||||||
return CLUTTER_A11Y_DWELL_DIRECTION_UP;
|
|
||||||
|
|
||||||
return CLUTTER_A11Y_DWELL_DIRECTION_DOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
trigger_clear_dwell_gesture (gpointer data)
|
|
||||||
{
|
|
||||||
ClutterInputDevice *device = data;
|
|
||||||
|
|
||||||
device->ptr_a11y_data->dwell_timer = 0;
|
|
||||||
device->ptr_a11y_data->dwell_gesture_started = FALSE;
|
|
||||||
|
|
||||||
return G_SOURCE_REMOVE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
trigger_dwell_gesture (gpointer data)
|
|
||||||
{
|
|
||||||
ClutterInputDevice *device = data;
|
|
||||||
ClutterPointerA11yDwellDirection direction;
|
|
||||||
unsigned int delay = get_dwell_delay (device);
|
|
||||||
|
|
||||||
restore_dwell_position (device);
|
|
||||||
direction = get_dwell_direction (device);
|
|
||||||
emit_dwell_click (device,
|
|
||||||
get_dwell_click_type_for_direction (device,
|
|
||||||
direction));
|
|
||||||
|
|
||||||
/* Do not clear the gesture right away, otherwise we'll start another one */
|
|
||||||
device->ptr_a11y_data->dwell_timer =
|
|
||||||
clutter_threads_add_timeout (delay, trigger_clear_dwell_gesture, device);
|
|
||||||
|
|
||||||
g_signal_emit_by_name (device->device_manager,
|
|
||||||
"ptr-a11y-timeout-stopped",
|
|
||||||
device,
|
|
||||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
|
||||||
TRUE);
|
|
||||||
|
|
||||||
return G_SOURCE_REMOVE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
start_dwell_gesture_timeout (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
unsigned int delay = get_dwell_delay (device);
|
|
||||||
|
|
||||||
device->ptr_a11y_data->dwell_timer =
|
|
||||||
clutter_threads_add_timeout (delay, trigger_dwell_gesture, device);
|
|
||||||
device->ptr_a11y_data->dwell_gesture_started = TRUE;
|
|
||||||
|
|
||||||
g_signal_emit_by_name (device->device_manager,
|
|
||||||
"ptr-a11y-timeout-started",
|
|
||||||
device,
|
|
||||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
|
||||||
delay);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
trigger_dwell_click (gpointer data)
|
|
||||||
{
|
|
||||||
ClutterInputDevice *device = data;
|
|
||||||
|
|
||||||
device->ptr_a11y_data->dwell_timer = 0;
|
|
||||||
|
|
||||||
g_signal_emit_by_name (device->device_manager,
|
|
||||||
"ptr-a11y-timeout-stopped",
|
|
||||||
device,
|
|
||||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
|
||||||
TRUE);
|
|
||||||
|
|
||||||
if (get_dwell_mode (device) == CLUTTER_A11Y_DWELL_MODE_GESTURE)
|
|
||||||
{
|
|
||||||
if (is_dwell_dragging (device))
|
|
||||||
emit_dwell_click (device, CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG);
|
|
||||||
else
|
|
||||||
start_dwell_gesture_timeout (device);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
emit_dwell_click (device, get_dwell_click_type (device));
|
|
||||||
update_dwell_click_type (device);
|
|
||||||
}
|
|
||||||
|
|
||||||
return G_SOURCE_REMOVE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
start_dwell_timeout (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
unsigned int delay = get_dwell_delay (device);
|
|
||||||
|
|
||||||
device->ptr_a11y_data->dwell_timer =
|
|
||||||
clutter_threads_add_timeout (delay, trigger_dwell_click, device);
|
|
||||||
|
|
||||||
g_signal_emit_by_name (device->device_manager,
|
|
||||||
"ptr-a11y-timeout-started",
|
|
||||||
device,
|
|
||||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
|
||||||
delay);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
stop_dwell_timeout (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
if (device->ptr_a11y_data->dwell_timer)
|
|
||||||
{
|
|
||||||
g_source_remove (device->ptr_a11y_data->dwell_timer);
|
|
||||||
device->ptr_a11y_data->dwell_timer = 0;
|
|
||||||
device->ptr_a11y_data->dwell_gesture_started = FALSE;
|
|
||||||
|
|
||||||
g_signal_emit_by_name (device->device_manager,
|
|
||||||
"ptr-a11y-timeout-stopped",
|
|
||||||
device,
|
|
||||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
|
||||||
FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
trigger_dwell_position_timeout (gpointer data)
|
|
||||||
{
|
|
||||||
ClutterInputDevice *device = data;
|
|
||||||
|
|
||||||
device->ptr_a11y_data->dwell_position_timer = 0;
|
|
||||||
|
|
||||||
if (is_dwell_click_enabled (device))
|
|
||||||
{
|
|
||||||
if (!pointer_has_moved (device))
|
|
||||||
start_dwell_timeout (device);
|
|
||||||
}
|
|
||||||
|
|
||||||
return G_SOURCE_REMOVE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
start_dwell_position_timeout (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
device->ptr_a11y_data->dwell_position_timer =
|
|
||||||
clutter_threads_add_timeout (100, trigger_dwell_position_timeout, device);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
stop_dwell_position_timeout (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
g_clear_handle_id (&device->ptr_a11y_data->dwell_position_timer,
|
|
||||||
g_source_remove);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
update_dwell_position (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
device->ptr_a11y_data->dwell_x = device->ptr_a11y_data->current_x;
|
|
||||||
device->ptr_a11y_data->dwell_y = device->ptr_a11y_data->current_y;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
update_current_position (ClutterInputDevice *device,
|
|
||||||
float x,
|
|
||||||
float y)
|
|
||||||
{
|
|
||||||
device->ptr_a11y_data->current_x = x;
|
|
||||||
device->ptr_a11y_data->current_y = y;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
is_device_core_pointer (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
ClutterInputDevice *core_pointer;
|
|
||||||
|
|
||||||
core_pointer = clutter_device_manager_get_core_device (device->device_manager,
|
|
||||||
CLUTTER_POINTER_DEVICE);
|
|
||||||
if (core_pointer == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return (core_pointer == device);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
_clutter_input_pointer_a11y_add_device (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
if (!is_device_core_pointer (device))
|
|
||||||
return;
|
|
||||||
|
|
||||||
device->accessibility_virtual_device =
|
|
||||||
clutter_device_manager_create_virtual_device (device->device_manager,
|
|
||||||
CLUTTER_POINTER_DEVICE);
|
|
||||||
|
|
||||||
device->ptr_a11y_data = g_new0 (ClutterPtrA11yData, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
_clutter_input_pointer_a11y_remove_device (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
if (!is_device_core_pointer (device))
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* Terminate a drag if started */
|
|
||||||
if (is_dwell_dragging (device))
|
|
||||||
emit_dwell_click (device, CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG);
|
|
||||||
|
|
||||||
stop_dwell_position_timeout (device);
|
|
||||||
stop_dwell_timeout (device);
|
|
||||||
stop_secondary_click_timeout (device);
|
|
||||||
|
|
||||||
g_clear_pointer (&device->ptr_a11y_data, g_free);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
_clutter_input_pointer_a11y_on_motion_event (ClutterInputDevice *device,
|
|
||||||
float x,
|
|
||||||
float y)
|
|
||||||
{
|
|
||||||
if (!is_device_core_pointer (device))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!_clutter_is_input_pointer_a11y_enabled (device))
|
|
||||||
return;
|
|
||||||
|
|
||||||
update_current_position (device, x, y);
|
|
||||||
|
|
||||||
if (is_secondary_click_enabled (device))
|
|
||||||
{
|
|
||||||
if (pointer_has_moved (device))
|
|
||||||
stop_secondary_click_timeout (device);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_dwell_click_enabled (device))
|
|
||||||
{
|
|
||||||
stop_dwell_position_timeout (device);
|
|
||||||
|
|
||||||
if (should_stop_dwell (device))
|
|
||||||
stop_dwell_timeout (device);
|
|
||||||
|
|
||||||
if (should_start_dwell (device))
|
|
||||||
start_dwell_position_timeout (device);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (should_update_dwell_position (device))
|
|
||||||
update_dwell_position (device);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
_clutter_input_pointer_a11y_on_button_event (ClutterInputDevice *device,
|
|
||||||
int button,
|
|
||||||
gboolean pressed)
|
|
||||||
{
|
|
||||||
if (!is_device_core_pointer (device))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!_clutter_is_input_pointer_a11y_enabled (device))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (pressed)
|
|
||||||
{
|
|
||||||
device->ptr_a11y_data->n_btn_pressed++;
|
|
||||||
|
|
||||||
stop_dwell_position_timeout (device);
|
|
||||||
|
|
||||||
if (is_dwell_click_enabled (device))
|
|
||||||
stop_dwell_timeout (device);
|
|
||||||
|
|
||||||
if (is_dwell_dragging (device))
|
|
||||||
stop_dwell_timeout (device);
|
|
||||||
|
|
||||||
if (is_secondary_click_enabled (device))
|
|
||||||
{
|
|
||||||
if (button == CLUTTER_BUTTON_PRIMARY)
|
|
||||||
{
|
|
||||||
if (should_start_secondary_click_timeout (device))
|
|
||||||
start_secondary_click_timeout (device);
|
|
||||||
}
|
|
||||||
else if (is_secondary_click_pending (device))
|
|
||||||
{
|
|
||||||
stop_secondary_click_timeout (device);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (has_button_pressed (device))
|
|
||||||
device->ptr_a11y_data->n_btn_pressed--;
|
|
||||||
|
|
||||||
if (is_secondary_click_triggered (device))
|
|
||||||
{
|
|
||||||
emit_button_click (device, CLUTTER_BUTTON_SECONDARY);
|
|
||||||
stop_secondary_click_timeout (device);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_secondary_click_pending (device))
|
|
||||||
stop_secondary_click_timeout (device);
|
|
||||||
|
|
||||||
if (is_dwell_dragging (device))
|
|
||||||
emit_dwell_click (device, CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
|
||||||
_clutter_is_input_pointer_a11y_enabled (ClutterInputDevice *device)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
|
||||||
|
|
||||||
return (is_secondary_click_enabled (device) || is_dwell_click_enabled (device));
|
|
||||||
}
|
|
@@ -1,64 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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);
|
|
||||||
}
|
|
@@ -1,56 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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 */
|
|
@@ -444,7 +444,8 @@ clutter_layout_manager_class_init (ClutterLayoutManagerClass *klass)
|
|||||||
G_SIGNAL_RUN_LAST,
|
G_SIGNAL_RUN_LAST,
|
||||||
G_STRUCT_OFFSET (ClutterLayoutManagerClass,
|
G_STRUCT_OFFSET (ClutterLayoutManagerClass,
|
||||||
layout_changed),
|
layout_changed),
|
||||||
NULL, NULL, NULL,
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__VOID,
|
||||||
G_TYPE_NONE, 0);
|
G_TYPE_NONE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -53,8 +53,7 @@ G_BEGIN_DECLS
|
|||||||
*
|
*
|
||||||
* Since: 0.2
|
* Since: 0.2
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_INIT_SUCCESS = 1,
|
CLUTTER_INIT_SUCCESS = 1,
|
||||||
CLUTTER_INIT_ERROR_UNKNOWN = 0,
|
CLUTTER_INIT_ERROR_UNKNOWN = 0,
|
||||||
CLUTTER_INIT_ERROR_THREADS = -1,
|
CLUTTER_INIT_ERROR_THREADS = -1,
|
||||||
@@ -117,6 +116,9 @@ void clutter_disable_accessibility (void);
|
|||||||
|
|
||||||
/* Threading functions */
|
/* Threading functions */
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
|
void clutter_threads_set_lock_functions (GCallback enter_fn,
|
||||||
|
GCallback leave_fn);
|
||||||
|
CLUTTER_EXPORT
|
||||||
guint clutter_threads_add_idle (GSourceFunc func,
|
guint clutter_threads_add_idle (GSourceFunc func,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
@@ -146,6 +148,19 @@ guint clutter_threads_add_repaint_func_full (ClutterRepaintF
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_threads_remove_repaint_func (guint handle_id);
|
void clutter_threads_remove_repaint_func (guint handle_id);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
void clutter_grab_pointer (ClutterActor *actor);
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
void clutter_ungrab_pointer (void);
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
ClutterActor * clutter_get_pointer_grab (void);
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
void clutter_grab_keyboard (ClutterActor *actor);
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
void clutter_ungrab_keyboard (void);
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
ClutterActor * clutter_get_keyboard_grab (void);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
PangoFontMap * clutter_get_font_map (void);
|
PangoFontMap * clutter_get_font_map (void);
|
||||||
|
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
BOOLEAN:BOXED
|
BOOLEAN:BOXED
|
||||||
BOOLEAN:BOXED,INT,INT
|
BOOLEAN:BOXED,INT,INT
|
||||||
BOOLEAN:OBJECT,BOOLEAN
|
BOOLEAN:OBJECT,BOOLEAN
|
||||||
BOOLEAN:OBJECT,BOXED
|
|
||||||
BOOLEAN:OBJECT,BOXED,DOUBLE
|
BOOLEAN:OBJECT,BOXED,DOUBLE
|
||||||
BOOLEAN:OBJECT,DOUBLE
|
BOOLEAN:OBJECT,DOUBLE
|
||||||
BOOLEAN:OBJECT,ENUM
|
BOOLEAN:OBJECT,ENUM
|
||||||
@@ -12,24 +11,29 @@ BOOLEAN:OBJECT,FLOAT,FLOAT
|
|||||||
BOXED:UINT,UINT
|
BOXED:UINT,UINT
|
||||||
DOUBLE:VOID
|
DOUBLE:VOID
|
||||||
UINT:VOID
|
UINT:VOID
|
||||||
|
VOID:BOOLEAN
|
||||||
|
VOID:BOXED
|
||||||
VOID:BOXED,FLAGS
|
VOID:BOXED,FLAGS
|
||||||
|
VOID:INT
|
||||||
VOID:INT64,INT64,FLOAT,BOOLEAN
|
VOID:INT64,INT64,FLOAT,BOOLEAN
|
||||||
VOID:INT,INT
|
VOID:INT,INT
|
||||||
VOID:INT,POINTER
|
VOID:INT,POINTER
|
||||||
VOID:FLOAT,FLOAT
|
VOID:FLOAT,FLOAT
|
||||||
VOID:INT,INT,INT,INT
|
VOID:INT,INT,INT,INT
|
||||||
|
VOID:OBJECT
|
||||||
VOID:OBJECT,FLAGS
|
VOID:OBJECT,FLAGS
|
||||||
VOID:OBJECT,FLAGS,BOOLEAN
|
|
||||||
VOID:OBJECT,FLAGS,UINT
|
|
||||||
VOID:OBJECT,FLOAT,FLOAT
|
VOID:OBJECT,FLOAT,FLOAT
|
||||||
VOID:OBJECT,FLOAT,FLOAT,FLAGS
|
VOID:OBJECT,FLOAT,FLOAT,FLAGS
|
||||||
VOID:OBJECT,OBJECT
|
VOID:OBJECT,OBJECT
|
||||||
VOID:OBJECT,PARAM
|
VOID:OBJECT,PARAM
|
||||||
VOID:OBJECT,POINTER
|
VOID:OBJECT,POINTER
|
||||||
VOID:OBJECT,UINT
|
VOID:OBJECT,UINT
|
||||||
|
VOID:POINTER
|
||||||
VOID:STRING,BOOLEAN
|
VOID:STRING,BOOLEAN
|
||||||
VOID:STRING,BOOLEAN,BOOLEAN
|
VOID:STRING,BOOLEAN,BOOLEAN
|
||||||
VOID:STRING,INT
|
VOID:STRING,INT
|
||||||
|
VOID:UINT
|
||||||
VOID:UINT,STRING,UINT
|
VOID:UINT,STRING,UINT
|
||||||
VOID:UINT,UINT
|
VOID:UINT,UINT
|
||||||
|
VOID:VOID
|
||||||
VOID:STRING,INT,POINTER
|
VOID:STRING,INT,POINTER
|
||||||
|
@@ -64,6 +64,9 @@ struct _ClutterMasterClockDefault
|
|||||||
/* the current state of the clock, in usecs */
|
/* the current state of the clock, in usecs */
|
||||||
gint64 cur_tick;
|
gint64 cur_tick;
|
||||||
|
|
||||||
|
/* the previous state of the clock, in usecs, used to compute the delta */
|
||||||
|
gint64 prev_tick;
|
||||||
|
|
||||||
#ifdef CLUTTER_ENABLE_DEBUG
|
#ifdef CLUTTER_ENABLE_DEBUG
|
||||||
gint64 frame_budget;
|
gint64 frame_budget;
|
||||||
gint64 remaining_budget;
|
gint64 remaining_budget;
|
||||||
@@ -74,6 +77,12 @@ struct _ClutterMasterClockDefault
|
|||||||
*/
|
*/
|
||||||
GSource *source;
|
GSource *source;
|
||||||
|
|
||||||
|
/* If the master clock is idle that means it has
|
||||||
|
* fallen back to idle polling for timeline
|
||||||
|
* progressions and it may have been some time since
|
||||||
|
* the last real stage update.
|
||||||
|
*/
|
||||||
|
guint idle : 1;
|
||||||
guint ensure_next_iteration : 1;
|
guint ensure_next_iteration : 1;
|
||||||
|
|
||||||
guint paused : 1;
|
guint paused : 1;
|
||||||
@@ -100,8 +109,7 @@ static GSourceFuncs clock_funcs = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void clutter_master_clock_iface_init (ClutterMasterClockIface *iface);
|
||||||
clutter_master_clock_iface_init (ClutterMasterClockInterface *iface);
|
|
||||||
|
|
||||||
#define clutter_master_clock_default_get_type _clutter_master_clock_default_get_type
|
#define clutter_master_clock_default_get_type _clutter_master_clock_default_get_type
|
||||||
|
|
||||||
@@ -266,12 +274,78 @@ master_clock_reschedule_stage_updates (ClutterMasterClockDefault *master_clock,
|
|||||||
static gint
|
static gint
|
||||||
master_clock_next_frame_delay (ClutterMasterClockDefault *master_clock)
|
master_clock_next_frame_delay (ClutterMasterClockDefault *master_clock)
|
||||||
{
|
{
|
||||||
|
gint64 now, next;
|
||||||
|
gint swap_delay;
|
||||||
|
|
||||||
if (!master_clock_is_running (master_clock))
|
if (!master_clock_is_running (master_clock))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* If all of the stages are busy waiting for a swap-buffers to complete
|
/* If all of the stages are busy waiting for a swap-buffers to complete
|
||||||
* then we wait for one to be ready.. */
|
* then we wait for one to be ready.. */
|
||||||
return master_clock_get_swap_wait_time (master_clock);
|
swap_delay = master_clock_get_swap_wait_time (master_clock);
|
||||||
|
if (swap_delay != 0)
|
||||||
|
return swap_delay;
|
||||||
|
|
||||||
|
/* When we have sync-to-vblank, we count on swap-buffer requests (or
|
||||||
|
* swap-buffer-complete events if supported in the backend) to throttle our
|
||||||
|
* frame rate so no additional delay is needed to start the next frame.
|
||||||
|
*
|
||||||
|
* If the master-clock has become idle due to no timeline progression causing
|
||||||
|
* redraws then we can no longer rely on vblank synchronization because the
|
||||||
|
* last real stage update/redraw may have happened a long time ago and so we
|
||||||
|
* fallback to polling for timeline progressions every 1/frame_rate seconds.
|
||||||
|
*
|
||||||
|
* (NB: if there aren't even any timelines running then the master clock will
|
||||||
|
* be completely stopped in master_clock_is_running())
|
||||||
|
*/
|
||||||
|
if (clutter_feature_available (CLUTTER_FEATURE_SYNC_TO_VBLANK) &&
|
||||||
|
!master_clock->idle)
|
||||||
|
{
|
||||||
|
CLUTTER_NOTE (SCHEDULER, "vblank available and updated stages");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (master_clock->prev_tick == 0)
|
||||||
|
{
|
||||||
|
/* If we weren't previously running, then draw the next frame
|
||||||
|
* immediately
|
||||||
|
*/
|
||||||
|
CLUTTER_NOTE (SCHEDULER, "draw the first frame immediately");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Otherwise, wait at least 1/frame_rate seconds since we last
|
||||||
|
* started a frame
|
||||||
|
*/
|
||||||
|
now = g_source_get_time (master_clock->source);
|
||||||
|
|
||||||
|
next = master_clock->prev_tick;
|
||||||
|
|
||||||
|
/* If time has gone backwards then there's no way of knowing how
|
||||||
|
long we should wait so let's just dispatch immediately */
|
||||||
|
if (now <= next)
|
||||||
|
{
|
||||||
|
CLUTTER_NOTE (SCHEDULER, "Time has gone backwards");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
next += (1000000L / clutter_get_default_frame_rate ());
|
||||||
|
|
||||||
|
if (next <= now)
|
||||||
|
{
|
||||||
|
CLUTTER_NOTE (SCHEDULER, "Less than %lu microsecs",
|
||||||
|
1000000L / (gulong) clutter_get_default_frame_rate ());
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CLUTTER_NOTE (SCHEDULER, "Waiting %" G_GINT64_FORMAT " msecs",
|
||||||
|
(next - now) / 1000);
|
||||||
|
|
||||||
|
return (next - now) / 1000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -337,7 +411,8 @@ master_clock_advance_timelines (ClutterMasterClockDefault *master_clock)
|
|||||||
for (l = timelines; l != NULL; l = l->next)
|
for (l = timelines; l != NULL; l = l->next)
|
||||||
_clutter_timeline_do_tick (l->data, master_clock->cur_tick / 1000);
|
_clutter_timeline_do_tick (l->data, master_clock->cur_tick / 1000);
|
||||||
|
|
||||||
g_slist_free_full (timelines, g_object_unref);
|
g_slist_foreach (timelines, (GFunc) g_object_unref, NULL);
|
||||||
|
g_slist_free (timelines);
|
||||||
|
|
||||||
#ifdef CLUTTER_ENABLE_DEBUG
|
#ifdef CLUTTER_ENABLE_DEBUG
|
||||||
if (_clutter_diagnostic_enabled ())
|
if (_clutter_diagnostic_enabled ())
|
||||||
@@ -455,6 +530,7 @@ clutter_clock_dispatch (GSource *source,
|
|||||||
{
|
{
|
||||||
ClutterClockSource *clock_source = (ClutterClockSource *) source;
|
ClutterClockSource *clock_source = (ClutterClockSource *) source;
|
||||||
ClutterMasterClockDefault *master_clock = clock_source->master_clock;
|
ClutterMasterClockDefault *master_clock = clock_source->master_clock;
|
||||||
|
gboolean stages_updated = FALSE;
|
||||||
GSList *stages;
|
GSList *stages;
|
||||||
|
|
||||||
CLUTTER_NOTE (SCHEDULER, "Master clock [tick]");
|
CLUTTER_NOTE (SCHEDULER, "Master clock [tick]");
|
||||||
@@ -474,6 +550,8 @@ clutter_clock_dispatch (GSource *source,
|
|||||||
*/
|
*/
|
||||||
stages = master_clock_list_ready_stages (master_clock);
|
stages = master_clock_list_ready_stages (master_clock);
|
||||||
|
|
||||||
|
master_clock->idle = FALSE;
|
||||||
|
|
||||||
/* Each frame is split into three separate phases: */
|
/* Each frame is split into three separate phases: */
|
||||||
|
|
||||||
/* 1. process all the events; each stage goes through its events queue
|
/* 1. process all the events; each stage goes through its events queue
|
||||||
@@ -486,11 +564,19 @@ clutter_clock_dispatch (GSource *source,
|
|||||||
master_clock_advance_timelines (master_clock);
|
master_clock_advance_timelines (master_clock);
|
||||||
|
|
||||||
/* 3. relayout and redraw the stages */
|
/* 3. relayout and redraw the stages */
|
||||||
master_clock_update_stages (master_clock, stages);
|
stages_updated = master_clock_update_stages (master_clock, stages);
|
||||||
|
|
||||||
|
/* The master clock goes idle if no stages were updated and falls back
|
||||||
|
* to polling for timeline progressions... */
|
||||||
|
if (!stages_updated)
|
||||||
|
master_clock->idle = TRUE;
|
||||||
|
|
||||||
master_clock_reschedule_stage_updates (master_clock, stages);
|
master_clock_reschedule_stage_updates (master_clock, stages);
|
||||||
|
|
||||||
g_slist_free_full (stages, g_object_unref);
|
g_slist_foreach (stages, (GFunc) g_object_unref, NULL);
|
||||||
|
g_slist_free (stages);
|
||||||
|
|
||||||
|
master_clock->prev_tick = master_clock->cur_tick;
|
||||||
|
|
||||||
_clutter_threads_release_lock ();
|
_clutter_threads_release_lock ();
|
||||||
|
|
||||||
@@ -523,6 +609,7 @@ clutter_master_clock_default_init (ClutterMasterClockDefault *self)
|
|||||||
source = clutter_clock_source_new (self);
|
source = clutter_clock_source_new (self);
|
||||||
self->source = source;
|
self->source = source;
|
||||||
|
|
||||||
|
self->idle = FALSE;
|
||||||
self->ensure_next_iteration = FALSE;
|
self->ensure_next_iteration = FALSE;
|
||||||
self->paused = FALSE;
|
self->paused = FALSE;
|
||||||
|
|
||||||
@@ -602,7 +689,7 @@ clutter_master_clock_default_set_paused (ClutterMasterClock *clock,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_master_clock_iface_init (ClutterMasterClockInterface *iface)
|
clutter_master_clock_iface_init (ClutterMasterClockIface *iface)
|
||||||
{
|
{
|
||||||
iface->add_timeline = clutter_master_clock_default_add_timeline;
|
iface->add_timeline = clutter_master_clock_default_add_timeline;
|
||||||
iface->remove_timeline = clutter_master_clock_default_remove_timeline;
|
iface->remove_timeline = clutter_master_clock_default_remove_timeline;
|
||||||
|
@@ -37,6 +37,10 @@
|
|||||||
#include "clutter-master-clock-default.h"
|
#include "clutter-master-clock-default.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
|
|
||||||
|
#define clutter_master_clock_get_type _clutter_master_clock_get_type
|
||||||
|
|
||||||
|
typedef ClutterMasterClockIface ClutterMasterClockInterface;
|
||||||
|
|
||||||
G_DEFINE_INTERFACE (ClutterMasterClock, clutter_master_clock, G_TYPE_OBJECT)
|
G_DEFINE_INTERFACE (ClutterMasterClock, clutter_master_clock, G_TYPE_OBJECT)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -28,12 +28,15 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define CLUTTER_TYPE_MASTER_CLOCK (clutter_master_clock_get_type ())
|
#define CLUTTER_TYPE_MASTER_CLOCK (_clutter_master_clock_get_type ())
|
||||||
G_DECLARE_INTERFACE (ClutterMasterClock, clutter_master_clock,
|
#define CLUTTER_MASTER_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_MASTER_CLOCK, ClutterMasterClock))
|
||||||
CLUTTER, MASTER_CLOCK,
|
#define CLUTTER_IS_MASTER_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_MASTER_CLOCK))
|
||||||
GObject)
|
#define CLUTTER_MASTER_CLOCK_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_MASTER_CLOCK, ClutterMasterClockIface))
|
||||||
|
|
||||||
struct _ClutterMasterClockInterface
|
typedef struct _ClutterMasterClock ClutterMasterClock; /* dummy */
|
||||||
|
typedef struct _ClutterMasterClockIface ClutterMasterClockIface;
|
||||||
|
|
||||||
|
struct _ClutterMasterClockIface
|
||||||
{
|
{
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
GTypeInterface parent_iface;
|
GTypeInterface parent_iface;
|
||||||
@@ -48,6 +51,8 @@ struct _ClutterMasterClockInterface
|
|||||||
gboolean paused);
|
gboolean paused);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GType _clutter_master_clock_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
ClutterMasterClock * _clutter_master_clock_get_default (void);
|
ClutterMasterClock * _clutter_master_clock_get_default (void);
|
||||||
void _clutter_master_clock_add_timeline (ClutterMasterClock *master_clock,
|
void _clutter_master_clock_add_timeline (ClutterMasterClock *master_clock,
|
||||||
ClutterTimeline *timeline);
|
ClutterTimeline *timeline);
|
||||||
|
@@ -26,19 +26,17 @@
|
|||||||
#define __CLUTTER_H_INSIDE__
|
#define __CLUTTER_H_INSIDE__
|
||||||
|
|
||||||
#include "clutter-backend.h"
|
#include "clutter-backend.h"
|
||||||
#include "clutter-device-manager-private.h"
|
|
||||||
#include "clutter-event-private.h"
|
|
||||||
#include "clutter-input-pointer-a11y-private.h"
|
|
||||||
#include "clutter-macros.h"
|
#include "clutter-macros.h"
|
||||||
#include "clutter-private.h"
|
|
||||||
#include "clutter-stage-private.h"
|
|
||||||
#include "clutter-stage-view.h"
|
#include "clutter-stage-view.h"
|
||||||
#include "cogl/clutter-stage-cogl.h"
|
#include "cogl/clutter-stage-cogl.h"
|
||||||
#include "clutter/x11/clutter-backend-x11.h"
|
#include "x11/clutter-stage-x11.h"
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_set_custom_backend_func (ClutterBackend *(* func) (void));
|
void clutter_set_custom_backend_func (ClutterBackend *(* func) (void));
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
gboolean _clutter_get_sync_to_vblank (void);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
int64_t clutter_stage_get_frame_counter (ClutterStage *stage);
|
int64_t clutter_stage_get_frame_counter (ClutterStage *stage);
|
||||||
|
|
||||||
@@ -54,12 +52,6 @@ void clutter_stage_freeze_updates (ClutterStage *stage);
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_stage_thaw_updates (ClutterStage *stage);
|
void clutter_stage_thaw_updates (ClutterStage *stage);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void clutter_stage_update_resource_scales (ClutterStage *stage);
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean clutter_actor_has_damage (ClutterActor *actor);
|
|
||||||
|
|
||||||
#undef __CLUTTER_H_INSIDE__
|
#undef __CLUTTER_H_INSIDE__
|
||||||
|
|
||||||
#endif /* __CLUTTER_MUTTER_H__ */
|
#endif /* __CLUTTER_MUTTER_H__ */
|
||||||
|
@@ -66,16 +66,12 @@
|
|||||||
|
|
||||||
#include "clutter-offscreen-effect.h"
|
#include "clutter-offscreen-effect.h"
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#include "cogl/cogl.h"
|
#include "cogl/cogl.h"
|
||||||
|
|
||||||
#include "clutter-actor-private.h"
|
#include "clutter-actor-private.h"
|
||||||
#include "clutter-debug.h"
|
#include "clutter-debug.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
#include "clutter-stage-private.h"
|
#include "clutter-stage-private.h"
|
||||||
#include "clutter-paint-volume-private.h"
|
|
||||||
#include "clutter-actor-box-private.h"
|
|
||||||
|
|
||||||
struct _ClutterOffscreenEffectPrivate
|
struct _ClutterOffscreenEffectPrivate
|
||||||
{
|
{
|
||||||
@@ -86,19 +82,27 @@ struct _ClutterOffscreenEffectPrivate
|
|||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
ClutterActor *stage;
|
ClutterActor *stage;
|
||||||
|
|
||||||
ClutterVertex position;
|
gfloat x_offset;
|
||||||
|
gfloat y_offset;
|
||||||
int fbo_offset_x;
|
|
||||||
int fbo_offset_y;
|
|
||||||
|
|
||||||
/* This is the calculated size of the fbo before being passed
|
/* This is the calculated size of the fbo before being passed
|
||||||
through create_texture(). This needs to be tracked separately so
|
through create_texture(). This needs to be tracked separately so
|
||||||
that we can detect when a different size is calculated and
|
that we can detect when a different size is calculated and
|
||||||
regenerate the fbo */
|
regenerate the fbo */
|
||||||
int target_width;
|
int fbo_width;
|
||||||
int target_height;
|
int fbo_height;
|
||||||
|
|
||||||
gint old_opacity_override;
|
gint old_opacity_override;
|
||||||
|
|
||||||
|
/* The matrix that was current the last time the fbo was updated. We
|
||||||
|
need to keep track of this to detect when we can reuse the
|
||||||
|
contents of the fbo without redrawing the actor. We need the
|
||||||
|
actual matrix rather than just detecting queued redraws on the
|
||||||
|
actor because any change in the parent hierarchy (even just a
|
||||||
|
translation) could cause the actor to look completely different
|
||||||
|
and it won't cause a redraw to be queued on the parent's
|
||||||
|
children. */
|
||||||
|
CoglMatrix last_matrix_drawn;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterOffscreenEffect,
|
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterOffscreenEffect,
|
||||||
@@ -137,35 +141,8 @@ clutter_offscreen_effect_real_create_texture (ClutterOffscreenEffect *effect,
|
|||||||
COGL_PIXEL_FORMAT_RGBA_8888_PRE);
|
COGL_PIXEL_FORMAT_RGBA_8888_PRE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
ensure_pipeline_filter_for_scale (ClutterOffscreenEffect *self,
|
|
||||||
float resource_scale)
|
|
||||||
{
|
|
||||||
CoglPipelineFilter filter;
|
|
||||||
|
|
||||||
if (!self->priv->target)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* If no fractional scaling is set, we're always going to render the texture
|
|
||||||
at a 1:1 texel:pixel ratio so, in such case we can use 'nearest' filtering
|
|
||||||
to decrease the effects of rounding errors in the geometry calculation;
|
|
||||||
if instead we we're using a global fractional scaling we need to make sure
|
|
||||||
that we're using the default linear effect, not to create artifacts when
|
|
||||||
scaling down the texture */
|
|
||||||
if (fmodf (resource_scale, 1.0f) == 0)
|
|
||||||
filter = COGL_PIPELINE_FILTER_NEAREST;
|
|
||||||
else
|
|
||||||
filter = COGL_PIPELINE_FILTER_LINEAR;
|
|
||||||
|
|
||||||
cogl_pipeline_set_layer_filters (self->priv->target, 0 /* layer_index */,
|
|
||||||
filter, filter);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
update_fbo (ClutterEffect *effect,
|
update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height)
|
||||||
int target_width,
|
|
||||||
int target_height,
|
|
||||||
float resource_scale)
|
|
||||||
{
|
{
|
||||||
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
|
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
|
||||||
ClutterOffscreenEffectPrivate *priv = self->priv;
|
ClutterOffscreenEffectPrivate *priv = self->priv;
|
||||||
@@ -180,13 +157,10 @@ update_fbo (ClutterEffect *effect,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->target_width == target_width &&
|
if (priv->fbo_width == fbo_width &&
|
||||||
priv->target_height == target_height &&
|
priv->fbo_height == fbo_height &&
|
||||||
priv->offscreen != NULL)
|
priv->offscreen != NULL)
|
||||||
{
|
|
||||||
ensure_pipeline_filter_for_scale (self, resource_scale);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->target == NULL)
|
if (priv->target == NULL)
|
||||||
{
|
{
|
||||||
@@ -194,7 +168,14 @@ update_fbo (ClutterEffect *effect,
|
|||||||
clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||||
|
|
||||||
priv->target = cogl_pipeline_new (ctx);
|
priv->target = cogl_pipeline_new (ctx);
|
||||||
ensure_pipeline_filter_for_scale (self, resource_scale);
|
|
||||||
|
/* We're always going to render the texture at a 1:1 texel:pixel
|
||||||
|
ratio so we can use 'nearest' filtering to decrease the
|
||||||
|
effects of rounding errors in the geometry calculation */
|
||||||
|
cogl_pipeline_set_layer_filters (priv->target,
|
||||||
|
0, /* layer_index */
|
||||||
|
COGL_PIPELINE_FILTER_NEAREST,
|
||||||
|
COGL_PIPELINE_FILTER_NEAREST);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->texture != NULL)
|
if (priv->texture != NULL)
|
||||||
@@ -210,14 +191,14 @@ update_fbo (ClutterEffect *effect,
|
|||||||
}
|
}
|
||||||
|
|
||||||
priv->texture =
|
priv->texture =
|
||||||
clutter_offscreen_effect_create_texture (self, target_width, target_height);
|
clutter_offscreen_effect_create_texture (self, fbo_width, fbo_height);
|
||||||
if (priv->texture == NULL)
|
if (priv->texture == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
cogl_pipeline_set_layer_texture (priv->target, 0, priv->texture);
|
cogl_pipeline_set_layer_texture (priv->target, 0, priv->texture);
|
||||||
|
|
||||||
priv->target_width = target_width;
|
priv->fbo_width = fbo_width;
|
||||||
priv->target_height = target_height;
|
priv->fbo_height = fbo_height;
|
||||||
|
|
||||||
priv->offscreen = cogl_offscreen_new_to_texture (priv->texture);
|
priv->offscreen = cogl_offscreen_new_to_texture (priv->texture);
|
||||||
if (priv->offscreen == NULL)
|
if (priv->offscreen == NULL)
|
||||||
@@ -227,8 +208,8 @@ update_fbo (ClutterEffect *effect,
|
|||||||
cogl_handle_unref (priv->target);
|
cogl_handle_unref (priv->target);
|
||||||
priv->target = NULL;
|
priv->target = NULL;
|
||||||
|
|
||||||
priv->target_width = 0;
|
priv->fbo_width = 0;
|
||||||
priv->target_height = 0;
|
priv->fbo_height = 0;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -241,17 +222,15 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
|||||||
{
|
{
|
||||||
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
|
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
|
||||||
ClutterOffscreenEffectPrivate *priv = self->priv;
|
ClutterOffscreenEffectPrivate *priv = self->priv;
|
||||||
ClutterActorBox raw_box, box;
|
ClutterActorBox box;
|
||||||
ClutterActor *stage;
|
ClutterActor *stage;
|
||||||
CoglMatrix projection, old_modelview, modelview;
|
CoglMatrix projection;
|
||||||
const ClutterPaintVolume *volume;
|
|
||||||
CoglColor transparent;
|
CoglColor transparent;
|
||||||
gfloat stage_width, stage_height;
|
gfloat stage_width, stage_height;
|
||||||
gfloat target_width = -1, target_height = -1;
|
gfloat fbo_width = -1, fbo_height = -1;
|
||||||
gfloat resource_scale;
|
gfloat width, height;
|
||||||
gfloat ceiled_resource_scale;
|
gfloat xexpand, yexpand;
|
||||||
ClutterVertex local_offset = { 0.f, 0.f, 0.f };
|
int texture_width, texture_height;
|
||||||
gfloat old_viewport[4];
|
|
||||||
|
|
||||||
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))
|
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -262,98 +241,92 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
|||||||
stage = _clutter_actor_get_stage_internal (priv->actor);
|
stage = _clutter_actor_get_stage_internal (priv->actor);
|
||||||
clutter_actor_get_size (stage, &stage_width, &stage_height);
|
clutter_actor_get_size (stage, &stage_width, &stage_height);
|
||||||
|
|
||||||
if (_clutter_actor_get_real_resource_scale (priv->actor, &resource_scale))
|
/* 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))
|
||||||
{
|
{
|
||||||
ceiled_resource_scale = ceilf (resource_scale);
|
clutter_actor_box_get_size (&box, &fbo_width, &fbo_height);
|
||||||
stage_width *= ceiled_resource_scale;
|
clutter_actor_box_get_origin (&box, &priv->x_offset, &priv->y_offset);
|
||||||
stage_height *= ceiled_resource_scale;
|
|
||||||
|
fbo_width = MIN (fbo_width, stage_width);
|
||||||
|
fbo_height = MIN (fbo_height, stage_height);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* We are sure we have a resource scale set to a good value at paint */
|
fbo_width = stage_width;
|
||||||
g_assert_not_reached ();
|
fbo_height = stage_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the minimal bounding box for what we want to paint, relative to the
|
if (fbo_width == stage_width)
|
||||||
* parent of priv->actor. Note that we may actually be painting a clone of
|
priv->x_offset = 0.0f;
|
||||||
* priv->actor so we need to be careful to avoid querying the transformation
|
if (fbo_height == stage_height)
|
||||||
* of priv->actor (like clutter_actor_get_paint_box would). Just stay in
|
priv->y_offset = 0.0f;
|
||||||
* local coordinates for now...
|
|
||||||
*/
|
|
||||||
volume = clutter_actor_get_paint_volume (priv->actor);
|
|
||||||
if (volume)
|
|
||||||
{
|
|
||||||
ClutterPaintVolume mutable_volume;
|
|
||||||
|
|
||||||
_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
|
|
||||||
{
|
|
||||||
clutter_actor_get_allocation_box (priv->actor, &raw_box);
|
|
||||||
}
|
|
||||||
|
|
||||||
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_scale (&box, ceiled_resource_scale);
|
|
||||||
clutter_actor_box_get_size (&box, &target_width, &target_height);
|
|
||||||
|
|
||||||
target_width = ceilf (target_width);
|
|
||||||
target_height = ceilf (target_height);
|
|
||||||
|
|
||||||
/* First assert that the framebuffer is the right size... */
|
/* First assert that the framebuffer is the right size... */
|
||||||
if (!update_fbo (effect, target_width, target_height, resource_scale))
|
if (!update_fbo (effect, fbo_width, fbo_height))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
cogl_get_modelview_matrix (&old_modelview);
|
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);
|
||||||
|
|
||||||
/* let's draw offscreen */
|
/* let's draw offscreen */
|
||||||
cogl_push_framebuffer (priv->offscreen);
|
cogl_push_framebuffer (priv->offscreen);
|
||||||
|
|
||||||
/* We don't want the FBO contents to be transformed. That could waste memory
|
/* Copy the modelview that would have been used if rendering onscreen */
|
||||||
* (e.g. during zoom), or result in something that's not rectangular (clipped
|
cogl_set_modelview_matrix (&priv->last_matrix_drawn);
|
||||||
* 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...
|
|
||||||
*/
|
|
||||||
clutter_actor_get_transform (priv->stage, &modelview);
|
|
||||||
cogl_set_modelview_matrix (&modelview);
|
|
||||||
|
|
||||||
/* Save the original viewport for calculating priv->position */
|
/* Set up the viewport so that it has the same size as the stage,
|
||||||
_clutter_stage_get_viewport (CLUTTER_STAGE (priv->stage),
|
* but offset it so that the actor of interest lands on our
|
||||||
&old_viewport[0],
|
* framebuffer. */
|
||||||
&old_viewport[1],
|
clutter_actor_get_size (priv->stage, &width, &height);
|
||||||
&old_viewport[2],
|
|
||||||
&old_viewport[3]);
|
|
||||||
|
|
||||||
/* Set up the viewport so that it has the same size as the stage (avoid
|
/* Expand the viewport if the actor is partially off-stage,
|
||||||
* distortion), but translated to account for the FBO offset...
|
* otherwise the actor will end up clipped to the stage viewport
|
||||||
*/
|
*/
|
||||||
cogl_set_viewport (-priv->fbo_offset_x,
|
xexpand = 0.f;
|
||||||
-priv->fbo_offset_y,
|
if (priv->x_offset < 0.f)
|
||||||
stage_width,
|
xexpand = -priv->x_offset;
|
||||||
stage_height);
|
if (priv->x_offset + texture_width > width)
|
||||||
|
xexpand = MAX (xexpand, (priv->x_offset + texture_width) - width);
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
/* Set the viewport */
|
||||||
|
cogl_set_viewport (-(priv->x_offset + xexpand), -(priv->y_offset + yexpand),
|
||||||
|
width + (2 * xexpand), height + (2 * yexpand));
|
||||||
|
|
||||||
/* Copy the stage's projection matrix across to the framebuffer */
|
/* Copy the stage's projection matrix across to the framebuffer */
|
||||||
_clutter_stage_get_projection_matrix (CLUTTER_STAGE (priv->stage),
|
_clutter_stage_get_projection_matrix (CLUTTER_STAGE (priv->stage),
|
||||||
&projection);
|
&projection);
|
||||||
|
|
||||||
/* Now save the global position of the effect (not just of the actor).
|
/* If we've expanded the viewport, make sure to scale the projection
|
||||||
* It doesn't appear anyone actually uses this yet, but get_target_rect is
|
* matrix accordingly (as it's been initialised to work with the
|
||||||
* documented as returning it. So we should...
|
* original viewport and not our expanded one).
|
||||||
*/
|
*/
|
||||||
_clutter_util_fully_transform_vertices (&old_modelview,
|
if (xexpand > 0.f || yexpand > 0.f)
|
||||||
&projection,
|
{
|
||||||
old_viewport,
|
gfloat new_width, new_height;
|
||||||
&local_offset,
|
|
||||||
&priv->position,
|
new_width = width + (2 * xexpand);
|
||||||
1);
|
new_height = height + (2 * yexpand);
|
||||||
|
|
||||||
|
cogl_matrix_scale (&projection,
|
||||||
|
width / new_width,
|
||||||
|
height / new_height,
|
||||||
|
1);
|
||||||
|
}
|
||||||
|
|
||||||
cogl_set_projection_matrix (&projection);
|
cogl_set_projection_matrix (&projection);
|
||||||
|
|
||||||
@@ -379,7 +352,6 @@ static void
|
|||||||
clutter_offscreen_effect_real_paint_target (ClutterOffscreenEffect *effect)
|
clutter_offscreen_effect_real_paint_target (ClutterOffscreenEffect *effect)
|
||||||
{
|
{
|
||||||
ClutterOffscreenEffectPrivate *priv = effect->priv;
|
ClutterOffscreenEffectPrivate *priv = effect->priv;
|
||||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
|
||||||
guint8 paint_opacity;
|
guint8 paint_opacity;
|
||||||
|
|
||||||
paint_opacity = clutter_actor_get_paint_opacity (priv->actor);
|
paint_opacity = clutter_actor_get_paint_opacity (priv->actor);
|
||||||
@@ -389,19 +361,18 @@ clutter_offscreen_effect_real_paint_target (ClutterOffscreenEffect *effect)
|
|||||||
paint_opacity,
|
paint_opacity,
|
||||||
paint_opacity,
|
paint_opacity,
|
||||||
paint_opacity);
|
paint_opacity);
|
||||||
|
cogl_set_source (priv->target);
|
||||||
|
|
||||||
/* At this point we are in stage coordinates translated so if
|
/* At this point we are in stage coordinates translated so if
|
||||||
* we draw our texture using a textured quad the size of the paint
|
* 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
|
* box then we will overlay where the actor would have drawn if it
|
||||||
* hadn't been redirected offscreen.
|
* hadn't been redirected offscreen.
|
||||||
*/
|
*/
|
||||||
cogl_framebuffer_draw_textured_rectangle (framebuffer,
|
cogl_rectangle_with_texture_coords (0, 0,
|
||||||
priv->target,
|
cogl_texture_get_width (priv->texture),
|
||||||
0, 0,
|
cogl_texture_get_height (priv->texture),
|
||||||
cogl_texture_get_width (priv->texture),
|
0.0, 0.0,
|
||||||
cogl_texture_get_height (priv->texture),
|
1.0, 1.0);
|
||||||
0.0, 0.0,
|
|
||||||
1.0, 1.0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -409,26 +380,16 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect)
|
|||||||
{
|
{
|
||||||
ClutterOffscreenEffectPrivate *priv = effect->priv;
|
ClutterOffscreenEffectPrivate *priv = effect->priv;
|
||||||
CoglMatrix modelview;
|
CoglMatrix modelview;
|
||||||
float resource_scale;
|
|
||||||
|
|
||||||
cogl_push_matrix ();
|
cogl_push_matrix ();
|
||||||
|
|
||||||
/* The current modelview matrix is *almost* perfect already. It's only
|
/* Now reset the modelview to put us in stage coordinates so
|
||||||
* missing a correction for the expanded FBO and offset rendering within...
|
* we can drawn the result of our offscreen render as a textured
|
||||||
*/
|
* quad... */
|
||||||
cogl_get_modelview_matrix (&modelview);
|
|
||||||
|
|
||||||
if (clutter_actor_get_resource_scale (priv->actor, &resource_scale) &&
|
cogl_matrix_init_identity (&modelview);
|
||||||
resource_scale != 1.0f)
|
_clutter_actor_apply_modelview_transform (priv->stage, &modelview);
|
||||||
{
|
cogl_matrix_translate (&modelview, priv->x_offset, priv->y_offset, 0.0f);
|
||||||
float paint_scale = 1.0f / resource_scale;
|
|
||||||
cogl_matrix_scale (&modelview, paint_scale, paint_scale, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
cogl_matrix_translate (&modelview,
|
|
||||||
priv->fbo_offset_x,
|
|
||||||
priv->fbo_offset_y,
|
|
||||||
0.0f);
|
|
||||||
cogl_set_modelview_matrix (&modelview);
|
cogl_set_modelview_matrix (&modelview);
|
||||||
|
|
||||||
/* paint the target material; this is virtualized for
|
/* paint the target material; this is virtualized for
|
||||||
@@ -465,11 +426,16 @@ clutter_offscreen_effect_paint (ClutterEffect *effect,
|
|||||||
{
|
{
|
||||||
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
|
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
|
||||||
ClutterOffscreenEffectPrivate *priv = self->priv;
|
ClutterOffscreenEffectPrivate *priv = self->priv;
|
||||||
|
CoglMatrix matrix;
|
||||||
|
|
||||||
/* If we've already got a cached image and the actor hasn't been redrawn
|
cogl_get_modelview_matrix (&matrix);
|
||||||
* then we can just use the cached image in the FBO.
|
|
||||||
*/
|
/* If we've already got a cached image for the same matrix and the
|
||||||
if (priv->offscreen == NULL || (flags & CLUTTER_EFFECT_PAINT_ACTOR_DIRTY))
|
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))
|
||||||
{
|
{
|
||||||
/* Chain up to the parent paint method which will call the pre and
|
/* Chain up to the parent paint method which will call the pre and
|
||||||
post paint functions to update the image */
|
post paint functions to update the image */
|
||||||
@@ -695,8 +661,8 @@ clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
clutter_rect_init (rect,
|
clutter_rect_init (rect,
|
||||||
priv->position.x,
|
priv->x_offset,
|
||||||
priv->position.y,
|
priv->y_offset,
|
||||||
cogl_texture_get_width (priv->texture),
|
cogl_texture_get_width (priv->texture),
|
||||||
cogl_texture_get_height (priv->texture));
|
cogl_texture_get_height (priv->texture));
|
||||||
|
|
||||||
|
@@ -74,11 +74,9 @@ struct _ClutterPaintNodeClass
|
|||||||
|
|
||||||
#define PAINT_OP_INIT { PAINT_OP_INVALID }
|
#define PAINT_OP_INIT { PAINT_OP_INVALID }
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
PAINT_OP_INVALID = 0,
|
PAINT_OP_INVALID = 0,
|
||||||
PAINT_OP_TEX_RECT,
|
PAINT_OP_TEX_RECT,
|
||||||
PAINT_OP_MULTITEX_RECT,
|
|
||||||
PAINT_OP_PATH,
|
PAINT_OP_PATH,
|
||||||
PAINT_OP_PRIMITIVE
|
PAINT_OP_PRIMITIVE
|
||||||
} PaintOpCode;
|
} PaintOpCode;
|
||||||
@@ -87,8 +85,6 @@ struct _ClutterPaintOperation
|
|||||||
{
|
{
|
||||||
PaintOpCode opcode;
|
PaintOpCode opcode;
|
||||||
|
|
||||||
GArray *multitex_coords;
|
|
||||||
|
|
||||||
union {
|
union {
|
||||||
float texrect[8];
|
float texrect[8];
|
||||||
|
|
||||||
@@ -98,6 +94,7 @@ struct _ClutterPaintOperation
|
|||||||
} op;
|
} op;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GType _clutter_root_node_get_type (void) G_GNUC_CONST;
|
||||||
GType _clutter_transform_node_get_type (void) G_GNUC_CONST;
|
GType _clutter_transform_node_get_type (void) G_GNUC_CONST;
|
||||||
GType _clutter_dummy_node_get_type (void) G_GNUC_CONST;
|
GType _clutter_dummy_node_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
@@ -110,9 +107,13 @@ void _clutter_paint_operation_paint_primitive (const C
|
|||||||
void _clutter_paint_node_init_types (void);
|
void _clutter_paint_node_init_types (void);
|
||||||
gpointer _clutter_paint_node_create (GType gtype);
|
gpointer _clutter_paint_node_create (GType gtype);
|
||||||
|
|
||||||
|
ClutterPaintNode * _clutter_root_node_new (CoglFramebuffer *framebuffer,
|
||||||
|
const ClutterColor *clear_color,
|
||||||
|
CoglBufferBit clear_flags);
|
||||||
ClutterPaintNode * _clutter_transform_node_new (const CoglMatrix *matrix);
|
ClutterPaintNode * _clutter_transform_node_new (const CoglMatrix *matrix);
|
||||||
ClutterPaintNode * _clutter_dummy_node_new (ClutterActor *actor);
|
ClutterPaintNode * _clutter_dummy_node_new (ClutterActor *actor);
|
||||||
|
|
||||||
|
void _clutter_paint_node_paint (ClutterPaintNode *root);
|
||||||
void _clutter_paint_node_dump_tree (ClutterPaintNode *root);
|
void _clutter_paint_node_dump_tree (ClutterPaintNode *root);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
@@ -138,6 +139,8 @@ G_GNUC_INTERNAL
|
|||||||
ClutterPaintNode * clutter_paint_node_get_last_child (ClutterPaintNode *node);
|
ClutterPaintNode * clutter_paint_node_get_last_child (ClutterPaintNode *node);
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
ClutterPaintNode * clutter_paint_node_get_parent (ClutterPaintNode *node);
|
ClutterPaintNode * clutter_paint_node_get_parent (ClutterPaintNode *node);
|
||||||
|
G_GNUC_INTERNAL
|
||||||
|
CoglFramebuffer * clutter_paint_node_get_framebuffer (ClutterPaintNode *node);
|
||||||
|
|
||||||
#define CLUTTER_TYPE_LAYER_NODE (_clutter_layer_node_get_type ())
|
#define CLUTTER_TYPE_LAYER_NODE (_clutter_layer_node_get_type ())
|
||||||
#define CLUTTER_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_LAYER_NODE, ClutterLayerNode))
|
#define CLUTTER_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_LAYER_NODE, ClutterLayerNode))
|
||||||
|
@@ -761,11 +761,6 @@ clutter_paint_operation_clear (ClutterPaintOperation *op)
|
|||||||
case PAINT_OP_TEX_RECT:
|
case PAINT_OP_TEX_RECT:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PAINT_OP_MULTITEX_RECT:
|
|
||||||
if (op->multitex_coords != NULL)
|
|
||||||
g_array_unref (op->multitex_coords);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PAINT_OP_PATH:
|
case PAINT_OP_PATH:
|
||||||
if (op->op.path != NULL)
|
if (op->op.path != NULL)
|
||||||
cogl_object_unref (op->op.path);
|
cogl_object_unref (op->op.path);
|
||||||
@@ -799,27 +794,6 @@ clutter_paint_op_init_tex_rect (ClutterPaintOperation *op,
|
|||||||
op->op.texrect[7] = y_2;
|
op->op.texrect[7] = y_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
|
||||||
clutter_paint_op_init_multitex_rect (ClutterPaintOperation *op,
|
|
||||||
const ClutterActorBox *rect,
|
|
||||||
const float *tex_coords,
|
|
||||||
unsigned int tex_coords_len)
|
|
||||||
{
|
|
||||||
clutter_paint_operation_clear (op);
|
|
||||||
|
|
||||||
op->opcode = PAINT_OP_MULTITEX_RECT;
|
|
||||||
op->multitex_coords = g_array_sized_new (FALSE, FALSE,
|
|
||||||
sizeof (float),
|
|
||||||
tex_coords_len);
|
|
||||||
|
|
||||||
g_array_append_vals (op->multitex_coords, tex_coords, tex_coords_len);
|
|
||||||
|
|
||||||
op->op.texrect[0] = rect->x1;
|
|
||||||
op->op.texrect[1] = rect->y1;
|
|
||||||
op->op.texrect[2] = rect->x2;
|
|
||||||
op->op.texrect[3] = rect->y2;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
clutter_paint_op_init_path (ClutterPaintOperation *op,
|
clutter_paint_op_init_path (ClutterPaintOperation *op,
|
||||||
CoglPath *path)
|
CoglPath *path)
|
||||||
@@ -907,33 +881,6 @@ clutter_paint_node_add_texture_rectangle (ClutterPaintNode *node,
|
|||||||
g_array_append_val (node->operations, operation);
|
g_array_append_val (node->operations, operation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_paint_node_add_multitexture_rectangle:
|
|
||||||
* @node: a #ClutterPaintNode
|
|
||||||
* @rect: a #ClutterActorBox
|
|
||||||
* @text_coords: array of multitexture values
|
|
||||||
* @text_coords_len: number of items of @text_coords
|
|
||||||
*
|
|
||||||
* Adds a rectangle region to the @node, with multitexture coordinates.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_paint_node_add_multitexture_rectangle (ClutterPaintNode *node,
|
|
||||||
const ClutterActorBox *rect,
|
|
||||||
const float *text_coords,
|
|
||||||
unsigned int text_coords_len)
|
|
||||||
{
|
|
||||||
ClutterPaintOperation operation = PAINT_OP_INIT;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_PAINT_NODE (node));
|
|
||||||
g_return_if_fail (rect != NULL);
|
|
||||||
|
|
||||||
clutter_paint_node_maybe_init_operations (node);
|
|
||||||
|
|
||||||
clutter_paint_op_init_multitex_rect (&operation, rect, text_coords, text_coords_len);
|
|
||||||
g_array_append_val (node->operations, operation);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_paint_node_add_path: (skip)
|
* clutter_paint_node_add_path: (skip)
|
||||||
* @node: a #ClutterPaintNode
|
* @node: a #ClutterPaintNode
|
||||||
@@ -989,15 +936,15 @@ clutter_paint_node_add_primitive (ClutterPaintNode *node,
|
|||||||
g_array_append_val (node->operations, operation);
|
g_array_append_val (node->operations, operation);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*< private >
|
||||||
* clutter_paint_node_paint:
|
* _clutter_paint_node_paint:
|
||||||
* @node: a #ClutterPaintNode
|
* @node: a #ClutterPaintNode
|
||||||
*
|
*
|
||||||
* Paints the @node using the class implementation, traversing
|
* Paints the @node using the class implementation, traversing
|
||||||
* its children, if any.
|
* its children, if any.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_paint_node_paint (ClutterPaintNode *node)
|
_clutter_paint_node_paint (ClutterPaintNode *node)
|
||||||
{
|
{
|
||||||
ClutterPaintNodeClass *klass = CLUTTER_PAINT_NODE_GET_CLASS (node);
|
ClutterPaintNodeClass *klass = CLUTTER_PAINT_NODE_GET_CLASS (node);
|
||||||
ClutterPaintNode *iter;
|
ClutterPaintNode *iter;
|
||||||
@@ -1014,7 +961,7 @@ clutter_paint_node_paint (ClutterPaintNode *node)
|
|||||||
iter != NULL;
|
iter != NULL;
|
||||||
iter = iter->next_sibling)
|
iter = iter->next_sibling)
|
||||||
{
|
{
|
||||||
clutter_paint_node_paint (iter);
|
_clutter_paint_node_paint (iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res)
|
if (res)
|
||||||
@@ -1059,7 +1006,7 @@ clutter_paint_node_to_json (ClutterPaintNode *node)
|
|||||||
|
|
||||||
if (node->operations != NULL)
|
if (node->operations != NULL)
|
||||||
{
|
{
|
||||||
guint i, j;
|
guint i;
|
||||||
|
|
||||||
for (i = 0; i < node->operations->len; i++)
|
for (i = 0; i < node->operations->len; i++)
|
||||||
{
|
{
|
||||||
@@ -1084,27 +1031,14 @@ clutter_paint_node_to_json (ClutterPaintNode *node)
|
|||||||
json_builder_end_array (builder);
|
json_builder_end_array (builder);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PAINT_OP_MULTITEX_RECT:
|
|
||||||
json_builder_set_member_name (builder, "texrect");
|
|
||||||
json_builder_begin_array (builder);
|
|
||||||
|
|
||||||
for (j = 0; i < op->multitex_coords->len; j++)
|
|
||||||
{
|
|
||||||
float coord = g_array_index (op->multitex_coords, float, j);
|
|
||||||
json_builder_add_double_value (builder, coord);
|
|
||||||
}
|
|
||||||
|
|
||||||
json_builder_end_array (builder);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PAINT_OP_PATH:
|
case PAINT_OP_PATH:
|
||||||
json_builder_set_member_name (builder, "path");
|
json_builder_set_member_name (builder, "path");
|
||||||
json_builder_add_int_value (builder, (intptr_t) op->op.path);
|
json_builder_add_int_value (builder, (gint64) op->op.path);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PAINT_OP_PRIMITIVE:
|
case PAINT_OP_PRIMITIVE:
|
||||||
json_builder_set_member_name (builder, "primitive");
|
json_builder_set_member_name (builder, "primitive");
|
||||||
json_builder_add_int_value (builder, (intptr_t) op->op.primitive);
|
json_builder_add_int_value (builder, (gint64) op->op.primitive);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PAINT_OP_INVALID:
|
case PAINT_OP_INVALID:
|
||||||
@@ -1194,15 +1128,6 @@ clutter_paint_node_get_root (ClutterPaintNode *node)
|
|||||||
return iter;
|
return iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_paint_node_get_framebuffer:
|
|
||||||
* @node: a #ClutterPaintNode
|
|
||||||
*
|
|
||||||
* Retrieves the #CoglFramebuffer that @node will draw
|
|
||||||
* into.
|
|
||||||
*
|
|
||||||
* Returns: (transfer none): a #CoglFramebuffer
|
|
||||||
*/
|
|
||||||
CoglFramebuffer *
|
CoglFramebuffer *
|
||||||
clutter_paint_node_get_framebuffer (ClutterPaintNode *node)
|
clutter_paint_node_get_framebuffer (ClutterPaintNode *node)
|
||||||
{
|
{
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user