Compare commits
12 Commits
wip/fmuell
...
wip/3-moni
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f4f9b122e | ||
|
|
82f03c51ac | ||
|
|
8f538671d6 | ||
|
|
0540e4dc45 | ||
|
|
5d8248d65b | ||
|
|
b61c2f2120 | ||
|
|
3dacd0f6f5 | ||
|
|
336cb36d3c | ||
|
|
bb33dad473 | ||
|
|
88a7b6e1da | ||
|
|
008a12a637 | ||
|
|
c8112a1dbc |
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,44 +1,20 @@
|
|||||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v1
|
image: registry.gitlab.gnome.org/gnome/mutter/master:v1
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- review
|
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
|
|
||||||
check-commit-log:
|
|
||||||
stage: review
|
|
||||||
script:
|
|
||||||
- ./.gitlab-ci/check-commit-log.sh
|
|
||||||
only:
|
|
||||||
- merge_requests
|
|
||||||
|
|
||||||
build-mutter:
|
build-mutter:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- meson . build -Dbuildtype=debugoptimized -Degl_device=true -Dwayland_eglstream=true --werror
|
- 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
|
|
||||||
- /^.*$/
|
|
||||||
|
|
||||||
test-mutter:
|
test-mutter:
|
||||||
stage: test
|
stage: test
|
||||||
dependencies:
|
|
||||||
- build-mutter
|
|
||||||
variables:
|
|
||||||
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
|
|
||||||
GSETTINGS_SCHEMA_DIR: "$CI_PROJECT_DIR/build/data"
|
|
||||||
script:
|
script:
|
||||||
- mkdir -m 700 $XDG_RUNTIME_DIR
|
- meson . build -Degl_device=true -Dwayland_eglstream=true
|
||||||
- glib-compile-schemas $GSETTINGS_SCHEMA_DIR
|
- ninja -C build
|
||||||
- >
|
- glib-compile-schemas $PWD/build/data
|
||||||
dbus-run-session -- xvfb-run -s '+iglx -noreset'
|
- env XDG_RUNTIME_DIR=/tmp/ GSETTINGS_SCHEMA_DIR=$PWD/build/data dbus-run-session -- xvfb-run -s '+iglx -noreset' meson test -C build -t 10 --verbose --no-stdsplit --wrap catchsegv
|
||||||
meson test -C build --no-rebuild -t 10 --verbose --no-stdsplit --wrap catchsegv
|
|
||||||
only:
|
|
||||||
- merge_requests
|
|
||||||
- /^.*$/
|
|
||||||
|
|||||||
@@ -10,8 +10,5 @@ RUN dnf -y update && dnf -y upgrade && \
|
|||||||
# For running unit tests
|
# For running unit tests
|
||||||
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 && \
|
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 && \
|
||||||
|
|
||||||
# Unpackaged versions
|
|
||||||
dnf install -y https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00848426-gsettings-desktop-schemas/gsettings-desktop-schemas-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00848426-gsettings-desktop-schemas/gsettings-desktop-schemas-devel-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm && \
|
|
||||||
|
|
||||||
dnf install -y intltool redhat-rpm-config make && \
|
dnf install -y intltool redhat-rpm-config make && \
|
||||||
dnf clean all
|
dnf clean all
|
||||||
|
|||||||
@@ -1,31 +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 $?
|
|
||||||
}
|
|
||||||
|
|
||||||
for commit in $commits; do
|
|
||||||
if ! commit_message_has_url $commit; then
|
|
||||||
echo "Missing merge request or issue URL on commit $(echo $commit | cut -c -8)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
13
Makefile.am
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
|
||||||
110
NEWS
110
NEWS
@@ -1,113 +1,3 @@
|
|||||||
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
|
||||||
710
clutter/clutter/Makefile.am
Normal file
710
clutter/clutter/Makefile.am
Normal file
@@ -0,0 +1,710 @@
|
|||||||
|
AUTOMAKE_OPTIONS = subdir-objects
|
||||||
|
|
||||||
|
# preamble
|
||||||
|
NULL =
|
||||||
|
|
||||||
|
# common definitions
|
||||||
|
CLEANFILES =
|
||||||
|
DISTCLEANFILES =
|
||||||
|
EXTRA_DIST =
|
||||||
|
BUILT_SOURCES =
|
||||||
|
|
||||||
|
AM_CPPFLAGS = \
|
||||||
|
-DCLUTTER_SYSCONFDIR=\""$(sysconfdir)"\" \
|
||||||
|
-DCLUTTER_COMPILATION=1 \
|
||||||
|
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
|
||||||
|
-DG_LOG_DOMAIN=\"Clutter\" \
|
||||||
|
-fvisibility=hidden \
|
||||||
|
-I$(top_srcdir) \
|
||||||
|
-I$(top_srcdir)/clutter \
|
||||||
|
-I$(top_builddir) \
|
||||||
|
-I$(top_builddir)/clutter \
|
||||||
|
-I$(top_srcdir)/../cogl \
|
||||||
|
-I$(top_builddir)/../cogl \
|
||||||
|
-I$(top_builddir)/../cogl/cogl \
|
||||||
|
$(CLUTTER_DEPRECATED_CFLAGS) \
|
||||||
|
$(CLUTTER_DEBUG_CFLAGS) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
|
||||||
|
|
||||||
|
# these are the gir files we generate using g-ir-scanner
|
||||||
|
INTROSPECTION_GIRS =
|
||||||
|
|
||||||
|
# the base include path for headers
|
||||||
|
clutter_base_includedir = $(includedir)/mutter-$(LIBMUTTER_API_VERSION)/clutter
|
||||||
|
clutter_includedir = $(clutter_base_includedir)/clutter
|
||||||
|
clutter_deprecateddir = $(clutter_base_includedir)/clutter/deprecated
|
||||||
|
|
||||||
|
# pkg-config files
|
||||||
|
pc_files =
|
||||||
|
|
||||||
|
# common sources - please, keep these sorted alphabetically
|
||||||
|
source_h = \
|
||||||
|
clutter-action.h \
|
||||||
|
clutter-actor-meta.h \
|
||||||
|
clutter-actor.h \
|
||||||
|
clutter-align-constraint.h \
|
||||||
|
clutter-animatable.h \
|
||||||
|
clutter-backend.h \
|
||||||
|
clutter-bind-constraint.h \
|
||||||
|
clutter-binding-pool.h \
|
||||||
|
clutter-bin-layout.h \
|
||||||
|
clutter-blur-effect.h \
|
||||||
|
clutter-box-layout.h \
|
||||||
|
clutter-brightness-contrast-effect.h \
|
||||||
|
clutter-cairo.h \
|
||||||
|
clutter-canvas.h \
|
||||||
|
clutter-child-meta.h \
|
||||||
|
clutter-click-action.h \
|
||||||
|
clutter-clone.h \
|
||||||
|
clutter-color-static.h \
|
||||||
|
clutter-color.h \
|
||||||
|
clutter-colorize-effect.h \
|
||||||
|
clutter-constraint.h \
|
||||||
|
clutter-container.h \
|
||||||
|
clutter-content.h \
|
||||||
|
clutter-deform-effect.h \
|
||||||
|
clutter-deprecated.h \
|
||||||
|
clutter-desaturate-effect.h \
|
||||||
|
clutter-device-manager.h \
|
||||||
|
clutter-drag-action.h \
|
||||||
|
clutter-drop-action.h \
|
||||||
|
clutter-effect.h \
|
||||||
|
clutter-enums.h \
|
||||||
|
clutter-event.h \
|
||||||
|
clutter-feature.h \
|
||||||
|
clutter-fixed-layout.h \
|
||||||
|
clutter-flow-layout.h \
|
||||||
|
clutter-gesture-action.h \
|
||||||
|
clutter-grid-layout.h \
|
||||||
|
clutter-group.h \
|
||||||
|
clutter-image.h \
|
||||||
|
clutter-input-device.h \
|
||||||
|
clutter-input-device-tool.h \
|
||||||
|
clutter-input-focus.h \
|
||||||
|
clutter-input-method.h \
|
||||||
|
clutter-interval.h \
|
||||||
|
clutter-keyframe-transition.h \
|
||||||
|
clutter-keysyms.h \
|
||||||
|
clutter-layout-manager.h \
|
||||||
|
clutter-layout-meta.h \
|
||||||
|
clutter-macros.h \
|
||||||
|
clutter-main.h \
|
||||||
|
clutter-offscreen-effect.h \
|
||||||
|
clutter-page-turn-effect.h \
|
||||||
|
clutter-paint-nodes.h \
|
||||||
|
clutter-paint-node.h \
|
||||||
|
clutter-pan-action.h \
|
||||||
|
clutter-path-constraint.h \
|
||||||
|
clutter-path.h \
|
||||||
|
clutter-property-transition.h \
|
||||||
|
clutter-rotate-action.h \
|
||||||
|
clutter-script.h \
|
||||||
|
clutter-scriptable.h \
|
||||||
|
clutter-scroll-actor.h \
|
||||||
|
clutter-settings.h \
|
||||||
|
clutter-shader-effect.h \
|
||||||
|
clutter-shader-types.h \
|
||||||
|
clutter-swipe-action.h \
|
||||||
|
clutter-snap-constraint.h \
|
||||||
|
clutter-stage.h \
|
||||||
|
clutter-stage-manager.h \
|
||||||
|
clutter-tap-action.h \
|
||||||
|
clutter-test-utils.h \
|
||||||
|
clutter-texture.h \
|
||||||
|
clutter-text.h \
|
||||||
|
clutter-text-buffer.h \
|
||||||
|
clutter-timeline.h \
|
||||||
|
clutter-transition-group.h \
|
||||||
|
clutter-transition.h \
|
||||||
|
clutter-types.h \
|
||||||
|
clutter-units.h \
|
||||||
|
clutter-virtual-input-device.h \
|
||||||
|
clutter-zoom-action.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
source_c = \
|
||||||
|
clutter-action.c \
|
||||||
|
clutter-actor-box.c \
|
||||||
|
clutter-actor-meta.c \
|
||||||
|
clutter-actor.c \
|
||||||
|
clutter-align-constraint.c \
|
||||||
|
clutter-animatable.c \
|
||||||
|
clutter-backend.c \
|
||||||
|
clutter-base-types.c \
|
||||||
|
clutter-bezier.c \
|
||||||
|
clutter-bind-constraint.c \
|
||||||
|
clutter-binding-pool.c \
|
||||||
|
clutter-bin-layout.c \
|
||||||
|
clutter-blur-effect.c \
|
||||||
|
clutter-box-layout.c \
|
||||||
|
clutter-brightness-contrast-effect.c \
|
||||||
|
clutter-cairo.c \
|
||||||
|
clutter-canvas.c \
|
||||||
|
clutter-child-meta.c \
|
||||||
|
clutter-click-action.c \
|
||||||
|
clutter-clone.c \
|
||||||
|
clutter-color.c \
|
||||||
|
clutter-colorize-effect.c \
|
||||||
|
clutter-constraint.c \
|
||||||
|
clutter-container.c \
|
||||||
|
clutter-content.c \
|
||||||
|
clutter-deform-effect.c \
|
||||||
|
clutter-desaturate-effect.c \
|
||||||
|
clutter-device-manager.c \
|
||||||
|
clutter-drag-action.c \
|
||||||
|
clutter-drop-action.c \
|
||||||
|
clutter-effect.c \
|
||||||
|
clutter-event.c \
|
||||||
|
clutter-feature.c \
|
||||||
|
clutter-fixed-layout.c \
|
||||||
|
clutter-flatten-effect.c \
|
||||||
|
clutter-flow-layout.c \
|
||||||
|
clutter-gesture-action.c \
|
||||||
|
clutter-grid-layout.c \
|
||||||
|
clutter-image.c \
|
||||||
|
clutter-input-device.c \
|
||||||
|
clutter-input-device-tool.c \
|
||||||
|
clutter-input-focus.c \
|
||||||
|
clutter-input-method.c \
|
||||||
|
clutter-virtual-input-device.c \
|
||||||
|
clutter-interval.c \
|
||||||
|
clutter-keyframe-transition.c \
|
||||||
|
clutter-keysyms-table.c \
|
||||||
|
clutter-layout-manager.c \
|
||||||
|
clutter-layout-meta.c \
|
||||||
|
clutter-main.c \
|
||||||
|
clutter-master-clock.c \
|
||||||
|
clutter-master-clock-default.c \
|
||||||
|
clutter-offscreen-effect.c \
|
||||||
|
clutter-page-turn-effect.c \
|
||||||
|
clutter-paint-nodes.c \
|
||||||
|
clutter-paint-node.c \
|
||||||
|
clutter-pan-action.c \
|
||||||
|
clutter-path-constraint.c \
|
||||||
|
clutter-path.c \
|
||||||
|
clutter-property-transition.c \
|
||||||
|
clutter-rotate-action.c \
|
||||||
|
clutter-script.c \
|
||||||
|
clutter-script-parser.c \
|
||||||
|
clutter-scriptable.c \
|
||||||
|
clutter-scroll-actor.c \
|
||||||
|
clutter-settings.c \
|
||||||
|
clutter-shader-effect.c \
|
||||||
|
clutter-shader-types.c \
|
||||||
|
clutter-swipe-action.c \
|
||||||
|
clutter-snap-constraint.c \
|
||||||
|
clutter-stage.c \
|
||||||
|
clutter-stage-manager.c \
|
||||||
|
clutter-stage-window.c \
|
||||||
|
clutter-tap-action.c \
|
||||||
|
clutter-test-utils.c \
|
||||||
|
clutter-text.c \
|
||||||
|
clutter-text-buffer.c \
|
||||||
|
clutter-transition-group.c \
|
||||||
|
clutter-transition.c \
|
||||||
|
clutter-timeline.c \
|
||||||
|
clutter-units.c \
|
||||||
|
clutter-util.c \
|
||||||
|
clutter-paint-volume.c \
|
||||||
|
clutter-zoom-action.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
# private headers; these should not be distributed or introspected
|
||||||
|
source_h_priv = \
|
||||||
|
clutter-actor-meta-private.h \
|
||||||
|
clutter-actor-private.h \
|
||||||
|
clutter-backend-private.h \
|
||||||
|
clutter-bezier.h \
|
||||||
|
clutter-constraint-private.h \
|
||||||
|
clutter-content-private.h \
|
||||||
|
clutter-debug.h \
|
||||||
|
clutter-device-manager-private.h \
|
||||||
|
clutter-easing.h \
|
||||||
|
clutter-effect-private.h \
|
||||||
|
clutter-event-translator.h \
|
||||||
|
clutter-event-private.h \
|
||||||
|
clutter-flatten-effect.h \
|
||||||
|
clutter-gesture-action-private.h \
|
||||||
|
clutter-id-pool.h \
|
||||||
|
clutter-input-focus-private.h \
|
||||||
|
clutter-input-method-private.h \
|
||||||
|
clutter-master-clock.h \
|
||||||
|
clutter-master-clock-default.h \
|
||||||
|
clutter-offscreen-effect-private.h \
|
||||||
|
clutter-paint-node-private.h \
|
||||||
|
clutter-paint-volume-private.h \
|
||||||
|
clutter-private.h \
|
||||||
|
clutter-script-private.h \
|
||||||
|
clutter-settings-private.h \
|
||||||
|
clutter-stage-manager-private.h \
|
||||||
|
clutter-stage-private.h \
|
||||||
|
clutter-stage-view.h \
|
||||||
|
clutter-stage-window.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
# private source code; these should not be introspected
|
||||||
|
source_c_priv = \
|
||||||
|
clutter-easing.c \
|
||||||
|
clutter-event-translator.c \
|
||||||
|
clutter-id-pool.c \
|
||||||
|
clutter-stage-view.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
# deprecated installed headers
|
||||||
|
deprecated_h = \
|
||||||
|
deprecated/clutter-actor.h \
|
||||||
|
deprecated/clutter-alpha.h \
|
||||||
|
deprecated/clutter-animatable.h \
|
||||||
|
deprecated/clutter-animation.h \
|
||||||
|
deprecated/clutter-animator.h \
|
||||||
|
deprecated/clutter-backend.h \
|
||||||
|
deprecated/clutter-behaviour.h \
|
||||||
|
deprecated/clutter-behaviour-depth.h \
|
||||||
|
deprecated/clutter-behaviour-ellipse.h \
|
||||||
|
deprecated/clutter-behaviour-opacity.h \
|
||||||
|
deprecated/clutter-behaviour-path.h \
|
||||||
|
deprecated/clutter-behaviour-rotate.h \
|
||||||
|
deprecated/clutter-behaviour-scale.h \
|
||||||
|
deprecated/clutter-bin-layout.h \
|
||||||
|
deprecated/clutter-box.h \
|
||||||
|
deprecated/clutter-cairo-texture.h \
|
||||||
|
deprecated/clutter-container.h \
|
||||||
|
deprecated/clutter-frame-source.h \
|
||||||
|
deprecated/clutter-group.h \
|
||||||
|
deprecated/clutter-input-device.h \
|
||||||
|
deprecated/clutter-keysyms.h \
|
||||||
|
deprecated/clutter-list-model.h \
|
||||||
|
deprecated/clutter-main.h \
|
||||||
|
deprecated/clutter-media.h \
|
||||||
|
deprecated/clutter-model.h \
|
||||||
|
deprecated/clutter-rectangle.h \
|
||||||
|
deprecated/clutter-score.h \
|
||||||
|
deprecated/clutter-shader.h \
|
||||||
|
deprecated/clutter-stage-manager.h \
|
||||||
|
deprecated/clutter-stage.h \
|
||||||
|
deprecated/clutter-state.h \
|
||||||
|
deprecated/clutter-table-layout.h \
|
||||||
|
deprecated/clutter-texture.h \
|
||||||
|
deprecated/clutter-timeline.h \
|
||||||
|
deprecated/clutter-timeout-pool.h \
|
||||||
|
deprecated/clutter-util.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
# deprecated source code
|
||||||
|
deprecated_c = \
|
||||||
|
deprecated/clutter-actor-deprecated.c \
|
||||||
|
deprecated/clutter-alpha.c \
|
||||||
|
deprecated/clutter-animation.c \
|
||||||
|
deprecated/clutter-animator.c \
|
||||||
|
deprecated/clutter-behaviour.c \
|
||||||
|
deprecated/clutter-behaviour-depth.c \
|
||||||
|
deprecated/clutter-behaviour-ellipse.c \
|
||||||
|
deprecated/clutter-behaviour-opacity.c \
|
||||||
|
deprecated/clutter-behaviour-path.c \
|
||||||
|
deprecated/clutter-behaviour-rotate.c \
|
||||||
|
deprecated/clutter-behaviour-scale.c \
|
||||||
|
deprecated/clutter-box.c \
|
||||||
|
deprecated/clutter-cairo-texture.c \
|
||||||
|
deprecated/clutter-frame-source.c \
|
||||||
|
deprecated/clutter-group.c \
|
||||||
|
deprecated/clutter-input-device-deprecated.c \
|
||||||
|
deprecated/clutter-layout-manager-deprecated.c \
|
||||||
|
deprecated/clutter-list-model.c \
|
||||||
|
deprecated/clutter-media.c \
|
||||||
|
deprecated/clutter-model.c \
|
||||||
|
deprecated/clutter-rectangle.c \
|
||||||
|
deprecated/clutter-score.c \
|
||||||
|
deprecated/clutter-shader.c \
|
||||||
|
deprecated/clutter-state.c \
|
||||||
|
deprecated/clutter-table-layout.c \
|
||||||
|
deprecated/clutter-texture.c \
|
||||||
|
deprecated/clutter-timeout-pool.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
# deprecated private headers; these should not be installed
|
||||||
|
deprecated_h_priv = \
|
||||||
|
deprecated/clutter-model-private.h \
|
||||||
|
deprecated/clutter-timeout-interval.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
# deprecated private source code; these should not be introspected
|
||||||
|
deprecated_c_priv = \
|
||||||
|
deprecated/clutter-timeout-interval.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
# built sources
|
||||||
|
built_source_c = \
|
||||||
|
clutter-enum-types.c \
|
||||||
|
clutter-marshal.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
# built headers
|
||||||
|
built_source_h = \
|
||||||
|
clutter-enum-types.h \
|
||||||
|
clutter-marshal.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
# config header
|
||||||
|
DISTCLEANFILES += clutter-config.h
|
||||||
|
EXTRA_DIST += clutter-config.h.in
|
||||||
|
|
||||||
|
# key symbol update script
|
||||||
|
EXTRA_DIST += clutter-keysyms-update.pl
|
||||||
|
|
||||||
|
pc_files += mutter-clutter-$(LIBMUTTER_API_VERSION).pc
|
||||||
|
|
||||||
|
# in order to be compatible with Clutter < 1.10, when we shipped a single
|
||||||
|
# shared library whose name was determined by the single backend it
|
||||||
|
# supported, we need to install symbolic links so that existing applications
|
||||||
|
# using Clutter won't break in the Brave New World of multi-backend support
|
||||||
|
# in the same shared object.
|
||||||
|
compat_libs =
|
||||||
|
|
||||||
|
# backends source listings
|
||||||
|
#
|
||||||
|
# backend_source_c := source code
|
||||||
|
# backend_source_h := installed public headers
|
||||||
|
# backend_source_c_priv := source that should not be scanned by g-i
|
||||||
|
# backend_source_h_priv := private headers
|
||||||
|
# backend_source_built := built sources
|
||||||
|
#
|
||||||
|
backend_source_c =
|
||||||
|
backend_source_h =
|
||||||
|
backend_source_c_priv =
|
||||||
|
backend_source_h_priv =
|
||||||
|
backend_source_built =
|
||||||
|
|
||||||
|
# X11 backend rules
|
||||||
|
x11_source_c = \
|
||||||
|
x11/clutter-backend-x11.c \
|
||||||
|
x11/clutter-device-manager-core-x11.c \
|
||||||
|
x11/clutter-event-x11.c \
|
||||||
|
x11/clutter-input-device-core-x11.c \
|
||||||
|
x11/clutter-keymap-x11.c \
|
||||||
|
x11/clutter-stage-x11.c \
|
||||||
|
x11/clutter-x11-texture-pixmap.c \
|
||||||
|
x11/clutter-xkb-a11y-x11.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
x11_source_h = \
|
||||||
|
x11/clutter-x11.h \
|
||||||
|
x11/clutter-x11-texture-pixmap.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
x11_source_h_priv = \
|
||||||
|
x11/clutter-backend-x11.h \
|
||||||
|
x11/clutter-device-manager-core-x11.h \
|
||||||
|
x11/clutter-input-device-core-x11.h \
|
||||||
|
x11/clutter-keymap-x11.h \
|
||||||
|
x11/clutter-settings-x11.h \
|
||||||
|
x11/clutter-stage-x11.h \
|
||||||
|
x11/clutter-xkb-a11y-x11.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
x11_source_c_priv = \
|
||||||
|
x11/xsettings/xsettings-client.c \
|
||||||
|
x11/xsettings/xsettings-client.h \
|
||||||
|
x11/xsettings/xsettings-common.c \
|
||||||
|
x11/xsettings/xsettings-common.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
x11_source_c += \
|
||||||
|
x11/clutter-device-manager-xi2.c \
|
||||||
|
x11/clutter-input-device-xi2.c \
|
||||||
|
x11/clutter-input-device-tool-xi2.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
x11_source_h_priv += \
|
||||||
|
x11/clutter-device-manager-xi2.h \
|
||||||
|
x11/clutter-input-device-xi2.h \
|
||||||
|
x11/clutter-input-device-tool-xi2.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
x11_source_c += \
|
||||||
|
x11/clutter-virtual-input-device-x11.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
x11_source_h_priv += \
|
||||||
|
x11/clutter-virtual-input-device-x11.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
backend_source_h += $(x11_source_h)
|
||||||
|
backend_source_c += $(x11_source_c)
|
||||||
|
backend_source_h_priv += $(x11_source_h_priv)
|
||||||
|
backend_source_c_priv += $(x11_source_c_priv)
|
||||||
|
|
||||||
|
# the list of files we want to introspect on X11
|
||||||
|
x11_introspection = $(x11_source_c) $(x11_source_h)
|
||||||
|
|
||||||
|
clutterx11_includedir = $(clutter_includedir)/x11
|
||||||
|
clutterx11_include_HEADERS = $(x11_source_h)
|
||||||
|
|
||||||
|
mutter-clutter-x11-@LIBMUTTER_API_VERSION@.pc: mutter-clutter-$(LIBMUTTER_API_VERSION).pc
|
||||||
|
$(QUIET_GEN)cp -f $< $(@F)
|
||||||
|
|
||||||
|
pc_files += mutter-clutter-x11-$(LIBMUTTER_API_VERSION).pc
|
||||||
|
|
||||||
|
# Shared cogl backend files
|
||||||
|
cogl_source_h =
|
||||||
|
|
||||||
|
cogl_source_c = \
|
||||||
|
cogl/clutter-stage-cogl.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
cogl_source_h_priv = \
|
||||||
|
cogl/clutter-stage-cogl.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
cogl_source_c_priv =
|
||||||
|
|
||||||
|
backend_source_h += $(cogl_source_h)
|
||||||
|
backend_source_c += $(cogl_source_c)
|
||||||
|
backend_source_h_priv += $(cogl_source_h_priv)
|
||||||
|
backend_source_c_priv += $(cogl_source_c_priv)
|
||||||
|
|
||||||
|
backend_source_h += $(glx_source_h)
|
||||||
|
backend_source_c += $(glx_source_c)
|
||||||
|
|
||||||
|
evdev_c_priv = \
|
||||||
|
evdev/clutter-device-manager-evdev.c \
|
||||||
|
evdev/clutter-input-device-evdev.c \
|
||||||
|
evdev/clutter-seat-evdev.c \
|
||||||
|
evdev/clutter-virtual-input-device-evdev.c \
|
||||||
|
evdev/clutter-event-evdev.c \
|
||||||
|
evdev/clutter-input-device-tool-evdev.c \
|
||||||
|
$(NULL)
|
||||||
|
evdev_h_priv = \
|
||||||
|
evdev/clutter-device-manager-evdev.h \
|
||||||
|
evdev/clutter-input-device-evdev.h \
|
||||||
|
evdev/clutter-seat-evdev.h \
|
||||||
|
evdev/clutter-input-device-tool-evdev.h \
|
||||||
|
evdev/clutter-virtual-input-device-evdev.h \
|
||||||
|
$(NULL)
|
||||||
|
evdev_h = evdev/clutter-evdev.h
|
||||||
|
|
||||||
|
if SUPPORT_WAYLAND
|
||||||
|
backend_source_c_priv += $(evdev_c_priv)
|
||||||
|
backend_source_h_priv += $(evdev_h_priv)
|
||||||
|
backend_source_h += $(evdev_h)
|
||||||
|
|
||||||
|
backend_source_c += evdev/clutter-xkb-utils.c
|
||||||
|
backend_source_h_priv += evdev/clutter-xkb-utils.h
|
||||||
|
|
||||||
|
# EGL backend rules
|
||||||
|
egl_source_h = \
|
||||||
|
egl/clutter-egl-headers.h \
|
||||||
|
egl/clutter-egl.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
egl_source_h_priv = egl/clutter-backend-eglnative.h
|
||||||
|
egl_source_c = egl/clutter-backend-eglnative.c
|
||||||
|
|
||||||
|
wayland_compositor_source_h = \
|
||||||
|
wayland/clutter-wayland-compositor.h \
|
||||||
|
wayland/clutter-wayland-surface.h
|
||||||
|
backend_source_h += $(wayland_compositor_source_h)
|
||||||
|
backend_source_c += \
|
||||||
|
wayland/clutter-wayland-surface.c
|
||||||
|
|
||||||
|
backend_source_h += $(egl_source_h)
|
||||||
|
backend_source_c += $(egl_source_c)
|
||||||
|
backend_source_h_priv += $(egl_source_h_priv)
|
||||||
|
|
||||||
|
endif # SUPPORT_WAYLAND
|
||||||
|
|
||||||
|
# cally
|
||||||
|
cally_sources_h = \
|
||||||
|
cally/cally-actor.h \
|
||||||
|
cally/cally-clone.h \
|
||||||
|
cally/cally-factory.h \
|
||||||
|
cally/cally-group.h \
|
||||||
|
cally/cally.h \
|
||||||
|
cally/cally-main.h \
|
||||||
|
cally/cally-rectangle.h \
|
||||||
|
cally/cally-root.h \
|
||||||
|
cally/cally-stage.h \
|
||||||
|
cally/cally-text.h \
|
||||||
|
cally/cally-texture.h \
|
||||||
|
cally/cally-util.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
cally_sources_c = \
|
||||||
|
cally/cally-actor.c \
|
||||||
|
cally/cally.c \
|
||||||
|
cally/cally-clone.c \
|
||||||
|
cally/cally-group.c \
|
||||||
|
cally/cally-rectangle.c \
|
||||||
|
cally/cally-root.c \
|
||||||
|
cally/cally-stage.c \
|
||||||
|
cally/cally-text.c \
|
||||||
|
cally/cally-texture.c \
|
||||||
|
cally/cally-util.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
cally_sources_private = \
|
||||||
|
cally/cally-actor-private.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
cally_includedir = $(clutter_base_includedir)/cally
|
||||||
|
cally_include_HEADERS = $(cally_sources_h)
|
||||||
|
|
||||||
|
# general build rules:
|
||||||
|
# you should not need to modify anything below this point
|
||||||
|
|
||||||
|
# glib-genmarshal rules
|
||||||
|
glib_marshal_list = clutter-marshal.list
|
||||||
|
glib_marshal_prefix = _clutter_marshal
|
||||||
|
include $(srcdir)/Makefile.am.marshal
|
||||||
|
|
||||||
|
# glib-mkenums rules
|
||||||
|
glib_enum_h = clutter-enum-types.h
|
||||||
|
glib_enum_c = clutter-enum-types.c
|
||||||
|
glib_enum_headers = $(source_h) $(deprecated_h)
|
||||||
|
include $(srcdir)/Makefile.am.enums
|
||||||
|
|
||||||
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
|
pkgconfig_DATA = $(pc_files)
|
||||||
|
DISTCLEANFILES += $(pc_files)
|
||||||
|
|
||||||
|
clutter_include_HEADERS = $(source_h) clutter.h clutter-autocleanups.h clutter-mutter.h
|
||||||
|
nodist_clutter_include_HEADERS = clutter-config.h $(built_source_h)
|
||||||
|
|
||||||
|
clutter_deprecated_HEADERS = $(deprecated_h)
|
||||||
|
|
||||||
|
mutterlibdir = $(libdir)/mutter-@LIBMUTTER_API_VERSION@
|
||||||
|
mutterlib_LTLIBRARIES = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
|
||||||
|
|
||||||
|
libmutter_clutter_@LIBMUTTER_API_VERSION@_la_LIBADD = \
|
||||||
|
$(LIBM) \
|
||||||
|
$(CLUTTER_LIBS) \
|
||||||
|
$(top_builddir)/../cogl/cogl/libmutter-cogl-$(LIBMUTTER_API_VERSION).la \
|
||||||
|
$(top_builddir)/../cogl/cogl-pango/libmutter-cogl-pango-$(LIBMUTTER_API_VERSION).la \
|
||||||
|
$(top_builddir)/../cogl/cogl-path/libmutter-cogl-path-$(LIBMUTTER_API_VERSION).la \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
libmutter_clutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
||||||
|
$(backend_source_c) \
|
||||||
|
$(backend_source_h) \
|
||||||
|
$(backend_source_c_priv) \
|
||||||
|
$(backend_source_h_priv) \
|
||||||
|
$(source_c) \
|
||||||
|
$(source_h) \
|
||||||
|
$(source_c_priv) \
|
||||||
|
$(source_h_priv) \
|
||||||
|
$(deprecated_c) \
|
||||||
|
$(deprecated_h) \
|
||||||
|
$(deprecated_c_priv) \
|
||||||
|
$(deprecated_h_priv) \
|
||||||
|
$(cally_sources_c) \
|
||||||
|
$(cally_sources_h) \
|
||||||
|
$(cally_sources_private) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
nodist_libmutter_clutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
||||||
|
$(backend_source_built) \
|
||||||
|
$(built_source_c) \
|
||||||
|
$(built_source_h)
|
||||||
|
|
||||||
|
libmutter_clutter_@LIBMUTTER_API_VERSION@_la_LDFLAGS = \
|
||||||
|
$(CLUTTER_LINK_FLAGS) \
|
||||||
|
$(CLUTTER_LT_LDFLAGS) \
|
||||||
|
-export-dynamic \
|
||||||
|
-rpath $(mutterlibdir) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
install-exec-local:
|
||||||
|
test -z "$(mutterlibdir)" || $(MKDIR_P) "$(DESTDIR)$(mutterlibdir)"
|
||||||
|
for lib in `echo $(compat_libs)`; do \
|
||||||
|
(cd $(DESTDIR)$(mutterlibdir) && \
|
||||||
|
rm -f $$lib.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION); \
|
||||||
|
) ; \
|
||||||
|
(cd $(DESTDIR)$(mutterlibdir) && \
|
||||||
|
{ ln -s -f libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib.0 || \
|
||||||
|
{ rm -f $$lib.0 && ln -s libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib.0; }; \
|
||||||
|
} \
|
||||||
|
) ; \
|
||||||
|
(cd $(DESTDIR)$(mutterlibdir) && \
|
||||||
|
{ ln -s -f libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib || \
|
||||||
|
{ rm -f $$lib && ln -s libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib; }; \
|
||||||
|
} \
|
||||||
|
) ; \
|
||||||
|
done
|
||||||
|
|
||||||
|
# gobject-introspection rules
|
||||||
|
-include $(INTROSPECTION_MAKEFILE)
|
||||||
|
|
||||||
|
INTROSPECTION_SCANNER_ARGS = \
|
||||||
|
--add-include-path=$(top_builddir)/../cogl/cogl \
|
||||||
|
--add-include-path=$(top_builddir)/../cogl/cogl-pango
|
||||||
|
INTROSPECTION_COMPILER_ARGS = \
|
||||||
|
--includedir=$(top_builddir)/../cogl/cogl \
|
||||||
|
--includedir=$(top_builddir)/../cogl/cogl-pango
|
||||||
|
INTROSPECTION_SCANNER_ENV = \
|
||||||
|
PKG_CONFIG_PATH=$(top_builddir)/../cogl/cogl/:$(top_builddir)/../cogl/cogl-pango/:$${PKG_CONFIG_PATH}
|
||||||
|
|
||||||
|
Clutter-@LIBMUTTER_API_VERSION@.gir: libmutter-clutter-@LIBMUTTER_API_VERSION@.la Makefile
|
||||||
|
|
||||||
|
Clutter_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = Clutter
|
||||||
|
Clutter_@LIBMUTTER_API_VERSION@_gir_VERSION = @LIBMUTTER_API_VERSION@
|
||||||
|
Clutter_@LIBMUTTER_API_VERSION@_gir_LIBS = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
|
||||||
|
Clutter_@LIBMUTTER_API_VERSION@_gir_FILES = \
|
||||||
|
$(clutter_include_HEADERS) \
|
||||||
|
$(clutter_deprecated_HEADERS) \
|
||||||
|
$(nodist_clutter_include_HEADERS) \
|
||||||
|
$(source_c) \
|
||||||
|
$(deprecated_c) \
|
||||||
|
$(built_source_c)
|
||||||
|
Clutter_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
|
||||||
|
Clutter_@LIBMUTTER_API_VERSION@_gir_INCLUDES = GL-1.0 GObject-2.0 cairo-1.0 Cogl-@LIBMUTTER_API_VERSION@ CoglPango-@LIBMUTTER_API_VERSION@ Atk-1.0 Json-1.0
|
||||||
|
Clutter_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
|
||||||
|
--warn-all \
|
||||||
|
--c-include='clutter/clutter.h' \
|
||||||
|
--pkg-export=mutter-clutter-@LIBMUTTER_API_VERSION@
|
||||||
|
|
||||||
|
INTROSPECTION_GIRS += Clutter-@LIBMUTTER_API_VERSION@.gir
|
||||||
|
|
||||||
|
Cally-@LIBMUTTER_API_VERSION@.gir: Makefile Clutter-@LIBMUTTER_API_VERSION@.gir
|
||||||
|
|
||||||
|
Cally_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = Cally
|
||||||
|
Cally_@LIBMUTTER_API_VERSION@_gir_VERSION = @LIBMUTTER_API_VERSION@
|
||||||
|
Cally_@LIBMUTTER_API_VERSION@_gir_LIBS = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
|
||||||
|
Cally_@LIBMUTTER_API_VERSION@_gir_FILES = $(cally_sources_h) $(cally_sources_c)
|
||||||
|
Cally_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
|
||||||
|
Cally_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
|
||||||
|
--warn-all \
|
||||||
|
--c-include='cally/cally.h' \
|
||||||
|
--pkg-export=mutter-clutter-@LIBMUTTER_API_VERSION@ \
|
||||||
|
--include-uninstalled=$(top_builddir)/clutter/Clutter-@LIBMUTTER_API_VERSION@.gir
|
||||||
|
|
||||||
|
INTROSPECTION_GIRS += Cally-@LIBMUTTER_API_VERSION@.gir
|
||||||
|
|
||||||
|
ClutterX11-@LIBMUTTER_API_VERSION@.gir: Makefile Clutter-@LIBMUTTER_API_VERSION@.gir
|
||||||
|
|
||||||
|
ClutterX11_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = ClutterX11
|
||||||
|
ClutterX11_@LIBMUTTER_API_VERSION@_gir_INCLUDES = xlib-2.0
|
||||||
|
ClutterX11_@LIBMUTTER_API_VERSION@_gir_LIBS = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
|
||||||
|
ClutterX11_@LIBMUTTER_API_VERSION@_gir_FILES = $(x11_introspection)
|
||||||
|
ClutterX11_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
|
||||||
|
ClutterX11_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
|
||||||
|
--warn-all \
|
||||||
|
--c-include='clutter/x11/clutter-x11.h' \
|
||||||
|
--pkg-export=mutter-clutter-x11-@LIBMUTTER_API_VERSION@ \
|
||||||
|
--include-uninstalled=$(top_builddir)/clutter/Clutter-@LIBMUTTER_API_VERSION@.gir
|
||||||
|
|
||||||
|
INTROSPECTION_GIRS += ClutterX11-@LIBMUTTER_API_VERSION@.gir
|
||||||
|
|
||||||
|
# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
|
||||||
|
# install anything - we need to install inside our prefix.
|
||||||
|
girdir = $(mutterlibdir)
|
||||||
|
gir_DATA = $(INTROSPECTION_GIRS)
|
||||||
|
|
||||||
|
typelibdir = $(mutterlibdir)
|
||||||
|
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
|
||||||
|
|
||||||
|
EXTRA_DIST += \
|
||||||
|
Makefile.am.marshal \
|
||||||
|
Makefile.am.enums
|
||||||
|
|
||||||
|
CLEANFILES += $(gir_DATA) $(typelib_DATA)
|
||||||
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
|
||||||
@@ -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,
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -279,12 +277,15 @@ void _clutter_actor_set_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);
|
||||||
|
|
||||||
@@ -315,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);
|
||||||
|
|||||||
@@ -635,7 +635,6 @@
|
|||||||
#include "clutter-interval.h"
|
#include "clutter-interval.h"
|
||||||
#include "clutter-main.h"
|
#include "clutter-main.h"
|
||||||
#include "clutter-marshal.h"
|
#include "clutter-marshal.h"
|
||||||
#include "clutter-mutter.h"
|
|
||||||
#include "clutter-paint-nodes.h"
|
#include "clutter-paint-nodes.h"
|
||||||
#include "clutter-paint-node-private.h"
|
#include "clutter-paint-node-private.h"
|
||||||
#include "clutter-paint-volume-private.h"
|
#include "clutter-paint-volume-private.h"
|
||||||
@@ -656,8 +655,7 @@
|
|||||||
* which indicates when to do something other than just enforce
|
* which indicates when to do something other than just enforce
|
||||||
* invariants.
|
* invariants.
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
MAP_STATE_CHECK, /* just enforce invariants. */
|
MAP_STATE_CHECK, /* just enforce invariants. */
|
||||||
MAP_STATE_MAKE_UNREALIZED, /* force unrealize, ignoring invariants,
|
MAP_STATE_MAKE_UNREALIZED, /* force unrealize, ignoring invariants,
|
||||||
* used when about to unparent.
|
* used when about to unparent.
|
||||||
@@ -699,8 +697,6 @@ struct _ClutterActorPrivate
|
|||||||
/* the cached transformation matrix; see apply_transform() */
|
/* the cached transformation matrix; see apply_transform() */
|
||||||
CoglMatrix transform;
|
CoglMatrix transform;
|
||||||
|
|
||||||
float resource_scale;
|
|
||||||
|
|
||||||
guint8 opacity;
|
guint8 opacity;
|
||||||
gint opacity_override;
|
gint opacity_override;
|
||||||
|
|
||||||
@@ -846,7 +842,6 @@ struct _ClutterActorPrivate
|
|||||||
guint needs_y_expand : 1;
|
guint needs_y_expand : 1;
|
||||||
guint needs_paint_volume_update : 1;
|
guint needs_paint_volume_update : 1;
|
||||||
guint had_effects_on_last_paint_volume_update : 1;
|
guint had_effects_on_last_paint_volume_update : 1;
|
||||||
guint needs_compute_resource_scale : 1;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@@ -919,7 +914,6 @@ enum
|
|||||||
PROP_SCALE_CENTER_X, /* XXX:2.0 remove */
|
PROP_SCALE_CENTER_X, /* XXX:2.0 remove */
|
||||||
PROP_SCALE_CENTER_Y, /* XXX:2.0 remove */
|
PROP_SCALE_CENTER_Y, /* XXX:2.0 remove */
|
||||||
PROP_SCALE_GRAVITY, /* XXX:2.0 remove */
|
PROP_SCALE_GRAVITY, /* XXX:2.0 remove */
|
||||||
PROP_RESOURCE_SCALE,
|
|
||||||
|
|
||||||
PROP_ROTATION_ANGLE_X, /* XXX:2.0 rename to rotation-x */
|
PROP_ROTATION_ANGLE_X, /* XXX:2.0 rename to rotation-x */
|
||||||
PROP_ROTATION_ANGLE_Y, /* XXX:2.0 rename to rotation-y */
|
PROP_ROTATION_ANGLE_Y, /* XXX:2.0 rename to rotation-y */
|
||||||
@@ -1028,7 +1022,7 @@ typedef struct _TransitionClosure
|
|||||||
|
|
||||||
static void clutter_container_iface_init (ClutterContainerIface *iface);
|
static void clutter_container_iface_init (ClutterContainerIface *iface);
|
||||||
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
|
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
|
||||||
static void clutter_animatable_iface_init (ClutterAnimatableInterface *iface);
|
static void clutter_animatable_iface_init (ClutterAnimatableIface *iface);
|
||||||
static void atk_implementor_iface_init (AtkImplementorIface *iface);
|
static void atk_implementor_iface_init (AtkImplementorIface *iface);
|
||||||
|
|
||||||
/* These setters are all static for now, maybe they should be in the
|
/* These setters are all static for now, maybe they should be in the
|
||||||
@@ -1099,8 +1093,6 @@ static void clutter_actor_set_child_transform_internal (ClutterActor *sel
|
|||||||
|
|
||||||
static void clutter_actor_realize_internal (ClutterActor *self);
|
static void clutter_actor_realize_internal (ClutterActor *self);
|
||||||
static void clutter_actor_unrealize_internal (ClutterActor *self);
|
static void clutter_actor_unrealize_internal (ClutterActor *self);
|
||||||
static gboolean clutter_actor_update_resource_scale (ClutterActor *self);
|
|
||||||
static void clutter_actor_ensure_resource_scale (ClutterActor *self);
|
|
||||||
|
|
||||||
static void clutter_actor_push_in_cloned_branch (ClutterActor *self,
|
static void clutter_actor_push_in_cloned_branch (ClutterActor *self,
|
||||||
gulong count);
|
gulong count);
|
||||||
@@ -1116,6 +1108,7 @@ static void clutter_actor_pop_in_cloned_branch (ClutterActor *self,
|
|||||||
{ _transform; } \
|
{ _transform; } \
|
||||||
cogl_matrix_translate ((m), -_tx, -_ty, -_tz); } G_STMT_END
|
cogl_matrix_translate ((m), -_tx, -_ty, -_tz); } G_STMT_END
|
||||||
|
|
||||||
|
static GQuark quark_shader_data = 0;
|
||||||
static GQuark quark_actor_layout_info = 0;
|
static GQuark quark_actor_layout_info = 0;
|
||||||
static GQuark quark_actor_transform_info = 0;
|
static GQuark quark_actor_transform_info = 0;
|
||||||
static GQuark quark_actor_animation_info = 0;
|
static GQuark quark_actor_animation_info = 0;
|
||||||
@@ -1527,8 +1520,6 @@ clutter_actor_real_map (ClutterActor *self)
|
|||||||
priv->pick_id,
|
priv->pick_id,
|
||||||
_clutter_actor_get_debug_name (self));
|
_clutter_actor_get_debug_name (self));
|
||||||
|
|
||||||
clutter_actor_ensure_resource_scale (self);
|
|
||||||
|
|
||||||
/* notify on parent mapped before potentially mapping
|
/* notify on parent mapped before potentially mapping
|
||||||
* children, so apps see a top-down notification.
|
* children, so apps see a top-down notification.
|
||||||
*/
|
*/
|
||||||
@@ -1731,22 +1722,6 @@ set_show_on_set_parent (ClutterActor *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_actor_queue_redraw_on_parent (ClutterActor *self)
|
|
||||||
{
|
|
||||||
const ClutterPaintVolume *pv;
|
|
||||||
|
|
||||||
if (!self->priv->parent)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* A relayout/redraw is underway */
|
|
||||||
if (self->priv->needs_allocation)
|
|
||||||
return;
|
|
||||||
|
|
||||||
pv = clutter_actor_get_transformed_paint_volume (self, self->priv->parent);
|
|
||||||
_clutter_actor_queue_redraw_with_clip (self->priv->parent, 0, pv);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_actor_show:
|
* clutter_actor_show:
|
||||||
* @self: A #ClutterActor
|
* @self: A #ClutterActor
|
||||||
@@ -1802,7 +1777,7 @@ clutter_actor_show (ClutterActor *self)
|
|||||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_VISIBLE]);
|
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_VISIBLE]);
|
||||||
|
|
||||||
if (priv->parent != NULL)
|
if (priv->parent != NULL)
|
||||||
clutter_actor_queue_redraw (self);
|
clutter_actor_queue_redraw (priv->parent);
|
||||||
|
|
||||||
g_object_thaw_notify (G_OBJECT (self));
|
g_object_thaw_notify (G_OBJECT (self));
|
||||||
}
|
}
|
||||||
@@ -1927,10 +1902,8 @@ clutter_actor_hide (ClutterActor *self)
|
|||||||
g_signal_emit (self, actor_signals[HIDE], 0);
|
g_signal_emit (self, actor_signals[HIDE], 0);
|
||||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_VISIBLE]);
|
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_VISIBLE]);
|
||||||
|
|
||||||
if (priv->parent != NULL && priv->needs_allocation)
|
if (priv->parent != NULL)
|
||||||
clutter_actor_queue_redraw (priv->parent);
|
clutter_actor_queue_redraw (priv->parent);
|
||||||
else
|
|
||||||
clutter_actor_queue_redraw_on_parent (self);
|
|
||||||
|
|
||||||
g_object_thaw_notify (G_OBJECT (self));
|
g_object_thaw_notify (G_OBJECT (self));
|
||||||
}
|
}
|
||||||
@@ -2698,12 +2671,9 @@ clutter_actor_real_allocate (ClutterActor *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_clutter_actor_propagate_queue_redraw (ClutterActor *self,
|
_clutter_actor_signal_queue_redraw (ClutterActor *self,
|
||||||
ClutterActor *origin,
|
ClutterActor *origin)
|
||||||
ClutterPaintVolume *pv)
|
|
||||||
{
|
{
|
||||||
gboolean stop = FALSE;
|
|
||||||
|
|
||||||
/* no point in queuing a redraw on a destroyed actor */
|
/* no point in queuing a redraw on a destroyed actor */
|
||||||
if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
|
if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
|
||||||
return;
|
return;
|
||||||
@@ -2712,33 +2682,27 @@ _clutter_actor_propagate_queue_redraw (ClutterActor *self,
|
|||||||
* the actor bas been cloned. In this case the clone will need to
|
* the actor bas been cloned. In this case the clone will need to
|
||||||
* receive the signal so it can queue its own redraw.
|
* receive the signal so it can queue its own redraw.
|
||||||
*/
|
*/
|
||||||
while (self)
|
|
||||||
{
|
|
||||||
_clutter_actor_queue_redraw_on_clones (self);
|
_clutter_actor_queue_redraw_on_clones (self);
|
||||||
|
|
||||||
/* calls klass->queue_redraw in default handler */
|
/* calls klass->queue_redraw in default handler */
|
||||||
if (g_signal_has_handler_pending (self, actor_signals[QUEUE_REDRAW],
|
if (g_signal_has_handler_pending (self, actor_signals[QUEUE_REDRAW],
|
||||||
0, TRUE))
|
0, TRUE))
|
||||||
{
|
{
|
||||||
g_signal_emit (self, actor_signals[QUEUE_REDRAW], 0, origin, pv, &stop);
|
g_signal_emit (self, actor_signals[QUEUE_REDRAW], 0, origin);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stop = CLUTTER_ACTOR_GET_CLASS (self)->queue_redraw (self, origin, pv);
|
CLUTTER_ACTOR_GET_CLASS (self)->queue_redraw (self, origin);
|
||||||
}
|
|
||||||
|
|
||||||
if (stop)
|
|
||||||
break;
|
|
||||||
|
|
||||||
self = clutter_actor_get_parent (self);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static void
|
||||||
clutter_actor_real_queue_redraw (ClutterActor *self,
|
clutter_actor_real_queue_redraw (ClutterActor *self,
|
||||||
ClutterActor *origin,
|
ClutterActor *origin)
|
||||||
ClutterPaintVolume *paint_volume)
|
|
||||||
{
|
{
|
||||||
|
ClutterActor *parent;
|
||||||
|
|
||||||
CLUTTER_NOTE (PAINT, "Redraw queued on '%s' (from: '%s')",
|
CLUTTER_NOTE (PAINT, "Redraw queued on '%s' (from: '%s')",
|
||||||
_clutter_actor_get_debug_name (self),
|
_clutter_actor_get_debug_name (self),
|
||||||
origin != NULL ? _clutter_actor_get_debug_name (origin)
|
origin != NULL ? _clutter_actor_get_debug_name (origin)
|
||||||
@@ -2746,7 +2710,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
|
|||||||
|
|
||||||
/* no point in queuing a redraw on a destroyed actor */
|
/* no point in queuing a redraw on a destroyed actor */
|
||||||
if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
|
if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
|
||||||
return TRUE;
|
return;
|
||||||
|
|
||||||
/* If the queue redraw is coming from a child then the actor has
|
/* If the queue redraw is coming from a child then the actor has
|
||||||
become dirty and any queued effect is no longer valid */
|
become dirty and any queued effect is no longer valid */
|
||||||
@@ -2761,7 +2725,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
|
|||||||
* won't change so we don't have to propagate up the hierarchy.
|
* won't change so we don't have to propagate up the hierarchy.
|
||||||
*/
|
*/
|
||||||
if (!CLUTTER_ACTOR_IS_VISIBLE (self))
|
if (!CLUTTER_ACTOR_IS_VISIBLE (self))
|
||||||
return TRUE;
|
return;
|
||||||
|
|
||||||
/* Although we could determine here that a full stage redraw
|
/* Although we could determine here that a full stage redraw
|
||||||
* has already been queued and immediately bail out, we actually
|
* has already been queued and immediately bail out, we actually
|
||||||
@@ -2775,7 +2739,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
|
|||||||
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
|
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
|
||||||
if (stage != NULL &&
|
if (stage != NULL &&
|
||||||
_clutter_stage_has_full_redraw_queued (CLUTTER_STAGE (stage)))
|
_clutter_stage_has_full_redraw_queued (CLUTTER_STAGE (stage)))
|
||||||
return TRUE;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
self->priv->propagated_one_redraw = TRUE;
|
self->priv->propagated_one_redraw = TRUE;
|
||||||
@@ -2783,17 +2747,12 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
|
|||||||
/* notify parents, if they are all visible eventually we'll
|
/* notify parents, if they are all visible eventually we'll
|
||||||
* queue redraw on the stage, which queues the redraw idle.
|
* queue redraw on the stage, which queues the redraw idle.
|
||||||
*/
|
*/
|
||||||
return FALSE;
|
parent = clutter_actor_get_parent (self);
|
||||||
}
|
if (parent != NULL)
|
||||||
|
|
||||||
static inline gboolean
|
|
||||||
clutter_actor_needs_relayout (ClutterActor *self)
|
|
||||||
{
|
{
|
||||||
ClutterActorPrivate *priv = self->priv;
|
/* this will go up recursively */
|
||||||
|
_clutter_actor_signal_queue_redraw (parent, origin);
|
||||||
return (priv->needs_width_request ||
|
}
|
||||||
priv->needs_height_request ||
|
|
||||||
priv->needs_allocation);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -3584,6 +3543,12 @@ _clutter_actor_update_last_paint_volume (ClutterActor *self)
|
|||||||
priv->last_paint_volume_valid = TRUE;
|
priv->last_paint_volume_valid = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline gboolean
|
||||||
|
actor_has_shader_data (ClutterActor *self)
|
||||||
|
{
|
||||||
|
return g_object_get_qdata (G_OBJECT (self), quark_shader_data) != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
guint32
|
guint32
|
||||||
_clutter_actor_get_pick_id (ClutterActor *self)
|
_clutter_actor_get_pick_id (ClutterActor *self)
|
||||||
{
|
{
|
||||||
@@ -3757,7 +3722,7 @@ clutter_actor_paint_node (ClutterActor *actor,
|
|||||||
if (!clutter_stage_get_no_clear_hint (CLUTTER_STAGE (actor)))
|
if (!clutter_stage_get_no_clear_hint (CLUTTER_STAGE (actor)))
|
||||||
clear_flags |= COGL_BUFFER_BIT_COLOR;
|
clear_flags |= COGL_BUFFER_BIT_COLOR;
|
||||||
|
|
||||||
node = clutter_root_node_new (fb, &bg_color, clear_flags);
|
node = _clutter_root_node_new (fb, &bg_color, clear_flags);
|
||||||
clutter_paint_node_set_name (node, "stageClear");
|
clutter_paint_node_set_name (node, "stageClear");
|
||||||
clutter_paint_node_add_rectangle (node, &box);
|
clutter_paint_node_add_rectangle (node, &box);
|
||||||
clutter_paint_node_add_child (root, node);
|
clutter_paint_node_add_child (root, node);
|
||||||
@@ -3796,7 +3761,7 @@ clutter_actor_paint_node (ClutterActor *actor,
|
|||||||
}
|
}
|
||||||
#endif /* CLUTTER_ENABLE_DEBUG */
|
#endif /* CLUTTER_ENABLE_DEBUG */
|
||||||
|
|
||||||
clutter_paint_node_paint (root);
|
_clutter_paint_node_paint (root);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -3825,6 +3790,7 @@ clutter_actor_paint (ClutterActor *self)
|
|||||||
ClutterActorPrivate *priv;
|
ClutterActorPrivate *priv;
|
||||||
ClutterPickMode pick_mode;
|
ClutterPickMode pick_mode;
|
||||||
gboolean clip_set = FALSE;
|
gboolean clip_set = FALSE;
|
||||||
|
gboolean shader_applied = FALSE;
|
||||||
ClutterStage *stage;
|
ClutterStage *stage;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||||
@@ -3855,8 +3821,6 @@ clutter_actor_paint (ClutterActor *self)
|
|||||||
if (!CLUTTER_ACTOR_IS_MAPPED (self))
|
if (!CLUTTER_ACTOR_IS_MAPPED (self))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
clutter_actor_ensure_resource_scale (self);
|
|
||||||
|
|
||||||
stage = (ClutterStage *) _clutter_actor_get_stage_internal (self);
|
stage = (ClutterStage *) _clutter_actor_get_stage_internal (self);
|
||||||
|
|
||||||
/* mark that we are in the paint process */
|
/* mark that we are in the paint process */
|
||||||
@@ -3996,13 +3960,25 @@ clutter_actor_paint (ClutterActor *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (priv->effects == NULL)
|
if (priv->effects == NULL)
|
||||||
|
{
|
||||||
|
if (pick_mode == CLUTTER_PICK_NONE &&
|
||||||
|
actor_has_shader_data (self))
|
||||||
|
{
|
||||||
|
_clutter_actor_shader_pre_paint (self, FALSE);
|
||||||
|
shader_applied = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
priv->next_effect_to_paint = NULL;
|
priv->next_effect_to_paint = NULL;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
priv->next_effect_to_paint =
|
priv->next_effect_to_paint =
|
||||||
_clutter_meta_group_peek_metas (priv->effects);
|
_clutter_meta_group_peek_metas (priv->effects);
|
||||||
|
|
||||||
clutter_actor_continue_paint (self);
|
clutter_actor_continue_paint (self);
|
||||||
|
|
||||||
|
if (shader_applied)
|
||||||
|
_clutter_actor_shader_post_paint (self);
|
||||||
|
|
||||||
if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_VOLUMES &&
|
if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_VOLUMES &&
|
||||||
pick_mode == CLUTTER_PICK_NONE))
|
pick_mode == CLUTTER_PICK_NONE))
|
||||||
_clutter_actor_draw_paint_volume (self);
|
_clutter_actor_draw_paint_volume (self);
|
||||||
@@ -4222,8 +4198,7 @@ remove_child (ClutterActor *self,
|
|||||||
child->priv->next_sibling = NULL;
|
child->priv->next_sibling = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
REMOVE_CHILD_DESTROY_META = 1 << 0,
|
REMOVE_CHILD_DESTROY_META = 1 << 0,
|
||||||
REMOVE_CHILD_EMIT_PARENT_SET = 1 << 1,
|
REMOVE_CHILD_EMIT_PARENT_SET = 1 << 1,
|
||||||
REMOVE_CHILD_EMIT_ACTOR_REMOVED = 1 << 2,
|
REMOVE_CHILD_EMIT_ACTOR_REMOVED = 1 << 2,
|
||||||
@@ -4359,10 +4334,7 @@ clutter_actor_remove_child_internal (ClutterActor *self,
|
|||||||
|
|
||||||
/* clutter_actor_reparent() will emit ::parent-set for us */
|
/* clutter_actor_reparent() will emit ::parent-set for us */
|
||||||
if (emit_parent_set && !CLUTTER_ACTOR_IN_REPARENT (child))
|
if (emit_parent_set && !CLUTTER_ACTOR_IN_REPARENT (child))
|
||||||
{
|
|
||||||
child->priv->needs_compute_resource_scale = TRUE;
|
|
||||||
g_signal_emit (child, actor_signals[PARENT_SET], 0, self);
|
g_signal_emit (child, actor_signals[PARENT_SET], 0, self);
|
||||||
}
|
|
||||||
|
|
||||||
/* if the child was mapped then we need to relayout ourselves to account
|
/* if the child was mapped then we need to relayout ourselves to account
|
||||||
* for the removed child
|
* for the removed child
|
||||||
@@ -4890,7 +4862,6 @@ clutter_actor_set_scale_factor (ClutterActor *self,
|
|||||||
g_assert (pspec != NULL);
|
g_assert (pspec != NULL);
|
||||||
g_assert (scale_p != NULL);
|
g_assert (scale_p != NULL);
|
||||||
|
|
||||||
if (*scale_p != factor)
|
|
||||||
_clutter_actor_create_transition (self, pspec, *scale_p, factor);
|
_clutter_actor_create_transition (self, pspec, *scale_p, factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5687,16 +5658,6 @@ clutter_actor_get_property (GObject *object,
|
|||||||
g_value_set_enum (value, clutter_actor_get_scale_gravity (actor));
|
g_value_set_enum (value, clutter_actor_get_scale_gravity (actor));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_RESOURCE_SCALE:
|
|
||||||
if (priv->needs_compute_resource_scale)
|
|
||||||
{
|
|
||||||
if (!clutter_actor_update_resource_scale (actor))
|
|
||||||
g_warning ("Getting invalid resource scale property");
|
|
||||||
}
|
|
||||||
|
|
||||||
g_value_set_float (value, priv->resource_scale);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_REACTIVE:
|
case PROP_REACTIVE:
|
||||||
g_value_set_boolean (value, clutter_actor_get_reactive (actor));
|
g_value_set_boolean (value, clutter_actor_get_reactive (actor));
|
||||||
break;
|
break;
|
||||||
@@ -6357,6 +6318,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
|
quark_shader_data = g_quark_from_static_string ("-clutter-actor-shader-data");
|
||||||
quark_actor_layout_info = g_quark_from_static_string ("-clutter-actor-layout-info");
|
quark_actor_layout_info = g_quark_from_static_string ("-clutter-actor-layout-info");
|
||||||
quark_actor_transform_info = g_quark_from_static_string ("-clutter-actor-transform-info");
|
quark_actor_transform_info = g_quark_from_static_string ("-clutter-actor-transform-info");
|
||||||
quark_actor_animation_info = g_quark_from_static_string ("-clutter-actor-animation-info");
|
quark_actor_animation_info = g_quark_from_static_string ("-clutter-actor-animation-info");
|
||||||
@@ -7150,19 +7112,6 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
|||||||
G_PARAM_STATIC_STRINGS |
|
G_PARAM_STATIC_STRINGS |
|
||||||
G_PARAM_DEPRECATED);
|
G_PARAM_DEPRECATED);
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterActor:resource-scale:
|
|
||||||
*
|
|
||||||
* The resource-scale of the #ClutterActor if any or -1 if not available
|
|
||||||
*/
|
|
||||||
obj_props[PROP_RESOURCE_SCALE] =
|
|
||||||
g_param_spec_float ("resource-scale",
|
|
||||||
P_("Resource Scale"),
|
|
||||||
P_("The Scaling factor for resources painting"),
|
|
||||||
-1.0f, G_MAXFLOAT,
|
|
||||||
1.0f,
|
|
||||||
CLUTTER_PARAM_READABLE);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterActor:rotation-angle-x:
|
* ClutterActor:rotation-angle-x:
|
||||||
*
|
*
|
||||||
@@ -8042,7 +7991,6 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
|||||||
* ClutterActor::queue-redraw:
|
* ClutterActor::queue-redraw:
|
||||||
* @actor: the actor we're bubbling the redraw request through
|
* @actor: the actor we're bubbling the redraw request through
|
||||||
* @origin: the actor which initiated the redraw request
|
* @origin: the actor which initiated the redraw request
|
||||||
* @volume: paint volume to redraw
|
|
||||||
*
|
*
|
||||||
* The ::queue_redraw signal is emitted when clutter_actor_queue_redraw()
|
* The ::queue_redraw signal is emitted when clutter_actor_queue_redraw()
|
||||||
* is called on @origin.
|
* is called on @origin.
|
||||||
@@ -8096,12 +8044,10 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
|||||||
G_SIGNAL_RUN_LAST |
|
G_SIGNAL_RUN_LAST |
|
||||||
G_SIGNAL_NO_HOOKS,
|
G_SIGNAL_NO_HOOKS,
|
||||||
G_STRUCT_OFFSET (ClutterActorClass, queue_redraw),
|
G_STRUCT_OFFSET (ClutterActorClass, queue_redraw),
|
||||||
g_signal_accumulator_true_handled,
|
NULL, NULL,
|
||||||
NULL,
|
_clutter_marshal_VOID__OBJECT,
|
||||||
_clutter_marshal_BOOLEAN__OBJECT_BOXED,
|
G_TYPE_NONE, 1,
|
||||||
G_TYPE_BOOLEAN, 2,
|
CLUTTER_TYPE_ACTOR);
|
||||||
CLUTTER_TYPE_ACTOR,
|
|
||||||
CLUTTER_TYPE_PAINT_VOLUME);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterActor::queue-relayout:
|
* ClutterActor::queue-relayout:
|
||||||
@@ -8602,13 +8548,11 @@ clutter_actor_init (ClutterActor *self)
|
|||||||
|
|
||||||
priv->opacity = 0xff;
|
priv->opacity = 0xff;
|
||||||
priv->show_on_set_parent = TRUE;
|
priv->show_on_set_parent = TRUE;
|
||||||
priv->resource_scale = -1.0f;
|
|
||||||
|
|
||||||
priv->needs_width_request = TRUE;
|
priv->needs_width_request = TRUE;
|
||||||
priv->needs_height_request = TRUE;
|
priv->needs_height_request = TRUE;
|
||||||
priv->needs_allocation = TRUE;
|
priv->needs_allocation = TRUE;
|
||||||
priv->needs_paint_volume_update = TRUE;
|
priv->needs_paint_volume_update = TRUE;
|
||||||
priv->needs_compute_resource_scale = TRUE;
|
|
||||||
|
|
||||||
priv->cached_width_age = 1;
|
priv->cached_width_age = 1;
|
||||||
priv->cached_height_age = 1;
|
priv->cached_height_age = 1;
|
||||||
@@ -8702,7 +8646,8 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self,
|
|||||||
ClutterPaintVolume *clip)
|
ClutterPaintVolume *clip)
|
||||||
{
|
{
|
||||||
ClutterActorPrivate *priv = self->priv;
|
ClutterActorPrivate *priv = self->priv;
|
||||||
ClutterPaintVolume *pv = NULL;
|
ClutterPaintVolume *pv;
|
||||||
|
gboolean clipped;
|
||||||
|
|
||||||
/* Remove queue entry early in the process, otherwise a new
|
/* Remove queue entry early in the process, otherwise a new
|
||||||
queue_redraw() during signal handling could put back this
|
queue_redraw() during signal handling could put back this
|
||||||
@@ -8729,7 +8674,8 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self,
|
|||||||
*/
|
*/
|
||||||
if (clip)
|
if (clip)
|
||||||
{
|
{
|
||||||
pv = clip;
|
_clutter_actor_set_queue_redraw_clip (self, clip);
|
||||||
|
clipped = TRUE;
|
||||||
}
|
}
|
||||||
else if (G_LIKELY (priv->last_paint_volume_valid))
|
else if (G_LIKELY (priv->last_paint_volume_valid))
|
||||||
{
|
{
|
||||||
@@ -8739,12 +8685,36 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self,
|
|||||||
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
|
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
|
||||||
|
|
||||||
/* make sure we redraw the actors old position... */
|
/* make sure we redraw the actors old position... */
|
||||||
_clutter_actor_propagate_queue_redraw (stage, stage,
|
_clutter_actor_set_queue_redraw_clip (stage,
|
||||||
&priv->last_paint_volume);
|
&priv->last_paint_volume);
|
||||||
}
|
_clutter_actor_signal_queue_redraw (stage, stage);
|
||||||
}
|
_clutter_actor_set_queue_redraw_clip (stage, NULL);
|
||||||
|
|
||||||
_clutter_actor_propagate_queue_redraw (self, self, pv);
|
/* XXX: Ideally the redraw signal would take a clip volume
|
||||||
|
* argument, but that would be an ABI break. Until we can
|
||||||
|
* break the ABI we pass the argument out-of-band
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* setup the clip for the actors new position... */
|
||||||
|
_clutter_actor_set_queue_redraw_clip (self, pv);
|
||||||
|
clipped = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
clipped = FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
clipped = FALSE;
|
||||||
|
|
||||||
|
_clutter_actor_signal_queue_redraw (self, self);
|
||||||
|
|
||||||
|
/* Just in case anyone is manually firing redraw signals without
|
||||||
|
* using the public queue_redraw() API we are careful to ensure that
|
||||||
|
* our out-of-band clip member is cleared before returning...
|
||||||
|
*
|
||||||
|
* Note: A NULL clip denotes a full-stage, un-clipped redraw
|
||||||
|
*/
|
||||||
|
if (G_LIKELY (clipped))
|
||||||
|
_clutter_actor_set_queue_redraw_clip (self, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -8776,12 +8746,13 @@ _clutter_actor_get_allocation_clip (ClutterActor *self,
|
|||||||
void
|
void
|
||||||
_clutter_actor_queue_redraw_full (ClutterActor *self,
|
_clutter_actor_queue_redraw_full (ClutterActor *self,
|
||||||
ClutterRedrawFlags flags,
|
ClutterRedrawFlags flags,
|
||||||
const ClutterPaintVolume *volume,
|
ClutterPaintVolume *volume,
|
||||||
ClutterEffect *effect)
|
ClutterEffect *effect)
|
||||||
{
|
{
|
||||||
ClutterActorPrivate *priv = self->priv;
|
ClutterActorPrivate *priv = self->priv;
|
||||||
ClutterPaintVolume allocation_pv;
|
ClutterPaintVolume allocation_pv;
|
||||||
ClutterPaintVolume *pv = NULL;
|
ClutterPaintVolume *pv;
|
||||||
|
gboolean should_free_pv;
|
||||||
ClutterActor *stage;
|
ClutterActor *stage;
|
||||||
|
|
||||||
/* Here's an outline of the actor queue redraw mechanism:
|
/* Here's an outline of the actor queue redraw mechanism:
|
||||||
@@ -8904,7 +8875,8 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
|
|||||||
{
|
{
|
||||||
/* NB: NULL denotes an undefined clip which will result in a
|
/* NB: NULL denotes an undefined clip which will result in a
|
||||||
* full redraw... */
|
* full redraw... */
|
||||||
_clutter_actor_propagate_queue_redraw (self, self, NULL);
|
_clutter_actor_set_queue_redraw_clip (self, NULL);
|
||||||
|
_clutter_actor_signal_queue_redraw (self, self);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8922,15 +8894,21 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
|
|||||||
clutter_paint_volume_set_height (pv,
|
clutter_paint_volume_set_height (pv,
|
||||||
allocation_clip.y2 -
|
allocation_clip.y2 -
|
||||||
allocation_clip.y1);
|
allocation_clip.y1);
|
||||||
|
should_free_pv = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pv = volume;
|
||||||
|
should_free_pv = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
self->priv->queue_redraw_entry =
|
self->priv->queue_redraw_entry =
|
||||||
_clutter_stage_queue_actor_redraw (CLUTTER_STAGE (stage),
|
_clutter_stage_queue_actor_redraw (CLUTTER_STAGE (stage),
|
||||||
priv->queue_redraw_entry,
|
priv->queue_redraw_entry,
|
||||||
self,
|
self,
|
||||||
pv ? pv : volume);
|
pv);
|
||||||
|
|
||||||
if (pv)
|
if (should_free_pv)
|
||||||
clutter_paint_volume_free (pv);
|
clutter_paint_volume_free (pv);
|
||||||
|
|
||||||
/* If this is the first redraw queued then we can directly use the
|
/* If this is the first redraw queued then we can directly use the
|
||||||
@@ -9046,7 +9024,7 @@ clutter_actor_queue_redraw (ClutterActor *self)
|
|||||||
void
|
void
|
||||||
_clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
_clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||||
ClutterRedrawFlags flags,
|
ClutterRedrawFlags flags,
|
||||||
const ClutterPaintVolume *volume)
|
ClutterPaintVolume *volume)
|
||||||
{
|
{
|
||||||
_clutter_actor_queue_redraw_full (self,
|
_clutter_actor_queue_redraw_full (self,
|
||||||
flags, /* flags */
|
flags, /* flags */
|
||||||
@@ -9568,8 +9546,6 @@ clutter_actor_get_preferred_width (ClutterActor *self,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_WIDTH);
|
|
||||||
|
|
||||||
/* the remaining cases are:
|
/* the remaining cases are:
|
||||||
*
|
*
|
||||||
* - either min_width or natural_width have been set
|
* - either min_width or natural_width have been set
|
||||||
@@ -9661,8 +9637,6 @@ clutter_actor_get_preferred_width (ClutterActor *self,
|
|||||||
|
|
||||||
if (natural_width_p)
|
if (natural_width_p)
|
||||||
*natural_width_p = request_natural_width;
|
*natural_width_p = request_natural_width;
|
||||||
|
|
||||||
CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_WIDTH);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -9716,8 +9690,6 @@ clutter_actor_get_preferred_height (ClutterActor *self,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_HEIGHT);
|
|
||||||
|
|
||||||
/* the remaining cases are:
|
/* the remaining cases are:
|
||||||
*
|
*
|
||||||
* - either min_height or natural_height have been set
|
* - either min_height or natural_height have been set
|
||||||
@@ -9808,8 +9780,6 @@ clutter_actor_get_preferred_height (ClutterActor *self,
|
|||||||
|
|
||||||
if (natural_height_p)
|
if (natural_height_p)
|
||||||
*natural_height_p = request_natural_height;
|
*natural_height_p = request_natural_height;
|
||||||
|
|
||||||
CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_HEIGHT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10152,9 +10122,6 @@ clutter_actor_allocate (ClutterActor *self,
|
|||||||
if (CLUTTER_ACTOR_IS_MAPPED (self))
|
if (CLUTTER_ACTOR_IS_MAPPED (self))
|
||||||
self->priv->needs_paint_volume_update = TRUE;
|
self->priv->needs_paint_volume_update = TRUE;
|
||||||
|
|
||||||
if (stage_allocation_changed)
|
|
||||||
priv->needs_compute_resource_scale = TRUE;
|
|
||||||
|
|
||||||
if (!stage_allocation_changed)
|
if (!stage_allocation_changed)
|
||||||
{
|
{
|
||||||
/* If the actor didn't move but needs_allocation is set, we just
|
/* If the actor didn't move but needs_allocation is set, we just
|
||||||
@@ -10334,7 +10301,6 @@ clutter_actor_set_position (ClutterActor *self,
|
|||||||
cur_position.x = clutter_actor_get_x (self);
|
cur_position.x = clutter_actor_get_x (self);
|
||||||
cur_position.y = clutter_actor_get_y (self);
|
cur_position.y = clutter_actor_get_y (self);
|
||||||
|
|
||||||
if (!clutter_point_equals (&cur_position, &new_position))
|
|
||||||
_clutter_actor_create_transition (self, obj_props[PROP_POSITION],
|
_clutter_actor_create_transition (self, obj_props[PROP_POSITION],
|
||||||
&cur_position,
|
&cur_position,
|
||||||
&new_position);
|
&new_position);
|
||||||
@@ -12817,8 +12783,7 @@ typedef void (* ClutterActorAddChildFunc) (ClutterActor *parent,
|
|||||||
ClutterActor *child,
|
ClutterActor *child,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
ADD_CHILD_CREATE_META = 1 << 0,
|
ADD_CHILD_CREATE_META = 1 << 0,
|
||||||
ADD_CHILD_EMIT_PARENT_SET = 1 << 1,
|
ADD_CHILD_EMIT_PARENT_SET = 1 << 1,
|
||||||
ADD_CHILD_EMIT_ACTOR_ADDED = 1 << 2,
|
ADD_CHILD_EMIT_ACTOR_ADDED = 1 << 2,
|
||||||
@@ -13003,10 +12968,7 @@ clutter_actor_add_child_internal (ClutterActor *self,
|
|||||||
|
|
||||||
/* clutter_actor_reparent() will emit ::parent-set for us */
|
/* clutter_actor_reparent() will emit ::parent-set for us */
|
||||||
if (emit_parent_set && !CLUTTER_ACTOR_IN_REPARENT (child))
|
if (emit_parent_set && !CLUTTER_ACTOR_IN_REPARENT (child))
|
||||||
{
|
|
||||||
child->priv->needs_compute_resource_scale = TRUE;
|
|
||||||
g_signal_emit (child, actor_signals[PARENT_SET], 0, NULL);
|
g_signal_emit (child, actor_signals[PARENT_SET], 0, NULL);
|
||||||
}
|
|
||||||
|
|
||||||
if (check_state)
|
if (check_state)
|
||||||
{
|
{
|
||||||
@@ -13039,7 +13001,9 @@ clutter_actor_add_child_internal (ClutterActor *self,
|
|||||||
/* maintain the invariant that if an actor needs layout,
|
/* maintain the invariant that if an actor needs layout,
|
||||||
* its parents do as well
|
* its parents do as well
|
||||||
*/
|
*/
|
||||||
if (clutter_actor_needs_relayout (child))
|
if (child->priv->needs_width_request ||
|
||||||
|
child->priv->needs_height_request ||
|
||||||
|
child->priv->needs_allocation)
|
||||||
{
|
{
|
||||||
/* we work around the short-circuiting we do
|
/* we work around the short-circuiting we do
|
||||||
* in clutter_actor_queue_relayout() since we
|
* in clutter_actor_queue_relayout() since we
|
||||||
@@ -13608,8 +13572,6 @@ clutter_actor_reparent (ClutterActor *self,
|
|||||||
insert_child_at_depth,
|
insert_child_at_depth,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
priv->needs_compute_resource_scale = TRUE;
|
|
||||||
|
|
||||||
/* we emit the ::parent-set signal once */
|
/* we emit the ::parent-set signal once */
|
||||||
g_signal_emit (self, actor_signals[PARENT_SET], 0, old_parent);
|
g_signal_emit (self, actor_signals[PARENT_SET], 0, old_parent);
|
||||||
|
|
||||||
@@ -13700,7 +13662,7 @@ clutter_actor_set_child_above_sibling (ClutterActor *self,
|
|||||||
sibling);
|
sibling);
|
||||||
g_object_unref(child);
|
g_object_unref(child);
|
||||||
|
|
||||||
clutter_actor_queue_redraw_on_parent (child);
|
clutter_actor_queue_relayout (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13747,7 +13709,7 @@ clutter_actor_set_child_below_sibling (ClutterActor *self,
|
|||||||
sibling);
|
sibling);
|
||||||
g_object_unref(child);
|
g_object_unref(child);
|
||||||
|
|
||||||
clutter_actor_queue_redraw_on_parent (child);
|
clutter_actor_queue_relayout (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15184,7 +15146,7 @@ clutter_actor_set_final_state (ClutterAnimatable *animatable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
|
clutter_animatable_iface_init (ClutterAnimatableIface *iface)
|
||||||
{
|
{
|
||||||
iface->find_property = clutter_actor_find_property;
|
iface->find_property = clutter_actor_find_property;
|
||||||
iface->get_initial_state = clutter_actor_get_initial_state;
|
iface->get_initial_state = clutter_actor_get_initial_state;
|
||||||
@@ -16512,12 +16474,6 @@ clutter_actor_is_in_clone_paint (ClutterActor *self)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
clutter_actor_has_damage (ClutterActor *actor)
|
|
||||||
{
|
|
||||||
return actor->priv->is_dirty;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
set_direction_recursive (ClutterActor *actor,
|
set_direction_recursive (ClutterActor *actor,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
@@ -16735,6 +16691,26 @@ clutter_actor_has_pointer (ClutterActor *self)
|
|||||||
return self->priv->has_pointer;
|
return self->priv->has_pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* XXX: This is a workaround for not being able to break the ABI of
|
||||||
|
* the QUEUE_REDRAW signal. It is an out-of-band argument. See
|
||||||
|
* clutter_actor_queue_clipped_redraw() for details.
|
||||||
|
*/
|
||||||
|
ClutterPaintVolume *
|
||||||
|
_clutter_actor_get_queue_redraw_clip (ClutterActor *self)
|
||||||
|
{
|
||||||
|
return g_object_get_data (G_OBJECT (self),
|
||||||
|
"-clutter-actor-queue-redraw-clip");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_clutter_actor_set_queue_redraw_clip (ClutterActor *self,
|
||||||
|
ClutterPaintVolume *clip)
|
||||||
|
{
|
||||||
|
g_object_set_data (G_OBJECT (self),
|
||||||
|
"-clutter-actor-queue-redraw-clip",
|
||||||
|
clip);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_actor_has_allocation:
|
* clutter_actor_has_allocation:
|
||||||
* @self: a #ClutterActor
|
* @self: a #ClutterActor
|
||||||
@@ -17779,171 +17755,6 @@ clutter_actor_get_paint_box (ClutterActor *self,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
_clutter_actor_get_resource_scale_for_rect (ClutterActor *self,
|
|
||||||
ClutterRect *bounding_rect,
|
|
||||||
float *resource_scale)
|
|
||||||
{
|
|
||||||
ClutterActor *stage;
|
|
||||||
float max_scale = 0;
|
|
||||||
|
|
||||||
stage = _clutter_actor_get_stage_internal (self);
|
|
||||||
if (!stage)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (!_clutter_stage_get_max_view_scale_factor_for_rect (CLUTTER_STAGE (stage),
|
|
||||||
bounding_rect,
|
|
||||||
&max_scale))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
*resource_scale = max_scale;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
_clutter_actor_compute_resource_scale (ClutterActor *self,
|
|
||||||
float *resource_scale)
|
|
||||||
{
|
|
||||||
ClutterRect bounding_rect;
|
|
||||||
ClutterActorPrivate *priv = self->priv;
|
|
||||||
|
|
||||||
if (CLUTTER_ACTOR_IN_DESTRUCTION (self) ||
|
|
||||||
CLUTTER_ACTOR_IN_PREF_SIZE (self) ||
|
|
||||||
!clutter_actor_is_mapped (self))
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
clutter_actor_get_transformed_position (self,
|
|
||||||
&bounding_rect.origin.x,
|
|
||||||
&bounding_rect.origin.y);
|
|
||||||
clutter_actor_get_transformed_size (self,
|
|
||||||
&bounding_rect.size.width,
|
|
||||||
&bounding_rect.size.height);
|
|
||||||
|
|
||||||
if (bounding_rect.size.width == 0.0 ||
|
|
||||||
bounding_rect.size.height == 0.0 ||
|
|
||||||
!_clutter_actor_get_resource_scale_for_rect (self,
|
|
||||||
&bounding_rect,
|
|
||||||
resource_scale))
|
|
||||||
{
|
|
||||||
if (priv->parent)
|
|
||||||
return _clutter_actor_compute_resource_scale (priv->parent,
|
|
||||||
resource_scale);
|
|
||||||
else
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ClutterActorTraverseVisitFlags
|
|
||||||
queue_update_resource_scale_cb (ClutterActor *actor,
|
|
||||||
int depth,
|
|
||||||
void *user_data)
|
|
||||||
{
|
|
||||||
actor->priv->needs_compute_resource_scale = TRUE;
|
|
||||||
return CLUTTER_ACTOR_TRAVERSE_VISIT_CONTINUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
_clutter_actor_queue_update_resource_scale_recursive (ClutterActor *self)
|
|
||||||
{
|
|
||||||
_clutter_actor_traverse (self,
|
|
||||||
CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST,
|
|
||||||
queue_update_resource_scale_cb,
|
|
||||||
NULL,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
clutter_actor_update_resource_scale (ClutterActor *self)
|
|
||||||
{
|
|
||||||
ClutterActorPrivate *priv;
|
|
||||||
float resource_scale;
|
|
||||||
float old_resource_scale;
|
|
||||||
priv = self->priv;
|
|
||||||
|
|
||||||
g_return_val_if_fail (priv->needs_compute_resource_scale, FALSE);
|
|
||||||
|
|
||||||
old_resource_scale = priv->resource_scale;
|
|
||||||
priv->resource_scale = -1.0f;
|
|
||||||
|
|
||||||
if (_clutter_actor_compute_resource_scale (self, &resource_scale))
|
|
||||||
{
|
|
||||||
priv->resource_scale = resource_scale;
|
|
||||||
priv->needs_compute_resource_scale = FALSE;
|
|
||||||
|
|
||||||
return fabsf (old_resource_scale - resource_scale) > FLT_EPSILON;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_actor_ensure_resource_scale (ClutterActor *self)
|
|
||||||
{
|
|
||||||
ClutterActorPrivate *priv = self->priv;
|
|
||||||
|
|
||||||
if (!priv->needs_compute_resource_scale)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (clutter_actor_update_resource_scale (self))
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_RESOURCE_SCALE]);
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
|
||||||
_clutter_actor_get_real_resource_scale (ClutterActor *self,
|
|
||||||
gfloat *resource_scale)
|
|
||||||
{
|
|
||||||
ClutterActorPrivate *priv = self->priv;
|
|
||||||
|
|
||||||
clutter_actor_ensure_resource_scale (self);
|
|
||||||
|
|
||||||
if (!priv->needs_compute_resource_scale)
|
|
||||||
{
|
|
||||||
*resource_scale = priv->resource_scale;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
*resource_scale = -1.0f;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_actor_get_resource_scale:
|
|
||||||
* @self: A #ClutterActor
|
|
||||||
* @resource_scale: (out): return location for the resource scale
|
|
||||||
*
|
|
||||||
* Retrieves the resource scale for this actor, if available.
|
|
||||||
*
|
|
||||||
* The resource scale refers to the scale the actor should use for its resources.
|
|
||||||
* For example if an actor draws a a picture of size 100 x 100 in the stage
|
|
||||||
* coordinate space, it should use a texture of twice the size (i.e. 200 x 200)
|
|
||||||
* if the resource scale is 2.
|
|
||||||
*
|
|
||||||
* The resource scale is determined by calculating the highest #ClutterStageView
|
|
||||||
* scale the actor will get painted on.
|
|
||||||
*
|
|
||||||
* Returns: TRUE if resource scale is set for the actor, otherwise FALSE
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
clutter_actor_get_resource_scale (ClutterActor *self,
|
|
||||||
gfloat *resource_scale)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE);
|
|
||||||
g_return_val_if_fail (resource_scale != NULL, FALSE);
|
|
||||||
|
|
||||||
if (_clutter_actor_get_real_resource_scale (self, resource_scale))
|
|
||||||
{
|
|
||||||
*resource_scale = ceilf (*resource_scale);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_actor_has_overlaps:
|
* clutter_actor_has_overlaps:
|
||||||
* @self: A #ClutterActor
|
* @self: A #ClutterActor
|
||||||
@@ -18643,10 +18454,6 @@ clutter_actor_set_margin_top (ClutterActor *self,
|
|||||||
g_return_if_fail (margin >= 0.f);
|
g_return_if_fail (margin >= 0.f);
|
||||||
|
|
||||||
info = _clutter_actor_get_layout_info_or_defaults (self);
|
info = _clutter_actor_get_layout_info_or_defaults (self);
|
||||||
|
|
||||||
if (info->margin.top == margin)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_TOP],
|
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_TOP],
|
||||||
info->margin.top,
|
info->margin.top,
|
||||||
margin);
|
margin);
|
||||||
@@ -18691,10 +18498,6 @@ clutter_actor_set_margin_bottom (ClutterActor *self,
|
|||||||
g_return_if_fail (margin >= 0.f);
|
g_return_if_fail (margin >= 0.f);
|
||||||
|
|
||||||
info = _clutter_actor_get_layout_info_or_defaults (self);
|
info = _clutter_actor_get_layout_info_or_defaults (self);
|
||||||
|
|
||||||
if (info->margin.bottom == margin)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_BOTTOM],
|
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_BOTTOM],
|
||||||
info->margin.bottom,
|
info->margin.bottom,
|
||||||
margin);
|
margin);
|
||||||
@@ -18739,10 +18542,6 @@ clutter_actor_set_margin_left (ClutterActor *self,
|
|||||||
g_return_if_fail (margin >= 0.f);
|
g_return_if_fail (margin >= 0.f);
|
||||||
|
|
||||||
info = _clutter_actor_get_layout_info_or_defaults (self);
|
info = _clutter_actor_get_layout_info_or_defaults (self);
|
||||||
|
|
||||||
if (info->margin.left == margin)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_LEFT],
|
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_LEFT],
|
||||||
info->margin.left,
|
info->margin.left,
|
||||||
margin);
|
margin);
|
||||||
@@ -18787,10 +18586,6 @@ clutter_actor_set_margin_right (ClutterActor *self,
|
|||||||
g_return_if_fail (margin >= 0.f);
|
g_return_if_fail (margin >= 0.f);
|
||||||
|
|
||||||
info = _clutter_actor_get_layout_info_or_defaults (self);
|
info = _clutter_actor_get_layout_info_or_defaults (self);
|
||||||
|
|
||||||
if (info->margin.right == margin)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_RIGHT],
|
_clutter_actor_create_transition (self, obj_props[PROP_MARGIN_RIGHT],
|
||||||
info->margin.right,
|
info->margin.right,
|
||||||
margin);
|
margin);
|
||||||
|
|||||||
@@ -236,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);
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -34,14 +34,23 @@
|
|||||||
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,6 +49,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterClone, g_object_unref)
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterColorizeEffect, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterColorizeEffect, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterConstraint, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterConstraint, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterContainer, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterContainer, g_object_unref)
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterContent, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeformEffect, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeformEffect, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDesaturateEffect, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDesaturateEffect, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeviceManager, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeviceManager, g_object_unref)
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
#include <clutter/clutter-backend.h>
|
#include <clutter/clutter-backend.h>
|
||||||
#include <clutter/clutter-device-manager.h>
|
#include <clutter/clutter-device-manager.h>
|
||||||
#include <clutter/clutter-keymap.h>
|
|
||||||
#include <clutter/clutter-stage-window.h>
|
#include <clutter/clutter-stage-window.h>
|
||||||
|
|
||||||
#include "clutter-event-translator.h"
|
#include "clutter-event-translator.h"
|
||||||
@@ -61,8 +60,6 @@ struct _ClutterBackend
|
|||||||
GList *event_translators;
|
GList *event_translators;
|
||||||
|
|
||||||
ClutterInputMethod *input_method;
|
ClutterInputMethod *input_method;
|
||||||
|
|
||||||
ClutterKeymap *keymap;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _ClutterBackendClass
|
struct _ClutterBackendClass
|
||||||
@@ -107,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);
|
||||||
@@ -160,6 +155,8 @@ void _clutter_backend_reset_cogl_framebuffer (Clutter
|
|||||||
|
|
||||||
void clutter_set_allowed_drivers (const char *drivers);
|
void clutter_set_allowed_drivers (const char *drivers);
|
||||||
|
|
||||||
|
void clutter_try_set_windowing_backend (const char *drivers);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_BACKEND_PRIVATE_H__ */
|
#endif /* __CLUTTER_BACKEND_PRIVATE_H__ */
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -427,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");
|
||||||
@@ -574,18 +577,6 @@ clutter_backend_real_get_device_manager (ClutterBackend *backend)
|
|||||||
return backend->device_manager;
|
return backend->device_manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ClutterKeymap *
|
|
||||||
clutter_backend_real_get_keymap (ClutterBackend *backend)
|
|
||||||
{
|
|
||||||
if (G_UNLIKELY (backend->keymap == NULL))
|
|
||||||
{
|
|
||||||
g_critical ("No keymap available, expect broken keyboard input");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return backend->keymap;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
clutter_backend_real_translate_event (ClutterBackend *backend,
|
clutter_backend_real_translate_event (ClutterBackend *backend,
|
||||||
gpointer native,
|
gpointer native,
|
||||||
@@ -684,7 +675,6 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
|||||||
klass->translate_event = clutter_backend_real_translate_event;
|
klass->translate_event = clutter_backend_real_translate_event;
|
||||||
klass->create_context = clutter_backend_real_create_context;
|
klass->create_context = clutter_backend_real_create_context;
|
||||||
klass->get_features = clutter_backend_real_get_features;
|
klass->get_features = clutter_backend_real_get_features;
|
||||||
klass->get_keymap = clutter_backend_real_get_keymap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -900,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
|
||||||
@@ -1005,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)
|
||||||
{
|
{
|
||||||
@@ -1094,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)
|
||||||
{
|
{
|
||||||
@@ -1176,17 +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);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -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__ */
|
||||||
|
|||||||
@@ -1146,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);
|
||||||
|
|
||||||
|
|||||||
@@ -150,8 +150,8 @@ 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,
|
||||||
@@ -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.
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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,7 +123,7 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
|||||||
g_signal_new (I_("attached"),
|
g_signal_new (I_("attached"),
|
||||||
G_TYPE_FROM_INTERFACE (iface),
|
G_TYPE_FROM_INTERFACE (iface),
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (ClutterContentInterface, attached),
|
G_STRUCT_OFFSET (ClutterContentIface, attached),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
_clutter_marshal_VOID__OBJECT,
|
_clutter_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
@@ -148,7 +143,7 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
|||||||
g_signal_new (I_("detached"),
|
g_signal_new (I_("detached"),
|
||||||
G_TYPE_FROM_INTERFACE (iface),
|
G_TYPE_FROM_INTERFACE (iface),
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (ClutterContentInterface, detached),
|
G_STRUCT_OFFSET (ClutterContentIface, detached),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
_clutter_marshal_VOID__OBJECT,
|
_clutter_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
@@ -193,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
|
||||||
@@ -243,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
|
||||||
@@ -277,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
|
||||||
@@ -306,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
|
||||||
|
|||||||
@@ -34,12 +34,23 @@
|
|||||||
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,14 +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
|
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,
|
||||||
@@ -42,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
|
||||||
@@ -83,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
|
||||||
|
|
||||||
|
|||||||
@@ -7,24 +7,38 @@
|
|||||||
#include "deprecated/clutter-alpha.h"
|
#include "deprecated/clutter-alpha.h"
|
||||||
#include "deprecated/clutter-animatable.h"
|
#include "deprecated/clutter-animatable.h"
|
||||||
#include "deprecated/clutter-animation.h"
|
#include "deprecated/clutter-animation.h"
|
||||||
|
#include "deprecated/clutter-animator.h"
|
||||||
|
#include "deprecated/clutter-backend.h"
|
||||||
#include "deprecated/clutter-behaviour.h"
|
#include "deprecated/clutter-behaviour.h"
|
||||||
#include "deprecated/clutter-behaviour-depth.h"
|
#include "deprecated/clutter-behaviour-depth.h"
|
||||||
|
#include "deprecated/clutter-behaviour-ellipse.h"
|
||||||
#include "deprecated/clutter-behaviour-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-box.h"
|
||||||
#include "deprecated/clutter-cairo-texture.h"
|
#include "deprecated/clutter-cairo-texture.h"
|
||||||
#include "deprecated/clutter-container.h"
|
#include "deprecated/clutter-container.h"
|
||||||
|
#include "deprecated/clutter-frame-source.h"
|
||||||
#include "deprecated/clutter-group.h"
|
#include "deprecated/clutter-group.h"
|
||||||
|
#include "deprecated/clutter-input-device.h"
|
||||||
#include "deprecated/clutter-keysyms.h"
|
#include "deprecated/clutter-keysyms.h"
|
||||||
|
#include "deprecated/clutter-list-model.h"
|
||||||
#include "deprecated/clutter-main.h"
|
#include "deprecated/clutter-main.h"
|
||||||
|
#include "deprecated/clutter-media.h"
|
||||||
|
#include "deprecated/clutter-model.h"
|
||||||
#include "deprecated/clutter-rectangle.h"
|
#include "deprecated/clutter-rectangle.h"
|
||||||
|
#include "deprecated/clutter-score.h"
|
||||||
|
#include "deprecated/clutter-shader.h"
|
||||||
#include "deprecated/clutter-stage-manager.h"
|
#include "deprecated/clutter-stage-manager.h"
|
||||||
#include "deprecated/clutter-stage.h"
|
#include "deprecated/clutter-stage.h"
|
||||||
#include "deprecated/clutter-state.h"
|
#include "deprecated/clutter-state.h"
|
||||||
#include "deprecated/clutter-table-layout.h"
|
#include "deprecated/clutter-table-layout.h"
|
||||||
#include "deprecated/clutter-texture.h"
|
#include "deprecated/clutter-texture.h"
|
||||||
#include "deprecated/clutter-timeline.h"
|
#include "deprecated/clutter-timeline.h"
|
||||||
|
#include "deprecated/clutter-timeout-pool.h"
|
||||||
|
#include "deprecated/clutter-util.h"
|
||||||
|
|
||||||
#undef __CLUTTER_DEPRECATED_H_INSIDE__
|
#undef __CLUTTER_DEPRECATED_H_INSIDE__
|
||||||
|
|
||||||
|
|||||||
@@ -167,10 +167,6 @@ struct _ClutterInputDeviceClass
|
|||||||
gboolean (* is_grouped) (ClutterInputDevice *device,
|
gboolean (* is_grouped) (ClutterInputDevice *device,
|
||||||
ClutterInputDevice *other_device);
|
ClutterInputDevice *other_device);
|
||||||
|
|
||||||
gboolean (* get_physical_size) (ClutterInputDevice *device,
|
|
||||||
gdouble *width,
|
|
||||||
gdouble *height);
|
|
||||||
|
|
||||||
/* Keyboard accessbility */
|
/* Keyboard accessbility */
|
||||||
void (* process_kbd_a11y_event) (ClutterEvent *event,
|
void (* process_kbd_a11y_event) (ClutterEvent *event,
|
||||||
ClutterInputDevice *device,
|
ClutterInputDevice *device,
|
||||||
|
|||||||
@@ -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 */
|
||||||
@@ -289,8 +284,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Deprecated: 1.22: Use #cairo_font_options_t instead
|
* Deprecated: 1.22: Use #cairo_font_options_t instead
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_FONT >*/
|
typedef enum { /*< prefix=CLUTTER_FONT >*/
|
||||||
{
|
|
||||||
CLUTTER_FONT_MIPMAPPING = (1 << 0),
|
CLUTTER_FONT_MIPMAPPING = (1 << 0),
|
||||||
CLUTTER_FONT_HINTING = (1 << 1)
|
CLUTTER_FONT_HINTING = (1 << 1)
|
||||||
} ClutterFontFlags;
|
} ClutterFontFlags;
|
||||||
@@ -306,8 +300,7 @@ typedef enum /*< prefix=CLUTTER_FONT >*/
|
|||||||
*
|
*
|
||||||
* 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
|
||||||
@@ -322,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;
|
||||||
@@ -358,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,
|
||||||
@@ -425,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,
|
||||||
@@ -458,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,
|
||||||
@@ -479,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;
|
||||||
@@ -504,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
|
||||||
@@ -522,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
|
||||||
@@ -540,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;
|
||||||
@@ -566,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,
|
||||||
@@ -592,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,
|
||||||
@@ -612,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;
|
||||||
|
|
||||||
@@ -629,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
|
||||||
@@ -647,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
|
||||||
@@ -706,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,
|
||||||
@@ -771,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,
|
||||||
@@ -789,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,
|
||||||
@@ -835,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,
|
||||||
@@ -881,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,
|
||||||
@@ -900,8 +875,7 @@ typedef enum /*< prefix=CLUTTER_SCROLL >*/
|
|||||||
*
|
*
|
||||||
* Since: 0.4
|
* Since: 0.4
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_STAGE_STATE_FULLSCREEN = (1 << 1),
|
CLUTTER_STAGE_STATE_FULLSCREEN = (1 << 1),
|
||||||
CLUTTER_STAGE_STATE_OFFSCREEN = (1 << 2),
|
CLUTTER_STAGE_STATE_OFFSCREEN = (1 << 2),
|
||||||
CLUTTER_STAGE_STATE_ACTIVATED = (1 << 3)
|
CLUTTER_STAGE_STATE_ACTIVATED = (1 << 3)
|
||||||
@@ -910,7 +884,7 @@ typedef enum
|
|||||||
/**
|
/**
|
||||||
* ClutterFeatureFlags:
|
* ClutterFeatureFlags:
|
||||||
* @CLUTTER_FEATURE_TEXTURE_NPOT: Set if NPOTS textures supported.
|
* @CLUTTER_FEATURE_TEXTURE_NPOT: Set if NPOTS textures supported.
|
||||||
* @CLUTTER_FEATURE_SWAP_THROTTLE: Set if backend throttles buffer swaps.
|
* @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)
|
||||||
@@ -929,7 +903,7 @@ typedef enum
|
|||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
CLUTTER_FEATURE_TEXTURE_NPOT = (1 << 2),
|
CLUTTER_FEATURE_TEXTURE_NPOT = (1 << 2),
|
||||||
CLUTTER_FEATURE_SWAP_THROTTLE = (1 << 3),
|
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),
|
||||||
@@ -953,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;
|
||||||
@@ -981,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,
|
||||||
@@ -1010,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
|
||||||
@@ -1036,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,
|
||||||
@@ -1064,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,
|
||||||
@@ -1082,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
|
||||||
@@ -1100,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,
|
||||||
@@ -1121,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,
|
||||||
@@ -1147,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
|
||||||
@@ -1169,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 */
|
||||||
@@ -1194,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
|
||||||
@@ -1210,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;
|
||||||
@@ -1230,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,
|
||||||
@@ -1261,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,
|
||||||
@@ -1293,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,
|
||||||
@@ -1314,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
|
||||||
@@ -1340,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,
|
||||||
@@ -1371,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
|
||||||
@@ -1387,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;
|
||||||
@@ -1404,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,
|
||||||
@@ -1425,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,
|
||||||
@@ -1444,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,
|
||||||
@@ -1467,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;
|
||||||
@@ -1484,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
|
||||||
@@ -1508,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
|
||||||
@@ -1545,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,
|
||||||
@@ -1568,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,
|
||||||
@@ -1587,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
|
||||||
@@ -1609,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,
|
||||||
@@ -1621,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,
|
||||||
@@ -1647,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,
|
||||||
@@ -1664,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,
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ G_BEGIN_DECLS
|
|||||||
typedef struct _ClutterEventTranslator ClutterEventTranslator;
|
typedef struct _ClutterEventTranslator ClutterEventTranslator;
|
||||||
typedef struct _ClutterEventTranslatorIface ClutterEventTranslatorIface;
|
typedef struct _ClutterEventTranslatorIface ClutterEventTranslatorIface;
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_TRANSLATE_CONTINUE,
|
CLUTTER_TRANSLATE_CONTINUE,
|
||||||
CLUTTER_TRANSLATE_REMOVE,
|
CLUTTER_TRANSLATE_REMOVE,
|
||||||
CLUTTER_TRANSLATE_QUEUE
|
CLUTTER_TRANSLATE_QUEUE
|
||||||
|
|||||||
@@ -772,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
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -261,7 +238,6 @@ clutter_image_set_data (ClutterImage *image,
|
|||||||
}
|
}
|
||||||
|
|
||||||
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
||||||
update_image_size (image);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -330,7 +306,6 @@ clutter_image_set_bytes (ClutterImage *image,
|
|||||||
}
|
}
|
||||||
|
|
||||||
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
||||||
update_image_size (image);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -424,7 +399,6 @@ clutter_image_set_area (ClutterImage *image,
|
|||||||
}
|
}
|
||||||
|
|
||||||
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
clutter_content_invalidate (CLUTTER_CONTENT (image));
|
||||||
update_image_size (image);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -2284,15 +2284,3 @@ clutter_input_device_is_grouped (ClutterInputDevice *device,
|
|||||||
|
|
||||||
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->is_grouped (device, other_device);
|
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->is_grouped (device, other_device);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
clutter_input_device_get_physical_size (ClutterInputDevice *device,
|
|
||||||
gdouble *width,
|
|
||||||
gdouble *height)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
|
||||||
|
|
||||||
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->get_physical_size (device,
|
|
||||||
width,
|
|
||||||
height);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -171,10 +171,6 @@ void clutter_input_device_set_mapping_mode (ClutterInputDev
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_input_device_is_grouped (ClutterInputDevice *device,
|
gboolean clutter_input_device_is_grouped (ClutterInputDevice *device,
|
||||||
ClutterInputDevice *other_device);
|
ClutterInputDevice *other_device);
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean clutter_input_device_get_physical_size (ClutterInputDevice *device,
|
|
||||||
gdouble *width,
|
|
||||||
gdouble *height);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|||||||
@@ -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,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 */
|
|
||||||
@@ -142,7 +142,6 @@ static const GDebugKey clutter_paint_debug_keys[] = {
|
|||||||
{ "disable-offscreen-redirect", CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT },
|
{ "disable-offscreen-redirect", CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT },
|
||||||
{ "continuous-redraw", CLUTTER_DEBUG_CONTINUOUS_REDRAW },
|
{ "continuous-redraw", CLUTTER_DEBUG_CONTINUOUS_REDRAW },
|
||||||
{ "paint-deform-tiles", CLUTTER_DEBUG_PAINT_DEFORM_TILES },
|
{ "paint-deform-tiles", CLUTTER_DEBUG_PAINT_DEFORM_TILES },
|
||||||
{ "damage-region", CLUTTER_DEBUG_PAINT_DAMAGE_REGION },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -193,6 +192,17 @@ clutter_config_read_from_key_file (GKeyFile *keyfile)
|
|||||||
if (!g_key_file_has_group (keyfile, ENVIRONMENT_GROUP))
|
if (!g_key_file_has_group (keyfile, ENVIRONMENT_GROUP))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
str_value =
|
||||||
|
g_key_file_get_string (keyfile, ENVIRONMENT_GROUP,
|
||||||
|
"Backends",
|
||||||
|
&key_error);
|
||||||
|
if (key_error != NULL)
|
||||||
|
g_clear_error (&key_error);
|
||||||
|
else
|
||||||
|
clutter_try_set_windowing_backend (str_value);
|
||||||
|
|
||||||
|
g_free (str_value);
|
||||||
|
|
||||||
str_value =
|
str_value =
|
||||||
g_key_file_get_string (keyfile, ENVIRONMENT_GROUP,
|
g_key_file_get_string (keyfile, ENVIRONMENT_GROUP,
|
||||||
"Drivers",
|
"Drivers",
|
||||||
@@ -244,6 +254,16 @@ clutter_config_read_from_key_file (GKeyFile *keyfile)
|
|||||||
else
|
else
|
||||||
clutter_enable_accessibility = bool_value;
|
clutter_enable_accessibility = bool_value;
|
||||||
|
|
||||||
|
bool_value =
|
||||||
|
g_key_file_get_boolean (keyfile, ENVIRONMENT_GROUP,
|
||||||
|
"SyncToVblank",
|
||||||
|
&key_error);
|
||||||
|
|
||||||
|
if (key_error != NULL)
|
||||||
|
g_clear_error (&key_error);
|
||||||
|
else
|
||||||
|
clutter_sync_to_vblank = bool_value;
|
||||||
|
|
||||||
int_value =
|
int_value =
|
||||||
g_key_file_get_integer (keyfile, ENVIRONMENT_GROUP,
|
g_key_file_get_integer (keyfile, ENVIRONMENT_GROUP,
|
||||||
"DefaultFps",
|
"DefaultFps",
|
||||||
@@ -1345,9 +1365,6 @@ clutter_init_real (GError **error)
|
|||||||
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS | CLUTTER_DEBUG_DISABLE_CULLING;
|
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS | CLUTTER_DEBUG_DISABLE_CULLING;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION)
|
|
||||||
g_message ("Enabling damaged region");
|
|
||||||
|
|
||||||
/* this will take care of initializing Cogl's state and
|
/* this will take care of initializing Cogl's state and
|
||||||
* query the GL machinery for features
|
* query the GL machinery for features
|
||||||
*/
|
*/
|
||||||
@@ -1470,6 +1487,10 @@ pre_parse_hook (GOptionContext *context,
|
|||||||
if (env_string)
|
if (env_string)
|
||||||
clutter_use_fuzzy_picking = TRUE;
|
clutter_use_fuzzy_picking = TRUE;
|
||||||
|
|
||||||
|
env_string = g_getenv ("CLUTTER_VBLANK");
|
||||||
|
if (g_strcmp0 (env_string, "none") == 0)
|
||||||
|
clutter_sync_to_vblank = FALSE;
|
||||||
|
|
||||||
return _clutter_backend_pre_parse (backend, error);
|
return _clutter_backend_pre_parse (backend, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3610,6 +3631,12 @@ _clutter_set_sync_to_vblank (gboolean sync_to_vblank)
|
|||||||
clutter_sync_to_vblank = !!sync_to_vblank;
|
clutter_sync_to_vblank = !!sync_to_vblank;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
_clutter_get_sync_to_vblank (void)
|
||||||
|
{
|
||||||
|
return clutter_sync_to_vblank;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_clutter_debug_messagev (const char *format,
|
_clutter_debug_messagev (const char *format,
|
||||||
va_list var_args)
|
va_list var_args)
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -109,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
|
||||||
|
|
||||||
@@ -299,10 +298,10 @@ master_clock_next_frame_delay (ClutterMasterClockDefault *master_clock)
|
|||||||
* (NB: if there aren't even any timelines running then the master clock will
|
* (NB: if there aren't even any timelines running then the master clock will
|
||||||
* be completely stopped in master_clock_is_running())
|
* be completely stopped in master_clock_is_running())
|
||||||
*/
|
*/
|
||||||
if (clutter_feature_available (CLUTTER_FEATURE_SWAP_THROTTLE) &&
|
if (clutter_feature_available (CLUTTER_FEATURE_SYNC_TO_VBLANK) &&
|
||||||
!master_clock->idle)
|
!master_clock->idle)
|
||||||
{
|
{
|
||||||
CLUTTER_NOTE (SCHEDULER, "swap throttling available and updated stages");
|
CLUTTER_NOTE (SCHEDULER, "vblank available and updated stages");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -690,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);
|
||||||
|
|||||||
@@ -34,6 +34,9 @@
|
|||||||
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);
|
||||||
|
|
||||||
@@ -49,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);
|
||||||
|
new_height = height + (2 * yexpand);
|
||||||
|
|
||||||
|
cogl_matrix_scale (&projection,
|
||||||
|
width / new_width,
|
||||||
|
height / new_height,
|
||||||
1);
|
1);
|
||||||
|
}
|
||||||
|
|
||||||
cogl_set_projection_matrix (&projection);
|
cogl_set_projection_matrix (&projection);
|
||||||
|
|
||||||
@@ -409,26 +382,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 +428,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 +663,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
|
||||||
|
|||||||
@@ -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,19 +1031,6 @@ clutter_paint_node_to_json (ClutterPaintNode *node)
|
|||||||
json_builder_end_array (builder);
|
json_builder_end_array (builder);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PAINT_OP_MULTITEX_RECT:
|
|
||||||
json_builder_set_member_name (builder, "texrect");
|
|
||||||
json_builder_begin_array (builder);
|
|
||||||
|
|
||||||
for (j = 0; i < op->multitex_coords->len; j++)
|
|
||||||
{
|
|
||||||
float coord = g_array_index (op->multitex_coords, float, j);
|
|
||||||
json_builder_add_double_value (builder, coord);
|
|
||||||
}
|
|
||||||
|
|
||||||
json_builder_end_array (builder);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PAINT_OP_PATH:
|
case PAINT_OP_PATH:
|
||||||
json_builder_set_member_name (builder, "path");
|
json_builder_set_member_name (builder, "path");
|
||||||
json_builder_add_int_value (builder, (gint64) op->op.path);
|
json_builder_add_int_value (builder, (gint64) op->op.path);
|
||||||
|
|||||||
@@ -49,9 +49,6 @@ ClutterPaintNode * clutter_paint_node_ref (Clutter
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_paint_node_unref (ClutterPaintNode *node);
|
void clutter_paint_node_unref (ClutterPaintNode *node);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void clutter_paint_node_paint (ClutterPaintNode *node);
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_paint_node_set_name (ClutterPaintNode *node,
|
void clutter_paint_node_set_name (ClutterPaintNode *node,
|
||||||
const char *name);
|
const char *name);
|
||||||
@@ -70,12 +67,6 @@ void clutter_paint_node_add_texture_rectangle (Clutter
|
|||||||
float x_2,
|
float x_2,
|
||||||
float y_2);
|
float y_2);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void clutter_paint_node_add_multitexture_rectangle (ClutterPaintNode *node,
|
|
||||||
const ClutterActorBox *rect,
|
|
||||||
const float *text_coords,
|
|
||||||
unsigned int text_coords_len);
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_paint_node_add_path (ClutterPaintNode *node,
|
void clutter_paint_node_add_path (ClutterPaintNode *node,
|
||||||
CoglPath *path);
|
CoglPath *path);
|
||||||
|
|||||||
@@ -83,13 +83,16 @@ _clutter_paint_node_init_types (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Root node
|
* Root node, private
|
||||||
*
|
*
|
||||||
* any frame can only have a since RootNode instance for each
|
* any frame can only have a since RootNode instance for each
|
||||||
* top-level actor.
|
* top-level actor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define clutter_root_node_get_type clutter_root_node_get_type
|
#define clutter_root_node_get_type _clutter_root_node_get_type
|
||||||
|
|
||||||
|
typedef struct _ClutterRootNode ClutterRootNode;
|
||||||
|
typedef struct _ClutterPaintNodeClass ClutterRootNodeClass;
|
||||||
|
|
||||||
struct _ClutterRootNode
|
struct _ClutterRootNode
|
||||||
{
|
{
|
||||||
@@ -108,8 +111,6 @@ clutter_root_node_pre_draw (ClutterPaintNode *node)
|
|||||||
{
|
{
|
||||||
ClutterRootNode *rnode = (ClutterRootNode *) node;
|
ClutterRootNode *rnode = (ClutterRootNode *) node;
|
||||||
|
|
||||||
cogl_push_framebuffer (rnode->framebuffer);
|
|
||||||
|
|
||||||
cogl_framebuffer_clear (rnode->framebuffer,
|
cogl_framebuffer_clear (rnode->framebuffer,
|
||||||
rnode->clear_flags,
|
rnode->clear_flags,
|
||||||
&rnode->clear_color);
|
&rnode->clear_color);
|
||||||
@@ -120,7 +121,6 @@ clutter_root_node_pre_draw (ClutterPaintNode *node)
|
|||||||
static void
|
static void
|
||||||
clutter_root_node_post_draw (ClutterPaintNode *node)
|
clutter_root_node_post_draw (ClutterPaintNode *node)
|
||||||
{
|
{
|
||||||
cogl_pop_framebuffer ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -158,13 +158,13 @@ clutter_root_node_init (ClutterRootNode *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ClutterPaintNode *
|
ClutterPaintNode *
|
||||||
clutter_root_node_new (CoglFramebuffer *framebuffer,
|
_clutter_root_node_new (CoglFramebuffer *framebuffer,
|
||||||
const ClutterColor *clear_color,
|
const ClutterColor *clear_color,
|
||||||
CoglBufferBit clear_flags)
|
CoglBufferBit clear_flags)
|
||||||
{
|
{
|
||||||
ClutterRootNode *res;
|
ClutterRootNode *res;
|
||||||
|
|
||||||
res = _clutter_paint_node_create (CLUTTER_TYPE_ROOT_NODE);
|
res = _clutter_paint_node_create (_clutter_root_node_get_type ());
|
||||||
|
|
||||||
cogl_color_init_from_4ub (&res->clear_color,
|
cogl_color_init_from_4ub (&res->clear_color,
|
||||||
clear_color->red,
|
clear_color->red,
|
||||||
@@ -431,17 +431,6 @@ clutter_pipeline_node_draw (ClutterPaintNode *node)
|
|||||||
op->op.texrect[7]);
|
op->op.texrect[7]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PAINT_OP_MULTITEX_RECT:
|
|
||||||
cogl_framebuffer_draw_multitextured_rectangle (cogl_get_draw_framebuffer (),
|
|
||||||
pnode->pipeline,
|
|
||||||
op->op.texrect[0],
|
|
||||||
op->op.texrect[1],
|
|
||||||
op->op.texrect[2],
|
|
||||||
op->op.texrect[3],
|
|
||||||
(float*) op->multitex_coords->data,
|
|
||||||
op->multitex_coords->len);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PAINT_OP_PATH:
|
case PAINT_OP_PATH:
|
||||||
cogl_path_fill (op->op.path);
|
cogl_path_fill (op->op.path);
|
||||||
break;
|
break;
|
||||||
@@ -838,7 +827,6 @@ clutter_text_node_draw (ClutterPaintNode *node)
|
|||||||
cogl_framebuffer_pop_clip (fb);
|
cogl_framebuffer_pop_clip (fb);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PAINT_OP_MULTITEX_RECT:
|
|
||||||
case PAINT_OP_PATH:
|
case PAINT_OP_PATH:
|
||||||
case PAINT_OP_PRIMITIVE:
|
case PAINT_OP_PRIMITIVE:
|
||||||
case PAINT_OP_INVALID:
|
case PAINT_OP_INVALID:
|
||||||
@@ -1004,7 +992,6 @@ clutter_clip_node_pre_draw (ClutterPaintNode *node)
|
|||||||
retval = TRUE;
|
retval = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PAINT_OP_MULTITEX_RECT:
|
|
||||||
case PAINT_OP_PRIMITIVE:
|
case PAINT_OP_PRIMITIVE:
|
||||||
case PAINT_OP_INVALID:
|
case PAINT_OP_INVALID:
|
||||||
break;
|
break;
|
||||||
@@ -1038,7 +1025,6 @@ clutter_clip_node_post_draw (ClutterPaintNode *node)
|
|||||||
cogl_framebuffer_pop_clip (fb);
|
cogl_framebuffer_pop_clip (fb);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PAINT_OP_MULTITEX_RECT:
|
|
||||||
case PAINT_OP_PRIMITIVE:
|
case PAINT_OP_PRIMITIVE:
|
||||||
case PAINT_OP_INVALID:
|
case PAINT_OP_INVALID:
|
||||||
break;
|
break;
|
||||||
@@ -1194,17 +1180,6 @@ clutter_layer_node_post_draw (ClutterPaintNode *node)
|
|||||||
cogl_pop_source ();
|
cogl_pop_source ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PAINT_OP_MULTITEX_RECT:
|
|
||||||
cogl_framebuffer_draw_multitextured_rectangle (cogl_get_draw_framebuffer (),
|
|
||||||
lnode->state,
|
|
||||||
op->op.texrect[0],
|
|
||||||
op->op.texrect[1],
|
|
||||||
op->op.texrect[2],
|
|
||||||
op->op.texrect[3],
|
|
||||||
(float*) op->multitex_coords->data,
|
|
||||||
op->multitex_coords->len);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PAINT_OP_PATH:
|
case PAINT_OP_PATH:
|
||||||
cogl_push_source (lnode->state);
|
cogl_push_source (lnode->state);
|
||||||
cogl_path_fill (op->op.path);
|
cogl_path_fill (op->op.path);
|
||||||
|
|||||||
@@ -143,26 +143,6 @@ CLUTTER_EXPORT
|
|||||||
ClutterPaintNode * clutter_text_node_new (PangoLayout *layout,
|
ClutterPaintNode * clutter_text_node_new (PangoLayout *layout,
|
||||||
const ClutterColor *color);
|
const ClutterColor *color);
|
||||||
|
|
||||||
#define CLUTTER_TYPE_ROOT_NODE (clutter_root_node_get_type ())
|
|
||||||
#define CLUTTER_ROOT_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ROOT_NODE, ClutterRootNode))
|
|
||||||
#define CLUTTER_IS_ROOT_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ROOT_NODE))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterRootNode:
|
|
||||||
*
|
|
||||||
* The #ClutterRootNode structure is an opaque
|
|
||||||
* type whose members cannot be directly accessed.
|
|
||||||
*/
|
|
||||||
typedef struct _ClutterRootNode ClutterRootNode;
|
|
||||||
typedef struct _ClutterPaintNodeClass ClutterRootNodeClass;
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
GType clutter_root_node_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
ClutterPaintNode * clutter_root_node_new (CoglFramebuffer *framebuffer,
|
|
||||||
const ClutterColor *clear_color,
|
|
||||||
CoglBufferBit clear_flags);
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_PAINT_NODES_H__ */
|
#endif /* __CLUTTER_PAINT_NODES_H__ */
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
#include "clutter-paint-volume-private.h"
|
#include "clutter-paint-volume-private.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
#include "clutter-stage-private.h"
|
#include "clutter-stage-private.h"
|
||||||
#include "clutter-actor-box-private.h"
|
|
||||||
|
|
||||||
G_DEFINE_BOXED_TYPE (ClutterPaintVolume, clutter_paint_volume,
|
G_DEFINE_BOXED_TYPE (ClutterPaintVolume, clutter_paint_volume,
|
||||||
clutter_paint_volume_copy,
|
clutter_paint_volume_copy,
|
||||||
@@ -1139,6 +1138,8 @@ _clutter_paint_volume_get_stage_paint_box (ClutterPaintVolume *pv,
|
|||||||
CoglMatrix modelview;
|
CoglMatrix modelview;
|
||||||
CoglMatrix projection;
|
CoglMatrix projection;
|
||||||
float viewport[4];
|
float viewport[4];
|
||||||
|
float width;
|
||||||
|
float height;
|
||||||
|
|
||||||
_clutter_paint_volume_copy_static (pv, &projected_pv);
|
_clutter_paint_volume_copy_static (pv, &projected_pv);
|
||||||
|
|
||||||
@@ -1163,22 +1164,50 @@ _clutter_paint_volume_get_stage_paint_box (ClutterPaintVolume *pv,
|
|||||||
|
|
||||||
_clutter_paint_volume_get_bounding_box (&projected_pv, box);
|
_clutter_paint_volume_get_bounding_box (&projected_pv, box);
|
||||||
|
|
||||||
if (pv->is_2d && pv->actor &&
|
/* The aim here is that for a given rectangle defined with floating point
|
||||||
clutter_actor_get_z_position (pv->actor) == 0)
|
* coordinates we want to determine a stable quantized size in pixels
|
||||||
{
|
* that doesn't vary due to the original box's sub-pixel position.
|
||||||
/* If the volume/actor are perfectly 2D, take the bounding box as
|
*
|
||||||
* good. We won't need to add any extra room for sub-pixel positioning
|
* The reason this is important is because effects will use this
|
||||||
* in this case.
|
* 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.
|
||||||
*/
|
*/
|
||||||
clutter_paint_volume_free (&projected_pv);
|
width = box->x2 - box->x1;
|
||||||
box->x1 = CLUTTER_NEARBYINT (box->x1);
|
height = box->y2 - box->y1;
|
||||||
box->y1 = CLUTTER_NEARBYINT (box->y1);
|
width = CLUTTER_NEARBYINT (width);
|
||||||
box->x2 = CLUTTER_NEARBYINT (box->x2);
|
height = CLUTTER_NEARBYINT (height);
|
||||||
box->y2 = CLUTTER_NEARBYINT (box->y2);
|
/* XXX: NB the width/height may now be up to 0.5px too small so we
|
||||||
return;
|
* 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. */
|
||||||
|
|
||||||
_clutter_actor_box_enlarge_for_effects (box);
|
/* 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_paint_volume_free (&projected_pv);
|
clutter_paint_volume_free (&projected_pv);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -961,7 +961,6 @@ clutter_pan_action_get_motion_delta (ClutterPanAction *self,
|
|||||||
return clutter_pan_action_get_interpolated_delta (self, delta_x, delta_y);
|
return clutter_pan_action_get_interpolated_delta (self, delta_x, delta_y);
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
return 0.0f;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,9 +69,6 @@ typedef struct _ClutterVertex4 ClutterVertex4;
|
|||||||
#define CLUTTER_ACTOR_IN_REPARENT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_REPARENT) != FALSE)
|
#define CLUTTER_ACTOR_IN_REPARENT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_REPARENT) != FALSE)
|
||||||
#define CLUTTER_ACTOR_IN_PAINT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PAINT) != FALSE)
|
#define CLUTTER_ACTOR_IN_PAINT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PAINT) != FALSE)
|
||||||
#define CLUTTER_ACTOR_IN_RELAYOUT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_RELAYOUT) != FALSE)
|
#define CLUTTER_ACTOR_IN_RELAYOUT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_RELAYOUT) != FALSE)
|
||||||
#define CLUTTER_ACTOR_IN_PREF_WIDTH(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PREF_WIDTH) != FALSE)
|
|
||||||
#define CLUTTER_ACTOR_IN_PREF_HEIGHT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PREF_HEIGHT) != FALSE)
|
|
||||||
#define CLUTTER_ACTOR_IN_PREF_SIZE(a) ((CLUTTER_PRIVATE_FLAGS (a) & (CLUTTER_IN_PREF_HEIGHT|CLUTTER_IN_PREF_WIDTH)) != FALSE)
|
|
||||||
|
|
||||||
#define CLUTTER_PARAM_READABLE (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)
|
#define CLUTTER_PARAM_READABLE (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)
|
||||||
#define CLUTTER_PARAM_WRITABLE (G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)
|
#define CLUTTER_PARAM_WRITABLE (G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)
|
||||||
@@ -94,24 +91,21 @@ typedef struct _ClutterVertex4 ClutterVertex4;
|
|||||||
* because it will break for negative numbers. */
|
* because it will break for negative numbers. */
|
||||||
#define CLUTTER_NEARBYINT(x) ((int) ((x) < 0.0f ? (x) - 0.5f : (x) + 0.5f))
|
#define CLUTTER_NEARBYINT(x) ((int) ((x) < 0.0f ? (x) - 0.5f : (x) + 0.5f))
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_ACTOR_UNUSED_FLAG = 0,
|
CLUTTER_ACTOR_UNUSED_FLAG = 0,
|
||||||
|
|
||||||
CLUTTER_IN_DESTRUCTION = 1 << 0,
|
CLUTTER_IN_DESTRUCTION = 1 << 0,
|
||||||
CLUTTER_IS_TOPLEVEL = 1 << 1,
|
CLUTTER_IS_TOPLEVEL = 1 << 1,
|
||||||
CLUTTER_IN_REPARENT = 1 << 2,
|
CLUTTER_IN_REPARENT = 1 << 2,
|
||||||
CLUTTER_IN_PREF_WIDTH = 1 << 3,
|
|
||||||
CLUTTER_IN_PREF_HEIGHT = 1 << 4,
|
|
||||||
|
|
||||||
/* Used to avoid recursion */
|
/* Used to avoid recursion */
|
||||||
CLUTTER_IN_PAINT = 1 << 5,
|
CLUTTER_IN_PAINT = 1 << 3,
|
||||||
|
|
||||||
/* Used to avoid recursion */
|
/* Used to avoid recursion */
|
||||||
CLUTTER_IN_RELAYOUT = 1 << 6,
|
CLUTTER_IN_RELAYOUT = 1 << 4,
|
||||||
|
|
||||||
/* a flag for internal children of Containers (DEPRECATED) */
|
/* a flag for internal children of Containers (DEPRECATED) */
|
||||||
CLUTTER_INTERNAL_CHILD = 1 << 7
|
CLUTTER_INTERNAL_CHILD = 1 << 5
|
||||||
} ClutterPrivateFlags;
|
} ClutterPrivateFlags;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -208,7 +202,7 @@ gboolean _clutter_feature_init (GError **error);
|
|||||||
|
|
||||||
/* Diagnostic mode */
|
/* Diagnostic mode */
|
||||||
gboolean _clutter_diagnostic_enabled (void);
|
gboolean _clutter_diagnostic_enabled (void);
|
||||||
void _clutter_diagnostic_message (const char *fmt, ...) G_GNUC_PRINTF (1, 2);
|
void _clutter_diagnostic_message (const char *fmt, ...);
|
||||||
|
|
||||||
/* Picking code */
|
/* Picking code */
|
||||||
guint _clutter_pixel_to_id (guchar pixel[4]);
|
guint _clutter_pixel_to_id (guchar pixel[4]);
|
||||||
@@ -246,17 +240,6 @@ void _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
|||||||
ClutterVertex *vertices_out,
|
ClutterVertex *vertices_out,
|
||||||
int n_vertices);
|
int n_vertices);
|
||||||
|
|
||||||
void _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
|
||||||
ClutterRect *dest);
|
|
||||||
|
|
||||||
void _clutter_util_rectangle_int_extents (const ClutterRect *src,
|
|
||||||
cairo_rectangle_int_t *dest);
|
|
||||||
|
|
||||||
void _clutter_util_rectangle_offset (const cairo_rectangle_int_t *src,
|
|
||||||
int x,
|
|
||||||
int y,
|
|
||||||
cairo_rectangle_int_t *dest);
|
|
||||||
|
|
||||||
void _clutter_util_rectangle_union (const cairo_rectangle_int_t *src1,
|
void _clutter_util_rectangle_union (const cairo_rectangle_int_t *src1,
|
||||||
const cairo_rectangle_int_t *src2,
|
const cairo_rectangle_int_t *src2,
|
||||||
cairo_rectangle_int_t *dest);
|
cairo_rectangle_int_t *dest);
|
||||||
|
|||||||
@@ -79,8 +79,7 @@ typedef void (* ClutterScriptConnectFunc) (ClutterScript *script,
|
|||||||
*
|
*
|
||||||
* Since: 0.6
|
* Since: 0.6
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_SCRIPT_ERROR_INVALID_TYPE_FUNCTION,
|
CLUTTER_SCRIPT_ERROR_INVALID_TYPE_FUNCTION,
|
||||||
CLUTTER_SCRIPT_ERROR_INVALID_PROPERTY,
|
CLUTTER_SCRIPT_ERROR_INVALID_PROPERTY,
|
||||||
CLUTTER_SCRIPT_ERROR_INVALID_VALUE
|
CLUTTER_SCRIPT_ERROR_INVALID_VALUE
|
||||||
|
|||||||
@@ -84,9 +84,9 @@ enum
|
|||||||
static GParamSpec *obj_props[PROP_LAST] = { NULL, };
|
static GParamSpec *obj_props[PROP_LAST] = { NULL, };
|
||||||
static GParamSpec *animatable_props[ANIM_PROP_LAST] = { NULL, };
|
static GParamSpec *animatable_props[ANIM_PROP_LAST] = { NULL, };
|
||||||
|
|
||||||
static ClutterAnimatableInterface *parent_animatable_iface = NULL;
|
static ClutterAnimatableIface *parent_animatable_iface = NULL;
|
||||||
|
|
||||||
static void clutter_animatable_iface_init (ClutterAnimatableInterface *iface);
|
static void clutter_animatable_iface_init (ClutterAnimatableIface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (ClutterScrollActor, clutter_scroll_actor, CLUTTER_TYPE_ACTOR,
|
G_DEFINE_TYPE_WITH_CODE (ClutterScrollActor, clutter_scroll_actor, CLUTTER_TYPE_ACTOR,
|
||||||
G_ADD_PRIVATE (ClutterScrollActor)
|
G_ADD_PRIVATE (ClutterScrollActor)
|
||||||
@@ -240,7 +240,7 @@ clutter_scroll_actor_get_initial_state (ClutterAnimatable *animatable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
|
clutter_animatable_iface_init (ClutterAnimatableIface *iface)
|
||||||
{
|
{
|
||||||
parent_animatable_iface = g_type_interface_peek_parent (iface);
|
parent_animatable_iface = g_type_interface_peek_parent (iface);
|
||||||
|
|
||||||
|
|||||||
@@ -333,7 +333,6 @@ clutter_shader_effect_create_shader (ClutterShaderEffect *self)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
return COGL_INVALID_HANDLE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ const ClutterPlane *_clutter_stage_get_clip (ClutterStage *stage);
|
|||||||
ClutterStageQueueRedrawEntry *_clutter_stage_queue_actor_redraw (ClutterStage *stage,
|
ClutterStageQueueRedrawEntry *_clutter_stage_queue_actor_redraw (ClutterStage *stage,
|
||||||
ClutterStageQueueRedrawEntry *entry,
|
ClutterStageQueueRedrawEntry *entry,
|
||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
const ClutterPaintVolume *clip);
|
ClutterPaintVolume *clip);
|
||||||
void _clutter_stage_queue_redraw_entry_invalidate (ClutterStageQueueRedrawEntry *entry);
|
void _clutter_stage_queue_redraw_entry_invalidate (ClutterStageQueueRedrawEntry *entry);
|
||||||
|
|
||||||
CoglFramebuffer *_clutter_stage_get_active_framebuffer (ClutterStage *stage);
|
CoglFramebuffer *_clutter_stage_get_active_framebuffer (ClutterStage *stage);
|
||||||
@@ -124,16 +124,11 @@ gboolean _clutter_stage_update_state (ClutterStage *stag
|
|||||||
|
|
||||||
void _clutter_stage_set_scale_factor (ClutterStage *stage,
|
void _clutter_stage_set_scale_factor (ClutterStage *stage,
|
||||||
int factor);
|
int factor);
|
||||||
gboolean _clutter_stage_get_max_view_scale_factor_for_rect (ClutterStage *stage,
|
|
||||||
ClutterRect *rect,
|
|
||||||
float *view_scale);
|
|
||||||
|
|
||||||
void _clutter_stage_presented (ClutterStage *stage,
|
void _clutter_stage_presented (ClutterStage *stage,
|
||||||
CoglFrameEvent frame_event,
|
CoglFrameEvent frame_event,
|
||||||
ClutterFrameInfo *frame_info);
|
ClutterFrameInfo *frame_info);
|
||||||
|
|
||||||
GList * _clutter_stage_peek_stage_views (ClutterStage *stage);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_STAGE_PRIVATE_H__ */
|
#endif /* __CLUTTER_STAGE_PRIVATE_H__ */
|
||||||
|
|||||||
@@ -6,13 +6,9 @@
|
|||||||
#include "clutter-stage-window.h"
|
#include "clutter-stage-window.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
|
|
||||||
/**
|
#define clutter_stage_window_get_type _clutter_stage_window_get_type
|
||||||
* SECTION:clutter-stage-window
|
|
||||||
* @short_description: Handles the implementation for ClutterStage
|
typedef ClutterStageWindowIface ClutterStageWindowInterface;
|
||||||
*
|
|
||||||
* #ClutterStageWindow is an interface that provides the implementation for the
|
|
||||||
* #ClutterStage actor, abstracting away the specifics of the windowing system.
|
|
||||||
*/
|
|
||||||
|
|
||||||
G_DEFINE_INTERFACE (ClutterStageWindow, clutter_stage_window, G_TYPE_OBJECT);
|
G_DEFINE_INTERFACE (ClutterStageWindow, clutter_stage_window, G_TYPE_OBJECT);
|
||||||
|
|
||||||
@@ -40,12 +36,6 @@ clutter_stage_window_default_init (ClutterStageWindowInterface *iface)
|
|||||||
g_object_interface_install_property (iface, pspec);
|
g_object_interface_install_property (iface, pspec);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* _clutter_stage_window_get_wrapper:
|
|
||||||
* @window: a #ClutterStageWindow object
|
|
||||||
*
|
|
||||||
* Returns the pointer to the #ClutterStage it's part of.
|
|
||||||
*/
|
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
_clutter_stage_window_get_wrapper (ClutterStageWindow *window)
|
_clutter_stage_window_get_wrapper (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
@@ -56,7 +46,7 @@ void
|
|||||||
_clutter_stage_window_set_title (ClutterStageWindow *window,
|
_clutter_stage_window_set_title (ClutterStageWindow *window,
|
||||||
const gchar *title)
|
const gchar *title)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||||
|
|
||||||
if (iface->set_title)
|
if (iface->set_title)
|
||||||
iface->set_title (window, title);
|
iface->set_title (window, title);
|
||||||
@@ -66,7 +56,7 @@ void
|
|||||||
_clutter_stage_window_set_fullscreen (ClutterStageWindow *window,
|
_clutter_stage_window_set_fullscreen (ClutterStageWindow *window,
|
||||||
gboolean is_fullscreen)
|
gboolean is_fullscreen)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||||
|
|
||||||
if (iface->set_fullscreen)
|
if (iface->set_fullscreen)
|
||||||
iface->set_fullscreen (window, is_fullscreen);
|
iface->set_fullscreen (window, is_fullscreen);
|
||||||
@@ -76,7 +66,7 @@ void
|
|||||||
_clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
|
_clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
|
||||||
gboolean is_visible)
|
gboolean is_visible)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||||
|
|
||||||
if (iface->set_cursor_visible)
|
if (iface->set_cursor_visible)
|
||||||
iface->set_cursor_visible (window, is_visible);
|
iface->set_cursor_visible (window, is_visible);
|
||||||
@@ -134,7 +124,7 @@ void
|
|||||||
_clutter_stage_window_schedule_update (ClutterStageWindow *window,
|
_clutter_stage_window_schedule_update (ClutterStageWindow *window,
|
||||||
int sync_delay)
|
int sync_delay)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
||||||
|
|
||||||
@@ -148,18 +138,10 @@ _clutter_stage_window_schedule_update (ClutterStageWindow *window,
|
|||||||
iface->schedule_update (window, sync_delay);
|
iface->schedule_update (window, sync_delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* _clutter_stage_window_get_update_time:
|
|
||||||
* @window: a #ClutterStageWindow object
|
|
||||||
*
|
|
||||||
* See _clutter_stage_get_update_time() for more info.
|
|
||||||
*
|
|
||||||
* Returns: The timestamp of the update time
|
|
||||||
*/
|
|
||||||
gint64
|
gint64
|
||||||
_clutter_stage_window_get_update_time (ClutterStageWindow *window)
|
_clutter_stage_window_get_update_time (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), 0);
|
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), 0);
|
||||||
|
|
||||||
@@ -173,16 +155,10 @@ _clutter_stage_window_get_update_time (ClutterStageWindow *window)
|
|||||||
return iface->get_update_time (window);
|
return iface->get_update_time (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* _clutter_stage_window_clear_update_time:
|
|
||||||
* @window: a #ClutterStageWindow object
|
|
||||||
*
|
|
||||||
* Clears the update time. See _clutter_stage_clear_update_time() for more info.
|
|
||||||
*/
|
|
||||||
void
|
void
|
||||||
_clutter_stage_window_clear_update_time (ClutterStageWindow *window)
|
_clutter_stage_window_clear_update_time (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
||||||
|
|
||||||
@@ -200,7 +176,7 @@ void
|
|||||||
_clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
|
_clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
|
||||||
cairo_rectangle_int_t *stage_clip)
|
cairo_rectangle_int_t *stage_clip)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
||||||
|
|
||||||
@@ -220,7 +196,7 @@ _clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
|
|||||||
gboolean
|
gboolean
|
||||||
_clutter_stage_window_has_redraw_clips (ClutterStageWindow *window)
|
_clutter_stage_window_has_redraw_clips (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
||||||
|
|
||||||
@@ -242,7 +218,7 @@ _clutter_stage_window_has_redraw_clips (ClutterStageWindow *window)
|
|||||||
gboolean
|
gboolean
|
||||||
_clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window)
|
_clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
||||||
|
|
||||||
@@ -257,7 +233,7 @@ gboolean
|
|||||||
_clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
|
_clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
|
||||||
cairo_rectangle_int_t *stage_clip)
|
cairo_rectangle_int_t *stage_clip)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
||||||
|
|
||||||
@@ -272,7 +248,7 @@ void
|
|||||||
_clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
|
_clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
|
||||||
gboolean accept_focus)
|
gboolean accept_focus)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
||||||
|
|
||||||
@@ -284,7 +260,7 @@ _clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
|
|||||||
void
|
void
|
||||||
_clutter_stage_window_redraw (ClutterStageWindow *window)
|
_clutter_stage_window_redraw (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
||||||
|
|
||||||
@@ -299,7 +275,7 @@ _clutter_stage_window_get_dirty_pixel (ClutterStageWindow *window,
|
|||||||
ClutterStageView *view,
|
ClutterStageView *view,
|
||||||
int *x, int *y)
|
int *x, int *y)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
|
|
||||||
*x = 0;
|
*x = 0;
|
||||||
*y = 0;
|
*y = 0;
|
||||||
@@ -314,7 +290,7 @@ _clutter_stage_window_get_dirty_pixel (ClutterStageWindow *window,
|
|||||||
gboolean
|
gboolean
|
||||||
_clutter_stage_window_can_clip_redraws (ClutterStageWindow *window)
|
_clutter_stage_window_can_clip_redraws (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
||||||
|
|
||||||
@@ -328,7 +304,7 @@ _clutter_stage_window_can_clip_redraws (ClutterStageWindow *window)
|
|||||||
GList *
|
GList *
|
||||||
_clutter_stage_window_get_views (ClutterStageWindow *window)
|
_clutter_stage_window_get_views (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||||
|
|
||||||
return iface->get_views (window);
|
return iface->get_views (window);
|
||||||
}
|
}
|
||||||
@@ -336,7 +312,7 @@ _clutter_stage_window_get_views (ClutterStageWindow *window)
|
|||||||
void
|
void
|
||||||
_clutter_stage_window_finish_frame (ClutterStageWindow *window)
|
_clutter_stage_window_finish_frame (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||||
|
|
||||||
if (iface->finish_frame)
|
if (iface->finish_frame)
|
||||||
iface->finish_frame (window);
|
iface->finish_frame (window);
|
||||||
@@ -345,7 +321,7 @@ _clutter_stage_window_finish_frame (ClutterStageWindow *window)
|
|||||||
int64_t
|
int64_t
|
||||||
_clutter_stage_window_get_frame_counter (ClutterStageWindow *window)
|
_clutter_stage_window_get_frame_counter (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||||
|
|
||||||
if (iface->get_frame_counter)
|
if (iface->get_frame_counter)
|
||||||
return iface->get_frame_counter (window);
|
return iface->get_frame_counter (window);
|
||||||
|
|||||||
@@ -7,21 +7,30 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define CLUTTER_TYPE_STAGE_WINDOW (clutter_stage_window_get_type ())
|
#define CLUTTER_TYPE_STAGE_WINDOW (_clutter_stage_window_get_type ())
|
||||||
|
#define CLUTTER_STAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_STAGE_WINDOW, ClutterStageWindow))
|
||||||
CLUTTER_EXPORT
|
#define CLUTTER_IS_STAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_STAGE_WINDOW))
|
||||||
G_DECLARE_INTERFACE (ClutterStageWindow, clutter_stage_window,
|
#define CLUTTER_STAGE_WINDOW_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_STAGE_WINDOW, ClutterStageWindowIface))
|
||||||
CLUTTER, STAGE_WINDOW,
|
|
||||||
GObject)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ClutterStageWindowInterface: (skip)
|
* ClutterStageWindow: (skip)
|
||||||
|
*
|
||||||
|
* #ClutterStageWindow is an opaque structure
|
||||||
|
* whose members should not be accessed directly
|
||||||
|
*
|
||||||
|
* Since: 0.8
|
||||||
|
*/
|
||||||
|
typedef struct _ClutterStageWindow ClutterStageWindow; /* dummy */
|
||||||
|
typedef struct _ClutterStageWindowIface ClutterStageWindowIface;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ClutterStageWindowIface: (skip)
|
||||||
*
|
*
|
||||||
* The interface implemented by backends for stage windows
|
* The interface implemented by backends for stage windows
|
||||||
*
|
*
|
||||||
* Since: 0.8
|
* Since: 0.8
|
||||||
*/
|
*/
|
||||||
struct _ClutterStageWindowInterface
|
struct _ClutterStageWindowIface
|
||||||
{
|
{
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
GTypeInterface parent_iface;
|
GTypeInterface parent_iface;
|
||||||
@@ -79,6 +88,9 @@ struct _ClutterStageWindowInterface
|
|||||||
void (* finish_frame) (ClutterStageWindow *stage_window);
|
void (* finish_frame) (ClutterStageWindow *stage_window);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
GType _clutter_stage_window_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
ClutterActor * _clutter_stage_window_get_wrapper (ClutterStageWindow *window);
|
ClutterActor * _clutter_stage_window_get_wrapper (ClutterStageWindow *window);
|
||||||
|
|
||||||
void _clutter_stage_window_set_title (ClutterStageWindow *window,
|
void _clutter_stage_window_set_title (ClutterStageWindow *window,
|
||||||
|
|||||||
@@ -36,10 +36,10 @@
|
|||||||
* using clutter_actor_destroy(), which will take care of destroying all the
|
* using clutter_actor_destroy(), which will take care of destroying all the
|
||||||
* actors contained inside them.
|
* actors contained inside them.
|
||||||
*
|
*
|
||||||
* #ClutterStage is a proxy actor, wrapping the backend-specific implementation
|
* #ClutterStage is a proxy actor, wrapping the backend-specific
|
||||||
* (a #StageWindow) of the windowing system. It is possible to subclass
|
* implementation of the windowing system. It is possible to subclass
|
||||||
* #ClutterStage, as long as every overridden virtual function chains up to the
|
* #ClutterStage, as long as every overridden virtual function chains up to
|
||||||
* parent class corresponding function.
|
* the parent class corresponding function.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "clutter-build-config.h"
|
#include "clutter-build-config.h"
|
||||||
@@ -87,8 +87,7 @@
|
|||||||
*
|
*
|
||||||
* A series of hints that enable or disable behaviours on the stage
|
* A series of hints that enable or disable behaviours on the stage
|
||||||
*/
|
*/
|
||||||
typedef enum /*< prefix=CLUTTER_STAGE >*/
|
typedef enum { /*< prefix=CLUTTER_STAGE >*/
|
||||||
{
|
|
||||||
CLUTTER_STAGE_HINT_NONE = 0,
|
CLUTTER_STAGE_HINT_NONE = 0,
|
||||||
|
|
||||||
CLUTTER_STAGE_NO_CLEAR_ON_PAINT = 1 << 0
|
CLUTTER_STAGE_NO_CLEAR_ON_PAINT = 1 << 0
|
||||||
@@ -202,12 +201,6 @@ static const ClutterColor default_stage_color = { 255, 255, 255, 255 };
|
|||||||
|
|
||||||
static void clutter_stage_maybe_finish_queue_redraws (ClutterStage *stage);
|
static void clutter_stage_maybe_finish_queue_redraws (ClutterStage *stage);
|
||||||
static void free_queue_redraw_entry (ClutterStageQueueRedrawEntry *entry);
|
static void free_queue_redraw_entry (ClutterStageQueueRedrawEntry *entry);
|
||||||
static void capture_view_into (ClutterStage *stage,
|
|
||||||
gboolean paint,
|
|
||||||
ClutterStageView *view,
|
|
||||||
cairo_rectangle_int_t *rect,
|
|
||||||
uint8_t *data,
|
|
||||||
int stride);
|
|
||||||
|
|
||||||
static void clutter_container_iface_init (ClutterContainerIface *iface);
|
static void clutter_container_iface_init (ClutterContainerIface *iface);
|
||||||
|
|
||||||
@@ -1281,44 +1274,45 @@ clutter_stage_real_queue_relayout (ClutterActor *self)
|
|||||||
parent_class->queue_relayout (self);
|
parent_class->queue_relayout (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static void
|
||||||
clutter_stage_real_queue_redraw (ClutterActor *actor,
|
clutter_stage_real_queue_redraw (ClutterActor *actor,
|
||||||
ClutterActor *leaf,
|
ClutterActor *leaf)
|
||||||
ClutterPaintVolume *redraw_clip)
|
|
||||||
{
|
{
|
||||||
ClutterStage *stage = CLUTTER_STAGE (actor);
|
ClutterStage *stage = CLUTTER_STAGE (actor);
|
||||||
ClutterStageWindow *stage_window;
|
ClutterStageWindow *stage_window;
|
||||||
|
ClutterPaintVolume *redraw_clip;
|
||||||
ClutterActorBox bounding_box;
|
ClutterActorBox bounding_box;
|
||||||
ClutterActorBox intersection_box;
|
ClutterActorBox intersection_box;
|
||||||
cairo_rectangle_int_t geom, stage_clip;
|
cairo_rectangle_int_t geom, stage_clip;
|
||||||
|
|
||||||
if (CLUTTER_ACTOR_IN_DESTRUCTION (actor))
|
if (CLUTTER_ACTOR_IN_DESTRUCTION (actor))
|
||||||
return TRUE;
|
return;
|
||||||
|
|
||||||
/* If the backend can't do anything with redraw clips (e.g. it already knows
|
/* If the backend can't do anything with redraw clips (e.g. it already knows
|
||||||
* it needs to redraw everything anyway) then don't spend time transforming
|
* it needs to redraw everything anyway) then don't spend time transforming
|
||||||
* any clip volume into stage coordinates... */
|
* any clip volume into stage coordinates... */
|
||||||
stage_window = _clutter_stage_get_window (stage);
|
stage_window = _clutter_stage_get_window (stage);
|
||||||
if (stage_window == NULL)
|
if (stage_window == NULL)
|
||||||
return TRUE;
|
return;
|
||||||
|
|
||||||
if (_clutter_stage_window_ignoring_redraw_clips (stage_window))
|
if (_clutter_stage_window_ignoring_redraw_clips (stage_window))
|
||||||
{
|
{
|
||||||
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
|
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
|
||||||
return FALSE;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert the clip volume into stage coordinates and then into an
|
/* Convert the clip volume into stage coordinates and then into an
|
||||||
* axis aligned stage coordinates bounding box...
|
* axis aligned stage coordinates bounding box...
|
||||||
*/
|
*/
|
||||||
|
redraw_clip = _clutter_actor_get_queue_redraw_clip (leaf);
|
||||||
if (redraw_clip == NULL)
|
if (redraw_clip == NULL)
|
||||||
{
|
{
|
||||||
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
|
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
|
||||||
return FALSE;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (redraw_clip->is_empty)
|
if (redraw_clip->is_empty)
|
||||||
return TRUE;
|
return;
|
||||||
|
|
||||||
_clutter_paint_volume_get_stage_paint_box (redraw_clip,
|
_clutter_paint_volume_get_stage_paint_box (redraw_clip,
|
||||||
stage,
|
stage,
|
||||||
@@ -1334,7 +1328,7 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
|
|||||||
/* There is no need to track degenerate/empty redraw clips */
|
/* There is no need to track degenerate/empty redraw clips */
|
||||||
if (intersection_box.x2 <= intersection_box.x1 ||
|
if (intersection_box.x2 <= intersection_box.x1 ||
|
||||||
intersection_box.y2 <= intersection_box.y1)
|
intersection_box.y2 <= intersection_box.y1)
|
||||||
return TRUE;
|
return;
|
||||||
|
|
||||||
/* when converting to integer coordinates make sure we round the edges of the
|
/* when converting to integer coordinates make sure we round the edges of the
|
||||||
* clip rectangle outwards... */
|
* clip rectangle outwards... */
|
||||||
@@ -1344,7 +1338,6 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
|
|||||||
stage_clip.height = intersection_box.y2 - stage_clip.y;
|
stage_clip.height = intersection_box.y2 - stage_clip.y;
|
||||||
|
|
||||||
_clutter_stage_window_add_redraw_clip (stage_window, &stage_clip);
|
_clutter_stage_window_add_redraw_clip (stage_window, &stage_clip);
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@@ -1481,8 +1474,8 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
|
|||||||
if (G_LIKELY (!(clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS)))
|
if (G_LIKELY (!(clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS)))
|
||||||
{
|
{
|
||||||
CLUTTER_NOTE (PICK, "Pushing pick scissor clip x: %d, y: %d, 1x1",
|
CLUTTER_NOTE (PICK, "Pushing pick scissor clip x: %d, y: %d, 1x1",
|
||||||
(int) (dirty_x * fb_scale),
|
(int) dirty_x * fb_scale,
|
||||||
(int) (dirty_y * fb_scale));
|
(int) dirty_y * fb_scale);
|
||||||
cogl_framebuffer_push_scissor_clip (fb, dirty_x * fb_scale, dirty_y * fb_scale, 1, 1);
|
cogl_framebuffer_push_scissor_clip (fb, dirty_x * fb_scale, dirty_y * fb_scale, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1502,7 +1495,7 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
|
|||||||
read_x = dirty_x * fb_scale;
|
read_x = dirty_x * fb_scale;
|
||||||
read_y = dirty_y * fb_scale;
|
read_y = dirty_y * fb_scale;
|
||||||
|
|
||||||
CLUTTER_NOTE (PICK, "Performing pick at %i,%i on view %dx%d+%d+%d s: %f",
|
CLUTTER_NOTE (PICK, "Performing pick at %i,%i on view %dx%d+%d+%d s: %d",
|
||||||
x, y,
|
x, y,
|
||||||
view_layout.width, view_layout.height,
|
view_layout.width, view_layout.height,
|
||||||
view_layout.x, view_layout.y, fb_scale);
|
view_layout.x, view_layout.y, fb_scale);
|
||||||
@@ -1518,8 +1511,7 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
|
|||||||
* are drawn offscreen (as we never swap buffers)
|
* are drawn offscreen (as we never swap buffers)
|
||||||
*/
|
*/
|
||||||
context->pick_mode = mode;
|
context->pick_mode = mode;
|
||||||
|
_clutter_stage_paint_view (stage, view, NULL);
|
||||||
clutter_stage_do_paint_view (stage, view, NULL);
|
|
||||||
context->pick_mode = CLUTTER_PICK_NONE;
|
context->pick_mode = CLUTTER_PICK_NONE;
|
||||||
|
|
||||||
/* Read the color of the screen co-ords pixel. RGBA_8888_PRE is used
|
/* Read the color of the screen co-ords pixel. RGBA_8888_PRE is used
|
||||||
@@ -2256,8 +2248,6 @@ clutter_stage_class_init (ClutterStageClass *klass)
|
|||||||
* @stage: the stage that received the event
|
* @stage: the stage that received the event
|
||||||
* @frame_event: a #CoglFrameEvent
|
* @frame_event: a #CoglFrameEvent
|
||||||
* @frame_info: a #ClutterFrameInfo
|
* @frame_info: a #ClutterFrameInfo
|
||||||
*
|
|
||||||
* Signals that the #ClutterStage was presented on the screen to the user.
|
|
||||||
*/
|
*/
|
||||||
stage_signals[PRESENTED] =
|
stage_signals[PRESENTED] =
|
||||||
g_signal_new (I_("presented"),
|
g_signal_new (I_("presented"),
|
||||||
@@ -2749,7 +2739,7 @@ clutter_stage_set_fullscreen (ClutterStage *stage,
|
|||||||
if (priv->is_fullscreen != fullscreen)
|
if (priv->is_fullscreen != fullscreen)
|
||||||
{
|
{
|
||||||
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
|
|
||||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
||||||
|
|
||||||
@@ -2814,7 +2804,7 @@ clutter_stage_set_user_resizable (ClutterStage *stage,
|
|||||||
&& priv->is_user_resizable != resizable)
|
&& priv->is_user_resizable != resizable)
|
||||||
{
|
{
|
||||||
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
|
|
||||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
||||||
if (iface->set_user_resizable)
|
if (iface->set_user_resizable)
|
||||||
@@ -2863,7 +2853,7 @@ clutter_stage_show_cursor (ClutterStage *stage)
|
|||||||
if (!priv->is_cursor_visible)
|
if (!priv->is_cursor_visible)
|
||||||
{
|
{
|
||||||
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
|
|
||||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
||||||
if (iface->set_cursor_visible)
|
if (iface->set_cursor_visible)
|
||||||
@@ -2896,7 +2886,7 @@ clutter_stage_hide_cursor (ClutterStage *stage)
|
|||||||
if (priv->is_cursor_visible)
|
if (priv->is_cursor_visible)
|
||||||
{
|
{
|
||||||
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
||||||
ClutterStageWindowInterface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
|
|
||||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
||||||
if (iface->set_cursor_visible)
|
if (iface->set_cursor_visible)
|
||||||
@@ -2944,9 +2934,6 @@ clutter_stage_read_pixels (ClutterStage *stage,
|
|||||||
cairo_region_t *clip;
|
cairo_region_t *clip;
|
||||||
cairo_rectangle_int_t clip_rect;
|
cairo_rectangle_int_t clip_rect;
|
||||||
CoglFramebuffer *framebuffer;
|
CoglFramebuffer *framebuffer;
|
||||||
float view_scale;
|
|
||||||
float pixel_width;
|
|
||||||
float pixel_height;
|
|
||||||
uint8_t *pixels;
|
uint8_t *pixels;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
|
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
|
||||||
@@ -2989,15 +2976,10 @@ clutter_stage_read_pixels (ClutterStage *stage,
|
|||||||
cogl_push_framebuffer (framebuffer);
|
cogl_push_framebuffer (framebuffer);
|
||||||
clutter_stage_do_paint_view (stage, view, &clip_rect);
|
clutter_stage_do_paint_view (stage, view, &clip_rect);
|
||||||
|
|
||||||
view_scale = clutter_stage_view_get_scale (view);
|
pixels = g_malloc0 (clip_rect.width * clip_rect.height * 4);
|
||||||
pixel_width = roundf (clip_rect.width * view_scale);
|
|
||||||
pixel_height = roundf (clip_rect.height * view_scale);
|
|
||||||
|
|
||||||
pixels = g_malloc0 (pixel_width * pixel_height * 4);
|
|
||||||
cogl_framebuffer_read_pixels (framebuffer,
|
cogl_framebuffer_read_pixels (framebuffer,
|
||||||
clip_rect.x * view_scale,
|
clip_rect.x, clip_rect.y,
|
||||||
clip_rect.y * view_scale,
|
clip_rect.width, clip_rect.height,
|
||||||
pixel_width, pixel_height,
|
|
||||||
COGL_PIXEL_FORMAT_RGBA_8888,
|
COGL_PIXEL_FORMAT_RGBA_8888,
|
||||||
pixels);
|
pixels);
|
||||||
|
|
||||||
@@ -3645,10 +3627,6 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
|
|||||||
float fb_scale;
|
float fb_scale;
|
||||||
float viewport_offset_x;
|
float viewport_offset_x;
|
||||||
float viewport_offset_y;
|
float viewport_offset_y;
|
||||||
float viewport_x;
|
|
||||||
float viewport_y;
|
|
||||||
float viewport_width;
|
|
||||||
float viewport_height;
|
|
||||||
float z_2d;
|
float z_2d;
|
||||||
|
|
||||||
CLUTTER_NOTE (PAINT,
|
CLUTTER_NOTE (PAINT,
|
||||||
@@ -3661,13 +3639,11 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
|
|||||||
|
|
||||||
viewport_offset_x = view_layout.x * fb_scale;
|
viewport_offset_x = view_layout.x * fb_scale;
|
||||||
viewport_offset_y = view_layout.y * fb_scale;
|
viewport_offset_y = view_layout.y * fb_scale;
|
||||||
viewport_x = roundf (priv->viewport[0] * fb_scale - viewport_offset_x);
|
|
||||||
viewport_y = roundf (priv->viewport[1] * fb_scale - viewport_offset_y);
|
|
||||||
viewport_width = roundf (priv->viewport[2] * fb_scale);
|
|
||||||
viewport_height = roundf (priv->viewport[3] * fb_scale);
|
|
||||||
cogl_framebuffer_set_viewport (fb,
|
cogl_framebuffer_set_viewport (fb,
|
||||||
viewport_x, viewport_y,
|
priv->viewport[0] * fb_scale - viewport_offset_x,
|
||||||
viewport_width, viewport_height);
|
priv->viewport[1] * fb_scale - viewport_offset_y,
|
||||||
|
priv->viewport[2] * fb_scale,
|
||||||
|
priv->viewport[3] * fb_scale);
|
||||||
|
|
||||||
perspective = priv->perspective;
|
perspective = priv->perspective;
|
||||||
|
|
||||||
@@ -3746,17 +3722,6 @@ clutter_stage_ensure_redraw (ClutterStage *stage)
|
|||||||
_clutter_master_clock_start_running (master_clock);
|
_clutter_master_clock_start_running (master_clock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_stage_is_redraw_queued: (skip)
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
clutter_stage_is_redraw_queued (ClutterStage *stage)
|
|
||||||
{
|
|
||||||
ClutterStagePrivate *priv = stage->priv;
|
|
||||||
|
|
||||||
return priv->redraw_pending;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_stage_queue_redraw:
|
* clutter_stage_queue_redraw:
|
||||||
* @stage: the #ClutterStage
|
* @stage: the #ClutterStage
|
||||||
@@ -4017,12 +3982,6 @@ clutter_stage_get_minimum_size (ClutterStage *stage,
|
|||||||
*height_p = (guint) height;
|
*height_p = (guint) height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* _clutter_stage_schedule_update:
|
|
||||||
* @window: a #ClutterStage actor
|
|
||||||
*
|
|
||||||
* Schedules a redraw of the #ClutterStage at the next optimal timestamp.
|
|
||||||
*/
|
|
||||||
void
|
void
|
||||||
_clutter_stage_schedule_update (ClutterStage *stage)
|
_clutter_stage_schedule_update (ClutterStage *stage)
|
||||||
{
|
{
|
||||||
@@ -4039,18 +3998,7 @@ _clutter_stage_schedule_update (ClutterStage *stage)
|
|||||||
stage->priv->sync_delay);
|
stage->priv->sync_delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* Returns the earliest time the stage is ready to update */
|
||||||
* _clutter_stage_get_update_time:
|
|
||||||
* @stage: a #ClutterStage actor
|
|
||||||
*
|
|
||||||
* Returns the earliest time in which the stage is ready to update. The update
|
|
||||||
* time is set when _clutter_stage_schedule_update() is called. This can then
|
|
||||||
* be used by e.g. the #ClutterMasterClock to know when the stage needs to be
|
|
||||||
* redrawn.
|
|
||||||
*
|
|
||||||
* Returns: -1 if no redraw is needed; 0 if the backend doesn't know, or the
|
|
||||||
* timestamp (in microseconds) otherwise.
|
|
||||||
*/
|
|
||||||
gint64
|
gint64
|
||||||
_clutter_stage_get_update_time (ClutterStage *stage)
|
_clutter_stage_get_update_time (ClutterStage *stage)
|
||||||
{
|
{
|
||||||
@@ -4066,13 +4014,6 @@ _clutter_stage_get_update_time (ClutterStage *stage)
|
|||||||
return _clutter_stage_window_get_update_time (stage_window);
|
return _clutter_stage_window_get_update_time (stage_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* _clutter_stage_clear_update_time:
|
|
||||||
* @stage: a #ClutterStage actor
|
|
||||||
*
|
|
||||||
* Resets the update time. Call this after a redraw, so that the update time
|
|
||||||
* can again be updated.
|
|
||||||
*/
|
|
||||||
void
|
void
|
||||||
_clutter_stage_clear_update_time (ClutterStage *stage)
|
_clutter_stage_clear_update_time (ClutterStage *stage)
|
||||||
{
|
{
|
||||||
@@ -4201,7 +4142,7 @@ ClutterStageQueueRedrawEntry *
|
|||||||
_clutter_stage_queue_actor_redraw (ClutterStage *stage,
|
_clutter_stage_queue_actor_redraw (ClutterStage *stage,
|
||||||
ClutterStageQueueRedrawEntry *entry,
|
ClutterStageQueueRedrawEntry *entry,
|
||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
const ClutterPaintVolume *clip)
|
ClutterPaintVolume *clip)
|
||||||
{
|
{
|
||||||
ClutterStagePrivate *priv = stage->priv;
|
ClutterStagePrivate *priv = stage->priv;
|
||||||
|
|
||||||
@@ -4771,33 +4712,62 @@ static void
|
|||||||
capture_view (ClutterStage *stage,
|
capture_view (ClutterStage *stage,
|
||||||
gboolean paint,
|
gboolean paint,
|
||||||
ClutterStageView *view,
|
ClutterStageView *view,
|
||||||
|
cairo_rectangle_int_t *rect,
|
||||||
ClutterCapture *capture)
|
ClutterCapture *capture)
|
||||||
{
|
{
|
||||||
|
CoglFramebuffer *framebuffer;
|
||||||
|
ClutterBackend *backend;
|
||||||
|
CoglContext *context;
|
||||||
cairo_surface_t *image;
|
cairo_surface_t *image;
|
||||||
uint8_t *data;
|
uint8_t *data;
|
||||||
int stride;
|
int stride;
|
||||||
cairo_rectangle_int_t *rect;
|
CoglBitmap *bitmap;
|
||||||
|
cairo_rectangle_int_t view_layout;
|
||||||
float view_scale;
|
float view_scale;
|
||||||
float texture_width;
|
|
||||||
float texture_height;
|
|
||||||
|
|
||||||
rect = &capture->rect;
|
framebuffer = clutter_stage_view_get_framebuffer (view);
|
||||||
|
|
||||||
|
if (paint)
|
||||||
|
{
|
||||||
|
cogl_push_framebuffer (framebuffer);
|
||||||
|
_clutter_stage_maybe_setup_viewport (stage, view);
|
||||||
|
clutter_stage_do_paint_view (stage, view, rect);
|
||||||
|
}
|
||||||
|
|
||||||
view_scale = clutter_stage_view_get_scale (view);
|
view_scale = clutter_stage_view_get_scale (view);
|
||||||
texture_width = roundf (rect->width * view_scale);
|
|
||||||
texture_height = roundf (rect->height * view_scale);
|
|
||||||
image = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
image = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
||||||
texture_width, texture_height);
|
rect->width * view_scale,
|
||||||
|
rect->height * view_scale);
|
||||||
cairo_surface_set_device_scale (image, view_scale, view_scale);
|
cairo_surface_set_device_scale (image, view_scale, view_scale);
|
||||||
|
|
||||||
|
|
||||||
data = cairo_image_surface_get_data (image);
|
data = cairo_image_surface_get_data (image);
|
||||||
stride = cairo_image_surface_get_stride (image);
|
stride = cairo_image_surface_get_stride (image);
|
||||||
|
|
||||||
capture_view_into (stage, paint, view, rect, data, stride);
|
backend = clutter_get_default_backend ();
|
||||||
|
context = clutter_backend_get_cogl_context (backend);
|
||||||
|
bitmap = cogl_bitmap_new_for_data (context,
|
||||||
|
rect->width * view_scale,
|
||||||
|
rect->height * view_scale,
|
||||||
|
CLUTTER_CAIRO_FORMAT_ARGB32,
|
||||||
|
stride,
|
||||||
|
data);
|
||||||
|
|
||||||
|
clutter_stage_view_get_layout (view, &view_layout);
|
||||||
|
|
||||||
|
cogl_framebuffer_read_pixels_into_bitmap (framebuffer,
|
||||||
|
(rect->x - view_layout.x) * view_scale,
|
||||||
|
(rect->y - view_layout.y) * view_scale,
|
||||||
|
COGL_READ_PIXELS_COLOR_BUFFER,
|
||||||
|
bitmap);
|
||||||
|
|
||||||
|
if (paint)
|
||||||
|
cogl_pop_framebuffer ();
|
||||||
|
|
||||||
|
capture->rect = *rect;
|
||||||
capture->image = image;
|
capture->image = image;
|
||||||
|
|
||||||
cairo_surface_mark_dirty (capture->image);
|
cairo_surface_mark_dirty (capture->image);
|
||||||
|
cogl_object_unref (bitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@@ -4813,91 +4783,34 @@ clutter_stage_capture (ClutterStage *stage,
|
|||||||
ClutterCapture *captures;
|
ClutterCapture *captures;
|
||||||
int n_captures;
|
int n_captures;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
|
|
||||||
|
|
||||||
captures = g_new0 (ClutterCapture, g_list_length (views));
|
captures = g_new0 (ClutterCapture, g_list_length (views));
|
||||||
n_captures = 0;
|
n_captures = 0;
|
||||||
|
|
||||||
for (l = views; l; l = l->next)
|
for (l = views; l; l = l->next)
|
||||||
{
|
{
|
||||||
ClutterStageView *view = l->data;
|
ClutterStageView *view = l->data;
|
||||||
ClutterCapture *capture;
|
|
||||||
cairo_rectangle_int_t view_layout;
|
cairo_rectangle_int_t view_layout;
|
||||||
cairo_region_t *region;
|
cairo_region_t *region;
|
||||||
|
cairo_rectangle_int_t view_capture_rect;
|
||||||
|
|
||||||
clutter_stage_view_get_layout (view, &view_layout);
|
clutter_stage_view_get_layout (view, &view_layout);
|
||||||
region = cairo_region_create_rectangle (&view_layout);
|
region = cairo_region_create_rectangle (&view_layout);
|
||||||
cairo_region_intersect_rectangle (region, rect);
|
cairo_region_intersect_rectangle (region, rect);
|
||||||
|
cairo_region_get_extents (region, &view_capture_rect);
|
||||||
capture = &captures[n_captures];
|
|
||||||
cairo_region_get_extents (region, &capture->rect);
|
|
||||||
cairo_region_destroy (region);
|
cairo_region_destroy (region);
|
||||||
|
|
||||||
if (capture->rect.width == 0 || capture->rect.height == 0)
|
if (view_capture_rect.width == 0 || view_capture_rect.height == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
capture_view (stage, paint, view, capture);
|
capture_view (stage, paint, view, &view_capture_rect,
|
||||||
|
&captures[n_captures]);
|
||||||
|
|
||||||
n_captures++;
|
n_captures++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n_captures == 0)
|
|
||||||
g_clear_pointer (&captures, g_free);
|
|
||||||
|
|
||||||
*out_captures = captures;
|
*out_captures = captures;
|
||||||
*out_n_captures = n_captures;
|
*out_n_captures = n_captures;
|
||||||
|
|
||||||
return n_captures > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
|
||||||
clutter_stage_get_capture_final_size (ClutterStage *stage,
|
|
||||||
cairo_rectangle_int_t *rect,
|
|
||||||
int *out_width,
|
|
||||||
int *out_height,
|
|
||||||
float *out_scale)
|
|
||||||
{
|
|
||||||
float max_scale;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
|
|
||||||
|
|
||||||
if (rect)
|
|
||||||
{
|
|
||||||
ClutterRect capture_rect;
|
|
||||||
|
|
||||||
_clutter_util_rect_from_rectangle (rect, &capture_rect);
|
|
||||||
if (!_clutter_stage_get_max_view_scale_factor_for_rect (stage,
|
|
||||||
&capture_rect,
|
|
||||||
&max_scale))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (out_width)
|
|
||||||
*out_width = (gint) roundf (rect->width * max_scale);
|
|
||||||
|
|
||||||
if (out_height)
|
|
||||||
*out_height = (gint) roundf (rect->height * max_scale);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ClutterActorBox alloc;
|
|
||||||
float stage_width, stage_height;
|
|
||||||
|
|
||||||
clutter_actor_get_allocation_box (CLUTTER_ACTOR (stage), &alloc);
|
|
||||||
clutter_actor_box_get_size (&alloc, &stage_width, &stage_height);
|
|
||||||
if (!_clutter_actor_get_real_resource_scale (CLUTTER_ACTOR (stage),
|
|
||||||
&max_scale))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (out_width)
|
|
||||||
*out_width = (gint) roundf (stage_width * max_scale);
|
|
||||||
|
|
||||||
if (out_height)
|
|
||||||
*out_height = (gint) roundf (stage_height * max_scale);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (out_scale)
|
|
||||||
*out_scale = max_scale;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4914,11 +4827,6 @@ capture_view_into (ClutterStage *stage,
|
|||||||
CoglContext *context;
|
CoglContext *context;
|
||||||
CoglBitmap *bitmap;
|
CoglBitmap *bitmap;
|
||||||
cairo_rectangle_int_t view_layout;
|
cairo_rectangle_int_t view_layout;
|
||||||
float view_scale;
|
|
||||||
float texture_width;
|
|
||||||
float texture_height;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
||||||
|
|
||||||
framebuffer = clutter_stage_view_get_framebuffer (view);
|
framebuffer = clutter_stage_view_get_framebuffer (view);
|
||||||
|
|
||||||
@@ -4929,14 +4837,10 @@ capture_view_into (ClutterStage *stage,
|
|||||||
clutter_stage_do_paint_view (stage, view, rect);
|
clutter_stage_do_paint_view (stage, view, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
view_scale = clutter_stage_view_get_scale (view);
|
|
||||||
texture_width = roundf (rect->width * view_scale);
|
|
||||||
texture_height = roundf (rect->height * view_scale);
|
|
||||||
|
|
||||||
backend = clutter_get_default_backend ();
|
backend = clutter_get_default_backend ();
|
||||||
context = clutter_backend_get_cogl_context (backend);
|
context = clutter_backend_get_cogl_context (backend);
|
||||||
bitmap = cogl_bitmap_new_for_data (context,
|
bitmap = cogl_bitmap_new_for_data (context,
|
||||||
texture_width, texture_height,
|
rect->width, rect->height,
|
||||||
CLUTTER_CAIRO_FORMAT_ARGB32,
|
CLUTTER_CAIRO_FORMAT_ARGB32,
|
||||||
stride,
|
stride,
|
||||||
data);
|
data);
|
||||||
@@ -4944,8 +4848,8 @@ capture_view_into (ClutterStage *stage,
|
|||||||
clutter_stage_view_get_layout (view, &view_layout);
|
clutter_stage_view_get_layout (view, &view_layout);
|
||||||
|
|
||||||
cogl_framebuffer_read_pixels_into_bitmap (framebuffer,
|
cogl_framebuffer_read_pixels_into_bitmap (framebuffer,
|
||||||
roundf ((rect->x - view_layout.x) * view_scale),
|
rect->x - view_layout.x,
|
||||||
roundf ((rect->y - view_layout.y) * view_scale),
|
rect->y - view_layout.y,
|
||||||
COGL_READ_PIXELS_COLOR_BUFFER,
|
COGL_READ_PIXELS_COLOR_BUFFER,
|
||||||
bitmap);
|
bitmap);
|
||||||
|
|
||||||
@@ -5054,46 +4958,3 @@ clutter_stage_thaw_updates (ClutterStage *stage)
|
|||||||
_clutter_master_clock_set_paused (master_clock, FALSE);
|
_clutter_master_clock_set_paused (master_clock, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GList *
|
|
||||||
_clutter_stage_peek_stage_views (ClutterStage *stage)
|
|
||||||
{
|
|
||||||
ClutterStagePrivate *priv = stage->priv;
|
|
||||||
|
|
||||||
return _clutter_stage_window_get_views (priv->impl);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
clutter_stage_update_resource_scales (ClutterStage *stage)
|
|
||||||
{
|
|
||||||
_clutter_actor_queue_update_resource_scale_recursive (CLUTTER_ACTOR (stage));
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
|
||||||
_clutter_stage_get_max_view_scale_factor_for_rect (ClutterStage *stage,
|
|
||||||
ClutterRect *rect,
|
|
||||||
float *view_scale)
|
|
||||||
{
|
|
||||||
ClutterStagePrivate *priv = stage->priv;
|
|
||||||
float scale = 0.0f;
|
|
||||||
GList *l;
|
|
||||||
|
|
||||||
for (l = _clutter_stage_window_get_views (priv->impl); l; l = l->next)
|
|
||||||
{
|
|
||||||
ClutterStageView *view = l->data;
|
|
||||||
cairo_rectangle_int_t view_layout;
|
|
||||||
ClutterRect view_rect;
|
|
||||||
|
|
||||||
clutter_stage_view_get_layout (view, &view_layout);
|
|
||||||
_clutter_util_rect_from_rectangle (&view_layout, &view_rect);
|
|
||||||
|
|
||||||
if (clutter_rect_intersection (&view_rect, rect, NULL))
|
|
||||||
scale = MAX (clutter_stage_view_get_scale (view), scale);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (scale == 0.0)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
*view_scale = scale;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -250,9 +250,6 @@ void clutter_stage_ensure_viewport (ClutterStage
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_stage_ensure_redraw (ClutterStage *stage);
|
void clutter_stage_ensure_redraw (ClutterStage *stage);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean clutter_stage_is_redraw_queued (ClutterStage *stage);
|
|
||||||
|
|
||||||
#ifdef CLUTTER_ENABLE_EXPERIMENTAL_API
|
#ifdef CLUTTER_ENABLE_EXPERIMENTAL_API
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_stage_set_sync_delay (ClutterStage *stage,
|
void clutter_stage_set_sync_delay (ClutterStage *stage,
|
||||||
@@ -261,13 +258,6 @@ CLUTTER_EXPORT
|
|||||||
void clutter_stage_skip_sync_delay (ClutterStage *stage);
|
void clutter_stage_skip_sync_delay (ClutterStage *stage);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean clutter_stage_get_capture_final_size (ClutterStage *stage,
|
|
||||||
cairo_rectangle_int_t *rect,
|
|
||||||
int *width,
|
|
||||||
int *height,
|
|
||||||
float *scale);
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_stage_capture (ClutterStage *stage,
|
gboolean clutter_stage_capture (ClutterStage *stage,
|
||||||
gboolean paint,
|
gboolean paint,
|
||||||
|
|||||||
@@ -50,8 +50,7 @@
|
|||||||
/* Initial size of buffer, in bytes */
|
/* Initial size of buffer, in bytes */
|
||||||
#define MIN_SIZE 16
|
#define MIN_SIZE 16
|
||||||
|
|
||||||
enum
|
enum {
|
||||||
{
|
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_TEXT,
|
PROP_TEXT,
|
||||||
PROP_LENGTH,
|
PROP_LENGTH,
|
||||||
@@ -61,8 +60,7 @@ enum
|
|||||||
|
|
||||||
static GParamSpec *obj_props[PROP_LAST] = { NULL, };
|
static GParamSpec *obj_props[PROP_LAST] = { NULL, };
|
||||||
|
|
||||||
enum
|
enum {
|
||||||
{
|
|
||||||
INSERTED_TEXT,
|
INSERTED_TEXT,
|
||||||
DELETED_TEXT,
|
DELETED_TEXT,
|
||||||
LAST_SIGNAL
|
LAST_SIGNAL
|
||||||
|
|||||||
@@ -144,17 +144,15 @@ struct _ClutterTextPrivate
|
|||||||
*/
|
*/
|
||||||
gint x_pos;
|
gint x_pos;
|
||||||
|
|
||||||
/* the x position of the PangoLayout (in both physical and logical pixels)
|
/* the x position of the PangoLayout when in
|
||||||
* when in single line mode, to scroll the contents of the
|
* single line mode, to scroll the contents of the
|
||||||
* text actor
|
* text actor
|
||||||
*/
|
*/
|
||||||
gint text_x;
|
gint text_x;
|
||||||
gint text_logical_x;
|
|
||||||
|
|
||||||
/* the y position of the PangoLayout (in both physical and logical pixels),
|
/* the y position of the PangoLayout, fixed to 0 by
|
||||||
* fixed to 0 by default for now */
|
* default for now */
|
||||||
gint text_y;
|
gint text_y;
|
||||||
gint text_logical_y;
|
|
||||||
|
|
||||||
/* Where to draw the cursor */
|
/* Where to draw the cursor */
|
||||||
ClutterRect cursor_rect;
|
ClutterRect cursor_rect;
|
||||||
@@ -187,9 +185,6 @@ struct _ClutterTextPrivate
|
|||||||
ClutterInputContentHintFlags input_hints;
|
ClutterInputContentHintFlags input_hints;
|
||||||
ClutterInputContentPurpose input_purpose;
|
ClutterInputContentPurpose input_purpose;
|
||||||
|
|
||||||
/* Signal handler for when the :resource-scale changes */
|
|
||||||
guint resource_scale_changed_id;
|
|
||||||
|
|
||||||
/* bitfields */
|
/* bitfields */
|
||||||
guint alignment : 2;
|
guint alignment : 2;
|
||||||
guint wrap : 1;
|
guint wrap : 1;
|
||||||
@@ -284,7 +279,7 @@ static const ClutterColor default_selected_text_color = { 0, 0, 0, 255 };
|
|||||||
|
|
||||||
static CoglPipeline *default_color_pipeline = NULL;
|
static CoglPipeline *default_color_pipeline = NULL;
|
||||||
|
|
||||||
static ClutterAnimatableInterface *parent_animatable_iface = NULL;
|
static ClutterAnimatableIface *parent_animatable_iface = NULL;
|
||||||
static ClutterScriptableIface *parent_scriptable_iface = NULL;
|
static ClutterScriptableIface *parent_scriptable_iface = NULL;
|
||||||
|
|
||||||
/* ClutterTextInputFocus */
|
/* ClutterTextInputFocus */
|
||||||
@@ -295,33 +290,6 @@ G_DECLARE_FINAL_TYPE (ClutterTextInputFocus, clutter_text_input_focus,
|
|||||||
G_DEFINE_TYPE (ClutterTextInputFocus, clutter_text_input_focus,
|
G_DEFINE_TYPE (ClutterTextInputFocus, clutter_text_input_focus,
|
||||||
CLUTTER_TYPE_INPUT_FOCUS)
|
CLUTTER_TYPE_INPUT_FOCUS)
|
||||||
|
|
||||||
/* Utilities pango to (logical) pixels functions */
|
|
||||||
static float
|
|
||||||
pixels_to_pango (float px)
|
|
||||||
{
|
|
||||||
return ceilf (px * (float) PANGO_SCALE);
|
|
||||||
}
|
|
||||||
|
|
||||||
static float
|
|
||||||
logical_pixels_to_pango (float px,
|
|
||||||
float scale)
|
|
||||||
{
|
|
||||||
return pixels_to_pango (px * scale);
|
|
||||||
}
|
|
||||||
|
|
||||||
static float
|
|
||||||
pango_to_pixels (float size)
|
|
||||||
{
|
|
||||||
return ceilf (size / (float) PANGO_SCALE);
|
|
||||||
}
|
|
||||||
|
|
||||||
static float
|
|
||||||
pango_to_logical_pixels (float size,
|
|
||||||
float scale)
|
|
||||||
{
|
|
||||||
return pango_to_pixels (size / scale);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_text_input_focus_request_surrounding (ClutterInputFocus *focus)
|
clutter_text_input_focus_request_surrounding (ClutterInputFocus *focus)
|
||||||
{
|
{
|
||||||
@@ -421,7 +389,7 @@ clutter_text_input_focus_new (ClutterText *text)
|
|||||||
|
|
||||||
/* ClutterText */
|
/* ClutterText */
|
||||||
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
|
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
|
||||||
static void clutter_animatable_iface_init (ClutterAnimatableInterface *iface);
|
static void clutter_animatable_iface_init (ClutterAnimatableIface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (ClutterText,
|
G_DEFINE_TYPE_WITH_CODE (ClutterText,
|
||||||
clutter_text,
|
clutter_text,
|
||||||
@@ -582,63 +550,6 @@ clutter_text_get_display_text (ClutterText *self)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
ensure_effective_pango_scale_attribute (ClutterText *self)
|
|
||||||
{
|
|
||||||
float resource_scale;
|
|
||||||
ClutterTextPrivate *priv = self->priv;
|
|
||||||
|
|
||||||
if (!clutter_actor_get_resource_scale (CLUTTER_ACTOR (self), &resource_scale) ||
|
|
||||||
resource_scale == 1.0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (priv->effective_attrs != NULL)
|
|
||||||
{
|
|
||||||
PangoAttrIterator *iter;
|
|
||||||
PangoAttribute *scale_attrib;
|
|
||||||
PangoAttrList *old_attributes;
|
|
||||||
|
|
||||||
old_attributes = priv->effective_attrs;
|
|
||||||
priv->effective_attrs = pango_attr_list_copy (priv->effective_attrs);
|
|
||||||
pango_attr_list_unref (old_attributes);
|
|
||||||
|
|
||||||
iter = pango_attr_list_get_iterator (priv->effective_attrs);
|
|
||||||
scale_attrib = pango_attr_iterator_get (iter, PANGO_ATTR_SCALE);
|
|
||||||
|
|
||||||
if (scale_attrib != NULL)
|
|
||||||
resource_scale *= ((PangoAttrFloat *) scale_attrib)->value;
|
|
||||||
|
|
||||||
pango_attr_iterator_destroy (iter);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
priv->effective_attrs = pango_attr_list_new ();
|
|
||||||
|
|
||||||
pango_attr_list_change (priv->effective_attrs,
|
|
||||||
pango_attr_scale_new (resource_scale));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
set_effective_pango_attributes (ClutterText *self,
|
|
||||||
PangoAttrList *attributes)
|
|
||||||
{
|
|
||||||
ClutterTextPrivate *priv = self->priv;
|
|
||||||
|
|
||||||
if (attributes != NULL)
|
|
||||||
{
|
|
||||||
PangoAttrList *old_attributes = priv->effective_attrs;
|
|
||||||
priv->effective_attrs = pango_attr_list_ref (attributes);
|
|
||||||
|
|
||||||
if (old_attributes != NULL)
|
|
||||||
pango_attr_list_unref (old_attributes);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_clear_pointer (&priv->effective_attrs, pango_attr_list_unref);
|
|
||||||
}
|
|
||||||
|
|
||||||
ensure_effective_pango_scale_attribute (self);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
clutter_text_ensure_effective_attributes (ClutterText *self)
|
clutter_text_ensure_effective_attributes (ClutterText *self)
|
||||||
{
|
{
|
||||||
@@ -652,25 +563,21 @@ clutter_text_ensure_effective_attributes (ClutterText *self)
|
|||||||
/* Same as if we don't have any attribute at all.
|
/* Same as if we don't have any attribute at all.
|
||||||
* We also ignore markup attributes for editable. */
|
* We also ignore markup attributes for editable. */
|
||||||
if (priv->attrs == NULL && (priv->editable || priv->markup_attrs == NULL))
|
if (priv->attrs == NULL && (priv->editable || priv->markup_attrs == NULL))
|
||||||
{
|
|
||||||
set_effective_pango_attributes (self, NULL);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->attrs != NULL)
|
if (priv->attrs != NULL)
|
||||||
{
|
{
|
||||||
/* If there are no markup attributes, or if this is editable (in which
|
/* If there are no markup attributes, or if this is editable (in which
|
||||||
* case we ignore markup), then we can just use these attrs directly */
|
* case we ignore markup), then we can just use these attrs directly */
|
||||||
if (priv->editable || priv->markup_attrs == NULL)
|
if (priv->editable || priv->markup_attrs == NULL)
|
||||||
set_effective_pango_attributes (self, priv->attrs);
|
priv->effective_attrs = pango_attr_list_ref (priv->attrs);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Otherwise we need to merge the two lists */
|
/* Otherwise we need to merge the two lists */
|
||||||
PangoAttrList *effective_attrs;
|
|
||||||
PangoAttrIterator *iter;
|
PangoAttrIterator *iter;
|
||||||
GSList *attributes, *l;
|
GSList *attributes, *l;
|
||||||
|
|
||||||
effective_attrs = pango_attr_list_copy (priv->markup_attrs);
|
priv->effective_attrs = pango_attr_list_copy (priv->markup_attrs);
|
||||||
|
|
||||||
iter = pango_attr_list_get_iterator (priv->attrs);
|
iter = pango_attr_list_get_iterator (priv->attrs);
|
||||||
do
|
do
|
||||||
@@ -681,7 +588,7 @@ clutter_text_ensure_effective_attributes (ClutterText *self)
|
|||||||
{
|
{
|
||||||
PangoAttribute *attr = l->data;
|
PangoAttribute *attr = l->data;
|
||||||
|
|
||||||
pango_attr_list_insert (effective_attrs, attr);
|
pango_attr_list_insert (priv->effective_attrs, attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_slist_free (attributes);
|
g_slist_free (attributes);
|
||||||
@@ -689,14 +596,12 @@ clutter_text_ensure_effective_attributes (ClutterText *self)
|
|||||||
while (pango_attr_iterator_next (iter));
|
while (pango_attr_iterator_next (iter));
|
||||||
|
|
||||||
pango_attr_iterator_destroy (iter);
|
pango_attr_iterator_destroy (iter);
|
||||||
|
|
||||||
set_effective_pango_attributes (self, effective_attrs);
|
|
||||||
pango_attr_list_unref (effective_attrs);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (priv->markup_attrs != NULL)
|
else if (priv->markup_attrs != NULL)
|
||||||
{
|
{
|
||||||
set_effective_pango_attributes (self, priv->markup_attrs);
|
/* We can just use the markup attributes directly */
|
||||||
|
priv->effective_attrs = pango_attr_list_ref (priv->markup_attrs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -905,18 +810,6 @@ clutter_text_direction_changed_cb (GObject *gobject,
|
|||||||
/* no need to queue a relayout: set_text_direction() will do that for us */
|
/* no need to queue a relayout: set_text_direction() will do that for us */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_text_resource_scale_changed_cb (GObject *gobject,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
ClutterText *self = CLUTTER_TEXT (gobject);
|
|
||||||
ClutterTextPrivate *priv = self->priv;
|
|
||||||
|
|
||||||
g_clear_pointer (&priv->effective_attrs, pango_attr_list_unref);
|
|
||||||
clutter_text_dirty_cache (self);
|
|
||||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (gobject));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* clutter_text_create_layout:
|
* clutter_text_create_layout:
|
||||||
* @text: a #ClutterText
|
* @text: a #ClutterText
|
||||||
@@ -984,7 +877,7 @@ clutter_text_create_layout (ClutterText *text,
|
|||||||
!((priv->editable && priv->single_line_mode) ||
|
!((priv->editable && priv->single_line_mode) ||
|
||||||
(priv->ellipsize == PANGO_ELLIPSIZE_NONE && !priv->wrap))))
|
(priv->ellipsize == PANGO_ELLIPSIZE_NONE && !priv->wrap))))
|
||||||
{
|
{
|
||||||
width = pixels_to_pango (allocation_width);
|
width = allocation_width * 1024 + 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pango only uses height if ellipsization is enabled, so don't set
|
/* Pango only uses height if ellipsization is enabled, so don't set
|
||||||
@@ -1001,7 +894,7 @@ clutter_text_create_layout (ClutterText *text,
|
|||||||
priv->ellipsize != PANGO_ELLIPSIZE_NONE &&
|
priv->ellipsize != PANGO_ELLIPSIZE_NONE &&
|
||||||
!priv->single_line_mode)
|
!priv->single_line_mode)
|
||||||
{
|
{
|
||||||
height = pixels_to_pango (allocation_height);
|
height = allocation_height * 1024 + 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Search for a cached layout with the same width and keep
|
/* Search for a cached layout with the same width and keep
|
||||||
@@ -1098,37 +991,6 @@ clutter_text_create_layout (ClutterText *text,
|
|||||||
return oldest_cache->layout;
|
return oldest_cache->layout;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PangoLayout *
|
|
||||||
create_text_layout_with_scale (ClutterText *text,
|
|
||||||
gfloat allocation_width,
|
|
||||||
gfloat allocation_height,
|
|
||||||
gfloat scale)
|
|
||||||
{
|
|
||||||
if (allocation_width > 0)
|
|
||||||
allocation_width = roundf (allocation_width * scale);
|
|
||||||
|
|
||||||
if (allocation_height > 0)
|
|
||||||
allocation_height = roundf (allocation_height * scale);
|
|
||||||
|
|
||||||
return clutter_text_create_layout (text, allocation_width, allocation_height);
|
|
||||||
}
|
|
||||||
|
|
||||||
static PangoLayout *
|
|
||||||
maybe_create_text_layout_with_resource_scale (ClutterText *text,
|
|
||||||
gfloat allocation_width,
|
|
||||||
gfloat allocation_height)
|
|
||||||
{
|
|
||||||
float resource_scale;
|
|
||||||
|
|
||||||
if (!clutter_actor_get_resource_scale (CLUTTER_ACTOR (text), &resource_scale))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return create_text_layout_with_scale (text,
|
|
||||||
allocation_width,
|
|
||||||
allocation_height,
|
|
||||||
resource_scale);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_text_coords_to_position:
|
* clutter_text_coords_to_position:
|
||||||
* @self: a #ClutterText
|
* @self: a #ClutterText
|
||||||
@@ -1149,18 +1011,14 @@ clutter_text_coords_to_position (ClutterText *self,
|
|||||||
gint index_;
|
gint index_;
|
||||||
gint px, py;
|
gint px, py;
|
||||||
gint trailing;
|
gint trailing;
|
||||||
gfloat resource_scale;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_TEXT (self), 0);
|
g_return_val_if_fail (CLUTTER_IS_TEXT (self), 0);
|
||||||
|
|
||||||
if (!clutter_actor_get_resource_scale (CLUTTER_ACTOR (self), &resource_scale))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/* Take any offset due to scrolling into account, and normalize
|
/* Take any offset due to scrolling into account, and normalize
|
||||||
* the coordinates to PangoScale units
|
* the coordinates to PangoScale units
|
||||||
*/
|
*/
|
||||||
px = logical_pixels_to_pango (x - self->priv->text_logical_x, resource_scale);
|
px = (x - self->priv->text_x) * PANGO_SCALE;
|
||||||
py = logical_pixels_to_pango (y - self->priv->text_logical_y, resource_scale);
|
py = (y - self->priv->text_y) * PANGO_SCALE;
|
||||||
|
|
||||||
pango_layout_xy_to_index (clutter_text_get_layout (self),
|
pango_layout_xy_to_index (clutter_text_get_layout (self),
|
||||||
px, py,
|
px, py,
|
||||||
@@ -1169,8 +1027,22 @@ clutter_text_coords_to_position (ClutterText *self,
|
|||||||
return index_ + trailing;
|
return index_ + trailing;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
/**
|
||||||
clutter_text_position_to_coords_internal (ClutterText *self,
|
* clutter_text_position_to_coords:
|
||||||
|
* @self: a #ClutterText
|
||||||
|
* @position: position in characters
|
||||||
|
* @x: (out): return location for the X coordinate, or %NULL
|
||||||
|
* @y: (out): return location for the Y coordinate, or %NULL
|
||||||
|
* @line_height: (out): return location for the line height, or %NULL
|
||||||
|
*
|
||||||
|
* Retrieves the coordinates of the given @position.
|
||||||
|
*
|
||||||
|
* Return value: %TRUE if the conversion was successful
|
||||||
|
*
|
||||||
|
* Since: 1.0
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
clutter_text_position_to_coords (ClutterText *self,
|
||||||
gint position,
|
gint position,
|
||||||
gfloat *x,
|
gfloat *x,
|
||||||
gfloat *y,
|
gfloat *y,
|
||||||
@@ -1240,7 +1112,7 @@ clutter_text_position_to_coords_internal (ClutterText *self,
|
|||||||
|
|
||||||
if (x)
|
if (x)
|
||||||
{
|
{
|
||||||
*x = pango_to_pixels (rect.x);
|
*x = (gfloat) rect.x / 1024.0f;
|
||||||
|
|
||||||
/* Take any offset due to scrolling into account */
|
/* Take any offset due to scrolling into account */
|
||||||
if (priv->single_line_mode)
|
if (priv->single_line_mode)
|
||||||
@@ -1248,58 +1120,14 @@ clutter_text_position_to_coords_internal (ClutterText *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (y)
|
if (y)
|
||||||
*y = pango_to_pixels (rect.y);
|
*y = (gfloat) rect.y / 1024.0f;
|
||||||
|
|
||||||
if (line_height)
|
if (line_height)
|
||||||
*line_height = pango_to_pixels (rect.height);
|
*line_height = (gfloat) rect.height / 1024.0f;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_text_position_to_coords:
|
|
||||||
* @self: a #ClutterText
|
|
||||||
* @position: position in characters
|
|
||||||
* @x: (out): return location for the X coordinate, or %NULL
|
|
||||||
* @y: (out): return location for the Y coordinate, or %NULL
|
|
||||||
* @line_height: (out): return location for the line height, or %NULL
|
|
||||||
*
|
|
||||||
* Retrieves the coordinates of the given @position.
|
|
||||||
*
|
|
||||||
* Return value: %TRUE if the conversion was successful
|
|
||||||
*
|
|
||||||
* Since: 1.0
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
clutter_text_position_to_coords (ClutterText *self,
|
|
||||||
gint position,
|
|
||||||
gfloat *x,
|
|
||||||
gfloat *y,
|
|
||||||
gfloat *line_height)
|
|
||||||
{
|
|
||||||
gfloat resource_scale;
|
|
||||||
gboolean ret;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_TEXT (self), FALSE);
|
|
||||||
|
|
||||||
if (!clutter_actor_get_resource_scale (CLUTTER_ACTOR (self), &resource_scale))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
ret = clutter_text_position_to_coords_internal (self, position,
|
|
||||||
x, y, line_height);
|
|
||||||
|
|
||||||
if (x)
|
|
||||||
*x /= resource_scale;
|
|
||||||
|
|
||||||
if (y)
|
|
||||||
*y /= resource_scale;
|
|
||||||
|
|
||||||
if (line_height)
|
|
||||||
*line_height /= resource_scale;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
update_cursor_location (ClutterText *self)
|
update_cursor_location (ClutterText *self)
|
||||||
{
|
{
|
||||||
@@ -1317,8 +1145,7 @@ update_cursor_location (ClutterText *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
clutter_text_ensure_cursor_position (ClutterText *self,
|
clutter_text_ensure_cursor_position (ClutterText *self)
|
||||||
float scale)
|
|
||||||
{
|
{
|
||||||
ClutterTextPrivate *priv = self->priv;
|
ClutterTextPrivate *priv = self->priv;
|
||||||
gfloat x, y, cursor_height;
|
gfloat x, y, cursor_height;
|
||||||
@@ -1341,15 +1168,15 @@ clutter_text_ensure_cursor_position (ClutterText *self,
|
|||||||
priv->preedit_set ? priv->preedit_cursor_pos : 0);
|
priv->preedit_set ? priv->preedit_cursor_pos : 0);
|
||||||
|
|
||||||
x = y = cursor_height = 0;
|
x = y = cursor_height = 0;
|
||||||
clutter_text_position_to_coords_internal (self, position,
|
clutter_text_position_to_coords (self, position,
|
||||||
&x, &y,
|
&x, &y,
|
||||||
&cursor_height);
|
&cursor_height);
|
||||||
|
|
||||||
clutter_rect_init (&cursor_rect,
|
clutter_rect_init (&cursor_rect,
|
||||||
x,
|
x,
|
||||||
y + CURSOR_Y_PADDING * scale,
|
y + CURSOR_Y_PADDING,
|
||||||
priv->cursor_size * scale,
|
priv->cursor_size,
|
||||||
cursor_height - 2 * CURSOR_Y_PADDING * scale);
|
cursor_height - 2 * CURSOR_Y_PADDING);
|
||||||
|
|
||||||
if (!clutter_rect_equals (&priv->cursor_rect, &cursor_rect))
|
if (!clutter_rect_equals (&priv->cursor_rect, &cursor_rect))
|
||||||
{
|
{
|
||||||
@@ -1772,12 +1599,6 @@ clutter_text_dispose (GObject *gobject)
|
|||||||
priv->direction_changed_id = 0;
|
priv->direction_changed_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->resource_scale_changed_id)
|
|
||||||
{
|
|
||||||
g_signal_handler_disconnect (self, priv->resource_scale_changed_id);
|
|
||||||
priv->resource_scale_changed_id = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->settings_changed_id)
|
if (priv->settings_changed_id)
|
||||||
{
|
{
|
||||||
g_signal_handler_disconnect (clutter_get_default_backend (),
|
g_signal_handler_disconnect (clutter_get_default_backend (),
|
||||||
@@ -1830,7 +1651,6 @@ typedef void (* ClutterTextSelectionFunc) (ClutterText *text,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_text_foreach_selection_rectangle (ClutterText *self,
|
clutter_text_foreach_selection_rectangle (ClutterText *self,
|
||||||
float scale,
|
|
||||||
ClutterTextSelectionFunc func,
|
ClutterTextSelectionFunc func,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
@@ -1882,7 +1702,7 @@ clutter_text_foreach_selection_rectangle (ClutterText *self,
|
|||||||
&n_ranges);
|
&n_ranges);
|
||||||
pango_layout_line_x_to_index (line, 0, &index_, NULL);
|
pango_layout_line_x_to_index (line, 0, &index_, NULL);
|
||||||
|
|
||||||
clutter_text_position_to_coords_internal (self,
|
clutter_text_position_to_coords (self,
|
||||||
bytes_to_offset (utf8, index_),
|
bytes_to_offset (utf8, index_),
|
||||||
NULL, &y, &height);
|
NULL, &y, &height);
|
||||||
|
|
||||||
@@ -1894,18 +1714,18 @@ clutter_text_foreach_selection_rectangle (ClutterText *self,
|
|||||||
gfloat range_x;
|
gfloat range_x;
|
||||||
gfloat range_width;
|
gfloat range_width;
|
||||||
|
|
||||||
range_x = pango_to_pixels (ranges[i * 2]);
|
range_x = ranges[i * 2] / PANGO_SCALE;
|
||||||
|
|
||||||
/* Account for any scrolling in single line mode */
|
/* Account for any scrolling in single line mode */
|
||||||
if (priv->single_line_mode)
|
if (priv->single_line_mode)
|
||||||
range_x += priv->text_x;
|
range_x += priv->text_x;
|
||||||
|
|
||||||
|
|
||||||
range_width = pango_to_pixels (ranges[i * 2 + 1] - ranges[i * 2]);
|
range_width = ((gfloat) ranges[i * 2 + 1] - (gfloat) ranges[i * 2])
|
||||||
box.x1 = range_x;
|
/ PANGO_SCALE;
|
||||||
box.x2 = ceilf (range_x + range_width);
|
|
||||||
|
|
||||||
clutter_actor_box_scale (&box, scale);
|
box.x1 = range_x;
|
||||||
|
box.x2 = ceilf (range_x + range_width + .5f);
|
||||||
|
|
||||||
func (self, &box, user_data);
|
func (self, &box, user_data);
|
||||||
}
|
}
|
||||||
@@ -1924,14 +1744,6 @@ add_selection_rectangle_to_path (ClutterText *text,
|
|||||||
cogl_path_rectangle (user_data, box->x1, box->y1, box->x2, box->y2);
|
cogl_path_rectangle (user_data, box->x1, box->y1, box->x2, box->y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
clutter_text_foreach_selection_rectangle_prescaled (ClutterText *self,
|
|
||||||
ClutterTextSelectionFunc func,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
clutter_text_foreach_selection_rectangle (self, 1.0f, func, user_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Draws the selected text, its background, and the cursor */
|
/* Draws the selected text, its background, and the cursor */
|
||||||
static void
|
static void
|
||||||
selection_paint (ClutterText *self,
|
selection_paint (ClutterText *self,
|
||||||
@@ -1987,7 +1799,7 @@ selection_paint (ClutterText *self,
|
|||||||
else
|
else
|
||||||
color = &priv->text_color;
|
color = &priv->text_color;
|
||||||
|
|
||||||
clutter_text_foreach_selection_rectangle_prescaled (self,
|
clutter_text_foreach_selection_rectangle (self,
|
||||||
add_selection_rectangle_to_path,
|
add_selection_rectangle_to_path,
|
||||||
selection_path);
|
selection_path);
|
||||||
|
|
||||||
@@ -2186,8 +1998,7 @@ clutter_text_press (ClutterActor *actor,
|
|||||||
return CLUTTER_EVENT_PROPAGATE;
|
return CLUTTER_EVENT_PROPAGATE;
|
||||||
|
|
||||||
clutter_actor_grab_key_focus (actor);
|
clutter_actor_grab_key_focus (actor);
|
||||||
clutter_input_focus_set_input_panel_state (priv->input_focus,
|
clutter_input_focus_request_toggle_input_panel (priv->input_focus);
|
||||||
CLUTTER_INPUT_PANEL_STATE_TOGGLE);
|
|
||||||
|
|
||||||
/* if the actor is empty we just reset everything and not
|
/* if the actor is empty we just reset everything and not
|
||||||
* set up the dragging of the selection since there's nothing
|
* set up the dragging of the selection since there's nothing
|
||||||
@@ -2579,7 +2390,6 @@ clutter_text_paint (ClutterActor *self)
|
|||||||
guint n_chars;
|
guint n_chars;
|
||||||
float alloc_width;
|
float alloc_width;
|
||||||
float alloc_height;
|
float alloc_height;
|
||||||
float resource_scale;
|
|
||||||
|
|
||||||
fb = cogl_get_draw_framebuffer ();
|
fb = cogl_get_draw_framebuffer ();
|
||||||
|
|
||||||
@@ -2589,6 +2399,8 @@ clutter_text_paint (ClutterActor *self)
|
|||||||
n_chars = clutter_text_buffer_get_length (get_buffer (text));
|
n_chars = clutter_text_buffer_get_length (get_buffer (text));
|
||||||
|
|
||||||
clutter_actor_get_allocation_box (self, &alloc);
|
clutter_actor_get_allocation_box (self, &alloc);
|
||||||
|
alloc_width = alloc.x2 - alloc.x1;
|
||||||
|
alloc_height = alloc.y2 - alloc.y1;
|
||||||
|
|
||||||
if (G_UNLIKELY (default_color_pipeline == NULL))
|
if (G_UNLIKELY (default_color_pipeline == NULL))
|
||||||
{
|
{
|
||||||
@@ -2621,8 +2433,7 @@ clutter_text_paint (ClutterActor *self)
|
|||||||
cogl_framebuffer_draw_rectangle (fb,
|
cogl_framebuffer_draw_rectangle (fb,
|
||||||
color_pipeline,
|
color_pipeline,
|
||||||
0, 0,
|
0, 0,
|
||||||
clutter_actor_box_get_width (&alloc),
|
alloc_width, alloc_height);
|
||||||
clutter_actor_box_get_height (&alloc));
|
|
||||||
|
|
||||||
cogl_object_unref (color_pipeline);
|
cogl_object_unref (color_pipeline);
|
||||||
}
|
}
|
||||||
@@ -2635,12 +2446,6 @@ clutter_text_paint (ClutterActor *self)
|
|||||||
!clutter_text_should_draw_cursor (text))
|
!clutter_text_should_draw_cursor (text))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!clutter_actor_get_resource_scale (CLUTTER_ACTOR (self), &resource_scale))
|
|
||||||
return;
|
|
||||||
|
|
||||||
clutter_actor_box_scale (&alloc, resource_scale);
|
|
||||||
clutter_actor_box_get_size (&alloc, &alloc_width, &alloc_height);
|
|
||||||
|
|
||||||
if (priv->editable && priv->single_line_mode)
|
if (priv->editable && priv->single_line_mode)
|
||||||
layout = clutter_text_create_layout (text, -1, -1);
|
layout = clutter_text_create_layout (text, -1, -1);
|
||||||
else
|
else
|
||||||
@@ -2672,15 +2477,8 @@ clutter_text_paint (ClutterActor *self)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resource_scale != 1.0f)
|
|
||||||
{
|
|
||||||
float paint_scale = 1.0f / resource_scale;
|
|
||||||
cogl_framebuffer_push_matrix (fb);
|
|
||||||
cogl_framebuffer_scale (fb, paint_scale, paint_scale, 1.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clutter_text_should_draw_cursor (text))
|
if (clutter_text_should_draw_cursor (text))
|
||||||
clutter_text_ensure_cursor_position (text, resource_scale);
|
clutter_text_ensure_cursor_position (text);
|
||||||
|
|
||||||
if (priv->editable && priv->single_line_mode)
|
if (priv->editable && priv->single_line_mode)
|
||||||
{
|
{
|
||||||
@@ -2694,7 +2492,7 @@ clutter_text_paint (ClutterActor *self)
|
|||||||
clip_set = TRUE;
|
clip_set = TRUE;
|
||||||
|
|
||||||
actor_width = alloc_width - 2 * TEXT_PADDING;
|
actor_width = alloc_width - 2 * TEXT_PADDING;
|
||||||
text_width = pango_to_pixels (logical_rect.width);
|
text_width = logical_rect.width / PANGO_SCALE;
|
||||||
|
|
||||||
rtl = priv->resolved_direction == PANGO_DIRECTION_RTL;
|
rtl = priv->resolved_direction == PANGO_DIRECTION_RTL;
|
||||||
|
|
||||||
@@ -2751,10 +2549,8 @@ clutter_text_paint (ClutterActor *self)
|
|||||||
{
|
{
|
||||||
priv->text_x = text_x;
|
priv->text_x = text_x;
|
||||||
priv->text_y = text_y;
|
priv->text_y = text_y;
|
||||||
priv->text_logical_x = roundf ((float) text_x / resource_scale);
|
|
||||||
priv->text_logical_y = roundf ((float) text_y / resource_scale);
|
|
||||||
|
|
||||||
clutter_text_ensure_cursor_position (text, resource_scale);
|
clutter_text_ensure_cursor_position (text);
|
||||||
}
|
}
|
||||||
|
|
||||||
real_opacity = clutter_actor_get_paint_opacity (self)
|
real_opacity = clutter_actor_get_paint_opacity (self)
|
||||||
@@ -2773,9 +2569,6 @@ clutter_text_paint (ClutterActor *self)
|
|||||||
|
|
||||||
selection_paint (text, fb);
|
selection_paint (text, fb);
|
||||||
|
|
||||||
if (resource_scale != 1.0f)
|
|
||||||
cogl_framebuffer_pop_matrix (fb);
|
|
||||||
|
|
||||||
if (clip_set)
|
if (clip_set)
|
||||||
cogl_framebuffer_pop_clip (fb);
|
cogl_framebuffer_pop_clip (fb);
|
||||||
}
|
}
|
||||||
@@ -2805,32 +2598,26 @@ add_selection_to_paint_volume (ClutterText *text,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_text_get_paint_volume_for_cursor (ClutterText *text,
|
clutter_text_get_paint_volume_for_cursor (ClutterText *text,
|
||||||
float resource_scale,
|
|
||||||
ClutterPaintVolume *volume)
|
ClutterPaintVolume *volume)
|
||||||
{
|
{
|
||||||
ClutterTextPrivate *priv = text->priv;
|
ClutterTextPrivate *priv = text->priv;
|
||||||
ClutterVertex origin;
|
ClutterVertex origin;
|
||||||
|
|
||||||
clutter_text_ensure_cursor_position (text, resource_scale);
|
clutter_text_ensure_cursor_position (text);
|
||||||
|
|
||||||
if (priv->position == priv->selection_bound)
|
if (priv->position == priv->selection_bound)
|
||||||
{
|
{
|
||||||
float width, height;
|
origin.x = priv->cursor_rect.origin.x;
|
||||||
|
origin.y = priv->cursor_rect.origin.y;
|
||||||
width = priv->cursor_rect.size.width / resource_scale;
|
|
||||||
height = priv->cursor_rect.size.height / resource_scale;
|
|
||||||
origin.x = priv->cursor_rect.origin.x / resource_scale;
|
|
||||||
origin.y = priv->cursor_rect.origin.y / resource_scale;
|
|
||||||
origin.z = 0;
|
origin.z = 0;
|
||||||
|
|
||||||
clutter_paint_volume_set_origin (volume, &origin);
|
clutter_paint_volume_set_origin (volume, &origin);
|
||||||
clutter_paint_volume_set_width (volume, width);
|
clutter_paint_volume_set_width (volume, priv->cursor_rect.size.width);
|
||||||
clutter_paint_volume_set_height (volume, height);
|
clutter_paint_volume_set_height (volume, priv->cursor_rect.size.height);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
clutter_text_foreach_selection_rectangle (text,
|
clutter_text_foreach_selection_rectangle (text,
|
||||||
1.0f / resource_scale,
|
|
||||||
add_selection_to_paint_volume,
|
add_selection_to_paint_volume,
|
||||||
volume);
|
volume);
|
||||||
}
|
}
|
||||||
@@ -2853,7 +2640,6 @@ clutter_text_get_paint_volume (ClutterActor *self,
|
|||||||
PangoLayout *layout;
|
PangoLayout *layout;
|
||||||
PangoRectangle ink_rect;
|
PangoRectangle ink_rect;
|
||||||
ClutterVertex origin;
|
ClutterVertex origin;
|
||||||
float resource_scale;
|
|
||||||
|
|
||||||
/* If the text is single line editable then it gets clipped to
|
/* If the text is single line editable then it gets clipped to
|
||||||
the allocation anyway so we can just use that */
|
the allocation anyway so we can just use that */
|
||||||
@@ -2868,24 +2654,19 @@ clutter_text_get_paint_volume (ClutterActor *self,
|
|||||||
if (!clutter_actor_has_allocation (self))
|
if (!clutter_actor_has_allocation (self))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!clutter_actor_get_resource_scale (self, &resource_scale))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
_clutter_paint_volume_init_static (&priv->paint_volume, self);
|
_clutter_paint_volume_init_static (&priv->paint_volume, self);
|
||||||
|
|
||||||
layout = clutter_text_get_layout (text);
|
layout = clutter_text_get_layout (text);
|
||||||
pango_layout_get_extents (layout, &ink_rect, NULL);
|
pango_layout_get_extents (layout, &ink_rect, NULL);
|
||||||
|
|
||||||
origin.x = pango_to_logical_pixels (ink_rect.x, resource_scale);
|
origin.x = ink_rect.x / (float) PANGO_SCALE;
|
||||||
origin.y = pango_to_logical_pixels (ink_rect.y, resource_scale);
|
origin.y = ink_rect.y / (float) PANGO_SCALE;
|
||||||
origin.z = 0;
|
origin.z = 0;
|
||||||
clutter_paint_volume_set_origin (&priv->paint_volume, &origin);
|
clutter_paint_volume_set_origin (&priv->paint_volume, &origin);
|
||||||
clutter_paint_volume_set_width (&priv->paint_volume,
|
clutter_paint_volume_set_width (&priv->paint_volume,
|
||||||
pango_to_logical_pixels (ink_rect.width,
|
ink_rect.width / (float) PANGO_SCALE);
|
||||||
resource_scale));
|
|
||||||
clutter_paint_volume_set_height (&priv->paint_volume,
|
clutter_paint_volume_set_height (&priv->paint_volume,
|
||||||
pango_to_logical_pixels (ink_rect.height,
|
ink_rect.height / (float) PANGO_SCALE);
|
||||||
resource_scale));
|
|
||||||
|
|
||||||
/* If the cursor is visible then that will likely be drawn
|
/* If the cursor is visible then that will likely be drawn
|
||||||
outside of the ink rectangle so we should merge that in */
|
outside of the ink rectangle so we should merge that in */
|
||||||
@@ -2895,8 +2676,7 @@ clutter_text_get_paint_volume (ClutterActor *self,
|
|||||||
|
|
||||||
_clutter_paint_volume_init_static (&cursor_paint_volume, self);
|
_clutter_paint_volume_init_static (&cursor_paint_volume, self);
|
||||||
|
|
||||||
clutter_text_get_paint_volume_for_cursor (text, resource_scale,
|
clutter_text_get_paint_volume_for_cursor (text, &cursor_paint_volume);
|
||||||
&cursor_paint_volume);
|
|
||||||
|
|
||||||
clutter_paint_volume_union (&priv->paint_volume,
|
clutter_paint_volume_union (&priv->paint_volume,
|
||||||
&cursor_paint_volume);
|
&cursor_paint_volume);
|
||||||
@@ -2924,12 +2704,9 @@ clutter_text_get_preferred_width (ClutterActor *self,
|
|||||||
PangoLayout *layout;
|
PangoLayout *layout;
|
||||||
gint logical_width;
|
gint logical_width;
|
||||||
gfloat layout_width;
|
gfloat layout_width;
|
||||||
gfloat resource_scale;
|
|
||||||
|
|
||||||
if (!clutter_actor_get_resource_scale (self, &resource_scale))
|
|
||||||
resource_scale = 1;
|
|
||||||
|
|
||||||
layout = clutter_text_create_layout (text, -1, -1);
|
layout = clutter_text_create_layout (text, -1, -1);
|
||||||
|
|
||||||
pango_layout_get_extents (layout, NULL, &logical_rect);
|
pango_layout_get_extents (layout, NULL, &logical_rect);
|
||||||
|
|
||||||
/* the X coordinate of the logical rectangle might be non-zero
|
/* the X coordinate of the logical rectangle might be non-zero
|
||||||
@@ -2939,7 +2716,7 @@ clutter_text_get_preferred_width (ClutterActor *self,
|
|||||||
logical_width = logical_rect.x + logical_rect.width;
|
logical_width = logical_rect.x + logical_rect.width;
|
||||||
|
|
||||||
layout_width = logical_width > 0
|
layout_width = logical_width > 0
|
||||||
? pango_to_logical_pixels (logical_width, resource_scale)
|
? ceilf (logical_width / 1024.0f)
|
||||||
: 1;
|
: 1;
|
||||||
|
|
||||||
if (min_width_p)
|
if (min_width_p)
|
||||||
@@ -2981,16 +2758,12 @@ clutter_text_get_preferred_height (ClutterActor *self,
|
|||||||
PangoRectangle logical_rect = { 0, };
|
PangoRectangle logical_rect = { 0, };
|
||||||
gint logical_height;
|
gint logical_height;
|
||||||
gfloat layout_height;
|
gfloat layout_height;
|
||||||
gfloat resource_scale;
|
|
||||||
|
|
||||||
if (!clutter_actor_get_resource_scale (self, &resource_scale))
|
|
||||||
resource_scale = 1;
|
|
||||||
|
|
||||||
if (priv->single_line_mode)
|
if (priv->single_line_mode)
|
||||||
for_width = -1;
|
for_width = -1;
|
||||||
|
|
||||||
layout = create_text_layout_with_scale (CLUTTER_TEXT (self),
|
layout = clutter_text_create_layout (CLUTTER_TEXT (self),
|
||||||
for_width, -1, resource_scale);
|
for_width, -1);
|
||||||
|
|
||||||
pango_layout_get_extents (layout, NULL, &logical_rect);
|
pango_layout_get_extents (layout, NULL, &logical_rect);
|
||||||
|
|
||||||
@@ -2999,7 +2772,7 @@ clutter_text_get_preferred_height (ClutterActor *self,
|
|||||||
* the height accordingly
|
* the height accordingly
|
||||||
*/
|
*/
|
||||||
logical_height = logical_rect.y + logical_rect.height;
|
logical_height = logical_rect.y + logical_rect.height;
|
||||||
layout_height = pango_to_logical_pixels (logical_height, resource_scale);
|
layout_height = ceilf (logical_height / 1024.0f);
|
||||||
|
|
||||||
if (min_height_p)
|
if (min_height_p)
|
||||||
{
|
{
|
||||||
@@ -3015,8 +2788,7 @@ clutter_text_get_preferred_height (ClutterActor *self,
|
|||||||
pango_layout_line_get_extents (line, NULL, &logical_rect);
|
pango_layout_line_get_extents (line, NULL, &logical_rect);
|
||||||
|
|
||||||
logical_height = logical_rect.y + logical_rect.height;
|
logical_height = logical_rect.y + logical_rect.height;
|
||||||
line_height = pango_to_logical_pixels (logical_height,
|
line_height = ceilf (logical_height / 1024.0f);
|
||||||
resource_scale);
|
|
||||||
|
|
||||||
*min_height_p = line_height;
|
*min_height_p = line_height;
|
||||||
}
|
}
|
||||||
@@ -3047,7 +2819,7 @@ clutter_text_allocate (ClutterActor *self,
|
|||||||
if (text->priv->editable && text->priv->single_line_mode)
|
if (text->priv->editable && text->priv->single_line_mode)
|
||||||
clutter_text_create_layout (text, -1, -1);
|
clutter_text_create_layout (text, -1, -1);
|
||||||
else
|
else
|
||||||
maybe_create_text_layout_with_resource_scale (text,
|
clutter_text_create_layout (text,
|
||||||
box->x2 - box->x1,
|
box->x2 - box->x1,
|
||||||
box->y2 - box->y1);
|
box->y2 - box->y1);
|
||||||
|
|
||||||
@@ -3775,7 +3547,7 @@ clutter_text_set_final_state (ClutterAnimatable *animatable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
|
clutter_animatable_iface_init (ClutterAnimatableIface *iface)
|
||||||
{
|
{
|
||||||
parent_animatable_iface = g_type_interface_peek_parent (iface);
|
parent_animatable_iface = g_type_interface_peek_parent (iface);
|
||||||
|
|
||||||
@@ -4620,11 +4392,6 @@ clutter_text_init (ClutterText *self)
|
|||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
priv->input_focus = clutter_text_input_focus_new (self);
|
priv->input_focus = clutter_text_input_focus_new (self);
|
||||||
|
|
||||||
priv->resource_scale_changed_id =
|
|
||||||
g_signal_connect (self, "notify::resource-scale",
|
|
||||||
G_CALLBACK (clutter_text_resource_scale_changed_cb),
|
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -5735,7 +5502,6 @@ clutter_text_set_markup (ClutterText *self,
|
|||||||
PangoLayout *
|
PangoLayout *
|
||||||
clutter_text_get_layout (ClutterText *self)
|
clutter_text_get_layout (ClutterText *self)
|
||||||
{
|
{
|
||||||
PangoLayout *layout;
|
|
||||||
gfloat width, height;
|
gfloat width, height;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_TEXT (self), NULL);
|
g_return_val_if_fail (CLUTTER_IS_TEXT (self), NULL);
|
||||||
@@ -5744,12 +5510,8 @@ clutter_text_get_layout (ClutterText *self)
|
|||||||
return clutter_text_create_layout (self, -1, -1);
|
return clutter_text_create_layout (self, -1, -1);
|
||||||
|
|
||||||
clutter_actor_get_size (CLUTTER_ACTOR (self), &width, &height);
|
clutter_actor_get_size (CLUTTER_ACTOR (self), &width, &height);
|
||||||
layout = maybe_create_text_layout_with_resource_scale (self, width, height);
|
|
||||||
|
|
||||||
if (!layout)
|
return clutter_text_create_layout (self, width, height);
|
||||||
layout = clutter_text_create_layout (self, width, height);
|
|
||||||
|
|
||||||
return layout;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6753,10 +6515,10 @@ clutter_text_get_layout_offsets (ClutterText *self,
|
|||||||
priv = self->priv;
|
priv = self->priv;
|
||||||
|
|
||||||
if (x != NULL)
|
if (x != NULL)
|
||||||
*x = priv->text_logical_x;
|
*x = priv->text_x;
|
||||||
|
|
||||||
if (y != NULL)
|
if (y != NULL)
|
||||||
*y = priv->text_logical_y;
|
*y = priv->text_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -53,8 +53,7 @@ G_BEGIN_DECLS
|
|||||||
*
|
*
|
||||||
* Since: 0.4
|
* Since: 0.4
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
CLUTTER_TEXTURE_ERROR_OUT_OF_MEMORY,
|
CLUTTER_TEXTURE_ERROR_OUT_OF_MEMORY,
|
||||||
CLUTTER_TEXTURE_ERROR_NO_YUV,
|
CLUTTER_TEXTURE_ERROR_NO_YUV,
|
||||||
CLUTTER_TEXTURE_ERROR_BAD_FORMAT
|
CLUTTER_TEXTURE_ERROR_BAD_FORMAT
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ typedef struct _ClutterVertex ClutterVertex;
|
|||||||
|
|
||||||
typedef struct _ClutterAlpha ClutterAlpha;
|
typedef struct _ClutterAlpha ClutterAlpha;
|
||||||
typedef struct _ClutterAnimation ClutterAnimation;
|
typedef struct _ClutterAnimation ClutterAnimation;
|
||||||
|
typedef struct _ClutterAnimator ClutterAnimator;
|
||||||
typedef struct _ClutterState ClutterState;
|
typedef struct _ClutterState ClutterState;
|
||||||
|
|
||||||
typedef struct _ClutterInputDeviceTool ClutterInputDeviceTool;
|
typedef struct _ClutterInputDeviceTool ClutterInputDeviceTool;
|
||||||
@@ -361,10 +362,6 @@ void clutter_rect_inset (ClutterRect *rect
|
|||||||
float d_x,
|
float d_x,
|
||||||
float d_y);
|
float d_y);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_rect_scale (ClutterRect *rect,
|
|
||||||
float s_x,
|
|
||||||
float s_y);
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void clutter_rect_clamp_to_pixel (ClutterRect *rect);
|
void clutter_rect_clamp_to_pixel (ClutterRect *rect);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
float clutter_rect_get_x (ClutterRect *rect);
|
float clutter_rect_get_x (ClutterRect *rect);
|
||||||
@@ -564,10 +561,6 @@ void clutter_actor_box_set_size (ClutterActorBox *box,
|
|||||||
gfloat width,
|
gfloat width,
|
||||||
gfloat height);
|
gfloat height);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
void clutter_actor_box_scale (ClutterActorBox *box,
|
|
||||||
gfloat scale);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterGeometry:
|
* ClutterGeometry:
|
||||||
* @x: X coordinate of the top left corner of an actor
|
* @x: X coordinate of the top left corner of an actor
|
||||||
|
|||||||
@@ -39,6 +39,29 @@
|
|||||||
#include "clutter-interval.h"
|
#include "clutter-interval.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
|
|
||||||
|
#include "deprecated/clutter-util.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_util_next_p2:
|
||||||
|
* @a: Value to get the next power
|
||||||
|
*
|
||||||
|
* Calculates the nearest power of two, greater than or equal to @a.
|
||||||
|
*
|
||||||
|
* Return value: The nearest power of two, greater or equal to @a.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.2
|
||||||
|
*/
|
||||||
|
gint
|
||||||
|
clutter_util_next_p2 (gint a)
|
||||||
|
{
|
||||||
|
int rval = 1;
|
||||||
|
|
||||||
|
while (rval < a)
|
||||||
|
rval <<= 1;
|
||||||
|
|
||||||
|
return rval;
|
||||||
|
}
|
||||||
|
|
||||||
/* Help macros to scale from OpenGL <-1,1> coordinates system to
|
/* Help macros to scale from OpenGL <-1,1> coordinates system to
|
||||||
* window coordinates ranging [0,window-size]
|
* window coordinates ranging [0,window-size]
|
||||||
*/
|
*/
|
||||||
@@ -105,47 +128,6 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
|
||||||
ClutterRect *dest)
|
|
||||||
{
|
|
||||||
*dest = (ClutterRect) {
|
|
||||||
.origin = {
|
|
||||||
.x = src->x,
|
|
||||||
.y = src->y
|
|
||||||
},
|
|
||||||
.size = {
|
|
||||||
.width = src->width,
|
|
||||||
.height = src->height
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
void _clutter_util_rectangle_int_extents (const ClutterRect *src,
|
|
||||||
cairo_rectangle_int_t *dest)
|
|
||||||
{
|
|
||||||
ClutterRect tmp = *src;
|
|
||||||
|
|
||||||
clutter_rect_clamp_to_pixel (&tmp);
|
|
||||||
|
|
||||||
*dest = (cairo_rectangle_int_t) {
|
|
||||||
.x = tmp.origin.x,
|
|
||||||
.y = tmp.origin.y,
|
|
||||||
.width = tmp.size.width,
|
|
||||||
.height = tmp.size.height,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
void _clutter_util_rectangle_offset (const cairo_rectangle_int_t *src,
|
|
||||||
int x,
|
|
||||||
int y,
|
|
||||||
cairo_rectangle_int_t *dest)
|
|
||||||
{
|
|
||||||
*dest = *src;
|
|
||||||
|
|
||||||
dest->x += x;
|
|
||||||
dest->y += y;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*< private >
|
/*< private >
|
||||||
* _clutter_util_rectangle_union:
|
* _clutter_util_rectangle_union:
|
||||||
* @src1: first rectangle to union
|
* @src1: first rectangle to union
|
||||||
|
|||||||
@@ -76,7 +76,6 @@
|
|||||||
#include "clutter-input-focus.h"
|
#include "clutter-input-focus.h"
|
||||||
#include "clutter-interval.h"
|
#include "clutter-interval.h"
|
||||||
#include "clutter-keyframe-transition.h"
|
#include "clutter-keyframe-transition.h"
|
||||||
#include "clutter-keymap.h"
|
|
||||||
#include "clutter-keysyms.h"
|
#include "clutter-keysyms.h"
|
||||||
#include "clutter-layout-manager.h"
|
#include "clutter-layout-manager.h"
|
||||||
#include "clutter-layout-meta.h"
|
#include "clutter-layout-meta.h"
|
||||||
|
|||||||
@@ -60,8 +60,7 @@ typedef struct _ClutterStageViewCoglPrivate
|
|||||||
G_DEFINE_TYPE_WITH_PRIVATE (ClutterStageViewCogl, clutter_stage_view_cogl,
|
G_DEFINE_TYPE_WITH_PRIVATE (ClutterStageViewCogl, clutter_stage_view_cogl,
|
||||||
CLUTTER_TYPE_STAGE_VIEW)
|
CLUTTER_TYPE_STAGE_VIEW)
|
||||||
|
|
||||||
static void
|
static void clutter_stage_window_iface_init (ClutterStageWindowIface *iface);
|
||||||
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface);
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (ClutterStageCogl,
|
G_DEFINE_TYPE_WITH_CODE (ClutterStageCogl,
|
||||||
_clutter_stage_cogl,
|
_clutter_stage_cogl,
|
||||||
@@ -69,8 +68,7 @@ G_DEFINE_TYPE_WITH_CODE (ClutterStageCogl,
|
|||||||
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW,
|
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW,
|
||||||
clutter_stage_window_iface_init));
|
clutter_stage_window_iface_init));
|
||||||
|
|
||||||
enum
|
enum {
|
||||||
{
|
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_WRAPPER,
|
PROP_WRAPPER,
|
||||||
PROP_BACKEND,
|
PROP_BACKEND,
|
||||||
@@ -353,58 +351,6 @@ valid_buffer_age (ClutterStageViewCogl *view_cogl,
|
|||||||
return age < MIN (view_priv->damage_index, DAMAGE_HISTORY_MAX);
|
return age < MIN (view_priv->damage_index, DAMAGE_HISTORY_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
paint_damage_region (ClutterStageWindow *stage_window,
|
|
||||||
ClutterStageView *view,
|
|
||||||
cairo_rectangle_int_t *swap_region)
|
|
||||||
{
|
|
||||||
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view);
|
|
||||||
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
|
|
||||||
static CoglPipeline *overlay_blue = NULL;
|
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (stage_cogl->wrapper);
|
|
||||||
float x_1 = swap_region->x;
|
|
||||||
float x_2 = swap_region->x + swap_region->width;
|
|
||||||
float y_1 = swap_region->y;
|
|
||||||
float y_2 = swap_region->y + swap_region->height;
|
|
||||||
CoglMatrix modelview;
|
|
||||||
|
|
||||||
if (G_UNLIKELY (overlay_blue == NULL))
|
|
||||||
{
|
|
||||||
overlay_blue = cogl_pipeline_new (ctx);
|
|
||||||
cogl_pipeline_set_color4ub (overlay_blue, 0x00, 0x00, 0x33, 0x33);
|
|
||||||
}
|
|
||||||
|
|
||||||
cogl_framebuffer_push_matrix (framebuffer);
|
|
||||||
cogl_matrix_init_identity (&modelview);
|
|
||||||
_clutter_actor_apply_modelview_transform (actor, &modelview);
|
|
||||||
cogl_framebuffer_set_modelview_matrix (framebuffer, &modelview);
|
|
||||||
|
|
||||||
/* Blue for the swap region */
|
|
||||||
cogl_framebuffer_draw_rectangle (framebuffer, overlay_blue, x_1, y_1, x_2, y_2);
|
|
||||||
|
|
||||||
/* Red for the clip */
|
|
||||||
if (stage_cogl->initialized_redraw_clip)
|
|
||||||
{
|
|
||||||
static CoglPipeline *overlay_red = NULL;
|
|
||||||
|
|
||||||
if (G_UNLIKELY (overlay_red == NULL))
|
|
||||||
{
|
|
||||||
overlay_red = cogl_pipeline_new (ctx);
|
|
||||||
cogl_pipeline_set_color4ub (overlay_red, 0x33, 0x00, 0x00, 0x33);
|
|
||||||
}
|
|
||||||
|
|
||||||
x_1 = stage_cogl->bounding_redraw_clip.x;
|
|
||||||
x_2 = stage_cogl->bounding_redraw_clip.x + stage_cogl->bounding_redraw_clip.width;
|
|
||||||
y_1 = stage_cogl->bounding_redraw_clip.y;
|
|
||||||
y_2 = stage_cogl->bounding_redraw_clip.y + stage_cogl->bounding_redraw_clip.height;
|
|
||||||
|
|
||||||
cogl_framebuffer_draw_rectangle (framebuffer, overlay_red, x_1, y_1, x_2, y_2);
|
|
||||||
}
|
|
||||||
|
|
||||||
cogl_framebuffer_pop_matrix (framebuffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
swap_framebuffer (ClutterStageWindow *stage_window,
|
swap_framebuffer (ClutterStageWindow *stage_window,
|
||||||
ClutterStageView *view,
|
ClutterStageView *view,
|
||||||
@@ -424,9 +370,6 @@ swap_framebuffer (ClutterStageWindow *stage_window,
|
|||||||
else
|
else
|
||||||
ndamage = 0;
|
ndamage = 0;
|
||||||
|
|
||||||
if (G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION)))
|
|
||||||
paint_damage_region (stage_window, view, swap_region);
|
|
||||||
|
|
||||||
if (cogl_is_onscreen (framebuffer))
|
if (cogl_is_onscreen (framebuffer))
|
||||||
{
|
{
|
||||||
CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer);
|
CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer);
|
||||||
@@ -551,40 +494,31 @@ calculate_scissor_region (cairo_rectangle_int_t *fb_clip_region,
|
|||||||
int fb_height,
|
int fb_height,
|
||||||
cairo_rectangle_int_t *out_scissor_rect)
|
cairo_rectangle_int_t *out_scissor_rect)
|
||||||
{
|
{
|
||||||
*out_scissor_rect = *fb_clip_region;
|
int scissor_x;
|
||||||
|
int scissor_y;
|
||||||
|
int scissor_width;
|
||||||
|
int scissor_height;
|
||||||
|
|
||||||
if (subpixel_compensation == 0)
|
scissor_x = fb_clip_region->x;
|
||||||
return;
|
scissor_y = fb_clip_region->y;
|
||||||
|
scissor_width = fb_clip_region->width;
|
||||||
|
scissor_height = fb_clip_region->height;
|
||||||
|
|
||||||
if (fb_clip_region->x > 0)
|
if (fb_clip_region->x > 0)
|
||||||
out_scissor_rect->x += subpixel_compensation;
|
scissor_x += subpixel_compensation;
|
||||||
if (fb_clip_region->y > 0)
|
if (fb_clip_region->y > 0)
|
||||||
out_scissor_rect->y += subpixel_compensation;
|
scissor_y += subpixel_compensation;
|
||||||
if (fb_clip_region->x + fb_clip_region->width < fb_width)
|
if (fb_clip_region->x + fb_clip_region->width < fb_width)
|
||||||
out_scissor_rect->width -= 2 * subpixel_compensation;
|
scissor_width -= 2 * subpixel_compensation;
|
||||||
if (fb_clip_region->y + fb_clip_region->height < fb_height)
|
if (fb_clip_region->y + fb_clip_region->height < fb_height)
|
||||||
out_scissor_rect->height -= 2 * subpixel_compensation;
|
scissor_height -= 2 * subpixel_compensation;
|
||||||
}
|
|
||||||
|
|
||||||
static inline gboolean
|
*out_scissor_rect = (cairo_rectangle_int_t) {
|
||||||
is_buffer_age_enabled (void)
|
.x = scissor_x,
|
||||||
{
|
.y = scissor_y,
|
||||||
/* Buffer age is disabled when running with CLUTTER_PAINT=damage-region,
|
.width = scissor_width,
|
||||||
* to ensure the red damage represents the currently damaged area */
|
.height = scissor_height
|
||||||
return !(clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION) &&
|
};
|
||||||
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
scale_and_clamp_rect (const ClutterRect *rect,
|
|
||||||
float scale,
|
|
||||||
cairo_rectangle_int_t *dest)
|
|
||||||
|
|
||||||
{
|
|
||||||
ClutterRect tmp = *rect;
|
|
||||||
|
|
||||||
clutter_rect_scale (&tmp, scale, scale);
|
|
||||||
_clutter_util_rectangle_int_extents (&tmp, dest);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -624,7 +558,9 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
cogl_is_onscreen (fb) &&
|
cogl_is_onscreen (fb) &&
|
||||||
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_REGION);
|
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_REGION);
|
||||||
|
|
||||||
has_buffer_age = cogl_is_onscreen (fb) && is_buffer_age_enabled ();
|
has_buffer_age =
|
||||||
|
cogl_is_onscreen (fb) &&
|
||||||
|
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
|
||||||
|
|
||||||
/* NB: a zero width redraw clip == full stage redraw */
|
/* NB: a zero width redraw clip == full stage redraw */
|
||||||
if (stage_cogl->bounding_redraw_clip.width == 0)
|
if (stage_cogl->bounding_redraw_clip.width == 0)
|
||||||
@@ -650,22 +586,21 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
* frames when starting up... */
|
* frames when starting up... */
|
||||||
cogl_onscreen_get_frame_counter (COGL_ONSCREEN (fb)) > 3)
|
cogl_onscreen_get_frame_counter (COGL_ONSCREEN (fb)) > 3)
|
||||||
{
|
{
|
||||||
ClutterRect rect;
|
|
||||||
|
|
||||||
may_use_clipped_redraw = TRUE;
|
may_use_clipped_redraw = TRUE;
|
||||||
|
|
||||||
_clutter_util_rect_from_rectangle (&redraw_clip, &rect);
|
|
||||||
clutter_rect_offset (&rect, -view_rect.x, -view_rect.y);
|
|
||||||
scale_and_clamp_rect (&rect, fb_scale, &fb_clip_region);
|
|
||||||
|
|
||||||
if (fb_scale != floorf (fb_scale))
|
if (fb_scale != floorf (fb_scale))
|
||||||
{
|
|
||||||
subpixel_compensation = ceilf (fb_scale);
|
subpixel_compensation = ceilf (fb_scale);
|
||||||
fb_clip_region.x -= subpixel_compensation;
|
|
||||||
fb_clip_region.y -= subpixel_compensation;
|
fb_clip_region = (cairo_rectangle_int_t) {
|
||||||
fb_clip_region.width += 2 * subpixel_compensation;
|
.x = (floorf ((redraw_clip.x - view_rect.x) * fb_scale) -
|
||||||
fb_clip_region.height += 2 * subpixel_compensation;
|
subpixel_compensation),
|
||||||
}
|
.y = (floorf ((redraw_clip.y - view_rect.y) * fb_scale) -
|
||||||
|
subpixel_compensation),
|
||||||
|
.width = (ceilf (redraw_clip.width * fb_scale) +
|
||||||
|
(2 * subpixel_compensation)),
|
||||||
|
.height = (ceilf (redraw_clip.height * fb_scale) +
|
||||||
|
(2 * subpixel_compensation))
|
||||||
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -693,7 +628,6 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
|
|
||||||
if (valid_buffer_age (view_cogl, age))
|
if (valid_buffer_age (view_cogl, age))
|
||||||
{
|
{
|
||||||
ClutterRect rect;
|
|
||||||
cairo_rectangle_int_t damage_region;
|
cairo_rectangle_int_t damage_region;
|
||||||
|
|
||||||
*current_fb_damage = fb_clip_region;
|
*current_fb_damage = fb_clip_region;
|
||||||
@@ -709,12 +643,12 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Update the bounding redraw clip state with the extra damage. */
|
/* Update the bounding redraw clip state with the extra damage. */
|
||||||
_clutter_util_rect_from_rectangle (&fb_clip_region, &rect);
|
damage_region = (cairo_rectangle_int_t) {
|
||||||
scale_and_clamp_rect (&rect, 1.0f / fb_scale, &damage_region);
|
.x = view_rect.x + floorf (fb_clip_region.x / fb_scale),
|
||||||
_clutter_util_rectangle_offset (&damage_region,
|
.y = view_rect.y + floorf (fb_clip_region.y / fb_scale),
|
||||||
view_rect.x,
|
.width = ceilf (fb_clip_region.width / fb_scale),
|
||||||
view_rect.y,
|
.height = ceilf (fb_clip_region.height / fb_scale)
|
||||||
&damage_region);
|
};
|
||||||
_clutter_util_rectangle_union (&stage_cogl->bounding_redraw_clip,
|
_clutter_util_rectangle_union (&stage_cogl->bounding_redraw_clip,
|
||||||
&damage_region,
|
&damage_region,
|
||||||
&stage_cogl->bounding_redraw_clip);
|
&stage_cogl->bounding_redraw_clip);
|
||||||
@@ -753,9 +687,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
}
|
}
|
||||||
else if (use_clipped_redraw)
|
else if (use_clipped_redraw)
|
||||||
{
|
{
|
||||||
ClutterRect rect;
|
|
||||||
cairo_rectangle_int_t scissor_rect;
|
cairo_rectangle_int_t scissor_rect;
|
||||||
cairo_rectangle_int_t paint_rect;
|
|
||||||
|
|
||||||
calculate_scissor_region (&fb_clip_region,
|
calculate_scissor_region (&fb_clip_region,
|
||||||
subpixel_compensation,
|
subpixel_compensation,
|
||||||
@@ -776,15 +708,13 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
scissor_rect.y,
|
scissor_rect.y,
|
||||||
scissor_rect.width,
|
scissor_rect.width,
|
||||||
scissor_rect.height);
|
scissor_rect.height);
|
||||||
|
paint_stage (stage_cogl, view,
|
||||||
_clutter_util_rect_from_rectangle (&fb_clip_region, &rect);
|
&(cairo_rectangle_int_t) {
|
||||||
scale_and_clamp_rect (&rect, 1.0f / fb_scale, &paint_rect);
|
.x = view_rect.x + floorf ((fb_clip_region.x - 0) / fb_scale),
|
||||||
_clutter_util_rectangle_offset (&paint_rect,
|
.y = view_rect.y + floorf ((fb_clip_region.y - 0) / fb_scale),
|
||||||
view_rect.x,
|
.width = ceilf ((fb_clip_region.width + 0) / fb_scale),
|
||||||
view_rect.y,
|
.height = ceilf ((fb_clip_region.height + 0) / fb_scale)
|
||||||
&paint_rect);
|
});
|
||||||
|
|
||||||
paint_stage (stage_cogl, view, &paint_rect);
|
|
||||||
cogl_framebuffer_pop_clip (fb);
|
cogl_framebuffer_pop_clip (fb);
|
||||||
|
|
||||||
stage_cogl->using_clipped_redraw = FALSE;
|
stage_cogl->using_clipped_redraw = FALSE;
|
||||||
@@ -799,9 +729,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
may_use_clipped_redraw &&
|
may_use_clipped_redraw &&
|
||||||
!clip_region_empty)
|
!clip_region_empty)
|
||||||
{
|
{
|
||||||
ClutterRect rect;
|
|
||||||
cairo_rectangle_int_t scissor_rect;
|
cairo_rectangle_int_t scissor_rect;
|
||||||
cairo_rectangle_int_t paint_rect;
|
|
||||||
|
|
||||||
calculate_scissor_region (&fb_clip_region,
|
calculate_scissor_region (&fb_clip_region,
|
||||||
subpixel_compensation,
|
subpixel_compensation,
|
||||||
@@ -813,15 +741,13 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
scissor_rect.y,
|
scissor_rect.y,
|
||||||
scissor_rect.width,
|
scissor_rect.width,
|
||||||
scissor_rect.height);
|
scissor_rect.height);
|
||||||
|
paint_stage (stage_cogl, view,
|
||||||
_clutter_util_rect_from_rectangle (&fb_clip_region, &rect);
|
&(cairo_rectangle_int_t) {
|
||||||
scale_and_clamp_rect (&rect, 1.0f / fb_scale, &paint_rect);
|
.x = view_rect.x + floorf (fb_clip_region.x / fb_scale),
|
||||||
_clutter_util_rectangle_offset (&paint_rect,
|
.y = view_rect.y + floorf (fb_clip_region.y / fb_scale),
|
||||||
view_rect.x,
|
.width = ceilf (fb_clip_region.width / fb_scale),
|
||||||
view_rect.y,
|
.height = ceilf (fb_clip_region.height / fb_scale)
|
||||||
&paint_rect);
|
});
|
||||||
|
|
||||||
paint_stage (stage_cogl, view, &paint_rect);
|
|
||||||
cogl_framebuffer_pop_clip (fb);
|
cogl_framebuffer_pop_clip (fb);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -965,7 +891,7 @@ clutter_stage_cogl_get_dirty_pixel (ClutterStageWindow *stage_window,
|
|||||||
CoglFramebuffer *framebuffer = clutter_stage_view_get_framebuffer (view);
|
CoglFramebuffer *framebuffer = clutter_stage_view_get_framebuffer (view);
|
||||||
gboolean has_buffer_age =
|
gboolean has_buffer_age =
|
||||||
cogl_is_onscreen (framebuffer) &&
|
cogl_is_onscreen (framebuffer) &&
|
||||||
is_buffer_age_enabled ();
|
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
|
||||||
float fb_scale;
|
float fb_scale;
|
||||||
gboolean scale_is_fractional;
|
gboolean scale_is_fractional;
|
||||||
|
|
||||||
@@ -1006,7 +932,7 @@ clutter_stage_cogl_get_dirty_pixel (ClutterStageWindow *stage_window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface)
|
clutter_stage_window_iface_init (ClutterStageWindowIface *iface)
|
||||||
{
|
{
|
||||||
iface->realize = clutter_stage_cogl_realize;
|
iface->realize = clutter_stage_cogl_realize;
|
||||||
iface->unrealize = clutter_stage_cogl_unrealize;
|
iface->unrealize = clutter_stage_cogl_unrealize;
|
||||||
|
|||||||
@@ -7,6 +7,371 @@
|
|||||||
|
|
||||||
#include "clutter-actor-private.h"
|
#include "clutter-actor-private.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
|
#include "clutter-shader.h"
|
||||||
|
|
||||||
|
typedef struct _ShaderData ShaderData;
|
||||||
|
|
||||||
|
struct _ShaderData
|
||||||
|
{
|
||||||
|
ClutterShader *shader;
|
||||||
|
|
||||||
|
/* back pointer to the actor */
|
||||||
|
ClutterActor *actor;
|
||||||
|
|
||||||
|
/* list of values that should be set on the shader
|
||||||
|
* before each paint cycle
|
||||||
|
*/
|
||||||
|
GHashTable *value_hash;
|
||||||
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
shader_value_free (gpointer data)
|
||||||
|
{
|
||||||
|
GValue *var = data;
|
||||||
|
g_value_unset (var);
|
||||||
|
g_slice_free (GValue, var);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
destroy_shader_data (gpointer data)
|
||||||
|
{
|
||||||
|
ShaderData *shader_data = data;
|
||||||
|
|
||||||
|
if (shader_data == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (shader_data->shader != NULL)
|
||||||
|
{
|
||||||
|
g_object_unref (shader_data->shader);
|
||||||
|
shader_data->shader = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shader_data->value_hash != NULL)
|
||||||
|
{
|
||||||
|
g_hash_table_destroy (shader_data->value_hash);
|
||||||
|
shader_data->value_hash = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_slice_free (ShaderData, shader_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_actor_get_shader:
|
||||||
|
* @self: a #ClutterActor
|
||||||
|
*
|
||||||
|
* Queries the currently set #ClutterShader on @self.
|
||||||
|
*
|
||||||
|
* Return value: (transfer none): The currently set #ClutterShader
|
||||||
|
* or %NULL if no shader is set.
|
||||||
|
*
|
||||||
|
* Since: 0.6
|
||||||
|
*
|
||||||
|
* Deprecated: 1.8: Use clutter_actor_get_effect() instead.
|
||||||
|
*/
|
||||||
|
ClutterShader *
|
||||||
|
clutter_actor_get_shader (ClutterActor *self)
|
||||||
|
{
|
||||||
|
ShaderData *shader_data;
|
||||||
|
|
||||||
|
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), NULL);
|
||||||
|
|
||||||
|
shader_data = g_object_get_data (G_OBJECT (self), "-clutter-actor-shader-data");
|
||||||
|
if (shader_data != NULL)
|
||||||
|
return shader_data->shader;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_actor_set_shader:
|
||||||
|
* @self: a #ClutterActor
|
||||||
|
* @shader: (allow-none): a #ClutterShader or %NULL to unset the shader.
|
||||||
|
*
|
||||||
|
* Sets the #ClutterShader to be used when rendering @self.
|
||||||
|
*
|
||||||
|
* If @shader is %NULL this function will unset any currently set shader
|
||||||
|
* for the actor.
|
||||||
|
*
|
||||||
|
* Any #ClutterEffect applied to @self will take the precedence
|
||||||
|
* over the #ClutterShader set using this function.
|
||||||
|
*
|
||||||
|
* Return value: %TRUE if the shader was successfully applied
|
||||||
|
* or removed
|
||||||
|
*
|
||||||
|
* Since: 0.6
|
||||||
|
*
|
||||||
|
* Deprecated: 1.8: Use #ClutterShaderEffect and
|
||||||
|
* clutter_actor_add_effect() instead.
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
clutter_actor_set_shader (ClutterActor *self,
|
||||||
|
ClutterShader *shader)
|
||||||
|
{
|
||||||
|
ShaderData *shader_data;
|
||||||
|
|
||||||
|
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE);
|
||||||
|
g_return_val_if_fail (shader == NULL || CLUTTER_IS_SHADER (shader), FALSE);
|
||||||
|
|
||||||
|
if (shader != NULL)
|
||||||
|
g_object_ref (shader);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* if shader passed in is NULL we destroy the shader */
|
||||||
|
g_object_set_data (G_OBJECT (self), "-clutter-actor-shader-data", NULL);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
shader_data = g_object_get_data (G_OBJECT (self), "-clutter-actor-shader-data");
|
||||||
|
if (shader_data == NULL)
|
||||||
|
{
|
||||||
|
shader_data = g_slice_new (ShaderData);
|
||||||
|
shader_data->actor = self;
|
||||||
|
shader_data->shader = NULL;
|
||||||
|
shader_data->value_hash =
|
||||||
|
g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||||
|
g_free,
|
||||||
|
shader_value_free);
|
||||||
|
|
||||||
|
g_object_set_data_full (G_OBJECT (self), "-clutter-actor-shader-data",
|
||||||
|
shader_data,
|
||||||
|
destroy_shader_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shader_data->shader != NULL)
|
||||||
|
g_object_unref (shader_data->shader);
|
||||||
|
|
||||||
|
shader_data->shader = shader;
|
||||||
|
|
||||||
|
clutter_actor_queue_redraw (self);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_each_param (gpointer key,
|
||||||
|
gpointer value,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
ClutterShader *shader = user_data;
|
||||||
|
const gchar *uniform = key;
|
||||||
|
GValue *var = value;
|
||||||
|
|
||||||
|
clutter_shader_set_uniform (shader, uniform, var);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_clutter_actor_shader_pre_paint (ClutterActor *actor,
|
||||||
|
gboolean repeat)
|
||||||
|
{
|
||||||
|
ShaderData *shader_data;
|
||||||
|
ClutterShader *shader;
|
||||||
|
|
||||||
|
shader_data = g_object_get_data (G_OBJECT (actor), "-clutter-actor-shader-data");
|
||||||
|
if (shader_data == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
shader = shader_data->shader;
|
||||||
|
if (shader != NULL)
|
||||||
|
{
|
||||||
|
clutter_shader_set_is_enabled (shader, TRUE);
|
||||||
|
|
||||||
|
g_hash_table_foreach (shader_data->value_hash, set_each_param, shader);
|
||||||
|
|
||||||
|
if (!repeat)
|
||||||
|
_clutter_context_push_shader_stack (actor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_clutter_actor_shader_post_paint (ClutterActor *actor)
|
||||||
|
{
|
||||||
|
ShaderData *shader_data;
|
||||||
|
ClutterShader *shader;
|
||||||
|
|
||||||
|
shader_data = g_object_get_data (G_OBJECT (actor), "-clutter-actor-shader-data");
|
||||||
|
if (G_LIKELY (shader_data == NULL))
|
||||||
|
return;
|
||||||
|
|
||||||
|
shader = shader_data->shader;
|
||||||
|
if (shader != NULL)
|
||||||
|
{
|
||||||
|
ClutterActor *head;
|
||||||
|
|
||||||
|
clutter_shader_set_is_enabled (shader, FALSE);
|
||||||
|
|
||||||
|
/* remove the actor from the shaders stack; if there is another
|
||||||
|
* actor inside it, then call pre-paint again to set its shader
|
||||||
|
* but this time with the second argument being TRUE, indicating
|
||||||
|
* that we are re-applying an existing shader and thus should it
|
||||||
|
* not be prepended to the stack
|
||||||
|
*/
|
||||||
|
head = _clutter_context_pop_shader_stack (actor);
|
||||||
|
if (head != NULL)
|
||||||
|
_clutter_actor_shader_pre_paint (head, TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
clutter_actor_set_shader_param_internal (ClutterActor *self,
|
||||||
|
const gchar *param,
|
||||||
|
const GValue *value)
|
||||||
|
{
|
||||||
|
ShaderData *shader_data;
|
||||||
|
GValue *var;
|
||||||
|
|
||||||
|
shader_data = g_object_get_data (G_OBJECT (self), "-clutter-actor-shader-data");
|
||||||
|
if (shader_data == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var = g_slice_new0 (GValue);
|
||||||
|
g_value_init (var, G_VALUE_TYPE (value));
|
||||||
|
g_value_copy (value, var);
|
||||||
|
g_hash_table_insert (shader_data->value_hash, g_strdup (param), var);
|
||||||
|
|
||||||
|
clutter_actor_queue_redraw (self);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_actor_set_shader_param:
|
||||||
|
* @self: a #ClutterActor
|
||||||
|
* @param: the name of the parameter
|
||||||
|
* @value: the value of the parameter
|
||||||
|
*
|
||||||
|
* Sets the value for a named parameter of the shader applied
|
||||||
|
* to @actor.
|
||||||
|
*
|
||||||
|
* Since: 1.0
|
||||||
|
*
|
||||||
|
* Deprecated: 1.8: Use clutter_shader_effect_set_uniform_value() instead
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_actor_set_shader_param (ClutterActor *self,
|
||||||
|
const gchar *param,
|
||||||
|
const GValue *value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||||
|
g_return_if_fail (param != NULL);
|
||||||
|
g_return_if_fail (CLUTTER_VALUE_HOLDS_SHADER_FLOAT (value) ||
|
||||||
|
CLUTTER_VALUE_HOLDS_SHADER_INT (value) ||
|
||||||
|
CLUTTER_VALUE_HOLDS_SHADER_MATRIX (value) ||
|
||||||
|
G_VALUE_HOLDS_FLOAT (value) ||
|
||||||
|
G_VALUE_HOLDS_INT (value));
|
||||||
|
|
||||||
|
clutter_actor_set_shader_param_internal (self, param, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_actor_set_shader_param_float:
|
||||||
|
* @self: a #ClutterActor
|
||||||
|
* @param: the name of the parameter
|
||||||
|
* @value: the value of the parameter
|
||||||
|
*
|
||||||
|
* Sets the value for a named float parameter of the shader applied
|
||||||
|
* to @actor.
|
||||||
|
*
|
||||||
|
* Since: 0.8
|
||||||
|
*
|
||||||
|
* Deprecated: 1.8: Use clutter_shader_effect_set_uniform() instead
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_actor_set_shader_param_float (ClutterActor *self,
|
||||||
|
const gchar *param,
|
||||||
|
gfloat value)
|
||||||
|
{
|
||||||
|
GValue var = { 0, };
|
||||||
|
|
||||||
|
g_value_init (&var, G_TYPE_FLOAT);
|
||||||
|
g_value_set_float (&var, value);
|
||||||
|
|
||||||
|
clutter_actor_set_shader_param_internal (self, param, &var);
|
||||||
|
|
||||||
|
g_value_unset (&var);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_actor_set_shader_param_int:
|
||||||
|
* @self: a #ClutterActor
|
||||||
|
* @param: the name of the parameter
|
||||||
|
* @value: the value of the parameter
|
||||||
|
*
|
||||||
|
* Sets the value for a named int parameter of the shader applied to
|
||||||
|
* @actor.
|
||||||
|
*
|
||||||
|
* Since: 0.8
|
||||||
|
*
|
||||||
|
* Deprecated: 1.8: Use clutter_shader_effect_set_uniform() instead
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_actor_set_shader_param_int (ClutterActor *self,
|
||||||
|
const gchar *param,
|
||||||
|
gint value)
|
||||||
|
{
|
||||||
|
GValue var = { 0, };
|
||||||
|
|
||||||
|
g_value_init (&var, G_TYPE_INT);
|
||||||
|
g_value_set_int (&var, value);
|
||||||
|
|
||||||
|
clutter_actor_set_shader_param_internal (self, param, &var);
|
||||||
|
|
||||||
|
g_value_unset (&var);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_actor_set_geometry:
|
||||||
|
* @self: A #ClutterActor
|
||||||
|
* @geometry: A #ClutterGeometry
|
||||||
|
*
|
||||||
|
* Sets the actor's fixed position and forces its minimum and natural
|
||||||
|
* size, in pixels. This means the untransformed actor will have the
|
||||||
|
* given geometry. This is the same as calling clutter_actor_set_position()
|
||||||
|
* and clutter_actor_set_size().
|
||||||
|
*
|
||||||
|
* Deprecated: 1.10: Use clutter_actor_set_position() and
|
||||||
|
* clutter_actor_set_size() instead.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_actor_set_geometry (ClutterActor *self,
|
||||||
|
const ClutterGeometry *geometry)
|
||||||
|
{
|
||||||
|
g_object_freeze_notify (G_OBJECT (self));
|
||||||
|
|
||||||
|
clutter_actor_set_position (self, geometry->x, geometry->y);
|
||||||
|
clutter_actor_set_size (self, geometry->width, geometry->height);
|
||||||
|
|
||||||
|
g_object_thaw_notify (G_OBJECT (self));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_actor_get_geometry:
|
||||||
|
* @self: A #ClutterActor
|
||||||
|
* @geometry: (out caller-allocates): A location to store actors #ClutterGeometry
|
||||||
|
*
|
||||||
|
* Gets the size and position of an actor relative to its parent
|
||||||
|
* actor. This is the same as calling clutter_actor_get_position() and
|
||||||
|
* clutter_actor_get_size(). It tries to "do what you mean" and get the
|
||||||
|
* requested size and position if the actor's allocation is invalid.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.10: Use clutter_actor_get_position() and
|
||||||
|
* clutter_actor_get_size(), or clutter_actor_get_allocation_geometry()
|
||||||
|
* instead.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_actor_get_geometry (ClutterActor *self,
|
||||||
|
ClutterGeometry *geometry)
|
||||||
|
{
|
||||||
|
gfloat x, y, width, height;
|
||||||
|
|
||||||
|
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||||
|
g_return_if_fail (geometry != NULL);
|
||||||
|
|
||||||
|
clutter_actor_get_position (self, &x, &y);
|
||||||
|
clutter_actor_get_size (self, &width, &height);
|
||||||
|
|
||||||
|
geometry->x = (int) x;
|
||||||
|
geometry->y = (int) y;
|
||||||
|
geometry->width = (int) width;
|
||||||
|
geometry->height = (int) height;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_actor_get_allocation_geometry:
|
* clutter_actor_get_allocation_geometry:
|
||||||
|
|||||||
@@ -33,6 +33,13 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_actor_set_geometry (ClutterActor *self,
|
||||||
|
const ClutterGeometry *geometry);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_FOR(clutter_actor_get_allocation_geometry)
|
||||||
|
void clutter_actor_get_geometry (ClutterActor *self,
|
||||||
|
ClutterGeometry *geometry);
|
||||||
CLUTTER_DEPRECATED
|
CLUTTER_DEPRECATED
|
||||||
guint32 clutter_actor_get_gid (ClutterActor *self);
|
guint32 clutter_actor_get_gid (ClutterActor *self);
|
||||||
|
|
||||||
|
|||||||
2164
clutter/clutter/deprecated/clutter-animator.c
Normal file
2164
clutter/clutter/deprecated/clutter-animator.c
Normal file
File diff suppressed because it is too large
Load Diff
188
clutter/clutter/deprecated/clutter-animator.h
Normal file
188
clutter/clutter/deprecated/clutter-animator.h
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
/*
|
||||||
|
* Clutter.
|
||||||
|
*
|
||||||
|
* An OpenGL based 'interactive canvas' library.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2010 Intel Corporation
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* Author:
|
||||||
|
* Øyvind Kolås <pippin@linux.intel.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||||
|
#error "Only <clutter/clutter.h> can be included directly."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __CLUTTER_ANIMATOR_H__
|
||||||
|
#define __CLUTTER_ANIMATOR_H__
|
||||||
|
|
||||||
|
#include <clutter/clutter-types.h>
|
||||||
|
#include <clutter/clutter-timeline.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define CLUTTER_TYPE_ANIMATOR (clutter_animator_get_type ())
|
||||||
|
#define CLUTTER_TYPE_ANIMATOR_KEY (clutter_animator_key_get_type ())
|
||||||
|
|
||||||
|
#define CLUTTER_ANIMATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ANIMATOR, ClutterAnimator))
|
||||||
|
#define CLUTTER_ANIMATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_ANIMATOR, ClutterAnimatorClass))
|
||||||
|
#define CLUTTER_IS_ANIMATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ANIMATOR))
|
||||||
|
#define CLUTTER_IS_ANIMATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_ANIMATOR))
|
||||||
|
#define CLUTTER_ANIMATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_ANIMATOR, ClutterAnimatorClass))
|
||||||
|
|
||||||
|
/* ClutterAnimator is typedef in clutter-types.h */
|
||||||
|
|
||||||
|
typedef struct _ClutterAnimatorClass ClutterAnimatorClass;
|
||||||
|
typedef struct _ClutterAnimatorPrivate ClutterAnimatorPrivate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterAnimatorKey:
|
||||||
|
*
|
||||||
|
* A key frame inside a #ClutterAnimator
|
||||||
|
*
|
||||||
|
* Since: 1.2
|
||||||
|
*
|
||||||
|
* Deprecated: 1.12
|
||||||
|
*/
|
||||||
|
typedef struct _ClutterAnimatorKey ClutterAnimatorKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterAnimator:
|
||||||
|
*
|
||||||
|
* The #ClutterAnimator structure contains only private data and
|
||||||
|
* should be accessed using the provided API
|
||||||
|
*
|
||||||
|
* Since: 1.2
|
||||||
|
*
|
||||||
|
* Deprecated: 1.12
|
||||||
|
*/
|
||||||
|
struct _ClutterAnimator
|
||||||
|
{
|
||||||
|
/*< private >*/
|
||||||
|
GObject parent_instance;
|
||||||
|
|
||||||
|
ClutterAnimatorPrivate *priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterAnimatorClass:
|
||||||
|
*
|
||||||
|
* The #ClutterAnimatorClass structure contains only private data
|
||||||
|
*
|
||||||
|
* Since: 1.2
|
||||||
|
*
|
||||||
|
* Deprecated: 1.12
|
||||||
|
*/
|
||||||
|
struct _ClutterAnimatorClass
|
||||||
|
{
|
||||||
|
/*< private >*/
|
||||||
|
GObjectClass parent_class;
|
||||||
|
|
||||||
|
/* padding for future expansion */
|
||||||
|
gpointer _padding_dummy[16];
|
||||||
|
};
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
GType clutter_animator_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
ClutterAnimator * clutter_animator_new (void);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
ClutterAnimator * clutter_animator_set_key (ClutterAnimator *animator,
|
||||||
|
GObject *object,
|
||||||
|
const gchar *property_name,
|
||||||
|
guint mode,
|
||||||
|
gdouble progress,
|
||||||
|
const GValue *value);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_animator_set (ClutterAnimator *animator,
|
||||||
|
gpointer first_object,
|
||||||
|
const gchar *first_property_name,
|
||||||
|
guint first_mode,
|
||||||
|
gdouble first_progress,
|
||||||
|
...) G_GNUC_NULL_TERMINATED;
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
GList * clutter_animator_get_keys (ClutterAnimator *animator,
|
||||||
|
GObject *object,
|
||||||
|
const gchar *property_name,
|
||||||
|
gdouble progress);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_animator_remove_key (ClutterAnimator *animator,
|
||||||
|
GObject *object,
|
||||||
|
const gchar *property_name,
|
||||||
|
gdouble progress);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
ClutterTimeline * clutter_animator_start (ClutterAnimator *animator);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
gboolean clutter_animator_compute_value (ClutterAnimator *animator,
|
||||||
|
GObject *object,
|
||||||
|
const gchar *property_name,
|
||||||
|
gdouble progress,
|
||||||
|
GValue *value);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
ClutterTimeline * clutter_animator_get_timeline (ClutterAnimator *animator);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_animator_set_timeline (ClutterAnimator *animator,
|
||||||
|
ClutterTimeline *timeline);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
guint clutter_animator_get_duration (ClutterAnimator *animator);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_animator_set_duration (ClutterAnimator *animator,
|
||||||
|
guint duration);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
gboolean clutter_animator_property_get_ease_in (ClutterAnimator *animator,
|
||||||
|
GObject *object,
|
||||||
|
const gchar *property_name);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_animator_property_set_ease_in (ClutterAnimator *animator,
|
||||||
|
GObject *object,
|
||||||
|
const gchar *property_name,
|
||||||
|
gboolean ease_in);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
ClutterInterpolation clutter_animator_property_get_interpolation (ClutterAnimator *animator,
|
||||||
|
GObject *object,
|
||||||
|
const gchar *property_name);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_animator_property_set_interpolation (ClutterAnimator *animator,
|
||||||
|
GObject *object,
|
||||||
|
const gchar *property_name,
|
||||||
|
ClutterInterpolation interpolation);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
GType clutter_animator_key_get_type (void) G_GNUC_CONST;
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
GObject * clutter_animator_key_get_object (const ClutterAnimatorKey *key);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
const gchar * clutter_animator_key_get_property_name (const ClutterAnimatorKey *key);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
GType clutter_animator_key_get_property_type (const ClutterAnimatorKey *key);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
gulong clutter_animator_key_get_mode (const ClutterAnimatorKey *key);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
gdouble clutter_animator_key_get_progress (const ClutterAnimatorKey *key);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
gboolean clutter_animator_key_get_value (const ClutterAnimatorKey *key,
|
||||||
|
GValue *value);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __CLUTTER_ANIMATOR_H__ */
|
||||||
64
clutter/clutter/deprecated/clutter-backend.h
Normal file
64
clutter/clutter/deprecated/clutter-backend.h
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Clutter.
|
||||||
|
*
|
||||||
|
* An OpenGL based 'interactive canvas' library.
|
||||||
|
*
|
||||||
|
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006, 2007, 2008 OpenedHand Ltd
|
||||||
|
* Copyright (C) 2009, 2010 Intel Corp
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||||
|
#error "Only <clutter/clutter.h> can be included directly."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __CLUTTER_BACKEND_DEPRECATED_H__
|
||||||
|
#define __CLUTTER_BACKEND_DEPRECATED_H__
|
||||||
|
|
||||||
|
#include <clutter/clutter-types.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_FOR(ClutterSettings:font_dpi)
|
||||||
|
void clutter_backend_set_resolution (ClutterBackend *backend,
|
||||||
|
gdouble dpi);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_time)
|
||||||
|
void clutter_backend_set_double_click_time (ClutterBackend *backend,
|
||||||
|
guint msec);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_time)
|
||||||
|
guint clutter_backend_get_double_click_time (ClutterBackend *backend);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_distance)
|
||||||
|
void clutter_backend_set_double_click_distance (ClutterBackend *backend,
|
||||||
|
guint distance);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_distance)
|
||||||
|
guint clutter_backend_get_double_click_distance (ClutterBackend *backend);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_FOR(ClutterSettings:font_name)
|
||||||
|
void clutter_backend_set_font_name (ClutterBackend *backend,
|
||||||
|
const gchar *font_name);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_FOR(ClutterSettings:font_name)
|
||||||
|
const gchar * clutter_backend_get_font_name (ClutterBackend *backend);
|
||||||
|
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __CLUTTER_BACKEND_DEPRECATED_H__ */
|
||||||
1059
clutter/clutter/deprecated/clutter-behaviour-ellipse.c
Normal file
1059
clutter/clutter/deprecated/clutter-behaviour-ellipse.c
Normal file
File diff suppressed because it is too large
Load Diff
159
clutter/clutter/deprecated/clutter-behaviour-ellipse.h
Normal file
159
clutter/clutter/deprecated/clutter-behaviour-ellipse.h
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
/*
|
||||||
|
* Clutter.
|
||||||
|
*
|
||||||
|
* An OpenGL based 'interactive canvas' library.
|
||||||
|
*
|
||||||
|
* Authored By Tomas Frydrych <tf@openedhand.com>
|
||||||
|
*
|
||||||
|
* Copyright (C) 2007 OpenedHand
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||||
|
#error "Only <clutter/clutter.h> can be included directly."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __CLUTTER_BEHAVIOUR_ELLIPSE_H__
|
||||||
|
#define __CLUTTER_BEHAVIOUR_ELLIPSE_H__
|
||||||
|
|
||||||
|
#include <clutter/clutter-types.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define CLUTTER_TYPE_BEHAVIOUR_ELLIPSE (clutter_behaviour_ellipse_get_type ())
|
||||||
|
|
||||||
|
#define CLUTTER_BEHAVIOUR_ELLIPSE(obj) \
|
||||||
|
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
||||||
|
CLUTTER_TYPE_BEHAVIOUR_ELLIPSE, ClutterBehaviourEllipse))
|
||||||
|
|
||||||
|
#define CLUTTER_BEHAVIOUR_ELLIPSE_CLASS(klass) \
|
||||||
|
(G_TYPE_CHECK_CLASS_CAST ((klass), \
|
||||||
|
CLUTTER_TYPE_BEHAVIOUR_ELLIPSE, ClutterBehaviourEllipseClass))
|
||||||
|
|
||||||
|
#define CLUTTER_IS_BEHAVIOUR_ELLIPSE(obj) \
|
||||||
|
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
|
||||||
|
CLUTTER_TYPE_BEHAVIOUR_ELLIPSE))
|
||||||
|
|
||||||
|
#define CLUTTER_IS_BEHAVIOUR_ELLIPSE_CLASS(klass) \
|
||||||
|
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
|
||||||
|
CLUTTER_TYPE_BEHAVIOUR_ELLIPSE))
|
||||||
|
|
||||||
|
#define CLUTTER_BEHAVIOUR_ELLIPSE_GET_CLASS(obj) \
|
||||||
|
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
|
||||||
|
CLUTTER_TYPE_BEHAVIOUR_ELLIPSE, ClutterBehaviourEllipseClass))
|
||||||
|
|
||||||
|
typedef struct _ClutterBehaviourEllipse ClutterBehaviourEllipse;
|
||||||
|
typedef struct _ClutterBehaviourEllipsePrivate ClutterBehaviourEllipsePrivate;
|
||||||
|
typedef struct _ClutterBehaviourEllipseClass ClutterBehaviourEllipseClass;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterBehaviourEllipse:
|
||||||
|
*
|
||||||
|
* The #ClutterBehaviourEllipse struct contains only private data
|
||||||
|
* and should be accessed using the provided API
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6
|
||||||
|
*/
|
||||||
|
struct _ClutterBehaviourEllipse
|
||||||
|
{
|
||||||
|
/*< private >*/
|
||||||
|
ClutterBehaviour parent_instance;
|
||||||
|
ClutterBehaviourEllipsePrivate *priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterBehaviourEllipseClass:
|
||||||
|
*
|
||||||
|
* The #ClutterBehaviourEllipseClass struct contains only private data
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6
|
||||||
|
*/
|
||||||
|
struct _ClutterBehaviourEllipseClass
|
||||||
|
{
|
||||||
|
/*< private >*/
|
||||||
|
ClutterBehaviourClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
GType clutter_behaviour_ellipse_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_FOR(clutter_actor_animate)
|
||||||
|
ClutterBehaviour * clutter_behaviour_ellipse_new (ClutterAlpha *alpha,
|
||||||
|
gint x,
|
||||||
|
gint y,
|
||||||
|
gint width,
|
||||||
|
gint height,
|
||||||
|
ClutterRotateDirection direction,
|
||||||
|
gdouble start,
|
||||||
|
gdouble end);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_ellipse_set_center (ClutterBehaviourEllipse *self,
|
||||||
|
gint x,
|
||||||
|
gint y);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_ellipse_get_center (ClutterBehaviourEllipse *self,
|
||||||
|
gint *x,
|
||||||
|
gint *y);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_ellipse_set_width (ClutterBehaviourEllipse *self,
|
||||||
|
gint width);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
gint clutter_behaviour_ellipse_get_width (ClutterBehaviourEllipse *self);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_ellipse_set_height (ClutterBehaviourEllipse *self,
|
||||||
|
gint height);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
gint clutter_behaviour_ellipse_get_height (ClutterBehaviourEllipse *self);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_ellipse_set_angle_start (ClutterBehaviourEllipse *self,
|
||||||
|
gdouble angle_start);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
gdouble clutter_behaviour_ellipse_get_angle_start (ClutterBehaviourEllipse *self);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_ellipse_set_angle_end (ClutterBehaviourEllipse *self,
|
||||||
|
gdouble angle_end);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
gdouble clutter_behaviour_ellipse_get_angle_end (ClutterBehaviourEllipse *self);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_ellipse_set_angle_tilt (ClutterBehaviourEllipse *self,
|
||||||
|
ClutterRotateAxis axis,
|
||||||
|
gdouble angle_tilt);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
gdouble clutter_behaviour_ellipse_get_angle_tilt (ClutterBehaviourEllipse *self,
|
||||||
|
ClutterRotateAxis axis);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_ellipse_set_tilt (ClutterBehaviourEllipse *self,
|
||||||
|
gdouble angle_tilt_x,
|
||||||
|
gdouble angle_tilt_y,
|
||||||
|
gdouble angle_tilt_z);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_ellipse_get_tilt (ClutterBehaviourEllipse *self,
|
||||||
|
gdouble *angle_tilt_x,
|
||||||
|
gdouble *angle_tilt_y,
|
||||||
|
gdouble *angle_tilt_z);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
ClutterRotateDirection clutter_behaviour_ellipse_get_direction (ClutterBehaviourEllipse *self);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_ellipse_set_direction (ClutterBehaviourEllipse *self,
|
||||||
|
ClutterRotateDirection direction);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __CLUTTER_BEHAVIOUR_ELLIPSE_H__ */
|
||||||
465
clutter/clutter/deprecated/clutter-behaviour-path.c
Normal file
465
clutter/clutter/deprecated/clutter-behaviour-path.c
Normal file
@@ -0,0 +1,465 @@
|
|||||||
|
/*
|
||||||
|
* Clutter.
|
||||||
|
*
|
||||||
|
* An OpenGL based 'interactive canvas' library.
|
||||||
|
*
|
||||||
|
* Authored By:
|
||||||
|
* Matthew Allum <mallum@openedhand.com>
|
||||||
|
* Neil Roberts <neil@linux.intel.com>
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006, 2007, 2008 OpenedHand Ltd
|
||||||
|
* Copyright (C) 2009, 2010 Intel Corp
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SECTION:clutter-behaviour-path
|
||||||
|
* @Title: ClutterBehaviourPath
|
||||||
|
* @short_description: A behaviour for moving actors along a #ClutterPath
|
||||||
|
* @Deprecated: 1.6: Use #ClutterPathConstraint and clutter_actor_animate()
|
||||||
|
* with the #ClutterPathConstraint:offset property instead.
|
||||||
|
*
|
||||||
|
* #ClutterBehaviourPath interpolates actors along a defined path.
|
||||||
|
*
|
||||||
|
* A path is described by a #ClutterPath object. The path can contain
|
||||||
|
* straight line parts and bezier curves. If the path contains
|
||||||
|
* %CLUTTER_PATH_MOVE_TO parts then the actors will jump to those
|
||||||
|
* coordinates. This can be used make disjoint paths.
|
||||||
|
*
|
||||||
|
* When creating a path behaviour in a #ClutterScript, you can specify
|
||||||
|
* the path property directly as a string. For example:
|
||||||
|
*
|
||||||
|
* |[
|
||||||
|
* {
|
||||||
|
* "id" : "spline-path",
|
||||||
|
* "type" : "ClutterBehaviourPath",
|
||||||
|
* "path" : "M 50 50 L 100 100",
|
||||||
|
* "alpha" : {
|
||||||
|
* "timeline" : "main-timeline",
|
||||||
|
* "function" : "ramp
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* ]|
|
||||||
|
*
|
||||||
|
* If the alpha function is a periodic function, i.e. it returns to
|
||||||
|
* 0.0 after reaching 1.0, then the actors will walk the path back to the
|
||||||
|
* starting #ClutterKnot.
|
||||||
|
*
|
||||||
|
* #ClutterBehaviourPath is available since Clutter 0.2
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6: Use #ClutterPath and #ClutterPathConstraint with
|
||||||
|
* clutter_actor_animate() instead.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "clutter-build-config.h"
|
||||||
|
|
||||||
|
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
|
#include "clutter-alpha.h"
|
||||||
|
#include "clutter-behaviour.h"
|
||||||
|
#include "clutter-behaviour-path.h"
|
||||||
|
#include "clutter-bezier.h"
|
||||||
|
#include "clutter-debug.h"
|
||||||
|
#include "clutter-enum-types.h"
|
||||||
|
#include "clutter-main.h"
|
||||||
|
#include "clutter-marshal.h"
|
||||||
|
#include "clutter-private.h"
|
||||||
|
#include "clutter-script-private.h"
|
||||||
|
#include "clutter-scriptable.h"
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
struct _ClutterBehaviourPathPrivate
|
||||||
|
{
|
||||||
|
ClutterPath *path;
|
||||||
|
guint last_knot_passed;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
KNOT_REACHED,
|
||||||
|
|
||||||
|
LAST_SIGNAL
|
||||||
|
};
|
||||||
|
|
||||||
|
static guint path_signals[LAST_SIGNAL] = { 0, };
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
PROP_0,
|
||||||
|
|
||||||
|
PROP_PATH,
|
||||||
|
|
||||||
|
PROP_LAST
|
||||||
|
};
|
||||||
|
|
||||||
|
static GParamSpec *obj_props[PROP_LAST];
|
||||||
|
|
||||||
|
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
|
||||||
|
|
||||||
|
G_DEFINE_TYPE_WITH_CODE (ClutterBehaviourPath,
|
||||||
|
clutter_behaviour_path,
|
||||||
|
CLUTTER_TYPE_BEHAVIOUR,
|
||||||
|
G_ADD_PRIVATE (ClutterBehaviourPath)
|
||||||
|
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_SCRIPTABLE,
|
||||||
|
clutter_scriptable_iface_init))
|
||||||
|
|
||||||
|
static void
|
||||||
|
actor_apply_knot_foreach (ClutterBehaviour *behaviour,
|
||||||
|
ClutterActor *actor,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
ClutterKnot *knot = data;
|
||||||
|
|
||||||
|
CLUTTER_NOTE (ANIMATION, "Setting actor to %ix%i", knot->x, knot->y);
|
||||||
|
|
||||||
|
clutter_actor_set_position (actor, knot->x, knot->y);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_behaviour_path_alpha_notify (ClutterBehaviour *behave,
|
||||||
|
gdouble alpha_value)
|
||||||
|
{
|
||||||
|
ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (behave);
|
||||||
|
ClutterBehaviourPathPrivate *priv = pathb->priv;
|
||||||
|
ClutterKnot position;
|
||||||
|
guint knot_num;
|
||||||
|
|
||||||
|
if (priv->path)
|
||||||
|
knot_num = clutter_path_get_position (priv->path, alpha_value, &position);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
memset (&position, 0, sizeof (position));
|
||||||
|
knot_num = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
clutter_behaviour_actors_foreach (behave,
|
||||||
|
actor_apply_knot_foreach,
|
||||||
|
&position);
|
||||||
|
|
||||||
|
if (knot_num != priv->last_knot_passed)
|
||||||
|
{
|
||||||
|
g_signal_emit (behave, path_signals[KNOT_REACHED], 0, knot_num);
|
||||||
|
priv->last_knot_passed = knot_num;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_behaviour_path_get_property (GObject *gobject,
|
||||||
|
guint prop_id,
|
||||||
|
GValue *value,
|
||||||
|
GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (gobject);
|
||||||
|
|
||||||
|
switch (prop_id)
|
||||||
|
{
|
||||||
|
case PROP_PATH:
|
||||||
|
g_value_set_object (value, clutter_behaviour_path_get_path (pathb));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_behaviour_path_set_property (GObject *gobject,
|
||||||
|
guint prop_id,
|
||||||
|
const GValue *value,
|
||||||
|
GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (gobject);
|
||||||
|
|
||||||
|
switch (prop_id)
|
||||||
|
{
|
||||||
|
case PROP_PATH:
|
||||||
|
clutter_behaviour_path_set_path (pathb, g_value_get_object (value));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_behaviour_path_dispose (GObject *gobject)
|
||||||
|
{
|
||||||
|
ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (gobject);
|
||||||
|
|
||||||
|
clutter_behaviour_path_set_path (pathb, NULL);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (clutter_behaviour_path_parent_class)->dispose (gobject);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_behaviour_path_class_init (ClutterBehaviourPathClass *klass)
|
||||||
|
{
|
||||||
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||||
|
ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass);
|
||||||
|
GParamSpec *pspec;
|
||||||
|
|
||||||
|
gobject_class->get_property = clutter_behaviour_path_get_property;
|
||||||
|
gobject_class->set_property = clutter_behaviour_path_set_property;
|
||||||
|
gobject_class->dispose = clutter_behaviour_path_dispose;
|
||||||
|
|
||||||
|
pspec = g_param_spec_object ("path",
|
||||||
|
P_("Path"),
|
||||||
|
P_("The ClutterPath object representing the path "
|
||||||
|
"to animate along"),
|
||||||
|
CLUTTER_TYPE_PATH,
|
||||||
|
CLUTTER_PARAM_READWRITE);
|
||||||
|
obj_props[PROP_PATH] = pspec;
|
||||||
|
g_object_class_install_property (gobject_class, PROP_PATH, pspec);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterBehaviourPath::knot-reached:
|
||||||
|
* @pathb: the object which received the signal
|
||||||
|
* @knot_num: the index of the #ClutterKnot reached
|
||||||
|
*
|
||||||
|
* This signal is emitted each time a node defined inside the path
|
||||||
|
* is reached.
|
||||||
|
*
|
||||||
|
* Since: 0.2
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6
|
||||||
|
*/
|
||||||
|
path_signals[KNOT_REACHED] =
|
||||||
|
g_signal_new ("knot-reached",
|
||||||
|
G_TYPE_FROM_CLASS (gobject_class),
|
||||||
|
G_SIGNAL_RUN_LAST,
|
||||||
|
G_STRUCT_OFFSET (ClutterBehaviourPathClass, knot_reached),
|
||||||
|
NULL, NULL,
|
||||||
|
_clutter_marshal_VOID__UINT,
|
||||||
|
G_TYPE_NONE, 1,
|
||||||
|
G_TYPE_UINT);
|
||||||
|
|
||||||
|
behave_class->alpha_notify = clutter_behaviour_path_alpha_notify;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ClutterScriptableIface *parent_scriptable_iface = NULL;
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
clutter_behaviour_path_parse_custom_node (ClutterScriptable *scriptable,
|
||||||
|
ClutterScript *script,
|
||||||
|
GValue *value,
|
||||||
|
const gchar *name,
|
||||||
|
JsonNode *node)
|
||||||
|
{
|
||||||
|
if (strcmp ("path", name) == 0)
|
||||||
|
{
|
||||||
|
ClutterPath *path;
|
||||||
|
GValue node_value = { 0 };
|
||||||
|
|
||||||
|
path = g_object_ref_sink (clutter_path_new ());
|
||||||
|
|
||||||
|
json_node_get_value (node, &node_value);
|
||||||
|
|
||||||
|
if (!G_VALUE_HOLDS (&node_value, G_TYPE_STRING)
|
||||||
|
|| !clutter_path_set_description (path,
|
||||||
|
g_value_get_string (&node_value)))
|
||||||
|
g_warning ("Invalid path description");
|
||||||
|
|
||||||
|
g_value_unset (&node_value);
|
||||||
|
|
||||||
|
g_value_init (value, G_TYPE_OBJECT);
|
||||||
|
g_value_take_object (value, path);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
/* chain up */
|
||||||
|
else if (parent_scriptable_iface->parse_custom_node)
|
||||||
|
return parent_scriptable_iface->parse_custom_node (scriptable, script,
|
||||||
|
value, name, node);
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_scriptable_iface_init (ClutterScriptableIface *iface)
|
||||||
|
{
|
||||||
|
parent_scriptable_iface = g_type_interface_peek_parent (iface);
|
||||||
|
|
||||||
|
if (!parent_scriptable_iface)
|
||||||
|
parent_scriptable_iface
|
||||||
|
= g_type_default_interface_peek (CLUTTER_TYPE_SCRIPTABLE);
|
||||||
|
|
||||||
|
iface->parse_custom_node = clutter_behaviour_path_parse_custom_node;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_behaviour_path_init (ClutterBehaviourPath *self)
|
||||||
|
{
|
||||||
|
self->priv = clutter_behaviour_path_get_instance_private (self);
|
||||||
|
self->priv->last_knot_passed = G_MAXUINT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_behaviour_path_new:
|
||||||
|
* @alpha: (allow-none): a #ClutterAlpha instance, or %NULL
|
||||||
|
* @path: a #ClutterPath or %NULL for an empty path
|
||||||
|
*
|
||||||
|
* Creates a new path behaviour. You can use this behaviour to drive
|
||||||
|
* actors along the nodes of a path, described by @path.
|
||||||
|
*
|
||||||
|
* This will claim the floating reference on the #ClutterPath so you
|
||||||
|
* do not need to unref if it.
|
||||||
|
*
|
||||||
|
* If @alpha is not %NULL, the #ClutterBehaviour will take ownership
|
||||||
|
* of the #ClutterAlpha instance. In the case when @alpha is %NULL,
|
||||||
|
* it can be set later with clutter_behaviour_set_alpha().
|
||||||
|
*
|
||||||
|
* Return value: (transfer full): a #ClutterBehaviour
|
||||||
|
*
|
||||||
|
* Since: 0.2
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6
|
||||||
|
*/
|
||||||
|
ClutterBehaviour *
|
||||||
|
clutter_behaviour_path_new (ClutterAlpha *alpha,
|
||||||
|
ClutterPath *path)
|
||||||
|
{
|
||||||
|
return g_object_new (CLUTTER_TYPE_BEHAVIOUR_PATH,
|
||||||
|
"alpha", alpha,
|
||||||
|
"path", path,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_behaviour_path_new_with_description:
|
||||||
|
* @alpha: (allow-none): a #ClutterAlpha instance, or %NULL
|
||||||
|
* @desc: a string description of the path
|
||||||
|
*
|
||||||
|
* Creates a new path behaviour using the path described by @desc. See
|
||||||
|
* clutter_path_add_string() for a description of the format.
|
||||||
|
*
|
||||||
|
* If @alpha is not %NULL, the #ClutterBehaviour will take ownership
|
||||||
|
* of the #ClutterAlpha instance. In the case when @alpha is %NULL,
|
||||||
|
* it can be set later with clutter_behaviour_set_alpha().
|
||||||
|
*
|
||||||
|
* Return value: (transfer full): a #ClutterBehaviour
|
||||||
|
*
|
||||||
|
* Since: 1.0
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6
|
||||||
|
*/
|
||||||
|
ClutterBehaviour *
|
||||||
|
clutter_behaviour_path_new_with_description (ClutterAlpha *alpha,
|
||||||
|
const gchar *desc)
|
||||||
|
{
|
||||||
|
return g_object_new (CLUTTER_TYPE_BEHAVIOUR_PATH,
|
||||||
|
"alpha", alpha,
|
||||||
|
"path", clutter_path_new_with_description (desc),
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_behaviour_path_new_with_knots:
|
||||||
|
* @alpha: (allow-none): a #ClutterAlpha instance, or %NULL
|
||||||
|
* @knots: (array length=n_knots): an array of #ClutterKnot<!-- -->s
|
||||||
|
* @n_knots: number of entries in @knots
|
||||||
|
*
|
||||||
|
* Creates a new path behaviour that will make the actors visit all of
|
||||||
|
* the given knots in order with straight lines in between.
|
||||||
|
*
|
||||||
|
* A path will be created where the first knot is used in a
|
||||||
|
* %CLUTTER_PATH_MOVE_TO and the subsequent knots are used in
|
||||||
|
* %CLUTTER_PATH_LINE_TO<!-- -->s.
|
||||||
|
*
|
||||||
|
* If @alpha is not %NULL, the #ClutterBehaviour will take ownership
|
||||||
|
* of the #ClutterAlpha instance. In the case when @alpha is %NULL,
|
||||||
|
* it can be set later with clutter_behaviour_set_alpha().
|
||||||
|
*
|
||||||
|
* Return value: (transfer full): a #ClutterBehaviour
|
||||||
|
*
|
||||||
|
* Since: 1.0
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6
|
||||||
|
*/
|
||||||
|
ClutterBehaviour *
|
||||||
|
clutter_behaviour_path_new_with_knots (ClutterAlpha *alpha,
|
||||||
|
const ClutterKnot *knots,
|
||||||
|
guint n_knots)
|
||||||
|
{
|
||||||
|
ClutterPath *path = clutter_path_new ();
|
||||||
|
guint i;
|
||||||
|
|
||||||
|
if (n_knots > 0)
|
||||||
|
{
|
||||||
|
clutter_path_add_move_to (path, knots[0].x, knots[0].y);
|
||||||
|
|
||||||
|
for (i = 1; i < n_knots; i++)
|
||||||
|
clutter_path_add_line_to (path, knots[i].x, knots[i].y);
|
||||||
|
}
|
||||||
|
|
||||||
|
return g_object_new (CLUTTER_TYPE_BEHAVIOUR_PATH,
|
||||||
|
"alpha", alpha,
|
||||||
|
"path", path,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_behaviour_path_set_path:
|
||||||
|
* @pathb: the path behaviour
|
||||||
|
* @path: the new path to follow
|
||||||
|
*
|
||||||
|
* Change the path that the actors will follow. This will take the
|
||||||
|
* floating reference on the #ClutterPath so you do not need to unref
|
||||||
|
* it.
|
||||||
|
*
|
||||||
|
* Since: 1.0
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_behaviour_path_set_path (ClutterBehaviourPath *pathb,
|
||||||
|
ClutterPath *path)
|
||||||
|
{
|
||||||
|
ClutterBehaviourPathPrivate *priv;
|
||||||
|
|
||||||
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_PATH (pathb));
|
||||||
|
|
||||||
|
priv = pathb->priv;
|
||||||
|
|
||||||
|
if (path)
|
||||||
|
g_object_ref_sink (path);
|
||||||
|
|
||||||
|
if (priv->path)
|
||||||
|
g_object_unref (priv->path);
|
||||||
|
|
||||||
|
priv->path = path;
|
||||||
|
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (pathb), obj_props[PROP_PATH]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_behaviour_path_get_path:
|
||||||
|
* @pathb: a #ClutterBehaviourPath instance
|
||||||
|
*
|
||||||
|
* Get the current path of the behaviour
|
||||||
|
*
|
||||||
|
* Return value: (transfer none): the path
|
||||||
|
*
|
||||||
|
* Since: 1.0
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6
|
||||||
|
*/
|
||||||
|
ClutterPath *
|
||||||
|
clutter_behaviour_path_get_path (ClutterBehaviourPath *pathb)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_PATH (pathb), NULL);
|
||||||
|
|
||||||
|
return pathb->priv->path;
|
||||||
|
}
|
||||||
135
clutter/clutter/deprecated/clutter-behaviour-path.h
Normal file
135
clutter/clutter/deprecated/clutter-behaviour-path.h
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
/*
|
||||||
|
* Clutter.
|
||||||
|
*
|
||||||
|
* An OpenGL based 'interactive canvas' library.
|
||||||
|
*
|
||||||
|
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||||
|
* Jorn Baayen <jorn@openedhand.com>
|
||||||
|
* Emmanuele Bassi <ebassi@openedhand.com>
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006 OpenedHand
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||||
|
#error "Only <clutter/clutter.h> can be included directly."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __CLUTTER_BEHAVIOUR_PATH_H__
|
||||||
|
#define __CLUTTER_BEHAVIOUR_PATH_H__
|
||||||
|
|
||||||
|
#include <clutter/clutter-types.h>
|
||||||
|
#include <clutter/clutter-path.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define CLUTTER_TYPE_BEHAVIOUR_PATH (clutter_behaviour_path_get_type ())
|
||||||
|
|
||||||
|
#define CLUTTER_BEHAVIOUR_PATH(obj) \
|
||||||
|
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
||||||
|
CLUTTER_TYPE_BEHAVIOUR_PATH, ClutterBehaviourPath))
|
||||||
|
|
||||||
|
#define CLUTTER_BEHAVIOUR_PATH_CLASS(klass) \
|
||||||
|
(G_TYPE_CHECK_CLASS_CAST ((klass), \
|
||||||
|
CLUTTER_TYPE_BEHAVIOUR_PATH, ClutterBehaviourPathClass))
|
||||||
|
|
||||||
|
#define CLUTTER_IS_BEHAVIOUR_PATH(obj) \
|
||||||
|
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
|
||||||
|
CLUTTER_TYPE_BEHAVIOUR_PATH))
|
||||||
|
|
||||||
|
#define CLUTTER_IS_BEHAVIOUR_PATH_CLASS(klass) \
|
||||||
|
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
|
||||||
|
CLUTTER_TYPE_BEHAVIOUR_PATH))
|
||||||
|
|
||||||
|
#define CLUTTER_BEHAVIOUR_PATH_GET_CLASS(obj) \
|
||||||
|
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
|
||||||
|
CLUTTER_TYPE_BEHAVIOUR_PATH, ClutterBehaviourPathClass))
|
||||||
|
|
||||||
|
typedef struct _ClutterBehaviourPath ClutterBehaviourPath;
|
||||||
|
typedef struct _ClutterBehaviourPathPrivate ClutterBehaviourPathPrivate;
|
||||||
|
typedef struct _ClutterBehaviourPathClass ClutterBehaviourPathClass;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterBehaviourPath:
|
||||||
|
*
|
||||||
|
* The #ClutterBehaviourPath structure contains only private data
|
||||||
|
* and should be accessed using the provided API
|
||||||
|
*
|
||||||
|
* Since: 0.2
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6: Use #ClutterPathConstraint and clutter_actor_animate()
|
||||||
|
* instead.
|
||||||
|
*/
|
||||||
|
struct _ClutterBehaviourPath
|
||||||
|
{
|
||||||
|
/*< private >*/
|
||||||
|
ClutterBehaviour parent;
|
||||||
|
ClutterBehaviourPathPrivate *priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterBehaviourPathClass:
|
||||||
|
* @knot_reached: signal class handler for the
|
||||||
|
* ClutterBehaviourPath::knot_reached signal
|
||||||
|
*
|
||||||
|
* The #ClutterBehaviourPathClass struct contains only private data
|
||||||
|
*
|
||||||
|
* Since: 0.2
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6
|
||||||
|
*/
|
||||||
|
struct _ClutterBehaviourPathClass
|
||||||
|
{
|
||||||
|
/*< private >*/
|
||||||
|
ClutterBehaviourClass parent_class;
|
||||||
|
|
||||||
|
/*< public >*/
|
||||||
|
void (*knot_reached) (ClutterBehaviourPath *pathb,
|
||||||
|
guint knot_num);
|
||||||
|
|
||||||
|
/*< private >*/
|
||||||
|
void (*_clutter_path_1) (void);
|
||||||
|
void (*_clutter_path_2) (void);
|
||||||
|
void (*_clutter_path_3) (void);
|
||||||
|
void (*_clutter_path_4) (void);
|
||||||
|
};
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
GType clutter_behaviour_path_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_FOR(clutter_actor_animate)
|
||||||
|
ClutterBehaviour *clutter_behaviour_path_new (ClutterAlpha *alpha,
|
||||||
|
ClutterPath *path);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_FOR(clutter_actor_animate)
|
||||||
|
ClutterBehaviour *clutter_behaviour_path_new_with_description
|
||||||
|
(ClutterAlpha *alpha,
|
||||||
|
const gchar *desc);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_FOR(clutter_actor_animate)
|
||||||
|
ClutterBehaviour *clutter_behaviour_path_new_with_knots
|
||||||
|
(ClutterAlpha *alpha,
|
||||||
|
const ClutterKnot *knots,
|
||||||
|
guint n_knots);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_path_set_path (ClutterBehaviourPath *pathb,
|
||||||
|
ClutterPath *path);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
ClutterPath * clutter_behaviour_path_get_path (ClutterBehaviourPath *pathb);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __CLUTTER_BEHAVIOUR_PATH_H__ */
|
||||||
688
clutter/clutter/deprecated/clutter-behaviour-rotate.c
Normal file
688
clutter/clutter/deprecated/clutter-behaviour-rotate.c
Normal file
@@ -0,0 +1,688 @@
|
|||||||
|
/*
|
||||||
|
* Clutter.
|
||||||
|
*
|
||||||
|
* An OpenGL based 'interactive canvas' library.
|
||||||
|
*
|
||||||
|
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||||
|
*
|
||||||
|
* Copyright (C) 2007 OpenedHand
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SECTION:clutter-behaviour-rotate
|
||||||
|
* @short_description: A behaviour controlling rotation
|
||||||
|
*
|
||||||
|
* A #ClutterBehaviourRotate rotate actors between a starting and ending
|
||||||
|
* angle on a given axis.
|
||||||
|
*
|
||||||
|
* The #ClutterBehaviourRotate is available since version 0.4.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6: Use the #ClutterActor rotation properties and
|
||||||
|
* clutter_actor_animate(), or #ClutterAnimator, or #ClutterState
|
||||||
|
* instead.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "clutter-build-config.h"
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
#include "deprecated/clutter-actor.h"
|
||||||
|
|
||||||
|
#include "clutter-alpha.h"
|
||||||
|
#include "clutter-behaviour.h"
|
||||||
|
#include "clutter-behaviour-rotate.h"
|
||||||
|
#include "clutter-debug.h"
|
||||||
|
#include "clutter-enum-types.h"
|
||||||
|
#include "clutter-main.h"
|
||||||
|
#include "clutter-private.h"
|
||||||
|
|
||||||
|
struct _ClutterBehaviourRotatePrivate
|
||||||
|
{
|
||||||
|
gdouble angle_start;
|
||||||
|
gdouble angle_end;
|
||||||
|
|
||||||
|
ClutterRotateAxis axis;
|
||||||
|
ClutterRotateDirection direction;
|
||||||
|
|
||||||
|
gint center_x;
|
||||||
|
gint center_y;
|
||||||
|
gint center_z;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
PROP_0,
|
||||||
|
|
||||||
|
PROP_ANGLE_START,
|
||||||
|
PROP_ANGLE_END,
|
||||||
|
PROP_AXIS,
|
||||||
|
PROP_DIRECTION,
|
||||||
|
PROP_CENTER_X,
|
||||||
|
PROP_CENTER_Y,
|
||||||
|
PROP_CENTER_Z,
|
||||||
|
|
||||||
|
PROP_LAST
|
||||||
|
};
|
||||||
|
|
||||||
|
static GParamSpec *obj_props[PROP_LAST];
|
||||||
|
|
||||||
|
G_DEFINE_TYPE_WITH_PRIVATE (ClutterBehaviourRotate,
|
||||||
|
clutter_behaviour_rotate,
|
||||||
|
CLUTTER_TYPE_BEHAVIOUR)
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
gdouble angle;
|
||||||
|
} RotateFrameClosure;
|
||||||
|
|
||||||
|
static void
|
||||||
|
alpha_notify_foreach (ClutterBehaviour *behaviour,
|
||||||
|
ClutterActor *actor,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
RotateFrameClosure *closure = data;
|
||||||
|
ClutterBehaviourRotate *rotate_behaviour;
|
||||||
|
ClutterBehaviourRotatePrivate *priv;
|
||||||
|
|
||||||
|
rotate_behaviour = CLUTTER_BEHAVIOUR_ROTATE (behaviour);
|
||||||
|
priv = rotate_behaviour->priv;
|
||||||
|
|
||||||
|
clutter_actor_set_rotation (actor, priv->axis,
|
||||||
|
closure->angle,
|
||||||
|
priv->center_x,
|
||||||
|
priv->center_y,
|
||||||
|
priv->center_z);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline float
|
||||||
|
clamp_angle (float a)
|
||||||
|
{
|
||||||
|
float a1, a2;
|
||||||
|
gint rounds;
|
||||||
|
|
||||||
|
rounds = a / 360.0;
|
||||||
|
a1 = rounds * 360.0;
|
||||||
|
a2 = a - a1;
|
||||||
|
|
||||||
|
return a2;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_behaviour_rotate_alpha_notify (ClutterBehaviour *behaviour,
|
||||||
|
gdouble alpha_value)
|
||||||
|
{
|
||||||
|
ClutterBehaviourRotate *rotate_behaviour;
|
||||||
|
ClutterBehaviourRotatePrivate *priv;
|
||||||
|
RotateFrameClosure closure;
|
||||||
|
gdouble start, end;
|
||||||
|
|
||||||
|
rotate_behaviour = CLUTTER_BEHAVIOUR_ROTATE (behaviour);
|
||||||
|
priv = rotate_behaviour->priv;
|
||||||
|
|
||||||
|
closure.angle = 0;
|
||||||
|
start = priv->angle_start;
|
||||||
|
end = priv->angle_end;
|
||||||
|
|
||||||
|
if (priv->direction == CLUTTER_ROTATE_CW && start >= end)
|
||||||
|
end += 360.0;
|
||||||
|
else if (priv->direction == CLUTTER_ROTATE_CCW && start <= end)
|
||||||
|
end -= 360.0;
|
||||||
|
|
||||||
|
closure.angle = (end - start) * alpha_value + start;
|
||||||
|
|
||||||
|
clutter_behaviour_actors_foreach (behaviour,
|
||||||
|
alpha_notify_foreach,
|
||||||
|
&closure);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_behaviour_rotate_set_property (GObject *gobject,
|
||||||
|
guint prop_id,
|
||||||
|
const GValue *value,
|
||||||
|
GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
ClutterBehaviourRotate *rotate;
|
||||||
|
ClutterBehaviourRotatePrivate *priv;
|
||||||
|
|
||||||
|
rotate = CLUTTER_BEHAVIOUR_ROTATE (gobject);
|
||||||
|
priv = rotate->priv;
|
||||||
|
|
||||||
|
switch (prop_id)
|
||||||
|
{
|
||||||
|
case PROP_ANGLE_START:
|
||||||
|
priv->angle_start = g_value_get_double (value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROP_ANGLE_END:
|
||||||
|
priv->angle_end = g_value_get_double (value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROP_AXIS:
|
||||||
|
priv->axis = g_value_get_enum (value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROP_DIRECTION:
|
||||||
|
priv->direction = g_value_get_enum (value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROP_CENTER_X:
|
||||||
|
clutter_behaviour_rotate_set_center (rotate,
|
||||||
|
g_value_get_int (value),
|
||||||
|
priv->center_y,
|
||||||
|
priv->center_z);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROP_CENTER_Y:
|
||||||
|
clutter_behaviour_rotate_set_center (rotate,
|
||||||
|
priv->center_x,
|
||||||
|
g_value_get_int (value),
|
||||||
|
priv->center_z);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROP_CENTER_Z:
|
||||||
|
clutter_behaviour_rotate_set_center (rotate,
|
||||||
|
priv->center_x,
|
||||||
|
priv->center_y,
|
||||||
|
g_value_get_int (value));
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_behaviour_rotate_get_property (GObject *gobject,
|
||||||
|
guint prop_id,
|
||||||
|
GValue *value,
|
||||||
|
GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
ClutterBehaviourRotatePrivate *priv;
|
||||||
|
|
||||||
|
priv = CLUTTER_BEHAVIOUR_ROTATE (gobject)->priv;
|
||||||
|
|
||||||
|
switch (prop_id)
|
||||||
|
{
|
||||||
|
case PROP_ANGLE_START:
|
||||||
|
g_value_set_double (value, priv->angle_start);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROP_ANGLE_END:
|
||||||
|
g_value_set_double (value, priv->angle_end);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROP_AXIS:
|
||||||
|
g_value_set_enum (value, priv->axis);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROP_DIRECTION:
|
||||||
|
g_value_set_enum (value, priv->direction);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROP_CENTER_X:
|
||||||
|
g_value_set_int (value, priv->center_x);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROP_CENTER_Y:
|
||||||
|
g_value_set_int (value, priv->center_y);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROP_CENTER_Z:
|
||||||
|
g_value_set_int (value, priv->center_z);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_behaviour_rotate_class_init (ClutterBehaviourRotateClass *klass)
|
||||||
|
{
|
||||||
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||||
|
ClutterBehaviourClass *behaviour_class = CLUTTER_BEHAVIOUR_CLASS (klass);
|
||||||
|
GParamSpec *pspec = NULL;
|
||||||
|
|
||||||
|
gobject_class->set_property = clutter_behaviour_rotate_set_property;
|
||||||
|
gobject_class->get_property = clutter_behaviour_rotate_get_property;
|
||||||
|
|
||||||
|
behaviour_class->alpha_notify = clutter_behaviour_rotate_alpha_notify;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterBehaviourRotate:angle-start:
|
||||||
|
*
|
||||||
|
* The initial angle from whence the rotation should start.
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
pspec = g_param_spec_double ("angle-start",
|
||||||
|
P_("Angle Begin"),
|
||||||
|
P_("Initial angle"),
|
||||||
|
0.0, 360.0,
|
||||||
|
0.0,
|
||||||
|
CLUTTER_PARAM_READWRITE);
|
||||||
|
obj_props[PROP_ANGLE_START] = pspec;
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_ANGLE_START,
|
||||||
|
pspec);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterBehaviourRotate:angle-end:
|
||||||
|
*
|
||||||
|
* The final angle to where the rotation should end.
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
pspec = g_param_spec_double ("angle-end",
|
||||||
|
P_("Angle End"),
|
||||||
|
P_("Final angle"),
|
||||||
|
0.0, 360.0,
|
||||||
|
0.0,
|
||||||
|
CLUTTER_PARAM_READWRITE);
|
||||||
|
obj_props[PROP_ANGLE_END] = pspec;
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_ANGLE_END,
|
||||||
|
pspec);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterBehaviourRotate:axis:
|
||||||
|
*
|
||||||
|
* The axis of rotation.
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
pspec = g_param_spec_enum ("axis",
|
||||||
|
P_("Axis"),
|
||||||
|
P_("Axis of rotation"),
|
||||||
|
CLUTTER_TYPE_ROTATE_AXIS,
|
||||||
|
CLUTTER_Z_AXIS,
|
||||||
|
CLUTTER_PARAM_READWRITE);
|
||||||
|
obj_props[PROP_AXIS] = pspec;
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_AXIS,
|
||||||
|
pspec);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterBehaviourRotate:direction:
|
||||||
|
*
|
||||||
|
* The direction of the rotation.
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
pspec = g_param_spec_enum ("direction",
|
||||||
|
P_("Direction"),
|
||||||
|
P_("Direction of rotation"),
|
||||||
|
CLUTTER_TYPE_ROTATE_DIRECTION,
|
||||||
|
CLUTTER_ROTATE_CW,
|
||||||
|
CLUTTER_PARAM_READWRITE);
|
||||||
|
obj_props[PROP_DIRECTION] = pspec;
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_DIRECTION,
|
||||||
|
pspec);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterBehaviourRotate:center-x:
|
||||||
|
*
|
||||||
|
* The x center of rotation.
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
pspec = g_param_spec_int ("center-x",
|
||||||
|
P_("Center X"),
|
||||||
|
P_("X coordinate of the center of rotation"),
|
||||||
|
-G_MAXINT, G_MAXINT,
|
||||||
|
0,
|
||||||
|
CLUTTER_PARAM_READWRITE);
|
||||||
|
obj_props[PROP_CENTER_X] = pspec;
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_CENTER_X,
|
||||||
|
pspec);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterBehaviourRotate:center-y:
|
||||||
|
*
|
||||||
|
* The y center of rotation.
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
pspec = g_param_spec_int ("center-y",
|
||||||
|
P_("Center Y"),
|
||||||
|
P_("Y coordinate of the center of rotation"),
|
||||||
|
-G_MAXINT, G_MAXINT,
|
||||||
|
0,
|
||||||
|
CLUTTER_PARAM_READWRITE);
|
||||||
|
obj_props[PROP_CENTER_Y] = pspec;
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_CENTER_Y,
|
||||||
|
pspec);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterBehaviourRotate:center-z:
|
||||||
|
*
|
||||||
|
* The z center of rotation.
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
pspec = g_param_spec_int ("center-z",
|
||||||
|
P_("Center Z"),
|
||||||
|
P_("Z coordinate of the center of rotation"),
|
||||||
|
-G_MAXINT, G_MAXINT,
|
||||||
|
0,
|
||||||
|
CLUTTER_PARAM_READWRITE);
|
||||||
|
obj_props[PROP_CENTER_Z] = pspec;
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_CENTER_Z,
|
||||||
|
pspec);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_behaviour_rotate_init (ClutterBehaviourRotate *self)
|
||||||
|
{
|
||||||
|
self->priv = clutter_behaviour_rotate_get_instance_private (self);
|
||||||
|
|
||||||
|
self->priv->angle_start = 0.0;
|
||||||
|
self->priv->angle_end = 0.0;
|
||||||
|
|
||||||
|
self->priv->axis = CLUTTER_Z_AXIS;
|
||||||
|
self->priv->direction = CLUTTER_ROTATE_CW;
|
||||||
|
|
||||||
|
self->priv->center_x = 0;
|
||||||
|
self->priv->center_y = 0;
|
||||||
|
self->priv->center_z = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_behaviour_rotate_new:
|
||||||
|
* @alpha: (allow-none): a #ClutterAlpha instance, or %NULL
|
||||||
|
* @axis: the rotation axis
|
||||||
|
* @direction: the rotation direction
|
||||||
|
* @angle_start: the starting angle in degrees, between 0 and 360.
|
||||||
|
* @angle_end: the final angle in degrees, between 0 and 360.
|
||||||
|
*
|
||||||
|
* Creates a new #ClutterBehaviourRotate. This behaviour will rotate actors
|
||||||
|
* bound to it on @axis, following @direction, between @angle_start and
|
||||||
|
* @angle_end. Angles >= 360 degrees will be clamped to the canonical interval
|
||||||
|
* <0, 360), if angle_start == angle_end, the behaviour will carry out a
|
||||||
|
* single rotation of 360 degrees.
|
||||||
|
*
|
||||||
|
* If @alpha is not %NULL, the #ClutterBehaviour will take ownership
|
||||||
|
* of the #ClutterAlpha instance. In the case when @alpha is %NULL,
|
||||||
|
* it can be set later with clutter_behaviour_set_alpha().
|
||||||
|
*
|
||||||
|
* Return value: the newly created #ClutterBehaviourRotate.
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
ClutterBehaviour *
|
||||||
|
clutter_behaviour_rotate_new (ClutterAlpha *alpha,
|
||||||
|
ClutterRotateAxis axis,
|
||||||
|
ClutterRotateDirection direction,
|
||||||
|
gdouble angle_start,
|
||||||
|
gdouble angle_end)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (alpha == NULL || CLUTTER_IS_ALPHA (alpha), NULL);
|
||||||
|
|
||||||
|
return g_object_new (CLUTTER_TYPE_BEHAVIOUR_ROTATE,
|
||||||
|
"alpha", alpha,
|
||||||
|
"axis", axis,
|
||||||
|
"direction", direction,
|
||||||
|
"angle-start", angle_start,
|
||||||
|
"angle-end", angle_end,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_behaviour_rotate_get_axis:
|
||||||
|
* @rotate: a #ClutterBehaviourRotate
|
||||||
|
*
|
||||||
|
* Retrieves the #ClutterRotateAxis used by the rotate behaviour.
|
||||||
|
*
|
||||||
|
* Return value: the rotation axis
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
ClutterRotateAxis
|
||||||
|
clutter_behaviour_rotate_get_axis (ClutterBehaviourRotate *rotate)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate), CLUTTER_Z_AXIS);
|
||||||
|
|
||||||
|
return rotate->priv->axis;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_behaviour_rotate_set_axis:
|
||||||
|
* @rotate: a #ClutterBehaviourRotate
|
||||||
|
* @axis: a #ClutterRotateAxis
|
||||||
|
*
|
||||||
|
* Sets the axis used by the rotate behaviour.
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_behaviour_rotate_set_axis (ClutterBehaviourRotate *rotate,
|
||||||
|
ClutterRotateAxis axis)
|
||||||
|
{
|
||||||
|
ClutterBehaviourRotatePrivate *priv;
|
||||||
|
|
||||||
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate));
|
||||||
|
|
||||||
|
priv = rotate->priv;
|
||||||
|
|
||||||
|
if (priv->axis != axis)
|
||||||
|
{
|
||||||
|
priv->axis = axis;
|
||||||
|
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_AXIS]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_behaviour_rotate_get_direction:
|
||||||
|
* @rotate: a #ClutterBehaviourRotate
|
||||||
|
*
|
||||||
|
* Retrieves the #ClutterRotateDirection used by the rotate behaviour.
|
||||||
|
*
|
||||||
|
* Return value: the rotation direction
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
ClutterRotateDirection
|
||||||
|
clutter_behaviour_rotate_get_direction (ClutterBehaviourRotate *rotate)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate),
|
||||||
|
CLUTTER_ROTATE_CW);
|
||||||
|
|
||||||
|
return rotate->priv->direction;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_behaviour_rotate_set_direction:
|
||||||
|
* @rotate: a #ClutterBehaviourRotate
|
||||||
|
* @direction: the rotation direction
|
||||||
|
*
|
||||||
|
* Sets the rotation direction used by the rotate behaviour.
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_behaviour_rotate_set_direction (ClutterBehaviourRotate *rotate,
|
||||||
|
ClutterRotateDirection direction)
|
||||||
|
{
|
||||||
|
ClutterBehaviourRotatePrivate *priv;
|
||||||
|
|
||||||
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate));
|
||||||
|
|
||||||
|
priv = rotate->priv;
|
||||||
|
|
||||||
|
if (priv->direction != direction)
|
||||||
|
{
|
||||||
|
priv->direction = direction;
|
||||||
|
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_DIRECTION]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_behaviour_rotate_get_bounds:
|
||||||
|
* @rotate: a #ClutterBehaviourRotate
|
||||||
|
* @angle_start: (out): return value for the initial angle
|
||||||
|
* @angle_end: (out): return value for the final angle
|
||||||
|
*
|
||||||
|
* Retrieves the rotation boundaries of the rotate behaviour.
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_behaviour_rotate_get_bounds (ClutterBehaviourRotate *rotate,
|
||||||
|
gdouble *angle_start,
|
||||||
|
gdouble *angle_end)
|
||||||
|
{
|
||||||
|
ClutterBehaviourRotatePrivate *priv;
|
||||||
|
|
||||||
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate));
|
||||||
|
|
||||||
|
priv = rotate->priv;
|
||||||
|
|
||||||
|
if (angle_start)
|
||||||
|
*angle_start = priv->angle_start;
|
||||||
|
|
||||||
|
if (angle_end)
|
||||||
|
*angle_end = priv->angle_end;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_behaviour_rotate_set_bounds:
|
||||||
|
* @rotate: a #ClutterBehaviourRotate
|
||||||
|
* @angle_start: initial angle in degrees, between 0 and 360.
|
||||||
|
* @angle_end: final angle in degrees, between 0 and 360.
|
||||||
|
*
|
||||||
|
* Sets the initial and final angles of a rotation behaviour; angles >= 360
|
||||||
|
* degrees get clamped to the canonical interval <0, 360).
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_behaviour_rotate_set_bounds (ClutterBehaviourRotate *rotate,
|
||||||
|
gdouble angle_start,
|
||||||
|
gdouble angle_end)
|
||||||
|
{
|
||||||
|
ClutterBehaviourRotatePrivate *priv;
|
||||||
|
|
||||||
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate));
|
||||||
|
|
||||||
|
priv = rotate->priv;
|
||||||
|
|
||||||
|
g_object_freeze_notify (G_OBJECT (rotate));
|
||||||
|
|
||||||
|
if (priv->angle_start != angle_start)
|
||||||
|
{
|
||||||
|
priv->angle_start = clamp_angle (angle_start);
|
||||||
|
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_ANGLE_START]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (priv->angle_end != angle_end)
|
||||||
|
{
|
||||||
|
priv->angle_end = clamp_angle (angle_end);
|
||||||
|
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_ANGLE_END]);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_object_thaw_notify (G_OBJECT (rotate));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_behaviour_rotate_set_center:
|
||||||
|
* @rotate: a #ClutterBehaviourRotate
|
||||||
|
* @x: X axis center of rotation
|
||||||
|
* @y: Y axis center of rotation
|
||||||
|
* @z: Z axis center of rotation
|
||||||
|
*
|
||||||
|
* Sets the center of rotation. The coordinates are relative to the plane
|
||||||
|
* normal to the rotation axis set with clutter_behaviour_rotate_set_axis().
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_behaviour_rotate_set_center (ClutterBehaviourRotate *rotate,
|
||||||
|
gint x,
|
||||||
|
gint y,
|
||||||
|
gint z)
|
||||||
|
{
|
||||||
|
ClutterBehaviourRotatePrivate *priv;
|
||||||
|
|
||||||
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate));
|
||||||
|
|
||||||
|
priv = rotate->priv;
|
||||||
|
|
||||||
|
g_object_freeze_notify (G_OBJECT (rotate));
|
||||||
|
|
||||||
|
if (priv->center_x != x)
|
||||||
|
{
|
||||||
|
priv->center_x = x;
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_CENTER_X]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (priv->center_y != y)
|
||||||
|
{
|
||||||
|
priv->center_y = y;
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_CENTER_Y]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (priv->center_z != z)
|
||||||
|
{
|
||||||
|
priv->center_z = z;
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_CENTER_Z]);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_object_thaw_notify (G_OBJECT (rotate));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_behaviour_rotate_get_center:
|
||||||
|
* @rotate: a #ClutterBehaviourRotate
|
||||||
|
* @x: (out): return location for the X center of rotation
|
||||||
|
* @y: (out): return location for the Y center of rotation
|
||||||
|
* @z: (out): return location for the Z center of rotation
|
||||||
|
*
|
||||||
|
* Retrieves the center of rotation set using
|
||||||
|
* clutter_behaviour_rotate_set_center().
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_behaviour_rotate_get_center (ClutterBehaviourRotate *rotate,
|
||||||
|
gint *x,
|
||||||
|
gint *y,
|
||||||
|
gint *z)
|
||||||
|
{
|
||||||
|
ClutterBehaviourRotatePrivate *priv;
|
||||||
|
|
||||||
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate));
|
||||||
|
|
||||||
|
priv = rotate->priv;
|
||||||
|
|
||||||
|
if (x)
|
||||||
|
*x = priv->center_x;
|
||||||
|
|
||||||
|
if (y)
|
||||||
|
*y = priv->center_y;
|
||||||
|
|
||||||
|
if (z)
|
||||||
|
*z = priv->center_z;
|
||||||
|
}
|
||||||
119
clutter/clutter/deprecated/clutter-behaviour-rotate.h
Normal file
119
clutter/clutter/deprecated/clutter-behaviour-rotate.h
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
/*
|
||||||
|
* Clutter.
|
||||||
|
*
|
||||||
|
* An OpenGL based 'interactive canvas' library.
|
||||||
|
*
|
||||||
|
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||||
|
*
|
||||||
|
* Copyright (C) 2007 OpenedHand
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||||
|
#error "Only <clutter/clutter.h> can be included directly."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __CLUTTER_BEHAVIOUR_ROTATE_H__
|
||||||
|
#define __CLUTTER_BEHAVIOUR_ROTATE_H__
|
||||||
|
|
||||||
|
#include <clutter/clutter-types.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define CLUTTER_TYPE_BEHAVIOUR_ROTATE (clutter_behaviour_rotate_get_type ())
|
||||||
|
#define CLUTTER_BEHAVIOUR_ROTATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BEHAVIOUR_ROTATE, ClutterBehaviourRotate))
|
||||||
|
#define CLUTTER_IS_BEHAVIOUR_ROTATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BEHAVIOUR_ROTATE))
|
||||||
|
#define CLUTTER_BEHAVIOUR_ROTATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BEHAVIOUR_ROTATE, ClutterBehaviourRotateClass))
|
||||||
|
#define CLUTTER_IS_BEHAVIOUR_ROTATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BEHAVIOUR_ROTATE))
|
||||||
|
#define CLUTTER_BEHAVIOUR_ROTATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((klass), CLUTTER_TYPE_BEHAVIOUR_ROTATE, ClutterBehaviourRotateClass))
|
||||||
|
|
||||||
|
typedef struct _ClutterBehaviourRotate ClutterBehaviourRotate;
|
||||||
|
typedef struct _ClutterBehaviourRotatePrivate ClutterBehaviourRotatePrivate;
|
||||||
|
typedef struct _ClutterBehaviourRotateClass ClutterBehaviourRotateClass;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterBehaviourRotate:
|
||||||
|
*
|
||||||
|
* The #ClutterBehaviourRotate struct contains only private data and
|
||||||
|
* should be accessed using the provided API
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6: Use clutter_actor_animate() instead.
|
||||||
|
*/
|
||||||
|
struct _ClutterBehaviourRotate
|
||||||
|
{
|
||||||
|
/*< private >*/
|
||||||
|
ClutterBehaviour parent_instance;
|
||||||
|
|
||||||
|
ClutterBehaviourRotatePrivate *priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterBehaviourRotateClass:
|
||||||
|
*
|
||||||
|
* The #ClutterBehaviourRotateClass struct contains only private data
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6
|
||||||
|
*/
|
||||||
|
struct _ClutterBehaviourRotateClass
|
||||||
|
{
|
||||||
|
/*< private >*/
|
||||||
|
ClutterBehaviourClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
GType clutter_behaviour_rotate_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_FOR(clutter_actor_animate)
|
||||||
|
ClutterBehaviour * clutter_behaviour_rotate_new (ClutterAlpha *alpha,
|
||||||
|
ClutterRotateAxis axis,
|
||||||
|
ClutterRotateDirection direction,
|
||||||
|
gdouble angle_start,
|
||||||
|
gdouble angle_end);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_rotate_get_center (ClutterBehaviourRotate *rotate,
|
||||||
|
gint *x,
|
||||||
|
gint *y,
|
||||||
|
gint *z);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_rotate_set_center (ClutterBehaviourRotate *rotate,
|
||||||
|
gint x,
|
||||||
|
gint y,
|
||||||
|
gint z);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
ClutterRotateAxis clutter_behaviour_rotate_get_axis (ClutterBehaviourRotate *rotate);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_rotate_set_axis (ClutterBehaviourRotate *rotate,
|
||||||
|
ClutterRotateAxis axis);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
ClutterRotateDirection clutter_behaviour_rotate_get_direction (ClutterBehaviourRotate *rotate);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_rotate_set_direction (ClutterBehaviourRotate *rotate,
|
||||||
|
ClutterRotateDirection direction);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_rotate_get_bounds (ClutterBehaviourRotate *rotate,
|
||||||
|
gdouble *angle_start,
|
||||||
|
gdouble *angle_end);
|
||||||
|
CLUTTER_DEPRECATED
|
||||||
|
void clutter_behaviour_rotate_set_bounds (ClutterBehaviourRotate *rotate,
|
||||||
|
gdouble angle_start,
|
||||||
|
gdouble angle_end);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __CLUTTER_BEHAVIOUR_ROTATE_H__ */
|
||||||
@@ -101,8 +101,7 @@ enum
|
|||||||
|
|
||||||
static GParamSpec *obj_props[PROP_LAST];
|
static GParamSpec *obj_props[PROP_LAST];
|
||||||
|
|
||||||
enum
|
enum {
|
||||||
{
|
|
||||||
APPLIED,
|
APPLIED,
|
||||||
REMOVED,
|
REMOVED,
|
||||||
LAST_SIGNAL
|
LAST_SIGNAL
|
||||||
|
|||||||
261
clutter/clutter/deprecated/clutter-frame-source.c
Normal file
261
clutter/clutter/deprecated/clutter-frame-source.c
Normal file
@@ -0,0 +1,261 @@
|
|||||||
|
/*
|
||||||
|
* Clutter.
|
||||||
|
*
|
||||||
|
* An OpenGL based 'interactive canvas' library.
|
||||||
|
*
|
||||||
|
* Authored By Neil Roberts <neil@linux.intel.com>
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008 OpenedHand
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "clutter-build-config.h"
|
||||||
|
|
||||||
|
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
|
#include "clutter-main.h"
|
||||||
|
#include "clutter-private.h"
|
||||||
|
|
||||||
|
#include "deprecated/clutter-frame-source.h"
|
||||||
|
#include "deprecated/clutter-timeout-interval.h"
|
||||||
|
|
||||||
|
typedef struct _ClutterFrameSource ClutterFrameSource;
|
||||||
|
|
||||||
|
struct _ClutterFrameSource
|
||||||
|
{
|
||||||
|
GSource source;
|
||||||
|
|
||||||
|
ClutterTimeoutInterval timeout;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gboolean clutter_frame_source_prepare (GSource *source,
|
||||||
|
gint *timeout);
|
||||||
|
static gboolean clutter_frame_source_check (GSource *source);
|
||||||
|
static gboolean clutter_frame_source_dispatch (GSource *source,
|
||||||
|
GSourceFunc callback,
|
||||||
|
gpointer user_data);
|
||||||
|
|
||||||
|
static GSourceFuncs clutter_frame_source_funcs =
|
||||||
|
{
|
||||||
|
clutter_frame_source_prepare,
|
||||||
|
clutter_frame_source_check,
|
||||||
|
clutter_frame_source_dispatch,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_frame_source_add_full: (rename-to clutter_frame_source_add)
|
||||||
|
* @priority: the priority of the frame source. Typically this will be in the
|
||||||
|
* range between %G_PRIORITY_DEFAULT and %G_PRIORITY_HIGH.
|
||||||
|
* @fps: the number of times per second to call the function
|
||||||
|
* @func: function to call
|
||||||
|
* @data: data to pass to the function
|
||||||
|
* @notify: function to call when the timeout source is removed
|
||||||
|
*
|
||||||
|
* Sets a function to be called at regular intervals with the given
|
||||||
|
* priority. The function is called repeatedly until it returns
|
||||||
|
* %FALSE, at which point the timeout is automatically destroyed and
|
||||||
|
* the function will not be called again. The @notify function is
|
||||||
|
* called when the timeout is destroyed. The first call to the
|
||||||
|
* function will be at the end of the first @interval.
|
||||||
|
*
|
||||||
|
* This function is similar to g_timeout_add_full() except that it
|
||||||
|
* will try to compensate for delays. For example, if @func takes half
|
||||||
|
* the interval time to execute then the function will be called again
|
||||||
|
* half the interval time after it finished. In contrast
|
||||||
|
* g_timeout_add_full() would not fire until a full interval after the
|
||||||
|
* function completes so the delay between calls would be 1.0 / @fps *
|
||||||
|
* 1.5. This function does not however try to invoke the function
|
||||||
|
* multiple times to catch up missing frames if @func takes more than
|
||||||
|
* @interval ms to execute.
|
||||||
|
*
|
||||||
|
* Return value: the ID (greater than 0) of the event source.
|
||||||
|
*
|
||||||
|
* Since: 0.8
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6: There is no direct replacement for this API.
|
||||||
|
*/
|
||||||
|
guint
|
||||||
|
clutter_frame_source_add_full (gint priority,
|
||||||
|
guint fps,
|
||||||
|
GSourceFunc func,
|
||||||
|
gpointer data,
|
||||||
|
GDestroyNotify notify)
|
||||||
|
{
|
||||||
|
guint ret;
|
||||||
|
GSource *source = g_source_new (&clutter_frame_source_funcs,
|
||||||
|
sizeof (ClutterFrameSource));
|
||||||
|
ClutterFrameSource *frame_source = (ClutterFrameSource *) source;
|
||||||
|
|
||||||
|
_clutter_timeout_interval_init (&frame_source->timeout, fps);
|
||||||
|
|
||||||
|
if (priority != G_PRIORITY_DEFAULT)
|
||||||
|
g_source_set_priority (source, priority);
|
||||||
|
|
||||||
|
g_source_set_name (source, "Clutter frame timeout");
|
||||||
|
g_source_set_callback (source, func, data, notify);
|
||||||
|
|
||||||
|
ret = g_source_attach (source, NULL);
|
||||||
|
|
||||||
|
g_source_unref (source);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_frame_source_add: (skip)
|
||||||
|
* @fps: the number of times per second to call the function
|
||||||
|
* @func: function to call
|
||||||
|
* @data: data to pass to the function
|
||||||
|
*
|
||||||
|
* Simple wrapper around clutter_frame_source_add_full().
|
||||||
|
*
|
||||||
|
* Return value: the ID (greater than 0) of the event source.
|
||||||
|
*
|
||||||
|
* Since: 0.8
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6: There is no direct replacement for this API
|
||||||
|
*/
|
||||||
|
guint
|
||||||
|
clutter_frame_source_add (guint fps,
|
||||||
|
GSourceFunc func,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
return clutter_frame_source_add_full (G_PRIORITY_DEFAULT,
|
||||||
|
fps, func, data, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
clutter_frame_source_prepare (GSource *source,
|
||||||
|
gint *delay)
|
||||||
|
{
|
||||||
|
ClutterFrameSource *frame_source = (ClutterFrameSource *) source;
|
||||||
|
gint64 current_time;
|
||||||
|
|
||||||
|
#if GLIB_CHECK_VERSION (2, 27, 3)
|
||||||
|
current_time = g_source_get_time (source) / 1000;
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
GTimeVal source_time;
|
||||||
|
g_source_get_current_time (source, &source_time);
|
||||||
|
current_time = source_time.tv_sec * 1000 + source_time.tv_usec / 1000;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return _clutter_timeout_interval_prepare (current_time,
|
||||||
|
&frame_source->timeout,
|
||||||
|
delay);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
clutter_frame_source_check (GSource *source)
|
||||||
|
{
|
||||||
|
return clutter_frame_source_prepare (source, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
clutter_frame_source_dispatch (GSource *source,
|
||||||
|
GSourceFunc callback,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
ClutterFrameSource *frame_source = (ClutterFrameSource *) source;
|
||||||
|
|
||||||
|
return _clutter_timeout_interval_dispatch (&frame_source->timeout,
|
||||||
|
callback, user_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_threads_add_frame_source_full: (rename-to clutter_threads_add_frame_source)
|
||||||
|
* @priority: the priority of the frame source. Typically this will be in the
|
||||||
|
* range between %G_PRIORITY_DEFAULT and %G_PRIORITY_HIGH.
|
||||||
|
* @fps: the number of times per second to call the function
|
||||||
|
* @func: function to call
|
||||||
|
* @data: data to pass to the function
|
||||||
|
* @notify: function to call when the timeout source is removed
|
||||||
|
*
|
||||||
|
* Sets a function to be called at regular intervals holding the Clutter
|
||||||
|
* threads lock, with the given priority. The function is called repeatedly
|
||||||
|
* until it returns %FALSE, at which point the timeout is automatically
|
||||||
|
* removed and the function will not be called again. The @notify function
|
||||||
|
* is called when the timeout is removed.
|
||||||
|
*
|
||||||
|
* This function is similar to clutter_threads_add_timeout_full()
|
||||||
|
* except that it will try to compensate for delays. For example, if
|
||||||
|
* @func takes half the interval time to execute then the function
|
||||||
|
* will be called again half the interval time after it finished. In
|
||||||
|
* contrast clutter_threads_add_timeout_full() would not fire until a
|
||||||
|
* full interval after the function completes so the delay between
|
||||||
|
* calls would be @interval * 1.5. This function does not however try
|
||||||
|
* to invoke the function multiple times to catch up missing frames if
|
||||||
|
* @func takes more than @interval ms to execute.
|
||||||
|
*
|
||||||
|
* See also clutter_threads_add_idle_full().
|
||||||
|
*
|
||||||
|
* Return value: the ID (greater than 0) of the event source.
|
||||||
|
*
|
||||||
|
* Since: 0.8
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6: There is no direct replacement for this API
|
||||||
|
*/
|
||||||
|
guint
|
||||||
|
clutter_threads_add_frame_source_full (gint priority,
|
||||||
|
guint fps,
|
||||||
|
GSourceFunc func,
|
||||||
|
gpointer data,
|
||||||
|
GDestroyNotify notify)
|
||||||
|
{
|
||||||
|
ClutterThreadsDispatch *dispatch;
|
||||||
|
|
||||||
|
g_return_val_if_fail (func != NULL, 0);
|
||||||
|
|
||||||
|
dispatch = g_slice_new (ClutterThreadsDispatch);
|
||||||
|
dispatch->func = func;
|
||||||
|
dispatch->data = data;
|
||||||
|
dispatch->notify = notify;
|
||||||
|
|
||||||
|
return clutter_frame_source_add_full (priority,
|
||||||
|
fps,
|
||||||
|
_clutter_threads_dispatch, dispatch,
|
||||||
|
_clutter_threads_dispatch_free);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_threads_add_frame_source: (skip)
|
||||||
|
* @fps: the number of times per second to call the function
|
||||||
|
* @func: function to call
|
||||||
|
* @data: data to pass to the function
|
||||||
|
*
|
||||||
|
* Simple wrapper around clutter_threads_add_frame_source_full().
|
||||||
|
*
|
||||||
|
* Return value: the ID (greater than 0) of the event source.
|
||||||
|
*
|
||||||
|
* Since: 0.8
|
||||||
|
*
|
||||||
|
* Deprecated: 1.6: There is no direct replacement for this API
|
||||||
|
*/
|
||||||
|
guint
|
||||||
|
clutter_threads_add_frame_source (guint fps,
|
||||||
|
GSourceFunc func,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (func != NULL, 0);
|
||||||
|
|
||||||
|
return clutter_threads_add_frame_source_full (G_PRIORITY_DEFAULT,
|
||||||
|
fps,
|
||||||
|
func, data,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user