Merge ~3v1n0/ubuntu/+source/mutter:ubuntu/master into ~ubuntu-desktop/ubuntu/+source/mutter:ubuntu/master
- Git
- lp:~3v1n0/ubuntu/+source/mutter
- ubuntu/master
- Merge into 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) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Desktop | Pending | ||
Review via email: mp+379812@code.launchpad.net |
Commit message
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
1 | diff --git a/NEWS b/NEWS | |||
2 | index 38e94df..769cadd 100644 | |||
3 | --- a/NEWS | |||
4 | +++ b/NEWS | |||
5 | @@ -1,45 +1,137 @@ | |||
7 | 1 | 3.34.3 | 1 | 3.35.91 |
8 | 2 | ======= | ||
9 | 3 | * Honor accelerometer orientation on monitor config changes [Hans; !959] | ||
10 | 4 | * Enable culling for integer-scaled actors [Robert; !1036] | ||
11 | 5 | * Add ClutterSeat::touch-mode property [Carlos; !1044] | ||
12 | 6 | * Fix mis-scaling when streaming windows [Olivier; !1022] | ||
13 | 7 | * Make the cursor renderer use the transactional KMS API [Jonas; !930] | ||
14 | 8 | * Advertise MetaMonitor as wl_output [Olivier; !994] | ||
15 | 9 | * Fix culling of XWayland windows [Robert; !1049] | ||
16 | 10 | * Only consider enabled effects when disabling culling [Robert; !1052] | ||
17 | 11 | * Misc. bug fixes and cleanups [Olivier, Sergio, Adam, Carlos, Björn; !1040, | ||
18 | 12 | #985, !1024, !1039, !1051] | ||
19 | 13 | |||
20 | 14 | Contributors: | ||
21 | 15 | Sergio Costas, Björn Daase, Olivier Fourdan, Carlos Garnacho, Hans de Goede, | ||
22 | 16 | Adam Jackson, Robert Mader, Jonas Ådahl | ||
23 | 17 | |||
24 | 18 | Translators: | ||
25 | 19 | sicklylife [ja] | ||
26 | 20 | |||
27 | 21 | 3.35.90 | ||
28 | 22 | ======= | ||
29 | 23 | * Cull out clip region [Robert; !985] | ||
30 | 24 | * Always enable tap-to-click/drag on opaque Wacom tablets [Carlos; !968] | ||
31 | 25 | * Fix visual glitches with offscreen effects applied [Georges; !992] | ||
32 | 26 | * Fix "sticky corner" in multi-head setups [Jonas D.; #774] | ||
33 | 27 | * Fix black shadows around XWayland windows during resizes [Ray, Olivier; #858] | ||
34 | 28 | * Zero-copy path for GPU-less secondary GPUs [Pekka; !810] | ||
35 | 29 | * Cancel DND on Esc [Carlos; #1020] | ||
36 | 30 | * Sync XWayland window shadows to frame during resizes [Olivier; !1009] | ||
37 | 31 | * Add support for per-monitor workareas [Alberts; !370] | ||
38 | 32 | * Ensure newly mapped wayland windows receive ENTER event [Olivier; !1026] | ||
39 | 33 | * Add ClutterSeat object [Carlos; !852] | ||
40 | 34 | * Honour CLUTTER_ACTOR_NO_LAYOUT flag more efficiently [Daniel; !575] | ||
41 | 35 | * Fix interoperation with wl_data_device_manager v1 [Carlos; #965] | ||
42 | 36 | * Favor text over images in clipboard manager [Carlos; #919] | ||
43 | 37 | * Apply monitor scale after background texture creation [Daniel; !1004] | ||
44 | 38 | * Plugged memory leaks [Sebastian, Adam; !991, #1000, !1011, !1020, !1030, | ||
45 | 39 | !1001, !1033] | ||
46 | 40 | * Fixed crashes [Jonas Å., Florian, Olivier; !961, #1029, !1037] | ||
47 | 41 | * Misc. bug fixes and cleanups [Björn, Jonas Å., Adam, Sebastian, Jonas D., | ||
48 | 42 | Daniel, Carlos, Corentin, Sebastian, Robert, Daniel; #385, !998, !1007, !995, | ||
49 | 43 | !1016, !1018, !1017, !1005, !1019, !1025, !1028, !1029, !1031, !1015, !1032, | ||
50 | 44 | !1034, #1025] | ||
51 | 45 | |||
52 | 46 | Contributors: | ||
53 | 47 | Björn Daase, Jonas Dreßler, Olivier Fourdan, Carlos Garnacho, Adam Jackson, | ||
54 | 48 | Sebastian Keller, Robert Mader, Alberts Muktupāvels, Florian Müllner, | ||
55 | 49 | Georges Basile Stavracas Neto, Corentin Noël, Pekka Paalanen, Ray Strode, | ||
56 | 50 | Daniel van Vugt, Jonas Ådahl | ||
57 | 51 | |||
58 | 52 | Translators: | ||
59 | 53 | sicklylife [ja], Umarzuki Bin Mochlis Moktar [ms] | ||
60 | 54 | |||
61 | 55 | 3.35.3 | ||
62 | 2 | ====== | 56 | ====== |
63 | 57 | * backends/native: Correct dy value in pinch gesture event [Yariv; !974] | ||
64 | 58 | * Upload clipping rectangles in parallel [Daniel; !969] | ||
65 | 59 | * More cogl API cleanups [Adam; !978, !977, !973] | ||
66 | 3 | * Fix window recording on HiDPI [Pascal; !976] | 60 | * Fix window recording on HiDPI [Pascal; !976] |
67 | 4 | * Fix top-left pixel being insensitive to clicks [Sebastian; #893] | 61 | * Fix top-left pixel being insensitive to clicks [Sebastian; #893] |
68 | 62 | * Misc. bug fixes and cleanups [Daniel, Adam; !979, !980] | ||
69 | 5 | 63 | ||
70 | 6 | Contributors: | 64 | Contributors: |
72 | 7 | Sebastian Keller, Pascal Nowack | 65 | Yariv Barkan, Adam Jackson, Sebastian Keller, Pascal Nowack, Daniel van Vugt |
73 | 66 | |||
74 | 67 | Translators: | ||
75 | 68 | Fran Dieguez [gl], Dz Chen [zh_CN] | ||
76 | 8 | 69 | ||
78 | 9 | 3.34.2 | 70 | 3.35.2 |
79 | 10 | ====== | 71 | ====== |
87 | 11 | * Fix immediate screen blank after releasing inhibitor [Tim; #573] | 72 | * Don't emit focus event after destruction [Marco; gnome-shell#1704, !860] |
88 | 12 | * Respond to frame callbacks regardless of damage [Jonas Å.; !839] | 73 | * Add a notion of pixel format planes [Niels; !858] |
89 | 13 | * Translate well-known selection atoms to mimetypes [Carlos; !842] | 74 | * Replace various Cogl/Clutter types with Graphene [Georges; !458] |
90 | 14 | * Fix Night Light on wayland [Jonas Å.; !840] | 75 | * Improve CoglJournal [Georges, Jasper; !402] |
91 | 15 | * Fix various copy+paste/DND regressions [Carlos; !848, #789, #842, | 76 | * Split pick and paint [Georges; !865] |
92 | 16 | #793, #845, #854] | 77 | * Remove deprecated/unused cogl/clutter APIs [Adam; !866, !878, !879, !880, |
93 | 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] |
94 | 18 | * Fix hang when opening not-responding dialog on Xorg [Carlos; !876] | 79 | * Fix hang when opening not-responding dialog on Xorg [Carlos; !876] |
98 | 19 | * Fix frozen grabs on Xorg after weeks of inactivity [Jonas Å.; !886] | 80 | * Allow changing Clutter debug flags at runtime [Georges; !862] |
99 | 20 | * Fix triggering popups from stylus devices on wayland [Carlos; #886] | 81 | * Fix frozen grabs on Xorg after weeks of inactivity [Jonas; !886] |
100 | 21 | * Support shadow framebuffers for offscreen rendering [Olivier; !917] | 82 | * Fix triggering popups from stylus devices o wayland [Carlos; #886] |
101 | 83 | * Fix fallback to GLES2 [Adam; #635] | ||
102 | 84 | * Fix buffer age checks on multiple monitors [Carlos; !906] | ||
103 | 85 | * Adjust to Sysprof API change [Christian; !908] | ||
104 | 86 | * Improve support for (X11) fullscreen games under wayland [Hans; !739] | ||
105 | 87 | * Support shadow framebuffers for offscreen rendering [Olivier; !877] | ||
106 | 22 | * Fix hang after interacting with desktop icons on X11 [Marco; !909] | 88 | * Fix hang after interacting with desktop icons on X11 [Marco; !909] |
107 | 23 | * Don't double scale when getting absolute surface coordinates [Xiang; !915] | 89 | * Don't double scale when getting absolute surface coordinates [Xiang; !915] |
108 | 90 | * Respect NET_WM_TRANSIENT_FOR for override-redirect windows [Marco; !920] | ||
109 | 24 | * Kill window effects on destroy [Robert; !924] | 91 | * Kill window effects on destroy [Robert; !924] |
110 | 92 | * Remove deprecated ClutterTexture [Jonas; !932] | ||
111 | 93 | * Use regions instead of bounding box for clipping and culling [Carlos; !867] | ||
112 | 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] |
113 | 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] |
127 | 27 | * Fix KMS freeze after pageflip [Pekka; !953] | 96 | * Add explicit paint/pick contexts [Jonas; !935] |
128 | 28 | * Fixed crashes [Robert, Jonas Å., Marco, Hans, Carlos, Tim; !856, !912, !895, | 97 | * Fix KMS freeze after pageflip fallback [Pekka; !953] |
129 | 29 | !928, #591, !823, !960] | 98 | * Fixed crashes [Robert, Carlos, Jonas, Marco, Hans, Tim; !856, !869, !912, |
130 | 30 | * Plugged memory leaks [Niels, Robert, Carlos; !847, !868, !873] | 99 | !895, !928, #591, !823, !960] |
131 | 31 | * Misc. bug fixes and cleanups [Daniel, Marco, Jonas Å., Georges, Cosimo, | 100 | * Plugged memory leaks [Niels, Robert, Carlos, Marco; !847, !868, !873, #908] |
132 | 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, |
133 | 33 | !925, !927, !940, !832] | 102 | Jan, Adam, Cosimo, Florian, Thomas, Georges, Hans, Corentin, Christian, |
134 | 34 | 103 | Benjamin; !853, !822, !451, !854, !816, !857, !859, !734, !844, !851, #876, | |
135 | 35 | Contributors: | 104 | !874, !673, !692, !888, !889, !894, !901, !905, !872, !898, !911, !918, !863, |
136 | 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, |
137 | 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] |
138 | 38 | Tim Klocke, Robert Mader, Florian Müllner, Georges Basile Stavracas Neto, | 107 | |
139 | 39 | Pekka Paalanen, Daniel van Vugt, Jonas Ådahl | 108 | Contributors: |
140 | 109 | Marco Trevisan (Treviño), Jan Alexander Steffens (heftig), | ||
141 | 110 | Thomas Hindoe Paaboel Andersen, Benjamin Berg, Cosimo Cecchi, Tim Crawford, | ||
142 | 111 | Piotr Drąg, Xiang Fan, Olivier Fourdan, Carlos Garnacho, Hans de Goede, | ||
143 | 112 | Niels De Graef, Christian Hergert, Adam Jackson, Robert Mader, | ||
144 | 113 | Florian Müllner, Georges Basile Stavracas Neto, Bastien Nocera, Corentin Noël, | ||
145 | 114 | Pekka Paalanen, Jasper St. Pierre, Christian Rauch, Daniel van Vugt, | ||
146 | 115 | Jonas Ådahl | ||
147 | 40 | 116 | ||
148 | 41 | Translators: | 117 | Translators: |
149 | 42 | Bruce Cowan [en_GB] | 118 | Bruce Cowan [en_GB] |
150 | 119 | |||
151 | 120 | 3.35.1 | ||
152 | 121 | ====== | ||
153 | 122 | * Fix immediate screen blank after releaseing inhibitor [Tim; #573] | ||
154 | 123 | * Respond to frame callbacks regardless of damage [Jonas; !839] | ||
155 | 124 | * selection [Carlos; !842] | ||
156 | 125 | * Fix Night Light on wayland [Jonas; !840] | ||
157 | 126 | * Fix various copy+paste/DND regressions [Carlos; !848, #789, #842, | ||
158 | 127 | #793, #845, #854] | ||
159 | 128 | * Misc. bug fixes and cleanups [Daniel, Marco, Jonas, Georges; | ||
160 | 129 | !841, !764, !837, !846] | ||
161 | 130 | |||
162 | 131 | Contributors: | ||
163 | 132 | Marco Trevisan (Treviño), Carlos Garnacho, Tim Klocke, | ||
164 | 133 | Georges Basile Stavracas Neto, Daniel van Vugt, Jonas Ådahl | ||
165 | 134 | |||
166 | 43 | 3.34.1 | 135 | 3.34.1 |
167 | 44 | ====== | 136 | ====== |
168 | 45 | * Fix startup of X11 session services on wayland [Carlos; #771] | 137 | * Fix startup of X11 session services on wayland [Carlos; #771] |
169 | diff --git a/clutter/clutter/cally/cally-actor.c b/clutter/clutter/cally/cally-actor.c | |||
170 | index d97357d..c92b576 100644 | |||
171 | --- a/clutter/clutter/cally/cally-actor.c | |||
172 | +++ b/clutter/clutter/cally/cally-actor.c | |||
173 | @@ -310,11 +310,7 @@ cally_actor_finalize (GObject *obj) | |||
174 | 310 | 310 | ||
175 | 311 | _cally_actor_clean_action_list (cally_actor); | 311 | _cally_actor_clean_action_list (cally_actor); |
176 | 312 | 312 | ||
182 | 313 | if (priv->action_idle_handler) | 313 | g_clear_handle_id (&priv->action_idle_handler, g_source_remove); |
178 | 314 | { | ||
179 | 315 | g_source_remove (priv->action_idle_handler); | ||
180 | 316 | priv->action_idle_handler = 0; | ||
181 | 317 | } | ||
183 | 318 | 314 | ||
184 | 319 | if (priv->action_queue) | 315 | if (priv->action_queue) |
185 | 320 | { | 316 | { |
186 | @@ -657,7 +653,7 @@ cally_actor_get_extents (AtkComponent *component, | |||
187 | 657 | ClutterActor *actor = NULL; | 653 | ClutterActor *actor = NULL; |
188 | 658 | gint top_level_x, top_level_y; | 654 | gint top_level_x, top_level_y; |
189 | 659 | gfloat f_width, f_height; | 655 | gfloat f_width, f_height; |
191 | 660 | ClutterVertex verts[4]; | 656 | graphene_point3d_t verts[4]; |
192 | 661 | ClutterActor *stage = NULL; | 657 | ClutterActor *stage = NULL; |
193 | 662 | 658 | ||
194 | 663 | g_return_if_fail (CALLY_IS_ACTOR (component)); | 659 | g_return_if_fail (CALLY_IS_ACTOR (component)); |
195 | diff --git a/clutter/clutter/cally/cally-text.c b/clutter/clutter/cally/cally-text.c | |||
196 | index 6375a38..2b34f09 100644 | |||
197 | --- a/clutter/clutter/cally/cally-text.c | |||
198 | +++ b/clutter/clutter/cally/cally-text.c | |||
199 | @@ -247,11 +247,7 @@ cally_text_finalize (GObject *obj) | |||
200 | 247 | /* g_object_unref (cally_text->priv->textutil); */ | 247 | /* g_object_unref (cally_text->priv->textutil); */ |
201 | 248 | /* cally_text->priv->textutil = NULL; */ | 248 | /* cally_text->priv->textutil = NULL; */ |
202 | 249 | 249 | ||
208 | 250 | if (cally_text->priv->insert_idle_handler) | 250 | g_clear_handle_id (&cally_text->priv->insert_idle_handler, g_source_remove); |
204 | 251 | { | ||
205 | 252 | g_source_remove (cally_text->priv->insert_idle_handler); | ||
206 | 253 | cally_text->priv->insert_idle_handler = 0; | ||
207 | 254 | } | ||
209 | 255 | 251 | ||
210 | 256 | G_OBJECT_CLASS (cally_text_parent_class)->finalize (obj); | 252 | G_OBJECT_CLASS (cally_text_parent_class)->finalize (obj); |
211 | 257 | } | 253 | } |
212 | @@ -1438,7 +1434,7 @@ static void cally_text_get_character_extents (AtkText *text, | |||
213 | 1438 | PangoLayout *layout; | 1434 | PangoLayout *layout; |
214 | 1439 | PangoRectangle extents; | 1435 | PangoRectangle extents; |
215 | 1440 | const gchar *text_value; | 1436 | const gchar *text_value; |
217 | 1441 | ClutterVertex verts[4]; | 1437 | graphene_point3d_t verts[4]; |
218 | 1442 | 1438 | ||
219 | 1443 | actor = CALLY_GET_CLUTTER_ACTOR (text); | 1439 | actor = CALLY_GET_CLUTTER_ACTOR (text); |
220 | 1444 | if (actor == NULL) /* State is defunct */ | 1440 | if (actor == NULL) /* State is defunct */ |
221 | @@ -2294,7 +2290,7 @@ _cally_misc_get_index_at_point (ClutterText *clutter_text, | |||
222 | 2294 | gint index, x_window, y_window, x_toplevel, y_toplevel; | 2290 | gint index, x_window, y_window, x_toplevel, y_toplevel; |
223 | 2295 | gint x_temp, y_temp; | 2291 | gint x_temp, y_temp; |
224 | 2296 | gboolean ret; | 2292 | gboolean ret; |
226 | 2297 | ClutterVertex verts[4]; | 2293 | graphene_point3d_t verts[4]; |
227 | 2298 | PangoLayout *layout; | 2294 | PangoLayout *layout; |
228 | 2299 | gint x_layout, y_layout; | 2295 | gint x_layout, y_layout; |
229 | 2300 | 2296 | ||
230 | diff --git a/clutter/clutter/cally/cally-texture.c b/clutter/clutter/cally/cally-texture.c | |||
231 | 2301 | deleted file mode 100644 | 2297 | deleted file mode 100644 |
232 | index e7df619..0000000 | |||
233 | --- a/clutter/clutter/cally/cally-texture.c | |||
234 | +++ /dev/null | |||
235 | @@ -1,98 +0,0 @@ | |||
236 | 1 | /* CALLY - The Clutter Accessibility Implementation Library | ||
237 | 2 | * | ||
238 | 3 | * Copyright (C) 2009 Igalia, S.L. | ||
239 | 4 | * | ||
240 | 5 | * Author: Alejandro Piñeiro Iglesias <apinheiro@igalia.com> | ||
241 | 6 | * | ||
242 | 7 | * This library is free software; you can redistribute it and/or | ||
243 | 8 | * modify it under the terms of the GNU Lesser General Public | ||
244 | 9 | * License as published by the Free Software Foundation; either | ||
245 | 10 | * version 2 of the License, or (at your option) any later version. | ||
246 | 11 | * | ||
247 | 12 | * This library is distributed in the hope that it will be useful, | ||
248 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
249 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
250 | 15 | * Lesser General Public License for more details. | ||
251 | 16 | * | ||
252 | 17 | * You should have received a copy of the GNU Lesser General Public | ||
253 | 18 | * License along with this library; if not, write to the | ||
254 | 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
255 | 20 | * Boston, MA 02111-1307, USA. | ||
256 | 21 | */ | ||
257 | 22 | |||
258 | 23 | /** | ||
259 | 24 | * SECTION:cally-texture | ||
260 | 25 | * @Title: CallyTexture | ||
261 | 26 | * @short_description: Implementation of the ATK interfaces for a #ClutterTexture | ||
262 | 27 | * @see_also: #ClutterTexture | ||
263 | 28 | * | ||
264 | 29 | * #CallyTexture implements the required ATK interfaces of #ClutterTexture | ||
265 | 30 | * | ||
266 | 31 | * In particular it sets a proper role for the texture. | ||
267 | 32 | */ | ||
268 | 33 | #include "clutter-build-config.h" | ||
269 | 34 | |||
270 | 35 | #define CLUTTER_DISABLE_DEPRECATION_WARNINGS | ||
271 | 36 | |||
272 | 37 | #include "cally-texture.h" | ||
273 | 38 | #include "cally-actor-private.h" | ||
274 | 39 | |||
275 | 40 | #include "deprecated/clutter-texture.h" | ||
276 | 41 | |||
277 | 42 | /* AtkObject */ | ||
278 | 43 | static void cally_texture_real_initialize (AtkObject *obj, | ||
279 | 44 | gpointer data); | ||
280 | 45 | |||
281 | 46 | G_DEFINE_TYPE (CallyTexture, cally_texture, CALLY_TYPE_ACTOR) | ||
282 | 47 | |||
283 | 48 | static void | ||
284 | 49 | cally_texture_class_init (CallyTextureClass *klass) | ||
285 | 50 | { | ||
286 | 51 | /* GObjectClass *gobject_class = G_OBJECT_CLASS (klass); */ | ||
287 | 52 | AtkObjectClass *class = ATK_OBJECT_CLASS (klass); | ||
288 | 53 | |||
289 | 54 | class->initialize = cally_texture_real_initialize; | ||
290 | 55 | } | ||
291 | 56 | |||
292 | 57 | static void | ||
293 | 58 | cally_texture_init (CallyTexture *texture) | ||
294 | 59 | { | ||
295 | 60 | /* nothing to do yet */ | ||
296 | 61 | } | ||
297 | 62 | |||
298 | 63 | /** | ||
299 | 64 | * cally_texture_new: | ||
300 | 65 | * @actor: a #ClutterActor | ||
301 | 66 | * | ||
302 | 67 | * Creates a new #CallyTexture for the given @actor. @actor must be | ||
303 | 68 | * a #ClutterTexture. | ||
304 | 69 | * | ||
305 | 70 | * Return value: the newly created #AtkObject | ||
306 | 71 | * | ||
307 | 72 | * Since: 1.4 | ||
308 | 73 | */ | ||
309 | 74 | AtkObject* | ||
310 | 75 | cally_texture_new (ClutterActor *actor) | ||
311 | 76 | { | ||
312 | 77 | GObject *object = NULL; | ||
313 | 78 | AtkObject *accessible = NULL; | ||
314 | 79 | |||
315 | 80 | g_return_val_if_fail (CLUTTER_IS_TEXTURE (actor), NULL); | ||
316 | 81 | |||
317 | 82 | object = g_object_new (CALLY_TYPE_TEXTURE, NULL); | ||
318 | 83 | |||
319 | 84 | accessible = ATK_OBJECT (object); | ||
320 | 85 | atk_object_initialize (accessible, actor); | ||
321 | 86 | |||
322 | 87 | return accessible; | ||
323 | 88 | } | ||
324 | 89 | |||
325 | 90 | static void | ||
326 | 91 | cally_texture_real_initialize (AtkObject *obj, | ||
327 | 92 | gpointer data) | ||
328 | 93 | { | ||
329 | 94 | ATK_OBJECT_CLASS (cally_texture_parent_class)->initialize (obj, data); | ||
330 | 95 | |||
331 | 96 | /* default role */ | ||
332 | 97 | obj->role = ATK_ROLE_IMAGE; | ||
333 | 98 | } | ||
334 | diff --git a/clutter/clutter/cally/cally-texture.h b/clutter/clutter/cally/cally-texture.h | |||
335 | 99 | deleted file mode 100644 | 0 | deleted file mode 100644 |
336 | index 909a533..0000000 | |||
337 | --- a/clutter/clutter/cally/cally-texture.h | |||
338 | +++ /dev/null | |||
339 | @@ -1,84 +0,0 @@ | |||
340 | 1 | /* CALLY - The Clutter Accessibility Implementation Library | ||
341 | 2 | * | ||
342 | 3 | * Copyright (C) 2009 Igalia, S.L. | ||
343 | 4 | * | ||
344 | 5 | * Author: Alejandro Piñeiro Iglesias <apinheiro@igalia.com> | ||
345 | 6 | * | ||
346 | 7 | * This library is free software; you can redistribute it and/or | ||
347 | 8 | * modify it under the terms of the GNU Lesser General Public | ||
348 | 9 | * License as published by the Free Software Foundation; either | ||
349 | 10 | * version 2 of the License, or (at your option) any later version. | ||
350 | 11 | * | ||
351 | 12 | * This library is distributed in the hope that it will be useful, | ||
352 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
353 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
354 | 15 | * Lesser General Public License for more details. | ||
355 | 16 | * | ||
356 | 17 | * You should have received a copy of the GNU Lesser General Public | ||
357 | 18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
358 | 19 | */ | ||
359 | 20 | |||
360 | 21 | #ifndef __CALLY_TEXTURE_H__ | ||
361 | 22 | #define __CALLY_TEXTURE_H__ | ||
362 | 23 | |||
363 | 24 | #if !defined(__CALLY_H_INSIDE__) && !defined(CLUTTER_COMPILATION) | ||
364 | 25 | #error "Only <cally/cally.h> can be included directly." | ||
365 | 26 | #endif | ||
366 | 27 | |||
367 | 28 | #include <clutter/clutter.h> | ||
368 | 29 | #include <cally/cally-actor.h> | ||
369 | 30 | |||
370 | 31 | G_BEGIN_DECLS | ||
371 | 32 | |||
372 | 33 | #define CALLY_TYPE_TEXTURE (cally_texture_get_type ()) | ||
373 | 34 | #define CALLY_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALLY_TYPE_TEXTURE, CallyTexture)) | ||
374 | 35 | #define CALLY_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CALLY_TYPE_TEXTURE, CallyTextureClass)) | ||
375 | 36 | #define CALLY_IS_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CALLY_TYPE_TEXTURE)) | ||
376 | 37 | #define CALLY_IS_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CALLY_TYPE_TEXTURE)) | ||
377 | 38 | #define CALLY_TEXTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CALLY_TYPE_TEXTURE, CallyTextureClass)) | ||
378 | 39 | |||
379 | 40 | typedef struct _CallyTexture CallyTexture; | ||
380 | 41 | typedef struct _CallyTextureClass CallyTextureClass; | ||
381 | 42 | typedef struct _CallyTexturePrivate CallyTexturePrivate; | ||
382 | 43 | |||
383 | 44 | /** | ||
384 | 45 | * CallyTexture: | ||
385 | 46 | * | ||
386 | 47 | * The <structname>CallyTexture</structname> structure contains only | ||
387 | 48 | * private data and should be accessed using the provided API | ||
388 | 49 | * | ||
389 | 50 | * Since: 1.4 | ||
390 | 51 | */ | ||
391 | 52 | struct _CallyTexture | ||
392 | 53 | { | ||
393 | 54 | /*< private >*/ | ||
394 | 55 | CallyActor parent; | ||
395 | 56 | |||
396 | 57 | CallyTexturePrivate *priv; | ||
397 | 58 | }; | ||
398 | 59 | |||
399 | 60 | /** | ||
400 | 61 | * CallyTextureClass: | ||
401 | 62 | * | ||
402 | 63 | * The <structname>CallyTextureClass</structname> structure contains | ||
403 | 64 | * only private data | ||
404 | 65 | * | ||
405 | 66 | * Since: 1.4 | ||
406 | 67 | */ | ||
407 | 68 | struct _CallyTextureClass | ||
408 | 69 | { | ||
409 | 70 | /*< private >*/ | ||
410 | 71 | CallyActorClass parent_class; | ||
411 | 72 | |||
412 | 73 | /* padding for future expansion */ | ||
413 | 74 | gpointer _padding_dummy[8]; | ||
414 | 75 | }; | ||
415 | 76 | |||
416 | 77 | CLUTTER_EXPORT | ||
417 | 78 | GType cally_texture_get_type (void) G_GNUC_CONST; | ||
418 | 79 | CLUTTER_EXPORT | ||
419 | 80 | AtkObject *cally_texture_new (ClutterActor *actor); | ||
420 | 81 | |||
421 | 82 | G_END_DECLS | ||
422 | 83 | |||
423 | 84 | #endif /* __CALLY_TEXTURE_H__ */ | ||
424 | diff --git a/clutter/clutter/cally/cally.c b/clutter/clutter/cally/cally.c | |||
425 | index 4e1b79a..8b92682 100644 | |||
426 | --- a/clutter/clutter/cally/cally.c | |||
427 | +++ b/clutter/clutter/cally/cally.c | |||
428 | @@ -39,7 +39,6 @@ | |||
429 | 39 | #include "cally-group.h" | 39 | #include "cally-group.h" |
430 | 40 | #include "cally-stage.h" | 40 | #include "cally-stage.h" |
431 | 41 | #include "cally-text.h" | 41 | #include "cally-text.h" |
432 | 42 | #include "cally-texture.h" | ||
433 | 43 | #include "cally-rectangle.h" | 42 | #include "cally-rectangle.h" |
434 | 44 | #include "cally-clone.h" | 43 | #include "cally-clone.h" |
435 | 45 | 44 | ||
436 | @@ -56,7 +55,6 @@ CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_ACTOR, cally_actor, cally_actor_new) | |||
437 | 56 | CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_GROUP, cally_group, cally_group_new) | 55 | CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_GROUP, cally_group, cally_group_new) |
438 | 57 | CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_STAGE, cally_stage, cally_stage_new) | 56 | CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_STAGE, cally_stage, cally_stage_new) |
439 | 58 | CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_TEXT, cally_text, cally_text_new) | 57 | CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_TEXT, cally_text, cally_text_new) |
440 | 59 | CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_TEXTURE, cally_texture, cally_texture_new) | ||
441 | 60 | CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_RECTANGLE, cally_rectangle, cally_rectangle_new) | 58 | CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_RECTANGLE, cally_rectangle, cally_rectangle_new) |
442 | 61 | CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_CLONE, cally_clone, cally_clone_new) | 59 | CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_CLONE, cally_clone, cally_clone_new) |
443 | 62 | 60 | ||
444 | @@ -78,7 +76,6 @@ cally_accessibility_init (void) | |||
445 | 78 | CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_GROUP, cally_group); | 76 | CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_GROUP, cally_group); |
446 | 79 | CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_STAGE, cally_stage); | 77 | CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_STAGE, cally_stage); |
447 | 80 | CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_TEXT, cally_text); | 78 | CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_TEXT, cally_text); |
448 | 81 | CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_TEXTURE, cally_texture); | ||
449 | 82 | CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_RECTANGLE, cally_rectangle); | 79 | CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_RECTANGLE, cally_rectangle); |
450 | 83 | CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_CLONE, cally_clone); | 80 | CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_CLONE, cally_clone); |
451 | 84 | 81 | ||
452 | diff --git a/clutter/clutter/cally/cally.h b/clutter/clutter/cally/cally.h | |||
453 | index 11fa9fc..440c30b 100644 | |||
454 | --- a/clutter/clutter/cally/cally.h | |||
455 | +++ b/clutter/clutter/cally/cally.h | |||
456 | @@ -32,7 +32,6 @@ | |||
457 | 32 | #include "cally-root.h" | 32 | #include "cally-root.h" |
458 | 33 | #include "cally-stage.h" | 33 | #include "cally-stage.h" |
459 | 34 | #include "cally-text.h" | 34 | #include "cally-text.h" |
460 | 35 | #include "cally-texture.h" | ||
461 | 36 | #include "cally-util.h" | 35 | #include "cally-util.h" |
462 | 37 | 36 | ||
463 | 38 | #undef __CALLY_H_INSIDE__ | 37 | #undef __CALLY_H_INSIDE__ |
464 | diff --git a/clutter/clutter/clutter-actor-box.c b/clutter/clutter/clutter-actor-box.c | |||
465 | index 6871274..a2308ac 100644 | |||
466 | --- a/clutter/clutter/clutter-actor-box.c | |||
467 | +++ b/clutter/clutter/clutter-actor-box.c | |||
468 | @@ -340,7 +340,7 @@ clutter_actor_box_contains (const ClutterActorBox *box, | |||
469 | 340 | /** | 340 | /** |
470 | 341 | * clutter_actor_box_from_vertices: | 341 | * clutter_actor_box_from_vertices: |
471 | 342 | * @box: a #ClutterActorBox | 342 | * @box: a #ClutterActorBox |
473 | 343 | * @verts: (array fixed-size=4): array of four #ClutterVertex | 343 | * @verts: (array fixed-size=4): array of four #graphene_point3d_t |
474 | 344 | * | 344 | * |
475 | 345 | * Calculates the bounding box represented by the four vertices; for details | 345 | * Calculates the bounding box represented by the four vertices; for details |
476 | 346 | * of the vertex array see clutter_actor_get_abs_allocation_vertices(). | 346 | * of the vertex array see clutter_actor_get_abs_allocation_vertices(). |
477 | @@ -348,8 +348,8 @@ clutter_actor_box_contains (const ClutterActorBox *box, | |||
478 | 348 | * Since: 1.0 | 348 | * Since: 1.0 |
479 | 349 | */ | 349 | */ |
480 | 350 | void | 350 | void |
483 | 351 | clutter_actor_box_from_vertices (ClutterActorBox *box, | 351 | clutter_actor_box_from_vertices (ClutterActorBox *box, |
484 | 352 | const ClutterVertex verts[]) | 352 | const graphene_point3d_t verts[]) |
485 | 353 | { | 353 | { |
486 | 354 | gfloat x_1, x_2, y_1, y_2; | 354 | gfloat x_1, x_2, y_1, y_2; |
487 | 355 | 355 | ||
488 | diff --git a/clutter/clutter/clutter-actor-meta.c b/clutter/clutter/clutter-actor-meta.c | |||
489 | index d7f4fd7..eba0985 100644 | |||
490 | --- a/clutter/clutter/clutter-actor-meta.c | |||
491 | +++ b/clutter/clutter/clutter-actor-meta.c | |||
492 | @@ -51,7 +51,7 @@ | |||
493 | 51 | struct _ClutterActorMetaPrivate | 51 | struct _ClutterActorMetaPrivate |
494 | 52 | { | 52 | { |
495 | 53 | ClutterActor *actor; | 53 | ClutterActor *actor; |
497 | 54 | guint destroy_id; | 54 | gulong destroy_id; |
498 | 55 | 55 | ||
499 | 56 | gchar *name; | 56 | gchar *name; |
500 | 57 | 57 | ||
501 | @@ -91,11 +91,7 @@ clutter_actor_meta_real_set_actor (ClutterActorMeta *meta, | |||
502 | 91 | if (meta->priv->actor == actor) | 91 | if (meta->priv->actor == actor) |
503 | 92 | return; | 92 | return; |
504 | 93 | 93 | ||
510 | 94 | if (meta->priv->destroy_id != 0) | 94 | g_clear_signal_handler (&meta->priv->destroy_id, meta->priv->actor); |
506 | 95 | { | ||
507 | 96 | g_signal_handler_disconnect (meta->priv->actor, meta->priv->destroy_id); | ||
508 | 97 | meta->priv->destroy_id = 0; | ||
509 | 98 | } | ||
511 | 99 | 95 | ||
512 | 100 | meta->priv->actor = actor; | 96 | meta->priv->actor = actor; |
513 | 101 | 97 | ||
514 | @@ -162,8 +158,8 @@ clutter_actor_meta_finalize (GObject *gobject) | |||
515 | 162 | { | 158 | { |
516 | 163 | ClutterActorMetaPrivate *priv = CLUTTER_ACTOR_META (gobject)->priv; | 159 | ClutterActorMetaPrivate *priv = CLUTTER_ACTOR_META (gobject)->priv; |
517 | 164 | 160 | ||
520 | 165 | if (priv->destroy_id != 0 && priv->actor != NULL) | 161 | if (priv->actor != NULL) |
521 | 166 | g_signal_handler_disconnect (priv->actor, priv->destroy_id); | 162 | g_clear_signal_handler (&priv->destroy_id, priv->actor); |
522 | 167 | 163 | ||
523 | 168 | g_free (priv->name); | 164 | g_free (priv->name); |
524 | 169 | 165 | ||
525 | diff --git a/clutter/clutter/clutter-actor-private.h b/clutter/clutter/clutter-actor-private.h | |||
526 | index fa2d4c3..9ff4b2d 100644 | |||
527 | --- a/clutter/clutter/clutter-actor-private.h | |||
528 | +++ b/clutter/clutter/clutter-actor-private.h | |||
529 | @@ -135,7 +135,7 @@ struct _AnchorCoord | |||
530 | 135 | } fraction; | 135 | } fraction; |
531 | 136 | 136 | ||
532 | 137 | /* Use when is_fractional == FALSE */ | 137 | /* Use when is_fractional == FALSE */ |
534 | 138 | ClutterVertex units; | 138 | graphene_point3d_t units; |
535 | 139 | } v; | 139 | } v; |
536 | 140 | }; | 140 | }; |
537 | 141 | 141 | ||
538 | @@ -163,7 +163,7 @@ struct _SizeRequest | |||
539 | 163 | struct _ClutterLayoutInfo | 163 | struct _ClutterLayoutInfo |
540 | 164 | { | 164 | { |
541 | 165 | /* fixed position coordinates */ | 165 | /* fixed position coordinates */ |
543 | 166 | ClutterPoint fixed_pos; | 166 | graphene_point_t fixed_pos; |
544 | 167 | 167 | ||
545 | 168 | ClutterMargin margin; | 168 | ClutterMargin margin; |
546 | 169 | 169 | ||
547 | @@ -173,8 +173,8 @@ struct _ClutterLayoutInfo | |||
548 | 173 | guint x_expand : 1; | 173 | guint x_expand : 1; |
549 | 174 | guint y_expand : 1; | 174 | guint y_expand : 1; |
550 | 175 | 175 | ||
553 | 176 | ClutterSize minimum; | 176 | graphene_size_t minimum; |
554 | 177 | ClutterSize natural; | 177 | graphene_size_t natural; |
555 | 178 | }; | 178 | }; |
556 | 179 | 179 | ||
557 | 180 | const ClutterLayoutInfo * _clutter_actor_get_layout_info_or_defaults (ClutterActor *self); | 180 | const ClutterLayoutInfo * _clutter_actor_get_layout_info_or_defaults (ClutterActor *self); |
558 | @@ -203,13 +203,13 @@ struct _ClutterTransformInfo | |||
559 | 203 | AnchorCoord anchor; | 203 | AnchorCoord anchor; |
560 | 204 | 204 | ||
561 | 205 | /* translation */ | 205 | /* translation */ |
563 | 206 | ClutterVertex translation; | 206 | graphene_point3d_t translation; |
564 | 207 | 207 | ||
565 | 208 | /* z_position */ | 208 | /* z_position */ |
566 | 209 | gfloat z_position; | 209 | gfloat z_position; |
567 | 210 | 210 | ||
568 | 211 | /* transformation center */ | 211 | /* transformation center */ |
570 | 212 | ClutterPoint pivot; | 212 | graphene_point_t pivot; |
571 | 213 | gfloat pivot_z; | 213 | gfloat pivot_z; |
572 | 214 | 214 | ||
573 | 215 | CoglMatrix transform; | 215 | CoglMatrix transform; |
574 | @@ -315,7 +315,6 @@ void _clutter_actor_queue_relayout_on_clones | |||
575 | 315 | void _clutter_actor_queue_only_relayout (ClutterActor *actor); | 315 | void _clutter_actor_queue_only_relayout (ClutterActor *actor); |
576 | 316 | void _clutter_actor_queue_update_resource_scale_recursive (ClutterActor *actor); | 316 | void _clutter_actor_queue_update_resource_scale_recursive (ClutterActor *actor); |
577 | 317 | 317 | ||
578 | 318 | CoglFramebuffer * _clutter_actor_get_active_framebuffer (ClutterActor *actor); | ||
579 | 319 | gboolean _clutter_actor_get_real_resource_scale (ClutterActor *actor, | 318 | gboolean _clutter_actor_get_real_resource_scale (ClutterActor *actor, |
580 | 320 | float *resource_scale); | 319 | float *resource_scale); |
581 | 321 | 320 | ||
582 | diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c | |||
583 | index ecf9a59..610741a 100644 | |||
584 | --- a/clutter/clutter/clutter-actor.c | |||
585 | +++ b/clutter/clutter/clutter-actor.c | |||
586 | @@ -643,6 +643,7 @@ | |||
587 | 643 | #include "clutter-main.h" | 643 | #include "clutter-main.h" |
588 | 644 | #include "clutter-marshal.h" | 644 | #include "clutter-marshal.h" |
589 | 645 | #include "clutter-mutter.h" | 645 | #include "clutter-mutter.h" |
590 | 646 | #include "clutter-paint-context-private.h" | ||
591 | 646 | #include "clutter-paint-nodes.h" | 647 | #include "clutter-paint-nodes.h" |
592 | 647 | #include "clutter-paint-node-private.h" | 648 | #include "clutter-paint-node-private.h" |
593 | 648 | #include "clutter-paint-volume-private.h" | 649 | #include "clutter-paint-volume-private.h" |
594 | @@ -656,7 +657,6 @@ | |||
595 | 656 | #include "clutter-units.h" | 657 | #include "clutter-units.h" |
596 | 657 | 658 | ||
597 | 658 | #include "deprecated/clutter-actor.h" | 659 | #include "deprecated/clutter-actor.h" |
598 | 659 | #include "deprecated/clutter-behaviour.h" | ||
599 | 660 | #include "deprecated/clutter-container.h" | 660 | #include "deprecated/clutter-container.h" |
600 | 661 | 661 | ||
601 | 662 | /* Internal enum used to control mapped state update. This is a hint | 662 | /* Internal enum used to control mapped state update. This is a hint |
602 | @@ -701,7 +701,7 @@ struct _ClutterActorPrivate | |||
603 | 701 | ClutterAllocationFlags allocation_flags; | 701 | ClutterAllocationFlags allocation_flags; |
604 | 702 | 702 | ||
605 | 703 | /* clip, in actor coordinates */ | 703 | /* clip, in actor coordinates */ |
607 | 704 | ClutterRect clip; | 704 | graphene_rect_t clip; |
608 | 705 | 705 | ||
609 | 706 | /* the cached transformation matrix; see apply_transform() */ | 706 | /* the cached transformation matrix; see apply_transform() */ |
610 | 707 | CoglMatrix transform; | 707 | CoglMatrix transform; |
611 | @@ -746,9 +746,6 @@ struct _ClutterActorPrivate | |||
612 | 746 | */ | 746 | */ |
613 | 747 | ClutterTextDirection text_direction; | 747 | ClutterTextDirection text_direction; |
614 | 748 | 748 | ||
615 | 749 | /* a counter used to toggle the CLUTTER_INTERNAL_CHILD flag */ | ||
616 | 750 | gint internal_child; | ||
617 | 751 | |||
618 | 752 | /* meta classes */ | 749 | /* meta classes */ |
619 | 753 | ClutterMetaGroup *actions; | 750 | ClutterMetaGroup *actions; |
620 | 754 | ClutterMetaGroup *constraints; | 751 | ClutterMetaGroup *constraints; |
621 | @@ -812,8 +809,8 @@ struct _ClutterActorPrivate | |||
622 | 812 | gpointer create_child_data; | 809 | gpointer create_child_data; |
623 | 813 | GDestroyNotify create_child_notify; | 810 | GDestroyNotify create_child_notify; |
624 | 814 | 811 | ||
627 | 815 | guint resolution_changed_id; | 812 | gulong resolution_changed_id; |
628 | 816 | guint font_changed_id; | 813 | gulong font_changed_id; |
629 | 817 | 814 | ||
630 | 818 | /* bitfields: KEEP AT THE END */ | 815 | /* bitfields: KEEP AT THE END */ |
631 | 819 | 816 | ||
632 | @@ -905,7 +902,6 @@ enum | |||
633 | 905 | PROP_DEPTH, /* XXX:2.0 remove */ | 902 | PROP_DEPTH, /* XXX:2.0 remove */ |
634 | 906 | PROP_Z_POSITION, | 903 | PROP_Z_POSITION, |
635 | 907 | 904 | ||
636 | 908 | PROP_CLIP, /* XXX:2.0 remove */ | ||
637 | 909 | PROP_CLIP_RECT, | 905 | PROP_CLIP_RECT, |
638 | 910 | PROP_HAS_CLIP, | 906 | PROP_HAS_CLIP, |
639 | 911 | PROP_CLIP_TO_ALLOCATION, | 907 | PROP_CLIP_TO_ALLOCATION, |
640 | @@ -1291,10 +1287,12 @@ clutter_actor_verify_map_state (ClutterActor *self) | |||
641 | 1291 | static gboolean | 1287 | static gboolean |
642 | 1292 | _clutter_actor_transform_local_box_to_stage (ClutterActor *self, | 1288 | _clutter_actor_transform_local_box_to_stage (ClutterActor *self, |
643 | 1293 | ClutterStage *stage, | 1289 | ClutterStage *stage, |
644 | 1290 | ClutterPickContext *pick_context, | ||
645 | 1294 | const ClutterActorBox *box, | 1291 | const ClutterActorBox *box, |
647 | 1295 | ClutterPoint vertices[4]) | 1292 | graphene_point_t vertices[4]) |
648 | 1296 | { | 1293 | { |
650 | 1297 | CoglFramebuffer *fb = cogl_get_draw_framebuffer (); | 1294 | CoglFramebuffer *fb = |
651 | 1295 | clutter_pick_context_get_framebuffer (pick_context); | ||
652 | 1298 | CoglMatrix stage_transform, inv_stage_transform; | 1296 | CoglMatrix stage_transform, inv_stage_transform; |
653 | 1299 | CoglMatrix modelview, transform_to_stage; | 1297 | CoglMatrix modelview, transform_to_stage; |
654 | 1300 | int v; | 1298 | int v; |
655 | @@ -1335,6 +1333,7 @@ _clutter_actor_transform_local_box_to_stage (ClutterActor *self, | |||
656 | 1335 | /** | 1333 | /** |
657 | 1336 | * clutter_actor_pick_box: | 1334 | * clutter_actor_pick_box: |
658 | 1337 | * @self: The #ClutterActor being "pick" painted. | 1335 | * @self: The #ClutterActor being "pick" painted. |
659 | 1336 | * @pick_context: The #ClutterPickContext | ||
660 | 1338 | * @box: A rectangle in the actor's own local coordinates. | 1337 | * @box: A rectangle in the actor's own local coordinates. |
661 | 1339 | * | 1338 | * |
662 | 1340 | * Logs (does a virtual paint of) a rectangle for picking. Note that @box is | 1339 | * Logs (does a virtual paint of) a rectangle for picking. Note that @box is |
663 | @@ -1345,10 +1344,11 @@ _clutter_actor_transform_local_box_to_stage (ClutterActor *self, | |||
664 | 1345 | */ | 1344 | */ |
665 | 1346 | void | 1345 | void |
666 | 1347 | clutter_actor_pick_box (ClutterActor *self, | 1346 | clutter_actor_pick_box (ClutterActor *self, |
667 | 1347 | ClutterPickContext *pick_context, | ||
668 | 1348 | const ClutterActorBox *box) | 1348 | const ClutterActorBox *box) |
669 | 1349 | { | 1349 | { |
670 | 1350 | ClutterStage *stage; | 1350 | ClutterStage *stage; |
672 | 1351 | ClutterPoint vertices[4]; | 1351 | graphene_point_t vertices[4]; |
673 | 1352 | 1352 | ||
674 | 1353 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | 1353 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); |
675 | 1354 | g_return_if_fail (box != NULL); | 1354 | g_return_if_fail (box != NULL); |
676 | @@ -1358,20 +1358,23 @@ clutter_actor_pick_box (ClutterActor *self, | |||
677 | 1358 | 1358 | ||
678 | 1359 | stage = CLUTTER_STAGE (_clutter_actor_get_stage_internal (self)); | 1359 | stage = CLUTTER_STAGE (_clutter_actor_get_stage_internal (self)); |
679 | 1360 | 1360 | ||
681 | 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, |
682 | 1362 | box, vertices)) | ||
683 | 1362 | clutter_stage_log_pick (stage, vertices, self); | 1363 | clutter_stage_log_pick (stage, vertices, self); |
684 | 1363 | } | 1364 | } |
685 | 1364 | 1365 | ||
686 | 1365 | static gboolean | 1366 | static gboolean |
687 | 1366 | _clutter_actor_push_pick_clip (ClutterActor *self, | 1367 | _clutter_actor_push_pick_clip (ClutterActor *self, |
688 | 1368 | ClutterPickContext *pick_context, | ||
689 | 1367 | const ClutterActorBox *clip) | 1369 | const ClutterActorBox *clip) |
690 | 1368 | { | 1370 | { |
691 | 1369 | ClutterStage *stage; | 1371 | ClutterStage *stage; |
693 | 1370 | ClutterPoint vertices[4]; | 1372 | graphene_point_t vertices[4]; |
694 | 1371 | 1373 | ||
695 | 1372 | stage = CLUTTER_STAGE (_clutter_actor_get_stage_internal (self)); | 1374 | stage = CLUTTER_STAGE (_clutter_actor_get_stage_internal (self)); |
696 | 1373 | 1375 | ||
698 | 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, |
699 | 1377 | clip, vertices)) | ||
700 | 1375 | return FALSE; | 1378 | return FALSE; |
701 | 1376 | 1379 | ||
702 | 1377 | clutter_stage_push_pick_clip (stage, vertices); | 1380 | clutter_stage_push_pick_clip (stage, vertices); |
703 | @@ -1776,6 +1779,15 @@ clutter_actor_unmap (ClutterActor *self) | |||
704 | 1776 | } | 1779 | } |
705 | 1777 | 1780 | ||
706 | 1778 | static void | 1781 | static void |
707 | 1782 | clutter_actor_queue_shallow_relayout (ClutterActor *self) | ||
708 | 1783 | { | ||
709 | 1784 | ClutterActor *stage = _clutter_actor_get_stage_internal (self); | ||
710 | 1785 | |||
711 | 1786 | if (stage != NULL) | ||
712 | 1787 | clutter_stage_queue_actor_relayout (CLUTTER_STAGE (stage), self); | ||
713 | 1788 | } | ||
714 | 1789 | |||
715 | 1790 | static void | ||
716 | 1779 | clutter_actor_real_show (ClutterActor *self) | 1791 | clutter_actor_real_show (ClutterActor *self) |
717 | 1780 | { | 1792 | { |
718 | 1781 | ClutterActorPrivate *priv = self->priv; | 1793 | ClutterActorPrivate *priv = self->priv; |
719 | @@ -1808,6 +1820,11 @@ clutter_actor_real_show (ClutterActor *self) | |||
720 | 1808 | 1820 | ||
721 | 1809 | clutter_actor_queue_relayout (self); | 1821 | clutter_actor_queue_relayout (self); |
722 | 1810 | } | 1822 | } |
723 | 1823 | else /* but still don't leave the actor un-allocated before showing it */ | ||
724 | 1824 | { | ||
725 | 1825 | clutter_actor_queue_shallow_relayout (self); | ||
726 | 1826 | clutter_actor_queue_redraw (self); | ||
727 | 1827 | } | ||
728 | 1811 | } | 1828 | } |
729 | 1812 | 1829 | ||
730 | 1813 | static inline void | 1830 | static inline void |
731 | @@ -2034,29 +2051,6 @@ clutter_actor_hide (ClutterActor *self) | |||
732 | 2034 | } | 2051 | } |
733 | 2035 | 2052 | ||
734 | 2036 | /** | 2053 | /** |
735 | 2037 | * clutter_actor_hide_all: | ||
736 | 2038 | * @self: a #ClutterActor | ||
737 | 2039 | * | ||
738 | 2040 | * Calls clutter_actor_hide() on all child actors (if any). | ||
739 | 2041 | * | ||
740 | 2042 | * Since: 0.2 | ||
741 | 2043 | * | ||
742 | 2044 | * Deprecated: 1.10: Using clutter_actor_hide() on the actor will | ||
743 | 2045 | * prevent its children from being painted as well. | ||
744 | 2046 | */ | ||
745 | 2047 | void | ||
746 | 2048 | clutter_actor_hide_all (ClutterActor *self) | ||
747 | 2049 | { | ||
748 | 2050 | ClutterActorClass *klass; | ||
749 | 2051 | |||
750 | 2052 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | ||
751 | 2053 | |||
752 | 2054 | klass = CLUTTER_ACTOR_GET_CLASS (self); | ||
753 | 2055 | if (klass->hide_all) | ||
754 | 2056 | klass->hide_all (self); | ||
755 | 2057 | } | ||
756 | 2058 | |||
757 | 2059 | /** | ||
758 | 2060 | * clutter_actor_realize: | 2054 | * clutter_actor_realize: |
759 | 2061 | * @self: A #ClutterActor | 2055 | * @self: A #ClutterActor |
760 | 2062 | * | 2056 | * |
761 | @@ -2350,7 +2344,7 @@ _clutter_actor_rerealize (ClutterActor *self, | |||
762 | 2350 | 2344 | ||
763 | 2351 | static void | 2345 | static void |
764 | 2352 | clutter_actor_real_pick (ClutterActor *self, | 2346 | clutter_actor_real_pick (ClutterActor *self, |
766 | 2353 | const ClutterColor *color) | 2347 | ClutterPickContext *pick_context) |
767 | 2354 | { | 2348 | { |
768 | 2355 | if (clutter_actor_should_pick_paint (self)) | 2349 | if (clutter_actor_should_pick_paint (self)) |
769 | 2356 | { | 2350 | { |
770 | @@ -2361,7 +2355,7 @@ clutter_actor_real_pick (ClutterActor *self, | |||
771 | 2361 | .y2 = clutter_actor_get_height (self), | 2355 | .y2 = clutter_actor_get_height (self), |
772 | 2362 | }; | 2356 | }; |
773 | 2363 | 2357 | ||
775 | 2364 | clutter_actor_pick_box (self, &box); | 2358 | clutter_actor_pick_box (self, pick_context, &box); |
776 | 2365 | } | 2359 | } |
777 | 2366 | 2360 | ||
778 | 2367 | /* XXX - this thoroughly sucks, but we need to maintain compatibility | 2361 | /* XXX - this thoroughly sucks, but we need to maintain compatibility |
779 | @@ -2378,7 +2372,7 @@ clutter_actor_real_pick (ClutterActor *self, | |||
780 | 2378 | for (iter = self->priv->first_child; | 2372 | for (iter = self->priv->first_child; |
781 | 2379 | iter != NULL; | 2373 | iter != NULL; |
782 | 2380 | iter = iter->priv->next_sibling) | 2374 | iter = iter->priv->next_sibling) |
784 | 2381 | clutter_actor_paint (iter); | 2375 | clutter_actor_pick (iter, pick_context); |
785 | 2382 | } | 2376 | } |
786 | 2383 | } | 2377 | } |
787 | 2384 | 2378 | ||
788 | @@ -2884,9 +2878,23 @@ clutter_actor_real_queue_relayout (ClutterActor *self) | |||
789 | 2884 | memset (priv->height_requests, 0, | 2878 | memset (priv->height_requests, 0, |
790 | 2885 | N_CACHED_SIZE_REQUESTS * sizeof (SizeRequest)); | 2879 | N_CACHED_SIZE_REQUESTS * sizeof (SizeRequest)); |
791 | 2886 | 2880 | ||
793 | 2887 | /* We need to go all the way up the hierarchy */ | 2881 | /* We may need to go all the way up the hierarchy */ |
794 | 2888 | if (priv->parent != NULL) | 2882 | if (priv->parent != NULL) |
796 | 2889 | _clutter_actor_queue_only_relayout (priv->parent); | 2883 | { |
797 | 2884 | if (priv->parent->flags & CLUTTER_ACTOR_NO_LAYOUT) | ||
798 | 2885 | { | ||
799 | 2886 | clutter_actor_queue_shallow_relayout (self); | ||
800 | 2887 | |||
801 | 2888 | /* The above might have invalidated the parent's paint volume if self | ||
802 | 2889 | * has moved or resized. DnD seems to require this... | ||
803 | 2890 | */ | ||
804 | 2891 | priv->parent->priv->needs_paint_volume_update = TRUE; | ||
805 | 2892 | } | ||
806 | 2893 | else | ||
807 | 2894 | { | ||
808 | 2895 | _clutter_actor_queue_only_relayout (priv->parent); | ||
809 | 2896 | } | ||
810 | 2897 | } | ||
811 | 2890 | } | 2898 | } |
812 | 2891 | 2899 | ||
813 | 2892 | /** | 2900 | /** |
814 | @@ -2894,8 +2902,8 @@ clutter_actor_real_queue_relayout (ClutterActor *self) | |||
815 | 2894 | * @self: A #ClutterActor | 2902 | * @self: A #ClutterActor |
816 | 2895 | * @ancestor: (allow-none): A #ClutterActor ancestor, or %NULL to use the | 2903 | * @ancestor: (allow-none): A #ClutterActor ancestor, or %NULL to use the |
817 | 2896 | * default #ClutterStage | 2904 | * default #ClutterStage |
820 | 2897 | * @point: A point as #ClutterVertex | 2905 | * @point: A point as #graphene_point3d_t |
821 | 2898 | * @vertex: (out caller-allocates): The translated #ClutterVertex | 2906 | * @vertex: (out caller-allocates): The translated #graphene_point3d_t |
822 | 2899 | * | 2907 | * |
823 | 2900 | * Transforms @point in coordinates relative to the actor into | 2908 | * Transforms @point in coordinates relative to the actor into |
824 | 2901 | * ancestor-relative coordinates using the relevant transform | 2909 | * ancestor-relative coordinates using the relevant transform |
825 | @@ -2909,10 +2917,10 @@ clutter_actor_real_queue_relayout (ClutterActor *self) | |||
826 | 2909 | * Since: 0.6 | 2917 | * Since: 0.6 |
827 | 2910 | */ | 2918 | */ |
828 | 2911 | void | 2919 | void |
833 | 2912 | clutter_actor_apply_relative_transform_to_point (ClutterActor *self, | 2920 | clutter_actor_apply_relative_transform_to_point (ClutterActor *self, |
834 | 2913 | ClutterActor *ancestor, | 2921 | ClutterActor *ancestor, |
835 | 2914 | const ClutterVertex *point, | 2922 | const graphene_point3d_t *point, |
836 | 2915 | ClutterVertex *vertex) | 2923 | graphene_point3d_t *vertex) |
837 | 2916 | { | 2924 | { |
838 | 2917 | gfloat w; | 2925 | gfloat w; |
839 | 2918 | CoglMatrix matrix; | 2926 | CoglMatrix matrix; |
840 | @@ -2939,10 +2947,10 @@ clutter_actor_apply_relative_transform_to_point (ClutterActor *self, | |||
841 | 2939 | } | 2947 | } |
842 | 2940 | 2948 | ||
843 | 2941 | static gboolean | 2949 | static gboolean |
848 | 2942 | _clutter_actor_fully_transform_vertices (ClutterActor *self, | 2950 | _clutter_actor_fully_transform_vertices (ClutterActor *self, |
849 | 2943 | const ClutterVertex *vertices_in, | 2951 | const graphene_point3d_t *vertices_in, |
850 | 2944 | ClutterVertex *vertices_out, | 2952 | graphene_point3d_t *vertices_out, |
851 | 2945 | int n_vertices) | 2953 | int n_vertices) |
852 | 2946 | { | 2954 | { |
853 | 2947 | ClutterActor *stage; | 2955 | ClutterActor *stage; |
854 | 2948 | CoglMatrix modelview; | 2956 | CoglMatrix modelview; |
855 | @@ -2984,8 +2992,8 @@ _clutter_actor_fully_transform_vertices (ClutterActor *self, | |||
856 | 2984 | /** | 2992 | /** |
857 | 2985 | * clutter_actor_apply_transform_to_point: | 2993 | * clutter_actor_apply_transform_to_point: |
858 | 2986 | * @self: A #ClutterActor | 2994 | * @self: A #ClutterActor |
861 | 2987 | * @point: A point as #ClutterVertex | 2995 | * @point: A point as #graphene_point3d_t |
862 | 2988 | * @vertex: (out caller-allocates): The translated #ClutterVertex | 2996 | * @vertex: (out caller-allocates): The translated #graphene_point3d_t |
863 | 2989 | * | 2997 | * |
864 | 2990 | * Transforms @point in coordinates relative to the actor | 2998 | * Transforms @point in coordinates relative to the actor |
865 | 2991 | * into screen-relative coordinates with the current actor | 2999 | * into screen-relative coordinates with the current actor |
866 | @@ -2994,9 +3002,9 @@ _clutter_actor_fully_transform_vertices (ClutterActor *self, | |||
867 | 2994 | * Since: 0.4 | 3002 | * Since: 0.4 |
868 | 2995 | **/ | 3003 | **/ |
869 | 2996 | void | 3004 | void |
873 | 2997 | clutter_actor_apply_transform_to_point (ClutterActor *self, | 3005 | clutter_actor_apply_transform_to_point (ClutterActor *self, |
874 | 2998 | const ClutterVertex *point, | 3006 | const graphene_point3d_t *point, |
875 | 2999 | ClutterVertex *vertex) | 3007 | graphene_point3d_t *vertex) |
876 | 3000 | { | 3008 | { |
877 | 3001 | g_return_if_fail (point != NULL); | 3009 | g_return_if_fail (point != NULL); |
878 | 3002 | g_return_if_fail (vertex != NULL); | 3010 | g_return_if_fail (vertex != NULL); |
879 | @@ -3046,10 +3054,10 @@ _clutter_actor_get_relative_transformation_matrix (ClutterActor *self, | |||
880 | 3046 | * transformed vertices to @verts[]. */ | 3054 | * transformed vertices to @verts[]. */ |
881 | 3047 | static gboolean | 3055 | static gboolean |
882 | 3048 | _clutter_actor_transform_and_project_box (ClutterActor *self, | 3056 | _clutter_actor_transform_and_project_box (ClutterActor *self, |
885 | 3049 | const ClutterActorBox *box, | 3057 | const ClutterActorBox *box, |
886 | 3050 | ClutterVertex verts[]) | 3058 | graphene_point3d_t *verts) |
887 | 3051 | { | 3059 | { |
889 | 3052 | ClutterVertex box_vertices[4]; | 3060 | graphene_point3d_t box_vertices[4]; |
890 | 3053 | 3061 | ||
891 | 3054 | box_vertices[0].x = box->x1; | 3062 | box_vertices[0].x = box->x1; |
892 | 3055 | box_vertices[0].y = box->y1; | 3063 | box_vertices[0].y = box->y1; |
893 | @@ -3073,8 +3081,8 @@ _clutter_actor_transform_and_project_box (ClutterActor *self, | |||
894 | 3073 | * @self: A #ClutterActor | 3081 | * @self: A #ClutterActor |
895 | 3074 | * @ancestor: (allow-none): A #ClutterActor to calculate the vertices | 3082 | * @ancestor: (allow-none): A #ClutterActor to calculate the vertices |
896 | 3075 | * against, or %NULL to use the #ClutterStage | 3083 | * against, or %NULL to use the #ClutterStage |
899 | 3076 | * @verts: (out) (array fixed-size=4) (element-type Clutter.Vertex): return | 3084 | * @verts: (out) (array fixed-size=4): return |
900 | 3077 | * location for an array of 4 #ClutterVertex in which to store the result | 3085 | * location for an array of 4 #graphene_point3d_t in which to store the result |
901 | 3078 | * | 3086 | * |
902 | 3079 | * Calculates the transformed coordinates of the four corners of the | 3087 | * Calculates the transformed coordinates of the four corners of the |
903 | 3080 | * actor in the plane of @ancestor. The returned vertices relate to | 3088 | * actor in the plane of @ancestor. The returned vertices relate to |
904 | @@ -3093,13 +3101,13 @@ _clutter_actor_transform_and_project_box (ClutterActor *self, | |||
905 | 3093 | * Since: 0.6 | 3101 | * Since: 0.6 |
906 | 3094 | */ | 3102 | */ |
907 | 3095 | void | 3103 | void |
911 | 3096 | clutter_actor_get_allocation_vertices (ClutterActor *self, | 3104 | clutter_actor_get_allocation_vertices (ClutterActor *self, |
912 | 3097 | ClutterActor *ancestor, | 3105 | ClutterActor *ancestor, |
913 | 3098 | ClutterVertex verts[]) | 3106 | graphene_point3d_t *verts) |
914 | 3099 | { | 3107 | { |
915 | 3100 | ClutterActorPrivate *priv; | 3108 | ClutterActorPrivate *priv; |
916 | 3101 | ClutterActorBox box; | 3109 | ClutterActorBox box; |
918 | 3102 | ClutterVertex vertices[4]; | 3110 | graphene_point3d_t vertices[4]; |
919 | 3103 | CoglMatrix modelview; | 3111 | CoglMatrix modelview; |
920 | 3104 | 3112 | ||
921 | 3105 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | 3113 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); |
922 | @@ -3151,9 +3159,9 @@ clutter_actor_get_allocation_vertices (ClutterActor *self, | |||
923 | 3151 | 3159 | ||
924 | 3152 | cogl_matrix_transform_points (&modelview, | 3160 | cogl_matrix_transform_points (&modelview, |
925 | 3153 | 3, | 3161 | 3, |
927 | 3154 | sizeof (ClutterVertex), | 3162 | sizeof (graphene_point3d_t), |
928 | 3155 | vertices, | 3163 | vertices, |
930 | 3156 | sizeof (ClutterVertex), | 3164 | sizeof (graphene_point3d_t), |
931 | 3157 | vertices, | 3165 | vertices, |
932 | 3158 | 4); | 3166 | 4); |
933 | 3159 | } | 3167 | } |
934 | @@ -3162,7 +3170,7 @@ clutter_actor_get_allocation_vertices (ClutterActor *self, | |||
935 | 3162 | * clutter_actor_get_abs_allocation_vertices: | 3170 | * clutter_actor_get_abs_allocation_vertices: |
936 | 3163 | * @self: A #ClutterActor | 3171 | * @self: A #ClutterActor |
937 | 3164 | * @verts: (out) (array fixed-size=4): Pointer to a location of an array | 3172 | * @verts: (out) (array fixed-size=4): Pointer to a location of an array |
939 | 3165 | * of 4 #ClutterVertex where to store the result. | 3173 | * of 4 #graphene_point3d_t where to store the result. |
940 | 3166 | * | 3174 | * |
941 | 3167 | * Calculates the transformed screen coordinates of the four corners of | 3175 | * Calculates the transformed screen coordinates of the four corners of |
942 | 3168 | * the actor; the returned vertices relate to the #ClutterActorBox | 3176 | * the actor; the returned vertices relate to the #ClutterActorBox |
943 | @@ -3176,8 +3184,8 @@ clutter_actor_get_allocation_vertices (ClutterActor *self, | |||
944 | 3176 | * Since: 0.4 | 3184 | * Since: 0.4 |
945 | 3177 | */ | 3185 | */ |
946 | 3178 | void | 3186 | void |
949 | 3179 | clutter_actor_get_abs_allocation_vertices (ClutterActor *self, | 3187 | clutter_actor_get_abs_allocation_vertices (ClutterActor *self, |
950 | 3180 | ClutterVertex verts[]) | 3188 | graphene_point3d_t *verts) |
951 | 3181 | { | 3189 | { |
952 | 3182 | ClutterActorPrivate *priv; | 3190 | ClutterActorPrivate *priv; |
953 | 3183 | ClutterActorBox actor_space_allocation; | 3191 | ClutterActorBox actor_space_allocation; |
954 | @@ -3411,20 +3419,20 @@ _clutter_actor_apply_relative_transformation_matrix (ClutterActor *self, | |||
955 | 3411 | } | 3419 | } |
956 | 3412 | 3420 | ||
957 | 3413 | static void | 3421 | static void |
959 | 3414 | _clutter_actor_draw_paint_volume_full (ClutterActor *self, | 3422 | _clutter_actor_draw_paint_volume_full (ClutterActor *self, |
960 | 3415 | ClutterPaintVolume *pv, | 3423 | ClutterPaintVolume *pv, |
963 | 3416 | const char *label, | 3424 | const char *label, |
964 | 3417 | const CoglColor *color) | 3425 | const ClutterColor *color, |
965 | 3426 | ClutterPaintNode *node) | ||
966 | 3418 | { | 3427 | { |
967 | 3428 | g_autoptr (ClutterPaintNode) pipeline_node = NULL; | ||
968 | 3419 | static CoglPipeline *outline = NULL; | 3429 | static CoglPipeline *outline = NULL; |
969 | 3420 | CoglPrimitive *prim; | 3430 | CoglPrimitive *prim; |
971 | 3421 | ClutterVertex line_ends[12 * 2]; | 3431 | graphene_point3d_t line_ends[12 * 2]; |
972 | 3422 | int n_vertices; | 3432 | int n_vertices; |
973 | 3423 | CoglContext *ctx = | 3433 | CoglContext *ctx = |
974 | 3424 | clutter_backend_get_cogl_context (clutter_get_default_backend ()); | 3434 | clutter_backend_get_cogl_context (clutter_get_default_backend ()); |
978 | 3425 | /* XXX: at some point we'll query this from the stage but we can't | 3435 | CoglColor cogl_color; |
976 | 3426 | * do that until the osx backend uses Cogl natively. */ | ||
977 | 3427 | CoglFramebuffer *fb = cogl_get_draw_framebuffer (); | ||
979 | 3428 | 3436 | ||
980 | 3429 | if (outline == NULL) | 3437 | if (outline == NULL) |
981 | 3430 | outline = cogl_pipeline_new (ctx); | 3438 | outline = cogl_pipeline_new (ctx); |
982 | @@ -3458,29 +3466,50 @@ _clutter_actor_draw_paint_volume_full (ClutterActor *self, | |||
983 | 3458 | n_vertices, | 3466 | n_vertices, |
984 | 3459 | (CoglVertexP3 *)line_ends); | 3467 | (CoglVertexP3 *)line_ends); |
985 | 3460 | 3468 | ||
988 | 3461 | cogl_pipeline_set_color (outline, color); | 3469 | cogl_color_init_from_4ub (&cogl_color, |
989 | 3462 | cogl_framebuffer_draw_primitive (fb, outline, prim); | 3470 | color->red, |
990 | 3471 | color->green, | ||
991 | 3472 | color->blue, | ||
992 | 3473 | color->alpha); | ||
993 | 3474 | cogl_pipeline_set_color (outline, &cogl_color); | ||
994 | 3475 | |||
995 | 3476 | pipeline_node = clutter_pipeline_node_new (outline); | ||
996 | 3477 | clutter_paint_node_set_name (pipeline_node, | ||
997 | 3478 | "ClutterActor (paint volume outline)"); | ||
998 | 3479 | clutter_paint_node_add_primitive (pipeline_node, prim); | ||
999 | 3480 | clutter_paint_node_add_child (node, pipeline_node); | ||
1000 | 3463 | cogl_object_unref (prim); | 3481 | cogl_object_unref (prim); |
1001 | 3464 | 3482 | ||
1002 | 3465 | if (label) | 3483 | if (label) |
1003 | 3466 | { | 3484 | { |
1004 | 3485 | g_autoptr (ClutterPaintNode) text_node = NULL; | ||
1005 | 3467 | PangoLayout *layout; | 3486 | PangoLayout *layout; |
1006 | 3487 | |||
1007 | 3468 | layout = pango_layout_new (clutter_actor_get_pango_context (self)); | 3488 | layout = pango_layout_new (clutter_actor_get_pango_context (self)); |
1008 | 3469 | pango_layout_set_text (layout, label, -1); | 3489 | pango_layout_set_text (layout, label, -1); |
1014 | 3470 | cogl_pango_render_layout (layout, | 3490 | |
1015 | 3471 | pv->vertices[0].x, | 3491 | text_node = clutter_text_node_new (layout, color); |
1016 | 3472 | pv->vertices[0].y, | 3492 | clutter_paint_node_set_name (text_node, |
1017 | 3473 | color, | 3493 | "ClutterActor (paint volume label)"); |
1018 | 3474 | 0); | 3494 | clutter_paint_node_add_rectangle (text_node, |
1019 | 3495 | &(ClutterActorBox) { | ||
1020 | 3496 | .x1 = pv->vertices[0].x, | ||
1021 | 3497 | .y1 = pv->vertices[0].y, | ||
1022 | 3498 | .x2 = pv->vertices[2].x, | ||
1023 | 3499 | .y2 = pv->vertices[2].y, | ||
1024 | 3500 | }); | ||
1025 | 3501 | clutter_paint_node_add_child (node, text_node); | ||
1026 | 3502 | |||
1027 | 3475 | g_object_unref (layout); | 3503 | g_object_unref (layout); |
1028 | 3476 | } | 3504 | } |
1029 | 3477 | } | 3505 | } |
1030 | 3478 | 3506 | ||
1031 | 3479 | static void | 3507 | static void |
1033 | 3480 | _clutter_actor_draw_paint_volume (ClutterActor *self) | 3508 | _clutter_actor_draw_paint_volume (ClutterActor *self, |
1034 | 3509 | ClutterPaintNode *node) | ||
1035 | 3481 | { | 3510 | { |
1036 | 3482 | ClutterPaintVolume *pv; | 3511 | ClutterPaintVolume *pv; |
1038 | 3483 | CoglColor color; | 3512 | ClutterColor color; |
1039 | 3484 | 3513 | ||
1040 | 3485 | pv = _clutter_actor_get_paint_volume_mutable (self); | 3514 | pv = _clutter_actor_get_paint_volume_mutable (self); |
1041 | 3486 | if (!pv) | 3515 | if (!pv) |
1042 | @@ -3495,61 +3524,79 @@ _clutter_actor_draw_paint_volume (ClutterActor *self) | |||
1043 | 3495 | clutter_paint_volume_set_width (&fake_pv, width); | 3524 | clutter_paint_volume_set_width (&fake_pv, width); |
1044 | 3496 | clutter_paint_volume_set_height (&fake_pv, height); | 3525 | clutter_paint_volume_set_height (&fake_pv, height); |
1045 | 3497 | 3526 | ||
1047 | 3498 | cogl_color_init_from_4f (&color, 0, 0, 1, 1); | 3527 | clutter_color_init (&color, 0, 0, 255, 255); |
1048 | 3499 | _clutter_actor_draw_paint_volume_full (self, &fake_pv, | 3528 | _clutter_actor_draw_paint_volume_full (self, &fake_pv, |
1049 | 3500 | _clutter_actor_get_debug_name (self), | 3529 | _clutter_actor_get_debug_name (self), |
1051 | 3501 | &color); | 3530 | &color, |
1052 | 3531 | node); | ||
1053 | 3502 | 3532 | ||
1054 | 3503 | clutter_paint_volume_free (&fake_pv); | 3533 | clutter_paint_volume_free (&fake_pv); |
1055 | 3504 | } | 3534 | } |
1056 | 3505 | else | 3535 | else |
1057 | 3506 | { | 3536 | { |
1059 | 3507 | cogl_color_init_from_4f (&color, 0, 1, 0, 1); | 3537 | clutter_color_init (&color, 0, 255, 0, 255); |
1060 | 3508 | _clutter_actor_draw_paint_volume_full (self, pv, | 3538 | _clutter_actor_draw_paint_volume_full (self, pv, |
1061 | 3509 | _clutter_actor_get_debug_name (self), | 3539 | _clutter_actor_get_debug_name (self), |
1063 | 3510 | &color); | 3540 | &color, |
1064 | 3541 | node); | ||
1065 | 3511 | } | 3542 | } |
1066 | 3512 | } | 3543 | } |
1067 | 3513 | 3544 | ||
1068 | 3514 | static void | 3545 | static void |
1072 | 3515 | _clutter_actor_paint_cull_result (ClutterActor *self, | 3546 | _clutter_actor_paint_cull_result (ClutterActor *self, |
1073 | 3516 | gboolean success, | 3547 | gboolean success, |
1074 | 3517 | ClutterCullResult result) | 3548 | ClutterCullResult result, |
1075 | 3549 | ClutterPaintNode *node) | ||
1076 | 3518 | { | 3550 | { |
1077 | 3551 | ClutterActorPrivate *priv = self->priv; | ||
1078 | 3519 | ClutterPaintVolume *pv; | 3552 | ClutterPaintVolume *pv; |
1080 | 3520 | CoglColor color; | 3553 | ClutterColor color; |
1081 | 3521 | 3554 | ||
1082 | 3522 | if (success) | 3555 | if (success) |
1083 | 3523 | { | 3556 | { |
1084 | 3524 | if (result == CLUTTER_CULL_RESULT_IN) | 3557 | if (result == CLUTTER_CULL_RESULT_IN) |
1086 | 3525 | cogl_color_init_from_4f (&color, 0, 1, 0, 1); | 3558 | clutter_color_init (&color, 0, 255, 0, 255); |
1087 | 3526 | else if (result == CLUTTER_CULL_RESULT_OUT) | 3559 | else if (result == CLUTTER_CULL_RESULT_OUT) |
1089 | 3527 | cogl_color_init_from_4f (&color, 0, 0, 1, 1); | 3560 | clutter_color_init (&color, 0, 0, 255, 255); |
1090 | 3528 | else | 3561 | else |
1092 | 3529 | cogl_color_init_from_4f (&color, 0, 1, 1, 1); | 3562 | clutter_color_init (&color, 0, 255, 255, 255); |
1093 | 3530 | } | 3563 | } |
1094 | 3531 | else | 3564 | else |
1096 | 3532 | cogl_color_init_from_4f (&color, 1, 1, 1, 1); | 3565 | clutter_color_init (&color, 255, 255, 255, 255); |
1097 | 3533 | 3566 | ||
1098 | 3534 | if (success && (pv = _clutter_actor_get_paint_volume_mutable (self))) | 3567 | if (success && (pv = _clutter_actor_get_paint_volume_mutable (self))) |
1099 | 3535 | _clutter_actor_draw_paint_volume_full (self, pv, | 3568 | _clutter_actor_draw_paint_volume_full (self, pv, |
1100 | 3536 | _clutter_actor_get_debug_name (self), | 3569 | _clutter_actor_get_debug_name (self), |
1102 | 3537 | &color); | 3570 | &color, |
1103 | 3571 | node); | ||
1104 | 3538 | else | 3572 | else |
1105 | 3539 | { | 3573 | { |
1106 | 3574 | g_autoptr (ClutterPaintNode) text_node = NULL; | ||
1107 | 3540 | PangoLayout *layout; | 3575 | PangoLayout *layout; |
1108 | 3576 | float width; | ||
1109 | 3577 | float height; | ||
1110 | 3541 | char *label = | 3578 | char *label = |
1111 | 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)); |
1114 | 3543 | cogl_color_init_from_4f (&color, 1, 1, 1, 1); | 3580 | clutter_color_init (&color, 255, 255, 255, 255); |
1115 | 3544 | cogl_set_source_color (&color); | 3581 | |
1116 | 3582 | width = clutter_actor_box_get_width (&priv->allocation); | ||
1117 | 3583 | height = clutter_actor_box_get_height (&priv->allocation); | ||
1118 | 3545 | 3584 | ||
1119 | 3546 | layout = pango_layout_new (clutter_actor_get_pango_context (self)); | 3585 | layout = pango_layout_new (clutter_actor_get_pango_context (self)); |
1120 | 3547 | pango_layout_set_text (layout, label, -1); | 3586 | pango_layout_set_text (layout, label, -1); |
1126 | 3548 | cogl_pango_render_layout (layout, | 3587 | |
1127 | 3549 | 0, | 3588 | text_node = clutter_text_node_new (layout, &color); |
1128 | 3550 | 0, | 3589 | clutter_paint_node_set_name (text_node, |
1129 | 3551 | &color, | 3590 | "ClutterActor (paint volume text)"); |
1130 | 3552 | 0); | 3591 | clutter_paint_node_add_rectangle (text_node, |
1131 | 3592 | &(ClutterActorBox) { | ||
1132 | 3593 | .x1 = 0.f, | ||
1133 | 3594 | .y1 = 0.f, | ||
1134 | 3595 | .x2 = width, | ||
1135 | 3596 | .y2 = height, | ||
1136 | 3597 | }); | ||
1137 | 3598 | clutter_paint_node_add_child (node, text_node); | ||
1138 | 3599 | |||
1139 | 3553 | g_free (label); | 3600 | g_free (label); |
1140 | 3554 | g_object_unref (layout); | 3601 | g_object_unref (layout); |
1141 | 3555 | } | 3602 | } |
1142 | @@ -3581,8 +3628,9 @@ in_clone_paint (void) | |||
1143 | 3581 | * means there's no point in trying to cull descendants of the current | 3628 | * means there's no point in trying to cull descendants of the current |
1144 | 3582 | * node. */ | 3629 | * node. */ |
1145 | 3583 | static gboolean | 3630 | static gboolean |
1148 | 3584 | cull_actor (ClutterActor *self, | 3631 | cull_actor (ClutterActor *self, |
1149 | 3585 | ClutterCullResult *result_out) | 3632 | ClutterPaintContext *paint_context, |
1150 | 3633 | ClutterCullResult *result_out) | ||
1151 | 3586 | { | 3634 | { |
1152 | 3587 | ClutterActorPrivate *priv = self->priv; | 3635 | ClutterActorPrivate *priv = self->priv; |
1153 | 3588 | ClutterStage *stage; | 3636 | ClutterStage *stage; |
1154 | @@ -3609,10 +3657,10 @@ cull_actor (ClutterActor *self, | |||
1155 | 3609 | return FALSE; | 3657 | return FALSE; |
1156 | 3610 | } | 3658 | } |
1157 | 3611 | 3659 | ||
1159 | 3612 | if (cogl_get_draw_framebuffer () != _clutter_stage_get_active_framebuffer (stage)) | 3660 | if (clutter_paint_context_is_drawing_off_stage (paint_context)) |
1160 | 3613 | { | 3661 | { |
1161 | 3614 | CLUTTER_NOTE (CLIPPING, "Bail from cull_actor without culling (%s): " | 3662 | CLUTTER_NOTE (CLIPPING, "Bail from cull_actor without culling (%s): " |
1163 | 3615 | "Current framebuffer doesn't correspond to stage", | 3663 | "Drawing off stage", |
1164 | 3616 | _clutter_actor_get_debug_name (self)); | 3664 | _clutter_actor_get_debug_name (self)); |
1165 | 3617 | return FALSE; | 3665 | return FALSE; |
1166 | 3618 | } | 3666 | } |
1167 | @@ -3750,7 +3798,8 @@ add_or_remove_flatten_effect (ClutterActor *self) | |||
1168 | 3750 | } | 3798 | } |
1169 | 3751 | 3799 | ||
1170 | 3752 | static void | 3800 | static void |
1172 | 3753 | clutter_actor_real_paint (ClutterActor *actor) | 3801 | clutter_actor_real_paint (ClutterActor *actor, |
1173 | 3802 | ClutterPaintContext *paint_context) | ||
1174 | 3754 | { | 3803 | { |
1175 | 3755 | ClutterActorPrivate *priv = actor->priv; | 3804 | ClutterActorPrivate *priv = actor->priv; |
1176 | 3756 | ClutterActor *iter; | 3805 | ClutterActor *iter; |
1177 | @@ -3767,21 +3816,19 @@ clutter_actor_real_paint (ClutterActor *actor) | |||
1178 | 3767 | iter->priv->allocation.x2 - iter->priv->allocation.x1, | 3816 | iter->priv->allocation.x2 - iter->priv->allocation.x1, |
1179 | 3768 | iter->priv->allocation.y2 - iter->priv->allocation.y1); | 3817 | iter->priv->allocation.y2 - iter->priv->allocation.y1); |
1180 | 3769 | 3818 | ||
1182 | 3770 | clutter_actor_paint (iter); | 3819 | clutter_actor_paint (iter, paint_context); |
1183 | 3771 | } | 3820 | } |
1184 | 3772 | } | 3821 | } |
1185 | 3773 | 3822 | ||
1186 | 3774 | static gboolean | 3823 | static gboolean |
1189 | 3775 | clutter_actor_paint_node (ClutterActor *actor, | 3824 | clutter_actor_paint_node (ClutterActor *actor, |
1190 | 3776 | ClutterPaintNode *root) | 3825 | ClutterPaintNode *root, |
1191 | 3826 | ClutterPaintContext *paint_context) | ||
1192 | 3777 | { | 3827 | { |
1193 | 3778 | ClutterActorPrivate *priv = actor->priv; | 3828 | ClutterActorPrivate *priv = actor->priv; |
1194 | 3779 | ClutterActorBox box; | 3829 | ClutterActorBox box; |
1195 | 3780 | ClutterColor bg_color; | 3830 | ClutterColor bg_color; |
1196 | 3781 | 3831 | ||
1197 | 3782 | if (root == NULL) | ||
1198 | 3783 | return FALSE; | ||
1199 | 3784 | |||
1200 | 3785 | box.x1 = 0.f; | 3832 | box.x1 = 0.f; |
1201 | 3786 | box.y1 = 0.f; | 3833 | box.y1 = 0.f; |
1202 | 3787 | box.x2 = clutter_actor_box_get_width (&priv->allocation); | 3834 | box.x2 = clutter_actor_box_get_width (&priv->allocation); |
1203 | @@ -3795,7 +3842,7 @@ clutter_actor_paint_node (ClutterActor *actor, | |||
1204 | 3795 | CoglFramebuffer *fb; | 3842 | CoglFramebuffer *fb; |
1205 | 3796 | CoglBufferBit clear_flags; | 3843 | CoglBufferBit clear_flags; |
1206 | 3797 | 3844 | ||
1208 | 3798 | fb = _clutter_stage_get_active_framebuffer (CLUTTER_STAGE (actor)); | 3845 | fb = clutter_paint_context_get_base_framebuffer (paint_context); |
1209 | 3799 | 3846 | ||
1210 | 3800 | if (clutter_stage_get_use_alpha (CLUTTER_STAGE (actor))) | 3847 | if (clutter_stage_get_use_alpha (CLUTTER_STAGE (actor))) |
1211 | 3801 | { | 3848 | { |
1212 | @@ -3813,8 +3860,6 @@ clutter_actor_paint_node (ClutterActor *actor, | |||
1213 | 3813 | bg_color.alpha); | 3860 | bg_color.alpha); |
1214 | 3814 | 3861 | ||
1215 | 3815 | clear_flags = COGL_BUFFER_BIT_DEPTH; | 3862 | clear_flags = COGL_BUFFER_BIT_DEPTH; |
1216 | 3816 | if (!clutter_stage_get_no_clear_hint (CLUTTER_STAGE (actor))) | ||
1217 | 3817 | clear_flags |= COGL_BUFFER_BIT_COLOR; | ||
1218 | 3818 | 3863 | ||
1219 | 3819 | node = clutter_root_node_new (fb, &bg_color, clear_flags); | 3864 | node = clutter_root_node_new (fb, &bg_color, clear_flags); |
1220 | 3820 | clutter_paint_node_set_name (node, "stageClear"); | 3865 | clutter_paint_node_set_name (node, "stageClear"); |
1221 | @@ -3839,7 +3884,7 @@ clutter_actor_paint_node (ClutterActor *actor, | |||
1222 | 3839 | } | 3884 | } |
1223 | 3840 | 3885 | ||
1224 | 3841 | if (priv->content != NULL) | 3886 | if (priv->content != NULL) |
1226 | 3842 | _clutter_content_paint_content (priv->content, actor, root); | 3887 | _clutter_content_paint_content (priv->content, actor, root, paint_context); |
1227 | 3843 | 3888 | ||
1228 | 3844 | if (CLUTTER_ACTOR_GET_CLASS (actor)->paint_node != NULL) | 3889 | if (CLUTTER_ACTOR_GET_CLASS (actor)->paint_node != NULL) |
1229 | 3845 | CLUTTER_ACTOR_GET_CLASS (actor)->paint_node (actor, root); | 3890 | CLUTTER_ACTOR_GET_CLASS (actor)->paint_node (actor, root); |
1230 | @@ -3855,7 +3900,7 @@ clutter_actor_paint_node (ClutterActor *actor, | |||
1231 | 3855 | } | 3900 | } |
1232 | 3856 | #endif /* CLUTTER_ENABLE_DEBUG */ | 3901 | #endif /* CLUTTER_ENABLE_DEBUG */ |
1233 | 3857 | 3902 | ||
1235 | 3858 | clutter_paint_node_paint (root); | 3903 | clutter_paint_node_paint (root, paint_context); |
1236 | 3859 | 3904 | ||
1237 | 3860 | return TRUE; | 3905 | return TRUE; |
1238 | 3861 | } | 3906 | } |
1239 | @@ -3879,13 +3924,14 @@ clutter_actor_paint_node (ClutterActor *actor, | |||
1240 | 3879 | * unless it is performing a pick paint. | 3924 | * unless it is performing a pick paint. |
1241 | 3880 | */ | 3925 | */ |
1242 | 3881 | void | 3926 | void |
1244 | 3882 | clutter_actor_paint (ClutterActor *self) | 3927 | clutter_actor_paint (ClutterActor *self, |
1245 | 3928 | ClutterPaintContext *paint_context) | ||
1246 | 3883 | { | 3929 | { |
1247 | 3930 | g_autoptr (ClutterPaintNode) actor_node = NULL; | ||
1248 | 3931 | g_autoptr (ClutterPaintNode) root_node = NULL; | ||
1249 | 3884 | ClutterActorPrivate *priv; | 3932 | ClutterActorPrivate *priv; |
1250 | 3885 | ClutterPickMode pick_mode; | ||
1251 | 3886 | ClutterActorBox clip; | 3933 | ClutterActorBox clip; |
1252 | 3887 | gboolean clip_set = FALSE; | 3934 | gboolean clip_set = FALSE; |
1253 | 3888 | ClutterStage *stage; | ||
1254 | 3889 | 3935 | ||
1255 | 3890 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | 3936 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); |
1256 | 3891 | 3937 | ||
1257 | @@ -3893,16 +3939,11 @@ clutter_actor_paint (ClutterActor *self) | |||
1258 | 3893 | return; | 3939 | return; |
1259 | 3894 | 3940 | ||
1260 | 3895 | priv = self->priv; | 3941 | priv = self->priv; |
1266 | 3896 | 3942 | priv->propagated_one_redraw = FALSE; | |
1262 | 3897 | pick_mode = _clutter_context_get_pick_mode (); | ||
1263 | 3898 | |||
1264 | 3899 | if (pick_mode == CLUTTER_PICK_NONE) | ||
1265 | 3900 | priv->propagated_one_redraw = FALSE; | ||
1267 | 3901 | 3943 | ||
1268 | 3902 | /* It's an important optimization that we consider painting of | 3944 | /* It's an important optimization that we consider painting of |
1269 | 3903 | * actors with 0 opacity to be a NOP... */ | 3945 | * actors with 0 opacity to be a NOP... */ |
1272 | 3904 | if (pick_mode == CLUTTER_PICK_NONE && | 3946 | if (/* ignore top-levels, since they might be transparent */ |
1271 | 3905 | /* ignore top-levels, since they might be transparent */ | ||
1273 | 3906 | !CLUTTER_ACTOR_IS_TOPLEVEL (self) && | 3947 | !CLUTTER_ACTOR_IS_TOPLEVEL (self) && |
1274 | 3907 | /* Use the override opacity if its been set */ | 3948 | /* Use the override opacity if its been set */ |
1275 | 3908 | ((priv->opacity_override >= 0) ? | 3949 | ((priv->opacity_override >= 0) ? |
1276 | @@ -3917,22 +3958,50 @@ clutter_actor_paint (ClutterActor *self) | |||
1277 | 3917 | 3958 | ||
1278 | 3918 | clutter_actor_ensure_resource_scale (self); | 3959 | clutter_actor_ensure_resource_scale (self); |
1279 | 3919 | 3960 | ||
1281 | 3920 | stage = (ClutterStage *) _clutter_actor_get_stage_internal (self); | 3961 | actor_node = clutter_actor_node_new (self); |
1282 | 3962 | root_node = clutter_paint_node_ref (actor_node); | ||
1283 | 3921 | 3963 | ||
1286 | 3922 | /* mark that we are in the paint process */ | 3964 | if (priv->has_clip) |
1287 | 3923 | CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PAINT); | 3965 | { |
1288 | 3966 | clip.x1 = priv->clip.origin.x; | ||
1289 | 3967 | clip.y1 = priv->clip.origin.y; | ||
1290 | 3968 | clip.x2 = priv->clip.origin.x + priv->clip.size.width; | ||
1291 | 3969 | clip.y2 = priv->clip.origin.y + priv->clip.size.height; | ||
1292 | 3970 | clip_set = TRUE; | ||
1293 | 3971 | } | ||
1294 | 3972 | else if (priv->clip_to_allocation) | ||
1295 | 3973 | { | ||
1296 | 3974 | clip.x1 = 0.f; | ||
1297 | 3975 | clip.y1 = 0.f; | ||
1298 | 3976 | clip.x2 = priv->allocation.x2 - priv->allocation.x1; | ||
1299 | 3977 | clip.y2 = priv->allocation.y2 - priv->allocation.y1; | ||
1300 | 3978 | clip_set = TRUE; | ||
1301 | 3979 | } | ||
1302 | 3980 | |||
1303 | 3981 | if (clip_set) | ||
1304 | 3982 | { | ||
1305 | 3983 | ClutterPaintNode *clip_node; | ||
1306 | 3984 | |||
1307 | 3985 | clip_node = clutter_clip_node_new (); | ||
1308 | 3986 | clutter_paint_node_add_rectangle (clip_node, &clip); | ||
1309 | 3987 | clutter_paint_node_add_child (clip_node, root_node); | ||
1310 | 3988 | clutter_paint_node_unref (root_node); | ||
1311 | 3924 | 3989 | ||
1313 | 3925 | cogl_push_matrix (); | 3990 | root_node = g_steal_pointer (&clip_node); |
1314 | 3991 | } | ||
1315 | 3926 | 3992 | ||
1316 | 3927 | if (priv->enable_model_view_transform) | 3993 | if (priv->enable_model_view_transform) |
1317 | 3928 | { | 3994 | { |
1319 | 3929 | CoglMatrix matrix; | 3995 | ClutterPaintNode *transform_node; |
1320 | 3996 | CoglMatrix transform; | ||
1321 | 3997 | |||
1322 | 3998 | clutter_actor_get_transform (self, &transform); | ||
1323 | 3999 | |||
1324 | 4000 | transform_node = clutter_transform_node_new (&transform); | ||
1325 | 4001 | clutter_paint_node_add_child (transform_node, root_node); | ||
1326 | 4002 | clutter_paint_node_unref (root_node); | ||
1327 | 3930 | 4003 | ||
1333 | 3931 | /* XXX: It could be better to cache the modelview with the actor | 4004 | root_node = g_steal_pointer (&transform_node); |
1329 | 3932 | * instead of progressively building up the transformations on | ||
1330 | 3933 | * the matrix stack every time we paint. */ | ||
1331 | 3934 | cogl_get_modelview_matrix (&matrix); | ||
1332 | 3935 | _clutter_actor_apply_modelview_transform (self, &matrix); | ||
1334 | 3936 | 4005 | ||
1335 | 3937 | #ifdef CLUTTER_ENABLE_DEBUG | 4006 | #ifdef CLUTTER_ENABLE_DEBUG |
1336 | 3938 | /* Catch when out-of-band transforms have been made by actors not as part | 4007 | /* Catch when out-of-band transforms have been made by actors not as part |
1337 | @@ -3944,7 +4013,7 @@ clutter_actor_paint (ClutterActor *self) | |||
1338 | 3944 | _clutter_actor_get_relative_transformation_matrix (self, NULL, | 4013 | _clutter_actor_get_relative_transformation_matrix (self, NULL, |
1339 | 3945 | &expected_matrix); | 4014 | &expected_matrix); |
1340 | 3946 | 4015 | ||
1342 | 3947 | if (!cogl_matrix_equal (&matrix, &expected_matrix)) | 4016 | if (!cogl_matrix_equal (&transform, &expected_matrix)) |
1343 | 3948 | { | 4017 | { |
1344 | 3949 | GString *buf = g_string_sized_new (1024); | 4018 | GString *buf = g_string_sized_new (1024); |
1345 | 3950 | ClutterActor *parent; | 4019 | ClutterActor *parent; |
1346 | @@ -3971,54 +4040,14 @@ clutter_actor_paint (ClutterActor *self) | |||
1347 | 3971 | } | 4040 | } |
1348 | 3972 | } | 4041 | } |
1349 | 3973 | #endif /* CLUTTER_ENABLE_DEBUG */ | 4042 | #endif /* CLUTTER_ENABLE_DEBUG */ |
1350 | 3974 | |||
1351 | 3975 | cogl_set_modelview_matrix (&matrix); | ||
1352 | 3976 | } | ||
1353 | 3977 | |||
1354 | 3978 | if (priv->has_clip) | ||
1355 | 3979 | { | ||
1356 | 3980 | clip.x1 = priv->clip.origin.x; | ||
1357 | 3981 | clip.y1 = priv->clip.origin.y; | ||
1358 | 3982 | clip.x2 = priv->clip.origin.x + priv->clip.size.width; | ||
1359 | 3983 | clip.y2 = priv->clip.origin.y + priv->clip.size.height; | ||
1360 | 3984 | clip_set = TRUE; | ||
1361 | 3985 | } | ||
1362 | 3986 | else if (priv->clip_to_allocation) | ||
1363 | 3987 | { | ||
1364 | 3988 | clip.x1 = 0.f; | ||
1365 | 3989 | clip.y1 = 0.f; | ||
1366 | 3990 | clip.x2 = priv->allocation.x2 - priv->allocation.x1; | ||
1367 | 3991 | clip.y2 = priv->allocation.y2 - priv->allocation.y1; | ||
1368 | 3992 | clip_set = TRUE; | ||
1369 | 3993 | } | ||
1370 | 3994 | |||
1371 | 3995 | if (clip_set) | ||
1372 | 3996 | { | ||
1373 | 3997 | if (pick_mode == CLUTTER_PICK_NONE) | ||
1374 | 3998 | { | ||
1375 | 3999 | CoglFramebuffer *fb = _clutter_stage_get_active_framebuffer (stage); | ||
1376 | 4000 | |||
1377 | 4001 | cogl_framebuffer_push_rectangle_clip (fb, | ||
1378 | 4002 | clip.x1, | ||
1379 | 4003 | clip.y1, | ||
1380 | 4004 | clip.x2, | ||
1381 | 4005 | clip.y2); | ||
1382 | 4006 | } | ||
1383 | 4007 | else | ||
1384 | 4008 | { | ||
1385 | 4009 | if (!_clutter_actor_push_pick_clip (self, &clip)) | ||
1386 | 4010 | clip_set = FALSE; | ||
1387 | 4011 | } | ||
1388 | 4012 | } | 4043 | } |
1389 | 4013 | 4044 | ||
1398 | 4014 | if (pick_mode == CLUTTER_PICK_NONE) | 4045 | /* We check whether we need to add the flatten effect before |
1399 | 4015 | { | 4046 | * each paint so that we can avoid having a mechanism for |
1400 | 4016 | /* We check whether we need to add the flatten effect before | 4047 | * applications to notify when the value of the |
1401 | 4017 | each paint so that we can avoid having a mechanism for | 4048 | * has_overlaps virtual changes. |
1402 | 4018 | applications to notify when the value of the | 4049 | */ |
1403 | 4019 | has_overlaps virtual changes. */ | 4050 | add_or_remove_flatten_effect (self); |
1396 | 4020 | add_or_remove_flatten_effect (self); | ||
1397 | 4021 | } | ||
1404 | 4022 | 4051 | ||
1405 | 4023 | /* We save the current paint volume so that the next time the | 4052 | /* We save the current paint volume so that the next time the |
1406 | 4024 | * actor queues a redraw we can constrain the redraw to just | 4053 | * actor queues a redraw we can constrain the redraw to just |
1407 | @@ -4047,7 +4076,7 @@ clutter_actor_paint (ClutterActor *self) | |||
1408 | 4047 | * paint then the last-paint-volume would likely represent the new | 4076 | * paint then the last-paint-volume would likely represent the new |
1409 | 4048 | * actor position not the old. | 4077 | * actor position not the old. |
1410 | 4049 | */ | 4078 | */ |
1412 | 4050 | if (!in_clone_paint () && pick_mode == CLUTTER_PICK_NONE) | 4079 | if (!in_clone_paint ()) |
1413 | 4051 | { | 4080 | { |
1414 | 4052 | gboolean success; | 4081 | gboolean success; |
1415 | 4053 | /* annoyingly gcc warns if uninitialized even though | 4082 | /* annoyingly gcc warns if uninitialized even though |
1416 | @@ -4061,12 +4090,12 @@ clutter_actor_paint (ClutterActor *self) | |||
1417 | 4061 | CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS))) | 4090 | CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS))) |
1418 | 4062 | _clutter_actor_update_last_paint_volume (self); | 4091 | _clutter_actor_update_last_paint_volume (self); |
1419 | 4063 | 4092 | ||
1421 | 4064 | success = cull_actor (self, &result); | 4093 | success = cull_actor (self, paint_context, &result); |
1422 | 4065 | 4094 | ||
1423 | 4066 | if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_REDRAWS)) | 4095 | if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_REDRAWS)) |
1425 | 4067 | _clutter_actor_paint_cull_result (self, success, result); | 4096 | _clutter_actor_paint_cull_result (self, success, result, actor_node); |
1426 | 4068 | else if (result == CLUTTER_CULL_RESULT_OUT && success) | 4097 | else if (result == CLUTTER_CULL_RESULT_OUT && success) |
1428 | 4069 | goto done; | 4098 | return; |
1429 | 4070 | } | 4099 | } |
1430 | 4071 | 4100 | ||
1431 | 4072 | if (priv->effects == NULL) | 4101 | if (priv->effects == NULL) |
1432 | @@ -4075,36 +4104,14 @@ clutter_actor_paint (ClutterActor *self) | |||
1433 | 4075 | priv->next_effect_to_paint = | 4104 | priv->next_effect_to_paint = |
1434 | 4076 | _clutter_meta_group_peek_metas (priv->effects); | 4105 | _clutter_meta_group_peek_metas (priv->effects); |
1435 | 4077 | 4106 | ||
1437 | 4078 | clutter_actor_continue_paint (self); | 4107 | if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_VOLUMES)) |
1438 | 4108 | _clutter_actor_draw_paint_volume (self, actor_node); | ||
1439 | 4079 | 4109 | ||
1443 | 4080 | if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_VOLUMES && | 4110 | clutter_paint_node_paint (root_node, paint_context); |
1441 | 4081 | pick_mode == CLUTTER_PICK_NONE)) | ||
1442 | 4082 | _clutter_actor_draw_paint_volume (self); | ||
1444 | 4083 | 4111 | ||
1445 | 4084 | /* If we make it here then the actor has run through a complete | 4112 | /* If we make it here then the actor has run through a complete |
1446 | 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 */ |
1469 | 4086 | if (pick_mode == CLUTTER_PICK_NONE) | 4114 | priv->is_dirty = FALSE; |
1448 | 4087 | priv->is_dirty = FALSE; | ||
1449 | 4088 | |||
1450 | 4089 | done: | ||
1451 | 4090 | if (clip_set) | ||
1452 | 4091 | { | ||
1453 | 4092 | if (pick_mode == CLUTTER_PICK_NONE) | ||
1454 | 4093 | { | ||
1455 | 4094 | CoglFramebuffer *fb = _clutter_stage_get_active_framebuffer (stage); | ||
1456 | 4095 | |||
1457 | 4096 | cogl_framebuffer_pop_clip (fb); | ||
1458 | 4097 | } | ||
1459 | 4098 | else | ||
1460 | 4099 | { | ||
1461 | 4100 | _clutter_actor_pop_pick_clip (self); | ||
1462 | 4101 | } | ||
1463 | 4102 | } | ||
1464 | 4103 | |||
1465 | 4104 | cogl_pop_matrix (); | ||
1466 | 4105 | |||
1467 | 4106 | /* paint sequence complete */ | ||
1468 | 4107 | CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_PAINT); | ||
1470 | 4108 | } | 4115 | } |
1471 | 4109 | 4116 | ||
1472 | 4110 | /** | 4117 | /** |
1473 | @@ -4120,7 +4127,8 @@ done: | |||
1474 | 4120 | * Since: 1.8 | 4127 | * Since: 1.8 |
1475 | 4121 | */ | 4128 | */ |
1476 | 4122 | void | 4129 | void |
1478 | 4123 | clutter_actor_continue_paint (ClutterActor *self) | 4130 | clutter_actor_continue_paint (ClutterActor *self, |
1479 | 4131 | ClutterPaintContext *paint_context) | ||
1480 | 4124 | { | 4132 | { |
1481 | 4125 | ClutterActorPrivate *priv; | 4133 | ClutterActorPrivate *priv; |
1482 | 4126 | 4134 | ||
1483 | @@ -4140,50 +4148,30 @@ clutter_actor_continue_paint (ClutterActor *self) | |||
1484 | 4140 | actual actor */ | 4148 | actual actor */ |
1485 | 4141 | if (priv->next_effect_to_paint == NULL) | 4149 | if (priv->next_effect_to_paint == NULL) |
1486 | 4142 | { | 4150 | { |
1490 | 4143 | if (_clutter_context_get_pick_mode () == CLUTTER_PICK_NONE) | 4151 | CoglFramebuffer *framebuffer; |
1491 | 4144 | { | 4152 | ClutterPaintNode *dummy; |
1489 | 4145 | ClutterPaintNode *dummy; | ||
1492 | 4146 | 4153 | ||
1500 | 4147 | /* XXX - this will go away in 2.0, when we can get rid of this | 4154 | /* XXX - this will go away in 2.0, when we can get rid of this |
1501 | 4148 | * stuff and switch to a pure retained render tree of PaintNodes | 4155 | * stuff and switch to a pure retained render tree of PaintNodes |
1502 | 4149 | * for the entire frame, starting from the Stage; the paint() | 4156 | * for the entire frame, starting from the Stage; the paint() |
1503 | 4150 | * virtual function can then be called directly. | 4157 | * virtual function can then be called directly. |
1504 | 4151 | */ | 4158 | */ |
1505 | 4152 | dummy = _clutter_dummy_node_new (self); | 4159 | framebuffer = clutter_paint_context_get_base_framebuffer (paint_context); |
1506 | 4153 | clutter_paint_node_set_name (dummy, "Root"); | 4160 | dummy = _clutter_dummy_node_new (self, framebuffer); |
1507 | 4161 | clutter_paint_node_set_name (dummy, "Root"); | ||
1508 | 4154 | 4162 | ||
1514 | 4155 | /* XXX - for 1.12, we use the return value of paint_node() to | 4163 | /* XXX - for 1.12, we use the return value of paint_node() to |
1515 | 4156 | * decide whether we should emit the ::paint signal. | 4164 | * decide whether we should emit the ::paint signal. |
1516 | 4157 | */ | 4165 | */ |
1517 | 4158 | clutter_actor_paint_node (self, dummy); | 4166 | clutter_actor_paint_node (self, dummy, paint_context); |
1518 | 4159 | clutter_paint_node_unref (dummy); | 4167 | clutter_paint_node_unref (dummy); |
1519 | 4160 | 4168 | ||
1527 | 4161 | /* XXX:2.0 - Call the paint() virtual directly */ | 4169 | /* XXX:2.0 - Call the paint() virtual directly */ |
1528 | 4162 | if (g_signal_has_handler_pending (self, actor_signals[PAINT], | 4170 | if (g_signal_has_handler_pending (self, actor_signals[PAINT], |
1529 | 4163 | 0, TRUE)) | 4171 | 0, TRUE)) |
1530 | 4164 | g_signal_emit (self, actor_signals[PAINT], 0); | 4172 | g_signal_emit (self, actor_signals[PAINT], 0, paint_context); |
1524 | 4165 | else | ||
1525 | 4166 | CLUTTER_ACTOR_GET_CLASS (self)->paint (self); | ||
1526 | 4167 | } | ||
1531 | 4168 | else | 4173 | else |
1550 | 4169 | { | 4174 | CLUTTER_ACTOR_GET_CLASS (self)->paint (self, paint_context); |
1533 | 4170 | ClutterColor col = { 0, }; | ||
1534 | 4171 | |||
1535 | 4172 | /* The actor will log a silhouette of itself to the stage pick log. | ||
1536 | 4173 | * Note that the picking color is no longer used as the "log" instead | ||
1537 | 4174 | * keeps a weak pointer to the actor itself. But we keep the color | ||
1538 | 4175 | * parameter for now so as to maintain ABI compatibility. The color | ||
1539 | 4176 | * parameter can be removed when someone feels like breaking the ABI | ||
1540 | 4177 | * along with gnome-shell. | ||
1541 | 4178 | * | ||
1542 | 4179 | * XXX:2.0 - Call the pick() virtual directly | ||
1543 | 4180 | */ | ||
1544 | 4181 | if (g_signal_has_handler_pending (self, actor_signals[PICK], | ||
1545 | 4182 | 0, TRUE)) | ||
1546 | 4183 | g_signal_emit (self, actor_signals[PICK], 0, &col); | ||
1547 | 4184 | else | ||
1548 | 4185 | CLUTTER_ACTOR_GET_CLASS (self)->pick (self, &col); | ||
1549 | 4186 | } | ||
1551 | 4187 | } | 4175 | } |
1552 | 4188 | else | 4176 | else |
1553 | 4189 | { | 4177 | { |
1554 | @@ -4197,31 +4185,161 @@ clutter_actor_continue_paint (ClutterActor *self) | |||
1555 | 4197 | priv->current_effect = priv->next_effect_to_paint->data; | 4185 | priv->current_effect = priv->next_effect_to_paint->data; |
1556 | 4198 | priv->next_effect_to_paint = priv->next_effect_to_paint->next; | 4186 | priv->next_effect_to_paint = priv->next_effect_to_paint->next; |
1557 | 4199 | 4187 | ||
1559 | 4200 | if (_clutter_context_get_pick_mode () == CLUTTER_PICK_NONE) | 4188 | if (priv->is_dirty) |
1560 | 4201 | { | 4189 | { |
1574 | 4202 | if (priv->is_dirty) | 4190 | /* If there's an effect queued with this redraw then all |
1575 | 4203 | { | 4191 | * effects up to that one will be considered dirty. It |
1576 | 4204 | /* If there's an effect queued with this redraw then all | 4192 | * is expected the queued effect will paint the cached |
1577 | 4205 | effects up to that one will be considered dirty. It | 4193 | * image and not call clutter_actor_continue_paint again |
1578 | 4206 | is expected the queued effect will paint the cached | 4194 | * (although it should work ok if it does) |
1579 | 4207 | image and not call clutter_actor_continue_paint again | 4195 | */ |
1580 | 4208 | (although it should work ok if it does) */ | 4196 | if (priv->effect_to_redraw == NULL || |
1581 | 4209 | if (priv->effect_to_redraw == NULL || | 4197 | priv->current_effect != priv->effect_to_redraw) |
1582 | 4210 | priv->current_effect != priv->effect_to_redraw) | 4198 | run_flags |= CLUTTER_EFFECT_PAINT_ACTOR_DIRTY; |
1570 | 4211 | run_flags |= CLUTTER_EFFECT_PAINT_ACTOR_DIRTY; | ||
1571 | 4212 | } | ||
1572 | 4213 | |||
1573 | 4214 | _clutter_effect_paint (priv->current_effect, run_flags); | ||
1583 | 4215 | } | 4199 | } |
1584 | 4200 | |||
1585 | 4201 | _clutter_effect_paint (priv->current_effect, paint_context, run_flags); | ||
1586 | 4202 | |||
1587 | 4203 | priv->current_effect = old_current_effect; | ||
1588 | 4204 | } | ||
1589 | 4205 | } | ||
1590 | 4206 | |||
1591 | 4207 | /** | ||
1592 | 4208 | * clutter_actor_pick: | ||
1593 | 4209 | * @actor: A #ClutterActor | ||
1594 | 4210 | * | ||
1595 | 4211 | * Asks @actor to perform a pick. | ||
1596 | 4212 | */ | ||
1597 | 4213 | void | ||
1598 | 4214 | clutter_actor_pick (ClutterActor *actor, | ||
1599 | 4215 | ClutterPickContext *pick_context) | ||
1600 | 4216 | { | ||
1601 | 4217 | ClutterActorPrivate *priv; | ||
1602 | 4218 | CoglFramebuffer *framebuffer; | ||
1603 | 4219 | ClutterActorBox clip; | ||
1604 | 4220 | gboolean clip_set = FALSE; | ||
1605 | 4221 | |||
1606 | 4222 | if (CLUTTER_ACTOR_IN_DESTRUCTION (actor)) | ||
1607 | 4223 | return; | ||
1608 | 4224 | |||
1609 | 4225 | priv = actor->priv; | ||
1610 | 4226 | |||
1611 | 4227 | /* if we aren't paintable (not in a toplevel with all | ||
1612 | 4228 | * parents paintable) then do nothing. | ||
1613 | 4229 | */ | ||
1614 | 4230 | if (!CLUTTER_ACTOR_IS_MAPPED (actor)) | ||
1615 | 4231 | return; | ||
1616 | 4232 | |||
1617 | 4233 | clutter_actor_ensure_resource_scale (actor); | ||
1618 | 4234 | |||
1619 | 4235 | /* mark that we are in the paint process */ | ||
1620 | 4236 | CLUTTER_SET_PRIVATE_FLAGS (actor, CLUTTER_IN_PICK); | ||
1621 | 4237 | |||
1622 | 4238 | framebuffer = clutter_pick_context_get_framebuffer (pick_context); | ||
1623 | 4239 | cogl_framebuffer_push_matrix (framebuffer); | ||
1624 | 4240 | |||
1625 | 4241 | if (priv->enable_model_view_transform) | ||
1626 | 4242 | { | ||
1627 | 4243 | CoglMatrix matrix; | ||
1628 | 4244 | |||
1629 | 4245 | cogl_framebuffer_get_modelview_matrix (framebuffer, &matrix); | ||
1630 | 4246 | _clutter_actor_apply_modelview_transform (actor, &matrix); | ||
1631 | 4247 | cogl_framebuffer_set_modelview_matrix (framebuffer, &matrix); | ||
1632 | 4248 | } | ||
1633 | 4249 | |||
1634 | 4250 | if (priv->has_clip) | ||
1635 | 4251 | { | ||
1636 | 4252 | clip.x1 = priv->clip.origin.x; | ||
1637 | 4253 | clip.y1 = priv->clip.origin.y; | ||
1638 | 4254 | clip.x2 = priv->clip.origin.x + priv->clip.size.width; | ||
1639 | 4255 | clip.y2 = priv->clip.origin.y + priv->clip.size.height; | ||
1640 | 4256 | clip_set = TRUE; | ||
1641 | 4257 | } | ||
1642 | 4258 | else if (priv->clip_to_allocation) | ||
1643 | 4259 | { | ||
1644 | 4260 | clip.x1 = 0.f; | ||
1645 | 4261 | clip.y1 = 0.f; | ||
1646 | 4262 | clip.x2 = priv->allocation.x2 - priv->allocation.x1; | ||
1647 | 4263 | clip.y2 = priv->allocation.y2 - priv->allocation.y1; | ||
1648 | 4264 | clip_set = TRUE; | ||
1649 | 4265 | } | ||
1650 | 4266 | |||
1651 | 4267 | if (clip_set) | ||
1652 | 4268 | clip_set = _clutter_actor_push_pick_clip (actor, pick_context, &clip); | ||
1653 | 4269 | |||
1654 | 4270 | priv->next_effect_to_paint = NULL; | ||
1655 | 4271 | if (priv->effects) | ||
1656 | 4272 | { | ||
1657 | 4273 | priv->next_effect_to_paint = | ||
1658 | 4274 | _clutter_meta_group_peek_metas (priv->effects); | ||
1659 | 4275 | } | ||
1660 | 4276 | |||
1661 | 4277 | clutter_actor_continue_pick (actor, pick_context); | ||
1662 | 4278 | |||
1663 | 4279 | if (clip_set) | ||
1664 | 4280 | _clutter_actor_pop_pick_clip (actor); | ||
1665 | 4281 | |||
1666 | 4282 | cogl_framebuffer_pop_matrix (framebuffer); | ||
1667 | 4283 | |||
1668 | 4284 | /* paint sequence complete */ | ||
1669 | 4285 | CLUTTER_UNSET_PRIVATE_FLAGS (actor, CLUTTER_IN_PICK); | ||
1670 | 4286 | } | ||
1671 | 4287 | |||
1672 | 4288 | /** | ||
1673 | 4289 | * clutter_actor_continue_pick: | ||
1674 | 4290 | * @actor: A #ClutterActor | ||
1675 | 4291 | * | ||
1676 | 4292 | * Run the next stage of the pick sequence. This function should only | ||
1677 | 4293 | * be called within the implementation of the ‘pick’ virtual of a | ||
1678 | 4294 | * #ClutterEffect. It will cause the run method of the next effect to | ||
1679 | 4295 | * be applied, or it will pick the actual actor if the current effect | ||
1680 | 4296 | * is the last effect in the chain. | ||
1681 | 4297 | */ | ||
1682 | 4298 | void | ||
1683 | 4299 | clutter_actor_continue_pick (ClutterActor *actor, | ||
1684 | 4300 | ClutterPickContext *pick_context) | ||
1685 | 4301 | { | ||
1686 | 4302 | ClutterActorPrivate *priv; | ||
1687 | 4303 | |||
1688 | 4304 | g_return_if_fail (CLUTTER_IS_ACTOR (actor)); | ||
1689 | 4305 | |||
1690 | 4306 | g_return_if_fail (CLUTTER_ACTOR_IN_PICK (actor)); | ||
1691 | 4307 | |||
1692 | 4308 | priv = actor->priv; | ||
1693 | 4309 | |||
1694 | 4310 | /* Skip any effects that are disabled */ | ||
1695 | 4311 | while (priv->next_effect_to_paint && | ||
1696 | 4312 | !clutter_actor_meta_get_enabled (priv->next_effect_to_paint->data)) | ||
1697 | 4313 | priv->next_effect_to_paint = priv->next_effect_to_paint->next; | ||
1698 | 4314 | |||
1699 | 4315 | /* If this has come from the last effect then we'll just pick the | ||
1700 | 4316 | * actual actor. | ||
1701 | 4317 | */ | ||
1702 | 4318 | if (priv->next_effect_to_paint == NULL) | ||
1703 | 4319 | { | ||
1704 | 4320 | /* The actor will log a silhouette of itself to the stage pick log. | ||
1705 | 4321 | * | ||
1706 | 4322 | * XXX:2.0 - Call the pick() virtual directly | ||
1707 | 4323 | */ | ||
1708 | 4324 | if (g_signal_has_handler_pending (actor, actor_signals[PICK], | ||
1709 | 4325 | 0, TRUE)) | ||
1710 | 4326 | g_signal_emit (actor, actor_signals[PICK], 0, pick_context); | ||
1711 | 4216 | else | 4327 | else |
1717 | 4217 | { | 4328 | CLUTTER_ACTOR_GET_CLASS (actor)->pick (actor, pick_context); |
1718 | 4218 | /* We can't determine when an actor has been modified since | 4329 | } |
1719 | 4219 | its last pick so lets just assume it has always been | 4330 | else |
1720 | 4220 | modified */ | 4331 | { |
1721 | 4221 | run_flags |= CLUTTER_EFFECT_PAINT_ACTOR_DIRTY; | 4332 | ClutterEffect *old_current_effect; |
1722 | 4222 | 4333 | ||
1725 | 4223 | _clutter_effect_pick (priv->current_effect, run_flags); | 4334 | /* Cache the current effect so that we can put it back before |
1726 | 4224 | } | 4335 | * returning. |
1727 | 4336 | */ | ||
1728 | 4337 | old_current_effect = priv->current_effect; | ||
1729 | 4338 | |||
1730 | 4339 | priv->current_effect = priv->next_effect_to_paint->data; | ||
1731 | 4340 | priv->next_effect_to_paint = priv->next_effect_to_paint->next; | ||
1732 | 4341 | |||
1733 | 4342 | _clutter_effect_pick (priv->current_effect, pick_context); | ||
1734 | 4225 | 4343 | ||
1735 | 4226 | priv->current_effect = old_current_effect; | 4344 | priv->current_effect = old_current_effect; |
1736 | 4227 | } | 4345 | } |
1737 | @@ -4435,7 +4553,6 @@ clutter_actor_remove_child_internal (ClutterActor *self, | |||
1738 | 4435 | clutter_actor_queue_compute_expand (self); | 4553 | clutter_actor_queue_compute_expand (self); |
1739 | 4436 | } | 4554 | } |
1740 | 4437 | 4555 | ||
1741 | 4438 | /* clutter_actor_reparent() will emit ::parent-set for us */ | ||
1742 | 4439 | if (emit_parent_set && !CLUTTER_ACTOR_IN_REPARENT (child) && | 4556 | if (emit_parent_set && !CLUTTER_ACTOR_IN_REPARENT (child) && |
1743 | 4440 | !CLUTTER_ACTOR_IN_DESTRUCTION (child)) | 4557 | !CLUTTER_ACTOR_IN_DESTRUCTION (child)) |
1744 | 4441 | { | 4558 | { |
1745 | @@ -4477,11 +4594,11 @@ static const ClutterTransformInfo default_transform_info = { | |||
1746 | 4477 | 4594 | ||
1747 | 4478 | { 0, }, /* anchor XXX:2.0 - remove*/ | 4595 | { 0, }, /* anchor XXX:2.0 - remove*/ |
1748 | 4479 | 4596 | ||
1750 | 4480 | CLUTTER_VERTEX_INIT_ZERO, /* translation */ | 4597 | GRAPHENE_POINT3D_INIT_ZERO, /* translation */ |
1751 | 4481 | 4598 | ||
1752 | 4482 | 0.f, /* z-position */ | 4599 | 0.f, /* z-position */ |
1753 | 4483 | 4600 | ||
1755 | 4484 | CLUTTER_POINT_INIT_ZERO, /* pivot */ | 4601 | GRAPHENE_POINT_INIT_ZERO, /* pivot */ |
1756 | 4485 | 0.f, /* pivot-z */ | 4602 | 0.f, /* pivot-z */ |
1757 | 4486 | 4603 | ||
1758 | 4487 | CLUTTER_MATRIX_INIT_IDENTITY, | 4604 | CLUTTER_MATRIX_INIT_IDENTITY, |
1759 | @@ -4560,8 +4677,8 @@ _clutter_actor_get_transform_info (ClutterActor *self) | |||
1760 | 4560 | } | 4677 | } |
1761 | 4561 | 4678 | ||
1762 | 4562 | static inline void | 4679 | static inline void |
1765 | 4563 | clutter_actor_set_pivot_point_internal (ClutterActor *self, | 4680 | clutter_actor_set_pivot_point_internal (ClutterActor *self, |
1766 | 4564 | const ClutterPoint *pivot) | 4681 | const graphene_point_t *pivot) |
1767 | 4565 | { | 4682 | { |
1768 | 4566 | ClutterTransformInfo *info; | 4683 | ClutterTransformInfo *info; |
1769 | 4567 | 4684 | ||
1770 | @@ -4866,11 +4983,11 @@ clutter_actor_get_rotation_angle (ClutterActor *self, | |||
1771 | 4866 | * rotation angle. | 4983 | * rotation angle. |
1772 | 4867 | */ | 4984 | */ |
1773 | 4868 | static inline void | 4985 | static inline void |
1777 | 4869 | clutter_actor_set_rotation_center_internal (ClutterActor *self, | 4986 | clutter_actor_set_rotation_center_internal (ClutterActor *self, |
1778 | 4870 | ClutterRotateAxis axis, | 4987 | ClutterRotateAxis axis, |
1779 | 4871 | const ClutterVertex *center) | 4988 | const graphene_point3d_t *center) |
1780 | 4872 | { | 4989 | { |
1782 | 4873 | ClutterVertex v = CLUTTER_VERTEX_INIT_ZERO; | 4990 | graphene_point3d_t v = GRAPHENE_POINT3D_INIT_ZERO; |
1783 | 4874 | GObject *obj = G_OBJECT (self); | 4991 | GObject *obj = G_OBJECT (self); |
1784 | 4875 | ClutterTransformInfo *info; | 4992 | ClutterTransformInfo *info; |
1785 | 4876 | 4993 | ||
1786 | @@ -5097,8 +5214,8 @@ clutter_actor_set_anchor_coord (ClutterActor *self, | |||
1787 | 5097 | } | 5214 | } |
1788 | 5098 | 5215 | ||
1789 | 5099 | static void | 5216 | static void |
1792 | 5100 | clutter_actor_set_clip_rect (ClutterActor *self, | 5217 | clutter_actor_set_clip_rect (ClutterActor *self, |
1793 | 5101 | const ClutterRect *clip) | 5218 | const graphene_rect_t *clip) |
1794 | 5102 | { | 5219 | { |
1795 | 5103 | ClutterActorPrivate *priv = self->priv; | 5220 | ClutterActorPrivate *priv = self->priv; |
1796 | 5104 | GObject *obj = G_OBJECT (self); | 5221 | GObject *obj = G_OBJECT (self); |
1797 | @@ -5113,7 +5230,6 @@ clutter_actor_set_clip_rect (ClutterActor *self, | |||
1798 | 5113 | 5230 | ||
1799 | 5114 | clutter_actor_queue_redraw (self); | 5231 | clutter_actor_queue_redraw (self); |
1800 | 5115 | 5232 | ||
1801 | 5116 | g_object_notify_by_pspec (obj, obj_props[PROP_CLIP]); /* XXX:2.0 - remove */ | ||
1802 | 5117 | g_object_notify_by_pspec (obj, obj_props[PROP_CLIP_RECT]); | 5233 | g_object_notify_by_pspec (obj, obj_props[PROP_CLIP_RECT]); |
1803 | 5118 | g_object_notify_by_pspec (obj, obj_props[PROP_HAS_CLIP]); | 5234 | g_object_notify_by_pspec (obj, obj_props[PROP_HAS_CLIP]); |
1804 | 5119 | } | 5235 | } |
1805 | @@ -5139,7 +5255,7 @@ clutter_actor_set_property (GObject *object, | |||
1806 | 5139 | 5255 | ||
1807 | 5140 | case PROP_POSITION: | 5256 | case PROP_POSITION: |
1808 | 5141 | { | 5257 | { |
1810 | 5142 | const ClutterPoint *pos = g_value_get_boxed (value); | 5258 | const graphene_point_t *pos = g_value_get_boxed (value); |
1811 | 5143 | 5259 | ||
1812 | 5144 | if (pos != NULL) | 5260 | if (pos != NULL) |
1813 | 5145 | clutter_actor_set_position (actor, pos->x, pos->y); | 5261 | clutter_actor_set_position (actor, pos->x, pos->y); |
1814 | @@ -5158,7 +5274,7 @@ clutter_actor_set_property (GObject *object, | |||
1815 | 5158 | 5274 | ||
1816 | 5159 | case PROP_SIZE: | 5275 | case PROP_SIZE: |
1817 | 5160 | { | 5276 | { |
1819 | 5161 | const ClutterSize *size = g_value_get_boxed (value); | 5277 | const graphene_size_t *size = g_value_get_boxed (value); |
1820 | 5162 | 5278 | ||
1821 | 5163 | if (size != NULL) | 5279 | if (size != NULL) |
1822 | 5164 | clutter_actor_set_size (actor, size->width, size->height); | 5280 | clutter_actor_set_size (actor, size->width, size->height); |
1823 | @@ -5244,10 +5360,10 @@ clutter_actor_set_property (GObject *object, | |||
1824 | 5244 | 5360 | ||
1825 | 5245 | case PROP_PIVOT_POINT: | 5361 | case PROP_PIVOT_POINT: |
1826 | 5246 | { | 5362 | { |
1828 | 5247 | const ClutterPoint *pivot = g_value_get_boxed (value); | 5363 | const graphene_point_t *pivot = g_value_get_boxed (value); |
1829 | 5248 | 5364 | ||
1830 | 5249 | if (pivot == NULL) | 5365 | if (pivot == NULL) |
1832 | 5250 | pivot = clutter_point_zero (); | 5366 | pivot = graphene_point_zero (); |
1833 | 5251 | 5367 | ||
1834 | 5252 | clutter_actor_set_pivot_point (actor, pivot->x, pivot->y); | 5368 | clutter_actor_set_pivot_point (actor, pivot->x, pivot->y); |
1835 | 5253 | } | 5369 | } |
1836 | @@ -5301,16 +5417,6 @@ clutter_actor_set_property (GObject *object, | |||
1837 | 5301 | clutter_actor_set_scale_gravity (actor, g_value_get_enum (value)); | 5417 | clutter_actor_set_scale_gravity (actor, g_value_get_enum (value)); |
1838 | 5302 | break; | 5418 | break; |
1839 | 5303 | 5419 | ||
1840 | 5304 | case PROP_CLIP: /* XXX:2.0 - remove */ | ||
1841 | 5305 | { | ||
1842 | 5306 | const ClutterGeometry *geom = g_value_get_boxed (value); | ||
1843 | 5307 | |||
1844 | 5308 | clutter_actor_set_clip (actor, | ||
1845 | 5309 | geom->x, geom->y, | ||
1846 | 5310 | geom->width, geom->height); | ||
1847 | 5311 | } | ||
1848 | 5312 | break; | ||
1849 | 5313 | |||
1850 | 5314 | case PROP_CLIP_RECT: | 5420 | case PROP_CLIP_RECT: |
1851 | 5315 | clutter_actor_set_clip_rect (actor, g_value_get_boxed (value)); | 5421 | clutter_actor_set_clip_rect (actor, g_value_get_boxed (value)); |
1852 | 5316 | break; | 5422 | break; |
1853 | @@ -5503,11 +5609,11 @@ clutter_actor_get_property (GObject *object, | |||
1854 | 5503 | 5609 | ||
1855 | 5504 | case PROP_POSITION: | 5610 | case PROP_POSITION: |
1856 | 5505 | { | 5611 | { |
1858 | 5506 | ClutterPoint position; | 5612 | graphene_point_t position; |
1859 | 5507 | 5613 | ||
1863 | 5508 | clutter_point_init (&position, | 5614 | graphene_point_init (&position, |
1864 | 5509 | clutter_actor_get_x (actor), | 5615 | clutter_actor_get_x (actor), |
1865 | 5510 | clutter_actor_get_y (actor)); | 5616 | clutter_actor_get_y (actor)); |
1866 | 5511 | g_value_set_boxed (value, &position); | 5617 | g_value_set_boxed (value, &position); |
1867 | 5512 | } | 5618 | } |
1868 | 5513 | break; | 5619 | break; |
1869 | @@ -5522,11 +5628,11 @@ clutter_actor_get_property (GObject *object, | |||
1870 | 5522 | 5628 | ||
1871 | 5523 | case PROP_SIZE: | 5629 | case PROP_SIZE: |
1872 | 5524 | { | 5630 | { |
1874 | 5525 | ClutterSize size; | 5631 | graphene_size_t size; |
1875 | 5526 | 5632 | ||
1879 | 5527 | clutter_size_init (&size, | 5633 | graphene_size_init (&size, |
1880 | 5528 | clutter_actor_get_width (actor), | 5634 | clutter_actor_get_width (actor), |
1881 | 5529 | clutter_actor_get_height (actor)); | 5635 | clutter_actor_get_height (actor)); |
1882 | 5530 | g_value_set_boxed (value, &size); | 5636 | g_value_set_boxed (value, &size); |
1883 | 5531 | } | 5637 | } |
1884 | 5532 | break; | 5638 | break; |
1885 | @@ -5649,19 +5755,6 @@ clutter_actor_get_property (GObject *object, | |||
1886 | 5649 | g_value_set_boolean (value, priv->has_clip); | 5755 | g_value_set_boolean (value, priv->has_clip); |
1887 | 5650 | break; | 5756 | break; |
1888 | 5651 | 5757 | ||
1889 | 5652 | case PROP_CLIP: /* XXX:2.0 - remove */ | ||
1890 | 5653 | { | ||
1891 | 5654 | ClutterGeometry clip; | ||
1892 | 5655 | |||
1893 | 5656 | clip.x = CLUTTER_NEARBYINT (priv->clip.origin.x); | ||
1894 | 5657 | clip.y = CLUTTER_NEARBYINT (priv->clip.origin.y); | ||
1895 | 5658 | clip.width = CLUTTER_NEARBYINT (priv->clip.size.width); | ||
1896 | 5659 | clip.height = CLUTTER_NEARBYINT (priv->clip.size.height); | ||
1897 | 5660 | |||
1898 | 5661 | g_value_set_boxed (value, &clip); | ||
1899 | 5662 | } | ||
1900 | 5663 | break; | ||
1901 | 5664 | |||
1902 | 5665 | case PROP_CLIP_RECT: | 5758 | case PROP_CLIP_RECT: |
1903 | 5666 | g_value_set_boxed (value, &priv->clip); | 5759 | g_value_set_boxed (value, &priv->clip); |
1904 | 5667 | break; | 5760 | break; |
1905 | @@ -5809,7 +5902,7 @@ clutter_actor_get_property (GObject *object, | |||
1906 | 5809 | 5902 | ||
1907 | 5810 | case PROP_ROTATION_CENTER_X: /* XXX:2.0 - remove */ | 5903 | case PROP_ROTATION_CENTER_X: /* XXX:2.0 - remove */ |
1908 | 5811 | { | 5904 | { |
1910 | 5812 | ClutterVertex center; | 5905 | graphene_point3d_t center; |
1911 | 5813 | 5906 | ||
1912 | 5814 | clutter_actor_get_rotation (actor, CLUTTER_X_AXIS, | 5907 | clutter_actor_get_rotation (actor, CLUTTER_X_AXIS, |
1913 | 5815 | ¢er.x, | 5908 | ¢er.x, |
1914 | @@ -5822,7 +5915,7 @@ clutter_actor_get_property (GObject *object, | |||
1915 | 5822 | 5915 | ||
1916 | 5823 | case PROP_ROTATION_CENTER_Y: /* XXX:2.0 - remove */ | 5916 | case PROP_ROTATION_CENTER_Y: /* XXX:2.0 - remove */ |
1917 | 5824 | { | 5917 | { |
1919 | 5825 | ClutterVertex center; | 5918 | graphene_point3d_t center; |
1920 | 5826 | 5919 | ||
1921 | 5827 | clutter_actor_get_rotation (actor, CLUTTER_Y_AXIS, | 5920 | clutter_actor_get_rotation (actor, CLUTTER_Y_AXIS, |
1922 | 5828 | ¢er.x, | 5921 | ¢er.x, |
1923 | @@ -5835,7 +5928,7 @@ clutter_actor_get_property (GObject *object, | |||
1924 | 5835 | 5928 | ||
1925 | 5836 | case PROP_ROTATION_CENTER_Z: /* XXX:2.0 - remove */ | 5929 | case PROP_ROTATION_CENTER_Z: /* XXX:2.0 - remove */ |
1926 | 5837 | { | 5930 | { |
1928 | 5838 | ClutterVertex center; | 5931 | graphene_point3d_t center; |
1929 | 5839 | 5932 | ||
1930 | 5840 | clutter_actor_get_rotation (actor, CLUTTER_Z_AXIS, | 5933 | clutter_actor_get_rotation (actor, CLUTTER_Z_AXIS, |
1931 | 5841 | ¢er.x, | 5934 | ¢er.x, |
1932 | @@ -6080,18 +6173,7 @@ clutter_actor_dispose (GObject *object) | |||
1933 | 6080 | if (priv->parent != NULL) | 6173 | if (priv->parent != NULL) |
1934 | 6081 | { | 6174 | { |
1935 | 6082 | ClutterActor *parent = priv->parent; | 6175 | ClutterActor *parent = priv->parent; |
1948 | 6083 | 6176 | clutter_container_remove_actor (CLUTTER_CONTAINER (parent), self); | |
1937 | 6084 | /* go through the Container implementation unless this | ||
1938 | 6085 | * is an internal child and has been marked as such. | ||
1939 | 6086 | * | ||
1940 | 6087 | * removing the actor from its parent will reset the | ||
1941 | 6088 | * realized and mapped states. | ||
1942 | 6089 | */ | ||
1943 | 6090 | if (!CLUTTER_ACTOR_IS_INTERNAL_CHILD (self)) | ||
1944 | 6091 | clutter_container_remove_actor (CLUTTER_CONTAINER (parent), self); | ||
1945 | 6092 | else | ||
1946 | 6093 | clutter_actor_remove_child_internal (parent, self, | ||
1947 | 6094 | REMOVE_CHILD_LEGACY_FLAGS); | ||
1949 | 6095 | } | 6177 | } |
1950 | 6096 | 6178 | ||
1951 | 6097 | /* parent must be gone at this point */ | 6179 | /* parent must be gone at this point */ |
1952 | @@ -6104,17 +6186,8 @@ clutter_actor_dispose (GObject *object) | |||
1953 | 6104 | g_assert (!CLUTTER_ACTOR_IS_REALIZED (self)); | 6186 | g_assert (!CLUTTER_ACTOR_IS_REALIZED (self)); |
1954 | 6105 | } | 6187 | } |
1955 | 6106 | 6188 | ||
1967 | 6107 | if (priv->resolution_changed_id) | 6189 | g_clear_signal_handler (&priv->resolution_changed_id, backend); |
1968 | 6108 | { | 6190 | g_clear_signal_handler (&priv->font_changed_id, backend); |
1958 | 6109 | g_signal_handler_disconnect (backend, priv->resolution_changed_id); | ||
1959 | 6110 | priv->resolution_changed_id = 0; | ||
1960 | 6111 | } | ||
1961 | 6112 | |||
1962 | 6113 | if (priv->font_changed_id) | ||
1963 | 6114 | { | ||
1964 | 6115 | g_signal_handler_disconnect (backend, priv->font_changed_id); | ||
1965 | 6116 | priv->font_changed_id = 0; | ||
1966 | 6117 | } | ||
1969 | 6118 | 6191 | ||
1970 | 6119 | g_clear_object (&priv->pango_context); | 6192 | g_clear_object (&priv->pango_context); |
1971 | 6120 | g_clear_object (&priv->actions); | 6193 | g_clear_object (&priv->actions); |
1972 | @@ -6263,7 +6336,7 @@ clutter_actor_update_default_paint_volume (ClutterActor *self, | |||
1973 | 6263 | priv->clip.size.width >= 0 && | 6336 | priv->clip.size.width >= 0 && |
1974 | 6264 | priv->clip.size.height >= 0) | 6337 | priv->clip.size.height >= 0) |
1975 | 6265 | { | 6338 | { |
1977 | 6266 | ClutterVertex origin; | 6339 | graphene_point3d_t origin; |
1978 | 6267 | 6340 | ||
1979 | 6268 | origin.x = priv->clip.origin.x; | 6341 | origin.x = priv->clip.origin.x; |
1980 | 6269 | origin.y = priv->clip.origin.y; | 6342 | origin.y = priv->clip.origin.y; |
1981 | @@ -6539,7 +6612,7 @@ clutter_actor_class_init (ClutterActorClass *klass) | |||
1982 | 6539 | g_param_spec_boxed ("position", | 6612 | g_param_spec_boxed ("position", |
1983 | 6540 | P_("Position"), | 6613 | P_("Position"), |
1984 | 6541 | P_("The position of the origin of the actor"), | 6614 | P_("The position of the origin of the actor"), |
1986 | 6542 | CLUTTER_TYPE_POINT, | 6615 | GRAPHENE_TYPE_POINT, |
1987 | 6543 | G_PARAM_READWRITE | | 6616 | G_PARAM_READWRITE | |
1988 | 6544 | G_PARAM_STATIC_STRINGS | | 6617 | G_PARAM_STATIC_STRINGS | |
1989 | 6545 | CLUTTER_PARAM_ANIMATABLE); | 6618 | CLUTTER_PARAM_ANIMATABLE); |
1990 | @@ -6557,7 +6630,7 @@ clutter_actor_class_init (ClutterActorClass *klass) | |||
1991 | 6557 | g_param_spec_float ("width", | 6630 | g_param_spec_float ("width", |
1992 | 6558 | P_("Width"), | 6631 | P_("Width"), |
1993 | 6559 | P_("Width of the actor"), | 6632 | P_("Width of the actor"), |
1995 | 6560 | 0.0, G_MAXFLOAT, | 6633 | -1.0f, G_MAXFLOAT, |
1996 | 6561 | 0.0, | 6634 | 0.0, |
1997 | 6562 | G_PARAM_READWRITE | | 6635 | G_PARAM_READWRITE | |
1998 | 6563 | G_PARAM_STATIC_STRINGS | | 6636 | G_PARAM_STATIC_STRINGS | |
1999 | @@ -6576,7 +6649,7 @@ clutter_actor_class_init (ClutterActorClass *klass) | |||
2000 | 6576 | g_param_spec_float ("height", | 6649 | g_param_spec_float ("height", |
2001 | 6577 | P_("Height"), | 6650 | P_("Height"), |
2002 | 6578 | P_("Height of the actor"), | 6651 | P_("Height of the actor"), |
2004 | 6579 | 0.0, G_MAXFLOAT, | 6652 | -1.0f, G_MAXFLOAT, |
2005 | 6580 | 0.0, | 6653 | 0.0, |
2006 | 6581 | G_PARAM_READWRITE | | 6654 | G_PARAM_READWRITE | |
2007 | 6582 | G_PARAM_STATIC_STRINGS | | 6655 | G_PARAM_STATIC_STRINGS | |
2008 | @@ -6598,7 +6671,7 @@ clutter_actor_class_init (ClutterActorClass *klass) | |||
2009 | 6598 | g_param_spec_boxed ("size", | 6671 | g_param_spec_boxed ("size", |
2010 | 6599 | P_("Size"), | 6672 | P_("Size"), |
2011 | 6600 | P_("The size of the actor"), | 6673 | P_("The size of the actor"), |
2013 | 6601 | CLUTTER_TYPE_SIZE, | 6674 | GRAPHENE_TYPE_SIZE, |
2014 | 6602 | G_PARAM_READWRITE | | 6675 | G_PARAM_READWRITE | |
2015 | 6603 | G_PARAM_STATIC_STRINGS | | 6676 | G_PARAM_STATIC_STRINGS | |
2016 | 6604 | CLUTTER_PARAM_ANIMATABLE); | 6677 | CLUTTER_PARAM_ANIMATABLE); |
2017 | @@ -7041,24 +7114,10 @@ clutter_actor_class_init (ClutterActorClass *klass) | |||
2018 | 7041 | CLUTTER_PARAM_READABLE); | 7114 | CLUTTER_PARAM_READABLE); |
2019 | 7042 | 7115 | ||
2020 | 7043 | /** | 7116 | /** |
2021 | 7044 | * ClutterActor:clip: | ||
2022 | 7045 | * | ||
2023 | 7046 | * The visible region of the actor, in actor-relative coordinates | ||
2024 | 7047 | * | ||
2025 | 7048 | * Deprecated: 1.12: Use #ClutterActor:clip-rect instead. | ||
2026 | 7049 | */ | ||
2027 | 7050 | obj_props[PROP_CLIP] = /* XXX:2.0 - remove */ | ||
2028 | 7051 | g_param_spec_boxed ("clip", | ||
2029 | 7052 | P_("Clip"), | ||
2030 | 7053 | P_("The clip region for the actor"), | ||
2031 | 7054 | CLUTTER_TYPE_GEOMETRY, | ||
2032 | 7055 | CLUTTER_PARAM_READWRITE); | ||
2033 | 7056 | |||
2034 | 7057 | /** | ||
2035 | 7058 | * ClutterActor:clip-rect: | 7117 | * ClutterActor:clip-rect: |
2036 | 7059 | * | 7118 | * |
2037 | 7060 | * The visible region of the actor, in actor-relative coordinates, | 7119 | * The visible region of the actor, in actor-relative coordinates, |
2039 | 7061 | * expressed as a #ClutterRect. | 7120 | * expressed as a #graphene_rect_t. |
2040 | 7062 | * | 7121 | * |
2041 | 7063 | * Setting this property to %NULL will unset the existing clip. | 7122 | * Setting this property to %NULL will unset the existing clip. |
2042 | 7064 | * | 7123 | * |
2043 | @@ -7071,7 +7130,7 @@ clutter_actor_class_init (ClutterActorClass *klass) | |||
2044 | 7071 | g_param_spec_boxed ("clip-rect", | 7130 | g_param_spec_boxed ("clip-rect", |
2045 | 7072 | P_("Clip Rectangle"), | 7131 | P_("Clip Rectangle"), |
2046 | 7073 | P_("The visible region of the actor"), | 7132 | P_("The visible region of the actor"), |
2048 | 7074 | CLUTTER_TYPE_RECT, | 7133 | GRAPHENE_TYPE_RECT, |
2049 | 7075 | G_PARAM_READWRITE | | 7134 | G_PARAM_READWRITE | |
2050 | 7076 | G_PARAM_STATIC_STRINGS); | 7135 | G_PARAM_STATIC_STRINGS); |
2051 | 7077 | 7136 | ||
2052 | @@ -7108,7 +7167,7 @@ clutter_actor_class_init (ClutterActorClass *klass) | |||
2053 | 7108 | g_param_spec_boxed ("pivot-point", | 7167 | g_param_spec_boxed ("pivot-point", |
2054 | 7109 | P_("Pivot Point"), | 7168 | P_("Pivot Point"), |
2055 | 7110 | P_("The point around which the scaling and rotation occur"), | 7169 | P_("The point around which the scaling and rotation occur"), |
2057 | 7111 | CLUTTER_TYPE_POINT, | 7170 | GRAPHENE_TYPE_POINT, |
2058 | 7112 | G_PARAM_READWRITE | | 7171 | G_PARAM_READWRITE | |
2059 | 7113 | G_PARAM_STATIC_STRINGS | | 7172 | G_PARAM_STATIC_STRINGS | |
2060 | 7114 | CLUTTER_PARAM_ANIMATABLE); | 7173 | CLUTTER_PARAM_ANIMATABLE); |
2061 | @@ -7330,7 +7389,7 @@ clutter_actor_class_init (ClutterActorClass *klass) | |||
2062 | 7330 | g_param_spec_boxed ("rotation-center-x", | 7389 | g_param_spec_boxed ("rotation-center-x", |
2063 | 7331 | P_("Rotation Center X"), | 7390 | P_("Rotation Center X"), |
2064 | 7332 | P_("The rotation center on the X axis"), | 7391 | P_("The rotation center on the X axis"), |
2066 | 7333 | CLUTTER_TYPE_VERTEX, | 7392 | GRAPHENE_TYPE_POINT3D, |
2067 | 7334 | G_PARAM_READWRITE | | 7393 | G_PARAM_READWRITE | |
2068 | 7335 | G_PARAM_STATIC_STRINGS | | 7394 | G_PARAM_STATIC_STRINGS | |
2069 | 7336 | G_PARAM_DEPRECATED); | 7395 | G_PARAM_DEPRECATED); |
2070 | @@ -7348,7 +7407,7 @@ clutter_actor_class_init (ClutterActorClass *klass) | |||
2071 | 7348 | g_param_spec_boxed ("rotation-center-y", | 7407 | g_param_spec_boxed ("rotation-center-y", |
2072 | 7349 | P_("Rotation Center Y"), | 7408 | P_("Rotation Center Y"), |
2073 | 7350 | P_("The rotation center on the Y axis"), | 7409 | P_("The rotation center on the Y axis"), |
2075 | 7351 | CLUTTER_TYPE_VERTEX, | 7410 | GRAPHENE_TYPE_POINT3D, |
2076 | 7352 | G_PARAM_READWRITE | | 7411 | G_PARAM_READWRITE | |
2077 | 7353 | G_PARAM_STATIC_STRINGS | | 7412 | G_PARAM_STATIC_STRINGS | |
2078 | 7354 | G_PARAM_DEPRECATED); | 7413 | G_PARAM_DEPRECATED); |
2079 | @@ -7366,7 +7425,7 @@ clutter_actor_class_init (ClutterActorClass *klass) | |||
2080 | 7366 | g_param_spec_boxed ("rotation-center-z", | 7425 | g_param_spec_boxed ("rotation-center-z", |
2081 | 7367 | P_("Rotation Center Z"), | 7426 | P_("Rotation Center Z"), |
2082 | 7368 | P_("The rotation center on the Z axis"), | 7427 | P_("The rotation center on the Z axis"), |
2084 | 7369 | CLUTTER_TYPE_VERTEX, | 7428 | GRAPHENE_TYPE_POINT3D, |
2085 | 7370 | G_PARAM_READWRITE | | 7429 | G_PARAM_READWRITE | |
2086 | 7371 | G_PARAM_STATIC_STRINGS | | 7430 | G_PARAM_STATIC_STRINGS | |
2087 | 7372 | G_PARAM_DEPRECATED); | 7431 | G_PARAM_DEPRECATED); |
2088 | @@ -8520,6 +8579,7 @@ clutter_actor_class_init (ClutterActorClass *klass) | |||
2089 | 8520 | /** | 8579 | /** |
2090 | 8521 | * ClutterActor::paint: | 8580 | * ClutterActor::paint: |
2091 | 8522 | * @actor: the #ClutterActor that received the signal | 8581 | * @actor: the #ClutterActor that received the signal |
2092 | 8582 | * @paint_context: a #ClutterPaintContext | ||
2093 | 8523 | * | 8583 | * |
2094 | 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. |
2095 | 8525 | * | 8585 | * |
2096 | @@ -8547,7 +8607,8 @@ clutter_actor_class_init (ClutterActorClass *klass) | |||
2097 | 8547 | G_SIGNAL_DEPRECATED, | 8607 | G_SIGNAL_DEPRECATED, |
2098 | 8548 | G_STRUCT_OFFSET (ClutterActorClass, paint), | 8608 | G_STRUCT_OFFSET (ClutterActorClass, paint), |
2099 | 8549 | NULL, NULL, NULL, | 8609 | NULL, NULL, NULL, |
2101 | 8550 | G_TYPE_NONE, 0); | 8610 | G_TYPE_NONE, 1, |
2102 | 8611 | CLUTTER_TYPE_PAINT_CONTEXT); | ||
2103 | 8551 | /** | 8612 | /** |
2104 | 8552 | * ClutterActor::realize: | 8613 | * ClutterActor::realize: |
2105 | 8553 | * @actor: the #ClutterActor that received the signal | 8614 | * @actor: the #ClutterActor that received the signal |
2106 | @@ -8590,12 +8651,11 @@ clutter_actor_class_init (ClutterActorClass *klass) | |||
2107 | 8590 | /** | 8651 | /** |
2108 | 8591 | * ClutterActor::pick: | 8652 | * ClutterActor::pick: |
2109 | 8592 | * @actor: the #ClutterActor that received the signal | 8653 | * @actor: the #ClutterActor that received the signal |
2111 | 8593 | * @color: the #ClutterColor to be used when picking | 8654 | * @pick_context: a #ClutterPickContext |
2112 | 8594 | * | 8655 | * |
2113 | 8595 | * The ::pick signal is emitted each time an actor is being painted | 8656 | * The ::pick signal is emitted each time an actor is being painted |
2114 | 8596 | * in "pick mode". The pick mode is used to identify the actor during | 8657 | * in "pick mode". The pick mode is used to identify the actor during |
2115 | 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(). |
2116 | 8598 | * The actor should paint its shape using the passed @pick_color. | ||
2117 | 8599 | * | 8659 | * |
2118 | 8600 | * Subclasses of #ClutterActor should override the class signal handler | 8660 | * Subclasses of #ClutterActor should override the class signal handler |
2119 | 8601 | * and paint themselves in that function. | 8661 | * and paint themselves in that function. |
2120 | @@ -8614,7 +8674,7 @@ clutter_actor_class_init (ClutterActorClass *klass) | |||
2121 | 8614 | G_STRUCT_OFFSET (ClutterActorClass, pick), | 8674 | G_STRUCT_OFFSET (ClutterActorClass, pick), |
2122 | 8615 | NULL, NULL, NULL, | 8675 | NULL, NULL, NULL, |
2123 | 8616 | G_TYPE_NONE, 1, | 8676 | G_TYPE_NONE, 1, |
2125 | 8617 | CLUTTER_TYPE_COLOR | G_SIGNAL_TYPE_STATIC_SCOPE); | 8677 | CLUTTER_TYPE_PICK_CONTEXT); |
2126 | 8618 | 8678 | ||
2127 | 8619 | /** | 8679 | /** |
2128 | 8620 | * ClutterActor::allocation-changed: | 8680 | * ClutterActor::allocation-changed: |
2129 | @@ -9021,7 +9081,7 @@ _clutter_actor_queue_redraw_full (ClutterActor *self, | |||
2130 | 9021 | if (flags & CLUTTER_REDRAW_CLIPPED_TO_ALLOCATION) | 9081 | if (flags & CLUTTER_REDRAW_CLIPPED_TO_ALLOCATION) |
2131 | 9022 | { | 9082 | { |
2132 | 9023 | ClutterActorBox allocation_clip; | 9083 | ClutterActorBox allocation_clip; |
2134 | 9024 | ClutterVertex origin; | 9084 | graphene_point3d_t origin; |
2135 | 9025 | 9085 | ||
2136 | 9026 | /* If the actor doesn't have a valid allocation then we will | 9086 | /* If the actor doesn't have a valid allocation then we will |
2137 | 9027 | * queue a full stage redraw. */ | 9087 | * queue a full stage redraw. */ |
2138 | @@ -9225,7 +9285,7 @@ clutter_actor_queue_redraw_with_clip (ClutterActor *self, | |||
2139 | 9225 | const cairo_rectangle_int_t *clip) | 9285 | const cairo_rectangle_int_t *clip) |
2140 | 9226 | { | 9286 | { |
2141 | 9227 | ClutterPaintVolume volume; | 9287 | ClutterPaintVolume volume; |
2143 | 9228 | ClutterVertex origin; | 9288 | graphene_point3d_t origin; |
2144 | 9229 | 9289 | ||
2145 | 9230 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | 9290 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); |
2146 | 9231 | 9291 | ||
2147 | @@ -9693,6 +9753,23 @@ clutter_actor_get_preferred_width (ClutterActor *self, | |||
2148 | 9693 | return; | 9753 | return; |
2149 | 9694 | } | 9754 | } |
2150 | 9695 | 9755 | ||
2151 | 9756 | /* if the request mode is CONTENT_SIZE we simply return the content width */ | ||
2152 | 9757 | if (priv->request_mode == CLUTTER_REQUEST_CONTENT_SIZE) | ||
2153 | 9758 | { | ||
2154 | 9759 | float content_width = 0.f; | ||
2155 | 9760 | |||
2156 | 9761 | if (priv->content != NULL) | ||
2157 | 9762 | clutter_content_get_preferred_size (priv->content, &content_width, NULL); | ||
2158 | 9763 | |||
2159 | 9764 | if (min_width_p != NULL) | ||
2160 | 9765 | *min_width_p = content_width; | ||
2161 | 9766 | |||
2162 | 9767 | if (natural_width_p != NULL) | ||
2163 | 9768 | *natural_width_p = content_width; | ||
2164 | 9769 | |||
2165 | 9770 | return; | ||
2166 | 9771 | } | ||
2167 | 9772 | |||
2168 | 9696 | CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_WIDTH); | 9773 | CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_WIDTH); |
2169 | 9697 | 9774 | ||
2170 | 9698 | /* the remaining cases are: | 9775 | /* the remaining cases are: |
2171 | @@ -9841,6 +9918,23 @@ clutter_actor_get_preferred_height (ClutterActor *self, | |||
2172 | 9841 | return; | 9918 | return; |
2173 | 9842 | } | 9919 | } |
2174 | 9843 | 9920 | ||
2175 | 9921 | /* if the request mode is CONTENT_SIZE we simply return the content height */ | ||
2176 | 9922 | if (priv->request_mode == CLUTTER_REQUEST_CONTENT_SIZE) | ||
2177 | 9923 | { | ||
2178 | 9924 | float content_height = 0.f; | ||
2179 | 9925 | |||
2180 | 9926 | if (priv->content != NULL) | ||
2181 | 9927 | clutter_content_get_preferred_size (priv->content, NULL, &content_height); | ||
2182 | 9928 | |||
2183 | 9929 | if (min_height_p != NULL) | ||
2184 | 9930 | *min_height_p = content_height; | ||
2185 | 9931 | |||
2186 | 9932 | if (natural_height_p != NULL) | ||
2187 | 9933 | *natural_height_p = content_height; | ||
2188 | 9934 | |||
2189 | 9935 | return; | ||
2190 | 9936 | } | ||
2191 | 9937 | |||
2192 | 9844 | CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_HEIGHT); | 9938 | CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PREF_HEIGHT); |
2193 | 9845 | 9939 | ||
2194 | 9846 | /* the remaining cases are: | 9940 | /* the remaining cases are: |
2195 | @@ -10452,17 +10546,17 @@ clutter_actor_set_position (ClutterActor *self, | |||
2196 | 10452 | gfloat x, | 10546 | gfloat x, |
2197 | 10453 | gfloat y) | 10547 | gfloat y) |
2198 | 10454 | { | 10548 | { |
2201 | 10455 | ClutterPoint new_position; | 10549 | graphene_point_t new_position; |
2202 | 10456 | ClutterPoint cur_position; | 10550 | graphene_point_t cur_position; |
2203 | 10457 | 10551 | ||
2204 | 10458 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | 10552 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); |
2205 | 10459 | 10553 | ||
2207 | 10460 | clutter_point_init (&new_position, x, y); | 10554 | graphene_point_init (&new_position, x, y); |
2208 | 10461 | 10555 | ||
2209 | 10462 | cur_position.x = clutter_actor_get_x (self); | 10556 | cur_position.x = clutter_actor_get_x (self); |
2210 | 10463 | cur_position.y = clutter_actor_get_y (self); | 10557 | cur_position.y = clutter_actor_get_y (self); |
2211 | 10464 | 10558 | ||
2213 | 10465 | if (!clutter_point_equals (&cur_position, &new_position)) | 10559 | if (!graphene_point_equal (&cur_position, &new_position)) |
2214 | 10466 | _clutter_actor_create_transition (self, obj_props[PROP_POSITION], | 10560 | _clutter_actor_create_transition (self, obj_props[PROP_POSITION], |
2215 | 10467 | &cur_position, | 10561 | &cur_position, |
2216 | 10468 | &new_position); | 10562 | &new_position); |
2217 | @@ -10897,8 +10991,8 @@ clutter_actor_set_height_internal (ClutterActor *self, | |||
2218 | 10897 | } | 10991 | } |
2219 | 10898 | 10992 | ||
2220 | 10899 | static void | 10993 | static void |
2223 | 10900 | clutter_actor_set_size_internal (ClutterActor *self, | 10994 | clutter_actor_set_size_internal (ClutterActor *self, |
2224 | 10901 | const ClutterSize *size) | 10995 | const graphene_size_t *size) |
2225 | 10902 | { | 10996 | { |
2226 | 10903 | if (size != NULL) | 10997 | if (size != NULL) |
2227 | 10904 | { | 10998 | { |
2228 | @@ -10934,11 +11028,11 @@ clutter_actor_set_size (ClutterActor *self, | |||
2229 | 10934 | gfloat width, | 11028 | gfloat width, |
2230 | 10935 | gfloat height) | 11029 | gfloat height) |
2231 | 10936 | { | 11030 | { |
2233 | 10937 | ClutterSize new_size; | 11031 | graphene_size_t new_size; |
2234 | 10938 | 11032 | ||
2235 | 10939 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | 11033 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); |
2236 | 10940 | 11034 | ||
2238 | 10941 | clutter_size_init (&new_size, width, height); | 11035 | graphene_size_init (&new_size, width, height); |
2239 | 10942 | 11036 | ||
2240 | 10943 | /* minor optimization: if we don't have a duration then we can | 11037 | /* minor optimization: if we don't have a duration then we can |
2241 | 10944 | * skip the get_size() below, to avoid the chance of going through | 11038 | * skip the get_size() below, to avoid the chance of going through |
2242 | @@ -10957,11 +11051,11 @@ clutter_actor_set_size (ClutterActor *self, | |||
2243 | 10957 | } | 11051 | } |
2244 | 10958 | else | 11052 | else |
2245 | 10959 | { | 11053 | { |
2247 | 10960 | ClutterSize cur_size; | 11054 | graphene_size_t cur_size; |
2248 | 10961 | 11055 | ||
2252 | 10962 | clutter_size_init (&cur_size, | 11056 | graphene_size_init (&cur_size, |
2253 | 10963 | clutter_actor_get_width (self), | 11057 | clutter_actor_get_width (self), |
2254 | 10964 | clutter_actor_get_height (self)); | 11058 | clutter_actor_get_height (self)); |
2255 | 10965 | 11059 | ||
2256 | 10966 | _clutter_actor_create_transition (self, | 11060 | _clutter_actor_create_transition (self, |
2257 | 10967 | obj_props[PROP_SIZE], | 11061 | obj_props[PROP_SIZE], |
2258 | @@ -11047,8 +11141,8 @@ clutter_actor_get_transformed_position (ClutterActor *self, | |||
2259 | 11047 | gfloat *x, | 11141 | gfloat *x, |
2260 | 11048 | gfloat *y) | 11142 | gfloat *y) |
2261 | 11049 | { | 11143 | { |
2264 | 11050 | ClutterVertex v1; | 11144 | graphene_point3d_t v1; |
2265 | 11051 | ClutterVertex v2; | 11145 | graphene_point3d_t v2; |
2266 | 11052 | 11146 | ||
2267 | 11053 | v1.x = v1.y = v1.z = 0; | 11147 | v1.x = v1.y = v1.z = 0; |
2268 | 11054 | clutter_actor_apply_transform_to_point (self, &v1, &v2); | 11148 | clutter_actor_apply_transform_to_point (self, &v1, &v2); |
2269 | @@ -11094,7 +11188,7 @@ clutter_actor_get_transformed_size (ClutterActor *self, | |||
2270 | 11094 | gfloat *height) | 11188 | gfloat *height) |
2271 | 11095 | { | 11189 | { |
2272 | 11096 | ClutterActorPrivate *priv; | 11190 | ClutterActorPrivate *priv; |
2274 | 11097 | ClutterVertex v[4]; | 11191 | graphene_point3d_t v[4]; |
2275 | 11098 | gfloat x_min, x_max, y_min, y_max; | 11192 | gfloat x_min, x_max, y_min, y_max; |
2276 | 11099 | gint i; | 11193 | gint i; |
2277 | 11100 | 11194 | ||
2278 | @@ -11416,8 +11510,8 @@ clutter_actor_set_y_internal (ClutterActor *self, | |||
2279 | 11416 | } | 11510 | } |
2280 | 11417 | 11511 | ||
2281 | 11418 | static void | 11512 | static void |
2284 | 11419 | clutter_actor_set_position_internal (ClutterActor *self, | 11513 | clutter_actor_set_position_internal (ClutterActor *self, |
2285 | 11420 | const ClutterPoint *position) | 11514 | const graphene_point_t *position) |
2286 | 11421 | { | 11515 | { |
2287 | 11422 | ClutterActorPrivate *priv = self->priv; | 11516 | ClutterActorPrivate *priv = self->priv; |
2288 | 11423 | ClutterLayoutInfo *linfo; | 11517 | ClutterLayoutInfo *linfo; |
2289 | @@ -11426,7 +11520,7 @@ clutter_actor_set_position_internal (ClutterActor *self, | |||
2290 | 11426 | linfo = _clutter_actor_get_layout_info (self); | 11520 | linfo = _clutter_actor_get_layout_info (self); |
2291 | 11427 | 11521 | ||
2292 | 11428 | if (priv->position_set && | 11522 | if (priv->position_set && |
2294 | 11429 | clutter_point_equals (position, &linfo->fixed_pos)) | 11523 | graphene_point_equal (position, &linfo->fixed_pos)) |
2295 | 11430 | return; | 11524 | return; |
2296 | 11431 | 11525 | ||
2297 | 11432 | clutter_actor_store_old_geometry (self, &old); | 11526 | clutter_actor_store_old_geometry (self, &old); |
2298 | @@ -11511,8 +11605,7 @@ clutter_actor_set_y (ClutterActor *self, | |||
2299 | 11511 | * the X coordinate of the origin of the allocation box. | 11605 | * the X coordinate of the origin of the allocation box. |
2300 | 11512 | * | 11606 | * |
2301 | 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(), |
2304 | 11514 | * clutter_actor_set_position() or clutter_actor_set_geometry(), this | 11608 | * clutter_actor_set_position(), this function will return that coordinate. |
2303 | 11515 | * function will return that coordinate. | ||
2305 | 11516 | * | 11609 | * |
2306 | 11517 | * If both the allocation and a fixed position are missing, this function | 11610 | * If both the allocation and a fixed position are missing, this function |
2307 | 11518 | * will return 0. | 11611 | * will return 0. |
2308 | @@ -11559,8 +11652,7 @@ clutter_actor_get_x (ClutterActor *self) | |||
2309 | 11559 | * the Y coordinate of the origin of the allocation box. | 11652 | * the Y coordinate of the origin of the allocation box. |
2310 | 11560 | * | 11653 | * |
2311 | 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(), |
2314 | 11562 | * clutter_actor_set_position() or clutter_actor_set_geometry(), this | 11655 | * clutter_actor_set_position(), this function will return that coordinate. |
2313 | 11563 | * function will return that coordinate. | ||
2315 | 11564 | * | 11656 | * |
2316 | 11565 | * If both the allocation and a fixed position are missing, this function | 11657 | * If both the allocation and a fixed position are missing, this function |
2317 | 11566 | * will return 0. | 11658 | * will return 0. |
2318 | @@ -11686,45 +11778,6 @@ clutter_actor_set_scale_full (ClutterActor *self, | |||
2319 | 11686 | } | 11778 | } |
2320 | 11687 | 11779 | ||
2321 | 11688 | /** | 11780 | /** |
2322 | 11689 | * clutter_actor_set_scale_with_gravity: | ||
2323 | 11690 | * @self: A #ClutterActor | ||
2324 | 11691 | * @scale_x: double factor to scale actor by horizontally. | ||
2325 | 11692 | * @scale_y: double factor to scale actor by vertically. | ||
2326 | 11693 | * @gravity: the location of the scale center expressed as a compass | ||
2327 | 11694 | * direction. | ||
2328 | 11695 | * | ||
2329 | 11696 | * Scales an actor with the given factors around the given | ||
2330 | 11697 | * center point. The center point is specified as one of the compass | ||
2331 | 11698 | * directions in #ClutterGravity. For example, setting it to north | ||
2332 | 11699 | * will cause the top of the actor to remain unchanged and the rest of | ||
2333 | 11700 | * the actor to expand left, right and downwards. | ||
2334 | 11701 | * | ||
2335 | 11702 | * The #ClutterActor:scale-x and #ClutterActor:scale-y properties are | ||
2336 | 11703 | * animatable. | ||
2337 | 11704 | * | ||
2338 | 11705 | * Since: 1.0 | ||
2339 | 11706 | * | ||
2340 | 11707 | * Deprecated: 1.12: Use clutter_actor_set_pivot_point() to set the | ||
2341 | 11708 | * scale center using normalized coordinates instead. | ||
2342 | 11709 | */ | ||
2343 | 11710 | void | ||
2344 | 11711 | clutter_actor_set_scale_with_gravity (ClutterActor *self, | ||
2345 | 11712 | gdouble scale_x, | ||
2346 | 11713 | gdouble scale_y, | ||
2347 | 11714 | ClutterGravity gravity) | ||
2348 | 11715 | { | ||
2349 | 11716 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | ||
2350 | 11717 | |||
2351 | 11718 | g_object_freeze_notify (G_OBJECT (self)); | ||
2352 | 11719 | |||
2353 | 11720 | clutter_actor_set_scale_factor (self, CLUTTER_X_AXIS, scale_x); | ||
2354 | 11721 | clutter_actor_set_scale_factor (self, CLUTTER_Y_AXIS, scale_y); | ||
2355 | 11722 | clutter_actor_set_scale_gravity (self, gravity); | ||
2356 | 11723 | |||
2357 | 11724 | g_object_thaw_notify (G_OBJECT (self)); | ||
2358 | 11725 | } | ||
2359 | 11726 | |||
2360 | 11727 | /** | ||
2361 | 11728 | * clutter_actor_get_scale: | 11781 | * clutter_actor_get_scale: |
2362 | 11729 | * @self: A #ClutterActor | 11782 | * @self: A #ClutterActor |
2363 | 11730 | * @scale_x: (out) (allow-none): Location to store horizonal | 11783 | * @scale_x: (out) (allow-none): Location to store horizonal |
2364 | @@ -12114,27 +12167,6 @@ clutter_actor_get_name (ClutterActor *self) | |||
2365 | 12114 | return self->priv->name; | 12167 | return self->priv->name; |
2366 | 12115 | } | 12168 | } |
2367 | 12116 | 12169 | ||
2368 | 12117 | /** | ||
2369 | 12118 | * clutter_actor_get_gid: | ||
2370 | 12119 | * @self: A #ClutterActor | ||
2371 | 12120 | * | ||
2372 | 12121 | * Retrieves the unique id for @self. | ||
2373 | 12122 | * | ||
2374 | 12123 | * Return value: Globally unique value for this object instance. | ||
2375 | 12124 | * | ||
2376 | 12125 | * Since: 0.6 | ||
2377 | 12126 | * | ||
2378 | 12127 | * Deprecated: 1.8: The id is not used any longer, and this function | ||
2379 | 12128 | * always returns 0. | ||
2380 | 12129 | */ | ||
2381 | 12130 | guint32 | ||
2382 | 12131 | clutter_actor_get_gid (ClutterActor *self) | ||
2383 | 12132 | { | ||
2384 | 12133 | g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0); | ||
2385 | 12134 | |||
2386 | 12135 | return 0; | ||
2387 | 12136 | } | ||
2388 | 12137 | |||
2389 | 12138 | static inline void | 12170 | static inline void |
2390 | 12139 | clutter_actor_set_depth_internal (ClutterActor *self, | 12171 | clutter_actor_set_depth_internal (ClutterActor *self, |
2391 | 12140 | float depth) | 12172 | float depth) |
2392 | @@ -12245,7 +12277,7 @@ clutter_actor_set_pivot_point (ClutterActor *self, | |||
2393 | 12245 | gfloat pivot_x, | 12277 | gfloat pivot_x, |
2394 | 12246 | gfloat pivot_y) | 12278 | gfloat pivot_y) |
2395 | 12247 | { | 12279 | { |
2397 | 12248 | ClutterPoint pivot = CLUTTER_POINT_INIT (pivot_x, pivot_y); | 12280 | graphene_point_t pivot = GRAPHENE_POINT_INIT (pivot_x, pivot_y); |
2398 | 12249 | const ClutterTransformInfo *info; | 12281 | const ClutterTransformInfo *info; |
2399 | 12250 | 12282 | ||
2400 | 12251 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | 12283 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); |
2401 | @@ -12406,7 +12438,7 @@ clutter_actor_set_rotation (ClutterActor *self, | |||
2402 | 12406 | gfloat y, | 12438 | gfloat y, |
2403 | 12407 | gfloat z) | 12439 | gfloat z) |
2404 | 12408 | { | 12440 | { |
2406 | 12409 | ClutterVertex v; | 12441 | graphene_point3d_t v; |
2407 | 12410 | 12442 | ||
2408 | 12411 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | 12443 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); |
2409 | 12412 | 12444 | ||
2410 | @@ -12603,7 +12635,6 @@ clutter_actor_set_clip (ClutterActor *self, | |||
2411 | 12603 | 12635 | ||
2412 | 12604 | clutter_actor_queue_redraw (self); | 12636 | clutter_actor_queue_redraw (self); |
2413 | 12605 | 12637 | ||
2414 | 12606 | g_object_notify_by_pspec (obj, obj_props[PROP_CLIP]); | ||
2415 | 12607 | g_object_notify_by_pspec (obj, obj_props[PROP_CLIP_RECT]); | 12638 | g_object_notify_by_pspec (obj, obj_props[PROP_CLIP_RECT]); |
2416 | 12608 | g_object_notify_by_pspec (obj, obj_props[PROP_HAS_CLIP]); | 12639 | g_object_notify_by_pspec (obj, obj_props[PROP_HAS_CLIP]); |
2417 | 12609 | } | 12640 | } |
2418 | @@ -13106,12 +13137,6 @@ clutter_actor_add_child_internal (ClutterActor *self, | |||
2419 | 13106 | if (self->priv->in_cloned_branch) | 13137 | if (self->priv->in_cloned_branch) |
2420 | 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); |
2421 | 13108 | 13139 | ||
2422 | 13109 | /* if push_internal() has been called then we automatically set | ||
2423 | 13110 | * the flag on the actor | ||
2424 | 13111 | */ | ||
2425 | 13112 | if (self->priv->internal_child) | ||
2426 | 13113 | CLUTTER_SET_PRIVATE_FLAGS (child, CLUTTER_INTERNAL_CHILD); | ||
2427 | 13114 | |||
2428 | 13115 | /* children may cause their parent to expand, if they are set | 13140 | /* children may cause their parent to expand, if they are set |
2429 | 13116 | * to expand; if a child is not expanded then it cannot change | 13141 | * to expand; if a child is not expanded then it cannot change |
2430 | 13117 | * its parent's state. any further change later on will queue | 13142 | * its parent's state. any further change later on will queue |
2431 | @@ -13129,7 +13154,6 @@ clutter_actor_add_child_internal (ClutterActor *self, | |||
2432 | 13129 | clutter_actor_queue_compute_expand (self); | 13154 | clutter_actor_queue_compute_expand (self); |
2433 | 13130 | } | 13155 | } |
2434 | 13131 | 13156 | ||
2435 | 13132 | /* clutter_actor_reparent() will emit ::parent-set for us */ | ||
2436 | 13133 | if (emit_parent_set && !CLUTTER_ACTOR_IN_REPARENT (child)) | 13157 | if (emit_parent_set && !CLUTTER_ACTOR_IN_REPARENT (child)) |
2437 | 13134 | { | 13158 | { |
2438 | 13135 | child->priv->needs_compute_resource_scale = TRUE; | 13159 | child->priv->needs_compute_resource_scale = TRUE; |
2439 | @@ -13639,115 +13663,15 @@ clutter_actor_replace_child (ClutterActor *self, | |||
2440 | 13639 | * Deprecated: 1.10: Use clutter_actor_remove_child() instead. | 13663 | * Deprecated: 1.10: Use clutter_actor_remove_child() instead. |
2441 | 13640 | */ | 13664 | */ |
2442 | 13641 | void | 13665 | void |
2483 | 13642 | clutter_actor_unparent (ClutterActor *self) | 13666 | clutter_actor_unparent (ClutterActor *self) |
2444 | 13643 | { | ||
2445 | 13644 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | ||
2446 | 13645 | |||
2447 | 13646 | if (self->priv->parent == NULL) | ||
2448 | 13647 | return; | ||
2449 | 13648 | |||
2450 | 13649 | clutter_actor_remove_child_internal (self->priv->parent, self, | ||
2451 | 13650 | REMOVE_CHILD_LEGACY_FLAGS); | ||
2452 | 13651 | } | ||
2453 | 13652 | |||
2454 | 13653 | /** | ||
2455 | 13654 | * clutter_actor_reparent: | ||
2456 | 13655 | * @self: a #ClutterActor | ||
2457 | 13656 | * @new_parent: the new #ClutterActor parent | ||
2458 | 13657 | * | ||
2459 | 13658 | * Resets the parent actor of @self. | ||
2460 | 13659 | * | ||
2461 | 13660 | * This function is logically equivalent to calling clutter_actor_unparent() | ||
2462 | 13661 | * and clutter_actor_set_parent(), but more efficiently implemented, as it | ||
2463 | 13662 | * ensures the child is not finalized when unparented, and emits the | ||
2464 | 13663 | * #ClutterActor::parent-set signal only once. | ||
2465 | 13664 | * | ||
2466 | 13665 | * In reality, calling this function is less useful than it sounds, as some | ||
2467 | 13666 | * application code may rely on changes in the intermediate state between | ||
2468 | 13667 | * removal and addition of the actor from its old parent to the @new_parent. | ||
2469 | 13668 | * Thus, it is strongly encouraged to avoid using this function in application | ||
2470 | 13669 | * code. | ||
2471 | 13670 | * | ||
2472 | 13671 | * Since: 0.2 | ||
2473 | 13672 | * | ||
2474 | 13673 | * Deprecated: 1.10: Use clutter_actor_remove_child() and | ||
2475 | 13674 | * clutter_actor_add_child() instead; remember to take a reference on | ||
2476 | 13675 | * the actor being removed before calling clutter_actor_remove_child() | ||
2477 | 13676 | * to avoid the reference count dropping to zero and the actor being | ||
2478 | 13677 | * destroyed. | ||
2479 | 13678 | */ | ||
2480 | 13679 | void | ||
2481 | 13680 | clutter_actor_reparent (ClutterActor *self, | ||
2482 | 13681 | ClutterActor *new_parent) | ||
2484 | 13682 | { | 13667 | { |
2485 | 13683 | ClutterActorPrivate *priv; | ||
2486 | 13684 | |||
2487 | 13685 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | 13668 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); |
2488 | 13686 | g_return_if_fail (CLUTTER_IS_ACTOR (new_parent)); | ||
2489 | 13687 | g_return_if_fail (self != new_parent); | ||
2490 | 13688 | |||
2491 | 13689 | if (CLUTTER_ACTOR_IS_TOPLEVEL (self)) | ||
2492 | 13690 | { | ||
2493 | 13691 | g_warning ("Cannot set a parent on a toplevel actor"); | ||
2494 | 13692 | return; | ||
2495 | 13693 | } | ||
2496 | 13694 | |||
2497 | 13695 | if (CLUTTER_ACTOR_IN_DESTRUCTION (self)) | ||
2498 | 13696 | { | ||
2499 | 13697 | g_warning ("Cannot set a parent currently being destroyed"); | ||
2500 | 13698 | return; | ||
2501 | 13699 | } | ||
2502 | 13700 | |||
2503 | 13701 | priv = self->priv; | ||
2504 | 13702 | |||
2505 | 13703 | if (priv->parent != new_parent) | ||
2506 | 13704 | { | ||
2507 | 13705 | ClutterActor *old_parent; | ||
2508 | 13706 | |||
2509 | 13707 | CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_REPARENT); | ||
2510 | 13708 | |||
2511 | 13709 | old_parent = priv->parent; | ||
2512 | 13710 | |||
2513 | 13711 | g_object_ref (self); | ||
2514 | 13712 | |||
2515 | 13713 | if (old_parent != NULL) | ||
2516 | 13714 | { | ||
2517 | 13715 | /* go through the Container implementation if this is a regular | ||
2518 | 13716 | * child and not an internal one | ||
2519 | 13717 | */ | ||
2520 | 13718 | if (!CLUTTER_ACTOR_IS_INTERNAL_CHILD (self)) | ||
2521 | 13719 | { | ||
2522 | 13720 | ClutterContainer *parent = CLUTTER_CONTAINER (old_parent); | ||
2523 | 13721 | |||
2524 | 13722 | /* this will have to call unparent() */ | ||
2525 | 13723 | clutter_container_remove_actor (parent, self); | ||
2526 | 13724 | } | ||
2527 | 13725 | else | ||
2528 | 13726 | clutter_actor_remove_child_internal (old_parent, self, | ||
2529 | 13727 | REMOVE_CHILD_LEGACY_FLAGS); | ||
2530 | 13728 | } | ||
2531 | 13729 | |||
2532 | 13730 | /* Note, will call set_parent() */ | ||
2533 | 13731 | if (!CLUTTER_ACTOR_IS_INTERNAL_CHILD (self)) | ||
2534 | 13732 | clutter_container_add_actor (CLUTTER_CONTAINER (new_parent), self); | ||
2535 | 13733 | else | ||
2536 | 13734 | clutter_actor_add_child_internal (new_parent, self, | ||
2537 | 13735 | ADD_CHILD_LEGACY_FLAGS, | ||
2538 | 13736 | insert_child_at_depth, | ||
2539 | 13737 | NULL); | ||
2540 | 13738 | |||
2541 | 13739 | priv->needs_compute_resource_scale = TRUE; | ||
2542 | 13740 | |||
2543 | 13741 | /* we emit the ::parent-set signal once */ | ||
2544 | 13742 | g_signal_emit (self, actor_signals[PARENT_SET], 0, old_parent); | ||
2545 | 13743 | |||
2546 | 13744 | CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_REPARENT); | ||
2547 | 13745 | 13669 | ||
2550 | 13746 | /* the IN_REPARENT flag suspends state updates */ | 13670 | if (self->priv->parent == NULL) |
2551 | 13747 | clutter_actor_update_map_state (self, MAP_STATE_CHECK); | 13671 | return; |
2552 | 13748 | 13672 | ||
2555 | 13749 | g_object_unref (self); | 13673 | clutter_actor_remove_child_internal (self->priv->parent, self, |
2556 | 13750 | } | 13674 | REMOVE_CHILD_LEGACY_FLAGS); |
2557 | 13751 | } | 13675 | } |
2558 | 13752 | 13676 | ||
2559 | 13753 | /** | 13677 | /** |
2560 | @@ -13917,134 +13841,6 @@ clutter_actor_set_child_at_index (ClutterActor *self, | |||
2561 | 13917 | clutter_actor_queue_relayout (self); | 13841 | clutter_actor_queue_relayout (self); |
2562 | 13918 | } | 13842 | } |
2563 | 13919 | 13843 | ||
2564 | 13920 | /** | ||
2565 | 13921 | * clutter_actor_raise: | ||
2566 | 13922 | * @self: A #ClutterActor | ||
2567 | 13923 | * @below: (allow-none): A #ClutterActor to raise above. | ||
2568 | 13924 | * | ||
2569 | 13925 | * Puts @self above @below. | ||
2570 | 13926 | * | ||
2571 | 13927 | * Both actors must have the same parent, and the parent must implement | ||
2572 | 13928 | * the #ClutterContainer interface | ||
2573 | 13929 | * | ||
2574 | 13930 | * This function calls clutter_container_raise_child() internally. | ||
2575 | 13931 | * | ||
2576 | 13932 | * Deprecated: 1.10: Use clutter_actor_set_child_above_sibling() instead. | ||
2577 | 13933 | */ | ||
2578 | 13934 | void | ||
2579 | 13935 | clutter_actor_raise (ClutterActor *self, | ||
2580 | 13936 | ClutterActor *below) | ||
2581 | 13937 | { | ||
2582 | 13938 | ClutterActor *parent; | ||
2583 | 13939 | |||
2584 | 13940 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | ||
2585 | 13941 | |||
2586 | 13942 | parent = clutter_actor_get_parent (self); | ||
2587 | 13943 | if (parent == NULL) | ||
2588 | 13944 | { | ||
2589 | 13945 | g_warning ("%s: Actor '%s' is not inside a container", | ||
2590 | 13946 | G_STRFUNC, | ||
2591 | 13947 | _clutter_actor_get_debug_name (self)); | ||
2592 | 13948 | return; | ||
2593 | 13949 | } | ||
2594 | 13950 | |||
2595 | 13951 | if (below != NULL) | ||
2596 | 13952 | { | ||
2597 | 13953 | if (parent != clutter_actor_get_parent (below)) | ||
2598 | 13954 | { | ||
2599 | 13955 | g_warning ("%s Actor '%s' is not in the same container as " | ||
2600 | 13956 | "actor '%s'", | ||
2601 | 13957 | G_STRFUNC, | ||
2602 | 13958 | _clutter_actor_get_debug_name (self), | ||
2603 | 13959 | _clutter_actor_get_debug_name (below)); | ||
2604 | 13960 | return; | ||
2605 | 13961 | } | ||
2606 | 13962 | } | ||
2607 | 13963 | |||
2608 | 13964 | clutter_container_raise_child (CLUTTER_CONTAINER (parent), self, below); | ||
2609 | 13965 | } | ||
2610 | 13966 | |||
2611 | 13967 | /** | ||
2612 | 13968 | * clutter_actor_lower: | ||
2613 | 13969 | * @self: A #ClutterActor | ||
2614 | 13970 | * @above: (allow-none): A #ClutterActor to lower below | ||
2615 | 13971 | * | ||
2616 | 13972 | * Puts @self below @above. | ||
2617 | 13973 | * | ||
2618 | 13974 | * Both actors must have the same parent, and the parent must implement | ||
2619 | 13975 | * the #ClutterContainer interface. | ||
2620 | 13976 | * | ||
2621 | 13977 | * This function calls clutter_container_lower_child() internally. | ||
2622 | 13978 | * | ||
2623 | 13979 | * Deprecated: 1.10: Use clutter_actor_set_child_below_sibling() instead. | ||
2624 | 13980 | */ | ||
2625 | 13981 | void | ||
2626 | 13982 | clutter_actor_lower (ClutterActor *self, | ||
2627 | 13983 | ClutterActor *above) | ||
2628 | 13984 | { | ||
2629 | 13985 | ClutterActor *parent; | ||
2630 | 13986 | |||
2631 | 13987 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | ||
2632 | 13988 | |||
2633 | 13989 | parent = clutter_actor_get_parent (self); | ||
2634 | 13990 | if (parent == NULL) | ||
2635 | 13991 | { | ||
2636 | 13992 | g_warning ("%s: Actor of type %s is not inside a container", | ||
2637 | 13993 | G_STRFUNC, | ||
2638 | 13994 | _clutter_actor_get_debug_name (self)); | ||
2639 | 13995 | return; | ||
2640 | 13996 | } | ||
2641 | 13997 | |||
2642 | 13998 | if (above) | ||
2643 | 13999 | { | ||
2644 | 14000 | if (parent != clutter_actor_get_parent (above)) | ||
2645 | 14001 | { | ||
2646 | 14002 | g_warning ("%s: Actor '%s' is not in the same container as " | ||
2647 | 14003 | "actor '%s'", | ||
2648 | 14004 | G_STRFUNC, | ||
2649 | 14005 | _clutter_actor_get_debug_name (self), | ||
2650 | 14006 | _clutter_actor_get_debug_name (above)); | ||
2651 | 14007 | return; | ||
2652 | 14008 | } | ||
2653 | 14009 | } | ||
2654 | 14010 | |||
2655 | 14011 | clutter_container_lower_child (CLUTTER_CONTAINER (parent), self, above); | ||
2656 | 14012 | } | ||
2657 | 14013 | |||
2658 | 14014 | /** | ||
2659 | 14015 | * clutter_actor_raise_top: | ||
2660 | 14016 | * @self: A #ClutterActor | ||
2661 | 14017 | * | ||
2662 | 14018 | * Raises @self to the top. | ||
2663 | 14019 | * | ||
2664 | 14020 | * This function calls clutter_actor_raise() internally. | ||
2665 | 14021 | * | ||
2666 | 14022 | * Deprecated: 1.10: Use clutter_actor_set_child_above_sibling() with | ||
2667 | 14023 | * a %NULL sibling, instead. | ||
2668 | 14024 | */ | ||
2669 | 14025 | void | ||
2670 | 14026 | clutter_actor_raise_top (ClutterActor *self) | ||
2671 | 14027 | { | ||
2672 | 14028 | clutter_actor_raise (self, NULL); | ||
2673 | 14029 | } | ||
2674 | 14030 | |||
2675 | 14031 | /** | ||
2676 | 14032 | * clutter_actor_lower_bottom: | ||
2677 | 14033 | * @self: A #ClutterActor | ||
2678 | 14034 | * | ||
2679 | 14035 | * Lowers @self to the bottom. | ||
2680 | 14036 | * | ||
2681 | 14037 | * This function calls clutter_actor_lower() internally. | ||
2682 | 14038 | * | ||
2683 | 14039 | * Deprecated: 1.10: Use clutter_actor_set_child_below_sibling() with | ||
2684 | 14040 | * a %NULL sibling, instead. | ||
2685 | 14041 | */ | ||
2686 | 14042 | void | ||
2687 | 14043 | clutter_actor_lower_bottom (ClutterActor *self) | ||
2688 | 14044 | { | ||
2689 | 14045 | clutter_actor_lower (self, NULL); | ||
2690 | 14046 | } | ||
2691 | 14047 | |||
2692 | 14048 | /* | 13844 | /* |
2693 | 14049 | * Event handling | 13845 | * Event handling |
2694 | 14050 | */ | 13846 | */ |
2695 | @@ -14188,34 +13984,6 @@ clutter_actor_get_reactive (ClutterActor *actor) | |||
2696 | 14188 | } | 13984 | } |
2697 | 14189 | 13985 | ||
2698 | 14190 | /** | 13986 | /** |
2699 | 14191 | * clutter_actor_get_anchor_point: | ||
2700 | 14192 | * @self: a #ClutterActor | ||
2701 | 14193 | * @anchor_x: (out): return location for the X coordinate of the anchor point | ||
2702 | 14194 | * @anchor_y: (out): return location for the Y coordinate of the anchor point | ||
2703 | 14195 | * | ||
2704 | 14196 | * Gets the current anchor point of the @actor in pixels. | ||
2705 | 14197 | * | ||
2706 | 14198 | * Since: 0.6 | ||
2707 | 14199 | * | ||
2708 | 14200 | * Deprecated: 1.12: Use #ClutterActor:pivot-point instead | ||
2709 | 14201 | */ | ||
2710 | 14202 | void | ||
2711 | 14203 | clutter_actor_get_anchor_point (ClutterActor *self, | ||
2712 | 14204 | gfloat *anchor_x, | ||
2713 | 14205 | gfloat *anchor_y) | ||
2714 | 14206 | { | ||
2715 | 14207 | const ClutterTransformInfo *info; | ||
2716 | 14208 | |||
2717 | 14209 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | ||
2718 | 14210 | |||
2719 | 14211 | info = _clutter_actor_get_transform_info_or_defaults (self); | ||
2720 | 14212 | clutter_anchor_coord_get_units (self, &info->anchor, | ||
2721 | 14213 | anchor_x, | ||
2722 | 14214 | anchor_y, | ||
2723 | 14215 | NULL); | ||
2724 | 14216 | } | ||
2725 | 14217 | |||
2726 | 14218 | /** | ||
2727 | 14219 | * clutter_actor_set_anchor_point: | 13987 | * clutter_actor_set_anchor_point: |
2728 | 14220 | * @self: a #ClutterActor | 13988 | * @self: a #ClutterActor |
2729 | 14221 | * @anchor_x: X coordinate of the anchor point | 13989 | * @anchor_x: X coordinate of the anchor point |
2730 | @@ -14729,40 +14497,6 @@ parse_actor_metas (ClutterScript *script, | |||
2731 | 14729 | return g_slist_reverse (retval); | 14497 | return g_slist_reverse (retval); |
2732 | 14730 | } | 14498 | } |
2733 | 14731 | 14499 | ||
2734 | 14732 | static GSList * | ||
2735 | 14733 | parse_behaviours (ClutterScript *script, | ||
2736 | 14734 | ClutterActor *actor, | ||
2737 | 14735 | JsonNode *node) | ||
2738 | 14736 | { | ||
2739 | 14737 | GList *elements, *l; | ||
2740 | 14738 | GSList *retval = NULL; | ||
2741 | 14739 | |||
2742 | 14740 | if (!JSON_NODE_HOLDS_ARRAY (node)) | ||
2743 | 14741 | return NULL; | ||
2744 | 14742 | |||
2745 | 14743 | elements = json_array_get_elements (json_node_get_array (node)); | ||
2746 | 14744 | |||
2747 | 14745 | for (l = elements; l != NULL; l = l->next) | ||
2748 | 14746 | { | ||
2749 | 14747 | JsonNode *element = l->data; | ||
2750 | 14748 | const gchar *id_ = _clutter_script_get_id_from_node (element); | ||
2751 | 14749 | GObject *behaviour; | ||
2752 | 14750 | |||
2753 | 14751 | if (id_ == NULL || *id_ == '\0') | ||
2754 | 14752 | continue; | ||
2755 | 14753 | |||
2756 | 14754 | behaviour = clutter_script_get_object (script, id_); | ||
2757 | 14755 | if (behaviour == NULL) | ||
2758 | 14756 | continue; | ||
2759 | 14757 | |||
2760 | 14758 | retval = g_slist_prepend (retval, behaviour); | ||
2761 | 14759 | } | ||
2762 | 14760 | |||
2763 | 14761 | g_list_free (elements); | ||
2764 | 14762 | |||
2765 | 14763 | return g_slist_reverse (retval); | ||
2766 | 14764 | } | ||
2767 | 14765 | |||
2768 | 14766 | static ClutterMargin * | 14500 | static ClutterMargin * |
2769 | 14767 | parse_margin (ClutterActor *self, | 14501 | parse_margin (ClutterActor *self, |
2770 | 14768 | JsonNode *node) | 14502 | JsonNode *node) |
2771 | @@ -14878,24 +14612,6 @@ clutter_actor_parse_custom_node (ClutterScriptable *scriptable, | |||
2772 | 14878 | else | 14612 | else |
2773 | 14879 | g_slice_free (RotationInfo, info); | 14613 | g_slice_free (RotationInfo, info); |
2774 | 14880 | } | 14614 | } |
2775 | 14881 | else if (strcmp (name, "behaviours") == 0) | ||
2776 | 14882 | { | ||
2777 | 14883 | GSList *l; | ||
2778 | 14884 | |||
2779 | 14885 | #ifdef CLUTTER_ENABLE_DEBUG | ||
2780 | 14886 | if (G_UNLIKELY (_clutter_diagnostic_enabled ())) | ||
2781 | 14887 | _clutter_diagnostic_message ("The 'behaviours' key is deprecated " | ||
2782 | 14888 | "and it should not be used in newly " | ||
2783 | 14889 | "written ClutterScript definitions."); | ||
2784 | 14890 | #endif | ||
2785 | 14891 | |||
2786 | 14892 | l = parse_behaviours (script, actor, node); | ||
2787 | 14893 | |||
2788 | 14894 | g_value_init (value, G_TYPE_POINTER); | ||
2789 | 14895 | g_value_set_pointer (value, l); | ||
2790 | 14896 | |||
2791 | 14897 | retval = TRUE; | ||
2792 | 14898 | } | ||
2793 | 14899 | else if (strcmp (name, "actions") == 0 || | 14615 | else if (strcmp (name, "actions") == 0 || |
2794 | 14900 | strcmp (name, "constraints") == 0 || | 14616 | strcmp (name, "constraints") == 0 || |
2795 | 14901 | strcmp (name, "effects") == 0) | 14617 | strcmp (name, "effects") == 0) |
2796 | @@ -14966,26 +14682,6 @@ clutter_actor_set_custom_property (ClutterScriptable *scriptable, | |||
2797 | 14966 | return; | 14682 | return; |
2798 | 14967 | } | 14683 | } |
2799 | 14968 | 14684 | ||
2800 | 14969 | if (strcmp (name, "behaviours") == 0) | ||
2801 | 14970 | { | ||
2802 | 14971 | GSList *behaviours, *l; | ||
2803 | 14972 | |||
2804 | 14973 | if (!G_VALUE_HOLDS (value, G_TYPE_POINTER)) | ||
2805 | 14974 | return; | ||
2806 | 14975 | |||
2807 | 14976 | behaviours = g_value_get_pointer (value); | ||
2808 | 14977 | for (l = behaviours; l != NULL; l = l->next) | ||
2809 | 14978 | { | ||
2810 | 14979 | ClutterBehaviour *behaviour = l->data; | ||
2811 | 14980 | |||
2812 | 14981 | clutter_behaviour_apply (behaviour, actor); | ||
2813 | 14982 | } | ||
2814 | 14983 | |||
2815 | 14984 | g_slist_free (behaviours); | ||
2816 | 14985 | |||
2817 | 14986 | return; | ||
2818 | 14987 | } | ||
2819 | 14988 | |||
2820 | 14989 | if (strcmp (name, "actions") == 0 || | 14685 | if (strcmp (name, "actions") == 0 || |
2821 | 14990 | strcmp (name, "constraints") == 0 || | 14686 | strcmp (name, "constraints") == 0 || |
2822 | 14991 | strcmp (name, "effects") == 0) | 14687 | strcmp (name, "effects") == 0) |
2823 | @@ -15409,7 +15105,7 @@ clutter_actor_transform_stage_point (ClutterActor *self, | |||
2824 | 15409 | gfloat *x_out, | 15105 | gfloat *x_out, |
2825 | 15410 | gfloat *y_out) | 15106 | gfloat *y_out) |
2826 | 15411 | { | 15107 | { |
2828 | 15412 | ClutterVertex v[4]; | 15108 | graphene_point3d_t v[4]; |
2829 | 15413 | double ST[3][3]; | 15109 | double ST[3][3]; |
2830 | 15414 | double RQ[3][3]; | 15110 | double RQ[3][3]; |
2831 | 15415 | int du, dv; | 15111 | int du, dv; |
2832 | @@ -16047,7 +15743,7 @@ update_pango_context (ClutterBackend *backend, | |||
2833 | 16047 | * stored by the #ClutterBackend change. | 15743 | * stored by the #ClutterBackend change. |
2834 | 16048 | * | 15744 | * |
2835 | 16049 | * You can use the returned #PangoContext to create a #PangoLayout | 15745 | * You can use the returned #PangoContext to create a #PangoLayout |
2837 | 16050 | * and render text using cogl_pango_render_layout() to reuse the | 15746 | * and render text using cogl_pango_show_layout() to reuse the |
2838 | 16051 | * glyphs cache also used by Clutter. | 15747 | * glyphs cache also used by Clutter. |
2839 | 16052 | * | 15748 | * |
2840 | 16053 | * Return value: (transfer none): the #PangoContext for a #ClutterActor. | 15749 | * Return value: (transfer none): the #PangoContext for a #ClutterActor. |
2841 | @@ -16546,25 +16242,6 @@ clutter_actor_unset_flags (ClutterActor *self, | |||
2842 | 16546 | g_object_thaw_notify (obj); | 16242 | g_object_thaw_notify (obj); |
2843 | 16547 | } | 16243 | } |
2844 | 16548 | 16244 | ||
2845 | 16549 | /** | ||
2846 | 16550 | * clutter_actor_get_transformation_matrix: | ||
2847 | 16551 | * @self: a #ClutterActor | ||
2848 | 16552 | * @matrix: (out caller-allocates): the return location for a #ClutterMatrix | ||
2849 | 16553 | * | ||
2850 | 16554 | * Retrieves the transformations applied to @self relative to its | ||
2851 | 16555 | * parent. | ||
2852 | 16556 | * | ||
2853 | 16557 | * Since: 1.0 | ||
2854 | 16558 | * | ||
2855 | 16559 | * Deprecated: 1.12: Use clutter_actor_get_transform() instead | ||
2856 | 16560 | */ | ||
2857 | 16561 | void | ||
2858 | 16562 | clutter_actor_get_transformation_matrix (ClutterActor *self, | ||
2859 | 16563 | ClutterMatrix *matrix) | ||
2860 | 16564 | { | ||
2861 | 16565 | clutter_actor_get_transform (self, matrix); | ||
2862 | 16566 | } | ||
2863 | 16567 | |||
2864 | 16568 | static void | 16245 | static void |
2865 | 16569 | clutter_actor_set_transform_internal (ClutterActor *self, | 16246 | clutter_actor_set_transform_internal (ClutterActor *self, |
2866 | 16570 | const ClutterMatrix *transform) | 16247 | const ClutterMatrix *transform) |
2867 | @@ -16827,100 +16504,6 @@ clutter_actor_get_text_direction (ClutterActor *self) | |||
2868 | 16827 | } | 16504 | } |
2869 | 16828 | 16505 | ||
2870 | 16829 | /** | 16506 | /** |
2871 | 16830 | * clutter_actor_push_internal: | ||
2872 | 16831 | * @self: a #ClutterActor | ||
2873 | 16832 | * | ||
2874 | 16833 | * Should be used by actors implementing the #ClutterContainer and with | ||
2875 | 16834 | * internal children added through clutter_actor_set_parent(), for instance: | ||
2876 | 16835 | * | ||
2877 | 16836 | * |[<!-- language="C" --> | ||
2878 | 16837 | * static void | ||
2879 | 16838 | * my_actor_init (MyActor *self) | ||
2880 | 16839 | * { | ||
2881 | 16840 | * self->priv = my_actor_get_instance_private (self); | ||
2882 | 16841 | * | ||
2883 | 16842 | * clutter_actor_push_internal (CLUTTER_ACTOR (self)); | ||
2884 | 16843 | * | ||
2885 | 16844 | * // calling clutter_actor_set_parent() now will result in | ||
2886 | 16845 | * // the internal flag being set on a child of MyActor | ||
2887 | 16846 | * | ||
2888 | 16847 | * // internal child - a background texture | ||
2889 | 16848 | * self->priv->background_tex = clutter_texture_new (); | ||
2890 | 16849 | * clutter_actor_set_parent (self->priv->background_tex, | ||
2891 | 16850 | * CLUTTER_ACTOR (self)); | ||
2892 | 16851 | * | ||
2893 | 16852 | * // internal child - a label | ||
2894 | 16853 | * self->priv->label = clutter_text_new (); | ||
2895 | 16854 | * clutter_actor_set_parent (self->priv->label, | ||
2896 | 16855 | * CLUTTER_ACTOR (self)); | ||
2897 | 16856 | * | ||
2898 | 16857 | * clutter_actor_pop_internal (CLUTTER_ACTOR (self)); | ||
2899 | 16858 | * | ||
2900 | 16859 | * // calling clutter_actor_set_parent() now will not result in | ||
2901 | 16860 | * // the internal flag being set on a child of MyActor | ||
2902 | 16861 | * } | ||
2903 | 16862 | * ]| | ||
2904 | 16863 | * | ||
2905 | 16864 | * This function will be used by Clutter to toggle an "internal child" | ||
2906 | 16865 | * flag whenever clutter_actor_set_parent() is called; internal children | ||
2907 | 16866 | * are handled differently by Clutter, specifically when destroying their | ||
2908 | 16867 | * parent. | ||
2909 | 16868 | * | ||
2910 | 16869 | * Call clutter_actor_pop_internal() when you finished adding internal | ||
2911 | 16870 | * children. | ||
2912 | 16871 | * | ||
2913 | 16872 | * Nested calls to clutter_actor_push_internal() are allowed, but each | ||
2914 | 16873 | * one must by followed by a clutter_actor_pop_internal() call. | ||
2915 | 16874 | * | ||
2916 | 16875 | * Since: 1.2 | ||
2917 | 16876 | * | ||
2918 | 16877 | * Deprecated: 1.10: All children of an actor are accessible through | ||
2919 | 16878 | * the #ClutterActor API, and #ClutterActor implements the | ||
2920 | 16879 | * #ClutterContainer interface, so this function is only useful | ||
2921 | 16880 | * for legacy containers overriding the default implementation. | ||
2922 | 16881 | */ | ||
2923 | 16882 | void | ||
2924 | 16883 | clutter_actor_push_internal (ClutterActor *self) | ||
2925 | 16884 | { | ||
2926 | 16885 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | ||
2927 | 16886 | |||
2928 | 16887 | self->priv->internal_child += 1; | ||
2929 | 16888 | } | ||
2930 | 16889 | |||
2931 | 16890 | /** | ||
2932 | 16891 | * clutter_actor_pop_internal: | ||
2933 | 16892 | * @self: a #ClutterActor | ||
2934 | 16893 | * | ||
2935 | 16894 | * Disables the effects of clutter_actor_push_internal(). | ||
2936 | 16895 | * | ||
2937 | 16896 | * Since: 1.2 | ||
2938 | 16897 | * | ||
2939 | 16898 | * Deprecated: 1.10: All children of an actor are accessible through | ||
2940 | 16899 | * the #ClutterActor API. This function is only useful for legacy | ||
2941 | 16900 | * containers overriding the default implementation of the | ||
2942 | 16901 | * #ClutterContainer interface. | ||
2943 | 16902 | */ | ||
2944 | 16903 | void | ||
2945 | 16904 | clutter_actor_pop_internal (ClutterActor *self) | ||
2946 | 16905 | { | ||
2947 | 16906 | ClutterActorPrivate *priv; | ||
2948 | 16907 | |||
2949 | 16908 | g_return_if_fail (CLUTTER_IS_ACTOR (self)); | ||
2950 | 16909 | |||
2951 | 16910 | priv = self->priv; | ||
2952 | 16911 | |||
2953 | 16912 | if (priv->internal_child == 0) | ||
2954 | 16913 | { | ||
2955 | 16914 | g_warning ("Mismatched %s: you need to call " | ||
2956 | 16915 | "clutter_actor_push_composite() at least once before " | ||
2957 | 16916 | "calling this function", G_STRFUNC); | ||
2958 | 16917 | return; | ||
2959 | 16918 | } | ||
2960 | 16919 | |||
2961 | 16920 | priv->internal_child -= 1; | ||
2962 | 16921 | } | ||
2963 | 16922 | |||
2964 | 16923 | /** | ||
2965 | 16924 | * clutter_actor_has_pointer: | 16507 | * clutter_actor_has_pointer: |
2966 | 16925 | * @self: a #ClutterActor | 16508 | * @self: a #ClutterActor |
2967 | 16926 | * | 16509 | * |
2968 | @@ -17979,9 +17562,9 @@ clutter_actor_get_paint_box (ClutterActor *self, | |||
2969 | 17979 | } | 17562 | } |
2970 | 17980 | 17563 | ||
2971 | 17981 | static gboolean | 17564 | static gboolean |
2975 | 17982 | _clutter_actor_get_resource_scale_for_rect (ClutterActor *self, | 17565 | _clutter_actor_get_resource_scale_for_rect (ClutterActor *self, |
2976 | 17983 | ClutterRect *bounding_rect, | 17566 | graphene_rect_t *bounding_rect, |
2977 | 17984 | float *resource_scale) | 17567 | float *resource_scale) |
2978 | 17985 | { | 17568 | { |
2979 | 17986 | ClutterActor *stage; | 17569 | ClutterActor *stage; |
2980 | 17987 | float max_scale = 0; | 17570 | float max_scale = 0; |
2981 | @@ -18004,7 +17587,7 @@ static gboolean | |||
2982 | 18004 | _clutter_actor_compute_resource_scale (ClutterActor *self, | 17587 | _clutter_actor_compute_resource_scale (ClutterActor *self, |
2983 | 18005 | float *resource_scale) | 17588 | float *resource_scale) |
2984 | 18006 | { | 17589 | { |
2986 | 18007 | ClutterRect bounding_rect; | 17590 | graphene_rect_t bounding_rect; |
2987 | 18008 | ClutterActorPrivate *priv = self->priv; | 17591 | ClutterActorPrivate *priv = self->priv; |
2988 | 18009 | 17592 | ||
2989 | 18010 | if (CLUTTER_ACTOR_IN_DESTRUCTION (self) || | 17593 | if (CLUTTER_ACTOR_IN_DESTRUCTION (self) || |
2990 | @@ -18548,13 +18131,13 @@ clutter_actor_get_layout_manager (ClutterActor *self) | |||
2991 | 18548 | } | 18131 | } |
2992 | 18549 | 18132 | ||
2993 | 18550 | static const ClutterLayoutInfo default_layout_info = { | 18133 | static const ClutterLayoutInfo default_layout_info = { |
2995 | 18551 | CLUTTER_POINT_INIT_ZERO, /* fixed-pos */ | 18134 | GRAPHENE_POINT_INIT_ZERO, /* fixed-pos */ |
2996 | 18552 | { 0, 0, 0, 0 }, /* margin */ | 18135 | { 0, 0, 0, 0 }, /* margin */ |
2997 | 18553 | CLUTTER_ACTOR_ALIGN_FILL, /* x-align */ | 18136 | CLUTTER_ACTOR_ALIGN_FILL, /* x-align */ |
2998 | 18554 | CLUTTER_ACTOR_ALIGN_FILL, /* y-align */ | 18137 | CLUTTER_ACTOR_ALIGN_FILL, /* y-align */ |
2999 | 18555 | FALSE, FALSE, /* expand */ | 18138 | FALSE, FALSE, /* expand */ |
3002 | 18556 | CLUTTER_SIZE_INIT_ZERO, /* minimum */ | 18139 | GRAPHENE_SIZE_INIT_ZERO, /* minimum */ |
3003 | 18557 | CLUTTER_SIZE_INIT_ZERO, /* natural */ | 18140 | GRAPHENE_SIZE_INIT_ZERO, /* natural */ |
3004 | 18558 | }; | 18141 | }; |
3005 | 18559 | 18142 | ||
3006 | 18560 | static void | 18143 | static void |
3007 | @@ -19500,7 +19083,7 @@ transition_closure_free (gpointer data) | |||
3008 | 19500 | * so that we don't end up inside on_transition_stopped() from | 19083 | * so that we don't end up inside on_transition_stopped() from |
3009 | 19501 | * a call to g_hash_table_remove(). | 19084 | * a call to g_hash_table_remove(). |
3010 | 19502 | */ | 19085 | */ |
3012 | 19503 | g_signal_handler_disconnect (clos->transition, clos->completed_id); | 19086 | g_clear_signal_handler (&clos->completed_id, clos->transition); |
3013 | 19504 | 19087 | ||
3014 | 19505 | if (clutter_timeline_is_playing (timeline)) | 19088 | if (clutter_timeline_is_playing (timeline)) |
3015 | 19506 | clutter_timeline_stop (timeline); | 19089 | clutter_timeline_stop (timeline); |
3016 | @@ -19682,8 +19265,8 @@ _clutter_actor_create_transition (ClutterActor *actor, | |||
3017 | 19682 | gboolean call_restore = FALSE; | 19265 | gboolean call_restore = FALSE; |
3018 | 19683 | TransitionClosure *clos; | 19266 | TransitionClosure *clos; |
3019 | 19684 | va_list var_args; | 19267 | va_list var_args; |
3022 | 19685 | GValue initial = G_VALUE_INIT; | 19268 | g_auto (GValue) initial = G_VALUE_INIT; |
3023 | 19686 | GValue final = G_VALUE_INIT; | 19269 | g_auto (GValue) final = G_VALUE_INIT; |
3024 | 19687 | GType ptype; | 19270 | GType ptype; |
3025 | 19688 | char *error; | 19271 | char *error; |
3026 | 19689 | 19272 | ||
3027 | @@ -19732,7 +19315,6 @@ _clutter_actor_create_transition (ClutterActor *actor, | |||
3028 | 19732 | if (error != NULL) | 19315 | if (error != NULL) |
3029 | 19733 | { | 19316 | { |
3030 | 19734 | g_critical ("%s: %s", G_STRLOC, error); | 19317 | g_critical ("%s: %s", G_STRLOC, error); |
3031 | 19735 | g_value_unset (&initial); | ||
3032 | 19736 | g_free (error); | 19318 | g_free (error); |
3033 | 19737 | goto out; | 19319 | goto out; |
3034 | 19738 | } | 19320 | } |
3035 | @@ -19754,9 +19336,6 @@ _clutter_actor_create_transition (ClutterActor *actor, | |||
3036 | 19754 | &final, | 19336 | &final, |
3037 | 19755 | pspec); | 19337 | pspec); |
3038 | 19756 | 19338 | ||
3039 | 19757 | g_value_unset (&initial); | ||
3040 | 19758 | g_value_unset (&final); | ||
3041 | 19759 | |||
3042 | 19760 | goto out; | 19339 | goto out; |
3043 | 19761 | } | 19340 | } |
3044 | 19762 | 19341 | ||
3045 | @@ -19804,9 +19383,6 @@ _clutter_actor_create_transition (ClutterActor *actor, | |||
3046 | 19804 | 19383 | ||
3047 | 19805 | /* the actor now owns the transition */ | 19384 | /* the actor now owns the transition */ |
3048 | 19806 | g_object_unref (res); | 19385 | g_object_unref (res); |
3049 | 19807 | |||
3050 | 19808 | g_value_unset (&initial); | ||
3051 | 19809 | g_value_unset (&final); | ||
3052 | 19810 | } | 19386 | } |
3053 | 19811 | else | 19387 | else |
3054 | 19812 | { | 19388 | { |
3055 | @@ -21293,32 +20869,6 @@ clutter_actor_has_mapped_clones (ClutterActor *self) | |||
3056 | 21293 | return FALSE; | 20869 | return FALSE; |
3057 | 21294 | } | 20870 | } |
3058 | 21295 | 20871 | ||
3059 | 21296 | CoglFramebuffer * | ||
3060 | 21297 | _clutter_actor_get_active_framebuffer (ClutterActor *self) | ||
3061 | 21298 | { | ||
3062 | 21299 | ClutterStage *stage; | ||
3063 | 21300 | |||
3064 | 21301 | if (!CLUTTER_ACTOR_IN_PAINT (self)) | ||
3065 | 21302 | { | ||
3066 | 21303 | g_critical ("The active framebuffer of actor '%s' can only be " | ||
3067 | 21304 | "retrieved during the paint sequence. Please, check " | ||
3068 | 21305 | "your code.", | ||
3069 | 21306 | _clutter_actor_get_debug_name (self)); | ||
3070 | 21307 | return NULL; | ||
3071 | 21308 | } | ||
3072 | 21309 | |||
3073 | 21310 | stage = (ClutterStage *) _clutter_actor_get_stage_internal (self); | ||
3074 | 21311 | if (stage == NULL) | ||
3075 | 21312 | { | ||
3076 | 21313 | g_critical ("The active framebuffer of actor '%s' is only available " | ||
3077 | 21314 | "if the actor is associated to a ClutterStage.", | ||
3078 | 21315 | _clutter_actor_get_debug_name (self)); | ||
3079 | 21316 | return NULL; | ||
3080 | 21317 | } | ||
3081 | 21318 | |||
3082 | 21319 | return _clutter_stage_get_active_framebuffer (stage); | ||
3083 | 21320 | } | ||
3084 | 21321 | |||
3085 | 21322 | static void | 20872 | static void |
3086 | 21323 | clutter_actor_child_model__items_changed (GListModel *model, | 20873 | clutter_actor_child_model__items_changed (GListModel *model, |
3087 | 21324 | guint position, | 20874 | guint position, |
3088 | diff --git a/clutter/clutter/clutter-actor.h b/clutter/clutter/clutter-actor.h | |||
3089 | index b1abff8..bb968dd 100644 | |||
3090 | --- a/clutter/clutter/clutter-actor.h | |||
3091 | +++ b/clutter/clutter/clutter-actor.h | |||
3092 | @@ -39,6 +39,8 @@ | |||
3093 | 39 | 39 | ||
3094 | 40 | #include <clutter/clutter-types.h> | 40 | #include <clutter/clutter-types.h> |
3095 | 41 | #include <clutter/clutter-event.h> | 41 | #include <clutter/clutter-event.h> |
3096 | 42 | #include <clutter/clutter-paint-context.h> | ||
3097 | 43 | #include <clutter/clutter-pick-context.h> | ||
3098 | 42 | 44 | ||
3099 | 43 | G_BEGIN_DECLS | 45 | G_BEGIN_DECLS |
3100 | 44 | 46 | ||
3101 | @@ -228,13 +230,14 @@ struct _ClutterActorClass | |||
3102 | 228 | void (* unrealize) (ClutterActor *self); | 230 | void (* unrealize) (ClutterActor *self); |
3103 | 229 | void (* map) (ClutterActor *self); | 231 | void (* map) (ClutterActor *self); |
3104 | 230 | void (* unmap) (ClutterActor *self); | 232 | void (* unmap) (ClutterActor *self); |
3106 | 231 | void (* paint) (ClutterActor *self); | 233 | void (* paint) (ClutterActor *self, |
3107 | 234 | ClutterPaintContext *paint_context); | ||
3108 | 232 | void (* parent_set) (ClutterActor *actor, | 235 | void (* parent_set) (ClutterActor *actor, |
3109 | 233 | ClutterActor *old_parent); | 236 | ClutterActor *old_parent); |
3110 | 234 | 237 | ||
3111 | 235 | void (* destroy) (ClutterActor *self); | 238 | void (* destroy) (ClutterActor *self); |
3112 | 236 | void (* pick) (ClutterActor *actor, | 239 | void (* pick) (ClutterActor *actor, |
3114 | 237 | const ClutterColor *color); | 240 | ClutterPickContext *pick_context); |
3115 | 238 | 241 | ||
3116 | 239 | gboolean (* queue_redraw) (ClutterActor *actor, | 242 | gboolean (* queue_redraw) (ClutterActor *actor, |
3117 | 240 | ClutterActor *leaf_that_queued, | 243 | ClutterActor *leaf_that_queued, |
3118 | @@ -350,9 +353,17 @@ void clutter_actor_map | |||
3119 | 350 | CLUTTER_EXPORT | 353 | CLUTTER_EXPORT |
3120 | 351 | void clutter_actor_unmap (ClutterActor *self); | 354 | void clutter_actor_unmap (ClutterActor *self); |
3121 | 352 | CLUTTER_EXPORT | 355 | CLUTTER_EXPORT |
3123 | 353 | void clutter_actor_paint (ClutterActor *self); | 356 | void clutter_actor_paint (ClutterActor *self, |
3124 | 357 | ClutterPaintContext *paint_context); | ||
3125 | 354 | CLUTTER_EXPORT | 358 | CLUTTER_EXPORT |
3127 | 355 | void clutter_actor_continue_paint (ClutterActor *self); | 359 | void clutter_actor_continue_paint (ClutterActor *self, |
3128 | 360 | ClutterPaintContext *paint_context); | ||
3129 | 361 | CLUTTER_EXPORT | ||
3130 | 362 | void clutter_actor_pick (ClutterActor *actor, | ||
3131 | 363 | ClutterPickContext *pick_context); | ||
3132 | 364 | CLUTTER_EXPORT | ||
3133 | 365 | void clutter_actor_continue_pick (ClutterActor *actor, | ||
3134 | 366 | ClutterPickContext *pick_context); | ||
3135 | 356 | CLUTTER_EXPORT | 367 | CLUTTER_EXPORT |
3136 | 357 | void clutter_actor_queue_redraw (ClutterActor *self); | 368 | void clutter_actor_queue_redraw (ClutterActor *self); |
3137 | 358 | CLUTTER_EXPORT | 369 | CLUTTER_EXPORT |
3138 | @@ -431,7 +442,7 @@ void clutter_actor_get_allocation_box | |||
3139 | 431 | CLUTTER_EXPORT | 442 | CLUTTER_EXPORT |
3140 | 432 | void clutter_actor_get_allocation_vertices (ClutterActor *self, | 443 | void clutter_actor_get_allocation_vertices (ClutterActor *self, |
3141 | 433 | ClutterActor *ancestor, | 444 | ClutterActor *ancestor, |
3143 | 434 | ClutterVertex verts[]); | 445 | graphene_point3d_t *verts); |
3144 | 435 | CLUTTER_EXPORT | 446 | CLUTTER_EXPORT |
3145 | 436 | gboolean clutter_actor_has_allocation (ClutterActor *self); | 447 | gboolean clutter_actor_has_allocation (ClutterActor *self); |
3146 | 437 | CLUTTER_EXPORT | 448 | CLUTTER_EXPORT |
3147 | @@ -817,16 +828,16 @@ gboolean clutter_actor_transform_stage_point | |||
3148 | 817 | gfloat *y_out); | 828 | gfloat *y_out); |
3149 | 818 | CLUTTER_EXPORT | 829 | CLUTTER_EXPORT |
3150 | 819 | void clutter_actor_get_abs_allocation_vertices (ClutterActor *self, | 830 | void clutter_actor_get_abs_allocation_vertices (ClutterActor *self, |
3152 | 820 | ClutterVertex verts[]); | 831 | graphene_point3d_t *verts); |
3153 | 821 | CLUTTER_EXPORT | 832 | CLUTTER_EXPORT |
3154 | 822 | void clutter_actor_apply_transform_to_point (ClutterActor *self, | 833 | void clutter_actor_apply_transform_to_point (ClutterActor *self, |
3157 | 823 | const ClutterVertex *point, | 834 | const graphene_point3d_t *point, |
3158 | 824 | ClutterVertex *vertex); | 835 | graphene_point3d_t *vertex); |
3159 | 825 | CLUTTER_EXPORT | 836 | CLUTTER_EXPORT |
3160 | 826 | void clutter_actor_apply_relative_transform_to_point (ClutterActor *self, | 837 | void clutter_actor_apply_relative_transform_to_point (ClutterActor *self, |
3161 | 827 | ClutterActor *ancestor, | 838 | ClutterActor *ancestor, |
3164 | 828 | const ClutterVertex *point, | 839 | const graphene_point3d_t *point, |
3165 | 829 | ClutterVertex *vertex); | 840 | graphene_point3d_t *vertex); |
3166 | 830 | 841 | ||
3167 | 831 | /* Implicit animations */ | 842 | /* Implicit animations */ |
3168 | 832 | CLUTTER_EXPORT | 843 | CLUTTER_EXPORT |
3169 | @@ -904,6 +915,7 @@ void clutter_actor_bind_model_with_properties | |||
3170 | 904 | 915 | ||
3171 | 905 | CLUTTER_EXPORT | 916 | CLUTTER_EXPORT |
3172 | 906 | void clutter_actor_pick_box (ClutterActor *self, | 917 | void clutter_actor_pick_box (ClutterActor *self, |
3173 | 918 | ClutterPickContext *pick_context, | ||
3174 | 907 | const ClutterActorBox *box); | 919 | const ClutterActorBox *box); |
3175 | 908 | 920 | ||
3176 | 909 | G_END_DECLS | 921 | G_END_DECLS |
3177 | diff --git a/clutter/clutter/clutter-animatable.c b/clutter/clutter/clutter-animatable.c | |||
3178 | index 0bb3409..e8c9511 100644 | |||
3179 | --- a/clutter/clutter/clutter-animatable.c | |||
3180 | +++ b/clutter/clutter/clutter-animatable.c | |||
3181 | @@ -54,7 +54,6 @@ | |||
3182 | 54 | #include "clutter-debug.h" | 54 | #include "clutter-debug.h" |
3183 | 55 | #include "clutter-private.h" | 55 | #include "clutter-private.h" |
3184 | 56 | 56 | ||
3185 | 57 | #include "deprecated/clutter-animatable.h" | ||
3186 | 58 | #include "deprecated/clutter-animation.h" | 57 | #include "deprecated/clutter-animation.h" |
3187 | 59 | 58 | ||
3188 | 60 | G_DEFINE_INTERFACE (ClutterAnimatable, clutter_animatable, G_TYPE_OBJECT); | 59 | G_DEFINE_INTERFACE (ClutterAnimatable, clutter_animatable, G_TYPE_OBJECT); |
3189 | @@ -65,80 +64,6 @@ clutter_animatable_default_init (ClutterAnimatableInterface *iface) | |||
3190 | 65 | } | 64 | } |
3191 | 66 | 65 | ||
3192 | 67 | /** | 66 | /** |
3193 | 68 | * clutter_animatable_animate_property: | ||
3194 | 69 | * @animatable: a #ClutterAnimatable | ||
3195 | 70 | * @animation: a #ClutterAnimation | ||
3196 | 71 | * @property_name: the name of the animated property | ||
3197 | 72 | * @initial_value: the initial value of the animation interval | ||
3198 | 73 | * @final_value: the final value of the animation interval | ||
3199 | 74 | * @progress: the progress factor | ||
3200 | 75 | * @value: return location for the animation value | ||
3201 | 76 | * | ||
3202 | 77 | * Calls the animate_property() virtual function for @animatable. | ||
3203 | 78 | * | ||
3204 | 79 | * The @initial_value and @final_value #GValue<!-- -->s must contain | ||
3205 | 80 | * the same type; @value must have been initialized to the same | ||
3206 | 81 | * type of @initial_value and @final_value. | ||
3207 | 82 | * | ||
3208 | 83 | * All implementation of the #ClutterAnimatable interface must | ||
3209 | 84 | * implement this function. | ||
3210 | 85 | * | ||
3211 | 86 | * Return value: %TRUE if the value has been validated and can | ||
3212 | 87 | * be applied to the #ClutterAnimatable, and %FALSE otherwise | ||
3213 | 88 | * | ||
3214 | 89 | * Since: 1.0 | ||
3215 | 90 | * | ||
3216 | 91 | * Deprecated: 1.8: Use clutter_animatable_interpolate_value() | ||
3217 | 92 | * instead | ||
3218 | 93 | */ | ||
3219 | 94 | gboolean | ||
3220 | 95 | clutter_animatable_animate_property (ClutterAnimatable *animatable, | ||
3221 | 96 | ClutterAnimation *animation, | ||
3222 | 97 | const gchar *property_name, | ||
3223 | 98 | const GValue *initial_value, | ||
3224 | 99 | const GValue *final_value, | ||
3225 | 100 | gdouble progress, | ||
3226 | 101 | GValue *value) | ||
3227 | 102 | { | ||
3228 | 103 | ClutterAnimatableInterface *iface; | ||
3229 | 104 | gboolean res; | ||
3230 | 105 | |||
3231 | 106 | g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE); | ||
3232 | 107 | g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), FALSE); | ||
3233 | 108 | g_return_val_if_fail (property_name != NULL, FALSE); | ||
3234 | 109 | g_return_val_if_fail (initial_value != NULL && final_value != NULL, FALSE); | ||
3235 | 110 | g_return_val_if_fail (G_VALUE_TYPE (initial_value) != G_TYPE_INVALID, FALSE); | ||
3236 | 111 | g_return_val_if_fail (G_VALUE_TYPE (final_value) != G_TYPE_INVALID, FALSE); | ||
3237 | 112 | g_return_val_if_fail (value != NULL, FALSE); | ||
3238 | 113 | g_return_val_if_fail (G_VALUE_TYPE (value) == G_VALUE_TYPE (initial_value) && | ||
3239 | 114 | G_VALUE_TYPE (value) == G_VALUE_TYPE (final_value), | ||
3240 | 115 | FALSE); | ||
3241 | 116 | |||
3242 | 117 | iface = CLUTTER_ANIMATABLE_GET_IFACE (animatable); | ||
3243 | 118 | if (iface->animate_property == NULL) | ||
3244 | 119 | { | ||
3245 | 120 | ClutterInterval *interval; | ||
3246 | 121 | |||
3247 | 122 | interval = clutter_animation_get_interval (animation, property_name); | ||
3248 | 123 | if (interval == NULL) | ||
3249 | 124 | return FALSE; | ||
3250 | 125 | |||
3251 | 126 | res = clutter_animatable_interpolate_value (animatable, property_name, | ||
3252 | 127 | interval, | ||
3253 | 128 | progress, | ||
3254 | 129 | value); | ||
3255 | 130 | } | ||
3256 | 131 | else | ||
3257 | 132 | res = iface->animate_property (animatable, animation, | ||
3258 | 133 | property_name, | ||
3259 | 134 | initial_value, final_value, | ||
3260 | 135 | progress, | ||
3261 | 136 | value); | ||
3262 | 137 | |||
3263 | 138 | return res; | ||
3264 | 139 | } | ||
3265 | 140 | |||
3266 | 141 | /** | ||
3267 | 142 | * clutter_animatable_find_property: | 67 | * clutter_animatable_find_property: |
3268 | 143 | * @animatable: a #ClutterAnimatable | 68 | * @animatable: a #ClutterAnimatable |
3269 | 144 | * @property_name: the name of the animatable property to find | 69 | * @property_name: the name of the animatable property to find |
3270 | diff --git a/clutter/clutter/clutter-autocleanups.h b/clutter/clutter/clutter-autocleanups.h | |||
3271 | index 0a68c05..8e17d00 100644 | |||
3272 | --- a/clutter/clutter/clutter-autocleanups.h | |||
3273 | +++ b/clutter/clutter/clutter-autocleanups.h | |||
3274 | @@ -90,13 +90,10 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActorBox, clutter_actor_box_free) | |||
3275 | 90 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterColor, clutter_color_free) | 90 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterColor, clutter_color_free) |
3276 | 91 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterMargin, clutter_margin_free) | 91 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterMargin, clutter_margin_free) |
3277 | 92 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterMatrix, clutter_matrix_free) | 92 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterMatrix, clutter_matrix_free) |
3278 | 93 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintContext, clutter_paint_context_unref) | ||
3279 | 93 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintNode, clutter_paint_node_unref) | 94 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintNode, clutter_paint_node_unref) |
3280 | 94 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintVolume, clutter_paint_volume_free) | 95 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintVolume, clutter_paint_volume_free) |
3281 | 95 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPathNode, clutter_path_node_free) | 96 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPathNode, clutter_path_node_free) |
3282 | 96 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPoint, clutter_point_free) | ||
3283 | 97 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterRect, clutter_rect_free) | ||
3284 | 98 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterSize, clutter_size_free) | ||
3285 | 99 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterVertex, clutter_vertex_free) | ||
3286 | 100 | 97 | ||
3287 | 101 | #endif /* __GI_SCANNER__ */ | 98 | #endif /* __GI_SCANNER__ */ |
3288 | 102 | 99 | ||
3289 | diff --git a/clutter/clutter/clutter-backend-private.h b/clutter/clutter/clutter-backend-private.h | |||
3290 | index f0855e1..c7c54f8 100644 | |||
3291 | --- a/clutter/clutter/clutter-backend-private.h | |||
3292 | +++ b/clutter/clutter/clutter-backend-private.h | |||
3293 | @@ -23,8 +23,7 @@ | |||
3294 | 23 | #define __CLUTTER_BACKEND_PRIVATE_H__ | 23 | #define __CLUTTER_BACKEND_PRIVATE_H__ |
3295 | 24 | 24 | ||
3296 | 25 | #include <clutter/clutter-backend.h> | 25 | #include <clutter/clutter-backend.h> |
3299 | 26 | #include <clutter/clutter-device-manager.h> | 26 | #include <clutter/clutter-seat.h> |
3298 | 27 | #include <clutter/clutter-keymap.h> | ||
3300 | 28 | #include <clutter/clutter-stage-window.h> | 27 | #include <clutter/clutter-stage-window.h> |
3301 | 29 | 28 | ||
3302 | 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)) |
3303 | @@ -47,8 +46,6 @@ struct _ClutterBackend | |||
3304 | 47 | 46 | ||
3305 | 48 | CoglOnscreen *dummy_onscreen; | 47 | CoglOnscreen *dummy_onscreen; |
3306 | 49 | 48 | ||
3307 | 50 | ClutterDeviceManager *device_manager; | ||
3308 | 51 | |||
3309 | 52 | cairo_font_options_t *font_options; | 49 | cairo_font_options_t *font_options; |
3310 | 53 | 50 | ||
3311 | 54 | gchar *font_name; | 51 | gchar *font_name; |
3312 | @@ -59,8 +56,6 @@ struct _ClutterBackend | |||
3313 | 59 | ClutterStageWindow *stage_window; | 56 | ClutterStageWindow *stage_window; |
3314 | 60 | 57 | ||
3315 | 61 | ClutterInputMethod *input_method; | 58 | ClutterInputMethod *input_method; |
3316 | 62 | |||
3317 | 63 | ClutterKeymap *keymap; | ||
3318 | 64 | }; | 59 | }; |
3319 | 65 | 60 | ||
3320 | 66 | struct _ClutterBackendClass | 61 | struct _ClutterBackendClass |
3321 | @@ -89,17 +84,12 @@ struct _ClutterBackendClass | |||
3322 | 89 | GError **error); | 84 | GError **error); |
3323 | 90 | gboolean (* create_context) (ClutterBackend *backend, | 85 | gboolean (* create_context) (ClutterBackend *backend, |
3324 | 91 | GError **error); | 86 | GError **error); |
3325 | 92 | ClutterDeviceManager *(* get_device_manager) (ClutterBackend *backend); | ||
3326 | 93 | 87 | ||
3327 | 94 | gboolean (* translate_event) (ClutterBackend *backend, | 88 | gboolean (* translate_event) (ClutterBackend *backend, |
3328 | 95 | gpointer native, | 89 | gpointer native, |
3329 | 96 | ClutterEvent *event); | 90 | ClutterEvent *event); |
3330 | 97 | 91 | ||
3336 | 98 | PangoDirection (* get_keymap_direction) (ClutterBackend *backend); | 92 | ClutterSeat * (* get_default_seat) (ClutterBackend *backend); |
3332 | 99 | |||
3333 | 100 | void (* bell_notify) (ClutterBackend *backend); | ||
3334 | 101 | |||
3335 | 102 | ClutterKeymap * (* get_keymap) (ClutterBackend *backend); | ||
3337 | 103 | 93 | ||
3338 | 104 | /* signals */ | 94 | /* signals */ |
3339 | 105 | void (* resolution_changed) (ClutterBackend *backend); | 95 | void (* resolution_changed) (ClutterBackend *backend); |
3340 | @@ -139,11 +129,6 @@ gfloat _clutter_backend_get_units_per_em (Clutter | |||
3341 | 139 | PangoFontDescription *font_desc); | 129 | PangoFontDescription *font_desc); |
3342 | 140 | gint32 _clutter_backend_get_units_serial (ClutterBackend *backend); | 130 | gint32 _clutter_backend_get_units_serial (ClutterBackend *backend); |
3343 | 141 | 131 | ||
3344 | 142 | PangoDirection _clutter_backend_get_keymap_direction (ClutterBackend *backend); | ||
3345 | 143 | |||
3346 | 144 | CLUTTER_EXPORT | ||
3347 | 145 | void _clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend); | ||
3348 | 146 | |||
3349 | 147 | void clutter_set_allowed_drivers (const char *drivers); | 132 | void clutter_set_allowed_drivers (const char *drivers); |
3350 | 148 | 133 | ||
3351 | 149 | CLUTTER_EXPORT | 134 | CLUTTER_EXPORT |
3352 | diff --git a/clutter/clutter/clutter-backend.c b/clutter/clutter/clutter-backend.c | |||
3353 | index 4652bc7..3cc4ca2 100644 | |||
3354 | --- a/clutter/clutter/clutter-backend.c | |||
3355 | +++ b/clutter/clutter/clutter-backend.c | |||
3356 | @@ -51,7 +51,6 @@ | |||
3357 | 51 | #include "clutter-stage-manager-private.h" | 51 | #include "clutter-stage-manager-private.h" |
3358 | 52 | #include "clutter-stage-private.h" | 52 | #include "clutter-stage-private.h" |
3359 | 53 | #include "clutter-stage-window.h" | 53 | #include "clutter-stage-window.h" |
3360 | 54 | #include "clutter-device-manager-private.h" | ||
3361 | 55 | 54 | ||
3362 | 56 | #ifdef CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT | 55 | #ifdef CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT |
3363 | 57 | #include "wayland/clutter-wayland-compositor.h" | 56 | #include "wayland/clutter-wayland-compositor.h" |
3364 | @@ -528,30 +527,6 @@ clutter_backend_real_init_events (ClutterBackend *backend) | |||
3365 | 528 | g_error ("Unknown input backend"); | 527 | g_error ("Unknown input backend"); |
3366 | 529 | } | 528 | } |
3367 | 530 | 529 | ||
3368 | 531 | static ClutterDeviceManager * | ||
3369 | 532 | clutter_backend_real_get_device_manager (ClutterBackend *backend) | ||
3370 | 533 | { | ||
3371 | 534 | if (G_UNLIKELY (backend->device_manager == NULL)) | ||
3372 | 535 | { | ||
3373 | 536 | g_critical ("No device manager available, expect broken input"); | ||
3374 | 537 | return NULL; | ||
3375 | 538 | } | ||
3376 | 539 | |||
3377 | 540 | return backend->device_manager; | ||
3378 | 541 | } | ||
3379 | 542 | |||
3380 | 543 | static ClutterKeymap * | ||
3381 | 544 | clutter_backend_real_get_keymap (ClutterBackend *backend) | ||
3382 | 545 | { | ||
3383 | 546 | if (G_UNLIKELY (backend->keymap == NULL)) | ||
3384 | 547 | { | ||
3385 | 548 | g_critical ("No keymap available, expect broken keyboard input"); | ||
3386 | 549 | return NULL; | ||
3387 | 550 | } | ||
3388 | 551 | |||
3389 | 552 | return backend->keymap; | ||
3390 | 553 | } | ||
3391 | 554 | |||
3392 | 555 | static void | 530 | static void |
3393 | 556 | clutter_backend_class_init (ClutterBackendClass *klass) | 531 | clutter_backend_class_init (ClutterBackendClass *klass) |
3394 | 557 | { | 532 | { |
3395 | @@ -615,10 +590,8 @@ clutter_backend_class_init (ClutterBackendClass *klass) | |||
3396 | 615 | klass->font_changed = clutter_backend_real_font_changed; | 590 | klass->font_changed = clutter_backend_real_font_changed; |
3397 | 616 | 591 | ||
3398 | 617 | klass->init_events = clutter_backend_real_init_events; | 592 | klass->init_events = clutter_backend_real_init_events; |
3399 | 618 | klass->get_device_manager = clutter_backend_real_get_device_manager; | ||
3400 | 619 | klass->create_context = clutter_backend_real_create_context; | 593 | klass->create_context = clutter_backend_real_create_context; |
3401 | 620 | klass->get_features = clutter_backend_real_get_features; | 594 | klass->get_features = clutter_backend_real_get_features; |
3402 | 621 | klass->get_keymap = clutter_backend_real_get_keymap; | ||
3403 | 622 | } | 595 | } |
3404 | 623 | 596 | ||
3405 | 624 | static void | 597 | static void |
3406 | @@ -627,7 +600,7 @@ clutter_backend_init (ClutterBackend *self) | |||
3407 | 627 | self->units_per_em = -1.0; | 600 | self->units_per_em = -1.0; |
3408 | 628 | self->units_serial = 1; | 601 | self->units_serial = 1; |
3409 | 629 | 602 | ||
3411 | 630 | self->dummy_onscreen = COGL_INVALID_HANDLE; | 603 | self->dummy_onscreen = NULL; |
3412 | 631 | } | 604 | } |
3413 | 632 | 605 | ||
3414 | 633 | void | 606 | void |
3415 | @@ -783,24 +756,24 @@ _clutter_backend_copy_event_data (ClutterBackend *backend, | |||
3416 | 783 | const ClutterEvent *src, | 756 | const ClutterEvent *src, |
3417 | 784 | ClutterEvent *dest) | 757 | ClutterEvent *dest) |
3418 | 785 | { | 758 | { |
3421 | 786 | ClutterDeviceManagerClass *device_manager_class; | 759 | ClutterSeatClass *seat_class; |
3422 | 787 | ClutterDeviceManager *device_manager; | 760 | ClutterSeat *seat; |
3423 | 788 | 761 | ||
3427 | 789 | device_manager = clutter_device_manager_get_default (); | 762 | seat = clutter_backend_get_default_seat (backend); |
3428 | 790 | device_manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager); | 763 | seat_class = CLUTTER_SEAT_GET_CLASS (seat); |
3429 | 791 | device_manager_class->copy_event_data (device_manager, src, dest); | 764 | seat_class->copy_event_data (seat, src, dest); |
3430 | 792 | } | 765 | } |
3431 | 793 | 766 | ||
3432 | 794 | void | 767 | void |
3433 | 795 | _clutter_backend_free_event_data (ClutterBackend *backend, | 768 | _clutter_backend_free_event_data (ClutterBackend *backend, |
3434 | 796 | ClutterEvent *event) | 769 | ClutterEvent *event) |
3435 | 797 | { | 770 | { |
3438 | 798 | ClutterDeviceManagerClass *device_manager_class; | 771 | ClutterSeatClass *seat_class; |
3439 | 799 | ClutterDeviceManager *device_manager; | 772 | ClutterSeat *seat; |
3440 | 800 | 773 | ||
3444 | 801 | device_manager = clutter_device_manager_get_default (); | 774 | seat = clutter_backend_get_default_seat (backend); |
3445 | 802 | device_manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager); | 775 | seat_class = CLUTTER_SEAT_GET_CLASS (seat); |
3446 | 803 | device_manager_class->free_event_data (device_manager, event); | 776 | seat_class->free_event_data (seat, event); |
3447 | 804 | } | 777 | } |
3448 | 805 | 778 | ||
3449 | 806 | /** | 779 | /** |
3450 | @@ -997,39 +970,6 @@ clutter_wayland_set_compositor_display (void *display) | |||
3451 | 997 | } | 970 | } |
3452 | 998 | #endif | 971 | #endif |
3453 | 999 | 972 | ||
3454 | 1000 | PangoDirection | ||
3455 | 1001 | _clutter_backend_get_keymap_direction (ClutterBackend *backend) | ||
3456 | 1002 | { | ||
3457 | 1003 | ClutterBackendClass *klass; | ||
3458 | 1004 | |||
3459 | 1005 | klass = CLUTTER_BACKEND_GET_CLASS (backend); | ||
3460 | 1006 | if (klass->get_keymap_direction != NULL) | ||
3461 | 1007 | return klass->get_keymap_direction (backend); | ||
3462 | 1008 | |||
3463 | 1009 | return PANGO_DIRECTION_NEUTRAL; | ||
3464 | 1010 | } | ||
3465 | 1011 | |||
3466 | 1012 | void | ||
3467 | 1013 | _clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend) | ||
3468 | 1014 | { | ||
3469 | 1015 | if (backend->dummy_onscreen == COGL_INVALID_HANDLE) | ||
3470 | 1016 | { | ||
3471 | 1017 | GError *internal_error = NULL; | ||
3472 | 1018 | |||
3473 | 1019 | backend->dummy_onscreen = cogl_onscreen_new (backend->cogl_context, 1, 1); | ||
3474 | 1020 | |||
3475 | 1021 | if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (backend->dummy_onscreen), | ||
3476 | 1022 | &internal_error)) | ||
3477 | 1023 | { | ||
3478 | 1024 | g_critical ("Unable to create dummy onscreen: %s", internal_error->message); | ||
3479 | 1025 | g_error_free (internal_error); | ||
3480 | 1026 | return; | ||
3481 | 1027 | } | ||
3482 | 1028 | } | ||
3483 | 1029 | |||
3484 | 1030 | cogl_set_framebuffer (COGL_FRAMEBUFFER (backend->dummy_onscreen)); | ||
3485 | 1031 | } | ||
3486 | 1032 | |||
3487 | 1033 | void | 973 | void |
3488 | 1034 | clutter_set_allowed_drivers (const char *drivers) | 974 | clutter_set_allowed_drivers (const char *drivers) |
3489 | 1035 | { | 975 | { |
3490 | @@ -1042,16 +982,6 @@ clutter_set_allowed_drivers (const char *drivers) | |||
3491 | 1042 | allowed_drivers = g_strdup (drivers); | 982 | allowed_drivers = g_strdup (drivers); |
3492 | 1043 | } | 983 | } |
3493 | 1044 | 984 | ||
3494 | 1045 | void | ||
3495 | 1046 | clutter_backend_bell_notify (ClutterBackend *backend) | ||
3496 | 1047 | { | ||
3497 | 1048 | ClutterBackendClass *klass; | ||
3498 | 1049 | |||
3499 | 1050 | klass = CLUTTER_BACKEND_GET_CLASS (backend); | ||
3500 | 1051 | if (klass->bell_notify) | ||
3501 | 1052 | klass->bell_notify (backend); | ||
3502 | 1053 | } | ||
3503 | 1054 | |||
3504 | 1055 | /** | 985 | /** |
3505 | 1056 | * clutter_backend_get_input_method: | 986 | * clutter_backend_get_input_method: |
3506 | 1057 | * @backend: the #CLutterBackend | 987 | * @backend: the #CLutterBackend |
3507 | @@ -1080,22 +1010,24 @@ clutter_backend_set_input_method (ClutterBackend *backend, | |||
3508 | 1080 | g_set_object (&backend->input_method, method); | 1010 | g_set_object (&backend->input_method, method); |
3509 | 1081 | } | 1011 | } |
3510 | 1082 | 1012 | ||
3511 | 1013 | ClutterStageWindow * | ||
3512 | 1014 | clutter_backend_get_stage_window (ClutterBackend *backend) | ||
3513 | 1015 | { | ||
3514 | 1016 | return backend->stage_window; | ||
3515 | 1017 | } | ||
3516 | 1018 | |||
3517 | 1083 | /** | 1019 | /** |
3519 | 1084 | * clutter_backend_get_keymap: | 1020 | * clutter_backend_get_default_seat: |
3520 | 1085 | * @backend: the #ClutterBackend | 1021 | * @backend: the #ClutterBackend |
3521 | 1086 | * | 1022 | * |
3523 | 1087 | * Gets the keymap used by Clutter | 1023 | * Returns the default seat |
3524 | 1088 | * | 1024 | * |
3526 | 1089 | * Returns: (transfer none): the keymap | 1025 | * Returns: (transfer none): the default seat |
3527 | 1090 | **/ | 1026 | **/ |
3530 | 1091 | ClutterKeymap * | 1027 | ClutterSeat * |
3531 | 1092 | clutter_backend_get_keymap (ClutterBackend *backend) | 1028 | clutter_backend_get_default_seat (ClutterBackend *backend) |
3532 | 1093 | { | 1029 | { |
3535 | 1094 | return CLUTTER_BACKEND_GET_CLASS (backend)->get_keymap (backend); | 1030 | g_return_val_if_fail (CLUTTER_IS_BACKEND (backend), NULL); |
3534 | 1095 | } | ||
3536 | 1096 | 1031 | ||
3541 | 1097 | ClutterStageWindow * | 1032 | return CLUTTER_BACKEND_GET_CLASS (backend)->get_default_seat (backend); |
3538 | 1098 | clutter_backend_get_stage_window (ClutterBackend *backend) | ||
3539 | 1099 | { | ||
3540 | 1100 | return backend->stage_window; | ||
3542 | 1101 | } | 1033 | } |
3543 | diff --git a/clutter/clutter/clutter-backend.h b/clutter/clutter/clutter-backend.h | |||
3544 | index fde57d8..14f6c24 100644 | |||
3545 | --- a/clutter/clutter/clutter-backend.h | |||
3546 | +++ b/clutter/clutter/clutter-backend.h | |||
3547 | @@ -36,6 +36,7 @@ | |||
3548 | 36 | #include <clutter/clutter-config.h> | 36 | #include <clutter/clutter-config.h> |
3549 | 37 | #include <clutter/clutter-keymap.h> | 37 | #include <clutter/clutter-keymap.h> |
3550 | 38 | #include <clutter/clutter-types.h> | 38 | #include <clutter/clutter-types.h> |
3551 | 39 | #include <clutter/clutter-seat.h> | ||
3552 | 39 | 40 | ||
3553 | 40 | G_BEGIN_DECLS | 41 | G_BEGIN_DECLS |
3554 | 41 | 42 | ||
3555 | @@ -73,16 +74,13 @@ CLUTTER_EXPORT | |||
3556 | 73 | CoglContext * clutter_backend_get_cogl_context (ClutterBackend *backend); | 74 | CoglContext * clutter_backend_get_cogl_context (ClutterBackend *backend); |
3557 | 74 | 75 | ||
3558 | 75 | CLUTTER_EXPORT | 76 | CLUTTER_EXPORT |
3559 | 76 | void clutter_backend_bell_notify (ClutterBackend *backend); | ||
3560 | 77 | |||
3561 | 78 | CLUTTER_EXPORT | ||
3562 | 79 | ClutterInputMethod * clutter_backend_get_input_method (ClutterBackend *backend); | 77 | ClutterInputMethod * clutter_backend_get_input_method (ClutterBackend *backend); |
3563 | 80 | 78 | ||
3564 | 81 | CLUTTER_EXPORT | 79 | CLUTTER_EXPORT |
3565 | 82 | void clutter_backend_set_input_method (ClutterBackend *backend, | 80 | void clutter_backend_set_input_method (ClutterBackend *backend, |
3566 | 83 | ClutterInputMethod *method); | 81 | ClutterInputMethod *method); |
3567 | 84 | CLUTTER_EXPORT | 82 | CLUTTER_EXPORT |
3569 | 85 | ClutterKeymap * clutter_backend_get_keymap (ClutterBackend *backend); | 83 | ClutterSeat * clutter_backend_get_default_seat (ClutterBackend *backend); |
3570 | 86 | 84 | ||
3571 | 87 | G_END_DECLS | 85 | G_END_DECLS |
3572 | 88 | 86 | ||
3573 | diff --git a/clutter/clutter/clutter-base-types.c b/clutter/clutter/clutter-base-types.c | |||
3574 | index 61e6fcd..fcbcd2e 100644 | |||
3575 | --- a/clutter/clutter/clutter-base-types.c | |||
3576 | +++ b/clutter/clutter/clutter-base-types.c | |||
3577 | @@ -42,286 +42,6 @@ | |||
3578 | 42 | 42 | ||
3579 | 43 | 43 | ||
3580 | 44 | 44 | ||
3581 | 45 | /* | 45 | /* |
3582 | 46 | * ClutterGeometry | ||
3583 | 47 | */ | ||
3584 | 48 | |||
3585 | 49 | static ClutterGeometry* | ||
3586 | 50 | clutter_geometry_copy (const ClutterGeometry *geometry) | ||
3587 | 51 | { | ||
3588 | 52 | return g_slice_dup (ClutterGeometry, geometry); | ||
3589 | 53 | } | ||
3590 | 54 | |||
3591 | 55 | static void | ||
3592 | 56 | clutter_geometry_free (ClutterGeometry *geometry) | ||
3593 | 57 | { | ||
3594 | 58 | if (G_LIKELY (geometry != NULL)) | ||
3595 | 59 | g_slice_free (ClutterGeometry, geometry); | ||
3596 | 60 | } | ||
3597 | 61 | |||
3598 | 62 | /** | ||
3599 | 63 | * clutter_geometry_union: | ||
3600 | 64 | * @geometry_a: a #ClutterGeometry | ||
3601 | 65 | * @geometry_b: another #ClutterGeometry | ||
3602 | 66 | * @result: (out): location to store the result | ||
3603 | 67 | * | ||
3604 | 68 | * Find the union of two rectangles represented as #ClutterGeometry. | ||
3605 | 69 | * | ||
3606 | 70 | * Since: 1.4 | ||
3607 | 71 | * | ||
3608 | 72 | * Deprecated: 1.16: Use #ClutterRect and clutter_rect_union() | ||
3609 | 73 | */ | ||
3610 | 74 | void | ||
3611 | 75 | clutter_geometry_union (const ClutterGeometry *geometry_a, | ||
3612 | 76 | const ClutterGeometry *geometry_b, | ||
3613 | 77 | ClutterGeometry *result) | ||
3614 | 78 | { | ||
3615 | 79 | /* We don't try to handle rectangles that can't be represented | ||
3616 | 80 | * as a signed integer box */ | ||
3617 | 81 | gint x_1 = MIN (geometry_a->x, geometry_b->x); | ||
3618 | 82 | gint y_1 = MIN (geometry_a->y, geometry_b->y); | ||
3619 | 83 | gint x_2 = MAX (geometry_a->x + (gint)geometry_a->width, | ||
3620 | 84 | geometry_b->x + (gint)geometry_b->width); | ||
3621 | 85 | gint y_2 = MAX (geometry_a->y + (gint)geometry_a->height, | ||
3622 | 86 | geometry_b->y + (gint)geometry_b->height); | ||
3623 | 87 | result->x = x_1; | ||
3624 | 88 | result->y = y_1; | ||
3625 | 89 | result->width = x_2 - x_1; | ||
3626 | 90 | result->height = y_2 - y_1; | ||
3627 | 91 | } | ||
3628 | 92 | |||
3629 | 93 | /** | ||
3630 | 94 | * clutter_geometry_intersects: | ||
3631 | 95 | * @geometry0: The first geometry to test | ||
3632 | 96 | * @geometry1: The second geometry to test | ||
3633 | 97 | * | ||
3634 | 98 | * Determines if @geometry0 and geometry1 intersect returning %TRUE if | ||
3635 | 99 | * they do else %FALSE. | ||
3636 | 100 | * | ||
3637 | 101 | * Return value: %TRUE of @geometry0 and geometry1 intersect else | ||
3638 | 102 | * %FALSE. | ||
3639 | 103 | * | ||
3640 | 104 | * Since: 1.4 | ||
3641 | 105 | * | ||
3642 | 106 | * Deprecated: 1.16: Use #ClutterRect and clutter_rect_intersection() | ||
3643 | 107 | */ | ||
3644 | 108 | gboolean | ||
3645 | 109 | clutter_geometry_intersects (const ClutterGeometry *geometry0, | ||
3646 | 110 | const ClutterGeometry *geometry1) | ||
3647 | 111 | { | ||
3648 | 112 | if (geometry1->x >= (geometry0->x + (gint)geometry0->width) || | ||
3649 | 113 | geometry1->y >= (geometry0->y + (gint)geometry0->height) || | ||
3650 | 114 | (geometry1->x + (gint)geometry1->width) <= geometry0->x || | ||
3651 | 115 | (geometry1->y + (gint)geometry1->height) <= geometry0->y) | ||
3652 | 116 | return FALSE; | ||
3653 | 117 | else | ||
3654 | 118 | return TRUE; | ||
3655 | 119 | } | ||
3656 | 120 | |||
3657 | 121 | static gboolean | ||
3658 | 122 | clutter_geometry_progress (const GValue *a, | ||
3659 | 123 | const GValue *b, | ||
3660 | 124 | gdouble progress, | ||
3661 | 125 | GValue *retval) | ||
3662 | 126 | { | ||
3663 | 127 | const ClutterGeometry *a_geom = g_value_get_boxed (a); | ||
3664 | 128 | const ClutterGeometry *b_geom = g_value_get_boxed (b); | ||
3665 | 129 | ClutterGeometry res = { 0, }; | ||
3666 | 130 | gint a_width = a_geom->width; | ||
3667 | 131 | gint b_width = b_geom->width; | ||
3668 | 132 | gint a_height = a_geom->height; | ||
3669 | 133 | gint b_height = b_geom->height; | ||
3670 | 134 | |||
3671 | 135 | res.x = a_geom->x + (b_geom->x - a_geom->x) * progress; | ||
3672 | 136 | res.y = a_geom->y + (b_geom->y - a_geom->y) * progress; | ||
3673 | 137 | |||
3674 | 138 | res.width = a_width + (b_width - a_width) * progress; | ||
3675 | 139 | res.height = a_height + (b_height - a_height) * progress; | ||
3676 | 140 | |||
3677 | 141 | g_value_set_boxed (retval, &res); | ||
3678 | 142 | |||
3679 | 143 | return TRUE; | ||
3680 | 144 | } | ||
3681 | 145 | |||
3682 | 146 | G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterGeometry, clutter_geometry, | ||
3683 | 147 | clutter_geometry_copy, | ||
3684 | 148 | clutter_geometry_free, | ||
3685 | 149 | CLUTTER_REGISTER_INTERVAL_PROGRESS (clutter_geometry_progress)); | ||
3686 | 150 | |||
3687 | 151 | |||
3688 | 152 | 46 | ||
3689 | 153 | |||
3690 | 154 | /* | ||
3691 | 155 | * ClutterVertices | ||
3692 | 156 | */ | ||
3693 | 157 | |||
3694 | 158 | /** | ||
3695 | 159 | * clutter_vertex_new: | ||
3696 | 160 | * @x: X coordinate | ||
3697 | 161 | * @y: Y coordinate | ||
3698 | 162 | * @z: Z coordinate | ||
3699 | 163 | * | ||
3700 | 164 | * Creates a new #ClutterVertex for the point in 3D space | ||
3701 | 165 | * identified by the 3 coordinates @x, @y, @z. | ||
3702 | 166 | * | ||
3703 | 167 | * This function is the logical equivalent of: | ||
3704 | 168 | * | ||
3705 | 169 | * |[ | ||
3706 | 170 | * clutter_vertex_init (clutter_vertex_alloc (), x, y, z); | ||
3707 | 171 | * ]| | ||
3708 | 172 | * | ||
3709 | 173 | * Return value: (transfer full): the newly allocated #ClutterVertex. | ||
3710 | 174 | * Use clutter_vertex_free() to free the resources | ||
3711 | 175 | * | ||
3712 | 176 | * Since: 1.0 | ||
3713 | 177 | */ | ||
3714 | 178 | ClutterVertex * | ||
3715 | 179 | clutter_vertex_new (gfloat x, | ||
3716 | 180 | gfloat y, | ||
3717 | 181 | gfloat z) | ||
3718 | 182 | { | ||
3719 | 183 | return clutter_vertex_init (clutter_vertex_alloc (), x, y, z); | ||
3720 | 184 | } | ||
3721 | 185 | |||
3722 | 186 | /** | ||
3723 | 187 | * clutter_vertex_alloc: (constructor) | ||
3724 | 188 | * | ||
3725 | 189 | * Allocates a new, empty #ClutterVertex. | ||
3726 | 190 | * | ||
3727 | 191 | * Return value: (transfer full): the newly allocated #ClutterVertex. | ||
3728 | 192 | * Use clutter_vertex_free() to free its resources | ||
3729 | 193 | * | ||
3730 | 194 | * Since: 1.12 | ||
3731 | 195 | */ | ||
3732 | 196 | ClutterVertex * | ||
3733 | 197 | clutter_vertex_alloc (void) | ||
3734 | 198 | { | ||
3735 | 199 | return g_slice_new0 (ClutterVertex); | ||
3736 | 200 | } | ||
3737 | 201 | |||
3738 | 202 | /** | ||
3739 | 203 | * clutter_vertex_init: | ||
3740 | 204 | * @vertex: a #ClutterVertex | ||
3741 | 205 | * @x: X coordinate | ||
3742 | 206 | * @y: Y coordinate | ||
3743 | 207 | * @z: Z coordinate | ||
3744 | 208 | * | ||
3745 | 209 | * Initializes @vertex with the given coordinates. | ||
3746 | 210 | * | ||
3747 | 211 | * Return value: (transfer none): the initialized #ClutterVertex | ||
3748 | 212 | * | ||
3749 | 213 | * Since: 1.10 | ||
3750 | 214 | */ | ||
3751 | 215 | ClutterVertex * | ||
3752 | 216 | clutter_vertex_init (ClutterVertex *vertex, | ||
3753 | 217 | gfloat x, | ||
3754 | 218 | gfloat y, | ||
3755 | 219 | gfloat z) | ||
3756 | 220 | { | ||
3757 | 221 | g_return_val_if_fail (vertex != NULL, NULL); | ||
3758 | 222 | |||
3759 | 223 | vertex->x = x; | ||
3760 | 224 | vertex->y = y; | ||
3761 | 225 | vertex->z = z; | ||
3762 | 226 | |||
3763 | 227 | return vertex; | ||
3764 | 228 | } | ||
3765 | 229 | |||
3766 | 230 | /** | ||
3767 | 231 | * clutter_vertex_copy: | ||
3768 | 232 | * @vertex: a #ClutterVertex | ||
3769 | 233 | * | ||
3770 | 234 | * Copies @vertex | ||
3771 | 235 | * | ||
3772 | 236 | * Return value: (transfer full): a newly allocated copy of #ClutterVertex. | ||
3773 | 237 | * Use clutter_vertex_free() to free the allocated resources | ||
3774 | 238 | * | ||
3775 | 239 | * Since: 1.0 | ||
3776 | 240 | */ | ||
3777 | 241 | ClutterVertex * | ||
3778 | 242 | clutter_vertex_copy (const ClutterVertex *vertex) | ||
3779 | 243 | { | ||
3780 | 244 | if (G_LIKELY (vertex != NULL)) | ||
3781 | 245 | return g_slice_dup (ClutterVertex, vertex); | ||
3782 | 246 | |||
3783 | 247 | return NULL; | ||
3784 | 248 | } | ||
3785 | 249 | |||
3786 | 250 | /** | ||
3787 | 251 | * clutter_vertex_free: | ||
3788 | 252 | * @vertex: a #ClutterVertex | ||
3789 | 253 | * | ||
3790 | 254 | * Frees a #ClutterVertex allocated using clutter_vertex_alloc() or | ||
3791 | 255 | * clutter_vertex_copy(). | ||
3792 | 256 | * | ||
3793 | 257 | * Since: 1.0 | ||
3794 | 258 | */ | ||
3795 | 259 | void | ||
3796 | 260 | clutter_vertex_free (ClutterVertex *vertex) | ||
3797 | 261 | { | ||
3798 | 262 | if (G_UNLIKELY (vertex != NULL)) | ||
3799 | 263 | g_slice_free (ClutterVertex, vertex); | ||
3800 | 264 | } | ||
3801 | 265 | |||
3802 | 266 | /** | ||
3803 | 267 | * clutter_vertex_equal: | ||
3804 | 268 | * @vertex_a: a #ClutterVertex | ||
3805 | 269 | * @vertex_b: a #ClutterVertex | ||
3806 | 270 | * | ||
3807 | 271 | * Compares @vertex_a and @vertex_b for equality | ||
3808 | 272 | * | ||
3809 | 273 | * Return value: %TRUE if the passed #ClutterVertex are equal | ||
3810 | 274 | * | ||
3811 | 275 | * Since: 1.0 | ||
3812 | 276 | */ | ||
3813 | 277 | gboolean | ||
3814 | 278 | clutter_vertex_equal (const ClutterVertex *vertex_a, | ||
3815 | 279 | const ClutterVertex *vertex_b) | ||
3816 | 280 | { | ||
3817 | 281 | g_return_val_if_fail (vertex_a != NULL && vertex_b != NULL, FALSE); | ||
3818 | 282 | |||
3819 | 283 | if (vertex_a == vertex_b) | ||
3820 | 284 | return TRUE; | ||
3821 | 285 | |||
3822 | 286 | return fabsf (vertex_a->x - vertex_b->x) < FLOAT_EPSILON && | ||
3823 | 287 | fabsf (vertex_a->y - vertex_b->y) < FLOAT_EPSILON && | ||
3824 | 288 | fabsf (vertex_a->z - vertex_b->z) < FLOAT_EPSILON; | ||
3825 | 289 | } | ||
3826 | 290 | |||
3827 | 291 | static void | ||
3828 | 292 | clutter_vertex_interpolate (const ClutterVertex *a, | ||
3829 | 293 | const ClutterVertex *b, | ||
3830 | 294 | double progress, | ||
3831 | 295 | ClutterVertex *res) | ||
3832 | 296 | { | ||
3833 | 297 | res->x = a->x + (b->x - a->x) * progress; | ||
3834 | 298 | res->y = a->y + (b->y - a->y) * progress; | ||
3835 | 299 | res->z = a->z + (b->z - a->z) * progress; | ||
3836 | 300 | } | ||
3837 | 301 | |||
3838 | 302 | static gboolean | ||
3839 | 303 | clutter_vertex_progress (const GValue *a, | ||
3840 | 304 | const GValue *b, | ||
3841 | 305 | gdouble progress, | ||
3842 | 306 | GValue *retval) | ||
3843 | 307 | { | ||
3844 | 308 | const ClutterVertex *av = g_value_get_boxed (a); | ||
3845 | 309 | const ClutterVertex *bv = g_value_get_boxed (b); | ||
3846 | 310 | ClutterVertex res; | ||
3847 | 311 | |||
3848 | 312 | clutter_vertex_interpolate (av, bv, progress, &res); | ||
3849 | 313 | |||
3850 | 314 | g_value_set_boxed (retval, &res); | ||
3851 | 315 | |||
3852 | 316 | return TRUE; | ||
3853 | 317 | } | ||
3854 | 318 | |||
3855 | 319 | G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterVertex, clutter_vertex, | ||
3856 | 320 | clutter_vertex_copy, | ||
3857 | 321 | clutter_vertex_free, | ||
3858 | 322 | CLUTTER_REGISTER_INTERVAL_PROGRESS (clutter_vertex_progress)); | ||
3859 | 323 | |||
3860 | 324 | |||
3861 | 325 | 47 | ||
3862 | 326 | |||
3863 | 327 | /* | ||
3864 | 328 | * ClutterMargin | 48 | * ClutterMargin |
3865 | 329 | */ | 49 | */ |
3866 | 330 | 50 | ||
3867 | @@ -382,993 +102,6 @@ G_DEFINE_BOXED_TYPE (ClutterMargin, clutter_margin, | |||
3868 | 382 | clutter_margin_copy, | 102 | clutter_margin_copy, |
3869 | 383 | clutter_margin_free) | 103 | clutter_margin_free) |
3870 | 384 | 104 | ||
3871 | 385 | |||
3872 | 386 | 105 | ||
3873 | 387 | |||
3874 | 388 | /* | ||
3875 | 389 | * ClutterPoint | ||
3876 | 390 | */ | ||
3877 | 391 | |||
3878 | 392 | static const ClutterPoint _clutter_point_zero = CLUTTER_POINT_INIT_ZERO; | ||
3879 | 393 | |||
3880 | 394 | /** | ||
3881 | 395 | * clutter_point_zero: | ||
3882 | 396 | * | ||
3883 | 397 | * A point centered at (0, 0). | ||
3884 | 398 | * | ||
3885 | 399 | * The returned value can be used as a guard. | ||
3886 | 400 | * | ||
3887 | 401 | * Return value: a point centered in (0, 0); the returned #ClutterPoint | ||
3888 | 402 | * is owned by Clutter and it should not be modified or freed. | ||
3889 | 403 | * | ||
3890 | 404 | * Since: 1.12 | ||
3891 | 405 | */ | ||
3892 | 406 | const ClutterPoint * | ||
3893 | 407 | clutter_point_zero (void) | ||
3894 | 408 | { | ||
3895 | 409 | return &_clutter_point_zero; | ||
3896 | 410 | } | ||
3897 | 411 | |||
3898 | 412 | /** | ||
3899 | 413 | * clutter_point_alloc: (constructor) | ||
3900 | 414 | * | ||
3901 | 415 | * Allocates a new #ClutterPoint. | ||
3902 | 416 | * | ||
3903 | 417 | * Return value: (transfer full): the newly allocated #ClutterPoint. | ||
3904 | 418 | * Use clutter_point_free() to free its resources. | ||
3905 | 419 | * | ||
3906 | 420 | * Since: 1.12 | ||
3907 | 421 | */ | ||
3908 | 422 | ClutterPoint * | ||
3909 | 423 | clutter_point_alloc (void) | ||
3910 | 424 | { | ||
3911 | 425 | return g_slice_new0 (ClutterPoint); | ||
3912 | 426 | } | ||
3913 | 427 | |||
3914 | 428 | /** | ||
3915 | 429 | * clutter_point_init: | ||
3916 | 430 | * @point: a #ClutterPoint | ||
3917 | 431 | * @x: the X coordinate of the point | ||
3918 | 432 | * @y: the Y coordinate of the point | ||
3919 | 433 | * | ||
3920 | 434 | * Initializes @point with the given coordinates. | ||
3921 | 435 | * | ||
3922 | 436 | * Return value: (transfer none): the initialized #ClutterPoint | ||
3923 | 437 | * | ||
3924 | 438 | * Since: 1.12 | ||
3925 | 439 | */ | ||
3926 | 440 | ClutterPoint * | ||
3927 | 441 | clutter_point_init (ClutterPoint *point, | ||
3928 | 442 | float x, | ||
3929 | 443 | float y) | ||
3930 | 444 | { | ||
3931 | 445 | g_return_val_if_fail (point != NULL, NULL); | ||
3932 | 446 | |||
3933 | 447 | point->x = x; | ||
3934 | 448 | point->y = y; | ||
3935 | 449 | |||
3936 | 450 | return point; | ||
3937 | 451 | } | ||
3938 | 452 | |||
3939 | 453 | /** | ||
3940 | 454 | * clutter_point_copy: | ||
3941 | 455 | * @point: a #ClutterPoint | ||
3942 | 456 | * | ||
3943 | 457 | * Creates a new #ClutterPoint with the same coordinates of @point. | ||
3944 | 458 | * | ||
3945 | 459 | * Return value: (transfer full): a newly allocated #ClutterPoint. | ||
3946 | 460 | * Use clutter_point_free() to free its resources. | ||
3947 | 461 | * | ||
3948 | 462 | * Since: 1.12 | ||
3949 | 463 | */ | ||
3950 | 464 | ClutterPoint * | ||
3951 | 465 | clutter_point_copy (const ClutterPoint *point) | ||
3952 | 466 | { | ||
3953 | 467 | return g_slice_dup (ClutterPoint, point); | ||
3954 | 468 | } | ||
3955 | 469 | |||
3956 | 470 | /** | ||
3957 | 471 | * clutter_point_free: | ||
3958 | 472 | * @point: a #ClutterPoint | ||
3959 | 473 | * | ||
3960 | 474 | * Frees the resources allocated for @point. | ||
3961 | 475 | * | ||
3962 | 476 | * Since: 1.12 | ||
3963 | 477 | */ | ||
3964 | 478 | void | ||
3965 | 479 | clutter_point_free (ClutterPoint *point) | ||
3966 | 480 | { | ||
3967 | 481 | if (point != NULL && point != &_clutter_point_zero) | ||
3968 | 482 | g_slice_free (ClutterPoint, point); | ||
3969 | 483 | } | ||
3970 | 484 | |||
3971 | 485 | /** | ||
3972 | 486 | * clutter_point_equals: | ||
3973 | 487 | * @a: the first #ClutterPoint to compare | ||
3974 | 488 | * @b: the second #ClutterPoint to compare | ||
3975 | 489 | * | ||
3976 | 490 | * Compares two #ClutterPoint for equality. | ||
3977 | 491 | * | ||
3978 | 492 | * Return value: %TRUE if the #ClutterPoints are equal | ||
3979 | 493 | * | ||
3980 | 494 | * Since: 1.12 | ||
3981 | 495 | */ | ||
3982 | 496 | gboolean | ||
3983 | 497 | clutter_point_equals (const ClutterPoint *a, | ||
3984 | 498 | const ClutterPoint *b) | ||
3985 | 499 | { | ||
3986 | 500 | if (a == b) | ||
3987 | 501 | return TRUE; | ||
3988 | 502 | |||
3989 | 503 | if (a == NULL || b == NULL) | ||
3990 | 504 | return FALSE; | ||
3991 | 505 | |||
3992 | 506 | return fabsf (a->x - b->x) < FLOAT_EPSILON && | ||
3993 | 507 | fabsf (a->y - b->y) < FLOAT_EPSILON; | ||
3994 | 508 | } | ||
3995 | 509 | |||
3996 | 510 | /** | ||
3997 | 511 | * clutter_point_distance: | ||
3998 | 512 | * @a: a #ClutterPoint | ||
3999 | 513 | * @b: a #ClutterPoint | ||
4000 | 514 | * @x_distance: (out) (allow-none): return location for the horizontal | ||
4001 | 515 | * distance between the points | ||
4002 | 516 | * @y_distance: (out) (allow-none): return location for the vertical | ||
4003 | 517 | * distance between the points | ||
4004 | 518 | * | ||
4005 | 519 | * Computes the distance between two #ClutterPoint. | ||
4006 | 520 | * | ||
4007 | 521 | * Return value: the distance between the points. | ||
4008 | 522 | * | ||
4009 | 523 | * Since: 1.12 | ||
4010 | 524 | */ | ||
4011 | 525 | float | ||
4012 | 526 | clutter_point_distance (const ClutterPoint *a, | ||
4013 | 527 | const ClutterPoint *b, | ||
4014 | 528 | float *x_distance, | ||
4015 | 529 | float *y_distance) | ||
4016 | 530 | { | ||
4017 | 531 | float x_d, y_d; | ||
4018 | 532 | |||
4019 | 533 | g_return_val_if_fail (a != NULL, 0.f); | ||
4020 | 534 | g_return_val_if_fail (b != NULL, 0.f); | ||
4021 | 535 | |||
4022 | 536 | if (clutter_point_equals (a, b)) | ||
4023 | 537 | return 0.f; | ||
4024 | 538 | |||
4025 | 539 | x_d = (a->x - b->x); | ||
4026 | 540 | y_d = (a->y - b->y); | ||
4027 | 541 | |||
4028 | 542 | if (x_distance != NULL) | ||
4029 | 543 | *x_distance = fabsf (x_d); | ||
4030 | 544 | |||
4031 | 545 | if (y_distance != NULL) | ||
4032 | 546 | *y_distance = fabsf (y_d); | ||
4033 | 547 | |||
4034 | 548 | return sqrt ((x_d * x_d) + (y_d * y_d)); | ||
4035 | 549 | } | ||
4036 | 550 | |||
4037 | 551 | static gboolean | ||
4038 | 552 | clutter_point_progress (const GValue *a, | ||
4039 | 553 | const GValue *b, | ||
4040 | 554 | gdouble progress, | ||
4041 | 555 | GValue *retval) | ||
4042 | 556 | { | ||
4043 | 557 | const ClutterPoint *ap = g_value_get_boxed (a); | ||
4044 | 558 | const ClutterPoint *bp = g_value_get_boxed (b); | ||
4045 | 559 | ClutterPoint res = CLUTTER_POINT_INIT (0, 0); | ||
4046 | 560 | |||
4047 | 561 | res.x = ap->x + (bp->x - ap->x) * progress; | ||
4048 | 562 | res.y = ap->y + (bp->y - ap->y) * progress; | ||
4049 | 563 | |||
4050 | 564 | g_value_set_boxed (retval, &res); | ||
4051 | 565 | |||
4052 | 566 | return TRUE; | ||
4053 | 567 | } | ||
4054 | 568 | |||
4055 | 569 | G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterPoint, clutter_point, | ||
4056 | 570 | clutter_point_copy, | ||
4057 | 571 | clutter_point_free, | ||
4058 | 572 | CLUTTER_REGISTER_INTERVAL_PROGRESS (clutter_point_progress)) | ||
4059 | 573 | |||
4060 | 574 | static int | ||
4061 | 575 | clutter_point_compare_line (const ClutterPoint *p, | ||
4062 | 576 | const ClutterPoint *a, | ||
4063 | 577 | const ClutterPoint *b) | ||
4064 | 578 | { | ||
4065 | 579 | float x1 = b->x - a->x; | ||
4066 | 580 | float y1 = b->y - a->y; | ||
4067 | 581 | float x2 = p->x - a->x; | ||
4068 | 582 | float y2 = p->y - a->y; | ||
4069 | 583 | float cross_z = x1 * y2 - y1 * x2; | ||
4070 | 584 | |||
4071 | 585 | if (cross_z > 0.f) | ||
4072 | 586 | return 1; | ||
4073 | 587 | else if (cross_z < 0.f) | ||
4074 | 588 | return -1; | ||
4075 | 589 | else | ||
4076 | 590 | return 0; | ||
4077 | 591 | } | ||
4078 | 592 | |||
4079 | 593 | /** | ||
4080 | 594 | * clutter_point_inside_quadrilateral: | ||
4081 | 595 | * @point: a #ClutterPoint to test | ||
4082 | 596 | * @vertices: array of vertices of the quadrilateral, in either clockwise or | ||
4083 | 597 | * anticlockwise order. | ||
4084 | 598 | * | ||
4085 | 599 | * Determines whether a point is inside the convex quadrilateral provided, | ||
4086 | 600 | * or on any of its edges or vertices. | ||
4087 | 601 | * | ||
4088 | 602 | * Returns: %TRUE if @point is inside or touching the quadrilateral | ||
4089 | 603 | */ | ||
4090 | 604 | gboolean | ||
4091 | 605 | clutter_point_inside_quadrilateral (const ClutterPoint *point, | ||
4092 | 606 | const ClutterPoint *vertices) | ||
4093 | 607 | { | ||
4094 | 608 | unsigned int i; | ||
4095 | 609 | int first_side; | ||
4096 | 610 | |||
4097 | 611 | first_side = 0; | ||
4098 | 612 | |||
4099 | 613 | for (i = 0; i < 4; i++) | ||
4100 | 614 | { | ||
4101 | 615 | int side; | ||
4102 | 616 | |||
4103 | 617 | side = clutter_point_compare_line (point, | ||
4104 | 618 | &vertices[i], | ||
4105 | 619 | &vertices[(i + 1) % 4]); | ||
4106 | 620 | |||
4107 | 621 | if (side) | ||
4108 | 622 | { | ||
4109 | 623 | if (first_side == 0) | ||
4110 | 624 | first_side = side; | ||
4111 | 625 | else if (side != first_side) | ||
4112 | 626 | return FALSE; | ||
4113 | 627 | } | ||
4114 | 628 | } | ||
4115 | 629 | |||
4116 | 630 | if (first_side == 0) | ||
4117 | 631 | return FALSE; | ||
4118 | 632 | |||
4119 | 633 | return TRUE; | ||
4120 | 634 | } | ||
4121 | 635 | |||
4122 | 636 | |||
4123 | 637 | 106 | ||
4124 | 638 | |||
4125 | 639 | /* | ||
4126 | 640 | * ClutterSize | ||
4127 | 641 | */ | ||
4128 | 642 | |||
4129 | 643 | /** | ||
4130 | 644 | * clutter_size_alloc: (constructor) | ||
4131 | 645 | * | ||
4132 | 646 | * Allocates a new #ClutterSize. | ||
4133 | 647 | * | ||
4134 | 648 | * Return value: (transfer full): the newly allocated #ClutterSize. | ||
4135 | 649 | * Use clutter_size_free() to free its resources. | ||
4136 | 650 | * | ||
4137 | 651 | * Since: 1.12 | ||
4138 | 652 | */ | ||
4139 | 653 | ClutterSize * | ||
4140 | 654 | clutter_size_alloc (void) | ||
4141 | 655 | { | ||
4142 | 656 | return g_slice_new0 (ClutterSize); | ||
4143 | 657 | } | ||
4144 | 658 | |||
4145 | 659 | /** | ||
4146 | 660 | * clutter_size_init: | ||
4147 | 661 | * @size: a #ClutterSize | ||
4148 | 662 | * @width: the width | ||
4149 | 663 | * @height: the height | ||
4150 | 664 | * | ||
4151 | 665 | * Initializes a #ClutterSize with the given dimensions. | ||
4152 | 666 | * | ||
4153 | 667 | * Return value: (transfer none): the initialized #ClutterSize | ||
4154 | 668 | * | ||
4155 | 669 | * Since: 1.12 | ||
4156 | 670 | */ | ||
4157 | 671 | ClutterSize * | ||
4158 | 672 | clutter_size_init (ClutterSize *size, | ||
4159 | 673 | float width, | ||
4160 | 674 | float height) | ||
4161 | 675 | { | ||
4162 | 676 | g_return_val_if_fail (size != NULL, NULL); | ||
4163 | 677 | |||
4164 | 678 | size->width = width; | ||
4165 | 679 | size->height = height; | ||
4166 | 680 | |||
4167 | 681 | return size; | ||
4168 | 682 | } | ||
4169 | 683 | |||
4170 | 684 | /** | ||
4171 | 685 | * clutter_size_copy: | ||
4172 | 686 | * @size: a #ClutterSize | ||
4173 | 687 | * | ||
4174 | 688 | * Creates a new #ClutterSize and duplicates @size. | ||
4175 | 689 | * | ||
4176 | 690 | * Return value: (transfer full): the newly allocated #ClutterSize. | ||
4177 | 691 | * Use clutter_size_free() to free its resources. | ||
4178 | 692 | * | ||
4179 | 693 | * Since: 1.12 | ||
4180 | 694 | */ | ||
4181 | 695 | ClutterSize * | ||
4182 | 696 | clutter_size_copy (const ClutterSize *size) | ||
4183 | 697 | { | ||
4184 | 698 | return g_slice_dup (ClutterSize, size); | ||
4185 | 699 | } | ||
4186 | 700 | |||
4187 | 701 | /** | ||
4188 | 702 | * clutter_size_free: | ||
4189 | 703 | * @size: a #ClutterSize | ||
4190 | 704 | * | ||
4191 | 705 | * Frees the resources allocated for @size. | ||
4192 | 706 | * | ||
4193 | 707 | * Since: 1.12 | ||
4194 | 708 | */ | ||
4195 | 709 | void | ||
4196 | 710 | clutter_size_free (ClutterSize *size) | ||
4197 | 711 | { | ||
4198 | 712 | if (size != NULL) | ||
4199 | 713 | g_slice_free (ClutterSize, size); | ||
4200 | 714 | } | ||
4201 | 715 | |||
4202 | 716 | /** | ||
4203 | 717 | * clutter_size_equals: | ||
4204 | 718 | * @a: a #ClutterSize to compare | ||
4205 | 719 | * @b: a #ClutterSize to compare | ||
4206 | 720 | * | ||
4207 | 721 | * Compares two #ClutterSize for equality. | ||
4208 | 722 | * | ||
4209 | 723 | * Return value: %TRUE if the two #ClutterSize are equal | ||
4210 | 724 | * | ||
4211 | 725 | * Since: 1.12 | ||
4212 | 726 | */ | ||
4213 | 727 | gboolean | ||
4214 | 728 | clutter_size_equals (const ClutterSize *a, | ||
4215 | 729 | const ClutterSize *b) | ||
4216 | 730 | { | ||
4217 | 731 | if (a == b) | ||
4218 | 732 | return TRUE; | ||
4219 | 733 | |||
4220 | 734 | if (a == NULL || b == NULL) | ||
4221 | 735 | return FALSE; | ||
4222 | 736 | |||
4223 | 737 | return fabsf (a->width - b->width) < FLOAT_EPSILON && | ||
4224 | 738 | fabsf (a->height - b->height) < FLOAT_EPSILON; | ||
4225 | 739 | } | ||
4226 | 740 | |||
4227 | 741 | static gboolean | ||
4228 | 742 | clutter_size_progress (const GValue *a, | ||
4229 | 743 | const GValue *b, | ||
4230 | 744 | gdouble progress, | ||
4231 | 745 | GValue *retval) | ||
4232 | 746 | { | ||
4233 | 747 | const ClutterSize *as = g_value_get_boxed (a); | ||
4234 | 748 | const ClutterSize *bs = g_value_get_boxed (b); | ||
4235 | 749 | ClutterSize res = CLUTTER_SIZE_INIT (0, 0); | ||
4236 | 750 | |||
4237 | 751 | res.width = as->width + (bs->width - as->width) * progress; | ||
4238 | 752 | res.height = as->height + (bs->height - as->height) * progress; | ||
4239 | 753 | |||
4240 | 754 | g_value_set_boxed (retval, &res); | ||
4241 | 755 | |||
4242 | 756 | return TRUE; | ||
4243 | 757 | } | ||
4244 | 758 | |||
4245 | 759 | G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterSize, clutter_size, | ||
4246 | 760 | clutter_size_copy, | ||
4247 | 761 | clutter_size_free, | ||
4248 | 762 | CLUTTER_REGISTER_INTERVAL_PROGRESS (clutter_size_progress)) | ||
4249 | 763 | |||
4250 | 764 | |||
4251 | 765 | 107 | ||
4252 | 766 | |||
4253 | 767 | /* | ||
4254 | 768 | * ClutterRect | ||
4255 | 769 | */ | ||
4256 | 770 | |||
4257 | 771 | static const ClutterRect _clutter_rect_zero = CLUTTER_RECT_INIT_ZERO; | ||
4258 | 772 | |||
4259 | 773 | static gboolean clutter_rect_progress (const GValue *a, | ||
4260 | 774 | const GValue *b, | ||
4261 | 775 | gdouble progress, | ||
4262 | 776 | GValue *res); | ||
4263 | 777 | |||
4264 | 778 | G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterRect, clutter_rect, | ||
4265 | 779 | clutter_rect_copy, | ||
4266 | 780 | clutter_rect_free, | ||
4267 | 781 | CLUTTER_REGISTER_INTERVAL_PROGRESS (clutter_rect_progress)) | ||
4268 | 782 | |||
4269 | 783 | static inline void | ||
4270 | 784 | clutter_rect_normalize_internal (ClutterRect *rect) | ||
4271 | 785 | { | ||
4272 | 786 | if (rect->size.width >= 0.f && rect->size.height >= 0.f) | ||
4273 | 787 | return; | ||
4274 | 788 | |||
4275 | 789 | if (rect->size.width < 0.f) | ||
4276 | 790 | { | ||
4277 | 791 | float size = fabsf (rect->size.width); | ||
4278 | 792 | |||
4279 | 793 | rect->origin.x -= size; | ||
4280 | 794 | rect->size.width = size; | ||
4281 | 795 | } | ||
4282 | 796 | |||
4283 | 797 | if (rect->size.height < 0.f) | ||
4284 | 798 | { | ||
4285 | 799 | float size = fabsf (rect->size.height); | ||
4286 | 800 | |||
4287 | 801 | rect->origin.y -= size; | ||
4288 | 802 | rect->size.height = size; | ||
4289 | 803 | } | ||
4290 | 804 | } | ||
4291 | 805 | |||
4292 | 806 | /** | ||
4293 | 807 | * clutter_rect_zero: | ||
4294 | 808 | * | ||
4295 | 809 | * A #ClutterRect with #ClutterRect.origin set at (0, 0) and a size | ||
4296 | 810 | * of 0. | ||
4297 | 811 | * | ||
4298 | 812 | * The returned value can be used as a guard. | ||
4299 | 813 | * | ||
4300 | 814 | * Return value: a rectangle with origin in (0, 0) and a size of 0. | ||
4301 | 815 | * The returned #ClutterRect is owned by Clutter and it should not | ||
4302 | 816 | * be modified or freed. | ||
4303 | 817 | * | ||
4304 | 818 | * Since: 1.12 | ||
4305 | 819 | */ | ||
4306 | 820 | const ClutterRect * | ||
4307 | 821 | clutter_rect_zero (void) | ||
4308 | 822 | { | ||
4309 | 823 | return &_clutter_rect_zero; | ||
4310 | 824 | } | ||
4311 | 825 | |||
4312 | 826 | /** | ||
4313 | 827 | * clutter_rect_alloc: (constructor) | ||
4314 | 828 | * | ||
4315 | 829 | * Creates a new, empty #ClutterRect. | ||
4316 | 830 | * | ||
4317 | 831 | * You can use clutter_rect_init() to initialize the returned rectangle, | ||
4318 | 832 | * for instance: | ||
4319 | 833 | * | ||
4320 | 834 | * |[ | ||
4321 | 835 | * rect = clutter_rect_init (clutter_rect_alloc (), x, y, width, height); | ||
4322 | 836 | * ]| | ||
4323 | 837 | * | ||
4324 | 838 | * Return value: (transfer full): the newly allocated #ClutterRect. | ||
4325 | 839 | * Use clutter_rect_free() to free its resources | ||
4326 | 840 | * | ||
4327 | 841 | * Since: 1.12 | ||
4328 | 842 | */ | ||
4329 | 843 | ClutterRect * | ||
4330 | 844 | clutter_rect_alloc (void) | ||
4331 | 845 | { | ||
4332 | 846 | return g_slice_new0 (ClutterRect); | ||
4333 | 847 | } | ||
4334 | 848 | |||
4335 | 849 | /** | ||
4336 | 850 | * clutter_rect_init: | ||
4337 | 851 | * @rect: a #ClutterRect | ||
4338 | 852 | * @x: X coordinate of the origin | ||
4339 | 853 | * @y: Y coordinate of the origin | ||
4340 | 854 | * @width: width of the rectangle | ||
4341 | 855 | * @height: height of the rectangle | ||
4342 | 856 | * | ||
4343 | 857 | * Initializes a #ClutterRect with the given origin and size. | ||
4344 | 858 | * | ||
4345 | 859 | * Return value: (transfer none): the updated rectangle | ||
4346 | 860 | * | ||
4347 | 861 | * Since: 1.12 | ||
4348 | 862 | */ | ||
4349 | 863 | ClutterRect * | ||
4350 | 864 | clutter_rect_init (ClutterRect *rect, | ||
4351 | 865 | float x, | ||
4352 | 866 | float y, | ||
4353 | 867 | float width, | ||
4354 | 868 | float height) | ||
4355 | 869 | { | ||
4356 | 870 | g_return_val_if_fail (rect != NULL, NULL); | ||
4357 | 871 | |||
4358 | 872 | rect->origin.x = x; | ||
4359 | 873 | rect->origin.y = y; | ||
4360 | 874 | |||
4361 | 875 | rect->size.width = width; | ||
4362 | 876 | rect->size.height = height; | ||
4363 | 877 | |||
4364 | 878 | return rect; | ||
4365 | 879 | } | ||
4366 | 880 | |||
4367 | 881 | /** | ||
4368 | 882 | * clutter_rect_copy: | ||
4369 | 883 | * @rect: a #ClutterRect | ||
4370 | 884 | * | ||
4371 | 885 | * Copies @rect into a new #ClutterRect instance. | ||
4372 | 886 | * | ||
4373 | 887 | * Return value: (transfer full): the newly allocate copy of @rect. | ||
4374 | 888 | * Use clutter_rect_free() to free the associated resources | ||
4375 | 889 | * | ||
4376 | 890 | * Since: 1.12 | ||
4377 | 891 | */ | ||
4378 | 892 | ClutterRect * | ||
4379 | 893 | clutter_rect_copy (const ClutterRect *rect) | ||
4380 | 894 | { | ||
4381 | 895 | if (rect != NULL) | ||
4382 | 896 | { | ||
4383 | 897 | ClutterRect *res; | ||
4384 | 898 | |||
4385 | 899 | res = g_slice_dup (ClutterRect, rect); | ||
4386 | 900 | clutter_rect_normalize_internal (res); | ||
4387 | 901 | |||
4388 | 902 | return res; | ||
4389 | 903 | } | ||
4390 | 904 | |||
4391 | 905 | return NULL; | ||
4392 | 906 | } | ||
4393 | 907 | |||
4394 | 908 | /** | ||
4395 | 909 | * clutter_rect_free: | ||
4396 | 910 | * @rect: a #ClutterRect | ||
4397 | 911 | * | ||
4398 | 912 | * Frees the resources allocated by @rect. | ||
4399 | 913 | * | ||
4400 | 914 | * Since: 1.12 | ||
4401 | 915 | */ | ||
4402 | 916 | void | ||
4403 | 917 | clutter_rect_free (ClutterRect *rect) | ||
4404 | 918 | { | ||
4405 | 919 | if (rect != NULL && rect != &_clutter_rect_zero) | ||
4406 | 920 | g_slice_free (ClutterRect, rect); | ||
4407 | 921 | } | ||
4408 | 922 | |||
4409 | 923 | /** | ||
4410 | 924 | * clutter_rect_equals: | ||
4411 | 925 | * @a: a #ClutterRect | ||
4412 | 926 | * @b: a #ClutterRect | ||
4413 | 927 | * | ||
4414 | 928 | * Checks whether @a and @b are equals. | ||
4415 | 929 | * | ||
4416 | 930 | * This function will normalize both @a and @b before comparing | ||
4417 | 931 | * their origin and size. | ||
4418 | 932 | * | ||
4419 | 933 | * Return value: %TRUE if the rectangles match in origin and size. | ||
4420 | 934 | * | ||
4421 | 935 | * Since: 1.12 | ||
4422 | 936 | */ | ||
4423 | 937 | gboolean | ||
4424 | 938 | clutter_rect_equals (ClutterRect *a, | ||
4425 | 939 | ClutterRect *b) | ||
4426 | 940 | { | ||
4427 | 941 | if (a == b) | ||
4428 | 942 | return TRUE; | ||
4429 | 943 | |||
4430 | 944 | if (a == NULL || b == NULL) | ||
4431 | 945 | return FALSE; | ||
4432 | 946 | |||
4433 | 947 | clutter_rect_normalize_internal (a); | ||
4434 | 948 | clutter_rect_normalize_internal (b); | ||
4435 | 949 | |||
4436 | 950 | return clutter_point_equals (&a->origin, &b->origin) && | ||
4437 | 951 | clutter_size_equals (&a->size, &b->size); | ||
4438 | 952 | } | ||
4439 | 953 | |||
4440 | 954 | /** | ||
4441 | 955 | * clutter_rect_normalize: | ||
4442 | 956 | * @rect: a #ClutterRect | ||
4443 | 957 | * | ||
4444 | 958 | * Normalizes a #ClutterRect. | ||
4445 | 959 | * | ||
4446 | 960 | * A #ClutterRect is defined by the area covered by its size; this means | ||
4447 | 961 | * that a #ClutterRect with #ClutterRect.origin in [ 0, 0 ] and a | ||
4448 | 962 | * #ClutterRect.size of [ 10, 10 ] is equivalent to a #ClutterRect with | ||
4449 | 963 | * #ClutterRect.origin in [ 10, 10 ] and a #ClutterRect.size of [ -10, -10 ]. | ||
4450 | 964 | * | ||
4451 | 965 | * This function is useful to ensure that a rectangle has positive width | ||
4452 | 966 | * and height; it will modify the passed @rect and normalize its size. | ||
4453 | 967 | * | ||
4454 | 968 | * Since: 1.12 | ||
4455 | 969 | */ | ||
4456 | 970 | ClutterRect * | ||
4457 | 971 | clutter_rect_normalize (ClutterRect *rect) | ||
4458 | 972 | { | ||
4459 | 973 | g_return_val_if_fail (rect != NULL, NULL); | ||
4460 | 974 | |||
4461 | 975 | clutter_rect_normalize_internal (rect); | ||
4462 | 976 | |||
4463 | 977 | return rect; | ||
4464 | 978 | } | ||
4465 | 979 | |||
4466 | 980 | /** | ||
4467 | 981 | * clutter_rect_get_center: | ||
4468 | 982 | * @rect: a #ClutterRect | ||
4469 | 983 | * @center: (out caller-allocates): a #ClutterPoint | ||
4470 | 984 | * | ||
4471 | 985 | * Retrieves the center of @rect, after normalizing the rectangle, | ||
4472 | 986 | * and updates @center with the correct coordinates. | ||
4473 | 987 | * | ||
4474 | 988 | * Since: 1.12 | ||
4475 | 989 | */ | ||
4476 | 990 | void | ||
4477 | 991 | clutter_rect_get_center (ClutterRect *rect, | ||
4478 | 992 | ClutterPoint *center) | ||
4479 | 993 | { | ||
4480 | 994 | g_return_if_fail (rect != NULL); | ||
4481 | 995 | g_return_if_fail (center != NULL); | ||
4482 | 996 | |||
4483 | 997 | clutter_rect_normalize_internal (rect); | ||
4484 | 998 | |||
4485 | 999 | center->x = rect->origin.x + (rect->size.width / 2.0f); | ||
4486 | 1000 | center->y = rect->origin.y + (rect->size.height / 2.0f); | ||
4487 | 1001 | } | ||
4488 | 1002 | |||
4489 | 1003 | /** | ||
4490 | 1004 | * clutter_rect_contains_point: | ||
4491 | 1005 | * @rect: a #ClutterRect | ||
4492 | 1006 | * @point: the point to check | ||
4493 | 1007 | * | ||
4494 | 1008 | * Checks whether @point is contained by @rect, after normalizing the | ||
4495 | 1009 | * rectangle. | ||
4496 | 1010 | * | ||
4497 | 1011 | * Return value: %TRUE if the @point is contained by @rect. | ||
4498 | 1012 | * | ||
4499 | 1013 | * Since: 1.12 | ||
4500 | 1014 | */ | ||
4501 | 1015 | gboolean | ||
4502 | 1016 | clutter_rect_contains_point (ClutterRect *rect, | ||
4503 | 1017 | ClutterPoint *point) | ||
4504 | 1018 | { | ||
4505 | 1019 | g_return_val_if_fail (rect != NULL, FALSE); | ||
4506 | 1020 | g_return_val_if_fail (point != NULL, FALSE); | ||
4507 | 1021 | |||
4508 | 1022 | clutter_rect_normalize_internal (rect); | ||
4509 | 1023 | |||
4510 | 1024 | return (point->x >= rect->origin.x) && | ||
4511 | 1025 | (point->y >= rect->origin.y) && | ||
4512 | 1026 | (point->x <= (rect->origin.x + rect->size.width)) && | ||
4513 | 1027 | (point->y <= (rect->origin.y + rect->size.height)); | ||
4514 | 1028 | } | ||
4515 | 1029 | |||
4516 | 1030 | /** | ||
4517 | 1031 | * clutter_rect_contains_rect: | ||
4518 | 1032 | * @a: a #ClutterRect | ||
4519 | 1033 | * @b: a #ClutterRect | ||
4520 | 1034 | * | ||
4521 | 1035 | * Checks whether @a contains @b. | ||
4522 | 1036 | * | ||
4523 | 1037 | * The first rectangle contains the second if the union of the | ||
4524 | 1038 | * two #ClutterRect is equal to the first rectangle. | ||
4525 | 1039 | * | ||
4526 | 1040 | * Return value: %TRUE if the first rectangle contains the second. | ||
4527 | 1041 | * | ||
4528 | 1042 | * Since: 1.12 | ||
4529 | 1043 | */ | ||
4530 | 1044 | gboolean | ||
4531 | 1045 | clutter_rect_contains_rect (ClutterRect *a, | ||
4532 | 1046 | ClutterRect *b) | ||
4533 | 1047 | { | ||
4534 | 1048 | ClutterRect res; | ||
4535 | 1049 | |||
4536 | 1050 | g_return_val_if_fail (a != NULL, FALSE); | ||
4537 | 1051 | g_return_val_if_fail (b != NULL, FALSE); | ||
4538 | 1052 | |||
4539 | 1053 | clutter_rect_union (a, b, &res); | ||
4540 | 1054 | |||
4541 | 1055 | return clutter_rect_equals (a, &res); | ||
4542 | 1056 | } | ||
4543 | 1057 | |||
4544 | 1058 | /** | ||
4545 | 1059 | * clutter_rect_union: | ||
4546 | 1060 | * @a: a #ClutterRect | ||
4547 | 1061 | * @b: a #ClutterRect | ||
4548 | 1062 | * @res: (out caller-allocates): a #ClutterRect | ||
4549 | 1063 | * | ||
4550 | 1064 | * Computes the smallest possible rectangle capable of fully containing | ||
4551 | 1065 | * both @a and @b, and places it into @res. | ||
4552 | 1066 | * | ||
4553 | 1067 | * This function will normalize both @a and @b prior to computing their | ||
4554 | 1068 | * union. | ||
4555 | 1069 | * | ||
4556 | 1070 | * Since: 1.12 | ||
4557 | 1071 | */ | ||
4558 | 1072 | void | ||
4559 | 1073 | clutter_rect_union (ClutterRect *a, | ||
4560 | 1074 | ClutterRect *b, | ||
4561 | 1075 | ClutterRect *res) | ||
4562 | 1076 | { | ||
4563 | 1077 | g_return_if_fail (a != NULL); | ||
4564 | 1078 | g_return_if_fail (b != NULL); | ||
4565 | 1079 | g_return_if_fail (res != NULL); | ||
4566 | 1080 | |||
4567 | 1081 | clutter_rect_normalize_internal (a); | ||
4568 | 1082 | clutter_rect_normalize_internal (b); | ||
4569 | 1083 | |||
4570 | 1084 | res->origin.x = MIN (a->origin.x, b->origin.x); | ||
4571 | 1085 | res->origin.y = MIN (a->origin.y, b->origin.y); | ||
4572 | 1086 | |||
4573 | 1087 | res->size.width = MAX (a->size.width, b->size.width); | ||
4574 | 1088 | res->size.height = MAX (a->size.height, b->size.height); | ||
4575 | 1089 | } | ||
4576 | 1090 | |||
4577 | 1091 | /** | ||
4578 | 1092 | * clutter_rect_intersection: | ||
4579 | 1093 | * @a: a #ClutterRect | ||
4580 | 1094 | * @b: a #ClutterRect | ||
4581 | 1095 | * @res: (out caller-allocates) (allow-none): a #ClutterRect, or %NULL | ||
4582 | 1096 | * | ||
4583 | 1097 | * Computes the intersection of @a and @b, and places it in @res, if @res | ||
4584 | 1098 | * is not %NULL. | ||
4585 | 1099 | * | ||
4586 | 1100 | * This function will normalize both @a and @b prior to computing their | ||
4587 | 1101 | * intersection. | ||
4588 | 1102 | * | ||
4589 | 1103 | * This function can be used to simply check if the intersection of @a and @b | ||
4590 | 1104 | * is not empty, by using %NULL for @res. | ||
4591 | 1105 | * | ||
4592 | 1106 | * Return value: %TRUE if the intersection of @a and @b is not empty | ||
4593 | 1107 | * | ||
4594 | 1108 | * Since: 1.12 | ||
4595 | 1109 | */ | ||
4596 | 1110 | gboolean | ||
4597 | 1111 | clutter_rect_intersection (ClutterRect *a, | ||
4598 | 1112 | ClutterRect *b, | ||
4599 | 1113 | ClutterRect *res) | ||
4600 | 1114 | { | ||
4601 | 1115 | float x_1, y_1, x_2, y_2; | ||
4602 | 1116 | |||
4603 | 1117 | g_return_val_if_fail (a != NULL, FALSE); | ||
4604 | 1118 | g_return_val_if_fail (b != NULL, FALSE); | ||
4605 | 1119 | |||
4606 | 1120 | clutter_rect_normalize_internal (a); | ||
4607 | 1121 | clutter_rect_normalize_internal (b); | ||
4608 | 1122 | |||
4609 | 1123 | x_1 = MAX (a->origin.x, b->origin.x); | ||
4610 | 1124 | y_1 = MAX (a->origin.y, b->origin.y); | ||
4611 | 1125 | x_2 = MIN (a->origin.x + a->size.width, b->origin.x + b->size.width); | ||
4612 | 1126 | y_2 = MIN (a->origin.y + a->size.height, b->origin.y + b->size.height); | ||
4613 | 1127 | |||
4614 | 1128 | if (x_1 >= x_2 || y_1 >= y_2) | ||
4615 | 1129 | { | ||
4616 | 1130 | if (res != NULL) | ||
4617 | 1131 | clutter_rect_init (res, 0.f, 0.f, 0.f, 0.f); | ||
4618 | 1132 | |||
4619 | 1133 | return FALSE; | ||
4620 | 1134 | } | ||
4621 | 1135 | |||
4622 | 1136 | if (res != NULL) | ||
4623 | 1137 | clutter_rect_init (res, x_1, y_1, x_2 - x_1, y_2 - y_1); | ||
4624 | 1138 | |||
4625 | 1139 | return TRUE; | ||
4626 | 1140 | } | ||
4627 | 1141 | |||
4628 | 1142 | /** | ||
4629 | 1143 | * clutter_rect_offset: | ||
4630 | 1144 | * @rect: a #ClutterRect | ||
4631 | 1145 | * @d_x: the horizontal offset value | ||
4632 | 1146 | * @d_y: the vertical offset value | ||
4633 | 1147 | * | ||
4634 | 1148 | * Offsets the origin of @rect by the given values, after normalizing | ||
4635 | 1149 | * the rectangle. | ||
4636 | 1150 | * | ||
4637 | 1151 | * Since: 1.12 | ||
4638 | 1152 | */ | ||
4639 | 1153 | void | ||
4640 | 1154 | clutter_rect_offset (ClutterRect *rect, | ||
4641 | 1155 | float d_x, | ||
4642 | 1156 | float d_y) | ||
4643 | 1157 | { | ||
4644 | 1158 | g_return_if_fail (rect != NULL); | ||
4645 | 1159 | |||
4646 | 1160 | clutter_rect_normalize_internal (rect); | ||
4647 | 1161 | |||
4648 | 1162 | rect->origin.x += d_x; | ||
4649 | 1163 | rect->origin.y += d_y; | ||
4650 | 1164 | } | ||
4651 | 1165 | |||
4652 | 1166 | /** | ||
4653 | 1167 | * clutter_rect_inset: | ||
4654 | 1168 | * @rect: a #ClutterRect | ||
4655 | 1169 | * @d_x: an horizontal value; a positive @d_x will create an inset rectangle, | ||
4656 | 1170 | * and a negative value will create a larger rectangle | ||
4657 | 1171 | * @d_y: a vertical value; a positive @d_x will create an inset rectangle, | ||
4658 | 1172 | * and a negative value will create a larger rectangle | ||
4659 | 1173 | * | ||
4660 | 1174 | * Normalizes the @rect and offsets its origin by the @d_x and @d_y values; | ||
4661 | 1175 | * the size is adjusted by (2 * @d_x, 2 * @d_y). | ||
4662 | 1176 | * | ||
4663 | 1177 | * If @d_x and @d_y are positive the size of the rectangle is decreased; if | ||
4664 | 1178 | * the values are negative, the size of the rectangle is increased. | ||
4665 | 1179 | * | ||
4666 | 1180 | * If the resulting rectangle has a negative width or height, the size is | ||
4667 | 1181 | * set to 0. | ||
4668 | 1182 | * | ||
4669 | 1183 | * Since: 1.12 | ||
4670 | 1184 | */ | ||
4671 | 1185 | void | ||
4672 | 1186 | clutter_rect_inset (ClutterRect *rect, | ||
4673 | 1187 | float d_x, | ||
4674 | 1188 | float d_y) | ||
4675 | 1189 | { | ||
4676 | 1190 | g_return_if_fail (rect != NULL); | ||
4677 | 1191 | |||
4678 | 1192 | clutter_rect_normalize_internal (rect); | ||
4679 | 1193 | |||
4680 | 1194 | rect->origin.x += d_x; | ||
4681 | 1195 | rect->origin.y += d_y; | ||
4682 | 1196 | |||
4683 | 1197 | if (d_x >= 0.f) | ||
4684 | 1198 | rect->size.width -= (d_x * 2.f); | ||
4685 | 1199 | else | ||
4686 | 1200 | rect->size.width += (d_x * -2.f); | ||
4687 | 1201 | |||
4688 | 1202 | if (d_y >= 0.f) | ||
4689 | 1203 | rect->size.height -= (d_y * 2.f); | ||
4690 | 1204 | else | ||
4691 | 1205 | rect->size.height += (d_y * -2.f); | ||
4692 | 1206 | |||
4693 | 1207 | if (rect->size.width < 0.f) | ||
4694 | 1208 | rect->size.width = 0.f; | ||
4695 | 1209 | |||
4696 | 1210 | if (rect->size.height < 0.f) | ||
4697 | 1211 | rect->size.height = 0.f; | ||
4698 | 1212 | } | ||
4699 | 1213 | |||
4700 | 1214 | /** | ||
4701 | 1215 | * clutter_rect_scale: | ||
4702 | 1216 | * @rect: a #ClutterRect | ||
4703 | 1217 | * @s_x: an horizontal scale value | ||
4704 | 1218 | * @s_y: a vertical scale value | ||
4705 | 1219 | * | ||
4706 | 1220 | * Scale the rectangle coordinates and size by @s_x horizontally and | ||
4707 | 1221 | * @s_y vertically. | ||
4708 | 1222 | */ | ||
4709 | 1223 | void | ||
4710 | 1224 | clutter_rect_scale (ClutterRect *rect, | ||
4711 | 1225 | float s_x, | ||
4712 | 1226 | float s_y) | ||
4713 | 1227 | { | ||
4714 | 1228 | g_return_if_fail (rect != NULL); | ||
4715 | 1229 | g_return_if_fail (s_x > 0.f); | ||
4716 | 1230 | g_return_if_fail (s_y > 0.f); | ||
4717 | 1231 | |||
4718 | 1232 | clutter_rect_normalize_internal (rect); | ||
4719 | 1233 | |||
4720 | 1234 | rect->origin.x *= s_x; | ||
4721 | 1235 | rect->origin.y *= s_y; | ||
4722 | 1236 | rect->size.width *= s_x; | ||
4723 | 1237 | rect->size.height *= s_y; | ||
4724 | 1238 | } | ||
4725 | 1239 | |||
4726 | 1240 | /** | ||
4727 | 1241 | * clutter_rect_clamp_to_pixel: | ||
4728 | 1242 | * @rect: a #ClutterRect | ||
4729 | 1243 | * | ||
4730 | 1244 | * Rounds the origin of @rect downwards to the nearest integer, and recompute the | ||
4731 | 1245 | * the size using the @rect origin and size rounded upwards to the nearest integer, | ||
4732 | 1246 | * so that @rect is updated to the smallest rectangle capable of fully containing | ||
4733 | 1247 | * the original, fractional rectangle in the coordinates space. | ||
4734 | 1248 | * | ||
4735 | 1249 | * Since: 1.12 | ||
4736 | 1250 | */ | ||
4737 | 1251 | void | ||
4738 | 1252 | clutter_rect_clamp_to_pixel (ClutterRect *rect) | ||
4739 | 1253 | { | ||
4740 | 1254 | float x2, y2; | ||
4741 | 1255 | |||
4742 | 1256 | g_return_if_fail (rect != NULL); | ||
4743 | 1257 | |||
4744 | 1258 | clutter_rect_normalize_internal (rect); | ||
4745 | 1259 | |||
4746 | 1260 | x2 = rect->origin.x + rect->size.width; | ||
4747 | 1261 | y2 = rect->origin.y + rect->size.height; | ||
4748 | 1262 | |||
4749 | 1263 | rect->origin.x = floorf (rect->origin.x); | ||
4750 | 1264 | rect->origin.y = floorf (rect->origin.y); | ||
4751 | 1265 | |||
4752 | 1266 | rect->size.width = ceilf (x2) - rect->origin.x; | ||
4753 | 1267 | rect->size.height = ceilf (y2) - rect->origin.y; | ||
4754 | 1268 | } | ||
4755 | 1269 | |||
4756 | 1270 | /** | ||
4757 | 1271 | * clutter_rect_get_x: | ||
4758 | 1272 | * @rect: a #ClutterRect | ||
4759 | 1273 | * | ||
4760 | 1274 | * Retrieves the X coordinate of the origin of @rect. | ||
4761 | 1275 | * | ||
4762 | 1276 | * Return value: the X coordinate of the origin of the rectangle | ||
4763 | 1277 | * | ||
4764 | 1278 | * Since: 1.12 | ||
4765 | 1279 | */ | ||
4766 | 1280 | float | ||
4767 | 1281 | clutter_rect_get_x (ClutterRect *rect) | ||
4768 | 1282 | { | ||
4769 | 1283 | g_return_val_if_fail (rect != NULL, 0.f); | ||
4770 | 1284 | |||
4771 | 1285 | clutter_rect_normalize_internal (rect); | ||
4772 | 1286 | |||
4773 | 1287 | return rect->origin.x; | ||
4774 | 1288 | } | ||
4775 | 1289 | |||
4776 | 1290 | /** | ||
4777 | 1291 | * clutter_rect_get_y: | ||
4778 | 1292 | * @rect: a #ClutterRect | ||
4779 | 1293 | * | ||
4780 | 1294 | * Retrieves the Y coordinate of the origin of @rect. | ||
4781 | 1295 | * | ||
4782 | 1296 | * Return value: the Y coordinate of the origin of the rectangle | ||
4783 | 1297 | * | ||
4784 | 1298 | * Since: 1.12 | ||
4785 | 1299 | */ | ||
4786 | 1300 | float | ||
4787 | 1301 | clutter_rect_get_y (ClutterRect *rect) | ||
4788 | 1302 | { | ||
4789 | 1303 | g_return_val_if_fail (rect != NULL, 0.f); | ||
4790 | 1304 | |||
4791 | 1305 | clutter_rect_normalize_internal (rect); | ||
4792 | 1306 | |||
4793 | 1307 | return rect->origin.y; | ||
4794 | 1308 | } | ||
4795 | 1309 | |||
4796 | 1310 | /** | ||
4797 | 1311 | * clutter_rect_get_width: | ||
4798 | 1312 | * @rect: a #ClutterRect | ||
4799 | 1313 | * | ||
4800 | 1314 | * Retrieves the width of @rect. | ||
4801 | 1315 | * | ||
4802 | 1316 | * Return value: the width of the rectangle | ||
4803 | 1317 | * | ||
4804 | 1318 | * Since: 1.12 | ||
4805 | 1319 | */ | ||
4806 | 1320 | float | ||
4807 | 1321 | clutter_rect_get_width (ClutterRect *rect) | ||
4808 | 1322 | { | ||
4809 | 1323 | g_return_val_if_fail (rect != NULL, 0.f); | ||
4810 | 1324 | |||
4811 | 1325 | clutter_rect_normalize_internal (rect); | ||
4812 | 1326 | |||
4813 | 1327 | return rect->size.width; | ||
4814 | 1328 | } | ||
4815 | 1329 | |||
4816 | 1330 | /** | ||
4817 | 1331 | * clutter_rect_get_height: | ||
4818 | 1332 | * @rect: a #ClutterRect | ||
4819 | 1333 | * | ||
4820 | 1334 | * Retrieves the height of @rect. | ||
4821 | 1335 | * | ||
4822 | 1336 | * Return value: the height of the rectangle | ||
4823 | 1337 | * | ||
4824 | 1338 | * Since: 1.12 | ||
4825 | 1339 | */ | ||
4826 | 1340 | float | ||
4827 | 1341 | clutter_rect_get_height (ClutterRect *rect) | ||
4828 | 1342 | { | ||
4829 | 1343 | g_return_val_if_fail (rect != NULL, 0.f); | ||
4830 | 1344 | |||
4831 | 1345 | clutter_rect_normalize_internal (rect); | ||
4832 | 1346 | |||
4833 | 1347 | return rect->size.height; | ||
4834 | 1348 | } | ||
4835 | 1349 | |||
4836 | 1350 | static gboolean | ||
4837 | 1351 | clutter_rect_progress (const GValue *a, | ||
4838 | 1352 | const GValue *b, | ||
4839 | 1353 | gdouble progress, | ||
4840 | 1354 | GValue *retval) | ||
4841 | 1355 | { | ||
4842 | 1356 | const ClutterRect *rect_a = g_value_get_boxed (a); | ||
4843 | 1357 | const ClutterRect *rect_b = g_value_get_boxed (b); | ||
4844 | 1358 | ClutterRect res = CLUTTER_RECT_INIT_ZERO; | ||
4845 | 1359 | |||
4846 | 1360 | #define INTERPOLATE(r_a,r_b,member,field,factor) ((r_a)->member.field + (((r_b)->member.field - ((r_a)->member.field)) * (factor))) | ||
4847 | 1361 | |||
4848 | 1362 | res.origin.x = INTERPOLATE (rect_a, rect_b, origin, x, progress); | ||
4849 | 1363 | res.origin.y = INTERPOLATE (rect_a, rect_b, origin, y, progress); | ||
4850 | 1364 | |||
4851 | 1365 | res.size.width = INTERPOLATE (rect_a, rect_b, size, width, progress); | ||
4852 | 1366 | res.size.height = INTERPOLATE (rect_a, rect_b, size, height, progress); | ||
4853 | 1367 | |||
4854 | 1368 | #undef INTERPOLATE | ||
4855 | 1369 | |||
4856 | 1370 | g_value_set_boxed (retval, &res); | ||
4857 | 1371 | |||
4858 | 1372 | return TRUE; | ||
4859 | 1373 | } | ||
4860 | 1374 | |||
4861 | 1375 | /** | 108 | /** |
4862 | 1376 | * ClutterMatrix: | 109 | * ClutterMatrix: |
4863 | 1377 | * | 110 | * |
4864 | @@ -1393,20 +126,20 @@ clutter_matrix_progress (const GValue *a, | |||
4865 | 1393 | { | 126 | { |
4866 | 1394 | const ClutterMatrix *matrix1 = g_value_get_boxed (a); | 127 | const ClutterMatrix *matrix1 = g_value_get_boxed (a); |
4867 | 1395 | const ClutterMatrix *matrix2 = g_value_get_boxed (b); | 128 | const ClutterMatrix *matrix2 = g_value_get_boxed (b); |
4869 | 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); |
4870 | 1397 | float shear1[3] = { 0.f, 0.f, 0.f }; | 130 | float shear1[3] = { 0.f, 0.f, 0.f }; |
4873 | 1398 | ClutterVertex rotate1 = CLUTTER_VERTEX_INIT_ZERO; | 131 | graphene_point3d_t rotate1 = GRAPHENE_POINT3D_INIT_ZERO; |
4874 | 1399 | ClutterVertex translate1 = CLUTTER_VERTEX_INIT_ZERO; | 132 | graphene_point3d_t translate1 = GRAPHENE_POINT3D_INIT_ZERO; |
4875 | 1400 | ClutterVertex4 perspective1 = { 0.f, 0.f, 0.f, 0.f }; | 133 | ClutterVertex4 perspective1 = { 0.f, 0.f, 0.f, 0.f }; |
4877 | 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); |
4878 | 1402 | float shear2[3] = { 0.f, 0.f, 0.f }; | 135 | float shear2[3] = { 0.f, 0.f, 0.f }; |
4881 | 1403 | ClutterVertex rotate2 = CLUTTER_VERTEX_INIT_ZERO; | 136 | graphene_point3d_t rotate2 = GRAPHENE_POINT3D_INIT_ZERO; |
4882 | 1404 | ClutterVertex translate2 = CLUTTER_VERTEX_INIT_ZERO; | 137 | graphene_point3d_t translate2 = GRAPHENE_POINT3D_INIT_ZERO; |
4883 | 1405 | ClutterVertex4 perspective2 = { 0.f, 0.f, 0.f, 0.f }; | 138 | ClutterVertex4 perspective2 = { 0.f, 0.f, 0.f, 0.f }; |
4885 | 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); |
4886 | 1407 | float shear_res = 0.f; | 140 | float shear_res = 0.f; |
4889 | 1408 | ClutterVertex rotate_res = CLUTTER_VERTEX_INIT_ZERO; | 141 | graphene_point3d_t rotate_res = GRAPHENE_POINT3D_INIT_ZERO; |
4890 | 1409 | ClutterVertex translate_res = CLUTTER_VERTEX_INIT_ZERO; | 142 | graphene_point3d_t translate_res = GRAPHENE_POINT3D_INIT_ZERO; |
4891 | 1410 | ClutterVertex4 perspective_res = { 0.f, 0.f, 0.f, 0.f }; | 143 | ClutterVertex4 perspective_res = { 0.f, 0.f, 0.f, 0.f }; |
4892 | 1411 | ClutterMatrix res; | 144 | ClutterMatrix res; |
4893 | 1412 | 145 | ||
4894 | @@ -1427,11 +160,11 @@ clutter_matrix_progress (const GValue *a, | |||
4895 | 1427 | res.ww = perspective_res.w; | 160 | res.ww = perspective_res.w; |
4896 | 1428 | 161 | ||
4897 | 1429 | /* translation */ | 162 | /* translation */ |
4899 | 1430 | clutter_vertex_interpolate (&translate1, &translate2, progress, &translate_res); | 163 | graphene_point3d_interpolate (&translate1, &translate2, progress, &translate_res); |
4900 | 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); |
4901 | 1432 | 165 | ||
4902 | 1433 | /* rotation */ | 166 | /* rotation */ |
4904 | 1434 | clutter_vertex_interpolate (&rotate1, &rotate2, progress, &rotate_res); | 167 | graphene_point3d_interpolate (&rotate1, &rotate2, progress, &rotate_res); |
4905 | 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); |
4906 | 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); |
4907 | 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); |
4908 | @@ -1450,7 +183,7 @@ clutter_matrix_progress (const GValue *a, | |||
4909 | 1450 | _clutter_util_matrix_skew_xy (&res, shear_res); | 183 | _clutter_util_matrix_skew_xy (&res, shear_res); |
4910 | 1451 | 184 | ||
4911 | 1452 | /* scale */ | 185 | /* scale */ |
4913 | 1453 | clutter_vertex_interpolate (&scale1, &scale2, progress, &scale_res); | 186 | graphene_point3d_interpolate (&scale1, &scale2, progress, &scale_res); |
4914 | 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); |
4915 | 1455 | 188 | ||
4916 | 1456 | g_value_set_boxed (retval, &res); | 189 | g_value_set_boxed (retval, &res); |
4917 | diff --git a/clutter/clutter/clutter-bin-layout.c b/clutter/clutter/clutter-bin-layout.c | |||
4918 | index 6bcdbe7..8c63b80 100644 | |||
4919 | --- a/clutter/clutter/clutter-bin-layout.c | |||
4920 | +++ b/clutter/clutter/clutter-bin-layout.c | |||
4921 | @@ -49,10 +49,10 @@ | |||
4922 | 49 | 49 | ||
4923 | 50 | #define CLUTTER_DISABLE_DEPRECATION_WARNINGS | 50 | #define CLUTTER_DISABLE_DEPRECATION_WARNINGS |
4924 | 51 | #include "deprecated/clutter-container.h" | 51 | #include "deprecated/clutter-container.h" |
4925 | 52 | #include "deprecated/clutter-bin-layout.h" | ||
4926 | 53 | 52 | ||
4927 | 54 | #include "clutter-actor-private.h" | 53 | #include "clutter-actor-private.h" |
4928 | 55 | #include "clutter-animatable.h" | 54 | #include "clutter-animatable.h" |
4929 | 55 | #include "clutter-bin-layout.h" | ||
4930 | 56 | #include "clutter-child-meta.h" | 56 | #include "clutter-child-meta.h" |
4931 | 57 | #include "clutter-debug.h" | 57 | #include "clutter-debug.h" |
4932 | 58 | #include "clutter-enum-types.h" | 58 | #include "clutter-enum-types.h" |
4933 | @@ -698,187 +698,3 @@ clutter_bin_layout_new (ClutterBinAlignment x_align, | |||
4934 | 698 | "y-align", y_align, | 698 | "y-align", y_align, |
4935 | 699 | NULL); | 699 | NULL); |
4936 | 700 | } | 700 | } |
4937 | 701 | |||
4938 | 702 | /** | ||
4939 | 703 | * clutter_bin_layout_set_alignment: | ||
4940 | 704 | * @self: a #ClutterBinLayout | ||
4941 | 705 | * @child: (allow-none): a child of @container | ||
4942 | 706 | * @x_align: the horizontal alignment policy to be used for the @child | ||
4943 | 707 | * inside @container | ||
4944 | 708 | * @y_align: the vertical aligment policy to be used on the @child | ||
4945 | 709 | * inside @container | ||
4946 | 710 | * | ||
4947 | 711 | * Sets the horizontal and vertical alignment policies to be applied | ||
4948 | 712 | * to a @child of @self | ||
4949 | 713 | * | ||
4950 | 714 | * If @child is %NULL then the @x_align and @y_align values will | ||
4951 | 715 | * be set as the default alignment policies | ||
4952 | 716 | * | ||
4953 | 717 | * Since: 1.2 | ||
4954 | 718 | * | ||
4955 | 719 | * Deprecated: 1.12: Use the #ClutterActor:x-align and | ||
4956 | 720 | * #ClutterActor:y-align properties of #ClutterActor instead. | ||
4957 | 721 | */ | ||
4958 | 722 | void | ||
4959 | 723 | clutter_bin_layout_set_alignment (ClutterBinLayout *self, | ||
4960 | 724 | ClutterActor *child, | ||
4961 | 725 | ClutterBinAlignment x_align, | ||
4962 | 726 | ClutterBinAlignment y_align) | ||
4963 | 727 | { | ||
4964 | 728 | ClutterBinLayoutPrivate *priv; | ||
4965 | 729 | ClutterLayoutManager *manager; | ||
4966 | 730 | ClutterLayoutMeta *meta; | ||
4967 | 731 | |||
4968 | 732 | g_return_if_fail (CLUTTER_IS_BIN_LAYOUT (self)); | ||
4969 | 733 | g_return_if_fail (child == NULL || CLUTTER_IS_ACTOR (child)); | ||
4970 | 734 | |||
4971 | 735 | priv = self->priv; | ||
4972 | 736 | |||
4973 | 737 | if (priv->container == NULL) | ||
4974 | 738 | { | ||
4975 | 739 | if (child == NULL) | ||
4976 | 740 | { | ||
4977 | 741 | set_x_align (self, x_align); | ||
4978 | 742 | set_y_align (self, y_align); | ||
4979 | 743 | } | ||
4980 | 744 | else | ||
4981 | 745 | g_warning ("The layout of type '%s' must be associated to " | ||
4982 | 746 | "a ClutterContainer before setting the alignment " | ||
4983 | 747 | "on its children", | ||
4984 | 748 | G_OBJECT_TYPE_NAME (self)); | ||
4985 | 749 | |||
4986 | 750 | return; | ||
4987 | 751 | } | ||
4988 | 752 | |||
4989 | 753 | manager = CLUTTER_LAYOUT_MANAGER (self); | ||
4990 | 754 | meta = clutter_layout_manager_get_child_meta (manager, | ||
4991 | 755 | priv->container, | ||
4992 | 756 | child); | ||
4993 | 757 | g_assert (CLUTTER_IS_BIN_LAYER (meta)); | ||
4994 | 758 | |||
4995 | 759 | set_layer_x_align (CLUTTER_BIN_LAYER (meta), x_align); | ||
4996 | 760 | set_layer_y_align (CLUTTER_BIN_LAYER (meta), y_align); | ||
4997 | 761 | } | ||
4998 | 762 | |||
4999 | 763 | /** | ||
5000 | 764 | * clutter_bin_layout_get_alignment: |
The diff has been truncated for viewing.