Merge ~3v1n0/ubuntu/+source/mutter:ubuntu/master into ~ubuntu-desktop/ubuntu/+source/mutter:ubuntu/master

Proposed by Marco Trevisan (Treviño)
Status: Merged
Merged at revision: e8829a3d4521e265b2886246001cf78372cc7f35
Proposed branch: ~3v1n0/ubuntu/+source/mutter:ubuntu/master
Merge into: ~ubuntu-desktop/ubuntu/+source/mutter:ubuntu/master
Diff against target: 100018 lines (+18412/-26783)
601 files modified
NEWS (+118/-26)
clutter/clutter/cally/cally-actor.c (+2/-6)
clutter/clutter/cally/cally-text.c (+3/-7)
clutter/clutter/cally/cally.c (+0/-3)
clutter/clutter/cally/cally.h (+0/-1)
clutter/clutter/clutter-actor-box.c (+3/-3)
clutter/clutter/clutter-actor-meta.c (+4/-8)
clutter/clutter/clutter-actor-private.h (+6/-7)
clutter/clutter/clutter-actor.c (+519/-969)
clutter/clutter/clutter-actor.h (+22/-10)
clutter/clutter/clutter-animatable.c (+0/-75)
clutter/clutter/clutter-autocleanups.h (+1/-4)
clutter/clutter/clutter-backend-private.h (+2/-17)
clutter/clutter/clutter-backend.c (+24/-92)
clutter/clutter/clutter-backend.h (+2/-4)
clutter/clutter/clutter-base-types.c (+12/-1279)
clutter/clutter/clutter-bin-layout.c (+1/-185)
clutter/clutter/clutter-bind-constraint.c (+3/-1)
clutter/clutter/clutter-blur-effect.c (+8/-5)
clutter/clutter/clutter-brightness-contrast-effect.c (+19/-16)
clutter/clutter/clutter-canvas.c (+4/-3)
clutter/clutter/clutter-click-action.c (+14/-47)
clutter/clutter/clutter-clone.c (+4/-4)
clutter/clutter/clutter-colorize-effect.c (+7/-4)
clutter/clutter/clutter-constraint.c (+1/-1)
clutter/clutter/clutter-container.c (+1/-195)
clutter/clutter/clutter-container.h (+1/-16)
clutter/clutter/clutter-content-private.h (+4/-3)
clutter/clutter/clutter-content.c (+12/-8)
clutter/clutter/clutter-content.h (+4/-3)
clutter/clutter/clutter-debug.h (+0/-39)
clutter/clutter/clutter-deform-effect.c (+8/-6)
clutter/clutter/clutter-deprecated.h (+0/-11)
clutter/clutter/clutter-desaturate-effect.c (+7/-4)
clutter/clutter/clutter-drag-action.c (+15/-19)
clutter/clutter/clutter-drag-action.h (+3/-3)
clutter/clutter/clutter-drop-action.c (+2/-4)
clutter/clutter/clutter-effect-private.h (+6/-3)
clutter/clutter/clutter-effect.c (+24/-18)
clutter/clutter/clutter-effect.h (+8/-3)
clutter/clutter/clutter-enums.h (+1/-29)
clutter/clutter/clutter-event.c (+21/-21)
clutter/clutter/clutter-event.h (+1/-1)
clutter/clutter/clutter-feature.c (+3/-12)
clutter/clutter/clutter-gesture-action.c (+6/-13)
clutter/clutter/clutter-graphene.c (+111/-0)
clutter/clutter/clutter-graphene.h (+8/-20)
clutter/clutter/clutter-grid-layout.c (+4/-4)
clutter/clutter/clutter-image.c (+4/-3)
clutter/clutter/clutter-input-device-private.h (+96/-147)
clutter/clutter/clutter-input-device.c (+40/-25)
clutter/clutter/clutter-input-device.h (+33/-1)
clutter/clutter/clutter-input-focus.c (+2/-2)
clutter/clutter/clutter-input-focus.h (+2/-2)
clutter/clutter/clutter-input-method-private.h (+2/-2)
clutter/clutter/clutter-input-method.c (+7/-8)
clutter/clutter/clutter-input-method.h (+2/-2)
clutter/clutter/clutter-input-pointer-a11y.c (+26/-30)
clutter/clutter/clutter-keymap.c (+6/-0)
clutter/clutter/clutter-keymap.h (+4/-0)
clutter/clutter/clutter-keysyms-update.pl (+0/-37)
clutter/clutter/clutter-layout-manager.c (+5/-11)
clutter/clutter/clutter-layout-manager.h (+0/-9)
clutter/clutter/clutter-main.c (+44/-21)
clutter/clutter/clutter-main.h (+48/-0)
clutter/clutter/clutter-mutter.h (+1/-1)
clutter/clutter/clutter-offscreen-effect.c (+90/-68)
clutter/clutter/clutter-offscreen-effect.h (+5/-3)
clutter/clutter/clutter-paint-context-private.h (+29/-0)
clutter/clutter/clutter-paint-context.c (+161/-0)
clutter/clutter/clutter-paint-context.h (+62/-0)
clutter/clutter/clutter-paint-node-private.h (+9/-28)
clutter/clutter/clutter-paint-node.c (+17/-15)
clutter/clutter/clutter-paint-node.h (+2/-1)
clutter/clutter/clutter-paint-nodes.c (+248/-98)
clutter/clutter/clutter-paint-nodes.h (+67/-0)
clutter/clutter/clutter-paint-volume-private.h (+1/-1)
clutter/clutter/clutter-paint-volume.c (+20/-26)
clutter/clutter/clutter-path.c (+1/-8)
clutter/clutter/clutter-pick-context-private.h (+25/-0)
clutter/clutter/clutter-pick-context.c (+83/-0)
clutter/clutter/clutter-pick-context.h (+49/-0)
clutter/clutter/clutter-private.h (+16/-18)
clutter/clutter/clutter-script-parser.c (+55/-54)
clutter/clutter/clutter-script-private.h (+6/-6)
clutter/clutter/clutter-script.c (+5/-70)
clutter/clutter/clutter-scroll-actor.c (+16/-16)
clutter/clutter/clutter-scroll-actor.h (+4/-4)
clutter/clutter/clutter-seat.c (+582/-0)
clutter/clutter/clutter-seat.h (+84/-85)
clutter/clutter/clutter-shader-effect.c (+29/-52)
clutter/clutter/clutter-stage-manager.c (+0/-19)
clutter/clutter/clutter-stage-private.h (+13/-12)
clutter/clutter/clutter-stage-view-private.h (+4/-2)
clutter/clutter/clutter-stage-view.c (+2/-2)
clutter/clutter/clutter-stage-window.c (+5/-6)
clutter/clutter/clutter-stage-window.h (+2/-5)
clutter/clutter/clutter-stage.c (+247/-528)
clutter/clutter/clutter-stage.h (+3/-31)
clutter/clutter/clutter-text.c (+42/-61)
clutter/clutter/clutter-text.h (+2/-2)
clutter/clutter/clutter-timeline.c (+23/-23)
clutter/clutter/clutter-timeline.h (+6/-6)
clutter/clutter/clutter-types.h (+6/-356)
clutter/clutter/clutter-util.c (+30/-66)
clutter/clutter/clutter-virtual-input-device.c (+13/-30)
clutter/clutter/clutter-virtual-input-device.h (+1/-4)
clutter/clutter/clutter-zoom-action.c (+10/-10)
clutter/clutter/clutter-zoom-action.h (+3/-3)
clutter/clutter/clutter.h (+0/-2)
clutter/clutter/cogl/clutter-stage-cogl.c (+329/-224)
clutter/clutter/cogl/clutter-stage-cogl.h (+1/-7)
clutter/clutter/deprecated/clutter-actor.h (+0/-40)
clutter/clutter/deprecated/clutter-alpha.c (+8/-139)
clutter/clutter/deprecated/clutter-alpha.h (+0/-12)
clutter/clutter/deprecated/clutter-animation.c (+1/-830)
clutter/clutter/deprecated/clutter-animation.h (+0/-58)
clutter/clutter/deprecated/clutter-container.h (+0/-20)
clutter/clutter/deprecated/clutter-group.c (+21/-28)
clutter/clutter/deprecated/clutter-rectangle.c (+24/-17)
clutter/clutter/deprecated/clutter-stage.h (+0/-14)
clutter/clutter/deprecated/clutter-state.c (+0/-352)
clutter/clutter/deprecated/clutter-state.h (+0/-31)
clutter/clutter/egl/clutter-backend-eglnative.c (+1/-1)
clutter/clutter/egl/clutter-backend-eglnative.h (+1/-4)
clutter/clutter/egl/clutter-egl.h (+0/-6)
clutter/clutter/meson.build (+11/-26)
clutter/clutter/x11/clutter-backend-x11.c (+0/-1)
clutter/clutter/x11/clutter-backend-x11.h (+0/-2)
cogl/cogl-pango/cogl-pango-display-list.c (+5/-15)
cogl/cogl-pango/cogl-pango-render.c (+0/-41)
cogl/cogl-pango/cogl-pango.h (+0/-65)
cogl/cogl-pango/cogl-pango.symbols (+0/-3)
cogl/cogl-path/cogl-path-functions.h (+0/-49)
cogl/cogl-path/cogl-path.c (+0/-38)
cogl/cogl/cogl-atlas-texture.c (+4/-18)
cogl/cogl/cogl-atlas.c (+9/-3)
cogl/cogl/cogl-attribute-private.h (+2/-3)
cogl/cogl/cogl-attribute.c (+4/-43)
cogl/cogl/cogl-bitmap-private.h (+0/-18)
cogl/cogl/cogl-bitmap.c (+18/-87)
cogl/cogl/cogl-blend-string.c (+7/-28)
cogl/cogl/cogl-blit.c (+5/-1)
cogl/cogl/cogl-buffer-private.h (+0/-3)
cogl/cogl/cogl-buffer.c (+0/-6)
cogl/cogl/cogl-clip-stack.c (+31/-2)
cogl/cogl/cogl-clip-stack.h (+13/-1)
cogl/cogl/cogl-color.c (+0/-22)
cogl/cogl/cogl-color.h (+0/-42)
cogl/cogl/cogl-context-private.h (+3/-47)
cogl/cogl/cogl-context.c (+19/-120)
cogl/cogl/cogl-context.h (+3/-25)
cogl/cogl/cogl-debug-options.h (+0/-5)
cogl/cogl/cogl-debug.c (+0/-1)
cogl/cogl/cogl-debug.h (+0/-1)
cogl/cogl/cogl-depth-state.h (+0/-7)
cogl/cogl/cogl-driver.h (+6/-0)
cogl/cogl/cogl-egl.h (+0/-20)
cogl/cogl/cogl-feature-private.c (+1/-1)
cogl/cogl/cogl-feature-private.h (+0/-2)
cogl/cogl/cogl-framebuffer-private.h (+4/-65)
cogl/cogl/cogl-framebuffer.c (+53/-259)
cogl/cogl/cogl-framebuffer.h (+12/-318)
cogl/cogl/cogl-indices.h (+1/-1)
cogl/cogl/cogl-journal-private.h (+2/-0)
cogl/cogl/cogl-journal.c (+126/-65)
cogl/cogl/cogl-matrix-stack-private.h (+3/-36)
cogl/cogl/cogl-matrix-stack.c (+31/-218)
cogl/cogl/cogl-matrix-stack.h (+3/-14)
cogl/cogl/cogl-matrix.c (+26/-94)
cogl/cogl/cogl-matrix.h (+7/-59)
cogl/cogl/cogl-object-private.h (+0/-31)
cogl/cogl/cogl-object.c (+0/-12)
cogl/cogl/cogl-offscreen.h (+0/-28)
cogl/cogl/cogl-onscreen-private.h (+0/-6)
cogl/cogl/cogl-onscreen.c (+4/-123)
cogl/cogl/cogl-onscreen.h (+0/-117)
cogl/cogl/cogl-pipeline-debug.c (+1/-19)
cogl/cogl/cogl-pipeline-layer-private.h (+1/-5)
cogl/cogl/cogl-pipeline-layer-state.c (+2/-119)
cogl/cogl/cogl-pipeline-layer-state.h (+2/-42)
cogl/cogl/cogl-pipeline-layer.c (+3/-7)
cogl/cogl/cogl-pipeline-private.h (+5/-122)
cogl/cogl/cogl-pipeline-state-private.h (+0/-24)
cogl/cogl/cogl-pipeline-state.c (+6/-440)
cogl/cogl/cogl-pipeline-state.h (+1/-190)
cogl/cogl/cogl-pipeline.c (+26/-288)
cogl/cogl/cogl-pipeline.h (+1/-1)
cogl/cogl/cogl-pixel-buffer.h (+0/-31)
cogl/cogl/cogl-pixel-format.c (+119/-86)
cogl/cogl/cogl-pixel-format.h (+28/-7)
cogl/cogl/cogl-primitives-private.h (+8/-2)
cogl/cogl/cogl-primitives.c (+29/-403)
cogl/cogl/cogl-private.h (+3/-23)
cogl/cogl/cogl-renderer-private.h (+0/-4)
cogl/cogl/cogl-renderer.c (+1/-40)
cogl/cogl/cogl-renderer.h (+0/-14)
cogl/cogl/cogl-sampler-cache-private.h (+1/-3)
cogl/cogl/cogl-sampler-cache.c (+3/-16)
cogl/cogl/cogl-snippet.h (+1/-2)
cogl/cogl/cogl-sub-texture.c (+2/-5)
cogl/cogl/cogl-texture-2d-private.h (+0/-1)
cogl/cogl/cogl-texture-2d-sliced-private.h (+0/-10)
cogl/cogl/cogl-texture-2d-sliced.c (+15/-137)
cogl/cogl/cogl-texture-2d.c (+2/-11)
cogl/cogl/cogl-texture-driver.h (+0/-11)
cogl/cogl/cogl-texture-private.h (+1/-8)
cogl/cogl/cogl-texture.c (+17/-20)
cogl/cogl/cogl-types.h (+1/-119)
cogl/cogl/cogl-xlib-private.h (+0/-6)
cogl/cogl/cogl-xlib-renderer-private.h (+0/-3)
cogl/cogl/cogl-xlib-renderer.c (+0/-28)
cogl/cogl/cogl-xlib-renderer.h (+1/-29)
cogl/cogl/cogl-xlib.h (+0/-57)
cogl/cogl/cogl.c (+0/-466)
cogl/cogl/cogl.h (+2/-12)
cogl/cogl/cogl1-context.h (+0/-599)
cogl/cogl/deprecated/cogl-auto-texture.c (+2/-2)
cogl/cogl/deprecated/cogl-auto-texture.h (+1/-2)
cogl/cogl/deprecated/cogl-clutter.c (+0/-59)
cogl/cogl/deprecated/cogl-clutter.h (+0/-9)
cogl/cogl/deprecated/cogl-framebuffer-deprecated.h (+0/-107)
cogl/cogl/deprecated/cogl-material-compat.c (+0/-299)
cogl/cogl/deprecated/cogl-material-compat.h (+0/-748)
cogl/cogl/deprecated/cogl-program-private.h (+0/-3)
cogl/cogl/deprecated/cogl-program.c (+8/-125)
cogl/cogl/deprecated/cogl-shader-private.h (+0/-6)
cogl/cogl/deprecated/cogl-shader.c (+2/-85)
cogl/cogl/deprecated/cogl-shader.h (+0/-208)
cogl/cogl/driver/gl/cogl-attribute-gl.c (+2/-223)
cogl/cogl/driver/gl/cogl-bitmap-gl-private.h (+21/-6)
cogl/cogl/driver/gl/cogl-bitmap-gl.c (+122/-0)
cogl/cogl/driver/gl/cogl-buffer-gl.c (+1/-1)
cogl/cogl/driver/gl/cogl-clip-stack-gl.c (+144/-210)
cogl/cogl/driver/gl/cogl-framebuffer-gl.c (+18/-62)
cogl/cogl/driver/gl/cogl-pipeline-fragend-glsl.c (+1/-11)
cogl/cogl/driver/gl/cogl-pipeline-opengl-private.h (+2/-10)
cogl/cogl/driver/gl/cogl-pipeline-opengl.c (+26/-281)
cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c (+19/-38)
cogl/cogl/driver/gl/cogl-pipeline-vertend-glsl.c (+2/-24)
cogl/cogl/driver/gl/cogl-texture-2d-gl-private.h (+1/-2)
cogl/cogl/driver/gl/cogl-texture-2d-gl.c (+23/-270)
cogl/cogl/driver/gl/cogl-texture-gl-private.h (+1/-2)
cogl/cogl/driver/gl/cogl-texture-gl.c (+4/-8)
cogl/cogl/driver/gl/cogl-util-gl-private.h (+7/-0)
cogl/cogl/driver/gl/gl/cogl-driver-gl.c (+64/-59)
cogl/cogl/driver/gl/gl/cogl-texture-driver-gl.c (+17/-26)
cogl/cogl/driver/gl/gles/cogl-driver-gles.c (+7/-34)
cogl/cogl/driver/gl/gles/cogl-texture-driver-gles.c (+24/-20)
cogl/cogl/driver/nop/cogl-driver-nop.c (+14/-1)
cogl/cogl/driver/nop/cogl-texture-2d-nop-private.h (+1/-2)
cogl/cogl/driver/nop/cogl-texture-2d-nop.c (+1/-2)
cogl/cogl/gl-prototypes/cogl-all-functions.h (+0/-46)
cogl/cogl/gl-prototypes/cogl-core-functions.h (+21/-28)
cogl/cogl/gl-prototypes/cogl-glsl-functions.h (+0/-82)
cogl/cogl/gl-prototypes/cogl-in-gles-core-functions.h (+0/-77)
cogl/cogl/gl-prototypes/cogl-in-gles2-core-functions.h (+0/-43)
cogl/cogl/libmutter-cogl.map.in (+0/-1)
cogl/cogl/meson.build (+8/-37)
cogl/cogl/winsys/cogl-glx-renderer-private.h (+0/-2)
cogl/cogl/winsys/cogl-glx.h (+0/-20)
cogl/cogl/winsys/cogl-texture-pixmap-x11.c (+17/-24)
cogl/cogl/winsys/cogl-texture-pixmap-x11.h (+0/-25)
cogl/cogl/winsys/cogl-winsys-egl-x11.c (+2/-48)
cogl/cogl/winsys/cogl-winsys-egl.c (+21/-11)
cogl/cogl/winsys/cogl-winsys-glx.c (+25/-116)
cogl/meson.build (+1/-0)
cogl/test-fixtures/test-utils.c (+0/-18)
cogl/tests/conform/meson.build (+1/-6)
cogl/tests/conform/test-backface-culling.c (+48/-42)
cogl/tests/conform/test-blend-strings.c (+29/-84)
cogl/tests/conform/test-conform-main.c (+1/-1)
cogl/tests/conform/test-declarations.h (+1/-1)
cogl/tests/conform/test-depth-test.c (+16/-47)
cogl/tests/conform/test-euler.c (+3/-17)
cogl/tests/conform/test-just-vertex-shader.c (+9/-95)
cogl/tests/conform/test-multitexture.c (+7/-5)
cogl/tests/conform/test-offscreen.c (+34/-35)
cogl/tests/conform/test-path.c (+1/-3)
cogl/tests/conform/test-pipeline-uniforms.c (+2/-2)
cogl/tests/conform/test-premult.c (+10/-30)
cogl/tests/conform/test-readpixels.c (+7/-7)
cogl/tests/conform/test-texture-mipmaps.c (+6/-4)
cogl/tests/conform/test-texture-pixmap-x11.c (+6/-4)
cogl/tests/conform/test-viewport.c (+7/-7)
cogl/tests/conform/test-wrap-modes.c (+23/-73)
cogl/tests/data/valgrind.suppressions (+0/-8)
debian/changelog (+39/-0)
debian/control (+11/-9)
debian/control.in (+11/-9)
debian/gbp.conf (+1/-1)
debian/gir1.2-mutter-6.install (+1/-0)
debian/libmutter-6-0.install (+2/-0)
debian/libmutter-6-0.symbols (+67/-452)
debian/libmutter-6-dev.install (+2/-2)
debian/mutter.install (+1/-1)
debian/patches/debian/synaptics-support.patch (+38/-38)
debian/patches/debian/tests-Tag-closed-transient-no-input-tests-as-flaky.patch (+2/-2)
debian/patches/meson-add-back-default_driver-option.patch (+4/-4)
debian/patches/series (+0/-1)
debian/patches/theme-load-icons-as-Gtk-does-with-fallback-and-RTL-suppor.patch (+6/-8)
debian/patches/theme-use-gtk_render_icon_suface-to-paint-button-icon.patch (+1/-1)
debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch (+59/-59)
debian/rules (+2/-2)
debian/tests/control (+2/-2)
debian/tests/libmutter-6-dev (+1/-1)
debian/watch (+1/-1)
dev/null (+0/-7)
meson.build (+5/-2)
mutter.doap (+24/-3)
po/POTFILES.in (+0/-1)
po/gl.po (+41/-1236)
po/ja.po (+63/-102)
po/ms.po (+1411/-2364)
po/zh_CN.po (+126/-90)
src/backends/meta-backend-private.h (+4/-26)
src/backends/meta-backend.c (+91/-132)
src/backends/meta-crtc.c (+2/-0)
src/backends/meta-cursor-renderer.c (+9/-9)
src/backends/meta-cursor-renderer.h (+3/-3)
src/backends/meta-cursor-tracker-private.h (+0/-1)
src/backends/meta-cursor-tracker.c (+4/-43)
src/backends/meta-egl-ext.h (+1/-0)
src/backends/meta-egl.c (+1/-0)
src/backends/meta-egl.h (+1/-0)
src/backends/meta-idle-monitor-dbus.c (+0/-47)
src/backends/meta-idle-monitor-private.h (+1/-1)
src/backends/meta-idle-monitor.c (+20/-40)
src/backends/meta-input-mapper.c (+7/-7)
src/backends/meta-input-settings.c (+93/-56)
src/backends/meta-monitor-config-manager.c (+129/-24)
src/backends/meta-monitor-manager.c (+5/-5)
src/backends/meta-orientation-manager.c (+3/-3)
src/backends/meta-profiler.c (+2/-5)
src/backends/meta-remote-desktop-session.c (+7/-11)
src/backends/meta-remote-desktop.c (+3/-3)
src/backends/meta-renderer.c (+2/-0)
src/backends/meta-screen-cast-monitor-stream-src.c (+17/-26)
src/backends/meta-screen-cast-window-stream-src.c (+15/-26)
src/backends/meta-screen-cast-window-stream.c (+2/-3)
src/backends/meta-screen-cast-window.c (+6/-6)
src/backends/meta-screen-cast-window.h (+8/-8)
src/backends/meta-stage-private.h (+4/-4)
src/backends/meta-stage.c (+23/-18)
src/backends/native/gen-default-modes.py (+2/-2)
src/backends/native/meta-backend-native.c (+48/-70)
src/backends/native/meta-backend-native.h (+2/-0)
src/backends/native/meta-barrier-native.c (+2/-2)
src/backends/native/meta-clutter-backend-native.c (+29/-31)
src/backends/native/meta-clutter-backend-native.h (+2/-0)
src/backends/native/meta-crtc-kms.c (+5/-1)
src/backends/native/meta-cursor-renderer-native.c (+171/-111)
src/backends/native/meta-drm-buffer-gbm.c (+18/-78)
src/backends/native/meta-drm-buffer-import.c (+197/-0)
src/backends/native/meta-drm-buffer-import.h (+54/-0)
src/backends/native/meta-gpu-kms.c (+75/-0)
src/backends/native/meta-gpu-kms.h (+17/-0)
src/backends/native/meta-input-device-native.c (+37/-58)
src/backends/native/meta-input-device-native.h (+2/-4)
src/backends/native/meta-input-settings-native.c (+4/-2)
src/backends/native/meta-keymap-native.c (+14/-9)
src/backends/native/meta-keymap-native.h (+4/-0)
src/backends/native/meta-kms-connector.c (+5/-0)
src/backends/native/meta-kms-crtc.c (+1/-0)
src/backends/native/meta-kms-device.c (+52/-13)
src/backends/native/meta-kms-device.h (+7/-0)
src/backends/native/meta-kms-impl-device.c (+30/-2)
src/backends/native/meta-kms-impl-device.h (+9/-0)
src/backends/native/meta-kms-impl-simple.c (+246/-44)
src/backends/native/meta-kms-impl.c (+4/-5)
src/backends/native/meta-kms-impl.h (+4/-6)
src/backends/native/meta-kms-plane-private.h (+33/-0)
src/backends/native/meta-kms-plane.c (+1/-1)
src/backends/native/meta-kms-plane.h (+0/-5)
src/backends/native/meta-kms-private.h (+2/-2)
src/backends/native/meta-kms-types.h (+2/-0)
src/backends/native/meta-kms-update-private.h (+23/-0)
src/backends/native/meta-kms-update.c (+111/-6)
src/backends/native/meta-kms-update.h (+41/-8)
src/backends/native/meta-kms.c (+31/-33)
src/backends/native/meta-kms.h (+1/-2)
src/backends/native/meta-launcher.c (+6/-5)
src/backends/native/meta-monitor-manager-kms.c (+14/-6)
src/backends/native/meta-renderer-native-gles3.c (+3/-0)
src/backends/native/meta-renderer-native.c (+160/-91)
src/backends/native/meta-seat-native.c (+2528/-112)
src/backends/native/meta-seat-native.h (+174/-8)
src/backends/native/meta-udev.c (+2/-2)
src/backends/native/meta-virtual-input-device-native.c (+13/-6)
src/backends/x11/cm/meta-backend-x11-cm.c (+6/-5)
src/backends/x11/meta-backend-x11.c (+17/-21)
src/backends/x11/meta-clutter-backend-x11.c (+16/-77)
src/backends/x11/meta-input-device-x11.c (+16/-6)
src/backends/x11/meta-keymap-x11.c (+29/-22)
src/backends/x11/meta-keymap-x11.h (+0/-2)
src/backends/x11/meta-seat-x11.c (+744/-681)
src/backends/x11/meta-seat-x11.h (+42/-0)
src/backends/x11/meta-stage-x11.c (+5/-56)
src/backends/x11/meta-stage-x11.h (+0/-4)
src/backends/x11/meta-virtual-input-device-x11.c (+2/-1)
src/backends/x11/meta-xkb-a11y-x11.c (+11/-14)
src/backends/x11/meta-xkb-a11y-x11.h (+3/-3)
src/backends/x11/nested/meta-stage-x11-nested.c (+0/-26)
src/compositor/clutter-utils.c (+6/-23)
src/compositor/clutter-utils.h (+5/-8)
src/compositor/compositor.c (+41/-34)
src/compositor/meta-background-actor.c (+6/-4)
src/compositor/meta-background.c (+28/-6)
src/compositor/meta-compositor-x11.c (+35/-18)
src/compositor/meta-cullable.c (+45/-2)
src/compositor/meta-cullable.h (+2/-0)
src/compositor/meta-dnd-actor.c (+1/-1)
src/compositor/meta-dnd.c (+1/-4)
src/compositor/meta-feedback-actor.c (+1/-1)
src/compositor/meta-shadow-factory.c (+3/-9)
src/compositor/meta-shaped-texture-private.h (+6/-1)
src/compositor/meta-shaped-texture.c (+132/-43)
src/compositor/meta-surface-actor-wayland.c (+10/-22)
src/compositor/meta-surface-actor-x11.c (+12/-35)
src/compositor/meta-surface-actor-x11.h (+6/-0)
src/compositor/meta-surface-actor.c (+68/-66)
src/compositor/meta-surface-actor.h (+5/-13)
src/compositor/meta-sync-ring.c (+1/-1)
src/compositor/meta-texture-tower.c (+12/-6)
src/compositor/meta-texture-tower.h (+2/-1)
src/compositor/meta-window-actor-private.h (+6/-13)
src/compositor/meta-window-actor-wayland.c (+35/-0)
src/compositor/meta-window-actor-x11.c (+1044/-20)
src/compositor/meta-window-actor-x11.h (+13/-0)
src/compositor/meta-window-actor.c (+86/-905)
src/compositor/meta-window-group.c (+10/-10)
src/compositor/region-utils.c (+4/-4)
src/compositor/region-utils.h (+4/-4)
src/core/boxes-private.h (+7/-7)
src/core/boxes.c (+19/-17)
src/core/constraints.c (+9/-44)
src/core/display-private.h (+0/-1)
src/core/display.c (+21/-51)
src/core/edge-resistance.c (+9/-17)
src/core/events.c (+3/-22)
src/core/frame.c (+4/-3)
src/core/frame.h (+3/-2)
src/core/main-private.h (+8/-0)
src/core/main.c (+1/-1)
src/core/meta-clipboard-manager.c (+13/-3)
src/core/meta-close-dialog-default.c (+2/-7)
src/core/meta-gesture-tracker.c (+8/-13)
src/core/meta-selection-source-memory.c (+1/-1)
src/core/meta-selection.c (+19/-0)
src/core/meta-sound-player.c (+3/-3)
src/core/meta-workspace-manager.c (+2/-2)
src/core/prefs.c (+2/-2)
src/core/stack.c (+7/-144)
src/core/startup-notification.c (+3/-8)
src/core/util.c (+18/-5)
src/core/window-private.h (+13/-1)
src/core/window.c (+63/-55)
src/meson.build (+29/-8)
src/meta/common.h (+0/-8)
src/meta/meta-cursor-tracker.h (+0/-7)
src/meta/meta-idle-monitor.h (+0/-3)
src/meta/meta-workspace-manager.h (+1/-0)
src/meta/util.h (+10/-0)
src/meta/window.h (+2/-0)
src/tests/clutter-test-utils.c (+13/-15)
src/tests/clutter-test-utils.h (+10/-10)
src/tests/clutter/accessibility/cally-atktext-example.c (+9/-9)
src/tests/clutter/clutter-1.0.suppressions (+0/-8)
src/tests/clutter/conform/actor-anchors.c (+4/-4)
src/tests/clutter/conform/actor-destroy.c (+7/-33)
src/tests/clutter/conform/actor-layout.c (+8/-8)
src/tests/clutter/conform/actor-offscreen-redirect.c (+24/-14)
src/tests/clutter/conform/actor-shader-effect.c (+6/-4)
src/tests/clutter/conform/binding-pool.c (+16/-4)
src/tests/clutter/conform/meson.build (+0/-2)
src/tests/clutter/conform/script-parser.c (+0/-39)
src/tests/clutter/conform/text-cache.c (+3/-1)
src/tests/clutter/conform/texture-fbo.c (+0/-8)
src/tests/clutter/conform/timeline.c (+1/-1)
src/tests/clutter/interactive/meson.build (+2/-9)
src/tests/clutter/interactive/test-actors.c (+3/-27)
src/tests/clutter/interactive/test-binding-pool.c (+13/-4)
src/tests/clutter/interactive/test-cogl-multitexture.c (+29/-23)
src/tests/clutter/interactive/test-cogl-offscreen.c (+59/-51)
src/tests/clutter/interactive/test-cogl-point-sprites.c (+12/-25)
src/tests/clutter/interactive/test-cogl-shader-glsl.c (+13/-15)
src/tests/clutter/interactive/test-cogl-tex-convert.c (+51/-36)
src/tests/clutter/interactive/test-cogl-tex-polygon.c (+90/-61)
src/tests/clutter/interactive/test-cogl-tex-tile.c (+22/-11)
src/tests/clutter/interactive/test-content.c (+4/-3)
src/tests/clutter/interactive/test-devices.c (+26/-22)
src/tests/clutter/interactive/test-easing.c (+16/-10)
src/tests/clutter/interactive/test-events.c (+1/-1)
src/tests/clutter/interactive/test-grab.c (+3/-3)
src/tests/clutter/interactive/test-image.c (+4/-3)
src/tests/clutter/interactive/test-layout.c (+6/-5)
src/tests/clutter/interactive/test-main.c (+13/-0)
src/tests/clutter/interactive/test-paint-wrapper.c (+32/-40)
src/tests/clutter/interactive/test-script.c (+0/-29)
src/tests/clutter/interactive/test-script.json (+1/-21)
src/tests/clutter/interactive/test-shader-effects.c (+2/-1)
src/tests/clutter/interactive/test-state.c (+2/-1)
src/tests/clutter/interactive/test-text-field.c (+9/-9)
src/tests/clutter/interactive/test-touch-events.c (+15/-31)
src/tests/clutter/meson.build (+2/-0)
src/tests/clutter/micro-bench/test-cogl-perf.c (+36/-22)
src/tests/clutter/micro-bench/test-picking.c (+3/-1)
src/tests/clutter/micro-bench/test-text-perf.c (+3/-1)
src/tests/clutter/micro-bench/test-text.c (+3/-1)
src/tests/clutter/performance/meson.build (+4/-1)
src/tests/clutter/performance/test-common.h (+11/-3)
src/tests/clutter/performance/test-state-interactive.c (+2/-1)
src/tests/clutter/performance/test-state-mini.c (+2/-1)
src/tests/clutter/performance/test-state-pick.c (+2/-1)
src/tests/clutter/performance/test-state.c (+2/-1)
src/tests/clutter/test-utils.h (+30/-0)
src/tests/meson.build (+6/-0)
src/tests/stacking/set-override-redirect-parent.metatest (+13/-0)
src/tests/test-utils.c (+2/-3)
src/tests/unit-tests.c (+3/-0)
src/tests/wayland-test-clients/meson.build (+61/-0)
src/tests/wayland-test-clients/subsurface-remap-toplevel.c (+397/-0)
src/tests/wayland-test-clients/test-driver.xml (+9/-0)
src/tests/wayland-test-clients/wayland-test-client-utils.c (+88/-0)
src/tests/wayland-test-clients/wayland-test-client-utils.h (+8/-0)
src/tests/wayland-unit-tests.c (+203/-0)
src/tests/wayland-unit-tests.h (+25/-0)
src/ui/frames.c (+87/-79)
src/ui/frames.h (+9/-3)
src/ui/theme.c (+2/-2)
src/ui/ui.c (+2/-2)
src/wayland/meta-pointer-confinement-wayland.c (+5/-2)
src/wayland/meta-wayland-actor-surface.c (+61/-33)
src/wayland/meta-wayland-actor-surface.h (+4/-1)
src/wayland/meta-wayland-buffer.c (+49/-18)
src/wayland/meta-wayland-buffer.h (+0/-1)
src/wayland/meta-wayland-cursor-surface.c (+13/-13)
src/wayland/meta-wayland-data-device-private.h (+1/-7)
src/wayland/meta-wayland-data-device.c (+174/-134)
src/wayland/meta-wayland-data-device.h (+2/-0)
src/wayland/meta-wayland-dma-buf.c (+30/-2)
src/wayland/meta-wayland-dma-buf.h (+0/-1)
src/wayland/meta-wayland-dnd-surface.c (+5/-5)
src/wayland/meta-wayland-egl-stream.c (+18/-9)
src/wayland/meta-wayland-egl-stream.h (+1/-1)
src/wayland/meta-wayland-gtk-shell.c (+2/-2)
src/wayland/meta-wayland-inhibit-shortcuts-dialog.c (+1/-1)
src/wayland/meta-wayland-inhibit-shortcuts.c (+6/-6)
src/wayland/meta-wayland-keyboard.c (+10/-6)
src/wayland/meta-wayland-legacy-xdg-shell.c (+79/-89)
src/wayland/meta-wayland-outputs.c (+30/-5)
src/wayland/meta-wayland-outputs.h (+2/-0)
src/wayland/meta-wayland-pointer-constraints.c (+22/-19)
src/wayland/meta-wayland-pointer.c (+27/-36)
src/wayland/meta-wayland-pointer.h (+1/-1)
src/wayland/meta-wayland-seat.c (+20/-18)
src/wayland/meta-wayland-shell-surface.c (+10/-24)
src/wayland/meta-wayland-shell-surface.h (+4/-12)
src/wayland/meta-wayland-subsurface.c (+32/-20)
src/wayland/meta-wayland-surface.c (+223/-220)
src/wayland/meta-wayland-surface.h (+66/-31)
src/wayland/meta-wayland-tablet-manager.c (+0/-5)
src/wayland/meta-wayland-tablet-pad.c (+2/-2)
src/wayland/meta-wayland-tablet-seat.c (+14/-10)
src/wayland/meta-wayland-tablet-seat.h (+1/-1)
src/wayland/meta-wayland-tablet-tool.c (+3/-10)
src/wayland/meta-wayland-tablet-tool.h (+1/-1)
src/wayland/meta-wayland-text-input-legacy.c (+2/-2)
src/wayland/meta-wayland-text-input.c (+2/-2)
src/wayland/meta-wayland-touch.c (+15/-8)
src/wayland/meta-wayland-touch.h (+0/-1)
src/wayland/meta-wayland-types.h (+2/-1)
src/wayland/meta-wayland-viewporter.c (+21/-14)
src/wayland/meta-wayland-window-configuration.c (+68/-0)
src/wayland/meta-wayland-window-configuration.h (+50/-0)
src/wayland/meta-wayland-wl-shell.c (+29/-15)
src/wayland/meta-wayland-xdg-foreign.c (+6/-6)
src/wayland/meta-wayland-xdg-shell.c (+108/-99)
src/wayland/meta-wayland.c (+2/-1)
src/wayland/meta-window-wayland.c (+114/-74)
src/wayland/meta-window-wayland.h (+8/-18)
src/wayland/meta-window-xwayland.c (+169/-0)
src/wayland/meta-xwayland-dnd.c (+9/-5)
src/wayland/meta-xwayland-grab-keyboard.c (+9/-16)
src/wayland/meta-xwayland.c (+1/-50)
src/x11/atomnames.h (+3/-0)
src/x11/events.c (+14/-4)
src/x11/meta-selection-source-x11.c (+1/-0)
src/x11/meta-startup-notification-x11.c (+6/-0)
src/x11/meta-x11-display-private.h (+2/-0)
src/x11/meta-x11-display.c (+61/-6)
src/x11/meta-x11-selection-input-stream.c (+15/-0)
src/x11/meta-x11-selection-output-stream.c (+19/-16)
src/x11/meta-x11-selection.c (+64/-9)
src/x11/meta-x11-window-control.c (+59/-85)
src/x11/meta-x11-window-control.h (+81/-0)
src/x11/session.c (+1/-1)
src/x11/window-props.c (+30/-7)
src/x11/window-x11-private.h (+7/-0)
src/x11/window-x11.c (+237/-24)
src/x11/window-x11.h (+12/-0)
Reviewer Review Type Date Requested Status
Ubuntu Desktop Pending
Review via email: mp+379812@code.launchpad.net

Description of the change

Update to 3.35.91

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/NEWS b/NEWS
index 38e94df..769cadd 100644
--- a/NEWS
+++ b/NEWS
@@ -1,45 +1,137 @@
13.34.313.35.91
2=======
3* Honor accelerometer orientation on monitor config changes [Hans; !959]
4* Enable culling for integer-scaled actors [Robert; !1036]
5* Add ClutterSeat::touch-mode property [Carlos; !1044]
6* Fix mis-scaling when streaming windows [Olivier; !1022]
7* Make the cursor renderer use the transactional KMS API [Jonas; !930]
8* Advertise MetaMonitor as wl_output [Olivier; !994]
9* Fix culling of XWayland windows [Robert; !1049]
10* Only consider enabled effects when disabling culling [Robert; !1052]
11* Misc. bug fixes and cleanups [Olivier, Sergio, Adam, Carlos, Björn; !1040,
12 #985, !1024, !1039, !1051]
13
14Contributors:
15 Sergio Costas, Björn Daase, Olivier Fourdan, Carlos Garnacho, Hans de Goede,
16 Adam Jackson, Robert Mader, Jonas Ådahl
17
18Translators:
19 sicklylife [ja]
20
213.35.90
22=======
23* Cull out clip region [Robert; !985]
24* Always enable tap-to-click/drag on opaque Wacom tablets [Carlos; !968]
25* Fix visual glitches with offscreen effects applied [Georges; !992]
26* Fix "sticky corner" in multi-head setups [Jonas D.; #774]
27* Fix black shadows around XWayland windows during resizes [Ray, Olivier; #858]
28* Zero-copy path for GPU-less secondary GPUs [Pekka; !810]
29* Cancel DND on Esc [Carlos; #1020]
30* Sync XWayland window shadows to frame during resizes [Olivier; !1009]
31* Add support for per-monitor workareas [Alberts; !370]
32* Ensure newly mapped wayland windows receive ENTER event [Olivier; !1026]
33* Add ClutterSeat object [Carlos; !852]
34* Honour CLUTTER_ACTOR_NO_LAYOUT flag more efficiently [Daniel; !575]
35* Fix interoperation with wl_data_device_manager v1 [Carlos; #965]
36* Favor text over images in clipboard manager [Carlos; #919]
37* Apply monitor scale after background texture creation [Daniel; !1004]
38* Plugged memory leaks [Sebastian, Adam; !991, #1000, !1011, !1020, !1030,
39 !1001, !1033]
40* Fixed crashes [Jonas Å., Florian, Olivier; !961, #1029, !1037]
41* Misc. bug fixes and cleanups [Björn, Jonas Å., Adam, Sebastian, Jonas D.,
42 Daniel, Carlos, Corentin, Sebastian, Robert, Daniel; #385, !998, !1007, !995,
43 !1016, !1018, !1017, !1005, !1019, !1025, !1028, !1029, !1031, !1015, !1032,
44 !1034, #1025]
45
46Contributors:
47 Björn Daase, Jonas Dreßler, Olivier Fourdan, Carlos Garnacho, Adam Jackson,
48 Sebastian Keller, Robert Mader, Alberts Muktupāvels, Florian Müllner,
49 Georges Basile Stavracas Neto, Corentin Noël, Pekka Paalanen, Ray Strode,
50 Daniel van Vugt, Jonas Ådahl
51
52Translators:
53 sicklylife [ja], Umarzuki Bin Mochlis Moktar [ms]
54
553.35.3
2======56======
57* backends/native: Correct dy value in pinch gesture event [Yariv; !974]
58* Upload clipping rectangles in parallel [Daniel; !969]
59* More cogl API cleanups [Adam; !978, !977, !973]
3* Fix window recording on HiDPI [Pascal; !976]60* Fix window recording on HiDPI [Pascal; !976]
4* Fix top-left pixel being insensitive to clicks [Sebastian; #893]61* Fix top-left pixel being insensitive to clicks [Sebastian; #893]
62* Misc. bug fixes and cleanups [Daniel, Adam; !979, !980]
563
6Contributors:64Contributors:
7 Sebastian Keller, Pascal Nowack65 Yariv Barkan, Adam Jackson, Sebastian Keller, Pascal Nowack, Daniel van Vugt
66
67Translators:
68 Fran Dieguez [gl], Dz Chen [zh_CN]
869
93.34.2703.35.2
10======71======
11* Fix immediate screen blank after releasing inhibitor [Tim; #573]72* Don't emit focus event after destruction [Marco; gnome-shell#1704, !860]
12* Respond to frame callbacks regardless of damage [Jonas Å.; !839]73* Add a notion of pixel format planes [Niels; !858]
13* Translate well-known selection atoms to mimetypes [Carlos; !842]74* Replace various Cogl/Clutter types with Graphene [Georges; !458]
14* Fix Night Light on wayland [Jonas Å.; !840]75* Improve CoglJournal [Georges, Jasper; !402]
15* Fix various copy+paste/DND regressions [Carlos; !848, #789, #842,76* Split pick and paint [Georges; !865]
16 #793, #845, #854]77* Remove deprecated/unused cogl/clutter APIs [Adam; !866, !878, !879, !880,
17* Don't emit focus event after desctruction [Marco; gnome-shell#1704, !860]78 !885, !900, !902, !904, !896, !913, !922, !883, !903, !921, !933, !819]
18* Fix hang when opening not-responding dialog on Xorg [Carlos; !876]79* Fix hang when opening not-responding dialog on Xorg [Carlos; !876]
19* Fix frozen grabs on Xorg after weeks of inactivity [Jonas Å.; !886]80* Allow changing Clutter debug flags at runtime [Georges; !862]
20* Fix triggering popups from stylus devices on wayland [Carlos; #886]81* Fix frozen grabs on Xorg after weeks of inactivity [Jonas; !886]
21* Support shadow framebuffers for offscreen rendering [Olivier; !917]82* Fix triggering popups from stylus devices o wayland [Carlos; #886]
83* Fix fallback to GLES2 [Adam; #635]
84* Fix buffer age checks on multiple monitors [Carlos; !906]
85* Adjust to Sysprof API change [Christian; !908]
86* Improve support for (X11) fullscreen games under wayland [Hans; !739]
87* Support shadow framebuffers for offscreen rendering [Olivier; !877]
22* Fix hang after interacting with desktop icons on X11 [Marco; !909]88* Fix hang after interacting with desktop icons on X11 [Marco; !909]
23* Don't double scale when getting absolute surface coordinates [Xiang; !915]89* Don't double scale when getting absolute surface coordinates [Xiang; !915]
90* Respect NET_WM_TRANSIENT_FOR for override-redirect windows [Marco; !920]
24* Kill window effects on destroy [Robert; !924]91* Kill window effects on destroy [Robert; !924]
92* Remove deprecated ClutterTexture [Jonas; !932]
93* Use regions instead of bounding box for clipping and culling [Carlos; !867]
25* Use partial damage for dma-buf and EGLImage buffers on wayland [Robert; #947]94* Use partial damage for dma-buf and EGLImage buffers on wayland [Robert; #947]
26* Do not stack transients underneath their always-on-top parent [Florian; #587]95* Do not stack transients underneath their always-on-top parent [Florian; #587]
27* Fix KMS freeze after pageflip [Pekka; !953]96* Add explicit paint/pick contexts [Jonas; !935]
28* Fixed crashes [Robert, Jonas Å., Marco, Hans, Carlos, Tim; !856, !912, !895,97* Fix KMS freeze after pageflip fallback [Pekka; !953]
29 !928, #591, !823, !960]98* Fixed crashes [Robert, Carlos, Jonas, Marco, Hans, Tim; !856, !869, !912,
30* Plugged memory leaks [Niels, Robert, Carlos; !847, !868, !873]99 !895, !928, #591, !823, !960]
31* Misc. bug fixes and cleanups [Daniel, Marco, Jonas Å., Georges, Cosimo,100* Plugged memory leaks [Niels, Robert, Carlos, Marco; !847, !868, !873, #908]
32 Florian, Hans, Robert, Jonas D.; !841, !764, !837, !846, !673, !811, !893,101* Misc. bug fixes and cleanups [Niels, Robert, Jonas, Marco, Carlos, Daniel,
33 !925, !927, !940, !832]102 Jan, Adam, Cosimo, Florian, Thomas, Georges, Hans, Corentin, Christian,
34103 Benjamin; !853, !822, !451, !854, !816, !857, !859, !734, !844, !851, #876,
35Contributors:104 !874, !673, !692, !888, !889, !894, !901, !905, !872, !898, !911, !918, !863,
36 Marco Trevisan (Treviño), Cosimo Cecchi, Tim Crawford, Jonas Dreßler,105 #878, !811, !893, !925, !926, !890, !931, !927, !934, !938, !940, !947, !941,
37 Xiang Fan, Olivier Fourdan, Carlos Garnacho, Hans de Goede, Niels De Graef,106 !929, !949, !952, !871, !955, !956, !958, !907, !965, !964, !966]
38 Tim Klocke, Robert Mader, Florian Müllner, Georges Basile Stavracas Neto,107
39 Pekka Paalanen, Daniel van Vugt, Jonas Ådahl108Contributors:
109 Marco Trevisan (Treviño), Jan Alexander Steffens (heftig),
110 Thomas Hindoe Paaboel Andersen, Benjamin Berg, Cosimo Cecchi, Tim Crawford,
111 Piotr Drąg, Xiang Fan, Olivier Fourdan, Carlos Garnacho, Hans de Goede,
112 Niels De Graef, Christian Hergert, Adam Jackson, Robert Mader,
113 Florian Müllner, Georges Basile Stavracas Neto, Bastien Nocera, Corentin Noël,
114 Pekka Paalanen, Jasper St. Pierre, Christian Rauch, Daniel van Vugt,
115 Jonas Ådahl
40116
41Translators:117Translators:
42 Bruce Cowan [en_GB]118 Bruce Cowan [en_GB]
119
1203.35.1
121======
122* Fix immediate screen blank after releaseing inhibitor [Tim; #573]
123* Respond to frame callbacks regardless of damage [Jonas; !839]
124* selection [Carlos; !842]
125* Fix Night Light on wayland [Jonas; !840]
126* Fix various copy+paste/DND regressions [Carlos; !848, #789, #842,
127 #793, #845, #854]
128* Misc. bug fixes and cleanups [Daniel, Marco, Jonas, Georges;
129 !841, !764, !837, !846]
130
131Contributors:
132 Marco Trevisan (Treviño), Carlos Garnacho, Tim Klocke,
133 Georges Basile Stavracas Neto, Daniel van Vugt, Jonas Ådahl
134
433.34.11353.34.1
44======136======
45* Fix startup of X11 session services on wayland [Carlos; #771]137* Fix startup of X11 session services on wayland [Carlos; #771]
diff --git a/clutter/clutter/cally/cally-actor.c b/clutter/clutter/cally/cally-actor.c
index d97357d..c92b576 100644
--- a/clutter/clutter/cally/cally-actor.c
+++ b/clutter/clutter/cally/cally-actor.c
@@ -310,11 +310,7 @@ cally_actor_finalize (GObject *obj)
310310
311 _cally_actor_clean_action_list (cally_actor);311 _cally_actor_clean_action_list (cally_actor);
312312
313 if (priv->action_idle_handler)313 g_clear_handle_id (&priv->action_idle_handler, g_source_remove);
314 {
315 g_source_remove (priv->action_idle_handler);
316 priv->action_idle_handler = 0;
317 }
318314
319 if (priv->action_queue)315 if (priv->action_queue)
320 {316 {
@@ -657,7 +653,7 @@ cally_actor_get_extents (AtkComponent *component,
657 ClutterActor *actor = NULL;653 ClutterActor *actor = NULL;
658 gint top_level_x, top_level_y;654 gint top_level_x, top_level_y;
659 gfloat f_width, f_height;655 gfloat f_width, f_height;
660 ClutterVertex verts[4];656 graphene_point3d_t verts[4];
661 ClutterActor *stage = NULL;657 ClutterActor *stage = NULL;
662658
663 g_return_if_fail (CALLY_IS_ACTOR (component));659 g_return_if_fail (CALLY_IS_ACTOR (component));
diff --git a/clutter/clutter/cally/cally-text.c b/clutter/clutter/cally/cally-text.c
index 6375a38..2b34f09 100644
--- a/clutter/clutter/cally/cally-text.c
+++ b/clutter/clutter/cally/cally-text.c
@@ -247,11 +247,7 @@ cally_text_finalize (GObject *obj)
247/* g_object_unref (cally_text->priv->textutil); */247/* g_object_unref (cally_text->priv->textutil); */
248/* cally_text->priv->textutil = NULL; */248/* cally_text->priv->textutil = NULL; */
249249
250 if (cally_text->priv->insert_idle_handler)250 g_clear_handle_id (&cally_text->priv->insert_idle_handler, g_source_remove);
251 {
252 g_source_remove (cally_text->priv->insert_idle_handler);
253 cally_text->priv->insert_idle_handler = 0;
254 }
255251
256 G_OBJECT_CLASS (cally_text_parent_class)->finalize (obj);252 G_OBJECT_CLASS (cally_text_parent_class)->finalize (obj);
257}253}
@@ -1438,7 +1434,7 @@ static void cally_text_get_character_extents (AtkText *text,
1438 PangoLayout *layout;1434 PangoLayout *layout;
1439 PangoRectangle extents;1435 PangoRectangle extents;
1440 const gchar *text_value;1436 const gchar *text_value;
1441 ClutterVertex verts[4];1437 graphene_point3d_t verts[4];
14421438
1443 actor = CALLY_GET_CLUTTER_ACTOR (text);1439 actor = CALLY_GET_CLUTTER_ACTOR (text);
1444 if (actor == NULL) /* State is defunct */1440 if (actor == NULL) /* State is defunct */
@@ -2294,7 +2290,7 @@ _cally_misc_get_index_at_point (ClutterText *clutter_text,
2294 gint index, x_window, y_window, x_toplevel, y_toplevel;2290 gint index, x_window, y_window, x_toplevel, y_toplevel;
2295 gint x_temp, y_temp;2291 gint x_temp, y_temp;
2296 gboolean ret;2292 gboolean ret;
2297 ClutterVertex verts[4];2293 graphene_point3d_t verts[4];
2298 PangoLayout *layout;2294 PangoLayout *layout;
2299 gint x_layout, y_layout;2295 gint x_layout, y_layout;
23002296
diff --git a/clutter/clutter/cally/cally-texture.c b/clutter/clutter/cally/cally-texture.c
2301deleted file mode 1006442297deleted file mode 100644
index e7df619..0000000
--- a/clutter/clutter/cally/cally-texture.c
+++ /dev/null
@@ -1,98 +0,0 @@
1/* CALLY - The Clutter Accessibility Implementation Library
2 *
3 * Copyright (C) 2009 Igalia, S.L.
4 *
5 * Author: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
21 */
22
23/**
24 * SECTION:cally-texture
25 * @Title: CallyTexture
26 * @short_description: Implementation of the ATK interfaces for a #ClutterTexture
27 * @see_also: #ClutterTexture
28 *
29 * #CallyTexture implements the required ATK interfaces of #ClutterTexture
30 *
31 * In particular it sets a proper role for the texture.
32 */
33#include "clutter-build-config.h"
34
35#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
36
37#include "cally-texture.h"
38#include "cally-actor-private.h"
39
40#include "deprecated/clutter-texture.h"
41
42/* AtkObject */
43static void cally_texture_real_initialize (AtkObject *obj,
44 gpointer data);
45
46G_DEFINE_TYPE (CallyTexture, cally_texture, CALLY_TYPE_ACTOR)
47
48static void
49cally_texture_class_init (CallyTextureClass *klass)
50{
51/* GObjectClass *gobject_class = G_OBJECT_CLASS (klass); */
52 AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
53
54 class->initialize = cally_texture_real_initialize;
55}
56
57static void
58cally_texture_init (CallyTexture *texture)
59{
60 /* nothing to do yet */
61}
62
63/**
64 * cally_texture_new:
65 * @actor: a #ClutterActor
66 *
67 * Creates a new #CallyTexture for the given @actor. @actor must be
68 * a #ClutterTexture.
69 *
70 * Return value: the newly created #AtkObject
71 *
72 * Since: 1.4
73 */
74AtkObject*
75cally_texture_new (ClutterActor *actor)
76{
77 GObject *object = NULL;
78 AtkObject *accessible = NULL;
79
80 g_return_val_if_fail (CLUTTER_IS_TEXTURE (actor), NULL);
81
82 object = g_object_new (CALLY_TYPE_TEXTURE, NULL);
83
84 accessible = ATK_OBJECT (object);
85 atk_object_initialize (accessible, actor);
86
87 return accessible;
88}
89
90static void
91cally_texture_real_initialize (AtkObject *obj,
92 gpointer data)
93{
94 ATK_OBJECT_CLASS (cally_texture_parent_class)->initialize (obj, data);
95
96 /* default role */
97 obj->role = ATK_ROLE_IMAGE;
98}
diff --git a/clutter/clutter/cally/cally-texture.h b/clutter/clutter/cally/cally-texture.h
99deleted file mode 1006440deleted file mode 100644
index 909a533..0000000
--- a/clutter/clutter/cally/cally-texture.h
+++ /dev/null
@@ -1,84 +0,0 @@
1/* CALLY - The Clutter Accessibility Implementation Library
2 *
3 * Copyright (C) 2009 Igalia, S.L.
4 *
5 * Author: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef __CALLY_TEXTURE_H__
22#define __CALLY_TEXTURE_H__
23
24#if !defined(__CALLY_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
25#error "Only <cally/cally.h> can be included directly."
26#endif
27
28#include <clutter/clutter.h>
29#include <cally/cally-actor.h>
30
31G_BEGIN_DECLS
32
33#define CALLY_TYPE_TEXTURE (cally_texture_get_type ())
34#define CALLY_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALLY_TYPE_TEXTURE, CallyTexture))
35#define CALLY_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CALLY_TYPE_TEXTURE, CallyTextureClass))
36#define CALLY_IS_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CALLY_TYPE_TEXTURE))
37#define CALLY_IS_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CALLY_TYPE_TEXTURE))
38#define CALLY_TEXTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CALLY_TYPE_TEXTURE, CallyTextureClass))
39
40typedef struct _CallyTexture CallyTexture;
41typedef struct _CallyTextureClass CallyTextureClass;
42typedef struct _CallyTexturePrivate CallyTexturePrivate;
43
44/**
45 * CallyTexture:
46 *
47 * The <structname>CallyTexture</structname> structure contains only
48 * private data and should be accessed using the provided API
49 *
50 * Since: 1.4
51 */
52struct _CallyTexture
53{
54 /*< private >*/
55 CallyActor parent;
56
57 CallyTexturePrivate *priv;
58};
59
60/**
61 * CallyTextureClass:
62 *
63 * The <structname>CallyTextureClass</structname> structure contains
64 * only private data
65 *
66 * Since: 1.4
67 */
68struct _CallyTextureClass
69{
70 /*< private >*/
71 CallyActorClass parent_class;
72
73 /* padding for future expansion */
74 gpointer _padding_dummy[8];
75};
76
77CLUTTER_EXPORT
78GType cally_texture_get_type (void) G_GNUC_CONST;
79CLUTTER_EXPORT
80AtkObject *cally_texture_new (ClutterActor *actor);
81
82G_END_DECLS
83
84#endif /* __CALLY_TEXTURE_H__ */
diff --git a/clutter/clutter/cally/cally.c b/clutter/clutter/cally/cally.c
index 4e1b79a..8b92682 100644
--- a/clutter/clutter/cally/cally.c
+++ b/clutter/clutter/cally/cally.c
@@ -39,7 +39,6 @@
39#include "cally-group.h"39#include "cally-group.h"
40#include "cally-stage.h"40#include "cally-stage.h"
41#include "cally-text.h"41#include "cally-text.h"
42#include "cally-texture.h"
43#include "cally-rectangle.h"42#include "cally-rectangle.h"
44#include "cally-clone.h"43#include "cally-clone.h"
4544
@@ -56,7 +55,6 @@ CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_ACTOR, cally_actor, cally_actor_new)
56CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_GROUP, cally_group, cally_group_new)55CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_GROUP, cally_group, cally_group_new)
57CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_STAGE, cally_stage, cally_stage_new)56CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_STAGE, cally_stage, cally_stage_new)
58CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_TEXT, cally_text, cally_text_new)57CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_TEXT, cally_text, cally_text_new)
59CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_TEXTURE, cally_texture, cally_texture_new)
60CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_RECTANGLE, cally_rectangle, cally_rectangle_new)58CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_RECTANGLE, cally_rectangle, cally_rectangle_new)
61CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_CLONE, cally_clone, cally_clone_new)59CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_CLONE, cally_clone, cally_clone_new)
6260
@@ -78,7 +76,6 @@ cally_accessibility_init (void)
78 CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_GROUP, cally_group);76 CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_GROUP, cally_group);
79 CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_STAGE, cally_stage);77 CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_STAGE, cally_stage);
80 CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_TEXT, cally_text);78 CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_TEXT, cally_text);
81 CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_TEXTURE, cally_texture);
82 CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_RECTANGLE, cally_rectangle);79 CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_RECTANGLE, cally_rectangle);
83 CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_CLONE, cally_clone);80 CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_CLONE, cally_clone);
8481
diff --git a/clutter/clutter/cally/cally.h b/clutter/clutter/cally/cally.h
index 11fa9fc..440c30b 100644
--- a/clutter/clutter/cally/cally.h
+++ b/clutter/clutter/cally/cally.h
@@ -32,7 +32,6 @@
32#include "cally-root.h"32#include "cally-root.h"
33#include "cally-stage.h"33#include "cally-stage.h"
34#include "cally-text.h"34#include "cally-text.h"
35#include "cally-texture.h"
36#include "cally-util.h"35#include "cally-util.h"
3736
38#undef __CALLY_H_INSIDE__37#undef __CALLY_H_INSIDE__
diff --git a/clutter/clutter/clutter-actor-box.c b/clutter/clutter/clutter-actor-box.c
index 6871274..a2308ac 100644
--- a/clutter/clutter/clutter-actor-box.c
+++ b/clutter/clutter/clutter-actor-box.c
@@ -340,7 +340,7 @@ clutter_actor_box_contains (const ClutterActorBox *box,
340/**340/**
341 * clutter_actor_box_from_vertices:341 * clutter_actor_box_from_vertices:
342 * @box: a #ClutterActorBox342 * @box: a #ClutterActorBox
343 * @verts: (array fixed-size=4): array of four #ClutterVertex343 * @verts: (array fixed-size=4): array of four #graphene_point3d_t
344 *344 *
345 * Calculates the bounding box represented by the four vertices; for details345 * Calculates the bounding box represented by the four vertices; for details
346 * of the vertex array see clutter_actor_get_abs_allocation_vertices().346 * of the vertex array see clutter_actor_get_abs_allocation_vertices().
@@ -348,8 +348,8 @@ clutter_actor_box_contains (const ClutterActorBox *box,
348 * Since: 1.0348 * Since: 1.0
349 */349 */
350void350void
351clutter_actor_box_from_vertices (ClutterActorBox *box,351clutter_actor_box_from_vertices (ClutterActorBox *box,
352 const ClutterVertex verts[])352 const graphene_point3d_t verts[])
353{353{
354 gfloat x_1, x_2, y_1, y_2;354 gfloat x_1, x_2, y_1, y_2;
355355
diff --git a/clutter/clutter/clutter-actor-meta.c b/clutter/clutter/clutter-actor-meta.c
index d7f4fd7..eba0985 100644
--- a/clutter/clutter/clutter-actor-meta.c
+++ b/clutter/clutter/clutter-actor-meta.c
@@ -51,7 +51,7 @@
51struct _ClutterActorMetaPrivate51struct _ClutterActorMetaPrivate
52{52{
53 ClutterActor *actor;53 ClutterActor *actor;
54 guint destroy_id;54 gulong destroy_id;
5555
56 gchar *name;56 gchar *name;
5757
@@ -91,11 +91,7 @@ clutter_actor_meta_real_set_actor (ClutterActorMeta *meta,
91 if (meta->priv->actor == actor)91 if (meta->priv->actor == actor)
92 return;92 return;
9393
94 if (meta->priv->destroy_id != 0)94 g_clear_signal_handler (&meta->priv->destroy_id, meta->priv->actor);
95 {
96 g_signal_handler_disconnect (meta->priv->actor, meta->priv->destroy_id);
97 meta->priv->destroy_id = 0;
98 }
9995
100 meta->priv->actor = actor;96 meta->priv->actor = actor;
10197
@@ -162,8 +158,8 @@ clutter_actor_meta_finalize (GObject *gobject)
162{158{
163 ClutterActorMetaPrivate *priv = CLUTTER_ACTOR_META (gobject)->priv;159 ClutterActorMetaPrivate *priv = CLUTTER_ACTOR_META (gobject)->priv;
164160
165 if (priv->destroy_id != 0 && priv->actor != NULL)161 if (priv->actor != NULL)
166 g_signal_handler_disconnect (priv->actor, priv->destroy_id);162 g_clear_signal_handler (&priv->destroy_id, priv->actor);
167163
168 g_free (priv->name);164 g_free (priv->name);
169165
diff --git a/clutter/clutter/clutter-actor-private.h b/clutter/clutter/clutter-actor-private.h
index fa2d4c3..9ff4b2d 100644
--- a/clutter/clutter/clutter-actor-private.h
+++ b/clutter/clutter/clutter-actor-private.h
@@ -135,7 +135,7 @@ struct _AnchorCoord
135 } fraction;135 } fraction;
136136
137 /* Use when is_fractional == FALSE */137 /* Use when is_fractional == FALSE */
138 ClutterVertex units;138 graphene_point3d_t units;
139 } v;139 } v;
140};140};
141141
@@ -163,7 +163,7 @@ struct _SizeRequest
163struct _ClutterLayoutInfo163struct _ClutterLayoutInfo
164{164{
165 /* fixed position coordinates */165 /* fixed position coordinates */
166 ClutterPoint fixed_pos;166 graphene_point_t fixed_pos;
167167
168 ClutterMargin margin;168 ClutterMargin margin;
169169
@@ -173,8 +173,8 @@ struct _ClutterLayoutInfo
173 guint x_expand : 1;173 guint x_expand : 1;
174 guint y_expand : 1;174 guint y_expand : 1;
175175
176 ClutterSize minimum;176 graphene_size_t minimum;
177 ClutterSize natural;177 graphene_size_t natural;
178};178};
179179
180const ClutterLayoutInfo * _clutter_actor_get_layout_info_or_defaults (ClutterActor *self);180const ClutterLayoutInfo * _clutter_actor_get_layout_info_or_defaults (ClutterActor *self);
@@ -203,13 +203,13 @@ struct _ClutterTransformInfo
203 AnchorCoord anchor;203 AnchorCoord anchor;
204204
205 /* translation */205 /* translation */
206 ClutterVertex translation;206 graphene_point3d_t translation;
207207
208 /* z_position */208 /* z_position */
209 gfloat z_position;209 gfloat z_position;
210210
211 /* transformation center */211 /* transformation center */
212 ClutterPoint pivot;212 graphene_point_t pivot;
213 gfloat pivot_z;213 gfloat pivot_z;
214214
215 CoglMatrix transform;215 CoglMatrix transform;
@@ -315,7 +315,6 @@ void _clutter_actor_queue_relayout_on_clones
315void _clutter_actor_queue_only_relayout (ClutterActor *actor);315void _clutter_actor_queue_only_relayout (ClutterActor *actor);
316void _clutter_actor_queue_update_resource_scale_recursive (ClutterActor *actor);316void _clutter_actor_queue_update_resource_scale_recursive (ClutterActor *actor);
317317
318CoglFramebuffer * _clutter_actor_get_active_framebuffer (ClutterActor *actor);
319gboolean _clutter_actor_get_real_resource_scale (ClutterActor *actor,318gboolean _clutter_actor_get_real_resource_scale (ClutterActor *actor,
320 float *resource_scale);319 float *resource_scale);
321320
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index ecf9a59..610741a 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -643,6 +643,7 @@
643#include "clutter-main.h"643#include "clutter-main.h"
644#include "clutter-marshal.h"644#include "clutter-marshal.h"
645#include "clutter-mutter.h"645#include "clutter-mutter.h"
646#include "clutter-paint-context-private.h"
646#include "clutter-paint-nodes.h"647#include "clutter-paint-nodes.h"
647#include "clutter-paint-node-private.h"648#include "clutter-paint-node-private.h"
648#include "clutter-paint-volume-private.h"649#include "clutter-paint-volume-private.h"
@@ -656,7 +657,6 @@
656#include "clutter-units.h"657#include "clutter-units.h"
657658
658#include "deprecated/clutter-actor.h"659#include "deprecated/clutter-actor.h"
659#include "deprecated/clutter-behaviour.h"
660#include "deprecated/clutter-container.h"660#include "deprecated/clutter-container.h"
661661
662/* Internal enum used to control mapped state update. This is a hint662/* Internal enum used to control mapped state update. This is a hint
@@ -701,7 +701,7 @@ struct _ClutterActorPrivate
701 ClutterAllocationFlags allocation_flags;701 ClutterAllocationFlags allocation_flags;
702702
703 /* clip, in actor coordinates */703 /* clip, in actor coordinates */
704 ClutterRect clip;704 graphene_rect_t clip;
705705
706 /* the cached transformation matrix; see apply_transform() */706 /* the cached transformation matrix; see apply_transform() */
707 CoglMatrix transform;707 CoglMatrix transform;
@@ -746,9 +746,6 @@ struct _ClutterActorPrivate
746 */746 */
747 ClutterTextDirection text_direction;747 ClutterTextDirection text_direction;
748748
749 /* a counter used to toggle the CLUTTER_INTERNAL_CHILD flag */
750 gint internal_child;
751
752 /* meta classes */749 /* meta classes */
753 ClutterMetaGroup *actions;750 ClutterMetaGroup *actions;
754 ClutterMetaGroup *constraints;751 ClutterMetaGroup *constraints;
@@ -812,8 +809,8 @@ struct _ClutterActorPrivate
812 gpointer create_child_data;809 gpointer create_child_data;
813 GDestroyNotify create_child_notify;810 GDestroyNotify create_child_notify;
814811
815 guint resolution_changed_id;812 gulong resolution_changed_id;
816 guint font_changed_id;813 gulong font_changed_id;
817814
818 /* bitfields: KEEP AT THE END */815 /* bitfields: KEEP AT THE END */
819816
@@ -905,7 +902,6 @@ enum
905 PROP_DEPTH, /* XXX:2.0 remove */902 PROP_DEPTH, /* XXX:2.0 remove */
906 PROP_Z_POSITION,903 PROP_Z_POSITION,
907904
908 PROP_CLIP, /* XXX:2.0 remove */
909 PROP_CLIP_RECT,905 PROP_CLIP_RECT,
910 PROP_HAS_CLIP,906 PROP_HAS_CLIP,
911 PROP_CLIP_TO_ALLOCATION,907 PROP_CLIP_TO_ALLOCATION,
@@ -1291,10 +1287,12 @@ clutter_actor_verify_map_state (ClutterActor *self)
1291static gboolean1287static gboolean
1292_clutter_actor_transform_local_box_to_stage (ClutterActor *self,1288_clutter_actor_transform_local_box_to_stage (ClutterActor *self,
1293 ClutterStage *stage,1289 ClutterStage *stage,
1290 ClutterPickContext *pick_context,
1294 const ClutterActorBox *box,1291 const ClutterActorBox *box,
1295 ClutterPoint vertices[4])1292 graphene_point_t vertices[4])
1296{1293{
1297 CoglFramebuffer *fb = cogl_get_draw_framebuffer ();1294 CoglFramebuffer *fb =
1295 clutter_pick_context_get_framebuffer (pick_context);
1298 CoglMatrix stage_transform, inv_stage_transform;1296 CoglMatrix stage_transform, inv_stage_transform;
1299 CoglMatrix modelview, transform_to_stage;1297 CoglMatrix modelview, transform_to_stage;
1300 int v;1298 int v;
@@ -1335,6 +1333,7 @@ _clutter_actor_transform_local_box_to_stage (ClutterActor *self,
1335/**1333/**
1336 * clutter_actor_pick_box:1334 * clutter_actor_pick_box:
1337 * @self: The #ClutterActor being "pick" painted.1335 * @self: The #ClutterActor being "pick" painted.
1336 * @pick_context: The #ClutterPickContext
1338 * @box: A rectangle in the actor's own local coordinates.1337 * @box: A rectangle in the actor's own local coordinates.
1339 *1338 *
1340 * Logs (does a virtual paint of) a rectangle for picking. Note that @box is1339 * Logs (does a virtual paint of) a rectangle for picking. Note that @box is
@@ -1345,10 +1344,11 @@ _clutter_actor_transform_local_box_to_stage (ClutterActor *self,
1345 */1344 */
1346void1345void
1347clutter_actor_pick_box (ClutterActor *self,1346clutter_actor_pick_box (ClutterActor *self,
1347 ClutterPickContext *pick_context,
1348 const ClutterActorBox *box)1348 const ClutterActorBox *box)
1349{1349{
1350 ClutterStage *stage;1350 ClutterStage *stage;
1351 ClutterPoint vertices[4];1351 graphene_point_t vertices[4];
13521352
1353 g_return_if_fail (CLUTTER_IS_ACTOR (self));1353 g_return_if_fail (CLUTTER_IS_ACTOR (self));
1354 g_return_if_fail (box != NULL);1354 g_return_if_fail (box != NULL);
@@ -1358,20 +1358,23 @@ clutter_actor_pick_box (ClutterActor *self,
13581358
1359 stage = CLUTTER_STAGE (_clutter_actor_get_stage_internal (self));1359 stage = CLUTTER_STAGE (_clutter_actor_get_stage_internal (self));
13601360
1361 if (_clutter_actor_transform_local_box_to_stage (self, stage, box, vertices))1361 if (_clutter_actor_transform_local_box_to_stage (self, stage, pick_context,
1362 box, vertices))
1362 clutter_stage_log_pick (stage, vertices, self);1363 clutter_stage_log_pick (stage, vertices, self);
1363}1364}
13641365
1365static gboolean1366static gboolean
1366_clutter_actor_push_pick_clip (ClutterActor *self,1367_clutter_actor_push_pick_clip (ClutterActor *self,
1368 ClutterPickContext *pick_context,
1367 const ClutterActorBox *clip)1369 const ClutterActorBox *clip)
1368{1370{
1369 ClutterStage *stage;1371 ClutterStage *stage;
1370 ClutterPoint vertices[4];1372 graphene_point_t vertices[4];
13711373
1372 stage = CLUTTER_STAGE (_clutter_actor_get_stage_internal (self));1374 stage = CLUTTER_STAGE (_clutter_actor_get_stage_internal (self));
13731375
1374 if (!_clutter_actor_transform_local_box_to_stage (self, stage, clip, vertices))1376 if (!_clutter_actor_transform_local_box_to_stage (self, stage, pick_context,
1377 clip, vertices))
1375 return FALSE;1378 return FALSE;
13761379
1377 clutter_stage_push_pick_clip (stage, vertices);1380 clutter_stage_push_pick_clip (stage, vertices);
@@ -1776,6 +1779,15 @@ clutter_actor_unmap (ClutterActor *self)
1776}1779}
17771780
1778static void1781static void
1782clutter_actor_queue_shallow_relayout (ClutterActor *self)
1783{
1784 ClutterActor *stage = _clutter_actor_get_stage_internal (self);
1785
1786 if (stage != NULL)
1787 clutter_stage_queue_actor_relayout (CLUTTER_STAGE (stage), self);
1788}
1789
1790static void
1779clutter_actor_real_show (ClutterActor *self)1791clutter_actor_real_show (ClutterActor *self)
1780{1792{
1781 ClutterActorPrivate *priv = self->priv;1793 ClutterActorPrivate *priv = self->priv;
@@ -1808,6 +1820,11 @@ clutter_actor_real_show (ClutterActor *self)
18081820
1809 clutter_actor_queue_relayout (self);1821 clutter_actor_queue_relayout (self);
1810 }1822 }
1823 else /* but still don't leave the actor un-allocated before showing it */
1824 {
1825 clutter_actor_queue_shallow_relayout (self);
1826 clutter_actor_queue_redraw (self);
1827 }
1811}1828}
18121829
1813static inline void1830static inline void
@@ -2034,29 +2051,6 @@ clutter_actor_hide (ClutterActor *self)
2034}2051}
20352052
2036/**2053/**
2037 * clutter_actor_hide_all:
2038 * @self: a #ClutterActor
2039 *
2040 * Calls clutter_actor_hide() on all child actors (if any).
2041 *
2042 * Since: 0.2
2043 *
2044 * Deprecated: 1.10: Using clutter_actor_hide() on the actor will
2045 * prevent its children from being painted as well.
2046 */
2047void
2048clutter_actor_hide_all (ClutterActor *self)
2049{
2050 ClutterActorClass *klass;
2051
2052 g_return_if_fail (CLUTTER_IS_ACTOR (self));
2053
2054 klass = CLUTTER_ACTOR_GET_CLASS (self);
2055 if (klass->hide_all)
2056 klass->hide_all (self);
2057}
2058
2059/**
2060 * clutter_actor_realize:2054 * clutter_actor_realize:
2061 * @self: A #ClutterActor2055 * @self: A #ClutterActor
2062 *2056 *
@@ -2350,7 +2344,7 @@ _clutter_actor_rerealize (ClutterActor *self,
23502344
2351static void2345static void
2352clutter_actor_real_pick (ClutterActor *self,2346clutter_actor_real_pick (ClutterActor *self,
2353 const ClutterColor *color)2347 ClutterPickContext *pick_context)
2354{2348{
2355 if (clutter_actor_should_pick_paint (self))2349 if (clutter_actor_should_pick_paint (self))
2356 {2350 {
@@ -2361,7 +2355,7 @@ clutter_actor_real_pick (ClutterActor *self,
2361 .y2 = clutter_actor_get_height (self),2355 .y2 = clutter_actor_get_height (self),
2362 };2356 };
23632357
2364 clutter_actor_pick_box (self, &box);2358 clutter_actor_pick_box (self, pick_context, &box);
2365 }2359 }
23662360
2367 /* XXX - this thoroughly sucks, but we need to maintain compatibility2361 /* XXX - this thoroughly sucks, but we need to maintain compatibility
@@ -2378,7 +2372,7 @@ clutter_actor_real_pick (ClutterActor *self,
2378 for (iter = self->priv->first_child;2372 for (iter = self->priv->first_child;
2379 iter != NULL;2373 iter != NULL;
2380 iter = iter->priv->next_sibling)2374 iter = iter->priv->next_sibling)
2381 clutter_actor_paint (iter);2375 clutter_actor_pick (iter, pick_context);
2382 }2376 }
2383}2377}
23842378
@@ -2884,9 +2878,23 @@ clutter_actor_real_queue_relayout (ClutterActor *self)
2884 memset (priv->height_requests, 0,2878 memset (priv->height_requests, 0,
2885 N_CACHED_SIZE_REQUESTS * sizeof (SizeRequest));2879 N_CACHED_SIZE_REQUESTS * sizeof (SizeRequest));
28862880
2887 /* We need to go all the way up the hierarchy */2881 /* We may need to go all the way up the hierarchy */
2888 if (priv->parent != NULL)2882 if (priv->parent != NULL)
2889 _clutter_actor_queue_only_relayout (priv->parent);2883 {
2884 if (priv->parent->flags & CLUTTER_ACTOR_NO_LAYOUT)
2885 {
2886 clutter_actor_queue_shallow_relayout (self);
2887
2888 /* The above might have invalidated the parent's paint volume if self
2889 * has moved or resized. DnD seems to require this...
2890 */
2891 priv->parent->priv->needs_paint_volume_update = TRUE;
2892 }
2893 else
2894 {
2895 _clutter_actor_queue_only_relayout (priv->parent);
2896 }
2897 }
2890}2898}
28912899
2892/**2900/**
@@ -2894,8 +2902,8 @@ clutter_actor_real_queue_relayout (ClutterActor *self)
2894 * @self: A #ClutterActor2902 * @self: A #ClutterActor
2895 * @ancestor: (allow-none): A #ClutterActor ancestor, or %NULL to use the2903 * @ancestor: (allow-none): A #ClutterActor ancestor, or %NULL to use the
2896 * default #ClutterStage2904 * default #ClutterStage
2897 * @point: A point as #ClutterVertex2905 * @point: A point as #graphene_point3d_t
2898 * @vertex: (out caller-allocates): The translated #ClutterVertex2906 * @vertex: (out caller-allocates): The translated #graphene_point3d_t
2899 *2907 *
2900 * Transforms @point in coordinates relative to the actor into2908 * Transforms @point in coordinates relative to the actor into
2901 * ancestor-relative coordinates using the relevant transform2909 * ancestor-relative coordinates using the relevant transform
@@ -2909,10 +2917,10 @@ clutter_actor_real_queue_relayout (ClutterActor *self)
2909 * Since: 0.62917 * Since: 0.6
2910 */2918 */
2911void2919void
2912clutter_actor_apply_relative_transform_to_point (ClutterActor *self,2920clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
2913 ClutterActor *ancestor,2921 ClutterActor *ancestor,
2914 const ClutterVertex *point,2922 const graphene_point3d_t *point,
2915 ClutterVertex *vertex)2923 graphene_point3d_t *vertex)
2916{2924{
2917 gfloat w;2925 gfloat w;
2918 CoglMatrix matrix;2926 CoglMatrix matrix;
@@ -2939,10 +2947,10 @@ clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
2939}2947}
29402948
2941static gboolean2949static gboolean
2942_clutter_actor_fully_transform_vertices (ClutterActor *self,2950_clutter_actor_fully_transform_vertices (ClutterActor *self,
2943 const ClutterVertex *vertices_in,2951 const graphene_point3d_t *vertices_in,
2944 ClutterVertex *vertices_out,2952 graphene_point3d_t *vertices_out,
2945 int n_vertices)2953 int n_vertices)
2946{2954{
2947 ClutterActor *stage;2955 ClutterActor *stage;
2948 CoglMatrix modelview;2956 CoglMatrix modelview;
@@ -2984,8 +2992,8 @@ _clutter_actor_fully_transform_vertices (ClutterActor *self,
2984/**2992/**
2985 * clutter_actor_apply_transform_to_point:2993 * clutter_actor_apply_transform_to_point:
2986 * @self: A #ClutterActor2994 * @self: A #ClutterActor
2987 * @point: A point as #ClutterVertex2995 * @point: A point as #graphene_point3d_t
2988 * @vertex: (out caller-allocates): The translated #ClutterVertex2996 * @vertex: (out caller-allocates): The translated #graphene_point3d_t
2989 *2997 *
2990 * Transforms @point in coordinates relative to the actor2998 * Transforms @point in coordinates relative to the actor
2991 * into screen-relative coordinates with the current actor2999 * into screen-relative coordinates with the current actor
@@ -2994,9 +3002,9 @@ _clutter_actor_fully_transform_vertices (ClutterActor *self,
2994 * Since: 0.43002 * Since: 0.4
2995 **/3003 **/
2996void3004void
2997clutter_actor_apply_transform_to_point (ClutterActor *self,3005clutter_actor_apply_transform_to_point (ClutterActor *self,
2998 const ClutterVertex *point,3006 const graphene_point3d_t *point,
2999 ClutterVertex *vertex)3007 graphene_point3d_t *vertex)
3000{3008{
3001 g_return_if_fail (point != NULL);3009 g_return_if_fail (point != NULL);
3002 g_return_if_fail (vertex != NULL);3010 g_return_if_fail (vertex != NULL);
@@ -3046,10 +3054,10 @@ _clutter_actor_get_relative_transformation_matrix (ClutterActor *self,
3046 * transformed vertices to @verts[]. */3054 * transformed vertices to @verts[]. */
3047static gboolean3055static gboolean
3048_clutter_actor_transform_and_project_box (ClutterActor *self,3056_clutter_actor_transform_and_project_box (ClutterActor *self,
3049 const ClutterActorBox *box,3057 const ClutterActorBox *box,
3050 ClutterVertex verts[])3058 graphene_point3d_t *verts)
3051{3059{
3052 ClutterVertex box_vertices[4];3060 graphene_point3d_t box_vertices[4];
30533061
3054 box_vertices[0].x = box->x1;3062 box_vertices[0].x = box->x1;
3055 box_vertices[0].y = box->y1;3063 box_vertices[0].y = box->y1;
@@ -3073,8 +3081,8 @@ _clutter_actor_transform_and_project_box (ClutterActor *self,
3073 * @self: A #ClutterActor3081 * @self: A #ClutterActor
3074 * @ancestor: (allow-none): A #ClutterActor to calculate the vertices3082 * @ancestor: (allow-none): A #ClutterActor to calculate the vertices
3075 * against, or %NULL to use the #ClutterStage3083 * against, or %NULL to use the #ClutterStage
3076 * @verts: (out) (array fixed-size=4) (element-type Clutter.Vertex): return3084 * @verts: (out) (array fixed-size=4): return
3077 * location for an array of 4 #ClutterVertex in which to store the result3085 * location for an array of 4 #graphene_point3d_t in which to store the result
3078 *3086 *
3079 * Calculates the transformed coordinates of the four corners of the3087 * Calculates the transformed coordinates of the four corners of the
3080 * actor in the plane of @ancestor. The returned vertices relate to3088 * actor in the plane of @ancestor. The returned vertices relate to
@@ -3093,13 +3101,13 @@ _clutter_actor_transform_and_project_box (ClutterActor *self,
3093 * Since: 0.63101 * Since: 0.6
3094 */3102 */
3095void3103void
3096clutter_actor_get_allocation_vertices (ClutterActor *self,3104clutter_actor_get_allocation_vertices (ClutterActor *self,
3097 ClutterActor *ancestor,3105 ClutterActor *ancestor,
3098 ClutterVertex verts[])3106 graphene_point3d_t *verts)
3099{3107{
3100 ClutterActorPrivate *priv;3108 ClutterActorPrivate *priv;
3101 ClutterActorBox box;3109 ClutterActorBox box;
3102 ClutterVertex vertices[4];3110 graphene_point3d_t vertices[4];
3103 CoglMatrix modelview;3111 CoglMatrix modelview;
31043112
3105 g_return_if_fail (CLUTTER_IS_ACTOR (self));3113 g_return_if_fail (CLUTTER_IS_ACTOR (self));
@@ -3151,9 +3159,9 @@ clutter_actor_get_allocation_vertices (ClutterActor *self,
31513159
3152 cogl_matrix_transform_points (&modelview,3160 cogl_matrix_transform_points (&modelview,
3153 3,3161 3,
3154 sizeof (ClutterVertex),3162 sizeof (graphene_point3d_t),
3155 vertices,3163 vertices,
3156 sizeof (ClutterVertex),3164 sizeof (graphene_point3d_t),
3157 vertices,3165 vertices,
3158 4);3166 4);
3159}3167}
@@ -3162,7 +3170,7 @@ clutter_actor_get_allocation_vertices (ClutterActor *self,
3162 * clutter_actor_get_abs_allocation_vertices:3170 * clutter_actor_get_abs_allocation_vertices:
3163 * @self: A #ClutterActor3171 * @self: A #ClutterActor
3164 * @verts: (out) (array fixed-size=4): Pointer to a location of an array3172 * @verts: (out) (array fixed-size=4): Pointer to a location of an array
3165 * of 4 #ClutterVertex where to store the result.3173 * of 4 #graphene_point3d_t where to store the result.
3166 *3174 *
3167 * Calculates the transformed screen coordinates of the four corners of3175 * Calculates the transformed screen coordinates of the four corners of
3168 * the actor; the returned vertices relate to the #ClutterActorBox3176 * the actor; the returned vertices relate to the #ClutterActorBox
@@ -3176,8 +3184,8 @@ clutter_actor_get_allocation_vertices (ClutterActor *self,
3176 * Since: 0.43184 * Since: 0.4
3177 */3185 */
3178void3186void
3179clutter_actor_get_abs_allocation_vertices (ClutterActor *self,3187clutter_actor_get_abs_allocation_vertices (ClutterActor *self,
3180 ClutterVertex verts[])3188 graphene_point3d_t *verts)
3181{3189{
3182 ClutterActorPrivate *priv;3190 ClutterActorPrivate *priv;
3183 ClutterActorBox actor_space_allocation;3191 ClutterActorBox actor_space_allocation;
@@ -3411,20 +3419,20 @@ _clutter_actor_apply_relative_transformation_matrix (ClutterActor *self,
3411}3419}
34123420
3413static void3421static void
3414_clutter_actor_draw_paint_volume_full (ClutterActor *self,3422_clutter_actor_draw_paint_volume_full (ClutterActor *self,
3415 ClutterPaintVolume *pv,3423 ClutterPaintVolume *pv,
3416 const char *label,3424 const char *label,
3417 const CoglColor *color)3425 const ClutterColor *color,
3426 ClutterPaintNode *node)
3418{3427{
3428 g_autoptr (ClutterPaintNode) pipeline_node = NULL;
3419 static CoglPipeline *outline = NULL;3429 static CoglPipeline *outline = NULL;
3420 CoglPrimitive *prim;3430 CoglPrimitive *prim;
3421 ClutterVertex line_ends[12 * 2];3431 graphene_point3d_t line_ends[12 * 2];
3422 int n_vertices;3432 int n_vertices;
3423 CoglContext *ctx =3433 CoglContext *ctx =
3424 clutter_backend_get_cogl_context (clutter_get_default_backend ());3434 clutter_backend_get_cogl_context (clutter_get_default_backend ());
3425 /* XXX: at some point we'll query this from the stage but we can't3435 CoglColor cogl_color;
3426 * do that until the osx backend uses Cogl natively. */
3427 CoglFramebuffer *fb = cogl_get_draw_framebuffer ();
34283436
3429 if (outline == NULL)3437 if (outline == NULL)
3430 outline = cogl_pipeline_new (ctx);3438 outline = cogl_pipeline_new (ctx);
@@ -3458,29 +3466,50 @@ _clutter_actor_draw_paint_volume_full (ClutterActor *self,
3458 n_vertices,3466 n_vertices,
3459 (CoglVertexP3 *)line_ends);3467 (CoglVertexP3 *)line_ends);
34603468
3461 cogl_pipeline_set_color (outline, color);3469 cogl_color_init_from_4ub (&cogl_color,
3462 cogl_framebuffer_draw_primitive (fb, outline, prim);3470 color->red,
3471 color->green,
3472 color->blue,
3473 color->alpha);
3474 cogl_pipeline_set_color (outline, &cogl_color);
3475
3476 pipeline_node = clutter_pipeline_node_new (outline);
3477 clutter_paint_node_set_name (pipeline_node,
3478 "ClutterActor (paint volume outline)");
3479 clutter_paint_node_add_primitive (pipeline_node, prim);
3480 clutter_paint_node_add_child (node, pipeline_node);
3463 cogl_object_unref (prim);3481 cogl_object_unref (prim);
34643482
3465 if (label)3483 if (label)
3466 {3484 {
3485 g_autoptr (ClutterPaintNode) text_node = NULL;
3467 PangoLayout *layout;3486 PangoLayout *layout;
3487
3468 layout = pango_layout_new (clutter_actor_get_pango_context (self));3488 layout = pango_layout_new (clutter_actor_get_pango_context (self));
3469 pango_layout_set_text (layout, label, -1);3489 pango_layout_set_text (layout, label, -1);
3470 cogl_pango_render_layout (layout,3490
3471 pv->vertices[0].x,3491 text_node = clutter_text_node_new (layout, color);
3472 pv->vertices[0].y,3492 clutter_paint_node_set_name (text_node,
3473 color,3493 "ClutterActor (paint volume label)");
3474 0);3494 clutter_paint_node_add_rectangle (text_node,
3495 &(ClutterActorBox) {
3496 .x1 = pv->vertices[0].x,
3497 .y1 = pv->vertices[0].y,
3498 .x2 = pv->vertices[2].x,
3499 .y2 = pv->vertices[2].y,
3500 });
3501 clutter_paint_node_add_child (node, text_node);
3502
3475 g_object_unref (layout);3503 g_object_unref (layout);
3476 }3504 }
3477}3505}
34783506
3479static void3507static void
3480_clutter_actor_draw_paint_volume (ClutterActor *self)3508_clutter_actor_draw_paint_volume (ClutterActor *self,
3509 ClutterPaintNode *node)
3481{3510{
3482 ClutterPaintVolume *pv;3511 ClutterPaintVolume *pv;
3483 CoglColor color;3512 ClutterColor color;
34843513
3485 pv = _clutter_actor_get_paint_volume_mutable (self);3514 pv = _clutter_actor_get_paint_volume_mutable (self);
3486 if (!pv)3515 if (!pv)
@@ -3495,61 +3524,79 @@ _clutter_actor_draw_paint_volume (ClutterActor *self)
3495 clutter_paint_volume_set_width (&fake_pv, width);3524 clutter_paint_volume_set_width (&fake_pv, width);
3496 clutter_paint_volume_set_height (&fake_pv, height);3525 clutter_paint_volume_set_height (&fake_pv, height);
34973526
3498 cogl_color_init_from_4f (&color, 0, 0, 1, 1);3527 clutter_color_init (&color, 0, 0, 255, 255);
3499 _clutter_actor_draw_paint_volume_full (self, &fake_pv,3528 _clutter_actor_draw_paint_volume_full (self, &fake_pv,
3500 _clutter_actor_get_debug_name (self),3529 _clutter_actor_get_debug_name (self),
3501 &color);3530 &color,
3531 node);
35023532
3503 clutter_paint_volume_free (&fake_pv);3533 clutter_paint_volume_free (&fake_pv);
3504 }3534 }
3505 else3535 else
3506 {3536 {
3507 cogl_color_init_from_4f (&color, 0, 1, 0, 1);3537 clutter_color_init (&color, 0, 255, 0, 255);
3508 _clutter_actor_draw_paint_volume_full (self, pv,3538 _clutter_actor_draw_paint_volume_full (self, pv,
3509 _clutter_actor_get_debug_name (self),3539 _clutter_actor_get_debug_name (self),
3510 &color);3540 &color,
3541 node);
3511 }3542 }
3512}3543}
35133544
3514static void3545static void
3515_clutter_actor_paint_cull_result (ClutterActor *self,3546_clutter_actor_paint_cull_result (ClutterActor *self,
3516 gboolean success,3547 gboolean success,
3517 ClutterCullResult result)3548 ClutterCullResult result,
3549 ClutterPaintNode *node)
3518{3550{
3551 ClutterActorPrivate *priv = self->priv;
3519 ClutterPaintVolume *pv;3552 ClutterPaintVolume *pv;
3520 CoglColor color;3553 ClutterColor color;
35213554
3522 if (success)3555 if (success)
3523 {3556 {
3524 if (result == CLUTTER_CULL_RESULT_IN)3557 if (result == CLUTTER_CULL_RESULT_IN)
3525 cogl_color_init_from_4f (&color, 0, 1, 0, 1);3558 clutter_color_init (&color, 0, 255, 0, 255);
3526 else if (result == CLUTTER_CULL_RESULT_OUT)3559 else if (result == CLUTTER_CULL_RESULT_OUT)
3527 cogl_color_init_from_4f (&color, 0, 0, 1, 1);3560 clutter_color_init (&color, 0, 0, 255, 255);
3528 else3561 else
3529 cogl_color_init_from_4f (&color, 0, 1, 1, 1);3562 clutter_color_init (&color, 0, 255, 255, 255);
3530 }3563 }
3531 else3564 else
3532 cogl_color_init_from_4f (&color, 1, 1, 1, 1);3565 clutter_color_init (&color, 255, 255, 255, 255);
35333566
3534 if (success && (pv = _clutter_actor_get_paint_volume_mutable (self)))3567 if (success && (pv = _clutter_actor_get_paint_volume_mutable (self)))
3535 _clutter_actor_draw_paint_volume_full (self, pv,3568 _clutter_actor_draw_paint_volume_full (self, pv,
3536 _clutter_actor_get_debug_name (self),3569 _clutter_actor_get_debug_name (self),
3537 &color);3570 &color,
3571 node);
3538 else3572 else
3539 {3573 {
3574 g_autoptr (ClutterPaintNode) text_node = NULL;
3540 PangoLayout *layout;3575 PangoLayout *layout;
3576 float width;
3577 float height;
3541 char *label =3578 char *label =
3542 g_strdup_printf ("CULL FAILURE: %s", _clutter_actor_get_debug_name (self));3579 g_strdup_printf ("CULL FAILURE: %s", _clutter_actor_get_debug_name (self));
3543 cogl_color_init_from_4f (&color, 1, 1, 1, 1);3580 clutter_color_init (&color, 255, 255, 255, 255);
3544 cogl_set_source_color (&color);3581
3582 width = clutter_actor_box_get_width (&priv->allocation);
3583 height = clutter_actor_box_get_height (&priv->allocation);
35453584
3546 layout = pango_layout_new (clutter_actor_get_pango_context (self));3585 layout = pango_layout_new (clutter_actor_get_pango_context (self));
3547 pango_layout_set_text (layout, label, -1);3586 pango_layout_set_text (layout, label, -1);
3548 cogl_pango_render_layout (layout,3587
3549 0,3588 text_node = clutter_text_node_new (layout, &color);
3550 0,3589 clutter_paint_node_set_name (text_node,
3551 &color,3590 "ClutterActor (paint volume text)");
3552 0);3591 clutter_paint_node_add_rectangle (text_node,
3592 &(ClutterActorBox) {
3593 .x1 = 0.f,
3594 .y1 = 0.f,
3595 .x2 = width,
3596 .y2 = height,
3597 });
3598 clutter_paint_node_add_child (node, text_node);
3599
3553 g_free (label);3600 g_free (label);
3554 g_object_unref (layout);3601 g_object_unref (layout);
3555 }3602 }
@@ -3581,8 +3628,9 @@ in_clone_paint (void)
3581 * means there's no point in trying to cull descendants of the current3628 * means there's no point in trying to cull descendants of the current
3582 * node. */3629 * node. */
3583static gboolean3630static gboolean
3584cull_actor (ClutterActor *self,3631cull_actor (ClutterActor *self,
3585 ClutterCullResult *result_out)3632 ClutterPaintContext *paint_context,
3633 ClutterCullResult *result_out)
3586{3634{
3587 ClutterActorPrivate *priv = self->priv;3635 ClutterActorPrivate *priv = self->priv;
3588 ClutterStage *stage;3636 ClutterStage *stage;
@@ -3609,10 +3657,10 @@ cull_actor (ClutterActor *self,
3609 return FALSE;3657 return FALSE;
3610 }3658 }
36113659
3612 if (cogl_get_draw_framebuffer () != _clutter_stage_get_active_framebuffer (stage))3660 if (clutter_paint_context_is_drawing_off_stage (paint_context))
3613 {3661 {
3614 CLUTTER_NOTE (CLIPPING, "Bail from cull_actor without culling (%s): "3662 CLUTTER_NOTE (CLIPPING, "Bail from cull_actor without culling (%s): "
3615 "Current framebuffer doesn't correspond to stage",3663 "Drawing off stage",
3616 _clutter_actor_get_debug_name (self));3664 _clutter_actor_get_debug_name (self));
3617 return FALSE;3665 return FALSE;
3618 }3666 }
@@ -3750,7 +3798,8 @@ add_or_remove_flatten_effect (ClutterActor *self)
3750}3798}
37513799
3752static void3800static void
3753clutter_actor_real_paint (ClutterActor *actor)3801clutter_actor_real_paint (ClutterActor *actor,
3802 ClutterPaintContext *paint_context)
3754{3803{
3755 ClutterActorPrivate *priv = actor->priv;3804 ClutterActorPrivate *priv = actor->priv;
3756 ClutterActor *iter;3805 ClutterActor *iter;
@@ -3767,21 +3816,19 @@ clutter_actor_real_paint (ClutterActor *actor)
3767 iter->priv->allocation.x2 - iter->priv->allocation.x1,3816 iter->priv->allocation.x2 - iter->priv->allocation.x1,
3768 iter->priv->allocation.y2 - iter->priv->allocation.y1);3817 iter->priv->allocation.y2 - iter->priv->allocation.y1);
37693818
3770 clutter_actor_paint (iter);3819 clutter_actor_paint (iter, paint_context);
3771 }3820 }
3772}3821}
37733822
3774static gboolean3823static gboolean
3775clutter_actor_paint_node (ClutterActor *actor,3824clutter_actor_paint_node (ClutterActor *actor,
3776 ClutterPaintNode *root)3825 ClutterPaintNode *root,
3826 ClutterPaintContext *paint_context)
3777{3827{
3778 ClutterActorPrivate *priv = actor->priv;3828 ClutterActorPrivate *priv = actor->priv;
3779 ClutterActorBox box;3829 ClutterActorBox box;
3780 ClutterColor bg_color;3830 ClutterColor bg_color;
37813831
3782 if (root == NULL)
3783 return FALSE;
3784
3785 box.x1 = 0.f;3832 box.x1 = 0.f;
3786 box.y1 = 0.f;3833 box.y1 = 0.f;
3787 box.x2 = clutter_actor_box_get_width (&priv->allocation);3834 box.x2 = clutter_actor_box_get_width (&priv->allocation);
@@ -3795,7 +3842,7 @@ clutter_actor_paint_node (ClutterActor *actor,
3795 CoglFramebuffer *fb;3842 CoglFramebuffer *fb;
3796 CoglBufferBit clear_flags;3843 CoglBufferBit clear_flags;
37973844
3798 fb = _clutter_stage_get_active_framebuffer (CLUTTER_STAGE (actor));3845 fb = clutter_paint_context_get_base_framebuffer (paint_context);
37993846
3800 if (clutter_stage_get_use_alpha (CLUTTER_STAGE (actor)))3847 if (clutter_stage_get_use_alpha (CLUTTER_STAGE (actor)))
3801 {3848 {
@@ -3813,8 +3860,6 @@ clutter_actor_paint_node (ClutterActor *actor,
3813 bg_color.alpha);3860 bg_color.alpha);
38143861
3815 clear_flags = COGL_BUFFER_BIT_DEPTH;3862 clear_flags = COGL_BUFFER_BIT_DEPTH;
3816 if (!clutter_stage_get_no_clear_hint (CLUTTER_STAGE (actor)))
3817 clear_flags |= COGL_BUFFER_BIT_COLOR;
38183863
3819 node = clutter_root_node_new (fb, &bg_color, clear_flags);3864 node = clutter_root_node_new (fb, &bg_color, clear_flags);
3820 clutter_paint_node_set_name (node, "stageClear");3865 clutter_paint_node_set_name (node, "stageClear");
@@ -3839,7 +3884,7 @@ clutter_actor_paint_node (ClutterActor *actor,
3839 }3884 }
38403885
3841 if (priv->content != NULL)3886 if (priv->content != NULL)
3842 _clutter_content_paint_content (priv->content, actor, root);3887 _clutter_content_paint_content (priv->content, actor, root, paint_context);
38433888
3844 if (CLUTTER_ACTOR_GET_CLASS (actor)->paint_node != NULL)3889 if (CLUTTER_ACTOR_GET_CLASS (actor)->paint_node != NULL)
3845 CLUTTER_ACTOR_GET_CLASS (actor)->paint_node (actor, root);3890 CLUTTER_ACTOR_GET_CLASS (actor)->paint_node (actor, root);
@@ -3855,7 +3900,7 @@ clutter_actor_paint_node (ClutterActor *actor,
3855 }3900 }
3856#endif /* CLUTTER_ENABLE_DEBUG */3901#endif /* CLUTTER_ENABLE_DEBUG */
38573902
3858 clutter_paint_node_paint (root);3903 clutter_paint_node_paint (root, paint_context);
38593904
3860 return TRUE;3905 return TRUE;
3861}3906}
@@ -3879,13 +3924,14 @@ clutter_actor_paint_node (ClutterActor *actor,
3879 * unless it is performing a pick paint.3924 * unless it is performing a pick paint.
3880 */3925 */
3881void3926void
3882clutter_actor_paint (ClutterActor *self)3927clutter_actor_paint (ClutterActor *self,
3928 ClutterPaintContext *paint_context)
3883{3929{
3930 g_autoptr (ClutterPaintNode) actor_node = NULL;
3931 g_autoptr (ClutterPaintNode) root_node = NULL;
3884 ClutterActorPrivate *priv;3932 ClutterActorPrivate *priv;
3885 ClutterPickMode pick_mode;
3886 ClutterActorBox clip;3933 ClutterActorBox clip;
3887 gboolean clip_set = FALSE;3934 gboolean clip_set = FALSE;
3888 ClutterStage *stage;
38893935
3890 g_return_if_fail (CLUTTER_IS_ACTOR (self));3936 g_return_if_fail (CLUTTER_IS_ACTOR (self));
38913937
@@ -3893,16 +3939,11 @@ clutter_actor_paint (ClutterActor *self)
3893 return;3939 return;
38943940
3895 priv = self->priv;3941 priv = self->priv;
38963942 priv->propagated_one_redraw = FALSE;
3897 pick_mode = _clutter_context_get_pick_mode ();
3898
3899 if (pick_mode == CLUTTER_PICK_NONE)
3900 priv->propagated_one_redraw = FALSE;
39013943
3902 /* It's an important optimization that we consider painting of3944 /* It's an important optimization that we consider painting of
3903 * actors with 0 opacity to be a NOP... */3945 * actors with 0 opacity to be a NOP... */
3904 if (pick_mode == CLUTTER_PICK_NONE &&3946 if (/* ignore top-levels, since they might be transparent */
3905 /* ignore top-levels, since they might be transparent */
3906 !CLUTTER_ACTOR_IS_TOPLEVEL (self) &&3947 !CLUTTER_ACTOR_IS_TOPLEVEL (self) &&
3907 /* Use the override opacity if its been set */3948 /* Use the override opacity if its been set */
3908 ((priv->opacity_override >= 0) ?3949 ((priv->opacity_override >= 0) ?
@@ -3917,22 +3958,50 @@ clutter_actor_paint (ClutterActor *self)
39173958
3918 clutter_actor_ensure_resource_scale (self);3959 clutter_actor_ensure_resource_scale (self);
39193960
3920 stage = (ClutterStage *) _clutter_actor_get_stage_internal (self);3961 actor_node = clutter_actor_node_new (self);
3962 root_node = clutter_paint_node_ref (actor_node);
39213963
3922 /* mark that we are in the paint process */3964 if (priv->has_clip)
3923 CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PAINT);3965 {
3966 clip.x1 = priv->clip.origin.x;
3967 clip.y1 = priv->clip.origin.y;
3968 clip.x2 = priv->clip.origin.x + priv->clip.size.width;
3969 clip.y2 = priv->clip.origin.y + priv->clip.size.height;
3970 clip_set = TRUE;
3971 }
3972 else if (priv->clip_to_allocation)
3973 {
3974 clip.x1 = 0.f;
3975 clip.y1 = 0.f;
3976 clip.x2 = priv->allocation.x2 - priv->allocation.x1;
3977 clip.y2 = priv->allocation.y2 - priv->allocation.y1;
3978 clip_set = TRUE;
3979 }
3980
3981 if (clip_set)
3982 {
3983 ClutterPaintNode *clip_node;
3984
3985 clip_node = clutter_clip_node_new ();
3986 clutter_paint_node_add_rectangle (clip_node, &clip);
3987 clutter_paint_node_add_child (clip_node, root_node);
3988 clutter_paint_node_unref (root_node);
39243989
3925 cogl_push_matrix ();3990 root_node = g_steal_pointer (&clip_node);
3991 }
39263992
3927 if (priv->enable_model_view_transform)3993 if (priv->enable_model_view_transform)
3928 {3994 {
3929 CoglMatrix matrix;3995 ClutterPaintNode *transform_node;
3996 CoglMatrix transform;
3997
3998 clutter_actor_get_transform (self, &transform);
3999
4000 transform_node = clutter_transform_node_new (&transform);
4001 clutter_paint_node_add_child (transform_node, root_node);
4002 clutter_paint_node_unref (root_node);
39304003
3931 /* XXX: It could be better to cache the modelview with the actor4004 root_node = g_steal_pointer (&transform_node);
3932 * instead of progressively building up the transformations on
3933 * the matrix stack every time we paint. */
3934 cogl_get_modelview_matrix (&matrix);
3935 _clutter_actor_apply_modelview_transform (self, &matrix);
39364005
3937#ifdef CLUTTER_ENABLE_DEBUG4006#ifdef CLUTTER_ENABLE_DEBUG
3938 /* Catch when out-of-band transforms have been made by actors not as part4007 /* Catch when out-of-band transforms have been made by actors not as part
@@ -3944,7 +4013,7 @@ clutter_actor_paint (ClutterActor *self)
3944 _clutter_actor_get_relative_transformation_matrix (self, NULL,4013 _clutter_actor_get_relative_transformation_matrix (self, NULL,
3945 &expected_matrix);4014 &expected_matrix);
39464015
3947 if (!cogl_matrix_equal (&matrix, &expected_matrix))4016 if (!cogl_matrix_equal (&transform, &expected_matrix))
3948 {4017 {
3949 GString *buf = g_string_sized_new (1024);4018 GString *buf = g_string_sized_new (1024);
3950 ClutterActor *parent;4019 ClutterActor *parent;
@@ -3971,54 +4040,14 @@ clutter_actor_paint (ClutterActor *self)
3971 }4040 }
3972 }4041 }
3973#endif /* CLUTTER_ENABLE_DEBUG */4042#endif /* CLUTTER_ENABLE_DEBUG */
3974
3975 cogl_set_modelview_matrix (&matrix);
3976 }
3977
3978 if (priv->has_clip)
3979 {
3980 clip.x1 = priv->clip.origin.x;
3981 clip.y1 = priv->clip.origin.y;
3982 clip.x2 = priv->clip.origin.x + priv->clip.size.width;
3983 clip.y2 = priv->clip.origin.y + priv->clip.size.height;
3984 clip_set = TRUE;
3985 }
3986 else if (priv->clip_to_allocation)
3987 {
3988 clip.x1 = 0.f;
3989 clip.y1 = 0.f;
3990 clip.x2 = priv->allocation.x2 - priv->allocation.x1;
3991 clip.y2 = priv->allocation.y2 - priv->allocation.y1;
3992 clip_set = TRUE;
3993 }
3994
3995 if (clip_set)
3996 {
3997 if (pick_mode == CLUTTER_PICK_NONE)
3998 {
3999 CoglFramebuffer *fb = _clutter_stage_get_active_framebuffer (stage);
4000
4001 cogl_framebuffer_push_rectangle_clip (fb,
4002 clip.x1,
4003 clip.y1,
4004 clip.x2,
4005 clip.y2);
4006 }
4007 else
4008 {
4009 if (!_clutter_actor_push_pick_clip (self, &clip))
4010 clip_set = FALSE;
4011 }
4012 }4043 }
40134044
4014 if (pick_mode == CLUTTER_PICK_NONE)4045 /* We check whether we need to add the flatten effect before
4015 {4046 * each paint so that we can avoid having a mechanism for
4016 /* We check whether we need to add the flatten effect before4047 * applications to notify when the value of the
4017 each paint so that we can avoid having a mechanism for4048 * has_overlaps virtual changes.
4018 applications to notify when the value of the4049 */
4019 has_overlaps virtual changes. */4050 add_or_remove_flatten_effect (self);
4020 add_or_remove_flatten_effect (self);
4021 }
40224051
4023 /* We save the current paint volume so that the next time the4052 /* We save the current paint volume so that the next time the
4024 * actor queues a redraw we can constrain the redraw to just4053 * actor queues a redraw we can constrain the redraw to just
@@ -4047,7 +4076,7 @@ clutter_actor_paint (ClutterActor *self)
4047 * paint then the last-paint-volume would likely represent the new4076 * paint then the last-paint-volume would likely represent the new
4048 * actor position not the old.4077 * actor position not the old.
4049 */4078 */
4050 if (!in_clone_paint () && pick_mode == CLUTTER_PICK_NONE)4079 if (!in_clone_paint ())
4051 {4080 {
4052 gboolean success;4081 gboolean success;
4053 /* annoyingly gcc warns if uninitialized even though4082 /* annoyingly gcc warns if uninitialized even though
@@ -4061,12 +4090,12 @@ clutter_actor_paint (ClutterActor *self)
4061 CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS)))4090 CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS)))
4062 _clutter_actor_update_last_paint_volume (self);4091 _clutter_actor_update_last_paint_volume (self);
40634092
4064 success = cull_actor (self, &result);4093 success = cull_actor (self, paint_context, &result);
40654094
4066 if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_REDRAWS))4095 if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_REDRAWS))
4067 _clutter_actor_paint_cull_result (self, success, result);4096 _clutter_actor_paint_cull_result (self, success, result, actor_node);
4068 else if (result == CLUTTER_CULL_RESULT_OUT && success)4097 else if (result == CLUTTER_CULL_RESULT_OUT && success)
4069 goto done;4098 return;
4070 }4099 }
40714100
4072 if (priv->effects == NULL)4101 if (priv->effects == NULL)
@@ -4075,36 +4104,14 @@ clutter_actor_paint (ClutterActor *self)
4075 priv->next_effect_to_paint =4104 priv->next_effect_to_paint =
4076 _clutter_meta_group_peek_metas (priv->effects);4105 _clutter_meta_group_peek_metas (priv->effects);
40774106
4078 clutter_actor_continue_paint (self);4107 if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_VOLUMES))
4108 _clutter_actor_draw_paint_volume (self, actor_node);
40794109
4080 if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_VOLUMES &&4110 clutter_paint_node_paint (root_node, paint_context);
4081 pick_mode == CLUTTER_PICK_NONE))
4082 _clutter_actor_draw_paint_volume (self);
40834111
4084 /* If we make it here then the actor has run through a complete4112 /* If we make it here then the actor has run through a complete
4085 paint run including all the effects so it's no longer dirty */4113 paint run including all the effects so it's no longer dirty */
4086 if (pick_mode == CLUTTER_PICK_NONE)4114 priv->is_dirty = FALSE;
4087 priv->is_dirty = FALSE;
4088
4089done:
4090 if (clip_set)
4091 {
4092 if (pick_mode == CLUTTER_PICK_NONE)
4093 {
4094 CoglFramebuffer *fb = _clutter_stage_get_active_framebuffer (stage);
4095
4096 cogl_framebuffer_pop_clip (fb);
4097 }
4098 else
4099 {
4100 _clutter_actor_pop_pick_clip (self);
4101 }
4102 }
4103
4104 cogl_pop_matrix ();
4105
4106 /* paint sequence complete */
4107 CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_PAINT);
4108}4115}
41094116
4110/**4117/**
@@ -4120,7 +4127,8 @@ done:
4120 * Since: 1.84127 * Since: 1.8
4121 */4128 */
4122void4129void
4123clutter_actor_continue_paint (ClutterActor *self)4130clutter_actor_continue_paint (ClutterActor *self,
4131 ClutterPaintContext *paint_context)
4124{4132{
4125 ClutterActorPrivate *priv;4133 ClutterActorPrivate *priv;
41264134
@@ -4140,50 +4148,30 @@ clutter_actor_continue_paint (ClutterActor *self)
4140 actual actor */4148 actual actor */
4141 if (priv->next_effect_to_paint == NULL)4149 if (priv->next_effect_to_paint == NULL)
4142 {4150 {
4143 if (_clutter_context_get_pick_mode () == CLUTTER_PICK_NONE)4151 CoglFramebuffer *framebuffer;
4144 {4152 ClutterPaintNode *dummy;
4145 ClutterPaintNode *dummy;
41464153
4147 /* XXX - this will go away in 2.0, when we can get rid of this4154 /* XXX - this will go away in 2.0, when we can get rid of this
4148 * stuff and switch to a pure retained render tree of PaintNodes4155 * stuff and switch to a pure retained render tree of PaintNodes
4149 * for the entire frame, starting from the Stage; the paint()4156 * for the entire frame, starting from the Stage; the paint()
4150 * virtual function can then be called directly.4157 * virtual function can then be called directly.
4151 */4158 */
4152 dummy = _clutter_dummy_node_new (self);4159 framebuffer = clutter_paint_context_get_base_framebuffer (paint_context);
4153 clutter_paint_node_set_name (dummy, "Root");4160 dummy = _clutter_dummy_node_new (self, framebuffer);
4161 clutter_paint_node_set_name (dummy, "Root");
41544162
4155 /* XXX - for 1.12, we use the return value of paint_node() to4163 /* XXX - for 1.12, we use the return value of paint_node() to
4156 * decide whether we should emit the ::paint signal.4164 * decide whether we should emit the ::paint signal.
4157 */4165 */
4158 clutter_actor_paint_node (self, dummy);4166 clutter_actor_paint_node (self, dummy, paint_context);
4159 clutter_paint_node_unref (dummy);4167 clutter_paint_node_unref (dummy);
41604168
4161 /* XXX:2.0 - Call the paint() virtual directly */4169 /* XXX:2.0 - Call the paint() virtual directly */
4162 if (g_signal_has_handler_pending (self, actor_signals[PAINT],4170 if (g_signal_has_handler_pending (self, actor_signals[PAINT],
4163 0, TRUE))4171 0, TRUE))
4164 g_signal_emit (self, actor_signals[PAINT], 0);4172 g_signal_emit (self, actor_signals[PAINT], 0, paint_context);
4165 else
4166 CLUTTER_ACTOR_GET_CLASS (self)->paint (self);
4167 }
4168 else4173 else
4169 {4174 CLUTTER_ACTOR_GET_CLASS (self)->paint (self, paint_context);
4170 ClutterColor col = { 0, };
4171
4172 /* The actor will log a silhouette of itself to the stage pick log.
4173 * Note that the picking color is no longer used as the "log" instead
4174 * keeps a weak pointer to the actor itself. But we keep the color
4175 * parameter for now so as to maintain ABI compatibility. The color
4176 * parameter can be removed when someone feels like breaking the ABI
4177 * along with gnome-shell.
4178 *
4179 * XXX:2.0 - Call the pick() virtual directly
4180 */
4181 if (g_signal_has_handler_pending (self, actor_signals[PICK],
4182 0, TRUE))
4183 g_signal_emit (self, actor_signals[PICK], 0, &col);
4184 else
4185 CLUTTER_ACTOR_GET_CLASS (self)->pick (self, &col);
4186 }
4187 }4175 }
4188 else4176 else
4189 {4177 {
@@ -4197,31 +4185,161 @@ clutter_actor_continue_paint (ClutterActor *self)
4197 priv->current_effect = priv->next_effect_to_paint->data;4185 priv->current_effect = priv->next_effect_to_paint->data;
4198 priv->next_effect_to_paint = priv->next_effect_to_paint->next;4186 priv->next_effect_to_paint = priv->next_effect_to_paint->next;
41994187
4200 if (_clutter_context_get_pick_mode () == CLUTTER_PICK_NONE)4188 if (priv->is_dirty)
4201 {4189 {
4202 if (priv->is_dirty)4190 /* If there's an effect queued with this redraw then all
4203 {4191 * effects up to that one will be considered dirty. It
4204 /* If there's an effect queued with this redraw then all4192 * is expected the queued effect will paint the cached
4205 effects up to that one will be considered dirty. It4193 * image and not call clutter_actor_continue_paint again
4206 is expected the queued effect will paint the cached4194 * (although it should work ok if it does)
4207 image and not call clutter_actor_continue_paint again4195 */
4208 (although it should work ok if it does) */4196 if (priv->effect_to_redraw == NULL ||
4209 if (priv->effect_to_redraw == NULL ||4197 priv->current_effect != priv->effect_to_redraw)
4210 priv->current_effect != priv->effect_to_redraw)4198 run_flags |= CLUTTER_EFFECT_PAINT_ACTOR_DIRTY;
4211 run_flags |= CLUTTER_EFFECT_PAINT_ACTOR_DIRTY;
4212 }
4213
4214 _clutter_effect_paint (priv->current_effect, run_flags);
4215 }4199 }
4200
4201 _clutter_effect_paint (priv->current_effect, paint_context, run_flags);
4202
4203 priv->current_effect = old_current_effect;
4204 }
4205}
4206
4207/**
4208 * clutter_actor_pick:
4209 * @actor: A #ClutterActor
4210 *
4211 * Asks @actor to perform a pick.
4212 */
4213void
4214clutter_actor_pick (ClutterActor *actor,
4215 ClutterPickContext *pick_context)
4216{
4217 ClutterActorPrivate *priv;
4218 CoglFramebuffer *framebuffer;
4219 ClutterActorBox clip;
4220 gboolean clip_set = FALSE;
4221
4222 if (CLUTTER_ACTOR_IN_DESTRUCTION (actor))
4223 return;
4224
4225 priv = actor->priv;
4226
4227 /* if we aren't paintable (not in a toplevel with all
4228 * parents paintable) then do nothing.
4229 */
4230 if (!CLUTTER_ACTOR_IS_MAPPED (actor))
4231 return;
4232
4233 clutter_actor_ensure_resource_scale (actor);
4234
4235 /* mark that we are in the paint process */
4236 CLUTTER_SET_PRIVATE_FLAGS (actor, CLUTTER_IN_PICK);
4237
4238 framebuffer = clutter_pick_context_get_framebuffer (pick_context);
4239 cogl_framebuffer_push_matrix (framebuffer);
4240
4241 if (priv->enable_model_view_transform)
4242 {
4243 CoglMatrix matrix;
4244
4245 cogl_framebuffer_get_modelview_matrix (framebuffer, &matrix);
4246 _clutter_actor_apply_modelview_transform (actor, &matrix);
4247 cogl_framebuffer_set_modelview_matrix (framebuffer, &matrix);
4248 }
4249
4250 if (priv->has_clip)
4251 {
4252 clip.x1 = priv->clip.origin.x;
4253 clip.y1 = priv->clip.origin.y;
4254 clip.x2 = priv->clip.origin.x + priv->clip.size.width;
4255 clip.y2 = priv->clip.origin.y + priv->clip.size.height;
4256 clip_set = TRUE;
4257 }
4258 else if (priv->clip_to_allocation)
4259 {
4260 clip.x1 = 0.f;
4261 clip.y1 = 0.f;
4262 clip.x2 = priv->allocation.x2 - priv->allocation.x1;
4263 clip.y2 = priv->allocation.y2 - priv->allocation.y1;
4264 clip_set = TRUE;
4265 }
4266
4267 if (clip_set)
4268 clip_set = _clutter_actor_push_pick_clip (actor, pick_context, &clip);
4269
4270 priv->next_effect_to_paint = NULL;
4271 if (priv->effects)
4272 {
4273 priv->next_effect_to_paint =
4274 _clutter_meta_group_peek_metas (priv->effects);
4275 }
4276
4277 clutter_actor_continue_pick (actor, pick_context);
4278
4279 if (clip_set)
4280 _clutter_actor_pop_pick_clip (actor);
4281
4282 cogl_framebuffer_pop_matrix (framebuffer);
4283
4284 /* paint sequence complete */
4285 CLUTTER_UNSET_PRIVATE_FLAGS (actor, CLUTTER_IN_PICK);
4286}
4287
4288/**
4289 * clutter_actor_continue_pick:
4290 * @actor: A #ClutterActor
4291 *
4292 * Run the next stage of the pick sequence. This function should only
4293 * be called within the implementation of the ‘pick’ virtual of a
4294 * #ClutterEffect. It will cause the run method of the next effect to
4295 * be applied, or it will pick the actual actor if the current effect
4296 * is the last effect in the chain.
4297 */
4298void
4299clutter_actor_continue_pick (ClutterActor *actor,
4300 ClutterPickContext *pick_context)
4301{
4302 ClutterActorPrivate *priv;
4303
4304 g_return_if_fail (CLUTTER_IS_ACTOR (actor));
4305
4306 g_return_if_fail (CLUTTER_ACTOR_IN_PICK (actor));
4307
4308 priv = actor->priv;
4309
4310 /* Skip any effects that are disabled */
4311 while (priv->next_effect_to_paint &&
4312 !clutter_actor_meta_get_enabled (priv->next_effect_to_paint->data))
4313 priv->next_effect_to_paint = priv->next_effect_to_paint->next;
4314
4315 /* If this has come from the last effect then we'll just pick the
4316 * actual actor.
4317 */
4318 if (priv->next_effect_to_paint == NULL)
4319 {
4320 /* The actor will log a silhouette of itself to the stage pick log.
4321 *
4322 * XXX:2.0 - Call the pick() virtual directly
4323 */
4324 if (g_signal_has_handler_pending (actor, actor_signals[PICK],
4325 0, TRUE))
4326 g_signal_emit (actor, actor_signals[PICK], 0, pick_context);
4216 else4327 else
4217 {4328 CLUTTER_ACTOR_GET_CLASS (actor)->pick (actor, pick_context);
4218 /* We can't determine when an actor has been modified since4329 }
4219 its last pick so lets just assume it has always been4330 else
4220 modified */4331 {
4221 run_flags |= CLUTTER_EFFECT_PAINT_ACTOR_DIRTY;4332 ClutterEffect *old_current_effect;
42224333
4223 _clutter_effect_pick (priv->current_effect, run_flags);4334 /* Cache the current effect so that we can put it back before
4224 }4335 * returning.
4336 */
4337 old_current_effect = priv->current_effect;
4338
4339 priv->current_effect = priv->next_effect_to_paint->data;
4340 priv->next_effect_to_paint = priv->next_effect_to_paint->next;
4341
4342 _clutter_effect_pick (priv->current_effect, pick_context);
42254343
4226 priv->current_effect = old_current_effect;4344 priv->current_effect = old_current_effect;
4227 }4345 }
@@ -4435,7 +4553,6 @@ clutter_actor_remove_child_internal (ClutterActor *self,
4435 clutter_actor_queue_compute_expand (self);4553 clutter_actor_queue_compute_expand (self);
4436 }4554 }
44374555
4438 /* clutter_actor_reparent() will emit ::parent-set for us */
4439 if (emit_parent_set && !CLUTTER_ACTOR_IN_REPARENT (child) &&4556 if (emit_parent_set && !CLUTTER_ACTOR_IN_REPARENT (child) &&
4440 !CLUTTER_ACTOR_IN_DESTRUCTION (child))4557 !CLUTTER_ACTOR_IN_DESTRUCTION (child))
4441 {4558 {
@@ -4477,11 +4594,11 @@ static const ClutterTransformInfo default_transform_info = {
44774594
4478 { 0, }, /* anchor XXX:2.0 - remove*/4595 { 0, }, /* anchor XXX:2.0 - remove*/
44794596
4480 CLUTTER_VERTEX_INIT_ZERO, /* translation */4597 GRAPHENE_POINT3D_INIT_ZERO, /* translation */
44814598
4482 0.f, /* z-position */4599 0.f, /* z-position */
44834600
4484 CLUTTER_POINT_INIT_ZERO, /* pivot */4601 GRAPHENE_POINT_INIT_ZERO, /* pivot */
4485 0.f, /* pivot-z */4602 0.f, /* pivot-z */
44864603
4487 CLUTTER_MATRIX_INIT_IDENTITY,4604 CLUTTER_MATRIX_INIT_IDENTITY,
@@ -4560,8 +4677,8 @@ _clutter_actor_get_transform_info (ClutterActor *self)
4560}4677}
45614678
4562static inline void4679static inline void
4563clutter_actor_set_pivot_point_internal (ClutterActor *self,4680clutter_actor_set_pivot_point_internal (ClutterActor *self,
4564 const ClutterPoint *pivot)4681 const graphene_point_t *pivot)
4565{4682{
4566 ClutterTransformInfo *info;4683 ClutterTransformInfo *info;
45674684
@@ -4866,11 +4983,11 @@ clutter_actor_get_rotation_angle (ClutterActor *self,
4866 * rotation angle.4983 * rotation angle.
4867 */4984 */
4868static inline void4985static inline void
4869clutter_actor_set_rotation_center_internal (ClutterActor *self,4986clutter_actor_set_rotation_center_internal (ClutterActor *self,
4870 ClutterRotateAxis axis,4987 ClutterRotateAxis axis,
4871 const ClutterVertex *center)4988 const graphene_point3d_t *center)
4872{4989{
4873 ClutterVertex v = CLUTTER_VERTEX_INIT_ZERO; 4990 graphene_point3d_t v = GRAPHENE_POINT3D_INIT_ZERO;
4874 GObject *obj = G_OBJECT (self);4991 GObject *obj = G_OBJECT (self);
4875 ClutterTransformInfo *info;4992 ClutterTransformInfo *info;
48764993
@@ -5097,8 +5214,8 @@ clutter_actor_set_anchor_coord (ClutterActor *self,
5097}5214}
50985215
5099static void5216static void
5100clutter_actor_set_clip_rect (ClutterActor *self,5217clutter_actor_set_clip_rect (ClutterActor *self,
5101 const ClutterRect *clip)5218 const graphene_rect_t *clip)
5102{5219{
5103 ClutterActorPrivate *priv = self->priv;5220 ClutterActorPrivate *priv = self->priv;
5104 GObject *obj = G_OBJECT (self);5221 GObject *obj = G_OBJECT (self);
@@ -5113,7 +5230,6 @@ clutter_actor_set_clip_rect (ClutterActor *self,
51135230
5114 clutter_actor_queue_redraw (self);5231 clutter_actor_queue_redraw (self);
51155232
5116 g_object_notify_by_pspec (obj, obj_props[PROP_CLIP]); /* XXX:2.0 - remove */
5117 g_object_notify_by_pspec (obj, obj_props[PROP_CLIP_RECT]);5233 g_object_notify_by_pspec (obj, obj_props[PROP_CLIP_RECT]);
5118 g_object_notify_by_pspec (obj, obj_props[PROP_HAS_CLIP]);5234 g_object_notify_by_pspec (obj, obj_props[PROP_HAS_CLIP]);
5119}5235}
@@ -5139,7 +5255,7 @@ clutter_actor_set_property (GObject *object,
51395255
5140 case PROP_POSITION:5256 case PROP_POSITION:
5141 {5257 {
5142 const ClutterPoint *pos = g_value_get_boxed (value);5258 const graphene_point_t *pos = g_value_get_boxed (value);
51435259
5144 if (pos != NULL)5260 if (pos != NULL)
5145 clutter_actor_set_position (actor, pos->x, pos->y);5261 clutter_actor_set_position (actor, pos->x, pos->y);
@@ -5158,7 +5274,7 @@ clutter_actor_set_property (GObject *object,
51585274
5159 case PROP_SIZE:5275 case PROP_SIZE:
5160 {5276 {
5161 const ClutterSize *size = g_value_get_boxed (value);5277 const graphene_size_t *size = g_value_get_boxed (value);
51625278
5163 if (size != NULL)5279 if (size != NULL)
5164 clutter_actor_set_size (actor, size->width, size->height);5280 clutter_actor_set_size (actor, size->width, size->height);
@@ -5244,10 +5360,10 @@ clutter_actor_set_property (GObject *object,
52445360
5245 case PROP_PIVOT_POINT:5361 case PROP_PIVOT_POINT:
5246 {5362 {
5247 const ClutterPoint *pivot = g_value_get_boxed (value);5363 const graphene_point_t *pivot = g_value_get_boxed (value);
52485364
5249 if (pivot == NULL)5365 if (pivot == NULL)
5250 pivot = clutter_point_zero ();5366 pivot = graphene_point_zero ();
52515367
5252 clutter_actor_set_pivot_point (actor, pivot->x, pivot->y);5368 clutter_actor_set_pivot_point (actor, pivot->x, pivot->y);
5253 }5369 }
@@ -5301,16 +5417,6 @@ clutter_actor_set_property (GObject *object,
5301 clutter_actor_set_scale_gravity (actor, g_value_get_enum (value));5417 clutter_actor_set_scale_gravity (actor, g_value_get_enum (value));
5302 break;5418 break;
53035419
5304 case PROP_CLIP: /* XXX:2.0 - remove */
5305 {
5306 const ClutterGeometry *geom = g_value_get_boxed (value);
5307
5308 clutter_actor_set_clip (actor,
5309 geom->x, geom->y,
5310 geom->width, geom->height);
5311 }
5312 break;
5313
5314 case PROP_CLIP_RECT:5420 case PROP_CLIP_RECT:
5315 clutter_actor_set_clip_rect (actor, g_value_get_boxed (value));5421 clutter_actor_set_clip_rect (actor, g_value_get_boxed (value));
5316 break;5422 break;
@@ -5503,11 +5609,11 @@ clutter_actor_get_property (GObject *object,
55035609
5504 case PROP_POSITION:5610 case PROP_POSITION:
5505 {5611 {
5506 ClutterPoint position;5612 graphene_point_t position;
55075613
5508 clutter_point_init (&position,5614 graphene_point_init (&position,
5509 clutter_actor_get_x (actor),5615 clutter_actor_get_x (actor),
5510 clutter_actor_get_y (actor));5616 clutter_actor_get_y (actor));
5511 g_value_set_boxed (value, &position);5617 g_value_set_boxed (value, &position);
5512 }5618 }
5513 break;5619 break;
@@ -5522,11 +5628,11 @@ clutter_actor_get_property (GObject *object,
55225628
5523 case PROP_SIZE:5629 case PROP_SIZE:
5524 {5630 {
5525 ClutterSize size;5631 graphene_size_t size;
55265632
5527 clutter_size_init (&size,5633 graphene_size_init (&size,
5528 clutter_actor_get_width (actor),5634 clutter_actor_get_width (actor),
5529 clutter_actor_get_height (actor));5635 clutter_actor_get_height (actor));
5530 g_value_set_boxed (value, &size);5636 g_value_set_boxed (value, &size);
5531 }5637 }
5532 break;5638 break;
@@ -5649,19 +5755,6 @@ clutter_actor_get_property (GObject *object,
5649 g_value_set_boolean (value, priv->has_clip);5755 g_value_set_boolean (value, priv->has_clip);
5650 break;5756 break;
56515757
5652 case PROP_CLIP: /* XXX:2.0 - remove */
5653 {
5654 ClutterGeometry clip;
5655
5656 clip.x = CLUTTER_NEARBYINT (priv->clip.origin.x);
5657 clip.y = CLUTTER_NEARBYINT (priv->clip.origin.y);
5658 clip.width = CLUTTER_NEARBYINT (priv->clip.size.width);
5659 clip.height = CLUTTER_NEARBYINT (priv->clip.size.height);
5660
5661 g_value_set_boxed (value, &clip);
5662 }
5663 break;
5664
5665 case PROP_CLIP_RECT:5758 case PROP_CLIP_RECT:
5666 g_value_set_boxed (value, &priv->clip);5759 g_value_set_boxed (value, &priv->clip);
5667 break;5760 break;
@@ -5809,7 +5902,7 @@ clutter_actor_get_property (GObject *object,
58095902
5810 case PROP_ROTATION_CENTER_X: /* XXX:2.0 - remove */5903 case PROP_ROTATION_CENTER_X: /* XXX:2.0 - remove */
5811 {5904 {
5812 ClutterVertex center;5905 graphene_point3d_t center;
58135906
5814 clutter_actor_get_rotation (actor, CLUTTER_X_AXIS,5907 clutter_actor_get_rotation (actor, CLUTTER_X_AXIS,
5815 &center.x,5908 &center.x,
@@ -5822,7 +5915,7 @@ clutter_actor_get_property (GObject *object,
58225915
5823 case PROP_ROTATION_CENTER_Y: /* XXX:2.0 - remove */5916 case PROP_ROTATION_CENTER_Y: /* XXX:2.0 - remove */
5824 {5917 {
5825 ClutterVertex center;5918 graphene_point3d_t center;
58265919
5827 clutter_actor_get_rotation (actor, CLUTTER_Y_AXIS,5920 clutter_actor_get_rotation (actor, CLUTTER_Y_AXIS,
5828 &center.x,5921 &center.x,
@@ -5835,7 +5928,7 @@ clutter_actor_get_property (GObject *object,
58355928
5836 case PROP_ROTATION_CENTER_Z: /* XXX:2.0 - remove */5929 case PROP_ROTATION_CENTER_Z: /* XXX:2.0 - remove */
5837 {5930 {
5838 ClutterVertex center;5931 graphene_point3d_t center;
58395932
5840 clutter_actor_get_rotation (actor, CLUTTER_Z_AXIS,5933 clutter_actor_get_rotation (actor, CLUTTER_Z_AXIS,
5841 &center.x,5934 &center.x,
@@ -6080,18 +6173,7 @@ clutter_actor_dispose (GObject *object)
6080 if (priv->parent != NULL)6173 if (priv->parent != NULL)
6081 {6174 {
6082 ClutterActor *parent = priv->parent;6175 ClutterActor *parent = priv->parent;
60836176 clutter_container_remove_actor (CLUTTER_CONTAINER (parent), self);
6084 /* go through the Container implementation unless this
6085 * is an internal child and has been marked as such.
6086 *
6087 * removing the actor from its parent will reset the
6088 * realized and mapped states.
6089 */
6090 if (!CLUTTER_ACTOR_IS_INTERNAL_CHILD (self))
6091 clutter_container_remove_actor (CLUTTER_CONTAINER (parent), self);
6092 else
6093 clutter_actor_remove_child_internal (parent, self,
6094 REMOVE_CHILD_LEGACY_FLAGS);
6095 }6177 }
60966178
6097 /* parent must be gone at this point */6179 /* parent must be gone at this point */
@@ -6104,17 +6186,8 @@ clutter_actor_dispose (GObject *object)
6104 g_assert (!CLUTTER_ACTOR_IS_REALIZED (self));6186 g_assert (!CLUTTER_ACTOR_IS_REALIZED (self));
6105 }6187 }
61066188
6107 if (priv->resolution_changed_id)6189 g_clear_signal_handler (&priv->resolution_changed_id, backend);
6108 {6190 g_clear_signal_handler (&priv->font_changed_id, backend);
6109 g_signal_handler_disconnect (backend, priv->resolution_changed_id);
6110 priv->resolution_changed_id = 0;
6111 }
6112
6113 if (priv->font_changed_id)
6114 {
6115 g_signal_handler_disconnect (backend, priv->font_changed_id);
6116 priv->font_changed_id = 0;
6117 }
61186191
6119 g_clear_object (&priv->pango_context);6192 g_clear_object (&priv->pango_context);
6120 g_clear_object (&priv->actions);6193 g_clear_object (&priv->actions);
@@ -6263,7 +6336,7 @@ clutter_actor_update_default_paint_volume (ClutterActor *self,
6263 priv->clip.size.width >= 0 &&6336 priv->clip.size.width >= 0 &&
6264 priv->clip.size.height >= 0)6337 priv->clip.size.height >= 0)
6265 {6338 {
6266 ClutterVertex origin;6339 graphene_point3d_t origin;
62676340
6268 origin.x = priv->clip.origin.x;6341 origin.x = priv->clip.origin.x;
6269 origin.y = priv->clip.origin.y;6342 origin.y = priv->clip.origin.y;
@@ -6539,7 +6612,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
6539 g_param_spec_boxed ("position",6612 g_param_spec_boxed ("position",
6540 P_("Position"),6613 P_("Position"),
6541 P_("The position of the origin of the actor"),6614 P_("The position of the origin of the actor"),
6542 CLUTTER_TYPE_POINT,6615 GRAPHENE_TYPE_POINT,
6543 G_PARAM_READWRITE |6616 G_PARAM_READWRITE |
6544 G_PARAM_STATIC_STRINGS |6617 G_PARAM_STATIC_STRINGS |
6545 CLUTTER_PARAM_ANIMATABLE);6618 CLUTTER_PARAM_ANIMATABLE);
@@ -6557,7 +6630,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
6557 g_param_spec_float ("width",6630 g_param_spec_float ("width",
6558 P_("Width"),6631 P_("Width"),
6559 P_("Width of the actor"),6632 P_("Width of the actor"),
6560 0.0, G_MAXFLOAT,6633 -1.0f, G_MAXFLOAT,
6561 0.0,6634 0.0,
6562 G_PARAM_READWRITE |6635 G_PARAM_READWRITE |
6563 G_PARAM_STATIC_STRINGS |6636 G_PARAM_STATIC_STRINGS |
@@ -6576,7 +6649,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
6576 g_param_spec_float ("height",6649 g_param_spec_float ("height",
6577 P_("Height"),6650 P_("Height"),
6578 P_("Height of the actor"),6651 P_("Height of the actor"),
6579 0.0, G_MAXFLOAT,6652 -1.0f, G_MAXFLOAT,
6580 0.0,6653 0.0,
6581 G_PARAM_READWRITE |6654 G_PARAM_READWRITE |
6582 G_PARAM_STATIC_STRINGS |6655 G_PARAM_STATIC_STRINGS |
@@ -6598,7 +6671,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
6598 g_param_spec_boxed ("size",6671 g_param_spec_boxed ("size",
6599 P_("Size"),6672 P_("Size"),
6600 P_("The size of the actor"),6673 P_("The size of the actor"),
6601 CLUTTER_TYPE_SIZE,6674 GRAPHENE_TYPE_SIZE,
6602 G_PARAM_READWRITE |6675 G_PARAM_READWRITE |
6603 G_PARAM_STATIC_STRINGS |6676 G_PARAM_STATIC_STRINGS |
6604 CLUTTER_PARAM_ANIMATABLE);6677 CLUTTER_PARAM_ANIMATABLE);
@@ -7041,24 +7114,10 @@ clutter_actor_class_init (ClutterActorClass *klass)
7041 CLUTTER_PARAM_READABLE);7114 CLUTTER_PARAM_READABLE);
70427115
7043 /**7116 /**
7044 * ClutterActor:clip:
7045 *
7046 * The visible region of the actor, in actor-relative coordinates
7047 *
7048 * Deprecated: 1.12: Use #ClutterActor:clip-rect instead.
7049 */
7050 obj_props[PROP_CLIP] = /* XXX:2.0 - remove */
7051 g_param_spec_boxed ("clip",
7052 P_("Clip"),
7053 P_("The clip region for the actor"),
7054 CLUTTER_TYPE_GEOMETRY,
7055 CLUTTER_PARAM_READWRITE);
7056
7057 /**
7058 * ClutterActor:clip-rect:7117 * ClutterActor:clip-rect:
7059 *7118 *
7060 * The visible region of the actor, in actor-relative coordinates,7119 * The visible region of the actor, in actor-relative coordinates,
7061 * expressed as a #ClutterRect.7120 * expressed as a #graphene_rect_t.
7062 *7121 *
7063 * Setting this property to %NULL will unset the existing clip.7122 * Setting this property to %NULL will unset the existing clip.
7064 *7123 *
@@ -7071,7 +7130,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
7071 g_param_spec_boxed ("clip-rect",7130 g_param_spec_boxed ("clip-rect",
7072 P_("Clip Rectangle"),7131 P_("Clip Rectangle"),
7073 P_("The visible region of the actor"),7132 P_("The visible region of the actor"),
7074 CLUTTER_TYPE_RECT,7133 GRAPHENE_TYPE_RECT,
7075 G_PARAM_READWRITE |7134 G_PARAM_READWRITE |
7076 G_PARAM_STATIC_STRINGS);7135 G_PARAM_STATIC_STRINGS);
70777136
@@ -7108,7 +7167,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
7108 g_param_spec_boxed ("pivot-point",7167 g_param_spec_boxed ("pivot-point",
7109 P_("Pivot Point"),7168 P_("Pivot Point"),
7110 P_("The point around which the scaling and rotation occur"),7169 P_("The point around which the scaling and rotation occur"),
7111 CLUTTER_TYPE_POINT,7170 GRAPHENE_TYPE_POINT,
7112 G_PARAM_READWRITE |7171 G_PARAM_READWRITE |
7113 G_PARAM_STATIC_STRINGS |7172 G_PARAM_STATIC_STRINGS |
7114 CLUTTER_PARAM_ANIMATABLE);7173 CLUTTER_PARAM_ANIMATABLE);
@@ -7330,7 +7389,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
7330 g_param_spec_boxed ("rotation-center-x",7389 g_param_spec_boxed ("rotation-center-x",
7331 P_("Rotation Center X"),7390 P_("Rotation Center X"),
7332 P_("The rotation center on the X axis"),7391 P_("The rotation center on the X axis"),
7333 CLUTTER_TYPE_VERTEX,7392 GRAPHENE_TYPE_POINT3D,
7334 G_PARAM_READWRITE |7393 G_PARAM_READWRITE |
7335 G_PARAM_STATIC_STRINGS |7394 G_PARAM_STATIC_STRINGS |
7336 G_PARAM_DEPRECATED);7395 G_PARAM_DEPRECATED);
@@ -7348,7 +7407,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
7348 g_param_spec_boxed ("rotation-center-y",7407 g_param_spec_boxed ("rotation-center-y",
7349 P_("Rotation Center Y"),7408 P_("Rotation Center Y"),
7350 P_("The rotation center on the Y axis"),7409 P_("The rotation center on the Y axis"),
7351 CLUTTER_TYPE_VERTEX,7410 GRAPHENE_TYPE_POINT3D,
7352 G_PARAM_READWRITE |7411 G_PARAM_READWRITE |
7353 G_PARAM_STATIC_STRINGS |7412 G_PARAM_STATIC_STRINGS |
7354 G_PARAM_DEPRECATED);7413 G_PARAM_DEPRECATED);
@@ -7366,7 +7425,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
7366 g_param_spec_boxed ("rotation-center-z",7425 g_param_spec_boxed ("rotation-center-z",
7367 P_("Rotation Center Z"),7426 P_("Rotation Center Z"),
7368 P_("The rotation center on the Z axis"),7427 P_("The rotation center on the Z axis"),
7369 CLUTTER_TYPE_VERTEX,7428 GRAPHENE_TYPE_POINT3D,
7370 G_PARAM_READWRITE |7429 G_PARAM_READWRITE |
7371 G_PARAM_STATIC_STRINGS |7430 G_PARAM_STATIC_STRINGS |
7372 G_PARAM_DEPRECATED);7431 G_PARAM_DEPRECATED);
@@ -8520,6 +8579,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
8520 /**8579 /**
8521 * ClutterActor::paint:8580 * ClutterActor::paint:
8522 * @actor: the #ClutterActor that received the signal8581 * @actor: the #ClutterActor that received the signal
8582 * @paint_context: a #ClutterPaintContext
8523 *8583 *
8524 * The ::paint signal is emitted each time an actor is being painted.8584 * The ::paint signal is emitted each time an actor is being painted.
8525 *8585 *
@@ -8547,7 +8607,8 @@ clutter_actor_class_init (ClutterActorClass *klass)
8547 G_SIGNAL_DEPRECATED,8607 G_SIGNAL_DEPRECATED,
8548 G_STRUCT_OFFSET (ClutterActorClass, paint),8608 G_STRUCT_OFFSET (ClutterActorClass, paint),
8549 NULL, NULL, NULL,8609 NULL, NULL, NULL,
8550 G_TYPE_NONE, 0);8610 G_TYPE_NONE, 1,
8611 CLUTTER_TYPE_PAINT_CONTEXT);
8551 /**8612 /**
8552 * ClutterActor::realize:8613 * ClutterActor::realize:
8553 * @actor: the #ClutterActor that received the signal8614 * @actor: the #ClutterActor that received the signal
@@ -8590,12 +8651,11 @@ clutter_actor_class_init (ClutterActorClass *klass)
8590 /**8651 /**
8591 * ClutterActor::pick:8652 * ClutterActor::pick:
8592 * @actor: the #ClutterActor that received the signal8653 * @actor: the #ClutterActor that received the signal
8593 * @color: the #ClutterColor to be used when picking8654 * @pick_context: a #ClutterPickContext
8594 *8655 *
8595 * The ::pick signal is emitted each time an actor is being painted8656 * The ::pick signal is emitted each time an actor is being painted
8596 * in "pick mode". The pick mode is used to identify the actor during8657 * in "pick mode". The pick mode is used to identify the actor during
8597 * the event handling phase, or by clutter_stage_get_actor_at_pos().8658 * the event handling phase, or by clutter_stage_get_actor_at_pos().
8598 * The actor should paint its shape using the passed @pick_color.
8599 *8659 *
8600 * Subclasses of #ClutterActor should override the class signal handler8660 * Subclasses of #ClutterActor should override the class signal handler
8601 * and paint themselves in that function.8661 * and paint themselves in that function.
@@ -8614,7 +8674,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
8614 G_STRUCT_OFFSET (ClutterActorClass, pick),8674 G_STRUCT_OFFSET (ClutterActorClass, pick),
8615 NULL, NULL, NULL,8675 NULL, NULL, NULL,
8616 G_TYPE_NONE, 1,8676 G_TYPE_NONE, 1,
8617 CLUTTER_TYPE_COLOR | G_SIGNAL_TYPE_STATIC_SCOPE);8677 CLUTTER_TYPE_PICK_CONTEXT);
86188678
8619 /**8679 /**
8620 * ClutterActor::allocation-changed:8680 * ClutterActor::allocation-changed:
@@ -9021,7 +9081,7 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
9021 if (flags & CLUTTER_REDRAW_CLIPPED_TO_ALLOCATION)9081 if (flags & CLUTTER_REDRAW_CLIPPED_TO_ALLOCATION)
9022 {9082 {
9023 ClutterActorBox allocation_clip;9083 ClutterActorBox allocation_clip;
9024 ClutterVertex origin;9084 graphene_point3d_t origin;
90259085
9026 /* If the actor doesn't have a valid allocation then we will9086 /* If the actor doesn't have a valid allocation then we will
9027 * queue a full stage redraw. */9087 * queue a full stage redraw. */
@@ -9225,7 +9285,7 @@ clutter_actor_queue_redraw_with_clip (ClutterActor *self,
9225 const cairo_rectangle_int_t *clip)9285 const cairo_rectangle_int_t *clip)
9226{9286{
9227 ClutterPaintVolume volume;9287 ClutterPaintVolume volume;
9228 ClutterVertex origin;9288 graphene_point3d_t origin;
92299289
9230 g_return_if_fail (CLUTTER_IS_ACTOR (self));9290 g_return_if_fail (CLUTTER_IS_ACTOR (self));
92319291
@@ -9693,6 +9753,23 @@ clutter_actor_get_preferred_width (ClutterActor *self,
9693 return;9753 return;
9694 }9754 }
96959755
9756 /* if the request mode is CONTENT_SIZE we simply return the content width */
9757 if (priv->request_mode == CLUTTER_REQUEST_CONTENT_SIZE)
9758 {
9759 float content_width = 0.f;
9760
9761 if (priv->content != NULL)
9762 clutter_content_get_preferred_size (priv->content, &content_width, NULL);
9763
9764 if (min_width_p != NULL)
9765 *min_width_p = content_width;
9766
9767 if (natural_width_p != NULL)
9768 *natural_width_p = content_width;
9769
9770 return;
9771 }
9772
9696 CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_WIDTH);9773 CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_WIDTH);
96979774
9698 /* the remaining cases are:9775 /* the remaining cases are:
@@ -9841,6 +9918,23 @@ clutter_actor_get_preferred_height (ClutterActor *self,
9841 return;9918 return;
9842 }9919 }
98439920
9921 /* if the request mode is CONTENT_SIZE we simply return the content height */
9922 if (priv->request_mode == CLUTTER_REQUEST_CONTENT_SIZE)
9923 {
9924 float content_height = 0.f;
9925
9926 if (priv->content != NULL)
9927 clutter_content_get_preferred_size (priv->content, NULL, &content_height);
9928
9929 if (min_height_p != NULL)
9930 *min_height_p = content_height;
9931
9932 if (natural_height_p != NULL)
9933 *natural_height_p = content_height;
9934
9935 return;
9936 }
9937
9844 CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_HEIGHT);9938 CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_HEIGHT);
98459939
9846 /* the remaining cases are:9940 /* the remaining cases are:
@@ -10452,17 +10546,17 @@ clutter_actor_set_position (ClutterActor *self,
10452 gfloat x,10546 gfloat x,
10453 gfloat y)10547 gfloat y)
10454{10548{
10455 ClutterPoint new_position;10549 graphene_point_t new_position;
10456 ClutterPoint cur_position;10550 graphene_point_t cur_position;
1045710551
10458 g_return_if_fail (CLUTTER_IS_ACTOR (self));10552 g_return_if_fail (CLUTTER_IS_ACTOR (self));
1045910553
10460 clutter_point_init (&new_position, x, y);10554 graphene_point_init (&new_position, x, y);
1046110555
10462 cur_position.x = clutter_actor_get_x (self);10556 cur_position.x = clutter_actor_get_x (self);
10463 cur_position.y = clutter_actor_get_y (self);10557 cur_position.y = clutter_actor_get_y (self);
1046410558
10465 if (!clutter_point_equals (&cur_position, &new_position))10559 if (!graphene_point_equal (&cur_position, &new_position))
10466 _clutter_actor_create_transition (self, obj_props[PROP_POSITION],10560 _clutter_actor_create_transition (self, obj_props[PROP_POSITION],
10467 &cur_position,10561 &cur_position,
10468 &new_position);10562 &new_position);
@@ -10897,8 +10991,8 @@ clutter_actor_set_height_internal (ClutterActor *self,
10897}10991}
1089810992
10899static void10993static void
10900clutter_actor_set_size_internal (ClutterActor *self,10994clutter_actor_set_size_internal (ClutterActor *self,
10901 const ClutterSize *size)10995 const graphene_size_t *size)
10902{10996{
10903 if (size != NULL)10997 if (size != NULL)
10904 {10998 {
@@ -10934,11 +11028,11 @@ clutter_actor_set_size (ClutterActor *self,
10934 gfloat width,11028 gfloat width,
10935 gfloat height)11029 gfloat height)
10936{11030{
10937 ClutterSize new_size;11031 graphene_size_t new_size;
1093811032
10939 g_return_if_fail (CLUTTER_IS_ACTOR (self));11033 g_return_if_fail (CLUTTER_IS_ACTOR (self));
1094011034
10941 clutter_size_init (&new_size, width, height);11035 graphene_size_init (&new_size, width, height);
1094211036
10943 /* minor optimization: if we don't have a duration then we can11037 /* minor optimization: if we don't have a duration then we can
10944 * skip the get_size() below, to avoid the chance of going through11038 * skip the get_size() below, to avoid the chance of going through
@@ -10957,11 +11051,11 @@ clutter_actor_set_size (ClutterActor *self,
10957 }11051 }
10958 else11052 else
10959 {11053 {
10960 ClutterSize cur_size;11054 graphene_size_t cur_size;
1096111055
10962 clutter_size_init (&cur_size,11056 graphene_size_init (&cur_size,
10963 clutter_actor_get_width (self),11057 clutter_actor_get_width (self),
10964 clutter_actor_get_height (self));11058 clutter_actor_get_height (self));
1096511059
10966 _clutter_actor_create_transition (self,11060 _clutter_actor_create_transition (self,
10967 obj_props[PROP_SIZE],11061 obj_props[PROP_SIZE],
@@ -11047,8 +11141,8 @@ clutter_actor_get_transformed_position (ClutterActor *self,
11047 gfloat *x,11141 gfloat *x,
11048 gfloat *y)11142 gfloat *y)
11049{11143{
11050 ClutterVertex v1;11144 graphene_point3d_t v1;
11051 ClutterVertex v2;11145 graphene_point3d_t v2;
1105211146
11053 v1.x = v1.y = v1.z = 0;11147 v1.x = v1.y = v1.z = 0;
11054 clutter_actor_apply_transform_to_point (self, &v1, &v2);11148 clutter_actor_apply_transform_to_point (self, &v1, &v2);
@@ -11094,7 +11188,7 @@ clutter_actor_get_transformed_size (ClutterActor *self,
11094 gfloat *height)11188 gfloat *height)
11095{11189{
11096 ClutterActorPrivate *priv;11190 ClutterActorPrivate *priv;
11097 ClutterVertex v[4];11191 graphene_point3d_t v[4];
11098 gfloat x_min, x_max, y_min, y_max;11192 gfloat x_min, x_max, y_min, y_max;
11099 gint i;11193 gint i;
1110011194
@@ -11416,8 +11510,8 @@ clutter_actor_set_y_internal (ClutterActor *self,
11416}11510}
1141711511
11418static void11512static void
11419clutter_actor_set_position_internal (ClutterActor *self,11513clutter_actor_set_position_internal (ClutterActor *self,
11420 const ClutterPoint *position)11514 const graphene_point_t *position)
11421{11515{
11422 ClutterActorPrivate *priv = self->priv;11516 ClutterActorPrivate *priv = self->priv;
11423 ClutterLayoutInfo *linfo;11517 ClutterLayoutInfo *linfo;
@@ -11426,7 +11520,7 @@ clutter_actor_set_position_internal (ClutterActor *self,
11426 linfo = _clutter_actor_get_layout_info (self);11520 linfo = _clutter_actor_get_layout_info (self);
1142711521
11428 if (priv->position_set &&11522 if (priv->position_set &&
11429 clutter_point_equals (position, &linfo->fixed_pos))11523 graphene_point_equal (position, &linfo->fixed_pos))
11430 return;11524 return;
1143111525
11432 clutter_actor_store_old_geometry (self, &old);11526 clutter_actor_store_old_geometry (self, &old);
@@ -11511,8 +11605,7 @@ clutter_actor_set_y (ClutterActor *self,
11511 * the X coordinate of the origin of the allocation box.11605 * the X coordinate of the origin of the allocation box.
11512 *11606 *
11513 * If the actor has any fixed coordinate set using clutter_actor_set_x(),11607 * If the actor has any fixed coordinate set using clutter_actor_set_x(),
11514 * clutter_actor_set_position() or clutter_actor_set_geometry(), this11608 * clutter_actor_set_position(), this function will return that coordinate.
11515 * function will return that coordinate.
11516 *11609 *
11517 * If both the allocation and a fixed position are missing, this function11610 * If both the allocation and a fixed position are missing, this function
11518 * will return 0.11611 * will return 0.
@@ -11559,8 +11652,7 @@ clutter_actor_get_x (ClutterActor *self)
11559 * the Y coordinate of the origin of the allocation box.11652 * the Y coordinate of the origin of the allocation box.
11560 *11653 *
11561 * If the actor has any fixed coordinate set using clutter_actor_set_y(),11654 * If the actor has any fixed coordinate set using clutter_actor_set_y(),
11562 * clutter_actor_set_position() or clutter_actor_set_geometry(), this11655 * clutter_actor_set_position(), this function will return that coordinate.
11563 * function will return that coordinate.
11564 *11656 *
11565 * If both the allocation and a fixed position are missing, this function11657 * If both the allocation and a fixed position are missing, this function
11566 * will return 0.11658 * will return 0.
@@ -11686,45 +11778,6 @@ clutter_actor_set_scale_full (ClutterActor *self,
11686}11778}
1168711779
11688/**11780/**
11689 * clutter_actor_set_scale_with_gravity:
11690 * @self: A #ClutterActor
11691 * @scale_x: double factor to scale actor by horizontally.
11692 * @scale_y: double factor to scale actor by vertically.
11693 * @gravity: the location of the scale center expressed as a compass
11694 * direction.
11695 *
11696 * Scales an actor with the given factors around the given
11697 * center point. The center point is specified as one of the compass
11698 * directions in #ClutterGravity. For example, setting it to north
11699 * will cause the top of the actor to remain unchanged and the rest of
11700 * the actor to expand left, right and downwards.
11701 *
11702 * The #ClutterActor:scale-x and #ClutterActor:scale-y properties are
11703 * animatable.
11704 *
11705 * Since: 1.0
11706 *
11707 * Deprecated: 1.12: Use clutter_actor_set_pivot_point() to set the
11708 * scale center using normalized coordinates instead.
11709 */
11710void
11711clutter_actor_set_scale_with_gravity (ClutterActor *self,
11712 gdouble scale_x,
11713 gdouble scale_y,
11714 ClutterGravity gravity)
11715{
11716 g_return_if_fail (CLUTTER_IS_ACTOR (self));
11717
11718 g_object_freeze_notify (G_OBJECT (self));
11719
11720 clutter_actor_set_scale_factor (self, CLUTTER_X_AXIS, scale_x);
11721 clutter_actor_set_scale_factor (self, CLUTTER_Y_AXIS, scale_y);
11722 clutter_actor_set_scale_gravity (self, gravity);
11723
11724 g_object_thaw_notify (G_OBJECT (self));
11725}
11726
11727/**
11728 * clutter_actor_get_scale:11781 * clutter_actor_get_scale:
11729 * @self: A #ClutterActor11782 * @self: A #ClutterActor
11730 * @scale_x: (out) (allow-none): Location to store horizonal11783 * @scale_x: (out) (allow-none): Location to store horizonal
@@ -12114,27 +12167,6 @@ clutter_actor_get_name (ClutterActor *self)
12114 return self->priv->name;12167 return self->priv->name;
12115}12168}
1211612169
12117/**
12118 * clutter_actor_get_gid:
12119 * @self: A #ClutterActor
12120 *
12121 * Retrieves the unique id for @self.
12122 *
12123 * Return value: Globally unique value for this object instance.
12124 *
12125 * Since: 0.6
12126 *
12127 * Deprecated: 1.8: The id is not used any longer, and this function
12128 * always returns 0.
12129 */
12130guint32
12131clutter_actor_get_gid (ClutterActor *self)
12132{
12133 g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0);
12134
12135 return 0;
12136}
12137
12138static inline void12170static inline void
12139clutter_actor_set_depth_internal (ClutterActor *self,12171clutter_actor_set_depth_internal (ClutterActor *self,
12140 float depth)12172 float depth)
@@ -12245,7 +12277,7 @@ clutter_actor_set_pivot_point (ClutterActor *self,
12245 gfloat pivot_x,12277 gfloat pivot_x,
12246 gfloat pivot_y)12278 gfloat pivot_y)
12247{12279{
12248 ClutterPoint pivot = CLUTTER_POINT_INIT (pivot_x, pivot_y);12280 graphene_point_t pivot = GRAPHENE_POINT_INIT (pivot_x, pivot_y);
12249 const ClutterTransformInfo *info;12281 const ClutterTransformInfo *info;
1225012282
12251 g_return_if_fail (CLUTTER_IS_ACTOR (self));12283 g_return_if_fail (CLUTTER_IS_ACTOR (self));
@@ -12406,7 +12438,7 @@ clutter_actor_set_rotation (ClutterActor *self,
12406 gfloat y,12438 gfloat y,
12407 gfloat z)12439 gfloat z)
12408{12440{
12409 ClutterVertex v;12441 graphene_point3d_t v;
1241012442
12411 g_return_if_fail (CLUTTER_IS_ACTOR (self));12443 g_return_if_fail (CLUTTER_IS_ACTOR (self));
1241212444
@@ -12603,7 +12635,6 @@ clutter_actor_set_clip (ClutterActor *self,
1260312635
12604 clutter_actor_queue_redraw (self);12636 clutter_actor_queue_redraw (self);
1260512637
12606 g_object_notify_by_pspec (obj, obj_props[PROP_CLIP]);
12607 g_object_notify_by_pspec (obj, obj_props[PROP_CLIP_RECT]);12638 g_object_notify_by_pspec (obj, obj_props[PROP_CLIP_RECT]);
12608 g_object_notify_by_pspec (obj, obj_props[PROP_HAS_CLIP]);12639 g_object_notify_by_pspec (obj, obj_props[PROP_HAS_CLIP]);
12609}12640}
@@ -13106,12 +13137,6 @@ clutter_actor_add_child_internal (ClutterActor *self,
13106 if (self->priv->in_cloned_branch)13137 if (self->priv->in_cloned_branch)
13107 clutter_actor_push_in_cloned_branch (child, self->priv->in_cloned_branch);13138 clutter_actor_push_in_cloned_branch (child, self->priv->in_cloned_branch);
1310813139
13109 /* if push_internal() has been called then we automatically set
13110 * the flag on the actor
13111 */
13112 if (self->priv->internal_child)
13113 CLUTTER_SET_PRIVATE_FLAGS (child, CLUTTER_INTERNAL_CHILD);
13114
13115 /* children may cause their parent to expand, if they are set13140 /* children may cause their parent to expand, if they are set
13116 * to expand; if a child is not expanded then it cannot change13141 * to expand; if a child is not expanded then it cannot change
13117 * its parent's state. any further change later on will queue13142 * its parent's state. any further change later on will queue
@@ -13129,7 +13154,6 @@ clutter_actor_add_child_internal (ClutterActor *self,
13129 clutter_actor_queue_compute_expand (self);13154 clutter_actor_queue_compute_expand (self);
13130 }13155 }
1313113156
13132 /* clutter_actor_reparent() will emit ::parent-set for us */
13133 if (emit_parent_set && !CLUTTER_ACTOR_IN_REPARENT (child))13157 if (emit_parent_set && !CLUTTER_ACTOR_IN_REPARENT (child))
13134 {13158 {
13135 child->priv->needs_compute_resource_scale = TRUE;13159 child->priv->needs_compute_resource_scale = TRUE;
@@ -13639,115 +13663,15 @@ clutter_actor_replace_child (ClutterActor *self,
13639 * Deprecated: 1.10: Use clutter_actor_remove_child() instead.13663 * Deprecated: 1.10: Use clutter_actor_remove_child() instead.
13640 */13664 */
13641void13665void
13642clutter_actor_unparent (ClutterActor *self)13666clutter_actor_unparent (ClutterActor *self)
13643{
13644 g_return_if_fail (CLUTTER_IS_ACTOR (self));
13645
13646 if (self->priv->parent == NULL)
13647 return;
13648
13649 clutter_actor_remove_child_internal (self->priv->parent, self,
13650 REMOVE_CHILD_LEGACY_FLAGS);
13651}
13652
13653/**
13654 * clutter_actor_reparent:
13655 * @self: a #ClutterActor
13656 * @new_parent: the new #ClutterActor parent
13657 *
13658 * Resets the parent actor of @self.
13659 *
13660 * This function is logically equivalent to calling clutter_actor_unparent()
13661 * and clutter_actor_set_parent(), but more efficiently implemented, as it
13662 * ensures the child is not finalized when unparented, and emits the
13663 * #ClutterActor::parent-set signal only once.
13664 *
13665 * In reality, calling this function is less useful than it sounds, as some
13666 * application code may rely on changes in the intermediate state between
13667 * removal and addition of the actor from its old parent to the @new_parent.
13668 * Thus, it is strongly encouraged to avoid using this function in application
13669 * code.
13670 *
13671 * Since: 0.2
13672 *
13673 * Deprecated: 1.10: Use clutter_actor_remove_child() and
13674 * clutter_actor_add_child() instead; remember to take a reference on
13675 * the actor being removed before calling clutter_actor_remove_child()
13676 * to avoid the reference count dropping to zero and the actor being
13677 * destroyed.
13678 */
13679void
13680clutter_actor_reparent (ClutterActor *self,
13681 ClutterActor *new_parent)
13682{13667{
13683 ClutterActorPrivate *priv;
13684
13685 g_return_if_fail (CLUTTER_IS_ACTOR (self));13668 g_return_if_fail (CLUTTER_IS_ACTOR (self));
13686 g_return_if_fail (CLUTTER_IS_ACTOR (new_parent));
13687 g_return_if_fail (self != new_parent);
13688
13689 if (CLUTTER_ACTOR_IS_TOPLEVEL (self))
13690 {
13691 g_warning ("Cannot set a parent on a toplevel actor");
13692 return;
13693 }
13694
13695 if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
13696 {
13697 g_warning ("Cannot set a parent currently being destroyed");
13698 return;
13699 }
13700
13701 priv = self->priv;
13702
13703 if (priv->parent != new_parent)
13704 {
13705 ClutterActor *old_parent;
13706
13707 CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_REPARENT);
13708
13709 old_parent = priv->parent;
13710
13711 g_object_ref (self);
13712
13713 if (old_parent != NULL)
13714 {
13715 /* go through the Container implementation if this is a regular
13716 * child and not an internal one
13717 */
13718 if (!CLUTTER_ACTOR_IS_INTERNAL_CHILD (self))
13719 {
13720 ClutterContainer *parent = CLUTTER_CONTAINER (old_parent);
13721
13722 /* this will have to call unparent() */
13723 clutter_container_remove_actor (parent, self);
13724 }
13725 else
13726 clutter_actor_remove_child_internal (old_parent, self,
13727 REMOVE_CHILD_LEGACY_FLAGS);
13728 }
13729
13730 /* Note, will call set_parent() */
13731 if (!CLUTTER_ACTOR_IS_INTERNAL_CHILD (self))
13732 clutter_container_add_actor (CLUTTER_CONTAINER (new_parent), self);
13733 else
13734 clutter_actor_add_child_internal (new_parent, self,
13735 ADD_CHILD_LEGACY_FLAGS,
13736 insert_child_at_depth,
13737 NULL);
13738
13739 priv->needs_compute_resource_scale = TRUE;
13740
13741 /* we emit the ::parent-set signal once */
13742 g_signal_emit (self, actor_signals[PARENT_SET], 0, old_parent);
13743
13744 CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_REPARENT);
1374513669
13746 /* the IN_REPARENT flag suspends state updates */13670 if (self->priv->parent == NULL)
13747 clutter_actor_update_map_state (self, MAP_STATE_CHECK);13671 return;
1374813672
13749 g_object_unref (self);13673 clutter_actor_remove_child_internal (self->priv->parent, self,
13750 }13674 REMOVE_CHILD_LEGACY_FLAGS);
13751}13675}
1375213676
13753/**13677/**
@@ -13917,134 +13841,6 @@ clutter_actor_set_child_at_index (ClutterActor *self,
13917 clutter_actor_queue_relayout (self);13841 clutter_actor_queue_relayout (self);
13918}13842}
1391913843
13920/**
13921 * clutter_actor_raise:
13922 * @self: A #ClutterActor
13923 * @below: (allow-none): A #ClutterActor to raise above.
13924 *
13925 * Puts @self above @below.
13926 *
13927 * Both actors must have the same parent, and the parent must implement
13928 * the #ClutterContainer interface
13929 *
13930 * This function calls clutter_container_raise_child() internally.
13931 *
13932 * Deprecated: 1.10: Use clutter_actor_set_child_above_sibling() instead.
13933 */
13934void
13935clutter_actor_raise (ClutterActor *self,
13936 ClutterActor *below)
13937{
13938 ClutterActor *parent;
13939
13940 g_return_if_fail (CLUTTER_IS_ACTOR (self));
13941
13942 parent = clutter_actor_get_parent (self);
13943 if (parent == NULL)
13944 {
13945 g_warning ("%s: Actor '%s' is not inside a container",
13946 G_STRFUNC,
13947 _clutter_actor_get_debug_name (self));
13948 return;
13949 }
13950
13951 if (below != NULL)
13952 {
13953 if (parent != clutter_actor_get_parent (below))
13954 {
13955 g_warning ("%s Actor '%s' is not in the same container as "
13956 "actor '%s'",
13957 G_STRFUNC,
13958 _clutter_actor_get_debug_name (self),
13959 _clutter_actor_get_debug_name (below));
13960 return;
13961 }
13962 }
13963
13964 clutter_container_raise_child (CLUTTER_CONTAINER (parent), self, below);
13965}
13966
13967/**
13968 * clutter_actor_lower:
13969 * @self: A #ClutterActor
13970 * @above: (allow-none): A #ClutterActor to lower below
13971 *
13972 * Puts @self below @above.
13973 *
13974 * Both actors must have the same parent, and the parent must implement
13975 * the #ClutterContainer interface.
13976 *
13977 * This function calls clutter_container_lower_child() internally.
13978 *
13979 * Deprecated: 1.10: Use clutter_actor_set_child_below_sibling() instead.
13980 */
13981void
13982clutter_actor_lower (ClutterActor *self,
13983 ClutterActor *above)
13984{
13985 ClutterActor *parent;
13986
13987 g_return_if_fail (CLUTTER_IS_ACTOR (self));
13988
13989 parent = clutter_actor_get_parent (self);
13990 if (parent == NULL)
13991 {
13992 g_warning ("%s: Actor of type %s is not inside a container",
13993 G_STRFUNC,
13994 _clutter_actor_get_debug_name (self));
13995 return;
13996 }
13997
13998 if (above)
13999 {
14000 if (parent != clutter_actor_get_parent (above))
14001 {
14002 g_warning ("%s: Actor '%s' is not in the same container as "
14003 "actor '%s'",
14004 G_STRFUNC,
14005 _clutter_actor_get_debug_name (self),
14006 _clutter_actor_get_debug_name (above));
14007 return;
14008 }
14009 }
14010
14011 clutter_container_lower_child (CLUTTER_CONTAINER (parent), self, above);
14012}
14013
14014/**
14015 * clutter_actor_raise_top:
14016 * @self: A #ClutterActor
14017 *
14018 * Raises @self to the top.
14019 *
14020 * This function calls clutter_actor_raise() internally.
14021 *
14022 * Deprecated: 1.10: Use clutter_actor_set_child_above_sibling() with
14023 * a %NULL sibling, instead.
14024 */
14025void
14026clutter_actor_raise_top (ClutterActor *self)
14027{
14028 clutter_actor_raise (self, NULL);
14029}
14030
14031/**
14032 * clutter_actor_lower_bottom:
14033 * @self: A #ClutterActor
14034 *
14035 * Lowers @self to the bottom.
14036 *
14037 * This function calls clutter_actor_lower() internally.
14038 *
14039 * Deprecated: 1.10: Use clutter_actor_set_child_below_sibling() with
14040 * a %NULL sibling, instead.
14041 */
14042void
14043clutter_actor_lower_bottom (ClutterActor *self)
14044{
14045 clutter_actor_lower (self, NULL);
14046}
14047
14048/*13844/*
14049 * Event handling13845 * Event handling
14050 */13846 */
@@ -14188,34 +13984,6 @@ clutter_actor_get_reactive (ClutterActor *actor)
14188}13984}
1418913985
14190/**13986/**
14191 * clutter_actor_get_anchor_point:
14192 * @self: a #ClutterActor
14193 * @anchor_x: (out): return location for the X coordinate of the anchor point
14194 * @anchor_y: (out): return location for the Y coordinate of the anchor point
14195 *
14196 * Gets the current anchor point of the @actor in pixels.
14197 *
14198 * Since: 0.6
14199 *
14200 * Deprecated: 1.12: Use #ClutterActor:pivot-point instead
14201 */
14202void
14203clutter_actor_get_anchor_point (ClutterActor *self,
14204 gfloat *anchor_x,
14205 gfloat *anchor_y)
14206{
14207 const ClutterTransformInfo *info;
14208
14209 g_return_if_fail (CLUTTER_IS_ACTOR (self));
14210
14211 info = _clutter_actor_get_transform_info_or_defaults (self);
14212 clutter_anchor_coord_get_units (self, &info->anchor,
14213 anchor_x,
14214 anchor_y,
14215 NULL);
14216}
14217
14218/**
14219 * clutter_actor_set_anchor_point:13987 * clutter_actor_set_anchor_point:
14220 * @self: a #ClutterActor13988 * @self: a #ClutterActor
14221 * @anchor_x: X coordinate of the anchor point13989 * @anchor_x: X coordinate of the anchor point
@@ -14729,40 +14497,6 @@ parse_actor_metas (ClutterScript *script,
14729 return g_slist_reverse (retval);14497 return g_slist_reverse (retval);
14730}14498}
1473114499
14732static GSList *
14733parse_behaviours (ClutterScript *script,
14734 ClutterActor *actor,
14735 JsonNode *node)
14736{
14737 GList *elements, *l;
14738 GSList *retval = NULL;
14739
14740 if (!JSON_NODE_HOLDS_ARRAY (node))
14741 return NULL;
14742
14743 elements = json_array_get_elements (json_node_get_array (node));
14744
14745 for (l = elements; l != NULL; l = l->next)
14746 {
14747 JsonNode *element = l->data;
14748 const gchar *id_ = _clutter_script_get_id_from_node (element);
14749 GObject *behaviour;
14750
14751 if (id_ == NULL || *id_ == '\0')
14752 continue;
14753
14754 behaviour = clutter_script_get_object (script, id_);
14755 if (behaviour == NULL)
14756 continue;
14757
14758 retval = g_slist_prepend (retval, behaviour);
14759 }
14760
14761 g_list_free (elements);
14762
14763 return g_slist_reverse (retval);
14764}
14765
14766static ClutterMargin *14500static ClutterMargin *
14767parse_margin (ClutterActor *self,14501parse_margin (ClutterActor *self,
14768 JsonNode *node)14502 JsonNode *node)
@@ -14878,24 +14612,6 @@ clutter_actor_parse_custom_node (ClutterScriptable *scriptable,
14878 else14612 else
14879 g_slice_free (RotationInfo, info);14613 g_slice_free (RotationInfo, info);
14880 }14614 }
14881 else if (strcmp (name, "behaviours") == 0)
14882 {
14883 GSList *l;
14884
14885#ifdef CLUTTER_ENABLE_DEBUG
14886 if (G_UNLIKELY (_clutter_diagnostic_enabled ()))
14887 _clutter_diagnostic_message ("The 'behaviours' key is deprecated "
14888 "and it should not be used in newly "
14889 "written ClutterScript definitions.");
14890#endif
14891
14892 l = parse_behaviours (script, actor, node);
14893
14894 g_value_init (value, G_TYPE_POINTER);
14895 g_value_set_pointer (value, l);
14896
14897 retval = TRUE;
14898 }
14899 else if (strcmp (name, "actions") == 0 ||14615 else if (strcmp (name, "actions") == 0 ||
14900 strcmp (name, "constraints") == 0 ||14616 strcmp (name, "constraints") == 0 ||
14901 strcmp (name, "effects") == 0)14617 strcmp (name, "effects") == 0)
@@ -14966,26 +14682,6 @@ clutter_actor_set_custom_property (ClutterScriptable *scriptable,
14966 return;14682 return;
14967 }14683 }
1496814684
14969 if (strcmp (name, "behaviours") == 0)
14970 {
14971 GSList *behaviours, *l;
14972
14973 if (!G_VALUE_HOLDS (value, G_TYPE_POINTER))
14974 return;
14975
14976 behaviours = g_value_get_pointer (value);
14977 for (l = behaviours; l != NULL; l = l->next)
14978 {
14979 ClutterBehaviour *behaviour = l->data;
14980
14981 clutter_behaviour_apply (behaviour, actor);
14982 }
14983
14984 g_slist_free (behaviours);
14985
14986 return;
14987 }
14988
14989 if (strcmp (name, "actions") == 0 ||14685 if (strcmp (name, "actions") == 0 ||
14990 strcmp (name, "constraints") == 0 ||14686 strcmp (name, "constraints") == 0 ||
14991 strcmp (name, "effects") == 0)14687 strcmp (name, "effects") == 0)
@@ -15409,7 +15105,7 @@ clutter_actor_transform_stage_point (ClutterActor *self,
15409 gfloat *x_out,15105 gfloat *x_out,
15410 gfloat *y_out)15106 gfloat *y_out)
15411{15107{
15412 ClutterVertex v[4];15108 graphene_point3d_t v[4];
15413 double ST[3][3];15109 double ST[3][3];
15414 double RQ[3][3];15110 double RQ[3][3];
15415 int du, dv;15111 int du, dv;
@@ -16047,7 +15743,7 @@ update_pango_context (ClutterBackend *backend,
16047 * stored by the #ClutterBackend change.15743 * stored by the #ClutterBackend change.
16048 *15744 *
16049 * You can use the returned #PangoContext to create a #PangoLayout15745 * You can use the returned #PangoContext to create a #PangoLayout
16050 * and render text using cogl_pango_render_layout() to reuse the15746 * and render text using cogl_pango_show_layout() to reuse the
16051 * glyphs cache also used by Clutter.15747 * glyphs cache also used by Clutter.
16052 *15748 *
16053 * Return value: (transfer none): the #PangoContext for a #ClutterActor.15749 * Return value: (transfer none): the #PangoContext for a #ClutterActor.
@@ -16546,25 +16242,6 @@ clutter_actor_unset_flags (ClutterActor *self,
16546 g_object_thaw_notify (obj);16242 g_object_thaw_notify (obj);
16547}16243}
1654816244
16549/**
16550 * clutter_actor_get_transformation_matrix:
16551 * @self: a #ClutterActor
16552 * @matrix: (out caller-allocates): the return location for a #ClutterMatrix
16553 *
16554 * Retrieves the transformations applied to @self relative to its
16555 * parent.
16556 *
16557 * Since: 1.0
16558 *
16559 * Deprecated: 1.12: Use clutter_actor_get_transform() instead
16560 */
16561void
16562clutter_actor_get_transformation_matrix (ClutterActor *self,
16563 ClutterMatrix *matrix)
16564{
16565 clutter_actor_get_transform (self, matrix);
16566}
16567
16568static void16245static void
16569clutter_actor_set_transform_internal (ClutterActor *self,16246clutter_actor_set_transform_internal (ClutterActor *self,
16570 const ClutterMatrix *transform)16247 const ClutterMatrix *transform)
@@ -16827,100 +16504,6 @@ clutter_actor_get_text_direction (ClutterActor *self)
16827}16504}
1682816505
16829/**16506/**
16830 * clutter_actor_push_internal:
16831 * @self: a #ClutterActor
16832 *
16833 * Should be used by actors implementing the #ClutterContainer and with
16834 * internal children added through clutter_actor_set_parent(), for instance:
16835 *
16836 * |[<!-- language="C" -->
16837 * static void
16838 * my_actor_init (MyActor *self)
16839 * {
16840 * self->priv = my_actor_get_instance_private (self);
16841 *
16842 * clutter_actor_push_internal (CLUTTER_ACTOR (self));
16843 *
16844 * // calling clutter_actor_set_parent() now will result in
16845 * // the internal flag being set on a child of MyActor
16846 *
16847 * // internal child - a background texture
16848 * self->priv->background_tex = clutter_texture_new ();
16849 * clutter_actor_set_parent (self->priv->background_tex,
16850 * CLUTTER_ACTOR (self));
16851 *
16852 * // internal child - a label
16853 * self->priv->label = clutter_text_new ();
16854 * clutter_actor_set_parent (self->priv->label,
16855 * CLUTTER_ACTOR (self));
16856 *
16857 * clutter_actor_pop_internal (CLUTTER_ACTOR (self));
16858 *
16859 * // calling clutter_actor_set_parent() now will not result in
16860 * // the internal flag being set on a child of MyActor
16861 * }
16862 * ]|
16863 *
16864 * This function will be used by Clutter to toggle an "internal child"
16865 * flag whenever clutter_actor_set_parent() is called; internal children
16866 * are handled differently by Clutter, specifically when destroying their
16867 * parent.
16868 *
16869 * Call clutter_actor_pop_internal() when you finished adding internal
16870 * children.
16871 *
16872 * Nested calls to clutter_actor_push_internal() are allowed, but each
16873 * one must by followed by a clutter_actor_pop_internal() call.
16874 *
16875 * Since: 1.2
16876 *
16877 * Deprecated: 1.10: All children of an actor are accessible through
16878 * the #ClutterActor API, and #ClutterActor implements the
16879 * #ClutterContainer interface, so this function is only useful
16880 * for legacy containers overriding the default implementation.
16881 */
16882void
16883clutter_actor_push_internal (ClutterActor *self)
16884{
16885 g_return_if_fail (CLUTTER_IS_ACTOR (self));
16886
16887 self->priv->internal_child += 1;
16888}
16889
16890/**
16891 * clutter_actor_pop_internal:
16892 * @self: a #ClutterActor
16893 *
16894 * Disables the effects of clutter_actor_push_internal().
16895 *
16896 * Since: 1.2
16897 *
16898 * Deprecated: 1.10: All children of an actor are accessible through
16899 * the #ClutterActor API. This function is only useful for legacy
16900 * containers overriding the default implementation of the
16901 * #ClutterContainer interface.
16902 */
16903void
16904clutter_actor_pop_internal (ClutterActor *self)
16905{
16906 ClutterActorPrivate *priv;
16907
16908 g_return_if_fail (CLUTTER_IS_ACTOR (self));
16909
16910 priv = self->priv;
16911
16912 if (priv->internal_child == 0)
16913 {
16914 g_warning ("Mismatched %s: you need to call "
16915 "clutter_actor_push_composite() at least once before "
16916 "calling this function", G_STRFUNC);
16917 return;
16918 }
16919
16920 priv->internal_child -= 1;
16921}
16922
16923/**
16924 * clutter_actor_has_pointer:16507 * clutter_actor_has_pointer:
16925 * @self: a #ClutterActor16508 * @self: a #ClutterActor
16926 *16509 *
@@ -17979,9 +17562,9 @@ clutter_actor_get_paint_box (ClutterActor *self,
17979}17562}
1798017563
17981static gboolean17564static gboolean
17982_clutter_actor_get_resource_scale_for_rect (ClutterActor *self,17565_clutter_actor_get_resource_scale_for_rect (ClutterActor *self,
17983 ClutterRect *bounding_rect,17566 graphene_rect_t *bounding_rect,
17984 float *resource_scale)17567 float *resource_scale)
17985{17568{
17986 ClutterActor *stage;17569 ClutterActor *stage;
17987 float max_scale = 0;17570 float max_scale = 0;
@@ -18004,7 +17587,7 @@ static gboolean
18004_clutter_actor_compute_resource_scale (ClutterActor *self,17587_clutter_actor_compute_resource_scale (ClutterActor *self,
18005 float *resource_scale)17588 float *resource_scale)
18006{17589{
18007 ClutterRect bounding_rect;17590 graphene_rect_t bounding_rect;
18008 ClutterActorPrivate *priv = self->priv;17591 ClutterActorPrivate *priv = self->priv;
1800917592
18010 if (CLUTTER_ACTOR_IN_DESTRUCTION (self) ||17593 if (CLUTTER_ACTOR_IN_DESTRUCTION (self) ||
@@ -18548,13 +18131,13 @@ clutter_actor_get_layout_manager (ClutterActor *self)
18548}18131}
1854918132
18550static const ClutterLayoutInfo default_layout_info = {18133static const ClutterLayoutInfo default_layout_info = {
18551 CLUTTER_POINT_INIT_ZERO, /* fixed-pos */18134 GRAPHENE_POINT_INIT_ZERO, /* fixed-pos */
18552 { 0, 0, 0, 0 }, /* margin */18135 { 0, 0, 0, 0 }, /* margin */
18553 CLUTTER_ACTOR_ALIGN_FILL, /* x-align */18136 CLUTTER_ACTOR_ALIGN_FILL, /* x-align */
18554 CLUTTER_ACTOR_ALIGN_FILL, /* y-align */18137 CLUTTER_ACTOR_ALIGN_FILL, /* y-align */
18555 FALSE, FALSE, /* expand */18138 FALSE, FALSE, /* expand */
18556 CLUTTER_SIZE_INIT_ZERO, /* minimum */18139 GRAPHENE_SIZE_INIT_ZERO, /* minimum */
18557 CLUTTER_SIZE_INIT_ZERO, /* natural */18140 GRAPHENE_SIZE_INIT_ZERO, /* natural */
18558};18141};
1855918142
18560static void18143static void
@@ -19500,7 +19083,7 @@ transition_closure_free (gpointer data)
19500 * so that we don't end up inside on_transition_stopped() from19083 * so that we don't end up inside on_transition_stopped() from
19501 * a call to g_hash_table_remove().19084 * a call to g_hash_table_remove().
19502 */19085 */
19503 g_signal_handler_disconnect (clos->transition, clos->completed_id);19086 g_clear_signal_handler (&clos->completed_id, clos->transition);
1950419087
19505 if (clutter_timeline_is_playing (timeline))19088 if (clutter_timeline_is_playing (timeline))
19506 clutter_timeline_stop (timeline);19089 clutter_timeline_stop (timeline);
@@ -19682,8 +19265,8 @@ _clutter_actor_create_transition (ClutterActor *actor,
19682 gboolean call_restore = FALSE;19265 gboolean call_restore = FALSE;
19683 TransitionClosure *clos;19266 TransitionClosure *clos;
19684 va_list var_args;19267 va_list var_args;
19685 GValue initial = G_VALUE_INIT;19268 g_auto (GValue) initial = G_VALUE_INIT;
19686 GValue final = G_VALUE_INIT;19269 g_auto (GValue) final = G_VALUE_INIT;
19687 GType ptype;19270 GType ptype;
19688 char *error;19271 char *error;
1968919272
@@ -19732,7 +19315,6 @@ _clutter_actor_create_transition (ClutterActor *actor,
19732 if (error != NULL)19315 if (error != NULL)
19733 {19316 {
19734 g_critical ("%s: %s", G_STRLOC, error);19317 g_critical ("%s: %s", G_STRLOC, error);
19735 g_value_unset (&initial);
19736 g_free (error);19318 g_free (error);
19737 goto out;19319 goto out;
19738 }19320 }
@@ -19754,9 +19336,6 @@ _clutter_actor_create_transition (ClutterActor *actor,
19754 &final,19336 &final,
19755 pspec);19337 pspec);
1975619338
19757 g_value_unset (&initial);
19758 g_value_unset (&final);
19759
19760 goto out;19339 goto out;
19761 }19340 }
1976219341
@@ -19804,9 +19383,6 @@ _clutter_actor_create_transition (ClutterActor *actor,
1980419383
19805 /* the actor now owns the transition */19384 /* the actor now owns the transition */
19806 g_object_unref (res);19385 g_object_unref (res);
19807
19808 g_value_unset (&initial);
19809 g_value_unset (&final);
19810 }19386 }
19811 else19387 else
19812 {19388 {
@@ -21293,32 +20869,6 @@ clutter_actor_has_mapped_clones (ClutterActor *self)
21293 return FALSE;20869 return FALSE;
21294}20870}
2129520871
21296CoglFramebuffer *
21297_clutter_actor_get_active_framebuffer (ClutterActor *self)
21298{
21299 ClutterStage *stage;
21300
21301 if (!CLUTTER_ACTOR_IN_PAINT (self))
21302 {
21303 g_critical ("The active framebuffer of actor '%s' can only be "
21304 "retrieved during the paint sequence. Please, check "
21305 "your code.",
21306 _clutter_actor_get_debug_name (self));
21307 return NULL;
21308 }
21309
21310 stage = (ClutterStage *) _clutter_actor_get_stage_internal (self);
21311 if (stage == NULL)
21312 {
21313 g_critical ("The active framebuffer of actor '%s' is only available "
21314 "if the actor is associated to a ClutterStage.",
21315 _clutter_actor_get_debug_name (self));
21316 return NULL;
21317 }
21318
21319 return _clutter_stage_get_active_framebuffer (stage);
21320}
21321
21322static void20872static void
21323clutter_actor_child_model__items_changed (GListModel *model,20873clutter_actor_child_model__items_changed (GListModel *model,
21324 guint position,20874 guint position,
diff --git a/clutter/clutter/clutter-actor.h b/clutter/clutter/clutter-actor.h
index b1abff8..bb968dd 100644
--- a/clutter/clutter/clutter-actor.h
+++ b/clutter/clutter/clutter-actor.h
@@ -39,6 +39,8 @@
3939
40#include <clutter/clutter-types.h>40#include <clutter/clutter-types.h>
41#include <clutter/clutter-event.h>41#include <clutter/clutter-event.h>
42#include <clutter/clutter-paint-context.h>
43#include <clutter/clutter-pick-context.h>
4244
43G_BEGIN_DECLS45G_BEGIN_DECLS
4446
@@ -228,13 +230,14 @@ struct _ClutterActorClass
228 void (* unrealize) (ClutterActor *self);230 void (* unrealize) (ClutterActor *self);
229 void (* map) (ClutterActor *self);231 void (* map) (ClutterActor *self);
230 void (* unmap) (ClutterActor *self);232 void (* unmap) (ClutterActor *self);
231 void (* paint) (ClutterActor *self);233 void (* paint) (ClutterActor *self,
234 ClutterPaintContext *paint_context);
232 void (* parent_set) (ClutterActor *actor,235 void (* parent_set) (ClutterActor *actor,
233 ClutterActor *old_parent);236 ClutterActor *old_parent);
234237
235 void (* destroy) (ClutterActor *self);238 void (* destroy) (ClutterActor *self);
236 void (* pick) (ClutterActor *actor,239 void (* pick) (ClutterActor *actor,
237 const ClutterColor *color);240 ClutterPickContext *pick_context);
238241
239 gboolean (* queue_redraw) (ClutterActor *actor,242 gboolean (* queue_redraw) (ClutterActor *actor,
240 ClutterActor *leaf_that_queued,243 ClutterActor *leaf_that_queued,
@@ -350,9 +353,17 @@ void clutter_actor_map
350CLUTTER_EXPORT353CLUTTER_EXPORT
351void clutter_actor_unmap (ClutterActor *self);354void clutter_actor_unmap (ClutterActor *self);
352CLUTTER_EXPORT355CLUTTER_EXPORT
353void clutter_actor_paint (ClutterActor *self);356void clutter_actor_paint (ClutterActor *self,
357 ClutterPaintContext *paint_context);
354CLUTTER_EXPORT358CLUTTER_EXPORT
355void clutter_actor_continue_paint (ClutterActor *self);359void clutter_actor_continue_paint (ClutterActor *self,
360 ClutterPaintContext *paint_context);
361CLUTTER_EXPORT
362void clutter_actor_pick (ClutterActor *actor,
363 ClutterPickContext *pick_context);
364CLUTTER_EXPORT
365void clutter_actor_continue_pick (ClutterActor *actor,
366 ClutterPickContext *pick_context);
356CLUTTER_EXPORT367CLUTTER_EXPORT
357void clutter_actor_queue_redraw (ClutterActor *self);368void clutter_actor_queue_redraw (ClutterActor *self);
358CLUTTER_EXPORT369CLUTTER_EXPORT
@@ -431,7 +442,7 @@ void clutter_actor_get_allocation_box
431CLUTTER_EXPORT442CLUTTER_EXPORT
432void clutter_actor_get_allocation_vertices (ClutterActor *self,443void clutter_actor_get_allocation_vertices (ClutterActor *self,
433 ClutterActor *ancestor,444 ClutterActor *ancestor,
434 ClutterVertex verts[]);445 graphene_point3d_t *verts);
435CLUTTER_EXPORT446CLUTTER_EXPORT
436gboolean clutter_actor_has_allocation (ClutterActor *self);447gboolean clutter_actor_has_allocation (ClutterActor *self);
437CLUTTER_EXPORT448CLUTTER_EXPORT
@@ -817,16 +828,16 @@ gboolean clutter_actor_transform_stage_point
817 gfloat *y_out);828 gfloat *y_out);
818CLUTTER_EXPORT829CLUTTER_EXPORT
819void clutter_actor_get_abs_allocation_vertices (ClutterActor *self,830void clutter_actor_get_abs_allocation_vertices (ClutterActor *self,
820 ClutterVertex verts[]);831 graphene_point3d_t *verts);
821CLUTTER_EXPORT832CLUTTER_EXPORT
822void clutter_actor_apply_transform_to_point (ClutterActor *self,833void clutter_actor_apply_transform_to_point (ClutterActor *self,
823 const ClutterVertex *point,834 const graphene_point3d_t *point,
824 ClutterVertex *vertex);835 graphene_point3d_t *vertex);
825CLUTTER_EXPORT836CLUTTER_EXPORT
826void clutter_actor_apply_relative_transform_to_point (ClutterActor *self,837void clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
827 ClutterActor *ancestor,838 ClutterActor *ancestor,
828 const ClutterVertex *point,839 const graphene_point3d_t *point,
829 ClutterVertex *vertex);840 graphene_point3d_t *vertex);
830841
831/* Implicit animations */842/* Implicit animations */
832CLUTTER_EXPORT843CLUTTER_EXPORT
@@ -904,6 +915,7 @@ void clutter_actor_bind_model_with_properties
904915
905CLUTTER_EXPORT916CLUTTER_EXPORT
906void clutter_actor_pick_box (ClutterActor *self,917void clutter_actor_pick_box (ClutterActor *self,
918 ClutterPickContext *pick_context,
907 const ClutterActorBox *box);919 const ClutterActorBox *box);
908920
909G_END_DECLS921G_END_DECLS
diff --git a/clutter/clutter/clutter-animatable.c b/clutter/clutter/clutter-animatable.c
index 0bb3409..e8c9511 100644
--- a/clutter/clutter/clutter-animatable.c
+++ b/clutter/clutter/clutter-animatable.c
@@ -54,7 +54,6 @@
54#include "clutter-debug.h"54#include "clutter-debug.h"
55#include "clutter-private.h"55#include "clutter-private.h"
5656
57#include "deprecated/clutter-animatable.h"
58#include "deprecated/clutter-animation.h"57#include "deprecated/clutter-animation.h"
5958
60G_DEFINE_INTERFACE (ClutterAnimatable, clutter_animatable, G_TYPE_OBJECT);59G_DEFINE_INTERFACE (ClutterAnimatable, clutter_animatable, G_TYPE_OBJECT);
@@ -65,80 +64,6 @@ clutter_animatable_default_init (ClutterAnimatableInterface *iface)
65}64}
6665
67/**66/**
68 * clutter_animatable_animate_property:
69 * @animatable: a #ClutterAnimatable
70 * @animation: a #ClutterAnimation
71 * @property_name: the name of the animated property
72 * @initial_value: the initial value of the animation interval
73 * @final_value: the final value of the animation interval
74 * @progress: the progress factor
75 * @value: return location for the animation value
76 *
77 * Calls the animate_property() virtual function for @animatable.
78 *
79 * The @initial_value and @final_value #GValue<!-- -->s must contain
80 * the same type; @value must have been initialized to the same
81 * type of @initial_value and @final_value.
82 *
83 * All implementation of the #ClutterAnimatable interface must
84 * implement this function.
85 *
86 * Return value: %TRUE if the value has been validated and can
87 * be applied to the #ClutterAnimatable, and %FALSE otherwise
88 *
89 * Since: 1.0
90 *
91 * Deprecated: 1.8: Use clutter_animatable_interpolate_value()
92 * instead
93 */
94gboolean
95clutter_animatable_animate_property (ClutterAnimatable *animatable,
96 ClutterAnimation *animation,
97 const gchar *property_name,
98 const GValue *initial_value,
99 const GValue *final_value,
100 gdouble progress,
101 GValue *value)
102{
103 ClutterAnimatableInterface *iface;
104 gboolean res;
105
106 g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE);
107 g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), FALSE);
108 g_return_val_if_fail (property_name != NULL, FALSE);
109 g_return_val_if_fail (initial_value != NULL && final_value != NULL, FALSE);
110 g_return_val_if_fail (G_VALUE_TYPE (initial_value) != G_TYPE_INVALID, FALSE);
111 g_return_val_if_fail (G_VALUE_TYPE (final_value) != G_TYPE_INVALID, FALSE);
112 g_return_val_if_fail (value != NULL, FALSE);
113 g_return_val_if_fail (G_VALUE_TYPE (value) == G_VALUE_TYPE (initial_value) &&
114 G_VALUE_TYPE (value) == G_VALUE_TYPE (final_value),
115 FALSE);
116
117 iface = CLUTTER_ANIMATABLE_GET_IFACE (animatable);
118 if (iface->animate_property == NULL)
119 {
120 ClutterInterval *interval;
121
122 interval = clutter_animation_get_interval (animation, property_name);
123 if (interval == NULL)
124 return FALSE;
125
126 res = clutter_animatable_interpolate_value (animatable, property_name,
127 interval,
128 progress,
129 value);
130 }
131 else
132 res = iface->animate_property (animatable, animation,
133 property_name,
134 initial_value, final_value,
135 progress,
136 value);
137
138 return res;
139}
140
141/**
142 * clutter_animatable_find_property:67 * clutter_animatable_find_property:
143 * @animatable: a #ClutterAnimatable68 * @animatable: a #ClutterAnimatable
144 * @property_name: the name of the animatable property to find69 * @property_name: the name of the animatable property to find
diff --git a/clutter/clutter/clutter-autocleanups.h b/clutter/clutter/clutter-autocleanups.h
index 0a68c05..8e17d00 100644
--- a/clutter/clutter/clutter-autocleanups.h
+++ b/clutter/clutter/clutter-autocleanups.h
@@ -90,13 +90,10 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActorBox, clutter_actor_box_free)
90G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterColor, clutter_color_free)90G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterColor, clutter_color_free)
91G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterMargin, clutter_margin_free)91G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterMargin, clutter_margin_free)
92G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterMatrix, clutter_matrix_free)92G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterMatrix, clutter_matrix_free)
93G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintContext, clutter_paint_context_unref)
93G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintNode, clutter_paint_node_unref)94G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintNode, clutter_paint_node_unref)
94G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintVolume, clutter_paint_volume_free)95G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintVolume, clutter_paint_volume_free)
95G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPathNode, clutter_path_node_free)96G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPathNode, clutter_path_node_free)
96G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPoint, clutter_point_free)
97G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterRect, clutter_rect_free)
98G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterSize, clutter_size_free)
99G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterVertex, clutter_vertex_free)
10097
101#endif /* __GI_SCANNER__ */98#endif /* __GI_SCANNER__ */
10299
diff --git a/clutter/clutter/clutter-backend-private.h b/clutter/clutter/clutter-backend-private.h
index f0855e1..c7c54f8 100644
--- a/clutter/clutter/clutter-backend-private.h
+++ b/clutter/clutter/clutter-backend-private.h
@@ -23,8 +23,7 @@
23#define __CLUTTER_BACKEND_PRIVATE_H__23#define __CLUTTER_BACKEND_PRIVATE_H__
2424
25#include <clutter/clutter-backend.h>25#include <clutter/clutter-backend.h>
26#include <clutter/clutter-device-manager.h>26#include <clutter/clutter-seat.h>
27#include <clutter/clutter-keymap.h>
28#include <clutter/clutter-stage-window.h>27#include <clutter/clutter-stage-window.h>
2928
30#define CLUTTER_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BACKEND, ClutterBackendClass))29#define CLUTTER_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BACKEND, ClutterBackendClass))
@@ -47,8 +46,6 @@ struct _ClutterBackend
4746
48 CoglOnscreen *dummy_onscreen;47 CoglOnscreen *dummy_onscreen;
4948
50 ClutterDeviceManager *device_manager;
51
52 cairo_font_options_t *font_options;49 cairo_font_options_t *font_options;
5350
54 gchar *font_name;51 gchar *font_name;
@@ -59,8 +56,6 @@ struct _ClutterBackend
59 ClutterStageWindow *stage_window;56 ClutterStageWindow *stage_window;
6057
61 ClutterInputMethod *input_method;58 ClutterInputMethod *input_method;
62
63 ClutterKeymap *keymap;
64};59};
6560
66struct _ClutterBackendClass61struct _ClutterBackendClass
@@ -89,17 +84,12 @@ struct _ClutterBackendClass
89 GError **error);84 GError **error);
90 gboolean (* create_context) (ClutterBackend *backend,85 gboolean (* create_context) (ClutterBackend *backend,
91 GError **error);86 GError **error);
92 ClutterDeviceManager *(* get_device_manager) (ClutterBackend *backend);
9387
94 gboolean (* translate_event) (ClutterBackend *backend,88 gboolean (* translate_event) (ClutterBackend *backend,
95 gpointer native,89 gpointer native,
96 ClutterEvent *event);90 ClutterEvent *event);
9791
98 PangoDirection (* get_keymap_direction) (ClutterBackend *backend);92 ClutterSeat * (* get_default_seat) (ClutterBackend *backend);
99
100 void (* bell_notify) (ClutterBackend *backend);
101
102 ClutterKeymap * (* get_keymap) (ClutterBackend *backend);
10393
104 /* signals */94 /* signals */
105 void (* resolution_changed) (ClutterBackend *backend);95 void (* resolution_changed) (ClutterBackend *backend);
@@ -139,11 +129,6 @@ gfloat _clutter_backend_get_units_per_em (Clutter
139 PangoFontDescription *font_desc);129 PangoFontDescription *font_desc);
140gint32 _clutter_backend_get_units_serial (ClutterBackend *backend);130gint32 _clutter_backend_get_units_serial (ClutterBackend *backend);
141131
142PangoDirection _clutter_backend_get_keymap_direction (ClutterBackend *backend);
143
144CLUTTER_EXPORT
145void _clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend);
146
147void clutter_set_allowed_drivers (const char *drivers);132void clutter_set_allowed_drivers (const char *drivers);
148133
149CLUTTER_EXPORT134CLUTTER_EXPORT
diff --git a/clutter/clutter/clutter-backend.c b/clutter/clutter/clutter-backend.c
index 4652bc7..3cc4ca2 100644
--- a/clutter/clutter/clutter-backend.c
+++ b/clutter/clutter/clutter-backend.c
@@ -51,7 +51,6 @@
51#include "clutter-stage-manager-private.h"51#include "clutter-stage-manager-private.h"
52#include "clutter-stage-private.h"52#include "clutter-stage-private.h"
53#include "clutter-stage-window.h"53#include "clutter-stage-window.h"
54#include "clutter-device-manager-private.h"
5554
56#ifdef CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT55#ifdef CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT
57#include "wayland/clutter-wayland-compositor.h"56#include "wayland/clutter-wayland-compositor.h"
@@ -528,30 +527,6 @@ clutter_backend_real_init_events (ClutterBackend *backend)
528 g_error ("Unknown input backend");527 g_error ("Unknown input backend");
529}528}
530529
531static ClutterDeviceManager *
532clutter_backend_real_get_device_manager (ClutterBackend *backend)
533{
534 if (G_UNLIKELY (backend->device_manager == NULL))
535 {
536 g_critical ("No device manager available, expect broken input");
537 return NULL;
538 }
539
540 return backend->device_manager;
541}
542
543static ClutterKeymap *
544clutter_backend_real_get_keymap (ClutterBackend *backend)
545{
546 if (G_UNLIKELY (backend->keymap == NULL))
547 {
548 g_critical ("No keymap available, expect broken keyboard input");
549 return NULL;
550 }
551
552 return backend->keymap;
553}
554
555static void530static void
556clutter_backend_class_init (ClutterBackendClass *klass)531clutter_backend_class_init (ClutterBackendClass *klass)
557{532{
@@ -615,10 +590,8 @@ clutter_backend_class_init (ClutterBackendClass *klass)
615 klass->font_changed = clutter_backend_real_font_changed;590 klass->font_changed = clutter_backend_real_font_changed;
616591
617 klass->init_events = clutter_backend_real_init_events;592 klass->init_events = clutter_backend_real_init_events;
618 klass->get_device_manager = clutter_backend_real_get_device_manager;
619 klass->create_context = clutter_backend_real_create_context;593 klass->create_context = clutter_backend_real_create_context;
620 klass->get_features = clutter_backend_real_get_features;594 klass->get_features = clutter_backend_real_get_features;
621 klass->get_keymap = clutter_backend_real_get_keymap;
622}595}
623596
624static void597static void
@@ -627,7 +600,7 @@ clutter_backend_init (ClutterBackend *self)
627 self->units_per_em = -1.0;600 self->units_per_em = -1.0;
628 self->units_serial = 1;601 self->units_serial = 1;
629602
630 self->dummy_onscreen = COGL_INVALID_HANDLE;603 self->dummy_onscreen = NULL;
631}604}
632605
633void606void
@@ -783,24 +756,24 @@ _clutter_backend_copy_event_data (ClutterBackend *backend,
783 const ClutterEvent *src,756 const ClutterEvent *src,
784 ClutterEvent *dest)757 ClutterEvent *dest)
785{758{
786 ClutterDeviceManagerClass *device_manager_class;759 ClutterSeatClass *seat_class;
787 ClutterDeviceManager *device_manager;760 ClutterSeat *seat;
788761
789 device_manager = clutter_device_manager_get_default ();762 seat = clutter_backend_get_default_seat (backend);
790 device_manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);763 seat_class = CLUTTER_SEAT_GET_CLASS (seat);
791 device_manager_class->copy_event_data (device_manager, src, dest);764 seat_class->copy_event_data (seat, src, dest);
792}765}
793766
794void767void
795_clutter_backend_free_event_data (ClutterBackend *backend,768_clutter_backend_free_event_data (ClutterBackend *backend,
796 ClutterEvent *event)769 ClutterEvent *event)
797{770{
798 ClutterDeviceManagerClass *device_manager_class;771 ClutterSeatClass *seat_class;
799 ClutterDeviceManager *device_manager;772 ClutterSeat *seat;
800773
801 device_manager = clutter_device_manager_get_default ();774 seat = clutter_backend_get_default_seat (backend);
802 device_manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);775 seat_class = CLUTTER_SEAT_GET_CLASS (seat);
803 device_manager_class->free_event_data (device_manager, event);776 seat_class->free_event_data (seat, event);
804}777}
805778
806/**779/**
@@ -997,39 +970,6 @@ clutter_wayland_set_compositor_display (void *display)
997}970}
998#endif971#endif
999972
1000PangoDirection
1001_clutter_backend_get_keymap_direction (ClutterBackend *backend)
1002{
1003 ClutterBackendClass *klass;
1004
1005 klass = CLUTTER_BACKEND_GET_CLASS (backend);
1006 if (klass->get_keymap_direction != NULL)
1007 return klass->get_keymap_direction (backend);
1008
1009 return PANGO_DIRECTION_NEUTRAL;
1010}
1011
1012void
1013_clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
1014{
1015 if (backend->dummy_onscreen == COGL_INVALID_HANDLE)
1016 {
1017 GError *internal_error = NULL;
1018
1019 backend->dummy_onscreen = cogl_onscreen_new (backend->cogl_context, 1, 1);
1020
1021 if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (backend->dummy_onscreen),
1022 &internal_error))
1023 {
1024 g_critical ("Unable to create dummy onscreen: %s", internal_error->message);
1025 g_error_free (internal_error);
1026 return;
1027 }
1028 }
1029
1030 cogl_set_framebuffer (COGL_FRAMEBUFFER (backend->dummy_onscreen));
1031}
1032
1033void973void
1034clutter_set_allowed_drivers (const char *drivers)974clutter_set_allowed_drivers (const char *drivers)
1035{975{
@@ -1042,16 +982,6 @@ clutter_set_allowed_drivers (const char *drivers)
1042 allowed_drivers = g_strdup (drivers);982 allowed_drivers = g_strdup (drivers);
1043}983}
1044984
1045void
1046clutter_backend_bell_notify (ClutterBackend *backend)
1047{
1048 ClutterBackendClass *klass;
1049
1050 klass = CLUTTER_BACKEND_GET_CLASS (backend);
1051 if (klass->bell_notify)
1052 klass->bell_notify (backend);
1053}
1054
1055/**985/**
1056 * clutter_backend_get_input_method:986 * clutter_backend_get_input_method:
1057 * @backend: the #CLutterBackend987 * @backend: the #CLutterBackend
@@ -1080,22 +1010,24 @@ clutter_backend_set_input_method (ClutterBackend *backend,
1080 g_set_object (&backend->input_method, method);1010 g_set_object (&backend->input_method, method);
1081}1011}
10821012
1013ClutterStageWindow *
1014clutter_backend_get_stage_window (ClutterBackend *backend)
1015{
1016 return backend->stage_window;
1017}
1018
1083/**1019/**
1084 * clutter_backend_get_keymap:1020 * clutter_backend_get_default_seat:
1085 * @backend: the #ClutterBackend1021 * @backend: the #ClutterBackend
1086 *1022 *
1087 * Gets the keymap used by Clutter1023 * Returns the default seat
1088 *1024 *
1089 * Returns: (transfer none): the keymap1025 * Returns: (transfer none): the default seat
1090 **/1026 **/
1091ClutterKeymap *1027ClutterSeat *
1092clutter_backend_get_keymap (ClutterBackend *backend)1028clutter_backend_get_default_seat (ClutterBackend *backend)
1093{1029{
1094 return CLUTTER_BACKEND_GET_CLASS (backend)->get_keymap (backend);1030 g_return_val_if_fail (CLUTTER_IS_BACKEND (backend), NULL);
1095}
10961031
1097ClutterStageWindow *1032 return CLUTTER_BACKEND_GET_CLASS (backend)->get_default_seat (backend);
1098clutter_backend_get_stage_window (ClutterBackend *backend)
1099{
1100 return backend->stage_window;
1101}1033}
diff --git a/clutter/clutter/clutter-backend.h b/clutter/clutter/clutter-backend.h
index fde57d8..14f6c24 100644
--- a/clutter/clutter/clutter-backend.h
+++ b/clutter/clutter/clutter-backend.h
@@ -36,6 +36,7 @@
36#include <clutter/clutter-config.h>36#include <clutter/clutter-config.h>
37#include <clutter/clutter-keymap.h>37#include <clutter/clutter-keymap.h>
38#include <clutter/clutter-types.h>38#include <clutter/clutter-types.h>
39#include <clutter/clutter-seat.h>
3940
40G_BEGIN_DECLS41G_BEGIN_DECLS
4142
@@ -73,16 +74,13 @@ CLUTTER_EXPORT
73CoglContext * clutter_backend_get_cogl_context (ClutterBackend *backend);74CoglContext * clutter_backend_get_cogl_context (ClutterBackend *backend);
7475
75CLUTTER_EXPORT76CLUTTER_EXPORT
76void clutter_backend_bell_notify (ClutterBackend *backend);
77
78CLUTTER_EXPORT
79ClutterInputMethod * clutter_backend_get_input_method (ClutterBackend *backend);77ClutterInputMethod * clutter_backend_get_input_method (ClutterBackend *backend);
8078
81CLUTTER_EXPORT79CLUTTER_EXPORT
82void clutter_backend_set_input_method (ClutterBackend *backend,80void clutter_backend_set_input_method (ClutterBackend *backend,
83 ClutterInputMethod *method);81 ClutterInputMethod *method);
84CLUTTER_EXPORT82CLUTTER_EXPORT
85ClutterKeymap * clutter_backend_get_keymap (ClutterBackend *backend);83ClutterSeat * clutter_backend_get_default_seat (ClutterBackend *backend);
8684
87G_END_DECLS85G_END_DECLS
8886
diff --git a/clutter/clutter/clutter-base-types.c b/clutter/clutter/clutter-base-types.c
index 61e6fcd..fcbcd2e 100644
--- a/clutter/clutter/clutter-base-types.c
+++ b/clutter/clutter/clutter-base-types.c
@@ -42,286 +42,6 @@
4242
4343
4444
45/*45/*
46 * ClutterGeometry
47 */
48
49static ClutterGeometry*
50clutter_geometry_copy (const ClutterGeometry *geometry)
51{
52 return g_slice_dup (ClutterGeometry, geometry);
53}
54
55static void
56clutter_geometry_free (ClutterGeometry *geometry)
57{
58 if (G_LIKELY (geometry != NULL))
59 g_slice_free (ClutterGeometry, geometry);
60}
61
62/**
63 * clutter_geometry_union:
64 * @geometry_a: a #ClutterGeometry
65 * @geometry_b: another #ClutterGeometry
66 * @result: (out): location to store the result
67 *
68 * Find the union of two rectangles represented as #ClutterGeometry.
69 *
70 * Since: 1.4
71 *
72 * Deprecated: 1.16: Use #ClutterRect and clutter_rect_union()
73 */
74void
75clutter_geometry_union (const ClutterGeometry *geometry_a,
76 const ClutterGeometry *geometry_b,
77 ClutterGeometry *result)
78{
79 /* We don't try to handle rectangles that can't be represented
80 * as a signed integer box */
81 gint x_1 = MIN (geometry_a->x, geometry_b->x);
82 gint y_1 = MIN (geometry_a->y, geometry_b->y);
83 gint x_2 = MAX (geometry_a->x + (gint)geometry_a->width,
84 geometry_b->x + (gint)geometry_b->width);
85 gint y_2 = MAX (geometry_a->y + (gint)geometry_a->height,
86 geometry_b->y + (gint)geometry_b->height);
87 result->x = x_1;
88 result->y = y_1;
89 result->width = x_2 - x_1;
90 result->height = y_2 - y_1;
91}
92
93/**
94 * clutter_geometry_intersects:
95 * @geometry0: The first geometry to test
96 * @geometry1: The second geometry to test
97 *
98 * Determines if @geometry0 and geometry1 intersect returning %TRUE if
99 * they do else %FALSE.
100 *
101 * Return value: %TRUE of @geometry0 and geometry1 intersect else
102 * %FALSE.
103 *
104 * Since: 1.4
105 *
106 * Deprecated: 1.16: Use #ClutterRect and clutter_rect_intersection()
107 */
108gboolean
109clutter_geometry_intersects (const ClutterGeometry *geometry0,
110 const ClutterGeometry *geometry1)
111{
112 if (geometry1->x >= (geometry0->x + (gint)geometry0->width) ||
113 geometry1->y >= (geometry0->y + (gint)geometry0->height) ||
114 (geometry1->x + (gint)geometry1->width) <= geometry0->x ||
115 (geometry1->y + (gint)geometry1->height) <= geometry0->y)
116 return FALSE;
117 else
118 return TRUE;
119}
120
121static gboolean
122clutter_geometry_progress (const GValue *a,
123 const GValue *b,
124 gdouble progress,
125 GValue *retval)
126{
127 const ClutterGeometry *a_geom = g_value_get_boxed (a);
128 const ClutterGeometry *b_geom = g_value_get_boxed (b);
129 ClutterGeometry res = { 0, };
130 gint a_width = a_geom->width;
131 gint b_width = b_geom->width;
132 gint a_height = a_geom->height;
133 gint b_height = b_geom->height;
134
135 res.x = a_geom->x + (b_geom->x - a_geom->x) * progress;
136 res.y = a_geom->y + (b_geom->y - a_geom->y) * progress;
137
138 res.width = a_width + (b_width - a_width) * progress;
139 res.height = a_height + (b_height - a_height) * progress;
140
141 g_value_set_boxed (retval, &res);
142
143 return TRUE;
144}
145
146G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterGeometry, clutter_geometry,
147 clutter_geometry_copy,
148 clutter_geometry_free,
149 CLUTTER_REGISTER_INTERVAL_PROGRESS (clutter_geometry_progress));
150
151
15246
153
154/*
155 * ClutterVertices
156 */
157
158/**
159 * clutter_vertex_new:
160 * @x: X coordinate
161 * @y: Y coordinate
162 * @z: Z coordinate
163 *
164 * Creates a new #ClutterVertex for the point in 3D space
165 * identified by the 3 coordinates @x, @y, @z.
166 *
167 * This function is the logical equivalent of:
168 *
169 * |[
170 * clutter_vertex_init (clutter_vertex_alloc (), x, y, z);
171 * ]|
172 *
173 * Return value: (transfer full): the newly allocated #ClutterVertex.
174 * Use clutter_vertex_free() to free the resources
175 *
176 * Since: 1.0
177 */
178ClutterVertex *
179clutter_vertex_new (gfloat x,
180 gfloat y,
181 gfloat z)
182{
183 return clutter_vertex_init (clutter_vertex_alloc (), x, y, z);
184}
185
186/**
187 * clutter_vertex_alloc: (constructor)
188 *
189 * Allocates a new, empty #ClutterVertex.
190 *
191 * Return value: (transfer full): the newly allocated #ClutterVertex.
192 * Use clutter_vertex_free() to free its resources
193 *
194 * Since: 1.12
195 */
196ClutterVertex *
197clutter_vertex_alloc (void)
198{
199 return g_slice_new0 (ClutterVertex);
200}
201
202/**
203 * clutter_vertex_init:
204 * @vertex: a #ClutterVertex
205 * @x: X coordinate
206 * @y: Y coordinate
207 * @z: Z coordinate
208 *
209 * Initializes @vertex with the given coordinates.
210 *
211 * Return value: (transfer none): the initialized #ClutterVertex
212 *
213 * Since: 1.10
214 */
215ClutterVertex *
216clutter_vertex_init (ClutterVertex *vertex,
217 gfloat x,
218 gfloat y,
219 gfloat z)
220{
221 g_return_val_if_fail (vertex != NULL, NULL);
222
223 vertex->x = x;
224 vertex->y = y;
225 vertex->z = z;
226
227 return vertex;
228}
229
230/**
231 * clutter_vertex_copy:
232 * @vertex: a #ClutterVertex
233 *
234 * Copies @vertex
235 *
236 * Return value: (transfer full): a newly allocated copy of #ClutterVertex.
237 * Use clutter_vertex_free() to free the allocated resources
238 *
239 * Since: 1.0
240 */
241ClutterVertex *
242clutter_vertex_copy (const ClutterVertex *vertex)
243{
244 if (G_LIKELY (vertex != NULL))
245 return g_slice_dup (ClutterVertex, vertex);
246
247 return NULL;
248}
249
250/**
251 * clutter_vertex_free:
252 * @vertex: a #ClutterVertex
253 *
254 * Frees a #ClutterVertex allocated using clutter_vertex_alloc() or
255 * clutter_vertex_copy().
256 *
257 * Since: 1.0
258 */
259void
260clutter_vertex_free (ClutterVertex *vertex)
261{
262 if (G_UNLIKELY (vertex != NULL))
263 g_slice_free (ClutterVertex, vertex);
264}
265
266/**
267 * clutter_vertex_equal:
268 * @vertex_a: a #ClutterVertex
269 * @vertex_b: a #ClutterVertex
270 *
271 * Compares @vertex_a and @vertex_b for equality
272 *
273 * Return value: %TRUE if the passed #ClutterVertex are equal
274 *
275 * Since: 1.0
276 */
277gboolean
278clutter_vertex_equal (const ClutterVertex *vertex_a,
279 const ClutterVertex *vertex_b)
280{
281 g_return_val_if_fail (vertex_a != NULL && vertex_b != NULL, FALSE);
282
283 if (vertex_a == vertex_b)
284 return TRUE;
285
286 return fabsf (vertex_a->x - vertex_b->x) < FLOAT_EPSILON &&
287 fabsf (vertex_a->y - vertex_b->y) < FLOAT_EPSILON &&
288 fabsf (vertex_a->z - vertex_b->z) < FLOAT_EPSILON;
289}
290
291static void
292clutter_vertex_interpolate (const ClutterVertex *a,
293 const ClutterVertex *b,
294 double progress,
295 ClutterVertex *res)
296{
297 res->x = a->x + (b->x - a->x) * progress;
298 res->y = a->y + (b->y - a->y) * progress;
299 res->z = a->z + (b->z - a->z) * progress;
300}
301
302static gboolean
303clutter_vertex_progress (const GValue *a,
304 const GValue *b,
305 gdouble progress,
306 GValue *retval)
307{
308 const ClutterVertex *av = g_value_get_boxed (a);
309 const ClutterVertex *bv = g_value_get_boxed (b);
310 ClutterVertex res;
311
312 clutter_vertex_interpolate (av, bv, progress, &res);
313
314 g_value_set_boxed (retval, &res);
315
316 return TRUE;
317}
318
319G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterVertex, clutter_vertex,
320 clutter_vertex_copy,
321 clutter_vertex_free,
322 CLUTTER_REGISTER_INTERVAL_PROGRESS (clutter_vertex_progress));
323
324
32547
326
327/*
328 * ClutterMargin48 * ClutterMargin
329 */49 */
33050
@@ -382,993 +102,6 @@ G_DEFINE_BOXED_TYPE (ClutterMargin, clutter_margin,
382 clutter_margin_copy,102 clutter_margin_copy,
383 clutter_margin_free)103 clutter_margin_free)
384104
385
386105
387
388/*
389 * ClutterPoint
390 */
391
392static const ClutterPoint _clutter_point_zero = CLUTTER_POINT_INIT_ZERO;
393
394/**
395 * clutter_point_zero:
396 *
397 * A point centered at (0, 0).
398 *
399 * The returned value can be used as a guard.
400 *
401 * Return value: a point centered in (0, 0); the returned #ClutterPoint
402 * is owned by Clutter and it should not be modified or freed.
403 *
404 * Since: 1.12
405 */
406const ClutterPoint *
407clutter_point_zero (void)
408{
409 return &_clutter_point_zero;
410}
411
412/**
413 * clutter_point_alloc: (constructor)
414 *
415 * Allocates a new #ClutterPoint.
416 *
417 * Return value: (transfer full): the newly allocated #ClutterPoint.
418 * Use clutter_point_free() to free its resources.
419 *
420 * Since: 1.12
421 */
422ClutterPoint *
423clutter_point_alloc (void)
424{
425 return g_slice_new0 (ClutterPoint);
426}
427
428/**
429 * clutter_point_init:
430 * @point: a #ClutterPoint
431 * @x: the X coordinate of the point
432 * @y: the Y coordinate of the point
433 *
434 * Initializes @point with the given coordinates.
435 *
436 * Return value: (transfer none): the initialized #ClutterPoint
437 *
438 * Since: 1.12
439 */
440ClutterPoint *
441clutter_point_init (ClutterPoint *point,
442 float x,
443 float y)
444{
445 g_return_val_if_fail (point != NULL, NULL);
446
447 point->x = x;
448 point->y = y;
449
450 return point;
451}
452
453/**
454 * clutter_point_copy:
455 * @point: a #ClutterPoint
456 *
457 * Creates a new #ClutterPoint with the same coordinates of @point.
458 *
459 * Return value: (transfer full): a newly allocated #ClutterPoint.
460 * Use clutter_point_free() to free its resources.
461 *
462 * Since: 1.12
463 */
464ClutterPoint *
465clutter_point_copy (const ClutterPoint *point)
466{
467 return g_slice_dup (ClutterPoint, point);
468}
469
470/**
471 * clutter_point_free:
472 * @point: a #ClutterPoint
473 *
474 * Frees the resources allocated for @point.
475 *
476 * Since: 1.12
477 */
478void
479clutter_point_free (ClutterPoint *point)
480{
481 if (point != NULL && point != &_clutter_point_zero)
482 g_slice_free (ClutterPoint, point);
483}
484
485/**
486 * clutter_point_equals:
487 * @a: the first #ClutterPoint to compare
488 * @b: the second #ClutterPoint to compare
489 *
490 * Compares two #ClutterPoint for equality.
491 *
492 * Return value: %TRUE if the #ClutterPoints are equal
493 *
494 * Since: 1.12
495 */
496gboolean
497clutter_point_equals (const ClutterPoint *a,
498 const ClutterPoint *b)
499{
500 if (a == b)
501 return TRUE;
502
503 if (a == NULL || b == NULL)
504 return FALSE;
505
506 return fabsf (a->x - b->x) < FLOAT_EPSILON &&
507 fabsf (a->y - b->y) < FLOAT_EPSILON;
508}
509
510/**
511 * clutter_point_distance:
512 * @a: a #ClutterPoint
513 * @b: a #ClutterPoint
514 * @x_distance: (out) (allow-none): return location for the horizontal
515 * distance between the points
516 * @y_distance: (out) (allow-none): return location for the vertical
517 * distance between the points
518 *
519 * Computes the distance between two #ClutterPoint.
520 *
521 * Return value: the distance between the points.
522 *
523 * Since: 1.12
524 */
525float
526clutter_point_distance (const ClutterPoint *a,
527 const ClutterPoint *b,
528 float *x_distance,
529 float *y_distance)
530{
531 float x_d, y_d;
532
533 g_return_val_if_fail (a != NULL, 0.f);
534 g_return_val_if_fail (b != NULL, 0.f);
535
536 if (clutter_point_equals (a, b))
537 return 0.f;
538
539 x_d = (a->x - b->x);
540 y_d = (a->y - b->y);
541
542 if (x_distance != NULL)
543 *x_distance = fabsf (x_d);
544
545 if (y_distance != NULL)
546 *y_distance = fabsf (y_d);
547
548 return sqrt ((x_d * x_d) + (y_d * y_d));
549}
550
551static gboolean
552clutter_point_progress (const GValue *a,
553 const GValue *b,
554 gdouble progress,
555 GValue *retval)
556{
557 const ClutterPoint *ap = g_value_get_boxed (a);
558 const ClutterPoint *bp = g_value_get_boxed (b);
559 ClutterPoint res = CLUTTER_POINT_INIT (0, 0);
560
561 res.x = ap->x + (bp->x - ap->x) * progress;
562 res.y = ap->y + (bp->y - ap->y) * progress;
563
564 g_value_set_boxed (retval, &res);
565
566 return TRUE;
567}
568
569G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterPoint, clutter_point,
570 clutter_point_copy,
571 clutter_point_free,
572 CLUTTER_REGISTER_INTERVAL_PROGRESS (clutter_point_progress))
573
574static int
575clutter_point_compare_line (const ClutterPoint *p,
576 const ClutterPoint *a,
577 const ClutterPoint *b)
578{
579 float x1 = b->x - a->x;
580 float y1 = b->y - a->y;
581 float x2 = p->x - a->x;
582 float y2 = p->y - a->y;
583 float cross_z = x1 * y2 - y1 * x2;
584
585 if (cross_z > 0.f)
586 return 1;
587 else if (cross_z < 0.f)
588 return -1;
589 else
590 return 0;
591}
592
593/**
594 * clutter_point_inside_quadrilateral:
595 * @point: a #ClutterPoint to test
596 * @vertices: array of vertices of the quadrilateral, in either clockwise or
597 * anticlockwise order.
598 *
599 * Determines whether a point is inside the convex quadrilateral provided,
600 * or on any of its edges or vertices.
601 *
602 * Returns: %TRUE if @point is inside or touching the quadrilateral
603 */
604gboolean
605clutter_point_inside_quadrilateral (const ClutterPoint *point,
606 const ClutterPoint *vertices)
607{
608 unsigned int i;
609 int first_side;
610
611 first_side = 0;
612
613 for (i = 0; i < 4; i++)
614 {
615 int side;
616
617 side = clutter_point_compare_line (point,
618 &vertices[i],
619 &vertices[(i + 1) % 4]);
620
621 if (side)
622 {
623 if (first_side == 0)
624 first_side = side;
625 else if (side != first_side)
626 return FALSE;
627 }
628 }
629
630 if (first_side == 0)
631 return FALSE;
632
633 return TRUE;
634}
635
636
637106
638
639/*
640 * ClutterSize
641 */
642
643/**
644 * clutter_size_alloc: (constructor)
645 *
646 * Allocates a new #ClutterSize.
647 *
648 * Return value: (transfer full): the newly allocated #ClutterSize.
649 * Use clutter_size_free() to free its resources.
650 *
651 * Since: 1.12
652 */
653ClutterSize *
654clutter_size_alloc (void)
655{
656 return g_slice_new0 (ClutterSize);
657}
658
659/**
660 * clutter_size_init:
661 * @size: a #ClutterSize
662 * @width: the width
663 * @height: the height
664 *
665 * Initializes a #ClutterSize with the given dimensions.
666 *
667 * Return value: (transfer none): the initialized #ClutterSize
668 *
669 * Since: 1.12
670 */
671ClutterSize *
672clutter_size_init (ClutterSize *size,
673 float width,
674 float height)
675{
676 g_return_val_if_fail (size != NULL, NULL);
677
678 size->width = width;
679 size->height = height;
680
681 return size;
682}
683
684/**
685 * clutter_size_copy:
686 * @size: a #ClutterSize
687 *
688 * Creates a new #ClutterSize and duplicates @size.
689 *
690 * Return value: (transfer full): the newly allocated #ClutterSize.
691 * Use clutter_size_free() to free its resources.
692 *
693 * Since: 1.12
694 */
695ClutterSize *
696clutter_size_copy (const ClutterSize *size)
697{
698 return g_slice_dup (ClutterSize, size);
699}
700
701/**
702 * clutter_size_free:
703 * @size: a #ClutterSize
704 *
705 * Frees the resources allocated for @size.
706 *
707 * Since: 1.12
708 */
709void
710clutter_size_free (ClutterSize *size)
711{
712 if (size != NULL)
713 g_slice_free (ClutterSize, size);
714}
715
716/**
717 * clutter_size_equals:
718 * @a: a #ClutterSize to compare
719 * @b: a #ClutterSize to compare
720 *
721 * Compares two #ClutterSize for equality.
722 *
723 * Return value: %TRUE if the two #ClutterSize are equal
724 *
725 * Since: 1.12
726 */
727gboolean
728clutter_size_equals (const ClutterSize *a,
729 const ClutterSize *b)
730{
731 if (a == b)
732 return TRUE;
733
734 if (a == NULL || b == NULL)
735 return FALSE;
736
737 return fabsf (a->width - b->width) < FLOAT_EPSILON &&
738 fabsf (a->height - b->height) < FLOAT_EPSILON;
739}
740
741static gboolean
742clutter_size_progress (const GValue *a,
743 const GValue *b,
744 gdouble progress,
745 GValue *retval)
746{
747 const ClutterSize *as = g_value_get_boxed (a);
748 const ClutterSize *bs = g_value_get_boxed (b);
749 ClutterSize res = CLUTTER_SIZE_INIT (0, 0);
750
751 res.width = as->width + (bs->width - as->width) * progress;
752 res.height = as->height + (bs->height - as->height) * progress;
753
754 g_value_set_boxed (retval, &res);
755
756 return TRUE;
757}
758
759G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterSize, clutter_size,
760 clutter_size_copy,
761 clutter_size_free,
762 CLUTTER_REGISTER_INTERVAL_PROGRESS (clutter_size_progress))
763
764
765107
766
767/*
768 * ClutterRect
769 */
770
771static const ClutterRect _clutter_rect_zero = CLUTTER_RECT_INIT_ZERO;
772
773static gboolean clutter_rect_progress (const GValue *a,
774 const GValue *b,
775 gdouble progress,
776 GValue *res);
777
778G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterRect, clutter_rect,
779 clutter_rect_copy,
780 clutter_rect_free,
781 CLUTTER_REGISTER_INTERVAL_PROGRESS (clutter_rect_progress))
782
783static inline void
784clutter_rect_normalize_internal (ClutterRect *rect)
785{
786 if (rect->size.width >= 0.f && rect->size.height >= 0.f)
787 return;
788
789 if (rect->size.width < 0.f)
790 {
791 float size = fabsf (rect->size.width);
792
793 rect->origin.x -= size;
794 rect->size.width = size;
795 }
796
797 if (rect->size.height < 0.f)
798 {
799 float size = fabsf (rect->size.height);
800
801 rect->origin.y -= size;
802 rect->size.height = size;
803 }
804}
805
806/**
807 * clutter_rect_zero:
808 *
809 * A #ClutterRect with #ClutterRect.origin set at (0, 0) and a size
810 * of 0.
811 *
812 * The returned value can be used as a guard.
813 *
814 * Return value: a rectangle with origin in (0, 0) and a size of 0.
815 * The returned #ClutterRect is owned by Clutter and it should not
816 * be modified or freed.
817 *
818 * Since: 1.12
819 */
820const ClutterRect *
821clutter_rect_zero (void)
822{
823 return &_clutter_rect_zero;
824}
825
826/**
827 * clutter_rect_alloc: (constructor)
828 *
829 * Creates a new, empty #ClutterRect.
830 *
831 * You can use clutter_rect_init() to initialize the returned rectangle,
832 * for instance:
833 *
834 * |[
835 * rect = clutter_rect_init (clutter_rect_alloc (), x, y, width, height);
836 * ]|
837 *
838 * Return value: (transfer full): the newly allocated #ClutterRect.
839 * Use clutter_rect_free() to free its resources
840 *
841 * Since: 1.12
842 */
843ClutterRect *
844clutter_rect_alloc (void)
845{
846 return g_slice_new0 (ClutterRect);
847}
848
849/**
850 * clutter_rect_init:
851 * @rect: a #ClutterRect
852 * @x: X coordinate of the origin
853 * @y: Y coordinate of the origin
854 * @width: width of the rectangle
855 * @height: height of the rectangle
856 *
857 * Initializes a #ClutterRect with the given origin and size.
858 *
859 * Return value: (transfer none): the updated rectangle
860 *
861 * Since: 1.12
862 */
863ClutterRect *
864clutter_rect_init (ClutterRect *rect,
865 float x,
866 float y,
867 float width,
868 float height)
869{
870 g_return_val_if_fail (rect != NULL, NULL);
871
872 rect->origin.x = x;
873 rect->origin.y = y;
874
875 rect->size.width = width;
876 rect->size.height = height;
877
878 return rect;
879}
880
881/**
882 * clutter_rect_copy:
883 * @rect: a #ClutterRect
884 *
885 * Copies @rect into a new #ClutterRect instance.
886 *
887 * Return value: (transfer full): the newly allocate copy of @rect.
888 * Use clutter_rect_free() to free the associated resources
889 *
890 * Since: 1.12
891 */
892ClutterRect *
893clutter_rect_copy (const ClutterRect *rect)
894{
895 if (rect != NULL)
896 {
897 ClutterRect *res;
898
899 res = g_slice_dup (ClutterRect, rect);
900 clutter_rect_normalize_internal (res);
901
902 return res;
903 }
904
905 return NULL;
906}
907
908/**
909 * clutter_rect_free:
910 * @rect: a #ClutterRect
911 *
912 * Frees the resources allocated by @rect.
913 *
914 * Since: 1.12
915 */
916void
917clutter_rect_free (ClutterRect *rect)
918{
919 if (rect != NULL && rect != &_clutter_rect_zero)
920 g_slice_free (ClutterRect, rect);
921}
922
923/**
924 * clutter_rect_equals:
925 * @a: a #ClutterRect
926 * @b: a #ClutterRect
927 *
928 * Checks whether @a and @b are equals.
929 *
930 * This function will normalize both @a and @b before comparing
931 * their origin and size.
932 *
933 * Return value: %TRUE if the rectangles match in origin and size.
934 *
935 * Since: 1.12
936 */
937gboolean
938clutter_rect_equals (ClutterRect *a,
939 ClutterRect *b)
940{
941 if (a == b)
942 return TRUE;
943
944 if (a == NULL || b == NULL)
945 return FALSE;
946
947 clutter_rect_normalize_internal (a);
948 clutter_rect_normalize_internal (b);
949
950 return clutter_point_equals (&a->origin, &b->origin) &&
951 clutter_size_equals (&a->size, &b->size);
952}
953
954/**
955 * clutter_rect_normalize:
956 * @rect: a #ClutterRect
957 *
958 * Normalizes a #ClutterRect.
959 *
960 * A #ClutterRect is defined by the area covered by its size; this means
961 * that a #ClutterRect with #ClutterRect.origin in [ 0, 0 ] and a
962 * #ClutterRect.size of [ 10, 10 ] is equivalent to a #ClutterRect with
963 * #ClutterRect.origin in [ 10, 10 ] and a #ClutterRect.size of [ -10, -10 ].
964 *
965 * This function is useful to ensure that a rectangle has positive width
966 * and height; it will modify the passed @rect and normalize its size.
967 *
968 * Since: 1.12
969 */
970ClutterRect *
971clutter_rect_normalize (ClutterRect *rect)
972{
973 g_return_val_if_fail (rect != NULL, NULL);
974
975 clutter_rect_normalize_internal (rect);
976
977 return rect;
978}
979
980/**
981 * clutter_rect_get_center:
982 * @rect: a #ClutterRect
983 * @center: (out caller-allocates): a #ClutterPoint
984 *
985 * Retrieves the center of @rect, after normalizing the rectangle,
986 * and updates @center with the correct coordinates.
987 *
988 * Since: 1.12
989 */
990void
991clutter_rect_get_center (ClutterRect *rect,
992 ClutterPoint *center)
993{
994 g_return_if_fail (rect != NULL);
995 g_return_if_fail (center != NULL);
996
997 clutter_rect_normalize_internal (rect);
998
999 center->x = rect->origin.x + (rect->size.width / 2.0f);
1000 center->y = rect->origin.y + (rect->size.height / 2.0f);
1001}
1002
1003/**
1004 * clutter_rect_contains_point:
1005 * @rect: a #ClutterRect
1006 * @point: the point to check
1007 *
1008 * Checks whether @point is contained by @rect, after normalizing the
1009 * rectangle.
1010 *
1011 * Return value: %TRUE if the @point is contained by @rect.
1012 *
1013 * Since: 1.12
1014 */
1015gboolean
1016clutter_rect_contains_point (ClutterRect *rect,
1017 ClutterPoint *point)
1018{
1019 g_return_val_if_fail (rect != NULL, FALSE);
1020 g_return_val_if_fail (point != NULL, FALSE);
1021
1022 clutter_rect_normalize_internal (rect);
1023
1024 return (point->x >= rect->origin.x) &&
1025 (point->y >= rect->origin.y) &&
1026 (point->x <= (rect->origin.x + rect->size.width)) &&
1027 (point->y <= (rect->origin.y + rect->size.height));
1028}
1029
1030/**
1031 * clutter_rect_contains_rect:
1032 * @a: a #ClutterRect
1033 * @b: a #ClutterRect
1034 *
1035 * Checks whether @a contains @b.
1036 *
1037 * The first rectangle contains the second if the union of the
1038 * two #ClutterRect is equal to the first rectangle.
1039 *
1040 * Return value: %TRUE if the first rectangle contains the second.
1041 *
1042 * Since: 1.12
1043 */
1044gboolean
1045clutter_rect_contains_rect (ClutterRect *a,
1046 ClutterRect *b)
1047{
1048 ClutterRect res;
1049
1050 g_return_val_if_fail (a != NULL, FALSE);
1051 g_return_val_if_fail (b != NULL, FALSE);
1052
1053 clutter_rect_union (a, b, &res);
1054
1055 return clutter_rect_equals (a, &res);
1056}
1057
1058/**
1059 * clutter_rect_union:
1060 * @a: a #ClutterRect
1061 * @b: a #ClutterRect
1062 * @res: (out caller-allocates): a #ClutterRect
1063 *
1064 * Computes the smallest possible rectangle capable of fully containing
1065 * both @a and @b, and places it into @res.
1066 *
1067 * This function will normalize both @a and @b prior to computing their
1068 * union.
1069 *
1070 * Since: 1.12
1071 */
1072void
1073clutter_rect_union (ClutterRect *a,
1074 ClutterRect *b,
1075 ClutterRect *res)
1076{
1077 g_return_if_fail (a != NULL);
1078 g_return_if_fail (b != NULL);
1079 g_return_if_fail (res != NULL);
1080
1081 clutter_rect_normalize_internal (a);
1082 clutter_rect_normalize_internal (b);
1083
1084 res->origin.x = MIN (a->origin.x, b->origin.x);
1085 res->origin.y = MIN (a->origin.y, b->origin.y);
1086
1087 res->size.width = MAX (a->size.width, b->size.width);
1088 res->size.height = MAX (a->size.height, b->size.height);
1089}
1090
1091/**
1092 * clutter_rect_intersection:
1093 * @a: a #ClutterRect
1094 * @b: a #ClutterRect
1095 * @res: (out caller-allocates) (allow-none): a #ClutterRect, or %NULL
1096 *
1097 * Computes the intersection of @a and @b, and places it in @res, if @res
1098 * is not %NULL.
1099 *
1100 * This function will normalize both @a and @b prior to computing their
1101 * intersection.
1102 *
1103 * This function can be used to simply check if the intersection of @a and @b
1104 * is not empty, by using %NULL for @res.
1105 *
1106 * Return value: %TRUE if the intersection of @a and @b is not empty
1107 *
1108 * Since: 1.12
1109 */
1110gboolean
1111clutter_rect_intersection (ClutterRect *a,
1112 ClutterRect *b,
1113 ClutterRect *res)
1114{
1115 float x_1, y_1, x_2, y_2;
1116
1117 g_return_val_if_fail (a != NULL, FALSE);
1118 g_return_val_if_fail (b != NULL, FALSE);
1119
1120 clutter_rect_normalize_internal (a);
1121 clutter_rect_normalize_internal (b);
1122
1123 x_1 = MAX (a->origin.x, b->origin.x);
1124 y_1 = MAX (a->origin.y, b->origin.y);
1125 x_2 = MIN (a->origin.x + a->size.width, b->origin.x + b->size.width);
1126 y_2 = MIN (a->origin.y + a->size.height, b->origin.y + b->size.height);
1127
1128 if (x_1 >= x_2 || y_1 >= y_2)
1129 {
1130 if (res != NULL)
1131 clutter_rect_init (res, 0.f, 0.f, 0.f, 0.f);
1132
1133 return FALSE;
1134 }
1135
1136 if (res != NULL)
1137 clutter_rect_init (res, x_1, y_1, x_2 - x_1, y_2 - y_1);
1138
1139 return TRUE;
1140}
1141
1142/**
1143 * clutter_rect_offset:
1144 * @rect: a #ClutterRect
1145 * @d_x: the horizontal offset value
1146 * @d_y: the vertical offset value
1147 *
1148 * Offsets the origin of @rect by the given values, after normalizing
1149 * the rectangle.
1150 *
1151 * Since: 1.12
1152 */
1153void
1154clutter_rect_offset (ClutterRect *rect,
1155 float d_x,
1156 float d_y)
1157{
1158 g_return_if_fail (rect != NULL);
1159
1160 clutter_rect_normalize_internal (rect);
1161
1162 rect->origin.x += d_x;
1163 rect->origin.y += d_y;
1164}
1165
1166/**
1167 * clutter_rect_inset:
1168 * @rect: a #ClutterRect
1169 * @d_x: an horizontal value; a positive @d_x will create an inset rectangle,
1170 * and a negative value will create a larger rectangle
1171 * @d_y: a vertical value; a positive @d_x will create an inset rectangle,
1172 * and a negative value will create a larger rectangle
1173 *
1174 * Normalizes the @rect and offsets its origin by the @d_x and @d_y values;
1175 * the size is adjusted by (2 * @d_x, 2 * @d_y).
1176 *
1177 * If @d_x and @d_y are positive the size of the rectangle is decreased; if
1178 * the values are negative, the size of the rectangle is increased.
1179 *
1180 * If the resulting rectangle has a negative width or height, the size is
1181 * set to 0.
1182 *
1183 * Since: 1.12
1184 */
1185void
1186clutter_rect_inset (ClutterRect *rect,
1187 float d_x,
1188 float d_y)
1189{
1190 g_return_if_fail (rect != NULL);
1191
1192 clutter_rect_normalize_internal (rect);
1193
1194 rect->origin.x += d_x;
1195 rect->origin.y += d_y;
1196
1197 if (d_x >= 0.f)
1198 rect->size.width -= (d_x * 2.f);
1199 else
1200 rect->size.width += (d_x * -2.f);
1201
1202 if (d_y >= 0.f)
1203 rect->size.height -= (d_y * 2.f);
1204 else
1205 rect->size.height += (d_y * -2.f);
1206
1207 if (rect->size.width < 0.f)
1208 rect->size.width = 0.f;
1209
1210 if (rect->size.height < 0.f)
1211 rect->size.height = 0.f;
1212}
1213
1214/**
1215 * clutter_rect_scale:
1216 * @rect: a #ClutterRect
1217 * @s_x: an horizontal scale value
1218 * @s_y: a vertical scale value
1219 *
1220 * Scale the rectangle coordinates and size by @s_x horizontally and
1221 * @s_y vertically.
1222 */
1223void
1224clutter_rect_scale (ClutterRect *rect,
1225 float s_x,
1226 float s_y)
1227{
1228 g_return_if_fail (rect != NULL);
1229 g_return_if_fail (s_x > 0.f);
1230 g_return_if_fail (s_y > 0.f);
1231
1232 clutter_rect_normalize_internal (rect);
1233
1234 rect->origin.x *= s_x;
1235 rect->origin.y *= s_y;
1236 rect->size.width *= s_x;
1237 rect->size.height *= s_y;
1238}
1239
1240/**
1241 * clutter_rect_clamp_to_pixel:
1242 * @rect: a #ClutterRect
1243 *
1244 * Rounds the origin of @rect downwards to the nearest integer, and recompute the
1245 * the size using the @rect origin and size rounded upwards to the nearest integer,
1246 * so that @rect is updated to the smallest rectangle capable of fully containing
1247 * the original, fractional rectangle in the coordinates space.
1248 *
1249 * Since: 1.12
1250 */
1251void
1252clutter_rect_clamp_to_pixel (ClutterRect *rect)
1253{
1254 float x2, y2;
1255
1256 g_return_if_fail (rect != NULL);
1257
1258 clutter_rect_normalize_internal (rect);
1259
1260 x2 = rect->origin.x + rect->size.width;
1261 y2 = rect->origin.y + rect->size.height;
1262
1263 rect->origin.x = floorf (rect->origin.x);
1264 rect->origin.y = floorf (rect->origin.y);
1265
1266 rect->size.width = ceilf (x2) - rect->origin.x;
1267 rect->size.height = ceilf (y2) - rect->origin.y;
1268}
1269
1270/**
1271 * clutter_rect_get_x:
1272 * @rect: a #ClutterRect
1273 *
1274 * Retrieves the X coordinate of the origin of @rect.
1275 *
1276 * Return value: the X coordinate of the origin of the rectangle
1277 *
1278 * Since: 1.12
1279 */
1280float
1281clutter_rect_get_x (ClutterRect *rect)
1282{
1283 g_return_val_if_fail (rect != NULL, 0.f);
1284
1285 clutter_rect_normalize_internal (rect);
1286
1287 return rect->origin.x;
1288}
1289
1290/**
1291 * clutter_rect_get_y:
1292 * @rect: a #ClutterRect
1293 *
1294 * Retrieves the Y coordinate of the origin of @rect.
1295 *
1296 * Return value: the Y coordinate of the origin of the rectangle
1297 *
1298 * Since: 1.12
1299 */
1300float
1301clutter_rect_get_y (ClutterRect *rect)
1302{
1303 g_return_val_if_fail (rect != NULL, 0.f);
1304
1305 clutter_rect_normalize_internal (rect);
1306
1307 return rect->origin.y;
1308}
1309
1310/**
1311 * clutter_rect_get_width:
1312 * @rect: a #ClutterRect
1313 *
1314 * Retrieves the width of @rect.
1315 *
1316 * Return value: the width of the rectangle
1317 *
1318 * Since: 1.12
1319 */
1320float
1321clutter_rect_get_width (ClutterRect *rect)
1322{
1323 g_return_val_if_fail (rect != NULL, 0.f);
1324
1325 clutter_rect_normalize_internal (rect);
1326
1327 return rect->size.width;
1328}
1329
1330/**
1331 * clutter_rect_get_height:
1332 * @rect: a #ClutterRect
1333 *
1334 * Retrieves the height of @rect.
1335 *
1336 * Return value: the height of the rectangle
1337 *
1338 * Since: 1.12
1339 */
1340float
1341clutter_rect_get_height (ClutterRect *rect)
1342{
1343 g_return_val_if_fail (rect != NULL, 0.f);
1344
1345 clutter_rect_normalize_internal (rect);
1346
1347 return rect->size.height;
1348}
1349
1350static gboolean
1351clutter_rect_progress (const GValue *a,
1352 const GValue *b,
1353 gdouble progress,
1354 GValue *retval)
1355{
1356 const ClutterRect *rect_a = g_value_get_boxed (a);
1357 const ClutterRect *rect_b = g_value_get_boxed (b);
1358 ClutterRect res = CLUTTER_RECT_INIT_ZERO;
1359
1360#define INTERPOLATE(r_a,r_b,member,field,factor) ((r_a)->member.field + (((r_b)->member.field - ((r_a)->member.field)) * (factor)))
1361
1362 res.origin.x = INTERPOLATE (rect_a, rect_b, origin, x, progress);
1363 res.origin.y = INTERPOLATE (rect_a, rect_b, origin, y, progress);
1364
1365 res.size.width = INTERPOLATE (rect_a, rect_b, size, width, progress);
1366 res.size.height = INTERPOLATE (rect_a, rect_b, size, height, progress);
1367
1368#undef INTERPOLATE
1369
1370 g_value_set_boxed (retval, &res);
1371
1372 return TRUE;
1373}
1374
1375/**108/**
1376 * ClutterMatrix:109 * ClutterMatrix:
1377 *110 *
@@ -1393,20 +126,20 @@ clutter_matrix_progress (const GValue *a,
1393{126{
1394 const ClutterMatrix *matrix1 = g_value_get_boxed (a);127 const ClutterMatrix *matrix1 = g_value_get_boxed (a);
1395 const ClutterMatrix *matrix2 = g_value_get_boxed (b);128 const ClutterMatrix *matrix2 = g_value_get_boxed (b);
1396 ClutterVertex scale1 = CLUTTER_VERTEX_INIT (1.f, 1.f, 1.f);129 graphene_point3d_t scale1 = GRAPHENE_POINT3D_INIT (1.f, 1.f, 1.f);
1397 float shear1[3] = { 0.f, 0.f, 0.f };130 float shear1[3] = { 0.f, 0.f, 0.f };
1398 ClutterVertex rotate1 = CLUTTER_VERTEX_INIT_ZERO;131 graphene_point3d_t rotate1 = GRAPHENE_POINT3D_INIT_ZERO;
1399 ClutterVertex translate1 = CLUTTER_VERTEX_INIT_ZERO;132 graphene_point3d_t translate1 = GRAPHENE_POINT3D_INIT_ZERO;
1400 ClutterVertex4 perspective1 = { 0.f, 0.f, 0.f, 0.f };133 ClutterVertex4 perspective1 = { 0.f, 0.f, 0.f, 0.f };
1401 ClutterVertex scale2 = CLUTTER_VERTEX_INIT (1.f, 1.f, 1.f);134 graphene_point3d_t scale2 = GRAPHENE_POINT3D_INIT (1.f, 1.f, 1.f);
1402 float shear2[3] = { 0.f, 0.f, 0.f };135 float shear2[3] = { 0.f, 0.f, 0.f };
1403 ClutterVertex rotate2 = CLUTTER_VERTEX_INIT_ZERO;136 graphene_point3d_t rotate2 = GRAPHENE_POINT3D_INIT_ZERO;
1404 ClutterVertex translate2 = CLUTTER_VERTEX_INIT_ZERO;137 graphene_point3d_t translate2 = GRAPHENE_POINT3D_INIT_ZERO;
1405 ClutterVertex4 perspective2 = { 0.f, 0.f, 0.f, 0.f };138 ClutterVertex4 perspective2 = { 0.f, 0.f, 0.f, 0.f };
1406 ClutterVertex scale_res = CLUTTER_VERTEX_INIT (1.f, 1.f, 1.f);139 graphene_point3d_t scale_res = GRAPHENE_POINT3D_INIT (1.f, 1.f, 1.f);
1407 float shear_res = 0.f;140 float shear_res = 0.f;
1408 ClutterVertex rotate_res = CLUTTER_VERTEX_INIT_ZERO;141 graphene_point3d_t rotate_res = GRAPHENE_POINT3D_INIT_ZERO;
1409 ClutterVertex translate_res = CLUTTER_VERTEX_INIT_ZERO;142 graphene_point3d_t translate_res = GRAPHENE_POINT3D_INIT_ZERO;
1410 ClutterVertex4 perspective_res = { 0.f, 0.f, 0.f, 0.f };143 ClutterVertex4 perspective_res = { 0.f, 0.f, 0.f, 0.f };
1411 ClutterMatrix res;144 ClutterMatrix res;
1412145
@@ -1427,11 +160,11 @@ clutter_matrix_progress (const GValue *a,
1427 res.ww = perspective_res.w;160 res.ww = perspective_res.w;
1428161
1429 /* translation */162 /* translation */
1430 clutter_vertex_interpolate (&translate1, &translate2, progress, &translate_res);163 graphene_point3d_interpolate (&translate1, &translate2, progress, &translate_res);
1431 cogl_matrix_translate (&res, translate_res.x, translate_res.y, translate_res.z);164 cogl_matrix_translate (&res, translate_res.x, translate_res.y, translate_res.z);
1432165
1433 /* rotation */166 /* rotation */
1434 clutter_vertex_interpolate (&rotate1, &rotate2, progress, &rotate_res);167 graphene_point3d_interpolate (&rotate1, &rotate2, progress, &rotate_res);
1435 cogl_matrix_rotate (&res, rotate_res.x, 1.0f, 0.0f, 0.0f);168 cogl_matrix_rotate (&res, rotate_res.x, 1.0f, 0.0f, 0.0f);
1436 cogl_matrix_rotate (&res, rotate_res.y, 0.0f, 1.0f, 0.0f);169 cogl_matrix_rotate (&res, rotate_res.y, 0.0f, 1.0f, 0.0f);
1437 cogl_matrix_rotate (&res, rotate_res.z, 0.0f, 0.0f, 1.0f);170 cogl_matrix_rotate (&res, rotate_res.z, 0.0f, 0.0f, 1.0f);
@@ -1450,7 +183,7 @@ clutter_matrix_progress (const GValue *a,
1450 _clutter_util_matrix_skew_xy (&res, shear_res);183 _clutter_util_matrix_skew_xy (&res, shear_res);
1451184
1452 /* scale */185 /* scale */
1453 clutter_vertex_interpolate (&scale1, &scale2, progress, &scale_res);186 graphene_point3d_interpolate (&scale1, &scale2, progress, &scale_res);
1454 cogl_matrix_scale (&res, scale_res.x, scale_res.y, scale_res.z);187 cogl_matrix_scale (&res, scale_res.x, scale_res.y, scale_res.z);
1455188
1456 g_value_set_boxed (retval, &res);189 g_value_set_boxed (retval, &res);
diff --git a/clutter/clutter/clutter-bin-layout.c b/clutter/clutter/clutter-bin-layout.c
index 6bcdbe7..8c63b80 100644
--- a/clutter/clutter/clutter-bin-layout.c
+++ b/clutter/clutter/clutter-bin-layout.c
@@ -49,10 +49,10 @@
4949
50#define CLUTTER_DISABLE_DEPRECATION_WARNINGS50#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
51#include "deprecated/clutter-container.h"51#include "deprecated/clutter-container.h"
52#include "deprecated/clutter-bin-layout.h"
5352
54#include "clutter-actor-private.h"53#include "clutter-actor-private.h"
55#include "clutter-animatable.h"54#include "clutter-animatable.h"
55#include "clutter-bin-layout.h"
56#include "clutter-child-meta.h"56#include "clutter-child-meta.h"
57#include "clutter-debug.h"57#include "clutter-debug.h"
58#include "clutter-enum-types.h"58#include "clutter-enum-types.h"
@@ -698,187 +698,3 @@ clutter_bin_layout_new (ClutterBinAlignment x_align,
698 "y-align", y_align,698 "y-align", y_align,
699 NULL);699 NULL);
700}700}
701
702/**
703 * clutter_bin_layout_set_alignment:
704 * @self: a #ClutterBinLayout
705 * @child: (allow-none): a child of @container
706 * @x_align: the horizontal alignment policy to be used for the @child
707 * inside @container
708 * @y_align: the vertical aligment policy to be used on the @child
709 * inside @container
710 *
711 * Sets the horizontal and vertical alignment policies to be applied
712 * to a @child of @self
713 *
714 * If @child is %NULL then the @x_align and @y_align values will
715 * be set as the default alignment policies
716 *
717 * Since: 1.2
718 *
719 * Deprecated: 1.12: Use the #ClutterActor:x-align and
720 * #ClutterActor:y-align properties of #ClutterActor instead.
721 */
722void
723clutter_bin_layout_set_alignment (ClutterBinLayout *self,
724 ClutterActor *child,
725 ClutterBinAlignment x_align,
726 ClutterBinAlignment y_align)
727{
728 ClutterBinLayoutPrivate *priv;
729 ClutterLayoutManager *manager;
730 ClutterLayoutMeta *meta;
731
732 g_return_if_fail (CLUTTER_IS_BIN_LAYOUT (self));
733 g_return_if_fail (child == NULL || CLUTTER_IS_ACTOR (child));
734
735 priv = self->priv;
736
737 if (priv->container == NULL)
738 {
739 if (child == NULL)
740 {
741 set_x_align (self, x_align);
742 set_y_align (self, y_align);
743 }
744 else
745 g_warning ("The layout of type '%s' must be associated to "
746 "a ClutterContainer before setting the alignment "
747 "on its children",
748 G_OBJECT_TYPE_NAME (self));
749
750 return;
751 }
752
753 manager = CLUTTER_LAYOUT_MANAGER (self);
754 meta = clutter_layout_manager_get_child_meta (manager,
755 priv->container,
756 child);
757 g_assert (CLUTTER_IS_BIN_LAYER (meta));
758
759 set_layer_x_align (CLUTTER_BIN_LAYER (meta), x_align);
760 set_layer_y_align (CLUTTER_BIN_LAYER (meta), y_align);
761}
762
763/**
764 * clutter_bin_layout_get_alignment:
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches