Compare commits
1 Commits
wip/carlos
...
wip/nielsd
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e04cbddf92 |
@@ -1,4 +1,4 @@
|
||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v3
|
||||
image: registry.gitlab.gnome.org/gnome/mutter/master:v2
|
||||
|
||||
stages:
|
||||
- review
|
||||
@@ -28,20 +28,6 @@ build-mutter:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
||||
build-without-native-backend-and-wayland:
|
||||
stage: build
|
||||
script:
|
||||
- meson . build -Dbuildtype=debugoptimized -Dnative_backend=false -Dudev=false -Dwayland=false -Dcore_tests=false --werror --prefix /usr
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
artifacts:
|
||||
expire_in: 1 day
|
||||
paths:
|
||||
- build
|
||||
only:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
||||
test-mutter:
|
||||
stage: test
|
||||
dependencies:
|
||||
@@ -72,7 +58,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 -Dman=false
|
||||
- meson gnome-shell gnome-shell/build --prefix /usr
|
||||
- ninja -C gnome-shell/build install
|
||||
only:
|
||||
- merge_requests
|
||||
|
@@ -1,26 +1,24 @@
|
||||
# Rebuild and push with
|
||||
#
|
||||
# cd .gitlab-ci/
|
||||
# docker build --no-cache -t registry.gitlab.gnome.org/gnome/mutter/master:v3 .
|
||||
# docker push registry.gitlab.gnome.org/gnome/mutter/master:v3
|
||||
#
|
||||
|
||||
FROM fedora:31
|
||||
FROM fedora:30
|
||||
|
||||
RUN dnf -y update && dnf -y upgrade && \
|
||||
dnf install -y 'dnf-command(builddep)' && \
|
||||
dnf install -y 'dnf-command(copr)' && \
|
||||
dnf copr enable -y fmuellner/gnome-shell-ci && \
|
||||
dnf -y update && dnf -y upgrade && \
|
||||
|
||||
dnf builddep -y mutter && \
|
||||
|
||||
# Until Fedora catches up with new build-deps
|
||||
dnf install -y 'pkgconfig(graphene-gobject-1.0)' 'pkgconfig(sysprof-capture-3)' && \
|
||||
# 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 && \
|
||||
|
||||
# For running unit tests
|
||||
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 '*/xvfb-run' gdm-lib accountsservice-libs && \
|
||||
|
||||
# Unpackaged versions
|
||||
dnf install -y https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00834984-gsettings-desktop-schemas/gsettings-desktop-schemas-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00834984-gsettings-desktop-schemas/gsettings-desktop-schemas-devel-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm && \
|
||||
dnf install -y https://copr-be.cloud.fedoraproject.org/results/hergertme/sysprof-3/fedora-30-x86_64/00917385-sysprof/libsysprof-ui-3.33.2-1.fc30.x86_64.rpm https://copr-be.cloud.fedoraproject.org/results/hergertme/sysprof-3/fedora-30-x86_64/00917385-sysprof/sysprof-cli-3.33.2-1.fc30.x86_64.rpm https://copr-be.cloud.fedoraproject.org/results/hergertme/sysprof-3/fedora-30-x86_64/00917385-sysprof/sysprof-3.33.2-1.fc30.x86_64.rpm https://copr-be.cloud.fedoraproject.org/results/hergertme/sysprof-3/fedora-30-x86_64/00917385-sysprof/sysprof-devel-3.33.2-1.fc30.x86_64.rpm && \
|
||||
|
||||
dnf install -y intltool redhat-rpm-config make && \
|
||||
|
||||
# GNOME Shell
|
||||
dnf builddep -y gnome-shell --setopt=install_weak_deps=False && \
|
||||
dnf remove -y gnome-bluetooth-libs-devel dbus-glib-devel upower-devel python3-devel && \
|
||||
|
@@ -40,12 +40,11 @@ function commit_message_subject_is_compliant() {
|
||||
return 0
|
||||
}
|
||||
|
||||
RET=0
|
||||
for commit in $commits; do
|
||||
commit_short=$(echo $commit | cut -c -8)
|
||||
|
||||
if ! commit_message_has_url $commit; then
|
||||
echo "Commit $commit_short needs a merge request or issue URL"
|
||||
echo "Missing merge request or issue URL on commit $commit_short"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -53,8 +52,6 @@ for commit in $commits; do
|
||||
if [ $? != 0 ]; then
|
||||
echo "Commit message for $commit_short is not compliant:"
|
||||
echo "$errors"
|
||||
RET=1
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
exit $RET
|
||||
|
192
NEWS
192
NEWS
@@ -1,195 +1,3 @@
|
||||
3.35.1
|
||||
======
|
||||
* Fix immediate screen blank after releaseing inhibitor [Tim; #573]
|
||||
* Respond to frame callbacks regardless of damage [Jonas; !839]
|
||||
* selection [Carlos; !842]
|
||||
* Fix Night Light on wayland [Jonas; !840]
|
||||
* Fix various copy+paste/DND regressions [Carlos; !848, #789, #842,
|
||||
#793, #845, #854]
|
||||
* Misc. bug fixes and cleanups [Daniel, Marco, Jonas, Georges;
|
||||
!841, !764, !837, !846]
|
||||
|
||||
Contributors:
|
||||
Marco Trevisan (Treviño), Carlos Garnacho, Tim Klocke,
|
||||
Georges Basile Stavracas Neto, Daniel van Vugt, Jonas Ådahl
|
||||
|
||||
3.34.1
|
||||
======
|
||||
* Fix startup of X11 session services on wayland [Carlos; #771]
|
||||
* Fix _NET_ACTIVE_WINDOW emission [Carlos; #751]
|
||||
* Fix initial view perspective [Marco; !803]
|
||||
* Fix screenshots and window animations when scaled [Robert; !758]
|
||||
* Re-enable coredumps when capabilities are set [Jonas; !811]
|
||||
* Fix scaling of DND surface actors [Robert; !780]
|
||||
* Optimize blitting of untransformed offscreen stage views [Olivier; !809, !820]
|
||||
* Fix freeze of pointer event delivery on X11 [Olivier; !821]
|
||||
* Fix scaling of stylus input coordinates with HiDPI [Dorian; !830]
|
||||
* Fix memory leak when using implicit animations [Jonas; !828]
|
||||
* Fix numlock state for native backend [Carlos; #769]
|
||||
* Fixed crashes [Marco, Olivier, Jonas Å.; !805, #823, !808, !825,
|
||||
#844, !826, #779]
|
||||
* Misc. bug fixes and cleanups [Jonas Å., Georges, Jonas D., Michal, Daniel,
|
||||
Iain, Adam, Marco, Carlos, Ting-Wei, Hans, Robert; !787, !795, !791, !797,
|
||||
!772, !775, !799, !778, !785, !782, !796, #819, !814, !769, !817, !783, !786,
|
||||
!829, !774, #822]
|
||||
|
||||
Contributors:
|
||||
Marco Trevisan (Treviño), Jonas Dreßler, Olivier Fourdan, Carlos Garnacho,
|
||||
Hans de Goede, Adam Jackson, Ting-Wei Lan, Iain Lane, Michal Lazo,
|
||||
Robert Mader, Georges Basile Stavracas Neto, Dorian Stoll, Daniel van Vugt,
|
||||
Jonas Ådahl
|
||||
|
||||
Translators:
|
||||
Milo Casagrande [it], Nathan Follens [nl], Matej Urbančič [sl],
|
||||
Ask Hjorth Larsen [da], Alan Mortensen [da], Jordi Mas [ca]
|
||||
|
||||
3.34.0
|
||||
======
|
||||
* Fix xdg-output v3 support [Olivier; !771]
|
||||
* Fix crash when changing decoration state [Jonas; !773]
|
||||
* Add and remove connectors on hot-plug [Jonas; !743]
|
||||
|
||||
Contributors:
|
||||
Olivier Fourdan, Jonas Ådahl
|
||||
|
||||
Translators:
|
||||
Rafael Fontenelle [pt_BR], Gwan-gyeong Mun [ko], Christian Kirbach [de],
|
||||
Claude Paroz [fr], Milo Casagrande [it], Emin Tufan Çetin [tr],
|
||||
Ryuta Fujii [ja]
|
||||
|
||||
3.33.92
|
||||
=======
|
||||
* Turn MetaShapedTexture into a ClutterContent implementation [Georges; !409]
|
||||
* Restore inhibit shortcut for overlay key [Olivier; #734]
|
||||
* Misc. pointer a11y improvements [Jonas D., Olivier; !746, !747, !745, !761]
|
||||
* Fix position of drag surfaces [Robert; !684]
|
||||
* Implement subsurface.place_below() for parents [Robert; !664]
|
||||
* Add meta_window_actor_get_image() [Jonas Å.; !752]
|
||||
* Revert faulty optimization from !719 [Jonas Å.; #735]
|
||||
* Add additional sysprof trace points [Jonas Å.; !757, !765]
|
||||
* Remove GLX "threaded swap wait" used on Nvidia [Daniel; !602]
|
||||
* Implement geometric picking [Daniel; !189]
|
||||
* Fix lost keyboard focus after DND [Olivier; #747]
|
||||
* Misc. bug fixes and cleanups [Florian, Carlos, Piotr, Hans, Georges, Robert,
|
||||
Ray, Mart, Rémi; !740, !672, !749, !751, !753, !730, !755, !756, !750, !715,
|
||||
#738944, !657, !768]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Rémi Bernon, Piotr Drąg, Jonas Dreßler, Olivier Fourdan,
|
||||
Carlos Garnacho, Hans de Goede, Robert Mader, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Mart Raudsepp, Ray Strode, Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Piotr Drąg [pl], Марко Костић [sr], Rūdolfs Mazurs [lv], Matej Urbančič [sl],
|
||||
Balázs Úr [hu], Fran Dieguez [gl], Jordi Mas [ca], Anders Jonsson [sv],
|
||||
Trần Ngọc Quân [vi], Tim Sabsch [de], Fabio Tomat [fur], Goran Vidović [hr],
|
||||
Marek Černocký [cs]
|
||||
|
||||
3.33.91
|
||||
=======
|
||||
* Fix primary selection copy and paste between X11 and wayland [Hans; #702]
|
||||
* Improve monitor hotplug support [Hans; !713]
|
||||
* Remove a source of frame skips [Daniel; !719]
|
||||
* Fix windows being lowered after unmaximizing with double click [Olivier; #88]
|
||||
* Remove Clutter API for global grabs [Jonas D.; !536]
|
||||
* Improve processing of incompressible events [Daniel; !711]
|
||||
* Add xdg-output v3 support [Olivier; !704]
|
||||
* Misc. bug fixes and cleanups [Jonas Å., Marco, Carlos, Adam, Albert, Niels,
|
||||
Olivier, Florian; !722, !385, !728, !726, !500, !731, !727, !700, !735, !738]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Albert Vaca Cintora, Jonas Dreßler, Olivier Fourdan,
|
||||
Carlos Garnacho, Hans de Goede, Niels De Graef, Adam Jackson, Florian Müllner,
|
||||
Marco Trevisan (Treviño), Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Asier Sarasua Garmendia [eu], Kukuh Syafaat [id], Florentina Mușat [ro],
|
||||
Aurimas Černius [lt], Daniel Mustieles [es]
|
||||
|
||||
3.33.90
|
||||
=======
|
||||
* Fix visibility of clones with hidden source [Florian; #683]
|
||||
* Reduce freezes when opening some popup windows [Carlos; #556]
|
||||
* Be more thorough when excluding obscured areas from painting [Carlos; !698]
|
||||
* Make it possible to start Xwayland on demand [Carlos; !709]
|
||||
* clutter: Expose layout_manager to transitions [Florian; !716]
|
||||
* Misc. bug fixes and cleanups [Mark, Florian, Iain, Niels, Carlos, Ray; !671,
|
||||
!691, !694, !696, !703, !707, !697, !710, !708, !714, #719, !721]
|
||||
|
||||
Contributors:
|
||||
Mark Blakeney, Carlos Garnacho, Niels De Graef, Iain Lane, Florian Müllner,
|
||||
Ray Strode
|
||||
|
||||
Translators:
|
||||
Asier Sarasua Garmendia [eu], Rafael Fontenelle [pt_BR], Fabio Tomat [fur],
|
||||
Florentina Mușat [ro]
|
||||
|
||||
3.33.4
|
||||
======
|
||||
* Discard page flip retries on hotplug [Jonas; !630]
|
||||
* Add xdg-output v2 support [Olivier; #645]
|
||||
* Restore DRM format fallbacks [Jonas; !662]
|
||||
* Don't emit ::size-changed when only position changed [Daniel; !568]
|
||||
* Expose workspace layout properties [Florian; !618]
|
||||
* Don't use grab modifiers when shortcuts are inhibited [Olivier; #642]
|
||||
* Fix stuttering due to unchanged power save mode notifications [Georges; !674]
|
||||
* Add API to reorder workspaces [Adam; !670]
|
||||
* Make picking a new focus window more reliable [Marco; !669]
|
||||
* Defer actor allocation till shown [Carlos; !677]
|
||||
* Try to use primary GPU for copy instead of glReadPixels [Pekka; !615]
|
||||
* Unset pointer focus when the cursor is hidden [Jonas D.; !448]
|
||||
* Fix modifier-drag on wayland subsurfaces [Robert; !604]
|
||||
* Fix background corruption on Nvidia after resuming from suspend [Daniel; !600]
|
||||
* Only grab the locate-pointer key when necessary [Olivier; !685, #647]
|
||||
* Misc. bug fixes and cleanups [Florian, Jonas, Daniel, Robert, Olivier,
|
||||
Georges, Marco, Carlos, Emmanuele; !648, !650, !647, !656, !658, !637,
|
||||
!663, !660, !659, !665, !666, !668, !667, #667, !676, !678, #672, !680,
|
||||
!683, !688, !689, !687]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Emmanuele Bassi, Adam Bieńkowski, Piotr Drąg, Jonas Dreßler,
|
||||
Olivier Fourdan, Carlos Garnacho, Robert Mader, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Pekka Paalanen, Marco Trevisan (Treviño),
|
||||
Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Fabio Tomat [fur], Kukuh Syafaat [id]
|
||||
|
||||
3.33.3
|
||||
======
|
||||
* Prepare for running Xwayland on demand [Carlos; !420]
|
||||
* Fix text selection color rendering [Florian; #494]
|
||||
* Fix black shadows when using fractional scaling [Robert; #609]
|
||||
* Honor startup sequence workspace on wayland [Carlos; gnome-shell#674]
|
||||
* Only emit 'grab-op-end` signal after dropping grabs [Marco; !596]
|
||||
* Add a Sysprof-based profiler [Jonas, Georges; !197, !603]
|
||||
* Relax "xwayland-allow-grabs" setting [Olivier; #597]
|
||||
* Implement locate-pointer accessibility feature [Olivier; !453]
|
||||
* Implement mouse accessibility [Olivier; !512]
|
||||
* Consolidate frame throttling [Daniel, Georges; !363]
|
||||
* Fix setting blank cursor under wayland [Jonas; #630]
|
||||
* Pixel-align OpenGL cursors [Jonas; !610]
|
||||
* Handle returning from fullscreen/maximization better [Jonas; !621]
|
||||
* Improve screencast support on multi-monitor systems [Georges; !623]
|
||||
* Fix running X11 applications with sudo under wayland [Hans; #643]
|
||||
* Implement toggle-keys notification [Olivier; #637]
|
||||
* Add initial KMS transactional support [Jonas; !525]
|
||||
* Improve finding new focus window when the old one is closed [Marco; #308]
|
||||
* Misc. bug fixes and cleanups [Jonas, Carlos, Marco, Florian, Pekka, Robert,
|
||||
Douglas, Georges, Daniel, Emil, Niels, Hans, Olivier, Ting-Wei, Corentin;
|
||||
!591, #398, !592, !581, !597, !598, !593, !497, #591, !545, gtk#1675, !601,
|
||||
#568, !564, !605, !609, !115, !214, !611, !617, !616, !619, !624, !622, !627,
|
||||
!628, !629, !632, !633, !631, !636, !639, !638, !634, !640, !529, !644, !590]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Piotr Drąg, Olivier Fourdan, Carlos Garnacho, Hans de Goede,
|
||||
Niels De Graef, Ting-Wei Lan, Robert Mader, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Corentin Noël, Pekka Paalanen, Douglas R. Reno,
|
||||
Marco Trevisan (Treviño), Emil Velikov, Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Balázs Úr [hu], Daniel Mustieles [es], Nathan Follens [nl], Goran Vidović [hr]
|
||||
|
||||
3.33.2
|
||||
======
|
||||
* Fix rendering lag on Xorg [Daniel; !520, !281]
|
||||
|
@@ -657,7 +657,7 @@ cally_actor_get_extents (AtkComponent *component,
|
||||
ClutterActor *actor = NULL;
|
||||
gint top_level_x, top_level_y;
|
||||
gfloat f_width, f_height;
|
||||
graphene_point3d_t verts[4];
|
||||
ClutterVertex verts[4];
|
||||
ClutterActor *stage = NULL;
|
||||
|
||||
g_return_if_fail (CALLY_IS_ACTOR (component));
|
||||
@@ -737,7 +737,11 @@ cally_actor_grab_focus (AtkComponent *component)
|
||||
*
|
||||
* This gets the top level origin, it is, the position of the stage in
|
||||
* the global screen. You can see it as the absolute display position
|
||||
* of the stage. This is 0,0 for a compositor.
|
||||
* of the stage.
|
||||
*
|
||||
* FIXME: only the case with x11 is implemented, other backends are
|
||||
* required
|
||||
*
|
||||
*/
|
||||
void
|
||||
_cally_actor_get_top_level_origin (ClutterActor *actor,
|
||||
@@ -745,11 +749,54 @@ _cally_actor_get_top_level_origin (ClutterActor *actor,
|
||||
gint *yp)
|
||||
{
|
||||
/* default values */
|
||||
gint x = 0;
|
||||
gint y = 0;
|
||||
|
||||
#ifdef CLUTTER_WINDOWING_X11
|
||||
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
|
||||
{
|
||||
ClutterActor *stage = NULL;
|
||||
Display *display = NULL;
|
||||
Window root_window;
|
||||
Window stage_window;
|
||||
Window child;
|
||||
gint return_val = 0;
|
||||
|
||||
stage = clutter_actor_get_stage (actor);
|
||||
|
||||
/* FIXME: what happens if you use another display with
|
||||
clutter_backend_x11_set_display ?*/
|
||||
display = clutter_x11_get_default_display ();
|
||||
root_window = clutter_x11_get_root_window ();
|
||||
stage_window = clutter_x11_get_stage_window (CLUTTER_STAGE (stage));
|
||||
|
||||
return_val = XTranslateCoordinates (display, stage_window, root_window,
|
||||
0, 0, &x, &y,
|
||||
&child);
|
||||
|
||||
if (!return_val)
|
||||
g_warning ("[x11] We were not able to get proper absolute "
|
||||
"position of the stage");
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
static gboolean yet_warned = FALSE;
|
||||
|
||||
if (!yet_warned)
|
||||
{
|
||||
yet_warned = TRUE;
|
||||
|
||||
g_warning ("The current Clutter backend does not support using "
|
||||
"atk_component_get_extents() with ATK_XY_SCREEN.");
|
||||
}
|
||||
}
|
||||
|
||||
if (xp)
|
||||
*xp = 0;
|
||||
*xp = x;
|
||||
|
||||
if (yp)
|
||||
*yp = 0;
|
||||
*yp = y;
|
||||
}
|
||||
|
||||
/* AtkAction implementation */
|
||||
|
@@ -1438,7 +1438,7 @@ static void cally_text_get_character_extents (AtkText *text,
|
||||
PangoLayout *layout;
|
||||
PangoRectangle extents;
|
||||
const gchar *text_value;
|
||||
graphene_point3d_t verts[4];
|
||||
ClutterVertex verts[4];
|
||||
|
||||
actor = CALLY_GET_CLUTTER_ACTOR (text);
|
||||
if (actor == NULL) /* State is defunct */
|
||||
@@ -2294,7 +2294,7 @@ _cally_misc_get_index_at_point (ClutterText *clutter_text,
|
||||
gint index, x_window, y_window, x_toplevel, y_toplevel;
|
||||
gint x_temp, y_temp;
|
||||
gboolean ret;
|
||||
graphene_point3d_t verts[4];
|
||||
ClutterVertex verts[4];
|
||||
PangoLayout *layout;
|
||||
gint x_layout, y_layout;
|
||||
|
||||
|
@@ -340,7 +340,7 @@ clutter_actor_box_contains (const ClutterActorBox *box,
|
||||
/**
|
||||
* clutter_actor_box_from_vertices:
|
||||
* @box: a #ClutterActorBox
|
||||
* @verts: (array fixed-size=4): array of four #graphene_point3d_t
|
||||
* @verts: (array fixed-size=4): array of four #ClutterVertex
|
||||
*
|
||||
* Calculates the bounding box represented by the four vertices; for details
|
||||
* of the vertex array see clutter_actor_get_abs_allocation_vertices().
|
||||
@@ -348,8 +348,8 @@ clutter_actor_box_contains (const ClutterActorBox *box,
|
||||
* Since: 1.0
|
||||
*/
|
||||
void
|
||||
clutter_actor_box_from_vertices (ClutterActorBox *box,
|
||||
const graphene_point3d_t verts[])
|
||||
clutter_actor_box_from_vertices (ClutterActorBox *box,
|
||||
const ClutterVertex verts[])
|
||||
{
|
||||
gfloat x_1, x_2, y_1, y_2;
|
||||
|
||||
|
@@ -135,7 +135,7 @@ struct _AnchorCoord
|
||||
} fraction;
|
||||
|
||||
/* Use when is_fractional == FALSE */
|
||||
graphene_point3d_t units;
|
||||
ClutterVertex units;
|
||||
} v;
|
||||
};
|
||||
|
||||
@@ -163,7 +163,7 @@ struct _SizeRequest
|
||||
struct _ClutterLayoutInfo
|
||||
{
|
||||
/* fixed position coordinates */
|
||||
graphene_point_t fixed_pos;
|
||||
ClutterPoint fixed_pos;
|
||||
|
||||
ClutterMargin margin;
|
||||
|
||||
@@ -173,8 +173,8 @@ struct _ClutterLayoutInfo
|
||||
guint x_expand : 1;
|
||||
guint y_expand : 1;
|
||||
|
||||
graphene_size_t minimum;
|
||||
graphene_size_t natural;
|
||||
ClutterSize minimum;
|
||||
ClutterSize natural;
|
||||
};
|
||||
|
||||
const ClutterLayoutInfo * _clutter_actor_get_layout_info_or_defaults (ClutterActor *self);
|
||||
@@ -203,13 +203,13 @@ struct _ClutterTransformInfo
|
||||
AnchorCoord anchor;
|
||||
|
||||
/* translation */
|
||||
graphene_point3d_t translation;
|
||||
ClutterVertex translation;
|
||||
|
||||
/* z_position */
|
||||
gfloat z_position;
|
||||
|
||||
/* transformation center */
|
||||
graphene_point_t pivot;
|
||||
ClutterPoint pivot;
|
||||
gfloat pivot_z;
|
||||
|
||||
CoglMatrix transform;
|
||||
@@ -242,6 +242,9 @@ ClutterAnimationInfo * _clutter_actor_get_animation_info
|
||||
ClutterTransition * _clutter_actor_create_transition (ClutterActor *self,
|
||||
GParamSpec *pspec,
|
||||
...);
|
||||
ClutterTransition * _clutter_actor_get_transition (ClutterActor *self,
|
||||
GParamSpec *pspec);
|
||||
|
||||
gboolean _clutter_actor_foreach_child (ClutterActor *self,
|
||||
ClutterForeachCallback callback,
|
||||
gpointer user_data);
|
||||
@@ -274,9 +277,6 @@ void _clutter_actor_set_enable_paint_unmapped
|
||||
void _clutter_actor_set_has_pointer (ClutterActor *self,
|
||||
gboolean has_pointer);
|
||||
|
||||
void _clutter_actor_set_has_key_focus (ClutterActor *self,
|
||||
gboolean has_key_focus);
|
||||
|
||||
void _clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||
ClutterRedrawFlags flags,
|
||||
const ClutterPaintVolume *clip_volume);
|
||||
@@ -297,6 +297,8 @@ const gchar * _clutter_actor_get_debug_name
|
||||
void _clutter_actor_push_clone_paint (void);
|
||||
void _clutter_actor_pop_clone_paint (void);
|
||||
|
||||
guint32 _clutter_actor_get_pick_id (ClutterActor *self);
|
||||
|
||||
void _clutter_actor_shader_pre_paint (ClutterActor *actor,
|
||||
gboolean repeat);
|
||||
void _clutter_actor_shader_post_paint (ClutterActor *actor);
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -233,7 +233,8 @@ struct _ClutterActorClass
|
||||
ClutterActor *old_parent);
|
||||
|
||||
void (* destroy) (ClutterActor *self);
|
||||
void (* pick) (ClutterActor *actor);
|
||||
void (* pick) (ClutterActor *actor,
|
||||
const ClutterColor *color);
|
||||
|
||||
gboolean (* queue_redraw) (ClutterActor *actor,
|
||||
ClutterActor *leaf_that_queued,
|
||||
@@ -353,10 +354,6 @@ void clutter_actor_paint
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_continue_paint (ClutterActor *self);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_pick (ClutterActor *actor);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_continue_pick (ClutterActor *actor);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_queue_redraw (ClutterActor *self);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||
@@ -434,7 +431,7 @@ void clutter_actor_get_allocation_box
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_get_allocation_vertices (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
graphene_point3d_t *verts);
|
||||
ClutterVertex verts[]);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_actor_has_allocation (ClutterActor *self);
|
||||
CLUTTER_EXPORT
|
||||
@@ -820,16 +817,16 @@ gboolean clutter_actor_transform_stage_point
|
||||
gfloat *y_out);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_get_abs_allocation_vertices (ClutterActor *self,
|
||||
graphene_point3d_t *verts);
|
||||
ClutterVertex verts[]);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_apply_transform_to_point (ClutterActor *self,
|
||||
const graphene_point3d_t *point,
|
||||
graphene_point3d_t *vertex);
|
||||
const ClutterVertex *point,
|
||||
ClutterVertex *vertex);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
|
||||
ClutterActor *ancestor,
|
||||
const graphene_point3d_t *point,
|
||||
graphene_point3d_t *vertex);
|
||||
const ClutterVertex *point,
|
||||
ClutterVertex *vertex);
|
||||
|
||||
/* Implicit animations */
|
||||
CLUTTER_EXPORT
|
||||
@@ -905,10 +902,6 @@ void clutter_actor_bind_model_with_properties
|
||||
const char *first_model_property,
|
||||
...);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_pick_box (ClutterActor *self,
|
||||
const ClutterActorBox *box);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_ACTOR_H__ */
|
||||
|
@@ -50,6 +50,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterConstraint, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterContainer, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeformEffect, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDesaturateEffect, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeviceManager, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDragAction, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDropAction, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterEffect, g_object_unref)
|
||||
@@ -93,6 +94,10 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterMatrix, clutter_matrix_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintNode, clutter_paint_node_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintVolume, clutter_paint_volume_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPathNode, clutter_path_node_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPoint, clutter_point_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterRect, clutter_rect_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterSize, clutter_size_free)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterVertex, clutter_vertex_free)
|
||||
|
||||
#endif /* __GI_SCANNER__ */
|
||||
|
||||
|
@@ -27,6 +27,8 @@
|
||||
#include <clutter/clutter-keymap.h>
|
||||
#include <clutter/clutter-stage-window.h>
|
||||
|
||||
#include "clutter-event-translator.h"
|
||||
|
||||
#define CLUTTER_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BACKEND, ClutterBackendClass))
|
||||
#define CLUTTER_IS_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BACKEND))
|
||||
#define CLUTTER_BACKEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BACKEND, ClutterBackendClass))
|
||||
@@ -56,7 +58,7 @@ struct _ClutterBackend
|
||||
gfloat units_per_em;
|
||||
gint32 units_serial;
|
||||
|
||||
ClutterStageWindow *stage_window;
|
||||
GList *event_translators;
|
||||
|
||||
ClutterInputMethod *input_method;
|
||||
|
||||
@@ -91,6 +93,12 @@ struct _ClutterBackendClass
|
||||
GError **error);
|
||||
ClutterDeviceManager *(* get_device_manager) (ClutterBackend *backend);
|
||||
|
||||
void (* copy_event_data) (ClutterBackend *backend,
|
||||
const ClutterEvent *src,
|
||||
ClutterEvent *dest);
|
||||
void (* free_event_data) (ClutterBackend *backend,
|
||||
ClutterEvent *event);
|
||||
|
||||
gboolean (* translate_event) (ClutterBackend *backend,
|
||||
gpointer native,
|
||||
ClutterEvent *event);
|
||||
@@ -128,11 +136,17 @@ void _clutter_backend_copy_event_data (Clutter
|
||||
ClutterEvent *dest);
|
||||
void _clutter_backend_free_event_data (ClutterBackend *backend,
|
||||
ClutterEvent *event);
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_backend_translate_event (ClutterBackend *backend,
|
||||
gpointer native,
|
||||
ClutterEvent *event);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_backend_add_event_translator (ClutterBackend *backend,
|
||||
ClutterEventTranslator *translator);
|
||||
|
||||
void _clutter_backend_remove_event_translator (ClutterBackend *backend,
|
||||
ClutterEventTranslator *translator);
|
||||
|
||||
ClutterFeatureFlags _clutter_backend_get_features (ClutterBackend *backend);
|
||||
|
||||
gfloat _clutter_backend_get_units_per_em (ClutterBackend *backend,
|
||||
@@ -146,9 +160,6 @@ 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,6 +62,9 @@
|
||||
#ifdef CLUTTER_INPUT_X11
|
||||
#include "x11/clutter-backend-x11.h"
|
||||
#endif
|
||||
#ifdef CLUTTER_INPUT_EVDEV
|
||||
#include "evdev/clutter-device-manager-evdev.h"
|
||||
#endif
|
||||
#ifdef CLUTTER_WINDOWING_EGL
|
||||
#include "egl/clutter-backend-eglnative.h"
|
||||
#endif
|
||||
@@ -101,12 +104,10 @@ clutter_backend_dispose (GObject *gobject)
|
||||
/* clear the events still in the queue of the main context */
|
||||
_clutter_clear_events_queue ();
|
||||
|
||||
/* remove all event translators */
|
||||
g_clear_pointer (&backend->event_translators, g_list_free);
|
||||
|
||||
g_clear_pointer (&backend->dummy_onscreen, cogl_object_unref);
|
||||
if (backend->stage_window)
|
||||
{
|
||||
g_object_remove_weak_pointer (G_OBJECT (backend->stage_window),
|
||||
(gpointer *) &backend->stage_window);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (clutter_backend_parent_class)->dispose (gobject);
|
||||
}
|
||||
@@ -396,7 +397,7 @@ clutter_backend_real_create_context (ClutterBackend *backend,
|
||||
else
|
||||
g_set_error_literal (error, CLUTTER_INIT_ERROR,
|
||||
CLUTTER_INIT_ERROR_BACKEND,
|
||||
"Unable to initialize the Clutter backend: no available drivers found.");
|
||||
_("Unable to initialize the Clutter backend: no available drivers found."));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -525,7 +526,40 @@ _clutter_create_backend (void)
|
||||
static void
|
||||
clutter_backend_real_init_events (ClutterBackend *backend)
|
||||
{
|
||||
g_error ("Unknown input backend");
|
||||
const char *input_backend = NULL;
|
||||
|
||||
input_backend = g_getenv ("CLUTTER_INPUT_BACKEND");
|
||||
if (input_backend != NULL)
|
||||
input_backend = g_intern_string (input_backend);
|
||||
|
||||
#ifdef CLUTTER_INPUT_X11
|
||||
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11) &&
|
||||
(input_backend == NULL || input_backend == I_(CLUTTER_INPUT_X11)))
|
||||
{
|
||||
_clutter_backend_x11_events_init (backend);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CLUTTER_INPUT_EVDEV
|
||||
/* Evdev can be used regardless of the windowing system */
|
||||
if ((input_backend != NULL && strcmp (input_backend, CLUTTER_INPUT_EVDEV) == 0)
|
||||
#ifdef CLUTTER_WINDOWING_EGL
|
||||
/* but we do want to always use it for EGL native */
|
||||
|| clutter_check_windowing_backend (CLUTTER_WINDOWING_EGL)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
_clutter_events_evdev_init (backend);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (input_backend != NULL)
|
||||
{
|
||||
if (input_backend != I_(CLUTTER_INPUT_NULL))
|
||||
g_error ("Unrecognized input backend '%s'", input_backend);
|
||||
}
|
||||
else
|
||||
g_error ("Unknown input backend");
|
||||
}
|
||||
|
||||
static ClutterDeviceManager *
|
||||
@@ -552,6 +586,34 @@ clutter_backend_real_get_keymap (ClutterBackend *backend)
|
||||
return backend->keymap;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_backend_real_translate_event (ClutterBackend *backend,
|
||||
gpointer native,
|
||||
ClutterEvent *event)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = backend->event_translators;
|
||||
l != NULL;
|
||||
l = l->next)
|
||||
{
|
||||
ClutterEventTranslator *translator = l->data;
|
||||
ClutterTranslateReturn retval;
|
||||
|
||||
retval = _clutter_event_translator_translate_event (translator,
|
||||
native,
|
||||
event);
|
||||
|
||||
if (retval == CLUTTER_TRANSLATE_QUEUE)
|
||||
return TRUE;
|
||||
|
||||
if (retval == CLUTTER_TRANSLATE_REMOVE)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
{
|
||||
@@ -574,7 +636,8 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterBackendClass, resolution_changed),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -591,7 +654,8 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterBackendClass, font_changed),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -608,7 +672,8 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterBackendClass, settings_changed),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
klass->resolution_changed = clutter_backend_real_resolution_changed;
|
||||
@@ -616,6 +681,7 @@ clutter_backend_class_init (ClutterBackendClass *klass)
|
||||
|
||||
klass->init_events = clutter_backend_real_init_events;
|
||||
klass->get_device_manager = clutter_backend_real_get_device_manager;
|
||||
klass->translate_event = clutter_backend_real_translate_event;
|
||||
klass->create_context = clutter_backend_real_create_context;
|
||||
klass->get_features = clutter_backend_real_get_features;
|
||||
klass->get_keymap = clutter_backend_real_get_keymap;
|
||||
@@ -627,7 +693,7 @@ clutter_backend_init (ClutterBackend *self)
|
||||
self->units_per_em = -1.0;
|
||||
self->units_serial = 1;
|
||||
|
||||
self->dummy_onscreen = NULL;
|
||||
self->dummy_onscreen = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -695,10 +761,6 @@ _clutter_backend_create_stage (ClutterBackend *backend,
|
||||
|
||||
g_assert (CLUTTER_IS_STAGE_WINDOW (stage_window));
|
||||
|
||||
backend->stage_window = stage_window;
|
||||
g_object_add_weak_pointer (G_OBJECT (backend->stage_window),
|
||||
(gpointer *) &backend->stage_window);
|
||||
|
||||
return stage_window;
|
||||
}
|
||||
|
||||
@@ -783,24 +845,37 @@ _clutter_backend_copy_event_data (ClutterBackend *backend,
|
||||
const ClutterEvent *src,
|
||||
ClutterEvent *dest)
|
||||
{
|
||||
ClutterDeviceManagerClass *device_manager_class;
|
||||
ClutterDeviceManager *device_manager;
|
||||
ClutterEventExtenderInterface *iface;
|
||||
ClutterBackendClass *klass;
|
||||
|
||||
device_manager = clutter_device_manager_get_default ();
|
||||
device_manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
device_manager_class->copy_event_data (device_manager, src, dest);
|
||||
klass = CLUTTER_BACKEND_GET_CLASS (backend);
|
||||
if (CLUTTER_IS_EVENT_EXTENDER (backend->device_manager))
|
||||
{
|
||||
iface = CLUTTER_EVENT_EXTENDER_GET_IFACE (backend->device_manager);
|
||||
iface->copy_event_data (CLUTTER_EVENT_EXTENDER (backend->device_manager),
|
||||
src, dest);
|
||||
}
|
||||
else if (klass->copy_event_data != NULL)
|
||||
klass->copy_event_data (backend, src, dest);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_backend_free_event_data (ClutterBackend *backend,
|
||||
ClutterEvent *event)
|
||||
{
|
||||
ClutterDeviceManagerClass *device_manager_class;
|
||||
ClutterDeviceManager *device_manager;
|
||||
ClutterEventExtenderInterface *iface;
|
||||
ClutterBackendClass *klass;
|
||||
|
||||
device_manager = clutter_device_manager_get_default ();
|
||||
device_manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
device_manager_class->free_event_data (device_manager, event);
|
||||
klass = CLUTTER_BACKEND_GET_CLASS (backend);
|
||||
|
||||
if (CLUTTER_IS_EVENT_EXTENDER (backend->device_manager))
|
||||
{
|
||||
iface = CLUTTER_EVENT_EXTENDER_GET_IFACE (backend->device_manager);
|
||||
iface->free_event_data (CLUTTER_EVENT_EXTENDER (backend->device_manager),
|
||||
event);
|
||||
}
|
||||
else if (klass->free_event_data != NULL)
|
||||
klass->free_event_data (backend, event);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -946,6 +1021,28 @@ _clutter_backend_translate_event (ClutterBackend *backend,
|
||||
event);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_backend_add_event_translator (ClutterBackend *backend,
|
||||
ClutterEventTranslator *translator)
|
||||
{
|
||||
if (g_list_find (backend->event_translators, translator) != NULL)
|
||||
return;
|
||||
|
||||
backend->event_translators =
|
||||
g_list_prepend (backend->event_translators, translator);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_backend_remove_event_translator (ClutterBackend *backend,
|
||||
ClutterEventTranslator *translator)
|
||||
{
|
||||
if (g_list_find (backend->event_translators, translator) == NULL)
|
||||
return;
|
||||
|
||||
backend->event_translators =
|
||||
g_list_remove (backend->event_translators, translator);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_backend_get_cogl_context: (skip)
|
||||
* @backend: a #ClutterBackend
|
||||
@@ -1012,9 +1109,9 @@ _clutter_backend_get_keymap_direction (ClutterBackend *backend)
|
||||
void
|
||||
_clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
|
||||
{
|
||||
if (backend->dummy_onscreen == NULL)
|
||||
if (backend->dummy_onscreen == COGL_INVALID_HANDLE)
|
||||
{
|
||||
GError *internal_error = NULL;
|
||||
CoglError *internal_error = NULL;
|
||||
|
||||
backend->dummy_onscreen = cogl_onscreen_new (backend->cogl_context, 1, 1);
|
||||
|
||||
@@ -1022,7 +1119,7 @@ _clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
|
||||
&internal_error))
|
||||
{
|
||||
g_critical ("Unable to create dummy onscreen: %s", internal_error->message);
|
||||
g_error_free (internal_error);
|
||||
cogl_error_free (internal_error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1093,9 +1190,3 @@ clutter_backend_get_keymap (ClutterBackend *backend)
|
||||
{
|
||||
return CLUTTER_BACKEND_GET_CLASS (backend)->get_keymap (backend);
|
||||
}
|
||||
|
||||
ClutterStageWindow *
|
||||
clutter_backend_get_stage_window (ClutterBackend *backend)
|
||||
{
|
||||
return backend->stage_window;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -152,9 +152,7 @@ clutter_bind_constraint_update_allocation (ClutterConstraint *constraint,
|
||||
ClutterBindConstraint *bind = CLUTTER_BIND_CONSTRAINT (constraint);
|
||||
gfloat source_width, source_height;
|
||||
gfloat actor_width, actor_height;
|
||||
graphene_point3d_t source_position;
|
||||
|
||||
source_position = GRAPHENE_POINT3D_INIT (0.f, 0.f, 0.f);
|
||||
ClutterVertex source_position = { 0., };
|
||||
|
||||
if (bind->source == NULL)
|
||||
return;
|
||||
|
@@ -182,7 +182,7 @@ clutter_blur_effect_modify_paint_volume (ClutterEffect *effect,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
gfloat cur_width, cur_height;
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
|
||||
clutter_paint_volume_get_origin (volume, &origin);
|
||||
cur_width = clutter_paint_volume_get_width (volume);
|
||||
|
@@ -666,7 +666,8 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterClickActionClass, clicked),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
|
@@ -252,13 +252,6 @@ clutter_clone_allocate (ClutterActor *self,
|
||||
if (priv->clone_source == NULL)
|
||||
return;
|
||||
|
||||
/* ClutterActor delays allocating until the actor is shown; however
|
||||
* we cannot paint it correctly in that case, so force an allocation.
|
||||
*/
|
||||
if (clutter_actor_get_parent (priv->clone_source) != NULL &&
|
||||
!clutter_actor_has_allocation (priv->clone_source))
|
||||
clutter_actor_allocate_preferred_size (priv->clone_source, flags);
|
||||
|
||||
#if 0
|
||||
/* XXX - this is wrong: ClutterClone cannot clone unparented
|
||||
* actors, as it will break all invariants
|
||||
|
@@ -118,6 +118,37 @@ container_real_remove (ClutterContainer *container,
|
||||
clutter_actor_remove_child (CLUTTER_ACTOR (container), actor);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
ClutterCallback callback;
|
||||
gpointer data;
|
||||
} ForeachClosure;
|
||||
|
||||
static gboolean
|
||||
foreach_cb (ClutterActor *actor,
|
||||
gpointer data)
|
||||
{
|
||||
ForeachClosure *clos = data;
|
||||
|
||||
clos->callback (actor, clos->data);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
container_real_foreach (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
ForeachClosure clos;
|
||||
|
||||
clos.callback = callback;
|
||||
clos.data = user_data;
|
||||
|
||||
_clutter_actor_foreach_child (CLUTTER_ACTOR (container),
|
||||
foreach_cb,
|
||||
&clos);
|
||||
}
|
||||
|
||||
static void
|
||||
container_real_raise (ClutterContainer *container,
|
||||
ClutterActor *child,
|
||||
@@ -166,7 +197,8 @@ clutter_container_default_init (ClutterContainerInterface *iface)
|
||||
iface_type,
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContainerIface, actor_added),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
/**
|
||||
@@ -184,7 +216,8 @@ clutter_container_default_init (ClutterContainerInterface *iface)
|
||||
iface_type,
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContainerIface, actor_removed),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@@ -212,6 +245,7 @@ clutter_container_default_init (ClutterContainerInterface *iface)
|
||||
|
||||
iface->add = container_real_add;
|
||||
iface->remove = container_real_remove;
|
||||
iface->foreach = container_real_foreach;
|
||||
iface->raise = container_real_raise;
|
||||
iface->lower = container_real_lower;
|
||||
iface->sort_depth_order = container_real_sort_depth_order;
|
||||
@@ -501,6 +535,15 @@ clutter_container_remove_valist (ClutterContainer *container,
|
||||
container_remove_valist (container, first_actor, var_args);
|
||||
}
|
||||
|
||||
static void
|
||||
get_children_cb (ClutterActor *child,
|
||||
gpointer data)
|
||||
{
|
||||
GList **children = data;
|
||||
|
||||
*children = g_list_prepend (*children, child);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_container_get_children:
|
||||
* @container: a #ClutterContainer
|
||||
@@ -518,9 +561,108 @@ clutter_container_remove_valist (ClutterContainer *container,
|
||||
GList *
|
||||
clutter_container_get_children (ClutterContainer *container)
|
||||
{
|
||||
GList *retval;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_CONTAINER (container), NULL);
|
||||
|
||||
return clutter_actor_get_children (CLUTTER_ACTOR (container));
|
||||
retval = NULL;
|
||||
clutter_container_foreach (container, get_children_cb, &retval);
|
||||
|
||||
return g_list_reverse (retval);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_container_foreach:
|
||||
* @container: a #ClutterContainer
|
||||
* @callback: (scope call): a function to be called for each child
|
||||
* @user_data: data to be passed to the function, or %NULL
|
||||
*
|
||||
* Calls @callback for each child of @container that was added
|
||||
* by the application (with clutter_container_add_actor()). Does
|
||||
* not iterate over "internal" children that are part of the
|
||||
* container's own implementation, if any.
|
||||
*
|
||||
* This function calls the #ClutterContainerIface.foreach()
|
||||
* virtual function, which has been deprecated.
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_actor_get_first_child() or
|
||||
* clutter_actor_get_last_child() to retrieve the beginning of
|
||||
* the list of children, and clutter_actor_get_next_sibling()
|
||||
* and clutter_actor_get_previous_sibling() to iterate over it;
|
||||
* alternatively, use the #ClutterActorIter API.
|
||||
*/
|
||||
void
|
||||
clutter_container_foreach (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
if (G_UNLIKELY (_clutter_diagnostic_enabled ()))
|
||||
{
|
||||
ClutterContainerIface *iface = CLUTTER_CONTAINER_GET_IFACE (container);
|
||||
|
||||
if (iface->foreach != container_real_foreach)
|
||||
_clutter_diagnostic_message ("The ClutterContainer::foreach() "
|
||||
"virtual function has been deprecated "
|
||||
"and it should not be overridden by "
|
||||
"newly written code");
|
||||
}
|
||||
#endif /* CLUTTER_ENABLE_DEBUG */
|
||||
|
||||
CLUTTER_CONTAINER_GET_IFACE (container)->foreach (container,
|
||||
callback,
|
||||
user_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_container_foreach_with_internals:
|
||||
* @container: a #ClutterContainer
|
||||
* @callback: (scope call): a function to be called for each child
|
||||
* @user_data: data to be passed to the function, or %NULL
|
||||
*
|
||||
* Calls @callback for each child of @container, including "internal"
|
||||
* children built in to the container itself that were never added
|
||||
* by the application.
|
||||
*
|
||||
* This function calls the #ClutterContainerIface.foreach_with_internals()
|
||||
* virtual function, which has been deprecated.
|
||||
*
|
||||
* Since: 1.0
|
||||
*
|
||||
* Deprecated: 1.10: See clutter_container_foreach().
|
||||
*/
|
||||
void
|
||||
clutter_container_foreach_with_internals (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
ClutterContainerIface *iface;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
iface = CLUTTER_CONTAINER_GET_IFACE (container);
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
if (G_UNLIKELY (_clutter_diagnostic_enabled ()))
|
||||
{
|
||||
if (iface->foreach_with_internals != NULL)
|
||||
_clutter_diagnostic_message ("The ClutterContainer::foreach_with_internals() "
|
||||
"virtual function has been deprecated "
|
||||
"and it should not be overridden by "
|
||||
"newly written code");
|
||||
}
|
||||
#endif /* CLUTTER_ENABLE_DEBUG */
|
||||
|
||||
if (iface->foreach_with_internals != NULL)
|
||||
iface->foreach_with_internals (container, callback, user_data);
|
||||
else
|
||||
iface->foreach (container, callback, user_data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -59,6 +59,14 @@ typedef struct _ClutterContainerIface ClutterContainerIface;
|
||||
* function is deprecated, and it should not be overridden.
|
||||
* @remove: virtual function for removing an actor from the container. This
|
||||
* virtual function is deprecated, and it should not be overridden.
|
||||
* @foreach: virtual function for iterating over the container's children.
|
||||
* This virtual function is deprecated, and it should not be overridden.
|
||||
* @foreach_with_internals: virtual functions for iterating over the
|
||||
* container's children, both added using the #ClutterContainer API
|
||||
* and internal children. The implementation of this virtual function
|
||||
* is required only if the #ClutterContainer implementation has
|
||||
* internal children. This virtual function is deprecated, and it should
|
||||
* not be overridden.
|
||||
* @raise: virtual function for raising a child. This virtual function is
|
||||
* deprecated and it should not be overridden.
|
||||
* @lower: virtual function for lowering a child. This virtual function is
|
||||
@@ -80,7 +88,7 @@ typedef struct _ClutterContainerIface ClutterContainerIface;
|
||||
* @actor_removed: class handler for #ClutterContainer::actor-removed
|
||||
* @child_notify: class handler for #ClutterContainer::child-notify
|
||||
*
|
||||
* Base interface for container actors. The @add and @remove
|
||||
* Base interface for container actors. The @add, @remove and @foreach
|
||||
* virtual functions must be provided by any implementation; the other
|
||||
* virtual functions are optional.
|
||||
*
|
||||
@@ -96,6 +104,13 @@ struct _ClutterContainerIface
|
||||
ClutterActor *actor);
|
||||
void (* remove) (ClutterContainer *container,
|
||||
ClutterActor *actor);
|
||||
void (* foreach) (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
void (* foreach_with_internals) (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
/* child stacking */
|
||||
void (* raise) (ClutterContainer *container,
|
||||
|
@@ -129,7 +129,8 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
||||
G_TYPE_FROM_INTERFACE (iface),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContentInterface, attached),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@@ -148,7 +149,8 @@ clutter_content_default_init (ClutterContentInterface *iface)
|
||||
G_TYPE_FROM_INTERFACE (iface),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (ClutterContentInterface, detached),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
}
|
||||
|
@@ -6,6 +6,46 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_DEBUG_MISC = 1 << 0,
|
||||
CLUTTER_DEBUG_ACTOR = 1 << 1,
|
||||
CLUTTER_DEBUG_TEXTURE = 1 << 2,
|
||||
CLUTTER_DEBUG_EVENT = 1 << 3,
|
||||
CLUTTER_DEBUG_PAINT = 1 << 4,
|
||||
CLUTTER_DEBUG_PANGO = 1 << 5,
|
||||
CLUTTER_DEBUG_BACKEND = 1 << 6,
|
||||
CLUTTER_DEBUG_SCHEDULER = 1 << 7,
|
||||
CLUTTER_DEBUG_SCRIPT = 1 << 8,
|
||||
CLUTTER_DEBUG_SHADER = 1 << 9,
|
||||
CLUTTER_DEBUG_MULTISTAGE = 1 << 10,
|
||||
CLUTTER_DEBUG_ANIMATION = 1 << 11,
|
||||
CLUTTER_DEBUG_LAYOUT = 1 << 12,
|
||||
CLUTTER_DEBUG_PICK = 1 << 13,
|
||||
CLUTTER_DEBUG_EVENTLOOP = 1 << 14,
|
||||
CLUTTER_DEBUG_CLIPPING = 1 << 15,
|
||||
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 16
|
||||
} ClutterDebugFlag;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_DEBUG_NOP_PICKING = 1 << 0,
|
||||
CLUTTER_DEBUG_DUMP_PICK_BUFFERS = 1 << 1
|
||||
} ClutterPickDebugFlag;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_DEBUG_DISABLE_SWAP_EVENTS = 1 << 0,
|
||||
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS = 1 << 1,
|
||||
CLUTTER_DEBUG_REDRAWS = 1 << 2,
|
||||
CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3,
|
||||
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
|
||||
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
|
||||
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
|
||||
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7,
|
||||
CLUTTER_DEBUG_PAINT_DAMAGE_REGION = 1 << 8,
|
||||
} ClutterDrawDebugFlag;
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
|
||||
#define CLUTTER_HAS_DEBUG(type) ((clutter_debug_flags & CLUTTER_DEBUG_##type) != FALSE)
|
||||
|
@@ -177,7 +177,7 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
|
||||
if (priv->is_dirty)
|
||||
{
|
||||
graphene_rect_t rect;
|
||||
ClutterRect rect;
|
||||
gboolean mapped_buffer;
|
||||
CoglVertexP3T2C4 *verts;
|
||||
ClutterActor *actor;
|
||||
@@ -193,8 +193,8 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
*/
|
||||
if (clutter_offscreen_effect_get_target_rect (effect, &rect))
|
||||
{
|
||||
width = graphene_rect_get_width (&rect);
|
||||
height = graphene_rect_get_height (&rect);
|
||||
width = clutter_rect_get_width (&rect);
|
||||
height = clutter_rect_get_height (&rect);
|
||||
}
|
||||
else
|
||||
clutter_actor_get_size (actor, &width, &height);
|
||||
|
@@ -7,12 +7,17 @@
|
||||
#include "deprecated/clutter-alpha.h"
|
||||
#include "deprecated/clutter-animatable.h"
|
||||
#include "deprecated/clutter-animation.h"
|
||||
#include "deprecated/clutter-behaviour.h"
|
||||
#include "deprecated/clutter-behaviour-depth.h"
|
||||
#include "deprecated/clutter-behaviour-opacity.h"
|
||||
#include "deprecated/clutter-behaviour-scale.h"
|
||||
#include "deprecated/clutter-bin-layout.h"
|
||||
#include "deprecated/clutter-box.h"
|
||||
#include "deprecated/clutter-cairo-texture.h"
|
||||
#include "deprecated/clutter-container.h"
|
||||
#include "deprecated/clutter-group.h"
|
||||
#include "deprecated/clutter-keysyms.h"
|
||||
#include "deprecated/clutter-main.h"
|
||||
#include "deprecated/clutter-rectangle.h"
|
||||
#include "deprecated/clutter-stage-manager.h"
|
||||
#include "deprecated/clutter-stage.h"
|
||||
|
@@ -80,7 +80,6 @@ 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;
|
||||
@@ -194,15 +193,34 @@ 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);
|
||||
@@ -210,35 +228,25 @@ ClutterBackend *_clutter_device_manager_get_backend (ClutterDeviceMa
|
||||
void _clutter_device_manager_compress_motion (ClutterDeviceManager *device_manger,
|
||||
ClutterEvent *event,
|
||||
const ClutterEvent *to_discard);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_device_manager_ensure_a11y_state (ClutterDeviceManager *device_manager);
|
||||
|
||||
/* input device */
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_input_device_has_sequence (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_add_event_sequence (ClutterInputDevice *device,
|
||||
ClutterEvent *event);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_remove_event_sequence (ClutterInputDevice *device,
|
||||
ClutterEvent *event);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_coords (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
gfloat x,
|
||||
gfloat y,
|
||||
ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_state (ClutterInputDevice *device,
|
||||
ClutterModifierType state);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_time (ClutterInputDevice *device,
|
||||
guint32 time_);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_stage (ClutterInputDevice *device,
|
||||
ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
ClutterStage * _clutter_input_device_get_stage (ClutterInputDevice *device);
|
||||
void _clutter_input_device_set_actor (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
@@ -247,57 +255,44 @@ void _clutter_input_device_set_actor (ClutterInputDev
|
||||
ClutterActor * _clutter_input_device_update (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
gboolean emit_crossing);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_n_keys (ClutterInputDevice *device,
|
||||
guint n_keys);
|
||||
CLUTTER_EXPORT
|
||||
guint _clutter_input_device_add_axis (ClutterInputDevice *device,
|
||||
ClutterInputAxis axis,
|
||||
gdouble min_value,
|
||||
gdouble max_value,
|
||||
gdouble resolution);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_reset_axes (ClutterInputDevice *device);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_set_associated_device (ClutterInputDevice *device,
|
||||
ClutterInputDevice *associated);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_add_slave (ClutterInputDevice *master,
|
||||
ClutterInputDevice *slave);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_remove_slave (ClutterInputDevice *master,
|
||||
ClutterInputDevice *slave);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_input_device_translate_axis (ClutterInputDevice *device,
|
||||
guint index_,
|
||||
gdouble value,
|
||||
gdouble *axis_value);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_add_scroll_info (ClutterInputDevice *device,
|
||||
guint index_,
|
||||
ClutterScrollDirection direction,
|
||||
gdouble increment);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_reset_scroll_info (ClutterInputDevice *device);
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_input_device_get_scroll_delta (ClutterInputDevice *device,
|
||||
guint index_,
|
||||
gdouble value,
|
||||
ClutterScrollDirection *direction_p,
|
||||
gdouble *delta_p);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterInputDeviceTool * clutter_input_device_lookup_tool (ClutterInputDevice *device,
|
||||
guint64 serial,
|
||||
ClutterInputDeviceToolType type);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_device_add_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_device_update_from_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
|
||||
|
@@ -91,14 +91,22 @@ G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterDeviceManager,
|
||||
clutter_device_manager,
|
||||
G_TYPE_OBJECT)
|
||||
|
||||
G_DEFINE_INTERFACE (ClutterEventExtender,
|
||||
clutter_event_extender,
|
||||
CLUTTER_TYPE_DEVICE_MANAGER)
|
||||
|
||||
static void
|
||||
clutter_event_extender_default_init (ClutterEventExtenderInterface *iface)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_device_manager_set_property (GObject *gobject,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterDeviceManager *self = CLUTTER_DEVICE_MANAGER (gobject);
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (self);
|
||||
ClutterDeviceManagerPrivate *priv = CLUTTER_DEVICE_MANAGER (gobject)->priv;
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
@@ -117,8 +125,7 @@ clutter_device_manager_get_property (GObject *gobject,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterDeviceManager *self = CLUTTER_DEVICE_MANAGER (gobject);
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (self);
|
||||
ClutterDeviceManagerPrivate *priv = CLUTTER_DEVICE_MANAGER (gobject)->priv;
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
@@ -164,7 +171,8 @@ clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_INPUT_DEVICE);
|
||||
|
||||
@@ -183,7 +191,8 @@ clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_INPUT_DEVICE);
|
||||
|
||||
@@ -282,7 +291,6 @@ 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
|
||||
@@ -294,16 +302,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_BOOLEAN,
|
||||
G_TYPE_NONE, 3,
|
||||
_clutter_marshal_VOID__OBJECT_FLAGS,
|
||||
G_TYPE_NONE, 2,
|
||||
CLUTTER_TYPE_INPUT_DEVICE,
|
||||
CLUTTER_TYPE_POINTER_A11Y_TIMEOUT_TYPE,
|
||||
G_TYPE_BOOLEAN);
|
||||
CLUTTER_TYPE_POINTER_A11Y_TIMEOUT_TYPE);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_device_manager_init (ClutterDeviceManager *self)
|
||||
{
|
||||
self->priv = clutter_device_manager_get_instance_private (self);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -322,7 +330,7 @@ clutter_device_manager_get_default (void)
|
||||
{
|
||||
ClutterBackend *backend = clutter_get_default_backend ();
|
||||
|
||||
return CLUTTER_BACKEND_GET_CLASS (backend)->get_device_manager (backend);
|
||||
return backend->device_manager;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -546,11 +554,9 @@ _clutter_device_manager_update_devices (ClutterDeviceManager *device_manager)
|
||||
ClutterBackend *
|
||||
_clutter_device_manager_get_backend (ClutterDeviceManager *manager)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (manager);
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (manager), NULL);
|
||||
|
||||
return priv->backend;
|
||||
return manager->priv->backend;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -607,20 +613,6 @@ _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)
|
||||
@@ -633,14 +625,13 @@ clutter_device_manager_set_kbd_a11y_settings (ClutterDeviceManager *device_man
|
||||
ClutterKbdA11ySettings *settings)
|
||||
{
|
||||
ClutterDeviceManagerClass *manager_class;
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (device_manager);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
if (are_kbd_a11y_settings_equal (&priv->kbd_a11y_settings, settings))
|
||||
if (are_kbd_a11y_settings_equal (&device_manager->priv->kbd_a11y_settings, settings))
|
||||
return;
|
||||
|
||||
priv->kbd_a11y_settings = *settings;
|
||||
device_manager->priv->kbd_a11y_settings = *settings;
|
||||
|
||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
if (manager_class->apply_kbd_a11y_settings)
|
||||
@@ -651,11 +642,9 @@ void
|
||||
clutter_device_manager_get_kbd_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterKbdA11ySettings *settings)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv = clutter_device_manager_get_instance_private (device_manager);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
*settings = priv->kbd_a11y_settings;
|
||||
*settings = device_manager->priv->kbd_a11y_settings;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -698,20 +687,17 @@ void
|
||||
clutter_device_manager_set_pointer_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterPointerA11ySettings *settings)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv =
|
||||
clutter_device_manager_get_instance_private (device_manager);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
if (are_pointer_a11y_settings_equal (&priv->pointer_a11y_settings, settings))
|
||||
if (are_pointer_a11y_settings_equal (&device_manager->priv->pointer_a11y_settings, settings))
|
||||
return;
|
||||
|
||||
if (priv->pointer_a11y_settings.controls == 0 && settings->controls != 0)
|
||||
if (device_manager->priv->pointer_a11y_settings.controls == 0 && settings->controls != 0)
|
||||
clutter_device_manager_enable_pointer_a11y (device_manager);
|
||||
else if (priv->pointer_a11y_settings.controls != 0 && settings->controls == 0)
|
||||
else if (device_manager->priv->pointer_a11y_settings.controls != 0 && settings->controls == 0)
|
||||
clutter_device_manager_disable_pointer_a11y (device_manager);
|
||||
|
||||
priv->pointer_a11y_settings = *settings;
|
||||
device_manager->priv->pointer_a11y_settings = *settings;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -725,12 +711,9 @@ void
|
||||
clutter_device_manager_get_pointer_a11y_settings (ClutterDeviceManager *device_manager,
|
||||
ClutterPointerA11ySettings *settings)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv =
|
||||
clutter_device_manager_get_instance_private (device_manager);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
*settings = priv->pointer_a11y_settings;
|
||||
*settings = device_manager->priv->pointer_a11y_settings;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -744,10 +727,7 @@ void
|
||||
clutter_device_manager_set_pointer_a11y_dwell_click_type (ClutterDeviceManager *device_manager,
|
||||
ClutterPointerA11yDwellClickType click_type)
|
||||
{
|
||||
ClutterDeviceManagerPrivate *priv =
|
||||
clutter_device_manager_get_instance_private (device_manager);
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
|
||||
|
||||
priv->pointer_a11y_settings.dwell_click_type = click_type;
|
||||
device_manager->priv->pointer_a11y_settings.dwell_click_type = click_type;
|
||||
}
|
||||
|
@@ -33,12 +33,16 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_DEVICE_MANAGER (clutter_device_manager_get_type ())
|
||||
CLUTTER_EXPORT
|
||||
G_DECLARE_DERIVABLE_TYPE (ClutterDeviceManager, clutter_device_manager,
|
||||
CLUTTER, DEVICE_MANAGER, GObject)
|
||||
#define CLUTTER_TYPE_DEVICE_MANAGER (clutter_device_manager_get_type ())
|
||||
#define CLUTTER_DEVICE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_DEVICE_MANAGER, ClutterDeviceManager))
|
||||
#define CLUTTER_IS_DEVICE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_DEVICE_MANAGER))
|
||||
#define CLUTTER_DEVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_DEVICE_MANAGER, ClutterDeviceManagerClass))
|
||||
#define CLUTTER_IS_DEVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_DEVICE_MANAGER))
|
||||
#define CLUTTER_DEVICE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_DEVICE_MANAGER, ClutterDeviceManagerClass))
|
||||
|
||||
typedef struct _ClutterDeviceManager ClutterDeviceManager;
|
||||
typedef struct _ClutterDeviceManagerPrivate ClutterDeviceManagerPrivate;
|
||||
typedef struct _ClutterDeviceManagerClass ClutterDeviceManagerClass;
|
||||
|
||||
/**
|
||||
* ClutterVirtualDeviceType:
|
||||
@@ -90,6 +94,21 @@ 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:
|
||||
*
|
||||
@@ -123,18 +142,13 @@ struct _ClutterDeviceManagerClass
|
||||
/* Keyboard accessbility */
|
||||
void (* apply_kbd_a11y_settings) (ClutterDeviceManager *device_manger,
|
||||
ClutterKbdA11ySettings *settings);
|
||||
|
||||
/* Event platform data */
|
||||
void (* copy_event_data) (ClutterDeviceManager *device_manager,
|
||||
const ClutterEvent *src,
|
||||
ClutterEvent *dest);
|
||||
void (* free_event_data) (ClutterDeviceManager *device_manager,
|
||||
ClutterEvent *event);
|
||||
|
||||
/* padding */
|
||||
gpointer _padding[4];
|
||||
gpointer _padding[6];
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_device_manager_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterDeviceManager *clutter_device_manager_get_default (void);
|
||||
CLUTTER_EXPORT
|
||||
|
@@ -81,7 +81,7 @@ struct _ClutterDragActionPrivate
|
||||
gint y_drag_threshold;
|
||||
ClutterActor *drag_handle;
|
||||
ClutterDragAxis drag_axis;
|
||||
graphene_rect_t drag_area;
|
||||
ClutterRect drag_area;
|
||||
|
||||
ClutterInputDevice *device;
|
||||
ClutterEventSequence *sequence;
|
||||
@@ -542,7 +542,7 @@ clutter_drag_action_real_drag_motion (ClutterDragAction *action,
|
||||
|
||||
if (action->priv->drag_area_set)
|
||||
{
|
||||
graphene_rect_t *drag_area = &action->priv->drag_area;
|
||||
ClutterRect *drag_area = &action->priv->drag_area;
|
||||
|
||||
x = CLAMP (x, drag_area->origin.x, drag_area->origin.x + drag_area->size.width);
|
||||
y = CLAMP (y, drag_area->origin.y, drag_area->origin.y + drag_area->size.height);
|
||||
@@ -811,7 +811,7 @@ clutter_drag_action_class_init (ClutterDragActionClass *klass)
|
||||
g_param_spec_boxed ("drag-area",
|
||||
P_("Drag Area"),
|
||||
P_("Constrains the dragging to a rectangle"),
|
||||
GRAPHENE_TYPE_RECT,
|
||||
CLUTTER_TYPE_RECT,
|
||||
CLUTTER_PARAM_READWRITE);
|
||||
|
||||
/**
|
||||
@@ -1267,10 +1267,10 @@ clutter_drag_action_get_motion_coords (ClutterDragAction *action,
|
||||
/**
|
||||
* clutter_drag_action_get_drag_area:
|
||||
* @action: a #ClutterDragAction
|
||||
* @drag_area: (out caller-allocates): a #graphene_rect_t to be filled
|
||||
* @drag_area: (out caller-allocates): a #ClutterRect to be filled
|
||||
*
|
||||
* Retrieves the "drag area" associated with @action, that
|
||||
* is a #graphene_rect_t that constrains the actor movements,
|
||||
* is a #ClutterRect that constrains the actor movements,
|
||||
* in parents coordinates.
|
||||
*
|
||||
* Returns: %TRUE if the actor is actually constrained (and thus
|
||||
@@ -1278,7 +1278,7 @@ clutter_drag_action_get_motion_coords (ClutterDragAction *action,
|
||||
*/
|
||||
gboolean
|
||||
clutter_drag_action_get_drag_area (ClutterDragAction *action,
|
||||
graphene_rect_t *drag_area)
|
||||
ClutterRect *drag_area)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_DRAG_ACTION (action), FALSE);
|
||||
|
||||
@@ -1298,8 +1298,8 @@ clutter_drag_action_get_drag_area (ClutterDragAction *action,
|
||||
* If @drag_area is %NULL, the actor is not constrained.
|
||||
*/
|
||||
void
|
||||
clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const graphene_rect_t *drag_area)
|
||||
clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const ClutterRect *drag_area)
|
||||
{
|
||||
ClutterDragActionPrivate *priv;
|
||||
|
||||
|
@@ -141,11 +141,11 @@ void clutter_drag_action_get_motion_coords (ClutterDragAction *actio
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_drag_action_get_drag_area (ClutterDragAction *action,
|
||||
graphene_rect_t *drag_area);
|
||||
ClutterRect *drag_area);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const graphene_rect_t *drag_area);
|
||||
void clutter_drag_action_set_drag_area (ClutterDragAction *action,
|
||||
const ClutterRect *drag_area);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -428,7 +428,8 @@ clutter_drop_action_class_init (ClutterDropActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterDropActionClass, over_in),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@@ -447,7 +448,8 @@ clutter_drop_action_class_init (ClutterDropActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterDropActionClass, over_out),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
|
@@ -12,7 +12,8 @@ gboolean _clutter_effect_modify_paint_volume (ClutterEffect
|
||||
gboolean _clutter_effect_has_custom_paint_volume (ClutterEffect *effect);
|
||||
void _clutter_effect_paint (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags);
|
||||
void _clutter_effect_pick (ClutterEffect *effect);
|
||||
void _clutter_effect_pick (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -100,13 +100,13 @@
|
||||
* // Clear the previous state //
|
||||
* if (self->rect_1)
|
||||
* {
|
||||
* cogl_object_unref (self->rect_1);
|
||||
* cogl_handle_unref (self->rect_1);
|
||||
* self->rect_1 = NULL;
|
||||
* }
|
||||
*
|
||||
* if (self->rect_2)
|
||||
* {
|
||||
* cogl_object_unref (self->rect_2);
|
||||
* cogl_handle_unref (self->rect_2);
|
||||
* self->rect_2 = NULL;
|
||||
* }
|
||||
*
|
||||
@@ -216,13 +216,14 @@ clutter_effect_real_paint (ClutterEffect *effect,
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_effect_real_pick (ClutterEffect *effect)
|
||||
clutter_effect_real_pick (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags)
|
||||
{
|
||||
ClutterActorMeta *actor_meta = CLUTTER_ACTOR_META (effect);
|
||||
ClutterActor *actor;
|
||||
|
||||
actor = clutter_actor_meta_get_actor (actor_meta);
|
||||
clutter_actor_continue_pick (actor);
|
||||
clutter_actor_continue_paint (actor);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -287,11 +288,12 @@ _clutter_effect_paint (ClutterEffect *effect,
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_effect_pick (ClutterEffect *effect)
|
||||
_clutter_effect_pick (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_EFFECT (effect));
|
||||
|
||||
CLUTTER_EFFECT_GET_CLASS (effect)->pick (effect);
|
||||
CLUTTER_EFFECT_GET_CLASS (effect)->pick (effect, flags);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@@ -82,7 +82,8 @@ struct _ClutterEffectClass
|
||||
|
||||
void (* paint) (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags);
|
||||
void (* pick) (ClutterEffect *effect);
|
||||
void (* pick) (ClutterEffect *effect,
|
||||
ClutterEffectPaintFlags flags);
|
||||
|
||||
/*< private >*/
|
||||
void (* _clutter_effect4) (void);
|
||||
|
@@ -13,7 +13,7 @@ G_BEGIN_DECLS
|
||||
/*** END file-header ***/
|
||||
|
||||
/*** BEGIN file-production ***/
|
||||
/* enumerations from "@basename@" */
|
||||
/* enumerations from "@filename@" */
|
||||
/*** END file-production ***/
|
||||
|
||||
/*** BEGIN value-header ***/
|
||||
|
@@ -277,6 +277,24 @@ typedef enum
|
||||
CLUTTER_ANIMATION_LAST
|
||||
} ClutterAnimationMode;
|
||||
|
||||
/**
|
||||
* ClutterFontFlags:
|
||||
* @CLUTTER_FONT_MIPMAPPING: Set to use mipmaps for the glyph cache textures.
|
||||
* @CLUTTER_FONT_HINTING: Set to enable hinting on the glyphs.
|
||||
*
|
||||
* Runtime flags to change the font quality. To be used with
|
||||
* clutter_set_font_flags().
|
||||
*
|
||||
* Since: 1.0
|
||||
*
|
||||
* Deprecated: 1.22: Use #cairo_font_options_t instead
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_FONT >*/
|
||||
{
|
||||
CLUTTER_FONT_MIPMAPPING = (1 << 0),
|
||||
CLUTTER_FONT_HINTING = (1 << 1)
|
||||
} ClutterFontFlags;
|
||||
|
||||
/**
|
||||
* ClutterTextDirection:
|
||||
* @CLUTTER_TEXT_DIRECTION_DEFAULT: Use the default setting, as returned
|
||||
@@ -956,6 +974,8 @@ typedef enum /*< prefix=CLUTTER_SCROLL >*/
|
||||
|
||||
/**
|
||||
* ClutterStageState:
|
||||
* @CLUTTER_STAGE_STATE_FULLSCREEN: Fullscreen mask
|
||||
* @CLUTTER_STAGE_STATE_OFFSCREEN: Offscreen mask (deprecated)
|
||||
* @CLUTTER_STAGE_STATE_ACTIVATED: Activated mask
|
||||
*
|
||||
* Stage state masks, used by the #ClutterEvent of type %CLUTTER_STAGE_STATE.
|
||||
@@ -964,13 +984,18 @@ typedef enum /*< prefix=CLUTTER_SCROLL >*/
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_STAGE_STATE_FULLSCREEN = (1 << 1),
|
||||
CLUTTER_STAGE_STATE_OFFSCREEN = (1 << 2),
|
||||
CLUTTER_STAGE_STATE_ACTIVATED = (1 << 3)
|
||||
} ClutterStageState;
|
||||
|
||||
/**
|
||||
* ClutterFeatureFlags:
|
||||
* @CLUTTER_FEATURE_SWAP_THROTTLE: Set if backend throttles buffer swaps.
|
||||
* @CLUTTER_FEATURE_TEXTURE_YUV: Set if YUV based textures supported.
|
||||
* @CLUTTER_FEATURE_TEXTURE_READ_PIXELS: Set if texture pixels can be read.
|
||||
* @CLUTTER_FEATURE_STAGE_STATIC: Set if stage size if fixed (i.e framebuffer)
|
||||
* @CLUTTER_FEATURE_STAGE_USER_RESIZE: Set if stage is able to be user resized.
|
||||
* @CLUTTER_FEATURE_STAGE_CURSOR: Set if stage has a graphical cursor.
|
||||
* @CLUTTER_FEATURE_SHADERS_GLSL: Set if the backend supports GLSL shaders.
|
||||
* @CLUTTER_FEATURE_OFFSCREEN: Set if the backend supports offscreen rendering.
|
||||
@@ -985,7 +1010,10 @@ typedef enum
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_FEATURE_SWAP_THROTTLE = (1 << 3),
|
||||
CLUTTER_FEATURE_TEXTURE_YUV = (1 << 4),
|
||||
CLUTTER_FEATURE_TEXTURE_READ_PIXELS = (1 << 5),
|
||||
CLUTTER_FEATURE_STAGE_STATIC = (1 << 6),
|
||||
CLUTTER_FEATURE_STAGE_USER_RESIZE = (1 << 7),
|
||||
CLUTTER_FEATURE_STAGE_CURSOR = (1 << 8),
|
||||
CLUTTER_FEATURE_SHADERS_GLSL = (1 << 9),
|
||||
CLUTTER_FEATURE_OFFSCREEN = (1 << 10),
|
||||
@@ -1213,7 +1241,8 @@ typedef enum
|
||||
* @CLUTTER_TEXTURE_RGB_FLAG_PREMULT: Unused flag
|
||||
* @CLUTTER_TEXTURE_YUV_FLAG_YUV2: Unused flag
|
||||
*
|
||||
* Flags for clutter_texture_set_from_rgb_data().
|
||||
* Flags for clutter_texture_set_from_rgb_data() and
|
||||
* clutter_texture_set_from_yuv_data().
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
|
@@ -5,28 +5,22 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_event_set_pointer_emulated (ClutterEvent *event,
|
||||
gboolean is_emulated);
|
||||
|
||||
/* Reinjecting queued events for processing */
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_process_event (ClutterEvent *event);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_event_process_filters (ClutterEvent *event);
|
||||
|
||||
/* clears the event queue inside the main context */
|
||||
void _clutter_clear_events_queue (void);
|
||||
void _clutter_clear_events_queue_for_stage (ClutterStage *stage);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_event_set_platform_data (ClutterEvent *event,
|
||||
gpointer data);
|
||||
CLUTTER_EXPORT
|
||||
gpointer _clutter_event_get_platform_data (const ClutterEvent *event);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_event_set_state_full (ClutterEvent *event,
|
||||
ClutterModifierType button_state,
|
||||
ClutterModifierType base_state,
|
||||
@@ -34,7 +28,6 @@ void _clutter_event_set_state_full (ClutterEvent *ev
|
||||
ClutterModifierType locked_state,
|
||||
ClutterModifierType effective_state);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_event_push (const ClutterEvent *event,
|
||||
gboolean do_copy);
|
||||
|
||||
|
38
clutter/clutter/clutter-event-translator.c
Normal file
38
clutter/clutter/clutter-event-translator.c
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-event-translator.h"
|
||||
|
||||
#include "clutter-backend.h"
|
||||
#include "clutter-private.h"
|
||||
|
||||
#define clutter_event_translator_get_type _clutter_event_translator_get_type
|
||||
|
||||
typedef ClutterEventTranslatorIface ClutterEventTranslatorInterface;
|
||||
|
||||
G_DEFINE_INTERFACE (ClutterEventTranslator, clutter_event_translator, G_TYPE_OBJECT);
|
||||
|
||||
static ClutterTranslateReturn
|
||||
default_translate_event (ClutterEventTranslator *translator,
|
||||
gpointer native,
|
||||
ClutterEvent *event)
|
||||
{
|
||||
return CLUTTER_TRANSLATE_CONTINUE;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_event_translator_default_init (ClutterEventTranslatorIface *iface)
|
||||
{
|
||||
iface->translate_event = default_translate_event;
|
||||
}
|
||||
|
||||
ClutterTranslateReturn
|
||||
_clutter_event_translator_translate_event (ClutterEventTranslator *translator,
|
||||
gpointer native,
|
||||
ClutterEvent *translated)
|
||||
{
|
||||
ClutterEventTranslatorIface *iface;
|
||||
|
||||
iface = CLUTTER_EVENT_TRANSLATOR_GET_IFACE (translator);
|
||||
|
||||
return iface->translate_event (translator, native, translated);
|
||||
}
|
42
clutter/clutter/clutter-event-translator.h
Normal file
42
clutter/clutter/clutter-event-translator.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef __CLUTTER_EVENT_TRANSLATOR_H__
|
||||
#define __CLUTTER_EVENT_TRANSLATOR_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <clutter/clutter-event.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_EVENT_TRANSLATOR (_clutter_event_translator_get_type ())
|
||||
#define CLUTTER_EVENT_TRANSLATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_EVENT_TRANSLATOR, ClutterEventTranslator))
|
||||
#define CLUTTER_IS_EVENT_TRANSLATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_EVENT_TRANSLATOR))
|
||||
#define CLUTTER_EVENT_TRANSLATOR_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_EVENT_TRANSLATOR, ClutterEventTranslatorIface))
|
||||
|
||||
typedef struct _ClutterEventTranslator ClutterEventTranslator;
|
||||
typedef struct _ClutterEventTranslatorIface ClutterEventTranslatorIface;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_TRANSLATE_CONTINUE,
|
||||
CLUTTER_TRANSLATE_REMOVE,
|
||||
CLUTTER_TRANSLATE_QUEUE
|
||||
} ClutterTranslateReturn;
|
||||
|
||||
struct _ClutterEventTranslatorIface
|
||||
{
|
||||
GTypeInterface g_iface;
|
||||
|
||||
ClutterTranslateReturn (* translate_event) (ClutterEventTranslator *translator,
|
||||
gpointer native,
|
||||
ClutterEvent *translated);
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType _clutter_event_translator_get_type (void) G_GNUC_CONST;
|
||||
|
||||
ClutterTranslateReturn _clutter_event_translator_translate_event (ClutterEventTranslator *translator,
|
||||
gpointer native,
|
||||
ClutterEvent *translated);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_EVENT_TRANSLATOR_H__ */
|
@@ -370,7 +370,7 @@ clutter_event_get_coords (const ClutterEvent *event,
|
||||
gfloat *x,
|
||||
gfloat *y)
|
||||
{
|
||||
graphene_point_t coords;
|
||||
ClutterPoint coords;
|
||||
|
||||
g_return_if_fail (event != NULL);
|
||||
|
||||
@@ -386,15 +386,15 @@ clutter_event_get_coords (const ClutterEvent *event,
|
||||
/**
|
||||
* clutter_event_get_position:
|
||||
* @event: a #ClutterEvent
|
||||
* @position: a #graphene_point_t
|
||||
* @position: a #ClutterPoint
|
||||
*
|
||||
* Retrieves the event coordinates as a #graphene_point_t.
|
||||
* Retrieves the event coordinates as a #ClutterPoint.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
void
|
||||
clutter_event_get_position (const ClutterEvent *event,
|
||||
graphene_point_t *position)
|
||||
ClutterPoint *position)
|
||||
{
|
||||
g_return_if_fail (event != NULL);
|
||||
g_return_if_fail (position != NULL);
|
||||
@@ -415,42 +415,42 @@ clutter_event_get_position (const ClutterEvent *event,
|
||||
case CLUTTER_PAD_BUTTON_RELEASE:
|
||||
case CLUTTER_PAD_STRIP:
|
||||
case CLUTTER_PAD_RING:
|
||||
graphene_point_init (position, 0.f, 0.f);
|
||||
clutter_point_init (position, 0.f, 0.f);
|
||||
break;
|
||||
|
||||
case CLUTTER_ENTER:
|
||||
case CLUTTER_LEAVE:
|
||||
graphene_point_init (position, event->crossing.x, event->crossing.y);
|
||||
clutter_point_init (position, event->crossing.x, event->crossing.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
graphene_point_init (position, event->button.x, event->button.y);
|
||||
clutter_point_init (position, event->button.x, event->button.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_MOTION:
|
||||
graphene_point_init (position, event->motion.x, event->motion.y);
|
||||
clutter_point_init (position, event->motion.x, event->motion.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCH_BEGIN:
|
||||
case CLUTTER_TOUCH_UPDATE:
|
||||
case CLUTTER_TOUCH_END:
|
||||
case CLUTTER_TOUCH_CANCEL:
|
||||
graphene_point_init (position, event->touch.x, event->touch.y);
|
||||
clutter_point_init (position, event->touch.x, event->touch.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_SCROLL:
|
||||
graphene_point_init (position, event->scroll.x, event->scroll.y);
|
||||
clutter_point_init (position, event->scroll.x, event->scroll.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCHPAD_PINCH:
|
||||
graphene_point_init (position, event->touchpad_pinch.x,
|
||||
event->touchpad_pinch.y);
|
||||
clutter_point_init (position, event->touchpad_pinch.x,
|
||||
event->touchpad_pinch.y);
|
||||
break;
|
||||
|
||||
case CLUTTER_TOUCHPAD_SWIPE:
|
||||
graphene_point_init (position, event->touchpad_swipe.x,
|
||||
event->touchpad_swipe.y);
|
||||
clutter_point_init (position, event->touchpad_swipe.x,
|
||||
event->touchpad_swipe.y);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1796,12 +1796,12 @@ float
|
||||
clutter_event_get_distance (const ClutterEvent *source,
|
||||
const ClutterEvent *target)
|
||||
{
|
||||
graphene_point_t p0, p1;
|
||||
ClutterPoint p0, p1;
|
||||
|
||||
clutter_event_get_position (source, &p0);
|
||||
clutter_event_get_position (source, &p1);
|
||||
|
||||
return graphene_point_distance (&p0, &p1, NULL, NULL);
|
||||
return clutter_point_distance (&p0, &p1, NULL, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1822,17 +1822,17 @@ double
|
||||
clutter_event_get_angle (const ClutterEvent *source,
|
||||
const ClutterEvent *target)
|
||||
{
|
||||
graphene_point_t p0, p1;
|
||||
ClutterPoint p0, p1;
|
||||
float x_distance, y_distance;
|
||||
double angle;
|
||||
|
||||
clutter_event_get_position (source, &p0);
|
||||
clutter_event_get_position (target, &p1);
|
||||
|
||||
if (graphene_point_equal (&p0, &p1))
|
||||
if (clutter_point_equals (&p0, &p1))
|
||||
return 0;
|
||||
|
||||
graphene_point_distance (&p0, &p1, &x_distance, &y_distance);
|
||||
clutter_point_distance (&p0, &p1, &x_distance, &y_distance);
|
||||
|
||||
angle = atan2 (x_distance, y_distance);
|
||||
|
||||
|
@@ -686,7 +686,7 @@ void clutter_event_get_coords (const ClutterEv
|
||||
gfloat *y);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_event_get_position (const ClutterEvent *event,
|
||||
graphene_point_t *position);
|
||||
ClutterPoint *position);
|
||||
CLUTTER_EXPORT
|
||||
float clutter_event_get_distance (const ClutterEvent *source,
|
||||
const ClutterEvent *target);
|
||||
|
@@ -33,6 +33,8 @@
|
||||
*
|
||||
* It is possible to ask whether Clutter has support for specific features at
|
||||
* run-time.
|
||||
*
|
||||
* See also cogl_get_features() and #CoglFeatureFlags
|
||||
*/
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
@@ -58,13 +60,20 @@ typedef struct ClutterFeatures
|
||||
static ClutterFeatures* __features = NULL;
|
||||
|
||||
static ClutterFeatureFlags
|
||||
clutter_features_from_cogl (void)
|
||||
clutter_features_from_cogl (guint cogl_flags)
|
||||
{
|
||||
ClutterFeatureFlags clutter_flags = 0;
|
||||
|
||||
if (cogl_flags & COGL_FEATURE_TEXTURE_YUV)
|
||||
clutter_flags |= CLUTTER_FEATURE_TEXTURE_YUV;
|
||||
|
||||
if (cogl_flags & COGL_FEATURE_TEXTURE_READ_PIXELS)
|
||||
clutter_flags |= CLUTTER_FEATURE_TEXTURE_READ_PIXELS;
|
||||
|
||||
clutter_flags |= CLUTTER_FEATURE_SHADERS_GLSL;
|
||||
|
||||
clutter_flags |= CLUTTER_FEATURE_OFFSCREEN;
|
||||
if (cogl_flags & COGL_FEATURE_OFFSCREEN)
|
||||
clutter_flags |= CLUTTER_FEATURE_OFFSCREEN;
|
||||
|
||||
return clutter_flags;
|
||||
}
|
||||
@@ -92,7 +101,7 @@ _clutter_feature_init (GError **error)
|
||||
if (!_clutter_backend_create_context (context->backend, error))
|
||||
return FALSE;
|
||||
|
||||
__features->flags = (clutter_features_from_cogl ()
|
||||
__features->flags = (clutter_features_from_cogl (cogl_get_features ())
|
||||
| _clutter_backend_get_features (context->backend));
|
||||
|
||||
__features->features_set = TRUE;
|
||||
|
@@ -804,7 +804,8 @@ clutter_gesture_action_class_init (ClutterGestureActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterGestureActionClass, gesture_end),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
|
||||
@@ -826,7 +827,8 @@ clutter_gesture_action_class_init (ClutterGestureActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterGestureActionClass, gesture_cancel),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
}
|
||||
|
@@ -1,111 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Authored By Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
|
||||
*
|
||||
* Copyright (C) 2019 Endless, Inc
|
||||
* Copyright (C) 2009, 2010 Intel Corp
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-graphene.h"
|
||||
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-types.h"
|
||||
|
||||
static gboolean
|
||||
graphene_point_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
double progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_point_t *ap = g_value_get_boxed (a);
|
||||
const graphene_point_t *bp = g_value_get_boxed (b);
|
||||
graphene_point_t res;
|
||||
|
||||
graphene_point_interpolate (ap, bp, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
graphene_point3d_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
double progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_point3d_t *av = g_value_get_boxed (a);
|
||||
const graphene_point3d_t *bv = g_value_get_boxed (b);
|
||||
graphene_point3d_t res;
|
||||
|
||||
graphene_point3d_interpolate (av, bv, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
graphene_rect_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
double progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_rect_t *rect_a = g_value_get_boxed (a);
|
||||
const graphene_rect_t *rect_b = g_value_get_boxed (b);
|
||||
graphene_rect_t res;
|
||||
|
||||
graphene_rect_interpolate (rect_a, rect_b, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
graphene_size_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
double progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const graphene_size_t *as = g_value_get_boxed (a);
|
||||
const graphene_size_t *bs = g_value_get_boxed (b);
|
||||
graphene_size_t res;
|
||||
|
||||
graphene_size_interpolate (as, bs, progress, &res);
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
clutter_graphene_init (void)
|
||||
{
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT,
|
||||
graphene_point_progress);
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT3D,
|
||||
graphene_point3d_progress);
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_RECT,
|
||||
graphene_rect_progress);
|
||||
clutter_interval_register_progress_func (GRAPHENE_TYPE_SIZE,
|
||||
graphene_size_progress);
|
||||
}
|
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Authored By Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
|
||||
*
|
||||
* Copyright (C) 2019 Endless, Inc
|
||||
* Copyright (C) 2009, 2010 Intel Corp
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#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,
|
||||
graphene_point_t *point)
|
||||
ClutterPoint *point)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
||||
g_return_val_if_fail (point != NULL, FALSE);
|
||||
@@ -1038,7 +1038,7 @@ _clutter_input_device_update (ClutterInputDevice *device,
|
||||
ClutterStage *stage;
|
||||
ClutterActor *new_cursor_actor;
|
||||
ClutterActor *old_cursor_actor;
|
||||
graphene_point_t point = GRAPHENE_POINT_INIT (-1.0f, -1.0f);
|
||||
ClutterPoint point = { -1, -1 };
|
||||
ClutterInputDeviceType device_type = device->device_type;
|
||||
|
||||
g_assert (device_type != CLUTTER_KEYBOARD_DEVICE &&
|
||||
@@ -1925,157 +1925,6 @@ _clutter_input_device_reset_scroll_info (ClutterInputDevice *device)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_grab_actor_destroy (ClutterActor *actor,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
switch (device->device_type)
|
||||
{
|
||||
case CLUTTER_POINTER_DEVICE:
|
||||
case CLUTTER_TABLET_DEVICE:
|
||||
device->pointer_grab_actor = NULL;
|
||||
break;
|
||||
|
||||
case CLUTTER_KEYBOARD_DEVICE:
|
||||
device->keyboard_grab_actor = NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_input_device_grab:
|
||||
* @device: a #ClutterInputDevice
|
||||
* @actor: a #ClutterActor
|
||||
*
|
||||
* Acquires a grab on @actor for the given @device.
|
||||
*
|
||||
* Any event coming from @device will be delivered to @actor, bypassing
|
||||
* the usual event delivery mechanism, until the grab is released by
|
||||
* calling clutter_input_device_ungrab().
|
||||
*
|
||||
* The grab is client-side: even if the windowing system used by the Clutter
|
||||
* backend has the concept of "device grabs", Clutter will not use them.
|
||||
*
|
||||
* Only #ClutterInputDevice of types %CLUTTER_POINTER_DEVICE,
|
||||
* %CLUTTER_TABLET_DEVICE and %CLUTTER_KEYBOARD_DEVICE can hold a grab.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
void
|
||||
clutter_input_device_grab (ClutterInputDevice *device,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
ClutterActor **grab_actor;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
|
||||
|
||||
switch (device->device_type)
|
||||
{
|
||||
case CLUTTER_POINTER_DEVICE:
|
||||
case CLUTTER_TABLET_DEVICE:
|
||||
grab_actor = &device->pointer_grab_actor;
|
||||
break;
|
||||
|
||||
case CLUTTER_KEYBOARD_DEVICE:
|
||||
grab_actor = &device->keyboard_grab_actor;
|
||||
break;
|
||||
|
||||
default:
|
||||
g_critical ("Only pointer and keyboard devices can grab an actor");
|
||||
return;
|
||||
}
|
||||
|
||||
if (*grab_actor != NULL)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (*grab_actor,
|
||||
G_CALLBACK (on_grab_actor_destroy),
|
||||
device);
|
||||
}
|
||||
|
||||
*grab_actor = actor;
|
||||
|
||||
g_signal_connect (*grab_actor,
|
||||
"destroy",
|
||||
G_CALLBACK (on_grab_actor_destroy),
|
||||
device);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_input_device_ungrab:
|
||||
* @device: a #ClutterInputDevice
|
||||
*
|
||||
* Releases the grab on the @device, if one is in place.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
void
|
||||
clutter_input_device_ungrab (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterActor **grab_actor;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
|
||||
|
||||
switch (device->device_type)
|
||||
{
|
||||
case CLUTTER_POINTER_DEVICE:
|
||||
case CLUTTER_TABLET_DEVICE:
|
||||
grab_actor = &device->pointer_grab_actor;
|
||||
break;
|
||||
|
||||
case CLUTTER_KEYBOARD_DEVICE:
|
||||
grab_actor = &device->keyboard_grab_actor;
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (*grab_actor == NULL)
|
||||
return;
|
||||
|
||||
g_signal_handlers_disconnect_by_func (*grab_actor,
|
||||
G_CALLBACK (on_grab_actor_destroy),
|
||||
device);
|
||||
|
||||
*grab_actor = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_input_device_get_grabbed_actor:
|
||||
* @device: a #ClutterInputDevice
|
||||
*
|
||||
* Retrieves a pointer to the #ClutterActor currently grabbing all
|
||||
* the events coming from @device.
|
||||
*
|
||||
* Return value: (transfer none): a #ClutterActor, or %NULL
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
ClutterActor *
|
||||
clutter_input_device_get_grabbed_actor (ClutterInputDevice *device)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
|
||||
|
||||
switch (device->device_type)
|
||||
{
|
||||
case CLUTTER_POINTER_DEVICE:
|
||||
case CLUTTER_TABLET_DEVICE:
|
||||
return device->pointer_grab_actor;
|
||||
|
||||
case CLUTTER_KEYBOARD_DEVICE:
|
||||
return device->keyboard_grab_actor;
|
||||
|
||||
default:
|
||||
g_critical ("Only pointer and keyboard devices can grab an actor");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
on_grab_sequence_actor_destroy (ClutterActor *actor,
|
||||
ClutterInputDevice *device)
|
||||
|
@@ -58,7 +58,7 @@ gint clutter_input_device_get_device_id (ClutterInputDev
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_input_device_get_coords (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
graphene_point_t *point);
|
||||
ClutterPoint *point);
|
||||
CLUTTER_EXPORT
|
||||
ClutterModifierType clutter_input_device_get_modifier_state (ClutterInputDevice *device);
|
||||
CLUTTER_EXPORT
|
||||
|
@@ -89,8 +89,8 @@ clutter_input_focus_reset (ClutterInputFocus *focus)
|
||||
}
|
||||
|
||||
void
|
||||
clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const graphene_rect_t *rect)
|
||||
clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const ClutterRect *rect)
|
||||
{
|
||||
ClutterInputFocusPrivate *priv;
|
||||
|
||||
|
@@ -57,8 +57,8 @@ gboolean clutter_input_focus_is_focused (ClutterInputFocus *focus);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_focus_reset (ClutterInputFocus *focus);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const graphene_rect_t *rect);
|
||||
void clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
|
||||
const ClutterRect *rect);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_input_focus_set_surrounding (ClutterInputFocus *focus,
|
||||
|
@@ -26,8 +26,8 @@ ClutterInputFocus * clutter_input_method_get_focus (ClutterInputMethod *method);
|
||||
|
||||
void clutter_input_method_reset (ClutterInputMethod *method);
|
||||
|
||||
void clutter_input_method_set_cursor_location (ClutterInputMethod *method,
|
||||
const graphene_rect_t *rect);
|
||||
void clutter_input_method_set_cursor_location (ClutterInputMethod *method,
|
||||
const ClutterRect *rect);
|
||||
void clutter_input_method_set_surrounding (ClutterInputMethod *method,
|
||||
const gchar *text,
|
||||
guint cursor,
|
||||
|
@@ -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, GRAPHENE_TYPE_RECT);
|
||||
G_TYPE_NONE, 1, CLUTTER_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 graphene_rect_t *rect)
|
||||
clutter_input_method_set_cursor_location (ClutterInputMethod *im,
|
||||
const ClutterRect *rect)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im));
|
||||
|
||||
|
@@ -42,8 +42,8 @@ struct _ClutterInputMethodClass
|
||||
|
||||
void (* reset) (ClutterInputMethod *im);
|
||||
|
||||
void (* set_cursor_location) (ClutterInputMethod *im,
|
||||
const graphene_rect_t *rect);
|
||||
void (* set_cursor_location) (ClutterInputMethod *im,
|
||||
const ClutterRect *rect);
|
||||
void (* set_surrounding) (ClutterInputMethod *im,
|
||||
const gchar *text,
|
||||
guint cursor,
|
||||
|
@@ -27,19 +27,14 @@
|
||||
|
||||
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,8 +171,7 @@ trigger_secondary_click (gpointer data)
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
TRUE);
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
@@ -203,8 +202,7 @@ 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,
|
||||
FALSE);
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK);
|
||||
}
|
||||
device->ptr_a11y_data->secondary_click_triggered = FALSE;
|
||||
}
|
||||
@@ -440,8 +438,7 @@ trigger_dwell_gesture (gpointer data)
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
||||
TRUE);
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
@@ -472,8 +469,7 @@ trigger_dwell_click (gpointer data)
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
TRUE);
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL);
|
||||
|
||||
if (get_dwell_mode (device) == CLUTTER_A11Y_DWELL_MODE_GESTURE)
|
||||
{
|
||||
@@ -518,41 +514,10 @@ stop_dwell_timeout (ClutterInputDevice *device)
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL,
|
||||
FALSE);
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_DWELL);
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -605,7 +570,6 @@ _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);
|
||||
|
||||
@@ -633,13 +597,10 @@ _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);
|
||||
|
||||
if (should_start_dwell (device))
|
||||
start_dwell_position_timeout (device);
|
||||
else if (should_start_dwell (device))
|
||||
start_dwell_timeout (device);
|
||||
}
|
||||
|
||||
if (should_update_dwell_position (device))
|
||||
@@ -661,8 +622,6 @@ _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);
|
||||
|
||||
|
@@ -329,6 +329,9 @@ layout_manager_real_begin_animation (ClutterLayoutManager *manager,
|
||||
/* let the alpha take ownership of the timeline */
|
||||
g_object_unref (timeline);
|
||||
|
||||
g_signal_connect_swapped (timeline, "completed",
|
||||
G_CALLBACK (clutter_layout_manager_end_animation),
|
||||
manager);
|
||||
g_signal_connect_swapped (timeline, "new-frame",
|
||||
G_CALLBACK (clutter_layout_manager_layout_changed),
|
||||
manager);
|
||||
@@ -372,6 +375,9 @@ layout_manager_real_end_animation (ClutterLayoutManager *manager)
|
||||
if (clutter_timeline_is_playing (timeline))
|
||||
clutter_timeline_stop (timeline);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (timeline,
|
||||
G_CALLBACK (clutter_layout_manager_end_animation),
|
||||
manager);
|
||||
g_signal_handlers_disconnect_by_func (timeline,
|
||||
G_CALLBACK (clutter_layout_manager_layout_changed),
|
||||
manager);
|
||||
@@ -438,7 +444,8 @@ clutter_layout_manager_class_init (ClutterLayoutManagerClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterLayoutManagerClass,
|
||||
layout_changed),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
|
@@ -213,6 +213,15 @@ void clutter_layout_manager_child_get_property (ClutterLayoutMa
|
||||
const gchar *property_name,
|
||||
GValue *value);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
ClutterAlpha * clutter_layout_manager_begin_animation (ClutterLayoutManager *manager,
|
||||
guint duration,
|
||||
gulong mode);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_layout_manager_end_animation (ClutterLayoutManager *manager);
|
||||
CLUTTER_DEPRECATED
|
||||
gdouble clutter_layout_manager_get_animation_progress (ClutterLayoutManager *manager);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_LAYOUT_MANAGER_H__ */
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -34,45 +34,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_DEBUG_MISC = 1 << 0,
|
||||
CLUTTER_DEBUG_ACTOR = 1 << 1,
|
||||
CLUTTER_DEBUG_TEXTURE = 1 << 2,
|
||||
CLUTTER_DEBUG_EVENT = 1 << 3,
|
||||
CLUTTER_DEBUG_PAINT = 1 << 4,
|
||||
CLUTTER_DEBUG_PANGO = 1 << 5,
|
||||
CLUTTER_DEBUG_BACKEND = 1 << 6,
|
||||
CLUTTER_DEBUG_SCHEDULER = 1 << 7,
|
||||
CLUTTER_DEBUG_SCRIPT = 1 << 8,
|
||||
CLUTTER_DEBUG_SHADER = 1 << 9,
|
||||
CLUTTER_DEBUG_MULTISTAGE = 1 << 10,
|
||||
CLUTTER_DEBUG_ANIMATION = 1 << 11,
|
||||
CLUTTER_DEBUG_LAYOUT = 1 << 12,
|
||||
CLUTTER_DEBUG_PICK = 1 << 13,
|
||||
CLUTTER_DEBUG_EVENTLOOP = 1 << 14,
|
||||
CLUTTER_DEBUG_CLIPPING = 1 << 15,
|
||||
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 16,
|
||||
} ClutterDebugFlag;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_DEBUG_NOP_PICKING = 1 << 0,
|
||||
} ClutterPickDebugFlag;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_DEBUG_DISABLE_SWAP_EVENTS = 1 << 0,
|
||||
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS = 1 << 1,
|
||||
CLUTTER_DEBUG_REDRAWS = 1 << 2,
|
||||
CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3,
|
||||
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
|
||||
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
|
||||
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
|
||||
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7,
|
||||
CLUTTER_DEBUG_PAINT_DAMAGE_REGION = 1 << 8,
|
||||
} ClutterDrawDebugFlag;
|
||||
|
||||
/**
|
||||
* CLUTTER_INIT_ERROR:
|
||||
*
|
||||
@@ -156,6 +117,9 @@ void clutter_disable_accessibility (void);
|
||||
|
||||
/* Threading functions */
|
||||
CLUTTER_EXPORT
|
||||
void clutter_threads_set_lock_functions (GCallback enter_fn,
|
||||
GCallback leave_fn);
|
||||
CLUTTER_EXPORT
|
||||
guint clutter_threads_add_idle (GSourceFunc func,
|
||||
gpointer data);
|
||||
CLUTTER_EXPORT
|
||||
@@ -185,6 +149,19 @@ guint clutter_threads_add_repaint_func_full (ClutterRepaintF
|
||||
CLUTTER_EXPORT
|
||||
void clutter_threads_remove_repaint_func (guint handle_id);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_grab_pointer (ClutterActor *actor);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_ungrab_pointer (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterActor * clutter_get_pointer_grab (void);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_grab_keyboard (ClutterActor *actor);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_ungrab_keyboard (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterActor * clutter_get_keyboard_grab (void);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
PangoFontMap * clutter_get_font_map (void);
|
||||
|
||||
@@ -197,15 +174,6 @@ guint clutter_get_default_frame_rate (void);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_check_windowing_backend (const char *backend_type);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_add_debug_flags (ClutterDebugFlag debug_flags,
|
||||
ClutterDrawDebugFlag draw_flags,
|
||||
ClutterPickDebugFlag pick_flags);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_remove_debug_flags (ClutterDebugFlag debug_flags,
|
||||
ClutterDrawDebugFlag draw_flags,
|
||||
ClutterPickDebugFlag pick_flags);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -12,14 +12,17 @@ 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
|
||||
@@ -27,9 +30,12 @@ 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,15 +26,10 @@
|
||||
#define __CLUTTER_H_INSIDE__
|
||||
|
||||
#include "clutter-backend.h"
|
||||
#include "clutter-device-manager-private.h"
|
||||
#include "clutter-event-private.h"
|
||||
#include "clutter-input-pointer-a11y-private.h"
|
||||
#include "clutter-macros.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-stage-private.h"
|
||||
#include "clutter-stage-view.h"
|
||||
#include "cogl/clutter-stage-cogl.h"
|
||||
#include "clutter/x11/clutter-backend-x11.h"
|
||||
#include "x11/clutter-stage-x11.h"
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_set_custom_backend_func (ClutterBackend *(* func) (void));
|
||||
@@ -48,6 +43,11 @@ void clutter_stage_capture_into (ClutterStage *stage,
|
||||
cairo_rectangle_int_t *rect,
|
||||
uint8_t *data);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterStageView * clutter_stage_get_view_at (ClutterStage *stage,
|
||||
float x,
|
||||
float y);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_freeze_updates (ClutterStage *stage);
|
||||
|
||||
|
@@ -86,7 +86,7 @@ struct _ClutterOffscreenEffectPrivate
|
||||
ClutterActor *actor;
|
||||
ClutterActor *stage;
|
||||
|
||||
graphene_point3d_t position;
|
||||
ClutterVertex 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_object_unref (priv->offscreen);
|
||||
cogl_handle_unref (priv->offscreen);
|
||||
priv->offscreen = NULL;
|
||||
}
|
||||
|
||||
@@ -199,13 +199,13 @@ update_fbo (ClutterEffect *effect,
|
||||
|
||||
if (priv->texture != NULL)
|
||||
{
|
||||
cogl_object_unref (priv->texture);
|
||||
cogl_handle_unref (priv->texture);
|
||||
priv->texture = NULL;
|
||||
}
|
||||
|
||||
if (priv->offscreen != NULL)
|
||||
{
|
||||
cogl_object_unref (priv->offscreen);
|
||||
cogl_handle_unref (priv->offscreen);
|
||||
priv->offscreen = NULL;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ update_fbo (ClutterEffect *effect,
|
||||
{
|
||||
g_warning ("%s: Unable to create an Offscreen buffer", G_STRLOC);
|
||||
|
||||
cogl_object_unref (priv->target);
|
||||
cogl_handle_unref (priv->target);
|
||||
priv->target = NULL;
|
||||
|
||||
priv->target_width = 0;
|
||||
@@ -250,11 +250,9 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
||||
gfloat target_width = -1, target_height = -1;
|
||||
gfloat resource_scale;
|
||||
gfloat ceiled_resource_scale;
|
||||
graphene_point3d_t local_offset;
|
||||
ClutterVertex local_offset = { 0.f, 0.f, 0.f };
|
||||
gfloat old_viewport[4];
|
||||
|
||||
local_offset = GRAPHENE_POINT3D_INIT (0.0f, 0.0f, 0.0f);
|
||||
|
||||
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))
|
||||
return FALSE;
|
||||
|
||||
@@ -489,13 +487,13 @@ clutter_offscreen_effect_finalize (GObject *gobject)
|
||||
ClutterOffscreenEffectPrivate *priv = self->priv;
|
||||
|
||||
if (priv->offscreen)
|
||||
cogl_object_unref (priv->offscreen);
|
||||
cogl_handle_unref (priv->offscreen);
|
||||
|
||||
if (priv->target)
|
||||
cogl_object_unref (priv->target);
|
||||
cogl_handle_unref (priv->target);
|
||||
|
||||
if (priv->texture)
|
||||
cogl_object_unref (priv->texture);
|
||||
cogl_handle_unref (priv->texture);
|
||||
|
||||
G_OBJECT_CLASS (clutter_offscreen_effect_parent_class)->finalize (gobject);
|
||||
}
|
||||
@@ -539,7 +537,7 @@ clutter_offscreen_effect_init (ClutterOffscreenEffect *self)
|
||||
* used instead of clutter_offscreen_effect_get_target() when the
|
||||
* effect subclass wants to paint using its own material.
|
||||
*
|
||||
* Return value: (transfer none): a #CoglHandle or %NULL. The
|
||||
* Return value: (transfer none): a #CoglHandle or %COGL_INVALID_HANDLE. The
|
||||
* returned texture is owned by Clutter and it should not be
|
||||
* modified or freed
|
||||
*
|
||||
@@ -604,7 +602,7 @@ clutter_offscreen_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
* Calls the create_texture() virtual function of the @effect
|
||||
*
|
||||
* Return value: (transfer full): a handle to a Cogl texture, or
|
||||
* %NULL. The returned handle has its reference
|
||||
* %COGL_INVALID_HANDLE. The returned handle has its reference
|
||||
* count increased.
|
||||
*
|
||||
* Since: 1.4
|
||||
@@ -684,7 +682,7 @@ clutter_offscreen_effect_get_target_size (ClutterOffscreenEffect *effect,
|
||||
*/
|
||||
gboolean
|
||||
clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
||||
graphene_rect_t *rect)
|
||||
ClutterRect *rect)
|
||||
{
|
||||
ClutterOffscreenEffectPrivate *priv;
|
||||
|
||||
@@ -696,11 +694,11 @@ clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
||||
if (priv->texture == NULL)
|
||||
return FALSE;
|
||||
|
||||
graphene_rect_init (rect,
|
||||
priv->position.x,
|
||||
priv->position.y,
|
||||
cogl_texture_get_width (priv->texture),
|
||||
cogl_texture_get_height (priv->texture));
|
||||
clutter_rect_init (rect,
|
||||
priv->position.x,
|
||||
priv->position.y,
|
||||
cogl_texture_get_width (priv->texture),
|
||||
cogl_texture_get_height (priv->texture));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -114,7 +114,7 @@ gboolean clutter_offscreen_effect_get_target_size (ClutterOffscree
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
|
||||
graphene_rect_t *rect);
|
||||
ClutterRect *rect);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -138,6 +138,32 @@ 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))
|
||||
#define CLUTTER_IS_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_LAYER_NODE))
|
||||
|
||||
/*
|
||||
* ClutterLayerNode:
|
||||
*
|
||||
* The #ClutterLayerNode structure is an opaque
|
||||
* type whose members cannot be directly accessed.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef struct _ClutterLayerNode ClutterLayerNode;
|
||||
typedef struct _ClutterLayerNodeClass ClutterLayerNodeClass;
|
||||
|
||||
GType _clutter_layer_node_get_type (void) G_GNUC_CONST;
|
||||
|
||||
ClutterPaintNode * _clutter_layer_node_new (const CoglMatrix *projection,
|
||||
const cairo_rectangle_t *viewport,
|
||||
float width,
|
||||
float height,
|
||||
guint8 opacity);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -1099,12 +1099,12 @@ clutter_paint_node_to_json (ClutterPaintNode *node)
|
||||
|
||||
case PAINT_OP_PATH:
|
||||
json_builder_set_member_name (builder, "path");
|
||||
json_builder_add_int_value (builder, (intptr_t) op->op.path);
|
||||
json_builder_add_int_value (builder, (gint64) op->op.path);
|
||||
break;
|
||||
|
||||
case PAINT_OP_PRIMITIVE:
|
||||
json_builder_set_member_name (builder, "primitive");
|
||||
json_builder_add_int_value (builder, (intptr_t) op->op.primitive);
|
||||
json_builder_add_int_value (builder, (gint64) op->op.primitive);
|
||||
break;
|
||||
|
||||
case PAINT_OP_INVALID:
|
||||
@@ -1194,15 +1194,6 @@ clutter_paint_node_get_root (ClutterPaintNode *node)
|
||||
return iter;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_paint_node_get_framebuffer:
|
||||
* @node: a #ClutterPaintNode
|
||||
*
|
||||
* Retrieves the #CoglFramebuffer that @node will draw
|
||||
* into.
|
||||
*
|
||||
* Returns: (transfer none): a #CoglFramebuffer
|
||||
*/
|
||||
CoglFramebuffer *
|
||||
clutter_paint_node_get_framebuffer (ClutterPaintNode *node)
|
||||
{
|
||||
|
@@ -56,9 +56,6 @@ CLUTTER_EXPORT
|
||||
void clutter_paint_node_set_name (ClutterPaintNode *node,
|
||||
const char *name);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
CoglFramebuffer * clutter_paint_node_get_framebuffer (ClutterPaintNode *node);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_node_add_child (ClutterPaintNode *node,
|
||||
ClutterPaintNode *child);
|
||||
|
@@ -183,31 +183,35 @@ clutter_root_node_new (CoglFramebuffer *framebuffer,
|
||||
}
|
||||
|
||||
/*
|
||||
* ClutterTransformNode
|
||||
* Transform node
|
||||
*
|
||||
* A private PaintNode, that changes the modelview of its child
|
||||
* nodes.
|
||||
*/
|
||||
|
||||
struct _ClutterTransformNode
|
||||
{
|
||||
#define clutter_transform_node_get_type _clutter_transform_node_get_type
|
||||
|
||||
typedef struct _ClutterTransformNode {
|
||||
ClutterPaintNode parent_instance;
|
||||
|
||||
CoglMatrix transform;
|
||||
};
|
||||
CoglMatrix modelview;
|
||||
} ClutterTransformNode;
|
||||
|
||||
struct _ClutterTransformNodeClass
|
||||
{
|
||||
ClutterPaintNodeClass parent_class;
|
||||
};
|
||||
typedef struct _ClutterPaintNodeClass ClutterTransformNodeClass;
|
||||
|
||||
G_DEFINE_TYPE (ClutterTransformNode, clutter_transform_node, CLUTTER_TYPE_PAINT_NODE)
|
||||
|
||||
static gboolean
|
||||
clutter_transform_node_pre_draw (ClutterPaintNode *node)
|
||||
{
|
||||
ClutterTransformNode *transform_node = (ClutterTransformNode *) node;
|
||||
CoglFramebuffer *fb = cogl_get_draw_framebuffer ();
|
||||
ClutterTransformNode *tnode = (ClutterTransformNode *) node;
|
||||
CoglMatrix matrix;
|
||||
|
||||
cogl_framebuffer_push_matrix (fb);
|
||||
cogl_framebuffer_transform (fb, &transform_node->transform);
|
||||
cogl_push_matrix ();
|
||||
|
||||
cogl_get_modelview_matrix (&matrix);
|
||||
cogl_matrix_multiply (&matrix, &matrix, &tnode->modelview);
|
||||
cogl_set_modelview_matrix (&matrix);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -215,9 +219,7 @@ clutter_transform_node_pre_draw (ClutterPaintNode *node)
|
||||
static void
|
||||
clutter_transform_node_post_draw (ClutterPaintNode *node)
|
||||
{
|
||||
CoglFramebuffer *fb = cogl_get_draw_framebuffer ();
|
||||
|
||||
cogl_framebuffer_pop_matrix (fb);
|
||||
cogl_pop_matrix ();
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -233,24 +235,18 @@ clutter_transform_node_class_init (ClutterTransformNodeClass *klass)
|
||||
static void
|
||||
clutter_transform_node_init (ClutterTransformNode *self)
|
||||
{
|
||||
cogl_matrix_init_identity (&self->transform);
|
||||
cogl_matrix_init_identity (&self->modelview);
|
||||
}
|
||||
|
||||
/*
|
||||
* clutter_transform_node_new:
|
||||
* @transform: (nullable): the transform matrix to apply
|
||||
*
|
||||
* Return value: (transfer full): the newly created #ClutterTransformNode.
|
||||
* Use clutter_paint_node_unref() when done.
|
||||
*/
|
||||
ClutterPaintNode *
|
||||
clutter_transform_node_new (const CoglMatrix *transform)
|
||||
_clutter_transform_node_new (const CoglMatrix *modelview)
|
||||
{
|
||||
ClutterTransformNode *res;
|
||||
|
||||
res = _clutter_paint_node_create (CLUTTER_TYPE_TRANSFORM_NODE);
|
||||
if (transform)
|
||||
res->transform = *transform;
|
||||
res = _clutter_paint_node_create (_clutter_transform_node_get_type ());
|
||||
|
||||
if (modelview != NULL)
|
||||
res->modelview = *modelview;
|
||||
|
||||
return (ClutterPaintNode *) res;
|
||||
}
|
||||
@@ -1082,101 +1078,10 @@ clutter_clip_node_new (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* ClutterActorNode
|
||||
* ClutterLayerNode (private)
|
||||
*/
|
||||
|
||||
struct _ClutterActorNode
|
||||
{
|
||||
ClutterPaintNode parent_instance;
|
||||
|
||||
ClutterActor *actor;
|
||||
};
|
||||
|
||||
struct _ClutterActorNodeClass
|
||||
{
|
||||
ClutterPaintNodeClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (ClutterActorNode, clutter_actor_node, CLUTTER_TYPE_PAINT_NODE)
|
||||
|
||||
static gboolean
|
||||
clutter_actor_node_pre_draw (ClutterPaintNode *node)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_actor_node_draw (ClutterPaintNode *node)
|
||||
{
|
||||
ClutterActorNode *actor_node = CLUTTER_ACTOR_NODE (node);
|
||||
|
||||
clutter_actor_continue_paint (actor_node->actor);
|
||||
}
|
||||
|
||||
static JsonNode *
|
||||
clutter_actor_node_serialize (ClutterPaintNode *node)
|
||||
{
|
||||
ClutterActorNode *actor_node = CLUTTER_ACTOR_NODE (node);
|
||||
g_autoptr (JsonBuilder) builder = NULL;
|
||||
const char *debug_name;
|
||||
|
||||
debug_name = _clutter_actor_get_debug_name (actor_node->actor);
|
||||
|
||||
builder = json_builder_new ();
|
||||
|
||||
json_builder_begin_object (builder);
|
||||
json_builder_set_member_name (builder, "actor");
|
||||
json_builder_add_string_value (builder, debug_name);
|
||||
json_builder_end_object (builder);
|
||||
|
||||
return json_builder_get_root (builder);
|
||||
}
|
||||
static void
|
||||
clutter_actor_node_class_init (ClutterActorNodeClass *klass)
|
||||
{
|
||||
ClutterPaintNodeClass *node_class;
|
||||
|
||||
node_class = CLUTTER_PAINT_NODE_CLASS (klass);
|
||||
node_class->pre_draw = clutter_actor_node_pre_draw;
|
||||
node_class->draw = clutter_actor_node_draw;
|
||||
node_class->serialize = clutter_actor_node_serialize;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_actor_node_init (ClutterActorNode *self)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* clutter_actor_node_new:
|
||||
* @actor: the actor to paint
|
||||
*
|
||||
* Creates a new #ClutterActorNode.
|
||||
*
|
||||
* The actor is painted together with any effects
|
||||
* applied to it. Children of this node will draw
|
||||
* over the actor contents.
|
||||
*
|
||||
* Return value: (transfer full): the newly created #ClutterActorNode.
|
||||
* Use clutter_paint_node_unref() when done.
|
||||
*/
|
||||
ClutterPaintNode *
|
||||
clutter_actor_node_new (ClutterActor *actor)
|
||||
{
|
||||
ClutterActorNode *res;
|
||||
|
||||
g_assert (actor != NULL);
|
||||
|
||||
res = _clutter_paint_node_create (CLUTTER_TYPE_ACTOR_NODE);
|
||||
res->actor = actor;
|
||||
|
||||
return (ClutterPaintNode *) res;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ClutterLayerNode
|
||||
*/
|
||||
#define clutter_layer_node_get_type _clutter_layer_node_get_type
|
||||
|
||||
struct _ClutterLayerNode
|
||||
{
|
||||
@@ -1363,11 +1268,11 @@ clutter_layer_node_init (ClutterLayerNode *self)
|
||||
* Since: 1.10
|
||||
*/
|
||||
ClutterPaintNode *
|
||||
clutter_layer_node_new (const CoglMatrix *projection,
|
||||
const cairo_rectangle_t *viewport,
|
||||
float width,
|
||||
float height,
|
||||
guint8 opacity)
|
||||
_clutter_layer_node_new (const CoglMatrix *projection,
|
||||
const cairo_rectangle_t *viewport,
|
||||
float width,
|
||||
float height,
|
||||
guint8 opacity)
|
||||
{
|
||||
ClutterLayerNode *res;
|
||||
CoglColor color;
|
||||
|
@@ -143,25 +143,6 @@ CLUTTER_EXPORT
|
||||
ClutterPaintNode * clutter_text_node_new (PangoLayout *layout,
|
||||
const ClutterColor *color);
|
||||
|
||||
#define CLUTTER_TYPE_ACTOR_NODE (clutter_actor_node_get_type ())
|
||||
#define CLUTTER_ACTOR_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ACTOR_NODE, ClutterActorNode))
|
||||
#define CLUTTER_IS_ACTOR_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ACTOR_NODE))
|
||||
|
||||
/**
|
||||
* ClutterActorNode:
|
||||
*
|
||||
* The #ClutterActorNode structure is an opaque
|
||||
* type whose members cannot be directly accessed.
|
||||
*/
|
||||
typedef struct _ClutterActorNode ClutterActorNode;
|
||||
typedef struct _ClutterActorNode ClutterActorNodeClass;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_actor_node_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterPaintNode * clutter_actor_node_new (ClutterActor *actor);
|
||||
|
||||
#define CLUTTER_TYPE_ROOT_NODE (clutter_root_node_get_type ())
|
||||
#define CLUTTER_ROOT_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ROOT_NODE, ClutterRootNode))
|
||||
#define CLUTTER_IS_ROOT_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ROOT_NODE))
|
||||
@@ -182,54 +163,6 @@ CLUTTER_EXPORT
|
||||
ClutterPaintNode * clutter_root_node_new (CoglFramebuffer *framebuffer,
|
||||
const ClutterColor *clear_color,
|
||||
CoglBufferBit clear_flags);
|
||||
|
||||
#define CLUTTER_TYPE_LAYER_NODE (clutter_layer_node_get_type ())
|
||||
#define CLUTTER_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_LAYER_NODE, ClutterLayerNode))
|
||||
#define CLUTTER_IS_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_LAYER_NODE))
|
||||
|
||||
/*
|
||||
* ClutterLayerNode:
|
||||
*
|
||||
* The #ClutterLayerNode structure is an opaque
|
||||
* type whose members cannot be directly accessed.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef struct _ClutterLayerNode ClutterLayerNode;
|
||||
typedef struct _ClutterLayerNodeClass ClutterLayerNodeClass;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_layer_node_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterPaintNode * clutter_layer_node_new (const CoglMatrix *projection,
|
||||
const cairo_rectangle_t *viewport,
|
||||
float width,
|
||||
float height,
|
||||
guint8 opacity);
|
||||
|
||||
|
||||
#define CLUTTER_TYPE_TRANSFORM_NODE (clutter_transform_node_get_type ())
|
||||
#define CLUTTER_TRANSFORM_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_TRANSFORM_NODE, ClutterTransformNode))
|
||||
#define CLUTTER_IS_TRANSFORM_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_TRANSFORM_NODE))
|
||||
|
||||
/*
|
||||
* ClutterTransformNode:
|
||||
*
|
||||
* The #ClutterLayerNode structure is an opaque
|
||||
* type whose members cannot be directly accessed.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef struct _ClutterTransformNode ClutterTransformNode;
|
||||
typedef struct _ClutterPaintNodeClass ClutterTransformNodeClass;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_transform_node_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterPaintNode * clutter_transform_node_new (const CoglMatrix *projection);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_PAINT_NODES_H__ */
|
||||
|
@@ -58,7 +58,7 @@ struct _ClutterPaintVolume
|
||||
* elements 4, 5, 6 and 7 most of the time for 2D actors when
|
||||
* calculating the projected paint box.
|
||||
*/
|
||||
graphene_point3d_t vertices[8];
|
||||
ClutterVertex vertices[8];
|
||||
|
||||
/* As an optimization for internally managed PaintVolumes we allow
|
||||
* initializing ClutterPaintVolume variables allocated on the stack
|
||||
|
@@ -63,7 +63,7 @@ _clutter_paint_volume_new (ClutterActor *actor)
|
||||
|
||||
pv->actor = actor;
|
||||
|
||||
memset (pv->vertices, 0, 8 * sizeof (graphene_point3d_t));
|
||||
memset (pv->vertices, 0, 8 * sizeof (ClutterVertex));
|
||||
|
||||
pv->is_static = FALSE;
|
||||
pv->is_empty = TRUE;
|
||||
@@ -96,7 +96,7 @@ _clutter_paint_volume_init_static (ClutterPaintVolume *pv,
|
||||
{
|
||||
pv->actor = actor;
|
||||
|
||||
memset (pv->vertices, 0, 8 * sizeof (graphene_point3d_t));
|
||||
memset (pv->vertices, 0, 8 * sizeof (ClutterVertex));
|
||||
|
||||
pv->is_static = TRUE;
|
||||
pv->is_empty = TRUE;
|
||||
@@ -170,7 +170,7 @@ clutter_paint_volume_free (ClutterPaintVolume *pv)
|
||||
/**
|
||||
* clutter_paint_volume_set_origin:
|
||||
* @pv: a #ClutterPaintVolume
|
||||
* @origin: a #graphene_point3d_t
|
||||
* @origin: a #ClutterVertex
|
||||
*
|
||||
* Sets the origin of the paint volume.
|
||||
*
|
||||
@@ -182,8 +182,8 @@ clutter_paint_volume_free (ClutterPaintVolume *pv)
|
||||
* Since: 1.6
|
||||
*/
|
||||
void
|
||||
clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||
const graphene_point3d_t *origin)
|
||||
clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||
const ClutterVertex *origin)
|
||||
{
|
||||
static const int key_vertices[4] = { 0, 1, 3, 4 };
|
||||
float dx, dy, dz;
|
||||
@@ -210,7 +210,7 @@ clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||
/**
|
||||
* clutter_paint_volume_get_origin:
|
||||
* @pv: a #ClutterPaintVolume
|
||||
* @vertex: (out): the return location for a #graphene_point3d_t
|
||||
* @vertex: (out): the return location for a #ClutterVertex
|
||||
*
|
||||
* Retrieves the origin of the #ClutterPaintVolume.
|
||||
*
|
||||
@@ -218,7 +218,7 @@ clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||
*/
|
||||
void
|
||||
clutter_paint_volume_get_origin (const ClutterPaintVolume *pv,
|
||||
graphene_point3d_t *vertex)
|
||||
ClutterVertex *vertex)
|
||||
{
|
||||
g_return_if_fail (pv != NULL);
|
||||
g_return_if_fail (vertex != NULL);
|
||||
@@ -659,7 +659,7 @@ clutter_paint_volume_union_box (ClutterPaintVolume *pv,
|
||||
const ClutterActorBox *box)
|
||||
{
|
||||
ClutterPaintVolume volume;
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
|
||||
g_return_if_fail (pv != NULL);
|
||||
g_return_if_fail (box != NULL);
|
||||
@@ -757,7 +757,7 @@ _clutter_paint_volume_get_bounding_box (ClutterPaintVolume *pv,
|
||||
ClutterActorBox *box)
|
||||
{
|
||||
gfloat x_min, y_min, x_max, y_max;
|
||||
graphene_point3d_t *vertices;
|
||||
ClutterVertex *vertices;
|
||||
int count;
|
||||
gint i;
|
||||
|
||||
@@ -878,9 +878,9 @@ _clutter_paint_volume_transform (ClutterPaintVolume *pv,
|
||||
|
||||
cogl_matrix_transform_points (matrix,
|
||||
3,
|
||||
sizeof (graphene_point3d_t),
|
||||
sizeof (ClutterVertex),
|
||||
pv->vertices,
|
||||
sizeof (graphene_point3d_t),
|
||||
sizeof (ClutterVertex),
|
||||
pv->vertices,
|
||||
transform_count);
|
||||
|
||||
@@ -896,7 +896,7 @@ _clutter_paint_volume_axis_align (ClutterPaintVolume *pv)
|
||||
{
|
||||
int count;
|
||||
int i;
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
float max_x;
|
||||
float max_y;
|
||||
float max_z;
|
||||
@@ -1075,7 +1075,7 @@ _clutter_paint_volume_cull (ClutterPaintVolume *pv,
|
||||
const ClutterPlane *planes)
|
||||
{
|
||||
int vertex_count;
|
||||
graphene_point3d_t *vertices = pv->vertices;
|
||||
ClutterVertex *vertices = pv->vertices;
|
||||
gboolean partial = FALSE;
|
||||
int i;
|
||||
int j;
|
||||
@@ -1097,18 +1097,24 @@ _clutter_paint_volume_cull (ClutterPaintVolume *pv,
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
const ClutterPlane *plane = &planes[i];
|
||||
int out = 0;
|
||||
for (j = 0; j < vertex_count; j++)
|
||||
{
|
||||
graphene_vec3_t v;
|
||||
ClutterVertex p;
|
||||
float distance;
|
||||
|
||||
graphene_vec3_init (&v,
|
||||
vertices[j].x - graphene_vec3_get_x (&plane->v0),
|
||||
vertices[j].y - graphene_vec3_get_y (&plane->v0),
|
||||
vertices[j].z - graphene_vec3_get_z (&plane->v0));
|
||||
/* XXX: for perspective projections this can be optimized
|
||||
* out because all the planes should pass through the origin
|
||||
* so (0,0,0) is a valid v0. */
|
||||
p.x = vertices[j].x - planes[i].v0[0];
|
||||
p.y = vertices[j].y - planes[i].v0[1];
|
||||
p.z = vertices[j].z - planes[i].v0[2];
|
||||
|
||||
if (graphene_vec3_dot (&plane->n, &v) < 0)
|
||||
distance = (planes[i].n[0] * p.x +
|
||||
planes[i].n[1] * p.y +
|
||||
planes[i].n[2] * p.z);
|
||||
|
||||
if (distance < 0)
|
||||
out++;
|
||||
}
|
||||
|
||||
|
@@ -579,7 +579,8 @@ clutter_pan_action_class_init (ClutterPanActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterPanActionClass, pan_stopped),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
}
|
||||
|
@@ -27,7 +27,8 @@
|
||||
* and bezier curves.
|
||||
*
|
||||
* A #ClutterPath contains a description of a path consisting of
|
||||
* straight lines and bezier curves.
|
||||
* straight lines and bezier curves. This can be used in a
|
||||
* #ClutterBehaviourPath to animate an actor moving along the path.
|
||||
*
|
||||
* The path consists of a series of nodes. Each node is one of the
|
||||
* following four types:
|
||||
@@ -243,6 +244,9 @@ clutter_path_finalize (GObject *object)
|
||||
*
|
||||
* Creates a new #ClutterPath instance with no nodes.
|
||||
*
|
||||
* The object has a floating reference so if you add it to a
|
||||
* #ClutterBehaviourPath then you do not need to unref it.
|
||||
*
|
||||
* Return value: the newly created #ClutterPath
|
||||
*
|
||||
* Since: 1.0
|
||||
@@ -263,6 +267,9 @@ clutter_path_new (void)
|
||||
* @desc. See clutter_path_add_string() for details of the format of
|
||||
* the string.
|
||||
*
|
||||
* The object has a floating reference so if you add it to a
|
||||
* #ClutterBehaviourPath then you do not need to unref it.
|
||||
*
|
||||
* Return value: the newly created #ClutterPath
|
||||
*
|
||||
* Since: 1.0
|
||||
|
@@ -64,10 +64,10 @@ typedef struct _ClutterVertex4 ClutterVertex4;
|
||||
#define CLUTTER_UNSET_PRIVATE_FLAGS(a,f) (CLUTTER_PRIVATE_FLAGS (a) &= ~(f))
|
||||
|
||||
#define CLUTTER_ACTOR_IS_TOPLEVEL(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IS_TOPLEVEL) != FALSE)
|
||||
#define CLUTTER_ACTOR_IS_INTERNAL_CHILD(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_INTERNAL_CHILD) != FALSE)
|
||||
#define CLUTTER_ACTOR_IN_DESTRUCTION(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_DESTRUCTION) != FALSE)
|
||||
#define CLUTTER_ACTOR_IN_REPARENT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_REPARENT) != FALSE)
|
||||
#define CLUTTER_ACTOR_IN_PAINT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PAINT) != FALSE)
|
||||
#define CLUTTER_ACTOR_IN_PICK(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PICK) != FALSE)
|
||||
#define CLUTTER_ACTOR_IN_RELAYOUT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_RELAYOUT) != FALSE)
|
||||
#define CLUTTER_ACTOR_IN_PREF_WIDTH(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PREF_WIDTH) != FALSE)
|
||||
#define CLUTTER_ACTOR_IN_PREF_HEIGHT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PREF_HEIGHT) != FALSE)
|
||||
@@ -85,6 +85,7 @@ typedef struct _ClutterVertex4 ClutterVertex4;
|
||||
/* keep this for source compatibility with clutter */
|
||||
#define P_(String) (String)
|
||||
#define N_(String) (String)
|
||||
#define _(String) (String)
|
||||
|
||||
/* This is a replacement for the nearbyint function which always rounds to the
|
||||
* nearest integer. nearbyint is apparently a C99 function so it might not
|
||||
@@ -105,10 +106,12 @@ typedef enum
|
||||
|
||||
/* Used to avoid recursion */
|
||||
CLUTTER_IN_PAINT = 1 << 5,
|
||||
CLUTTER_IN_PICK = 1 << 6,
|
||||
|
||||
/* Used to avoid recursion */
|
||||
CLUTTER_IN_RELAYOUT = 1 << 7,
|
||||
CLUTTER_IN_RELAYOUT = 1 << 6,
|
||||
|
||||
/* a flag for internal children of Containers (DEPRECATED) */
|
||||
CLUTTER_INTERNAL_CHILD = 1 << 7
|
||||
} ClutterPrivateFlags;
|
||||
|
||||
/*
|
||||
@@ -139,6 +142,13 @@ struct _ClutterMainContext
|
||||
/* default FPS; this is only used if we cannot sync to vblank */
|
||||
guint frame_rate;
|
||||
|
||||
/* actors with a grab on all devices */
|
||||
ClutterActor *pointer_grab_actor;
|
||||
ClutterActor *keyboard_grab_actor;
|
||||
|
||||
/* stack of actors with shaders during paint */
|
||||
GSList *shaders;
|
||||
|
||||
/* fb bit masks for col<->id mapping in picking */
|
||||
gint fb_r_mask;
|
||||
gint fb_g_mask;
|
||||
@@ -163,6 +173,7 @@ struct _ClutterMainContext
|
||||
|
||||
/* boolean flags */
|
||||
guint is_initialized : 1;
|
||||
guint motion_events_per_actor : 1;
|
||||
guint defer_display_setup : 1;
|
||||
guint options_parsed : 1;
|
||||
guint show_fps : 1;
|
||||
@@ -179,9 +190,7 @@ typedef struct
|
||||
gboolean _clutter_threads_dispatch (gpointer data);
|
||||
void _clutter_threads_dispatch_free (gpointer data);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_threads_acquire_lock (void);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_threads_release_lock (void);
|
||||
|
||||
ClutterMainContext * _clutter_context_get_default (void);
|
||||
@@ -189,6 +198,10 @@ void _clutter_context_lock (void);
|
||||
void _clutter_context_unlock (void);
|
||||
gboolean _clutter_context_is_initialized (void);
|
||||
ClutterPickMode _clutter_context_get_pick_mode (void);
|
||||
void _clutter_context_push_shader_stack (ClutterActor *actor);
|
||||
ClutterActor * _clutter_context_pop_shader_stack (ClutterActor *actor);
|
||||
ClutterActor * _clutter_context_peek_shader_stack (void);
|
||||
gboolean _clutter_context_get_motion_events_enabled (void);
|
||||
gboolean _clutter_context_get_show_fps (void);
|
||||
|
||||
gboolean _clutter_feature_init (GError **error);
|
||||
@@ -197,7 +210,11 @@ gboolean _clutter_feature_init (GError **error);
|
||||
gboolean _clutter_diagnostic_enabled (void);
|
||||
void _clutter_diagnostic_message (const char *fmt, ...) G_GNUC_PRINTF (1, 2);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
/* Picking code */
|
||||
guint _clutter_pixel_to_id (guchar pixel[4]);
|
||||
void _clutter_id_to_color (guint id,
|
||||
ClutterColor *col);
|
||||
|
||||
void _clutter_set_sync_to_vblank (gboolean sync_to_vblank);
|
||||
|
||||
/* use this function as the accumulator if you have a signal with
|
||||
@@ -222,17 +239,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 graphene_point3d_t *vertices_in,
|
||||
graphene_point3d_t *vertices_out,
|
||||
int n_vertices);
|
||||
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_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
||||
graphene_rect_t *dest);
|
||||
ClutterRect *dest);
|
||||
|
||||
void _clutter_util_rectangle_int_extents (const graphene_rect_t *src,
|
||||
void _clutter_util_rectangle_int_extents (const ClutterRect *src,
|
||||
cairo_rectangle_int_t *dest);
|
||||
|
||||
void _clutter_util_rectangle_offset (const cairo_rectangle_int_t *src,
|
||||
@@ -280,13 +297,12 @@ void _clutter_util_matrix_skew_yz (ClutterMatrix *matrix,
|
||||
float factor);
|
||||
|
||||
gboolean _clutter_util_matrix_decompose (const ClutterMatrix *src,
|
||||
graphene_point3d_t *scale_p,
|
||||
ClutterVertex *scale_p,
|
||||
float shear_p[3],
|
||||
graphene_point3d_t *rotate_p,
|
||||
graphene_point3d_t *translate_p,
|
||||
ClutterVertex *rotate_p,
|
||||
ClutterVertex *translate_p,
|
||||
ClutterVertex4 *perspective_p);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
PangoDirection _clutter_pango_unichar_direction (gunichar ch);
|
||||
|
||||
PangoDirection _clutter_pango_find_base_dir (const gchar *text,
|
||||
@@ -294,8 +310,8 @@ PangoDirection _clutter_pango_find_base_dir (const gchar *text,
|
||||
|
||||
typedef struct _ClutterPlane
|
||||
{
|
||||
graphene_vec3_t v0;
|
||||
graphene_vec3_t n;
|
||||
float v0[3];
|
||||
float n[3];
|
||||
} ClutterPlane;
|
||||
|
||||
typedef enum _ClutterCullResult
|
||||
@@ -313,8 +329,6 @@ gboolean _clutter_run_progress_function (GType gtype,
|
||||
gdouble progress,
|
||||
GValue *retval);
|
||||
|
||||
void clutter_timeline_cancel_delay (ClutterTimeline *timeline);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_PRIVATE_H__ */
|
||||
|
@@ -352,64 +352,63 @@ _clutter_script_parse_knot (ClutterScript *script,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_rect_from_array (JsonArray *array,
|
||||
graphene_rect_t *rect)
|
||||
parse_geometry_from_array (JsonArray *array,
|
||||
ClutterGeometry *geometry)
|
||||
{
|
||||
if (json_array_get_length (array) != 4)
|
||||
return FALSE;
|
||||
|
||||
graphene_rect_init (rect,
|
||||
json_array_get_int_element (array, 0),
|
||||
json_array_get_int_element (array, 1),
|
||||
json_array_get_int_element (array, 2),
|
||||
json_array_get_int_element (array, 3));
|
||||
geometry->x = json_array_get_int_element (array, 0);
|
||||
geometry->y = json_array_get_int_element (array, 1);
|
||||
geometry->width = json_array_get_int_element (array, 2);
|
||||
geometry->height = json_array_get_int_element (array, 3);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_rect_from_object (JsonObject *object,
|
||||
graphene_rect_t *rect)
|
||||
parse_geometry_from_object (JsonObject *object,
|
||||
ClutterGeometry *geometry)
|
||||
{
|
||||
if (json_object_has_member (object, "x"))
|
||||
rect->origin.x = json_object_get_int_member (object, "x");
|
||||
geometry->x = json_object_get_int_member (object, "x");
|
||||
else
|
||||
rect->origin.x = 0;
|
||||
geometry->x = 0;
|
||||
|
||||
if (json_object_has_member (object, "y"))
|
||||
rect->origin.y = json_object_get_int_member (object, "y");
|
||||
geometry->y = json_object_get_int_member (object, "y");
|
||||
else
|
||||
rect->origin.y = 0;
|
||||
geometry->y = 0;
|
||||
|
||||
if (json_object_has_member (object, "width"))
|
||||
rect->size.width = json_object_get_int_member (object, "width");
|
||||
geometry->width = json_object_get_int_member (object, "width");
|
||||
else
|
||||
rect->size.width = 0;
|
||||
geometry->width = 0;
|
||||
|
||||
if (json_object_has_member (object, "height"))
|
||||
rect->size.height = json_object_get_int_member (object, "height");
|
||||
geometry->height = json_object_get_int_member (object, "height");
|
||||
else
|
||||
rect->size.height = 0;
|
||||
geometry->height = 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_script_parse_rect (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_rect_t *rect)
|
||||
_clutter_script_parse_geometry (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterGeometry *geometry)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
||||
g_return_val_if_fail (node != NULL, FALSE);
|
||||
g_return_val_if_fail (rect != NULL, FALSE);
|
||||
g_return_val_if_fail (geometry != NULL, FALSE);
|
||||
|
||||
switch (JSON_NODE_TYPE (node))
|
||||
{
|
||||
case JSON_NODE_ARRAY:
|
||||
return parse_rect_from_array (json_node_get_array (node), rect);
|
||||
return parse_geometry_from_array (json_node_get_array (node), geometry);
|
||||
|
||||
case JSON_NODE_OBJECT:
|
||||
return parse_rect_from_object (json_node_get_object (node), rect);
|
||||
return parse_geometry_from_object (json_node_get_object (node), geometry);
|
||||
|
||||
default:
|
||||
break;
|
||||
@@ -493,8 +492,8 @@ _clutter_script_parse_color (ClutterScript *script,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_point_from_array (JsonArray *array,
|
||||
graphene_point_t *point)
|
||||
parse_point_from_array (JsonArray *array,
|
||||
ClutterPoint *point)
|
||||
{
|
||||
if (json_array_get_length (array) != 2)
|
||||
return FALSE;
|
||||
@@ -506,8 +505,8 @@ parse_point_from_array (JsonArray *array,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_point_from_object (JsonObject *object,
|
||||
graphene_point_t *point)
|
||||
parse_point_from_object (JsonObject *object,
|
||||
ClutterPoint *point)
|
||||
{
|
||||
if (json_object_has_member (object, "x"))
|
||||
point->x = json_object_get_double_member (object, "x");
|
||||
@@ -523,9 +522,9 @@ parse_point_from_object (JsonObject *object,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_script_parse_point (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_point_t *point)
|
||||
_clutter_script_parse_point (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterPoint *point)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
||||
g_return_val_if_fail (node != NULL, FALSE);
|
||||
@@ -547,8 +546,8 @@ _clutter_script_parse_point (ClutterScript *script,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_size_from_array (JsonArray *array,
|
||||
graphene_size_t *size)
|
||||
parse_size_from_array (JsonArray *array,
|
||||
ClutterSize *size)
|
||||
{
|
||||
if (json_array_get_length (array) != 2)
|
||||
return FALSE;
|
||||
@@ -560,8 +559,8 @@ parse_size_from_array (JsonArray *array,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_size_from_object (JsonObject *object,
|
||||
graphene_size_t *size)
|
||||
parse_size_from_object (JsonObject *object,
|
||||
ClutterSize *size)
|
||||
{
|
||||
if (json_object_has_member (object, "width"))
|
||||
size->width = json_object_get_double_member (object, "width");
|
||||
@@ -577,9 +576,9 @@ parse_size_from_object (JsonObject *object,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_script_parse_size (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_size_t *size)
|
||||
_clutter_script_parse_size (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterSize *size)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), FALSE);
|
||||
g_return_val_if_fail (node != NULL, FALSE);
|
||||
@@ -1329,11 +1328,11 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (p_type == GRAPHENE_TYPE_RECT)
|
||||
else if (p_type == CLUTTER_TYPE_GEOMETRY)
|
||||
{
|
||||
graphene_rect_t rect = GRAPHENE_RECT_INIT_ZERO;
|
||||
ClutterGeometry geom = { 0, };
|
||||
|
||||
/* rect := {
|
||||
/* geometry := {
|
||||
* "x" : (int),
|
||||
* "y" : (int),
|
||||
* "width" : (int),
|
||||
@@ -1341,9 +1340,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
* }
|
||||
*/
|
||||
|
||||
if (_clutter_script_parse_rect (script, node, &rect))
|
||||
if (_clutter_script_parse_geometry (script, node, &geom))
|
||||
{
|
||||
g_value_set_boxed (value, &rect);
|
||||
g_value_set_boxed (value, &geom);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -1365,9 +1364,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (p_type == GRAPHENE_TYPE_POINT)
|
||||
else if (p_type == CLUTTER_TYPE_POINT)
|
||||
{
|
||||
graphene_point_t point = GRAPHENE_POINT_INIT_ZERO;
|
||||
ClutterPoint point = CLUTTER_POINT_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_point (script, node, &point))
|
||||
{
|
||||
@@ -1375,9 +1374,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (p_type == GRAPHENE_TYPE_SIZE)
|
||||
else if (p_type == CLUTTER_TYPE_SIZE)
|
||||
{
|
||||
graphene_size_t size = GRAPHENE_SIZE_INIT_ZERO;
|
||||
ClutterSize size = CLUTTER_SIZE_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_size (script, node, &size))
|
||||
{
|
||||
@@ -1418,15 +1417,15 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_RECT))
|
||||
else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_GEOMETRY))
|
||||
{
|
||||
graphene_rect_t rect = GRAPHENE_RECT_INIT_ZERO;
|
||||
ClutterGeometry geom = { 0, };
|
||||
|
||||
/* rect := [ (int), (int), (int), (int) ] */
|
||||
/* geometry := [ (int), (int), (int), (int) ] */
|
||||
|
||||
if (_clutter_script_parse_rect (script, node, &rect))
|
||||
if (_clutter_script_parse_geometry (script, node, &geom))
|
||||
{
|
||||
g_value_set_boxed (value, &rect);
|
||||
g_value_set_boxed (value, &geom);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -1442,9 +1441,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_POINT))
|
||||
else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_POINT))
|
||||
{
|
||||
graphene_point_t point = GRAPHENE_POINT_INIT_ZERO;
|
||||
ClutterPoint point = CLUTTER_POINT_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_point (script, node, &point))
|
||||
{
|
||||
@@ -1452,9 +1451,9 @@ _clutter_script_parse_node (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (G_VALUE_HOLDS (value, GRAPHENE_TYPE_SIZE))
|
||||
else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_SIZE))
|
||||
{
|
||||
graphene_size_t size = GRAPHENE_SIZE_INIT_ZERO;
|
||||
ClutterSize size = CLUTTER_SIZE_INIT_ZERO;
|
||||
|
||||
if (_clutter_script_parse_size (script, node, &size))
|
||||
{
|
||||
@@ -1637,17 +1636,14 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
GObject *object,
|
||||
const gchar *name,
|
||||
GList *properties,
|
||||
GPtrArray **param_names,
|
||||
GArray **param_values)
|
||||
GArray **params)
|
||||
{
|
||||
ClutterScriptable *scriptable = NULL;
|
||||
ClutterScriptableIface *iface = NULL;
|
||||
GList *l, *unparsed;
|
||||
gboolean parse_custom = FALSE;
|
||||
|
||||
*param_names = g_ptr_array_new_with_free_func (g_free);
|
||||
*param_values = g_array_new (FALSE, FALSE, sizeof (GValue));
|
||||
g_array_set_clear_func (*param_values, (GDestroyNotify) g_value_unset);
|
||||
*params = g_array_new (FALSE, FALSE, sizeof (GParameter));
|
||||
|
||||
if (CLUTTER_IS_SCRIPTABLE (object))
|
||||
{
|
||||
@@ -1663,7 +1659,7 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
for (l = properties; l != NULL; l = l->next)
|
||||
{
|
||||
PropertyInfo *pinfo = l->data;
|
||||
GValue value = G_VALUE_INIT;
|
||||
GParameter param = { NULL };
|
||||
gboolean res = FALSE;
|
||||
|
||||
if (pinfo->is_child || pinfo->is_layout)
|
||||
@@ -1680,12 +1676,12 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
pinfo->name);
|
||||
|
||||
if (parse_custom)
|
||||
res = iface->parse_custom_node (scriptable, script, &value,
|
||||
res = iface->parse_custom_node (scriptable, script, ¶m.value,
|
||||
pinfo->name,
|
||||
pinfo->node);
|
||||
|
||||
if (!res)
|
||||
res = _clutter_script_parse_node (script, &value,
|
||||
res = _clutter_script_parse_node (script, ¶m.value,
|
||||
pinfo->name,
|
||||
pinfo->node,
|
||||
pinfo->pspec);
|
||||
@@ -1697,8 +1693,9 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
continue;
|
||||
}
|
||||
|
||||
g_ptr_array_add (*param_names, g_strdup (pinfo->name));
|
||||
g_array_append_val (*param_values, value);
|
||||
param.name = g_strdup (pinfo->name);
|
||||
|
||||
g_array_append_val (*params, param);
|
||||
|
||||
property_info_free (pinfo);
|
||||
}
|
||||
@@ -1713,8 +1710,7 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
GType gtype,
|
||||
const gchar *name,
|
||||
GList *properties,
|
||||
GPtrArray **construct_param_names,
|
||||
GArray **construct_param_values)
|
||||
GArray **construct_params)
|
||||
{
|
||||
GObjectClass *klass;
|
||||
GList *l, *unparsed;
|
||||
@@ -1722,17 +1718,14 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
klass = g_type_class_ref (gtype);
|
||||
g_assert (klass != NULL);
|
||||
|
||||
*construct_param_names = g_ptr_array_new_with_free_func (g_free);
|
||||
*construct_param_values = g_array_new (FALSE, FALSE, sizeof (GValue));
|
||||
g_array_set_clear_func (*construct_param_values,
|
||||
(GDestroyNotify) g_value_unset);
|
||||
*construct_params = g_array_new (FALSE, FALSE, sizeof (GParameter));
|
||||
|
||||
unparsed = NULL;
|
||||
|
||||
for (l = properties; l != NULL; l = l->next)
|
||||
{
|
||||
PropertyInfo *pinfo = l->data;
|
||||
GValue value = G_VALUE_INIT;
|
||||
GParameter param = { NULL };
|
||||
GParamSpec *pspec = NULL;
|
||||
|
||||
/* we allow custom property names for classes, so if we
|
||||
@@ -1756,7 +1749,9 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!_clutter_script_parse_node (script, &value,
|
||||
param.name = g_strdup (pinfo->name);
|
||||
|
||||
if (!_clutter_script_parse_node (script, ¶m.value,
|
||||
pinfo->name,
|
||||
pinfo->node,
|
||||
pinfo->pspec))
|
||||
@@ -1765,8 +1760,7 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
continue;
|
||||
}
|
||||
|
||||
g_ptr_array_add (*construct_param_names, g_strdup (pinfo->name));
|
||||
g_array_append_val (*construct_param_values, value);
|
||||
g_array_append_val (*construct_params, param);
|
||||
|
||||
property_info_free (pinfo);
|
||||
}
|
||||
@@ -2093,8 +2087,7 @@ _clutter_script_apply_properties (ClutterScript *script,
|
||||
gboolean set_custom_property = FALSE;
|
||||
GObject *object = oinfo->object;
|
||||
GList *properties;
|
||||
g_autoptr (GPtrArray) param_names = NULL;
|
||||
g_autoptr (GArray) param_values = NULL;
|
||||
GArray *params;
|
||||
guint i;
|
||||
|
||||
if (!oinfo->has_unresolved)
|
||||
@@ -2118,31 +2111,34 @@ _clutter_script_apply_properties (ClutterScript *script,
|
||||
object,
|
||||
oinfo->id,
|
||||
properties,
|
||||
¶m_names,
|
||||
¶m_values);
|
||||
¶ms);
|
||||
|
||||
/* consume all the properties we could translate in this pass */
|
||||
for (i = 0; i < param_names->len; i++)
|
||||
for (i = 0; i < params->len; i++)
|
||||
{
|
||||
char *name = g_ptr_array_index (param_names, i);
|
||||
GValue *value = &g_array_index (param_values, GValue, i);
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
|
||||
CLUTTER_NOTE (SCRIPT,
|
||||
"Setting %s property '%s' (type:%s) to object '%s' (id:%s)",
|
||||
set_custom_property ? "custom" : "regular",
|
||||
name,
|
||||
g_type_name (G_VALUE_TYPE (value)),
|
||||
param->name,
|
||||
g_type_name (G_VALUE_TYPE (¶m->value)),
|
||||
g_type_name (oinfo->gtype),
|
||||
oinfo->id);
|
||||
|
||||
if (set_custom_property)
|
||||
iface->set_custom_property (scriptable, script,
|
||||
name,
|
||||
value);
|
||||
param->name,
|
||||
¶m->value);
|
||||
else
|
||||
g_object_set_property (object, name, value);
|
||||
g_object_set_property (object, param->name, ¶m->value);
|
||||
|
||||
g_free ((gchar *) param->name);
|
||||
g_value_unset (¶m->value);
|
||||
}
|
||||
|
||||
g_array_free (params, TRUE);
|
||||
|
||||
_clutter_script_check_unresolved (script, oinfo);
|
||||
}
|
||||
|
||||
@@ -2150,8 +2146,8 @@ void
|
||||
_clutter_script_construct_object (ClutterScript *script,
|
||||
ObjectInfo *oinfo)
|
||||
{
|
||||
g_autoptr (GPtrArray) param_names = NULL;
|
||||
g_autoptr (GArray) param_values = NULL;
|
||||
GArray *params = NULL;
|
||||
guint i;
|
||||
|
||||
/* we have completely updated the object */
|
||||
if (oinfo->object != NULL)
|
||||
@@ -2194,14 +2190,25 @@ _clutter_script_construct_object (ClutterScript *script,
|
||||
oinfo->gtype,
|
||||
oinfo->id,
|
||||
properties,
|
||||
¶m_names,
|
||||
¶m_values);
|
||||
¶ms);
|
||||
|
||||
default_stage = clutter_stage_manager_get_default_stage (manager);
|
||||
oinfo->object = G_OBJECT (default_stage);
|
||||
|
||||
for (i = 0; i < params->len; i++)
|
||||
{
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
|
||||
g_free ((gchar *) param->name);
|
||||
g_value_unset (¶m->value);
|
||||
}
|
||||
|
||||
g_array_free (params, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_autoptr (GPtrArray) param_names = NULL;
|
||||
GArray *param_values;
|
||||
GList *properties = oinfo->properties;
|
||||
|
||||
/* every other object: first, we get the construction parameters */
|
||||
@@ -2210,11 +2217,22 @@ _clutter_script_construct_object (ClutterScript *script,
|
||||
oinfo->gtype,
|
||||
oinfo->id,
|
||||
properties,
|
||||
¶m_names,
|
||||
¶m_values);
|
||||
¶ms);
|
||||
|
||||
/* Convert GParameter → (GStrv, GValue[]) */
|
||||
param_names = g_ptr_array_sized_new (params->len);
|
||||
param_values = g_array_sized_new (TRUE, FALSE, sizeof (GValue), params->len);
|
||||
for (i = 0; i < params->len; i++)
|
||||
{
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
|
||||
g_ptr_array_add (param_names, (gchar *) param->name);
|
||||
g_array_append_val (param_values, param->value);
|
||||
}
|
||||
g_ptr_array_add (param_names, NULL);
|
||||
|
||||
oinfo->object = g_object_new_with_properties (oinfo->gtype,
|
||||
param_names->len,
|
||||
params->len,
|
||||
(const gchar **) param_names->pdata,
|
||||
(const GValue *) param_values->data);
|
||||
|
||||
@@ -2223,6 +2241,17 @@ _clutter_script_construct_object (ClutterScript *script,
|
||||
* else too or only by this ClutterScript object.
|
||||
*/
|
||||
g_object_ref_sink (oinfo->object);
|
||||
|
||||
for (i = 0; i < params->len; i++)
|
||||
{
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
|
||||
g_free ((gchar *) param->name);
|
||||
g_value_unset (¶m->value);
|
||||
}
|
||||
|
||||
g_array_free (param_values, FALSE);
|
||||
g_array_free (params, TRUE);
|
||||
}
|
||||
|
||||
g_assert (oinfo->object != NULL);
|
||||
|
@@ -122,20 +122,20 @@ gboolean _clutter_script_flags_from_string (GType gtype,
|
||||
gboolean _clutter_script_parse_knot (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterKnot *knot);
|
||||
gboolean _clutter_script_parse_rect (ClutterScript *script,
|
||||
gboolean _clutter_script_parse_geometry (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_rect_t *rect);
|
||||
ClutterGeometry *geometry);
|
||||
gboolean _clutter_script_parse_color (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterColor *color);
|
||||
GObject *_clutter_script_parse_alpha (ClutterScript *script,
|
||||
JsonNode *node);
|
||||
gboolean _clutter_script_parse_point (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_point_t *point);
|
||||
gboolean _clutter_script_parse_point (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
ClutterPoint *point);
|
||||
gboolean _clutter_script_parse_size (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
graphene_size_t *size);
|
||||
ClutterSize *size);
|
||||
|
||||
gboolean _clutter_script_parse_translatable_string (ClutterScript *script,
|
||||
JsonNode *node,
|
||||
|
@@ -75,6 +75,65 @@
|
||||
* packing rules of Clutter still apply, and an actor cannot be packed
|
||||
* in multiple containers without unparenting it in between).
|
||||
*
|
||||
* Behaviours and timelines can also be defined inside a UI definition
|
||||
* buffer:
|
||||
*
|
||||
* <informalexample><programlisting><![CDATA[
|
||||
* {
|
||||
* "id" : "rotate-behaviour",
|
||||
* "type" : "ClutterBehaviourRotate",
|
||||
* "angle-start" : 0.0,
|
||||
* "angle-end" : 360.0,
|
||||
* "axis" : "z-axis",
|
||||
* "alpha" : {
|
||||
* "timeline" : { "duration" : 4000, "loop" : true },
|
||||
* "mode" : "easeInSine"
|
||||
* }
|
||||
* }
|
||||
* ]]></programlisting></informalexample>
|
||||
*
|
||||
* And then to apply a defined behaviour to an actor defined inside the
|
||||
* definition of an actor, the "behaviour" member can be used:
|
||||
*
|
||||
* <informalexample><programlisting><![CDATA[
|
||||
* {
|
||||
* "id" : "my-rotating-actor",
|
||||
* "type" : "ClutterTexture",
|
||||
* ...
|
||||
* "behaviours" : [ "rotate-behaviour" ]
|
||||
* }
|
||||
* ]]></programlisting></informalexample>
|
||||
*
|
||||
* A #ClutterAlpha belonging to a #ClutterBehaviour can only be defined
|
||||
* implicitly like in the example above, or explicitly by setting the
|
||||
* "alpha" property to point to a previously defined #ClutterAlpha, e.g.:
|
||||
*
|
||||
* <informalexample><programlisting><![CDATA[
|
||||
* {
|
||||
* "id" : "rotate-behaviour",
|
||||
* "type" : "ClutterBehaviourRotate",
|
||||
* "angle-start" : 0.0,
|
||||
* "angle-end" : 360.0,
|
||||
* "axis" : "z-axis",
|
||||
* "alpha" : {
|
||||
* "id" : "rotate-alpha",
|
||||
* "type" : "ClutterAlpha",
|
||||
* "timeline" : {
|
||||
* "id" : "rotate-timeline",
|
||||
* "type : "ClutterTimeline",
|
||||
* "duration" : 4000,
|
||||
* "loop" : true
|
||||
* },
|
||||
* "function" : "custom_sine_alpha"
|
||||
* }
|
||||
* }
|
||||
* ]]></programlisting></informalexample>
|
||||
*
|
||||
* Implicitely defined #ClutterAlpha<!-- -->s and #ClutterTimeline<!-- -->s
|
||||
* can omit the `id`, as well as the `type` members, but will not be available
|
||||
* using clutter_script_get_object() (they can, however, be extracted using the
|
||||
* #ClutterBehaviour and #ClutterAlpha API respectively).
|
||||
*
|
||||
* Signal handlers can be defined inside a Clutter UI definition file and
|
||||
* then autoconnected to their respective signals using the
|
||||
* clutter_script_connect_signals() function:
|
||||
@@ -151,6 +210,7 @@
|
||||
* function
|
||||
* "type_func" := the GType function name, for non-standard classes
|
||||
* "children" := an array of names or objects to add as children
|
||||
* "behaviours" := an array of names or objects to apply to an actor
|
||||
* "signals" := an array of signal definitions to connect to an object
|
||||
* "is-default" := a boolean flag used when defining the #ClutterStage;
|
||||
* if set to "true" the default stage will be used instead
|
||||
@@ -186,6 +246,7 @@
|
||||
#include "clutter-debug.h"
|
||||
|
||||
#include "deprecated/clutter-alpha.h"
|
||||
#include "deprecated/clutter-behaviour.h"
|
||||
#include "deprecated/clutter-container.h"
|
||||
#include "deprecated/clutter-state.h"
|
||||
|
||||
@@ -202,6 +263,8 @@ enum
|
||||
|
||||
static GParamSpec *obj_props[PROP_LAST];
|
||||
|
||||
#define CLUTTER_SCRIPT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_SCRIPT, ClutterScriptPrivate))
|
||||
|
||||
struct _ClutterScriptPrivate
|
||||
{
|
||||
GHashTable *objects;
|
||||
@@ -314,7 +377,7 @@ object_info_free (gpointer data)
|
||||
static void
|
||||
clutter_script_finalize (GObject *gobject)
|
||||
{
|
||||
ClutterScriptPrivate *priv = CLUTTER_SCRIPT (gobject)->priv;
|
||||
ClutterScriptPrivate *priv = CLUTTER_SCRIPT_GET_PRIVATE (gobject);
|
||||
|
||||
g_object_unref (priv->parser);
|
||||
g_hash_table_destroy (priv->objects);
|
||||
@@ -463,10 +526,11 @@ clutter_script_init (ClutterScript *script)
|
||||
/**
|
||||
* clutter_script_new:
|
||||
*
|
||||
* Creates a new #ClutterScript instance. #ClutterScript can be used to load
|
||||
* objects definitions for scenegraph elements, like actors, or behavioural
|
||||
* elements, like timelines. The definitions must be encoded using the
|
||||
* JavaScript Object Notation (JSON) language.
|
||||
* Creates a new #ClutterScript instance. #ClutterScript can be used
|
||||
* to load objects definitions for scenegraph elements, like actors,
|
||||
* or behavioural elements, like behaviours and timelines. The
|
||||
* definitions must be encoded using the JavaScript Object Notation (JSON)
|
||||
* language.
|
||||
*
|
||||
* Return value: the newly created #ClutterScript instance. Use
|
||||
* g_object_unref() when done.
|
||||
@@ -801,7 +865,9 @@ construct_each_objects (gpointer key,
|
||||
if (oinfo->object == NULL)
|
||||
_clutter_script_construct_object (script, oinfo);
|
||||
|
||||
/* this will take care of setting up properties and adding children */
|
||||
/* this will take care of setting up properties,
|
||||
* adding children and applying behaviours
|
||||
*/
|
||||
_clutter_script_apply_properties (script, oinfo);
|
||||
}
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@
|
||||
|
||||
struct _ClutterScrollActorPrivate
|
||||
{
|
||||
graphene_point_t scroll_to;
|
||||
ClutterPoint scroll_to;
|
||||
|
||||
ClutterScrollMode scroll_mode;
|
||||
|
||||
@@ -94,19 +94,19 @@ G_DEFINE_TYPE_WITH_CODE (ClutterScrollActor, clutter_scroll_actor, CLUTTER_TYPE_
|
||||
clutter_animatable_iface_init))
|
||||
|
||||
static void
|
||||
clutter_scroll_actor_set_scroll_to_internal (ClutterScrollActor *self,
|
||||
const graphene_point_t *point)
|
||||
clutter_scroll_actor_set_scroll_to_internal (ClutterScrollActor *self,
|
||||
const ClutterPoint *point)
|
||||
{
|
||||
ClutterScrollActorPrivate *priv = self->priv;
|
||||
ClutterActor *actor = CLUTTER_ACTOR (self);
|
||||
ClutterMatrix m = CLUTTER_MATRIX_INIT_IDENTITY;
|
||||
float dx, dy;
|
||||
|
||||
if (graphene_point_equal (&priv->scroll_to, point))
|
||||
if (clutter_point_equals (&priv->scroll_to, point))
|
||||
return;
|
||||
|
||||
if (point == NULL)
|
||||
graphene_point_init (&priv->scroll_to, 0.f, 0.f);
|
||||
clutter_point_init (&priv->scroll_to, 0.f, 0.f);
|
||||
else
|
||||
priv->scroll_to = *point;
|
||||
|
||||
@@ -216,7 +216,7 @@ clutter_scroll_actor_set_final_state (ClutterAnimatable *animatable,
|
||||
if (strcmp (property_name, "scroll-to") == 0)
|
||||
{
|
||||
ClutterScrollActor *self = CLUTTER_SCROLL_ACTOR (animatable);
|
||||
const graphene_point_t *point = g_value_get_boxed (value);
|
||||
const ClutterPoint *point = g_value_get_boxed (value);
|
||||
|
||||
clutter_scroll_actor_set_scroll_to_internal (self, point);
|
||||
}
|
||||
@@ -248,7 +248,7 @@ clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
|
||||
g_param_spec_boxed ("scroll-to",
|
||||
"Scroll To",
|
||||
"The point to scroll the actor to",
|
||||
GRAPHENE_TYPE_POINT,
|
||||
CLUTTER_TYPE_POINT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
CLUTTER_PARAM_ANIMATABLE);
|
||||
@@ -322,7 +322,7 @@ clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor)
|
||||
/**
|
||||
* clutter_scroll_actor_scroll_to_point:
|
||||
* @actor: a #ClutterScrollActor
|
||||
* @point: a #graphene_point_t
|
||||
* @point: a #ClutterPoint
|
||||
*
|
||||
* Scrolls the contents of @actor so that @point is the new origin
|
||||
* of the visible area.
|
||||
@@ -335,8 +335,8 @@ clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor)
|
||||
* Since: 1.12
|
||||
*/
|
||||
void
|
||||
clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
const graphene_point_t *point)
|
||||
clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
const ClutterPoint *point)
|
||||
{
|
||||
ClutterScrollActorPrivate *priv;
|
||||
const ClutterAnimationInfo *info;
|
||||
@@ -390,10 +390,10 @@ clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
|
||||
/* if a transition already exist, update its bounds */
|
||||
clutter_transition_set_from (priv->transition,
|
||||
GRAPHENE_TYPE_POINT,
|
||||
CLUTTER_TYPE_POINT,
|
||||
&priv->scroll_to);
|
||||
clutter_transition_set_to (priv->transition,
|
||||
GRAPHENE_TYPE_POINT,
|
||||
CLUTTER_TYPE_POINT,
|
||||
point);
|
||||
|
||||
/* always use the current easing state */
|
||||
@@ -417,10 +417,10 @@ clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
* Since: 1.12
|
||||
*/
|
||||
void
|
||||
clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
const graphene_rect_t *rect)
|
||||
clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
const ClutterRect *rect)
|
||||
{
|
||||
graphene_rect_t n_rect;
|
||||
ClutterRect n_rect;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_SCROLL_ACTOR (actor));
|
||||
g_return_if_fail (rect != NULL);
|
||||
@@ -428,7 +428,7 @@ clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
n_rect = *rect;
|
||||
|
||||
/* normalize, so that we have a valid origin */
|
||||
graphene_rect_normalize (&n_rect);
|
||||
clutter_rect_normalize (&n_rect);
|
||||
|
||||
clutter_scroll_actor_scroll_to_point (actor, &n_rect.origin);
|
||||
}
|
||||
|
@@ -86,11 +86,11 @@ CLUTTER_EXPORT
|
||||
ClutterScrollMode clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
const graphene_point_t *point);
|
||||
void clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
||||
const ClutterPoint *point);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
const graphene_rect_t *rect);
|
||||
void clutter_scroll_actor_scroll_to_rect (ClutterScrollActor *actor,
|
||||
const ClutterRect *rect);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -177,18 +177,18 @@ clutter_shader_effect_clear (ClutterShaderEffect *self,
|
||||
{
|
||||
ClutterShaderEffectPrivate *priv = self->priv;
|
||||
|
||||
if (priv->shader != NULL)
|
||||
if (priv->shader != COGL_INVALID_HANDLE)
|
||||
{
|
||||
cogl_object_unref (priv->shader);
|
||||
cogl_handle_unref (priv->shader);
|
||||
|
||||
priv->shader = NULL;
|
||||
priv->shader = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
if (priv->program != NULL)
|
||||
if (priv->program != COGL_INVALID_HANDLE)
|
||||
{
|
||||
cogl_object_unref (priv->program);
|
||||
cogl_handle_unref (priv->program);
|
||||
|
||||
priv->program = NULL;
|
||||
priv->program = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
if (reset_uniforms && priv->uniforms != NULL)
|
||||
@@ -208,7 +208,7 @@ clutter_shader_effect_update_uniforms (ClutterShaderEffect *effect)
|
||||
gpointer key, value;
|
||||
gsize size;
|
||||
|
||||
if (priv->program == NULL)
|
||||
if (priv->program == COGL_INVALID_HANDLE)
|
||||
return;
|
||||
|
||||
if (priv->uniforms == NULL)
|
||||
@@ -333,7 +333,7 @@ clutter_shader_effect_create_shader (ClutterShaderEffect *self)
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
return NULL;
|
||||
return COGL_INVALID_HANDLE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ clutter_shader_effect_try_static_source (ClutterShaderEffect *self)
|
||||
CLUTTER_TYPE_SHADER_EFFECT,
|
||||
ClutterShaderEffectClassPrivate);
|
||||
|
||||
if (class_priv->shader == NULL)
|
||||
if (class_priv->shader == COGL_INVALID_HANDLE)
|
||||
{
|
||||
gchar *source;
|
||||
|
||||
@@ -387,10 +387,10 @@ clutter_shader_effect_try_static_source (ClutterShaderEffect *self)
|
||||
}
|
||||
}
|
||||
|
||||
priv->shader = cogl_object_ref (class_priv->shader);
|
||||
priv->shader = cogl_handle_ref (class_priv->shader);
|
||||
|
||||
if (class_priv->program != NULL)
|
||||
priv->program = cogl_object_ref (class_priv->program);
|
||||
if (class_priv->program != COGL_INVALID_HANDLE)
|
||||
priv->program = cogl_handle_ref (class_priv->program);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,13 +404,13 @@ clutter_shader_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
|
||||
/* If the source hasn't been set then we'll try to get it from the
|
||||
static source instead */
|
||||
if (priv->shader == NULL)
|
||||
if (priv->shader == COGL_INVALID_HANDLE)
|
||||
clutter_shader_effect_try_static_source (self);
|
||||
|
||||
/* we haven't been prepared or we don't have support for
|
||||
* GLSL shaders in Clutter
|
||||
*/
|
||||
if (priv->program == NULL)
|
||||
if (priv->program == COGL_INVALID_HANDLE)
|
||||
goto out;
|
||||
|
||||
CLUTTER_NOTE (SHADER, "Applying the shader effect of type '%s'",
|
||||
@@ -500,7 +500,6 @@ static void
|
||||
clutter_shader_effect_init (ClutterShaderEffect *effect)
|
||||
{
|
||||
effect->priv = clutter_shader_effect_get_instance_private (effect);
|
||||
effect->priv->shader_type = CLUTTER_FRAGMENT_SHADER;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -534,7 +533,7 @@ clutter_shader_effect_new (ClutterShaderType shader_type)
|
||||
* Retrieves a pointer to the shader's handle
|
||||
*
|
||||
* Return value: (transfer none): a pointer to the shader's handle,
|
||||
* or %NULL
|
||||
* or %COGL_INVALID_HANDLE
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
@@ -542,7 +541,7 @@ CoglHandle
|
||||
clutter_shader_effect_get_shader (ClutterShaderEffect *effect)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SHADER_EFFECT (effect),
|
||||
NULL);
|
||||
COGL_INVALID_HANDLE);
|
||||
|
||||
return effect->priv->shader;
|
||||
}
|
||||
@@ -554,7 +553,7 @@ clutter_shader_effect_get_shader (ClutterShaderEffect *effect)
|
||||
* Retrieves a pointer to the program's handle
|
||||
*
|
||||
* Return value: (transfer none): a pointer to the program's handle,
|
||||
* or %NULL
|
||||
* or %COGL_INVALID_HANDLE
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
@@ -562,7 +561,7 @@ CoglHandle
|
||||
clutter_shader_effect_get_program (ClutterShaderEffect *effect)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_SHADER_EFFECT (effect),
|
||||
NULL);
|
||||
COGL_INVALID_HANDLE);
|
||||
|
||||
return effect->priv->program;
|
||||
}
|
||||
@@ -892,7 +891,7 @@ clutter_shader_effect_set_shader_source (ClutterShaderEffect *effect,
|
||||
|
||||
priv = effect->priv;
|
||||
|
||||
if (priv->shader != NULL)
|
||||
if (priv->shader != COGL_INVALID_HANDLE)
|
||||
return TRUE;
|
||||
|
||||
priv->shader = clutter_shader_effect_create_shader (effect);
|
||||
|
@@ -134,7 +134,8 @@ clutter_stage_manager_class_init (ClutterStageManagerClass *klass)
|
||||
G_OBJECT_CLASS_TYPE (gobject_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterStageManagerClass, stage_added),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_STAGE);
|
||||
/**
|
||||
@@ -152,7 +153,8 @@ clutter_stage_manager_class_init (ClutterStageManagerClass *klass)
|
||||
G_OBJECT_CLASS_TYPE (gobject_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterStageManagerClass, stage_removed),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_STAGE);
|
||||
}
|
||||
|
@@ -40,12 +40,8 @@ void _clutter_stage_paint_view (ClutterStage
|
||||
ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip);
|
||||
|
||||
void _clutter_stage_emit_after_paint (ClutterStage *stage);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_stage_set_window (ClutterStage *stage,
|
||||
ClutterStageWindow *stage_window);
|
||||
CLUTTER_EXPORT
|
||||
ClutterStageWindow *_clutter_stage_get_window (ClutterStage *stage);
|
||||
void _clutter_stage_get_projection_matrix (ClutterStage *stage,
|
||||
CoglMatrix *projection);
|
||||
@@ -67,7 +63,6 @@ void _clutter_stage_maybe_relayout (ClutterActor
|
||||
gboolean _clutter_stage_needs_update (ClutterStage *stage);
|
||||
gboolean _clutter_stage_do_update (ClutterStage *stage);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_stage_queue_event (ClutterStage *stage,
|
||||
ClutterEvent *event,
|
||||
gboolean copy_event);
|
||||
@@ -79,18 +74,9 @@ gint64 _clutter_stage_get_update_time (ClutterStage *stage);
|
||||
void _clutter_stage_clear_update_time (ClutterStage *stage);
|
||||
gboolean _clutter_stage_has_full_redraw_queued (ClutterStage *stage);
|
||||
|
||||
void clutter_stage_log_pick (ClutterStage *stage,
|
||||
const graphene_point_t *vertices,
|
||||
ClutterActor *actor);
|
||||
|
||||
void clutter_stage_push_pick_clip (ClutterStage *stage,
|
||||
const graphene_point_t *vertices);
|
||||
|
||||
void clutter_stage_pop_pick_clip (ClutterStage *stage);
|
||||
|
||||
ClutterActor *_clutter_stage_do_pick (ClutterStage *stage,
|
||||
float x,
|
||||
float y,
|
||||
gint x,
|
||||
gint y,
|
||||
ClutterPickMode mode);
|
||||
|
||||
ClutterPaintVolume *_clutter_stage_paint_volume_stack_allocate (ClutterStage *stage);
|
||||
@@ -106,6 +92,13 @@ void _clutter_stage_queue_redraw_entry_invalidate (Clut
|
||||
|
||||
CoglFramebuffer *_clutter_stage_get_active_framebuffer (ClutterStage *stage);
|
||||
|
||||
gint32 _clutter_stage_acquire_pick_id (ClutterStage *stage,
|
||||
ClutterActor *actor);
|
||||
void _clutter_stage_release_pick_id (ClutterStage *stage,
|
||||
gint32 pick_id);
|
||||
ClutterActor * _clutter_stage_get_actor_by_pick_id (ClutterStage *stage,
|
||||
gint32 pick_id);
|
||||
|
||||
void _clutter_stage_add_pointer_drag_actor (ClutterStage *stage,
|
||||
ClutterInputDevice *device,
|
||||
ClutterActor *actor);
|
||||
@@ -122,20 +115,18 @@ ClutterActor * _clutter_stage_get_touch_drag_actor (ClutterStage *st
|
||||
void _clutter_stage_remove_touch_drag_actor (ClutterStage *stage,
|
||||
ClutterEventSequence *sequence);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterStageState _clutter_stage_get_state (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_stage_is_activated (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
gboolean _clutter_stage_is_fullscreen (ClutterStage *stage);
|
||||
gboolean _clutter_stage_update_state (ClutterStage *stage,
|
||||
ClutterStageState unset_state,
|
||||
ClutterStageState set_state);
|
||||
|
||||
void _clutter_stage_set_scale_factor (ClutterStage *stage,
|
||||
int factor);
|
||||
gboolean _clutter_stage_get_max_view_scale_factor_for_rect (ClutterStage *stage,
|
||||
graphene_rect_t *rect,
|
||||
float *view_scale);
|
||||
gboolean _clutter_stage_get_max_view_scale_factor_for_rect (ClutterStage *stage,
|
||||
ClutterRect *rect,
|
||||
float *view_scale);
|
||||
|
||||
void _clutter_stage_presented (ClutterStage *stage,
|
||||
CoglFrameEvent frame_event,
|
||||
|
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Red Hat Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __CLUTTER_STAGE_VIEW_PRIVATE_H__
|
||||
#define __CLUTTER_STAGE_VIEW_PRIVATE_H__
|
||||
|
||||
#include "clutter/clutter-stage-view.h"
|
||||
|
||||
void clutter_stage_view_blit_offscreen (ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip);
|
||||
|
||||
gboolean clutter_stage_view_is_dirty_viewport (ClutterStageView *view);
|
||||
|
||||
void clutter_stage_view_set_dirty_viewport (ClutterStageView *view,
|
||||
gboolean dirty);
|
||||
|
||||
gboolean clutter_stage_view_is_dirty_projection (ClutterStageView *view);
|
||||
|
||||
void clutter_stage_view_set_dirty_projection (ClutterStageView *view,
|
||||
gboolean dirty);
|
||||
|
||||
|
||||
#endif /* __CLUTTER_STAGE_VIEW_PRIVATE_H__ */
|
@@ -18,7 +18,6 @@
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter/clutter-stage-view.h"
|
||||
#include "clutter/clutter-stage-view-private.h"
|
||||
|
||||
#include <cairo-gobject.h>
|
||||
#include <math.h>
|
||||
@@ -62,14 +61,6 @@ clutter_stage_view_get_layout (ClutterStageView *view,
|
||||
*rect = priv->layout;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_stage_view_get_framebuffer:
|
||||
* @view: a #ClutterStageView
|
||||
*
|
||||
* Retrieves the framebuffer of @view to draw to.
|
||||
*
|
||||
* Returns: (transfer none): a #CoglFramebuffer
|
||||
*/
|
||||
CoglFramebuffer *
|
||||
clutter_stage_view_get_framebuffer (ClutterStageView *view)
|
||||
{
|
||||
@@ -82,14 +73,6 @@ clutter_stage_view_get_framebuffer (ClutterStageView *view)
|
||||
return priv->framebuffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_stage_view_get_onscreen:
|
||||
* @view: a #ClutterStageView
|
||||
*
|
||||
* Retrieves the onscreen framebuffer of @view if available.
|
||||
*
|
||||
* Returns: (transfer none): a #CoglFramebuffer
|
||||
*/
|
||||
CoglFramebuffer *
|
||||
clutter_stage_view_get_onscreen (ClutterStageView *view)
|
||||
{
|
||||
@@ -143,21 +126,6 @@ clutter_stage_view_blit_offscreen (ClutterStageView *view,
|
||||
clutter_stage_view_get_instance_private (view);
|
||||
CoglMatrix matrix;
|
||||
|
||||
clutter_stage_view_get_offscreen_transformation_matrix (view, &matrix);
|
||||
if (cogl_matrix_is_identity (&matrix))
|
||||
{
|
||||
int fb_width = cogl_framebuffer_get_width (priv->framebuffer);
|
||||
int fb_height = cogl_framebuffer_get_height (priv->framebuffer);
|
||||
|
||||
if (cogl_blit_framebuffer (priv->offscreen,
|
||||
priv->framebuffer,
|
||||
0, 0,
|
||||
0, 0,
|
||||
fb_width, fb_height,
|
||||
NULL))
|
||||
return;
|
||||
}
|
||||
|
||||
clutter_stage_view_ensure_offscreen_blit_pipeline (view);
|
||||
cogl_framebuffer_push_matrix (priv->framebuffer);
|
||||
|
||||
|
@@ -18,10 +18,6 @@
|
||||
#ifndef __CLUTTER_STAGE_VIEW_H__
|
||||
#define __CLUTTER_STAGE_VIEW_H__
|
||||
|
||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <clutter/clutter.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <cairo.h>
|
||||
#include <glib-object.h>
|
||||
#include <cogl/cogl.h>
|
||||
@@ -61,9 +57,22 @@ void clutter_stage_view_transform_to_onscreen (ClutterStageView *vie
|
||||
gfloat *x,
|
||||
gfloat *y);
|
||||
|
||||
void clutter_stage_view_blit_offscreen (ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
float clutter_stage_view_get_scale (ClutterStageView *view);
|
||||
|
||||
gboolean clutter_stage_view_is_dirty_viewport (ClutterStageView *view);
|
||||
|
||||
void clutter_stage_view_set_dirty_viewport (ClutterStageView *view,
|
||||
gboolean dirty);
|
||||
|
||||
gboolean clutter_stage_view_is_dirty_projection (ClutterStageView *view);
|
||||
|
||||
void clutter_stage_view_set_dirty_projection (ClutterStageView *view,
|
||||
gboolean dirty);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView *view,
|
||||
CoglMatrix *matrix);
|
||||
|
@@ -62,6 +62,16 @@ _clutter_stage_window_set_title (ClutterStageWindow *window,
|
||||
iface->set_title (window, title);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_stage_window_set_fullscreen (ClutterStageWindow *window,
|
||||
gboolean is_fullscreen)
|
||||
{
|
||||
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||
|
||||
if (iface->set_fullscreen)
|
||||
iface->set_fullscreen (window, is_fullscreen);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
|
||||
gboolean is_visible)
|
||||
@@ -72,6 +82,14 @@ _clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
|
||||
iface->set_cursor_visible (window, is_visible);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_stage_window_set_user_resizable (ClutterStageWindow *window,
|
||||
gboolean is_resizable)
|
||||
{
|
||||
CLUTTER_STAGE_WINDOW_GET_IFACE (window)->set_user_resizable (window,
|
||||
is_resizable);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_stage_window_realize (ClutterStageWindow *window)
|
||||
{
|
||||
@@ -235,35 +253,19 @@ _clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
cairo_region_t *
|
||||
_clutter_stage_window_get_redraw_clip (ClutterStageWindow *window)
|
||||
gboolean
|
||||
_clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
|
||||
cairo_rectangle_int_t *stage_clip)
|
||||
{
|
||||
ClutterStageWindowInterface *iface;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
||||
|
||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||
if (iface->get_redraw_clip != NULL)
|
||||
return iface->get_redraw_clip (window);
|
||||
if (iface->get_redraw_clip_bounds != NULL)
|
||||
return iface->get_redraw_clip_bounds (window, stage_clip);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
|
||||
cairo_rectangle_int_t *stage_clip)
|
||||
{
|
||||
cairo_region_t *redraw_clip;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
||||
|
||||
redraw_clip = _clutter_stage_window_get_redraw_clip (window);
|
||||
if (!redraw_clip)
|
||||
return FALSE;
|
||||
|
||||
cairo_region_get_extents (redraw_clip, stage_clip);
|
||||
cairo_region_destroy (redraw_clip);
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -291,6 +293,24 @@ _clutter_stage_window_redraw (ClutterStageWindow *window)
|
||||
iface->redraw (window);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_clutter_stage_window_get_dirty_pixel (ClutterStageWindow *window,
|
||||
ClutterStageView *view,
|
||||
int *x, int *y)
|
||||
{
|
||||
ClutterStageWindowInterface *iface;
|
||||
|
||||
*x = 0;
|
||||
*y = 0;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
||||
|
||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
||||
if (iface->get_dirty_pixel)
|
||||
iface->get_dirty_pixel (window, view, x, y);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_stage_window_can_clip_redraws (ClutterStageWindow *window)
|
||||
{
|
||||
|
@@ -30,8 +30,12 @@ struct _ClutterStageWindowInterface
|
||||
|
||||
void (* set_title) (ClutterStageWindow *stage_window,
|
||||
const gchar *title);
|
||||
void (* set_fullscreen) (ClutterStageWindow *stage_window,
|
||||
gboolean is_fullscreen);
|
||||
void (* set_cursor_visible) (ClutterStageWindow *stage_window,
|
||||
gboolean cursor_visible);
|
||||
void (* set_user_resizable) (ClutterStageWindow *stage_window,
|
||||
gboolean is_resizable);
|
||||
|
||||
gboolean (* realize) (ClutterStageWindow *stage_window);
|
||||
void (* unrealize) (ClutterStageWindow *stage_window);
|
||||
@@ -55,13 +59,19 @@ struct _ClutterStageWindowInterface
|
||||
cairo_rectangle_int_t *stage_rectangle);
|
||||
gboolean (* has_redraw_clips) (ClutterStageWindow *stage_window);
|
||||
gboolean (* ignoring_redraw_clips) (ClutterStageWindow *stage_window);
|
||||
cairo_region_t * (* get_redraw_clip) (ClutterStageWindow *stage_window);
|
||||
gboolean (* get_redraw_clip_bounds) (ClutterStageWindow *stage_window,
|
||||
cairo_rectangle_int_t *clip);
|
||||
|
||||
|
||||
void (* set_accept_focus) (ClutterStageWindow *stage_window,
|
||||
gboolean accept_focus);
|
||||
|
||||
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);
|
||||
@@ -73,8 +83,12 @@ ClutterActor * _clutter_stage_window_get_wrapper (ClutterStageWindow *
|
||||
|
||||
void _clutter_stage_window_set_title (ClutterStageWindow *window,
|
||||
const gchar *title);
|
||||
void _clutter_stage_window_set_fullscreen (ClutterStageWindow *window,
|
||||
gboolean is_fullscreen);
|
||||
void _clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
|
||||
gboolean is_visible);
|
||||
void _clutter_stage_window_set_user_resizable (ClutterStageWindow *window,
|
||||
gboolean is_resizable);
|
||||
|
||||
gboolean _clutter_stage_window_realize (ClutterStageWindow *window);
|
||||
void _clutter_stage_window_unrealize (ClutterStageWindow *window);
|
||||
@@ -86,7 +100,6 @@ void _clutter_stage_window_hide (ClutterStageWin
|
||||
void _clutter_stage_window_resize (ClutterStageWindow *window,
|
||||
gint width,
|
||||
gint height);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_stage_window_get_geometry (ClutterStageWindow *window,
|
||||
cairo_rectangle_int_t *geometry);
|
||||
void _clutter_stage_window_schedule_update (ClutterStageWindow *window,
|
||||
@@ -100,13 +113,16 @@ gboolean _clutter_stage_window_has_redraw_clips (ClutterStageWin
|
||||
gboolean _clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window);
|
||||
gboolean _clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
|
||||
cairo_rectangle_int_t *clip);
|
||||
cairo_region_t * _clutter_stage_window_get_redraw_clip (ClutterStageWindow *window);
|
||||
|
||||
void _clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
|
||||
gboolean accept_focus);
|
||||
|
||||
void _clutter_stage_window_redraw (ClutterStageWindow *window);
|
||||
|
||||
void _clutter_stage_window_get_dirty_pixel (ClutterStageWindow *window,
|
||||
ClutterStageView *view,
|
||||
int *x, int *y);
|
||||
|
||||
gboolean _clutter_stage_window_can_clip_redraws (ClutterStageWindow *window);
|
||||
|
||||
GList * _clutter_stage_window_get_views (ClutterStageWindow *window);
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -30,7 +30,6 @@
|
||||
|
||||
#include <clutter/clutter-types.h>
|
||||
#include <clutter/clutter-group.h>
|
||||
#include <clutter/clutter-stage-view.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -62,6 +61,8 @@ struct _ClutterStage
|
||||
};
|
||||
/**
|
||||
* ClutterStageClass:
|
||||
* @fullscreen: handler for the #ClutterStage::fullscreen signal
|
||||
* @unfullscreen: handler for the #ClutterStage::unfullscreen signal
|
||||
* @activate: handler for the #ClutterStage::activate signal
|
||||
* @deactivate: handler for the #ClutterStage::deactivate signal
|
||||
* @delete_event: handler for the #ClutterStage::delete-event signal
|
||||
@@ -78,18 +79,17 @@ struct _ClutterStageClass
|
||||
|
||||
/*< public >*/
|
||||
/* signals */
|
||||
void (* fullscreen) (ClutterStage *stage);
|
||||
void (* unfullscreen) (ClutterStage *stage);
|
||||
void (* activate) (ClutterStage *stage);
|
||||
void (* deactivate) (ClutterStage *stage);
|
||||
|
||||
gboolean (* delete_event) (ClutterStage *stage,
|
||||
ClutterEvent *event);
|
||||
|
||||
void (* paint_view) (ClutterStage *stage,
|
||||
ClutterStageView *view);
|
||||
|
||||
/*< private >*/
|
||||
/* padding for future expansion */
|
||||
gpointer _padding_dummy[30];
|
||||
gpointer _padding_dummy[31];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -115,6 +115,26 @@ struct _ClutterPerspective
|
||||
gfloat z_far;
|
||||
};
|
||||
|
||||
/**
|
||||
* ClutterFog:
|
||||
* @z_near: starting distance from the viewer to the near clipping
|
||||
* plane (always positive)
|
||||
* @z_far: final distance from the viewer to the far clipping
|
||||
* plane (always positive)
|
||||
*
|
||||
* Fog settings used to create the depth cueing effect.
|
||||
*
|
||||
* Since: 0.6
|
||||
*
|
||||
* Deprecated: 1.10: The fog-related API in #ClutterStage has been
|
||||
* deprecated as well.
|
||||
*/
|
||||
struct _ClutterFog
|
||||
{
|
||||
gfloat z_near;
|
||||
gfloat z_far;
|
||||
};
|
||||
|
||||
/**
|
||||
* ClutterFrameInfo: (skip)
|
||||
*/
|
||||
@@ -133,6 +153,8 @@ typedef struct _ClutterCapture
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_perspective_get_type (void) G_GNUC_CONST;
|
||||
CLUTTER_DEPRECATED
|
||||
GType clutter_fog_get_type (void) G_GNUC_CONST;
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_stage_get_type (void) G_GNUC_CONST;
|
||||
|
||||
@@ -146,6 +168,11 @@ CLUTTER_EXPORT
|
||||
void clutter_stage_get_perspective (ClutterStage *stage,
|
||||
ClutterPerspective *perspective);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_set_fullscreen (ClutterStage *stage,
|
||||
gboolean fullscreen);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_stage_get_fullscreen (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_show_cursor (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_hide_cursor (ClutterStage *stage);
|
||||
@@ -154,6 +181,11 @@ void clutter_stage_set_title (ClutterStage
|
||||
const gchar *title);
|
||||
CLUTTER_EXPORT
|
||||
const gchar * clutter_stage_get_title (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_set_user_resizable (ClutterStage *stage,
|
||||
gboolean resizable);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_stage_get_user_resizable (ClutterStage *stage);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_set_minimum_size (ClutterStage *stage,
|
||||
@@ -201,8 +233,8 @@ gboolean clutter_stage_event (ClutterStage
|
||||
CLUTTER_EXPORT
|
||||
ClutterActor * clutter_stage_get_actor_at_pos (ClutterStage *stage,
|
||||
ClutterPickMode pick_mode,
|
||||
float x,
|
||||
float y);
|
||||
gint x,
|
||||
gint y);
|
||||
CLUTTER_EXPORT
|
||||
guchar * clutter_stage_read_pixels (ClutterStage *stage,
|
||||
gint x,
|
||||
@@ -214,8 +246,6 @@ CLUTTER_EXPORT
|
||||
void clutter_stage_get_redraw_clip_bounds (ClutterStage *stage,
|
||||
cairo_rectangle_int_t *clip);
|
||||
CLUTTER_EXPORT
|
||||
cairo_region_t * clutter_stage_get_redraw_clip (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_ensure_viewport (ClutterStage *stage);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_ensure_redraw (ClutterStage *stage);
|
||||
@@ -244,10 +274,6 @@ gboolean clutter_stage_capture (ClutterStage *stage,
|
||||
cairo_rectangle_int_t *rect,
|
||||
ClutterCapture **captures,
|
||||
int *n_captures);
|
||||
CLUTTER_EXPORT
|
||||
ClutterStageView * clutter_stage_get_view_at (ClutterStage *stage,
|
||||
float x,
|
||||
float y);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -122,7 +122,8 @@ clutter_tap_action_class_init (ClutterTapActionClass *klass)
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTapActionClass, tap),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
CLUTTER_TYPE_ACTOR);
|
||||
}
|
||||
|
@@ -1,8 +1,17 @@
|
||||
#include "clutter-build-config.h"
|
||||
|
||||
#include "clutter-test-utils.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <glib-object.h>
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#include "clutter-actor.h"
|
||||
#include "clutter-color.h"
|
||||
#include "clutter-event.h"
|
||||
#include "clutter-keysyms.h"
|
||||
#include "clutter-main.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-stage.h"
|
||||
|
||||
typedef struct {
|
||||
ClutterActor *stage;
|
||||
@@ -264,7 +273,7 @@ clutter_test_run (void)
|
||||
typedef struct {
|
||||
ClutterActor *stage;
|
||||
|
||||
graphene_point_t point;
|
||||
ClutterPoint point;
|
||||
|
||||
gpointer result;
|
||||
|
||||
@@ -339,10 +348,10 @@ on_key_press_event (ClutterActor *stage,
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
clutter_test_check_actor_at_point (ClutterActor *stage,
|
||||
const graphene_point_t *point,
|
||||
ClutterActor *actor,
|
||||
ClutterActor **result)
|
||||
clutter_test_check_actor_at_point (ClutterActor *stage,
|
||||
const ClutterPoint *point,
|
||||
ClutterActor *actor,
|
||||
ClutterActor **result)
|
||||
{
|
||||
ValidateData *data;
|
||||
guint press_id = 0;
|
||||
@@ -401,10 +410,10 @@ clutter_test_check_actor_at_point (ClutterActor *stage,
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
clutter_test_check_color_at_point (ClutterActor *stage,
|
||||
const graphene_point_t *point,
|
||||
const ClutterColor *color,
|
||||
ClutterColor *result)
|
||||
clutter_test_check_color_at_point (ClutterActor *stage,
|
||||
const ClutterPoint *point,
|
||||
const ClutterColor *color,
|
||||
ClutterColor *result)
|
||||
{
|
||||
ValidateData *data;
|
||||
gboolean retval;
|
@@ -19,23 +19,16 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef __CLUTTER_TEST_UTILS_H__
|
||||
#define __CLUTTER_TEST_UTILS_H__
|
||||
|
||||
#define __CLUTTER_H_INSIDE__
|
||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <clutter/clutter.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include "clutter/clutter-types.h"
|
||||
#include "clutter/clutter-actor.h"
|
||||
#include "clutter/clutter-color.h"
|
||||
#include "clutter/clutter-private.h"
|
||||
#include "core/main-private.h"
|
||||
#include "meta/common.h"
|
||||
#include "meta/main.h"
|
||||
#include "backends/x11/nested/meta-backend-x11-nested.h"
|
||||
#include "wayland/meta-wayland.h"
|
||||
#include "wayland/meta-xwayland.h"
|
||||
#include <clutter/clutter-types.h>
|
||||
#include <clutter/clutter-actor.h>
|
||||
#include <clutter/clutter-color.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -86,8 +79,6 @@ G_BEGIN_DECLS
|
||||
int \
|
||||
main (int argc, char *argv[]) \
|
||||
{ \
|
||||
meta_test_init ();\
|
||||
\
|
||||
clutter_test_init (&argc, &argv); \
|
||||
\
|
||||
{ \
|
||||
@@ -121,7 +112,7 @@ ClutterActor * clutter_test_get_stage (void);
|
||||
|
||||
#define clutter_test_assert_actor_at_point(stage,point,actor) \
|
||||
G_STMT_START { \
|
||||
const graphene_point_t *__p = (point); \
|
||||
const ClutterPoint *__p = (point); \
|
||||
ClutterActor *__actor = (actor); \
|
||||
ClutterActor *__stage = (stage); \
|
||||
ClutterActor *__res; \
|
||||
@@ -141,7 +132,7 @@ G_STMT_START { \
|
||||
|
||||
#define clutter_test_assert_color_at_point(stage,point,color) \
|
||||
G_STMT_START { \
|
||||
const graphene_point_t *__p = (point); \
|
||||
const ClutterPoint *__p = (point); \
|
||||
const ClutterColor *__c = (color); \
|
||||
ClutterActor *__stage = (stage); \
|
||||
ClutterColor __res; \
|
||||
@@ -158,15 +149,15 @@ G_STMT_START { \
|
||||
} G_STMT_END
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_test_check_actor_at_point (ClutterActor *stage,
|
||||
const graphene_point_t *point,
|
||||
ClutterActor *actor,
|
||||
ClutterActor **result);
|
||||
gboolean clutter_test_check_actor_at_point (ClutterActor *stage,
|
||||
const ClutterPoint *point,
|
||||
ClutterActor *actor,
|
||||
ClutterActor **result);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_test_check_color_at_point (ClutterActor *stage,
|
||||
const graphene_point_t *point,
|
||||
const ClutterColor *color,
|
||||
ClutterColor *result);
|
||||
gboolean clutter_test_check_color_at_point (ClutterActor *stage,
|
||||
const ClutterPoint *point,
|
||||
const ClutterColor *color,
|
||||
ClutterColor *result);
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -171,7 +171,7 @@ clutter_text_buffer_normal_insert_text (ClutterTextBuffer *buffer,
|
||||
|
||||
/* Actual text insertion */
|
||||
at = g_utf8_offset_to_pointer (pv->normal_text, position) - pv->normal_text;
|
||||
memmove (pv->normal_text + at + n_bytes, pv->normal_text + at, pv->normal_text_bytes - at);
|
||||
g_memmove (pv->normal_text + at + n_bytes, pv->normal_text + at, pv->normal_text_bytes - at);
|
||||
memcpy (pv->normal_text + at, chars, n_bytes);
|
||||
|
||||
/* Book keeping */
|
||||
@@ -201,7 +201,7 @@ clutter_text_buffer_normal_delete_text (ClutterTextBuffer *buffer,
|
||||
start = g_utf8_offset_to_pointer (pv->normal_text, position) - pv->normal_text;
|
||||
end = g_utf8_offset_to_pointer (pv->normal_text, position + n_chars) - pv->normal_text;
|
||||
|
||||
memmove (pv->normal_text + start, pv->normal_text + end, pv->normal_text_bytes + 1 - end);
|
||||
g_memmove (pv->normal_text + start, pv->normal_text + end, pv->normal_text_bytes + 1 - end);
|
||||
pv->normal_text_chars -= n_chars;
|
||||
pv->normal_text_bytes -= (end - start);
|
||||
|
||||
@@ -228,8 +228,8 @@ clutter_text_buffer_real_inserted_text (ClutterTextBuffer *buffer,
|
||||
const gchar *chars,
|
||||
guint n_chars)
|
||||
{
|
||||
g_object_notify_by_pspec (G_OBJECT (buffer), obj_props[PROP_TEXT]);
|
||||
g_object_notify_by_pspec (G_OBJECT (buffer), obj_props[PROP_LENGTH]);
|
||||
g_object_notify (G_OBJECT (buffer), "text");
|
||||
g_object_notify (G_OBJECT (buffer), "length");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -237,8 +237,8 @@ clutter_text_buffer_real_deleted_text (ClutterTextBuffer *buffer,
|
||||
guint position,
|
||||
guint n_chars)
|
||||
{
|
||||
g_object_notify_by_pspec (G_OBJECT (buffer), obj_props[PROP_TEXT]);
|
||||
g_object_notify_by_pspec (G_OBJECT (buffer), obj_props[PROP_LENGTH]);
|
||||
g_object_notify (G_OBJECT (buffer), "text");
|
||||
g_object_notify (G_OBJECT (buffer), "length");
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------
|
||||
@@ -598,7 +598,7 @@ clutter_text_buffer_set_max_length (ClutterTextBuffer *buffer,
|
||||
clutter_text_buffer_delete_text (buffer, max_length, -1);
|
||||
|
||||
buffer->priv->max_length = max_length;
|
||||
g_object_notify_by_pspec (G_OBJECT (buffer), obj_props[PROP_MAX_LENGTH]);
|
||||
g_object_notify (G_OBJECT (buffer), "max-length");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -157,7 +157,7 @@ struct _ClutterTextPrivate
|
||||
gint text_logical_y;
|
||||
|
||||
/* Where to draw the cursor */
|
||||
graphene_rect_t cursor_rect;
|
||||
ClutterRect cursor_rect;
|
||||
ClutterColor cursor_color;
|
||||
guint cursor_size;
|
||||
|
||||
@@ -1304,7 +1304,7 @@ static inline void
|
||||
update_cursor_location (ClutterText *self)
|
||||
{
|
||||
ClutterTextPrivate *priv = self->priv;
|
||||
graphene_rect_t rect;
|
||||
ClutterRect 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);
|
||||
graphene_rect_offset (&rect, x, y);
|
||||
clutter_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;
|
||||
graphene_rect_t cursor_rect = GRAPHENE_RECT_INIT_ZERO;
|
||||
ClutterRect cursor_rect = CLUTTER_RECT_INIT_ZERO;
|
||||
gint position;
|
||||
|
||||
position = priv->position;
|
||||
@@ -1345,17 +1345,25 @@ clutter_text_ensure_cursor_position (ClutterText *self,
|
||||
&x, &y,
|
||||
&cursor_height);
|
||||
|
||||
graphene_rect_init (&cursor_rect,
|
||||
x,
|
||||
y + CURSOR_Y_PADDING * scale,
|
||||
priv->cursor_size * scale,
|
||||
cursor_height - 2 * CURSOR_Y_PADDING * scale);
|
||||
clutter_rect_init (&cursor_rect,
|
||||
x,
|
||||
y + CURSOR_Y_PADDING * scale,
|
||||
priv->cursor_size * scale,
|
||||
cursor_height - 2 * CURSOR_Y_PADDING * scale);
|
||||
|
||||
if (!graphene_rect_equal (&priv->cursor_rect, &cursor_rect))
|
||||
if (!clutter_rect_equals (&priv->cursor_rect, &cursor_rect))
|
||||
{
|
||||
ClutterGeometry cursor_pos;
|
||||
|
||||
priv->cursor_rect = cursor_rect;
|
||||
|
||||
g_signal_emit (self, text_signals[CURSOR_EVENT], 0, &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_CHANGED], 0);
|
||||
|
||||
update_cursor_location (self);
|
||||
@@ -2252,10 +2260,7 @@ clutter_text_press (ClutterActor *actor,
|
||||
priv->in_select_drag = TRUE;
|
||||
|
||||
if (type == CLUTTER_BUTTON_PRESS)
|
||||
{
|
||||
clutter_input_device_grab (clutter_event_get_device (event),
|
||||
actor);
|
||||
}
|
||||
clutter_grab_pointer (actor);
|
||||
else
|
||||
{
|
||||
clutter_input_device_sequence_grab (clutter_event_get_device (event),
|
||||
@@ -2313,7 +2318,7 @@ clutter_text_release (ClutterActor *actor,
|
||||
{
|
||||
if (!priv->in_select_touch)
|
||||
{
|
||||
clutter_input_device_ungrab (clutter_event_get_device (event));
|
||||
clutter_ungrab_pointer ();
|
||||
priv->in_select_drag = FALSE;
|
||||
|
||||
return CLUTTER_EVENT_STOP;
|
||||
@@ -2704,7 +2709,7 @@ clutter_text_paint (ClutterActor *self)
|
||||
|
||||
if (actor_width < text_width)
|
||||
{
|
||||
gint cursor_x = graphene_rect_get_x (&priv->cursor_rect);
|
||||
gint cursor_x = clutter_rect_get_x (&priv->cursor_rect);
|
||||
|
||||
if (priv->position == -1)
|
||||
{
|
||||
@@ -2791,7 +2796,7 @@ add_selection_to_paint_volume (ClutterText *text,
|
||||
{
|
||||
ClutterPaintVolume *total_volume = user_data;
|
||||
ClutterPaintVolume rect_volume;
|
||||
graphene_point3d_t vertex;
|
||||
ClutterVertex vertex;
|
||||
|
||||
_clutter_paint_volume_init_static (&rect_volume, CLUTTER_ACTOR (text));
|
||||
|
||||
@@ -2813,7 +2818,7 @@ clutter_text_get_paint_volume_for_cursor (ClutterText *text,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
ClutterTextPrivate *priv = text->priv;
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
|
||||
clutter_text_ensure_cursor_position (text, resource_scale);
|
||||
|
||||
@@ -2856,7 +2861,7 @@ clutter_text_get_paint_volume (ClutterActor *self,
|
||||
{
|
||||
PangoLayout *layout;
|
||||
PangoRectangle ink_rect;
|
||||
graphene_point3d_t origin;
|
||||
ClutterVertex origin;
|
||||
float resource_scale;
|
||||
|
||||
/* If the text is single line editable then it gets clipped to
|
||||
@@ -4335,7 +4340,8 @@ clutter_text_class_init (ClutterTextClass *klass)
|
||||
G_TYPE_FROM_CLASS (gobject_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTextClass, text_changed),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -4391,10 +4397,10 @@ clutter_text_class_init (ClutterTextClass *klass)
|
||||
/**
|
||||
* ClutterText::cursor-event:
|
||||
* @self: the #ClutterText that emitted the signal
|
||||
* @rect: the coordinates of the cursor
|
||||
* @geometry: the coordinates of the cursor
|
||||
*
|
||||
* The ::cursor-event signal is emitted whenever the cursor position
|
||||
* changes inside a #ClutterText actor. Inside @rect it is stored
|
||||
* changes inside a #ClutterText actor. Inside @geometry it is stored
|
||||
* the current position and size of the cursor, relative to the actor
|
||||
* itself.
|
||||
*
|
||||
@@ -4407,9 +4413,10 @@ 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, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__BOXED,
|
||||
G_TYPE_NONE, 1,
|
||||
GRAPHENE_TYPE_RECT | G_SIGNAL_TYPE_STATIC_SCOPE);
|
||||
CLUTTER_TYPE_GEOMETRY | G_SIGNAL_TYPE_STATIC_SCOPE);
|
||||
|
||||
/**
|
||||
* ClutterText::cursor-changed:
|
||||
@@ -4425,7 +4432,8 @@ clutter_text_class_init (ClutterTextClass *klass)
|
||||
G_TYPE_FROM_CLASS (gobject_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTextClass, cursor_changed),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
@@ -4443,7 +4451,8 @@ clutter_text_class_init (ClutterTextClass *klass)
|
||||
G_TYPE_FROM_CLASS (gobject_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTextClass, activate),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
binding_pool = clutter_binding_pool_get_for_class (klass);
|
||||
@@ -4812,7 +4821,7 @@ buffer_notify_max_length (ClutterTextBuffer *buffer,
|
||||
GParamSpec *spec,
|
||||
ClutterText *self)
|
||||
{
|
||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_MAX_LENGTH]);
|
||||
g_object_notify (G_OBJECT (self), "max-length");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -4911,9 +4920,9 @@ clutter_text_set_buffer (ClutterText *self,
|
||||
|
||||
obj = G_OBJECT (self);
|
||||
g_object_freeze_notify (obj);
|
||||
g_object_notify_by_pspec (obj, obj_props[PROP_BUFFER]);
|
||||
g_object_notify_by_pspec (obj, obj_props[PROP_TEXT]);
|
||||
g_object_notify_by_pspec (obj, obj_props[PROP_MAX_LENGTH]);
|
||||
g_object_notify (obj, "buffer");
|
||||
g_object_notify (obj, "text");
|
||||
g_object_notify (obj, "max-length");
|
||||
g_object_thaw_notify (obj);
|
||||
}
|
||||
|
||||
@@ -6772,8 +6781,8 @@ clutter_text_get_layout_offsets (ClutterText *self,
|
||||
* Since: 1.16
|
||||
*/
|
||||
void
|
||||
clutter_text_get_cursor_rect (ClutterText *self,
|
||||
graphene_rect_t *rect)
|
||||
clutter_text_get_cursor_rect (ClutterText *self,
|
||||
ClutterRect *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 graphene_rect_t *rect);
|
||||
const ClutterGeometry *geometry);
|
||||
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,
|
||||
graphene_rect_t *rect);
|
||||
ClutterRect *rect);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_text_set_selectable (ClutterText *self,
|
||||
gboolean selectable);
|
||||
|
@@ -46,7 +46,8 @@ G_BEGIN_DECLS
|
||||
* @CLUTTER_TEXTURE_ERROR_NO_YUV: YUV operation attempted but no YUV support
|
||||
* found
|
||||
* @CLUTTER_TEXTURE_ERROR_BAD_FORMAT: The requested format for
|
||||
* clutter_texture_set_from_rgb_data is unsupported.
|
||||
* clutter_texture_set_from_rgb_data or
|
||||
* clutter_texture_set_from_yuv_data is unsupported.
|
||||
*
|
||||
* Error enumeration for #ClutterTexture
|
||||
*
|
||||
|
@@ -145,8 +145,8 @@ struct _ClutterTimelinePrivate
|
||||
ClutterStepMode step_mode;
|
||||
|
||||
/* cubic-bezier() parameters */
|
||||
graphene_point_t cb_1;
|
||||
graphene_point_t cb_2;
|
||||
ClutterPoint cb_1;
|
||||
ClutterPoint cb_2;
|
||||
|
||||
guint is_playing : 1;
|
||||
|
||||
@@ -424,11 +424,6 @@ 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)
|
||||
@@ -555,7 +550,11 @@ clutter_timeline_dispose (GObject *object)
|
||||
|
||||
priv = self->priv;
|
||||
|
||||
clutter_timeline_cancel_delay (self);
|
||||
if (priv->delay_id)
|
||||
{
|
||||
g_source_remove (priv->delay_id);
|
||||
priv->delay_id = 0;
|
||||
}
|
||||
|
||||
if (priv->progress_notify != NULL)
|
||||
{
|
||||
@@ -710,7 +709,8 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTimelineClass, new_frame),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__INT,
|
||||
G_TYPE_NONE,
|
||||
1, G_TYPE_INT);
|
||||
/**
|
||||
@@ -733,7 +733,8 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTimelineClass, completed),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
/**
|
||||
* ClutterTimeline::started:
|
||||
@@ -749,7 +750,8 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTimelineClass, started),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
/**
|
||||
* ClutterTimeline::paused:
|
||||
@@ -762,7 +764,8 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTimelineClass, paused),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
/**
|
||||
* ClutterTimeline::marker-reached:
|
||||
@@ -829,7 +832,8 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ClutterTimelineClass, stopped),
|
||||
NULL, NULL, NULL,
|
||||
NULL, NULL,
|
||||
_clutter_marshal_VOID__BOOLEAN,
|
||||
G_TYPE_NONE, 1,
|
||||
G_TYPE_BOOLEAN);
|
||||
}
|
||||
@@ -846,8 +850,8 @@ clutter_timeline_init (ClutterTimeline *self)
|
||||
self->priv->step_mode = CLUTTER_STEP_MODE_END;
|
||||
|
||||
/* default cubic-bezier() paramereters are (0, 0, 1, 1) */
|
||||
graphene_point_init (&self->priv->cb_1, 0, 0);
|
||||
graphene_point_init (&self->priv->cb_2, 1, 1);
|
||||
clutter_point_init (&self->priv->cb_1, 0, 0);
|
||||
clutter_point_init (&self->priv->cb_2, 1, 1);
|
||||
}
|
||||
|
||||
struct CheckIfMarkerHitClosure
|
||||
@@ -1214,11 +1218,15 @@ clutter_timeline_pause (ClutterTimeline *timeline)
|
||||
|
||||
priv = timeline->priv;
|
||||
|
||||
clutter_timeline_cancel_delay (timeline);
|
||||
|
||||
if (!priv->is_playing)
|
||||
if (priv->delay_id == 0 && !priv->is_playing)
|
||||
return;
|
||||
|
||||
if (priv->delay_id)
|
||||
{
|
||||
g_source_remove (priv->delay_id);
|
||||
priv->delay_id = 0;
|
||||
}
|
||||
|
||||
priv->msecs_delta = 0;
|
||||
set_is_playing (timeline, FALSE);
|
||||
|
||||
@@ -2485,9 +2493,9 @@ clutter_timeline_get_step_progress (ClutterTimeline *timeline,
|
||||
* Since: 1.12
|
||||
*/
|
||||
void
|
||||
clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
const graphene_point_t *c_1,
|
||||
const graphene_point_t *c_2)
|
||||
clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
const ClutterPoint *c_1,
|
||||
const ClutterPoint *c_2)
|
||||
{
|
||||
ClutterTimelinePrivate *priv;
|
||||
|
||||
@@ -2522,9 +2530,9 @@ clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
* Since: 1.12
|
||||
*/
|
||||
gboolean
|
||||
clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
graphene_point_t *c_1,
|
||||
graphene_point_t *c_2)
|
||||
clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
ClutterPoint *c_1,
|
||||
ClutterPoint *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 graphene_point_t *c_1,
|
||||
const graphene_point_t *c_2);
|
||||
void clutter_timeline_set_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
const ClutterPoint *c_1,
|
||||
const ClutterPoint *c_2);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
graphene_point_t *c_1,
|
||||
graphene_point_t *c_2);
|
||||
gboolean clutter_timeline_get_cubic_bezier_progress (ClutterTimeline *timeline,
|
||||
ClutterPoint *c_1,
|
||||
ClutterPoint *c_2);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gint64 clutter_timeline_get_duration_hint (ClutterTimeline *timeline);
|
||||
|
@@ -134,6 +134,7 @@ clutter_transition_stopped (ClutterTimeline *timeline,
|
||||
clutter_transition_detach (CLUTTER_TRANSITION (timeline),
|
||||
priv->animatable);
|
||||
g_clear_object (&priv->animatable);
|
||||
g_object_unref (timeline);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -33,16 +33,20 @@
|
||||
#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;
|
||||
|
||||
@@ -75,9 +79,14 @@ 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;
|
||||
@@ -104,6 +113,8 @@ typedef union _ClutterEvent ClutterEvent;
|
||||
*/
|
||||
typedef struct _ClutterEventSequence ClutterEventSequence;
|
||||
|
||||
typedef struct _ClutterFog ClutterFog; /* deprecated */
|
||||
typedef struct _ClutterBehaviour ClutterBehaviour; /* deprecated */
|
||||
typedef struct _ClutterShader ClutterShader; /* deprecated */
|
||||
|
||||
/**
|
||||
@@ -126,6 +137,307 @@ 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
|
||||
@@ -229,8 +541,8 @@ gboolean clutter_actor_box_contains (const ClutterActorBox *box,
|
||||
gfloat x,
|
||||
gfloat y);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_box_from_vertices (ClutterActorBox *box,
|
||||
const graphene_point3d_t verts[]);
|
||||
void clutter_actor_box_from_vertices (ClutterActorBox *box,
|
||||
const ClutterVertex verts[]);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_box_interpolate (const ClutterActorBox *initial,
|
||||
const ClutterActorBox *final,
|
||||
@@ -256,6 +568,41 @@ 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
|
||||
@@ -327,10 +674,10 @@ void clutter_paint_volume_free (ClutterPaintVolume
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
|
||||
const graphene_point3d_t *origin);
|
||||
const ClutterVertex *origin);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_paint_volume_get_origin (const ClutterPaintVolume *pv,
|
||||
graphene_point3d_t *vertex);
|
||||
ClutterVertex *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 graphene_point3d_t *vertices_in,
|
||||
graphene_point3d_t *vertices_out,
|
||||
const ClutterVertex *vertices_in,
|
||||
ClutterVertex *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 (graphene_point3d_t),
|
||||
sizeof (ClutterVertex),
|
||||
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 (graphene_point3d_t),
|
||||
sizeof (ClutterVertex),
|
||||
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];
|
||||
graphene_point3d_t *vertex_out = &vertices_out[i];
|
||||
ClutterVertex *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,
|
||||
graphene_rect_t *dest)
|
||||
ClutterRect *dest)
|
||||
{
|
||||
*dest = (graphene_rect_t) {
|
||||
*dest = (ClutterRect) {
|
||||
.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 graphene_rect_t *src,
|
||||
_clutter_util_rectangle_int_extents (const ClutterRect *src,
|
||||
cairo_rectangle_int_t *dest)
|
||||
{
|
||||
graphene_rect_t tmp = *src;
|
||||
ClutterRect tmp = *src;
|
||||
|
||||
graphene_rect_round_extents (&tmp, &tmp);
|
||||
clutter_rect_clamp_to_pixel (&tmp);
|
||||
|
||||
*dest = (cairo_rectangle_int_t) {
|
||||
.x = tmp.origin.x,
|
||||
@@ -299,12 +299,48 @@ _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_combine (const graphene_point3d_t *a,
|
||||
const graphene_point3d_t *b,
|
||||
double ascl,
|
||||
double bscl,
|
||||
graphene_point3d_t *res)
|
||||
_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)
|
||||
{
|
||||
res->x = (ascl * a->x) + (bscl * b->x);
|
||||
res->y = (ascl * a->y) + (bscl * b->y);
|
||||
@@ -352,16 +388,16 @@ _clutter_util_vertex4_interpolate (const ClutterVertex4 *a,
|
||||
*/
|
||||
gboolean
|
||||
_clutter_util_matrix_decompose (const ClutterMatrix *src,
|
||||
graphene_point3d_t *scale_p,
|
||||
ClutterVertex *scale_p,
|
||||
float shear_p[3],
|
||||
graphene_point3d_t *rotate_p,
|
||||
graphene_point3d_t *translate_p,
|
||||
ClutterVertex *rotate_p,
|
||||
ClutterVertex *translate_p,
|
||||
ClutterVertex4 *perspective_p)
|
||||
{
|
||||
CoglMatrix matrix = *src;
|
||||
CoglMatrix perspective;
|
||||
ClutterVertex4 vertex_tmp;
|
||||
graphene_point3d_t row[3], pdum;
|
||||
ClutterVertex row[3], pdum;
|
||||
int i, j;
|
||||
|
||||
#define XY_SHEAR 0
|
||||
@@ -449,34 +485,34 @@ _clutter_util_matrix_decompose (const ClutterMatrix *src,
|
||||
}
|
||||
|
||||
/* compute scale.x and normalize the first row */
|
||||
scale_p->x = graphene_point3d_length (&row[0]);
|
||||
graphene_point3d_normalize (&row[0], &row[0]);
|
||||
scale_p->x = _clutter_util_vertex_length (&row[0]);
|
||||
_clutter_util_vertex_normalize (&row[0]);
|
||||
|
||||
/* compute XY shear and make the second row orthogonal to the first */
|
||||
shear_p[XY_SHEAR] = graphene_point3d_dot (&row[0], &row[1]);
|
||||
shear_p[XY_SHEAR] = _clutter_util_vertex_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 = graphene_point3d_length (&row[1]);
|
||||
graphene_point3d_normalize (&row[1], &row[1]);
|
||||
scale_p->y = _clutter_util_vertex_length (&row[1]);
|
||||
_clutter_util_vertex_normalize (&row[1]);
|
||||
shear_p[XY_SHEAR] /= scale_p->y;
|
||||
|
||||
/* compute XZ and YZ shears, orthogonalize the third row */
|
||||
shear_p[XZ_SHEAR] = graphene_point3d_dot (&row[0], &row[2]);
|
||||
shear_p[XZ_SHEAR] = _clutter_util_vertex_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] = graphene_point3d_dot (&row[1], &row[2]);
|
||||
shear_p[YZ_SHEAR] = _clutter_util_vertex_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 = graphene_point3d_length (&row[2]);
|
||||
graphene_point3d_normalize (&row[2], &row[2]);
|
||||
scale_p->z = _clutter_util_vertex_length (&row[2]);
|
||||
_clutter_util_vertex_normalize (&row[2]);
|
||||
shear_p[XZ_SHEAR] /= scale_p->z;
|
||||
shear_p[YZ_SHEAR] /= scale_p->z;
|
||||
|
||||
@@ -484,8 +520,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
|
||||
*/
|
||||
graphene_point3d_cross (&row[1], &row[2], &pdum);
|
||||
if (graphene_point3d_dot (&row[0], &pdum) < 0.f)
|
||||
_clutter_util_vertex_cross (&row[1], &row[2], &pdum);
|
||||
if (_clutter_util_vertex_dot (&row[0], &pdum) < 0.f)
|
||||
{
|
||||
scale_p->x *= -1.f;
|
||||
|
||||
|
@@ -172,7 +172,6 @@ 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__ */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user