Compare commits
305 Commits
3.33.90
...
wip/nielsd
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4233ecd539 | ||
![]() |
355d486502 | ||
![]() |
84415f936c | ||
![]() |
8665084df1 | ||
![]() |
62072838c9 | ||
![]() |
c5b7d73ce2 | ||
![]() |
0556138b9f | ||
![]() |
d57dbe1d4c | ||
![]() |
5d646a5d6f | ||
![]() |
e82a657cd9 | ||
![]() |
8c89ea5f0a | ||
![]() |
8cfa8dc0c1 | ||
![]() |
bdf5e3f357 | ||
![]() |
94682e69aa | ||
![]() |
160cc9182d | ||
![]() |
cd293f764e | ||
![]() |
a5d0cfe8fb | ||
![]() |
ba0f17f5b1 | ||
![]() |
16875340cb | ||
![]() |
959a418cc3 | ||
![]() |
7c7ccb2e43 | ||
![]() |
cada2b54fe | ||
![]() |
3ecae81809 | ||
![]() |
4f2b217a6a | ||
![]() |
b1a1d4e13d | ||
![]() |
f7315c9a36 | ||
![]() |
9ac52f0340 | ||
![]() |
f059466337 | ||
![]() |
dcd0f4322a | ||
![]() |
65d8f27b6b | ||
![]() |
bdceb3acdb | ||
![]() |
8e204e036a | ||
![]() |
553211dd81 | ||
![]() |
97010ac64d | ||
![]() |
c2d03bf73e | ||
![]() |
22c8f179d2 | ||
![]() |
d4ff5e2d31 | ||
![]() |
2773e8adf8 | ||
![]() |
e17d70a592 | ||
![]() |
da213febdc | ||
![]() |
7c2e926c44 | ||
![]() |
c474ad6a53 | ||
![]() |
877ecc1bb4 | ||
![]() |
0d0286d59e | ||
![]() |
23f77a1b63 | ||
![]() |
317ce05a27 | ||
![]() |
a8155a0471 | ||
![]() |
5e7fa20f06 | ||
![]() |
3a688988e0 | ||
![]() |
34ff206604 | ||
![]() |
5c1be2233d | ||
![]() |
e1751ad9ee | ||
![]() |
84cc89e19a | ||
![]() |
ea4665bf51 | ||
![]() |
227d272049 | ||
![]() |
e53db92a7b | ||
![]() |
dd2b1278a0 | ||
![]() |
f2e2fcf758 | ||
![]() |
dfd44ff971 | ||
![]() |
943b069996 | ||
![]() |
2a56de80a2 | ||
![]() |
69a0c1dc80 | ||
![]() |
1b4709794e | ||
![]() |
1cc249fe18 | ||
![]() |
446bd04b6c | ||
![]() |
9234fcb624 | ||
![]() |
59a697f773 | ||
![]() |
d49d10b14f | ||
![]() |
4c15d32b55 | ||
![]() |
73eaf51770 | ||
![]() |
81ee8886ce | ||
![]() |
658c741420 | ||
![]() |
65cc8c1ea2 | ||
![]() |
d9597d2148 | ||
![]() |
fc3831c797 | ||
![]() |
ce86f90efb | ||
![]() |
b5f50028f2 | ||
![]() |
2c388e2155 | ||
![]() |
fb6e2743ec | ||
![]() |
6ee006c851 | ||
![]() |
107e521553 | ||
![]() |
7735a919d1 | ||
![]() |
9f617ae43d | ||
![]() |
104bdde746 | ||
![]() |
2a990cc140 | ||
![]() |
3e41568074 | ||
![]() |
66ae09b670 | ||
![]() |
7b97c7b35e | ||
![]() |
ca318c1520 | ||
![]() |
cbb4f6c892 | ||
![]() |
092b3edb51 | ||
![]() |
8d6d2d07dd | ||
![]() |
fa461525ee | ||
![]() |
8e510a07c4 | ||
![]() |
e153524748 | ||
![]() |
eb8a1f42bc | ||
![]() |
89cd9d382d | ||
![]() |
488991b0f6 | ||
![]() |
e2330617ac | ||
![]() |
5e6d98e79f | ||
![]() |
5eaf655224 | ||
![]() |
2c1553570f | ||
![]() |
c937dd5ba3 | ||
![]() |
26b76ee95d | ||
![]() |
006eb6d81e | ||
![]() |
0cdf13ac12 | ||
![]() |
0a3f25c303 | ||
![]() |
105a3f757a | ||
![]() |
f376a318ba | ||
![]() |
4b88c1832a | ||
![]() |
fc8aa1cdb1 | ||
![]() |
7049b2f274 | ||
![]() |
0f51ae7cf0 | ||
![]() |
437f6b3d59 | ||
![]() |
05e1a6c2ca | ||
![]() |
25c1a85384 | ||
![]() |
bba8f6c53e | ||
![]() |
dbe9daeb76 | ||
![]() |
8fd55fef85 | ||
![]() |
acfd03da30 | ||
![]() |
f352c3d79d | ||
![]() |
4bf0bd3f55 | ||
![]() |
76f2579e44 | ||
![]() |
0706e021f5 | ||
![]() |
b5775e3d85 | ||
![]() |
cd70595b50 | ||
![]() |
1d2913d9b9 | ||
![]() |
b8a49a682e | ||
![]() |
82901f89d5 | ||
![]() |
c9c53cb55f | ||
![]() |
1e637bd7e1 | ||
![]() |
63a0b702c9 | ||
![]() |
031003a5dc | ||
![]() |
b69d2aa6a0 | ||
![]() |
d7d2612218 | ||
![]() |
7a0340c57d | ||
![]() |
0863bd2408 | ||
![]() |
594cc7c7d6 | ||
![]() |
0b19078b2b | ||
![]() |
7811865e84 | ||
![]() |
0e69fe0781 | ||
![]() |
26b08d87a8 | ||
![]() |
321ab3b367 | ||
![]() |
4d0869e206 | ||
![]() |
d13cea6ccb | ||
![]() |
6922f0e16a | ||
![]() |
31df06d94e | ||
![]() |
ecec9a7eaa | ||
![]() |
ab7af2d0c5 | ||
![]() |
f92e0bec0b | ||
![]() |
7a22f6fd3f | ||
![]() |
850ef51879 | ||
![]() |
ef2e04a613 | ||
![]() |
e16b75a0b7 | ||
![]() |
8cdcf529e9 | ||
![]() |
280167f217 | ||
![]() |
a72f3fdabb | ||
![]() |
dd6227e3bf | ||
![]() |
1271ce1cab | ||
![]() |
998114791f | ||
![]() |
8a73324a0f | ||
![]() |
9065edfc95 | ||
![]() |
5111e33948 | ||
![]() |
4cf828323d | ||
![]() |
35776c5d29 | ||
![]() |
2f27b8d5fa | ||
![]() |
be4131b3c4 | ||
![]() |
854feafa83 | ||
![]() |
f423736a70 | ||
![]() |
fdbac25e0d | ||
![]() |
bcfac0d6dc | ||
![]() |
682d43b5ab | ||
![]() |
cd273e82ad | ||
![]() |
3c0067dc69 | ||
![]() |
a957c2f0c2 | ||
![]() |
908203c735 | ||
![]() |
2f072af02b | ||
![]() |
de98fb29da | ||
![]() |
82c92177ff | ||
![]() |
14c706e51b | ||
![]() |
a70823dd1c | ||
![]() |
fdda8adfcf | ||
![]() |
8f242f8bf0 | ||
![]() |
36a14e65c2 | ||
![]() |
6ed5d2e2b4 | ||
![]() |
d4eb222644 | ||
![]() |
a14fd1b955 | ||
![]() |
ab1107973b | ||
![]() |
4ab483d991 | ||
![]() |
dabf72f3c0 | ||
![]() |
907a1f5e48 | ||
![]() |
97140ab634 | ||
![]() |
dc9c5417bc | ||
![]() |
556e7694de | ||
![]() |
1a5cba5df5 | ||
![]() |
cd0990c581 | ||
![]() |
96e831dd8a | ||
![]() |
65fde269c6 | ||
![]() |
ad138210b3 | ||
![]() |
6968f17f3f | ||
![]() |
7e69d1400a | ||
![]() |
ccefa87351 | ||
![]() |
a3c97ee535 | ||
![]() |
77229f99b8 | ||
![]() |
a51437ee2b | ||
![]() |
78232fa3eb | ||
![]() |
433e1b388d | ||
![]() |
9b7d918537 | ||
![]() |
4c59eb0910 | ||
![]() |
5cfea4fee3 | ||
![]() |
7275cf60bd | ||
![]() |
acbefa5263 | ||
![]() |
2b64861ee1 | ||
![]() |
ea90b803fa | ||
![]() |
56e8aab280 | ||
![]() |
1b58341e50 | ||
![]() |
634c31d7cb | ||
![]() |
b8dcd5f842 | ||
![]() |
14e02635ff | ||
![]() |
9b3b5badfb | ||
![]() |
47c1558287 | ||
![]() |
cc7e843c44 | ||
![]() |
cfb8f18cef | ||
![]() |
c0a71720af | ||
![]() |
8b03d9ecc3 | ||
![]() |
ea54ce7d96 | ||
![]() |
cb31e3e12a | ||
![]() |
c710a56903 | ||
![]() |
96d5bde9b7 | ||
![]() |
ad72fa46b0 | ||
![]() |
fa4580de53 | ||
![]() |
5e343e2c16 | ||
![]() |
ef93bb6471 | ||
![]() |
d6aaef9954 | ||
![]() |
2ca351366e | ||
![]() |
f54bf022bd | ||
![]() |
e56df455ae | ||
![]() |
54101b1948 | ||
![]() |
829d9c863c | ||
![]() |
f304fa4869 | ||
![]() |
a32559e5ae | ||
![]() |
8e13292d62 | ||
![]() |
29ea5306eb | ||
![]() |
fb9e8768a3 | ||
![]() |
c747be84d9 | ||
![]() |
2d7adb90c8 | ||
![]() |
6b35a4901e | ||
![]() |
4c1fde9deb | ||
![]() |
425e65049b | ||
![]() |
d3f30d9ece | ||
![]() |
75cffd0ec4 | ||
![]() |
e33d6b2908 | ||
![]() |
a50907513a | ||
![]() |
c0130ca8f7 | ||
![]() |
9d4e4e2bd4 | ||
![]() |
bdc7cc8ab9 | ||
![]() |
13deb22223 | ||
![]() |
220e4caf36 | ||
![]() |
5c617ac286 | ||
![]() |
bc08ad2fbb | ||
![]() |
0947bc37d3 | ||
![]() |
959eb98090 | ||
![]() |
32dcf77a8f | ||
![]() |
75349f8cde | ||
![]() |
eac227a203 | ||
![]() |
bc166aa6b4 | ||
![]() |
5fa8b24b2b | ||
![]() |
9d65eab549 | ||
![]() |
c4a9117ef8 | ||
![]() |
0db38c4999 | ||
![]() |
8ee00cee60 | ||
![]() |
984aad4b86 | ||
![]() |
9af90bf9c1 | ||
![]() |
12ea2fcb51 | ||
![]() |
55cd110c63 | ||
![]() |
f37a172dc7 | ||
![]() |
ad62a659eb | ||
![]() |
15c9458e92 | ||
![]() |
a3baf14e72 | ||
![]() |
f57ce7254d | ||
![]() |
4d8190972d | ||
![]() |
b7ef8796b2 | ||
![]() |
7e8a864992 | ||
![]() |
f3660dc60e | ||
![]() |
0eb355e29d | ||
![]() |
3ccb7cf4b2 | ||
![]() |
578ff22464 | ||
![]() |
73db35c53c | ||
![]() |
76445bcb97 | ||
![]() |
6792903c4f | ||
![]() |
17c217848d | ||
![]() |
07de258f48 | ||
![]() |
ee3e195b79 | ||
![]() |
a0bdf44c2d | ||
![]() |
3259c7e150 | ||
![]() |
e9e28baab7 | ||
![]() |
d20f6c7969 | ||
![]() |
93c7d571af | ||
![]() |
d526283ab9 | ||
![]() |
782056adab | ||
![]() |
0521706617 | ||
![]() |
989a281b5f | ||
![]() |
18838bcefc | ||
![]() |
f780706f09 | ||
![]() |
358911a049 |
@@ -28,10 +28,10 @@ build-mutter:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
||||
build-without-native-backend:
|
||||
build-without-native-backend-and-wayland:
|
||||
stage: build
|
||||
script:
|
||||
- meson . build -Dbuildtype=debugoptimized -Dnative_backend=false -Dudev=false --werror --prefix /usr
|
||||
- meson . build -Dbuildtype=debugoptimized -Dnative_backend=false -Dudev=false -Dwayland=false -Dcore_tests=false --werror --prefix /usr
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
artifacts:
|
||||
@@ -72,7 +72,7 @@ can-build-gnome-shell:
|
||||
- meson install --no-rebuild -C build
|
||||
script:
|
||||
- .gitlab-ci/checkout-gnome-shell.sh
|
||||
- meson gnome-shell gnome-shell/build --prefix /usr
|
||||
- meson gnome-shell gnome-shell/build --prefix /usr -Dman=false
|
||||
- ninja -C gnome-shell/build install
|
||||
only:
|
||||
- merge_requests
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# Rebuild and push with
|
||||
#
|
||||
# cd .gitlab-ci/
|
||||
# docker build -t registry.gitlab.gnome.org/gnome/mutter/master:v2 .
|
||||
# docker build --no-cache -t registry.gitlab.gnome.org/gnome/mutter/master:v2 .
|
||||
# docker push registry.gitlab.gnome.org/gnome/mutter/master:v2
|
||||
#
|
||||
|
||||
@@ -13,11 +13,12 @@ RUN dnf -y update && dnf -y upgrade && \
|
||||
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 && \
|
||||
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 && \
|
||||
@@ -31,6 +32,8 @@ RUN dnf -y update && dnf -y upgrade && \
|
||||
|
||||
# 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 && \
|
||||
|
||||
|
108
NEWS
108
NEWS
@@ -1,3 +1,111 @@
|
||||
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]
|
||||
|
@@ -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;
|
||||
ClutterVertex verts[4];
|
||||
graphene_point3d_t verts[4];
|
||||
ClutterActor *stage = NULL;
|
||||
|
||||
g_return_if_fail (CALLY_IS_ACTOR (component));
|
||||
@@ -737,11 +737,7 @@ 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.
|
||||
*
|
||||
* FIXME: only the case with x11 is implemented, other backends are
|
||||
* required
|
||||
*
|
||||
* of the stage. This is 0,0 for a compositor.
|
||||
*/
|
||||
void
|
||||
_cally_actor_get_top_level_origin (ClutterActor *actor,
|
||||
@@ -749,54 +745,11 @@ _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 = x;
|
||||
*xp = 0;
|
||||
|
||||
if (yp)
|
||||
*yp = y;
|
||||
*yp = 0;
|
||||
}
|
||||
|
||||
/* AtkAction implementation */
|
||||
|
@@ -1438,7 +1438,7 @@ static void cally_text_get_character_extents (AtkText *text,
|
||||
PangoLayout *layout;
|
||||
PangoRectangle extents;
|
||||
const gchar *text_value;
|
||||
ClutterVertex verts[4];
|
||||
graphene_point3d_t 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;
|
||||
ClutterVertex verts[4];
|
||||
graphene_point3d_t 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 #ClutterVertex
|
||||
* @verts: (array fixed-size=4): array of four #graphene_point3d_t
|
||||
*
|
||||
* 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 ClutterVertex verts[])
|
||||
clutter_actor_box_from_vertices (ClutterActorBox *box,
|
||||
const graphene_point3d_t verts[])
|
||||
{
|
||||
gfloat x_1, x_2, y_1, y_2;
|
||||
|
||||
|
@@ -135,7 +135,7 @@ struct _AnchorCoord
|
||||
} fraction;
|
||||
|
||||
/* Use when is_fractional == FALSE */
|
||||
ClutterVertex units;
|
||||
graphene_point3d_t units;
|
||||
} v;
|
||||
};
|
||||
|
||||
@@ -163,7 +163,7 @@ struct _SizeRequest
|
||||
struct _ClutterLayoutInfo
|
||||
{
|
||||
/* fixed position coordinates */
|
||||
ClutterPoint fixed_pos;
|
||||
graphene_point_t fixed_pos;
|
||||
|
||||
ClutterMargin margin;
|
||||
|
||||
@@ -173,8 +173,8 @@ struct _ClutterLayoutInfo
|
||||
guint x_expand : 1;
|
||||
guint y_expand : 1;
|
||||
|
||||
ClutterSize minimum;
|
||||
ClutterSize natural;
|
||||
graphene_size_t minimum;
|
||||
graphene_size_t natural;
|
||||
};
|
||||
|
||||
const ClutterLayoutInfo * _clutter_actor_get_layout_info_or_defaults (ClutterActor *self);
|
||||
@@ -203,13 +203,13 @@ struct _ClutterTransformInfo
|
||||
AnchorCoord anchor;
|
||||
|
||||
/* translation */
|
||||
ClutterVertex translation;
|
||||
graphene_point3d_t translation;
|
||||
|
||||
/* z_position */
|
||||
gfloat z_position;
|
||||
|
||||
/* transformation center */
|
||||
ClutterPoint pivot;
|
||||
graphene_point_t pivot;
|
||||
gfloat pivot_z;
|
||||
|
||||
CoglMatrix transform;
|
||||
@@ -242,9 +242,6 @@ 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);
|
||||
@@ -277,6 +274,9 @@ 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,8 +297,6 @@ 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);
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -233,8 +233,7 @@ struct _ClutterActorClass
|
||||
ClutterActor *old_parent);
|
||||
|
||||
void (* destroy) (ClutterActor *self);
|
||||
void (* pick) (ClutterActor *actor,
|
||||
const ClutterColor *color);
|
||||
void (* pick) (ClutterActor *actor);
|
||||
|
||||
gboolean (* queue_redraw) (ClutterActor *actor,
|
||||
ClutterActor *leaf_that_queued,
|
||||
@@ -431,7 +430,7 @@ void clutter_actor_get_allocation_box
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_get_allocation_vertices (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
ClutterVertex verts[]);
|
||||
graphene_point3d_t *verts);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_actor_has_allocation (ClutterActor *self);
|
||||
CLUTTER_EXPORT
|
||||
@@ -817,16 +816,16 @@ gboolean clutter_actor_transform_stage_point
|
||||
gfloat *y_out);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_get_abs_allocation_vertices (ClutterActor *self,
|
||||
ClutterVertex verts[]);
|
||||
graphene_point3d_t *verts);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_apply_transform_to_point (ClutterActor *self,
|
||||
const ClutterVertex *point,
|
||||
ClutterVertex *vertex);
|
||||
const graphene_point3d_t *point,
|
||||
graphene_point3d_t *vertex);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
const ClutterVertex *point,
|
||||
ClutterVertex *vertex);
|
||||
const graphene_point3d_t *point,
|
||||
graphene_point3d_t *vertex);
|
||||
|
||||
/* Implicit animations */
|
||||
CLUTTER_EXPORT
|
||||
@@ -902,6 +901,10 @@ 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,7 +50,6 @@ 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)
|
||||
@@ -94,10 +93,6 @@ 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,8 +27,6 @@
|
||||
#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))
|
||||
@@ -58,7 +56,7 @@ struct _ClutterBackend
|
||||
gfloat units_per_em;
|
||||
gint32 units_serial;
|
||||
|
||||
GList *event_translators;
|
||||
ClutterStageWindow *stage_window;
|
||||
|
||||
ClutterInputMethod *input_method;
|
||||
|
||||
@@ -93,12 +91,6 @@ 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);
|
||||
@@ -136,17 +128,11 @@ 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,
|
||||
@@ -160,6 +146,9 @@ 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);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_BACKEND_PRIVATE_H__ */
|
||||
|
@@ -62,9 +62,6 @@
|
||||
#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
|
||||
@@ -104,10 +101,12 @@ 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);
|
||||
}
|
||||
@@ -397,7 +396,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;
|
||||
}
|
||||
@@ -526,40 +525,7 @@ _clutter_create_backend (void)
|
||||
static void
|
||||
clutter_backend_real_init_events (ClutterBackend *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");
|
||||
g_error ("Unknown input backend");
|
||||
}
|
||||
|
||||
static ClutterDeviceManager *
|
||||
@@ -586,34 +552,6 @@ 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)
|
||||
{
|
||||
@@ -636,8 +574,7 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterBackendClass, resolution_changed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -654,8 +591,7 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterBackendClass, font_changed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -672,8 +608,7 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterBackendClass, settings_changed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
klass->resolution_changed = clutter_backend_real_resolution_changed;
|
||||
@@ -681,7 +616,6 @@ 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;
|
||||
@@ -693,7 +627,7 @@ clutter_backend_init (ClutterBackend *self)
|
||||
self->units_per_em = -1.0;
|
||||
self->units_serial = 1;
|
||||
|
||||
self->dummy_onscreen = COGL_INVALID_HANDLE;
|
||||
self->dummy_onscreen = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -761,6 +695,10 @@ _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;
|
||||
}
|
||||
|
||||
@@ -845,37 +783,24 @@ _clutter_backend_copy_event_data (ClutterBackend *backend,
|
||||
const ClutterEvent *src,
|
||||
ClutterEvent *dest)
|
||||
{
|
||||
ClutterEventExtenderInterface *iface;
|
||||
ClutterBackendClass *klass;
|
||||
ClutterDeviceManagerClass *device_manager_class;
|
||||
ClutterDeviceManager *device_manager;
|
||||
|
||||
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);
|
||||
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);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_backend_free_event_data (ClutterBackend *backend,
|
||||
ClutterEvent *event)
|
||||
{
|
||||
ClutterEventExtenderInterface *iface;
|
||||
ClutterBackendClass *klass;
|
||||
ClutterDeviceManagerClass *device_manager_class;
|
||||
ClutterDeviceManager *device_manager;
|
||||
|
||||
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);
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1021,28 +946,6 @@ _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
|
||||
@@ -1109,7 +1012,7 @@ _clutter_backend_get_keymap_direction (ClutterBackend *backend)
|
||||
void
|
||||
_clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
|
||||
{
|
||||
if (backend->dummy_onscreen == COGL_INVALID_HANDLE)
|
||||
if (backend->dummy_onscreen == NULL)
|
||||
{
|
||||
GError *internal_error = NULL;
|
||||
|
||||
@@ -1190,3 +1093,9 @@ 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;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -152,7 +152,9 @@ clutter_bind_constraint_update_allocation (ClutterConstraint *constraint,
|
||||
ClutterBindConstraint *bind = CLUTTER_BIND_CONSTRAINT (constraint);
|
||||
gfloat source_width, source_height;
|
||||
gfloat actor_width, actor_height;
|
||||
ClutterVertex source_position = { 0., };
|
||||
graphene_point3d_t source_position;
|
||||
|
||||
source_position = GRAPHENE_POINT3D_INIT (0.f, 0.f, 0.f);
|
||||
|
||||
if (bind->source == NULL)
|
||||
return;
|
||||
|
@@ -182,7 +182,7 @@ clutter_blur_effect_modify_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
gfloat cur_width, cur_height;
|
||||
ClutterVertex origin;
|
||||
graphene_point3d_t origin;
|
||||
|
||||
clutter_paint_volume_get_origin (volume, &origin);
|
||||
cur_width = clutter_paint_volume_get_width (volume);
|
||||
|
@@ -666,8 +666,7 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterClickActionClass, clicked),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
|
@@ -118,37 +118,6 @@ 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,
|
||||
@@ -197,8 +166,7 @@ clutter_container_default_init (ClutterContainerInterface *iface)
|
||||
iface_type,
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContainerIface, actor_added),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
/**
|
||||
@@ -216,8 +184,7 @@ clutter_container_default_init (ClutterContainerInterface *iface)
|
||||
iface_type,
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContainerIface, actor_removed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@@ -245,7 +212,6 @@ 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;
|
||||
@@ -535,15 +501,6 @@ 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
|
||||
@@ -561,108 +518,9 @@ get_children_cb (ClutterActor *child,
|
||||
GList *
|
||||
clutter_container_get_children (ClutterContainer *container)
|
||||
{
|
||||
GList *retval;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_CONTAINER (container), NULL);
|
||||
|
||||
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);
|
||||
return clutter_actor_get_children (CLUTTER_ACTOR (container));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -59,14 +59,6 @@ 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
|
||||
@@ -88,7 +80,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, @remove and @foreach
|
||||
* Base interface for container actors. The @add and @remove
|
||||
* virtual functions must be provided by any implementation; the other
|
||||
* virtual functions are optional.
|
||||
*
|
||||
@@ -104,13 +96,6 @@ 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,8 +129,7 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
||||
G_TYPE_FROM_INTERFACE (iface),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContentInterface, attached),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@@ -149,8 +148,7 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
||||
G_TYPE_FROM_INTERFACE (iface),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContentInterface, detached),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
}
|
||||
|
@@ -30,7 +30,6 @@ typedef enum
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_DEBUG_NOP_PICKING = 1 << 0,
|
||||
CLUTTER_DEBUG_DUMP_PICK_BUFFERS = 1 << 1
|
||||
} ClutterPickDebugFlag;
|
||||
|
||||
typedef enum
|
||||
|
@@ -177,7 +177,7 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
|
||||
if (priv->is_dirty)
|
||||
{
|
||||
ClutterRect rect;
|
||||
graphene_rect_t 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 = clutter_rect_get_width (&rect);
|
||||
height = clutter_rect_get_height (&rect);
|
||||
width = graphene_rect_get_width (&rect);
|
||||
height = graphene_rect_get_height (&rect);
|
||||
}
|
||||
else
|
||||
clutter_actor_get_size (actor, &width, &height);
|
||||
|
@@ -80,6 +80,7 @@ typedef struct _ClutterPtrA11yData
|
||||
gboolean dwell_drag_started;
|
||||
gboolean dwell_gesture_started;
|
||||
guint dwell_timer;
|
||||
guint dwell_position_timer;
|
||||
|
||||
guint secondary_click_timer;
|
||||
gboolean secondary_click_triggered;
|
||||
@@ -193,34 +194,15 @@ struct _ClutterInputDeviceClass
|
||||
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);
|
||||
@@ -228,25 +210,35 @@ 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,
|
||||
@@ -255,44 +247,57 @@ 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);
|
||||
|
||||
|
@@ -91,22 +91,14 @@ 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)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv = CLUTTER_DEVICE_MANAGER (gobject)->priv;
|
||||
ClutterDeviceManager *self = CLUTTER_DEVICE_MANAGER (gobject);
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (self);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
@@ -125,7 +117,8 @@ clutter_device_manager_get_property (GObject *gobject,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv = CLUTTER_DEVICE_MANAGER (gobject)->priv;
|
||||
ClutterDeviceManager *self = CLUTTER_DEVICE_MANAGER (gobject);
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (self);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
@@ -171,8 +164,7 @@ clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_INPUT_DEVICE);
|
||||
|
||||
@@ -191,8 +183,7 @@ clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_INPUT_DEVICE);
|
||||
|
||||
@@ -291,6 +282,7 @@ clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
|
||||
* @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
|
||||
@@ -302,16 +294,16 @@ clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT_FLAGS,
|
||||
G_TYPE_NONE, 2,
|
||||
_clutter_marshal_VOID__OBJECT_FLAGS_BOOLEAN,
|
||||
G_TYPE_NONE, 3,
|
||||
CLUTTER_TYPE_INPUT_DEVICE,
|
||||
CLUTTER_TYPE_POINTER_A11Y_TIMEOUT_TYPE);
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -330,7 +322,7 @@ clutter_device_manager_get_default (void)
|
||||
{
|
||||
ClutterBackend *backend = clutter_get_default_backend ();
|
||||
|
||||
return backend->device_manager;
|
||||
return CLUTTER_BACKEND_GET_CLASS (backend)->get_device_manager (backend);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -554,9 +546,11 @@ _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 manager->priv->backend;
|
||||
return priv->backend;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -613,6 +607,20 @@ _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)
|
||||
@@ -625,13 +633,14 @@ 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 (&device_manager->priv->kbd_a11y_settings, settings))
|
||||
if (are_kbd_a11y_settings_equal (&priv->kbd_a11y_settings, settings))
|
||||
return;
|
||||
|
||||
device_manager->priv->kbd_a11y_settings = *settings;
|
||||
priv->kbd_a11y_settings = *settings;
|
||||
|
||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
if (manager_class->apply_kbd_a11y_settings)
|
||||
@@ -642,9 +651,11 @@ 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 = device_manager->priv->kbd_a11y_settings;
|
||||
*settings = priv->kbd_a11y_settings;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -687,17 +698,20 @@ 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 (&device_manager->priv->pointer_a11y_settings, settings))
|
||||
if (are_pointer_a11y_settings_equal (&priv->pointer_a11y_settings, settings))
|
||||
return;
|
||||
|
||||
if (device_manager->priv->pointer_a11y_settings.controls == 0 && settings->controls != 0)
|
||||
if (priv->pointer_a11y_settings.controls == 0 && settings->controls != 0)
|
||||
clutter_device_manager_enable_pointer_a11y (device_manager);
|
||||
else if (device_manager->priv->pointer_a11y_settings.controls != 0 && settings->controls == 0)
|
||||
else if (priv->pointer_a11y_settings.controls != 0 && settings->controls == 0)
|
||||
clutter_device_manager_disable_pointer_a11y (device_manager);
|
||||
|
||||
device_manager->priv->pointer_a11y_settings = *settings;
|
||||
priv->pointer_a11y_settings = *settings;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -711,9 +725,12 @@ 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 = device_manager->priv->pointer_a11y_settings;
|
||||
*settings = priv->pointer_a11y_settings;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -727,7 +744,10 @@ 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));
|
||||
|
||||
device_manager->priv->pointer_a11y_settings.dwell_click_type = click_type;
|
||||
priv->pointer_a11y_settings.dwell_click_type = click_type;
|
||||
}
|
||||
|
@@ -33,16 +33,12 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#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))
|
||||
#define CLUTTER_TYPE_DEVICE_MANAGER (clutter_device_manager_get_type ())
|
||||
CLUTTER_EXPORT
|
||||
G_DECLARE_DERIVABLE_TYPE (ClutterDeviceManager, clutter_device_manager,
|
||||
CLUTTER, DEVICE_MANAGER, GObject)
|
||||
|
||||
typedef struct _ClutterDeviceManager ClutterDeviceManager;
|
||||
typedef struct _ClutterDeviceManagerPrivate ClutterDeviceManagerPrivate;
|
||||
typedef struct _ClutterDeviceManagerClass ClutterDeviceManagerClass;
|
||||
|
||||
/**
|
||||
* ClutterVirtualDeviceType:
|
||||
@@ -94,21 +90,6 @@ typedef struct _ClutterPointerA11ySettings
|
||||
gint dwell_threshold;
|
||||
} ClutterPointerA11ySettings;
|
||||
|
||||
/**
|
||||
* ClutterDeviceManager:
|
||||
*
|
||||
* The #ClutterDeviceManager structure contains only private data
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
struct _ClutterDeviceManager
|
||||
{
|
||||
/*< private >*/
|
||||
GObject parent_instance;
|
||||
|
||||
ClutterDeviceManagerPrivate *priv;
|
||||
};
|
||||
|
||||
/**
|
||||
* ClutterDeviceManagerClass:
|
||||
*
|
||||
@@ -142,12 +123,17 @@ struct _ClutterDeviceManagerClass
|
||||
/* Keyboard accessbility */
|
||||
void (* apply_kbd_a11y_settings) (ClutterDeviceManager *device_manger,
|
||||
ClutterKbdA11ySettings *settings);
|
||||
/* padding */
|
||||
gpointer _padding[6];
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_device_manager_get_type (void) G_GNUC_CONST;
|
||||
/* 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];
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterDeviceManager *clutter_device_manager_get_default (void);
|
||||
|
@@ -81,7 +81,7 @@ struct _ClutterDragActionPrivate
|
||||
gint y_drag_threshold;
|
||||
ClutterActor *drag_handle;
|
||||
ClutterDragAxis drag_axis;
|
||||
ClutterRect drag_area;
|
||||
graphene_rect_t drag_area;
|
||||
|
||||
ClutterInputDevice *device;
|
||||
ClutterEventSequence *sequence;
|
||||
@@ -542,7 +542,7 @@ clutter_drag_action_real_drag_motion (ClutterDragAction *action,
|
||||
|
||||
if (action->priv->drag_area_set)
|
||||
{
|
||||
ClutterRect *drag_area = &action->priv->drag_area;
|
||||
graphene_rect_t *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"),
|
||||
CLUTTER_TYPE_RECT,
|
||||
GRAPHENE_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 #ClutterRect to be filled
|
||||
* @drag_area: (out caller-allocates): a #graphene_rect_t to be filled
|
||||
*
|
||||
* Retrieves the "drag area" associated with @action, that
|
||||
* is a #ClutterRect that constrains the actor movements,
|
||||
* is a #graphene_rect_t 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,
|
||||
ClutterRect *drag_area)
|
||||
graphene_rect_t *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 ClutterRect *drag_area)
|
||||
clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const graphene_rect_t *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,
|
||||
ClutterRect *drag_area);
|
||||
graphene_rect_t *drag_area);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const ClutterRect *drag_area);
|
||||
void clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const graphene_rect_t *drag_area);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -428,8 +428,7 @@ clutter_drop_action_class_init (ClutterDropActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterDropActionClass, over_in),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@@ -448,8 +447,7 @@ clutter_drop_action_class_init (ClutterDropActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterDropActionClass, over_out),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
|
@@ -100,13 +100,13 @@
|
||||
* // Clear the previous state //
|
||||
* if (self->rect_1)
|
||||
* {
|
||||
* cogl_handle_unref (self->rect_1);
|
||||
* cogl_object_unref (self->rect_1);
|
||||
* self->rect_1 = NULL;
|
||||
* }
|
||||
*
|
||||
* if (self->rect_2)
|
||||
* {
|
||||
* cogl_handle_unref (self->rect_2);
|
||||
* cogl_object_unref (self->rect_2);
|
||||
* self->rect_2 = NULL;
|
||||
* }
|
||||
*
|
||||
|
@@ -5,22 +5,28 @@
|
||||
|
||||
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,
|
||||
@@ -28,6 +34,7 @@ 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);
|
||||
|
||||
|
@@ -1,38 +0,0 @@
|
||||
#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);
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
#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)
|
||||
{
|
||||
ClutterPoint coords;
|
||||
graphene_point_t 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 #ClutterPoint
|
||||
* @position: a #graphene_point_t
|
||||
*
|
||||
* Retrieves the event coordinates as a #ClutterPoint.
|
||||
* Retrieves the event coordinates as a #graphene_point_t.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
void
|
||||
clutter_event_get_position (const ClutterEvent *event,
|
||||
ClutterPoint *position)
|
||||
graphene_point_t *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:
|
||||
clutter_point_init (position, 0.f, 0.f);
|
||||
graphene_point_init (position, 0.f, 0.f);
|
||||
break;
|
||||
|
||||
case CLUTTER_ENTER:
|
||||
case CLUTTER_LEAVE:
|
||||
clutter_point_init (position, event->crossing.x, event->crossing.y);
|
||||
graphene_point_init (position, event->crossing.x, event->crossing.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
clutter_point_init (position, event->button.x, event->button.y);
|
||||
graphene_point_init (position, event->button.x, event->button.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_MOTION:
|
||||
clutter_point_init (position, event->motion.x, event->motion.y);
|
||||
graphene_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:
|
||||
clutter_point_init (position, event->touch.x, event->touch.y);
|
||||
graphene_point_init (position, event->touch.x, event->touch.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_SCROLL:
|
||||
clutter_point_init (position, event->scroll.x, event->scroll.y);
|
||||
graphene_point_init (position, event->scroll.x, event->scroll.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCHPAD_PINCH:
|
||||
clutter_point_init (position, event->touchpad_pinch.x,
|
||||
event->touchpad_pinch.y);
|
||||
graphene_point_init (position, event->touchpad_pinch.x,
|
||||
event->touchpad_pinch.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCHPAD_SWIPE:
|
||||
clutter_point_init (position, event->touchpad_swipe.x,
|
||||
event->touchpad_swipe.y);
|
||||
graphene_point_init (position, event->touchpad_swipe.x,
|
||||
event->touchpad_swipe.y);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1796,12 +1796,12 @@ float
|
||||
clutter_event_get_distance (const ClutterEvent *source,
|
||||
const ClutterEvent *target)
|
||||
{
|
||||
ClutterPoint p0, p1;
|
||||
graphene_point_t p0, p1;
|
||||
|
||||
clutter_event_get_position (source, &p0);
|
||||
clutter_event_get_position (source, &p1);
|
||||
|
||||
return clutter_point_distance (&p0, &p1, NULL, NULL);
|
||||
return graphene_point_distance (&p0, &p1, NULL, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1822,17 +1822,17 @@ double
|
||||
clutter_event_get_angle (const ClutterEvent *source,
|
||||
const ClutterEvent *target)
|
||||
{
|
||||
ClutterPoint p0, p1;
|
||||
graphene_point_t p0, p1;
|
||||
float x_distance, y_distance;
|
||||
double angle;
|
||||
|
||||
clutter_event_get_position (source, &p0);
|
||||
clutter_event_get_position (target, &p1);
|
||||
|
||||
if (clutter_point_equals (&p0, &p1))
|
||||
if (graphene_point_equal (&p0, &p1))
|
||||
return 0;
|
||||
|
||||
clutter_point_distance (&p0, &p1, &x_distance, &y_distance);
|
||||
graphene_point_distance (&p0, &p1, &x_distance, &y_distance);
|
||||
|
||||
angle = atan2 (x_distance, y_distance);
|
||||
|
||||
|
@@ -686,7 +686,7 @@ void clutter_event_get_coords (const ClutterEv
|
||||
gfloat *y);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_event_get_position (const ClutterEvent *event,
|
||||
ClutterPoint *position);
|
||||
graphene_point_t *position);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_event_get_distance (const ClutterEvent *source,
|
||||
const ClutterEvent *target);
|
||||
|
@@ -804,8 +804,7 @@ clutter_gesture_action_class_init (ClutterGestureActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterGestureActionClass, gesture_end),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@@ -827,8 +826,7 @@ clutter_gesture_action_class_init (ClutterGestureActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterGestureActionClass, gesture_cancel),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
}
|
||||
|
111
clutter/clutter/clutter-graphene.c
Normal file
111
clutter/clutter/clutter-graphene.c
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* 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);
|
||||
}
|
30
clutter/clutter/clutter-graphene.h
Normal file
30
clutter/clutter/clutter-graphene.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#ifndef CLUTTER_GRAPHENE_H
|
||||
#define CLUTTER_GRAPHENE_H
|
||||
|
||||
void clutter_graphene_init (void);
|
||||
|
||||
#endif
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -991,7 +991,7 @@ clutter_input_device_get_enabled (ClutterInputDevice *device)
|
||||
gboolean
|
||||
clutter_input_device_get_coords (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
ClutterPoint *point)
|
||||
graphene_point_t *point)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
||||
g_return_val_if_fail (point != NULL, FALSE);
|
||||
@@ -1038,7 +1038,7 @@ _clutter_input_device_update (ClutterInputDevice *device,
|
||||
ClutterStage *stage;
|
||||
ClutterActor *new_cursor_actor;
|
||||
ClutterActor *old_cursor_actor;
|
||||
ClutterPoint point = { -1, -1 };
|
||||
graphene_point_t point = GRAPHENE_POINT_INIT (-1.0f, -1.0f);
|
||||
ClutterInputDeviceType device_type = device->device_type;
|
||||
|
||||
g_assert (device_type != CLUTTER_KEYBOARD_DEVICE &&
|
||||
@@ -1925,6 +1925,157 @@ _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)
|
||||
|
@@ -58,7 +58,7 @@ gint clutter_input_device_get_device_id (ClutterInputDev
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_input_device_get_coords (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
ClutterPoint *point);
|
||||
graphene_point_t *point);
|
||||
CLUTTER_EXPORT
|
||||
ClutterModifierType clutter_input_device_get_modifier_state (ClutterInputDevice *device);
|
||||
CLUTTER_EXPORT
|
||||
|
@@ -89,8 +89,8 @@ clutter_input_focus_reset (ClutterInputFocus *focus)
|
||||
}
|
||||
|
||||
void
|
||||
clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const ClutterRect *rect)
|
||||
clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const graphene_rect_t *rect)
|
||||
{
|
||||
ClutterInputFocusPrivate *priv;
|
||||
|
||||
|
@@ -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 ClutterRect *rect);
|
||||
void clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const graphene_rect_t *rect);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_focus_set_surrounding (ClutterInputFocus *focus,
|
||||
|
@@ -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 ClutterRect *rect);
|
||||
void clutter_input_method_set_cursor_location (ClutterInputMethod *method,
|
||||
const graphene_rect_t *rect);
|
||||
void clutter_input_method_set_surrounding (ClutterInputMethod *method,
|
||||
const gchar *text,
|
||||
guint cursor,
|
||||
|
@@ -187,7 +187,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, CLUTTER_TYPE_RECT);
|
||||
G_TYPE_NONE, 1, GRAPHENE_TYPE_RECT);
|
||||
|
||||
pspecs[PROP_CONTENT_HINTS] =
|
||||
g_param_spec_flags ("content-hints",
|
||||
@@ -377,8 +377,8 @@ clutter_input_method_reset (ClutterInputMethod *im)
|
||||
}
|
||||
|
||||
void
|
||||
clutter_input_method_set_cursor_location (ClutterInputMethod *im,
|
||||
const ClutterRect *rect)
|
||||
clutter_input_method_set_cursor_location (ClutterInputMethod *im,
|
||||
const graphene_rect_t *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 ClutterRect *rect);
|
||||
void (* set_cursor_location) (ClutterInputMethod *im,
|
||||
const graphene_rect_t *rect);
|
||||
void (* set_surrounding) (ClutterInputMethod *im,
|
||||
const gchar *text,
|
||||
guint cursor,
|
||||
|
@@ -27,14 +27,19 @@
|
||||
|
||||
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
|
||||
|
@@ -99,7 +99,7 @@ get_dwell_click_type (ClutterInputDevice *device)
|
||||
ClutterPointerA11ySettings settings;
|
||||
|
||||
clutter_device_manager_get_pointer_a11y_settings (device->device_manager, &settings);
|
||||
#
|
||||
|
||||
return settings.dwell_click_type;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,8 @@ trigger_secondary_click (gpointer data)
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK);
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
TRUE);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
@@ -202,7 +203,8 @@ stop_secondary_click_timeout (ClutterInputDevice *device)
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK);
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
FALSE);
|
||||
}
|
||||
device->ptr_a11y_data->secondary_click_triggered = FALSE;
|
||||
}
|
||||
@@ -438,7 +440,8 @@ trigger_dwell_gesture (gpointer data)
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE);
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
||||
TRUE);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
@@ -469,7 +472,8 @@ trigger_dwell_click (gpointer data)
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL);
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
TRUE);
|
||||
|
||||
if (get_dwell_mode (device) == CLUTTER_A11Y_DWELL_MODE_GESTURE)
|
||||
{
|
||||
@@ -514,10 +518,41 @@ stop_dwell_timeout (ClutterInputDevice *device)
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL);
|
||||
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)
|
||||
{
|
||||
@@ -570,6 +605,7 @@ _clutter_input_pointer_a11y_remove_device (ClutterInputDevice *device)
|
||||
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);
|
||||
|
||||
@@ -597,10 +633,13 @@ _clutter_input_pointer_a11y_on_motion_event (ClutterInputDevice *device,
|
||||
|
||||
if (is_dwell_click_enabled (device))
|
||||
{
|
||||
stop_dwell_position_timeout (device);
|
||||
|
||||
if (should_stop_dwell (device))
|
||||
stop_dwell_timeout (device);
|
||||
else if (should_start_dwell (device))
|
||||
start_dwell_timeout (device);
|
||||
|
||||
if (should_start_dwell (device))
|
||||
start_dwell_position_timeout (device);
|
||||
}
|
||||
|
||||
if (should_update_dwell_position (device))
|
||||
@@ -622,6 +661,8 @@ _clutter_input_pointer_a11y_on_button_event (ClutterInputDevice *device,
|
||||
{
|
||||
device->ptr_a11y_data->n_btn_pressed++;
|
||||
|
||||
stop_dwell_position_timeout (device);
|
||||
|
||||
if (is_dwell_click_enabled (device))
|
||||
stop_dwell_timeout (device);
|
||||
|
||||
|
@@ -444,8 +444,7 @@ clutter_layout_manager_class_init (ClutterLayoutManagerClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterLayoutManagerClass,
|
||||
layout_changed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
|
@@ -59,6 +59,7 @@
|
||||
#include "clutter-event-private.h"
|
||||
#include "clutter-feature.h"
|
||||
#include "clutter-input-pointer-a11y-private.h"
|
||||
#include "clutter-graphene.h"
|
||||
#include "clutter-main.h"
|
||||
#include "clutter-master-clock.h"
|
||||
#include "clutter-mutter.h"
|
||||
@@ -129,7 +130,6 @@ static const GDebugKey clutter_debug_keys[] = {
|
||||
|
||||
static const GDebugKey clutter_pick_debug_keys[] = {
|
||||
{ "nop-picking", CLUTTER_DEBUG_NOP_PICKING },
|
||||
{ "dump-pick-buffers", CLUTTER_DEBUG_DUMP_PICK_BUFFERS },
|
||||
};
|
||||
|
||||
static const GDebugKey clutter_paint_debug_keys[] = {
|
||||
@@ -401,125 +401,6 @@ clutter_disable_accessibility (void)
|
||||
clutter_enable_accessibility = FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_id_to_color (guint id_,
|
||||
ClutterColor *col)
|
||||
{
|
||||
ClutterMainContext *ctx;
|
||||
gint red, green, blue;
|
||||
|
||||
ctx = _clutter_context_get_default ();
|
||||
|
||||
if (ctx->fb_g_mask == 0)
|
||||
{
|
||||
/* Figure out framebuffer masks used for pick */
|
||||
cogl_get_bitmasks (&ctx->fb_r_mask,
|
||||
&ctx->fb_g_mask,
|
||||
&ctx->fb_b_mask, NULL);
|
||||
|
||||
ctx->fb_r_mask_used = ctx->fb_r_mask;
|
||||
ctx->fb_g_mask_used = ctx->fb_g_mask;
|
||||
ctx->fb_b_mask_used = ctx->fb_b_mask;
|
||||
|
||||
/* XXX - describe what "fuzzy picking" is */
|
||||
if (clutter_use_fuzzy_picking)
|
||||
{
|
||||
ctx->fb_r_mask_used--;
|
||||
ctx->fb_g_mask_used--;
|
||||
ctx->fb_b_mask_used--;
|
||||
}
|
||||
}
|
||||
|
||||
/* compute the numbers we'll store in the components */
|
||||
red = (id_ >> (ctx->fb_g_mask_used+ctx->fb_b_mask_used))
|
||||
& (0xff >> (8-ctx->fb_r_mask_used));
|
||||
green = (id_ >> ctx->fb_b_mask_used)
|
||||
& (0xff >> (8-ctx->fb_g_mask_used));
|
||||
blue = (id_)
|
||||
& (0xff >> (8-ctx->fb_b_mask_used));
|
||||
|
||||
/* shift left bits a bit and add one, this circumvents
|
||||
* at least some potential rounding errors in GL/GLES
|
||||
* driver / hw implementation.
|
||||
*/
|
||||
if (ctx->fb_r_mask_used != ctx->fb_r_mask)
|
||||
red = red * 2;
|
||||
if (ctx->fb_g_mask_used != ctx->fb_g_mask)
|
||||
green = green * 2;
|
||||
if (ctx->fb_b_mask_used != ctx->fb_b_mask)
|
||||
blue = blue * 2;
|
||||
|
||||
/* shift up to be full 8bit values */
|
||||
red = (red << (8 - ctx->fb_r_mask)) | (0x7f >> (ctx->fb_r_mask_used));
|
||||
green = (green << (8 - ctx->fb_g_mask)) | (0x7f >> (ctx->fb_g_mask_used));
|
||||
blue = (blue << (8 - ctx->fb_b_mask)) | (0x7f >> (ctx->fb_b_mask_used));
|
||||
|
||||
col->red = red;
|
||||
col->green = green;
|
||||
col->blue = blue;
|
||||
col->alpha = 0xff;
|
||||
|
||||
/* XXX: We rotate the nibbles of the colors here so that there is a
|
||||
* visible variation between colors of sequential actor identifiers;
|
||||
* otherwise pick buffers dumped to an image will pretty much just look
|
||||
* black.
|
||||
*/
|
||||
if (G_UNLIKELY (clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS))
|
||||
{
|
||||
col->red = (col->red << 4) | (col->red >> 4);
|
||||
col->green = (col->green << 4) | (col->green >> 4);
|
||||
col->blue = (col->blue << 4) | (col->blue >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
guint
|
||||
_clutter_pixel_to_id (guchar pixel[4])
|
||||
{
|
||||
ClutterMainContext *ctx;
|
||||
gint red, green, blue;
|
||||
guint retval;
|
||||
|
||||
ctx = _clutter_context_get_default ();
|
||||
|
||||
/* reduce the pixel components to the number of bits actually used of the
|
||||
* 8bits.
|
||||
*/
|
||||
if (G_UNLIKELY (clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS))
|
||||
{
|
||||
guchar tmp;
|
||||
|
||||
/* XXX: In _clutter_id_to_color we rotated the nibbles of the colors so
|
||||
* that there is a visible variation between colors of sequential actor
|
||||
* identifiers (otherwise pick buffers dumped to an image will pretty
|
||||
* much just look black.) Here we reverse that rotation.
|
||||
*/
|
||||
tmp = ((pixel[0] << 4) | (pixel[0] >> 4));
|
||||
red = tmp >> (8 - ctx->fb_r_mask);
|
||||
tmp = ((pixel[1] << 4) | (pixel[1] >> 4));
|
||||
green = tmp >> (8 - ctx->fb_g_mask);
|
||||
tmp = ((pixel[2] << 4) | (pixel[2] >> 4));
|
||||
blue = tmp >> (8 - ctx->fb_b_mask);
|
||||
}
|
||||
else
|
||||
{
|
||||
red = pixel[0] >> (8 - ctx->fb_r_mask);
|
||||
green = pixel[1] >> (8 - ctx->fb_g_mask);
|
||||
blue = pixel[2] >> (8 - ctx->fb_b_mask);
|
||||
}
|
||||
|
||||
/* divide potentially by two if 'fuzzy' */
|
||||
red = red >> (ctx->fb_r_mask - ctx->fb_r_mask_used);
|
||||
green = green >> (ctx->fb_g_mask - ctx->fb_g_mask_used);
|
||||
blue = blue >> (ctx->fb_b_mask - ctx->fb_b_mask_used);
|
||||
|
||||
/* combine the correct per component values into the final id */
|
||||
retval = blue
|
||||
+ (green << ctx->fb_b_mask_used)
|
||||
+ (red << (ctx->fb_b_mask_used + ctx->fb_g_mask_used));
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static CoglPangoFontMap *
|
||||
clutter_context_get_pango_fontmap (void)
|
||||
{
|
||||
@@ -1279,8 +1160,8 @@ clutter_get_option_group (void)
|
||||
context = _clutter_context_get_default ();
|
||||
|
||||
group = g_option_group_new ("clutter",
|
||||
_("Clutter Options"),
|
||||
_("Show Clutter Options"),
|
||||
"Clutter Options",
|
||||
"Show Clutter Options",
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
@@ -1701,37 +1582,19 @@ static inline void
|
||||
emit_pointer_event (ClutterEvent *event,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
ClutterMainContext *context = _clutter_context_get_default ();
|
||||
|
||||
if (_clutter_event_process_filters (event))
|
||||
return;
|
||||
|
||||
if (context->pointer_grab_actor == NULL &&
|
||||
(device == NULL || device->pointer_grab_actor == NULL))
|
||||
{
|
||||
/* no grab, time to capture and bubble */
|
||||
emit_event_chain (event);
|
||||
}
|
||||
if (device != NULL && device->pointer_grab_actor != NULL)
|
||||
clutter_actor_event (device->pointer_grab_actor, event, FALSE);
|
||||
else
|
||||
{
|
||||
if (context->pointer_grab_actor != NULL)
|
||||
{
|
||||
/* global grab */
|
||||
clutter_actor_event (context->pointer_grab_actor, event, FALSE);
|
||||
}
|
||||
else if (device != NULL && device->pointer_grab_actor != NULL)
|
||||
{
|
||||
/* per device grab */
|
||||
clutter_actor_event (device->pointer_grab_actor, event, FALSE);
|
||||
}
|
||||
}
|
||||
emit_event_chain (event);
|
||||
}
|
||||
|
||||
static inline void
|
||||
emit_crossing_event (ClutterEvent *event,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
ClutterMainContext *context = _clutter_context_get_default ();
|
||||
ClutterEventSequence *sequence = clutter_event_get_event_sequence (event);
|
||||
ClutterActor *grab_actor = NULL;
|
||||
|
||||
@@ -1745,9 +1608,7 @@ emit_crossing_event (ClutterEvent *event,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (context->pointer_grab_actor != NULL)
|
||||
grab_actor = context->pointer_grab_actor;
|
||||
else if (device != NULL && device->pointer_grab_actor != NULL)
|
||||
if (device != NULL && device->pointer_grab_actor != NULL)
|
||||
grab_actor = device->pointer_grab_actor;
|
||||
}
|
||||
|
||||
@@ -1788,30 +1649,13 @@ static inline void
|
||||
emit_keyboard_event (ClutterEvent *event,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
ClutterMainContext *context = _clutter_context_get_default ();
|
||||
|
||||
if (_clutter_event_process_filters (event))
|
||||
return;
|
||||
|
||||
if (context->keyboard_grab_actor == NULL &&
|
||||
(device == NULL || device->keyboard_grab_actor == NULL))
|
||||
{
|
||||
/* no grab, time to capture and bubble */
|
||||
emit_event_chain (event);
|
||||
}
|
||||
if (device != NULL && device->keyboard_grab_actor != NULL)
|
||||
clutter_actor_event (device->keyboard_grab_actor, event, FALSE);
|
||||
else
|
||||
{
|
||||
if (context->keyboard_grab_actor != NULL)
|
||||
{
|
||||
/* global key grab */
|
||||
clutter_actor_event (context->keyboard_grab_actor, event, FALSE);
|
||||
}
|
||||
else if (device != NULL && device->keyboard_grab_actor != NULL)
|
||||
{
|
||||
/* per-device key grab */
|
||||
clutter_actor_event (context->keyboard_grab_actor, event, FALSE);
|
||||
}
|
||||
}
|
||||
emit_event_chain (event);
|
||||
}
|
||||
|
||||
static inline void
|
||||
@@ -1985,7 +1829,8 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
|
||||
case CLUTTER_MOTION:
|
||||
#ifdef CLUTTER_WINDOWING_X11
|
||||
if (!clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
|
||||
if (!clutter_check_windowing_backend (CLUTTER_WINDOWING_X11) &&
|
||||
!(event->any.flags & CLUTTER_EVENT_FLAG_SYNTHETIC))
|
||||
{
|
||||
if (_clutter_is_input_pointer_a11y_enabled (device))
|
||||
{
|
||||
@@ -2009,15 +1854,7 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
if (_clutter_event_process_filters (event))
|
||||
break;
|
||||
|
||||
/* global grabs */
|
||||
if (context->pointer_grab_actor != NULL)
|
||||
{
|
||||
clutter_actor_event (context->pointer_grab_actor,
|
||||
event,
|
||||
FALSE);
|
||||
break;
|
||||
}
|
||||
else if (device != NULL && device->pointer_grab_actor != NULL)
|
||||
if (device != NULL && device->pointer_grab_actor != NULL)
|
||||
{
|
||||
clutter_actor_event (device->pointer_grab_actor,
|
||||
event,
|
||||
@@ -2358,6 +2195,8 @@ clutter_base_init (void)
|
||||
|
||||
/* initialise the Big Clutter Lock™ if necessary */
|
||||
clutter_threads_init_default ();
|
||||
|
||||
clutter_graphene_init ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2380,332 +2219,6 @@ clutter_get_default_frame_rate (void)
|
||||
return context->frame_rate;
|
||||
}
|
||||
|
||||
static void
|
||||
on_grab_actor_destroy (ClutterActor *actor,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
if (device == NULL)
|
||||
{
|
||||
ClutterMainContext *context = _clutter_context_get_default ();
|
||||
|
||||
if (context->pointer_grab_actor == actor)
|
||||
clutter_ungrab_pointer ();
|
||||
|
||||
if (context->keyboard_grab_actor == actor)
|
||||
clutter_ungrab_keyboard ();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
switch (device->device_type)
|
||||
{
|
||||
case CLUTTER_POINTER_DEVICE:
|
||||
device->pointer_grab_actor = NULL;
|
||||
break;
|
||||
|
||||
case CLUTTER_KEYBOARD_DEVICE:
|
||||
device->keyboard_grab_actor = NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_grab_pointer:
|
||||
* @actor: a #ClutterActor
|
||||
*
|
||||
* Grabs pointer events, after the grab is done all pointer related events
|
||||
* (press, motion, release, enter, leave and scroll) are delivered to this
|
||||
* actor directly without passing through both capture and bubble phases of
|
||||
* the event delivery chain. The source set in the event will be the actor
|
||||
* that would have received the event if the pointer grab was not in effect.
|
||||
*
|
||||
* Grabs completely override the entire event delivery chain
|
||||
* done by Clutter. Pointer grabs should only be used as a last resource;
|
||||
* using the #ClutterActor::captured-event signal should always be the
|
||||
* preferred way to intercept event delivery to reactive actors.
|
||||
*
|
||||
* This function should rarely be used.
|
||||
*
|
||||
* If a grab is required, you are strongly encouraged to use a specific
|
||||
* input device by calling clutter_input_device_grab().
|
||||
*
|
||||
* Since: 0.6
|
||||
*/
|
||||
void
|
||||
clutter_grab_pointer (ClutterActor *actor)
|
||||
{
|
||||
ClutterMainContext *context;
|
||||
|
||||
g_return_if_fail (actor == NULL || CLUTTER_IS_ACTOR (actor));
|
||||
|
||||
context = _clutter_context_get_default ();
|
||||
|
||||
if (context->pointer_grab_actor == actor)
|
||||
return;
|
||||
|
||||
if (context->pointer_grab_actor != NULL)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (context->pointer_grab_actor,
|
||||
G_CALLBACK (on_grab_actor_destroy),
|
||||
NULL);
|
||||
context->pointer_grab_actor = NULL;
|
||||
}
|
||||
|
||||
if (actor != NULL)
|
||||
{
|
||||
context->pointer_grab_actor = actor;
|
||||
|
||||
g_signal_connect (context->pointer_grab_actor, "destroy",
|
||||
G_CALLBACK (on_grab_actor_destroy),
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 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:
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_ungrab_pointer:
|
||||
*
|
||||
* Removes an existing grab of the pointer.
|
||||
*
|
||||
* Since: 0.6
|
||||
*/
|
||||
void
|
||||
clutter_ungrab_pointer (void)
|
||||
{
|
||||
clutter_grab_pointer (NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_pointer_grab:
|
||||
*
|
||||
* Queries the current pointer grab of clutter.
|
||||
*
|
||||
* Return value: (transfer none): the actor currently holding the pointer grab, or NULL if there is no grab.
|
||||
*
|
||||
* Since: 0.6
|
||||
*/
|
||||
ClutterActor *
|
||||
clutter_get_pointer_grab (void)
|
||||
{
|
||||
ClutterMainContext *context;
|
||||
context = _clutter_context_get_default ();
|
||||
|
||||
return context->pointer_grab_actor;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* clutter_grab_keyboard:
|
||||
* @actor: a #ClutterActor
|
||||
*
|
||||
* Grabs keyboard events, after the grab is done keyboard
|
||||
* events (#ClutterActor::key-press-event and #ClutterActor::key-release-event)
|
||||
* are delivered to this actor directly. The source set in the event will be
|
||||
* the actor that would have received the event if the keyboard grab was not
|
||||
* in effect.
|
||||
*
|
||||
* Like pointer grabs, keyboard grabs should only be used as a last
|
||||
* resource.
|
||||
*
|
||||
* See also clutter_stage_set_key_focus() and clutter_actor_grab_key_focus()
|
||||
* to perform a "soft" key grab and assign key focus to a specific actor.
|
||||
*
|
||||
* Since: 0.6
|
||||
*/
|
||||
void
|
||||
clutter_grab_keyboard (ClutterActor *actor)
|
||||
{
|
||||
ClutterMainContext *context;
|
||||
|
||||
g_return_if_fail (actor == NULL || CLUTTER_IS_ACTOR (actor));
|
||||
|
||||
context = _clutter_context_get_default ();
|
||||
|
||||
if (context->keyboard_grab_actor == actor)
|
||||
return;
|
||||
|
||||
if (context->keyboard_grab_actor != NULL)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (context->keyboard_grab_actor,
|
||||
G_CALLBACK (on_grab_actor_destroy),
|
||||
NULL);
|
||||
context->keyboard_grab_actor = NULL;
|
||||
}
|
||||
|
||||
if (actor != NULL)
|
||||
{
|
||||
context->keyboard_grab_actor = actor;
|
||||
|
||||
g_signal_connect (context->keyboard_grab_actor, "destroy",
|
||||
G_CALLBACK (on_grab_actor_destroy),
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_ungrab_keyboard:
|
||||
*
|
||||
* Removes an existing grab of the keyboard.
|
||||
*
|
||||
* Since: 0.6
|
||||
*/
|
||||
void
|
||||
clutter_ungrab_keyboard (void)
|
||||
{
|
||||
clutter_grab_keyboard (NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_keyboard_grab:
|
||||
*
|
||||
* Queries the current keyboard grab of clutter.
|
||||
*
|
||||
* Return value: (transfer none): the actor currently holding the keyboard grab, or NULL if there is no grab.
|
||||
*
|
||||
* Since: 0.6
|
||||
*/
|
||||
ClutterActor *
|
||||
clutter_get_keyboard_grab (void)
|
||||
{
|
||||
ClutterMainContext *context;
|
||||
|
||||
context = _clutter_context_get_default ();
|
||||
|
||||
return context->keyboard_grab_actor;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_font_map:
|
||||
*
|
||||
|
@@ -146,19 +146,6 @@ 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,17 +12,14 @@ 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
|
||||
@@ -30,12 +27,9 @@ 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
|
||||
|
@@ -26,10 +26,15 @@
|
||||
#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 "x11/clutter-stage-x11.h"
|
||||
#include "clutter/x11/clutter-backend-x11.h"
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_set_custom_backend_func (ClutterBackend *(* func) (void));
|
||||
|
@@ -86,7 +86,7 @@ struct _ClutterOffscreenEffectPrivate
|
||||
ClutterActor *actor;
|
||||
ClutterActor *stage;
|
||||
|
||||
ClutterVertex position;
|
||||
graphene_point3d_t position;
|
||||
|
||||
int fbo_offset_x;
|
||||
int fbo_offset_y;
|
||||
@@ -119,7 +119,7 @@ clutter_offscreen_effect_set_actor (ClutterActorMeta *meta,
|
||||
/* clear out the previous state */
|
||||
if (priv->offscreen != NULL)
|
||||
{
|
||||
cogl_handle_unref (priv->offscreen);
|
||||
cogl_object_unref (priv->offscreen);
|
||||
priv->offscreen = NULL;
|
||||
}
|
||||
|
||||
@@ -199,13 +199,13 @@ update_fbo (ClutterEffect *effect,
|
||||
|
||||
if (priv->texture != NULL)
|
||||
{
|
||||
cogl_handle_unref (priv->texture);
|
||||
cogl_object_unref (priv->texture);
|
||||
priv->texture = NULL;
|
||||
}
|
||||
|
||||
if (priv->offscreen != NULL)
|
||||
{
|
||||
cogl_handle_unref (priv->offscreen);
|
||||
cogl_object_unref (priv->offscreen);
|
||||
priv->offscreen = NULL;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ update_fbo (ClutterEffect *effect,
|
||||
{
|
||||
g_warning ("%s: Unable to create an Offscreen buffer", G_STRLOC);
|
||||
|
||||
cogl_handle_unref (priv->target);
|
||||
cogl_object_unref (priv->target);
|
||||
priv->target = NULL;
|
||||
|
||||
priv->target_width = 0;
|
||||
@@ -250,9 +250,11 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
||||
gfloat target_width = -1, target_height = -1;
|
||||
gfloat resource_scale;
|
||||
gfloat ceiled_resource_scale;
|
||||
ClutterVertex local_offset = { 0.f, 0.f, 0.f };
|
||||
graphene_point3d_t local_offset;
|
||||
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;
|
||||
|
||||
@@ -487,13 +489,13 @@ clutter_offscreen_effect_finalize (GObject *gobject)
|
||||
ClutterOffscreenEffectPrivate *priv = self->priv;
|
||||
|
||||
if (priv->offscreen)
|
||||
cogl_handle_unref (priv->offscreen);
|
||||
cogl_object_unref (priv->offscreen);
|
||||
|
||||
if (priv->target)
|
||||
cogl_handle_unref (priv->target);
|
||||
cogl_object_unref (priv->target);
|
||||
|
||||
if (priv->texture)
|
||||
cogl_handle_unref (priv->texture);
|
||||
cogl_object_unref (priv->texture);
|
||||
|
||||
G_OBJECT_CLASS (clutter_offscreen_effect_parent_class)->finalize (gobject);
|
||||
}
|
||||
@@ -537,7 +539,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 %COGL_INVALID_HANDLE. The
|
||||
* Return value: (transfer none): a #CoglHandle or %NULL. The
|
||||
* returned texture is owned by Clutter and it should not be
|
||||
* modified or freed
|
||||
*
|
||||
@@ -602,7 +604,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
|
||||
* %COGL_INVALID_HANDLE. The returned handle has its reference
|
||||
* %NULL. The returned handle has its reference
|
||||
* count increased.
|
||||
*
|
||||
* Since: 1.4
|
||||
@@ -682,7 +684,7 @@ clutter_offscreen_effect_get_target_size (ClutterOffscreenEffect *effect,
|
||||
*/
|
||||
gboolean
|
||||
clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
||||
ClutterRect *rect)
|
||||
graphene_rect_t *rect)
|
||||
{
|
||||
ClutterOffscreenEffectPrivate *priv;
|
||||
|
||||
@@ -694,11 +696,11 @@ clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
||||
if (priv->texture == NULL)
|
||||
return FALSE;
|
||||
|
||||
clutter_rect_init (rect,
|
||||
priv->position.x,
|
||||
priv->position.y,
|
||||
cogl_texture_get_width (priv->texture),
|
||||
cogl_texture_get_height (priv->texture));
|
||||
graphene_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,
|
||||
ClutterRect *rect);
|
||||
graphene_rect_t *rect);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -138,8 +138,6 @@ 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, (gint64) op->op.path);
|
||||
json_builder_add_int_value (builder, (intptr_t) op->op.path);
|
||||
break;
|
||||
|
||||
case PAINT_OP_PRIMITIVE:
|
||||
json_builder_set_member_name (builder, "primitive");
|
||||
json_builder_add_int_value (builder, (gint64) op->op.primitive);
|
||||
json_builder_add_int_value (builder, (intptr_t) op->op.primitive);
|
||||
break;
|
||||
|
||||
case PAINT_OP_INVALID:
|
||||
@@ -1194,6 +1194,15 @@ 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,6 +56,9 @@ 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);
|
||||
|
@@ -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.
|
||||
*/
|
||||
ClutterVertex vertices[8];
|
||||
graphene_point3d_t 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 (ClutterVertex));
|
||||
memset (pv->vertices, 0, 8 * sizeof (graphene_point3d_t));
|
||||
|
||||
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 (ClutterVertex));
|
||||
memset (pv->vertices, 0, 8 * sizeof (graphene_point3d_t));
|
||||
|
||||
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 #ClutterVertex
|
||||
* @origin: a #graphene_point3d_t
|
||||
*
|
||||
* 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 ClutterVertex *origin)
|
||||
clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||
const graphene_point3d_t *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 #ClutterVertex
|
||||
* @vertex: (out): the return location for a #graphene_point3d_t
|
||||
*
|
||||
* 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,
|
||||
ClutterVertex *vertex)
|
||||
graphene_point3d_t *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;
|
||||
ClutterVertex origin;
|
||||
graphene_point3d_t 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;
|
||||
ClutterVertex *vertices;
|
||||
graphene_point3d_t *vertices;
|
||||
int count;
|
||||
gint i;
|
||||
|
||||
@@ -878,9 +878,9 @@ _clutter_paint_volume_transform (ClutterPaintVolume *pv,
|
||||
|
||||
cogl_matrix_transform_points (matrix,
|
||||
3,
|
||||
sizeof (ClutterVertex),
|
||||
sizeof (graphene_point3d_t),
|
||||
pv->vertices,
|
||||
sizeof (ClutterVertex),
|
||||
sizeof (graphene_point3d_t),
|
||||
pv->vertices,
|
||||
transform_count);
|
||||
|
||||
@@ -896,7 +896,7 @@ _clutter_paint_volume_axis_align (ClutterPaintVolume *pv)
|
||||
{
|
||||
int count;
|
||||
int i;
|
||||
ClutterVertex origin;
|
||||
graphene_point3d_t 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;
|
||||
ClutterVertex *vertices = pv->vertices;
|
||||
graphene_point3d_t *vertices = pv->vertices;
|
||||
gboolean partial = FALSE;
|
||||
int i;
|
||||
int j;
|
||||
@@ -1097,24 +1097,18 @@ _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++)
|
||||
{
|
||||
ClutterVertex p;
|
||||
float distance;
|
||||
graphene_vec3_t v;
|
||||
|
||||
/* 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];
|
||||
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));
|
||||
|
||||
distance = (planes[i].n[0] * p.x +
|
||||
planes[i].n[1] * p.y +
|
||||
planes[i].n[2] * p.z);
|
||||
|
||||
if (distance < 0)
|
||||
if (graphene_vec3_dot (&plane->n, &v) < 0)
|
||||
out++;
|
||||
}
|
||||
|
||||
|
@@ -579,8 +579,7 @@ clutter_pan_action_class_init (ClutterPanActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterPanActionClass, pan_stopped),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
}
|
||||
|
@@ -64,7 +64,6 @@ 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)
|
||||
@@ -85,7 +84,6 @@ 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
|
||||
@@ -109,9 +107,6 @@ typedef enum
|
||||
|
||||
/* Used to avoid recursion */
|
||||
CLUTTER_IN_RELAYOUT = 1 << 6,
|
||||
|
||||
/* a flag for internal children of Containers (DEPRECATED) */
|
||||
CLUTTER_INTERNAL_CHILD = 1 << 7
|
||||
} ClutterPrivateFlags;
|
||||
|
||||
/*
|
||||
@@ -142,10 +137,6 @@ 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;
|
||||
|
||||
/* fb bit masks for col<->id mapping in picking */
|
||||
gint fb_r_mask;
|
||||
gint fb_g_mask;
|
||||
@@ -186,7 +177,9 @@ 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);
|
||||
@@ -202,11 +195,7 @@ gboolean _clutter_feature_init (GError **error);
|
||||
gboolean _clutter_diagnostic_enabled (void);
|
||||
void _clutter_diagnostic_message (const char *fmt, ...) G_GNUC_PRINTF (1, 2);
|
||||
|
||||
/* Picking code */
|
||||
guint _clutter_pixel_to_id (guchar pixel[4]);
|
||||
void _clutter_id_to_color (guint id,
|
||||
ClutterColor *col);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_set_sync_to_vblank (gboolean sync_to_vblank);
|
||||
|
||||
/* use this function as the accumulator if you have a signal with
|
||||
@@ -231,17 +220,17 @@ 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 ClutterVertex *vertices_in,
|
||||
ClutterVertex *vertices_out,
|
||||
int n_vertices);
|
||||
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,
|
||||
ClutterRect *dest);
|
||||
graphene_rect_t *dest);
|
||||
|
||||
void _clutter_util_rectangle_int_extents (const ClutterRect *src,
|
||||
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,
|
||||
@@ -289,12 +278,13 @@ void _clutter_util_matrix_skew_yz (ClutterMatrix *matrix,
|
||||
float factor);
|
||||
|
||||
gboolean _clutter_util_matrix_decompose (const ClutterMatrix *src,
|
||||
ClutterVertex *scale_p,
|
||||
graphene_point3d_t *scale_p,
|
||||
float shear_p[3],
|
||||
ClutterVertex *rotate_p,
|
||||
ClutterVertex *translate_p,
|
||||
graphene_point3d_t *rotate_p,
|
||||
graphene_point3d_t *translate_p,
|
||||
ClutterVertex4 *perspective_p);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
PangoDirection _clutter_pango_unichar_direction (gunichar ch);
|
||||
|
||||
PangoDirection _clutter_pango_find_base_dir (const gchar *text,
|
||||
@@ -302,8 +292,8 @@ PangoDirection _clutter_pango_find_base_dir (const gchar *text,
|
||||
|
||||
typedef struct _ClutterPlane
|
||||
{
|
||||
float v0[3];
|
||||
float n[3];
|
||||
graphene_vec3_t v0;
|
||||
graphene_vec3_t n;
|
||||
} ClutterPlane;
|
||||
|
||||
typedef enum _ClutterCullResult
|
||||
@@ -321,6 +311,8 @@ 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,63 +352,64 @@ _clutter_script_parse_knot (ClutterScript *script,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_geometry_from_array (JsonArray *array,
|
||||
ClutterGeometry *geometry)
|
||||
parse_rect_from_array (JsonArray *array,
|
||||
graphene_rect_t *rect)
|
||||
{
|
||||
if (json_array_get_length (array) != 4)
|
||||
return FALSE;
|
||||
|
||||
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);
|
||||
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));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_geometry_from_object (JsonObject *object,
|
||||
ClutterGeometry *geometry)
|
||||
parse_rect_from_object (JsonObject *object,
|
||||
graphene_rect_t *rect)
|
||||
{
|
||||
if (json_object_has_member (object, "x"))
|
||||
geometry->x = json_object_get_int_member (object, "x");
|
||||
rect->origin.x = json_object_get_int_member (object, "x");
|
||||
else
|
||||
geometry->x = 0;
|
||||
rect->origin.x = 0;
|
||||
|
||||
if (json_object_has_member (object, "y"))
|
||||
geometry->y = json_object_get_int_member (object, "y");
|
||||
rect->origin.y = json_object_get_int_member (object, "y");
|
||||
else
|
||||
geometry->y = 0;
|
||||
rect->origin.y = 0;
|
||||
|
||||
if (json_object_has_member (object, "width"))
|
||||
geometry->width = json_object_get_int_member (object, "width");
|
||||
rect->size.width = json_object_get_int_member (object, "width");
|
||||
else
|
||||
geometry->width = 0;
|
||||
rect->size.width = 0;
|
||||
|
||||
if (json_object_has_member (object, "height"))
|
||||
geometry->height = json_object_get_int_member (object, "height");
|
||||
rect->size.height = json_object_get_int_member (object, "height");
|
||||
else
|
||||
geometry->height = 0;
|
||||
rect->size.height = 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_script_parse_geometry (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterGeometry *geometry)
|
||||
_clutter_script_parse_rect (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_rect_t *rect)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
||||
g_return_val_if_fail (node != NULL, FALSE);
|
||||
g_return_val_if_fail (geometry != NULL, FALSE);
|
||||
g_return_val_if_fail (rect != NULL, FALSE);
|
||||
|
||||
switch (JSON_NODE_TYPE (node))
|
||||
{
|
||||
case JSON_NODE_ARRAY:
|
||||
return parse_geometry_from_array (json_node_get_array (node), geometry);
|
||||
return parse_rect_from_array (json_node_get_array (node), rect);
|
||||
|
||||
case JSON_NODE_OBJECT:
|
||||
return parse_geometry_from_object (json_node_get_object (node), geometry);
|
||||
return parse_rect_from_object (json_node_get_object (node), rect);
|
||||
|
||||
default:
|
||||
break;
|
||||
@@ -492,8 +493,8 @@ _clutter_script_parse_color (ClutterScript *script,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_point_from_array (JsonArray *array,
|
||||
ClutterPoint *point)
|
||||
parse_point_from_array (JsonArray *array,
|
||||
graphene_point_t *point)
|
||||
{
|
||||
if (json_array_get_length (array) != 2)
|
||||
return FALSE;
|
||||
@@ -505,8 +506,8 @@ parse_point_from_array (JsonArray *array,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_point_from_object (JsonObject *object,
|
||||
ClutterPoint *point)
|
||||
parse_point_from_object (JsonObject *object,
|
||||
graphene_point_t *point)
|
||||
{
|
||||
if (json_object_has_member (object, "x"))
|
||||
point->x = json_object_get_double_member (object, "x");
|
||||
@@ -522,9 +523,9 @@ parse_point_from_object (JsonObject *object,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_script_parse_point (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterPoint *point)
|
||||
_clutter_script_parse_point (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_point_t *point)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
||||
g_return_val_if_fail (node != NULL, FALSE);
|
||||
@@ -546,8 +547,8 @@ _clutter_script_parse_point (ClutterScript *script,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_size_from_array (JsonArray *array,
|
||||
ClutterSize *size)
|
||||
parse_size_from_array (JsonArray *array,
|
||||
graphene_size_t *size)
|
||||
{
|
||||
if (json_array_get_length (array) != 2)
|
||||
return FALSE;
|
||||
@@ -559,8 +560,8 @@ parse_size_from_array (JsonArray *array,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_size_from_object (JsonObject *object,
|
||||
ClutterSize *size)
|
||||
parse_size_from_object (JsonObject *object,
|
||||
graphene_size_t *size)
|
||||
{
|
||||
if (json_object_has_member (object, "width"))
|
||||
size->width = json_object_get_double_member (object, "width");
|
||||
@@ -576,9 +577,9 @@ parse_size_from_object (JsonObject *object,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_script_parse_size (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterSize *size)
|
||||
_clutter_script_parse_size (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_size_t *size)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
||||
g_return_val_if_fail (node != NULL, FALSE);
|
||||
@@ -1328,11 +1329,11 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (p_type == CLUTTER_TYPE_GEOMETRY)
|
||||
else if (p_type == GRAPHENE_TYPE_RECT)
|
||||
{
|
||||
ClutterGeometry geom = { 0, };
|
||||
graphene_rect_t rect = GRAPHENE_RECT_INIT_ZERO;
|
||||
|
||||
/* geometry := {
|
||||
/* rect := {
|
||||
* "x" : (int),
|
||||
* "y" : (int),
|
||||
* "width" : (int),
|
||||
@@ -1340,9 +1341,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
* }
|
||||
*/
|
||||
|
||||
if (_clutter_script_parse_geometry (script, node, &geom))
|
||||
if (_clutter_script_parse_rect (script, node, &rect))
|
||||
{
|
||||
g_value_set_boxed (value, &geom);
|
||||
g_value_set_boxed (value, &rect);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -1364,9 +1365,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (p_type == CLUTTER_TYPE_POINT)
|
||||
else if (p_type == GRAPHENE_TYPE_POINT)
|
||||
{
|
||||
ClutterPoint point = CLUTTER_POINT_INIT_ZERO;
|
||||
graphene_point_t point = GRAPHENE_POINT_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_point (script, node, &point))
|
||||
{
|
||||
@@ -1374,9 +1375,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (p_type == CLUTTER_TYPE_SIZE)
|
||||
else if (p_type == GRAPHENE_TYPE_SIZE)
|
||||
{
|
||||
ClutterSize size = CLUTTER_SIZE_INIT_ZERO;
|
||||
graphene_size_t size = GRAPHENE_SIZE_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_size (script, node, &size))
|
||||
{
|
||||
@@ -1417,15 +1418,15 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_GEOMETRY))
|
||||
else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_RECT))
|
||||
{
|
||||
ClutterGeometry geom = { 0, };
|
||||
graphene_rect_t rect = GRAPHENE_RECT_INIT_ZERO;
|
||||
|
||||
/* geometry := [ (int), (int), (int), (int) ] */
|
||||
/* rect := [ (int), (int), (int), (int) ] */
|
||||
|
||||
if (_clutter_script_parse_geometry (script, node, &geom))
|
||||
if (_clutter_script_parse_rect (script, node, &rect))
|
||||
{
|
||||
g_value_set_boxed (value, &geom);
|
||||
g_value_set_boxed (value, &rect);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -1441,9 +1442,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_POINT))
|
||||
else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_POINT))
|
||||
{
|
||||
ClutterPoint point = CLUTTER_POINT_INIT_ZERO;
|
||||
graphene_point_t point = GRAPHENE_POINT_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_point (script, node, &point))
|
||||
{
|
||||
@@ -1451,9 +1452,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_SIZE))
|
||||
else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_SIZE))
|
||||
{
|
||||
ClutterSize size = CLUTTER_SIZE_INIT_ZERO;
|
||||
graphene_size_t size = GRAPHENE_SIZE_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_size (script, node, &size))
|
||||
{
|
||||
|
@@ -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_geometry (ClutterScript *script,
|
||||
gboolean _clutter_script_parse_rect (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterGeometry *geometry);
|
||||
graphene_rect_t *rect);
|
||||
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,
|
||||
ClutterPoint *point);
|
||||
gboolean _clutter_script_parse_point (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_point_t *point);
|
||||
gboolean _clutter_script_parse_size (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterSize *size);
|
||||
graphene_size_t *size);
|
||||
|
||||
gboolean _clutter_script_parse_translatable_string (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
|
@@ -56,7 +56,7 @@
|
||||
|
||||
struct _ClutterScrollActorPrivate
|
||||
{
|
||||
ClutterPoint scroll_to;
|
||||
graphene_point_t 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 ClutterPoint *point)
|
||||
clutter_scroll_actor_set_scroll_to_internal (ClutterScrollActor *self,
|
||||
const graphene_point_t *point)
|
||||
{
|
||||
ClutterScrollActorPrivate *priv = self->priv;
|
||||
ClutterActor *actor = CLUTTER_ACTOR (self);
|
||||
ClutterMatrix m = CLUTTER_MATRIX_INIT_IDENTITY;
|
||||
float dx, dy;
|
||||
|
||||
if (clutter_point_equals (&priv->scroll_to, point))
|
||||
if (graphene_point_equal (&priv->scroll_to, point))
|
||||
return;
|
||||
|
||||
if (point == NULL)
|
||||
clutter_point_init (&priv->scroll_to, 0.f, 0.f);
|
||||
graphene_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 ClutterPoint *point = g_value_get_boxed (value);
|
||||
const graphene_point_t *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",
|
||||
CLUTTER_TYPE_POINT,
|
||||
GRAPHENE_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 #ClutterPoint
|
||||
* @point: a #graphene_point_t
|
||||
*
|
||||
* 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 ClutterPoint *point)
|
||||
clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
const graphene_point_t *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,
|
||||
CLUTTER_TYPE_POINT,
|
||||
GRAPHENE_TYPE_POINT,
|
||||
&priv->scroll_to);
|
||||
clutter_transition_set_to (priv->transition,
|
||||
CLUTTER_TYPE_POINT,
|
||||
GRAPHENE_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 ClutterRect *rect)
|
||||
clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
const graphene_rect_t *rect)
|
||||
{
|
||||
ClutterRect n_rect;
|
||||
graphene_rect_t 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 */
|
||||
clutter_rect_normalize (&n_rect);
|
||||
graphene_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 ClutterPoint *point);
|
||||
void clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
const graphene_point_t *point);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
const ClutterRect *rect);
|
||||
void clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
const graphene_rect_t *rect);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -177,18 +177,18 @@ clutter_shader_effect_clear (ClutterShaderEffect *self,
|
||||
{
|
||||
ClutterShaderEffectPrivate *priv = self->priv;
|
||||
|
||||
if (priv->shader != COGL_INVALID_HANDLE)
|
||||
if (priv->shader != NULL)
|
||||
{
|
||||
cogl_handle_unref (priv->shader);
|
||||
cogl_object_unref (priv->shader);
|
||||
|
||||
priv->shader = COGL_INVALID_HANDLE;
|
||||
priv->shader = NULL;
|
||||
}
|
||||
|
||||
if (priv->program != COGL_INVALID_HANDLE)
|
||||
if (priv->program != NULL)
|
||||
{
|
||||
cogl_handle_unref (priv->program);
|
||||
cogl_object_unref (priv->program);
|
||||
|
||||
priv->program = COGL_INVALID_HANDLE;
|
||||
priv->program = NULL;
|
||||
}
|
||||
|
||||
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 == COGL_INVALID_HANDLE)
|
||||
if (priv->program == NULL)
|
||||
return;
|
||||
|
||||
if (priv->uniforms == NULL)
|
||||
@@ -333,7 +333,7 @@ clutter_shader_effect_create_shader (ClutterShaderEffect *self)
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
return COGL_INVALID_HANDLE;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ clutter_shader_effect_try_static_source (ClutterShaderEffect *self)
|
||||
CLUTTER_TYPE_SHADER_EFFECT,
|
||||
ClutterShaderEffectClassPrivate);
|
||||
|
||||
if (class_priv->shader == COGL_INVALID_HANDLE)
|
||||
if (class_priv->shader == NULL)
|
||||
{
|
||||
gchar *source;
|
||||
|
||||
@@ -387,10 +387,10 @@ clutter_shader_effect_try_static_source (ClutterShaderEffect *self)
|
||||
}
|
||||
}
|
||||
|
||||
priv->shader = cogl_handle_ref (class_priv->shader);
|
||||
priv->shader = cogl_object_ref (class_priv->shader);
|
||||
|
||||
if (class_priv->program != COGL_INVALID_HANDLE)
|
||||
priv->program = cogl_handle_ref (class_priv->program);
|
||||
if (class_priv->program != NULL)
|
||||
priv->program = cogl_object_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 == COGL_INVALID_HANDLE)
|
||||
if (priv->shader == NULL)
|
||||
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 == COGL_INVALID_HANDLE)
|
||||
if (priv->program == NULL)
|
||||
goto out;
|
||||
|
||||
CLUTTER_NOTE (SHADER, "Applying the shader effect of type '%s'",
|
||||
@@ -500,6 +500,7 @@ static void
|
||||
clutter_shader_effect_init (ClutterShaderEffect *effect)
|
||||
{
|
||||
effect->priv = clutter_shader_effect_get_instance_private (effect);
|
||||
effect->priv->shader_type = CLUTTER_FRAGMENT_SHADER;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -533,7 +534,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 %COGL_INVALID_HANDLE
|
||||
* or %NULL
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
@@ -541,7 +542,7 @@ CoglHandle
|
||||
clutter_shader_effect_get_shader (ClutterShaderEffect *effect)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SHADER_EFFECT (effect),
|
||||
COGL_INVALID_HANDLE);
|
||||
NULL);
|
||||
|
||||
return effect->priv->shader;
|
||||
}
|
||||
@@ -553,7 +554,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 %COGL_INVALID_HANDLE
|
||||
* or %NULL
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
@@ -561,7 +562,7 @@ CoglHandle
|
||||
clutter_shader_effect_get_program (ClutterShaderEffect *effect)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SHADER_EFFECT (effect),
|
||||
COGL_INVALID_HANDLE);
|
||||
NULL);
|
||||
|
||||
return effect->priv->program;
|
||||
}
|
||||
@@ -891,7 +892,7 @@ clutter_shader_effect_set_shader_source (ClutterShaderEffect *effect,
|
||||
|
||||
priv = effect->priv;
|
||||
|
||||
if (priv->shader != COGL_INVALID_HANDLE)
|
||||
if (priv->shader != NULL)
|
||||
return TRUE;
|
||||
|
||||
priv->shader = clutter_shader_effect_create_shader (effect);
|
||||
|
@@ -134,8 +134,7 @@ 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,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_STAGE);
|
||||
/**
|
||||
@@ -153,8 +152,7 @@ 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,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_STAGE);
|
||||
}
|
||||
|
@@ -41,8 +41,11 @@ void _clutter_stage_paint_view (ClutterStage
|
||||
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);
|
||||
@@ -64,6 +67,7 @@ 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);
|
||||
@@ -75,9 +79,18 @@ 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,
|
||||
gint x,
|
||||
gint y,
|
||||
float x,
|
||||
float y,
|
||||
ClutterPickMode mode);
|
||||
|
||||
ClutterPaintVolume *_clutter_stage_paint_volume_stack_allocate (ClutterStage *stage);
|
||||
@@ -93,13 +106,6 @@ 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);
|
||||
@@ -116,17 +122,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_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,
|
||||
ClutterRect *rect,
|
||||
float *view_scale);
|
||||
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,
|
||||
|
@@ -143,6 +143,21 @@ 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);
|
||||
|
||||
|
@@ -275,24 +275,6 @@ _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)
|
||||
{
|
||||
|
@@ -64,10 +64,6 @@ 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);
|
||||
@@ -92,6 +88,7 @@ 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,
|
||||
@@ -111,10 +108,6 @@ 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
@@ -115,26 +115,6 @@ 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)
|
||||
*/
|
||||
@@ -153,8 +133,6 @@ 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;
|
||||
|
||||
@@ -223,8 +201,8 @@ gboolean clutter_stage_event (ClutterStage
|
||||
CLUTTER_EXPORT
|
||||
ClutterActor * clutter_stage_get_actor_at_pos (ClutterStage *stage,
|
||||
ClutterPickMode pick_mode,
|
||||
gint x,
|
||||
gint y);
|
||||
float x,
|
||||
float y);
|
||||
CLUTTER_EXPORT
|
||||
guchar * clutter_stage_read_pixels (ClutterStage *stage,
|
||||
gint x,
|
||||
|
@@ -122,8 +122,7 @@ clutter_tap_action_class_init (ClutterTapActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTapActionClass, tap),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
}
|
||||
|
@@ -157,7 +157,7 @@ struct _ClutterTextPrivate
|
||||
gint text_logical_y;
|
||||
|
||||
/* Where to draw the cursor */
|
||||
ClutterRect cursor_rect;
|
||||
graphene_rect_t cursor_rect;
|
||||
ClutterColor cursor_color;
|
||||
guint cursor_size;
|
||||
|
||||
@@ -1304,7 +1304,7 @@ static inline void
|
||||
update_cursor_location (ClutterText *self)
|
||||
{
|
||||
ClutterTextPrivate *priv = self->priv;
|
||||
ClutterRect rect;
|
||||
graphene_rect_t rect;
|
||||
float x, y;
|
||||
|
||||
if (!priv->editable)
|
||||
@@ -1312,7 +1312,7 @@ update_cursor_location (ClutterText *self)
|
||||
|
||||
rect = priv->cursor_rect;
|
||||
clutter_actor_get_transformed_position (CLUTTER_ACTOR (self), &x, &y);
|
||||
clutter_rect_offset (&rect, x, y);
|
||||
graphene_rect_offset (&rect, x, y);
|
||||
clutter_input_focus_set_cursor_location (priv->input_focus, &rect);
|
||||
}
|
||||
|
||||
@@ -1322,7 +1322,7 @@ clutter_text_ensure_cursor_position (ClutterText *self,
|
||||
{
|
||||
ClutterTextPrivate *priv = self->priv;
|
||||
gfloat x, y, cursor_height;
|
||||
ClutterRect cursor_rect = CLUTTER_RECT_INIT_ZERO;
|
||||
graphene_rect_t cursor_rect = GRAPHENE_RECT_INIT_ZERO;
|
||||
gint position;
|
||||
|
||||
position = priv->position;
|
||||
@@ -1345,25 +1345,17 @@ clutter_text_ensure_cursor_position (ClutterText *self,
|
||||
&x, &y,
|
||||
&cursor_height);
|
||||
|
||||
clutter_rect_init (&cursor_rect,
|
||||
x,
|
||||
y + CURSOR_Y_PADDING * scale,
|
||||
priv->cursor_size * scale,
|
||||
cursor_height - 2 * CURSOR_Y_PADDING * scale);
|
||||
graphene_rect_init (&cursor_rect,
|
||||
x,
|
||||
y + CURSOR_Y_PADDING * scale,
|
||||
priv->cursor_size * scale,
|
||||
cursor_height - 2 * CURSOR_Y_PADDING * scale);
|
||||
|
||||
if (!clutter_rect_equals (&priv->cursor_rect, &cursor_rect))
|
||||
if (!graphene_rect_equal (&priv->cursor_rect, &cursor_rect))
|
||||
{
|
||||
ClutterGeometry cursor_pos;
|
||||
|
||||
priv->cursor_rect = cursor_rect;
|
||||
|
||||
/* XXX:2.0 - remove */
|
||||
cursor_pos.x = clutter_rect_get_x (&priv->cursor_rect);
|
||||
cursor_pos.y = clutter_rect_get_y (&priv->cursor_rect);
|
||||
cursor_pos.width = clutter_rect_get_width (&priv->cursor_rect);
|
||||
cursor_pos.height = clutter_rect_get_height (&priv->cursor_rect);
|
||||
g_signal_emit (self, text_signals[CURSOR_EVENT], 0, &cursor_pos);
|
||||
|
||||
g_signal_emit (self, text_signals[CURSOR_EVENT], 0, &cursor_rect);
|
||||
g_signal_emit (self, text_signals[CURSOR_CHANGED], 0);
|
||||
|
||||
update_cursor_location (self);
|
||||
@@ -2260,7 +2252,10 @@ clutter_text_press (ClutterActor *actor,
|
||||
priv->in_select_drag = TRUE;
|
||||
|
||||
if (type == CLUTTER_BUTTON_PRESS)
|
||||
clutter_grab_pointer (actor);
|
||||
{
|
||||
clutter_input_device_grab (clutter_event_get_device (event),
|
||||
actor);
|
||||
}
|
||||
else
|
||||
{
|
||||
clutter_input_device_sequence_grab (clutter_event_get_device (event),
|
||||
@@ -2318,7 +2313,7 @@ clutter_text_release (ClutterActor *actor,
|
||||
{
|
||||
if (!priv->in_select_touch)
|
||||
{
|
||||
clutter_ungrab_pointer ();
|
||||
clutter_input_device_ungrab (clutter_event_get_device (event));
|
||||
priv->in_select_drag = FALSE;
|
||||
|
||||
return CLUTTER_EVENT_STOP;
|
||||
@@ -2709,7 +2704,7 @@ clutter_text_paint (ClutterActor *self)
|
||||
|
||||
if (actor_width < text_width)
|
||||
{
|
||||
gint cursor_x = clutter_rect_get_x (&priv->cursor_rect);
|
||||
gint cursor_x = graphene_rect_get_x (&priv->cursor_rect);
|
||||
|
||||
if (priv->position == -1)
|
||||
{
|
||||
@@ -2796,7 +2791,7 @@ add_selection_to_paint_volume (ClutterText *text,
|
||||
{
|
||||
ClutterPaintVolume *total_volume = user_data;
|
||||
ClutterPaintVolume rect_volume;
|
||||
ClutterVertex vertex;
|
||||
graphene_point3d_t vertex;
|
||||
|
||||
_clutter_paint_volume_init_static (&rect_volume, CLUTTER_ACTOR (text));
|
||||
|
||||
@@ -2818,7 +2813,7 @@ clutter_text_get_paint_volume_for_cursor (ClutterText *text,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
ClutterTextPrivate *priv = text->priv;
|
||||
ClutterVertex origin;
|
||||
graphene_point3d_t origin;
|
||||
|
||||
clutter_text_ensure_cursor_position (text, resource_scale);
|
||||
|
||||
@@ -2861,7 +2856,7 @@ clutter_text_get_paint_volume (ClutterActor *self,
|
||||
{
|
||||
PangoLayout *layout;
|
||||
PangoRectangle ink_rect;
|
||||
ClutterVertex origin;
|
||||
graphene_point3d_t origin;
|
||||
float resource_scale;
|
||||
|
||||
/* If the text is single line editable then it gets clipped to
|
||||
@@ -4340,8 +4335,7 @@ clutter_text_class_init (ClutterTextClass *klass)
|
||||
G_TYPE_FROM_CLASS (gobject_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTextClass, text_changed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -4397,10 +4391,10 @@ clutter_text_class_init (ClutterTextClass *klass)
|
||||
/**
|
||||
* ClutterText::cursor-event:
|
||||
* @self: the #ClutterText that emitted the signal
|
||||
* @geometry: the coordinates of the cursor
|
||||
* @rect: the coordinates of the cursor
|
||||
*
|
||||
* The ::cursor-event signal is emitted whenever the cursor position
|
||||
* changes inside a #ClutterText actor. Inside @geometry it is stored
|
||||
* changes inside a #ClutterText actor. Inside @rect it is stored
|
||||
* the current position and size of the cursor, relative to the actor
|
||||
* itself.
|
||||
*
|
||||
@@ -4413,10 +4407,9 @@ clutter_text_class_init (ClutterTextClass *klass)
|
||||
G_TYPE_FROM_CLASS (gobject_class),
|
||||
G_SIGNAL_RUN_LAST | G_SIGNAL_DEPRECATED,
|
||||
G_STRUCT_OFFSET (ClutterTextClass, cursor_event),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__BOXED,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_GEOMETRY | G_SIGNAL_TYPE_STATIC_SCOPE);
|
||||
GRAPHENE_TYPE_RECT | G_SIGNAL_TYPE_STATIC_SCOPE);
|
||||
|
||||
/**
|
||||
* ClutterText::cursor-changed:
|
||||
@@ -4432,8 +4425,7 @@ clutter_text_class_init (ClutterTextClass *klass)
|
||||
G_TYPE_FROM_CLASS (gobject_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTextClass, cursor_changed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -4451,8 +4443,7 @@ clutter_text_class_init (ClutterTextClass *klass)
|
||||
G_TYPE_FROM_CLASS (gobject_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTextClass, activate),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
binding_pool = clutter_binding_pool_get_for_class (klass);
|
||||
@@ -6781,8 +6772,8 @@ clutter_text_get_layout_offsets (ClutterText *self,
|
||||
* Since: 1.16
|
||||
*/
|
||||
void
|
||||
clutter_text_get_cursor_rect (ClutterText *self,
|
||||
ClutterRect *rect)
|
||||
clutter_text_get_cursor_rect (ClutterText *self,
|
||||
graphene_rect_t *rect)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_TEXT (self));
|
||||
g_return_if_fail (rect != NULL);
|
||||
|
@@ -82,7 +82,7 @@ struct _ClutterTextClass
|
||||
void (* text_changed) (ClutterText *self);
|
||||
void (* activate) (ClutterText *self);
|
||||
void (* cursor_event) (ClutterText *self,
|
||||
const ClutterGeometry *geometry);
|
||||
const graphene_rect_t *rect);
|
||||
void (* cursor_changed) (ClutterText *self);
|
||||
|
||||
/*< private >*/
|
||||
@@ -230,7 +230,7 @@ CLUTTER_EXPORT
|
||||
guint clutter_text_get_cursor_size (ClutterText *self);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_text_get_cursor_rect (ClutterText *self,
|
||||
ClutterRect *rect);
|
||||
graphene_rect_t *rect);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_text_set_selectable (ClutterText *self,
|
||||
gboolean selectable);
|
||||
|
@@ -145,8 +145,8 @@ struct _ClutterTimelinePrivate
|
||||
ClutterStepMode step_mode;
|
||||
|
||||
/* cubic-bezier() parameters */
|
||||
ClutterPoint cb_1;
|
||||
ClutterPoint cb_2;
|
||||
graphene_point_t cb_1;
|
||||
graphene_point_t cb_2;
|
||||
|
||||
guint is_playing : 1;
|
||||
|
||||
@@ -424,6 +424,11 @@ clutter_timeline_set_custom_property (ClutterScriptable *scriptable,
|
||||
g_object_set_property (G_OBJECT (scriptable), name, value);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_timeline_cancel_delay (ClutterTimeline *timeline)
|
||||
{
|
||||
g_clear_handle_id (&timeline->priv->delay_id, g_source_remove);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_scriptable_iface_init (ClutterScriptableIface *iface)
|
||||
@@ -550,11 +555,7 @@ clutter_timeline_dispose (GObject *object)
|
||||
|
||||
priv = self->priv;
|
||||
|
||||
if (priv->delay_id)
|
||||
{
|
||||
g_source_remove (priv->delay_id);
|
||||
priv->delay_id = 0;
|
||||
}
|
||||
clutter_timeline_cancel_delay (self);
|
||||
|
||||
if (priv->progress_notify != NULL)
|
||||
{
|
||||
@@ -709,8 +710,7 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTimelineClass, new_frame),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__INT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE,
|
||||
1, G_TYPE_INT);
|
||||
/**
|
||||
@@ -733,8 +733,7 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTimelineClass, completed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
/**
|
||||
* ClutterTimeline::started:
|
||||
@@ -750,8 +749,7 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTimelineClass, started),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
/**
|
||||
* ClutterTimeline::paused:
|
||||
@@ -764,8 +762,7 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTimelineClass, paused),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
/**
|
||||
* ClutterTimeline::marker-reached:
|
||||
@@ -832,8 +829,7 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTimelineClass, stopped),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__BOOLEAN,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
G_TYPE_BOOLEAN);
|
||||
}
|
||||
@@ -850,8 +846,8 @@ clutter_timeline_init (ClutterTimeline *self)
|
||||
self->priv->step_mode = CLUTTER_STEP_MODE_END;
|
||||
|
||||
/* default cubic-bezier() paramereters are (0, 0, 1, 1) */
|
||||
clutter_point_init (&self->priv->cb_1, 0, 0);
|
||||
clutter_point_init (&self->priv->cb_2, 1, 1);
|
||||
graphene_point_init (&self->priv->cb_1, 0, 0);
|
||||
graphene_point_init (&self->priv->cb_2, 1, 1);
|
||||
}
|
||||
|
||||
struct CheckIfMarkerHitClosure
|
||||
@@ -1218,14 +1214,10 @@ clutter_timeline_pause (ClutterTimeline *timeline)
|
||||
|
||||
priv = timeline->priv;
|
||||
|
||||
if (priv->delay_id == 0 && !priv->is_playing)
|
||||
return;
|
||||
clutter_timeline_cancel_delay (timeline);
|
||||
|
||||
if (priv->delay_id)
|
||||
{
|
||||
g_source_remove (priv->delay_id);
|
||||
priv->delay_id = 0;
|
||||
}
|
||||
if (!priv->is_playing)
|
||||
return;
|
||||
|
||||
priv->msecs_delta = 0;
|
||||
set_is_playing (timeline, FALSE);
|
||||
@@ -2493,9 +2485,9 @@ clutter_timeline_get_step_progress (ClutterTimeline *timeline,
|
||||
* Since: 1.12
|
||||
*/
|
||||
void
|
||||
clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
const ClutterPoint *c_1,
|
||||
const ClutterPoint *c_2)
|
||||
clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
const graphene_point_t *c_1,
|
||||
const graphene_point_t *c_2)
|
||||
{
|
||||
ClutterTimelinePrivate *priv;
|
||||
|
||||
@@ -2530,9 +2522,9 @@ clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
* Since: 1.12
|
||||
*/
|
||||
gboolean
|
||||
clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
ClutterPoint *c_1,
|
||||
ClutterPoint *c_2)
|
||||
clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
graphene_point_t *c_1,
|
||||
graphene_point_t *c_2)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), FALSE);
|
||||
|
||||
|
@@ -208,13 +208,13 @@ gboolean clutter_timeline_get_step_progress
|
||||
gint *n_steps,
|
||||
ClutterStepMode *step_mode);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
const ClutterPoint *c_1,
|
||||
const ClutterPoint *c_2);
|
||||
void clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
const graphene_point_t *c_1,
|
||||
const graphene_point_t *c_2);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
ClutterPoint *c_1,
|
||||
ClutterPoint *c_2);
|
||||
gboolean clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
graphene_point_t *c_1,
|
||||
graphene_point_t *c_2);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gint64 clutter_timeline_get_duration_hint (ClutterTimeline *timeline);
|
||||
|
@@ -134,7 +134,6 @@ clutter_transition_stopped (ClutterTimeline *timeline,
|
||||
clutter_transition_detach (CLUTTER_TRANSITION (timeline),
|
||||
priv->animatable);
|
||||
g_clear_object (&priv->animatable);
|
||||
g_object_unref (timeline);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -33,20 +33,16 @@
|
||||
#include <clutter/clutter-macros.h>
|
||||
#include <clutter/clutter-enums.h>
|
||||
|
||||
#include <graphene-gobject.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_ACTOR_BOX (clutter_actor_box_get_type ())
|
||||
#define CLUTTER_TYPE_FOG (clutter_fog_get_type ())
|
||||
#define CLUTTER_TYPE_GEOMETRY (clutter_geometry_get_type ())
|
||||
#define CLUTTER_TYPE_KNOT (clutter_knot_get_type ())
|
||||
#define CLUTTER_TYPE_MARGIN (clutter_margin_get_type ())
|
||||
#define CLUTTER_TYPE_MATRIX (clutter_matrix_get_type ())
|
||||
#define CLUTTER_TYPE_PAINT_VOLUME (clutter_paint_volume_get_type ())
|
||||
#define CLUTTER_TYPE_PERSPECTIVE (clutter_perspective_get_type ())
|
||||
#define CLUTTER_TYPE_VERTEX (clutter_vertex_get_type ())
|
||||
#define CLUTTER_TYPE_POINT (clutter_point_get_type ())
|
||||
#define CLUTTER_TYPE_SIZE (clutter_size_get_type ())
|
||||
#define CLUTTER_TYPE_RECT (clutter_rect_get_type ())
|
||||
|
||||
typedef struct _ClutterActor ClutterActor;
|
||||
|
||||
@@ -79,14 +75,9 @@ typedef struct _ClutterPathNode ClutterPathNode;
|
||||
|
||||
typedef struct _ClutterActorBox ClutterActorBox;
|
||||
typedef struct _ClutterColor ClutterColor;
|
||||
typedef struct _ClutterGeometry ClutterGeometry; /* XXX:2.0 - remove */
|
||||
typedef struct _ClutterKnot ClutterKnot;
|
||||
typedef struct _ClutterMargin ClutterMargin;
|
||||
typedef struct _ClutterPerspective ClutterPerspective;
|
||||
typedef struct _ClutterPoint ClutterPoint;
|
||||
typedef struct _ClutterRect ClutterRect;
|
||||
typedef struct _ClutterSize ClutterSize;
|
||||
typedef struct _ClutterVertex ClutterVertex;
|
||||
|
||||
typedef struct _ClutterAlpha ClutterAlpha;
|
||||
typedef struct _ClutterAnimation ClutterAnimation;
|
||||
@@ -113,7 +104,6 @@ typedef union _ClutterEvent ClutterEvent;
|
||||
*/
|
||||
typedef struct _ClutterEventSequence ClutterEventSequence;
|
||||
|
||||
typedef struct _ClutterFog ClutterFog; /* deprecated */
|
||||
typedef struct _ClutterBehaviour ClutterBehaviour; /* deprecated */
|
||||
typedef struct _ClutterShader ClutterShader; /* deprecated */
|
||||
|
||||
@@ -137,307 +127,6 @@ typedef struct _ClutterShader ClutterShader; /* deprecated */
|
||||
*/
|
||||
typedef struct _ClutterPaintVolume ClutterPaintVolume;
|
||||
|
||||
/**
|
||||
* ClutterPoint:
|
||||
* @x: X coordinate, in pixels
|
||||
* @y: Y coordinate, in pixels
|
||||
*
|
||||
* A point in 2D space.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
struct _ClutterPoint
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
|
||||
/**
|
||||
* CLUTTER_POINT_INIT:
|
||||
* @x: X coordinate
|
||||
* @y: Y coordinate
|
||||
*
|
||||
* A simple macro for initializing a #ClutterPoint when declaring it, e.g.:
|
||||
*
|
||||
* |[
|
||||
* ClutterPoint p = CLUTTER_POINT_INIT (100, 100);
|
||||
* ]|
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
#define CLUTTER_POINT_INIT(x,y) { (x), (y) }
|
||||
|
||||
/**
|
||||
* CLUTTER_POINT_INIT_ZERO:
|
||||
*
|
||||
* A simple macro for initializing a #ClutterPoint to (0, 0) when
|
||||
* declaring it.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
#define CLUTTER_POINT_INIT_ZERO CLUTTER_POINT_INIT (0.f, 0.f)
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_point_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
const ClutterPoint * clutter_point_zero (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterPoint * clutter_point_alloc (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterPoint * clutter_point_init (ClutterPoint *point,
|
||||
float x,
|
||||
float y);
|
||||
CLUTTER_EXPORT
|
||||
ClutterPoint * clutter_point_copy (const ClutterPoint *point);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_point_free (ClutterPoint *point);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_point_equals (const ClutterPoint *a,
|
||||
const ClutterPoint *b);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_point_distance (const ClutterPoint *a,
|
||||
const ClutterPoint *b,
|
||||
float *x_distance,
|
||||
float *y_distance);
|
||||
|
||||
/**
|
||||
* ClutterSize:
|
||||
* @width: the width, in pixels
|
||||
* @height: the height, in pixels
|
||||
*
|
||||
* A size, in 2D space.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
struct _ClutterSize
|
||||
{
|
||||
float width;
|
||||
float height;
|
||||
};
|
||||
|
||||
/**
|
||||
* CLUTTER_SIZE_INIT:
|
||||
* @width: the width
|
||||
* @height: the height
|
||||
*
|
||||
* A simple macro for initializing a #ClutterSize when declaring it, e.g.:
|
||||
*
|
||||
* |[
|
||||
* ClutterSize s = CLUTTER_SIZE_INIT (200, 200);
|
||||
* ]|
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
#define CLUTTER_SIZE_INIT(width,height) { (width), (height) }
|
||||
|
||||
/**
|
||||
* CLUTTER_SIZE_INIT_ZERO:
|
||||
*
|
||||
* A simple macro for initializing a #ClutterSize to (0, 0) when
|
||||
* declaring it.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
#define CLUTTER_SIZE_INIT_ZERO CLUTTER_SIZE_INIT (0.f, 0.f)
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_size_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterSize * clutter_size_alloc (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterSize * clutter_size_init (ClutterSize *size,
|
||||
float width,
|
||||
float height);
|
||||
CLUTTER_EXPORT
|
||||
ClutterSize * clutter_size_copy (const ClutterSize *size);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_size_free (ClutterSize *size);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_size_equals (const ClutterSize *a,
|
||||
const ClutterSize *b);
|
||||
|
||||
/**
|
||||
* ClutterRect:
|
||||
* @origin: the origin of the rectangle
|
||||
* @size: the size of the rectangle
|
||||
*
|
||||
* The location and size of a rectangle.
|
||||
*
|
||||
* The width and height of a #ClutterRect can be negative; Clutter considers
|
||||
* a rectangle with an origin of [ 0.0, 0.0 ] and a size of [ 10.0, 10.0 ] to
|
||||
* be equivalent to a rectangle with origin of [ 10.0, 10.0 ] and size of
|
||||
* [ -10.0, -10.0 ].
|
||||
*
|
||||
* Application code can normalize rectangles using clutter_rect_normalize():
|
||||
* this function will ensure that the width and height of a #ClutterRect are
|
||||
* positive values. All functions taking a #ClutterRect as an argument will
|
||||
* implicitly normalize it before computing eventual results. For this reason
|
||||
* it is safer to access the contents of a #ClutterRect by using the provided
|
||||
* API at all times, instead of directly accessing the structure members.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
struct _ClutterRect
|
||||
{
|
||||
ClutterPoint origin;
|
||||
ClutterSize size;
|
||||
};
|
||||
|
||||
/**
|
||||
* CLUTTER_RECT_INIT:
|
||||
* @x: the X coordinate
|
||||
* @y: the Y coordinate
|
||||
* @width: the width
|
||||
* @height: the height
|
||||
*
|
||||
* A simple macro for initializing a #ClutterRect when declaring it, e.g.:
|
||||
*
|
||||
* |[
|
||||
* ClutterRect r = CLUTTER_RECT_INIT (100, 100, 200, 200);
|
||||
* ]|
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
#define CLUTTER_RECT_INIT(x,y,width,height) { { (x), (y) }, { (width), (height) } }
|
||||
|
||||
/**
|
||||
* CLUTTER_RECT_INIT_ZERO:
|
||||
*
|
||||
* A simple macro for initializing a #ClutterRect to (0, 0, 0, 0) when
|
||||
* declaring it.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
#define CLUTTER_RECT_INIT_ZERO CLUTTER_RECT_INIT (0.f, 0.f, 0.f, 0.f)
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_rect_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
const ClutterRect * clutter_rect_zero (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterRect * clutter_rect_alloc (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterRect * clutter_rect_init (ClutterRect *rect,
|
||||
float x,
|
||||
float y,
|
||||
float width,
|
||||
float height);
|
||||
CLUTTER_EXPORT
|
||||
ClutterRect * clutter_rect_copy (const ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_rect_free (ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_rect_equals (ClutterRect *a,
|
||||
ClutterRect *b);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterRect * clutter_rect_normalize (ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_rect_get_center (ClutterRect *rect,
|
||||
ClutterPoint *center);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_rect_contains_point (ClutterRect *rect,
|
||||
ClutterPoint *point);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_rect_contains_rect (ClutterRect *a,
|
||||
ClutterRect *b);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_rect_union (ClutterRect *a,
|
||||
ClutterRect *b,
|
||||
ClutterRect *res);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_rect_intersection (ClutterRect *a,
|
||||
ClutterRect *b,
|
||||
ClutterRect *res);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_rect_offset (ClutterRect *rect,
|
||||
float d_x,
|
||||
float d_y);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_rect_inset (ClutterRect *rect,
|
||||
float d_x,
|
||||
float d_y);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_rect_scale (ClutterRect *rect,
|
||||
float s_x,
|
||||
float s_y);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_rect_clamp_to_pixel (ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_rect_get_x (ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_rect_get_y (ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_rect_get_width (ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_rect_get_height (ClutterRect *rect);
|
||||
|
||||
/**
|
||||
* ClutterVertex:
|
||||
* @x: X coordinate of the vertex
|
||||
* @y: Y coordinate of the vertex
|
||||
* @z: Z coordinate of the vertex
|
||||
*
|
||||
* A point in 3D space, expressed in pixels
|
||||
*
|
||||
* Since: 0.4
|
||||
*/
|
||||
struct _ClutterVertex
|
||||
{
|
||||
gfloat x;
|
||||
gfloat y;
|
||||
gfloat z;
|
||||
};
|
||||
|
||||
/**
|
||||
* CLUTTER_VERTEX_INIT:
|
||||
* @x: the X coordinate of the vertex
|
||||
* @y: the Y coordinate of the vertex
|
||||
* @z: the Z coordinate of the vertex
|
||||
*
|
||||
* A simple macro for initializing a #ClutterVertex when declaring it, e.g.:
|
||||
*
|
||||
* |[
|
||||
* ClutterVertex v = CLUTTER_VERTEX_INIT (x, y, z);
|
||||
* ]|
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
#define CLUTTER_VERTEX_INIT(x,y,z) { (x), (y), (z) }
|
||||
|
||||
/**
|
||||
* CLUTTER_VERTEX_INIT_ZERO:
|
||||
*
|
||||
* A simple macro for initializing a #ClutterVertex to (0, 0, 0).
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
#define CLUTTER_VERTEX_INIT_ZERO CLUTTER_VERTEX_INIT (0.f, 0.f, 0.f)
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_vertex_get_type (void) G_GNUC_CONST;
|
||||
CLUTTER_EXPORT
|
||||
ClutterVertex *clutter_vertex_new (gfloat x,
|
||||
gfloat y,
|
||||
gfloat z);
|
||||
CLUTTER_EXPORT
|
||||
ClutterVertex *clutter_vertex_alloc (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterVertex *clutter_vertex_init (ClutterVertex *vertex,
|
||||
gfloat x,
|
||||
gfloat y,
|
||||
gfloat z);
|
||||
CLUTTER_EXPORT
|
||||
ClutterVertex *clutter_vertex_copy (const ClutterVertex *vertex);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_vertex_free (ClutterVertex *vertex);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_vertex_equal (const ClutterVertex *vertex_a,
|
||||
const ClutterVertex *vertex_b);
|
||||
|
||||
/**
|
||||
* ClutterActorBox:
|
||||
* @x1: X coordinate of the top left corner
|
||||
@@ -541,8 +230,8 @@ gboolean clutter_actor_box_contains (const ClutterActorBox *box,
|
||||
gfloat x,
|
||||
gfloat y);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_box_from_vertices (ClutterActorBox *box,
|
||||
const ClutterVertex verts[]);
|
||||
void clutter_actor_box_from_vertices (ClutterActorBox *box,
|
||||
const graphene_point3d_t verts[]);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_box_interpolate (const ClutterActorBox *initial,
|
||||
const ClutterActorBox *final,
|
||||
@@ -568,41 +257,6 @@ CLUTTER_EXPORT
|
||||
void clutter_actor_box_scale (ClutterActorBox *box,
|
||||
gfloat scale);
|
||||
|
||||
/**
|
||||
* ClutterGeometry:
|
||||
* @x: X coordinate of the top left corner of an actor
|
||||
* @y: Y coordinate of the top left corner of an actor
|
||||
* @width: width of an actor
|
||||
* @height: height of an actor
|
||||
*
|
||||
* The rectangle containing an actor's bounding box, measured in pixels.
|
||||
*
|
||||
* You should not use #ClutterGeometry, or operate on its fields
|
||||
* directly; you should use #cairo_rectangle_int_t or #ClutterRect if you
|
||||
* need a rectangle type, depending on the precision required.
|
||||
*
|
||||
* Deprecated: 1.16
|
||||
*/
|
||||
struct _ClutterGeometry
|
||||
{
|
||||
/*< public >*/
|
||||
gint x;
|
||||
gint y;
|
||||
guint width;
|
||||
guint height;
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_geometry_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_geometry_union (const ClutterGeometry *geometry_a,
|
||||
const ClutterGeometry *geometry_b,
|
||||
ClutterGeometry *result);
|
||||
CLUTTER_DEPRECATED
|
||||
gboolean clutter_geometry_intersects (const ClutterGeometry *geometry0,
|
||||
const ClutterGeometry *geometry1);
|
||||
|
||||
/**
|
||||
* ClutterKnot:
|
||||
* @x: X coordinate of the knot
|
||||
@@ -674,10 +328,10 @@ void clutter_paint_volume_free (ClutterPaintVolume
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||
const ClutterVertex *origin);
|
||||
const graphene_point3d_t *origin);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_volume_get_origin (const ClutterPaintVolume *pv,
|
||||
ClutterVertex *vertex);
|
||||
graphene_point3d_t *vertex);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_volume_set_width (ClutterPaintVolume *pv,
|
||||
gfloat width);
|
||||
|
@@ -51,8 +51,8 @@ void
|
||||
_clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
const CoglMatrix *projection,
|
||||
const float *viewport,
|
||||
const ClutterVertex *vertices_in,
|
||||
ClutterVertex *vertices_out,
|
||||
const graphene_point3d_t *vertices_in,
|
||||
graphene_point3d_t *vertices_out,
|
||||
int n_vertices)
|
||||
{
|
||||
CoglMatrix modelview_projection;
|
||||
@@ -69,7 +69,7 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
modelview);
|
||||
cogl_matrix_project_points (&modelview_projection,
|
||||
3,
|
||||
sizeof (ClutterVertex),
|
||||
sizeof (graphene_point3d_t),
|
||||
vertices_in,
|
||||
sizeof (ClutterVertex4),
|
||||
vertices_tmp,
|
||||
@@ -79,7 +79,7 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
{
|
||||
cogl_matrix_transform_points (modelview,
|
||||
3,
|
||||
sizeof (ClutterVertex),
|
||||
sizeof (graphene_point3d_t),
|
||||
vertices_in,
|
||||
sizeof (ClutterVertex4),
|
||||
vertices_tmp,
|
||||
@@ -97,7 +97,7 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
for (i = 0; i < n_vertices; i++)
|
||||
{
|
||||
ClutterVertex4 vertex_tmp = vertices_tmp[i];
|
||||
ClutterVertex *vertex_out = &vertices_out[i];
|
||||
graphene_point3d_t *vertex_out = &vertices_out[i];
|
||||
/* Finally translate from OpenGL coords to window coords */
|
||||
vertex_out->x = MTX_GL_SCALE_X (vertex_tmp.x, vertex_tmp.w,
|
||||
viewport[2], viewport[0]);
|
||||
@@ -108,9 +108,9 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
|
||||
void
|
||||
_clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
||||
ClutterRect *dest)
|
||||
graphene_rect_t *dest)
|
||||
{
|
||||
*dest = (ClutterRect) {
|
||||
*dest = (graphene_rect_t) {
|
||||
.origin = {
|
||||
.x = src->x,
|
||||
.y = src->y
|
||||
@@ -123,12 +123,12 @@ _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_util_rectangle_int_extents (const ClutterRect *src,
|
||||
_clutter_util_rectangle_int_extents (const graphene_rect_t *src,
|
||||
cairo_rectangle_int_t *dest)
|
||||
{
|
||||
ClutterRect tmp = *src;
|
||||
graphene_rect_t tmp = *src;
|
||||
|
||||
clutter_rect_clamp_to_pixel (&tmp);
|
||||
graphene_rect_round_extents (&tmp, &tmp);
|
||||
|
||||
*dest = (cairo_rectangle_int_t) {
|
||||
.x = tmp.origin.x,
|
||||
@@ -299,48 +299,12 @@ _clutter_util_matrix_skew_yz (ClutterMatrix *matrix,
|
||||
matrix->zw += matrix->yw * factor;
|
||||
}
|
||||
|
||||
static float
|
||||
_clutter_util_vertex_length (const ClutterVertex *vertex)
|
||||
{
|
||||
return sqrtf (vertex->x * vertex->x + vertex->y * vertex->y + vertex->z * vertex->z);
|
||||
}
|
||||
|
||||
static void
|
||||
_clutter_util_vertex_normalize (ClutterVertex *vertex)
|
||||
{
|
||||
float factor = _clutter_util_vertex_length (vertex);
|
||||
|
||||
if (factor == 0.f)
|
||||
return;
|
||||
|
||||
vertex->x /= factor;
|
||||
vertex->y /= factor;
|
||||
vertex->z /= factor;
|
||||
}
|
||||
|
||||
static float
|
||||
_clutter_util_vertex_dot (const ClutterVertex *v1,
|
||||
const ClutterVertex *v2)
|
||||
{
|
||||
return v1->x * v2->x + v1->y * v2->y + v1->z * v2->z;
|
||||
}
|
||||
|
||||
static void
|
||||
_clutter_util_vertex_cross (const ClutterVertex *v1,
|
||||
const ClutterVertex *v2,
|
||||
ClutterVertex *res)
|
||||
{
|
||||
res->x = v1->y * v2->z - v2->y * v1->z;
|
||||
res->y = v1->z * v2->x - v2->z * v1->x;
|
||||
res->z = v1->x * v2->y - v2->x * v1->y;
|
||||
}
|
||||
|
||||
static void
|
||||
_clutter_util_vertex_combine (const ClutterVertex *a,
|
||||
const ClutterVertex *b,
|
||||
double ascl,
|
||||
double bscl,
|
||||
ClutterVertex *res)
|
||||
_clutter_util_vertex_combine (const graphene_point3d_t *a,
|
||||
const graphene_point3d_t *b,
|
||||
double ascl,
|
||||
double bscl,
|
||||
graphene_point3d_t *res)
|
||||
{
|
||||
res->x = (ascl * a->x) + (bscl * b->x);
|
||||
res->y = (ascl * a->y) + (bscl * b->y);
|
||||
@@ -388,16 +352,16 @@ _clutter_util_vertex4_interpolate (const ClutterVertex4 *a,
|
||||
*/
|
||||
gboolean
|
||||
_clutter_util_matrix_decompose (const ClutterMatrix *src,
|
||||
ClutterVertex *scale_p,
|
||||
graphene_point3d_t *scale_p,
|
||||
float shear_p[3],
|
||||
ClutterVertex *rotate_p,
|
||||
ClutterVertex *translate_p,
|
||||
graphene_point3d_t *rotate_p,
|
||||
graphene_point3d_t *translate_p,
|
||||
ClutterVertex4 *perspective_p)
|
||||
{
|
||||
CoglMatrix matrix = *src;
|
||||
CoglMatrix perspective;
|
||||
ClutterVertex4 vertex_tmp;
|
||||
ClutterVertex row[3], pdum;
|
||||
graphene_point3d_t row[3], pdum;
|
||||
int i, j;
|
||||
|
||||
#define XY_SHEAR 0
|
||||
@@ -485,34 +449,34 @@ _clutter_util_matrix_decompose (const ClutterMatrix *src,
|
||||
}
|
||||
|
||||
/* compute scale.x and normalize the first row */
|
||||
scale_p->x = _clutter_util_vertex_length (&row[0]);
|
||||
_clutter_util_vertex_normalize (&row[0]);
|
||||
scale_p->x = graphene_point3d_length (&row[0]);
|
||||
graphene_point3d_normalize (&row[0], &row[0]);
|
||||
|
||||
/* compute XY shear and make the second row orthogonal to the first */
|
||||
shear_p[XY_SHEAR] = _clutter_util_vertex_dot (&row[0], &row[1]);
|
||||
shear_p[XY_SHEAR] = graphene_point3d_dot (&row[0], &row[1]);
|
||||
_clutter_util_vertex_combine (&row[1], &row[0],
|
||||
1.0, -shear_p[XY_SHEAR],
|
||||
&row[1]);
|
||||
|
||||
/* compute the Y scale and normalize the second row */
|
||||
scale_p->y = _clutter_util_vertex_length (&row[1]);
|
||||
_clutter_util_vertex_normalize (&row[1]);
|
||||
scale_p->y = graphene_point3d_length (&row[1]);
|
||||
graphene_point3d_normalize (&row[1], &row[1]);
|
||||
shear_p[XY_SHEAR] /= scale_p->y;
|
||||
|
||||
/* compute XZ and YZ shears, orthogonalize the third row */
|
||||
shear_p[XZ_SHEAR] = _clutter_util_vertex_dot (&row[0], &row[2]);
|
||||
shear_p[XZ_SHEAR] = graphene_point3d_dot (&row[0], &row[2]);
|
||||
_clutter_util_vertex_combine (&row[2], &row[0],
|
||||
1.0, -shear_p[XZ_SHEAR],
|
||||
&row[2]);
|
||||
|
||||
shear_p[YZ_SHEAR] = _clutter_util_vertex_dot (&row[1], &row[2]);
|
||||
shear_p[YZ_SHEAR] = graphene_point3d_dot (&row[1], &row[2]);
|
||||
_clutter_util_vertex_combine (&row[2], &row[1],
|
||||
1.0, -shear_p[YZ_SHEAR],
|
||||
&row[2]);
|
||||
|
||||
/* get the Z scale and normalize the third row*/
|
||||
scale_p->z = _clutter_util_vertex_length (&row[2]);
|
||||
_clutter_util_vertex_normalize (&row[2]);
|
||||
scale_p->z = graphene_point3d_length (&row[2]);
|
||||
graphene_point3d_normalize (&row[2], &row[2]);
|
||||
shear_p[XZ_SHEAR] /= scale_p->z;
|
||||
shear_p[YZ_SHEAR] /= scale_p->z;
|
||||
|
||||
@@ -520,8 +484,8 @@ _clutter_util_matrix_decompose (const ClutterMatrix *src,
|
||||
* check for a coordinate system flip; if the determinant
|
||||
* is -1, then negate the matrix and scaling factors
|
||||
*/
|
||||
_clutter_util_vertex_cross (&row[1], &row[2], &pdum);
|
||||
if (_clutter_util_vertex_dot (&row[0], &pdum) < 0.f)
|
||||
graphene_point3d_cross (&row[1], &row[2], &pdum);
|
||||
if (graphene_point3d_dot (&row[0], &pdum) < 0.f)
|
||||
{
|
||||
scale_p->x *= -1.f;
|
||||
|
||||
|
@@ -172,6 +172,7 @@ void clutter_virtual_input_device_notify_touch_up (ClutterVirtualInputDevice *vi
|
||||
CLUTTER_EXPORT
|
||||
ClutterDeviceManager * clutter_virtual_input_device_get_manager (ClutterVirtualInputDevice *virtual_device);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
int clutter_virtual_input_device_get_device_type (ClutterVirtualInputDevice *virtual_device);
|
||||
|
||||
#endif /* __CLUTTER_VIRTUAL_INPUT_DEVICE_H__ */
|
||||
|
@@ -80,9 +80,9 @@ struct _ClutterZoomActionPrivate
|
||||
|
||||
ZoomPoint points[2];
|
||||
|
||||
ClutterPoint initial_focal_point;
|
||||
ClutterPoint focal_point;
|
||||
ClutterPoint transformed_focal_point;
|
||||
graphene_point_t initial_focal_point;
|
||||
graphene_point_t focal_point;
|
||||
graphene_point_t transformed_focal_point;
|
||||
|
||||
gfloat initial_x;
|
||||
gfloat initial_y;
|
||||
@@ -238,13 +238,13 @@ clutter_zoom_action_gesture_cancel (ClutterGestureAction *action,
|
||||
static gboolean
|
||||
clutter_zoom_action_real_zoom (ClutterZoomAction *action,
|
||||
ClutterActor *actor,
|
||||
ClutterPoint *focal_point,
|
||||
graphene_point_t *focal_point,
|
||||
gdouble factor)
|
||||
{
|
||||
ClutterZoomActionPrivate *priv = action->priv;
|
||||
gfloat x, y, z;
|
||||
gdouble scale_x, scale_y;
|
||||
ClutterVertex out, in;
|
||||
graphene_point3d_t out, in;
|
||||
|
||||
in.x = priv->transformed_focal_point.x;
|
||||
in.y = priv->transformed_focal_point.y;
|
||||
@@ -400,7 +400,7 @@ clutter_zoom_action_class_init (ClutterZoomActionClass *klass)
|
||||
_clutter_marshal_BOOLEAN__OBJECT_BOXED_DOUBLE,
|
||||
G_TYPE_BOOLEAN, 3,
|
||||
CLUTTER_TYPE_ACTOR,
|
||||
CLUTTER_TYPE_POINT,
|
||||
GRAPHENE_TYPE_POINT,
|
||||
G_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
@@ -478,7 +478,7 @@ clutter_zoom_action_get_zoom_axis (ClutterZoomAction *action)
|
||||
/**
|
||||
* clutter_zoom_action_get_focal_point:
|
||||
* @action: a #ClutterZoomAction
|
||||
* @point: (out): a #ClutterPoint
|
||||
* @point: (out): a #graphene_point_t
|
||||
*
|
||||
* Retrieves the focal point of the current zoom
|
||||
*
|
||||
@@ -486,7 +486,7 @@ clutter_zoom_action_get_zoom_axis (ClutterZoomAction *action)
|
||||
*/
|
||||
void
|
||||
clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
|
||||
ClutterPoint *point)
|
||||
graphene_point_t *point)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_ZOOM_ACTION (action));
|
||||
g_return_if_fail (point != NULL);
|
||||
@@ -497,7 +497,7 @@ clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
|
||||
/**
|
||||
* clutter_zoom_action_get_transformed_focal_point:
|
||||
* @action: a #ClutterZoomAction
|
||||
* @point: (out): a #ClutterPoint
|
||||
* @point: (out): a #graphene_point_t
|
||||
*
|
||||
* Retrieves the focal point relative to the actor's coordinates of
|
||||
* the current zoom
|
||||
@@ -506,7 +506,7 @@ clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
|
||||
*/
|
||||
void
|
||||
clutter_zoom_action_get_transformed_focal_point (ClutterZoomAction *action,
|
||||
ClutterPoint *point)
|
||||
graphene_point_t *point)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_ZOOM_ACTION (action));
|
||||
g_return_if_fail (point != NULL);
|
||||
|
@@ -79,7 +79,7 @@ struct _ClutterZoomActionClass
|
||||
/*< public >*/
|
||||
gboolean (* zoom) (ClutterZoomAction *action,
|
||||
ClutterActor *actor,
|
||||
ClutterPoint *focal_point,
|
||||
graphene_point_t *focal_point,
|
||||
gdouble factor);
|
||||
|
||||
/*< private >*/
|
||||
@@ -104,10 +104,10 @@ ClutterZoomAxis clutter_zoom_action_get_zoom_axis (ClutterZoomActi
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
|
||||
ClutterPoint *point);
|
||||
graphene_point_t *point);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_zoom_action_get_transformed_focal_point (ClutterZoomAction *action,
|
||||
ClutterPoint *point);
|
||||
graphene_point_t *point);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -103,7 +103,6 @@
|
||||
#include "clutter-stage-manager.h"
|
||||
#include "clutter-stage-view.h"
|
||||
#include "clutter-tap-action.h"
|
||||
#include "clutter-test-utils.h"
|
||||
#include "clutter-texture.h"
|
||||
#include "clutter-text.h"
|
||||
#include "clutter-timeline.h"
|
||||
|
@@ -204,7 +204,7 @@ clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window,
|
||||
if (max_render_time_allowed <= 0)
|
||||
{
|
||||
g_warning ("Unsupported monitor refresh rate detected. "
|
||||
"(Refresh rate: %.3f, refresh interval: %ld)",
|
||||
"(Refresh rate: %.3f, refresh interval: %" G_GINT64_FORMAT ")",
|
||||
refresh_rate,
|
||||
refresh_interval);
|
||||
stage_cogl->update_time = now;
|
||||
@@ -625,14 +625,14 @@ is_buffer_age_enabled (void)
|
||||
}
|
||||
|
||||
static void
|
||||
scale_and_clamp_rect (const ClutterRect *rect,
|
||||
scale_and_clamp_rect (const graphene_rect_t *rect,
|
||||
float scale,
|
||||
cairo_rectangle_int_t *dest)
|
||||
|
||||
{
|
||||
ClutterRect tmp = *rect;
|
||||
graphene_rect_t tmp = *rect;
|
||||
|
||||
clutter_rect_scale (&tmp, scale, scale);
|
||||
graphene_rect_scale (&tmp, scale, scale, &tmp);
|
||||
_clutter_util_rectangle_int_extents (&tmp, dest);
|
||||
}
|
||||
|
||||
@@ -699,12 +699,12 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
* frames when starting up... */
|
||||
cogl_onscreen_get_frame_counter (COGL_ONSCREEN (fb)) > 3)
|
||||
{
|
||||
ClutterRect rect;
|
||||
graphene_rect_t rect;
|
||||
|
||||
may_use_clipped_redraw = TRUE;
|
||||
|
||||
_clutter_util_rect_from_rectangle (&redraw_clip, &rect);
|
||||
clutter_rect_offset (&rect, -view_rect.x, -view_rect.y);
|
||||
graphene_rect_offset (&rect, -view_rect.x, -view_rect.y);
|
||||
scale_and_clamp_rect (&rect, fb_scale, &fb_clip_region);
|
||||
|
||||
if (fb_scale != floorf (fb_scale))
|
||||
@@ -742,7 +742,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
|
||||
if (valid_buffer_age (view_cogl, age))
|
||||
{
|
||||
ClutterRect rect;
|
||||
graphene_rect_t rect;
|
||||
cairo_rectangle_int_t damage_region;
|
||||
|
||||
*current_fb_damage = fb_clip_region;
|
||||
@@ -802,7 +802,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
}
|
||||
else if (use_clipped_redraw)
|
||||
{
|
||||
ClutterRect rect;
|
||||
graphene_rect_t rect;
|
||||
cairo_rectangle_int_t scissor_rect;
|
||||
cairo_rectangle_int_t paint_rect;
|
||||
|
||||
@@ -848,7 +848,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
may_use_clipped_redraw &&
|
||||
!clip_region_empty)
|
||||
{
|
||||
ClutterRect rect;
|
||||
graphene_rect_t rect;
|
||||
cairo_rectangle_int_t scissor_rect;
|
||||
cairo_rectangle_int_t paint_rect;
|
||||
|
||||
@@ -1004,55 +1004,6 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
|
||||
COGL_TRACE_END (ClutterStageCoglRedraw);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_stage_cogl_get_dirty_pixel (ClutterStageWindow *stage_window,
|
||||
ClutterStageView *view,
|
||||
int *x,
|
||||
int *y)
|
||||
{
|
||||
CoglFramebuffer *framebuffer = clutter_stage_view_get_framebuffer (view);
|
||||
gboolean has_buffer_age =
|
||||
cogl_is_onscreen (framebuffer) &&
|
||||
is_buffer_age_enabled ();
|
||||
float fb_scale;
|
||||
gboolean scale_is_fractional;
|
||||
|
||||
fb_scale = clutter_stage_view_get_scale (view);
|
||||
if (fb_scale != floorf (fb_scale))
|
||||
scale_is_fractional = TRUE;
|
||||
else
|
||||
scale_is_fractional = FALSE;
|
||||
|
||||
/*
|
||||
* Buffer damage is tracked in the framebuffer coordinate space
|
||||
* using the damage history. When fractional scaling is used, a
|
||||
* coordinate on the stage might not correspond to the exact position of any
|
||||
* physical pixel, which causes issues when painting using the pick mode.
|
||||
*
|
||||
* For now, always use the (0, 0) pixel for picking when using fractional
|
||||
* framebuffer scaling.
|
||||
*/
|
||||
if (!has_buffer_age || scale_is_fractional)
|
||||
{
|
||||
*x = 0;
|
||||
*y = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ClutterStageViewCogl *view_cogl = CLUTTER_STAGE_VIEW_COGL (view);
|
||||
ClutterStageViewCoglPrivate *view_priv =
|
||||
clutter_stage_view_cogl_get_instance_private (view_cogl);
|
||||
cairo_rectangle_int_t view_layout;
|
||||
cairo_rectangle_int_t *fb_damage;
|
||||
|
||||
clutter_stage_view_get_layout (view, &view_layout);
|
||||
|
||||
fb_damage = &view_priv->damage_history[DAMAGE_HISTORY (view_priv->damage_index - 1)];
|
||||
*x = fb_damage->x / fb_scale;
|
||||
*y = fb_damage->y / fb_scale;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface)
|
||||
{
|
||||
@@ -1070,7 +1021,6 @@ clutter_stage_window_iface_init (ClutterStageWindowInterface *iface)
|
||||
iface->ignoring_redraw_clips = clutter_stage_cogl_ignoring_redraw_clips;
|
||||
iface->get_redraw_clip_bounds = clutter_stage_cogl_get_redraw_clip_bounds;
|
||||
iface->redraw = clutter_stage_cogl_redraw;
|
||||
iface->get_dirty_pixel = clutter_stage_cogl_get_dirty_pixel;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -1,44 +0,0 @@
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
#include "deprecated/clutter-actor.h"
|
||||
|
||||
#include "clutter-actor-private.h"
|
||||
#include "clutter-private.h"
|
||||
|
||||
/**
|
||||
* clutter_actor_get_allocation_geometry:
|
||||
* @self: A #ClutterActor
|
||||
* @geom: (out): allocation geometry in pixels
|
||||
*
|
||||
* Gets the layout box an actor has been assigned. The allocation can
|
||||
* only be assumed valid inside a paint() method; anywhere else, it
|
||||
* may be out-of-date.
|
||||
*
|
||||
* An allocation does not incorporate the actor's scale or anchor point;
|
||||
* those transformations do not affect layout, only rendering.
|
||||
*
|
||||
* The returned rectangle is in pixels.
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
* Deprecated: 1.12: Use clutter_actor_get_allocation_box() instead.
|
||||
*/
|
||||
void
|
||||
clutter_actor_get_allocation_geometry (ClutterActor *self,
|
||||
ClutterGeometry *geom)
|
||||
{
|
||||
ClutterActorBox box;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||
g_return_if_fail (geom != NULL);
|
||||
|
||||
clutter_actor_get_allocation_box (self, &box);
|
||||
|
||||
geom->x = CLUTTER_NEARBYINT (clutter_actor_box_get_x (&box));
|
||||
geom->y = CLUTTER_NEARBYINT (clutter_actor_box_get_y (&box));
|
||||
geom->width = CLUTTER_NEARBYINT (clutter_actor_box_get_width (&box));
|
||||
geom->height = CLUTTER_NEARBYINT (clutter_actor_box_get_height (&box));
|
||||
}
|
@@ -145,10 +145,6 @@ CLUTTER_DEPRECATED
|
||||
void clutter_actor_get_transformation_matrix (ClutterActor *self,
|
||||
ClutterMatrix *matrix);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR (clutter_actor_get_allocation_box)
|
||||
void clutter_actor_get_allocation_geometry (ClutterActor *self,
|
||||
ClutterGeometry *geom);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_ACTOR_DEPRECATED_H__ */
|
||||
|
@@ -567,8 +567,7 @@ clutter_animation_class_init (ClutterAnimationClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterAnimationClass, started),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -589,8 +588,7 @@ clutter_animation_class_init (ClutterAnimationClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterAnimationClass, completed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
@@ -2222,7 +2220,7 @@ clutter_actor_animate_with_timeline (ClutterActor *actor,
|
||||
*
|
||||
* Will animate the "rotation-angle-z" property between the current value
|
||||
* and 360 degrees, and set the "rotation-center-z" property to the fixed
|
||||
* value of the #ClutterVertex "center".
|
||||
* value of the #graphene_point3d_t "center".
|
||||
*
|
||||
* This function will implicitly create a #ClutterAnimation object which
|
||||
* will be assigned to the @actor and will be returned to the developer
|
||||
|
@@ -258,8 +258,7 @@ clutter_behaviour_class_init (ClutterBehaviourClass *klass)
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterBehaviourClass, applied),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
/**
|
||||
@@ -279,8 +278,7 @@ clutter_behaviour_class_init (ClutterBehaviourClass *klass)
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterBehaviourClass, removed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
}
|
||||
|
@@ -294,7 +294,7 @@ clutter_cairo_texture_context_destroy (void *data)
|
||||
cogl_texture = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (cairo));
|
||||
if (cairo_width == 0 ||
|
||||
cairo_height == 0 ||
|
||||
cogl_texture == COGL_INVALID_HANDLE)
|
||||
cogl_texture == NULL)
|
||||
{
|
||||
draw_context_destroy (ctxt);
|
||||
return;
|
||||
@@ -507,7 +507,7 @@ clutter_cairo_texture_create_surface (ClutterCairoTexture *self,
|
||||
cairo_stride,
|
||||
cairo_data);
|
||||
clutter_texture_set_cogl_texture (CLUTTER_TEXTURE (self), cogl_texture);
|
||||
cogl_handle_unref (cogl_texture);
|
||||
cogl_object_unref (cogl_texture);
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
@@ -65,16 +65,6 @@ void clutter_container_remove_valist (ClutterContaine
|
||||
CLUTTER_DEPRECATED_FOR(clutter_actor_get_children)
|
||||
GList * clutter_container_get_children (ClutterContainer *container);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_container_foreach (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_container_foreach_with_internals (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_actor_set_child_above_sibling)
|
||||
void clutter_container_raise_child (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
|
@@ -170,20 +170,6 @@ clutter_group_real_actor_removed (ClutterContainer *container,
|
||||
priv->children = g_list_remove (priv->children, actor);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_group_real_foreach (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
ClutterGroupPrivate *priv = CLUTTER_GROUP (container)->priv;
|
||||
|
||||
/* Using g_list_foreach instead of iterating the list manually
|
||||
because it has better protection against the current node being
|
||||
removed. This will happen for example if someone calls
|
||||
clutter_container_foreach(container, clutter_actor_destroy) */
|
||||
g_list_foreach (priv->children, (GFunc) callback, user_data);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_group_real_raise (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
@@ -285,7 +271,6 @@ clutter_container_iface_init (ClutterContainerIface *iface)
|
||||
iface->actor_added = clutter_group_real_actor_added;
|
||||
iface->remove = clutter_group_real_remove;
|
||||
iface->actor_removed = clutter_group_real_actor_removed;
|
||||
iface->foreach = clutter_group_real_foreach;
|
||||
iface->raise = clutter_group_real_raise;
|
||||
iface->lower = clutter_group_real_lower;
|
||||
iface->sort_depth_order = clutter_group_real_sort_depth_order;
|
||||
@@ -306,13 +291,12 @@ clutter_group_real_paint (ClutterActor *actor)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_group_real_pick (ClutterActor *actor,
|
||||
const ClutterColor *pick)
|
||||
clutter_group_real_pick (ClutterActor *actor)
|
||||
{
|
||||
ClutterGroupPrivate *priv = CLUTTER_GROUP (actor)->priv;
|
||||
|
||||
/* Chain up so we get a bounding box pained (if we are reactive) */
|
||||
CLUTTER_ACTOR_CLASS (clutter_group_parent_class)->pick (actor, pick);
|
||||
CLUTTER_ACTOR_CLASS (clutter_group_parent_class)->pick (actor);
|
||||
|
||||
g_list_foreach (priv->children, (GFunc) clutter_actor_paint, NULL);
|
||||
}
|
||||
@@ -391,21 +375,28 @@ clutter_group_dispose (GObject *object)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_group_real_show_all (ClutterActor *actor)
|
||||
clutter_group_real_show_all (ClutterActor *self)
|
||||
{
|
||||
clutter_container_foreach (CLUTTER_CONTAINER (actor),
|
||||
CLUTTER_CALLBACK (clutter_actor_show),
|
||||
NULL);
|
||||
clutter_actor_show (actor);
|
||||
ClutterActorIter iter;
|
||||
ClutterActor *actor;
|
||||
|
||||
clutter_actor_iter_init (&iter, self);
|
||||
while (clutter_actor_iter_next (&iter, &actor))
|
||||
clutter_actor_show (actor);
|
||||
|
||||
clutter_actor_show (self);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_group_real_hide_all (ClutterActor *actor)
|
||||
{
|
||||
ClutterActorIter iter;
|
||||
|
||||
clutter_actor_hide (actor);
|
||||
clutter_container_foreach (CLUTTER_CONTAINER (actor),
|
||||
CLUTTER_CALLBACK (clutter_actor_hide),
|
||||
NULL);
|
||||
|
||||
clutter_actor_iter_init (&iter, actor);
|
||||
while (clutter_actor_iter_next (&iter, &actor))
|
||||
clutter_actor_hide (actor);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@@ -84,7 +84,7 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
static CoglPipeline *default_color_pipeline = NULL;
|
||||
CoglPipeline *content_pipeline;
|
||||
ClutterGeometry geom;
|
||||
ClutterActorBox alloc;
|
||||
CoglColor color;
|
||||
guint8 tmp_alpha;
|
||||
|
||||
@@ -92,7 +92,7 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
"painting rect '%s'",
|
||||
clutter_actor_get_name (self) ? clutter_actor_get_name (self)
|
||||
: "unknown");
|
||||
clutter_actor_get_allocation_geometry (self, &geom);
|
||||
clutter_actor_get_allocation_box (self, &alloc);
|
||||
|
||||
if (G_UNLIKELY (default_color_pipeline == NULL))
|
||||
{
|
||||
@@ -140,40 +140,41 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
/* We paint the border and the content only if the rectangle
|
||||
* is big enough to show them
|
||||
*/
|
||||
if ((priv->border_width * 2) < geom.width &&
|
||||
(priv->border_width * 2) < geom.height)
|
||||
if ((priv->border_width * 2) < clutter_actor_box_get_width (&alloc) &&
|
||||
(priv->border_width * 2) < clutter_actor_box_get_height (&alloc))
|
||||
{
|
||||
/* paint the border. this sucks, but it's the only way to make a border */
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
border_pipeline,
|
||||
priv->border_width, 0,
|
||||
geom.width,
|
||||
clutter_actor_box_get_width (&alloc),
|
||||
priv->border_width);
|
||||
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
border_pipeline,
|
||||
geom.width - priv->border_width,
|
||||
clutter_actor_box_get_width (&alloc) - priv->border_width,
|
||||
priv->border_width,
|
||||
geom.width, geom.height);
|
||||
clutter_actor_box_get_width (&alloc),
|
||||
clutter_actor_box_get_height (&alloc));
|
||||
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
border_pipeline,
|
||||
0, geom.height - priv->border_width,
|
||||
geom.width - priv->border_width,
|
||||
geom.height);
|
||||
0, clutter_actor_box_get_height (&alloc) - priv->border_width,
|
||||
clutter_actor_box_get_width (&alloc) - priv->border_width,
|
||||
clutter_actor_box_get_height (&alloc));
|
||||
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
border_pipeline,
|
||||
0, 0,
|
||||
priv->border_width,
|
||||
geom.height - priv->border_width);
|
||||
clutter_actor_box_get_height (&alloc) - priv->border_width);
|
||||
|
||||
/* now paint the rectangle */
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
content_pipeline,
|
||||
priv->border_width, priv->border_width,
|
||||
geom.width - priv->border_width,
|
||||
geom.height - priv->border_width);
|
||||
clutter_actor_box_get_width (&alloc) - priv->border_width,
|
||||
clutter_actor_box_get_height (&alloc) - priv->border_width);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -183,7 +184,9 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
*/
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
border_pipeline,
|
||||
0, 0, geom.width, geom.height);
|
||||
0, 0,
|
||||
clutter_actor_box_get_width (&alloc),
|
||||
clutter_actor_box_get_height (&alloc));
|
||||
}
|
||||
|
||||
cogl_object_unref (border_pipeline);
|
||||
@@ -192,7 +195,9 @@ clutter_rectangle_paint (ClutterActor *self)
|
||||
{
|
||||
cogl_framebuffer_draw_rectangle (framebuffer,
|
||||
content_pipeline,
|
||||
0, 0, geom.width, geom.height);
|
||||
0, 0,
|
||||
clutter_actor_box_get_width (&alloc),
|
||||
clutter_actor_box_get_height (&alloc));
|
||||
}
|
||||
|
||||
cogl_object_unref (content_pipeline);
|
||||
|
@@ -74,20 +74,6 @@ gboolean clutter_stage_is_default (ClutterStage *stage);
|
||||
CLUTTER_DEPRECATED_FOR(clutter_actor_queue_redraw)
|
||||
void clutter_stage_queue_redraw (ClutterStage *stage);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_stage_set_use_fog (ClutterStage *stage,
|
||||
gboolean fog);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
gboolean clutter_stage_get_use_fog (ClutterStage *stage);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_stage_set_fog (ClutterStage *stage,
|
||||
ClutterFog *fog);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_stage_get_fog (ClutterStage *stage,
|
||||
ClutterFog *fog);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_actor_set_background_color)
|
||||
void clutter_stage_set_color (ClutterStage *stage,
|
||||
|
@@ -1423,8 +1423,7 @@ clutter_state_class_init (ClutterStateClass *klass)
|
||||
G_TYPE_FROM_CLASS (gobject_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterStateClass, completed),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
|
@@ -438,7 +438,7 @@ set_viewport_with_buffer_under_fbo_source (ClutterActor *fbo_source,
|
||||
* falling back to a stage sized fbo with an offset of (0,0)
|
||||
*/
|
||||
|
||||
ClutterVertex verts[4];
|
||||
graphene_point3d_t verts[4];
|
||||
float x_min = G_MAXFLOAT, y_min = G_MAXFLOAT;
|
||||
int i;
|
||||
|
||||
@@ -572,83 +572,6 @@ gen_texcoords_and_draw_cogl_rectangle (ClutterActor *self,
|
||||
0, 0, t_w, t_h);
|
||||
}
|
||||
|
||||
static CoglPipeline *
|
||||
create_pick_pipeline (ClutterActor *self)
|
||||
{
|
||||
ClutterTexture *texture = CLUTTER_TEXTURE (self);
|
||||
ClutterTexturePrivate *priv = texture->priv;
|
||||
CoglPipeline *pick_pipeline = cogl_pipeline_copy (texture_template_pipeline);
|
||||
GError *error = NULL;
|
||||
|
||||
if (!cogl_pipeline_set_layer_combine (pick_pipeline, 0,
|
||||
"RGBA = "
|
||||
" MODULATE (CONSTANT, TEXTURE[A])",
|
||||
&error))
|
||||
{
|
||||
if (!priv->seen_create_pick_pipeline_warning)
|
||||
g_warning ("Error setting up texture combine for shaped "
|
||||
"texture picking: %s", error->message);
|
||||
priv->seen_create_pick_pipeline_warning = TRUE;
|
||||
g_error_free (error);
|
||||
cogl_object_unref (pick_pipeline);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cogl_pipeline_set_blend (pick_pipeline,
|
||||
"RGBA = ADD (SRC_COLOR[RGBA], 0)",
|
||||
NULL);
|
||||
|
||||
cogl_pipeline_set_alpha_test_function (pick_pipeline,
|
||||
COGL_PIPELINE_ALPHA_FUNC_EQUAL,
|
||||
1.0);
|
||||
|
||||
return pick_pipeline;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_texture_pick (ClutterActor *self,
|
||||
const ClutterColor *color)
|
||||
{
|
||||
ClutterTexture *texture = CLUTTER_TEXTURE (self);
|
||||
ClutterTexturePrivate *priv = texture->priv;
|
||||
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||
|
||||
if (!clutter_actor_should_pick_paint (self))
|
||||
return;
|
||||
|
||||
if (G_LIKELY (priv->pick_with_alpha_supported) && priv->pick_with_alpha)
|
||||
{
|
||||
CoglColor pick_color;
|
||||
|
||||
if (priv->pick_pipeline == NULL)
|
||||
priv->pick_pipeline = create_pick_pipeline (self);
|
||||
|
||||
if (priv->pick_pipeline == NULL)
|
||||
{
|
||||
priv->pick_with_alpha_supported = FALSE;
|
||||
CLUTTER_ACTOR_CLASS (clutter_texture_parent_class)->pick (self,
|
||||
color);
|
||||
return;
|
||||
}
|
||||
|
||||
if (priv->fbo_handle != NULL)
|
||||
update_fbo (self);
|
||||
|
||||
cogl_color_init_from_4ub (&pick_color,
|
||||
color->red,
|
||||
color->green,
|
||||
color->blue,
|
||||
0xff);
|
||||
cogl_pipeline_set_layer_combine_constant (priv->pick_pipeline,
|
||||
0, &pick_color);
|
||||
cogl_pipeline_set_layer_texture (priv->pick_pipeline, 0,
|
||||
clutter_texture_get_cogl_texture (texture));
|
||||
gen_texcoords_and_draw_cogl_rectangle (self, priv->pick_pipeline, framebuffer);
|
||||
}
|
||||
else
|
||||
CLUTTER_ACTOR_CLASS (clutter_texture_parent_class)->pick (self, color);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_texture_paint (ClutterActor *self)
|
||||
{
|
||||
@@ -767,12 +690,6 @@ clutter_texture_dispose (GObject *object)
|
||||
priv->pipeline = NULL;
|
||||
}
|
||||
|
||||
if (priv->pick_pipeline != NULL)
|
||||
{
|
||||
cogl_object_unref (priv->pick_pipeline);
|
||||
priv->pick_pipeline = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (clutter_texture_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
@@ -944,7 +861,6 @@ clutter_texture_class_init (ClutterTextureClass *klass)
|
||||
GParamSpec *pspec;
|
||||
|
||||
actor_class->paint = clutter_texture_paint;
|
||||
actor_class->pick = clutter_texture_pick;
|
||||
actor_class->get_paint_volume = clutter_texture_get_paint_volume;
|
||||
actor_class->realize = clutter_texture_realize;
|
||||
actor_class->unrealize = clutter_texture_unrealize;
|
||||
@@ -1166,8 +1082,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
|
||||
G_TYPE_FROM_CLASS (gobject_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTextureClass, pixbuf_change),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE,
|
||||
0);
|
||||
/**
|
||||
@@ -1188,8 +1103,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
|
||||
G_TYPE_FROM_CLASS (gobject_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTextureClass, load_finished),
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__BOXED,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE,
|
||||
1,
|
||||
G_TYPE_ERROR);
|
||||
@@ -1263,11 +1177,9 @@ clutter_texture_init (ClutterTexture *self)
|
||||
priv->repeat_y = FALSE;
|
||||
priv->sync_actor_size = TRUE;
|
||||
priv->fbo_handle = NULL;
|
||||
priv->pick_pipeline = NULL;
|
||||
priv->keep_aspect_ratio = FALSE;
|
||||
priv->pick_with_alpha = FALSE;
|
||||
priv->pick_with_alpha_supported = TRUE;
|
||||
priv->seen_create_pick_pipeline_warning = FALSE;
|
||||
|
||||
if (G_UNLIKELY (texture_template_pipeline == NULL))
|
||||
{
|
||||
@@ -1317,7 +1229,7 @@ clutter_texture_get_cogl_material (ClutterTexture *texture)
|
||||
* Replaces the underlying Cogl material drawn by this actor with
|
||||
* @cogl_material. A reference to the material is taken so if the
|
||||
* handle is no longer needed it should be deref'd with
|
||||
* cogl_handle_unref. Texture data is attached to the material so
|
||||
* cogl_object_unref. Texture data is attached to the material so
|
||||
* calling this function also replaces the Cogl
|
||||
* texture. #ClutterTexture requires that the material have a texture
|
||||
* layer so you should set one on the material before calling this
|
||||
@@ -1390,7 +1302,7 @@ get_first_layer_index (CoglPipeline *pipeline, int *layer_index)
|
||||
*
|
||||
* Retrieves the handle to the underlying COGL texture used for drawing
|
||||
* the actor. No extra reference is taken so if you need to keep the
|
||||
* handle then you should call cogl_handle_ref() on it.
|
||||
* handle then you should call cogl_object_ref() on it.
|
||||
*
|
||||
* The texture handle returned is the first layer of the material
|
||||
* handle used by the #ClutterTexture. If you need to access the other
|
||||
@@ -1430,7 +1342,7 @@ clutter_texture_get_cogl_texture (ClutterTexture *texture)
|
||||
*
|
||||
* Replaces the underlying COGL texture drawn by this actor with
|
||||
* @cogl_tex. A reference to the texture is taken so if the handle is
|
||||
* no longer needed it should be deref'd with cogl_handle_unref.
|
||||
* no longer needed it should be deref'd with cogl_object_unref.
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
@@ -1565,7 +1477,7 @@ clutter_texture_set_from_data (ClutterTexture *texture,
|
||||
|
||||
g_set_error (&inner_error, CLUTTER_TEXTURE_ERROR,
|
||||
CLUTTER_TEXTURE_ERROR_BAD_FORMAT,
|
||||
_("Failed to load the image data"));
|
||||
"Failed to load the image data");
|
||||
|
||||
g_signal_emit (texture, texture_signals[LOAD_FINISHED], 0, inner_error);
|
||||
|
||||
@@ -1724,7 +1636,7 @@ clutter_texture_set_from_yuv_data (ClutterTexture *texture,
|
||||
{
|
||||
g_set_error (error, CLUTTER_TEXTURE_ERROR,
|
||||
CLUTTER_TEXTURE_ERROR_NO_YUV,
|
||||
_("YUV textures are not supported"));
|
||||
"YUV textures are not supported");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1733,7 +1645,7 @@ clutter_texture_set_from_yuv_data (ClutterTexture *texture,
|
||||
{
|
||||
g_set_error (error, CLUTTER_TEXTURE_ERROR,
|
||||
CLUTTER_TEXTURE_ERROR_BAD_FORMAT,
|
||||
_("YUV2 textures are not supported"));
|
||||
"YUV2 textures are not supported");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1960,7 +1872,7 @@ clutter_texture_async_load (ClutterTexture *self,
|
||||
{
|
||||
g_set_error (error, CLUTTER_TEXTURE_ERROR,
|
||||
CLUTTER_TEXTURE_ERROR_BAD_FORMAT,
|
||||
_("Failed to load the image data"));
|
||||
"Failed to load the image data");
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
@@ -2057,7 +1969,7 @@ clutter_texture_set_from_file (ClutterTexture *texture,
|
||||
{
|
||||
g_set_error (&internal_error, CLUTTER_TEXTURE_ERROR,
|
||||
CLUTTER_TEXTURE_ERROR_BAD_FORMAT,
|
||||
_("Failed to load the image data"));
|
||||
"Failed to load the image data");
|
||||
}
|
||||
|
||||
if (internal_error != NULL)
|
||||
@@ -2359,7 +2271,7 @@ clutter_texture_set_area_from_rgb_data (ClutterTexture *texture,
|
||||
{
|
||||
g_set_error (error, CLUTTER_TEXTURE_ERROR,
|
||||
CLUTTER_TEXTURE_ERROR_BAD_FORMAT,
|
||||
_("Failed to load the image data"));
|
||||
"Failed to load the image data");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -3050,13 +2962,8 @@ clutter_texture_set_pick_with_alpha (ClutterTexture *texture,
|
||||
if (priv->pick_with_alpha == pick_with_alpha)
|
||||
return;
|
||||
|
||||
if (!pick_with_alpha && priv->pick_pipeline != NULL)
|
||||
{
|
||||
cogl_object_unref (priv->pick_pipeline);
|
||||
priv->pick_pipeline = NULL;
|
||||
}
|
||||
g_assert (!pick_with_alpha); /* No longer supported */
|
||||
|
||||
/* NB: the pick pipeline is created lazily when we first pick */
|
||||
priv->pick_with_alpha = pick_with_alpha;
|
||||
|
||||
/* NB: actors are expected to call clutter_actor_queue_redraw when
|
||||
|
@@ -40,10 +40,6 @@
|
||||
/* This is a Cogl based backend */
|
||||
#include "cogl/clutter-stage-cogl.h"
|
||||
|
||||
#ifdef HAVE_EVDEV
|
||||
#include "evdev/clutter-device-manager-evdev.h"
|
||||
#endif
|
||||
|
||||
#include "clutter-debug.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-main.h"
|
||||
|
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright (C) 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/>.
|
||||
*
|
||||
* Author: Damien Lespiau <damien.lespiau@intel.com>
|
||||
*/
|
||||
|
||||
#ifndef __CLUTTER_DEVICE_MANAGER_EVDEV_H__
|
||||
#define __CLUTTER_DEVICE_MANAGER_EVDEV_H__
|
||||
|
||||
#include <clutter/clutter-backend.h>
|
||||
#include <clutter/clutter-device-manager.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_DEVICE_MANAGER_EVDEV (clutter_device_manager_evdev_get_type ())
|
||||
#define CLUTTER_DEVICE_MANAGER_EVDEV(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_DEVICE_MANAGER_EVDEV, ClutterDeviceManagerEvdev))
|
||||
#define CLUTTER_IS_DEVICE_MANAGER_EVDEV(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_DEVICE_MANAGER_EVDEV))
|
||||
#define CLUTTER_DEVICE_MANAGER_EVDEV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_DEVICE_MANAGER_EVDEV, ClutterDeviceManagerEvdevClass))
|
||||
#define CLUTTER_IS_DEVICE_MANAGER_EVDEV_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_DEVICE_MANAGER_EVDEV))
|
||||
#define CLUTTER_DEVICE_MANAGER_EVDEV_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_DEVICE_MANAGER_EVDEV, ClutterDeviceManagerEvdevClass))
|
||||
|
||||
typedef struct _ClutterDeviceManagerEvdev ClutterDeviceManagerEvdev;
|
||||
typedef struct _ClutterDeviceManagerEvdevClass ClutterDeviceManagerEvdevClass;
|
||||
typedef struct _ClutterDeviceManagerEvdevPrivate ClutterDeviceManagerEvdevPrivate;
|
||||
|
||||
typedef struct _ClutterSeatEvdev ClutterSeatEvdev;
|
||||
|
||||
struct _ClutterDeviceManagerEvdev
|
||||
{
|
||||
ClutterDeviceManager parent_instance;
|
||||
|
||||
ClutterDeviceManagerEvdevPrivate *priv;
|
||||
};
|
||||
|
||||
struct _ClutterDeviceManagerEvdevClass
|
||||
{
|
||||
ClutterDeviceManagerClass parent_class;
|
||||
};
|
||||
|
||||
GType clutter_device_manager_evdev_get_type (void) G_GNUC_CONST;
|
||||
|
||||
void _clutter_events_evdev_init (ClutterBackend *backend);
|
||||
void _clutter_events_evdev_uninit (ClutterBackend *backend);
|
||||
|
||||
gint _clutter_device_manager_evdev_acquire_device_id (ClutterDeviceManagerEvdev *manager_evdev);
|
||||
|
||||
void _clutter_device_manager_evdev_release_device_id (ClutterDeviceManagerEvdev *manager_evdev,
|
||||
ClutterInputDevice *device);
|
||||
|
||||
ClutterStage * _clutter_device_manager_evdev_get_stage (ClutterDeviceManagerEvdev *manager_evdev);
|
||||
|
||||
void _clutter_device_manager_evdev_constrain_pointer (ClutterDeviceManagerEvdev *manager_evdev,
|
||||
ClutterInputDevice *core_pointer,
|
||||
uint64_t time_us,
|
||||
float x,
|
||||
float y,
|
||||
float *new_x,
|
||||
float *new_y);
|
||||
|
||||
void _clutter_device_manager_evdev_filter_relative_motion (ClutterDeviceManagerEvdev *manager_evdev,
|
||||
ClutterInputDevice *device,
|
||||
float x,
|
||||
float y,
|
||||
float *dx,
|
||||
float *dy);
|
||||
|
||||
void _clutter_device_manager_evdev_dispatch (ClutterDeviceManagerEvdev *manager_evdev);
|
||||
|
||||
struct xkb_state * _clutter_device_manager_evdev_get_xkb_state (ClutterDeviceManagerEvdev *manager_evdev);
|
||||
|
||||
static inline guint64
|
||||
us (guint64 us)
|
||||
{
|
||||
return us;
|
||||
}
|
||||
|
||||
static inline guint64
|
||||
ms2us (guint64 ms)
|
||||
{
|
||||
return us (ms * 1000);
|
||||
}
|
||||
|
||||
static inline guint32
|
||||
us2ms (guint64 us)
|
||||
{
|
||||
return (guint32) (us / 1000);
|
||||
}
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_DEVICE_MANAGER_EVDEV_H__ */
|
@@ -1,181 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright (C) 2012 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/>.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __CLUTTER_EVDEV_H__
|
||||
#define __CLUTTER_EVDEV_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
#include <clutter/clutter.h>
|
||||
#include <libinput.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#if !defined(CLUTTER_ENABLE_COMPOSITOR_API) && !defined(CLUTTER_COMPILATION)
|
||||
#error "You need to define CLUTTER_ENABLE_COMPOSITOR_API before including clutter-evdev.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ClutterOpenDeviceCallback:
|
||||
* @path: the device path
|
||||
* @flags: flags to be passed to open
|
||||
*
|
||||
* This callback will be called when Clutter needs to access an input
|
||||
* device. It should return an open file descriptor for the file at @path,
|
||||
* or -1 if opening failed.
|
||||
*/
|
||||
typedef int (*ClutterOpenDeviceCallback) (const char *path,
|
||||
int flags,
|
||||
gpointer user_data,
|
||||
GError **error);
|
||||
typedef void (*ClutterCloseDeviceCallback) (int fd,
|
||||
gpointer user_data);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_evdev_set_device_callbacks (ClutterOpenDeviceCallback open_callback,
|
||||
ClutterCloseDeviceCallback close_callback,
|
||||
gpointer user_data);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_evdev_set_seat_id (const gchar *seat_id);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_evdev_release_devices (void);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_evdev_reclaim_devices (void);
|
||||
|
||||
/**
|
||||
* ClutterPointerConstrainCallback:
|
||||
* @device: the core pointer device
|
||||
* @time: the event time in milliseconds
|
||||
* @x: (inout): the new X coordinate
|
||||
* @y: (inout): the new Y coordinate
|
||||
* @user_data: user data passed to this function
|
||||
*
|
||||
* This callback will be called for all pointer motion events, and should
|
||||
* update (@x, @y) to constrain the pointer position appropriately.
|
||||
* The subsequent motion event will use the updated values as the new coordinates.
|
||||
* Note that the coordinates are not clamped to the stage size, and the callback
|
||||
* must make sure that this happens before it returns.
|
||||
* Also note that the event will be emitted even if the pointer is constrained
|
||||
* to be in the same position.
|
||||
*
|
||||
* Since: 1.16
|
||||
*/
|
||||
typedef void (*ClutterPointerConstrainCallback) (ClutterInputDevice *device,
|
||||
guint32 time,
|
||||
float prev_x,
|
||||
float prev_y,
|
||||
float *x,
|
||||
float *y,
|
||||
gpointer user_data);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_evdev_set_pointer_constrain_callback (ClutterDeviceManager *evdev,
|
||||
ClutterPointerConstrainCallback callback,
|
||||
gpointer user_data,
|
||||
GDestroyNotify user_data_notify);
|
||||
|
||||
typedef void (*ClutterRelativeMotionFilter) (ClutterInputDevice *device,
|
||||
float x,
|
||||
float y,
|
||||
float *dx,
|
||||
float *dy,
|
||||
gpointer user_data);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_evdev_set_relative_motion_filter (ClutterDeviceManager *evdev,
|
||||
ClutterRelativeMotionFilter filter,
|
||||
gpointer user_data);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_evdev_set_keyboard_map (ClutterDeviceManager *evdev,
|
||||
struct xkb_keymap *keymap);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
struct xkb_keymap * clutter_evdev_get_keyboard_map (ClutterDeviceManager *evdev);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_evdev_set_keyboard_layout_index (ClutterDeviceManager *evdev,
|
||||
xkb_layout_index_t idx);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
xkb_layout_index_t clutter_evdev_get_keyboard_layout_index (ClutterDeviceManager *evdev);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_evdev_set_keyboard_numlock (ClutterDeviceManager *evdev,
|
||||
gboolean numlock_state);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_evdev_set_keyboard_repeat (ClutterDeviceManager *evdev,
|
||||
gboolean repeat,
|
||||
guint32 delay,
|
||||
guint32 interval);
|
||||
|
||||
typedef gboolean (* ClutterEvdevFilterFunc) (struct libinput_event *event,
|
||||
gpointer data);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_evdev_add_filter (ClutterEvdevFilterFunc func,
|
||||
gpointer data,
|
||||
GDestroyNotify destroy_notify);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_evdev_remove_filter (ClutterEvdevFilterFunc func,
|
||||
gpointer data);
|
||||
CLUTTER_EXPORT
|
||||
struct libinput_device * clutter_evdev_input_device_get_libinput_device (ClutterInputDevice *device);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gint32 clutter_evdev_event_sequence_get_slot (const ClutterEventSequence *sequence);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_evdev_warp_pointer (ClutterInputDevice *pointer_device,
|
||||
guint32 time_,
|
||||
int x,
|
||||
int y);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
guint32 clutter_evdev_event_get_event_code (const ClutterEvent *event);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
guint64 clutter_evdev_event_get_time_usec (const ClutterEvent *event);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_evdev_event_get_relative_motion (const ClutterEvent *event,
|
||||
double *dx,
|
||||
double *dy,
|
||||
double *dx_unaccel,
|
||||
double *dy_unaccel);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_evdev_input_device_tool_set_pressure_curve (ClutterInputDeviceTool *tool,
|
||||
gdouble curve[4]);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_evdev_input_device_tool_set_button_code (ClutterInputDeviceTool *tool,
|
||||
guint button,
|
||||
guint evcode);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_EVDEV_H__ */
|
@@ -1,191 +0,0 @@
|
||||
/* Clutter.
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright (C) 2015 Red Hat
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* Authored by:
|
||||
* Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter/clutter-device-manager-private.h"
|
||||
#include "clutter/clutter-event-private.h"
|
||||
#include "clutter-input-device-evdev.h"
|
||||
#include "clutter-evdev.h"
|
||||
|
||||
typedef struct _ClutterEventEvdev ClutterEventEvdev;
|
||||
|
||||
struct _ClutterEventEvdev
|
||||
{
|
||||
guint32 evcode;
|
||||
|
||||
guint64 time_usec;
|
||||
|
||||
gboolean has_relative_motion;
|
||||
double dx;
|
||||
double dy;
|
||||
double dx_unaccel;
|
||||
double dy_unaccel;
|
||||
};
|
||||
|
||||
static ClutterEventEvdev *
|
||||
_clutter_event_evdev_new (void)
|
||||
{
|
||||
return g_slice_new0 (ClutterEventEvdev);
|
||||
}
|
||||
|
||||
ClutterEventEvdev *
|
||||
_clutter_event_evdev_copy (ClutterEventEvdev *event_evdev)
|
||||
{
|
||||
if (event_evdev != NULL)
|
||||
return g_slice_dup (ClutterEventEvdev, event_evdev);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_event_evdev_free (ClutterEventEvdev *event_evdev)
|
||||
{
|
||||
if (event_evdev != NULL)
|
||||
g_slice_free (ClutterEventEvdev, event_evdev);
|
||||
}
|
||||
|
||||
static ClutterEventEvdev *
|
||||
clutter_evdev_event_ensure_platform_data (ClutterEvent *event)
|
||||
{
|
||||
ClutterEventEvdev *event_evdev = _clutter_event_get_platform_data (event);
|
||||
|
||||
if (!event_evdev)
|
||||
{
|
||||
event_evdev = _clutter_event_evdev_new ();
|
||||
_clutter_event_set_platform_data (event, event_evdev);
|
||||
}
|
||||
|
||||
return event_evdev;
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_evdev_event_set_event_code (ClutterEvent *event,
|
||||
guint32 evcode)
|
||||
{
|
||||
ClutterEventEvdev *event_evdev;
|
||||
|
||||
event_evdev = clutter_evdev_event_ensure_platform_data (event);
|
||||
event_evdev->evcode = evcode;
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_evdev_event_set_time_usec (ClutterEvent *event,
|
||||
guint64 time_usec)
|
||||
{
|
||||
ClutterEventEvdev *event_evdev;
|
||||
|
||||
event_evdev = clutter_evdev_event_ensure_platform_data (event);
|
||||
event_evdev->time_usec = time_usec;
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_evdev_event_set_relative_motion (ClutterEvent *event,
|
||||
double dx,
|
||||
double dy,
|
||||
double dx_unaccel,
|
||||
double dy_unaccel)
|
||||
{
|
||||
ClutterEventEvdev *event_evdev;
|
||||
|
||||
event_evdev = clutter_evdev_event_ensure_platform_data (event);
|
||||
event_evdev->dx = dx;
|
||||
event_evdev->dy = dy;
|
||||
event_evdev->dx_unaccel = dx_unaccel;
|
||||
event_evdev->dy_unaccel = dy_unaccel;
|
||||
event_evdev->has_relative_motion = TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_evdev_event_get_event_code:
|
||||
* @event: a #ClutterEvent
|
||||
*
|
||||
* Returns the event code of the original event. See linux/input.h for more
|
||||
* information.
|
||||
*
|
||||
* Returns: The event code.
|
||||
**/
|
||||
guint32
|
||||
clutter_evdev_event_get_event_code (const ClutterEvent *event)
|
||||
{
|
||||
ClutterEventEvdev *event_evdev = _clutter_event_get_platform_data (event);
|
||||
|
||||
if (event_evdev)
|
||||
return event_evdev->evcode;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_evdev_event_get_time_usec:
|
||||
* @event: a #ClutterEvent
|
||||
*
|
||||
* Returns the time in microsecond granularity, or 0 if unavailable.
|
||||
*
|
||||
* Returns: The time in microsecond granularity, or 0 if unavailable.
|
||||
*/
|
||||
guint64
|
||||
clutter_evdev_event_get_time_usec (const ClutterEvent *event)
|
||||
{
|
||||
ClutterEventEvdev *event_evdev = _clutter_event_get_platform_data (event);
|
||||
|
||||
if (event_evdev)
|
||||
return event_evdev->time_usec;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_evdev_event_get_pointer_motion
|
||||
* @event: a #ClutterEvent
|
||||
*
|
||||
* If available, the normal and unaccelerated motion deltas are written
|
||||
* to the dx, dy, dx_unaccel and dy_unaccel and TRUE is returned.
|
||||
*
|
||||
* If unavailable, FALSE is returned.
|
||||
*
|
||||
* Returns: TRUE on success, otherwise FALSE.
|
||||
**/
|
||||
gboolean
|
||||
clutter_evdev_event_get_relative_motion (const ClutterEvent *event,
|
||||
double *dx,
|
||||
double *dy,
|
||||
double *dx_unaccel,
|
||||
double *dy_unaccel)
|
||||
{
|
||||
ClutterEventEvdev *event_evdev = _clutter_event_get_platform_data (event);
|
||||
|
||||
if (event_evdev && event_evdev->has_relative_motion)
|
||||
{
|
||||
if (dx)
|
||||
*dx = event_evdev->dx;
|
||||
if (dy)
|
||||
*dy = event_evdev->dy;
|
||||
if (dx_unaccel)
|
||||
*dx_unaccel = event_evdev->dx_unaccel;
|
||||
if (dy_unaccel)
|
||||
*dy_unaccel = event_evdev->dy_unaccel;
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user