Compare commits
1 Commits
wip/nielsd
...
wip/fmuell
Author | SHA1 | Date | |
---|---|---|---|
9622733140 |
@ -1,4 +1,4 @@
|
||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v2
|
||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v1
|
||||
|
||||
stages:
|
||||
- review
|
||||
@ -7,8 +7,6 @@ stages:
|
||||
|
||||
check-commit-log:
|
||||
stage: review
|
||||
variables:
|
||||
GIT_DEPTH: "100"
|
||||
script:
|
||||
- ./.gitlab-ci/check-commit-log.sh
|
||||
only:
|
||||
@ -17,21 +15,7 @@ check-commit-log:
|
||||
build-mutter:
|
||||
stage: build
|
||||
script:
|
||||
- meson . build -Dbuildtype=debugoptimized -Degl_device=true -Dwayland_eglstream=true --werror --prefix /usr
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
artifacts:
|
||||
expire_in: 1 day
|
||||
paths:
|
||||
- build
|
||||
only:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
||||
build-without-native-backend-and-wayland:
|
||||
stage: build
|
||||
script:
|
||||
- meson . build -Dbuildtype=debugoptimized -Dnative_backend=false -Dudev=false -Dwayland=false -Dcore_tests=false --werror --prefix /usr
|
||||
- meson . build -Dbuildtype=debugoptimized -Degl_device=true -Dwayland_eglstream=true --werror
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
artifacts:
|
||||
@ -49,31 +33,12 @@ test-mutter:
|
||||
variables:
|
||||
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
|
||||
GSETTINGS_SCHEMA_DIR: "$CI_PROJECT_DIR/build/data"
|
||||
G_SLICE: "always-malloc"
|
||||
MALLOC_CHECK_: "3"
|
||||
NO_AT_BRIDGE: "1"
|
||||
MALLOC_PERTURB_: "123"
|
||||
script:
|
||||
- dconf update
|
||||
- mkdir -m 700 $XDG_RUNTIME_DIR
|
||||
- glib-compile-schemas $GSETTINGS_SCHEMA_DIR
|
||||
- >
|
||||
dbus-run-session -- xvfb-run -s '+iglx -noreset'
|
||||
meson test -C build --no-rebuild -t 10 --verbose --no-stdsplit --print-errorlogs --wrap catchsegv
|
||||
only:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
||||
can-build-gnome-shell:
|
||||
stage: test
|
||||
dependencies:
|
||||
- build-mutter
|
||||
before_script:
|
||||
- meson install --no-rebuild -C build
|
||||
script:
|
||||
- .gitlab-ci/checkout-gnome-shell.sh
|
||||
- meson gnome-shell gnome-shell/build --prefix /usr -Dman=false
|
||||
- ninja -C gnome-shell/build install
|
||||
meson test -C build --no-rebuild -t 10 --verbose --no-stdsplit --wrap catchsegv
|
||||
only:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
@ -1,40 +1,17 @@
|
||||
# Rebuild and push with
|
||||
#
|
||||
# cd .gitlab-ci/
|
||||
# docker build --no-cache -t registry.gitlab.gnome.org/gnome/mutter/master:v2 .
|
||||
# docker push registry.gitlab.gnome.org/gnome/mutter/master:v2
|
||||
#
|
||||
|
||||
FROM fedora:30
|
||||
FROM fedora:29
|
||||
|
||||
RUN dnf -y update && dnf -y upgrade && \
|
||||
dnf install -y 'dnf-command(builddep)' && \
|
||||
dnf install -y 'dnf-command(copr)' && \
|
||||
dnf copr enable -y fmuellner/gnome-shell-ci && \
|
||||
dnf copr enable -y jadahl/mutter-ci && \
|
||||
dnf copr enable -y hergertme/sysprof-3 && \
|
||||
dnf -y update && dnf -y upgrade && \
|
||||
|
||||
dnf builddep -y mutter && \
|
||||
|
||||
# Until Fedora catches up with meson build-deps
|
||||
dnf install -y meson xorg-x11-server-Xorg gnome-settings-daemon-devel egl-wayland-devel xorg-x11-server-Xwayland graphene-devel && \
|
||||
|
||||
# Until Fedora catches up with mesa bug fixes
|
||||
dnf upgrade -y mesa-dri-drivers mesa-libEGL && \
|
||||
dnf install -y meson xorg-x11-server-Xorg gnome-settings-daemon-devel egl-wayland-devel xorg-x11-server-Xwayland && \
|
||||
|
||||
# For running unit tests
|
||||
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 '*/xvfb-run' gdm-lib accountsservice-libs && \
|
||||
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 && \
|
||||
|
||||
dnf install -y sysprof-devel && \
|
||||
# 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 && \
|
||||
|
||||
# GNOME Shell
|
||||
dnf builddep -y gnome-shell --setopt=install_weak_deps=False && \
|
||||
# New dep this cycle
|
||||
dnf install -y 'pkgconfig(gnome-autoar-0)' && \
|
||||
dnf remove -y gnome-bluetooth-libs-devel dbus-glib-devel upower-devel python3-devel && \
|
||||
dnf remove -y --noautoremove mutter mutter-devel && \
|
||||
|
||||
dnf clean all
|
||||
|
@ -23,35 +23,9 @@ function commit_message_has_url() {
|
||||
return $?
|
||||
}
|
||||
|
||||
function commit_message_subject_is_compliant() {
|
||||
commit=$1
|
||||
commit_message_subject=$(git show -s --format='format:%s' $commit)
|
||||
|
||||
if echo "$commit_message_subject" | grep -qe "\(^meta-\|^Meta\)"; then
|
||||
echo " - message subject should not be prefixed with 'meta-' or 'Meta'"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if echo "$commit_message_subject" | grep -qe "\.[ch]:"; then
|
||||
echo " - message subject prefix should not include .c, .h, etc."
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
for commit in $commits; do
|
||||
commit_short=$(echo $commit | cut -c -8)
|
||||
|
||||
if ! commit_message_has_url $commit; then
|
||||
echo "Missing merge request or issue URL on commit $commit_short"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
errors=$(commit_message_subject_is_compliant $commit)
|
||||
if [ $? != 0 ]; then
|
||||
echo "Commit message for $commit_short is not compliant:"
|
||||
echo "$errors"
|
||||
echo "Missing merge request or issue URL on commit $(echo $commit | cut -c -8)"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
@ -1,35 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
mutter_branch=$(git describe --contains --all HEAD)
|
||||
gnome_shell_target=
|
||||
|
||||
git clone https://gitlab.gnome.org/GNOME/gnome-shell.git
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo Checkout failed
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd gnome-shell
|
||||
|
||||
if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ]; then
|
||||
merge_request_remote=${CI_MERGE_REQUEST_SOURCE_PROJECT_URL//mutter/gnome-shell}
|
||||
merge_request_branch=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
|
||||
|
||||
echo Looking for $merge_request_branch on remote ...
|
||||
if git fetch -q $merge_request_remote $merge_request_branch 2>/dev/null; then
|
||||
gnome_shell_target=FETCH_HEAD
|
||||
else
|
||||
gnome_shell_target=origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
|
||||
echo Using $gnome_shell_target instead
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$gnome_shell_target" ]; then
|
||||
gnome_shell_target=$(git branch -r -l origin/$mutter_branch)
|
||||
gnome_shell_target=${gnome_shell_target:-$(git branch -r -l ${mutter_branch#remotes/})}
|
||||
gnome_shell_target=${gnome_shell_target:-origin/master}
|
||||
echo Using $gnome_shell_target instead
|
||||
fi
|
||||
|
||||
git checkout -q $gnome_shell_target
|
295
NEWS
295
NEWS
@ -1,298 +1,3 @@
|
||||
3.35.1
|
||||
======
|
||||
* Fix immediate screen blank after releaseing inhibitor [Tim; #573]
|
||||
* Respond to frame callbacks regardless of damage [Jonas; !839]
|
||||
* selection [Carlos; !842]
|
||||
* Fix Night Light on wayland [Jonas; !840]
|
||||
* Fix various copy+paste/DND regressions [Carlos; !848, #789, #842,
|
||||
#793, #845, #854]
|
||||
* Misc. bug fixes and cleanups [Daniel, Marco, Jonas, Georges;
|
||||
!841, !764, !837, !846]
|
||||
|
||||
Contributors:
|
||||
Marco Trevisan (Treviño), Carlos Garnacho, Tim Klocke,
|
||||
Georges Basile Stavracas Neto, Daniel van Vugt, Jonas Ådahl
|
||||
|
||||
3.34.1
|
||||
======
|
||||
* Fix startup of X11 session services on wayland [Carlos; #771]
|
||||
* Fix _NET_ACTIVE_WINDOW emission [Carlos; #751]
|
||||
* Fix initial view perspective [Marco; !803]
|
||||
* Fix screenshots and window animations when scaled [Robert; !758]
|
||||
* Re-enable coredumps when capabilities are set [Jonas; !811]
|
||||
* Fix scaling of DND surface actors [Robert; !780]
|
||||
* Optimize blitting of untransformed offscreen stage views [Olivier; !809, !820]
|
||||
* Fix freeze of pointer event delivery on X11 [Olivier; !821]
|
||||
* Fix scaling of stylus input coordinates with HiDPI [Dorian; !830]
|
||||
* Fix memory leak when using implicit animations [Jonas; !828]
|
||||
* Fix numlock state for native backend [Carlos; #769]
|
||||
* Fixed crashes [Marco, Olivier, Jonas Å.; !805, #823, !808, !825,
|
||||
#844, !826, #779]
|
||||
* Misc. bug fixes and cleanups [Jonas Å., Georges, Jonas D., Michal, Daniel,
|
||||
Iain, Adam, Marco, Carlos, Ting-Wei, Hans, Robert; !787, !795, !791, !797,
|
||||
!772, !775, !799, !778, !785, !782, !796, #819, !814, !769, !817, !783, !786,
|
||||
!829, !774, #822]
|
||||
|
||||
Contributors:
|
||||
Marco Trevisan (Treviño), Jonas Dreßler, Olivier Fourdan, Carlos Garnacho,
|
||||
Hans de Goede, Adam Jackson, Ting-Wei Lan, Iain Lane, Michal Lazo,
|
||||
Robert Mader, Georges Basile Stavracas Neto, Dorian Stoll, Daniel van Vugt,
|
||||
Jonas Ådahl
|
||||
|
||||
Translators:
|
||||
Milo Casagrande [it], Nathan Follens [nl], Matej Urbančič [sl],
|
||||
Ask Hjorth Larsen [da], Alan Mortensen [da], Jordi Mas [ca]
|
||||
|
||||
3.34.0
|
||||
======
|
||||
* Fix xdg-output v3 support [Olivier; !771]
|
||||
* Fix crash when changing decoration state [Jonas; !773]
|
||||
* Add and remove connectors on hot-plug [Jonas; !743]
|
||||
|
||||
Contributors:
|
||||
Olivier Fourdan, Jonas Ådahl
|
||||
|
||||
Translators:
|
||||
Rafael Fontenelle [pt_BR], Gwan-gyeong Mun [ko], Christian Kirbach [de],
|
||||
Claude Paroz [fr], Milo Casagrande [it], Emin Tufan Çetin [tr],
|
||||
Ryuta Fujii [ja]
|
||||
|
||||
3.33.92
|
||||
=======
|
||||
* Turn MetaShapedTexture into a ClutterContent implementation [Georges; !409]
|
||||
* Restore inhibit shortcut for overlay key [Olivier; #734]
|
||||
* Misc. pointer a11y improvements [Jonas D., Olivier; !746, !747, !745, !761]
|
||||
* Fix position of drag surfaces [Robert; !684]
|
||||
* Implement subsurface.place_below() for parents [Robert; !664]
|
||||
* Add meta_window_actor_get_image() [Jonas Å.; !752]
|
||||
* Revert faulty optimization from !719 [Jonas Å.; #735]
|
||||
* Add additional sysprof trace points [Jonas Å.; !757, !765]
|
||||
* Remove GLX "threaded swap wait" used on Nvidia [Daniel; !602]
|
||||
* Implement geometric picking [Daniel; !189]
|
||||
* Fix lost keyboard focus after DND [Olivier; #747]
|
||||
* Misc. bug fixes and cleanups [Florian, Carlos, Piotr, Hans, Georges, Robert,
|
||||
Ray, Mart, Rémi; !740, !672, !749, !751, !753, !730, !755, !756, !750, !715,
|
||||
#738944, !657, !768]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Rémi Bernon, Piotr Drąg, Jonas Dreßler, Olivier Fourdan,
|
||||
Carlos Garnacho, Hans de Goede, Robert Mader, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Mart Raudsepp, Ray Strode, Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Piotr Drąg [pl], Марко Костић [sr], Rūdolfs Mazurs [lv], Matej Urbančič [sl],
|
||||
Balázs Úr [hu], Fran Dieguez [gl], Jordi Mas [ca], Anders Jonsson [sv],
|
||||
Trần Ngọc Quân [vi], Tim Sabsch [de], Fabio Tomat [fur], Goran Vidović [hr],
|
||||
Marek Černocký [cs]
|
||||
|
||||
3.33.91
|
||||
=======
|
||||
* Fix primary selection copy and paste between X11 and wayland [Hans; #702]
|
||||
* Improve monitor hotplug support [Hans; !713]
|
||||
* Remove a source of frame skips [Daniel; !719]
|
||||
* Fix windows being lowered after unmaximizing with double click [Olivier; #88]
|
||||
* Remove Clutter API for global grabs [Jonas D.; !536]
|
||||
* Improve processing of incompressible events [Daniel; !711]
|
||||
* Add xdg-output v3 support [Olivier; !704]
|
||||
* Misc. bug fixes and cleanups [Jonas Å., Marco, Carlos, Adam, Albert, Niels,
|
||||
Olivier, Florian; !722, !385, !728, !726, !500, !731, !727, !700, !735, !738]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Albert Vaca Cintora, Jonas Dreßler, Olivier Fourdan,
|
||||
Carlos Garnacho, Hans de Goede, Niels De Graef, Adam Jackson, Florian Müllner,
|
||||
Marco Trevisan (Treviño), Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Asier Sarasua Garmendia [eu], Kukuh Syafaat [id], Florentina Mușat [ro],
|
||||
Aurimas Černius [lt], Daniel Mustieles [es]
|
||||
|
||||
3.33.90
|
||||
=======
|
||||
* Fix visibility of clones with hidden source [Florian; #683]
|
||||
* Reduce freezes when opening some popup windows [Carlos; #556]
|
||||
* Be more thorough when excluding obscured areas from painting [Carlos; !698]
|
||||
* Make it possible to start Xwayland on demand [Carlos; !709]
|
||||
* clutter: Expose layout_manager to transitions [Florian; !716]
|
||||
* Misc. bug fixes and cleanups [Mark, Florian, Iain, Niels, Carlos, Ray; !671,
|
||||
!691, !694, !696, !703, !707, !697, !710, !708, !714, #719, !721]
|
||||
|
||||
Contributors:
|
||||
Mark Blakeney, Carlos Garnacho, Niels De Graef, Iain Lane, Florian Müllner,
|
||||
Ray Strode
|
||||
|
||||
Translators:
|
||||
Asier Sarasua Garmendia [eu], Rafael Fontenelle [pt_BR], Fabio Tomat [fur],
|
||||
Florentina Mușat [ro]
|
||||
|
||||
3.33.4
|
||||
======
|
||||
* Discard page flip retries on hotplug [Jonas; !630]
|
||||
* Add xdg-output v2 support [Olivier; #645]
|
||||
* Restore DRM format fallbacks [Jonas; !662]
|
||||
* Don't emit ::size-changed when only position changed [Daniel; !568]
|
||||
* Expose workspace layout properties [Florian; !618]
|
||||
* Don't use grab modifiers when shortcuts are inhibited [Olivier; #642]
|
||||
* Fix stuttering due to unchanged power save mode notifications [Georges; !674]
|
||||
* Add API to reorder workspaces [Adam; !670]
|
||||
* Make picking a new focus window more reliable [Marco; !669]
|
||||
* Defer actor allocation till shown [Carlos; !677]
|
||||
* Try to use primary GPU for copy instead of glReadPixels [Pekka; !615]
|
||||
* Unset pointer focus when the cursor is hidden [Jonas D.; !448]
|
||||
* Fix modifier-drag on wayland subsurfaces [Robert; !604]
|
||||
* Fix background corruption on Nvidia after resuming from suspend [Daniel; !600]
|
||||
* Only grab the locate-pointer key when necessary [Olivier; !685, #647]
|
||||
* Misc. bug fixes and cleanups [Florian, Jonas, Daniel, Robert, Olivier,
|
||||
Georges, Marco, Carlos, Emmanuele; !648, !650, !647, !656, !658, !637,
|
||||
!663, !660, !659, !665, !666, !668, !667, #667, !676, !678, #672, !680,
|
||||
!683, !688, !689, !687]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Emmanuele Bassi, Adam Bieńkowski, Piotr Drąg, Jonas Dreßler,
|
||||
Olivier Fourdan, Carlos Garnacho, Robert Mader, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Pekka Paalanen, Marco Trevisan (Treviño),
|
||||
Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Fabio Tomat [fur], Kukuh Syafaat [id]
|
||||
|
||||
3.33.3
|
||||
======
|
||||
* Prepare for running Xwayland on demand [Carlos; !420]
|
||||
* Fix text selection color rendering [Florian; #494]
|
||||
* Fix black shadows when using fractional scaling [Robert; #609]
|
||||
* Honor startup sequence workspace on wayland [Carlos; gnome-shell#674]
|
||||
* Only emit 'grab-op-end` signal after dropping grabs [Marco; !596]
|
||||
* Add a Sysprof-based profiler [Jonas, Georges; !197, !603]
|
||||
* Relax "xwayland-allow-grabs" setting [Olivier; #597]
|
||||
* Implement locate-pointer accessibility feature [Olivier; !453]
|
||||
* Implement mouse accessibility [Olivier; !512]
|
||||
* Consolidate frame throttling [Daniel, Georges; !363]
|
||||
* Fix setting blank cursor under wayland [Jonas; #630]
|
||||
* Pixel-align OpenGL cursors [Jonas; !610]
|
||||
* Handle returning from fullscreen/maximization better [Jonas; !621]
|
||||
* Improve screencast support on multi-monitor systems [Georges; !623]
|
||||
* Fix running X11 applications with sudo under wayland [Hans; #643]
|
||||
* Implement toggle-keys notification [Olivier; #637]
|
||||
* Add initial KMS transactional support [Jonas; !525]
|
||||
* Improve finding new focus window when the old one is closed [Marco; #308]
|
||||
* Misc. bug fixes and cleanups [Jonas, Carlos, Marco, Florian, Pekka, Robert,
|
||||
Douglas, Georges, Daniel, Emil, Niels, Hans, Olivier, Ting-Wei, Corentin;
|
||||
!591, #398, !592, !581, !597, !598, !593, !497, #591, !545, gtk#1675, !601,
|
||||
#568, !564, !605, !609, !115, !214, !611, !617, !616, !619, !624, !622, !627,
|
||||
!628, !629, !632, !633, !631, !636, !639, !638, !634, !640, !529, !644, !590]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Piotr Drąg, Olivier Fourdan, Carlos Garnacho, Hans de Goede,
|
||||
Niels De Graef, Ting-Wei Lan, Robert Mader, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Corentin Noël, Pekka Paalanen, Douglas R. Reno,
|
||||
Marco Trevisan (Treviño), Emil Velikov, Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Balázs Úr [hu], Daniel Mustieles [es], Nathan Follens [nl], Goran Vidović [hr]
|
||||
|
||||
3.33.2
|
||||
======
|
||||
* Fix rendering lag on Xorg [Daniel; !520, !281]
|
||||
* Misc. bug fixes and cleanups [Carlos, Marco, Jonas D., Florian, Niels,
|
||||
Daniel, Benjamin, Jonas Å., Ignacio, Vasilis; #598, !576, !547, !578,
|
||||
!583, !582, !469, !524, !119, !571, !584, !585, !586, #425]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Benjamin Berg, Jonas Dreßler, Carlos Garnacho, Niels De Graef,
|
||||
Vasilis Liaskovitis, Florian Müllner, Ignacio Casal Quinteiro,
|
||||
Marco Trevisan (Treviño), Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Daniel Mustieles [es]
|
||||
|
||||
3.33.1
|
||||
======
|
||||
* Remove unused APIs and outdated driver support
|
||||
[Adam; !481, !468, !489, !487, !546]
|
||||
* Enable EGL_IMG_context_priority [Adam; !454]
|
||||
* Disable mouse keys with Numlock on [Olivier; #530]
|
||||
* Fix crash when restarting on X11 [Marco; #576]
|
||||
* Implement clipboard manager [Carlos; !320]
|
||||
* Fix spurious idle signals that prevent session unblank [Jonas Å.; !543]
|
||||
* Fix mapping of touchscreens that don't report dimensions [Carlos; #581]
|
||||
* Fix propagating fractional scaling factor [Robert; !537]
|
||||
* Add experimental RT scheduling support [Carlos; !460]
|
||||
* Misc. bug fixes and cleanups [Robert, Carlos, Olivier, Ray, Marco, Jonas D.,
|
||||
Georges, Daniel V., Daniel M; !467, !504, !551, !552, #575, #556, !557, !442,
|
||||
!562, !535, !548, #586, !567, !396, !422, !507]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Piotr Drąg, Jonas Dreßler, Olivier Fourdan, Carlos Garnacho,
|
||||
Adam Jackson, Robert Mader, Daniel García Moreno, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Ray Strode, Marco Trevisan (Treviño),
|
||||
Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Daniel Mustieles [es], Fabio Tomat [fur], Kukuh Syafaat [id]
|
||||
|
||||
3.32.1
|
||||
======
|
||||
* Fix fallback app menu on wayland [Florian; #493]
|
||||
* Fix elogind support [Tom; !491]
|
||||
* Fix startup notifications not timing out [Carlos; #501]
|
||||
* Fix keyboard accessibility toggle from keys
|
||||
[Olivier, Carlos; !501, #529, !531]
|
||||
* Fix touchscreen input on rotated displays [Carlos; #514]
|
||||
* Work around hangul text input bug [Carlos; #1365]
|
||||
* Fix blurry wallpaper scaling [Daniel; !505]
|
||||
* Fix placement of window menu when using fractional scaling [Jan; #527]
|
||||
* Fix repaint issues of offscreen effects on secondary monitors [Daniel; !511]
|
||||
* Fix windows not getting focus after launch [Daniel; #505]
|
||||
* Properly advertise support for 'underscan' property [Jonas; !507]
|
||||
* Improve power-saving handling [Jonas; !506]
|
||||
* Fix moving windows by super+touch [Jonas D.; !495]
|
||||
* Misc. bug fixes and cleanups [Benjamin, Florian, Adam, Marco, Pablo,
|
||||
Erik, Jonas, Heiher, Pekka, Daniel, Olivier, Carlos; !478, !475, !480,
|
||||
!482, #490, !488, #491, #480, !477, !496, !492, !485, !515, !519, !521,
|
||||
!216, !538, #541, #523]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Pablo Barciela, Benjamin Berg, Tom Briden, Jonas Dreßler,
|
||||
Olivier Fourdan, Carlos Garnacho, Jan Alexander Steffens (heftig), Heiher,
|
||||
Adam Jackson, Erik Kurzinger, Florian Müllner, Pekka Paalanen,
|
||||
Marco Trevisan (Treviño), Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Khaled Hosny [ar], Goran Vidović [hr], Daniel Mustieles [es]
|
||||
|
||||
3.32.0
|
||||
======
|
||||
* Fix deadlock when cancelling a theme sound [Andrea; !474]
|
||||
* Stop swizzling BGRA buffers (bye-bye inverted colors in screenshots
|
||||
and animations) [Carlos; !486]
|
||||
|
||||
Contributors:
|
||||
Andrea Azzarone, Carlos Garnacho, Robert Mader
|
||||
|
||||
3.31.92
|
||||
=======
|
||||
* Fix flicker of apps that use multiple SHM buffers [Jonas Å.; #199]
|
||||
* Don't disable page flips after temporary failues [Jonas Å.; #460]
|
||||
* Improve redraw performance [Carlos; !196]
|
||||
* Add cursor-mode support to window screencasting [Jonas Å.; !413]
|
||||
* Add back support for system-wide monitor configurations [Jonas Å.; !253]
|
||||
* Add fractional scaling support [Marco, Jonas Å.; !3]
|
||||
* Consider remapped keys when guessing keycode from keysym [Andrea; #443]
|
||||
* Stop turning on-screen-keyboard off on focus changes [Carlos; !432]
|
||||
* Fix crashes [Robert, Carlos, Jonas D., Florian; !447, #361, !426, #479]
|
||||
* Misc. bug fixes and cleanups [Benjamin, Adam, Olivier, Niels, Piotr; !457,
|
||||
!452, !459, !380, !361, !461, !464, !471, !473, !463]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Andrea Azzarone, Benjamin Berg, Piotr Drąg, Jonas Dreßler,
|
||||
Olivier Fourdan, Carlos Garnacho, Niels De Graef, Adam Jackson, Robert Mader,
|
||||
Florian Müllner, Marco Trevisan (Treviño)
|
||||
|
||||
Translators:
|
||||
Milo Casagrande [it], Tim Sabsch [de], Trần Ngọc Quân [vi],
|
||||
Gwan-gyeong Mun [ko], Марко Костић [sr], Daniel Mustieles [es],
|
||||
Rūdolfs Mazurs [lv], Nathan Follens [nl]
|
||||
|
||||
3.31.91
|
||||
=======
|
||||
* Fix infinite loop in EDID matching [Marco; #459]
|
||||
|
@ -657,7 +657,7 @@ cally_actor_get_extents (AtkComponent *component,
|
||||
ClutterActor *actor = NULL;
|
||||
gint top_level_x, top_level_y;
|
||||
gfloat f_width, f_height;
|
||||
graphene_point3d_t verts[4];
|
||||
ClutterVertex verts[4];
|
||||
ClutterActor *stage = NULL;
|
||||
|
||||
g_return_if_fail (CALLY_IS_ACTOR (component));
|
||||
@ -737,7 +737,11 @@ cally_actor_grab_focus (AtkComponent *component)
|
||||
*
|
||||
* This gets the top level origin, it is, the position of the stage in
|
||||
* the global screen. You can see it as the absolute display position
|
||||
* of the stage. This is 0,0 for a compositor.
|
||||
* of the stage.
|
||||
*
|
||||
* FIXME: only the case with x11 is implemented, other backends are
|
||||
* required
|
||||
*
|
||||
*/
|
||||
void
|
||||
_cally_actor_get_top_level_origin (ClutterActor *actor,
|
||||
@ -745,11 +749,54 @@ _cally_actor_get_top_level_origin (ClutterActor *actor,
|
||||
gint *yp)
|
||||
{
|
||||
/* default values */
|
||||
gint x = 0;
|
||||
gint y = 0;
|
||||
|
||||
#ifdef CLUTTER_WINDOWING_X11
|
||||
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
|
||||
{
|
||||
ClutterActor *stage = NULL;
|
||||
Display *display = NULL;
|
||||
Window root_window;
|
||||
Window stage_window;
|
||||
Window child;
|
||||
gint return_val = 0;
|
||||
|
||||
stage = clutter_actor_get_stage (actor);
|
||||
|
||||
/* FIXME: what happens if you use another display with
|
||||
clutter_backend_x11_set_display ?*/
|
||||
display = clutter_x11_get_default_display ();
|
||||
root_window = clutter_x11_get_root_window ();
|
||||
stage_window = clutter_x11_get_stage_window (CLUTTER_STAGE (stage));
|
||||
|
||||
return_val = XTranslateCoordinates (display, stage_window, root_window,
|
||||
0, 0, &x, &y,
|
||||
&child);
|
||||
|
||||
if (!return_val)
|
||||
g_warning ("[x11] We were not able to get proper absolute "
|
||||
"position of the stage");
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
static gboolean yet_warned = FALSE;
|
||||
|
||||
if (!yet_warned)
|
||||
{
|
||||
yet_warned = TRUE;
|
||||
|
||||
g_warning ("The current Clutter backend does not support using "
|
||||
"atk_component_get_extents() with ATK_XY_SCREEN.");
|
||||
}
|
||||
}
|
||||
|
||||
if (xp)
|
||||
*xp = 0;
|
||||
*xp = x;
|
||||
|
||||
if (yp)
|
||||
*yp = 0;
|
||||
*yp = y;
|
||||
}
|
||||
|
||||
/* AtkAction implementation */
|
||||
@ -997,8 +1044,10 @@ _cally_actor_clean_action_list (CallyActor *cally_actor)
|
||||
|
||||
if (priv->action_list)
|
||||
{
|
||||
g_list_free_full (priv->action_list,
|
||||
(GDestroyNotify) _cally_actor_destroy_action_info);
|
||||
g_list_foreach (priv->action_list,
|
||||
(GFunc) _cally_actor_destroy_action_info,
|
||||
NULL);
|
||||
g_list_free (priv->action_list);
|
||||
priv->action_list = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1438,7 +1438,7 @@ static void cally_text_get_character_extents (AtkText *text,
|
||||
PangoLayout *layout;
|
||||
PangoRectangle extents;
|
||||
const gchar *text_value;
|
||||
graphene_point3d_t verts[4];
|
||||
ClutterVertex verts[4];
|
||||
|
||||
actor = CALLY_GET_CLUTTER_ACTOR (text);
|
||||
if (actor == NULL) /* State is defunct */
|
||||
@ -2294,7 +2294,7 @@ _cally_misc_get_index_at_point (ClutterText *clutter_text,
|
||||
gint index, x_window, y_window, x_toplevel, y_toplevel;
|
||||
gint x_temp, y_temp;
|
||||
gboolean ret;
|
||||
graphene_point3d_t verts[4];
|
||||
ClutterVertex verts[4];
|
||||
PangoLayout *layout;
|
||||
gint x_layout, y_layout;
|
||||
|
||||
|
@ -340,7 +340,7 @@ clutter_actor_box_contains (const ClutterActorBox *box,
|
||||
/**
|
||||
* clutter_actor_box_from_vertices:
|
||||
* @box: a #ClutterActorBox
|
||||
* @verts: (array fixed-size=4): array of four #graphene_point3d_t
|
||||
* @verts: (array fixed-size=4): array of four #ClutterVertex
|
||||
*
|
||||
* Calculates the bounding box represented by the four vertices; for details
|
||||
* of the vertex array see clutter_actor_get_abs_allocation_vertices().
|
||||
@ -348,8 +348,8 @@ clutter_actor_box_contains (const ClutterActorBox *box,
|
||||
* Since: 1.0
|
||||
*/
|
||||
void
|
||||
clutter_actor_box_from_vertices (ClutterActorBox *box,
|
||||
const graphene_point3d_t verts[])
|
||||
clutter_actor_box_from_vertices (ClutterActorBox *box,
|
||||
const ClutterVertex verts[])
|
||||
{
|
||||
gfloat x_1, x_2, y_1, y_2;
|
||||
|
||||
@ -594,27 +594,6 @@ _clutter_actor_box_enlarge_for_effects (ClutterActorBox *box)
|
||||
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,
|
||||
clutter_actor_box_copy,
|
||||
clutter_actor_box_free,
|
||||
|
@ -577,7 +577,8 @@ _clutter_meta_group_clear_metas (ClutterMetaGroup *group)
|
||||
{
|
||||
g_list_foreach (group->meta, (GFunc) _clutter_actor_meta_set_actor, NULL);
|
||||
|
||||
g_list_free_full (group->meta, g_object_unref);
|
||||
g_list_foreach (group->meta, (GFunc) g_object_unref, NULL);
|
||||
g_list_free (group->meta);
|
||||
group->meta = NULL;
|
||||
}
|
||||
|
||||
|
@ -53,8 +53,7 @@ typedef enum
|
||||
* Controls some options for how clutter_actor_traverse() iterates
|
||||
* through the graph.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST = 1L<<0,
|
||||
CLUTTER_ACTOR_TRAVERSE_BREADTH_FIRST = 1L<<1
|
||||
} ClutterActorTraverseFlags;
|
||||
@ -75,8 +74,7 @@ typedef enum
|
||||
* the continuing traversal. It may stop traversal completely, just
|
||||
* 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_SKIP_CHILDREN = 1L<<1,
|
||||
CLUTTER_ACTOR_TRAVERSE_VISIT_BREAK = 1L<<2
|
||||
@ -135,7 +133,7 @@ struct _AnchorCoord
|
||||
} fraction;
|
||||
|
||||
/* Use when is_fractional == FALSE */
|
||||
graphene_point3d_t units;
|
||||
ClutterVertex units;
|
||||
} v;
|
||||
};
|
||||
|
||||
@ -163,7 +161,7 @@ struct _SizeRequest
|
||||
struct _ClutterLayoutInfo
|
||||
{
|
||||
/* fixed position coordinates */
|
||||
graphene_point_t fixed_pos;
|
||||
ClutterPoint fixed_pos;
|
||||
|
||||
ClutterMargin margin;
|
||||
|
||||
@ -173,8 +171,8 @@ struct _ClutterLayoutInfo
|
||||
guint x_expand : 1;
|
||||
guint y_expand : 1;
|
||||
|
||||
graphene_size_t minimum;
|
||||
graphene_size_t natural;
|
||||
ClutterSize minimum;
|
||||
ClutterSize natural;
|
||||
};
|
||||
|
||||
const ClutterLayoutInfo * _clutter_actor_get_layout_info_or_defaults (ClutterActor *self);
|
||||
@ -203,13 +201,13 @@ struct _ClutterTransformInfo
|
||||
AnchorCoord anchor;
|
||||
|
||||
/* translation */
|
||||
graphene_point3d_t translation;
|
||||
ClutterVertex translation;
|
||||
|
||||
/* z_position */
|
||||
gfloat z_position;
|
||||
|
||||
/* transformation center */
|
||||
graphene_point_t pivot;
|
||||
ClutterPoint pivot;
|
||||
gfloat pivot_z;
|
||||
|
||||
CoglMatrix transform;
|
||||
@ -242,6 +240,9 @@ ClutterAnimationInfo * _clutter_actor_get_animation_info
|
||||
ClutterTransition * _clutter_actor_create_transition (ClutterActor *self,
|
||||
GParamSpec *pspec,
|
||||
...);
|
||||
ClutterTransition * _clutter_actor_get_transition (ClutterActor *self,
|
||||
GParamSpec *pspec);
|
||||
|
||||
gboolean _clutter_actor_foreach_child (ClutterActor *self,
|
||||
ClutterForeachCallback callback,
|
||||
gpointer user_data);
|
||||
@ -274,9 +275,6 @@ void _clutter_actor_set_enable_paint_unmapped
|
||||
void _clutter_actor_set_has_pointer (ClutterActor *self,
|
||||
gboolean has_pointer);
|
||||
|
||||
void _clutter_actor_set_has_key_focus (ClutterActor *self,
|
||||
gboolean has_key_focus);
|
||||
|
||||
void _clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||
ClutterRedrawFlags flags,
|
||||
const ClutterPaintVolume *clip_volume);
|
||||
@ -297,6 +295,8 @@ const gchar * _clutter_actor_get_debug_name
|
||||
void _clutter_actor_push_clone_paint (void);
|
||||
void _clutter_actor_pop_clone_paint (void);
|
||||
|
||||
guint32 _clutter_actor_get_pick_id (ClutterActor *self);
|
||||
|
||||
void _clutter_actor_shader_pre_paint (ClutterActor *actor,
|
||||
gboolean repeat);
|
||||
void _clutter_actor_shader_post_paint (ClutterActor *actor);
|
||||
@ -313,11 +313,8 @@ void _clutter_actor_detach_clone
|
||||
void _clutter_actor_queue_redraw_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_update_resource_scale_recursive (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,
|
||||
CoglTexture *texture);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -233,7 +233,8 @@ struct _ClutterActorClass
|
||||
ClutterActor *old_parent);
|
||||
|
||||
void (* destroy) (ClutterActor *self);
|
||||
void (* pick) (ClutterActor *actor);
|
||||
void (* pick) (ClutterActor *actor,
|
||||
const ClutterColor *color);
|
||||
|
||||
gboolean (* queue_redraw) (ClutterActor *actor,
|
||||
ClutterActor *leaf_that_queued,
|
||||
@ -430,7 +431,7 @@ void clutter_actor_get_allocation_box
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_get_allocation_vertices (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
graphene_point3d_t *verts);
|
||||
ClutterVertex verts[]);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_actor_has_allocation (ClutterActor *self);
|
||||
CLUTTER_EXPORT
|
||||
@ -583,11 +584,6 @@ gboolean clutter_actor_is_in_clone_paint
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_actor_get_paint_box (ClutterActor *self,
|
||||
ClutterActorBox *box);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_actor_get_resource_scale (ClutterActor *self,
|
||||
gfloat *resource_scale);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_actor_has_overlaps (ClutterActor *self);
|
||||
|
||||
@ -816,16 +812,16 @@ gboolean clutter_actor_transform_stage_point
|
||||
gfloat *y_out);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_get_abs_allocation_vertices (ClutterActor *self,
|
||||
graphene_point3d_t *verts);
|
||||
ClutterVertex verts[]);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_apply_transform_to_point (ClutterActor *self,
|
||||
const graphene_point3d_t *point,
|
||||
graphene_point3d_t *vertex);
|
||||
const ClutterVertex *point,
|
||||
ClutterVertex *vertex);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
const graphene_point3d_t *point,
|
||||
graphene_point3d_t *vertex);
|
||||
const ClutterVertex *point,
|
||||
ClutterVertex *vertex);
|
||||
|
||||
/* Implicit animations */
|
||||
CLUTTER_EXPORT
|
||||
@ -901,10 +897,6 @@ void clutter_actor_bind_model_with_properties
|
||||
const char *first_model_property,
|
||||
...);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_pick_box (ClutterActor *self,
|
||||
const ClutterActorBox *box);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_ACTOR_H__ */
|
||||
|
@ -50,6 +50,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterConstraint, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterContainer, 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 (ClutterDeviceManager, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDragAction, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDropAction, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterEffect, g_object_unref)
|
||||
@ -93,6 +94,10 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterMatrix, clutter_matrix_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintNode, clutter_paint_node_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintVolume, clutter_paint_volume_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPathNode, clutter_path_node_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPoint, clutter_point_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterRect, clutter_rect_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterSize, clutter_size_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterVertex, clutter_vertex_free)
|
||||
|
||||
#endif /* __GI_SCANNER__ */
|
||||
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include <clutter/clutter-keymap.h>
|
||||
#include <clutter/clutter-stage-window.h>
|
||||
|
||||
#include "clutter-event-translator.h"
|
||||
|
||||
#define CLUTTER_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BACKEND, ClutterBackendClass))
|
||||
#define CLUTTER_IS_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BACKEND))
|
||||
#define CLUTTER_BACKEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BACKEND, ClutterBackendClass))
|
||||
@ -56,7 +58,7 @@ struct _ClutterBackend
|
||||
gfloat units_per_em;
|
||||
gint32 units_serial;
|
||||
|
||||
ClutterStageWindow *stage_window;
|
||||
GList *event_translators;
|
||||
|
||||
ClutterInputMethod *input_method;
|
||||
|
||||
@ -91,6 +93,12 @@ struct _ClutterBackendClass
|
||||
GError **error);
|
||||
ClutterDeviceManager *(* get_device_manager) (ClutterBackend *backend);
|
||||
|
||||
void (* copy_event_data) (ClutterBackend *backend,
|
||||
const ClutterEvent *src,
|
||||
ClutterEvent *dest);
|
||||
void (* free_event_data) (ClutterBackend *backend,
|
||||
ClutterEvent *event);
|
||||
|
||||
gboolean (* translate_event) (ClutterBackend *backend,
|
||||
gpointer native,
|
||||
ClutterEvent *event);
|
||||
@ -128,11 +136,17 @@ void _clutter_backend_copy_event_data (Clutter
|
||||
ClutterEvent *dest);
|
||||
void _clutter_backend_free_event_data (ClutterBackend *backend,
|
||||
ClutterEvent *event);
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_backend_translate_event (ClutterBackend *backend,
|
||||
gpointer native,
|
||||
ClutterEvent *event);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_backend_add_event_translator (ClutterBackend *backend,
|
||||
ClutterEventTranslator *translator);
|
||||
|
||||
void _clutter_backend_remove_event_translator (ClutterBackend *backend,
|
||||
ClutterEventTranslator *translator);
|
||||
|
||||
ClutterFeatureFlags _clutter_backend_get_features (ClutterBackend *backend);
|
||||
|
||||
gfloat _clutter_backend_get_units_per_em (ClutterBackend *backend,
|
||||
@ -146,8 +160,7 @@ void _clutter_backend_reset_cogl_framebuffer (Clutter
|
||||
|
||||
void clutter_set_allowed_drivers (const char *drivers);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterStageWindow * clutter_backend_get_stage_window (ClutterBackend *backend);
|
||||
void clutter_try_set_windowing_backend (const char *drivers);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -62,6 +62,9 @@
|
||||
#ifdef CLUTTER_INPUT_X11
|
||||
#include "x11/clutter-backend-x11.h"
|
||||
#endif
|
||||
#ifdef CLUTTER_INPUT_EVDEV
|
||||
#include "evdev/clutter-device-manager-evdev.h"
|
||||
#endif
|
||||
#ifdef CLUTTER_WINDOWING_EGL
|
||||
#include "egl/clutter-backend-eglnative.h"
|
||||
#endif
|
||||
@ -101,12 +104,10 @@ clutter_backend_dispose (GObject *gobject)
|
||||
/* clear the events still in the queue of the main context */
|
||||
_clutter_clear_events_queue ();
|
||||
|
||||
/* remove all event translators */
|
||||
g_clear_pointer (&backend->event_translators, g_list_free);
|
||||
|
||||
g_clear_pointer (&backend->dummy_onscreen, cogl_object_unref);
|
||||
if (backend->stage_window)
|
||||
{
|
||||
g_object_remove_weak_pointer (G_OBJECT (backend->stage_window),
|
||||
(gpointer *) &backend->stage_window);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (clutter_backend_parent_class)->dispose (gobject);
|
||||
}
|
||||
@ -396,7 +397,7 @@ clutter_backend_real_create_context (ClutterBackend *backend,
|
||||
else
|
||||
g_set_error_literal (error, CLUTTER_INIT_ERROR,
|
||||
CLUTTER_INIT_ERROR_BACKEND,
|
||||
"Unable to initialize the Clutter backend: no available drivers found.");
|
||||
_("Unable to initialize the Clutter backend: no available drivers found."));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -525,7 +526,40 @@ _clutter_create_backend (void)
|
||||
static void
|
||||
clutter_backend_real_init_events (ClutterBackend *backend)
|
||||
{
|
||||
g_error ("Unknown input backend");
|
||||
const char *input_backend = NULL;
|
||||
|
||||
input_backend = g_getenv ("CLUTTER_INPUT_BACKEND");
|
||||
if (input_backend != NULL)
|
||||
input_backend = g_intern_string (input_backend);
|
||||
|
||||
#ifdef CLUTTER_INPUT_X11
|
||||
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11) &&
|
||||
(input_backend == NULL || input_backend == I_(CLUTTER_INPUT_X11)))
|
||||
{
|
||||
_clutter_backend_x11_events_init (backend);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CLUTTER_INPUT_EVDEV
|
||||
/* Evdev can be used regardless of the windowing system */
|
||||
if ((input_backend != NULL && strcmp (input_backend, CLUTTER_INPUT_EVDEV) == 0)
|
||||
#ifdef CLUTTER_WINDOWING_EGL
|
||||
/* but we do want to always use it for EGL native */
|
||||
|| clutter_check_windowing_backend (CLUTTER_WINDOWING_EGL)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
_clutter_events_evdev_init (backend);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (input_backend != NULL)
|
||||
{
|
||||
if (input_backend != I_(CLUTTER_INPUT_NULL))
|
||||
g_error ("Unrecognized input backend '%s'", input_backend);
|
||||
}
|
||||
else
|
||||
g_error ("Unknown input backend");
|
||||
}
|
||||
|
||||
static ClutterDeviceManager *
|
||||
@ -552,6 +586,34 @@ clutter_backend_real_get_keymap (ClutterBackend *backend)
|
||||
return backend->keymap;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_backend_real_translate_event (ClutterBackend *backend,
|
||||
gpointer native,
|
||||
ClutterEvent *event)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = backend->event_translators;
|
||||
l != NULL;
|
||||
l = l->next)
|
||||
{
|
||||
ClutterEventTranslator *translator = l->data;
|
||||
ClutterTranslateReturn retval;
|
||||
|
||||
retval = _clutter_event_translator_translate_event (translator,
|
||||
native,
|
||||
event);
|
||||
|
||||
if (retval == CLUTTER_TRANSLATE_QUEUE)
|
||||
return TRUE;
|
||||
|
||||
if (retval == CLUTTER_TRANSLATE_REMOVE)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
{
|
||||
@ -574,7 +636,8 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterBackendClass, resolution_changed),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@ -591,7 +654,8 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterBackendClass, font_changed),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@ -608,7 +672,8 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterBackendClass, settings_changed),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
klass->resolution_changed = clutter_backend_real_resolution_changed;
|
||||
@ -616,6 +681,7 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
|
||||
klass->init_events = clutter_backend_real_init_events;
|
||||
klass->get_device_manager = clutter_backend_real_get_device_manager;
|
||||
klass->translate_event = clutter_backend_real_translate_event;
|
||||
klass->create_context = clutter_backend_real_create_context;
|
||||
klass->get_features = clutter_backend_real_get_features;
|
||||
klass->get_keymap = clutter_backend_real_get_keymap;
|
||||
@ -627,7 +693,7 @@ clutter_backend_init (ClutterBackend *self)
|
||||
self->units_per_em = -1.0;
|
||||
self->units_serial = 1;
|
||||
|
||||
self->dummy_onscreen = NULL;
|
||||
self->dummy_onscreen = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
void
|
||||
@ -695,10 +761,6 @@ _clutter_backend_create_stage (ClutterBackend *backend,
|
||||
|
||||
g_assert (CLUTTER_IS_STAGE_WINDOW (stage_window));
|
||||
|
||||
backend->stage_window = stage_window;
|
||||
g_object_add_weak_pointer (G_OBJECT (backend->stage_window),
|
||||
(gpointer *) &backend->stage_window);
|
||||
|
||||
return stage_window;
|
||||
}
|
||||
|
||||
@ -783,24 +845,37 @@ _clutter_backend_copy_event_data (ClutterBackend *backend,
|
||||
const ClutterEvent *src,
|
||||
ClutterEvent *dest)
|
||||
{
|
||||
ClutterDeviceManagerClass *device_manager_class;
|
||||
ClutterDeviceManager *device_manager;
|
||||
ClutterEventExtenderInterface *iface;
|
||||
ClutterBackendClass *klass;
|
||||
|
||||
device_manager = clutter_device_manager_get_default ();
|
||||
device_manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
device_manager_class->copy_event_data (device_manager, src, dest);
|
||||
klass = CLUTTER_BACKEND_GET_CLASS (backend);
|
||||
if (CLUTTER_IS_EVENT_EXTENDER (backend->device_manager))
|
||||
{
|
||||
iface = CLUTTER_EVENT_EXTENDER_GET_IFACE (backend->device_manager);
|
||||
iface->copy_event_data (CLUTTER_EVENT_EXTENDER (backend->device_manager),
|
||||
src, dest);
|
||||
}
|
||||
else if (klass->copy_event_data != NULL)
|
||||
klass->copy_event_data (backend, src, dest);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_backend_free_event_data (ClutterBackend *backend,
|
||||
ClutterEvent *event)
|
||||
{
|
||||
ClutterDeviceManagerClass *device_manager_class;
|
||||
ClutterDeviceManager *device_manager;
|
||||
ClutterEventExtenderInterface *iface;
|
||||
ClutterBackendClass *klass;
|
||||
|
||||
device_manager = clutter_device_manager_get_default ();
|
||||
device_manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
device_manager_class->free_event_data (device_manager, event);
|
||||
klass = CLUTTER_BACKEND_GET_CLASS (backend);
|
||||
|
||||
if (CLUTTER_IS_EVENT_EXTENDER (backend->device_manager))
|
||||
{
|
||||
iface = CLUTTER_EVENT_EXTENDER_GET_IFACE (backend->device_manager);
|
||||
iface->free_event_data (CLUTTER_EVENT_EXTENDER (backend->device_manager),
|
||||
event);
|
||||
}
|
||||
else if (klass->free_event_data != NULL)
|
||||
klass->free_event_data (backend, event);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -946,6 +1021,28 @@ _clutter_backend_translate_event (ClutterBackend *backend,
|
||||
event);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_backend_add_event_translator (ClutterBackend *backend,
|
||||
ClutterEventTranslator *translator)
|
||||
{
|
||||
if (g_list_find (backend->event_translators, translator) != NULL)
|
||||
return;
|
||||
|
||||
backend->event_translators =
|
||||
g_list_prepend (backend->event_translators, translator);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_backend_remove_event_translator (ClutterBackend *backend,
|
||||
ClutterEventTranslator *translator)
|
||||
{
|
||||
if (g_list_find (backend->event_translators, translator) == NULL)
|
||||
return;
|
||||
|
||||
backend->event_translators =
|
||||
g_list_remove (backend->event_translators, translator);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_backend_get_cogl_context: (skip)
|
||||
* @backend: a #ClutterBackend
|
||||
@ -997,6 +1094,61 @@ clutter_wayland_set_compositor_display (void *display)
|
||||
}
|
||||
#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
|
||||
_clutter_backend_get_keymap_direction (ClutterBackend *backend)
|
||||
{
|
||||
@ -1012,9 +1164,9 @@ _clutter_backend_get_keymap_direction (ClutterBackend *backend)
|
||||
void
|
||||
_clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
|
||||
{
|
||||
if (backend->dummy_onscreen == NULL)
|
||||
if (backend->dummy_onscreen == COGL_INVALID_HANDLE)
|
||||
{
|
||||
GError *internal_error = NULL;
|
||||
CoglError *internal_error = NULL;
|
||||
|
||||
backend->dummy_onscreen = cogl_onscreen_new (backend->cogl_context, 1, 1);
|
||||
|
||||
@ -1022,7 +1174,7 @@ _clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
|
||||
&internal_error))
|
||||
{
|
||||
g_critical ("Unable to create dummy onscreen: %s", internal_error->message);
|
||||
g_error_free (internal_error);
|
||||
cogl_error_free (internal_error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1093,9 +1245,3 @@ clutter_backend_get_keymap (ClutterBackend *backend)
|
||||
{
|
||||
return CLUTTER_BACKEND_GET_CLASS (backend)->get_keymap (backend);
|
||||
}
|
||||
|
||||
ClutterStageWindow *
|
||||
clutter_backend_get_stage_window (ClutterBackend *backend)
|
||||
{
|
||||
return backend->stage_window;
|
||||
}
|
||||
|
@ -60,6 +60,9 @@ GType clutter_backend_get_type (void) G_GNUC_CONST;
|
||||
CLUTTER_EXPORT
|
||||
ClutterBackend * clutter_get_default_backend (void);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_set_windowing_backend (const char *backend_type);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gdouble clutter_backend_get_resolution (ClutterBackend *backend);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -152,9 +152,7 @@ clutter_bind_constraint_update_allocation (ClutterConstraint *constraint,
|
||||
ClutterBindConstraint *bind = CLUTTER_BIND_CONSTRAINT (constraint);
|
||||
gfloat source_width, source_height;
|
||||
gfloat actor_width, actor_height;
|
||||
graphene_point3d_t source_position;
|
||||
|
||||
source_position = GRAPHENE_POINT3D_INIT (0.f, 0.f, 0.f);
|
||||
ClutterVertex source_position = { 0., };
|
||||
|
||||
if (bind->source == NULL)
|
||||
return;
|
||||
|
@ -235,7 +235,8 @@ clutter_binding_pool_finalize (GObject *gobject)
|
||||
|
||||
g_hash_table_destroy (pool->entries_hash);
|
||||
|
||||
g_slist_free_full (pool->entries, (GDestroyNotify) binding_entry_free);
|
||||
g_slist_foreach (pool->entries, (GFunc) binding_entry_free, NULL);
|
||||
g_slist_free (pool->entries);
|
||||
|
||||
G_OBJECT_CLASS (clutter_binding_pool_parent_class)->finalize (gobject);
|
||||
}
|
||||
|
@ -178,11 +178,11 @@ clutter_blur_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_blur_effect_modify_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
clutter_blur_effect_get_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
gfloat cur_width, cur_height;
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
|
||||
clutter_paint_volume_get_origin (volume, &origin);
|
||||
cur_width = clutter_paint_volume_get_width (volume);
|
||||
@ -223,7 +223,7 @@ clutter_blur_effect_class_init (ClutterBlurEffectClass *klass)
|
||||
gobject_class->dispose = clutter_blur_effect_dispose;
|
||||
|
||||
effect_class->pre_paint = clutter_blur_effect_pre_paint;
|
||||
effect_class->modify_paint_volume = clutter_blur_effect_modify_paint_volume;
|
||||
effect_class->get_paint_volume = clutter_blur_effect_get_paint_volume;
|
||||
|
||||
offscreen_class = CLUTTER_OFFSCREEN_EFFECT_CLASS (klass);
|
||||
offscreen_class->paint_target = clutter_blur_effect_paint_target;
|
||||
@ -249,7 +249,9 @@ clutter_blur_effect_init (ClutterBlurEffect *self)
|
||||
cogl_pipeline_add_layer_snippet (klass->base_pipeline, 0, snippet);
|
||||
cogl_object_unref (snippet);
|
||||
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline, 0);
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline,
|
||||
0, /* layer number */
|
||||
COGL_TEXTURE_TYPE_2D);
|
||||
}
|
||||
|
||||
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
||||
|
@ -438,7 +438,9 @@ clutter_brightness_contrast_effect_init (ClutterBrightnessContrastEffect *self)
|
||||
cogl_pipeline_add_snippet (klass->base_pipeline, snippet);
|
||||
cogl_object_unref (snippet);
|
||||
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline, 0);
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline,
|
||||
0, /* layer number */
|
||||
COGL_TEXTURE_TYPE_2D);
|
||||
}
|
||||
|
||||
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
||||
|
@ -44,7 +44,6 @@
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <cogl/cogl.h>
|
||||
#include <cairo-gobject.h>
|
||||
|
||||
@ -70,7 +69,6 @@ struct _ClutterCanvasPrivate
|
||||
|
||||
int width;
|
||||
int height;
|
||||
float scale_factor;
|
||||
|
||||
CoglTexture *texture;
|
||||
gboolean dirty;
|
||||
@ -84,7 +82,6 @@ enum
|
||||
|
||||
PROP_WIDTH,
|
||||
PROP_HEIGHT,
|
||||
PROP_SCALE_FACTOR,
|
||||
|
||||
LAST_PROP
|
||||
};
|
||||
@ -181,19 +178,6 @@ clutter_canvas_set_property (GObject *gobject,
|
||||
}
|
||||
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:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||
break;
|
||||
@ -218,10 +202,6 @@ clutter_canvas_get_property (GObject *gobject,
|
||||
g_value_set_int (value, priv->height);
|
||||
break;
|
||||
|
||||
case PROP_SCALE_FACTOR:
|
||||
g_value_set_float (value, priv->scale_factor);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||
break;
|
||||
@ -265,19 +245,6 @@ clutter_canvas_class_init (ClutterCanvasClass *klass)
|
||||
G_PARAM_READWRITE |
|
||||
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:
|
||||
@ -324,7 +291,6 @@ clutter_canvas_init (ClutterCanvas *self)
|
||||
|
||||
self->priv->width = -1;
|
||||
self->priv->height = -1;
|
||||
self->priv->scale_factor = 1.0f;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -374,8 +340,8 @@ clutter_canvas_emit_draw (ClutterCanvas *self)
|
||||
|
||||
priv->dirty = TRUE;
|
||||
|
||||
real_width = ceilf (priv->width * priv->scale_factor);
|
||||
real_height = ceilf (priv->height * priv->scale_factor);
|
||||
real_width = priv->width;
|
||||
real_height = priv->height;
|
||||
|
||||
CLUTTER_NOTE (MISC, "Creating Cairo surface with size %d x %d",
|
||||
priv->width, priv->height);
|
||||
@ -421,10 +387,6 @@ clutter_canvas_emit_draw (ClutterCanvas *self)
|
||||
mapped_buffer = FALSE;
|
||||
}
|
||||
|
||||
cairo_surface_set_device_scale (surface,
|
||||
priv->scale_factor,
|
||||
priv->scale_factor);
|
||||
|
||||
self->priv->cr = cr = cairo_create (surface);
|
||||
|
||||
g_signal_emit (self, canvas_signals[DRAW], 0,
|
||||
@ -486,10 +448,10 @@ clutter_canvas_get_preferred_size (ClutterContent *content,
|
||||
return FALSE;
|
||||
|
||||
if (width != NULL)
|
||||
*width = ceilf (priv->width * priv->scale_factor);
|
||||
*width = priv->width;
|
||||
|
||||
if (height != NULL)
|
||||
*height = ceilf (priv->height * priv->scale_factor);
|
||||
*height = priv->height;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -598,48 +560,3 @@ clutter_canvas_set_size (ClutterCanvas *canvas,
|
||||
|
||||
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
|
||||
void clutter_canvas_set_scale_factor (ClutterCanvas *canvas,
|
||||
float scale);
|
||||
int scale);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_canvas_get_scale_factor (ClutterCanvas *canvas);
|
||||
int clutter_canvas_get_scale_factor (ClutterCanvas *canvas);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -355,10 +355,6 @@ on_captured_event (ClutterActor *stage,
|
||||
|
||||
switch (clutter_event_type (event))
|
||||
{
|
||||
case CLUTTER_TOUCH_CANCEL:
|
||||
clutter_click_action_release (action);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCH_END:
|
||||
has_button = FALSE;
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
@ -666,7 +662,8 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterClickActionClass, clicked),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
|
@ -252,13 +252,6 @@ clutter_clone_allocate (ClutterActor *self,
|
||||
if (priv->clone_source == NULL)
|
||||
return;
|
||||
|
||||
/* ClutterActor delays allocating until the actor is shown; however
|
||||
* we cannot paint it correctly in that case, so force an allocation.
|
||||
*/
|
||||
if (clutter_actor_get_parent (priv->clone_source) != NULL &&
|
||||
!clutter_actor_has_allocation (priv->clone_source))
|
||||
clutter_actor_allocate_preferred_size (priv->clone_source, flags);
|
||||
|
||||
#if 0
|
||||
/* XXX - this is wrong: ClutterClone cannot clone unparented
|
||||
* actors, as it will break all invariants
|
||||
|
@ -293,7 +293,9 @@ clutter_colorize_effect_init (ClutterColorizeEffect *self)
|
||||
cogl_pipeline_add_snippet (klass->base_pipeline, snippet);
|
||||
cogl_object_unref (snippet);
|
||||
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline, 0);
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline,
|
||||
0, /* layer number */
|
||||
COGL_TEXTURE_TYPE_2D);
|
||||
}
|
||||
|
||||
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
||||
|
@ -118,6 +118,37 @@ container_real_remove (ClutterContainer *container,
|
||||
clutter_actor_remove_child (CLUTTER_ACTOR (container), actor);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
ClutterCallback callback;
|
||||
gpointer data;
|
||||
} ForeachClosure;
|
||||
|
||||
static gboolean
|
||||
foreach_cb (ClutterActor *actor,
|
||||
gpointer data)
|
||||
{
|
||||
ForeachClosure *clos = data;
|
||||
|
||||
clos->callback (actor, clos->data);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
container_real_foreach (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
ForeachClosure clos;
|
||||
|
||||
clos.callback = callback;
|
||||
clos.data = user_data;
|
||||
|
||||
_clutter_actor_foreach_child (CLUTTER_ACTOR (container),
|
||||
foreach_cb,
|
||||
&clos);
|
||||
}
|
||||
|
||||
static void
|
||||
container_real_raise (ClutterContainer *container,
|
||||
ClutterActor *child,
|
||||
@ -166,7 +197,8 @@ clutter_container_default_init (ClutterContainerInterface *iface)
|
||||
iface_type,
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContainerIface, actor_added),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
/**
|
||||
@ -184,7 +216,8 @@ clutter_container_default_init (ClutterContainerInterface *iface)
|
||||
iface_type,
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContainerIface, actor_removed),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@ -212,6 +245,7 @@ clutter_container_default_init (ClutterContainerInterface *iface)
|
||||
|
||||
iface->add = container_real_add;
|
||||
iface->remove = container_real_remove;
|
||||
iface->foreach = container_real_foreach;
|
||||
iface->raise = container_real_raise;
|
||||
iface->lower = container_real_lower;
|
||||
iface->sort_depth_order = container_real_sort_depth_order;
|
||||
@ -501,6 +535,15 @@ clutter_container_remove_valist (ClutterContainer *container,
|
||||
container_remove_valist (container, first_actor, var_args);
|
||||
}
|
||||
|
||||
static void
|
||||
get_children_cb (ClutterActor *child,
|
||||
gpointer data)
|
||||
{
|
||||
GList **children = data;
|
||||
|
||||
*children = g_list_prepend (*children, child);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_container_get_children:
|
||||
* @container: a #ClutterContainer
|
||||
@ -518,9 +561,108 @@ clutter_container_remove_valist (ClutterContainer *container,
|
||||
GList *
|
||||
clutter_container_get_children (ClutterContainer *container)
|
||||
{
|
||||
GList *retval;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_CONTAINER (container), NULL);
|
||||
|
||||
return clutter_actor_get_children (CLUTTER_ACTOR (container));
|
||||
retval = NULL;
|
||||
clutter_container_foreach (container, get_children_cb, &retval);
|
||||
|
||||
return g_list_reverse (retval);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_container_foreach:
|
||||
* @container: a #ClutterContainer
|
||||
* @callback: (scope call): a function to be called for each child
|
||||
* @user_data: data to be passed to the function, or %NULL
|
||||
*
|
||||
* Calls @callback for each child of @container that was added
|
||||
* by the application (with clutter_container_add_actor()). Does
|
||||
* not iterate over "internal" children that are part of the
|
||||
* container's own implementation, if any.
|
||||
*
|
||||
* This function calls the #ClutterContainerIface.foreach()
|
||||
* virtual function, which has been deprecated.
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_actor_get_first_child() or
|
||||
* clutter_actor_get_last_child() to retrieve the beginning of
|
||||
* the list of children, and clutter_actor_get_next_sibling()
|
||||
* and clutter_actor_get_previous_sibling() to iterate over it;
|
||||
* alternatively, use the #ClutterActorIter API.
|
||||
*/
|
||||
void
|
||||
clutter_container_foreach (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
if (G_UNLIKELY (_clutter_diagnostic_enabled ()))
|
||||
{
|
||||
ClutterContainerIface *iface = CLUTTER_CONTAINER_GET_IFACE (container);
|
||||
|
||||
if (iface->foreach != container_real_foreach)
|
||||
_clutter_diagnostic_message ("The ClutterContainer::foreach() "
|
||||
"virtual function has been deprecated "
|
||||
"and it should not be overridden by "
|
||||
"newly written code");
|
||||
}
|
||||
#endif /* CLUTTER_ENABLE_DEBUG */
|
||||
|
||||
CLUTTER_CONTAINER_GET_IFACE (container)->foreach (container,
|
||||
callback,
|
||||
user_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_container_foreach_with_internals:
|
||||
* @container: a #ClutterContainer
|
||||
* @callback: (scope call): a function to be called for each child
|
||||
* @user_data: data to be passed to the function, or %NULL
|
||||
*
|
||||
* Calls @callback for each child of @container, including "internal"
|
||||
* children built in to the container itself that were never added
|
||||
* by the application.
|
||||
*
|
||||
* This function calls the #ClutterContainerIface.foreach_with_internals()
|
||||
* virtual function, which has been deprecated.
|
||||
*
|
||||
* Since: 1.0
|
||||
*
|
||||
* Deprecated: 1.10: See clutter_container_foreach().
|
||||
*/
|
||||
void
|
||||
clutter_container_foreach_with_internals (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
ClutterContainerIface *iface;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
iface = CLUTTER_CONTAINER_GET_IFACE (container);
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
if (G_UNLIKELY (_clutter_diagnostic_enabled ()))
|
||||
{
|
||||
if (iface->foreach_with_internals != NULL)
|
||||
_clutter_diagnostic_message ("The ClutterContainer::foreach_with_internals() "
|
||||
"virtual function has been deprecated "
|
||||
"and it should not be overridden by "
|
||||
"newly written code");
|
||||
}
|
||||
#endif /* CLUTTER_ENABLE_DEBUG */
|
||||
|
||||
if (iface->foreach_with_internals != NULL)
|
||||
iface->foreach_with_internals (container, callback, user_data);
|
||||
else
|
||||
iface->foreach (container, callback, user_data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -59,6 +59,14 @@ typedef struct _ClutterContainerIface ClutterContainerIface;
|
||||
* function is deprecated, and it should not be overridden.
|
||||
* @remove: virtual function for removing an actor from the container. This
|
||||
* virtual function is deprecated, and it should not be overridden.
|
||||
* @foreach: virtual function for iterating over the container's children.
|
||||
* This virtual function is deprecated, and it should not be overridden.
|
||||
* @foreach_with_internals: virtual functions for iterating over the
|
||||
* container's children, both added using the #ClutterContainer API
|
||||
* and internal children. The implementation of this virtual function
|
||||
* is required only if the #ClutterContainer implementation has
|
||||
* internal children. This virtual function is deprecated, and it should
|
||||
* not be overridden.
|
||||
* @raise: virtual function for raising a child. This virtual function is
|
||||
* deprecated and it should not be overridden.
|
||||
* @lower: virtual function for lowering a child. This virtual function is
|
||||
@ -80,7 +88,7 @@ typedef struct _ClutterContainerIface ClutterContainerIface;
|
||||
* @actor_removed: class handler for #ClutterContainer::actor-removed
|
||||
* @child_notify: class handler for #ClutterContainer::child-notify
|
||||
*
|
||||
* Base interface for container actors. The @add and @remove
|
||||
* Base interface for container actors. The @add, @remove and @foreach
|
||||
* virtual functions must be provided by any implementation; the other
|
||||
* virtual functions are optional.
|
||||
*
|
||||
@ -96,6 +104,13 @@ struct _ClutterContainerIface
|
||||
ClutterActor *actor);
|
||||
void (* remove) (ClutterContainer *container,
|
||||
ClutterActor *actor);
|
||||
void (* foreach) (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
void (* foreach_with_internals) (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
/* child stacking */
|
||||
void (* raise) (ClutterContainer *container,
|
||||
|
@ -129,7 +129,8 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
||||
G_TYPE_FROM_INTERFACE (iface),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContentInterface, attached),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@ -148,7 +149,8 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
||||
G_TYPE_FROM_INTERFACE (iface),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContentInterface, detached),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
}
|
||||
|
@ -6,8 +6,7 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_DEBUG_MISC = 1 << 0,
|
||||
CLUTTER_DEBUG_ACTOR = 1 << 1,
|
||||
CLUTTER_DEBUG_TEXTURE = 1 << 2,
|
||||
@ -27,13 +26,12 @@ typedef enum
|
||||
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 16
|
||||
} ClutterDebugFlag;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_DEBUG_NOP_PICKING = 1 << 0,
|
||||
CLUTTER_DEBUG_DUMP_PICK_BUFFERS = 1 << 1
|
||||
} ClutterPickDebugFlag;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_DEBUG_DISABLE_SWAP_EVENTS = 1 << 0,
|
||||
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS = 1 << 1,
|
||||
CLUTTER_DEBUG_REDRAWS = 1 << 2,
|
||||
|
@ -177,7 +177,7 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
|
||||
if (priv->is_dirty)
|
||||
{
|
||||
graphene_rect_t rect;
|
||||
ClutterRect rect;
|
||||
gboolean mapped_buffer;
|
||||
CoglVertexP3T2C4 *verts;
|
||||
ClutterActor *actor;
|
||||
@ -193,8 +193,8 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
*/
|
||||
if (clutter_offscreen_effect_get_target_rect (effect, &rect))
|
||||
{
|
||||
width = graphene_rect_get_width (&rect);
|
||||
height = graphene_rect_get_height (&rect);
|
||||
width = clutter_rect_get_width (&rect);
|
||||
height = clutter_rect_get_height (&rect);
|
||||
}
|
||||
else
|
||||
clutter_actor_get_size (actor, &width, &height);
|
||||
@ -282,7 +282,6 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
/* enable depth testing */
|
||||
cogl_depth_state_init (&depth_state);
|
||||
cogl_depth_state_set_test_enabled (&depth_state, TRUE);
|
||||
cogl_depth_state_set_test_function (&depth_state, COGL_DEPTH_TEST_FUNCTION_LEQUAL);
|
||||
cogl_pipeline_set_depth_state (pipeline, &depth_state, NULL);
|
||||
|
||||
/* enable backface culling if we have a back material */
|
||||
|
@ -9,15 +9,23 @@
|
||||
#include "deprecated/clutter-animation.h"
|
||||
#include "deprecated/clutter-behaviour.h"
|
||||
#include "deprecated/clutter-behaviour-depth.h"
|
||||
#include "deprecated/clutter-behaviour-ellipse.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-bin-layout.h"
|
||||
#include "deprecated/clutter-box.h"
|
||||
#include "deprecated/clutter-cairo-texture.h"
|
||||
#include "deprecated/clutter-container.h"
|
||||
#include "deprecated/clutter-group.h"
|
||||
#include "deprecated/clutter-input-device.h"
|
||||
#include "deprecated/clutter-keysyms.h"
|
||||
#include "deprecated/clutter-list-model.h"
|
||||
#include "deprecated/clutter-main.h"
|
||||
#include "deprecated/clutter-model.h"
|
||||
#include "deprecated/clutter-rectangle.h"
|
||||
#include "deprecated/clutter-shader.h"
|
||||
#include "deprecated/clutter-stage-manager.h"
|
||||
#include "deprecated/clutter-stage.h"
|
||||
#include "deprecated/clutter-state.h"
|
||||
|
@ -297,7 +297,9 @@ clutter_desaturate_effect_init (ClutterDesaturateEffect *self)
|
||||
cogl_pipeline_add_snippet (klass->base_pipeline, snippet);
|
||||
cogl_object_unref (snippet);
|
||||
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline, 0);
|
||||
cogl_pipeline_set_layer_null_texture (klass->base_pipeline,
|
||||
0, /* layer number */
|
||||
COGL_TEXTURE_TYPE_2D);
|
||||
}
|
||||
|
||||
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
|
||||
|
@ -69,23 +69,6 @@ typedef struct _ClutterTouchInfo
|
||||
gfloat current_y;
|
||||
} ClutterTouchInfo;
|
||||
|
||||
typedef struct _ClutterPtrA11yData
|
||||
{
|
||||
int n_btn_pressed;
|
||||
float current_x;
|
||||
float current_y;
|
||||
|
||||
float dwell_x;
|
||||
float dwell_y;
|
||||
gboolean dwell_drag_started;
|
||||
gboolean dwell_gesture_started;
|
||||
guint dwell_timer;
|
||||
guint dwell_position_timer;
|
||||
|
||||
guint secondary_click_timer;
|
||||
gboolean secondary_click_triggered;
|
||||
} ClutterPtrA11yData;
|
||||
|
||||
struct _ClutterInputDevice
|
||||
{
|
||||
GObject parent_instance;
|
||||
@ -160,10 +143,6 @@ struct _ClutterInputDevice
|
||||
|
||||
guint has_cursor : 1;
|
||||
guint is_enabled : 1;
|
||||
|
||||
/* Accessiblity */
|
||||
ClutterVirtualInputDevice *accessibility_virtual_device;
|
||||
ClutterPtrA11yData *ptr_a11y_data;
|
||||
};
|
||||
|
||||
typedef void (*ClutterEmitInputDeviceEvent) (ClutterEvent *event,
|
||||
@ -188,21 +167,44 @@ struct _ClutterInputDeviceClass
|
||||
gboolean (* is_grouped) (ClutterInputDevice *device,
|
||||
ClutterInputDevice *other_device);
|
||||
|
||||
gboolean (* get_physical_size) (ClutterInputDevice *device,
|
||||
gdouble *width,
|
||||
gdouble *height);
|
||||
|
||||
/* Keyboard accessbility */
|
||||
void (* process_kbd_a11y_event) (ClutterEvent *event,
|
||||
ClutterInputDevice *device,
|
||||
ClutterEmitInputDeviceEvent emit_event_func);
|
||||
};
|
||||
|
||||
/* Platform-dependent interface */
|
||||
typedef struct _ClutterEventExtender ClutterEventExtender;
|
||||
typedef struct _ClutterEventExtenderInterface ClutterEventExtenderInterface;
|
||||
|
||||
#define CLUTTER_TYPE_EVENT_EXTENDER (clutter_event_extender_get_type ())
|
||||
#define CLUTTER_EVENT_EXTENDER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CLUTTER_TYPE_EVENT_EXTENDER, ClutterEventExtender))
|
||||
#define CLUTTER_IS_EVENT_EXTENDER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CLUTTER_TYPE_EVENT_EXTENDER))
|
||||
#define CLUTTER_EVENT_EXTENDER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), CLUTTER_TYPE_EVENT_EXTENDER, ClutterEventExtenderInterface))
|
||||
|
||||
struct _ClutterEventExtenderInterface
|
||||
{
|
||||
GTypeInterface g_iface;
|
||||
|
||||
void (* copy_event_data) (ClutterEventExtender *event_extender,
|
||||
const ClutterEvent *src,
|
||||
ClutterEvent *dest);
|
||||
void (* free_event_data) (ClutterEventExtender *event_extender,
|
||||
ClutterEvent *event);
|
||||
};
|
||||
|
||||
GType clutter_event_extender_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/* device manager */
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_device_manager_add_device (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDevice *device);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_device_manager_remove_device (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDevice *device);
|
||||
void _clutter_device_manager_update_devices (ClutterDeviceManager *device_manager);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_device_manager_select_stage_events (ClutterDeviceManager *device_manager,
|
||||
ClutterStage *stage);
|
||||
ClutterBackend *_clutter_device_manager_get_backend (ClutterDeviceManager *device_manager);
|
||||
@ -210,35 +212,25 @@ ClutterBackend *_clutter_device_manager_get_backend (ClutterDeviceMa
|
||||
void _clutter_device_manager_compress_motion (ClutterDeviceManager *device_manger,
|
||||
ClutterEvent *event,
|
||||
const ClutterEvent *to_discard);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_device_manager_ensure_a11y_state (ClutterDeviceManager *device_manager);
|
||||
|
||||
/* input device */
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_input_device_has_sequence (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_add_event_sequence (ClutterInputDevice *device,
|
||||
ClutterEvent *event);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_remove_event_sequence (ClutterInputDevice *device,
|
||||
ClutterEvent *event);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_coords (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
gfloat x,
|
||||
gfloat y,
|
||||
ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_state (ClutterInputDevice *device,
|
||||
ClutterModifierType state);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_time (ClutterInputDevice *device,
|
||||
guint32 time_);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_stage (ClutterInputDevice *device,
|
||||
ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
ClutterStage * _clutter_input_device_get_stage (ClutterInputDevice *device);
|
||||
void _clutter_input_device_set_actor (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
@ -247,57 +239,44 @@ void _clutter_input_device_set_actor (ClutterInputDev
|
||||
ClutterActor * _clutter_input_device_update (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
gboolean emit_crossing);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_n_keys (ClutterInputDevice *device,
|
||||
guint n_keys);
|
||||
CLUTTER_EXPORT
|
||||
guint _clutter_input_device_add_axis (ClutterInputDevice *device,
|
||||
ClutterInputAxis axis,
|
||||
gdouble min_value,
|
||||
gdouble max_value,
|
||||
gdouble resolution);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_reset_axes (ClutterInputDevice *device);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_associated_device (ClutterInputDevice *device,
|
||||
ClutterInputDevice *associated);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_add_slave (ClutterInputDevice *master,
|
||||
ClutterInputDevice *slave);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_remove_slave (ClutterInputDevice *master,
|
||||
ClutterInputDevice *slave);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_input_device_translate_axis (ClutterInputDevice *device,
|
||||
guint index_,
|
||||
gdouble value,
|
||||
gdouble *axis_value);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_add_scroll_info (ClutterInputDevice *device,
|
||||
guint index_,
|
||||
ClutterScrollDirection direction,
|
||||
gdouble increment);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_reset_scroll_info (ClutterInputDevice *device);
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_input_device_get_scroll_delta (ClutterInputDevice *device,
|
||||
guint index_,
|
||||
gdouble value,
|
||||
ClutterScrollDirection *direction_p,
|
||||
gdouble *delta_p);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterInputDeviceTool * clutter_input_device_lookup_tool (ClutterInputDevice *device,
|
||||
guint64 serial,
|
||||
ClutterInputDeviceToolType type);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_device_add_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_device_update_from_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
|
||||
|
@ -47,7 +47,6 @@
|
||||
#include "clutter-stage-private.h"
|
||||
#include "clutter-virtual-input-device.h"
|
||||
#include "clutter-input-device-tool.h"
|
||||
#include "clutter-input-pointer-a11y-private.h"
|
||||
|
||||
struct _ClutterDeviceManagerPrivate
|
||||
{
|
||||
@ -56,8 +55,6 @@ struct _ClutterDeviceManagerPrivate
|
||||
|
||||
/* Keyboard a11y */
|
||||
ClutterKbdA11ySettings kbd_a11y_settings;
|
||||
/* Pointer a11y */
|
||||
ClutterPointerA11ySettings pointer_a11y_settings;
|
||||
};
|
||||
|
||||
enum
|
||||
@ -78,9 +75,6 @@ enum
|
||||
TOOL_CHANGED,
|
||||
KBD_A11Y_MASK_CHANGED,
|
||||
KBD_A11Y_FLAGS_CHANGED,
|
||||
PTR_A11Y_DWELL_CLICK_TYPE_CHANGED,
|
||||
PTR_A11Y_TIMEOUT_STARTED,
|
||||
PTR_A11Y_TIMEOUT_STOPPED,
|
||||
|
||||
LAST_SIGNAL
|
||||
};
|
||||
@ -91,14 +85,22 @@ G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterDeviceManager,
|
||||
clutter_device_manager,
|
||||
G_TYPE_OBJECT)
|
||||
|
||||
G_DEFINE_INTERFACE (ClutterEventExtender,
|
||||
clutter_event_extender,
|
||||
CLUTTER_TYPE_DEVICE_MANAGER)
|
||||
|
||||
static void
|
||||
clutter_event_extender_default_init (ClutterEventExtenderInterface *iface)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_device_manager_set_property (GObject *gobject,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterDeviceManager *self = CLUTTER_DEVICE_MANAGER (gobject);
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (self);
|
||||
ClutterDeviceManagerPrivate *priv = CLUTTER_DEVICE_MANAGER (gobject)->priv;
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
@ -117,8 +119,7 @@ clutter_device_manager_get_property (GObject *gobject,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterDeviceManager *self = CLUTTER_DEVICE_MANAGER (gobject);
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (self);
|
||||
ClutterDeviceManagerPrivate *priv = CLUTTER_DEVICE_MANAGER (gobject)->priv;
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
@ -164,7 +165,8 @@ clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_INPUT_DEVICE);
|
||||
|
||||
@ -183,7 +185,8 @@ clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_INPUT_DEVICE);
|
||||
|
||||
@ -236,74 +239,12 @@ clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
|
||||
G_TYPE_NONE, 2,
|
||||
G_TYPE_UINT,
|
||||
G_TYPE_UINT);
|
||||
|
||||
/**
|
||||
* ClutterDeviceManager::ptr-a11y-dwell-click-type-changed:
|
||||
* @manager: the #ClutterDeviceManager that emitted the signal
|
||||
* @click_type: the new #ClutterPointerA11yDwellClickType mode
|
||||
*
|
||||
* The ::ptr-a11y-dwell-click-type-changed signal is emitted each time
|
||||
* the ClutterPointerA11yDwellClickType mode is changed as the result
|
||||
* of pointer accessibility operations.
|
||||
*/
|
||||
manager_signals[PTR_A11Y_DWELL_CLICK_TYPE_CHANGED] =
|
||||
g_signal_new (I_("ptr-a11y-dwell-click-type-changed"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__FLAGS,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_POINTER_A11Y_DWELL_CLICK_TYPE);
|
||||
|
||||
/**
|
||||
* ClutterDeviceManager::ptr-a11y-timeout-started:
|
||||
* @manager: the #ClutterDeviceManager that emitted the signal
|
||||
* @device: the core pointer #ClutterInputDevice
|
||||
* @timeout_type: the type of timeout #ClutterPointerA11yTimeoutType
|
||||
* @delay: the delay in ms before secondary-click is triggered.
|
||||
*
|
||||
* The ::ptr-a11y-timeout-started signal is emitted when a
|
||||
* pointer accessibility timeout delay is started, so that upper
|
||||
* layers can notify the user with some visual feedback.
|
||||
*/
|
||||
manager_signals[PTR_A11Y_TIMEOUT_STARTED] =
|
||||
g_signal_new (I_("ptr-a11y-timeout-started"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT_FLAGS_UINT,
|
||||
G_TYPE_NONE, 3,
|
||||
CLUTTER_TYPE_INPUT_DEVICE,
|
||||
CLUTTER_TYPE_POINTER_A11Y_TIMEOUT_TYPE,
|
||||
G_TYPE_UINT);
|
||||
|
||||
/**
|
||||
* ClutterDeviceManager::ptr-a11y-timeout-stopped:
|
||||
* @manager: the #ClutterDeviceManager that emitted the signal
|
||||
* @device: the core pointer #ClutterInputDevice
|
||||
* @timeout_type: the type of timeout #ClutterPointerA11yTimeoutType
|
||||
* @clicked: %TRUE if the timeout finished and triggered a click
|
||||
*
|
||||
* The ::ptr-a11y-timeout-stopped signal is emitted when a running
|
||||
* pointer accessibility timeout delay is stopped, either because
|
||||
* it's triggered at the end of the delay or cancelled, so that
|
||||
* upper layers can notify the user with some visual feedback.
|
||||
*/
|
||||
manager_signals[PTR_A11Y_TIMEOUT_STOPPED] =
|
||||
g_signal_new (I_("ptr-a11y-timeout-stopped"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT_FLAGS_BOOLEAN,
|
||||
G_TYPE_NONE, 3,
|
||||
CLUTTER_TYPE_INPUT_DEVICE,
|
||||
CLUTTER_TYPE_POINTER_A11Y_TIMEOUT_TYPE,
|
||||
G_TYPE_BOOLEAN);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_device_manager_init (ClutterDeviceManager *self)
|
||||
{
|
||||
self->priv = clutter_device_manager_get_instance_private (self);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -322,7 +263,7 @@ clutter_device_manager_get_default (void)
|
||||
{
|
||||
ClutterBackend *backend = clutter_get_default_backend ();
|
||||
|
||||
return CLUTTER_BACKEND_GET_CLASS (backend)->get_device_manager (backend);
|
||||
return backend->device_manager;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -546,11 +487,9 @@ _clutter_device_manager_update_devices (ClutterDeviceManager *device_manager)
|
||||
ClutterBackend *
|
||||
_clutter_device_manager_get_backend (ClutterDeviceManager *manager)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (manager);
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (manager), NULL);
|
||||
|
||||
return priv->backend;
|
||||
return manager->priv->backend;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -607,25 +546,17 @@ _clutter_device_manager_compress_motion (ClutterDeviceManager *device_manager,
|
||||
manager_class->compress_motion (device_manager, event, to_discard);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_device_manager_ensure_a11y_state (ClutterDeviceManager *device_manager)
|
||||
{
|
||||
ClutterInputDevice *core_pointer;
|
||||
|
||||
core_pointer = clutter_device_manager_get_core_device (device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
if (core_pointer)
|
||||
{
|
||||
if (_clutter_is_input_pointer_a11y_enabled (core_pointer))
|
||||
_clutter_input_pointer_a11y_add_device (core_pointer);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
are_kbd_a11y_settings_equal (ClutterKbdA11ySettings *a,
|
||||
ClutterKbdA11ySettings *b)
|
||||
{
|
||||
return (memcmp (a, b, sizeof (ClutterKbdA11ySettings)) == 0);
|
||||
return (a->controls == b->controls &&
|
||||
a->slowkeys_delay == b->slowkeys_delay &&
|
||||
a->debounce_delay == b->debounce_delay &&
|
||||
a->timeout_delay == b->timeout_delay &&
|
||||
a->mousekeys_init_delay == b->mousekeys_init_delay &&
|
||||
a->mousekeys_max_speed == b->mousekeys_max_speed &&
|
||||
a->mousekeys_accel_time == b->mousekeys_accel_time);
|
||||
}
|
||||
|
||||
void
|
||||
@ -633,14 +564,13 @@ clutter_device_manager_set_kbd_a11y_settings (ClutterDeviceManager *device_man
|
||||
ClutterKbdA11ySettings *settings)
|
||||
{
|
||||
ClutterDeviceManagerClass *manager_class;
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (device_manager);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
if (are_kbd_a11y_settings_equal (&priv->kbd_a11y_settings, settings))
|
||||
if (are_kbd_a11y_settings_equal (&device_manager->priv->kbd_a11y_settings, settings))
|
||||
return;
|
||||
|
||||
priv->kbd_a11y_settings = *settings;
|
||||
device_manager->priv->kbd_a11y_settings = *settings;
|
||||
|
||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
if (manager_class->apply_kbd_a11y_settings)
|
||||
@ -651,103 +581,7 @@ void
|
||||
clutter_device_manager_get_kbd_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterKbdA11ySettings *settings)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (device_manager);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
*settings = priv->kbd_a11y_settings;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
are_pointer_a11y_settings_equal (ClutterPointerA11ySettings *a,
|
||||
ClutterPointerA11ySettings *b)
|
||||
{
|
||||
return (memcmp (a, b, sizeof (ClutterPointerA11ySettings)) == 0);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_device_manager_enable_pointer_a11y (ClutterDeviceManager *device_manager)
|
||||
{
|
||||
ClutterInputDevice *core_pointer;
|
||||
|
||||
core_pointer = clutter_device_manager_get_core_device (device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
|
||||
_clutter_input_pointer_a11y_add_device (core_pointer);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_device_manager_disable_pointer_a11y (ClutterDeviceManager *device_manager)
|
||||
{
|
||||
ClutterInputDevice *core_pointer;
|
||||
|
||||
core_pointer = clutter_device_manager_get_core_device (device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
|
||||
_clutter_input_pointer_a11y_remove_device (core_pointer);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_device_manager_set_pointer_a11y_settings:
|
||||
* @device_manager: a #ClutterDeviceManager
|
||||
* @settings: a pointer to a #ClutterPointerA11ySettings
|
||||
*
|
||||
* Sets the pointer accessibility settings
|
||||
**/
|
||||
void
|
||||
clutter_device_manager_set_pointer_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterPointerA11ySettings *settings)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv =
|
||||
clutter_device_manager_get_instance_private (device_manager);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
if (are_pointer_a11y_settings_equal (&priv->pointer_a11y_settings, settings))
|
||||
return;
|
||||
|
||||
if (priv->pointer_a11y_settings.controls == 0 && settings->controls != 0)
|
||||
clutter_device_manager_enable_pointer_a11y (device_manager);
|
||||
else if (priv->pointer_a11y_settings.controls != 0 && settings->controls == 0)
|
||||
clutter_device_manager_disable_pointer_a11y (device_manager);
|
||||
|
||||
priv->pointer_a11y_settings = *settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_device_manager_get_pointer_a11y_settings:
|
||||
* @device_manager: a #ClutterDeviceManager
|
||||
* @settings: a pointer to a #ClutterPointerA11ySettings
|
||||
*
|
||||
* Gets the current pointer accessibility settings
|
||||
**/
|
||||
void
|
||||
clutter_device_manager_get_pointer_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterPointerA11ySettings *settings)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv =
|
||||
clutter_device_manager_get_instance_private (device_manager);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
*settings = priv->pointer_a11y_settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_device_manager_set_pointer_a11y_dwell_click_type:
|
||||
* @device_manager: a #ClutterDeviceManager
|
||||
* @click_type: type of click as #ClutterPointerA11yDwellClickType
|
||||
*
|
||||
* Sets the dwell click type
|
||||
**/
|
||||
void
|
||||
clutter_device_manager_set_pointer_a11y_dwell_click_type (ClutterDeviceManager *device_manager,
|
||||
ClutterPointerA11yDwellClickType click_type)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv =
|
||||
clutter_device_manager_get_instance_private (device_manager);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
priv->pointer_a11y_settings.dwell_click_type = click_type;
|
||||
*settings = device_manager->priv->kbd_a11y_settings;
|
||||
}
|
||||
|
@ -33,12 +33,16 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_DEVICE_MANAGER (clutter_device_manager_get_type ())
|
||||
CLUTTER_EXPORT
|
||||
G_DECLARE_DERIVABLE_TYPE (ClutterDeviceManager, clutter_device_manager,
|
||||
CLUTTER, DEVICE_MANAGER, GObject)
|
||||
#define CLUTTER_TYPE_DEVICE_MANAGER (clutter_device_manager_get_type ())
|
||||
#define CLUTTER_DEVICE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_DEVICE_MANAGER, ClutterDeviceManager))
|
||||
#define CLUTTER_IS_DEVICE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_DEVICE_MANAGER))
|
||||
#define CLUTTER_DEVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_DEVICE_MANAGER, ClutterDeviceManagerClass))
|
||||
#define CLUTTER_IS_DEVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_DEVICE_MANAGER))
|
||||
#define CLUTTER_DEVICE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_DEVICE_MANAGER, ClutterDeviceManagerClass))
|
||||
|
||||
typedef struct _ClutterDeviceManager ClutterDeviceManager;
|
||||
typedef struct _ClutterDeviceManagerPrivate ClutterDeviceManagerPrivate;
|
||||
typedef struct _ClutterDeviceManagerClass ClutterDeviceManagerClass;
|
||||
|
||||
/**
|
||||
* ClutterVirtualDeviceType:
|
||||
@ -70,25 +74,19 @@ typedef struct _ClutterKbdA11ySettings
|
||||
} ClutterKbdA11ySettings;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11ySettings:
|
||||
* ClutterDeviceManager:
|
||||
*
|
||||
* The #ClutterPointerA11ySettings structure contains pointer accessibility
|
||||
* settings
|
||||
* The #ClutterDeviceManager structure contains only private data
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
typedef struct _ClutterPointerA11ySettings
|
||||
struct _ClutterDeviceManager
|
||||
{
|
||||
ClutterPointerA11yFlags controls;
|
||||
ClutterPointerA11yDwellClickType dwell_click_type;
|
||||
ClutterPointerA11yDwellMode dwell_mode;
|
||||
ClutterPointerA11yDwellDirection dwell_gesture_single;
|
||||
ClutterPointerA11yDwellDirection dwell_gesture_double;
|
||||
ClutterPointerA11yDwellDirection dwell_gesture_drag;
|
||||
ClutterPointerA11yDwellDirection dwell_gesture_secondary;
|
||||
gint secondary_click_delay;
|
||||
gint dwell_delay;
|
||||
gint dwell_threshold;
|
||||
} ClutterPointerA11ySettings;
|
||||
/*< private >*/
|
||||
GObject parent_instance;
|
||||
|
||||
ClutterDeviceManagerPrivate *priv;
|
||||
};
|
||||
|
||||
/**
|
||||
* ClutterDeviceManagerClass:
|
||||
@ -123,18 +121,13 @@ struct _ClutterDeviceManagerClass
|
||||
/* Keyboard accessbility */
|
||||
void (* apply_kbd_a11y_settings) (ClutterDeviceManager *device_manger,
|
||||
ClutterKbdA11ySettings *settings);
|
||||
|
||||
/* Event platform data */
|
||||
void (* copy_event_data) (ClutterDeviceManager *device_manager,
|
||||
const ClutterEvent *src,
|
||||
ClutterEvent *dest);
|
||||
void (* free_event_data) (ClutterDeviceManager *device_manager,
|
||||
ClutterEvent *event);
|
||||
|
||||
/* padding */
|
||||
gpointer _padding[4];
|
||||
gpointer _padding[6];
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_device_manager_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterDeviceManager *clutter_device_manager_get_default (void);
|
||||
CLUTTER_EXPORT
|
||||
@ -159,23 +152,10 @@ ClutterVirtualDeviceType clutter_device_manager_get_supported_virtual_device_typ
|
||||
CLUTTER_EXPORT
|
||||
void clutter_device_manager_set_kbd_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterKbdA11ySettings *settings);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_device_manager_get_kbd_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterKbdA11ySettings *settings);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_device_manager_set_pointer_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterPointerA11ySettings *settings);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_device_manager_get_pointer_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterPointerA11ySettings *settings);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_device_manager_set_pointer_a11y_dwell_click_type (ClutterDeviceManager *device_manager,
|
||||
ClutterPointerA11yDwellClickType click_type);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_DEVICE_MANAGER_H__ */
|
||||
|
@ -81,7 +81,7 @@ struct _ClutterDragActionPrivate
|
||||
gint y_drag_threshold;
|
||||
ClutterActor *drag_handle;
|
||||
ClutterDragAxis drag_axis;
|
||||
graphene_rect_t drag_area;
|
||||
ClutterRect drag_area;
|
||||
|
||||
ClutterInputDevice *device;
|
||||
ClutterEventSequence *sequence;
|
||||
@ -542,7 +542,7 @@ clutter_drag_action_real_drag_motion (ClutterDragAction *action,
|
||||
|
||||
if (action->priv->drag_area_set)
|
||||
{
|
||||
graphene_rect_t *drag_area = &action->priv->drag_area;
|
||||
ClutterRect *drag_area = &action->priv->drag_area;
|
||||
|
||||
x = CLAMP (x, drag_area->origin.x, drag_area->origin.x + drag_area->size.width);
|
||||
y = CLAMP (y, drag_area->origin.y, drag_area->origin.y + drag_area->size.height);
|
||||
@ -811,7 +811,7 @@ clutter_drag_action_class_init (ClutterDragActionClass *klass)
|
||||
g_param_spec_boxed ("drag-area",
|
||||
P_("Drag Area"),
|
||||
P_("Constrains the dragging to a rectangle"),
|
||||
GRAPHENE_TYPE_RECT,
|
||||
CLUTTER_TYPE_RECT,
|
||||
CLUTTER_PARAM_READWRITE);
|
||||
|
||||
/**
|
||||
@ -1267,10 +1267,10 @@ clutter_drag_action_get_motion_coords (ClutterDragAction *action,
|
||||
/**
|
||||
* clutter_drag_action_get_drag_area:
|
||||
* @action: a #ClutterDragAction
|
||||
* @drag_area: (out caller-allocates): a #graphene_rect_t to be filled
|
||||
* @drag_area: (out caller-allocates): a #ClutterRect to be filled
|
||||
*
|
||||
* Retrieves the "drag area" associated with @action, that
|
||||
* is a #graphene_rect_t that constrains the actor movements,
|
||||
* is a #ClutterRect that constrains the actor movements,
|
||||
* in parents coordinates.
|
||||
*
|
||||
* Returns: %TRUE if the actor is actually constrained (and thus
|
||||
@ -1278,7 +1278,7 @@ clutter_drag_action_get_motion_coords (ClutterDragAction *action,
|
||||
*/
|
||||
gboolean
|
||||
clutter_drag_action_get_drag_area (ClutterDragAction *action,
|
||||
graphene_rect_t *drag_area)
|
||||
ClutterRect *drag_area)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_DRAG_ACTION (action), FALSE);
|
||||
|
||||
@ -1298,8 +1298,8 @@ clutter_drag_action_get_drag_area (ClutterDragAction *action,
|
||||
* If @drag_area is %NULL, the actor is not constrained.
|
||||
*/
|
||||
void
|
||||
clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const graphene_rect_t *drag_area)
|
||||
clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const ClutterRect *drag_area)
|
||||
{
|
||||
ClutterDragActionPrivate *priv;
|
||||
|
||||
|
@ -141,11 +141,11 @@ void clutter_drag_action_get_motion_coords (ClutterDragAction *actio
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_drag_action_get_drag_area (ClutterDragAction *action,
|
||||
graphene_rect_t *drag_area);
|
||||
ClutterRect *drag_area);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const graphene_rect_t *drag_area);
|
||||
void clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const ClutterRect *drag_area);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -428,7 +428,8 @@ clutter_drop_action_class_init (ClutterDropActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterDropActionClass, over_in),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@ -447,7 +448,8 @@ clutter_drop_action_class_init (ClutterDropActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterDropActionClass, over_out),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
|
@ -7,7 +7,7 @@ G_BEGIN_DECLS
|
||||
|
||||
gboolean _clutter_effect_pre_paint (ClutterEffect *effect);
|
||||
void _clutter_effect_post_paint (ClutterEffect *effect);
|
||||
gboolean _clutter_effect_modify_paint_volume (ClutterEffect *effect,
|
||||
gboolean _clutter_effect_get_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume);
|
||||
gboolean _clutter_effect_has_custom_paint_volume (ClutterEffect *effect);
|
||||
void _clutter_effect_paint (ClutterEffect *effect,
|
||||
|
@ -100,13 +100,13 @@
|
||||
* // Clear the previous state //
|
||||
* if (self->rect_1)
|
||||
* {
|
||||
* cogl_object_unref (self->rect_1);
|
||||
* cogl_handle_unref (self->rect_1);
|
||||
* self->rect_1 = NULL;
|
||||
* }
|
||||
*
|
||||
* if (self->rect_2)
|
||||
* {
|
||||
* cogl_object_unref (self->rect_2);
|
||||
* cogl_handle_unref (self->rect_2);
|
||||
* self->rect_2 = NULL;
|
||||
* }
|
||||
*
|
||||
@ -188,8 +188,8 @@ clutter_effect_real_post_paint (ClutterEffect *effect)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_effect_real_modify_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
clutter_effect_real_get_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@ -252,7 +252,7 @@ clutter_effect_class_init (ClutterEffectClass *klass)
|
||||
|
||||
klass->pre_paint = clutter_effect_real_pre_paint;
|
||||
klass->post_paint = clutter_effect_real_post_paint;
|
||||
klass->modify_paint_volume = clutter_effect_real_modify_paint_volume;
|
||||
klass->get_paint_volume = clutter_effect_real_get_paint_volume;
|
||||
klass->paint = clutter_effect_real_paint;
|
||||
klass->pick = clutter_effect_real_pick;
|
||||
}
|
||||
@ -297,14 +297,13 @@ _clutter_effect_pick (ClutterEffect *effect,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_effect_modify_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
_clutter_effect_get_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_EFFECT (effect), FALSE);
|
||||
g_return_val_if_fail (volume != NULL, FALSE);
|
||||
|
||||
return CLUTTER_EFFECT_GET_CLASS (effect)->modify_paint_volume (effect,
|
||||
volume);
|
||||
return CLUTTER_EFFECT_GET_CLASS (effect)->get_paint_volume (effect, volume);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@ -312,7 +311,7 @@ _clutter_effect_has_custom_paint_volume (ClutterEffect *effect)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_EFFECT (effect), FALSE);
|
||||
|
||||
return CLUTTER_EFFECT_GET_CLASS (effect)->modify_paint_volume != clutter_effect_real_modify_paint_volume;
|
||||
return CLUTTER_EFFECT_GET_CLASS (effect)->get_paint_volume != clutter_effect_real_get_paint_volume;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -60,7 +60,7 @@ struct _ClutterEffect
|
||||
* ClutterEffectClass:
|
||||
* @pre_paint: virtual function
|
||||
* @post_paint: virtual function
|
||||
* @modify_paint_volume: virtual function
|
||||
* @get_paint_volume: virtual function
|
||||
* @paint: virtual function
|
||||
* @pick: virtual function
|
||||
*
|
||||
@ -74,16 +74,16 @@ struct _ClutterEffectClass
|
||||
ClutterActorMetaClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
gboolean (* pre_paint) (ClutterEffect *effect);
|
||||
void (* post_paint) (ClutterEffect *effect);
|
||||
gboolean (* pre_paint) (ClutterEffect *effect);
|
||||
void (* post_paint) (ClutterEffect *effect);
|
||||
|
||||
gboolean (* modify_paint_volume) (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume);
|
||||
gboolean (* get_paint_volume) (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume);
|
||||
|
||||
void (* paint) (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags);
|
||||
void (* pick) (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags);
|
||||
void (* paint) (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags);
|
||||
void (* pick) (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags);
|
||||
|
||||
/*< private >*/
|
||||
void (* _clutter_effect4) (void);
|
||||
|
@ -13,7 +13,7 @@ G_BEGIN_DECLS
|
||||
/*** END file-header ***/
|
||||
|
||||
/*** BEGIN file-production ***/
|
||||
/* enumerations from "@basename@" */
|
||||
/* enumerations from "@filename@" */
|
||||
/*** END file-production ***/
|
||||
|
||||
/*** BEGIN value-header ***/
|
||||
|
@ -51,8 +51,7 @@ G_BEGIN_DECLS
|
||||
*
|
||||
* 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_NORTH,
|
||||
CLUTTER_GRAVITY_NORTH_EAST,
|
||||
@ -75,8 +74,7 @@ typedef enum /*< prefix=CLUTTER_GRAVITY >*/
|
||||
*
|
||||
* Since: 0.4
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER >*/
|
||||
CLUTTER_X_AXIS,
|
||||
CLUTTER_Y_AXIS,
|
||||
CLUTTER_Z_AXIS
|
||||
@ -93,8 +91,7 @@ typedef enum /*< prefix=CLUTTER >*/
|
||||
*
|
||||
* Deprecated: 1.22
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_ROTATE >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_ROTATE >*/
|
||||
CLUTTER_ROTATE_CW,
|
||||
CLUTTER_ROTATE_CCW
|
||||
} ClutterRotateDirection;
|
||||
@ -110,8 +107,7 @@ typedef enum /*< prefix=CLUTTER_ROTATE >*/
|
||||
*
|
||||
* Since: 0.8
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_REQUEST >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_REQUEST >*/
|
||||
CLUTTER_REQUEST_HEIGHT_FOR_WIDTH,
|
||||
CLUTTER_REQUEST_WIDTH_FOR_HEIGHT,
|
||||
CLUTTER_REQUEST_CONTENT_SIZE
|
||||
@ -204,8 +200,7 @@ typedef enum /*< prefix=CLUTTER_REQUEST >*/
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_CUSTOM_MODE = 0,
|
||||
|
||||
/* linear */
|
||||
@ -277,6 +272,23 @@ typedef enum
|
||||
CLUTTER_ANIMATION_LAST
|
||||
} ClutterAnimationMode;
|
||||
|
||||
/**
|
||||
* ClutterFontFlags:
|
||||
* @CLUTTER_FONT_MIPMAPPING: Set to use mipmaps for the glyph cache textures.
|
||||
* @CLUTTER_FONT_HINTING: Set to enable hinting on the glyphs.
|
||||
*
|
||||
* Runtime flags to change the font quality. To be used with
|
||||
* clutter_set_font_flags().
|
||||
*
|
||||
* Since: 1.0
|
||||
*
|
||||
* Deprecated: 1.22: Use #cairo_font_options_t instead
|
||||
*/
|
||||
typedef enum { /*< prefix=CLUTTER_FONT >*/
|
||||
CLUTTER_FONT_MIPMAPPING = (1 << 0),
|
||||
CLUTTER_FONT_HINTING = (1 << 1)
|
||||
} ClutterFontFlags;
|
||||
|
||||
/**
|
||||
* ClutterTextDirection:
|
||||
* @CLUTTER_TEXT_DIRECTION_DEFAULT: Use the default setting, as returned
|
||||
@ -288,8 +300,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_TEXT_DIRECTION_DEFAULT,
|
||||
CLUTTER_TEXT_DIRECTION_LTR,
|
||||
CLUTTER_TEXT_DIRECTION_RTL
|
||||
@ -304,8 +315,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_VERTEX_SHADER,
|
||||
CLUTTER_FRAGMENT_SHADER
|
||||
} ClutterShaderType;
|
||||
@ -340,8 +350,7 @@ typedef enum
|
||||
*
|
||||
* Since: 0.4
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_SHIFT_MASK = 1 << 0,
|
||||
CLUTTER_LOCK_MASK = 1 << 1,
|
||||
CLUTTER_CONTROL_MASK = 1 << 2,
|
||||
@ -407,8 +416,7 @@ typedef enum
|
||||
* Keyboard accessibility features applied to a ClutterInputDevice keyboard.
|
||||
*
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_KEYBOARD_ENABLED = 1 << 0,
|
||||
CLUTTER_A11Y_TIMEOUT_ENABLED = 1 << 1,
|
||||
CLUTTER_A11Y_MOUSE_KEYS_ENABLED = 1 << 2,
|
||||
@ -425,88 +433,6 @@ typedef enum
|
||||
CLUTTER_A11Y_FEATURE_STATE_CHANGE_BEEP = 1 << 13,
|
||||
} ClutterKeyboardA11yFlags;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11yFlags:
|
||||
* @CLUTTER_A11Y_POINTER_ENABLED:
|
||||
* @CLUTTER_A11Y_SECONDARY_CLICK_ENABLED:
|
||||
* @CLUTTER_A11Y_DWELL_ENABLED:
|
||||
*
|
||||
* Pointer accessibility features applied to a ClutterInputDevice pointer.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_SECONDARY_CLICK_ENABLED = 1 << 0,
|
||||
CLUTTER_A11Y_DWELL_ENABLED = 1 << 1,
|
||||
} ClutterPointerA11yFlags;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11yDwellClickType:
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE: Internal use only
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY:
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY:
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE:
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE:
|
||||
* @CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG:
|
||||
*
|
||||
* Dwell click types.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE,
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY,
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY,
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE,
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE,
|
||||
CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG,
|
||||
} ClutterPointerA11yDwellClickType;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11yDwellDirection:
|
||||
* @CLUTTER_A11Y_DWELL_DIRECTION_NONE:
|
||||
* @CLUTTER_A11Y_DWELL_DIRECTION_LEFT:
|
||||
* @CLUTTER_A11Y_DWELL_DIRECTION_RIGHT:
|
||||
* @CLUTTER_A11Y_DWELL_DIRECTION_UP:
|
||||
* @CLUTTER_A11Y_DWELL_DIRECTION_DOWN:
|
||||
*
|
||||
* Dwell gesture directions.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_DWELL_DIRECTION_NONE,
|
||||
CLUTTER_A11Y_DWELL_DIRECTION_LEFT,
|
||||
CLUTTER_A11Y_DWELL_DIRECTION_RIGHT,
|
||||
CLUTTER_A11Y_DWELL_DIRECTION_UP,
|
||||
CLUTTER_A11Y_DWELL_DIRECTION_DOWN,
|
||||
} ClutterPointerA11yDwellDirection;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11yDwellMode:
|
||||
* @CLUTTER_A11Y_DWELL_MODE_WINDOW:
|
||||
* @CLUTTER_A11Y_DWELL_MODE_GESTURE:
|
||||
*
|
||||
* Dwell mode.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_DWELL_MODE_WINDOW,
|
||||
CLUTTER_A11Y_DWELL_MODE_GESTURE,
|
||||
} ClutterPointerA11yDwellMode;
|
||||
|
||||
/**
|
||||
* ClutterPointerA11yTimeoutType:
|
||||
* @CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK:
|
||||
* @CLUTTER_A11Y_TIMEOUT_TYPE_DWELL:
|
||||
* @CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE:
|
||||
*
|
||||
* Pointer accessibility timeout type.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
||||
} ClutterPointerA11yTimeoutType;
|
||||
|
||||
/**
|
||||
* ClutterActorFlags:
|
||||
* @CLUTTER_ACTOR_MAPPED: the actor will be painted (is visible, and inside
|
||||
@ -522,8 +448,7 @@ typedef enum {
|
||||
*
|
||||
* Flags used to signal the state of an actor.
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_ACTOR >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_ACTOR >*/
|
||||
CLUTTER_ACTOR_MAPPED = 1 << 1,
|
||||
CLUTTER_ACTOR_REALIZED = 1 << 2,
|
||||
CLUTTER_ACTOR_REACTIVE = 1 << 3,
|
||||
@ -543,8 +468,7 @@ typedef enum /*< prefix=CLUTTER_ACTOR >*/
|
||||
*
|
||||
* 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_ALWAYS = 1<<1
|
||||
} ClutterOffscreenRedirect;
|
||||
@ -568,8 +492,7 @@ typedef enum /*< prefix=CLUTTER_OFFSCREEN_REDIRECT >*/
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_ALLOCATION_NONE = 0,
|
||||
CLUTTER_ABSOLUTE_ORIGIN_CHANGED = 1 << 1,
|
||||
CLUTTER_DELEGATE_LAYOUT = 1 << 2
|
||||
@ -586,8 +509,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_ALIGN >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_ALIGN >*/
|
||||
CLUTTER_ALIGN_X_AXIS,
|
||||
CLUTTER_ALIGN_Y_AXIS,
|
||||
CLUTTER_ALIGN_BOTH
|
||||
@ -604,8 +526,7 @@ typedef enum /*< prefix=CLUTTER_ALIGN >*/
|
||||
*
|
||||
* Deprecated: 1.22
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_INTERPOLATION_LINEAR,
|
||||
CLUTTER_INTERPOLATION_CUBIC
|
||||
} ClutterInterpolation;
|
||||
@ -630,8 +551,7 @@ typedef enum
|
||||
* Deprecated: 1.12: Use #ClutterActorAlign and the #ClutterActor
|
||||
* API instead
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_BIN_ALIGNMENT_FIXED,
|
||||
CLUTTER_BIN_ALIGNMENT_FILL,
|
||||
CLUTTER_BIN_ALIGNMENT_START,
|
||||
@ -656,8 +576,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_BIND >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_BIND >*/
|
||||
CLUTTER_BIND_X,
|
||||
CLUTTER_BIND_Y,
|
||||
CLUTTER_BIND_WIDTH,
|
||||
@ -676,8 +595,7 @@ typedef enum /*< prefix=CLUTTER_BIND >*/
|
||||
*
|
||||
* 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)
|
||||
} ClutterEffectPaintFlags;
|
||||
|
||||
@ -693,8 +611,7 @@ typedef enum /*< prefix=CLUTTER_EFFECT_PAINT >*/
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_BOX_ALIGNMENT_START,
|
||||
CLUTTER_BOX_ALIGNMENT_END,
|
||||
CLUTTER_BOX_ALIGNMENT_CENTER
|
||||
@ -711,8 +628,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.8
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_LONG_PRESS >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_LONG_PRESS >*/
|
||||
CLUTTER_LONG_PRESS_QUERY,
|
||||
CLUTTER_LONG_PRESS_ACTIVATE,
|
||||
CLUTTER_LONG_PRESS_CANCEL
|
||||
@ -770,8 +686,7 @@ typedef enum /*< prefix=CLUTTER_LONG_PRESS >*/
|
||||
*
|
||||
* Since: 1.6
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_COLOR >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_COLOR >*/
|
||||
/* CGA/EGA-like palette */
|
||||
CLUTTER_COLOR_WHITE = 0,
|
||||
CLUTTER_COLOR_BLACK,
|
||||
@ -835,8 +750,7 @@ typedef enum /*< prefix=CLUTTER_COLOR >*/
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_DRAG >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_DRAG >*/
|
||||
CLUTTER_DRAG_AXIS_NONE = 0,
|
||||
|
||||
CLUTTER_DRAG_X_AXIS,
|
||||
@ -853,8 +767,7 @@ typedef enum /*< prefix=CLUTTER_DRAG >*/
|
||||
*
|
||||
* Since: 0.6
|
||||
*/
|
||||
typedef enum /*< flags prefix=CLUTTER_EVENT >*/
|
||||
{
|
||||
typedef enum { /*< flags prefix=CLUTTER_EVENT >*/
|
||||
CLUTTER_EVENT_NONE = 0,
|
||||
CLUTTER_EVENT_FLAG_SYNTHETIC = 1 << 0,
|
||||
CLUTTER_EVENT_FLAG_INPUT_METHOD = 1 << 1,
|
||||
@ -899,8 +812,7 @@ typedef enum /*< flags prefix=CLUTTER_EVENT >*/
|
||||
*
|
||||
* Since: 0.4
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER >*/
|
||||
CLUTTER_NOTHING = 0,
|
||||
CLUTTER_KEY_PRESS,
|
||||
CLUTTER_KEY_RELEASE,
|
||||
@ -945,8 +857,7 @@ typedef enum /*< prefix=CLUTTER >*/
|
||||
*
|
||||
* Since: 0.4
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_SCROLL >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_SCROLL >*/
|
||||
CLUTTER_SCROLL_UP,
|
||||
CLUTTER_SCROLL_DOWN,
|
||||
CLUTTER_SCROLL_LEFT,
|
||||
@ -956,23 +867,28 @@ typedef enum /*< prefix=CLUTTER_SCROLL >*/
|
||||
|
||||
/**
|
||||
* ClutterStageState:
|
||||
* @CLUTTER_STAGE_STATE_FULLSCREEN: Fullscreen mask
|
||||
* @CLUTTER_STAGE_STATE_OFFSCREEN: Offscreen mask (deprecated)
|
||||
* @CLUTTER_STAGE_STATE_ACTIVATED: Activated mask
|
||||
*
|
||||
* Stage state masks, used by the #ClutterEvent of type %CLUTTER_STAGE_STATE.
|
||||
*
|
||||
* Since: 0.4
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_STAGE_STATE_FULLSCREEN = (1 << 1),
|
||||
CLUTTER_STAGE_STATE_OFFSCREEN = (1 << 2),
|
||||
CLUTTER_STAGE_STATE_ACTIVATED = (1 << 3)
|
||||
} ClutterStageState;
|
||||
|
||||
/**
|
||||
* ClutterFeatureFlags:
|
||||
* @CLUTTER_FEATURE_TEXTURE_NPOT: Set if NPOTS textures supported.
|
||||
* @CLUTTER_FEATURE_SWAP_THROTTLE: Set if backend throttles buffer swaps.
|
||||
* @CLUTTER_FEATURE_TEXTURE_YUV: Set if YUV based textures supported.
|
||||
* @CLUTTER_FEATURE_TEXTURE_READ_PIXELS: Set if texture pixels can be read.
|
||||
* @CLUTTER_FEATURE_STAGE_STATIC: Set if stage size if fixed (i.e framebuffer)
|
||||
* @CLUTTER_FEATURE_STAGE_USER_RESIZE: Set if stage is able to be user resized.
|
||||
* @CLUTTER_FEATURE_STAGE_CURSOR: Set if stage has a graphical cursor.
|
||||
* @CLUTTER_FEATURE_SHADERS_GLSL: Set if the backend supports GLSL shaders.
|
||||
* @CLUTTER_FEATURE_OFFSCREEN: Set if the backend supports offscreen rendering.
|
||||
@ -986,10 +902,12 @@ typedef enum
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_FEATURE_TEXTURE_NPOT = (1 << 2),
|
||||
CLUTTER_FEATURE_SWAP_THROTTLE = (1 << 3),
|
||||
CLUTTER_FEATURE_TEXTURE_YUV = (1 << 4),
|
||||
CLUTTER_FEATURE_TEXTURE_READ_PIXELS = (1 << 5),
|
||||
CLUTTER_FEATURE_STAGE_STATIC = (1 << 6),
|
||||
CLUTTER_FEATURE_STAGE_USER_RESIZE = (1 << 7),
|
||||
CLUTTER_FEATURE_STAGE_CURSOR = (1 << 8),
|
||||
CLUTTER_FEATURE_SHADERS_GLSL = (1 << 9),
|
||||
CLUTTER_FEATURE_OFFSCREEN = (1 << 10),
|
||||
@ -1009,8 +927,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_FLOW >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_FLOW >*/
|
||||
CLUTTER_FLOW_HORIZONTAL,
|
||||
CLUTTER_FLOW_VERTICAL
|
||||
} ClutterFlowOrientation;
|
||||
@ -1037,8 +954,7 @@ typedef enum /*< prefix=CLUTTER_FLOW >*/
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_POINTER_DEVICE,
|
||||
CLUTTER_KEYBOARD_DEVICE,
|
||||
CLUTTER_EXTENSION_DEVICE,
|
||||
@ -1066,8 +982,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.6
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_INPUT_MODE_MASTER,
|
||||
CLUTTER_INPUT_MODE_SLAVE,
|
||||
CLUTTER_INPUT_MODE_FLOATING
|
||||
@ -1092,8 +1007,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.6
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_INPUT_AXIS_IGNORE,
|
||||
|
||||
CLUTTER_INPUT_AXIS_X,
|
||||
@ -1120,8 +1034,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.6
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_SNAP_EDGE_TOP,
|
||||
CLUTTER_SNAP_EDGE_RIGHT,
|
||||
CLUTTER_SNAP_EDGE_BOTTOM,
|
||||
@ -1138,8 +1051,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_PICK_NONE = 0,
|
||||
CLUTTER_PICK_REACTIVE,
|
||||
CLUTTER_PICK_ALL
|
||||
@ -1156,8 +1068,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.8
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_SWIPE_DIRECTION >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_SWIPE_DIRECTION >*/
|
||||
CLUTTER_SWIPE_DIRECTION_UP = 1 << 0,
|
||||
CLUTTER_SWIPE_DIRECTION_DOWN = 1 << 1,
|
||||
CLUTTER_SWIPE_DIRECTION_LEFT = 1 << 2,
|
||||
@ -1177,8 +1088,7 @@ typedef enum /*< prefix=CLUTTER_SWIPE_DIRECTION >*/
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_PAN >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_PAN >*/
|
||||
CLUTTER_PAN_AXIS_NONE = 0,
|
||||
|
||||
CLUTTER_PAN_X_AXIS,
|
||||
@ -1203,8 +1113,7 @@ typedef enum /*< prefix=CLUTTER_PAN >*/
|
||||
*
|
||||
* Deprecated: 1.22: Use the alignment properties of #ClutterActor
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_TABLE_ALIGNMENT_START,
|
||||
CLUTTER_TABLE_ALIGNMENT_CENTER,
|
||||
CLUTTER_TABLE_ALIGNMENT_END
|
||||
@ -1225,8 +1134,7 @@ typedef enum
|
||||
* Deprecated: 1.22: The #ClutterTexture class was the only user of
|
||||
* this API
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_TEXTURE >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_TEXTURE >*/
|
||||
CLUTTER_TEXTURE_NONE = 0,
|
||||
CLUTTER_TEXTURE_RGB_FLAG_BGR = 1 << 1,
|
||||
CLUTTER_TEXTURE_RGB_FLAG_PREMULT = 1 << 2, /* FIXME: not handled */
|
||||
@ -1250,8 +1158,7 @@ typedef enum /*< prefix=CLUTTER_TEXTURE >*/
|
||||
* this API; use #ClutterImage and clutter_actor_set_content_scaling_filters()
|
||||
* instead.
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_TEXTURE_QUALITY >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_TEXTURE_QUALITY >*/
|
||||
CLUTTER_TEXTURE_QUALITY_LOW,
|
||||
CLUTTER_TEXTURE_QUALITY_MEDIUM,
|
||||
CLUTTER_TEXTURE_QUALITY_HIGH
|
||||
@ -1266,8 +1173,7 @@ typedef enum /*< prefix=CLUTTER_TEXTURE_QUALITY >*/
|
||||
*
|
||||
* Since: 0.6
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_TIMELINE_FORWARD,
|
||||
CLUTTER_TIMELINE_BACKWARD
|
||||
} ClutterTimelineDirection;
|
||||
@ -1286,8 +1192,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_UNIT >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_UNIT >*/
|
||||
CLUTTER_UNIT_PIXEL,
|
||||
CLUTTER_UNIT_EM,
|
||||
CLUTTER_UNIT_MM,
|
||||
@ -1317,8 +1222,7 @@ typedef enum /*< prefix=CLUTTER_UNIT >*/
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_PATH_MOVE_TO = 0,
|
||||
CLUTTER_PATH_LINE_TO = 1,
|
||||
CLUTTER_PATH_CURVE_TO = 2,
|
||||
@ -1349,8 +1253,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_ACTOR_ALIGN_FILL,
|
||||
CLUTTER_ACTOR_ALIGN_START,
|
||||
CLUTTER_ACTOR_ALIGN_CENTER,
|
||||
@ -1370,8 +1273,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_REPAINT_FLAGS_PRE_PAINT = 1 << 0,
|
||||
CLUTTER_REPAINT_FLAGS_POST_PAINT = 1 << 1,
|
||||
CLUTTER_REPAINT_FLAGS_QUEUE_REDRAW_ON_ADD = 1 << 2
|
||||
@ -1396,8 +1298,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_CONTENT_GRAVITY_TOP_LEFT,
|
||||
CLUTTER_CONTENT_GRAVITY_TOP,
|
||||
CLUTTER_CONTENT_GRAVITY_TOP_RIGHT,
|
||||
@ -1427,8 +1328,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_SCALING_FILTER_LINEAR,
|
||||
CLUTTER_SCALING_FILTER_NEAREST,
|
||||
CLUTTER_SCALING_FILTER_TRILINEAR
|
||||
@ -1443,8 +1343,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_ORIENTATION_HORIZONTAL,
|
||||
CLUTTER_ORIENTATION_VERTICAL
|
||||
} ClutterOrientation;
|
||||
@ -1460,8 +1359,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_SCROLL >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_SCROLL >*/
|
||||
CLUTTER_SCROLL_NONE = 0,
|
||||
|
||||
CLUTTER_SCROLL_HORIZONTALLY = 1 << 0,
|
||||
@ -1481,8 +1379,7 @@ typedef enum /*< prefix=CLUTTER_SCROLL >*/
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_GRID_POSITION_LEFT,
|
||||
CLUTTER_GRID_POSITION_RIGHT,
|
||||
CLUTTER_GRID_POSITION_TOP,
|
||||
@ -1500,8 +1397,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_REPEAT_NONE = 0,
|
||||
CLUTTER_REPEAT_X_AXIS = 1 << 0,
|
||||
CLUTTER_REPEAT_Y_AXIS = 1 << 1,
|
||||
@ -1523,8 +1419,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_STEP_MODE_START,
|
||||
CLUTTER_STEP_MODE_END
|
||||
} ClutterStepMode;
|
||||
@ -1540,8 +1435,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_ZOOM >*/
|
||||
{
|
||||
typedef enum { /*< prefix=CLUTTER_ZOOM >*/
|
||||
CLUTTER_ZOOM_X_AXIS,
|
||||
CLUTTER_ZOOM_Y_AXIS,
|
||||
CLUTTER_ZOOM_BOTH
|
||||
@ -1564,8 +1458,7 @@ typedef enum /*< prefix=CLUTTER_ZOOM >*/
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_GESTURE_TRIGGER_EDGE_NONE = 0,
|
||||
CLUTTER_GESTURE_TRIGGER_EDGE_AFTER,
|
||||
CLUTTER_GESTURE_TRIGGER_EDGE_BEFORE
|
||||
@ -1601,8 +1494,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.24
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_TOUCHPAD_GESTURE_PHASE_BEGIN,
|
||||
CLUTTER_TOUCHPAD_GESTURE_PHASE_UPDATE,
|
||||
CLUTTER_TOUCHPAD_GESTURE_PHASE_END,
|
||||
@ -1624,8 +1516,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.26
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_SCROLL_SOURCE_UNKNOWN,
|
||||
CLUTTER_SCROLL_SOURCE_WHEEL,
|
||||
CLUTTER_SCROLL_SOURCE_FINGER,
|
||||
@ -1643,8 +1534,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.26
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_SCROLL_FINISHED_NONE = 0,
|
||||
CLUTTER_SCROLL_FINISHED_HORIZONTAL = 1 << 0,
|
||||
CLUTTER_SCROLL_FINISHED_VERTICAL = 1 << 1
|
||||
@ -1665,8 +1555,7 @@ typedef enum
|
||||
*
|
||||
* Since: 1.28
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_INPUT_DEVICE_TOOL_NONE,
|
||||
CLUTTER_INPUT_DEVICE_TOOL_PEN,
|
||||
CLUTTER_INPUT_DEVICE_TOOL_ERASER,
|
||||
@ -1677,20 +1566,17 @@ typedef enum
|
||||
CLUTTER_INPUT_DEVICE_TOOL_LENS
|
||||
} ClutterInputDeviceToolType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_INPUT_DEVICE_PAD_SOURCE_UNKNOWN,
|
||||
CLUTTER_INPUT_DEVICE_PAD_SOURCE_FINGER,
|
||||
} ClutterInputDevicePadSource;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE,
|
||||
CLUTTER_INPUT_DEVICE_MAPPING_RELATIVE,
|
||||
} ClutterInputDeviceMapping;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_INPUT_CONTENT_HINT_COMPLETION = 1 << 0,
|
||||
CLUTTER_INPUT_CONTENT_HINT_SPELLCHECK = 1 << 1,
|
||||
CLUTTER_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION = 1 << 2,
|
||||
@ -1703,8 +1589,7 @@ typedef enum
|
||||
CLUTTER_INPUT_CONTENT_HINT_MULTILINE = 1 << 9,
|
||||
} ClutterInputContentHintFlags;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_INPUT_CONTENT_PURPOSE_NORMAL,
|
||||
CLUTTER_INPUT_CONTENT_PURPOSE_ALPHA,
|
||||
CLUTTER_INPUT_CONTENT_PURPOSE_DIGITS,
|
||||
@ -1720,8 +1605,7 @@ typedef enum
|
||||
CLUTTER_INPUT_CONTENT_PURPOSE_TERMINAL,
|
||||
} ClutterInputContentPurpose;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_INPUT_PANEL_STATE_OFF,
|
||||
CLUTTER_INPUT_PANEL_STATE_ON,
|
||||
CLUTTER_INPUT_PANEL_STATE_TOGGLE,
|
||||
|
@ -5,28 +5,22 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_event_set_pointer_emulated (ClutterEvent *event,
|
||||
gboolean is_emulated);
|
||||
|
||||
/* Reinjecting queued events for processing */
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_process_event (ClutterEvent *event);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_event_process_filters (ClutterEvent *event);
|
||||
|
||||
/* clears the event queue inside the main context */
|
||||
void _clutter_clear_events_queue (void);
|
||||
void _clutter_clear_events_queue_for_stage (ClutterStage *stage);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_event_set_platform_data (ClutterEvent *event,
|
||||
gpointer data);
|
||||
CLUTTER_EXPORT
|
||||
gpointer _clutter_event_get_platform_data (const ClutterEvent *event);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_event_set_state_full (ClutterEvent *event,
|
||||
ClutterModifierType button_state,
|
||||
ClutterModifierType base_state,
|
||||
@ -34,7 +28,6 @@ void _clutter_event_set_state_full (ClutterEvent *ev
|
||||
ClutterModifierType locked_state,
|
||||
ClutterModifierType effective_state);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_event_push (const ClutterEvent *event,
|
||||
gboolean do_copy);
|
||||
|
||||
|
38
clutter/clutter/clutter-event-translator.c
Normal file
38
clutter/clutter/clutter-event-translator.c
Normal file
@ -0,0 +1,38 @@
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-event-translator.h"
|
||||
|
||||
#include "clutter-backend.h"
|
||||
#include "clutter-private.h"
|
||||
|
||||
#define clutter_event_translator_get_type _clutter_event_translator_get_type
|
||||
|
||||
typedef ClutterEventTranslatorIface ClutterEventTranslatorInterface;
|
||||
|
||||
G_DEFINE_INTERFACE (ClutterEventTranslator, clutter_event_translator, G_TYPE_OBJECT);
|
||||
|
||||
static ClutterTranslateReturn
|
||||
default_translate_event (ClutterEventTranslator *translator,
|
||||
gpointer native,
|
||||
ClutterEvent *event)
|
||||
{
|
||||
return CLUTTER_TRANSLATE_CONTINUE;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_event_translator_default_init (ClutterEventTranslatorIface *iface)
|
||||
{
|
||||
iface->translate_event = default_translate_event;
|
||||
}
|
||||
|
||||
ClutterTranslateReturn
|
||||
_clutter_event_translator_translate_event (ClutterEventTranslator *translator,
|
||||
gpointer native,
|
||||
ClutterEvent *translated)
|
||||
{
|
||||
ClutterEventTranslatorIface *iface;
|
||||
|
||||
iface = CLUTTER_EVENT_TRANSLATOR_GET_IFACE (translator);
|
||||
|
||||
return iface->translate_event (translator, native, translated);
|
||||
}
|
41
clutter/clutter/clutter-event-translator.h
Normal file
41
clutter/clutter/clutter-event-translator.h
Normal file
@ -0,0 +1,41 @@
|
||||
#ifndef __CLUTTER_EVENT_TRANSLATOR_H__
|
||||
#define __CLUTTER_EVENT_TRANSLATOR_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <clutter/clutter-event.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_EVENT_TRANSLATOR (_clutter_event_translator_get_type ())
|
||||
#define CLUTTER_EVENT_TRANSLATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_EVENT_TRANSLATOR, ClutterEventTranslator))
|
||||
#define CLUTTER_IS_EVENT_TRANSLATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_EVENT_TRANSLATOR))
|
||||
#define CLUTTER_EVENT_TRANSLATOR_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_EVENT_TRANSLATOR, ClutterEventTranslatorIface))
|
||||
|
||||
typedef struct _ClutterEventTranslator ClutterEventTranslator;
|
||||
typedef struct _ClutterEventTranslatorIface ClutterEventTranslatorIface;
|
||||
|
||||
typedef enum {
|
||||
CLUTTER_TRANSLATE_CONTINUE,
|
||||
CLUTTER_TRANSLATE_REMOVE,
|
||||
CLUTTER_TRANSLATE_QUEUE
|
||||
} ClutterTranslateReturn;
|
||||
|
||||
struct _ClutterEventTranslatorIface
|
||||
{
|
||||
GTypeInterface g_iface;
|
||||
|
||||
ClutterTranslateReturn (* translate_event) (ClutterEventTranslator *translator,
|
||||
gpointer native,
|
||||
ClutterEvent *translated);
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType _clutter_event_translator_get_type (void) G_GNUC_CONST;
|
||||
|
||||
ClutterTranslateReturn _clutter_event_translator_translate_event (ClutterEventTranslator *translator,
|
||||
gpointer native,
|
||||
ClutterEvent *translated);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_EVENT_TRANSLATOR_H__ */
|
@ -370,7 +370,7 @@ clutter_event_get_coords (const ClutterEvent *event,
|
||||
gfloat *x,
|
||||
gfloat *y)
|
||||
{
|
||||
graphene_point_t coords;
|
||||
ClutterPoint coords;
|
||||
|
||||
g_return_if_fail (event != NULL);
|
||||
|
||||
@ -386,15 +386,15 @@ clutter_event_get_coords (const ClutterEvent *event,
|
||||
/**
|
||||
* clutter_event_get_position:
|
||||
* @event: a #ClutterEvent
|
||||
* @position: a #graphene_point_t
|
||||
* @position: a #ClutterPoint
|
||||
*
|
||||
* Retrieves the event coordinates as a #graphene_point_t.
|
||||
* Retrieves the event coordinates as a #ClutterPoint.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
void
|
||||
clutter_event_get_position (const ClutterEvent *event,
|
||||
graphene_point_t *position)
|
||||
ClutterPoint *position)
|
||||
{
|
||||
g_return_if_fail (event != NULL);
|
||||
g_return_if_fail (position != NULL);
|
||||
@ -415,42 +415,42 @@ clutter_event_get_position (const ClutterEvent *event,
|
||||
case CLUTTER_PAD_BUTTON_RELEASE:
|
||||
case CLUTTER_PAD_STRIP:
|
||||
case CLUTTER_PAD_RING:
|
||||
graphene_point_init (position, 0.f, 0.f);
|
||||
clutter_point_init (position, 0.f, 0.f);
|
||||
break;
|
||||
|
||||
case CLUTTER_ENTER:
|
||||
case CLUTTER_LEAVE:
|
||||
graphene_point_init (position, event->crossing.x, event->crossing.y);
|
||||
clutter_point_init (position, event->crossing.x, event->crossing.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
graphene_point_init (position, event->button.x, event->button.y);
|
||||
clutter_point_init (position, event->button.x, event->button.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_MOTION:
|
||||
graphene_point_init (position, event->motion.x, event->motion.y);
|
||||
clutter_point_init (position, event->motion.x, event->motion.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCH_BEGIN:
|
||||
case CLUTTER_TOUCH_UPDATE:
|
||||
case CLUTTER_TOUCH_END:
|
||||
case CLUTTER_TOUCH_CANCEL:
|
||||
graphene_point_init (position, event->touch.x, event->touch.y);
|
||||
clutter_point_init (position, event->touch.x, event->touch.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_SCROLL:
|
||||
graphene_point_init (position, event->scroll.x, event->scroll.y);
|
||||
clutter_point_init (position, event->scroll.x, event->scroll.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCHPAD_PINCH:
|
||||
graphene_point_init (position, event->touchpad_pinch.x,
|
||||
event->touchpad_pinch.y);
|
||||
clutter_point_init (position, event->touchpad_pinch.x,
|
||||
event->touchpad_pinch.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCHPAD_SWIPE:
|
||||
graphene_point_init (position, event->touchpad_swipe.x,
|
||||
event->touchpad_swipe.y);
|
||||
clutter_point_init (position, event->touchpad_swipe.x,
|
||||
event->touchpad_swipe.y);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1021,9 +1021,6 @@ clutter_event_get_event_sequence (const ClutterEvent *event)
|
||||
event->type == CLUTTER_TOUCH_END ||
|
||||
event->type == CLUTTER_TOUCH_CANCEL)
|
||||
return event->touch.sequence;
|
||||
else if (event->type == CLUTTER_ENTER ||
|
||||
event->type == CLUTTER_LEAVE)
|
||||
return event->crossing.sequence;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -1796,12 +1793,12 @@ float
|
||||
clutter_event_get_distance (const ClutterEvent *source,
|
||||
const ClutterEvent *target)
|
||||
{
|
||||
graphene_point_t p0, p1;
|
||||
ClutterPoint p0, p1;
|
||||
|
||||
clutter_event_get_position (source, &p0);
|
||||
clutter_event_get_position (source, &p1);
|
||||
|
||||
return graphene_point_distance (&p0, &p1, NULL, NULL);
|
||||
return clutter_point_distance (&p0, &p1, NULL, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1822,17 +1819,17 @@ double
|
||||
clutter_event_get_angle (const ClutterEvent *source,
|
||||
const ClutterEvent *target)
|
||||
{
|
||||
graphene_point_t p0, p1;
|
||||
ClutterPoint p0, p1;
|
||||
float x_distance, y_distance;
|
||||
double angle;
|
||||
|
||||
clutter_event_get_position (source, &p0);
|
||||
clutter_event_get_position (target, &p1);
|
||||
|
||||
if (graphene_point_equal (&p0, &p1))
|
||||
if (clutter_point_equals (&p0, &p1))
|
||||
return 0;
|
||||
|
||||
graphene_point_distance (&p0, &p1, &x_distance, &y_distance);
|
||||
clutter_point_distance (&p0, &p1, &x_distance, &y_distance);
|
||||
|
||||
angle = atan2 (x_distance, y_distance);
|
||||
|
||||
|
@ -269,7 +269,6 @@ struct _ClutterCrossingEvent
|
||||
gfloat x;
|
||||
gfloat y;
|
||||
ClutterInputDevice *device;
|
||||
ClutterEventSequence *sequence;
|
||||
ClutterActor *related;
|
||||
};
|
||||
|
||||
@ -686,7 +685,7 @@ void clutter_event_get_coords (const ClutterEv
|
||||
gfloat *y);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_event_get_position (const ClutterEvent *event,
|
||||
graphene_point_t *position);
|
||||
ClutterPoint *position);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_event_get_distance (const ClutterEvent *source,
|
||||
const ClutterEvent *target);
|
||||
|
@ -64,13 +64,17 @@ clutter_features_from_cogl (guint cogl_flags)
|
||||
{
|
||||
ClutterFeatureFlags clutter_flags = 0;
|
||||
|
||||
if (cogl_flags & COGL_FEATURE_TEXTURE_NPOT)
|
||||
clutter_flags |= CLUTTER_FEATURE_TEXTURE_NPOT;
|
||||
|
||||
if (cogl_flags & COGL_FEATURE_TEXTURE_YUV)
|
||||
clutter_flags |= CLUTTER_FEATURE_TEXTURE_YUV;
|
||||
|
||||
if (cogl_flags & COGL_FEATURE_TEXTURE_READ_PIXELS)
|
||||
clutter_flags |= CLUTTER_FEATURE_TEXTURE_READ_PIXELS;
|
||||
|
||||
clutter_flags |= CLUTTER_FEATURE_SHADERS_GLSL;
|
||||
if (cogl_flags & COGL_FEATURE_SHADERS_GLSL)
|
||||
clutter_flags |= CLUTTER_FEATURE_SHADERS_GLSL;
|
||||
|
||||
if (cogl_flags & COGL_FEATURE_OFFSCREEN)
|
||||
clutter_flags |= CLUTTER_FEATURE_OFFSCREEN;
|
||||
|
@ -804,7 +804,8 @@ clutter_gesture_action_class_init (ClutterGestureActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterGestureActionClass, gesture_end),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@ -826,7 +827,8 @@ clutter_gesture_action_class_init (ClutterGestureActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterGestureActionClass, gesture_cancel),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
}
|
||||
|
@ -1,111 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Authored By Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
|
||||
*
|
||||
* Copyright (C) 2019 Endless, Inc
|
||||
* Copyright (C) 2009, 2010 Intel Corp
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-graphene.h"
|
||||
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-types.h"
|
||||
|
||||
static gboolean
|
||||
graphene_point_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
double progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_point_t *ap = g_value_get_boxed (a);
|
||||
const graphene_point_t *bp = g_value_get_boxed (b);
|
||||
graphene_point_t res;
|
||||
|
||||
graphene_point_interpolate (ap, bp, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
graphene_point3d_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
double progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_point3d_t *av = g_value_get_boxed (a);
|
||||
const graphene_point3d_t *bv = g_value_get_boxed (b);
|
||||
graphene_point3d_t res;
|
||||
|
||||
graphene_point3d_interpolate (av, bv, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
graphene_rect_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
double progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_rect_t *rect_a = g_value_get_boxed (a);
|
||||
const graphene_rect_t *rect_b = g_value_get_boxed (b);
|
||||
graphene_rect_t res;
|
||||
|
||||
graphene_rect_interpolate (rect_a, rect_b, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
graphene_size_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
double progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_size_t *as = g_value_get_boxed (a);
|
||||
const graphene_size_t *bs = g_value_get_boxed (b);
|
||||
graphene_size_t res;
|
||||
|
||||
graphene_size_interpolate (as, bs, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
clutter_graphene_init (void)
|
||||
{
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT,
|
||||
graphene_point_progress);
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT3D,
|
||||
graphene_point3d_progress);
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_RECT,
|
||||
graphene_rect_progress);
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_SIZE,
|
||||
graphene_size_progress);
|
||||
}
|
@ -256,7 +256,7 @@ clutter_image_set_data (ClutterImage *image,
|
||||
{
|
||||
g_set_error_literal (error, CLUTTER_IMAGE_ERROR,
|
||||
CLUTTER_IMAGE_ERROR_INVALID_DATA,
|
||||
"Unable to load image data");
|
||||
_("Unable to load image data"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -325,7 +325,7 @@ clutter_image_set_bytes (ClutterImage *image,
|
||||
{
|
||||
g_set_error_literal (error, CLUTTER_IMAGE_ERROR,
|
||||
CLUTTER_IMAGE_ERROR_INVALID_DATA,
|
||||
"Unable to load image data");
|
||||
_("Unable to load image data"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -419,7 +419,7 @@ clutter_image_set_area (ClutterImage *image,
|
||||
{
|
||||
g_set_error_literal (error, CLUTTER_IMAGE_ERROR,
|
||||
CLUTTER_IMAGE_ERROR_INVALID_DATA,
|
||||
"Unable to load image data");
|
||||
_("Unable to load image data"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -63,8 +63,7 @@ typedef struct _ClutterImageClass ClutterImageClass;
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_IMAGE_ERROR_INVALID_DATA
|
||||
} ClutterImageError;
|
||||
|
||||
|
@ -35,8 +35,7 @@ struct _ClutterInputDeviceToolPrivate
|
||||
guint64 id;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_TYPE,
|
||||
PROP_SERIAL,
|
||||
|
@ -107,9 +107,6 @@ clutter_input_device_dispose (GObject *gobject)
|
||||
device->associated = NULL;
|
||||
}
|
||||
|
||||
if (device->accessibility_virtual_device)
|
||||
g_clear_object (&device->accessibility_virtual_device);
|
||||
|
||||
g_clear_pointer (&device->axes, g_array_unref);
|
||||
g_clear_pointer (&device->keys, g_array_unref);
|
||||
g_clear_pointer (&device->scroll_info, g_array_unref);
|
||||
@ -837,7 +834,6 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
|
||||
event->crossing.x = device->current_x;
|
||||
event->crossing.y = device->current_y;
|
||||
event->crossing.related = actor;
|
||||
event->crossing.sequence = sequence;
|
||||
clutter_event_set_device (event, device);
|
||||
|
||||
/* we need to make sure that this event is processed
|
||||
@ -874,7 +870,6 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
|
||||
event->crossing.y = device->current_y;
|
||||
event->crossing.source = actor;
|
||||
event->crossing.related = old_actor;
|
||||
event->crossing.sequence = sequence;
|
||||
clutter_event_set_device (event, device);
|
||||
|
||||
/* see above */
|
||||
@ -991,7 +986,7 @@ clutter_input_device_get_enabled (ClutterInputDevice *device)
|
||||
gboolean
|
||||
clutter_input_device_get_coords (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
graphene_point_t *point)
|
||||
ClutterPoint *point)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
||||
g_return_val_if_fail (point != NULL, FALSE);
|
||||
@ -1038,11 +1033,10 @@ _clutter_input_device_update (ClutterInputDevice *device,
|
||||
ClutterStage *stage;
|
||||
ClutterActor *new_cursor_actor;
|
||||
ClutterActor *old_cursor_actor;
|
||||
graphene_point_t point = GRAPHENE_POINT_INIT (-1.0f, -1.0f);
|
||||
ClutterInputDeviceType device_type = device->device_type;
|
||||
ClutterPoint point = { -1, -1 };
|
||||
|
||||
g_assert (device_type != CLUTTER_KEYBOARD_DEVICE &&
|
||||
device_type != CLUTTER_PAD_DEVICE);
|
||||
if (device->device_type == CLUTTER_KEYBOARD_DEVICE)
|
||||
return NULL;
|
||||
|
||||
stage = device->stage;
|
||||
if (G_UNLIKELY (stage == NULL))
|
||||
@ -1925,157 +1919,6 @@ _clutter_input_device_reset_scroll_info (ClutterInputDevice *device)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_grab_actor_destroy (ClutterActor *actor,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
switch (device->device_type)
|
||||
{
|
||||
case CLUTTER_POINTER_DEVICE:
|
||||
case CLUTTER_TABLET_DEVICE:
|
||||
device->pointer_grab_actor = NULL;
|
||||
break;
|
||||
|
||||
case CLUTTER_KEYBOARD_DEVICE:
|
||||
device->keyboard_grab_actor = NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_input_device_grab:
|
||||
* @device: a #ClutterInputDevice
|
||||
* @actor: a #ClutterActor
|
||||
*
|
||||
* Acquires a grab on @actor for the given @device.
|
||||
*
|
||||
* Any event coming from @device will be delivered to @actor, bypassing
|
||||
* the usual event delivery mechanism, until the grab is released by
|
||||
* calling clutter_input_device_ungrab().
|
||||
*
|
||||
* The grab is client-side: even if the windowing system used by the Clutter
|
||||
* backend has the concept of "device grabs", Clutter will not use them.
|
||||
*
|
||||
* Only #ClutterInputDevice of types %CLUTTER_POINTER_DEVICE,
|
||||
* %CLUTTER_TABLET_DEVICE and %CLUTTER_KEYBOARD_DEVICE can hold a grab.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
void
|
||||
clutter_input_device_grab (ClutterInputDevice *device,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
ClutterActor **grab_actor;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
|
||||
|
||||
switch (device->device_type)
|
||||
{
|
||||
case CLUTTER_POINTER_DEVICE:
|
||||
case CLUTTER_TABLET_DEVICE:
|
||||
grab_actor = &device->pointer_grab_actor;
|
||||
break;
|
||||
|
||||
case CLUTTER_KEYBOARD_DEVICE:
|
||||
grab_actor = &device->keyboard_grab_actor;
|
||||
break;
|
||||
|
||||
default:
|
||||
g_critical ("Only pointer and keyboard devices can grab an actor");
|
||||
return;
|
||||
}
|
||||
|
||||
if (*grab_actor != NULL)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (*grab_actor,
|
||||
G_CALLBACK (on_grab_actor_destroy),
|
||||
device);
|
||||
}
|
||||
|
||||
*grab_actor = actor;
|
||||
|
||||
g_signal_connect (*grab_actor,
|
||||
"destroy",
|
||||
G_CALLBACK (on_grab_actor_destroy),
|
||||
device);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_input_device_ungrab:
|
||||
* @device: a #ClutterInputDevice
|
||||
*
|
||||
* Releases the grab on the @device, if one is in place.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
void
|
||||
clutter_input_device_ungrab (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterActor **grab_actor;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
|
||||
|
||||
switch (device->device_type)
|
||||
{
|
||||
case CLUTTER_POINTER_DEVICE:
|
||||
case CLUTTER_TABLET_DEVICE:
|
||||
grab_actor = &device->pointer_grab_actor;
|
||||
break;
|
||||
|
||||
case CLUTTER_KEYBOARD_DEVICE:
|
||||
grab_actor = &device->keyboard_grab_actor;
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (*grab_actor == NULL)
|
||||
return;
|
||||
|
||||
g_signal_handlers_disconnect_by_func (*grab_actor,
|
||||
G_CALLBACK (on_grab_actor_destroy),
|
||||
device);
|
||||
|
||||
*grab_actor = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_input_device_get_grabbed_actor:
|
||||
* @device: a #ClutterInputDevice
|
||||
*
|
||||
* Retrieves a pointer to the #ClutterActor currently grabbing all
|
||||
* the events coming from @device.
|
||||
*
|
||||
* Return value: (transfer none): a #ClutterActor, or %NULL
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
ClutterActor *
|
||||
clutter_input_device_get_grabbed_actor (ClutterInputDevice *device)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
|
||||
|
||||
switch (device->device_type)
|
||||
{
|
||||
case CLUTTER_POINTER_DEVICE:
|
||||
case CLUTTER_TABLET_DEVICE:
|
||||
return device->pointer_grab_actor;
|
||||
|
||||
case CLUTTER_KEYBOARD_DEVICE:
|
||||
return device->keyboard_grab_actor;
|
||||
|
||||
default:
|
||||
g_critical ("Only pointer and keyboard devices can grab an actor");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
on_grab_sequence_actor_destroy (ClutterActor *actor,
|
||||
ClutterInputDevice *device)
|
||||
@ -2441,3 +2284,15 @@ clutter_input_device_is_grouped (ClutterInputDevice *device,
|
||||
|
||||
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->is_grouped (device, other_device);
|
||||
}
|
||||
|
||||
gboolean
|
||||
clutter_input_device_get_physical_size (ClutterInputDevice *device,
|
||||
gdouble *width,
|
||||
gdouble *height)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
||||
|
||||
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->get_physical_size (device,
|
||||
width,
|
||||
height);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ gint clutter_input_device_get_device_id (ClutterInputDev
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_input_device_get_coords (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
graphene_point_t *point);
|
||||
ClutterPoint *point);
|
||||
CLUTTER_EXPORT
|
||||
ClutterModifierType clutter_input_device_get_modifier_state (ClutterInputDevice *device);
|
||||
CLUTTER_EXPORT
|
||||
@ -171,6 +171,10 @@ void clutter_input_device_set_mapping_mode (ClutterInputDev
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_input_device_is_grouped (ClutterInputDevice *device,
|
||||
ClutterInputDevice *other_device);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_input_device_get_physical_size (ClutterInputDevice *device,
|
||||
gdouble *width,
|
||||
gdouble *height);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -89,8 +89,8 @@ clutter_input_focus_reset (ClutterInputFocus *focus)
|
||||
}
|
||||
|
||||
void
|
||||
clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const graphene_rect_t *rect)
|
||||
clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const ClutterRect *rect)
|
||||
{
|
||||
ClutterInputFocusPrivate *priv;
|
||||
|
||||
@ -175,8 +175,7 @@ clutter_input_focus_set_can_show_preedit (ClutterInputFocus *focus,
|
||||
}
|
||||
|
||||
void
|
||||
clutter_input_focus_set_input_panel_state (ClutterInputFocus *focus,
|
||||
ClutterInputPanelState state)
|
||||
clutter_input_focus_request_toggle_input_panel (ClutterInputFocus *focus)
|
||||
{
|
||||
ClutterInputFocusPrivate *priv;
|
||||
|
||||
@ -185,7 +184,7 @@ clutter_input_focus_set_input_panel_state (ClutterInputFocus *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
|
||||
|
@ -57,8 +57,8 @@ gboolean clutter_input_focus_is_focused (ClutterInputFocus *focus);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_focus_reset (ClutterInputFocus *focus);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const graphene_rect_t *rect);
|
||||
void clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const ClutterRect *rect);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_focus_set_surrounding (ClutterInputFocus *focus,
|
||||
@ -78,7 +78,6 @@ CLUTTER_EXPORT
|
||||
void clutter_input_focus_set_can_show_preedit (ClutterInputFocus *focus,
|
||||
gboolean can_show_preedit);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_focus_set_input_panel_state (ClutterInputFocus *focus,
|
||||
ClutterInputPanelState state);
|
||||
void clutter_input_focus_request_toggle_input_panel (ClutterInputFocus *focus);
|
||||
|
||||
#endif /* __CLUTTER_INPUT_FOCUS_H__ */
|
||||
|
@ -26,8 +26,8 @@ ClutterInputFocus * clutter_input_method_get_focus (ClutterInputMethod *method);
|
||||
|
||||
void clutter_input_method_reset (ClutterInputMethod *method);
|
||||
|
||||
void clutter_input_method_set_cursor_location (ClutterInputMethod *method,
|
||||
const graphene_rect_t *rect);
|
||||
void clutter_input_method_set_cursor_location (ClutterInputMethod *method,
|
||||
const ClutterRect *rect);
|
||||
void clutter_input_method_set_surrounding (ClutterInputMethod *method,
|
||||
const gchar *text,
|
||||
guint cursor,
|
||||
|
@ -37,8 +37,7 @@ struct _ClutterInputMethodPrivate
|
||||
gboolean can_show_preedit;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
COMMIT,
|
||||
DELETE_SURROUNDING,
|
||||
REQUEST_SURROUNDING,
|
||||
@ -47,8 +46,7 @@ enum
|
||||
N_SIGNALS,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_CONTENT_HINTS,
|
||||
PROP_CONTENT_PURPOSE,
|
||||
@ -187,7 +185,7 @@ clutter_input_method_class_init (ClutterInputMethodClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1, GRAPHENE_TYPE_RECT);
|
||||
G_TYPE_NONE, 1, CLUTTER_TYPE_RECT);
|
||||
|
||||
pspecs[PROP_CONTENT_HINTS] =
|
||||
g_param_spec_flags ("content-hints",
|
||||
@ -266,6 +264,9 @@ clutter_input_method_focus_out (ClutterInputMethod *im)
|
||||
|
||||
klass = CLUTTER_INPUT_METHOD_GET_CLASS (im);
|
||||
klass->focus_out (im);
|
||||
|
||||
g_signal_emit (im, signals[INPUT_PANEL_STATE],
|
||||
0, CLUTTER_INPUT_PANEL_STATE_OFF);
|
||||
}
|
||||
|
||||
ClutterInputFocus *
|
||||
@ -360,12 +361,12 @@ clutter_input_method_notify_key_event (ClutterInputMethod *im,
|
||||
}
|
||||
|
||||
void
|
||||
clutter_input_method_set_input_panel_state (ClutterInputMethod *im,
|
||||
ClutterInputPanelState state)
|
||||
clutter_input_method_toggle_input_panel (ClutterInputMethod *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
|
||||
@ -377,8 +378,8 @@ clutter_input_method_reset (ClutterInputMethod *im)
|
||||
}
|
||||
|
||||
void
|
||||
clutter_input_method_set_cursor_location (ClutterInputMethod *im,
|
||||
const graphene_rect_t *rect)
|
||||
clutter_input_method_set_cursor_location (ClutterInputMethod *im,
|
||||
const ClutterRect *rect)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im));
|
||||
|
||||
|
@ -42,8 +42,8 @@ struct _ClutterInputMethodClass
|
||||
|
||||
void (* reset) (ClutterInputMethod *im);
|
||||
|
||||
void (* set_cursor_location) (ClutterInputMethod *im,
|
||||
const graphene_rect_t *rect);
|
||||
void (* set_cursor_location) (ClutterInputMethod *im,
|
||||
const ClutterRect *rect);
|
||||
void (* set_surrounding) (ClutterInputMethod *im,
|
||||
const gchar *text,
|
||||
guint cursor,
|
||||
@ -83,8 +83,7 @@ void clutter_input_method_notify_key_event (ClutterInputMethod *im,
|
||||
const ClutterEvent *event,
|
||||
gboolean filtered);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_method_set_input_panel_state (ClutterInputMethod *im,
|
||||
ClutterInputPanelState state);
|
||||
void clutter_input_method_request_toggle_input_panel (ClutterInputMethod *im);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_method_forward_key (ClutterInputMethod *im,
|
||||
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Red Hat
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Author: Olivier Fourdan <ofourdan@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef __CLUTTER_INPUT_POINTER_A11Y_H__
|
||||
#define __CLUTTER_INPUT_POINTER_A11Y_H__
|
||||
|
||||
#include <clutter/clutter-types.h>
|
||||
#include "clutter-enum-types.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_pointer_a11y_add_device (ClutterInputDevice *device);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_pointer_a11y_remove_device (ClutterInputDevice *device);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_pointer_a11y_on_motion_event (ClutterInputDevice *device,
|
||||
float x,
|
||||
float y);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_pointer_a11y_on_button_event (ClutterInputDevice *device,
|
||||
int button,
|
||||
gboolean pressed);
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_is_input_pointer_a11y_enabled (ClutterInputDevice *device);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_INPUT_POINTER_A11Y_H__ */
|
@ -1,710 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Red Hat
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Author: Olivier Fourdan <ofourdan@redhat.com>
|
||||
*
|
||||
* This reimplements in Clutter the same behavior as mousetweaks original
|
||||
* implementation by Gerd Kohlberger <gerdko gmail com>
|
||||
* mousetweaks Copyright (C) 2007-2010 Gerd Kohlberger <gerdko gmail com>
|
||||
*/
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-device-manager.h"
|
||||
#include "clutter-device-manager-private.h"
|
||||
#include "clutter-enum-types.h"
|
||||
#include "clutter-input-device.h"
|
||||
#include "clutter-input-pointer-a11y-private.h"
|
||||
#include "clutter-main.h"
|
||||
#include "clutter-virtual-input-device.h"
|
||||
|
||||
static gboolean
|
||||
is_secondary_click_enabled (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
return (settings.controls & CLUTTER_A11Y_SECONDARY_CLICK_ENABLED);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_dwell_click_enabled (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
return (settings.controls & CLUTTER_A11Y_DWELL_ENABLED);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
get_secondary_click_delay (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
return settings.secondary_click_delay;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
get_dwell_delay (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
return settings.dwell_delay;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
get_dwell_threshold (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
return settings.dwell_threshold;
|
||||
}
|
||||
|
||||
static ClutterPointerA11yDwellMode
|
||||
get_dwell_mode (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
return settings.dwell_mode;
|
||||
}
|
||||
|
||||
static ClutterPointerA11yDwellClickType
|
||||
get_dwell_click_type (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
return settings.dwell_click_type;
|
||||
}
|
||||
|
||||
static ClutterPointerA11yDwellClickType
|
||||
get_dwell_click_type_for_direction (ClutterInputDevice *device,
|
||||
ClutterPointerA11yDwellDirection direction)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
if (direction == settings.dwell_gesture_single)
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY;
|
||||
else if (direction == settings.dwell_gesture_double)
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE;
|
||||
else if (direction == settings.dwell_gesture_drag)
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG;
|
||||
else if (direction == settings.dwell_gesture_secondary)
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY;
|
||||
|
||||
return CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE;
|
||||
}
|
||||
|
||||
static void
|
||||
emit_button_press (ClutterInputDevice *device,
|
||||
gint button)
|
||||
{
|
||||
clutter_virtual_input_device_notify_button (device->accessibility_virtual_device,
|
||||
g_get_monotonic_time (),
|
||||
button,
|
||||
CLUTTER_BUTTON_STATE_PRESSED);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_button_release (ClutterInputDevice *device,
|
||||
gint button)
|
||||
{
|
||||
clutter_virtual_input_device_notify_button (device->accessibility_virtual_device,
|
||||
g_get_monotonic_time (),
|
||||
button,
|
||||
CLUTTER_BUTTON_STATE_RELEASED);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_button_click (ClutterInputDevice *device,
|
||||
gint button)
|
||||
{
|
||||
emit_button_press (device, button);
|
||||
emit_button_release (device, button);
|
||||
}
|
||||
|
||||
static void
|
||||
restore_dwell_position (ClutterInputDevice *device)
|
||||
{
|
||||
clutter_virtual_input_device_notify_absolute_motion (device->accessibility_virtual_device,
|
||||
g_get_monotonic_time (),
|
||||
device->ptr_a11y_data->dwell_x,
|
||||
device->ptr_a11y_data->dwell_y);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
trigger_secondary_click (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
|
||||
device->ptr_a11y_data->secondary_click_triggered = TRUE;
|
||||
device->ptr_a11y_data->secondary_click_timer = 0;
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
TRUE);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
start_secondary_click_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
unsigned int delay = get_secondary_click_delay (device);
|
||||
|
||||
device->ptr_a11y_data->secondary_click_timer =
|
||||
clutter_threads_add_timeout (delay, trigger_secondary_click, device);
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-started",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
delay);
|
||||
}
|
||||
|
||||
static void
|
||||
stop_secondary_click_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
if (device->ptr_a11y_data->secondary_click_timer)
|
||||
{
|
||||
g_source_remove (device->ptr_a11y_data->secondary_click_timer);
|
||||
device->ptr_a11y_data->secondary_click_timer = 0;
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
FALSE);
|
||||
}
|
||||
device->ptr_a11y_data->secondary_click_triggered = FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pointer_has_moved (ClutterInputDevice *device)
|
||||
{
|
||||
float dx, dy;
|
||||
gint threshold;
|
||||
|
||||
dx = device->ptr_a11y_data->dwell_x - device->ptr_a11y_data->current_x;
|
||||
dy = device->ptr_a11y_data->dwell_y - device->ptr_a11y_data->current_y;
|
||||
threshold = get_dwell_threshold (device);
|
||||
|
||||
/* Pythagorean theorem */
|
||||
return ((dx * dx) + (dy * dy)) > (threshold * threshold);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_secondary_click_pending (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->secondary_click_timer != 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_secondary_click_triggered (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->secondary_click_triggered;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_dwell_click_pending (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->dwell_timer != 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_dwell_dragging (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->dwell_drag_started;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_dwell_gesturing (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->dwell_gesture_started;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
has_button_pressed (ClutterInputDevice *device)
|
||||
{
|
||||
return device->ptr_a11y_data->n_btn_pressed > 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
should_start_secondary_click_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
return !is_dwell_dragging (device);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
should_start_dwell (ClutterInputDevice *device)
|
||||
{
|
||||
/* We should trigger a dwell if we've not already started one, and if
|
||||
* no button is currently pressed or we are in the middle of a dwell
|
||||
* drag action.
|
||||
*/
|
||||
return !is_dwell_click_pending (device) &&
|
||||
(is_dwell_dragging (device) ||
|
||||
!has_button_pressed (device));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
should_stop_dwell (ClutterInputDevice *device)
|
||||
{
|
||||
/* We should stop a dwell if the motion exceeds the threshold, unless
|
||||
* we've started a gesture, because we want to keep the original dwell
|
||||
* location to both detect a gesture and restore the original pointer
|
||||
* location once the gesture is finished.
|
||||
*/
|
||||
return pointer_has_moved (device) &&
|
||||
!is_dwell_gesturing (device);
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
should_update_dwell_position (ClutterInputDevice *device)
|
||||
{
|
||||
return !is_dwell_gesturing (device) &&
|
||||
!is_dwell_click_pending (device) &&
|
||||
!is_secondary_click_pending (device);
|
||||
}
|
||||
|
||||
static void
|
||||
update_dwell_click_type (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterPointerA11ySettings settings;
|
||||
ClutterPointerA11yDwellClickType dwell_click_type;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
|
||||
dwell_click_type = settings.dwell_click_type;
|
||||
switch (dwell_click_type)
|
||||
{
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE:
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY:
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE:
|
||||
dwell_click_type = CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY;
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG:
|
||||
if (!is_dwell_dragging (device))
|
||||
dwell_click_type = CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY;
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY:
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (dwell_click_type != settings.dwell_click_type)
|
||||
{
|
||||
settings.dwell_click_type = dwell_click_type;
|
||||
clutter_device_manager_set_pointer_a11y_settings (device->device_manager,
|
||||
&settings);
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-dwell-click-type-changed",
|
||||
dwell_click_type);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
emit_dwell_click (ClutterInputDevice *device,
|
||||
ClutterPointerA11yDwellClickType dwell_click_type)
|
||||
{
|
||||
switch (dwell_click_type)
|
||||
{
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_PRIMARY:
|
||||
emit_button_click (device, CLUTTER_BUTTON_PRIMARY);
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DOUBLE:
|
||||
emit_button_click (device, CLUTTER_BUTTON_PRIMARY);
|
||||
emit_button_click (device, CLUTTER_BUTTON_PRIMARY);
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG:
|
||||
if (is_dwell_dragging (device))
|
||||
{
|
||||
emit_button_release (device, CLUTTER_BUTTON_PRIMARY);
|
||||
device->ptr_a11y_data->dwell_drag_started = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
emit_button_press (device, CLUTTER_BUTTON_PRIMARY);
|
||||
device->ptr_a11y_data->dwell_drag_started = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_SECONDARY:
|
||||
emit_button_click (device, CLUTTER_BUTTON_SECONDARY);
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_MIDDLE:
|
||||
emit_button_click (device, CLUTTER_BUTTON_MIDDLE);
|
||||
break;
|
||||
|
||||
case CLUTTER_A11Y_DWELL_CLICK_TYPE_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static ClutterPointerA11yDwellDirection
|
||||
get_dwell_direction (ClutterInputDevice *device)
|
||||
{
|
||||
float dx, dy;
|
||||
|
||||
dx = ABS (device->ptr_a11y_data->dwell_x - device->ptr_a11y_data->current_x);
|
||||
dy = ABS (device->ptr_a11y_data->dwell_y - device->ptr_a11y_data->current_y);
|
||||
|
||||
/* The pointer hasn't moved */
|
||||
if (!pointer_has_moved (device))
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_NONE;
|
||||
|
||||
if (device->ptr_a11y_data->dwell_x < device->ptr_a11y_data->current_x)
|
||||
{
|
||||
if (dx > dy)
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_LEFT;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dx > dy)
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_RIGHT;
|
||||
}
|
||||
|
||||
if (device->ptr_a11y_data->dwell_y < device->ptr_a11y_data->current_y)
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_UP;
|
||||
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_DOWN;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
trigger_clear_dwell_gesture (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
|
||||
device->ptr_a11y_data->dwell_timer = 0;
|
||||
device->ptr_a11y_data->dwell_gesture_started = FALSE;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
trigger_dwell_gesture (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
ClutterPointerA11yDwellDirection direction;
|
||||
unsigned int delay = get_dwell_delay (device);
|
||||
|
||||
restore_dwell_position (device);
|
||||
direction = get_dwell_direction (device);
|
||||
emit_dwell_click (device,
|
||||
get_dwell_click_type_for_direction (device,
|
||||
direction));
|
||||
|
||||
/* Do not clear the gesture right away, otherwise we'll start another one */
|
||||
device->ptr_a11y_data->dwell_timer =
|
||||
clutter_threads_add_timeout (delay, trigger_clear_dwell_gesture, device);
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
||||
TRUE);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
start_dwell_gesture_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
unsigned int delay = get_dwell_delay (device);
|
||||
|
||||
device->ptr_a11y_data->dwell_timer =
|
||||
clutter_threads_add_timeout (delay, trigger_dwell_gesture, device);
|
||||
device->ptr_a11y_data->dwell_gesture_started = TRUE;
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-started",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
||||
delay);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
trigger_dwell_click (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
|
||||
device->ptr_a11y_data->dwell_timer = 0;
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
TRUE);
|
||||
|
||||
if (get_dwell_mode (device) == CLUTTER_A11Y_DWELL_MODE_GESTURE)
|
||||
{
|
||||
if (is_dwell_dragging (device))
|
||||
emit_dwell_click (device, CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG);
|
||||
else
|
||||
start_dwell_gesture_timeout (device);
|
||||
}
|
||||
else
|
||||
{
|
||||
emit_dwell_click (device, get_dwell_click_type (device));
|
||||
update_dwell_click_type (device);
|
||||
}
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
start_dwell_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
unsigned int delay = get_dwell_delay (device);
|
||||
|
||||
device->ptr_a11y_data->dwell_timer =
|
||||
clutter_threads_add_timeout (delay, trigger_dwell_click, device);
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-started",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
delay);
|
||||
}
|
||||
|
||||
static void
|
||||
stop_dwell_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
if (device->ptr_a11y_data->dwell_timer)
|
||||
{
|
||||
g_source_remove (device->ptr_a11y_data->dwell_timer);
|
||||
device->ptr_a11y_data->dwell_timer = 0;
|
||||
device->ptr_a11y_data->dwell_gesture_started = FALSE;
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
trigger_dwell_position_timeout (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
|
||||
device->ptr_a11y_data->dwell_position_timer = 0;
|
||||
|
||||
if (is_dwell_click_enabled (device))
|
||||
{
|
||||
if (!pointer_has_moved (device))
|
||||
start_dwell_timeout (device);
|
||||
}
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
start_dwell_position_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
device->ptr_a11y_data->dwell_position_timer =
|
||||
clutter_threads_add_timeout (100, trigger_dwell_position_timeout, device);
|
||||
}
|
||||
|
||||
static void
|
||||
stop_dwell_position_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
g_clear_handle_id (&device->ptr_a11y_data->dwell_position_timer,
|
||||
g_source_remove);
|
||||
}
|
||||
|
||||
static void
|
||||
update_dwell_position (ClutterInputDevice *device)
|
||||
{
|
||||
device->ptr_a11y_data->dwell_x = device->ptr_a11y_data->current_x;
|
||||
device->ptr_a11y_data->dwell_y = device->ptr_a11y_data->current_y;
|
||||
}
|
||||
|
||||
static void
|
||||
update_current_position (ClutterInputDevice *device,
|
||||
float x,
|
||||
float y)
|
||||
{
|
||||
device->ptr_a11y_data->current_x = x;
|
||||
device->ptr_a11y_data->current_y = y;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_device_core_pointer (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterInputDevice *core_pointer;
|
||||
|
||||
core_pointer = clutter_device_manager_get_core_device (device->device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
if (core_pointer == NULL)
|
||||
return FALSE;
|
||||
|
||||
return (core_pointer == device);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_input_pointer_a11y_add_device (ClutterInputDevice *device)
|
||||
{
|
||||
if (!is_device_core_pointer (device))
|
||||
return;
|
||||
|
||||
device->accessibility_virtual_device =
|
||||
clutter_device_manager_create_virtual_device (device->device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
|
||||
device->ptr_a11y_data = g_new0 (ClutterPtrA11yData, 1);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_input_pointer_a11y_remove_device (ClutterInputDevice *device)
|
||||
{
|
||||
if (!is_device_core_pointer (device))
|
||||
return;
|
||||
|
||||
/* Terminate a drag if started */
|
||||
if (is_dwell_dragging (device))
|
||||
emit_dwell_click (device, CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG);
|
||||
|
||||
stop_dwell_position_timeout (device);
|
||||
stop_dwell_timeout (device);
|
||||
stop_secondary_click_timeout (device);
|
||||
|
||||
g_clear_pointer (&device->ptr_a11y_data, g_free);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_input_pointer_a11y_on_motion_event (ClutterInputDevice *device,
|
||||
float x,
|
||||
float y)
|
||||
{
|
||||
if (!is_device_core_pointer (device))
|
||||
return;
|
||||
|
||||
if (!_clutter_is_input_pointer_a11y_enabled (device))
|
||||
return;
|
||||
|
||||
update_current_position (device, x, y);
|
||||
|
||||
if (is_secondary_click_enabled (device))
|
||||
{
|
||||
if (pointer_has_moved (device))
|
||||
stop_secondary_click_timeout (device);
|
||||
}
|
||||
|
||||
if (is_dwell_click_enabled (device))
|
||||
{
|
||||
stop_dwell_position_timeout (device);
|
||||
|
||||
if (should_stop_dwell (device))
|
||||
stop_dwell_timeout (device);
|
||||
|
||||
if (should_start_dwell (device))
|
||||
start_dwell_position_timeout (device);
|
||||
}
|
||||
|
||||
if (should_update_dwell_position (device))
|
||||
update_dwell_position (device);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_input_pointer_a11y_on_button_event (ClutterInputDevice *device,
|
||||
int button,
|
||||
gboolean pressed)
|
||||
{
|
||||
if (!is_device_core_pointer (device))
|
||||
return;
|
||||
|
||||
if (!_clutter_is_input_pointer_a11y_enabled (device))
|
||||
return;
|
||||
|
||||
if (pressed)
|
||||
{
|
||||
device->ptr_a11y_data->n_btn_pressed++;
|
||||
|
||||
stop_dwell_position_timeout (device);
|
||||
|
||||
if (is_dwell_click_enabled (device))
|
||||
stop_dwell_timeout (device);
|
||||
|
||||
if (is_dwell_dragging (device))
|
||||
stop_dwell_timeout (device);
|
||||
|
||||
if (is_secondary_click_enabled (device))
|
||||
{
|
||||
if (button == CLUTTER_BUTTON_PRIMARY)
|
||||
{
|
||||
if (should_start_secondary_click_timeout (device))
|
||||
start_secondary_click_timeout (device);
|
||||
}
|
||||
else if (is_secondary_click_pending (device))
|
||||
{
|
||||
stop_secondary_click_timeout (device);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (has_button_pressed (device))
|
||||
device->ptr_a11y_data->n_btn_pressed--;
|
||||
|
||||
if (is_secondary_click_triggered (device))
|
||||
{
|
||||
emit_button_click (device, CLUTTER_BUTTON_SECONDARY);
|
||||
stop_secondary_click_timeout (device);
|
||||
}
|
||||
|
||||
if (is_secondary_click_pending (device))
|
||||
stop_secondary_click_timeout (device);
|
||||
|
||||
if (is_dwell_dragging (device))
|
||||
emit_dwell_click (device, CLUTTER_A11Y_DWELL_CLICK_TYPE_DRAG);
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_is_input_pointer_a11y_enabled (ClutterInputDevice *device)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
||||
|
||||
return (is_secondary_click_enabled (device) || is_dwell_click_enabled (device));
|
||||
}
|
@ -444,7 +444,8 @@ clutter_layout_manager_class_init (ClutterLayoutManagerClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterLayoutManagerClass,
|
||||
layout_changed),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -53,8 +53,7 @@ G_BEGIN_DECLS
|
||||
*
|
||||
* Since: 0.2
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_INIT_SUCCESS = 1,
|
||||
CLUTTER_INIT_ERROR_UNKNOWN = 0,
|
||||
CLUTTER_INIT_ERROR_THREADS = -1,
|
||||
@ -117,6 +116,9 @@ void clutter_disable_accessibility (void);
|
||||
|
||||
/* Threading functions */
|
||||
CLUTTER_EXPORT
|
||||
void clutter_threads_set_lock_functions (GCallback enter_fn,
|
||||
GCallback leave_fn);
|
||||
CLUTTER_EXPORT
|
||||
guint clutter_threads_add_idle (GSourceFunc func,
|
||||
gpointer data);
|
||||
CLUTTER_EXPORT
|
||||
@ -146,6 +148,19 @@ guint clutter_threads_add_repaint_func_full (ClutterRepaintF
|
||||
CLUTTER_EXPORT
|
||||
void clutter_threads_remove_repaint_func (guint handle_id);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_grab_pointer (ClutterActor *actor);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_ungrab_pointer (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterActor * clutter_get_pointer_grab (void);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_grab_keyboard (ClutterActor *actor);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_ungrab_keyboard (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterActor * clutter_get_keyboard_grab (void);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
PangoFontMap * clutter_get_font_map (void);
|
||||
|
||||
|
@ -12,24 +12,29 @@ BOOLEAN:OBJECT,FLOAT,FLOAT
|
||||
BOXED:UINT,UINT
|
||||
DOUBLE:VOID
|
||||
UINT:VOID
|
||||
VOID:BOOLEAN
|
||||
VOID:BOXED
|
||||
VOID:BOXED,FLAGS
|
||||
VOID:INT
|
||||
VOID:INT64,INT64,FLOAT,BOOLEAN
|
||||
VOID:INT,INT
|
||||
VOID:INT,POINTER
|
||||
VOID:FLOAT,FLOAT
|
||||
VOID:INT,INT,INT,INT
|
||||
VOID:OBJECT
|
||||
VOID:OBJECT,FLAGS
|
||||
VOID:OBJECT,FLAGS,BOOLEAN
|
||||
VOID:OBJECT,FLAGS,UINT
|
||||
VOID:OBJECT,FLOAT,FLOAT
|
||||
VOID:OBJECT,FLOAT,FLOAT,FLAGS
|
||||
VOID:OBJECT,OBJECT
|
||||
VOID:OBJECT,PARAM
|
||||
VOID:OBJECT,POINTER
|
||||
VOID:OBJECT,UINT
|
||||
VOID:POINTER
|
||||
VOID:STRING,BOOLEAN
|
||||
VOID:STRING,BOOLEAN,BOOLEAN
|
||||
VOID:STRING,INT
|
||||
VOID:UINT
|
||||
VOID:UINT,STRING,UINT
|
||||
VOID:UINT,UINT
|
||||
VOID:VOID
|
||||
VOID:STRING,INT,POINTER
|
||||
|
@ -64,6 +64,9 @@ struct _ClutterMasterClockDefault
|
||||
/* the current state of the clock, in usecs */
|
||||
gint64 cur_tick;
|
||||
|
||||
/* the previous state of the clock, in usecs, used to compute the delta */
|
||||
gint64 prev_tick;
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
gint64 frame_budget;
|
||||
gint64 remaining_budget;
|
||||
@ -74,6 +77,12 @@ struct _ClutterMasterClockDefault
|
||||
*/
|
||||
GSource *source;
|
||||
|
||||
/* If the master clock is idle that means it has
|
||||
* fallen back to idle polling for timeline
|
||||
* progressions and it may have been some time since
|
||||
* the last real stage update.
|
||||
*/
|
||||
guint idle : 1;
|
||||
guint ensure_next_iteration : 1;
|
||||
|
||||
guint paused : 1;
|
||||
@ -266,12 +275,78 @@ master_clock_reschedule_stage_updates (ClutterMasterClockDefault *master_clock,
|
||||
static gint
|
||||
master_clock_next_frame_delay (ClutterMasterClockDefault *master_clock)
|
||||
{
|
||||
gint64 now, next;
|
||||
gint swap_delay;
|
||||
|
||||
if (!master_clock_is_running (master_clock))
|
||||
return -1;
|
||||
|
||||
/* If all of the stages are busy waiting for a swap-buffers to complete
|
||||
* then we wait for one to be ready.. */
|
||||
return master_clock_get_swap_wait_time (master_clock);
|
||||
swap_delay = master_clock_get_swap_wait_time (master_clock);
|
||||
if (swap_delay != 0)
|
||||
return swap_delay;
|
||||
|
||||
/* When we have sync-to-vblank, we count on swap-buffer requests (or
|
||||
* swap-buffer-complete events if supported in the backend) to throttle our
|
||||
* frame rate so no additional delay is needed to start the next frame.
|
||||
*
|
||||
* If the master-clock has become idle due to no timeline progression causing
|
||||
* redraws then we can no longer rely on vblank synchronization because the
|
||||
* last real stage update/redraw may have happened a long time ago and so we
|
||||
* fallback to polling for timeline progressions every 1/frame_rate seconds.
|
||||
*
|
||||
* (NB: if there aren't even any timelines running then the master clock will
|
||||
* be completely stopped in master_clock_is_running())
|
||||
*/
|
||||
if (clutter_feature_available (CLUTTER_FEATURE_SWAP_THROTTLE) &&
|
||||
!master_clock->idle)
|
||||
{
|
||||
CLUTTER_NOTE (SCHEDULER, "swap throttling available and updated stages");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (master_clock->prev_tick == 0)
|
||||
{
|
||||
/* If we weren't previously running, then draw the next frame
|
||||
* immediately
|
||||
*/
|
||||
CLUTTER_NOTE (SCHEDULER, "draw the first frame immediately");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Otherwise, wait at least 1/frame_rate seconds since we last
|
||||
* started a frame
|
||||
*/
|
||||
now = g_source_get_time (master_clock->source);
|
||||
|
||||
next = master_clock->prev_tick;
|
||||
|
||||
/* If time has gone backwards then there's no way of knowing how
|
||||
long we should wait so let's just dispatch immediately */
|
||||
if (now <= next)
|
||||
{
|
||||
CLUTTER_NOTE (SCHEDULER, "Time has gone backwards");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
next += (1000000L / clutter_get_default_frame_rate ());
|
||||
|
||||
if (next <= now)
|
||||
{
|
||||
CLUTTER_NOTE (SCHEDULER, "Less than %lu microsecs",
|
||||
1000000L / (gulong) clutter_get_default_frame_rate ());
|
||||
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
CLUTTER_NOTE (SCHEDULER, "Waiting %" G_GINT64_FORMAT " msecs",
|
||||
(next - now) / 1000);
|
||||
|
||||
return (next - now) / 1000;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@ -337,7 +412,8 @@ master_clock_advance_timelines (ClutterMasterClockDefault *master_clock)
|
||||
for (l = timelines; l != NULL; l = l->next)
|
||||
_clutter_timeline_do_tick (l->data, master_clock->cur_tick / 1000);
|
||||
|
||||
g_slist_free_full (timelines, g_object_unref);
|
||||
g_slist_foreach (timelines, (GFunc) g_object_unref, NULL);
|
||||
g_slist_free (timelines);
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
if (_clutter_diagnostic_enabled ())
|
||||
@ -455,6 +531,7 @@ clutter_clock_dispatch (GSource *source,
|
||||
{
|
||||
ClutterClockSource *clock_source = (ClutterClockSource *) source;
|
||||
ClutterMasterClockDefault *master_clock = clock_source->master_clock;
|
||||
gboolean stages_updated = FALSE;
|
||||
GSList *stages;
|
||||
|
||||
CLUTTER_NOTE (SCHEDULER, "Master clock [tick]");
|
||||
@ -474,6 +551,8 @@ clutter_clock_dispatch (GSource *source,
|
||||
*/
|
||||
stages = master_clock_list_ready_stages (master_clock);
|
||||
|
||||
master_clock->idle = FALSE;
|
||||
|
||||
/* Each frame is split into three separate phases: */
|
||||
|
||||
/* 1. process all the events; each stage goes through its events queue
|
||||
@ -486,11 +565,19 @@ clutter_clock_dispatch (GSource *source,
|
||||
master_clock_advance_timelines (master_clock);
|
||||
|
||||
/* 3. relayout and redraw the stages */
|
||||
master_clock_update_stages (master_clock, stages);
|
||||
stages_updated = master_clock_update_stages (master_clock, stages);
|
||||
|
||||
/* The master clock goes idle if no stages were updated and falls back
|
||||
* to polling for timeline progressions... */
|
||||
if (!stages_updated)
|
||||
master_clock->idle = TRUE;
|
||||
|
||||
master_clock_reschedule_stage_updates (master_clock, stages);
|
||||
|
||||
g_slist_free_full (stages, g_object_unref);
|
||||
g_slist_foreach (stages, (GFunc) g_object_unref, NULL);
|
||||
g_slist_free (stages);
|
||||
|
||||
master_clock->prev_tick = master_clock->cur_tick;
|
||||
|
||||
_clutter_threads_release_lock ();
|
||||
|
||||
@ -523,6 +610,7 @@ clutter_master_clock_default_init (ClutterMasterClockDefault *self)
|
||||
source = clutter_clock_source_new (self);
|
||||
self->source = source;
|
||||
|
||||
self->idle = FALSE;
|
||||
self->ensure_next_iteration = FALSE;
|
||||
self->paused = FALSE;
|
||||
|
||||
|
@ -26,15 +26,10 @@
|
||||
#define __CLUTTER_H_INSIDE__
|
||||
|
||||
#include "clutter-backend.h"
|
||||
#include "clutter-device-manager-private.h"
|
||||
#include "clutter-event-private.h"
|
||||
#include "clutter-input-pointer-a11y-private.h"
|
||||
#include "clutter-macros.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-stage-private.h"
|
||||
#include "clutter-stage-view.h"
|
||||
#include "cogl/clutter-stage-cogl.h"
|
||||
#include "clutter/x11/clutter-backend-x11.h"
|
||||
#include "x11/clutter-stage-x11.h"
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_set_custom_backend_func (ClutterBackend *(* func) (void));
|
||||
@ -54,9 +49,6 @@ void clutter_stage_freeze_updates (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
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);
|
||||
|
||||
|
@ -66,8 +66,6 @@
|
||||
|
||||
#include "clutter-offscreen-effect.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "cogl/cogl.h"
|
||||
|
||||
#include "clutter-actor-private.h"
|
||||
@ -86,7 +84,7 @@ struct _ClutterOffscreenEffectPrivate
|
||||
ClutterActor *actor;
|
||||
ClutterActor *stage;
|
||||
|
||||
graphene_point3d_t position;
|
||||
ClutterVertex position;
|
||||
|
||||
int fbo_offset_x;
|
||||
int fbo_offset_y;
|
||||
@ -95,8 +93,8 @@ struct _ClutterOffscreenEffectPrivate
|
||||
through create_texture(). This needs to be tracked separately so
|
||||
that we can detect when a different size is calculated and
|
||||
regenerate the fbo */
|
||||
int target_width;
|
||||
int target_height;
|
||||
int fbo_width;
|
||||
int fbo_height;
|
||||
|
||||
gint old_opacity_override;
|
||||
};
|
||||
@ -119,7 +117,7 @@ clutter_offscreen_effect_set_actor (ClutterActorMeta *meta,
|
||||
/* clear out the previous state */
|
||||
if (priv->offscreen != NULL)
|
||||
{
|
||||
cogl_object_unref (priv->offscreen);
|
||||
cogl_handle_unref (priv->offscreen);
|
||||
priv->offscreen = NULL;
|
||||
}
|
||||
|
||||
@ -137,35 +135,8 @@ clutter_offscreen_effect_real_create_texture (ClutterOffscreenEffect *effect,
|
||||
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
|
||||
update_fbo (ClutterEffect *effect,
|
||||
int target_width,
|
||||
int target_height,
|
||||
float resource_scale)
|
||||
update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height)
|
||||
{
|
||||
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
|
||||
ClutterOffscreenEffectPrivate *priv = self->priv;
|
||||
@ -180,13 +151,10 @@ update_fbo (ClutterEffect *effect,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (priv->target_width == target_width &&
|
||||
priv->target_height == target_height &&
|
||||
if (priv->fbo_width == fbo_width &&
|
||||
priv->fbo_height == fbo_height &&
|
||||
priv->offscreen != NULL)
|
||||
{
|
||||
ensure_pipeline_filter_for_scale (self, resource_scale);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (priv->target == NULL)
|
||||
{
|
||||
@ -194,41 +162,48 @@ update_fbo (ClutterEffect *effect,
|
||||
clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||
|
||||
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)
|
||||
{
|
||||
cogl_object_unref (priv->texture);
|
||||
cogl_handle_unref (priv->texture);
|
||||
priv->texture = NULL;
|
||||
}
|
||||
|
||||
if (priv->offscreen != NULL)
|
||||
{
|
||||
cogl_object_unref (priv->offscreen);
|
||||
cogl_handle_unref (priv->offscreen);
|
||||
priv->offscreen = NULL;
|
||||
}
|
||||
|
||||
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)
|
||||
return FALSE;
|
||||
|
||||
cogl_pipeline_set_layer_texture (priv->target, 0, priv->texture);
|
||||
|
||||
priv->target_width = target_width;
|
||||
priv->target_height = target_height;
|
||||
priv->fbo_width = fbo_width;
|
||||
priv->fbo_height = fbo_height;
|
||||
|
||||
priv->offscreen = cogl_offscreen_new_to_texture (priv->texture);
|
||||
if (priv->offscreen == NULL)
|
||||
{
|
||||
g_warning ("%s: Unable to create an Offscreen buffer", G_STRLOC);
|
||||
|
||||
cogl_object_unref (priv->target);
|
||||
cogl_handle_unref (priv->target);
|
||||
priv->target = NULL;
|
||||
|
||||
priv->target_width = 0;
|
||||
priv->target_height = 0;
|
||||
priv->fbo_width = 0;
|
||||
priv->fbo_height = 0;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -247,14 +222,10 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
||||
const ClutterPaintVolume *volume;
|
||||
CoglColor transparent;
|
||||
gfloat stage_width, stage_height;
|
||||
gfloat target_width = -1, target_height = -1;
|
||||
gfloat resource_scale;
|
||||
gfloat ceiled_resource_scale;
|
||||
graphene_point3d_t local_offset;
|
||||
gfloat fbo_width = -1, fbo_height = -1;
|
||||
ClutterVertex local_offset = { 0.f, 0.f, 0.f };
|
||||
gfloat old_viewport[4];
|
||||
|
||||
local_offset = GRAPHENE_POINT3D_INIT (0.0f, 0.0f, 0.0f);
|
||||
|
||||
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))
|
||||
return FALSE;
|
||||
|
||||
@ -264,18 +235,6 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
||||
stage = _clutter_actor_get_stage_internal (priv->actor);
|
||||
clutter_actor_get_size (stage, &stage_width, &stage_height);
|
||||
|
||||
if (_clutter_actor_get_real_resource_scale (priv->actor, &resource_scale))
|
||||
{
|
||||
ceiled_resource_scale = ceilf (resource_scale);
|
||||
stage_width *= ceiled_resource_scale;
|
||||
stage_height *= ceiled_resource_scale;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We are sure we have a resource scale set to a good value at paint */
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
/* Get the minimal bounding box for what we want to paint, relative to the
|
||||
* parent of priv->actor. Note that we may actually be painting a clone of
|
||||
* priv->actor so we need to be careful to avoid querying the transformation
|
||||
@ -302,14 +261,10 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
||||
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);
|
||||
clutter_actor_box_get_size (&box, &fbo_width, &fbo_height);
|
||||
|
||||
/* 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;
|
||||
|
||||
cogl_get_modelview_matrix (&old_modelview);
|
||||
@ -411,7 +366,6 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect)
|
||||
{
|
||||
ClutterOffscreenEffectPrivate *priv = effect->priv;
|
||||
CoglMatrix modelview;
|
||||
float resource_scale;
|
||||
|
||||
cogl_push_matrix ();
|
||||
|
||||
@ -419,14 +373,6 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect)
|
||||
* missing a correction for the expanded FBO and offset rendering within...
|
||||
*/
|
||||
cogl_get_modelview_matrix (&modelview);
|
||||
|
||||
if (clutter_actor_get_resource_scale (priv->actor, &resource_scale) &&
|
||||
resource_scale != 1.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,
|
||||
@ -489,13 +435,13 @@ clutter_offscreen_effect_finalize (GObject *gobject)
|
||||
ClutterOffscreenEffectPrivate *priv = self->priv;
|
||||
|
||||
if (priv->offscreen)
|
||||
cogl_object_unref (priv->offscreen);
|
||||
cogl_handle_unref (priv->offscreen);
|
||||
|
||||
if (priv->target)
|
||||
cogl_object_unref (priv->target);
|
||||
cogl_handle_unref (priv->target);
|
||||
|
||||
if (priv->texture)
|
||||
cogl_object_unref (priv->texture);
|
||||
cogl_handle_unref (priv->texture);
|
||||
|
||||
G_OBJECT_CLASS (clutter_offscreen_effect_parent_class)->finalize (gobject);
|
||||
}
|
||||
@ -539,7 +485,7 @@ clutter_offscreen_effect_init (ClutterOffscreenEffect *self)
|
||||
* used instead of clutter_offscreen_effect_get_target() when the
|
||||
* effect subclass wants to paint using its own material.
|
||||
*
|
||||
* Return value: (transfer none): a #CoglHandle or %NULL. The
|
||||
* Return value: (transfer none): a #CoglHandle or %COGL_INVALID_HANDLE. The
|
||||
* returned texture is owned by Clutter and it should not be
|
||||
* modified or freed
|
||||
*
|
||||
@ -604,7 +550,7 @@ clutter_offscreen_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
* Calls the create_texture() virtual function of the @effect
|
||||
*
|
||||
* Return value: (transfer full): a handle to a Cogl texture, or
|
||||
* %NULL. The returned handle has its reference
|
||||
* %COGL_INVALID_HANDLE. The returned handle has its reference
|
||||
* count increased.
|
||||
*
|
||||
* Since: 1.4
|
||||
@ -684,7 +630,7 @@ clutter_offscreen_effect_get_target_size (ClutterOffscreenEffect *effect,
|
||||
*/
|
||||
gboolean
|
||||
clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
||||
graphene_rect_t *rect)
|
||||
ClutterRect *rect)
|
||||
{
|
||||
ClutterOffscreenEffectPrivate *priv;
|
||||
|
||||
@ -696,11 +642,11 @@ clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
||||
if (priv->texture == NULL)
|
||||
return FALSE;
|
||||
|
||||
graphene_rect_init (rect,
|
||||
priv->position.x,
|
||||
priv->position.y,
|
||||
cogl_texture_get_width (priv->texture),
|
||||
cogl_texture_get_height (priv->texture));
|
||||
clutter_rect_init (rect,
|
||||
priv->position.x,
|
||||
priv->position.y,
|
||||
cogl_texture_get_width (priv->texture),
|
||||
cogl_texture_get_height (priv->texture));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ gboolean clutter_offscreen_effect_get_target_size (ClutterOffscree
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
||||
graphene_rect_t *rect);
|
||||
ClutterRect *rect);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -74,8 +74,7 @@ struct _ClutterPaintNodeClass
|
||||
|
||||
#define PAINT_OP_INIT { PAINT_OP_INVALID }
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
PAINT_OP_INVALID = 0,
|
||||
PAINT_OP_TEX_RECT,
|
||||
PAINT_OP_MULTITEX_RECT,
|
||||
@ -138,6 +137,8 @@ G_GNUC_INTERNAL
|
||||
ClutterPaintNode * clutter_paint_node_get_last_child (ClutterPaintNode *node);
|
||||
G_GNUC_INTERNAL
|
||||
ClutterPaintNode * clutter_paint_node_get_parent (ClutterPaintNode *node);
|
||||
G_GNUC_INTERNAL
|
||||
CoglFramebuffer * clutter_paint_node_get_framebuffer (ClutterPaintNode *node);
|
||||
|
||||
#define CLUTTER_TYPE_LAYER_NODE (_clutter_layer_node_get_type ())
|
||||
#define CLUTTER_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_LAYER_NODE, ClutterLayerNode))
|
||||
|
@ -1099,12 +1099,12 @@ clutter_paint_node_to_json (ClutterPaintNode *node)
|
||||
|
||||
case PAINT_OP_PATH:
|
||||
json_builder_set_member_name (builder, "path");
|
||||
json_builder_add_int_value (builder, (intptr_t) op->op.path);
|
||||
json_builder_add_int_value (builder, (gint64) op->op.path);
|
||||
break;
|
||||
|
||||
case PAINT_OP_PRIMITIVE:
|
||||
json_builder_set_member_name (builder, "primitive");
|
||||
json_builder_add_int_value (builder, (intptr_t) op->op.primitive);
|
||||
json_builder_add_int_value (builder, (gint64) op->op.primitive);
|
||||
break;
|
||||
|
||||
case PAINT_OP_INVALID:
|
||||
@ -1194,15 +1194,6 @@ clutter_paint_node_get_root (ClutterPaintNode *node)
|
||||
return iter;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_paint_node_get_framebuffer:
|
||||
* @node: a #ClutterPaintNode
|
||||
*
|
||||
* Retrieves the #CoglFramebuffer that @node will draw
|
||||
* into.
|
||||
*
|
||||
* Returns: (transfer none): a #CoglFramebuffer
|
||||
*/
|
||||
CoglFramebuffer *
|
||||
clutter_paint_node_get_framebuffer (ClutterPaintNode *node)
|
||||
{
|
||||
|
@ -56,9 +56,6 @@ CLUTTER_EXPORT
|
||||
void clutter_paint_node_set_name (ClutterPaintNode *node,
|
||||
const char *name);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
CoglFramebuffer * clutter_paint_node_get_framebuffer (ClutterPaintNode *node);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_node_add_child (ClutterPaintNode *node,
|
||||
ClutterPaintNode *child);
|
||||
|
@ -75,7 +75,8 @@ _clutter_paint_node_init_types (void)
|
||||
cogl_pipeline_set_color (default_color_pipeline, &cogl_color);
|
||||
|
||||
default_texture_pipeline = cogl_pipeline_new (ctx);
|
||||
cogl_pipeline_set_layer_null_texture (default_texture_pipeline, 0);
|
||||
cogl_pipeline_set_layer_null_texture (default_texture_pipeline, 0,
|
||||
COGL_TEXTURE_TYPE_2D);
|
||||
cogl_pipeline_set_color (default_texture_pipeline, &cogl_color);
|
||||
cogl_pipeline_set_layer_wrap_mode (default_texture_pipeline, 0,
|
||||
COGL_PIPELINE_WRAP_MODE_AUTOMATIC);
|
||||
|
@ -58,7 +58,7 @@ struct _ClutterPaintVolume
|
||||
* elements 4, 5, 6 and 7 most of the time for 2D actors when
|
||||
* calculating the projected paint box.
|
||||
*/
|
||||
graphene_point3d_t vertices[8];
|
||||
ClutterVertex vertices[8];
|
||||
|
||||
/* As an optimization for internally managed PaintVolumes we allow
|
||||
* initializing ClutterPaintVolume variables allocated on the stack
|
||||
|
@ -63,7 +63,7 @@ _clutter_paint_volume_new (ClutterActor *actor)
|
||||
|
||||
pv->actor = actor;
|
||||
|
||||
memset (pv->vertices, 0, 8 * sizeof (graphene_point3d_t));
|
||||
memset (pv->vertices, 0, 8 * sizeof (ClutterVertex));
|
||||
|
||||
pv->is_static = FALSE;
|
||||
pv->is_empty = TRUE;
|
||||
@ -96,7 +96,7 @@ _clutter_paint_volume_init_static (ClutterPaintVolume *pv,
|
||||
{
|
||||
pv->actor = actor;
|
||||
|
||||
memset (pv->vertices, 0, 8 * sizeof (graphene_point3d_t));
|
||||
memset (pv->vertices, 0, 8 * sizeof (ClutterVertex));
|
||||
|
||||
pv->is_static = TRUE;
|
||||
pv->is_empty = TRUE;
|
||||
@ -170,7 +170,7 @@ clutter_paint_volume_free (ClutterPaintVolume *pv)
|
||||
/**
|
||||
* clutter_paint_volume_set_origin:
|
||||
* @pv: a #ClutterPaintVolume
|
||||
* @origin: a #graphene_point3d_t
|
||||
* @origin: a #ClutterVertex
|
||||
*
|
||||
* Sets the origin of the paint volume.
|
||||
*
|
||||
@ -182,8 +182,8 @@ clutter_paint_volume_free (ClutterPaintVolume *pv)
|
||||
* Since: 1.6
|
||||
*/
|
||||
void
|
||||
clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||
const graphene_point3d_t *origin)
|
||||
clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||
const ClutterVertex *origin)
|
||||
{
|
||||
static const int key_vertices[4] = { 0, 1, 3, 4 };
|
||||
float dx, dy, dz;
|
||||
@ -210,7 +210,7 @@ clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||
/**
|
||||
* clutter_paint_volume_get_origin:
|
||||
* @pv: a #ClutterPaintVolume
|
||||
* @vertex: (out): the return location for a #graphene_point3d_t
|
||||
* @vertex: (out): the return location for a #ClutterVertex
|
||||
*
|
||||
* Retrieves the origin of the #ClutterPaintVolume.
|
||||
*
|
||||
@ -218,7 +218,7 @@ clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||
*/
|
||||
void
|
||||
clutter_paint_volume_get_origin (const ClutterPaintVolume *pv,
|
||||
graphene_point3d_t *vertex)
|
||||
ClutterVertex *vertex)
|
||||
{
|
||||
g_return_if_fail (pv != NULL);
|
||||
g_return_if_fail (vertex != NULL);
|
||||
@ -659,7 +659,7 @@ clutter_paint_volume_union_box (ClutterPaintVolume *pv,
|
||||
const ClutterActorBox *box)
|
||||
{
|
||||
ClutterPaintVolume volume;
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
|
||||
g_return_if_fail (pv != NULL);
|
||||
g_return_if_fail (box != NULL);
|
||||
@ -757,7 +757,7 @@ _clutter_paint_volume_get_bounding_box (ClutterPaintVolume *pv,
|
||||
ClutterActorBox *box)
|
||||
{
|
||||
gfloat x_min, y_min, x_max, y_max;
|
||||
graphene_point3d_t *vertices;
|
||||
ClutterVertex *vertices;
|
||||
int count;
|
||||
gint i;
|
||||
|
||||
@ -878,9 +878,9 @@ _clutter_paint_volume_transform (ClutterPaintVolume *pv,
|
||||
|
||||
cogl_matrix_transform_points (matrix,
|
||||
3,
|
||||
sizeof (graphene_point3d_t),
|
||||
sizeof (ClutterVertex),
|
||||
pv->vertices,
|
||||
sizeof (graphene_point3d_t),
|
||||
sizeof (ClutterVertex),
|
||||
pv->vertices,
|
||||
transform_count);
|
||||
|
||||
@ -896,7 +896,7 @@ _clutter_paint_volume_axis_align (ClutterPaintVolume *pv)
|
||||
{
|
||||
int count;
|
||||
int i;
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
float max_x;
|
||||
float max_y;
|
||||
float max_z;
|
||||
@ -1075,7 +1075,7 @@ _clutter_paint_volume_cull (ClutterPaintVolume *pv,
|
||||
const ClutterPlane *planes)
|
||||
{
|
||||
int vertex_count;
|
||||
graphene_point3d_t *vertices = pv->vertices;
|
||||
ClutterVertex *vertices = pv->vertices;
|
||||
gboolean partial = FALSE;
|
||||
int i;
|
||||
int j;
|
||||
@ -1097,18 +1097,24 @@ _clutter_paint_volume_cull (ClutterPaintVolume *pv,
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
const ClutterPlane *plane = &planes[i];
|
||||
int out = 0;
|
||||
for (j = 0; j < vertex_count; j++)
|
||||
{
|
||||
graphene_vec3_t v;
|
||||
ClutterVertex p;
|
||||
float distance;
|
||||
|
||||
graphene_vec3_init (&v,
|
||||
vertices[j].x - graphene_vec3_get_x (&plane->v0),
|
||||
vertices[j].y - graphene_vec3_get_y (&plane->v0),
|
||||
vertices[j].z - graphene_vec3_get_z (&plane->v0));
|
||||
/* XXX: for perspective projections this can be optimized
|
||||
* out because all the planes should pass through the origin
|
||||
* so (0,0,0) is a valid v0. */
|
||||
p.x = vertices[j].x - planes[i].v0[0];
|
||||
p.y = vertices[j].y - planes[i].v0[1];
|
||||
p.z = vertices[j].z - planes[i].v0[2];
|
||||
|
||||
if (graphene_vec3_dot (&plane->n, &v) < 0)
|
||||
distance = (planes[i].n[0] * p.x +
|
||||
planes[i].n[1] * p.y +
|
||||
planes[i].n[2] * p.z);
|
||||
|
||||
if (distance < 0)
|
||||
out++;
|
||||
}
|
||||
|
||||
|
@ -579,7 +579,8 @@ clutter_pan_action_class_init (ClutterPanActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterPanActionClass, pan_stopped),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
}
|
||||
|
@ -295,7 +295,8 @@ clutter_path_clear (ClutterPath *path)
|
||||
{
|
||||
ClutterPathPrivate *priv = path->priv;
|
||||
|
||||
g_slist_free_full (priv->nodes, (GDestroyNotify) clutter_path_node_full_free);
|
||||
g_slist_foreach (priv->nodes, (GFunc) clutter_path_node_full_free, NULL);
|
||||
g_slist_free (priv->nodes);
|
||||
|
||||
priv->nodes = priv->nodes_tail = NULL;
|
||||
priv->nodes_dirty = TRUE;
|
||||
@ -658,7 +659,8 @@ clutter_path_parse_description (const gchar *p,
|
||||
return TRUE;
|
||||
|
||||
fail:
|
||||
g_slist_free_full (nodes, (GDestroyNotify) clutter_path_node_full_free);
|
||||
g_slist_foreach (nodes, (GFunc) clutter_path_node_full_free, NULL);
|
||||
g_slist_free (nodes);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -64,13 +64,11 @@ typedef struct _ClutterVertex4 ClutterVertex4;
|
||||
#define CLUTTER_UNSET_PRIVATE_FLAGS(a,f) (CLUTTER_PRIVATE_FLAGS (a) &= ~(f))
|
||||
|
||||
#define CLUTTER_ACTOR_IS_TOPLEVEL(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IS_TOPLEVEL) != FALSE)
|
||||
#define CLUTTER_ACTOR_IS_INTERNAL_CHILD(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_INTERNAL_CHILD) != FALSE)
|
||||
#define CLUTTER_ACTOR_IN_DESTRUCTION(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_DESTRUCTION) != FALSE)
|
||||
#define CLUTTER_ACTOR_IN_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_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_WRITABLE (G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)
|
||||
@ -84,6 +82,7 @@ typedef struct _ClutterVertex4 ClutterVertex4;
|
||||
/* keep this for source compatibility with clutter */
|
||||
#define P_(String) (String)
|
||||
#define N_(String) (String)
|
||||
#define _(String) (String)
|
||||
|
||||
/* This is a replacement for the nearbyint function which always rounds to the
|
||||
* nearest integer. nearbyint is apparently a C99 function so it might not
|
||||
@ -92,21 +91,21 @@ typedef struct _ClutterVertex4 ClutterVertex4;
|
||||
* because it will break for negative numbers. */
|
||||
#define CLUTTER_NEARBYINT(x) ((int) ((x) < 0.0f ? (x) - 0.5f : (x) + 0.5f))
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_ACTOR_UNUSED_FLAG = 0,
|
||||
|
||||
CLUTTER_IN_DESTRUCTION = 1 << 0,
|
||||
CLUTTER_IS_TOPLEVEL = 1 << 1,
|
||||
CLUTTER_IN_REPARENT = 1 << 2,
|
||||
CLUTTER_IN_PREF_WIDTH = 1 << 3,
|
||||
CLUTTER_IN_PREF_HEIGHT = 1 << 4,
|
||||
|
||||
/* Used to avoid recursion */
|
||||
CLUTTER_IN_PAINT = 1 << 5,
|
||||
CLUTTER_IN_PAINT = 1 << 3,
|
||||
|
||||
/* Used to avoid recursion */
|
||||
CLUTTER_IN_RELAYOUT = 1 << 6,
|
||||
CLUTTER_IN_RELAYOUT = 1 << 4,
|
||||
|
||||
/* a flag for internal children of Containers (DEPRECATED) */
|
||||
CLUTTER_INTERNAL_CHILD = 1 << 5
|
||||
} ClutterPrivateFlags;
|
||||
|
||||
/*
|
||||
@ -137,6 +136,13 @@ struct _ClutterMainContext
|
||||
/* default FPS; this is only used if we cannot sync to vblank */
|
||||
guint frame_rate;
|
||||
|
||||
/* actors with a grab on all devices */
|
||||
ClutterActor *pointer_grab_actor;
|
||||
ClutterActor *keyboard_grab_actor;
|
||||
|
||||
/* stack of actors with shaders during paint */
|
||||
GSList *shaders;
|
||||
|
||||
/* fb bit masks for col<->id mapping in picking */
|
||||
gint fb_r_mask;
|
||||
gint fb_g_mask;
|
||||
@ -161,6 +167,7 @@ struct _ClutterMainContext
|
||||
|
||||
/* boolean flags */
|
||||
guint is_initialized : 1;
|
||||
guint motion_events_per_actor : 1;
|
||||
guint defer_display_setup : 1;
|
||||
guint options_parsed : 1;
|
||||
guint show_fps : 1;
|
||||
@ -177,9 +184,7 @@ typedef struct
|
||||
gboolean _clutter_threads_dispatch (gpointer data);
|
||||
void _clutter_threads_dispatch_free (gpointer data);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_threads_acquire_lock (void);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_threads_release_lock (void);
|
||||
|
||||
ClutterMainContext * _clutter_context_get_default (void);
|
||||
@ -187,6 +192,10 @@ void _clutter_context_lock (void);
|
||||
void _clutter_context_unlock (void);
|
||||
gboolean _clutter_context_is_initialized (void);
|
||||
ClutterPickMode _clutter_context_get_pick_mode (void);
|
||||
void _clutter_context_push_shader_stack (ClutterActor *actor);
|
||||
ClutterActor * _clutter_context_pop_shader_stack (ClutterActor *actor);
|
||||
ClutterActor * _clutter_context_peek_shader_stack (void);
|
||||
gboolean _clutter_context_get_motion_events_enabled (void);
|
||||
gboolean _clutter_context_get_show_fps (void);
|
||||
|
||||
gboolean _clutter_feature_init (GError **error);
|
||||
@ -195,7 +204,11 @@ gboolean _clutter_feature_init (GError **error);
|
||||
gboolean _clutter_diagnostic_enabled (void);
|
||||
void _clutter_diagnostic_message (const char *fmt, ...) G_GNUC_PRINTF (1, 2);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
/* Picking code */
|
||||
guint _clutter_pixel_to_id (guchar pixel[4]);
|
||||
void _clutter_id_to_color (guint id,
|
||||
ClutterColor *col);
|
||||
|
||||
void _clutter_set_sync_to_vblank (gboolean sync_to_vblank);
|
||||
|
||||
/* use this function as the accumulator if you have a signal with
|
||||
@ -220,23 +233,12 @@ void _clutter_run_repaint_functions (ClutterRepaintFlags flags);
|
||||
|
||||
GType _clutter_layout_manager_get_child_meta_type (ClutterLayoutManager *manager);
|
||||
|
||||
void _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
const CoglMatrix *projection,
|
||||
const float *viewport,
|
||||
const graphene_point3d_t *vertices_in,
|
||||
graphene_point3d_t *vertices_out,
|
||||
int n_vertices);
|
||||
|
||||
void _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
||||
graphene_rect_t *dest);
|
||||
|
||||
void _clutter_util_rectangle_int_extents (const graphene_rect_t *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_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
const CoglMatrix *projection,
|
||||
const float *viewport,
|
||||
const ClutterVertex *vertices_in,
|
||||
ClutterVertex *vertices_out,
|
||||
int n_vertices);
|
||||
|
||||
void _clutter_util_rectangle_union (const cairo_rectangle_int_t *src1,
|
||||
const cairo_rectangle_int_t *src2,
|
||||
@ -278,22 +280,16 @@ void _clutter_util_matrix_skew_yz (ClutterMatrix *matrix,
|
||||
float factor);
|
||||
|
||||
gboolean _clutter_util_matrix_decompose (const ClutterMatrix *src,
|
||||
graphene_point3d_t *scale_p,
|
||||
ClutterVertex *scale_p,
|
||||
float shear_p[3],
|
||||
graphene_point3d_t *rotate_p,
|
||||
graphene_point3d_t *translate_p,
|
||||
ClutterVertex *rotate_p,
|
||||
ClutterVertex *translate_p,
|
||||
ClutterVertex4 *perspective_p);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
PangoDirection _clutter_pango_unichar_direction (gunichar ch);
|
||||
|
||||
PangoDirection _clutter_pango_find_base_dir (const gchar *text,
|
||||
gint length);
|
||||
|
||||
typedef struct _ClutterPlane
|
||||
{
|
||||
graphene_vec3_t v0;
|
||||
graphene_vec3_t n;
|
||||
float v0[3];
|
||||
float n[3];
|
||||
} ClutterPlane;
|
||||
|
||||
typedef enum _ClutterCullResult
|
||||
@ -311,8 +307,6 @@ gboolean _clutter_run_progress_function (GType gtype,
|
||||
gdouble progress,
|
||||
GValue *retval);
|
||||
|
||||
void clutter_timeline_cancel_delay (ClutterTimeline *timeline);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_PRIVATE_H__ */
|
||||
|
@ -352,64 +352,63 @@ _clutter_script_parse_knot (ClutterScript *script,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_rect_from_array (JsonArray *array,
|
||||
graphene_rect_t *rect)
|
||||
parse_geometry_from_array (JsonArray *array,
|
||||
ClutterGeometry *geometry)
|
||||
{
|
||||
if (json_array_get_length (array) != 4)
|
||||
return FALSE;
|
||||
|
||||
graphene_rect_init (rect,
|
||||
json_array_get_int_element (array, 0),
|
||||
json_array_get_int_element (array, 1),
|
||||
json_array_get_int_element (array, 2),
|
||||
json_array_get_int_element (array, 3));
|
||||
geometry->x = json_array_get_int_element (array, 0);
|
||||
geometry->y = json_array_get_int_element (array, 1);
|
||||
geometry->width = json_array_get_int_element (array, 2);
|
||||
geometry->height = json_array_get_int_element (array, 3);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_rect_from_object (JsonObject *object,
|
||||
graphene_rect_t *rect)
|
||||
parse_geometry_from_object (JsonObject *object,
|
||||
ClutterGeometry *geometry)
|
||||
{
|
||||
if (json_object_has_member (object, "x"))
|
||||
rect->origin.x = json_object_get_int_member (object, "x");
|
||||
geometry->x = json_object_get_int_member (object, "x");
|
||||
else
|
||||
rect->origin.x = 0;
|
||||
geometry->x = 0;
|
||||
|
||||
if (json_object_has_member (object, "y"))
|
||||
rect->origin.y = json_object_get_int_member (object, "y");
|
||||
geometry->y = json_object_get_int_member (object, "y");
|
||||
else
|
||||
rect->origin.y = 0;
|
||||
geometry->y = 0;
|
||||
|
||||
if (json_object_has_member (object, "width"))
|
||||
rect->size.width = json_object_get_int_member (object, "width");
|
||||
geometry->width = json_object_get_int_member (object, "width");
|
||||
else
|
||||
rect->size.width = 0;
|
||||
geometry->width = 0;
|
||||
|
||||
if (json_object_has_member (object, "height"))
|
||||
rect->size.height = json_object_get_int_member (object, "height");
|
||||
geometry->height = json_object_get_int_member (object, "height");
|
||||
else
|
||||
rect->size.height = 0;
|
||||
geometry->height = 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_script_parse_rect (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_rect_t *rect)
|
||||
_clutter_script_parse_geometry (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterGeometry *geometry)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
||||
g_return_val_if_fail (node != NULL, FALSE);
|
||||
g_return_val_if_fail (rect != NULL, FALSE);
|
||||
g_return_val_if_fail (geometry != NULL, FALSE);
|
||||
|
||||
switch (JSON_NODE_TYPE (node))
|
||||
{
|
||||
case JSON_NODE_ARRAY:
|
||||
return parse_rect_from_array (json_node_get_array (node), rect);
|
||||
return parse_geometry_from_array (json_node_get_array (node), geometry);
|
||||
|
||||
case JSON_NODE_OBJECT:
|
||||
return parse_rect_from_object (json_node_get_object (node), rect);
|
||||
return parse_geometry_from_object (json_node_get_object (node), geometry);
|
||||
|
||||
default:
|
||||
break;
|
||||
@ -493,8 +492,8 @@ _clutter_script_parse_color (ClutterScript *script,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_point_from_array (JsonArray *array,
|
||||
graphene_point_t *point)
|
||||
parse_point_from_array (JsonArray *array,
|
||||
ClutterPoint *point)
|
||||
{
|
||||
if (json_array_get_length (array) != 2)
|
||||
return FALSE;
|
||||
@ -506,8 +505,8 @@ parse_point_from_array (JsonArray *array,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_point_from_object (JsonObject *object,
|
||||
graphene_point_t *point)
|
||||
parse_point_from_object (JsonObject *object,
|
||||
ClutterPoint *point)
|
||||
{
|
||||
if (json_object_has_member (object, "x"))
|
||||
point->x = json_object_get_double_member (object, "x");
|
||||
@ -523,9 +522,9 @@ parse_point_from_object (JsonObject *object,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_script_parse_point (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_point_t *point)
|
||||
_clutter_script_parse_point (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterPoint *point)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
||||
g_return_val_if_fail (node != NULL, FALSE);
|
||||
@ -547,8 +546,8 @@ _clutter_script_parse_point (ClutterScript *script,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_size_from_array (JsonArray *array,
|
||||
graphene_size_t *size)
|
||||
parse_size_from_array (JsonArray *array,
|
||||
ClutterSize *size)
|
||||
{
|
||||
if (json_array_get_length (array) != 2)
|
||||
return FALSE;
|
||||
@ -560,8 +559,8 @@ parse_size_from_array (JsonArray *array,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_size_from_object (JsonObject *object,
|
||||
graphene_size_t *size)
|
||||
parse_size_from_object (JsonObject *object,
|
||||
ClutterSize *size)
|
||||
{
|
||||
if (json_object_has_member (object, "width"))
|
||||
size->width = json_object_get_double_member (object, "width");
|
||||
@ -577,9 +576,9 @@ parse_size_from_object (JsonObject *object,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_script_parse_size (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_size_t *size)
|
||||
_clutter_script_parse_size (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterSize *size)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
||||
g_return_val_if_fail (node != NULL, FALSE);
|
||||
@ -1329,11 +1328,11 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (p_type == GRAPHENE_TYPE_RECT)
|
||||
else if (p_type == CLUTTER_TYPE_GEOMETRY)
|
||||
{
|
||||
graphene_rect_t rect = GRAPHENE_RECT_INIT_ZERO;
|
||||
ClutterGeometry geom = { 0, };
|
||||
|
||||
/* rect := {
|
||||
/* geometry := {
|
||||
* "x" : (int),
|
||||
* "y" : (int),
|
||||
* "width" : (int),
|
||||
@ -1341,9 +1340,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
* }
|
||||
*/
|
||||
|
||||
if (_clutter_script_parse_rect (script, node, &rect))
|
||||
if (_clutter_script_parse_geometry (script, node, &geom))
|
||||
{
|
||||
g_value_set_boxed (value, &rect);
|
||||
g_value_set_boxed (value, &geom);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@ -1365,9 +1364,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (p_type == GRAPHENE_TYPE_POINT)
|
||||
else if (p_type == CLUTTER_TYPE_POINT)
|
||||
{
|
||||
graphene_point_t point = GRAPHENE_POINT_INIT_ZERO;
|
||||
ClutterPoint point = CLUTTER_POINT_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_point (script, node, &point))
|
||||
{
|
||||
@ -1375,9 +1374,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (p_type == GRAPHENE_TYPE_SIZE)
|
||||
else if (p_type == CLUTTER_TYPE_SIZE)
|
||||
{
|
||||
graphene_size_t size = GRAPHENE_SIZE_INIT_ZERO;
|
||||
ClutterSize size = CLUTTER_SIZE_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_size (script, node, &size))
|
||||
{
|
||||
@ -1418,15 +1417,15 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_RECT))
|
||||
else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_GEOMETRY))
|
||||
{
|
||||
graphene_rect_t rect = GRAPHENE_RECT_INIT_ZERO;
|
||||
ClutterGeometry geom = { 0, };
|
||||
|
||||
/* rect := [ (int), (int), (int), (int) ] */
|
||||
/* geometry := [ (int), (int), (int), (int) ] */
|
||||
|
||||
if (_clutter_script_parse_rect (script, node, &rect))
|
||||
if (_clutter_script_parse_geometry (script, node, &geom))
|
||||
{
|
||||
g_value_set_boxed (value, &rect);
|
||||
g_value_set_boxed (value, &geom);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@ -1442,9 +1441,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_POINT))
|
||||
else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_POINT))
|
||||
{
|
||||
graphene_point_t point = GRAPHENE_POINT_INIT_ZERO;
|
||||
ClutterPoint point = CLUTTER_POINT_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_point (script, node, &point))
|
||||
{
|
||||
@ -1452,9 +1451,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_SIZE))
|
||||
else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_SIZE))
|
||||
{
|
||||
graphene_size_t size = GRAPHENE_SIZE_INIT_ZERO;
|
||||
ClutterSize size = CLUTTER_SIZE_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_size (script, node, &size))
|
||||
{
|
||||
@ -1637,17 +1636,14 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
GObject *object,
|
||||
const gchar *name,
|
||||
GList *properties,
|
||||
GPtrArray **param_names,
|
||||
GArray **param_values)
|
||||
GArray **params)
|
||||
{
|
||||
ClutterScriptable *scriptable = NULL;
|
||||
ClutterScriptableIface *iface = NULL;
|
||||
GList *l, *unparsed;
|
||||
gboolean parse_custom = FALSE;
|
||||
|
||||
*param_names = g_ptr_array_new_with_free_func (g_free);
|
||||
*param_values = g_array_new (FALSE, FALSE, sizeof (GValue));
|
||||
g_array_set_clear_func (*param_values, (GDestroyNotify) g_value_unset);
|
||||
*params = g_array_new (FALSE, FALSE, sizeof (GParameter));
|
||||
|
||||
if (CLUTTER_IS_SCRIPTABLE (object))
|
||||
{
|
||||
@ -1663,7 +1659,7 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
for (l = properties; l != NULL; l = l->next)
|
||||
{
|
||||
PropertyInfo *pinfo = l->data;
|
||||
GValue value = G_VALUE_INIT;
|
||||
GParameter param = { NULL };
|
||||
gboolean res = FALSE;
|
||||
|
||||
if (pinfo->is_child || pinfo->is_layout)
|
||||
@ -1680,12 +1676,12 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
pinfo->name);
|
||||
|
||||
if (parse_custom)
|
||||
res = iface->parse_custom_node (scriptable, script, &value,
|
||||
res = iface->parse_custom_node (scriptable, script, ¶m.value,
|
||||
pinfo->name,
|
||||
pinfo->node);
|
||||
|
||||
if (!res)
|
||||
res = _clutter_script_parse_node (script, &value,
|
||||
res = _clutter_script_parse_node (script, ¶m.value,
|
||||
pinfo->name,
|
||||
pinfo->node,
|
||||
pinfo->pspec);
|
||||
@ -1697,8 +1693,9 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
continue;
|
||||
}
|
||||
|
||||
g_ptr_array_add (*param_names, g_strdup (pinfo->name));
|
||||
g_array_append_val (*param_values, value);
|
||||
param.name = g_strdup (pinfo->name);
|
||||
|
||||
g_array_append_val (*params, param);
|
||||
|
||||
property_info_free (pinfo);
|
||||
}
|
||||
@ -1713,8 +1710,7 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
GType gtype,
|
||||
const gchar *name,
|
||||
GList *properties,
|
||||
GPtrArray **construct_param_names,
|
||||
GArray **construct_param_values)
|
||||
GArray **construct_params)
|
||||
{
|
||||
GObjectClass *klass;
|
||||
GList *l, *unparsed;
|
||||
@ -1722,17 +1718,14 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
klass = g_type_class_ref (gtype);
|
||||
g_assert (klass != NULL);
|
||||
|
||||
*construct_param_names = g_ptr_array_new_with_free_func (g_free);
|
||||
*construct_param_values = g_array_new (FALSE, FALSE, sizeof (GValue));
|
||||
g_array_set_clear_func (*construct_param_values,
|
||||
(GDestroyNotify) g_value_unset);
|
||||
*construct_params = g_array_new (FALSE, FALSE, sizeof (GParameter));
|
||||
|
||||
unparsed = NULL;
|
||||
|
||||
for (l = properties; l != NULL; l = l->next)
|
||||
{
|
||||
PropertyInfo *pinfo = l->data;
|
||||
GValue value = G_VALUE_INIT;
|
||||
GParameter param = { NULL };
|
||||
GParamSpec *pspec = NULL;
|
||||
|
||||
/* we allow custom property names for classes, so if we
|
||||
@ -1756,7 +1749,9 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!_clutter_script_parse_node (script, &value,
|
||||
param.name = g_strdup (pinfo->name);
|
||||
|
||||
if (!_clutter_script_parse_node (script, ¶m.value,
|
||||
pinfo->name,
|
||||
pinfo->node,
|
||||
pinfo->pspec))
|
||||
@ -1765,8 +1760,7 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
continue;
|
||||
}
|
||||
|
||||
g_ptr_array_add (*construct_param_names, g_strdup (pinfo->name));
|
||||
g_array_append_val (*construct_param_values, value);
|
||||
g_array_append_val (*construct_params, param);
|
||||
|
||||
property_info_free (pinfo);
|
||||
}
|
||||
@ -2027,7 +2021,8 @@ add_children (ClutterScript *script,
|
||||
clutter_container_add_actor (container, CLUTTER_ACTOR (object));
|
||||
}
|
||||
|
||||
g_list_free_full (oinfo->children, g_free);
|
||||
g_list_foreach (oinfo->children, (GFunc) g_free, NULL);
|
||||
g_list_free (oinfo->children);
|
||||
|
||||
oinfo->children = unresolved;
|
||||
}
|
||||
@ -2093,8 +2088,7 @@ _clutter_script_apply_properties (ClutterScript *script,
|
||||
gboolean set_custom_property = FALSE;
|
||||
GObject *object = oinfo->object;
|
||||
GList *properties;
|
||||
g_autoptr (GPtrArray) param_names = NULL;
|
||||
g_autoptr (GArray) param_values = NULL;
|
||||
GArray *params;
|
||||
guint i;
|
||||
|
||||
if (!oinfo->has_unresolved)
|
||||
@ -2118,31 +2112,34 @@ _clutter_script_apply_properties (ClutterScript *script,
|
||||
object,
|
||||
oinfo->id,
|
||||
properties,
|
||||
¶m_names,
|
||||
¶m_values);
|
||||
¶ms);
|
||||
|
||||
/* consume all the properties we could translate in this pass */
|
||||
for (i = 0; i < param_names->len; i++)
|
||||
for (i = 0; i < params->len; i++)
|
||||
{
|
||||
char *name = g_ptr_array_index (param_names, i);
|
||||
GValue *value = &g_array_index (param_values, GValue, i);
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
|
||||
CLUTTER_NOTE (SCRIPT,
|
||||
"Setting %s property '%s' (type:%s) to object '%s' (id:%s)",
|
||||
set_custom_property ? "custom" : "regular",
|
||||
name,
|
||||
g_type_name (G_VALUE_TYPE (value)),
|
||||
param->name,
|
||||
g_type_name (G_VALUE_TYPE (¶m->value)),
|
||||
g_type_name (oinfo->gtype),
|
||||
oinfo->id);
|
||||
|
||||
if (set_custom_property)
|
||||
iface->set_custom_property (scriptable, script,
|
||||
name,
|
||||
value);
|
||||
param->name,
|
||||
¶m->value);
|
||||
else
|
||||
g_object_set_property (object, name, value);
|
||||
g_object_set_property (object, param->name, ¶m->value);
|
||||
|
||||
g_free ((gchar *) param->name);
|
||||
g_value_unset (¶m->value);
|
||||
}
|
||||
|
||||
g_array_free (params, TRUE);
|
||||
|
||||
_clutter_script_check_unresolved (script, oinfo);
|
||||
}
|
||||
|
||||
@ -2150,8 +2147,8 @@ void
|
||||
_clutter_script_construct_object (ClutterScript *script,
|
||||
ObjectInfo *oinfo)
|
||||
{
|
||||
g_autoptr (GPtrArray) param_names = NULL;
|
||||
g_autoptr (GArray) param_values = NULL;
|
||||
GArray *params = NULL;
|
||||
guint i;
|
||||
|
||||
/* we have completely updated the object */
|
||||
if (oinfo->object != NULL)
|
||||
@ -2194,14 +2191,25 @@ _clutter_script_construct_object (ClutterScript *script,
|
||||
oinfo->gtype,
|
||||
oinfo->id,
|
||||
properties,
|
||||
¶m_names,
|
||||
¶m_values);
|
||||
¶ms);
|
||||
|
||||
default_stage = clutter_stage_manager_get_default_stage (manager);
|
||||
oinfo->object = G_OBJECT (default_stage);
|
||||
|
||||
for (i = 0; i < params->len; i++)
|
||||
{
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
|
||||
g_free ((gchar *) param->name);
|
||||
g_value_unset (¶m->value);
|
||||
}
|
||||
|
||||
g_array_free (params, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_autoptr (GPtrArray) param_names = NULL;
|
||||
GArray *param_values;
|
||||
GList *properties = oinfo->properties;
|
||||
|
||||
/* every other object: first, we get the construction parameters */
|
||||
@ -2210,11 +2218,22 @@ _clutter_script_construct_object (ClutterScript *script,
|
||||
oinfo->gtype,
|
||||
oinfo->id,
|
||||
properties,
|
||||
¶m_names,
|
||||
¶m_values);
|
||||
¶ms);
|
||||
|
||||
/* Convert GParameter → (GStrv, GValue[]) */
|
||||
param_names = g_ptr_array_sized_new (params->len);
|
||||
param_values = g_array_sized_new (TRUE, FALSE, sizeof (GValue), params->len);
|
||||
for (i = 0; i < params->len; i++)
|
||||
{
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
|
||||
g_ptr_array_add (param_names, (gchar *) param->name);
|
||||
g_array_append_val (param_values, param->value);
|
||||
}
|
||||
g_ptr_array_add (param_names, NULL);
|
||||
|
||||
oinfo->object = g_object_new_with_properties (oinfo->gtype,
|
||||
param_names->len,
|
||||
params->len,
|
||||
(const gchar **) param_names->pdata,
|
||||
(const GValue *) param_values->data);
|
||||
|
||||
@ -2223,6 +2242,17 @@ _clutter_script_construct_object (ClutterScript *script,
|
||||
* else too or only by this ClutterScript object.
|
||||
*/
|
||||
g_object_ref_sink (oinfo->object);
|
||||
|
||||
for (i = 0; i < params->len; i++)
|
||||
{
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
|
||||
g_free ((gchar *) param->name);
|
||||
g_value_unset (¶m->value);
|
||||
}
|
||||
|
||||
g_array_free (param_values, FALSE);
|
||||
g_array_free (params, TRUE);
|
||||
}
|
||||
|
||||
g_assert (oinfo->object != NULL);
|
||||
|
@ -122,20 +122,20 @@ gboolean _clutter_script_flags_from_string (GType gtype,
|
||||
gboolean _clutter_script_parse_knot (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterKnot *knot);
|
||||
gboolean _clutter_script_parse_rect (ClutterScript *script,
|
||||
gboolean _clutter_script_parse_geometry (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_rect_t *rect);
|
||||
ClutterGeometry *geometry);
|
||||
gboolean _clutter_script_parse_color (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterColor *color);
|
||||
GObject *_clutter_script_parse_alpha (ClutterScript *script,
|
||||
JsonNode *node);
|
||||
gboolean _clutter_script_parse_point (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_point_t *point);
|
||||
gboolean _clutter_script_parse_point (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterPoint *point);
|
||||
gboolean _clutter_script_parse_size (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_size_t *size);
|
||||
ClutterSize *size);
|
||||
|
||||
gboolean _clutter_script_parse_translatable_string (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
|
@ -263,6 +263,8 @@ enum
|
||||
|
||||
static GParamSpec *obj_props[PROP_LAST];
|
||||
|
||||
#define CLUTTER_SCRIPT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_SCRIPT, ClutterScriptPrivate))
|
||||
|
||||
struct _ClutterScriptPrivate
|
||||
{
|
||||
GHashTable *objects;
|
||||
@ -344,12 +346,15 @@ object_info_free (gpointer data)
|
||||
g_free (oinfo->class_name);
|
||||
g_free (oinfo->type_func);
|
||||
|
||||
g_list_free_full (oinfo->properties, property_info_free);
|
||||
g_list_foreach (oinfo->properties, (GFunc) property_info_free, NULL);
|
||||
g_list_free (oinfo->properties);
|
||||
|
||||
g_list_free_full (oinfo->signals, signal_info_free);
|
||||
g_list_foreach (oinfo->signals, (GFunc) signal_info_free, NULL);
|
||||
g_list_free (oinfo->signals);
|
||||
|
||||
/* these are ids */
|
||||
g_list_free_full (oinfo->children, g_free);
|
||||
g_list_foreach (oinfo->children, (GFunc) g_free, NULL);
|
||||
g_list_free (oinfo->children);
|
||||
|
||||
/* we unref top-level objects and leave the actors alone,
|
||||
* unless we are unmerging in which case we have to destroy
|
||||
@ -375,7 +380,7 @@ object_info_free (gpointer data)
|
||||
static void
|
||||
clutter_script_finalize (GObject *gobject)
|
||||
{
|
||||
ClutterScriptPrivate *priv = CLUTTER_SCRIPT (gobject)->priv;
|
||||
ClutterScriptPrivate *priv = CLUTTER_SCRIPT_GET_PRIVATE (gobject);
|
||||
|
||||
g_object_unref (priv->parser);
|
||||
g_hash_table_destroy (priv->objects);
|
||||
@ -841,7 +846,8 @@ clutter_script_unmerge_objects (ClutterScript *script,
|
||||
for (l = data.ids; l != NULL; l = l->next)
|
||||
g_hash_table_remove (priv->objects, l->data);
|
||||
|
||||
g_slist_free_full (data.ids, g_free);
|
||||
g_slist_foreach (data.ids, (GFunc) g_free, NULL);
|
||||
g_slist_free (data.ids);
|
||||
|
||||
clutter_script_ensure_objects (script);
|
||||
}
|
||||
|
@ -79,8 +79,7 @@ typedef void (* ClutterScriptConnectFunc) (ClutterScript *script,
|
||||
*
|
||||
* Since: 0.6
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CLUTTER_SCRIPT_ERROR_INVALID_TYPE_FUNCTION,
|
||||
CLUTTER_SCRIPT_ERROR_INVALID_PROPERTY,
|
||||
CLUTTER_SCRIPT_ERROR_INVALID_VALUE
|
||||
|
@ -56,7 +56,7 @@
|
||||
|
||||
struct _ClutterScrollActorPrivate
|
||||
{
|
||||
graphene_point_t scroll_to;
|
||||
ClutterPoint scroll_to;
|
||||
|
||||
ClutterScrollMode scroll_mode;
|
||||
|
||||
@ -94,19 +94,19 @@ G_DEFINE_TYPE_WITH_CODE (ClutterScrollActor, clutter_scroll_actor, CLUTTER_TYPE_
|
||||
clutter_animatable_iface_init))
|
||||
|
||||
static void
|
||||
clutter_scroll_actor_set_scroll_to_internal (ClutterScrollActor *self,
|
||||
const graphene_point_t *point)
|
||||
clutter_scroll_actor_set_scroll_to_internal (ClutterScrollActor *self,
|
||||
const ClutterPoint *point)
|
||||
{
|
||||
ClutterScrollActorPrivate *priv = self->priv;
|
||||
ClutterActor *actor = CLUTTER_ACTOR (self);
|
||||
ClutterMatrix m = CLUTTER_MATRIX_INIT_IDENTITY;
|
||||
float dx, dy;
|
||||
|
||||
if (graphene_point_equal (&priv->scroll_to, point))
|
||||
if (clutter_point_equals (&priv->scroll_to, point))
|
||||
return;
|
||||
|
||||
if (point == NULL)
|
||||
graphene_point_init (&priv->scroll_to, 0.f, 0.f);
|
||||
clutter_point_init (&priv->scroll_to, 0.f, 0.f);
|
||||
else
|
||||
priv->scroll_to = *point;
|
||||
|
||||
@ -216,7 +216,7 @@ clutter_scroll_actor_set_final_state (ClutterAnimatable *animatable,
|
||||
if (strcmp (property_name, "scroll-to") == 0)
|
||||
{
|
||||
ClutterScrollActor *self = CLUTTER_SCROLL_ACTOR (animatable);
|
||||
const graphene_point_t *point = g_value_get_boxed (value);
|
||||
const ClutterPoint *point = g_value_get_boxed (value);
|
||||
|
||||
clutter_scroll_actor_set_scroll_to_internal (self, point);
|
||||
}
|
||||
@ -248,7 +248,7 @@ clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
|
||||
g_param_spec_boxed ("scroll-to",
|
||||
"Scroll To",
|
||||
"The point to scroll the actor to",
|
||||
GRAPHENE_TYPE_POINT,
|
||||
CLUTTER_TYPE_POINT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
CLUTTER_PARAM_ANIMATABLE);
|
||||
@ -322,7 +322,7 @@ clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor)
|
||||
/**
|
||||
* clutter_scroll_actor_scroll_to_point:
|
||||
* @actor: a #ClutterScrollActor
|
||||
* @point: a #graphene_point_t
|
||||
* @point: a #ClutterPoint
|
||||
*
|
||||
* Scrolls the contents of @actor so that @point is the new origin
|
||||
* of the visible area.
|
||||
@ -335,8 +335,8 @@ clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor)
|
||||
* Since: 1.12
|
||||
*/
|
||||
void
|
||||
clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
const graphene_point_t *point)
|
||||
clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
const ClutterPoint *point)
|
||||
{
|
||||
ClutterScrollActorPrivate *priv;
|
||||
const ClutterAnimationInfo *info;
|
||||
@ -390,10 +390,10 @@ clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
|
||||
/* if a transition already exist, update its bounds */
|
||||
clutter_transition_set_from (priv->transition,
|
||||
GRAPHENE_TYPE_POINT,
|
||||
CLUTTER_TYPE_POINT,
|
||||
&priv->scroll_to);
|
||||
clutter_transition_set_to (priv->transition,
|
||||
GRAPHENE_TYPE_POINT,
|
||||
CLUTTER_TYPE_POINT,
|
||||
point);
|
||||
|
||||
/* always use the current easing state */
|
||||
@ -417,10 +417,10 @@ clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
* Since: 1.12
|
||||
*/
|
||||
void
|
||||
clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
const graphene_rect_t *rect)
|
||||
clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
const ClutterRect *rect)
|
||||
{
|
||||
graphene_rect_t n_rect;
|
||||
ClutterRect n_rect;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_SCROLL_ACTOR (actor));
|
||||
g_return_if_fail (rect != NULL);
|
||||
@ -428,7 +428,7 @@ clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
n_rect = *rect;
|
||||
|
||||
/* normalize, so that we have a valid origin */
|
||||
graphene_rect_normalize (&n_rect);
|
||||
clutter_rect_normalize (&n_rect);
|
||||
|
||||
clutter_scroll_actor_scroll_to_point (actor, &n_rect.origin);
|
||||
}
|
||||
|
@ -86,11 +86,11 @@ CLUTTER_EXPORT
|
||||
ClutterScrollMode clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
const graphene_point_t *point);
|
||||
void clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
const ClutterPoint *point);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
const graphene_rect_t *rect);
|
||||
void clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
const ClutterRect *rect);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -177,18 +177,18 @@ clutter_shader_effect_clear (ClutterShaderEffect *self,
|
||||
{
|
||||
ClutterShaderEffectPrivate *priv = self->priv;
|
||||
|
||||
if (priv->shader != NULL)
|
||||
if (priv->shader != COGL_INVALID_HANDLE)
|
||||
{
|
||||
cogl_object_unref (priv->shader);
|
||||
cogl_handle_unref (priv->shader);
|
||||
|
||||
priv->shader = NULL;
|
||||
priv->shader = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
if (priv->program != NULL)
|
||||
if (priv->program != COGL_INVALID_HANDLE)
|
||||
{
|
||||
cogl_object_unref (priv->program);
|
||||
cogl_handle_unref (priv->program);
|
||||
|
||||
priv->program = NULL;
|
||||
priv->program = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
if (reset_uniforms && priv->uniforms != NULL)
|
||||
@ -208,7 +208,7 @@ clutter_shader_effect_update_uniforms (ClutterShaderEffect *effect)
|
||||
gpointer key, value;
|
||||
gsize size;
|
||||
|
||||
if (priv->program == NULL)
|
||||
if (priv->program == COGL_INVALID_HANDLE)
|
||||
return;
|
||||
|
||||
if (priv->uniforms == NULL)
|
||||
@ -333,7 +333,7 @@ clutter_shader_effect_create_shader (ClutterShaderEffect *self)
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
return NULL;
|
||||
return COGL_INVALID_HANDLE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -353,7 +353,7 @@ clutter_shader_effect_try_static_source (ClutterShaderEffect *self)
|
||||
CLUTTER_TYPE_SHADER_EFFECT,
|
||||
ClutterShaderEffectClassPrivate);
|
||||
|
||||
if (class_priv->shader == NULL)
|
||||
if (class_priv->shader == COGL_INVALID_HANDLE)
|
||||
{
|
||||
gchar *source;
|
||||
|
||||
@ -387,10 +387,10 @@ clutter_shader_effect_try_static_source (ClutterShaderEffect *self)
|
||||
}
|
||||
}
|
||||
|
||||
priv->shader = cogl_object_ref (class_priv->shader);
|
||||
priv->shader = cogl_handle_ref (class_priv->shader);
|
||||
|
||||
if (class_priv->program != NULL)
|
||||
priv->program = cogl_object_ref (class_priv->program);
|
||||
if (class_priv->program != COGL_INVALID_HANDLE)
|
||||
priv->program = cogl_handle_ref (class_priv->program);
|
||||
}
|
||||
}
|
||||
|
||||
@ -404,13 +404,13 @@ clutter_shader_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
|
||||
/* If the source hasn't been set then we'll try to get it from the
|
||||
static source instead */
|
||||
if (priv->shader == NULL)
|
||||
if (priv->shader == COGL_INVALID_HANDLE)
|
||||
clutter_shader_effect_try_static_source (self);
|
||||
|
||||
/* we haven't been prepared or we don't have support for
|
||||
* GLSL shaders in Clutter
|
||||
*/
|
||||
if (priv->program == NULL)
|
||||
if (priv->program == COGL_INVALID_HANDLE)
|
||||
goto out;
|
||||
|
||||
CLUTTER_NOTE (SHADER, "Applying the shader effect of type '%s'",
|
||||
@ -500,7 +500,6 @@ static void
|
||||
clutter_shader_effect_init (ClutterShaderEffect *effect)
|
||||
{
|
||||
effect->priv = clutter_shader_effect_get_instance_private (effect);
|
||||
effect->priv->shader_type = CLUTTER_FRAGMENT_SHADER;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -534,7 +533,7 @@ clutter_shader_effect_new (ClutterShaderType shader_type)
|
||||
* Retrieves a pointer to the shader's handle
|
||||
*
|
||||
* Return value: (transfer none): a pointer to the shader's handle,
|
||||
* or %NULL
|
||||
* or %COGL_INVALID_HANDLE
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
@ -542,7 +541,7 @@ CoglHandle
|
||||
clutter_shader_effect_get_shader (ClutterShaderEffect *effect)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SHADER_EFFECT (effect),
|
||||
NULL);
|
||||
COGL_INVALID_HANDLE);
|
||||
|
||||
return effect->priv->shader;
|
||||
}
|
||||
@ -554,7 +553,7 @@ clutter_shader_effect_get_shader (ClutterShaderEffect *effect)
|
||||
* Retrieves a pointer to the program's handle
|
||||
*
|
||||
* Return value: (transfer none): a pointer to the program's handle,
|
||||
* or %NULL
|
||||
* or %COGL_INVALID_HANDLE
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
@ -562,7 +561,7 @@ CoglHandle
|
||||
clutter_shader_effect_get_program (ClutterShaderEffect *effect)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SHADER_EFFECT (effect),
|
||||
NULL);
|
||||
COGL_INVALID_HANDLE);
|
||||
|
||||
return effect->priv->program;
|
||||
}
|
||||
@ -892,7 +891,7 @@ clutter_shader_effect_set_shader_source (ClutterShaderEffect *effect,
|
||||
|
||||
priv = effect->priv;
|
||||
|
||||
if (priv->shader != NULL)
|
||||
if (priv->shader != COGL_INVALID_HANDLE)
|
||||
return TRUE;
|
||||
|
||||
priv->shader = clutter_shader_effect_create_shader (effect);
|
||||
|
@ -89,8 +89,8 @@ clutter_stage_manager_dispose (GObject *gobject)
|
||||
|
||||
stage_manager = CLUTTER_STAGE_MANAGER (gobject);
|
||||
|
||||
g_slist_free_full (stage_manager->stages,
|
||||
(GDestroyNotify) clutter_actor_destroy);
|
||||
g_slist_foreach (stage_manager->stages, (GFunc) clutter_actor_destroy, NULL);
|
||||
g_slist_free (stage_manager->stages);
|
||||
stage_manager->stages = NULL;
|
||||
|
||||
G_OBJECT_CLASS (clutter_stage_manager_parent_class)->dispose (gobject);
|
||||
@ -134,7 +134,8 @@ clutter_stage_manager_class_init (ClutterStageManagerClass *klass)
|
||||
G_OBJECT_CLASS_TYPE (gobject_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterStageManagerClass, stage_added),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_STAGE);
|
||||
/**
|
||||
@ -152,7 +153,8 @@ clutter_stage_manager_class_init (ClutterStageManagerClass *klass)
|
||||
G_OBJECT_CLASS_TYPE (gobject_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterStageManagerClass, stage_removed),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_STAGE);
|
||||
}
|
||||
|
@ -40,12 +40,8 @@ void _clutter_stage_paint_view (ClutterStage
|
||||
ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip);
|
||||
|
||||
void _clutter_stage_emit_after_paint (ClutterStage *stage);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_stage_set_window (ClutterStage *stage,
|
||||
ClutterStageWindow *stage_window);
|
||||
CLUTTER_EXPORT
|
||||
ClutterStageWindow *_clutter_stage_get_window (ClutterStage *stage);
|
||||
void _clutter_stage_get_projection_matrix (ClutterStage *stage,
|
||||
CoglMatrix *projection);
|
||||
@ -67,7 +63,6 @@ void _clutter_stage_maybe_relayout (ClutterActor
|
||||
gboolean _clutter_stage_needs_update (ClutterStage *stage);
|
||||
gboolean _clutter_stage_do_update (ClutterStage *stage);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_stage_queue_event (ClutterStage *stage,
|
||||
ClutterEvent *event,
|
||||
gboolean copy_event);
|
||||
@ -79,18 +74,9 @@ gint64 _clutter_stage_get_update_time (ClutterStage *stage);
|
||||
void _clutter_stage_clear_update_time (ClutterStage *stage);
|
||||
gboolean _clutter_stage_has_full_redraw_queued (ClutterStage *stage);
|
||||
|
||||
void clutter_stage_log_pick (ClutterStage *stage,
|
||||
const graphene_point_t *vertices,
|
||||
ClutterActor *actor);
|
||||
|
||||
void clutter_stage_push_pick_clip (ClutterStage *stage,
|
||||
const graphene_point_t *vertices);
|
||||
|
||||
void clutter_stage_pop_pick_clip (ClutterStage *stage);
|
||||
|
||||
ClutterActor *_clutter_stage_do_pick (ClutterStage *stage,
|
||||
float x,
|
||||
float y,
|
||||
gint x,
|
||||
gint y,
|
||||
ClutterPickMode mode);
|
||||
|
||||
ClutterPaintVolume *_clutter_stage_paint_volume_stack_allocate (ClutterStage *stage);
|
||||
@ -106,6 +92,13 @@ void _clutter_stage_queue_redraw_entry_invalidate (Clut
|
||||
|
||||
CoglFramebuffer *_clutter_stage_get_active_framebuffer (ClutterStage *stage);
|
||||
|
||||
gint32 _clutter_stage_acquire_pick_id (ClutterStage *stage,
|
||||
ClutterActor *actor);
|
||||
void _clutter_stage_release_pick_id (ClutterStage *stage,
|
||||
gint32 pick_id);
|
||||
ClutterActor * _clutter_stage_get_actor_by_pick_id (ClutterStage *stage,
|
||||
gint32 pick_id);
|
||||
|
||||
void _clutter_stage_add_pointer_drag_actor (ClutterStage *stage,
|
||||
ClutterInputDevice *device,
|
||||
ClutterActor *actor);
|
||||
@ -122,27 +115,20 @@ ClutterActor * _clutter_stage_get_touch_drag_actor (ClutterStage *st
|
||||
void _clutter_stage_remove_touch_drag_actor (ClutterStage *stage,
|
||||
ClutterEventSequence *sequence);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterStageState _clutter_stage_get_state (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_stage_is_activated (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_stage_is_fullscreen (ClutterStage *stage);
|
||||
gboolean _clutter_stage_update_state (ClutterStage *stage,
|
||||
ClutterStageState unset_state,
|
||||
ClutterStageState set_state);
|
||||
|
||||
void _clutter_stage_set_scale_factor (ClutterStage *stage,
|
||||
int factor);
|
||||
gboolean _clutter_stage_get_max_view_scale_factor_for_rect (ClutterStage *stage,
|
||||
graphene_rect_t *rect,
|
||||
float *view_scale);
|
||||
|
||||
void _clutter_stage_presented (ClutterStage *stage,
|
||||
CoglFrameEvent frame_event,
|
||||
ClutterFrameInfo *frame_info);
|
||||
|
||||
GList * _clutter_stage_peek_stage_views (ClutterStage *stage);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_STAGE_PRIVATE_H__ */
|
||||
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Red Hat Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __CLUTTER_STAGE_VIEW_PRIVATE_H__
|
||||
#define __CLUTTER_STAGE_VIEW_PRIVATE_H__
|
||||
|
||||
#include "clutter/clutter-stage-view.h"
|
||||
|
||||
void clutter_stage_view_blit_offscreen (ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip);
|
||||
|
||||
gboolean clutter_stage_view_is_dirty_viewport (ClutterStageView *view);
|
||||
|
||||
void clutter_stage_view_set_dirty_viewport (ClutterStageView *view,
|
||||
gboolean dirty);
|
||||
|
||||
gboolean clutter_stage_view_is_dirty_projection (ClutterStageView *view);
|
||||
|
||||
void clutter_stage_view_set_dirty_projection (ClutterStageView *view,
|
||||
gboolean dirty);
|
||||
|
||||
|
||||
#endif /* __CLUTTER_STAGE_VIEW_PRIVATE_H__ */
|
@ -18,7 +18,6 @@
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter/clutter-stage-view.h"
|
||||
#include "clutter/clutter-stage-view-private.h"
|
||||
|
||||
#include <cairo-gobject.h>
|
||||
#include <math.h>
|
||||
@ -62,14 +61,6 @@ clutter_stage_view_get_layout (ClutterStageView *view,
|
||||
*rect = priv->layout;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_stage_view_get_framebuffer:
|
||||
* @view: a #ClutterStageView
|
||||
*
|
||||
* Retrieves the framebuffer of @view to draw to.
|
||||
*
|
||||
* Returns: (transfer none): a #CoglFramebuffer
|
||||
*/
|
||||
CoglFramebuffer *
|
||||
clutter_stage_view_get_framebuffer (ClutterStageView *view)
|
||||
{
|
||||
@ -82,14 +73,6 @@ clutter_stage_view_get_framebuffer (ClutterStageView *view)
|
||||
return priv->framebuffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_stage_view_get_onscreen:
|
||||
* @view: a #ClutterStageView
|
||||
*
|
||||
* Retrieves the onscreen framebuffer of @view if available.
|
||||
*
|
||||
* Returns: (transfer none): a #CoglFramebuffer
|
||||
*/
|
||||
CoglFramebuffer *
|
||||
clutter_stage_view_get_onscreen (ClutterStageView *view)
|
||||
{
|
||||
@ -143,21 +126,6 @@ clutter_stage_view_blit_offscreen (ClutterStageView *view,
|
||||
clutter_stage_view_get_instance_private (view);
|
||||
CoglMatrix matrix;
|
||||
|
||||
clutter_stage_view_get_offscreen_transformation_matrix (view, &matrix);
|
||||
if (cogl_matrix_is_identity (&matrix))
|
||||
{
|
||||
int fb_width = cogl_framebuffer_get_width (priv->framebuffer);
|
||||
int fb_height = cogl_framebuffer_get_height (priv->framebuffer);
|
||||
|
||||
if (cogl_blit_framebuffer (priv->offscreen,
|
||||
priv->framebuffer,
|
||||
0, 0,
|
||||
0, 0,
|
||||
fb_width, fb_height,
|
||||
NULL))
|
||||
return;
|
||||
}
|
||||
|
||||
clutter_stage_view_ensure_offscreen_blit_pipeline (view);
|
||||
cogl_framebuffer_push_matrix (priv->framebuffer);
|
||||
|
||||
|
@ -18,10 +18,6 @@
|
||||
#ifndef __CLUTTER_STAGE_VIEW_H__
|
||||
#define __CLUTTER_STAGE_VIEW_H__
|
||||
|
||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <clutter/clutter.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <cairo.h>
|
||||
#include <glib-object.h>
|
||||
#include <cogl/cogl.h>
|
||||
@ -61,9 +57,22 @@ void clutter_stage_view_transform_to_onscreen (ClutterStageView *vie
|
||||
gfloat *x,
|
||||
gfloat *y);
|
||||
|
||||
void clutter_stage_view_blit_offscreen (ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
float clutter_stage_view_get_scale (ClutterStageView *view);
|
||||
|
||||
gboolean clutter_stage_view_is_dirty_viewport (ClutterStageView *view);
|
||||
|
||||
void clutter_stage_view_set_dirty_viewport (ClutterStageView *view,
|
||||
gboolean dirty);
|
||||
|
||||
gboolean clutter_stage_view_is_dirty_projection (ClutterStageView *view);
|
||||
|
||||
void clutter_stage_view_set_dirty_projection (ClutterStageView *view,
|
||||
gboolean dirty);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView *view,
|
||||
CoglMatrix *matrix);
|
||||
|
@ -62,6 +62,16 @@ _clutter_stage_window_set_title (ClutterStageWindow *window,
|
||||
iface->set_title (window, title);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_stage_window_set_fullscreen (ClutterStageWindow *window,
|
||||
gboolean is_fullscreen)
|
||||
{
|
||||
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||
|
||||
if (iface->set_fullscreen)
|
||||
iface->set_fullscreen (window, is_fullscreen);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
|
||||
gboolean is_visible)
|
||||
@ -72,6 +82,14 @@ _clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
|
||||
iface->set_cursor_visible (window, is_visible);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_stage_window_set_user_resizable (ClutterStageWindow *window,
|
||||
gboolean is_resizable)
|
||||
{
|
||||
CLUTTER_STAGE_WINDOW_GET_IFACE (window)->set_user_resizable (window,
|
||||
is_resizable);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_stage_window_realize (ClutterStageWindow *window)
|
||||
{
|
||||
@ -275,6 +293,24 @@ _clutter_stage_window_redraw (ClutterStageWindow *window)
|
||||
iface->redraw (window);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_clutter_stage_window_get_dirty_pixel (ClutterStageWindow *window,
|
||||
ClutterStageView *view,
|
||||
int *x, int *y)
|
||||
{
|
||||
ClutterStageWindowInterface *iface;
|
||||
|
||||
*x = 0;
|
||||
*y = 0;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
||||
|
||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||
if (iface->get_dirty_pixel)
|
||||
iface->get_dirty_pixel (window, view, x, y);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_stage_window_can_clip_redraws (ClutterStageWindow *window)
|
||||
{
|
||||
|
@ -30,8 +30,12 @@ struct _ClutterStageWindowInterface
|
||||
|
||||
void (* set_title) (ClutterStageWindow *stage_window,
|
||||
const gchar *title);
|
||||
void (* set_fullscreen) (ClutterStageWindow *stage_window,
|
||||
gboolean is_fullscreen);
|
||||
void (* set_cursor_visible) (ClutterStageWindow *stage_window,
|
||||
gboolean cursor_visible);
|
||||
void (* set_user_resizable) (ClutterStageWindow *stage_window,
|
||||
gboolean is_resizable);
|
||||
|
||||
gboolean (* realize) (ClutterStageWindow *stage_window);
|
||||
void (* unrealize) (ClutterStageWindow *stage_window);
|
||||
@ -64,6 +68,10 @@ struct _ClutterStageWindowInterface
|
||||
|
||||
void (* redraw) (ClutterStageWindow *stage_window);
|
||||
|
||||
void (* get_dirty_pixel) (ClutterStageWindow *stage_window,
|
||||
ClutterStageView *view,
|
||||
int *x, int *y);
|
||||
|
||||
gboolean (* can_clip_redraws) (ClutterStageWindow *stage_window);
|
||||
|
||||
GList *(* get_views) (ClutterStageWindow *stage_window);
|
||||
@ -75,8 +83,12 @@ ClutterActor * _clutter_stage_window_get_wrapper (ClutterStageWindow *
|
||||
|
||||
void _clutter_stage_window_set_title (ClutterStageWindow *window,
|
||||
const gchar *title);
|
||||
void _clutter_stage_window_set_fullscreen (ClutterStageWindow *window,
|
||||
gboolean is_fullscreen);
|
||||
void _clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
|
||||
gboolean is_visible);
|
||||
void _clutter_stage_window_set_user_resizable (ClutterStageWindow *window,
|
||||
gboolean is_resizable);
|
||||
|
||||
gboolean _clutter_stage_window_realize (ClutterStageWindow *window);
|
||||
void _clutter_stage_window_unrealize (ClutterStageWindow *window);
|
||||
@ -88,7 +100,6 @@ void _clutter_stage_window_hide (ClutterStageWin
|
||||
void _clutter_stage_window_resize (ClutterStageWindow *window,
|
||||
gint width,
|
||||
gint height);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_stage_window_get_geometry (ClutterStageWindow *window,
|
||||
cairo_rectangle_int_t *geometry);
|
||||
void _clutter_stage_window_schedule_update (ClutterStageWindow *window,
|
||||
@ -108,6 +119,10 @@ void _clutter_stage_window_set_accept_focus (ClutterStageWin
|
||||
|
||||
void _clutter_stage_window_redraw (ClutterStageWindow *window);
|
||||
|
||||
void _clutter_stage_window_get_dirty_pixel (ClutterStageWindow *window,
|
||||
ClutterStageView *view,
|
||||
int *x, int *y);
|
||||
|
||||
gboolean _clutter_stage_window_can_clip_redraws (ClutterStageWindow *window);
|
||||
|
||||
GList * _clutter_stage_window_get_views (ClutterStageWindow *window);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -30,7 +30,6 @@
|
||||
|
||||
#include <clutter/clutter-types.h>
|
||||
#include <clutter/clutter-group.h>
|
||||
#include <clutter/clutter-stage-view.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@ -62,6 +61,8 @@ struct _ClutterStage
|
||||
};
|
||||
/**
|
||||
* ClutterStageClass:
|
||||
* @fullscreen: handler for the #ClutterStage::fullscreen signal
|
||||
* @unfullscreen: handler for the #ClutterStage::unfullscreen signal
|
||||
* @activate: handler for the #ClutterStage::activate signal
|
||||
* @deactivate: handler for the #ClutterStage::deactivate signal
|
||||
* @delete_event: handler for the #ClutterStage::delete-event signal
|
||||
@ -78,18 +79,17 @@ struct _ClutterStageClass
|
||||
|
||||
/*< public >*/
|
||||
/* signals */
|
||||
void (* fullscreen) (ClutterStage *stage);
|
||||
void (* unfullscreen) (ClutterStage *stage);
|
||||
void (* activate) (ClutterStage *stage);
|
||||
void (* deactivate) (ClutterStage *stage);
|
||||
|
||||
gboolean (* delete_event) (ClutterStage *stage,
|
||||
ClutterEvent *event);
|
||||
|
||||
void (* paint_view) (ClutterStage *stage,
|
||||
ClutterStageView *view);
|
||||
|
||||
/*< private >*/
|
||||
/* padding for future expansion */
|
||||
gpointer _padding_dummy[30];
|
||||
gpointer _padding_dummy[31];
|
||||
};
|
||||
|
||||
/**
|
||||
@ -115,6 +115,26 @@ struct _ClutterPerspective
|
||||
gfloat z_far;
|
||||
};
|
||||
|
||||
/**
|
||||
* ClutterFog:
|
||||
* @z_near: starting distance from the viewer to the near clipping
|
||||
* plane (always positive)
|
||||
* @z_far: final distance from the viewer to the far clipping
|
||||
* plane (always positive)
|
||||
*
|
||||
* Fog settings used to create the depth cueing effect.
|
||||
*
|
||||
* Since: 0.6
|
||||
*
|
||||
* Deprecated: 1.10: The fog-related API in #ClutterStage has been
|
||||
* deprecated as well.
|
||||
*/
|
||||
struct _ClutterFog
|
||||
{
|
||||
gfloat z_near;
|
||||
gfloat z_far;
|
||||
};
|
||||
|
||||
/**
|
||||
* ClutterFrameInfo: (skip)
|
||||
*/
|
||||
@ -133,6 +153,8 @@ typedef struct _ClutterCapture
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_perspective_get_type (void) G_GNUC_CONST;
|
||||
CLUTTER_DEPRECATED
|
||||
GType clutter_fog_get_type (void) G_GNUC_CONST;
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_stage_get_type (void) G_GNUC_CONST;
|
||||
|
||||
@ -146,6 +168,11 @@ CLUTTER_EXPORT
|
||||
void clutter_stage_get_perspective (ClutterStage *stage,
|
||||
ClutterPerspective *perspective);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_set_fullscreen (ClutterStage *stage,
|
||||
gboolean fullscreen);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_stage_get_fullscreen (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_show_cursor (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_hide_cursor (ClutterStage *stage);
|
||||
@ -154,6 +181,11 @@ void clutter_stage_set_title (ClutterStage
|
||||
const gchar *title);
|
||||
CLUTTER_EXPORT
|
||||
const gchar * clutter_stage_get_title (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_set_user_resizable (ClutterStage *stage,
|
||||
gboolean resizable);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_stage_get_user_resizable (ClutterStage *stage);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_set_minimum_size (ClutterStage *stage,
|
||||
@ -201,8 +233,8 @@ gboolean clutter_stage_event (ClutterStage
|
||||
CLUTTER_EXPORT
|
||||
ClutterActor * clutter_stage_get_actor_at_pos (ClutterStage *stage,
|
||||
ClutterPickMode pick_mode,
|
||||
float x,
|
||||
float y);
|
||||
gint x,
|
||||
gint y);
|
||||
CLUTTER_EXPORT
|
||||
guchar * clutter_stage_read_pixels (ClutterStage *stage,
|
||||
gint x,
|
||||
@ -229,23 +261,12 @@ CLUTTER_EXPORT
|
||||
void clutter_stage_skip_sync_delay (ClutterStage *stage);
|
||||
#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
|
||||
gboolean clutter_stage_capture (ClutterStage *stage,
|
||||
gboolean paint,
|
||||
cairo_rectangle_int_t *rect,
|
||||
ClutterCapture **captures,
|
||||
int *n_captures);
|
||||
CLUTTER_EXPORT
|
||||
ClutterStageView * clutter_stage_get_view_at (ClutterStage *stage,
|
||||
float x,
|
||||
float y);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -122,7 +122,8 @@ clutter_tap_action_class_init (ClutterTapActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTapActionClass, tap),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
}
|
||||
|
@ -1,8 +1,17 @@
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-test-utils.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <glib-object.h>
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#include "clutter-actor.h"
|
||||
#include "clutter-color.h"
|
||||
#include "clutter-event.h"
|
||||
#include "clutter-keysyms.h"
|
||||
#include "clutter-main.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-stage.h"
|
||||
|
||||
typedef struct {
|
||||
ClutterActor *stage;
|
||||
@ -264,7 +273,7 @@ clutter_test_run (void)
|
||||
typedef struct {
|
||||
ClutterActor *stage;
|
||||
|
||||
graphene_point_t point;
|
||||
ClutterPoint point;
|
||||
|
||||
gpointer result;
|
||||
|
||||
@ -339,10 +348,10 @@ on_key_press_event (ClutterActor *stage,
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
clutter_test_check_actor_at_point (ClutterActor *stage,
|
||||
const graphene_point_t *point,
|
||||
ClutterActor *actor,
|
||||
ClutterActor **result)
|
||||
clutter_test_check_actor_at_point (ClutterActor *stage,
|
||||
const ClutterPoint *point,
|
||||
ClutterActor *actor,
|
||||
ClutterActor **result)
|
||||
{
|
||||
ValidateData *data;
|
||||
guint press_id = 0;
|
||||
@ -401,10 +410,10 @@ clutter_test_check_actor_at_point (ClutterActor *stage,
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
clutter_test_check_color_at_point (ClutterActor *stage,
|
||||
const graphene_point_t *point,
|
||||
const ClutterColor *color,
|
||||
ClutterColor *result)
|
||||
clutter_test_check_color_at_point (ClutterActor *stage,
|
||||
const ClutterPoint *point,
|
||||
const ClutterColor *color,
|
||||
ClutterColor *result)
|
||||
{
|
||||
ValidateData *data;
|
||||
gboolean retval;
|
@ -19,23 +19,16 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef __CLUTTER_TEST_UTILS_H__
|
||||
#define __CLUTTER_TEST_UTILS_H__
|
||||
|
||||
#define __CLUTTER_H_INSIDE__
|
||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <clutter/clutter.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include "clutter/clutter-types.h"
|
||||
#include "clutter/clutter-actor.h"
|
||||
#include "clutter/clutter-color.h"
|
||||
#include "clutter/clutter-private.h"
|
||||
#include "core/main-private.h"
|
||||
#include "meta/common.h"
|
||||
#include "meta/main.h"
|
||||
#include "backends/x11/nested/meta-backend-x11-nested.h"
|
||||
#include "wayland/meta-wayland.h"
|
||||
#include "wayland/meta-xwayland.h"
|
||||
#include <clutter/clutter-types.h>
|
||||
#include <clutter/clutter-actor.h>
|
||||
#include <clutter/clutter-color.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@ -86,8 +79,6 @@ G_BEGIN_DECLS
|
||||
int \
|
||||
main (int argc, char *argv[]) \
|
||||
{ \
|
||||
meta_test_init ();\
|
||||
\
|
||||
clutter_test_init (&argc, &argv); \
|
||||
\
|
||||
{ \
|
||||
@ -121,7 +112,7 @@ ClutterActor * clutter_test_get_stage (void);
|
||||
|
||||
#define clutter_test_assert_actor_at_point(stage,point,actor) \
|
||||
G_STMT_START { \
|
||||
const graphene_point_t *__p = (point); \
|
||||
const ClutterPoint *__p = (point); \
|
||||
ClutterActor *__actor = (actor); \
|
||||
ClutterActor *__stage = (stage); \
|
||||
ClutterActor *__res; \
|
||||
@ -141,7 +132,7 @@ G_STMT_START { \
|
||||
|
||||
#define clutter_test_assert_color_at_point(stage,point,color) \
|
||||
G_STMT_START { \
|
||||
const graphene_point_t *__p = (point); \
|
||||
const ClutterPoint *__p = (point); \
|
||||
const ClutterColor *__c = (color); \
|
||||
ClutterActor *__stage = (stage); \
|
||||
ClutterColor __res; \
|
||||
@ -158,15 +149,15 @@ G_STMT_START { \
|
||||
} G_STMT_END
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_test_check_actor_at_point (ClutterActor *stage,
|
||||
const graphene_point_t *point,
|
||||
ClutterActor *actor,
|
||||
ClutterActor **result);
|
||||
gboolean clutter_test_check_actor_at_point (ClutterActor *stage,
|
||||
const ClutterPoint *point,
|
||||
ClutterActor *actor,
|
||||
ClutterActor **result);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_test_check_color_at_point (ClutterActor *stage,
|
||||
const graphene_point_t *point,
|
||||
const ClutterColor *color,
|
||||
ClutterColor *result);
|
||||
gboolean clutter_test_check_color_at_point (ClutterActor *stage,
|
||||
const ClutterPoint *point,
|
||||
const ClutterColor *color,
|
||||
ClutterColor *result);
|
||||
|
||||
G_END_DECLS
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user