Compare commits

..

10 Commits

Author SHA1 Message Date
Bruce Leidl
7cab502754 Citadel changes to Mutter 2021-12-03 14:07:17 -05:00
Florian Müllner
8de96d3d7c Bump version to 41.1
Update NEWS.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2075>
2021-11-03 19:58:30 +01:00
Jason Gerecke
ad787c3cf7 input-mapper: Reverse sort order of display score comparator
The `guess_candidates()` function scores each display that an input
device could be mapped to and then uses the `sort_by_score()` comparator
to find the best option. The function expects the list to be sorted from
best to worst, but the comparator currently sorts them in the opposite
order. This causes the function to end up returning the _worst_ match
rather than the the best. This commit reverses the sort order of the
comparator so that the best display can be returned as intended.

Closes: #1889

(Cherry-picked from commit 64ff1f20f8)
2021-11-02 19:11:51 +01:00
Robert Mader
7f9defb444 clutter/stage: Only add paint volumes of mapped actors to stage clip
Right now we damage the stage even if an actor is not mapped, for
example in the overview.

Stop doing so, reducing over-paint significantly in some situations.
Clones will still do stage damage on their own.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2035>
(cherry picked from commit 136caca5d5)
2021-11-02 16:19:39 +01:00
Sebastian Keller
c33ca49dfc clutter/offscreen-effect: Consider paint volumes at negative coordinates
When basing the offscreen texture position off the paint volume, the
code was assuming that the paint volume was always starting at 0,0 but
this is not the case if child widgets are placed at negative coordinates
or the widget itself is transformed. This could cause such widgets that
have been flattened and therefore rendered to an offscreen texture to
appear cut off in the top/left.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4561
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1923
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2031>
(cherry picked from commit 3768efef2b)
2021-11-02 16:19:39 +01:00
Carlos Garnacho
fd826632e8 core: Use b/w unicode for tablet mode OSD
This unicode was initially meant to be b/w, but fonts and pango
eventually had another plan and we ended up with color glyphs
being used here, so we get strings like "". Change the
unicode used to ensure these are simpler b/w glyhps like
"● ○ ○ ○" that are easier to read on the OSD (and maybe even a
bit less ugly).

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4733
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2064>
(cherry picked from commit 5125f66afa)
2021-11-02 16:19:39 +01:00
Quytelda Kahja
2f5c4bfc86 clutter: Fix event axes array indices in axis broadcasts
A clutter event's axes array is indexed by `ClutterInputAxis`.
However, a few lines accidentally use `ClutterInputAxisFlags` as
indices, reading incorrect values from elsewhere in memory. As a
result, broadcasted axis values for the tilt, rotation, and wheel
axes don't reflect actual event data.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1982
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2065>
(cherry picked from commit af6fb2a702)
2021-11-02 16:19:39 +01:00
Carlos Garnacho
42d6013bc5 clutter: Only reset preedit text if set
On ClutterInputFocus::reset, avoid to unset the preedit text if
none was set earlier. This seems to trick GTK clients into focusing
the cursor position again, even when we are moving away from it.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4647

(Cherry-picked from commit 3b6f9111c7)
2021-11-01 18:37:54 +01:00
Rūdolfs Mazurs
4ccdedfd99 Update Latvian translation 2021-10-26 19:14:57 +00:00
Robert Mader
3fb3764d27 wayland/data-offer: Accept final preferrence of drop destination
Quoting the spec for `wl_data_device::drop`:
> If the resulting action is "ask", the action will not be considered
> final. The drag-and-drop destination is expected to perform one last
> wl_data_offer.set_actions request, or wl_data_offer.destroy in order
> to cancel the operation.

We did not respect the action choosen by the drop destination when
it called `wl_data_offer::set_actions` after `wl_data_device::drop`
if a user override was still active. This eventually resulted in
a protocol error in `wl_data_offer::finish`, as the current action
could still be `ask`.

Fix this by only allowing a user override to `ask` before `drop` is
called, thus making sure the final `set_actions` preference is
honored.

Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/1952

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2043>

(cherry picked from commit 33b834c433)
2021-10-14 23:11:23 +02:00
1726 changed files with 83104 additions and 134163 deletions

104
.gitignore vendored
View File

@@ -1,6 +1,106 @@
build-aux
compile
config.h
config.h.in
ltmain.sh
missing
50-mutter-navigation.xml
50-mutter-system.xml
50-mutter-windows.xml
mutter.desktop
mutter-wayland.desktop
*.o
*.a
*.lo
*.la
.libs
*.swp
*.gir
*.typelib
*.gmo
*.make
*.log
*.trs
*~
POTFILES
Makevars.template
po/*.header
po/*.pot
po/*.sed
po/*.sin
Rules-quot
libmutter.pc
mutter
mutter-restart-helper
mutter-test-client
mutter-test-runner
mutter-test-unit-tests
mutter-test-headless-start-test
mutter-all.test
org.gnome.mutter.gschema.valid
org.gnome.mutter.gschema.xml
org.gnome.mutter.wayland.gschema.valid
org.gnome.mutter.wayland.gschema.xml
testasyncgetprop
testboxes
testgradient
INSTALL
meta-enum-types.[ch]
src/stamp-meta-enum-types.h
src/meta-dbus-display-config.[ch]
src/meta-dbus-idle-monitor.[ch]
src/meta-dbus-login1.[ch]
src/meta-dbus-remote-desktop.[ch]
src/meta-dbus-screen-cast.[ch]
src/gtk-primary-selection-protocol.c
src/gtk-primary-selection-server-protocol.h
src/gtk-shell-protocol.c
src/gtk-shell-server-protocol.h
src/xdg-shell-unstable-v*-protocol.c
src/xdg-shell-unstable-v*-server-protocol.h
src/pointer-gestures-unstable-v*-protocol.c
src/pointer-gestures-unstable-v*-server-protocol.h
src/relative-pointer-unstable-v*-protocol.c
src/relative-pointer-unstable-v*-server-protocol.h
src/pointer-constraints-unstable-v*-protocol.c
src/pointer-constraints-unstable-v*-server-protocol.h
src/xdg-foreign-unstable-v*-protocol.c
src/xdg-foreign-unstable-v*-server-protocol.h
src/xdg-output-unstable-v1-protocol.c
src/xdg-output-unstable-v1-server-protocol.h
src/xwayland-keyboard-grab-unstable-v1-protocol.c
src/xwayland-keyboard-grab-unstable-v1-server-protocol.h
src/tablet-unstable-v*-protocol.c
src/tablet-unstable-v*-server-protocol.h
src/text-input-unstable-v*-protocol.c
src/text-input-unstable-v*-server-protocol.h
src/keyboard-shortcuts-inhibit-unstable-v*-protocol.c
src/keyboard-shortcuts-inhibit-unstable-v*-server-protocol.h
src/linux-dmabuf-unstable-v*-protocol.c
src/linux-dmabuf-unstable-v*-server-protocol.h
src/xdg-shell-protocol.c
src/xdg-shell-server-protocol.h
src/wayland-eglstream-controller-server-protocol.h
src/meta/meta-version.h
src/libmutter-*.pc
doc/reference/*.args
doc/reference/*.bak
doc/reference/*.hierarchy
doc/reference/*.interfaces
doc/reference/*.prerequisites
doc/reference/*.signals
doc/reference/*.stamp
doc/reference/html/
doc/reference/xml/
doc/reference/meta-decl-list.txt
doc/reference/meta-decl.txt
doc/reference/meta-overrides.txt
doc/reference/meta-undeclared.txt
doc/reference/meta-undocumented.txt
doc/reference/meta-unused.txt
doc/reference/meta-docs.sgml
doc/reference/meta.types
.dirstamp
**/tags.*
build/
subprojects/sysprof/
__pycache__/
.buildconfig

View File

@@ -1,6 +1,6 @@
include:
- remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/28b430bd847da130d7c678772b8be260abaab5b3/templates/fedora.yml'
- remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/34f4ade99434043f88e164933f570301fd18b125/templates/ci-fairy.yml'
- remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/bbe5232986c9b98eb1efe62484e07216f7d1a4df/templates/fedora.yml'
- remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/bbe5232986c9b98eb1efe62484e07216f7d1a4df/templates/ci-fairy.yml'
stages:
- review
@@ -9,167 +9,49 @@ stages:
- build
- test
- analyze
- docs
- deploy
variables:
FDO_UPSTREAM_REPO: GNOME/mutter
.skip-git-clone:
.mutter.fedora:34@common:
variables:
GIT_STRATEGY: none
.mutter.git-clone:
extends:
- .skip-git-clone
variables:
MUTTER_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_PATH
MUTTER_CLONE_DEPTH: 1
before_script: |
if [ -n "$MUTTER_CLONE_PATH" ]; then
set -x
uri="$CI_REPOSITORY_URL"
if [ -n "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" ]; then
uri="$CI_MERGE_REQUEST_SOURCE_PROJECT_URL.git"
branch="$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
elif [ -n "$CI_COMMIT_BRANCH" ]; then
branch="$CI_COMMIT_BRANCH"
else
branch="$CI_DEFAULT_BRANCH"
fi
if [ ! -d "$MUTTER_CLONE_PATH" ] || [ -z "$(ls -A "$MUTTER_CLONE_PATH")" ]; then
git clone --depth $MUTTER_CLONE_DEPTH "$uri" "$MUTTER_CLONE_PATH" -b "$branch"
elif [ ! -d "$MUTTER_CLONE_PATH/.git" ]; then
git clone --bare --depth $MUTTER_CLONE_DEPTH "$uri" "$MUTTER_CLONE_PATH/.git" -b "$branch"
if git -C "$MUTTER_CLONE_PATH" config --unset core.bare; then
git -C "$MUTTER_CLONE_PATH" checkout
else
# For some weird reasons sometimes the fast-path could fail with
# "fatal: not in a git directory" error, so handle it manually
tmpdir=$(mktemp --directory --tmpdir mutter-XXXXXX)
mkdir "$tmpdir/repo"
mv "$MUTTER_CLONE_PATH/.git" "$tmpdir/repo/"
git clone "$tmpdir/repo" "$tmpdir/src"
mv "$tmpdir"/src/* "$tmpdir"/src/.* "$MUTTER_CLONE_PATH"
rm -r "$tmpdir/repo"
rm -rv "$tmpdir"
fi
fi
set +x
fi
.mutter.skip-git-clone:
extends:
- .skip-git-clone
variables:
MUTTER_CLONE_PATH: ''
.mutter.run-as-user:
image:
name: ${FDO_DISTRIBUTION_IMAGE}
entrypoint:
- 'runuser'
- '-u'
- !reference [.mutter.fedora@common, variables, MUTTER_USER]
- '--'
.mutter.distribution-image:
extends:
- .fdo.distribution-image@fedora
- .mutter.run-as-user
.mutter.fedora@common:
extends:
- .skip-git-clone
variables:
FDO_DISTRIBUTION_VERSION: 39
BASE_TAG: '2023-09-12.0'
MUTTER_USER: 'meta-user'
FDO_DISTRIBUTION_VERSION: 34
BASE_TAG: '2021-09-04.1'
FDO_DISTRIBUTION_PACKAGES:
asciidoc
clang
gcovr
gdm
gnome-shell
python3-dbusmock
sassc
uncrustify
xorg-x11-server-Xvfb
mesa-dri-drivers
xorg-x11-proto-devel
qemu-system-x86-core
busybox
zenity
gi-docgen
python3-dbusmock
pkgconfig(libgcrypt)
pkgconfig(libdisplay-info)
FDO_DISTRIBUTION_EXEC: |
set -e
dnf install -y 'dnf-command(builddep)' &&
# Create $MUTTER_USER
useradd -u 9999 -b /opt/mutter -ms /bin/bash $MUTTER_USER
# Enable sudo for $MUTTER_USER
echo "%$MUTTER_USER ALL = (ALL) NOPASSWD: ALL" > /etc/sudoers.d/99_mutter-user
dnf install -y 'dnf-command(builddep)'
dnf builddep -y mutter --setopt=install_weak_deps=False
dnf builddep -y gnome-shell --setopt=install_weak_deps=False
dnf builddep -y kernel --setopt=install_weak_deps=False
dnf builddep -y libei --setopt=install_weak_deps=False
./.gitlab-ci/install-meson-project.sh \
https://gitlab.gnome.org/jadahl/catch.git \
main . 29ad36e2b1d28ac9d8b2bc44af46296cb1db5d66
dnf builddep -y mutter --setopt=install_weak_deps=False &&
dnf builddep -y gnome-shell --setopt=install_weak_deps=False &&
./.gitlab-ci/install-meson-project.sh \
https://gitlab.gnome.org/GNOME/glib.git \
main . a7c34b431bfaf3d56de64cb1cfea851ac11099d3
main . 02742ef957b532789c003eef80ec7f51c370e3d5 &&
./.gitlab-ci/install-meson-project.sh \
https://gitlab.freedesktop.org/libinput/libei.git \
1.0.901 .
https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas.git \
41.alpha . &&
./.gitlab-ci/install-meson-project.sh \
https://gitlab.gnome.org/GNOME/gjs.git \
1.69.2 . &&
rpm -e --nodeps gnome-bluetooth-libs-devel \
mutter mutter-devel \
gnome-shell
gnome-shell &&
# Ensure that we mark the project clone dir as safe directory
git config --system --add safe.directory "$CI_PROJECT_DIR"
if [[ x"$(uname -m )" = "xx86_64" ]] ; then
if [ -n "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" ]; then
git clone --depth $MUTTER_CLONE_DEPTH \
$CI_MERGE_REQUEST_SOURCE_PROJECT_URL.git mutter-src \
-b "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
elif [ -n "$CI_COMMIT_BRANCH" ]; then
git clone --depth $MUTTER_CLONE_DEPTH \
$CI_REPOSITORY_URL mutter-src -b "$CI_COMMIT_BRANCH"
else
git clone --depth $MUTTER_CLONE_DEPTH $CI_REPOSITORY_URL mutter-src
fi
meson setup build mutter-src -Dkvm_tests=true
ninja -C build src/tests/kvm/bzImage
mkdir -p /opt/mutter
cp build/src/tests/kvm/bzImage /opt/mutter/bzImage
dnf install -y python3-argcomplete
git clone https://github.com/arighi/virtme-ng.git
cd virtme-ng
git fetch --tags
git checkout v1.8
./setup.py install --prefix=/usr
cd ..
rm -rf virtme-ng
rm -rf build mutter-src
fi
retry:
max: 2
when:
- 'always'
dnf clean all
default:
# Cancel jobs if newer commits are pushed to the branch
@@ -183,17 +65,13 @@ default:
- 'scheduler_failure'
- 'api_failure'
.mutter.fedora@x86_64:
extends:
- .mutter.fedora@common
- .mutter.git-clone
.mutter.fedora:34@x86_64:
extends: .mutter.fedora:34@common
variables:
FDO_DISTRIBUTION_TAG: "x86_64-${BASE_TAG}"
.mutter.fedora@aarch64:
extends:
- .mutter.fedora@common
- .mutter.git-clone
.mutter.fedora:34@aarch64:
extends: .mutter.fedora:34@common
variables:
FDO_DISTRIBUTION_TAG: "aarch64-${BASE_TAG}"
tags:
@@ -201,38 +79,17 @@ default:
workflow:
rules:
# Allow to switch from branch pipelines to MR pipelines seamlessly
# https://docs.gitlab.com/ee/ci/jobs/job_control.html#avoid-duplicate-pipelines
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
when: never
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# Don't trigger a branch pipeline if there is an open MR
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: '$CI_COMMIT_BRANCH'
- if: '$CI_MERGE_REQUEST_IID'
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH'
.pipeline-guard:
.pipline-guard: &pipline-guard
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
- if: '$CI_COMMIT_BRANCH =~ /^gnome-[0-9-]+$/'
# Avoid catchall `when: manual` rule which might
# cause duplicate pipelines to be triggered.
# https://docs.gitlab.com/ee/ci/jobs/job_control.html#avoid-duplicate-pipelines
#
# Also make it so pipelines without MR need to be started
# manually, since their state will most likely be WIP
- if: '$CI_COMMIT_BRANCH'
when: 'manual'
.only-merge-requests:
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^$/'
when: never
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
when: on_success
- when: 'manual'
check-commit-log:
extends:
@@ -241,190 +98,140 @@ check-commit-log:
variables:
GIT_DEPTH: "100"
script:
ci-fairy check-commits --junit-xml=commit-message-junit-report.xml
- if [[ x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ]] ;
then
ci-fairy check-commits --junit-xml=commit-message-junit-report.xml ;
else
echo "Not a merge request" ;
fi
artifacts:
expire_in: 1 week
paths:
- commit-message-junit-report.xml
reports:
junit: commit-message-junit-report.xml
rules:
- !reference [.only-merge-requests, rules]
<<: *pipline-guard
check-merge-request:
extends:
- .fdo.ci-fairy
- .skip-git-clone
stage: review
variables:
GIT_STRATEGY: none
script:
ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-merge-request-report.xml
- if [[ x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ]] ;
then
ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-merge-request-report.xml ;
else
echo "Not a merge request" ;
fi
artifacts:
expire_in: 1 week
paths:
- check-merge-request-report.xml
reports:
junit: check-merge-request-report.xml
rules:
- !reference [.only-merge-requests, rules]
<<: *pipline-guard
build-fedora-container@x86_64:
extends:
- .fdo.container-build@fedora@x86_64
- .mutter.fedora@x86_64
- .mutter.skip-git-clone
- .mutter.fedora:34@x86_64
stage: prepare
rules:
- !reference [.pipeline-guard, rules]
needs:
- check-commit-log
- check-merge-request
variables:
GIT_STRATEGY: none
build-fedora-container@aarch64:
extends:
- .fdo.container-build@fedora@aarch64
- .mutter.fedora@aarch64
- .mutter.skip-git-clone
- .mutter.fedora:34@aarch64
stage: prepare
rules:
- !reference [.pipeline-guard, rules]
when: manual
needs:
- check-commit-log
- check-merge-request
variables:
GIT_STRATEGY: none
check-code-style:
extends:
- .mutter.distribution-image
- .mutter.fedora@x86_64
variables:
MUTTER_CLONE_DEPTH: 200
- .fdo.distribution-image@fedora
- .mutter.fedora:34@x86_64
stage: code-review
needs:
- job: build-fedora-container@x86_64
artifacts: false
- build-fedora-container@x86_64
script:
git remote add target $CI_MERGE_REQUEST_PROJECT_URL.git ;
git fetch target $CI_MERGE_REQUEST_TARGET_BRANCH_NAME ;
export common_parent_sha=$(diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent "target/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME") <(git rev-list --first-parent HEAD) | head -1) ;
python3 -u ./check-style.py --dry-run --sha $common_parent_sha ;
- if [[ x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ]] ;
then
git remote add target $CI_MERGE_REQUEST_PROJECT_URL.git ;
git fetch target $CI_MERGE_REQUEST_TARGET_BRANCH_NAME ;
export common_parent_sha=$(diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent "target/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME") <(git rev-list --first-parent HEAD) | head -1) ;
python3 -u ./check-style.py --dry-run --sha $common_parent_sha ;
else
echo "Not a merge request" ;
fi
allow_failure: true
rules:
- !reference [.only-merge-requests, rules]
.build-mutter-base:
variables:
BASE_MESON_OPTIONS:
-Degl_device=true
-Dwayland_eglstream=true
-Dcatch=true
-Dlibdisplay_info=true
.build-mutter:
extends:
- .mutter.distribution-image
- .build-mutter-base
- .fdo.distribution-image@fedora
stage: build
script:
- meson setup . build
--prefix /usr
--werror
--fatal-meson-warnings
--warnlevel 2
-Dbuildtype=debugoptimized
-Db_coverage=true
$BASE_MESON_OPTIONS
$EXTRA_MESON_OPTIONS
- meson . build -Dbuildtype=debugoptimized -Db_coverage=true -Degl_device=true -Dwayland_eglstream=true --werror --prefix /usr
- meson compile -C build
- sudo meson install --dry-run -C build
- meson install -C build
artifacts:
expire_in: 1 day
paths:
- build
build-mutter@x86_64:
variables:
EXTRA_MESON_OPTIONS:
-Dkvm_tests=true
-Dkvm_kernel_image=/opt/mutter/bzImage
extends:
- .build-mutter
- .mutter.fedora@x86_64
- .mutter.fedora:34@x86_64
needs:
- job: build-fedora-container@x86_64
artifacts: false
- build-fedora-container@x86_64
build-mutter@aarch64:
extends:
- .build-mutter
- .mutter.fedora@aarch64
- .mutter.fedora:34@aarch64
needs:
- job: build-fedora-container@aarch64
artifacts: false
when: manual
- build-fedora-container@aarch64
build-without-opengl-and-glx@x86_64:
extends:
- .mutter.distribution-image
- .mutter.fedora@x86_64
- .fdo.distribution-image@fedora
- .mutter.fedora:34@x86_64
stage: build
needs:
- job: build-fedora-container@x86_64
artifacts: false
- build-fedora-container@x86_64
script:
- meson setup . build --werror --prefix /usr
-Dbuildtype=debugoptimized
-Dopengl=false
-Dglx=false
-Degl_device=true
-Dwayland_eglstream=true
-Dintrospection=false
- meson . build -Dbuildtype=debugoptimized -Dopengl=false -Dglx=false -Degl_device=true -Dwayland_eglstream=true --werror --prefix /usr
- meson compile -C build
- sudo meson install --no-rebuild -C build
- meson install -C build
artifacts:
paths:
- build/meson-logs
build-without-native-backend-and-wayland@x86_64:
extends:
- .mutter.distribution-image
- .mutter.fedora@x86_64
- .fdo.distribution-image@fedora
- .mutter.fedora:34@x86_64
stage: build
needs:
- job: build-fedora-container@x86_64
artifacts: false
- build-fedora-container@x86_64
script:
- meson setup . build --werror --prefix /usr
-Dbuildtype=debugoptimized
-Dnative_backend=false
-Dudev=false
-Dwayland=false
-Dxwayland=false
-Dcore_tests=false
-Dnative_tests=false
-Dintrospection=false
- meson . build -Dbuildtype=debugoptimized -Dnative_backend=false -Dudev=false -Dwayland=false -Dcore_tests=false -Dnative_tests=false --werror --prefix /usr
- meson compile -C build
- sudo meson install --no-rebuild -C build
- meson install -C build
artifacts:
paths:
- build/meson-logs
build-wayland-only@x86_64:
extends:
- .mutter.distribution-image
- .mutter.fedora@x86_64
stage: build
needs:
- job: build-fedora-container@x86_64
artifacts: false
script:
- meson setup . build --werror --prefix /usr
-Dbuildtype=debugoptimized
-Dwayland=true
-Dxwayland=false
-Dcore_tests=false
-Dnative_tests=false
-Dintrospection=false
- meson compile -C build
- sudo meson install --no-rebuild -C build
artifacts:
paths:
- build/meson-logs
.test-setup:
.test-setup: &test-setup
variables:
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
GSETTINGS_SCHEMA_DIR: "$CI_PROJECT_DIR/build/data"
@@ -435,152 +242,99 @@ build-wayland-only@x86_64:
G_SLICE: "always-malloc"
MALLOC_CHECK_: "3"
NO_AT_BRIDGE: "1"
GTK_A11Y: "none"
before_script:
- !reference [.mutter.git-clone, before_script]
- glib-compile-schemas $GSETTINGS_SCHEMA_DIR
# Disable e.g. audio support to not dead lock screen cast tests
- rm -f /usr/share/pipewire/media-session.d/with-*
- mkdir -m 700 $XDG_RUNTIME_DIR
- pipewire & sleep 2
.test-mutter-base:
.test-mutter:
extends:
- .mutter.distribution-image
- .test-setup
- .fdo.distribution-image@fedora
<<: *test-setup
stage: test
after_script:
- pushd build
- gcovr --root=..
--filter='\.\./src/' --filter='\.\./clutter/' --filter='\.\./cogl/'
--exclude='\.\./build/.*\.[ch]$' --exclude='.*/tests/.*\.[ch]$'
--json --output=../coverage-${CI_JOB_NAME}.json
- popd
script:
- dbus-run-session -- xvfb-run -a -s "$XVFB_SERVER_ARGS"
catchsegv meson test -C build --no-rebuild -t 10
artifacts:
expire_in: 1 day
reports:
junit: "build/meson-logs/testlog-catchsegv.junit.xml"
name: "mutter-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
paths:
- build
- coverage-*.json
.test-mutter:
extends:
- .mutter.distribution-image
- .test-mutter-base
script:
- glib-compile-schemas $GSETTINGS_SCHEMA_DIR
- xvfb-run -a -s "$XVFB_SERVER_ARGS"
./src/tests/meta-dbus-runner.py
--launch=wireplumber
meson test
-C build
--setup plain
--no-suite 'mutter/kvm'
--no-rebuild
--timeout-multiplier 10
--print-errorlogs
artifacts:
reports:
junit: "build/meson-logs/testlog-plain.junit.xml"
test-mutter@x86_64:
extends:
- .mutter.fedora@x86_64
- .test-mutter
tags:
- asan
- .mutter.fedora:34@x86_64
needs:
- build-mutter@x86_64
test-mutter-kvm@x86_64:
extends:
- .mutter.fedora@x86_64
- .test-mutter-base
tags:
- kvm
script:
- meson test -C build
--no-rebuild
--timeout-multiplier 10
--setup plain
--suite 'mutter/kvm'
--print-errorlogs
needs:
- build-mutter@x86_64
artifacts:
reports:
junit: "build/meson-logs/testlog-plain.junit.xml"
test-mutter@aarch64:
extends:
- .mutter.fedora@aarch64
- .test-mutter
tags:
- asan-aarch64
- .mutter.fedora:34@aarch64
needs:
- build-mutter@aarch64
when: manual
coverage:
.test-mutter-coverage:
extends:
- .mutter.distribution-image
- .mutter.fedora@x86_64
- .fdo.distribution-image@fedora
stage: analyze
script:
- mkdir coveragereport
- gcovr --add-tracefile 'coverage-*.json'
--html-details --print-summary --output coveragereport/index.html
- gcovr --add-tracefile 'coverage-*.json'
--xml --output coveragereport/coverage.xml
- ninja -C build coverage
- cat build/meson-logs/coverage.txt
artifacts:
expose_as: 'Coverage Report'
paths:
- coveragereport
- coveragereport/index.html
reports:
coverage_report:
coverage_format: cobertura
# TODO: we may need to split this file once it will reach the
# gitlab limit size of 10M, or it will stop working:
# https://gitlab.com/gitlab-org/gitlab/-/issues/328772
path: coveragereport/coverage.xml
coverage: '/^lines: (\d+\.\d+\%)/'
- build/meson-logs/coveragereport
coverage: '/^TOTAL.*\s+(\d+\%)$/'
test-mutter-coverage@x86_64:
extends:
- .test-mutter-coverage
- .mutter.fedora:34@x86_64
needs:
- test-mutter@x86_64
# - test-mutter@aarch64
- test-mutter-kvm@x86_64
test-mutter-coverage@aarch64:
extends:
- .test-mutter-coverage
- .mutter.fedora:34@aarch64
needs:
- test-mutter@aarch64
can-build-gnome-shell@x86_64:
extends:
- .mutter.distribution-image
- .mutter.fedora@x86_64
- .fdo.distribution-image@fedora
- .mutter.fedora:34@x86_64
stage: test
needs:
- build-mutter@x86_64
before_script:
- !reference [.mutter.fedora@x86_64, before_script]
- sudo meson install --no-rebuild -C build
- meson install --no-rebuild -C build
script:
- .gitlab-ci/checkout-gnome-shell.sh
- meson setup gnome-shell gnome-shell/build --prefix /usr -Dman=false
- sudo meson install -C gnome-shell/build
- meson gnome-shell gnome-shell/build --prefix /usr -Dman=false
- meson install -C gnome-shell/build
test-mutter-coverity:
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $MUTTER_SCHEDULED_JOB == "coverity"'
when: on_success
- if: '$CI_COMMIT_BRANCH'
when: 'manual'
when: always
- when: manual
extends:
- .mutter.distribution-image
- .mutter.fedora@x86_64
- .fdo.distribution-image@fedora
- .mutter.fedora:34@x86_64
needs:
- job: build-fedora-container@x86_64
artifacts: false
- build-fedora-container@x86_64
stage: analyze
allow_failure: true
script:
- .gitlab-ci/download-coverity-tarball.sh
- CC=clang meson setup coverity-build -Dprofiler=false
- CC=clang meson coverity-build -Dprofiler=false
- ./coverity/cov-analysis-linux64-*/bin/cov-build --dir cov-int meson compile -C coverity-build
- tar czf cov-int.tar.gz cov-int
- curl https://scan.coverity.com/builds?project=mutter
@@ -595,33 +349,18 @@ test-mutter-coverity:
dist-mutter:
extends:
- .fdo.distribution-image@fedora
- .mutter.fedora@x86_64
- .build-mutter-base
- .test-setup
- .mutter.fedora:34@x86_64
<<: *test-setup
stage: deploy
needs:
- job: build-fedora-container@x86_64
artifacts: false
- build-mutter@x86_64
script:
- meson setup . build --werror --prefix /usr
-Dbuildtype=debugoptimized
- glib-compile-schemas $GSETTINGS_SCHEMA_DIR
- xvfb-run -a -s "$XVFB_SERVER_ARGS"
./src/tests/meta-dbus-runner.py
--launch=wireplumber
meson dist -C build
- dbus-run-session -- xvfb-run -a -s "$XVFB_SERVER_ARGS" meson dist -C build
rules:
- if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- "**/meson.build"
- meson/*
when: on_success
- if: '$GITLAB_USER_LOGIN == "marge-bot"'
when: on_success
- if: '$CI_MERGE_REQUEST_ASSIGNEES == "marge-bot"'
when: on_success
dist-mutter-tarball:
extends: dist-mutter
@@ -631,35 +370,3 @@ dist-mutter-tarball:
- build/meson-dist/$CI_PROJECT_NAME-$CI_COMMIT_TAG.tar.xz
rules:
- if: '$CI_COMMIT_TAG'
reference:
extends:
- .mutter.distribution-image
- .mutter.fedora@x86_64
stage: docs
needs:
- job: build-fedora-container@x86_64
artifacts: false
script:
- meson setup . build --werror -Ddocs=true -Dtests=false
- ninja -C build
- mkdir references
- mv build/doc/reference/{cally/cally,clutter/clutter,cogl/cogl,cogl-pango/cogl-pango,meta/meta,mtk/mtk} references/
artifacts:
expire_in: 1 week
expose_as: 'Documentation'
paths:
- references/
pages:
stage: deploy
needs: ['reference']
extends:
- .skip-git-clone
script:
- mv references public/
artifacts:
paths:
- public
rules:
- if: ($CI_DEFAULT_BRANCH == $CI_COMMIT_BRANCH && $CI_PROJECT_NAMESPACE == "GNOME")

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/bash
fetch() {
local remote=$1
@@ -41,9 +41,8 @@ if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ]; then
fi
if [ -z "$gnome_shell_target" ]; then
ref_remote=${CI_PROJECT_URL//mutter/gnome-shell}
echo -n Looking for $CI_COMMIT_REF_NAME on remote ...
if fetch $ref_remote $CI_COMMIT_REF_NAME; then
if fetch origin $CI_COMMIT_REF_NAME; then
echo \ found
gnome_shell_target=FETCH_HEAD
else

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/bash
# We need a coverity token to fetch the tarball
if [ -x $COVERITY_TOKEN ]

View File

@@ -2,81 +2,38 @@
set -e
usage() {
cat <<-EOF
Usage: $(basename $0) [OPTION…] REPO_URL COMMIT
Check out and install a meson project
Options:
-Dkey=val Option to pass on to meson
--subdir Build subdirectory instead of whole project
--prepare Script to run before build
-h, --help Display this help
EOF
}
TEMP=$(getopt \
--name=$(basename $0) \
--options='D:h' \
--longoptions='subdir:' \
--longoptions='prepare:' \
--longoptions='help' \
-- "$@")
eval set -- "$TEMP"
unset TEMP
MESON_OPTIONS=()
SUBDIR=.
PREPARE=:
while true; do
case "$1" in
-D)
MESON_OPTIONS+=( -D$2 )
shift 2
;;
--subdir)
SUBDIR=$2
shift 2
;;
--prepare)
PREPARE=$2
shift 2
;;
-h|--help)
usage
exit 0
;;
--)
shift
break
;;
esac
done
if [[ $# -lt 2 ]]; then
usage
if [[ $# -lt 3 ]]; then
echo Usage: $0 [options] [repo-url] [commit] [subdir]
echo Options:
echo -Dkey=val
exit 1
fi
MESON_OPTIONS=()
while [[ $1 =~ ^-D ]]; do
MESON_OPTIONS+=( "$1" )
shift
done
REPO_URL="$1"
COMMIT="$2"
TAG_OR_BRANCH="$2"
SUBDIR="$3"
COMMIT="$4"
CHECKOUT_DIR=$(mktemp --directory)
trap "rm -rf $CHECKOUT_DIR" EXIT
REPO_DIR="$(basename ${REPO_URL%.git})"
git clone --depth 1 "$REPO_URL" -b "$COMMIT" "$CHECKOUT_DIR"
git clone --depth 1 "$REPO_URL" -b "$TAG_OR_BRANCH"
pushd "$REPO_DIR"
pushd "$SUBDIR"
pushd "$CHECKOUT_DIR/$SUBDIR"
sh -c "$PREPARE"
meson setup --prefix=/usr _build "${MESON_OPTIONS[@]}"
if [ ! -z "$COMMIT" ]; then
git fetch origin "$COMMIT"
git checkout "$COMMIT"
fi
meson --prefix=/usr _build "${MESON_OPTIONS[@]}"
meson install -C _build
popd
popd
rm -rf "$REPO_DIR"

View File

@@ -283,4 +283,4 @@ click_action_clicked_cb (ClutterClickAction *click_action,
}
```
[gnome-coding-style]: https://developer.gnome.org/documentation/guidelines/programming/coding-style.html
[gnome-coding-style]: https://developer.gnome.org/programming-guidelines/stable/c-coding-style.html.en

702
NEWS
View File

@@ -1,620 +1,11 @@
45.0
41.1
====
* Fix focus-follows-mouse mode [Carlos; !3256]
* Optimize applying relative transformation matrix [Robert; !3259]
* Add support for P010 YCbCr format [Robert; !3244]
* Fix hardware cursor stuttering on Raspberry Pi [Daniel; !3279]
* Fix input in multi-monitor remote desktop sessions with libei [Pascal; !3273]
* Fixed crashes [Carlos, Daniel, Sebastian W.; !3252, !3253, !3255, !3160,
!3268, !3262, !3277]
* Misc. bug fixes and cleanups [Florian, Joan, Jonas, Carlos, Sebastian W.,
Pascal; !3248, !3249, !3263, !3261, !3116, !3251, !3032, !3275, !3278]
Contributors:
Jonas Ådahl, Carlos Garnacho, Sebastian Keller, Andre Klapper, Robert Mader,
Florian Müllner, Pascal Nowack, Joan Torres, Daniel van Vugt, Sebastian Wick
Translators:
Sabri Ünal [tr], Quentin PAGÈS [oc], Anders Jonsson [sv],
Christian Kirbach [de], Ask Hjorth Larsen [da]
45.rc
=====
* Fix possible redraw freeze in fullscreen windows [msizanoen; !3127]
* Fix restoring focus when leaving the overview [Jonas Å., Carlos; !3185]
* Support alpha-composited window screencasts [Georges; !3175]
* Fix some XWayland windows not getting mapped [Sebastian; !3194]
* Fix cursor movement on rotated screens [Daniel; !3180]
* Avoid global lock in stage signals [Christian; !3204]
* Implemented suspended xdg_toplevel state [Jonas Å.; !3019, !3213]
* Support idle_inhibit protocol [Charbel; !3145]
* Do not trigger repick during relayout [Carlos; !3220]
* Fix redraw issue when buffer age is unavailable [Carlos; !3221]
* Add Meta Toolkit (MTK) library [Bilal; !3128]
* Fix possible window freeze during resize operations [Carlos; !3189]
* Fixes to tablet cursor visibility on Wayland [Carlos; !3218]
* Improve support for input capture and emulated input [Jonas Å.; !3228]
* Use headless mode when seat ID is unset [Joan; !3093]
* Fix unresponsive touchscreen after titlebar drag [Carlos; !3059]
* Fix absolute pointer events on virtual monitor streams [Jonas Å.; !3241]
* Fix disabling CRTCs in disable-only mode updates [Jonas Å.; !3073]
* Cache multi-texture shader snippets [Daniel; !3224]
* Fixed crashes [Carlos, Jonas Å., Jonas D., Barnabás, Jeremy; !3183, !3219,
!3234, !3216, !3202, !3229, !3246]
* Plugged leaks [Sebastian, Niels; !3188, !3203]
* Misc. bug fixes and cleanups [Bilal, Michel, Jonas Å., Florian, Carlos,
Sebastian, Sandro, Daniel, Pascal, Georges, Jonas D., Uzair; !3087, !3154,
!3169, !3124, !3173, !3190, !3197, !3198, !3215, !3209, !3155, !3225, !3226,
!3223, !3231, !3187, !3230, !3210, !3227, !3233, !3235, !3237, !3238, !3236,
!3239, !3243, !3199, !3247, !3242]
Contributors:
Jonas Ådahl, Uzair Ahmad, Charbel Assaad, Sandro Bonazzola, Jeremy Cline,
Michel Dänzer, Jonas Dreßler, Bilal Elmoussaoui, Carlos Garnacho,
Niels De Graef, Christian Hergert, Sebastian Keller, msizanoen,
Florian Müllner, Georges Basile Stavracas Neto, Pascal Nowack, Barnabás Pőcze,
Joan Torres, Daniel van Vugt
Translators:
Kukuh Syafaat [id], Sabri Ünal [tr], Jiri Grönroos [fi],
Baurzhan Muftakhidinov [kk], Vasil Pupkin [be], Jordi Mas [ca],
Aurimas Černius [lt], A S Alam [pa], Nathan Follens [nl], Philipp Kiemle [de],
Milo Casagrande [it], Yaron Shahrabani [he], Gwan-gyeong Mun [ko],
Bruce Cowan [en_GB]
45.beta.1
=========
* Fix blitting from premultiplied to opaque formats [Jonas; !3159]
* Fix Super key not going to overview in GNOME Shell [Carlos; 3162]
* Use ClutterEvent in ClutterActor class event vmethod signatures
[Carlos; 3163]
* Misc. bug fixes and cleanups [Carlos, !3167, !3168]
Contributors:
Jonas Ådahl, Carlos Garnacho
Translators:
Piotr Drąg [pl], Daniel Mustieles [es]
45.beta
=======
* Support input capture and emulated input with libei
[Jonas, Peter, Olivier; !2628]
* Add KMS thread [Jonas; !2777]
* Fix touch move operations on subsurfaces [Gergo; !3125]
* Fix unexpected cursor changes over non-resizable windows [Michel; !3096]
* Improve render time estimates [Michel; !3090]
* Fix flickering when DRI driver isn't available [Daniel; !3117]
* Fix restoring maximized state of SSD windows [Sebastian K.; !3035]
* Add support for YUV formats [Niels, Robert; !2191]
* Fix xwayland-allow-byte-swapped-clients setting [Olivier; !3156]
* Misc. bug fixes and cleanups [Jonas, Florian, Bilal, Daniel, Robert,
Sebastian W., Michel, Carlos; !3111, !3100, !3112, !3065, !3101, !3129,
!3118, !3131, !3123, !3135, !3134, !3130, !3141, !3140, !3144, !3148, !3138,
!3150, !3005, !3103, !3126, !3147, !3157, !3153]
Contributors:
Jonas Ådahl, Michel Dänzer, Bilal Elmoussaoui, Olivier Fourdan,
Carlos Garnacho, Niels De Graef, Peter Hutterer, Sebastian Keller,
Gergo Koteles, Robert Mader, Florian Müllner, Daniel van Vugt, Sebastian Wick
Translators:
Yosef Or Boczko [he], Fabio Tomat [fur], Balázs Úr [hu],
Ekaterine Papava [ka], Yuri Chornoivan [uk], Artur So [ru],
Matej Urbančič [sl], Asier Sarasua Garmendia [eu], Danial Behzadi [fa],
Luming Zh [zh_CN], Hugo Carvalho [pt], Daniel Rusek [cs], Fran Dieguez [gl],
Daniel Mustieles [es]
45.alpha
========
* Fix DND in some server-side decorated windows [Sebastian; !2978]
* Optionally use libdisplay-info for EDID parsing [adarshgm; !2642]
* Optimize partial surface updates [msizanoen1; !2965]
* Fix redrawing regression in non-DMA remote sessions [Jonas Å.; !2987]
* Avoid race condition in xwayland-on-demand [Marco; !2970]
* Do not unminimize windows with initial IconicState [Carlos; !3001]
* Implement physical pixel rounding of wayland surfaces [msizanoen1; !2726]
* Fix mispositioning of some X11 fullscreen windows [Carlos; !2996]
* Fix legacy fullscreen windows appearing on all monitors [Carlos; !2999]
* Improve support for display-attached tablets [Carlos; !3012]
* Fix stuck cursor in some clients [Carlos; !3025]
* Avoid unexpected orientation changes around suspend/resume [Carlos; !3021]
* Fix oversized input region around Xwayland windows [Jonas Å.; !3022]
* Re-enable client modifiers with amdgpu driver [Robert; !3030]
* Fix sysprof tracing in non-main threads [Jonas Å.; !2998]
* Fix X11 client input region issues [Sebastian, Jonas Å.; !3031, !3045]
* Optimize finish-layout step during stage updating [Robert, Jonas D.; !2679]
* Fix profiling repeatedly [Jonas Å.; !3068]
* Ensure preferred monitor mode is always included [Timotej; !3061]
* Fully initialize input device state during init [Jonas Å.; !3070, !3071]
* Forward modifiers to IM alongside regular key events [Carlos; !3044]
* Fix window focus unexpectedly moving to secondary monitor when changing
workspaces [Sebastian W.; !2909]
* Avoid rapidly toggling dynamic max render time [Daniel; !3074]
* Fix dynamic max render time blocking with direct scanout [Dor; !3080]
* Mirror window placement in RTL locales [Shmuel; !3009]
* Fix screencast with fractionally scaled surfaces [msizanoen; !3053]
* Reipmlement strict focus mode policy [Brendan; !3063]
* Fixed crashes [Jonas Å., Barnabás, Carlos, Robert, Dor; !2992, !2995,
!3002, !3004, !3037, !3076, !3077, !3095, !3104]
* Plugged leaks [Jonas Å., Dor; !2991, !3078]
* Misc. bug fixes and cleanups [Marco, Andy, Sebastian K., Jonas Å., Robert,
Alexandre, Bilal, Georges, Florian, Dmitry, Michel, Pascal, Olivier, Carlos,
Daniel, Sebastian W., Corentin, Barnabás, Dor; !2903, !2983, !2986, !2985,
!2990, !2982, !3000, !2938, !2445, !3006, !3010, !2913, !2893, !2939, !3011,
!3007, !3018, !3016, !3024, !3020, !3029, !3034, !3036, !3040, !3046, !3051,
!3047, !3055, !3058, !3075, !3081] !3082, !3079, !2911, !3084, !3088, !3085,
!3052, !3094, !3083, !3092, !3008, !3098, !3091, !3062, !3108]
Contributors:
Jonas Ådahl, adarshgm, Dor Askayo, Michel Dänzer, Jonas Dreßler,
Bilal Elmoussaoui, Olivier Fourdan, Alexandre Franke, Carlos Garnacho,
Andy Holmes, Sebastian Keller, Dmitry V. Levin, Robert Mader, Shmuel Melamud,
msizanoen, msizanoen1, Florian Müllner, Georges Basile Stavracas Neto,
Corentin Noël, Pascal Nowack, Barnabás Pőcze, Timotej Šulík,
Marco Trevisan (Treviño), Daniel van Vugt, Sebastian Wick, Brendan William
Translators:
Danial Behzadi [fa], Simon Elst [fr], Rafael Fontenelle [pt_BR],
Sergej A [ru], Bruce Cowan [en_GB], Alexandre Franke [fr]
44.1
====
* Fall back to the default, not the unknown color space [Sebastian W.; !2915]
* Fix resizing windows via keyboard [Florian; !2908]
* Fix possible screen freeze after resume with multiple monitors [Daniel; !2933]
* Fix anchor position when dragging window [Carlos; !2942]
* Fix applying XSettings to decorations on X11 [Marco; !2948]
* Allow clipped redraws for headless backend [Salman; !2775]
* Improve screencast support [Georges; !2804]
* Fix focus-on-click for server-side decorated windows [Carlos; !2954]
* Fix initial fullscreen state of server-side decorated windows [Carlos; !2961]
* Fix feedback loop triggering bursts of excessive CPU load [Robert; !2823]
* Enable modifiers by default on non-native backend [Robert; !2972]
* Check EDID for supported sink Colorimetry [Sebastian W.; !2919]
* Fix artifacts in titlebars on some hardware [Carlos; !2976]
* Fix map transitions for X11 windows on wayland [Carlos; !2975]
* Fixed crashes [Jonas Å., Sebastian K., Carlos, Michel, Daniel, Robert;
!2932, !2930, !2945, !2956, !2962, !2968, !2967, !2960, !2963]
* Plugged leaks [Sebastian K., Jonas Å.; !2922, !2926, !2957]
* Misc. bug fixes and cleanups [Daniel, Ivan, Emmanuele, Simon, Jonas D.,
Jonas Å., Chris, Florian, Corentin, msizanoen1, Sebastian K.; !2918, !2904,
!2928, !2929, !2900, !2856, !2944, !2935, !2947, !2949, !2951, !2940, !2953,
!2964, !2934, !2902, !2971]
Contributors:
Jonas Ådahl, Emmanuele Bassi, Michel Dänzer, Jonas Dreßler, Carlos Garnacho,
Sebastian Keller, Robert Mader, Chris Mayo, Simon McVittie, Ivan Molodetskikh,
msizanoen1, Florian Müllner, Georges Basile Stavracas Neto, Corentin Noël,
Salman, Marco Trevisan (Treviño), Daniel van Vugt, Sebastian Wick
Translators:
Boyuan Yang [zh_CN], Ngọc Quân Trần [vi], Nathan Follens [nl]
44.0
====
* Fix state confusion and delay on startup [Carlos; !2906]
* Fix night light regression [Sebastian; !2916]
* Fix fullscreen regression with many SDL apps [Jonas; !2921]
* Fixed crashes [Jonas; !2901, !2912]
Contributors:
Jonas Ådahl, Carlos Garnacho, Sebastian Wick
Translators:
Ask Hjorth Larsen [da], Piotr Drąg [pl], Marek Černocký [cs],
Gwan-gyeong Mun [ko]
44.rc
=====
* Do not overwrite previously set offsets on attach [Matthias; !2843]
* Fix Xwayland focus regressions [Carlos; !2841, !2878]
* Stop parsing unused EDID parameters [adarshgm; !2825]
* Fix partial updates on offscreen rotated screens [Robert; !2860]
* Improve Xwayland RandR emulation compatibility [msizanoen1; !2725]
* Fix touch window dragging on rotated monitors [Jonas D.; !2859]
* Remove legacy OpenGL driver support [Jonas Å.; !2672]
* Improve default scale factor selection [Adrian, Jonas Å.; !2653, !2880]
* Handle all X11 window title fallbacks [Carlos; !2872]
* Fix handling of keyboard-driven window resize [Carlos; !2871]
* Fix recording windows on non-active workspaces [Robert; !2789]
* Manage KMS updates more asynchronously [Jonas Å.; !2854, !2855]
* Fix headless startup [Jonas Å.; !2821]
* Remove support for window shading [Robert; !2884]
* Move away from GTK3 [Carlos; !2864]
* Restore zero-copy fast path for Xwayland fullscreen windows [Carlos; !2797]
* Prevent clients from locking the compositor with cursor updates
[Olivier; !2849]
* Add experimental development tool for HDR modes [Sebastian; !2879]
* Account for linear sampling when calculating actor damage [msizanoen1; !2771]
* wayland: Implement fractional_scale protocol [Robert; !2394]
* Fixed crashes [Jonas D., Jonas Å., Robert; !2858, !2863, !2869, !2885, !2887]
* Memory handling fixes
[Jonas Å., Carlos, Simon, Michel; !2853, !2868, !2877, !2886]
* Misc. bug fixes and cleanups [Jonas Å., Florian, Robert, Carlos, Sebastian,
Jonas D.; !2846, !2840, !2850, !2829, !2862, !2779, !2861, !2713, !2865,
!2866, !2867, !2874, !2875, !2873, !2881, !2847, !2889, !2890, !2891, !2892,
!2894, !2895, !2899]
Contributors:
Dor Askayo, Matthias Clasen, Jonas Dreßler, Michel Dänzer, Olivier Fourdan,
Carlos Garnacho, Robert Mader, Simon McVittie, Florian Müllner, Adrian Vovk,
Sebastian Wick, adarshgm, msizanoen1, Jonas Ådahl
Translators:
Марко Костић [sr], Daniel [es], Fabio Tomat [fur], Matej Urbančič [sl],
Jiri Grönroos [fi], Balázs Úr [hu], Anders Jonsson [sv], Marek Černocký [cs],
Jürgen Benvenuti [de], Alexander Shopov [bg]
44.beta
=======
* Don't disable KMS modifiers on newer i915 systems [Sameer; !2641]
* Set LOD bias for sharper mipmaps [Daniel; !2644]
* Fix edge resistance and window snapping regression [John; !2687]
* Avoid high-level udev queries for input caps and properties [Carlos; !2617]
* Implement wl_output v3 and v4 [Robert; !2692]
* Fix recalculating viewport after window resize [Sebastian Kr.; !2689]
* Fix opaque cursors and LoDPI cursor on HiDPI screens [Jonas Å.; !2698]
* Process device removing events immediately [Jonas D.; !2696]
* Handle stage view updates without allocation more gracefully [Jonas D.; !2694]
* Fix window screenshots being cut off at the bottom right [Sebastian K.; !2720]
* wayland/subsurface: Avoid using buffers with unfinished client work
[Michel; !1880]
* Move X11 window decorations to a separate client
[Carlos; !2175, !2735, !2756, !2791, !2796, !2758]
* Fix cursor position in window screencasts [Georges; !2737]
* Skip resize effects for tiled windows during user grabs [Michael; !2579]
* Fix pointer constrains with subsurfaces [Robert; !2717]
* Disable direct scanout during drag-n-drop operations [Robert; !2677]
* Ignore unmapped subsurfaces in direct scanout check [Robert; !2755]
* Fix cursor disappearing over windows during grabs [Carlos; !2754]
* Make wl_output mode independent of the orientation [Sebastian W.; !2723]
* Improve focus handling on workspace switches [Sebastian W.; !2747]
* Fix initialization of keyboard accessibility [Carlos; !2750, !2778]
* Refactor API to use well-defined ownership instead of singletons
[Jonas Å.; !2718]
* Add support for xdg-foreign-v2 [Jason, Jonas Å.; !2770]
* Add higher bit depth offscreen framebuffers support [Jonas Å., Naveen; !2461]
* Overhaul dynamic max render time calculation [Michel; !2500]
* Do not require a physical device to update pointer visibility [Carlos; !2766]
* Allow building without xwayland support [Bilal; !2407, !2399]
* Add Xwayland byte-swapped clients support [Olivier; !2785]
* Fix freeze when crossing monitors under some conditions [Carlos; !2803]
* Don't allow window activation to break global grabs
[Florian, Carlos; !2776, !2832]
* Integrate window grab operations with new ClutterGrab API [Carlos; !2683]
* Support selecting an acceleration profile for touchpad devices [Evan; !2426]
* Enforce compliant surface buffer sizes [Robert; !2815]
* Keep proportional position when moving window between rects [Sebastian; !2591]
* Introduce implicit grabbing in Clutter [Jonas D.; !2342]
* Fix unexpected window focus changes after global grabs [Sebastian W.; !2742]
* Fix sloppy/mouse focus mode on wayland [Carlos; !2828]
* Add service channel Wayland clients [Jonas Å.; !2810]
* Fixed crashes [Sebastian W., Jonas Å., Bilal, Jonas D., msizanoen1, Georges,
Carlos, Daniel, Keyu; !2695, !2704, !2706, !2711, !2691, !2709, !2690, !2736,
!2745, !2674, !2793, !2794, !2827, !2831, !2834]
* Plugged leaks [Niels; !2799, !2817]
* Misc. bug fixes and cleanups [Jonas D., Jonas Å., Bilal, Florian, Corentin,
Bram, Georges, Hunor, Carlos, Robert, Michel, Christian, Olivier, Daniel,
Corey, Sebastian K., Jan, Anders, Simon, Sebastian W., Jake, Erico; !1492,
!2508, !2645, !2699, !2418, !2701, !2702, !2703, !2708, !2697, !2710, !2714,
!2715, !2716, !2719, 2724, 2739, 2740, 2733, 2753, 2741, !2680, !2727, !2757,
!2762, !2671, !2765, !2767, !2707, !2768, !2428, !2467, !2772, !2769, !2781,
!2784, !2786, !2780, !2788, !2792, !2783, !2798, !2795, !2800, !2805, !2790,
!2809, !2572, !2811, !2812, !2813, !2807, !2773, !2806, !2816, !2818, !2814,
!2819, !2782, !2822, !2087, !2824, !2826, !2621, !2748, !2091, !2833, !2808,
!2836]
Contributors:
Corey Berla, Hunor Csomortáni, Jake Dane, Jonas Dreßler, Michel Dänzer,
Bilal Elmoussaoui, Olivier Fourdan, Jason Francis, Carlos Garnacho,
Evan Goode, Niels De Graef, Christian Hergert, Peter Hutterer, Anders Jonsson,
Sebastian Keller, Sebastian Krzyszkowiak, Naveen Kumar, Sameer Lattannavar,
Robert Mader, Simon McVittie, Florian Müllner, Georges Basile Stavracas Neto,
Corentin Noël, Erico Nunes, Bram Stolk, Keyu Tao, Jan Tojnar, Daniel van Vugt,
Michael Webster, Sebastian Wick, John Wudrick, msizanoen1, Jonas Ådahl
Translators:
Dušan Kazik [sk], Aleksandr Melman [ru], Yuri Chornoivan [uk],
Hugo Carvalho [pt], Emin Tufan Çetin [tr], Kukuh Syafaat [id],
Fran Dieguez [gl], Yosef Or Boczko [he], Asier Sarasua Garmendia [eu],
Quentin PAGÈS [oc], Aurimas Černius [lt]
43.1
====
* Add quirk to work around issue with Mali GPUs [Daniel; !2614]
* Notify changes to night-light support over D-Bus [Sebastian W.; !2623]
* Fix always-on-top windows unexpectedly taking focus [Sebastian W.; !2489]
* Fix accidental direct scanout [Jonas Å.; !2624]
* Disable client modifiers with amdgpu driver [Michel; !2637]
* Cancel pointer gesture on wl_pointer.leave [Carlos; !2640]
* Add black padding to fixed-size wayland fullscreen windows
[Jonas Å., Sebastian W.; !2338]
* Stop sending frame callbacks to minimized clients [Robert; !2662]
* Fix scrolling in clients with no hi-res scroll support in RDP [José; !2664]
* Fix skipped low-res scroll events with some high-res mice [José; !2668]
* Throttle interactive move and resize updates [Jonas Å.; !2652]
* wayland-keyboard: Send pressed keys on enter [Jonas Å.; !2657]
* Fix some X11 windows getting unredirected erroneously [Sebastian K.; !2651]
* Fix Flatpak applications bypassing X11 permission [msizanoen1; !2633]
* Fix always visible cursor in virtual streams [Salman; !2629]
* Fixed crashes [Jonas Å., Sebastian W., Max, Carlos, Łukasz; !2616, !2627,
!2646, !2661, !2655, !2669, !2676]
* Misc. bug fixes and cleanups [Daniel, Jonas Å., Sebastian W., Ivan, Marco,
Florian, Carlos, Jonas D.; !2615, !2619, !2590, !2630, !2515, !2656,
!2659, !2670, !2667, !2678]
Contributors:
Marco Trevisan (Treviño), Jonas Dreßler, Michel Dänzer, José Expósito,
Carlos Garnacho, Sebastian Keller, Robert Mader, Salman Malik,
Ivan Molodetskikh, Florian Müllner, Łukasz Spintzyk, Daniel van Vugt,
Sebastian Wick, Max Zhao, msizanoen1, Jonas Ådahl
Translators:
Baurzhan Muftakhidinov [kk], Sabri Ünal [tr], Pawan Chitrakar [ne],
Jürgen Benvenuti [de], Nart Tlisha [ab], Fabio Tomat [fur],
Quentin PAGÈS [oc], Freddy Cheng [zh_TW], Мирослав Николић [sr],
Nathan Follens [nl]
43.0
====
* Fix stuttering in Xorg session [Daniel; !2625]
* Make MetaBarrier type derivable again [Jonas; !2626]
* Fixes crash [Jonas; !2622]
Contributors:
Daniel van Vugt, Jonas Ådahl
Translators:
Aleksandr Melman [ru], Fran Dieguez [gl], Daniel Mustieles [es],
Aurimas Černius [lt], Matej Urbančič [sl], Leônidas Araújo [pt_BR],
Kukuh Syafaat [id], Sveinn í Felli [is], Zurab Kargareteli [ka],
Rūdolfs Mazurs [lv], Yosef Or Boczko [he], Alexander Shopov [bg],
Alan Mortensen [da]
43.rc
=====
* Remember monitor scale when switching configurations [Jonas Å.; !2479]
* Embed wayland output name into screencast streams [Salman; !2540]
* Limit precision of stored refresh rates [Daniel; !2465, !2602]
* Add support for the "max bpc" connector property [Daniel; !2412]
* Fix focus-tracking corner case [Jonas D.; !2329]
* Add detail to ::event signal [Jonas D.; !2431]
* Improve heuristics for adding fallback monitor modes [Mario; !2586]
* Take over color management from gnome-settings-daemon
[Jonas Å.; !2141, !2164, !2165, !2166, !2568]
* Allow scanout for offscreen rotated views [Robert; !2468]
* Fix hot corner regression on X11 [Jonas Å.; !2604]
* Fix losing IM focus in some circumstances [Carlos; !2585]
* Avoid swapping redundant portions of buffers onscreen [Erico; !2241]
* Animate windows moving between monitors [Alessandro; !2558]
* Make NVIDIA + gbm use atomic mode setting [Jonas Å.; !2578]
* Fixed crashes [Jonas Å., Steev, Carlos, Simon; !2554, !2577, !2592, !2182,
!2609, !2612]
* Plugged memory leak [Alessandro; !2608]
* Misc. bug fixes and cleanups [Florian, Carlos, Jordan, Simon, Jonas Å.,
Jonas D., Daniel, Sebastian K., Alberts, Bilal, Dor, Sebastian W.; !2566,
!2573, !2576, !2534, !2581, !2430, !2561, !2584, !2588, !2551, !2552, !2594,
!2596, !2598, !2601, !2603, !2589, !2587, !2375, !2486, !2606, !1354, !2605,
!2611]
Contributors:
Dor Askayo, Alessandro Bono, Jonas Dreßler, Bilal Elmoussaoui,
Carlos Garnacho, Sebastian Keller, Steev Klimaszewski, Mario Limonciello,
Robert Mader, Salman Malik, Simon McVittie, Alberts Muktupāvels,
Florian Müllner, Erico Nunes, Jordan Petridis, Daniel van Vugt,
Sebastian Wick, Jonas Ådahl
Translators:
Nart Tlisha [ab], Jiri Grönroos [fi], Goran Vidović [hr],
Yuri Chornoivan [uk], Jordi Mas [ca], Marek Černocký [cs], Balázs Úr [hu],
Emin Tufan Çetin [tr], Danial Behzadi [fa], Piotr Drąg [pl],
Rūdolfs Mazurs [lv], Hugo Carvalho [pt], Anders Jonsson [sv],
Boyuan Yang [zh_CN], Asier Sarasua Garmendia [eu]
43.beta
=======
* Fix glitches in apps using subsurfaces [Robert; !2501, !2530]
* Reduce client work when entering overview [Robert; !2502]
* Support direct scanout on GPUs without modifiers support [Dor; !2510]
* screencast: Set correct stride when using dmabufs [Pascal; !2513]
* High-resolution scroll wheel support [José, Carlos; !1962]
* screencast: Use flag to signal failed recording [columbarius; !2516]
* Fix cursor visibility on X11 with only tablets as input [Carlos; !2518]
* Notify about privacy screen changes via predictions [Jonas Å.; !2340, !2531]
* Highlight actors becoming reactive under the pointer [Carlos; !2532]
* Replace MetaTextureTower with native GL mipmapping [Daniel, Neil; !2506]
* Add tool to pretty print display configuration [Jonas Å., Marco; !2448]
* Remove mipmap framerate limiting [Daniel; !2538]
* Fall back to ARGB if XRGB is not supported [Daniel; !2519]
* Add basic color-scheme support for server-side decorations [Florian; !2541]
* Don't skip frames after skipped KMS updates [Michel; !2498]
* Add support for multi-monitor direct scanout [Dor; !2526]
* Continue gi-docgen migration [Bilal; !2441]
* Always send modifiers to clients if supported [Jonas Å.; !2546]
* Defer and accumulate redraw-clip on scanout [Robert; !2480]
* Add single pixel buffer support [Robert, Jonas Å.; !2246]
* Report actual monitor transform [Robert; !344]
* Better integrate cogl tests with existing infrastructure [Jonas Å.; !2555]
* Fix registering as X11 window manager if GDK_BACKEND is set [Michel; !2496]
* Don't skip vblank sync on missing presentation timestamp [Dor; !2481]
* Fix cursor showing on Xilinx [Daniel; !2520]
* Plugged leaks [Michel, Daniel; !2527, !2562]
* Fixed crashes [Robert, Jonas Å.; !2459, !2553]
* Misc. bug fixes and cleanups [columbarius, Daniel, Carlos, Michel, Jonas Å.,
Florian, Jonas D., Julia, Corentin; !2323, !2074, !2517, !2525, !2524, !2442,
!2523, !2535, !2348, !2537, !2456, !2542, !2547, !2556, !2559, !2564, !2511]
Contributors:
Marco Trevisan (Treviño), Dor Askayo, Jonas Dreßler, Michel Dänzer,
Bilal Elmoussaoui, José Expósito, Carlos Garnacho, Julia Johannesen,
Robert Mader, Neil Moore, Florian Müllner, Pascal Nowack, Corentin Noël,
Nart Tlisha, Daniel van Vugt, columbarius, Jonas Ådahl
Translators:
Nart Tlisha [ab]
43.alpha
========
* Drop zenity dependency [Bilal; !2370]
* Fix initialization of privacy mode in displays that support it [Marco; !2372]
* Add NightLightSupported property to DisplayConfig [Jonas; !2310]
* Don't use direct scanout for transparent windows [Sebastian K.; !2409]
* Improve picking a window for direct scanout [Sebastian K.; !2413]
* Drop support for obsolete wayland protocols [Fernando; !2207, !2184]
* Fix --replace again [Jonas; !2432]
* Do not allow windows to steal focus when the shell has a grab [Carlos; !2433]
* Fix night light without GAMM_LUT property [Jonas; !2435]
* Expose Cogl's Snippet API to introspection [Simon; !2422]
* wayland: Fix rotation transform [Robert; !1055]
* Build and deploy API documentation [Bilal; !2427]
* Attach color state information to actors [Naveen; !2443]
* Fix pointer confinement on HiDPI setups [Jonas; !2460]
* Fix dma-bufu screencast regression [Jonas; !2462]
* Fix monitor mirroring in some cases [Jonas; !2492]
* Parse HDR and Colorimetry CTA-861 EDID extension blocks [Sebastian W.; !2351]
* Fix cursor tracking during screencasts on X11 [George; !2474]
* Fixed crashes [Jonas, Florian; !2415, !2364, !2491]
* Plugged leaks [Michel, Sebastian K.; !2469, !2497]
* Misc. bug fixes and cleanups [Kazuki, Dor, Jonas, Bilal, Sebastian K.,
Christian, Florian, Georges,, Sebastian W., Olivier; !2405, !2406, !2403,
!2416, !2398, !2414, !2425, !2354, !2436, !2447, !2446, !2355, !2429, !2417,
!2434, !2439, !2015, !2444, !2458, !2379, !2455, !2463, !2484, !2485, !2488,
!2499]
Contributors:
Marco Trevisan (Treviño), Dor Askayo, George Barrett, Michel Dänzer,
Bilal Elmoussaoui, Olivier Fourdan, Carlos Garnacho, Kazuki Hashimoto,
Sebastian Keller, Naveen Kumar, Robert Mader, Fernando Monteiro,
Florian Müllner, Georges Basile Stavracas Neto, Christian Rauch,
Simon Schneegans, Sebastian Wick, Jonas Ådahl
Translators:
Zurab Kargareteli [ka], Pawan Chitrakar [ne]
42.1
====
* Send correct LEAVE events when entering windows [Jonas D.; !2321]
* Be more forgiving with wrongly sized clients [Robert; !2335]
* Add ClutterInputCapabilities enum and device property [Carlos; !2331]
* Fall back if COPY_MODE_SECONDARY_GPU fails to init [Daniel; !2341]
* Fix missing root window properties after XWayland start [Olivier; !2336]
* wayland/shm: Add support for ABGR8888 and XBGR8888 formats [Jonas Å.; !2352]
* Keep actors dirty if a redraw was queued up during paint() [Carlos; !2353]
* Fix overview painting of shaped texture with layer snippets [Jonas Å.; !2278]
* Survive missing GAMMA_LUT KMS property [Daniel; !2360]
* Record current event when going through event filters [Jonas D.; !2327]
* Pass events to pointer a11y before going through filters [Jonas D.; !2332]
* Update cursor when scaled or transformed [Sebastian W.; !2363]
* Fix screen cast when DMA buffer fails or can't be used [Jonas Å.; !2383]
* Repick when pointer actor goes unmapped [Jonas D.; !2333]
* Improve IM support [Carlos; !2365, !2384]
* Allow using dumb buffers for cursor sprites [Jonas Å.; !2275]
* wayland/dma-buf: Only advertise supported formats [Robert; !2386]
* Fix screen cast cursor metadata with unthrottled input [Jonas Å.; !2393]
* Fixed crashes [Olivier Daniel, Łukasz, Jonas D.; !2339, !2359, !2347, !2299]
* Plugged memory leak [Sebastian K.; !2345]
* Misc. bug fixes and cleanups [Christian, Jonas Å., Bartłomiej, Carlos, Daniel,
Sebastian W., Corentin, Jonas D., Sebastian K.; !2316, !2152, !2334, !2349,
!2325, !2357, !2362, !2373, !2374, !2361, !2366, !2350, !2377, !2382, !2391,
!2395, !2387, !2400, !2397, !2378]
Contributors:
Jonas Dreßler, Bilal Elmoussaoui, Olivier Fourdan, Carlos Garnacho,
Christian Hergert, Sebastian Keller, Robert Mader, Florian Müllner,
Corentin Noël, Bartłomiej Piotrowski, Łukasz Spintzyk, Daniel van Vugt,
Sebastian Wick, Jonas Ådahl
Translators:
Balázs Úr [hu], Charles Monzat [fr], Milo Casagrande [it], Марко Костић [sr],
Nathan Follens [nl], Jordi Mas [ca], Ngọc Quân Trần [vi]
42.0
====
Translators:
Fabio Tomat [fur], Alexander Shopov [bg]
42.rc
=====
* Fix X11 → wayland drops ending up in the wrong wayland client [Olivier; !2305]
* Make xdg-activation interoperate with other startup sequences [Carlos; !2314]
* Fix stuck grab feedback actor during compositor grabs [Jonas D.; !2308]
* Make gnome-desktop dependency optional [Bilal; !2317]
* Provide better profiling information [Ivan; !1928]
* Drop ClutterEvent "source" field [Carlos; !2311]
* Add support for xdg_toplevel.configure_bounds() [Jonas Å.; !2167]
* Add support for wl_surface.offset [Jonas Å.; !1905]
* Fix resizing of virtual monitors [Jonas Å.; !2270]
* Include size in configure events of maximized clients [Sebastian K.; !2238]
* Only allow direct scanouts for surfaces that aren't cropped, scaled or rotated
[Robert; !2276]
* Fix pipewire screencasts [Ivan; !2322]
* Plugged memory leak [Robert; !2297]
* Fixed crash [Jonas; !2318]
* Misc. bug fixes and cleanups [Bilal, Jonas Å., Florian, Dor, Alfonso,
Sebastian W., Carlos, Jonas D.; !2306, !2300, !2301, !2303, !2307, !2315,
!2319, !2298, !2320, !2324]
Contributors:
Dor Askayo, Jonas Dreßler, Bilal Elmoussaoui, Olivier Fourdan,
Carlos Garnacho, Sebastian Keller, Robert Mader, Ivan Molodetskikh,
Florian Müllner, Alfonso Sánchez-Beato, Sebastian Wick, Jonas Ådahl
Translators:
Emin Tufan Çetin [tr], Yosef Or Boczko [he], Quentin PAGÈS [oc],
Christian Kirbach [de], Aurimas Černius [lt], Danial Behzadi [fa],
Daniel Mustieles [es], Alan Mortensen [da], Goran Vidović [hr],
Tim Sabsch [de], Anders Jonsson [sv], Gwan-gyeong Mun [ko],
Daniel Șerbănescu [ro], Piotr Drąg [pl]
42.beta
=======
* Implement a new Clutter grab API [Carlos; !2068, !2099, !2100]
* Support KMS testing via QEMU [Jonas Å.; !2151]
* Generate API references with gi-docgen [Andy; !2248]
* Improve support for running from toolbx [Sebastian; !2254, !2261]
* Add support for privacy screen [Marco; !1952]
* Allow changing monitor configuration policy [Jonas Å.; !2030]
* Add support for XFixes ClientDisconnectMode [Olivier; !1794]
* Fix possible missed clicks on menus [Carlos; !2257]
* Place popups on the same monitor as the anchor rect [Jonas Å.; !2252]
* Announce DMA-BUF support via pipewire [columbarius; !1939]
* Raise the file descriptor limit of the wayland compositor [Olivier; !2235]
* Fix resetting idle time on lid open [Carlos; !2272]
* Don't limit DMA buffer screen casting only to Intel [Jonas Å.; !2086]
* Keep a single cursor sprite visible with tablets [Carlos; !285]
* Sync keyboard LEDs after layout changes [Konstantin; !2279]
* Honor window input area in picking [Carlos; !2283]
* Handle mixture of keycombo/no action in pad rings/strips [Carlos; !2001]
* Fixed crashes [Carlos, Jonas Å., Daniel; !2237, !2280, !2282, !2251]
* Misc. bug fixes and cleanups [Björn, Jonas Å., Daniel, Michel, Robert,
Pascal, Florian, Olivier, Pabel, Carlos, Jonas D.; !2236, !2014, !2240,
!2230, !2232, !2255, !2245, !2242, !2159, !2253, !2258, !2263, !2266,
!2271, !2256, !2264, !2262, !2281, !2287, !2284]
Contributors:
Marco Trevisan (Treviño), Björn Daase, Jonas Dreßler, Michel Dänzer,
Olivier Fourdan, Carlos Garnacho, Pablo Correa Gómez, Andy Holmes,
Konstantin Kharlamov, Robert Mader, Florian Müllner, Pascal Nowack,
Daniel van Vugt, Sebastian Wick, columbarius, Jonas Ådahl
Translators:
Yaron Shahrabani [he], Boyuan Yang [zh_CN], Marek Černocký [cs],
Aurimas Černius [lt], Kukuh Syafaat [id], Daniel Mustieles [es],
Yuri Chornoivan [uk], Hugo Carvalho [pt], Yosef Or Boczko [he],
Fran Dieguez [gl], Matheus Barbosa [pt_BR], Aleksandr Melman [ru],
sicklylife [ja], Luming Zh [zh_CN], Matej Urbančič [sl],
Leônidas Araújo [pt_BR], Asier Sarasua Garmendia [eu],
Jordi Mas i Hernandez [ca]
42.alpha
========
* Fix monitor screencast scanouts [Michel; !1914]
* dma-buf: Use alpha-less pixel formats where appropriate [Robert; !1810]
* wayland: Allow clients to maximize windows regardless of constraints
[Christian; !1997]
* Handle hotplug events without relevant changes more effectively [Marco; !1964]
* Handle hotplug events without relevant changes more effectively
[Marco; !1964]
* Improve error reporting when startup fails [Jonas; !1994]
* dma-buf: Add support for ABGR and XBGR formats [Erfan; !1999]
* Fix X11 middle button emulation setting [José; !2000]
@@ -625,82 +16,27 @@ Translators:
* Fix videos in Firefox stuttering in overview [Robert; !2034]
* Don't use atomic mode setting for virtio_gpu driver [Jonas; !2040]
* Improve on-screen keyboard on X11 [Sebastian, Ray; !1955, !2039]
* misc [Daniel, Jonas, Corentin, Robert; !1992, !2007, !2008, !2026, !2044]
* Fix text glitches after size changes [Sebastian; !2006]
* Fix reporting output rotation to xwayland [Olivier; !2050]
* wayland: Accept final preference of drop destination [Robert; !2043]
* Only add paint volumes of mapped actors to stage clip [Robert; !2035]
* Fix negative paint volume offscreen effect [Sebastian; !2031]
* Introduce MetaRenderDevice [Jonas; !1854]
* Prefer GBM over EGLStream where possible [Jonas; !2051, !2052]
* Fix erratic scrolling in GTK apps [Carlos; !2059]
* Use rtkit to get realtime priority [Carlos; !2060]
* Turn experimental features into flags [Robert; !1961]
* Add support for EGL_KHR_partial_update [Erico; !2023]
* Use b/w unicode for tablet mode OSD [Carlos; !2064]
* Fix erratic scrolling in GTK apps [Carlos; gnome-shell#4647]
* Fix tilt direction of pen/tablet inputs [Quytelda; !2065]
* Sanitize event handling at gestures [Carlos; !2024]
* Use b/w unicode for tablet mode OSD [Carlos; !2064]
* Fix negative paint volume offscreen effect [Sebastian; !2031]
* Only add paint volumes of mapped actors to stage clip [Robert; !2035]
* Fix mapping tablet input to correct monitor [Jason; !1934]
* Optionally run (and exit) with a command [Mark; !1982]
* Fix key repeat of on-screen keyboard for 2nd-level keysyms [Ray; !2045]
* Copy damage rectangles to secondary GPU [Piotr; !2033]
* Fix window size after returning from fullscreen [Sebastian, Jonas; !2066]
* Fix blank screen when unplugging docking station [Jonas; !2097]
* Ensure constraints after client resize [Sebastian; !2103]
* Improve anti-aliasing of background corners [Daniel; !2102]
* Fix unredirected Xwayland windows not getting updated [Michel; !2112]
* Fix DND between X11 and wayland clients [Carlos; !2124]
* Add hold gestures [José; !1830]
* Always snoop key events for a11y [Carlos; !1328]
* Improve Wacom tablet mapping [Carlos; !2107]
* Allow adding more streams to a screen cast session [Jonas; !2131]
* Do not throttle input in wayland event delivery [Carlos; !1915]
* Allow forcing EGLStream backend [Jonas; !2132]
* Check keyboard serials for activation [Carlos; !2148]
* Rebind the EGLimage when handling damage [Neil; !2062]
* Do not pass events to windows with modal transients [Florian; !2123]
* Fix mixed up refresh rates in multi-monitor setups [Robert; !2169]
* Fix orientation changes on devices with 90° [Hans, Marco; !2090]
* Allow disabling HW cursors [Olivier; !2150]
* Improve damage handling [Robert; !2168]
* Consider xrandr flags for advertised modes [Robert; !2190]
* Improve KMS fallback modes [Robert; !2189]
* window-group: Disable culling when rendinging clone to offscreen buffer
[Sebastian; !2080]
* Support DMA buffer feedback [Jonas, Robert; !2202, !1959]
* Advance timelines according to presentation time [Daniel; !2161]
* Drop deprecated wl-shell and text-input-v3 support [Fernando; !2183, !2185]
* Fix workspace switch animation in default plugin [Mark, Erik; !2076, !2120]
* Fix unfullscreening of window that were mapped fullscreen [Jonas; !2210]
* Consider wayland subsurfaces for scanout [Robert; !2211]
* Fix DMA-BUF screencasts with unredirected fullscreen windows [Georges; !2186]
* Fixed crashes [Carlos, Jonas, Daniel; !2063, !2025, !2081, !2104, !1991,
!2111, !2127, !2147, !2181, !2216]
* Plugged leaks [Sebastian, Jonas; !2193, !2192, !2225]
* Misc. bug fixes and cleanups [Daniel, Jonas, Corentin, Robert, Georges,
Sebastian, Simon, Carlos, Pascal, Fernando, Joan, José, Florian, Alexander,
Ievgen; !1992, !2007, !2008, !2026, !2044, !2057, !2002, !2028, !2049, !2061,
!1796, !2079, !2084, !2088, !2093, !2009, !2094, !2108, !2125, !2133, !2128,
!2138, !2058, !2130, !2140, !2122, !2095, !2126, !2139, !2145, !2149, !2157,
!1966, !2163, !2158, !2134, !1993, !2142, !2162, !2173, !2187, !2199, !2203,
!2204, !2205, !2146, !1812, !2214, !2215, !2188, !2206]
* Misc. bug fixes and cleanups
Contributors:
Marco Trevisan (Treviño), Erfan Abdi, Dor Askayo, Michel Dänzer,
José Expósito, Olivier Fourdan, Carlos Garnacho, Jason Gerecke, Hans de Goede,
JoseExposito, Quytelda Kahja, Sebastian Keller, Robert Mader, Mark,
Erik Massop, Simon McVittie, Alexander Mikhaylenko, Fernando Monteiro,
Florian Müllner, Georges Basile Stavracas Neto, Bastien Nocera, Pascal Nowack,
Corentin Noël, Erico Nunes, Ievgen Popovych, Christian Rauch, Neil Roberts,
Ray Strode, Joan Torres, Daniel van Vugt, Jonas Ådahl, Piotr Łopatka
José Expósito, Olivier Fourdan, Carlos Garnacho, Jason Gerecke,
Quytelda Kahja, Sebastian Keller, Robert Mader, Bastien Nocera, Corentin Noël,
Christian Rauch, Ray Strode, Daniel van Vugt, Jonas Ådahl
Translators:
eshagh shahidani [fa], Danial Behzadi [fa], Марко Костић [sr],
Zander Brown [en_GB], Ngọc Quân Trần [vi], Rūdolfs Mazurs [lv],
Yuri Chornoivan [uk], Fabio Tomat [fur], Hugo Carvalho [pt],
Milo Casagrande [it], Quentin PAGÈS [oc], Goran Vidović [hr],
Yaron Shahrabani [he], Daniel Mustieles [es], Aleksandr Melman [ru],
Aurimas Černius [lt], Sveinn í Felli [is], Kukuh Syafaat [id],
Asier Sarasua Garmendia [eu]
Zander Brown [en_GB], Ngọc Quân Trần [vi], Rūdolfs Mazurs [lv]
41.0
====
@@ -723,7 +59,7 @@ Translators:
* wayland: Make each wl_output correspond to one monitor [Jonas; !1712]
* Expose 'inactive-since' timestamp to uresourced [Nishal; !1960]
* Pass dirty rects to secondary GPU [Piotr; !1879]
* Support committing preedit string on focus loss [Carlos; !1940]
* Support commiting preedit string on focus loss [Carlos; !1940]
* Improve auto-rotation support [Marco; !1233]
* Add meta_window_actor_paint_to_content() [Robert; !1893]
* Fixed crashes [Jonas, Ray, Robert; !1947, !1979, !1965, !1958]
@@ -1132,7 +468,7 @@ Translators:
* Optimize resource scale computation [Jonas D.; !1196, !1276, !1343]
* Allow animating ClutterActor's content property [Georges; !1301]
* Implement backgrounds as ClutterContent [Georges; !1302]
* Add ClutterAlignConstraint:pivot-point property [Jonas D.; !737]
* Add ClutterAlignContraint:pivot-point property [Jonas D.; !737]
* Fix crash on area screenshots with fractional scaling [Sebastian; !1320]
* Do not paint textures of fully obscured windows [Robert; !1326]
* Use a more appropriate combine function on opaque areas [Daniel; !1331]
@@ -3667,7 +3003,7 @@ Translations:
wasn't usable from a GNOME Shell extension, so has been changed to take
a GSettings object rather than the name of a schema [Jasper; #673014]
* Don't try to auto-maximize not-maximizable windows; this fixes the problem
with the Nautilus desktop window being mispositioned when enabled
with the Nautilus desktop window being mis-positioned when enabled
[Owen; #673566]
* Fix a crash in the default plugin (not used in GNOME) [Giovanni; #673809]
* Make the <Super> key work when set as the mouse button modifier
@@ -3782,7 +3118,7 @@ Translations:
* Handle changes to workspaces-only-on-primary GSetting [Florian; #664853]
* Don't use the Clutter default stage [Jasper; #664028]
* Fix compilation with --disable-introspection [Lionel; #661871]
* Fix problem where stage could end up missized on startup with
* Fix problem where stage could end up mis-sized on startup with
multiple monitors [Lionel]
* Misc bug fixes [Adel, Lionel, Jasper; #666015]
@@ -4109,7 +3445,7 @@ Translations:
meta_window_get_monitor()
MetaWindow::window-entered-monitor, <etaWindow::window-left-monitor
meta_window_move_to_monitor() [Florian]
* Behavior improvements for attached modal dialogs:
* Behavior improvemnts for attached modal dialogs:
- Allow dragging dragging on the titlebar to move the parent ["Ron"]
- Allow resizing [Florian]
- Constrain to be on the current monitor [Florian]
@@ -4878,7 +4214,7 @@ Translations: none
Thanks to Thomas Thurman for improvements in this version.
- Add casts to fix failure to build from source on 64bit hosts (Thomas) (#562106)
- Added script to produce announcements (Thomas)
- Added script to produce annoucements (Thomas)
Translations
Jorge González (es)

View File

@@ -14,7 +14,7 @@ window compositing, focus tracking, workspace management, keybindings and
monitor configuration.
Internally it uses a fork of Cogl, a hardware acceleration abstraction library
used to simplify usage of OpenGL pipelines, as well as a fork of Clutter, a
used to simplify usage of OpenGL pipelines, as well as a fork af Clutter, a
scene graph and user interface toolkit.
Mutter is used by, for example, GNOME Shell, the GNOME core user interface, and
@@ -29,15 +29,6 @@ To contribute, open merge requests at https://gitlab.gnome.org/GNOME/mutter.
It can be useful to look at the documentation available at the
[Wiki](https://gitlab.gnome.org/GNOME/mutter/-/wikis/home).
The API documentation is available at:
- Meta: <https://gnome.pages.gitlab.gnome.org/mutter/meta/>
- Clutter: <https://gnome.pages.gitlab.gnome.org/mutter/clutter/>
- Cally: <https://gnome.pages.gitlab.gnome.org/mutter/cally/>
- Cogl: <https://gnome.pages.gitlab.gnome.org/mutter/cogl/>
- CoglPango: <https://gnome.pages.gitlab.gnome.org/mutter/cogl-pango/>
- Mtk: <https://gnome.pages.gitlab.gnome.org/mutter/mtk/>
## Coding style and conventions
See [HACKING.md](./HACKING.md).
@@ -51,45 +42,6 @@ commit subjects with a relevant topic, such as `compositor:` or
`clutter/actor:`, and it's always better to write too much in the commit
message body than too little.
If a commit fixes an issue and that issue should be closed, add URL to it in
the bottom of the commit message and prefix with `Closes:`.
Do not add any `Part-of:` line, as that will be handled automatically when
merging.
### The Fixes tag
If a commit fixes a regression caused by a particular commit, it can be marked
with the `Fixes:` tag. To produce such a tag, use
```
git show -s --pretty='format:Fixes: %h (\"%s\")' <COMMIT>
```
or create an alias
```
git config --global alias.fixes "show -s --pretty='format:Fixes: %h (\"%s\")'"
```
and then use
```
git fixes <COMMIT>
```
### Example
```
compositor: Also consider dark matter when calculating paint volume
Ignoring dark matter when calculating the paint volume missed the case where
compositing happens in complete vacuum.
Fixes: 123abc123ab ("compositor: Calculate paint volume ourselves")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1234
```
## Default branch
The default development branch is `main`. If you still have a local

View File

@@ -11,13 +11,9 @@ import tempfile
uncrustify_cfg = 'tools/uncrustify.cfg'
def run_diff(sha):
proc = subprocess.run(
["git", "diff", "-U0", "--function-context", sha, "HEAD"],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
encoding="utf-8",
)
return proc.stdout.strip().splitlines()
proc = subprocess.Popen(["git", "diff", "-U0", "--function-context", sha, "HEAD"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
files = proc.stdout.read().strip().decode('utf-8')
return files.split('\n')
def find_chunks(diff):
file_entry_re = re.compile('^\+\+\+ b/(.*)$')
@@ -46,15 +42,14 @@ def reformat_chunks(chunks, rewrite):
def create_temp_file(file, start, end):
with open(file) as f:
tmp = tempfile.NamedTemporaryFile()
if start > 1:
tmp.write(b'/** *INDENT-OFF* **/\n')
for i, line in enumerate(f, start=1):
if i == start - 1:
tmp.write(b'/** *INDENT-OFF* **/\n')
for i, line in enumerate(f):
if i == start - 2:
tmp.write(b'/** *INDENT-ON* **/\n')
tmp.write(bytes(line, 'utf-8'))
if i == end - 1:
if i == end - 2:
tmp.write(b'/** *INDENT-OFF* **/\n')
tmp.seek(0)
@@ -80,11 +75,9 @@ def reformat_chunks(chunks, rewrite):
tmp = create_temp_file(chunk['file'], chunk['start'], chunk['end'])
# uncrustify chunk
proc = subprocess.run(
["uncrustify", "-c", uncrustify_cfg, "-f", tmp.name],
stdout=subprocess.PIPE,
)
reindented = proc.stdout.splitlines(keepends=True)
proc = subprocess.Popen(["uncrustify", "-c", uncrustify_cfg, "-f", tmp.name], stdout=subprocess.PIPE)
reindented = proc.stdout.readlines()
proc.wait()
if proc.returncode != 0:
continue
@@ -95,32 +88,25 @@ def reformat_chunks(chunks, rewrite):
if dry_run is True:
# Show changes
proc = subprocess.run(
["diff", "-up", "--color=always", chunk['file'], formatted.name],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
encoding="utf-8",
)
diff = proc.stdout
proc = subprocess.Popen(["diff", "-up", "--color=always", chunk['file'], formatted.name], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
diff = proc.stdout.read().decode('utf-8')
if diff != '':
output = re.sub('\t', '\t', diff)
print(output)
changed = True
else:
# Apply changes
diff = subprocess.run(
["diff", "-up", chunk['file'], formatted.name],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
patch = subprocess.run(["patch", chunk['file']], input=diff.stdout)
diff = subprocess.Popen(["diff", "-up", chunk['file'], formatted.name], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
patch = subprocess.Popen(["patch", chunk['file']], stdin=diff.stdout)
diff.stdout.close()
patch.communicate()
formatted.close()
return changed
parser = argparse.ArgumentParser(description='Check code style. Needs uncrustify installed.')
parser = argparse.ArgumentParser(description='Check code style.')
parser.add_argument('--sha', metavar='SHA', type=str,
help='SHA for the commit to compare HEAD with')
parser.add_argument('--dry-run', '-d', type=bool,
@@ -143,22 +129,10 @@ chunks = find_chunks(diff)
changed = reformat_chunks(chunks, rewrite)
if dry_run is not True and rewrite is True:
proc = subprocess.run(["git", "add", "-p"])
if proc.returncode == 0:
# Commit the added changes as a squash commit
subprocess.run(
["git", "commit", "--squash", "HEAD", "-C", "HEAD"],
stdout=subprocess.DEVNULL)
# Delete the unapplied changes
subprocess.run(["git", "reset", "--hard"], stdout=subprocess.DEVNULL)
proc = subprocess.Popen(["git", "commit", "--all", "--amend", "-C", "HEAD"], stdout=subprocess.DEVNULL)
os._exit(0)
elif dry_run is True and changed is True:
print(f"""
Issue the following commands in your local tree to apply the suggested changes:
$ git rebase {sha} --exec "./check-style.py -r"
$ git rebase --autosquash {sha}
""")
print ("\nIssue the following command in your local tree to apply the suggested changes (needs uncrustify installed):\n\n $ git rebase origin/main --exec \"./check-style.py -r\" \n")
os._exit(-1)
os._exit(0)

View File

@@ -27,7 +27,7 @@ that on CallyRoot:
* CallyUtil callbacks these signals are related to key event
listeners (key snooper simulation). One of the main CallyUtil
responsibilities is managing event (connecting, emitting), so I
responsabilities is managing event (connecting, emitting), so I
would prefer to not start to add/mix more functionalities here.
Ideally it would be better to emit all CallyStage methods from
@@ -56,7 +56,7 @@ Adding -Wshadow option and solving warnings related
2010-06-14 Alejandro Piñeiro <apinheiro@igalia.com>
Added dummy padding for future vt expansion
Added dummy padding for future vt expasion
Added dummy padding on the different classes structures, to allow
future expansion of virtual methods.
@@ -393,7 +393,7 @@ Manage properly ATK_STATE_ACTIVE on CallyStage
* cally/cally-stage.c
Added private struct
(cally_stage_class_init),(cally_stage_init),(cally_stage_real_initialize):
(cally_stage_class_init),(cally_stage_init),(cally_stage_real_initalize):
Initialization stuff
(cally_stage_activate_cb)
(cally_stage_deactivate_cb): new ClutterStage signal callbacks, change
@@ -975,7 +975,7 @@ Missing cail-rectangle.[ch] files, according 2009-02-23 entry at Changelog
2009-02-18 Alejandro Pinheiro <apinheiro@igalia.com>
* configure.ac: added additional compile flags
* configure.ac: added aditional compile flags
* cail/cail-actor.[ch]: Reimplemented support for AtkAction interface
* cail/cail-root.[ch]: code style review

View File

@@ -22,9 +22,10 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CALLY_ACTOR_PRIVATE_H__
#define __CALLY_ACTOR_PRIVATE_H__
#include "cally/cally-actor.h"
#include "cally-actor.h"
/*
* Auxiliary define, in order to get the clutter actor from the AtkObject using
@@ -37,3 +38,5 @@
void _cally_actor_get_top_level_origin (ClutterActor *actor,
gint *x,
gint *y);
#endif /* __CALLY_ACTOR_PRIVATE_H__ */

View File

@@ -23,11 +23,12 @@
*/
/**
* CallyActor:
*
* Implementation of the ATK interfaces for [class@Clutter.Actor]
* SECTION:cally-actor
* @Title: CallyActor
* @short_description: Implementation of the ATK interfaces for #ClutterActor
* @see_also: #ClutterActor
*
* #CallyActor implements the required ATK interfaces of [class@Clutter.Actor]
* #CallyActor implements the required ATK interfaces of #ClutterActor
* exposing the common elements on each actor (position, extents, etc).
*/
@@ -41,7 +42,7 @@
* has a key focus managed by the stage. Basically any actor can be focused using
* clutter_stage_set_key_focus. So, we will use this approach: all actors are
* focusable, and we get the currently focused using clutter_stage_get_key_focus
* This affects focus related stateset and some atk_component focus methods (like
* This affects focus related stateset and some atk_componenet focus methods (like
* grab focus).
*
* In the same way, we will manage the focus state change management
@@ -66,17 +67,17 @@
*
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include <glib.h>
#include <clutter/clutter.h>
#include "clutter/clutter.h"
#include "clutter/clutter-actor-private.h"
#include <math.h>
#include "cally/cally-actor.h"
#include "cally/cally-actor-private.h"
#include "cally-actor.h"
#include "cally-actor-private.h"
typedef struct _CallyActorActionInfo CallyActorActionInfo;
@@ -193,6 +194,8 @@ G_DEFINE_TYPE_WITH_CODE (CallyActor,
* Creates a new #CallyActor for the given @actor
*
* Return value: the newly created #AtkObject
*
* Since: 1.4
*/
AtkObject *
cally_actor_new (ClutterActor *actor)
@@ -1032,6 +1035,8 @@ _cally_actor_get_action_info (CallyActor *cally_actor,
* Adds a new action to be accessed with the #AtkAction interface.
*
* Return value: added action id, or -1 if failure
*
* Since: 1.4
*/
guint
cally_actor_add_action (CallyActor *cally_actor,
@@ -1061,6 +1066,8 @@ cally_actor_add_action (CallyActor *cally_actor,
* Adds a new action to be accessed with the #AtkAction interface.
*
* Return value: added action id, or -1 if failure
*
* Since: 1.6
*/
guint
cally_actor_add_action_full (CallyActor *cally_actor,
@@ -1097,9 +1104,11 @@ cally_actor_add_action_full (CallyActor *cally_actor,
* @cally_actor: a #CallyActor
* @action_id: the action id
*
* Removes a action, using the @action_id returned by [method@Actor.add_action]
* Removes a action, using the @action_id returned by cally_actor_add_action()
*
* Return value: %TRUE if the operation was successful, %FALSE otherwise
*
* Since: 1.4
*/
gboolean
cally_actor_remove_action (CallyActor *cally_actor,
@@ -1129,9 +1138,11 @@ cally_actor_remove_action (CallyActor *cally_actor,
* @action_name: the name of the action to remove
*
* Removes an action, using the @action_name used when the action was added
* with [method@Actor.add_action]
* with cally_actor_add_action()
*
* Return value: %TRUE if the operation was successful, %FALSE otherwise
*
* Since: 1.4
*/
gboolean
cally_actor_remove_action_by_name (CallyActor *cally_actor,

View File

@@ -22,15 +22,15 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CALLY_ACTOR_H__
#define __CALLY_ACTOR_H__
#if !defined(__CALLY_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <cally/cally.h> can be included directly."
#endif
#include <atk/atk.h>
#include "clutter/clutter.h"
#include <clutter/clutter.h>
G_BEGIN_DECLS
@@ -51,6 +51,8 @@ typedef struct _CallyActorPrivate CallyActorPrivate;
*
* Action function, to be used on #AtkAction implementations as a individual
* action
*
* Since: 1.4
*/
typedef void (* CallyActionFunc) (CallyActor *cally_actor);
@@ -60,14 +62,22 @@ typedef void (* CallyActionFunc) (CallyActor *cally_actor);
* @user_data: user data passed to the function
*
* Action function, to be used on #AtkAction implementations as
* an individual action.
*
* Unlike #CallyActionFunc, this function uses the @user_data
* argument passed to [method@Actor.add_action_full].
* an individual action. Unlike #CallyActionFunc, this function
* uses the @user_data argument passed to cally_actor_add_action_full().
*
* Since: 1.6
*/
typedef void (* CallyActionCallback) (CallyActor *cally_actor,
gpointer user_data);
/**
* CallyActor:
*
* The <structname>CallyActor</structname> structure contains only private
* data and should be accessed using the provided API
*
* Since: 1.4
*/
struct _CallyActor
{
/*< private >*/
@@ -79,6 +89,8 @@ struct _CallyActor
/**
* CallyActorClass:
* @notify_clutter: Signal handler for notify signal on Clutter actor
* @focus_clutter: Signal handler for key-focus-in and key-focus-out
* signal on Clutter actor. This virtual functions is deprecated.
* @add_actor: Signal handler for actor-added signal on
* ClutterContainer interface
* @remove_actor: Signal handler for actor-added signal on
@@ -86,6 +98,8 @@ struct _CallyActor
*
* The <structname>CallyActorClass</structname> structure contains
* only private data
*
* Since: 1.4
*/
struct _CallyActorClass
{
@@ -96,6 +110,9 @@ struct _CallyActorClass
void (*notify_clutter) (GObject *object,
GParamSpec *pspec);
gboolean (*focus_clutter) (ClutterActor *actor,
gpointer data);
gint (*add_actor) (ClutterActor *container,
ClutterActor *actor,
gpointer data);
@@ -103,6 +120,10 @@ struct _CallyActorClass
gint (*remove_actor) (ClutterActor *container,
ClutterActor *actor,
gpointer data);
/*< private >*/
/* padding for future expansion */
gpointer _padding_dummy[32];
};
CLUTTER_EXPORT
@@ -135,3 +156,5 @@ gboolean cally_actor_remove_action_by_name (CallyActor *cally_actor,
const gchar *action_name);
G_END_DECLS
#endif /* __CALLY_ACTOR_H__ */

View File

@@ -15,15 +15,18 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* CallyClone:
*
* Implementation of the ATK interfaces for a #ClutterClone
* SECTION:cally-clone
* @Title: CallyClone
* @short_description: Implementation of the ATK interfaces for a #ClutterClone
* @see_also: #ClutterClone
*
* #CallyClone implements the required ATK interfaces of [class@Clutter.Clone]
* #CallyClone implements the required ATK interfaces of #ClutterClone
*
* In particular it sets a proper role for the clone, as just a image,
* as it is the sanest and simplest approach.
@@ -33,7 +36,7 @@
*
* In the old times, it was just ClutterCloneTexture. So, from a a11y POV
* CallyCloneTexture was just another image, like ClutterTexture, and if
* it was a clone was irrelevant. So on cally-0.8, CallyCloneTexture
* it was a clone was irrevelant. So on cally-0.8, CallyCloneTexture
* expose a object with role ATK_ROLE_IMAGE. But now, ClutterClone is more
* general. You can clone any object, including groups, and made things
* like have one text entry, and a clone with different properties in the
@@ -66,10 +69,10 @@
* a11y POV should still be managed as a image (with the proper properties,
* position, size, etc.).
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "cally/cally-clone.h"
#include "cally/cally-actor-private.h"
#include "cally-clone.h"
#include "cally-actor-private.h"
/* AtkObject */
static void cally_clone_real_initialize (AtkObject *obj,
@@ -97,9 +100,11 @@ cally_clone_init (CallyClone *clone)
* @actor: a #ClutterActor
*
* Creates a new #CallyClone for the given @actor. @actor must be a
* [class@Clutter.Clone].
* #ClutterClone.
*
* Return value: the newly created #AtkObject
*
* Since: 1.4
*/
AtkObject*
cally_clone_new (ClutterActor *actor)

View File

@@ -18,14 +18,15 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CALLY_CLONE_H__
#define __CALLY_CLONE_H__
#if !defined(__CALLY_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <cally/cally.h> can be included directly."
#endif
#include "clutter/clutter.h"
#include "cally/cally-actor.h"
#include <clutter/clutter.h>
#include <cally/cally-actor.h>
G_BEGIN_DECLS
@@ -40,6 +41,14 @@ typedef struct _CallyClone CallyClone;
typedef struct _CallyCloneClass CallyCloneClass;
typedef struct _CallyClonePrivate CallyClonePrivate;
/**
* CallyClone:
*
* The <structname>CallyClone</structname> structure contains only private
* data and should be accessed using the provided API
*
* Since: 1.4
*/
struct _CallyClone
{
/*< private >*/
@@ -53,11 +62,16 @@ struct _CallyClone
*
* The <structname>CallyCloneClass</structname> structure contains only
* private data
*
* Since: 1.4
*/
struct _CallyCloneClass
{
/*< private >*/
CallyActorClass parent_class;
/* padding for future expansion */
gpointer _padding_dummy[8];
};
CLUTTER_EXPORT
@@ -66,3 +80,5 @@ CLUTTER_EXPORT
AtkObject *cally_clone_new (ClutterActor *actor);
G_END_DECLS
#endif /* __CALLY_CLONE_H__ */

View File

@@ -18,10 +18,13 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#pragma once
#ifndef _CALLY_FACTORY_H__
#define _CALLY_FACTORY_H__
#include <glib-object.h>
#include <atk/atkobject.h>
@@ -39,6 +42,8 @@
* It assumes that the accessibility object provides a
* @opt_create_accessible method in order to create the accessibility
* object. It returns a @type GType object.
*
* Since: 1.4
*/
#define CALLY_ACCESSIBLE_FACTORY(type, type_as_function, opt_create_accessible) \
\
@@ -101,8 +106,12 @@ type_as_function ## _factory_get_type (void) \
*
* Sets the #AtkObjectFactory to be used in order to instantiate
* accessibility objects for the actor which GType is @widget_type.
*
* Since: 1.4
*/
#define CALLY_ACTOR_SET_FACTORY(widget_type, type_as_function) \
atk_registry_set_factory_type (atk_get_default_registry (), \
widget_type, \
type_as_function ## _factory_get_type ())
#endif /* _CALLY_FACTORY_H__ */

View File

@@ -22,7 +22,8 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CALLY_MAIN_H__
#define __CALLY_MAIN_H__
#if !defined(__CALLY_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <cally/cally.h> can be included directly."
@@ -39,3 +40,5 @@ CLUTTER_EXPORT
gboolean cally_accessibility_init (void);
G_END_DECLS
#endif /* __CALLY_MAIN_H__ */

View File

@@ -15,31 +15,33 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* CallyRoot:
*
* Root object for the Cally toolkit
* SECTION:cally-root
* @short_description: Root object for the Cally toolkit
* @see_also: #ClutterStage
*
* #CallyRoot is the root object of the accessibility tree-like
* hierarchy, exposing the application level.
*
* Somewhat equivalent to #GailTopLevel. We consider that this class
* expose the a11y information of the [class@Clutter.StageManager], as the
* children of this object are the different [class@Clutter.Stage] managed (so
* the [class@GObject.Object] used in the atk_object_initialize() is the
* [class@Clutter.StageManager]).
* expose the a11y information of the #ClutterStageManager, as the
* children of this object are the different ClutterStage managed (so
* the #GObject used in the atk_object_initialize() is the
* #ClutterStageManager).
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "cally/cally-root.h"
#include "cally-root.h"
#include "clutter/clutter-actor.h"
#include "clutter/clutter-stage-private.h"
#include "clutter/clutter-stage-manager.h"
#include "clutter-actor.h"
#include "clutter-stage-private.h"
#include "clutter-stage-manager.h"
/* GObject */
@@ -111,6 +113,8 @@ cally_root_init (CallyRoot *root)
* Creates a new #CallyRoot object.
*
* Return value: the newly created #AtkObject
*
* Since: 1.4
*/
AtkObject*
cally_root_new (void)

View File

@@ -18,15 +18,15 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CALLY_ROOT_H__
#define __CALLY_ROOT_H__
#if !defined(__CALLY_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <cally/cally.h> can be included directly."
#endif
#include <atk/atk.h>
#include "clutter/clutter.h"
#include <clutter/clutter.h>
G_BEGIN_DECLS
@@ -41,6 +41,14 @@ typedef struct _CallyRoot CallyRoot;
typedef struct _CallyRootClass CallyRootClass;
typedef struct _CallyRootPrivate CallyRootPrivate;
/**
* CallyRoot:
*
* The <structname>CallyRoot</structname> structure contains only private
* data and should be accessed using the provided API
*
* Since: 1.4
*/
struct _CallyRoot
{
/*< private >*/
@@ -54,11 +62,16 @@ struct _CallyRoot
*
* The <structname>CallyRootClass</structname> structure contains only
* private data
*
* Since: 1.4
*/
struct _CallyRootClass
{
/*< private >*/
AtkGObjectAccessibleClass parent_class;
/* padding for future expansion */
gpointer _padding_dummy[16];
};
CLUTTER_EXPORT
@@ -67,3 +80,5 @@ CLUTTER_EXPORT
AtkObject *cally_root_new (void);
G_END_DECLS
#endif /* __CALLY_ROOT_H__ */

View File

@@ -15,26 +15,29 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* CallyStage:
*
* Implementation of the ATK interfaces for a #ClutterStage
* SECTION:cally-stage
* @Title: CallyStage
* @short_description: Implementation of the ATK interfaces for a #ClutterStage
* @see_also: #ClutterStage
*
* #CallyStage implements the required ATK interfaces for [class@Clutter.Stage]
* #CallyStage implements the required ATK interfaces for #ClutterStage
*
* Some implementation details: at this moment #CallyStage is used as
* the most similar Window object in this toolkit (ie: emitting window
* related signals), although the real purpose of [class@Clutter.Stage] is
* related signals), although the real purpose of #ClutterStage is
* being a canvas. Anyway, this is required for applications using
* just clutter, or directly [class@Clutter.Stage]
* just clutter, or directly #ClutterStage
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "cally/cally-stage.h"
#include "cally/cally-actor-private.h"
#include "cally-stage.h"
#include "cally-actor-private.h"
/* AtkObject.h */
static void cally_stage_real_initialize (AtkObject *obj,
@@ -90,9 +93,11 @@ cally_stage_init (CallyStage *cally_stage)
* @actor: a #ClutterActor
*
* Creates a new #CallyStage for the given @actor. @actor should be a
* [class@Clutter.Stage].
* #ClutterStage.
*
* Return value: the newly created #AtkObject
*
* Since: 1.4
*/
AtkObject*
cally_stage_new (ClutterActor *actor)

View File

@@ -18,14 +18,15 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CALLY_STAGE_H__
#define __CALLY_STAGE_H__
#if !defined(__CALLY_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <cally/cally.h> can be included directly."
#endif
#include "cally/cally-actor.h"
#include "clutter/clutter.h"
#include <cally/cally-actor.h>
#include <clutter/clutter.h>
G_BEGIN_DECLS
@@ -40,6 +41,14 @@ typedef struct _CallyStage CallyStage;
typedef struct _CallyStageClass CallyStageClass;
typedef struct _CallyStagePrivate CallyStagePrivate;
/**
* CallyStage:
*
* The <structname>CallyStage</structname> structure contains only
* private data and should be accessed using the provided API
*
* Since: 1.4
*/
struct _CallyStage
{
/*< private >*/
@@ -53,11 +62,16 @@ struct _CallyStage
*
* The <structname>CallyStageClass</structname> structure contains only
* private data
*
* Since: 1.4
*/
struct _CallyStageClass
{
/*< private >*/
CallyActorClass parent_class;
/* padding for future expansion */
gpointer _padding_dummy[16];
};
CLUTTER_EXPORT
@@ -66,3 +80,5 @@ CLUTTER_EXPORT
AtkObject *cally_stage_new (ClutterActor *actor);
G_END_DECLS
#endif /* __CALLY_STAGE_H__ */

View File

@@ -23,26 +23,30 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* CallyText:
*
* Implementation of the ATK interfaces for a [class@Clutter.Text]
* SECTION:cally-text
* @short_description: Implementation of the ATK interfaces for a #ClutterText
* @see_also: #ClutterText
*
* #CallyText implements the required ATK interfaces of
* [class@Clutter.Text], #AtkText and #AtkEditableText
* #ClutterText, #AtkText and #AtkEditableText
*
*
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "cally/cally-text.h"
#include "cally/cally-actor-private.h"
#include "cally-text.h"
#include "cally-actor-private.h"
#include "clutter/clutter-color.h"
#include "clutter/clutter-main.h"
#include "clutter/clutter-text.h"
#include "clutter-color.h"
#include "clutter-main.h"
#include "clutter-text.h"
static void cally_text_finalize (GObject *obj);
@@ -253,9 +257,11 @@ cally_text_finalize (GObject *obj)
* @actor: a #ClutterActor
*
* Creates a new #CallyText for the given @actor. @actor must be a
* [class@Clutter.Text].
* #ClutterText.
*
* Return value: the newly created #AtkObject
*
* Since: 1.4
*/
AtkObject*
cally_text_new (ClutterActor *actor)

View File

@@ -18,14 +18,15 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CALLY_TEXT_H__
#define __CALLY_TEXT_H__
#if !defined(__CALLY_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <cally/cally.h> can be included directly."
#endif
#include "clutter/clutter.h"
#include "cally/cally-actor.h"
#include <clutter/clutter.h>
#include <cally/cally-actor.h>
G_BEGIN_DECLS
@@ -40,6 +41,14 @@ typedef struct _CallyText CallyText;
typedef struct _CallyTextClass CallyTextClass;
typedef struct _CallyTextPrivate CallyTextPrivate;
/**
* CallyText:
*
* The <structname>CallyText</structname> structure contains only private
* data and should be accessed using the provided API
*
* Since: 1.4
*/
struct _CallyText
{
/*< private >*/
@@ -53,11 +62,16 @@ struct _CallyText
*
* The <structname>CallyTextClass</structname> structure contains only
* private data
*
* Since: 1.4
*/
struct _CallyTextClass
{
/*< private >*/
CallyActorClass parent_class;
/* padding for future expansion */
gpointer _padding_dummy[8];
};
CLUTTER_EXPORT
@@ -66,3 +80,5 @@ CLUTTER_EXPORT
AtkObject* cally_text_new (ClutterActor *actor);
G_END_DECLS
#endif /* __CALLY_TEXT_H__ */

View File

@@ -18,13 +18,16 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* CallyUtil:
*
* #AtkUtil implementation
* SECTION:cally-util
* @Title: CallyUtil
* @short_description: #AtkUtil implementation
* @see_also: #ClutterActor
*
* #CallyUtil implements #AtkUtil abstract methods. Although it
* includes the name "Util" it is in fact one of the most important
@@ -35,15 +38,15 @@
* available any accessible object.
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include <stdlib.h>
#include <string.h>
#include <clutter/clutter.h>
#include "cally/cally-util.h"
#include "cally/cally-root.h"
#include "cally/cally-stage.h"
#include "clutter/clutter.h"
#include "cally-util.h"
#include "cally-root.h"
#include "cally-stage.h"
#define DEFAULT_PASSWORD_CHAR '*'
@@ -57,6 +60,17 @@ static const gchar * cally_util_get_toolkit_name (void);
static const gchar * cally_util_get_toolkit_version (void);
/* private */
static void cally_util_simulate_snooper_install (void);
static void cally_util_simulate_snooper_remove (void);
static gboolean cally_key_snooper (ClutterActor *actor,
ClutterEvent *event,
gpointer user_data);
static void cally_util_stage_added_cb (ClutterStageManager *stage_manager,
ClutterStage *stage,
gpointer data);
static void cally_util_stage_removed_cb (ClutterStageManager *stage_manager,
ClutterStage *stage,
gpointer data);
static gboolean notify_hf (gpointer key,
gpointer value,
gpointer data);
@@ -139,8 +153,12 @@ cally_util_add_key_event_listener (AtkKeySnoopFunc listener,
CallyKeyEventInfo *event_info = NULL;
if (!key_listener_list)
{
key_listener_list = g_hash_table_new_full (NULL, NULL, NULL, g_free);
cally_util_simulate_snooper_install ();
}
event_info = g_new (CallyKeyEventInfo, 1);
event_info->listener = listener;
event_info->func_data = data;
@@ -161,11 +179,75 @@ cally_util_remove_key_event_listener (guint remove_listener)
{
g_hash_table_destroy (key_listener_list);
key_listener_list = NULL;
cally_util_simulate_snooper_remove ();
}
}
/* ------------------------------ PRIVATE FUNCTIONS ------------------------- */
/* Trying to emulate gtk_key_snooper install (a kind of wrapper). This
could be implemented without it, but I will maintain it in this
way, so if in the future clutter implements it natively it would be
easier the transition */
static void
cally_util_simulate_snooper_install (void)
{
ClutterStageManager *stage_manager = NULL;
ClutterStage *stage = NULL;
GSList *stage_list = NULL;
GSList *iter = NULL;
stage_manager = clutter_stage_manager_get_default ();
stage_list = clutter_stage_manager_list_stages (stage_manager);
for (iter = stage_list; iter != NULL; iter = g_slist_next (iter))
{
stage = CLUTTER_STAGE (iter->data);
g_signal_connect (G_OBJECT (stage), "captured-event",
G_CALLBACK (cally_key_snooper), NULL);
}
g_signal_connect (G_OBJECT (stage_manager), "stage-added",
G_CALLBACK (cally_util_stage_added_cb), cally_key_snooper);
g_signal_connect (G_OBJECT (stage_manager), "stage-removed",
G_CALLBACK (cally_util_stage_removed_cb), cally_key_snooper);
g_slist_free (stage_list);
}
static void
cally_util_simulate_snooper_remove (void)
{
ClutterStageManager *stage_manager = NULL;
ClutterStage *stage = NULL;
GSList *stage_list = NULL;
GSList *iter = NULL;
gint num = 0;
stage_manager = clutter_stage_manager_get_default ();
stage_list = clutter_stage_manager_list_stages (stage_manager);
for (iter = stage_list; iter != NULL; iter = g_slist_next (iter))
{
stage = CLUTTER_STAGE (iter->data);
num += g_signal_handlers_disconnect_by_func (stage, cally_key_snooper, NULL);
}
g_signal_handlers_disconnect_by_func (G_OBJECT (stage_manager),
G_CALLBACK (cally_util_stage_added_cb),
cally_key_snooper);
g_signal_handlers_disconnect_by_func (G_OBJECT (stage_manager),
G_CALLBACK (cally_util_stage_removed_cb),
cally_key_snooper);
#ifdef CALLY_DEBUG
g_print ("Number of snooper callbacks disconnected: %i\n", num);
#endif
}
static AtkKeyEventStruct *
atk_key_event_from_clutter_event_key (ClutterKeyEvent *clutter_event,
gunichar password_char)
@@ -173,7 +255,7 @@ atk_key_event_from_clutter_event_key (ClutterKeyEvent *clutter_event,
AtkKeyEventStruct *atk_event = g_new0 (AtkKeyEventStruct, 1);
gunichar key_unichar;
switch (clutter_event_type ((ClutterEvent *) clutter_event))
switch (clutter_event->type)
{
case CLUTTER_KEY_PRESS:
atk_event->type = ATK_KEY_EVENT_PRESS;
@@ -189,7 +271,7 @@ atk_key_event_from_clutter_event_key (ClutterKeyEvent *clutter_event,
if (password_char)
atk_event->state = 0;
else
atk_event->state = clutter_event_get_state ((ClutterEvent *) clutter_event);
atk_event->state = clutter_event->modifier_state;
/* We emit the clutter keyval. This is not exactly the one expected
by AtkKeyEventStruct, as it expects a Gdk-like event, with the
@@ -200,7 +282,7 @@ atk_key_event_from_clutter_event_key (ClutterKeyEvent *clutter_event,
if (password_char)
atk_event->keyval = clutter_unicode_to_keysym (password_char);
else
atk_event->keyval = clutter_event_get_key_symbol ((ClutterEvent *) clutter_event);
atk_event->keyval = clutter_event->keyval;
/* It is expected to store a key defining string here (ie "Space" in
case you press a space). Anyway, there are no function on clutter
@@ -222,7 +304,8 @@ atk_key_event_from_clutter_event_key (ClutterKeyEvent *clutter_event,
new = g_string_new ("");
new = g_string_insert_unichar (new, 0, key_unichar);
atk_event->string = g_string_free (new, FALSE);
atk_event->string = new->str;
g_string_free (new, FALSE);
}
else
atk_event->string = NULL;
@@ -236,9 +319,9 @@ atk_key_event_from_clutter_event_key (ClutterKeyEvent *clutter_event,
if (password_char)
atk_event->keycode = 0;
else
atk_event->keycode = clutter_event_get_key_code ((ClutterEvent *) clutter_event);
atk_event->keycode = clutter_event->hardware_keycode;
atk_event->timestamp = clutter_event_get_time ((ClutterEvent *) clutter_event);
atk_event->timestamp = clutter_event->time;
#ifdef CALLY_DEBUG
@@ -276,13 +359,10 @@ insert_hf (gpointer key, gpointer value, gpointer data)
* char
*/
static gunichar
check_key_visibility (ClutterStage *stage)
check_key_visibility (ClutterEvent *event)
{
AtkObject *accessible;
ClutterActor *focus;
focus = clutter_stage_get_key_focus (stage);
accessible = clutter_actor_get_accessible (focus);
ClutterKeyEvent *key_event = (ClutterKeyEvent *)event;
AtkObject *accessible = clutter_actor_get_accessible (key_event->source);
g_return_val_if_fail (accessible != NULL, 0);
@@ -298,44 +378,65 @@ check_key_visibility (ClutterStage *stage)
still better fill this with a default unichar that the original
one */
if (CLUTTER_IS_TEXT (focus))
return clutter_text_get_password_char (CLUTTER_TEXT (focus));
if (CLUTTER_IS_TEXT (key_event->source))
return clutter_text_get_password_char (CLUTTER_TEXT (key_event->source));
else
return DEFAULT_PASSWORD_CHAR;
}
gboolean
cally_snoop_key_event (ClutterStage *stage,
ClutterKeyEvent *key)
static gboolean
cally_key_snooper (ClutterActor *actor,
ClutterEvent *event,
gpointer user_data)
{
ClutterEvent *event = (ClutterEvent *) key;
AtkKeyEventStruct *key_event = NULL;
ClutterEventType event_type;
gboolean consumed = FALSE;
gint consumed = 0;
gunichar password_char = 0;
event_type = clutter_event_type (event);
/* filter key events */
if ((event_type != CLUTTER_KEY_PRESS) && (event_type != CLUTTER_KEY_RELEASE))
return FALSE;
if ((event->type != CLUTTER_KEY_PRESS) && (event->type != CLUTTER_KEY_RELEASE))
{
return FALSE;
}
password_char = check_key_visibility (event);
if (key_listener_list)
{
GHashTable *new_hash = g_hash_table_new (NULL, NULL);
g_hash_table_foreach (key_listener_list, insert_hf, new_hash);
password_char = check_key_visibility (stage);
key_event = atk_key_event_from_clutter_event_key (key, password_char);
key_event = atk_key_event_from_clutter_event_key ((ClutterKeyEvent *)event,
password_char);
/* func data is inside the hash table */
consumed = g_hash_table_foreach_steal (new_hash, notify_hf, key_event) > 0;
consumed = g_hash_table_foreach_steal (new_hash, notify_hf, key_event);
g_hash_table_destroy (new_hash);
g_free (key_event->string);
g_free (key_event);
}
return consumed;
return (consumed ? 1 : 0);
}
static void
cally_util_stage_added_cb (ClutterStageManager *stage_manager,
ClutterStage *stage,
gpointer data)
{
GCallback cally_key_snooper_cb = G_CALLBACK (data);
g_signal_connect (G_OBJECT (stage), "captured-event", cally_key_snooper_cb, NULL);
}
static void
cally_util_stage_removed_cb (ClutterStageManager *stage_manager,
ClutterStage *stage,
gpointer data)
{
GCallback cally_key_snooper_cb = G_CALLBACK (data);
g_signal_handlers_disconnect_by_func (stage, cally_key_snooper_cb, NULL);
}
void

View File

@@ -18,13 +18,14 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CALLY_UTIL_H__
#define __CALLY_UTIL_H__
#if !defined(__CALLY_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <cally/cally.h> can be included directly."
#endif
#include "clutter/clutter.h"
#include <clutter/clutter.h>
#include <atk/atk.h>
G_BEGIN_DECLS
@@ -40,6 +41,14 @@ typedef struct _CallyUtil CallyUtil;
typedef struct _CallyUtilClass CallyUtilClass;
typedef struct _CallyUtilPrivate CallyUtilPrivate;
/**
* CallyUtil:
*
* The <structname>CallyUtil</structname> structure contains only
* private data and should be accessed using the provided API
*
* Since: 1.4
*/
struct _CallyUtil
{
/*< private >*/
@@ -53,11 +62,16 @@ struct _CallyUtil
*
* The <structname>CallyUtilClass</structname> structure contains only
* private data
*
* Since: 1.4
*/
struct _CallyUtilClass
{
/*< private >*/
AtkUtilClass parent_class;
/* padding for future expansion */
gpointer _padding_dummy[8];
};
CLUTTER_EXPORT
@@ -65,7 +79,6 @@ GType cally_util_get_type (void) G_GNUC_CONST;
void _cally_util_override_atk_util (void);
gboolean cally_snoop_key_event (ClutterStage *stage,
ClutterKeyEvent *key);
G_END_DECLS
#endif /* __CALLY_UTIL_H__ */

View File

@@ -15,7 +15,9 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
@@ -27,24 +29,24 @@
*
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#include "cally/cally.h"
#include "cally.h"
#include "cally/cally-actor.h"
#include "cally/cally-stage.h"
#include "cally/cally-text.h"
#include "cally/cally-clone.h"
#include "cally-actor.h"
#include "cally-stage.h"
#include "cally-text.h"
#include "cally-clone.h"
#include "cally/cally-factory.h"
#include "cally/cally-util.h"
#include "cally-factory.h"
#include "cally-util.h"
#include "clutter/clutter.h"
#include "clutter.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-private.h"
#include "clutter-debug.h"
#include "clutter-private.h"
/* factories initialization*/
CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_ACTOR, cally_actor, cally_actor_new)
@@ -59,6 +61,8 @@ CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_CLONE, cally_clone, cally_clone_new)
*
* Return value: %TRUE if accessibility support has been correctly
* initialized.
*
* Since: 1.4
*/
gboolean
cally_accessibility_init (void)
@@ -84,6 +88,8 @@ cally_accessibility_init (void)
*
* Return value: %TRUE if accessibility support has been correctly
* initialized.
*
* Since: 1.4
*/
gboolean cally_get_cally_initialized (void)
{

View File

@@ -18,17 +18,20 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CALLY_H__
#define __CALLY_H__
#define __CALLY_H_INSIDE__
#include "cally/cally-actor.h"
#include "cally/cally-clone.h"
#include "cally/cally-factory.h"
#include "cally/cally-main.h"
#include "cally/cally-root.h"
#include "cally/cally-stage.h"
#include "cally/cally-text.h"
#include "cally/cally-util.h"
#include "cally-actor.h"
#include "cally-clone.h"
#include "cally-factory.h"
#include "cally-main.h"
#include "cally-root.h"
#include "cally-stage.h"
#include "cally-text.h"
#include "cally-util.h"
#undef __CALLY_H_INSIDE__
#endif /* __CALLY_H__ */

View File

@@ -1,45 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2021 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author:
* Carlos Garnacho <carlosg@gnome.org>
*/
#pragma once
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-action.h"
G_BEGIN_DECLS
void clutter_action_set_phase (ClutterAction *action,
ClutterEventPhase phase);
gboolean clutter_action_handle_event (ClutterAction *action,
const ClutterEvent *event);
void clutter_action_sequence_cancelled (ClutterAction *action,
ClutterInputDevice *device,
ClutterEventSequence *sequence);
G_END_DECLS

View File

@@ -23,92 +23,39 @@
*/
/**
* ClutterAction:
*
* Abstract class for event-related logic
* SECTION:clutter-action
* @Title: ClutterAction
* @Short_Description: Abstract class for event-related logic
* @See_Also: #ClutterConstraint
*
* #ClutterAction is an abstract base class for event-related actions that
* modify the user interaction of a [class@Actor], just like
* [class@Constraint] is an abstract class for modifiers of an actor's
* modify the user interaction of a #ClutterActor, just like
* #ClutterConstraint is an abstract class for modifiers of an actor's
* position or size.
*
* Implementations of #ClutterAction are associated to an actor and can
* provide behavioral changes when dealing with user input - for instance
* drag and drop capabilities, or scrolling, or panning - by using the
* various event-related signals provided by [class@Actor] itself.
* various event-related signals provided by #ClutterActor itself.
*
* #ClutterAction is available since Clutter 1.4
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-action.h"
#include "clutter/clutter-action-private.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-private.h"
#include "clutter-action.h"
typedef struct _ClutterActionPrivate ClutterActionPrivate;
#include "clutter-debug.h"
#include "clutter-private.h"
struct _ClutterActionPrivate
{
ClutterEventPhase phase;
};
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterAction, clutter_action,
CLUTTER_TYPE_ACTOR_META)
static gboolean
clutter_action_handle_event_default (ClutterAction *action,
const ClutterEvent *event)
{
return FALSE;
}
G_DEFINE_ABSTRACT_TYPE (ClutterAction, clutter_action, CLUTTER_TYPE_ACTOR_META);
static void
clutter_action_class_init (ClutterActionClass *klass)
{
klass->handle_event = clutter_action_handle_event_default;
}
static void
clutter_action_init (ClutterAction *self)
{
}
void
clutter_action_set_phase (ClutterAction *action,
ClutterEventPhase phase)
{
ClutterActionPrivate *priv;
priv = clutter_action_get_instance_private (action);
priv->phase = phase;
}
ClutterEventPhase
clutter_action_get_phase (ClutterAction *action)
{
ClutterActionPrivate *priv;
g_return_val_if_fail (CLUTTER_IS_ACTION (action), CLUTTER_PHASE_CAPTURE);
priv = clutter_action_get_instance_private (action);
return priv->phase;
}
gboolean
clutter_action_handle_event (ClutterAction *action,
const ClutterEvent *event)
{
return CLUTTER_ACTION_GET_CLASS (action)->handle_event (action, event);
}
void
clutter_action_sequence_cancelled (ClutterAction *action,
ClutterInputDevice *device,
ClutterEventSequence *sequence)
{
ClutterActionClass *action_class = CLUTTER_ACTION_GET_CLASS (action);
if (action_class->sequence_cancelled)
action_class->sequence_cancelled (action, device, sequence);
}

View File

@@ -22,13 +22,14 @@
* Emmanuele Bassi <ebassi@linux.intel.com>
*/
#pragma once
#ifndef __CLUTTER_ACTION_H__
#define __CLUTTER_ACTION_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-actor-meta.h"
#include <clutter/clutter-actor-meta.h>
G_BEGIN_DECLS
@@ -42,18 +43,22 @@ G_DECLARE_DERIVABLE_TYPE (ClutterAction, clutter_action,
* ClutterActionClass:
*
* The ClutterActionClass structure contains only private data
*
* Since: 1.4
*/
struct _ClutterActionClass
{
/*< private >*/
ClutterActorMetaClass parent_class;
gboolean (* handle_event) (ClutterAction *action,
const ClutterEvent *event);
void (* sequence_cancelled) (ClutterAction *action,
ClutterInputDevice *device,
ClutterEventSequence *sequence);
void (* _clutter_action1) (void);
void (* _clutter_action2) (void);
void (* _clutter_action3) (void);
void (* _clutter_action4) (void);
void (* _clutter_action5) (void);
void (* _clutter_action6) (void);
void (* _clutter_action7) (void);
void (* _clutter_action8) (void);
};
/* ClutterActor API */
@@ -65,11 +70,6 @@ void clutter_actor_add_action_with_name (ClutterActor *self,
const gchar *name,
ClutterAction *action);
CLUTTER_EXPORT
void clutter_actor_add_action_full (ClutterActor *self,
const char *name,
ClutterEventPhase phase,
ClutterAction *action);
CLUTTER_EXPORT
void clutter_actor_remove_action (ClutterActor *self,
ClutterAction *action);
CLUTTER_EXPORT
@@ -86,6 +86,6 @@ void clutter_actor_clear_actions (ClutterActor *self);
CLUTTER_EXPORT
gboolean clutter_actor_has_actions (ClutterActor *self);
ClutterEventPhase clutter_action_get_phase (ClutterAction *action);
G_END_DECLS
#endif /* __CLUTTER_ACTION_H__ */

View File

@@ -1,9 +1,12 @@
#pragma once
#ifndef __CLUTTER_ACTOR_BOX_PRIVATE_H__
#define __CLUTTER_ACTOR_BOX_PRIVATE_H__
#include "clutter/clutter-types.h"
#include <clutter/clutter-types.h>
G_BEGIN_DECLS
void _clutter_actor_box_enlarge_for_effects (ClutterActorBox *box);
G_END_DECLS
#endif /* __CLUTTER_ACTOR_BOX_PRIVATE_H__ */

View File

@@ -1,11 +1,11 @@
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include <math.h>
#include "clutter/clutter-types.h"
#include "clutter/clutter-interval.h"
#include "clutter/clutter-private.h"
#include "clutter/clutter-actor-box-private.h"
#include "clutter-types.h"
#include "clutter-interval.h"
#include "clutter-private.h"
#include "clutter-actor-box-private.h"
/**
* clutter_actor_box_new:
@@ -14,19 +14,21 @@
* @x_2: X coordinate of the bottom right point
* @y_2: Y coordinate of the bottom right point
*
* Allocates a new [struct@ActorBox] using the passed coordinates
* Allocates a new #ClutterActorBox using the passed coordinates
* for the top left and bottom right points.
*
* This function is the logical equivalent of:
*
* ```c
* |[
* clutter_actor_box_init (clutter_actor_box_alloc (),
* x_1, y_1,
* x_2, y_2);
* ```
* ]|
*
* Return value: (transfer full): the newly allocated #ClutterActorBox.
* Use [method@ActorBox.free] to free the resources
* Use clutter_actor_box_free() to free the resources
*
* Since: 1.0
*/
ClutterActorBox *
clutter_actor_box_new (gfloat x_1,
@@ -42,10 +44,12 @@ clutter_actor_box_new (gfloat x_1,
/**
* clutter_actor_box_alloc:
*
* Allocates a new [struct@ActorBox].
* Allocates a new #ClutterActorBox.
*
* Return value: (transfer full): the newly allocated #ClutterActorBox.
* Use [method@ActorBox.free] to free its resources
* Use clutter_actor_box_free() to free its resources
*
* Since: 1.12
*/
ClutterActorBox *
clutter_actor_box_alloc (void)
@@ -64,6 +68,8 @@ clutter_actor_box_alloc (void)
* Initializes @box with the given coordinates.
*
* Return value: (transfer none): the initialized #ClutterActorBox
*
* Since: 1.10
*/
ClutterActorBox *
clutter_actor_box_init (ClutterActorBox *box,
@@ -91,6 +97,8 @@ clutter_actor_box_init (ClutterActorBox *box,
* @height: height of the box
*
* Initializes @box with the given origin and size.
*
* Since: 1.10
*/
void
clutter_actor_box_init_rect (ClutterActorBox *box,
@@ -114,7 +122,9 @@ clutter_actor_box_init_rect (ClutterActorBox *box,
* Copies @box
*
* Return value: a newly allocated copy of #ClutterActorBox. Use
* [method@ActorBox.free] to free the allocated resources
* clutter_actor_box_free() to free the allocated resources
*
* Since: 1.0
*/
ClutterActorBox *
clutter_actor_box_copy (const ClutterActorBox *box)
@@ -129,8 +139,10 @@ clutter_actor_box_copy (const ClutterActorBox *box)
* clutter_actor_box_free:
* @box: a #ClutterActorBox
*
* Frees a #ClutterActorBox allocated using [ctor@ActorBox.new]
* or [method@ActorBox.copy].
* Frees a #ClutterActorBox allocated using clutter_actor_box_new()
* or clutter_actor_box_copy()
*
* Since: 1.0
*/
void
clutter_actor_box_free (ClutterActorBox *box)
@@ -147,6 +159,8 @@ clutter_actor_box_free (ClutterActorBox *box)
* Checks @box_a and @box_b for equality
*
* Return value: %TRUE if the passed #ClutterActorBox are equal
*
* Since: 1.0
*/
gboolean
clutter_actor_box_equal (const ClutterActorBox *box_a,
@@ -168,6 +182,8 @@ clutter_actor_box_equal (const ClutterActorBox *box_a,
* Retrieves the X coordinate of the origin of @box
*
* Return value: the X coordinate of the origin
*
* Since: 1.0
*/
gfloat
clutter_actor_box_get_x (const ClutterActorBox *box)
@@ -184,6 +200,8 @@ clutter_actor_box_get_x (const ClutterActorBox *box)
* Retrieves the Y coordinate of the origin of @box
*
* Return value: the Y coordinate of the origin
*
* Since: 1.0
*/
gfloat
clutter_actor_box_get_y (const ClutterActorBox *box)
@@ -200,6 +218,8 @@ clutter_actor_box_get_y (const ClutterActorBox *box)
* Retrieves the width of the @box
*
* Return value: the width of the box
*
* Since: 1.0
*/
gfloat
clutter_actor_box_get_width (const ClutterActorBox *box)
@@ -216,6 +236,8 @@ clutter_actor_box_get_width (const ClutterActorBox *box)
* Retrieves the height of the @box
*
* Return value: the height of the box
*
* Since: 1.0
*/
gfloat
clutter_actor_box_get_height (const ClutterActorBox *box)
@@ -232,6 +254,8 @@ clutter_actor_box_get_height (const ClutterActorBox *box)
* @y: (out) (allow-none): return location for the Y coordinate, or %NULL
*
* Retrieves the origin of @box
*
* Since: 1.0
*/
void
clutter_actor_box_get_origin (const ClutterActorBox *box,
@@ -254,6 +278,8 @@ clutter_actor_box_get_origin (const ClutterActorBox *box,
* @height: (out) (allow-none): return location for the height, or %NULL
*
* Retrieves the size of @box
*
* Since: 1.0
*/
void
clutter_actor_box_get_size (const ClutterActorBox *box,
@@ -276,6 +302,8 @@ clutter_actor_box_get_size (const ClutterActorBox *box,
* Retrieves the area of @box
*
* Return value: the area of a #ClutterActorBox, in pixels
*
* Since: 1.0
*/
gfloat
clutter_actor_box_get_area (const ClutterActorBox *box)
@@ -295,6 +323,8 @@ clutter_actor_box_get_area (const ClutterActorBox *box)
* within @box
*
* Return value: %TRUE if the point is contained by the #ClutterActorBox
*
* Since: 1.0
*/
gboolean
clutter_actor_box_contains (const ClutterActorBox *box,
@@ -313,7 +343,9 @@ clutter_actor_box_contains (const ClutterActorBox *box,
* @verts: (array fixed-size=4): array of four #graphene_point3d_t
*
* Calculates the bounding box represented by the four vertices; for details
* of the vertex array see [method@Actor.get_abs_allocation_vertices].
* of the vertex array see clutter_actor_get_abs_allocation_vertices().
*
* Since: 1.0
*/
void
clutter_actor_box_from_vertices (ClutterActorBox *box,
@@ -380,8 +412,10 @@ clutter_actor_box_from_vertices (ClutterActorBox *box,
* @progress: the interpolation progress
* @result: (out): return location for the interpolation
*
* Interpolates between @initial and @final `ClutterActorBox`es
* Interpolates between @initial and @final #ClutterActorBox<!-- -->es
* using @progress
*
* Since: 1.2
*/
void
clutter_actor_box_interpolate (const ClutterActorBox *initial,
@@ -404,6 +438,8 @@ clutter_actor_box_interpolate (const ClutterActorBox *initial,
* @box: (inout): the #ClutterActorBox to clamp
*
* Clamps the components of @box to the nearest integer
*
* Since: 1.2
*/
void
clutter_actor_box_clamp_to_pixel (ClutterActorBox *box)
@@ -424,6 +460,8 @@ clutter_actor_box_clamp_to_pixel (ClutterActorBox *box)
* of @a and @b
*
* Unions the two boxes @a and @b and stores the result in @result.
*
* Since: 1.4
*/
void
clutter_actor_box_union (const ClutterActorBox *a,
@@ -466,6 +504,8 @@ clutter_actor_box_progress (const GValue *a,
* @y: the Y coordinate of the new origin
*
* Changes the origin of @box, maintaining the size of the #ClutterActorBox.
*
* Since: 1.6
*/
void
clutter_actor_box_set_origin (ClutterActorBox *box,
@@ -489,6 +529,8 @@ clutter_actor_box_set_origin (ClutterActorBox *box,
* @height: the new height
*
* Sets the size of @box, maintaining the origin of the #ClutterActorBox.
*
* Since: 1.6
*/
void
clutter_actor_box_set_size (ClutterActorBox *box,
@@ -506,9 +548,6 @@ _clutter_actor_box_enlarge_for_effects (ClutterActorBox *box)
{
float width, height;
if (clutter_actor_box_get_area (box) == 0.0)
return;
/* The aim here is that for a given rectangle defined with floating point
* coordinates we want to determine a stable quantized size in pixels
* that doesn't vary due to the original box's sub-pixel position.
@@ -561,6 +600,8 @@ _clutter_actor_box_enlarge_for_effects (ClutterActorBox *box)
* @scale: scale factor for resizing this box
*
* Rescale the @box by provided @scale factor.
*
* Since: 1.6
*/
void
clutter_actor_box_scale (ClutterActorBox *box,

View File

@@ -22,9 +22,10 @@
* Emmanuele Bassi <ebassi@linux.intel.com>
*/
#pragma once
#ifndef __CLUTTER_ACTOR_META_PRIVATE_H__
#define __CLUTTER_ACTOR_META_PRIVATE_H__
#include "clutter/clutter-actor-meta.h"
#include <clutter/clutter-actor-meta.h>
G_BEGIN_DECLS
@@ -92,3 +93,5 @@ int _clutter_actor_meta_get_priority (ClutterActorMet
gboolean _clutter_actor_meta_is_internal (ClutterActorMeta *meta);
G_END_DECLS
#endif /* __CLUTTER_ACTOR_META_PRIVATE_H__ */

View File

@@ -23,27 +23,30 @@
*/
/**
* ClutterActorMeta:
*
* Base class of actor modifiers
* SECTION:clutter-actor-meta
* @Title: ClutterActorMeta
* @Short_Description: Base class of actor modifiers
* @See_Also: #ClutterAction, #ClutterConstraint
*
* #ClutterActorMeta is an abstract class providing a common API for
* modifiers of [class@Actor] behaviour, appearance or layout.
* modifiers of #ClutterActor behaviour, appearance or layout.
*
* A #ClutterActorMeta can only be owned by a single [class@Actor] at
* A #ClutterActorMeta can only be owned by a single #ClutterActor at
* any time.
*
* Every sub-class of #ClutterActorMeta should check if the
* [property@ActorMeta:enabled] property is set to %TRUE before applying
* #ClutterActorMeta:enabled property is set to %TRUE before applying
* any kind of modification.
*
* #ClutterActorMeta is available since Clutter 1.4
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-actor-meta-private.h"
#include "clutter-actor-meta-private.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-private.h"
#include "clutter-debug.h"
#include "clutter-private.h"
struct _ClutterActorMetaPrivate
{
@@ -106,8 +109,6 @@ clutter_actor_meta_real_set_actor (ClutterActorMeta *meta,
priv->destroy_id = g_signal_connect (priv->actor, "destroy",
G_CALLBACK (on_actor_destroy),
meta);
g_object_notify_by_pspec (G_OBJECT (meta), obj_props[PROP_ACTOR]);
}
static void
@@ -204,20 +205,27 @@ clutter_actor_meta_class_init (ClutterActorMetaClass *klass)
* ClutterActorMeta:actor:
*
* The #ClutterActor attached to the #ClutterActorMeta instance
*
* Since: 1.4
*/
obj_props[PROP_ACTOR] =
g_param_spec_object ("actor", NULL, NULL,
g_param_spec_object ("actor",
P_("Actor"),
P_("The actor attached to the meta"),
CLUTTER_TYPE_ACTOR,
CLUTTER_PARAM_READABLE |
G_PARAM_EXPLICIT_NOTIFY);
CLUTTER_PARAM_READABLE);
/**
* ClutterActorMeta:name:
*
* The unique name to access the #ClutterActorMeta
*
* Since: 1.4
*/
obj_props[PROP_NAME] =
g_param_spec_string ("name", NULL, NULL,
g_param_spec_string ("name",
P_("Name"),
P_("The name of the meta"),
NULL,
CLUTTER_PARAM_READWRITE);
@@ -225,9 +233,13 @@ clutter_actor_meta_class_init (ClutterActorMetaClass *klass)
* ClutterActorMeta:enabled:
*
* Whether or not the #ClutterActorMeta is enabled
*
* Since: 1.4
*/
obj_props[PROP_ENABLED] =
g_param_spec_boolean ("enabled", NULL, NULL,
g_param_spec_boolean ("enabled",
P_("Enabled"),
P_("Whether the meta is enabled"),
TRUE,
CLUTTER_PARAM_READWRITE);
@@ -257,6 +269,8 @@ clutter_actor_meta_init (ClutterActorMeta *self)
* Sets the name of @meta
*
* The name can be used to identify the #ClutterActorMeta instance
*
* Since: 1.4
*/
void
clutter_actor_meta_set_name (ClutterActorMeta *meta,
@@ -281,12 +295,14 @@ clutter_actor_meta_set_name (ClutterActorMeta *meta,
* clutter_actor_meta_get_name:
* @meta: a #ClutterActorMeta
*
* Retrieves the name set using [method@ActorMeta.set_name]
* Retrieves the name set using clutter_actor_meta_set_name()
*
* Return value: (transfer none): the name of the #ClutterActorMeta
* instance, or %NULL if none was set. The returned string is owned
* by the #ClutterActorMeta instance and it should not be modified
* or freed
*
* Since: 1.4
*/
const gchar *
clutter_actor_meta_get_name (ClutterActorMeta *meta)
@@ -306,6 +322,8 @@ clutter_actor_meta_get_name (ClutterActorMeta *meta)
* @is_enabled: whether @meta is enabled
*
* Sets whether @meta should be enabled or not
*
* Since: 1.4
*/
void
clutter_actor_meta_set_enabled (ClutterActorMeta *meta,
@@ -331,6 +349,8 @@ clutter_actor_meta_set_enabled (ClutterActorMeta *meta,
* Retrieves whether @meta is enabled
*
* Return value: %TRUE if the #ClutterActorMeta instance is enabled
*
* Since: 1.4
*/
gboolean
clutter_actor_meta_get_enabled (ClutterActorMeta *meta)
@@ -351,6 +371,8 @@ clutter_actor_meta_get_enabled (ClutterActorMeta *meta)
*
* Sets or unsets a back pointer to the #ClutterActor that owns
* the @meta
*
* Since: 1.4
*/
void
_clutter_actor_meta_set_actor (ClutterActorMeta *meta,
@@ -366,9 +388,11 @@ _clutter_actor_meta_set_actor (ClutterActorMeta *meta,
* clutter_actor_meta_get_actor:
* @meta: a #ClutterActorMeta
*
* Retrieves a pointer to the [class@Actor] that owns @meta
* Retrieves a pointer to the #ClutterActor that owns @meta
*
* Return value: (transfer none): a pointer to a #ClutterActor or %NULL
*
* Since: 1.4
*/
ClutterActor *
clutter_actor_meta_get_actor (ClutterActorMeta *meta)

View File

@@ -22,13 +22,14 @@
* Emmanuele Bassi <ebassi@linux.intel.com>
*/
#pragma once
#ifndef __CLUTTER_ACTOR_META_H__
#define __CLUTTER_ACTOR_META_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-types.h"
#include <clutter/clutter-types.h>
G_BEGIN_DECLS
@@ -47,6 +48,8 @@ typedef struct _ClutterActorMetaPrivate ClutterActorMetaPrivate;
*
* The #ClutterActorMetaClass structure contains
* only private data
*
* Since: 1.4
*/
struct _ClutterActorMetaClass
{
@@ -68,6 +71,14 @@ struct _ClutterActorMetaClass
void (* set_enabled) (ClutterActorMeta *meta,
gboolean is_enabled);
/*< private >*/
void (* _clutter_meta1) (void);
void (* _clutter_meta2) (void);
void (* _clutter_meta3) (void);
void (* _clutter_meta4) (void);
void (* _clutter_meta5) (void);
void (* _clutter_meta6) (void);
};
CLUTTER_EXPORT
@@ -85,3 +96,5 @@ CLUTTER_EXPORT
ClutterActor * clutter_actor_meta_get_actor (ClutterActorMeta *meta);
G_END_DECLS
#endif /* __CLUTTER_ACTOR_META_H__ */

View File

@@ -19,10 +19,10 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CLUTTER_ACTOR_PRIVATE_H__
#define __CLUTTER_ACTOR_PRIVATE_H__
#include "clutter/clutter-actor.h"
#include "clutter/clutter-grab.h"
#include <clutter/clutter-actor.h>
G_BEGIN_DECLS
@@ -245,13 +245,15 @@ void _clutter_actor_pop_clone_paint
ClutterActorAlign _clutter_actor_get_effective_x_align (ClutterActor *self);
void _clutter_actor_handle_event (ClutterActor *actor,
const ClutterEvent *event);
void _clutter_actor_attach_clone (ClutterActor *actor,
ClutterActor *clone);
void _clutter_actor_detach_clone (ClutterActor *actor,
ClutterActor *clone);
void _clutter_actor_queue_only_relayout (ClutterActor *actor);
void clutter_actor_clear_stage_views_recursive (ClutterActor *actor,
gboolean stop_transitions);
void clutter_actor_clear_stage_views_recursive (ClutterActor *actor);
float clutter_actor_get_real_resource_scale (ClutterActor *actor);
@@ -265,18 +267,10 @@ void clutter_actor_queue_immediate_relayout (ClutterActor *self);
gboolean clutter_actor_is_painting_unmapped (ClutterActor *self);
void clutter_actor_attach_grab (ClutterActor *actor,
ClutterGrab *grab);
void clutter_actor_detach_grab (ClutterActor *actor,
ClutterGrab *grab);
void clutter_actor_collect_event_actors (ClutterActor *self,
ClutterActor *deepmost,
GPtrArray *actors);
const GList * clutter_actor_peek_actions (ClutterActor *self);
void clutter_actor_set_implicitly_grabbed (ClutterActor *actor,
gboolean is_implicitly_grabbed);
gboolean clutter_actor_get_redraw_clip (ClutterActor *self,
ClutterPaintVolume *dst_old_pv,
ClutterPaintVolume *dst_new_pv);
G_END_DECLS
#endif /* __CLUTTER_ACTOR_PRIVATE_H__ */

File diff suppressed because it is too large Load Diff

View File

@@ -22,7 +22,8 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CLUTTER_ACTOR_H__
#define __CLUTTER_ACTOR_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
@@ -34,13 +35,12 @@
#include <pango/pango.h>
#include <atk/atk.h>
#include "cogl/cogl.h"
#include <cogl/cogl.h>
#include "clutter/clutter-types.h"
#include "clutter/clutter-event.h"
#include "clutter/clutter-paint-context.h"
#include "clutter/clutter-pick-context.h"
#include "mtk/mtk.h"
#include <clutter/clutter-types.h>
#include <clutter/clutter-event.h>
#include <clutter/clutter-paint-context.h>
#include <clutter/clutter-pick-context.h>
G_BEGIN_DECLS
@@ -81,6 +81,22 @@ G_BEGIN_DECLS
CLUTTER_MACRO_DEPRECATED \
(((ClutterActor*)(a))->flags &= ~(f))
#define CLUTTER_ACTOR_IS_MAPPED(a) \
CLUTTER_MACRO_DEPRECATED_FOR ("Deprecated macro. Use clutter_actor_is_mapped instead") \
((((ClutterActor*)(a))->flags & CLUTTER_ACTOR_MAPPED) != FALSE)
#define CLUTTER_ACTOR_IS_REALIZED(a) \
CLUTTER_MACRO_DEPRECATED_FOR ("Deprecated macro. Use clutter_actor_is_realized instead") \
((((ClutterActor*)(a))->flags & CLUTTER_ACTOR_REALIZED) != FALSE)
#define CLUTTER_ACTOR_IS_VISIBLE(a) \
CLUTTER_MACRO_DEPRECATED_FOR ("Deprecated macro. Use clutter_actor_is_visible instead") \
((((ClutterActor*)(a))->flags & CLUTTER_ACTOR_VISIBLE) != FALSE)
#define CLUTTER_ACTOR_IS_REACTIVE(a) \
CLUTTER_MACRO_DEPRECATED_FOR ("Deprecated macro. Use clutter_actor_get_reactive instead") \
((((ClutterActor*)(a))->flags & CLUTTER_ACTOR_REACTIVE) != FALSE)
typedef struct _ClutterActorClass ClutterActorClass;
typedef struct _ClutterActorPrivate ClutterActorPrivate;
@@ -102,7 +118,12 @@ typedef void (*ClutterCallback) (ClutterActor *actor,
*/
#define CLUTTER_CALLBACK(f) ((ClutterCallback) (f))
/**
* ClutterActor:
* @flags: #ClutterActorFlags
*
* Base class for actors.
*/
struct _ClutterActor
{
/*< private >*/
@@ -237,21 +258,21 @@ struct _ClutterActorClass
gboolean (* event) (ClutterActor *actor,
ClutterEvent *event);
gboolean (* button_press_event) (ClutterActor *actor,
ClutterEvent *event);
ClutterButtonEvent *event);
gboolean (* button_release_event) (ClutterActor *actor,
ClutterEvent *event);
ClutterButtonEvent *event);
gboolean (* scroll_event) (ClutterActor *actor,
ClutterEvent *event);
ClutterScrollEvent *event);
gboolean (* key_press_event) (ClutterActor *actor,
ClutterEvent *event);
ClutterKeyEvent *event);
gboolean (* key_release_event) (ClutterActor *actor,
ClutterEvent *event);
ClutterKeyEvent *event);
gboolean (* motion_event) (ClutterActor *actor,
ClutterEvent *event);
ClutterMotionEvent *event);
gboolean (* enter_event) (ClutterActor *actor,
ClutterEvent *event);
ClutterCrossingEvent *event);
gboolean (* leave_event) (ClutterActor *actor,
ClutterEvent *event);
ClutterCrossingEvent *event);
gboolean (* captured_event) (ClutterActor *actor,
ClutterEvent *event);
void (* key_focus_in) (ClutterActor *actor);
@@ -271,11 +292,15 @@ struct _ClutterActorClass
ClutterPaintNode *root);
gboolean (* touch_event) (ClutterActor *self,
ClutterEvent *event);
ClutterTouchEvent *event);
gboolean (* has_accessible) (ClutterActor *self);
void (* resource_scale_changed) (ClutterActor *self);
float (* calculate_resource_scale) (ClutterActor *self,
int phase);
/*< private >*/
/* padding for future expansion */
gpointer _padding_dummy[25];
};
/**
@@ -286,13 +311,17 @@ struct _ClutterActorClass
*
* The contents of the #ClutterActorIter structure
* are private and should only be accessed using the provided API.
*
* Since: 1.10
*/
struct _ClutterActorIter
{
/*< private >*/
gpointer CLUTTER_PRIVATE_FIELD (dummy1);
gpointer CLUTTER_PRIVATE_FIELD (dummy2);
gint CLUTTER_PRIVATE_FIELD (dummy3);
gpointer CLUTTER_PRIVATE_FIELD (dummy3);
gint CLUTTER_PRIVATE_FIELD (dummy4);
gpointer CLUTTER_PRIVATE_FIELD (dummy5);
};
CLUTTER_EXPORT
@@ -336,8 +365,8 @@ void clutter_actor_continue_pick
CLUTTER_EXPORT
void clutter_actor_queue_redraw (ClutterActor *self);
CLUTTER_EXPORT
void clutter_actor_queue_redraw_with_clip (ClutterActor *self,
const MtkRectangle *clip);
void clutter_actor_queue_redraw_with_clip (ClutterActor *self,
const cairo_rectangle_int_t *clip);
CLUTTER_EXPORT
void clutter_actor_queue_relayout (ClutterActor *self);
CLUTTER_EXPORT
@@ -595,13 +624,6 @@ void clutter_actor_set_content_repeat
ClutterContentRepeat repeat);
CLUTTER_EXPORT
ClutterContentRepeat clutter_actor_get_content_repeat (ClutterActor *self);
CLUTTER_EXPORT
void clutter_actor_set_color_state (ClutterActor *self,
ClutterColorState *color_state);
CLUTTER_EXPORT
ClutterColorState *clutter_actor_get_color_state (ClutterActor *self);
CLUTTER_EXPORT
void clutter_actor_get_content_box (ClutterActor *self,
ClutterActorBox *box);
@@ -616,6 +638,8 @@ const ClutterPaintVolume * clutter_actor_get_paint_volume
CLUTTER_EXPORT
const ClutterPaintVolume * clutter_actor_get_transformed_paint_volume (ClutterActor *self,
ClutterActor *relative_to_ancestor);
CLUTTER_EXPORT
const ClutterPaintVolume * clutter_actor_get_default_paint_volume (ClutterActor *self);
/* Events */
CLUTTER_EXPORT
@@ -876,7 +900,9 @@ void clutter_actor_uninhibit_culling
* of interest, using g_object_bind_property(). This way, when the @item
* in the #GListModel changes, the #ClutterActor changes as well.
*
* Returns: (transfer full): The newly created child #ClutterActor4
* Returns: (transfer full): The newly created child #ClutterActor
*
* Since: 1.24
*/
typedef ClutterActor * (* ClutterActorCreateChildFunc) (gpointer item,
gpointer user_data);
@@ -909,3 +935,5 @@ CLUTTER_EXPORT
void clutter_actor_invalidate_paint_volume (ClutterActor *self);
G_END_DECLS
#endif /* __CLUTTER_ACTOR_H__ */

View File

@@ -23,25 +23,27 @@
*/
/**
* ClutterAlignConstraint:
*
* A constraint aligning the position of an actor
* SECTION:clutter-align-constraint
* @Title: ClutterAlignConstraint
* @Short_Description: A constraint aligning the position of an actor
*
* #ClutterAlignConstraint is a [class@Constraint] that aligns the position
* of the [class@Actor] to which it is applied to the size of another
* [class@Actor] using an alignment factor
* #ClutterAlignConstraint is a #ClutterConstraint that aligns the position
* of the #ClutterActor to which it is applied to the size of another
* #ClutterActor using an alignment factor
*
* #ClutterAlignConstraint is available since Clutter 1.4
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-align-constraint.h"
#include "clutter-align-constraint.h"
#include "clutter/clutter-actor-meta-private.h"
#include "clutter/clutter-actor-private.h"
#include "clutter/clutter-constraint.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-enum-types.h"
#include "clutter/clutter-private.h"
#include "clutter-actor-meta-private.h"
#include "clutter-actor-private.h"
#include "clutter-constraint.h"
#include "clutter-debug.h"
#include "clutter-enum-types.h"
#include "clutter-private.h"
#include <math.h>
@@ -287,9 +289,13 @@ clutter_align_constraint_class_init (ClutterAlignConstraintClass *klass)
*
* The #ClutterActor must not be a child or a grandchild of the actor
* using the constraint.
*
* Since: 1.4
*/
obj_props[PROP_SOURCE] =
g_param_spec_object ("source", NULL, NULL,
g_param_spec_object ("source",
P_("Source"),
P_("The source of the alignment"),
CLUTTER_TYPE_ACTOR,
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT);
@@ -297,9 +303,13 @@ clutter_align_constraint_class_init (ClutterAlignConstraintClass *klass)
* ClutterAlignConstraint:align-axis:
*
* The axis to be used to compute the alignment
*
* Since: 1.4
*/
obj_props[PROP_ALIGN_AXIS] =
g_param_spec_enum ("align-axis", NULL, NULL,
g_param_spec_enum ("align-axis",
P_("Align Axis"),
P_("The axis to align the position to"),
CLUTTER_TYPE_ALIGN_AXIS,
CLUTTER_ALIGN_X_AXIS,
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT);
@@ -321,7 +331,9 @@ clutter_align_constraint_class_init (ClutterAlignConstraintClass *klass)
* the source actor.
*/
obj_props[PROP_PIVOT_POINT] =
g_param_spec_boxed ("pivot-point", NULL, NULL,
g_param_spec_boxed ("pivot-point",
P_("Pivot point"),
P_("The pivot point"),
GRAPHENE_TYPE_POINT,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
@@ -335,9 +347,13 @@ clutter_align_constraint_class_init (ClutterAlignConstraintClass *klass)
* with an align-axis value of %CLUTTER_ALIGN_X_AXIS, 0.0 means left and
* 1.0 means right; with a value of %CLUTTER_ALIGN_Y_AXIS, 0.0 means top
* and 1.0 means bottom.
*
* Since: 1.4
*/
obj_props[PROP_FACTOR] =
g_param_spec_float ("factor", NULL, NULL,
g_param_spec_float ("factor",
P_("Factor"),
P_("The alignment factor, between 0.0 and 1.0"),
0.0, 1.0,
0.0,
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT);
@@ -371,6 +387,8 @@ clutter_align_constraint_init (ClutterAlignConstraint *self)
* alignment @factor
*
* Return value: the newly created #ClutterAlignConstraint
*
* Since: 1.4
*/
ClutterConstraint *
clutter_align_constraint_new (ClutterActor *source,
@@ -392,6 +410,8 @@ clutter_align_constraint_new (ClutterActor *source,
* @source: (allow-none): a #ClutterActor, or %NULL to unset the source
*
* Sets the source of the alignment constraint
*
* Since: 1.4
*/
void
clutter_align_constraint_set_source (ClutterAlignConstraint *align,
@@ -458,6 +478,8 @@ clutter_align_constraint_set_source (ClutterAlignConstraint *align,
*
* Return value: (transfer none): the #ClutterActor used as the source
* of the alignment
*
* Since: 1.4
*/
ClutterActor *
clutter_align_constraint_get_source (ClutterAlignConstraint *align)
@@ -473,6 +495,8 @@ clutter_align_constraint_get_source (ClutterAlignConstraint *align)
* @axis: the axis to which the alignment refers to
*
* Sets the axis to which the alignment refers to
*
* Since: 1.4
*/
void
clutter_align_constraint_set_align_axis (ClutterAlignConstraint *align,
@@ -498,6 +522,8 @@ clutter_align_constraint_set_align_axis (ClutterAlignConstraint *align,
* Retrieves the value set using clutter_align_constraint_set_align_axis()
*
* Return value: the alignment axis
*
* Since: 1.4
*/
ClutterAlignAxis
clutter_align_constraint_get_align_axis (ClutterAlignConstraint *align)
@@ -578,6 +604,8 @@ clutter_align_constraint_get_pivot_point (ClutterAlignConstraint *align,
* meaning bottom, when #ClutterAlignConstraint:align-axis is set to
* %CLUTTER_ALIGN_Y_AXIS). A value of 0.5 aligns in the middle in either
* cases
*
* Since: 1.4
*/
void
clutter_align_constraint_set_factor (ClutterAlignConstraint *align,
@@ -600,6 +628,8 @@ clutter_align_constraint_set_factor (ClutterAlignConstraint *align,
* Retrieves the factor set using clutter_align_constraint_set_factor()
*
* Return value: the alignment factor
*
* Since: 1.4
*/
gfloat
clutter_align_constraint_get_factor (ClutterAlignConstraint *align)

View File

@@ -22,13 +22,14 @@
* Emmanuele Bassi <ebassi@linux.intel.com>
*/
#pragma once
#ifndef __CLUTTER_ALIGN_CONSTRAINT_H__
#define __CLUTTER_ALIGN_CONSTRAINT_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-constraint.h"
#include <clutter/clutter-constraint.h>
G_BEGIN_DECLS
@@ -36,6 +37,14 @@ G_BEGIN_DECLS
#define CLUTTER_ALIGN_CONSTRAINT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ALIGN_CONSTRAINT, ClutterAlignConstraint))
#define CLUTTER_IS_ALIGN_CONSTRAINT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ALIGN_CONSTRAINT))
/**
* ClutterAlignConstraint:
*
* #ClutterAlignConstraint is an opaque structure
* whose members cannot be directly accesses
*
* Since: 1.4
*/
typedef struct _ClutterAlignConstraint ClutterAlignConstraint;
typedef struct _ClutterAlignConstraintClass ClutterAlignConstraintClass;
@@ -70,3 +79,5 @@ CLUTTER_EXPORT
gfloat clutter_align_constraint_get_factor (ClutterAlignConstraint *align);
G_END_DECLS
#endif /* __CLUTTER_ALIGN_CONSTRAINT_H__ */

View File

@@ -23,25 +23,26 @@
*/
/**
* ClutterAnimatable:
*
* Interface for animatable classes
* SECTION:clutter-animatable
* @short_description: Interface for animatable classes
*
* #ClutterAnimatable is an interface that allows a [class@GObject.Object] class
* #ClutterAnimatable is an interface that allows a #GObject class
* to control how an actor will animate a property.
*
* Each #ClutterAnimatable should implement the
* [vfunc@Animatable.interpolate_value] virtual function of the
* #ClutterAnimatableInterface.interpolate_property() virtual function of the
* interface to compute the animation state between two values of an interval
* depending on a progress factor, expressed as a floating point value.
*
* #ClutterAnimatable is available since Clutter 1.0
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-animatable.h"
#include "clutter/clutter-interval.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-private.h"
#include "clutter-animatable.h"
#include "clutter-interval.h"
#include "clutter-debug.h"
#include "clutter-private.h"
G_DEFINE_INTERFACE (ClutterAnimatable, clutter_animatable, G_TYPE_OBJECT);
@@ -55,10 +56,12 @@ clutter_animatable_default_init (ClutterAnimatableInterface *iface)
* @animatable: a #ClutterAnimatable
* @property_name: the name of the animatable property to find
*
* Finds the [class@GObject.ParamSpec] for @property_name
* Finds the #GParamSpec for @property_name
*
* Return value: (transfer none): The #GParamSpec for the given property
* or %NULL
*
* Since: 1.4
*/
GParamSpec *
clutter_animatable_find_property (ClutterAnimatable *animatable,
@@ -86,6 +89,8 @@ clutter_animatable_find_property (ClutterAnimatable *animatable,
* @value: a #GValue initialized to the type of the property to retrieve
*
* Retrieves the current state of @property_name and sets @value with it
*
* Since: 1.4
*/
void
clutter_animatable_get_initial_state (ClutterAnimatable *animatable,
@@ -113,6 +118,8 @@ clutter_animatable_get_initial_state (ClutterAnimatable *animatable,
* @value: the value of the animatable property to set
*
* Sets the current state of @property_name to @value
*
* Since: 1.4
*/
void
clutter_animatable_set_final_state (ClutterAnimatable *animatable,
@@ -149,12 +156,14 @@ clutter_animatable_set_final_state (ClutterAnimatable *animatable,
* value, and store the result inside @value.
*
* This function should be used for every property animation
* involving `ClutterAnimatable`s.
* involving #ClutterAnimatable<!-- -->s.
*
* This function replaces clutter_animatable_animate_property().
*
* Return value: %TRUE if the interpolation was successful,
* and %FALSE otherwise
*
* Since: 1.8
*/
gboolean
clutter_animatable_interpolate_value (ClutterAnimatable *animatable,

View File

@@ -22,13 +22,14 @@
* Emmanuele Bassi <ebassi@linux.intel.com>
*/
#pragma once
#ifndef __CLUTTER_ANIMATABLE_H__
#define __CLUTTER_ANIMATABLE_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-types.h"
#include <clutter/clutter-types.h>
G_BEGIN_DECLS
@@ -50,6 +51,8 @@ G_DECLARE_INTERFACE (ClutterAnimatable, clutter_animatable,
* @interpolate_value: virtual function for interpolating the progress
* of a property
* @get_actor: virtual function for getting associated actor
*
* Since: 1.0
*/
struct _ClutterAnimatableInterface
{
@@ -95,3 +98,5 @@ CLUTTER_EXPORT
ClutterActor * clutter_animatable_get_actor (ClutterAnimatable *animatable);
G_END_DECLS
#endif /* __CLUTTER_ANIMATABLE_H__ */

View File

@@ -21,7 +21,8 @@
*
*/
#pragma once
#ifndef __CLUTTER_AUTO_CLEANUPS_H__
#define __CLUTTER_AUTO_CLEANUPS_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
@@ -50,6 +51,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterEffect, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterFixedLayout, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterFlowLayout, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterGridLayout, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterImage, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterInputDevice, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterInterval, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterKeyframeTransition, g_object_unref)
@@ -87,3 +89,5 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPaintVolume, clutter_paint_volume_free)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPathNode, clutter_path_node_free)
#endif /* __GI_SCANNER__ */
#endif /* __CLUTTER_AUTO_CLEANUPS_H__ */

View File

@@ -19,11 +19,12 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CLUTTER_BACKEND_PRIVATE_H__
#define __CLUTTER_BACKEND_PRIVATE_H__
#include "clutter/clutter-backend.h"
#include "clutter/clutter-seat.h"
#include "clutter/clutter-stage-window.h"
#include <clutter/clutter-backend.h>
#include <clutter/clutter-seat.h>
#include <clutter/clutter-stage-window.h>
#define CLUTTER_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BACKEND, ClutterBackendClass))
#define CLUTTER_IS_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BACKEND))
@@ -65,11 +66,17 @@ struct _ClutterBackendClass
GObjectClass parent_class;
/* vfuncs */
gboolean (* finish_init) (ClutterBackend *backend,
gboolean (* pre_parse) (ClutterBackend *backend,
GError **error);
gboolean (* post_parse) (ClutterBackend *backend,
GError **error);
ClutterStageWindow * (* create_stage) (ClutterBackend *backend,
ClutterStage *wrapper,
GError **error);
void (* init_features) (ClutterBackend *backend);
void (* add_options) (ClutterBackend *backend,
GOptionGroup *group);
ClutterFeatureFlags (* get_features) (ClutterBackend *backend);
CoglRenderer * (* get_renderer) (ClutterBackend *backend,
GError **error);
CoglDisplay * (* get_display) (ClutterBackend *backend,
@@ -79,6 +86,10 @@ struct _ClutterBackendClass
gboolean (* create_context) (ClutterBackend *backend,
GError **error);
gboolean (* translate_event) (ClutterBackend *backend,
gpointer native,
ClutterEvent *event);
ClutterSeat * (* get_default_seat) (ClutterBackend *backend);
gboolean (* is_display_server) (ClutterBackend *backend);
@@ -89,14 +100,27 @@ struct _ClutterBackendClass
void (* settings_changed) (ClutterBackend *backend);
};
ClutterBackend * _clutter_create_backend (void);
ClutterStageWindow * _clutter_backend_create_stage (ClutterBackend *backend,
ClutterStage *wrapper,
GError **error);
gboolean _clutter_backend_create_context (ClutterBackend *backend,
GError **error);
gboolean _clutter_backend_finish_init (ClutterBackend *backend,
void _clutter_backend_add_options (ClutterBackend *backend,
GOptionGroup *group);
gboolean _clutter_backend_pre_parse (ClutterBackend *backend,
GError **error);
gboolean _clutter_backend_post_parse (ClutterBackend *backend,
GError **error);
CLUTTER_EXPORT
gboolean _clutter_backend_translate_event (ClutterBackend *backend,
gpointer native,
ClutterEvent *event);
ClutterFeatureFlags _clutter_backend_get_features (ClutterBackend *backend);
gfloat _clutter_backend_get_units_per_em (ClutterBackend *backend,
PangoFontDescription *font_desc);
@@ -119,3 +143,5 @@ CLUTTER_EXPORT
void clutter_backend_destroy (ClutterBackend *backend);
G_END_DECLS
#endif /* __CLUTTER_BACKEND_PRIVATE_H__ */

View File

@@ -25,9 +25,8 @@
*/
/**
* ClutterBackend:
*
* Backend abstraction
* SECTION:clutter-backend
* @short_description: Backend abstraction
*
* Clutter can be compiled against different backends. Each backend
* has to implement a set of functions, in order to be used by Clutter.
@@ -35,21 +34,23 @@
* #ClutterBackend is the base class abstracting the various implementation;
* it provides a basic API to query the backend for generic information
* and settings.
*
* #ClutterBackend is available since Clutter 0.4
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-backend-private.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-event-private.h"
#include "clutter/clutter-marshal.h"
#include "clutter/clutter-mutter.h"
#include "clutter/clutter-private.h"
#include "clutter/clutter-stage-manager-private.h"
#include "clutter/clutter-stage-private.h"
#include "clutter/clutter-stage-window.h"
#include "clutter-backend-private.h"
#include "clutter-debug.h"
#include "clutter-event-private.h"
#include "clutter-marshal.h"
#include "clutter-mutter.h"
#include "clutter-private.h"
#include "clutter-stage-manager-private.h"
#include "clutter-stage-private.h"
#include "clutter-stage-window.h"
#include "cogl/cogl.h"
#include <cogl/cogl.h>
#define DEFAULT_FONT_NAME "Sans 10"
@@ -282,7 +283,8 @@ static const struct {
const char *driver_desc;
CoglDriver driver_id;
} all_known_drivers[] = {
{ "gl3", "OpenGL 3.1 core profile", COGL_DRIVER_GL3 },
{ "gl3", "OpenGL 3.2 core profile", COGL_DRIVER_GL3 },
{ "gl", "OpenGL legacy profile", COGL_DRIVER_GL },
{ "gles2", "OpenGL ES 2.0", COGL_DRIVER_GLES2 },
{ "any", "Default Cogl driver", COGL_DRIVER_ANY },
};
@@ -351,7 +353,8 @@ clutter_backend_real_create_context (ClutterBackend *backend,
if (internal_error != NULL)
g_propagate_error (error, internal_error);
else
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
g_set_error_literal (error, CLUTTER_INIT_ERROR,
CLUTTER_INIT_ERROR_BACKEND,
"Unable to initialize the Clutter backend: no available drivers found.");
return FALSE;
@@ -363,6 +366,53 @@ clutter_backend_real_create_context (ClutterBackend *backend,
return TRUE;
}
static ClutterFeatureFlags
clutter_backend_real_get_features (ClutterBackend *backend)
{
ClutterFeatureFlags flags = 0;
if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_MULTIPLE_ONSCREEN))
{
CLUTTER_NOTE (BACKEND, "Cogl supports multiple onscreen framebuffers");
flags |= CLUTTER_FEATURE_STAGE_MULTIPLE;
}
else
{
CLUTTER_NOTE (BACKEND, "Cogl only supports one onscreen framebuffer");
flags |= CLUTTER_FEATURE_STAGE_STATIC;
}
if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_BUFFERS_EVENT))
{
CLUTTER_NOTE (BACKEND, "Cogl supports swap buffers complete events");
flags |= CLUTTER_FEATURE_SWAP_EVENTS;
}
return flags;
}
static ClutterBackend * (* custom_backend_func) (void);
void
clutter_set_custom_backend_func (ClutterBackend *(* func) (void))
{
custom_backend_func = func;
}
ClutterBackend *
_clutter_create_backend (void)
{
ClutterBackend *retval;
g_return_val_if_fail (custom_backend_func, NULL);
retval = custom_backend_func ();
if (!retval)
g_error ("Failed to create custom backend.");
return retval;
}
static void
clutter_backend_class_init (ClutterBackendClass *klass)
{
@@ -374,8 +424,10 @@ clutter_backend_class_init (ClutterBackendClass *klass)
* ClutterBackend::resolution-changed:
* @backend: the #ClutterBackend that emitted the signal
*
* The signal is emitted each time the font
* The ::resolution-changed signal is emitted each time the font
* resolutions has been changed through #ClutterSettings.
*
* Since: 1.0
*/
backend_signals[RESOLUTION_CHANGED] =
g_signal_new (I_("resolution-changed"),
@@ -389,8 +441,10 @@ clutter_backend_class_init (ClutterBackendClass *klass)
* ClutterBackend::font-changed:
* @backend: the #ClutterBackend that emitted the signal
*
* The signal is emitted each time the font options
* The ::font-changed signal is emitted each time the font options
* have been changed through #ClutterSettings.
*
* Since: 1.0
*/
backend_signals[FONT_CHANGED] =
g_signal_new (I_("font-changed"),
@@ -404,8 +458,10 @@ clutter_backend_class_init (ClutterBackendClass *klass)
* ClutterBackend::settings-changed:
* @backend: the #ClutterBackend that emitted the signal
*
* The signal is emitted each time the #ClutterSettings
* The ::settings-changed signal is emitted each time the #ClutterSettings
* properties have been changed.
*
* Since: 1.4
*/
backend_signals[SETTINGS_CHANGED] =
g_signal_new (I_("settings-changed"),
@@ -419,6 +475,7 @@ clutter_backend_class_init (ClutterBackendClass *klass)
klass->font_changed = clutter_backend_real_font_changed;
klass->create_context = clutter_backend_real_create_context;
klass->get_features = clutter_backend_real_get_features;
}
static void
@@ -432,17 +489,45 @@ clutter_backend_init (ClutterBackend *self)
self->fallback_resource_scale = 1.f;
}
gboolean
_clutter_backend_finish_init (ClutterBackend *backend,
GError **error)
void
_clutter_backend_add_options (ClutterBackend *backend,
GOptionGroup *group)
{
ClutterBackendClass *klass;
g_assert (CLUTTER_IS_BACKEND (backend));
klass = CLUTTER_BACKEND_GET_CLASS (backend);
if (klass->finish_init)
return klass->finish_init (backend, error);
if (klass->add_options)
klass->add_options (backend, group);
}
gboolean
_clutter_backend_pre_parse (ClutterBackend *backend,
GError **error)
{
ClutterBackendClass *klass;
g_assert (CLUTTER_IS_BACKEND (backend));
klass = CLUTTER_BACKEND_GET_CLASS (backend);
if (klass->pre_parse)
return klass->pre_parse (backend, error);
return TRUE;
}
gboolean
_clutter_backend_post_parse (ClutterBackend *backend,
GError **error)
{
ClutterBackendClass *klass;
g_assert (CLUTTER_IS_BACKEND (backend));
klass = CLUTTER_BACKEND_GET_CLASS (backend);
if (klass->post_parse)
return klass->post_parse (backend, error);
return TRUE;
}
@@ -487,6 +572,46 @@ _clutter_backend_create_context (ClutterBackend *backend,
return klass->create_context (backend, error);
}
ClutterFeatureFlags
_clutter_backend_get_features (ClutterBackend *backend)
{
ClutterBackendClass *klass;
GError *error;
g_assert (CLUTTER_IS_BACKEND (backend));
klass = CLUTTER_BACKEND_GET_CLASS (backend);
/* we need to have a context here; so we create the
* GL context first and the ask for features. if the
* context already exists this should be a no-op
*/
error = NULL;
if (klass->create_context != NULL)
{
gboolean res;
res = klass->create_context (backend, &error);
if (!res)
{
if (error)
{
g_critical ("Unable to create a context: %s", error->message);
g_error_free (error);
}
else
g_critical ("Unable to create a context: unknown error");
return 0;
}
}
if (klass->get_features)
return klass->get_features (backend);
return 0;
}
gfloat
_clutter_backend_get_units_per_em (ClutterBackend *backend,
PangoFontDescription *font_desc)
@@ -510,6 +635,8 @@ _clutter_backend_get_units_per_em (ClutterBackend *backend,
* Return value: (transfer none): the default backend. You should
* not ref or unref the returned object. Applications should rarely
* need to use this.
*
* Since: 0.4
*/
ClutterBackend *
clutter_get_default_backend (void)
@@ -538,6 +665,8 @@ clutter_get_default_backend (void)
*
* Return value: the current resolution, or -1 if no resolution
* has been set.
*
* Since: 0.4
*/
gdouble
clutter_backend_get_resolution (ClutterBackend *backend)
@@ -570,6 +699,8 @@ clutter_backend_get_resolution (ClutterBackend *backend)
*
* This function is intended for actors creating a Pango layout
* using the PangoCairo API.
*
* Since: 0.8
*/
void
clutter_backend_set_font_options (ClutterBackend *backend,
@@ -600,6 +731,8 @@ clutter_backend_set_font_options (ClutterBackend *backend,
* Return value: (transfer none): the font options of the #ClutterBackend.
* The returned #cairo_font_options_t is owned by the backend and should
* not be modified or freed
*
* Since: 0.8
*/
const cairo_font_options_t *
clutter_backend_get_font_options (ClutterBackend *backend)
@@ -626,8 +759,18 @@ _clutter_backend_get_units_serial (ClutterBackend *backend)
return backend->units_serial;
}
gboolean
_clutter_backend_translate_event (ClutterBackend *backend,
gpointer native,
ClutterEvent *event)
{
return CLUTTER_BACKEND_GET_CLASS (backend)->translate_event (backend,
native,
event);
}
/**
* clutter_backend_get_cogl_context:
* clutter_backend_get_cogl_context: (skip)
* @backend: a #ClutterBackend
*
* Retrieves the #CoglContext associated with the given clutter
@@ -642,6 +785,9 @@ _clutter_backend_get_units_serial (ClutterBackend *backend)
* explicitly create a CoglContext.
*
* Return value: (transfer none): The #CoglContext associated with @backend.
*
* Since: 1.8
* Stability: unstable
*/
CoglContext *
clutter_backend_get_cogl_context (ClutterBackend *backend)
@@ -678,7 +824,7 @@ clutter_backend_get_input_method (ClutterBackend *backend)
/**
* clutter_backend_set_input_method:
* @backend: the #ClutterBackend
* @method: (nullable): the input method
* @method: the input method
*
* Sets the input method to be used by Clutter
**/
@@ -686,12 +832,6 @@ void
clutter_backend_set_input_method (ClutterBackend *backend,
ClutterInputMethod *method)
{
if (backend->input_method == method)
return;
if (backend->input_method)
clutter_input_method_focus_out (backend->input_method);
g_set_object (&backend->input_method, method);
}

View File

@@ -21,7 +21,8 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CLUTTER_BACKEND_H__
#define __CLUTTER_BACKEND_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
@@ -30,11 +31,11 @@
#include <cairo.h>
#include <pango/pango.h>
#include "cogl/cogl.h"
#include <cogl/cogl.h>
#include "clutter/clutter-keymap.h"
#include "clutter/clutter-types.h"
#include "clutter/clutter-seat.h"
#include <clutter/clutter-keymap.h>
#include <clutter/clutter-types.h>
#include <clutter/clutter-seat.h>
G_BEGIN_DECLS
@@ -42,6 +43,14 @@ G_BEGIN_DECLS
#define CLUTTER_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BACKEND, ClutterBackend))
#define CLUTTER_IS_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BACKEND))
/**
* ClutterBackend:
*
* #ClutterBackend is an opaque structure whose
* members cannot be directly accessed.
*
* Since: 0.4
*/
typedef struct _ClutterBackend ClutterBackend;
typedef struct _ClutterBackendClass ClutterBackendClass;
@@ -73,3 +82,5 @@ CLUTTER_EXPORT
ClutterSeat * clutter_backend_get_default_seat (ClutterBackend *backend);
G_END_DECLS
#endif /* __CLUTTER_BACKEND_H__ */

View File

@@ -30,15 +30,17 @@
* across the whole API.
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-types.h"
#include "clutter/clutter-private.h"
#include "clutter-types.h"
#include "clutter-private.h"
#include <math.h>
#define FLOAT_EPSILON (1e-15)
/*
* ClutterMargin
*/
@@ -51,6 +53,8 @@
* Return value: (transfer full): a newly allocated #ClutterMargin. Use
* clutter_margin_free() to free the resources associated with it when
* done.
*
* Since: 1.10
*/
ClutterMargin *
clutter_margin_new (void)
@@ -66,6 +70,8 @@ clutter_margin_new (void)
* the newly created structure.
*
* Return value: (transfer full): a copy of the #ClutterMargin.
*
* Since: 1.10
*/
ClutterMargin *
clutter_margin_copy (const ClutterMargin *margin_)
@@ -82,6 +88,8 @@ clutter_margin_copy (const ClutterMargin *margin_)
*
* Frees the resources allocated by clutter_margin_new() and
* clutter_margin_copy().
*
* Since: 1.10
*/
void
clutter_margin_free (ClutterMargin *margin_)

View File

@@ -21,13 +21,12 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include <glib.h>
#include <string.h>
#include "clutter/clutter-bezier.h"
#include "clutter/clutter-debug.h"
#include "clutter-bezier.h"
#include "clutter-debug.h"
/*
* We have some experimental code here to allow for constant velocity

View File

@@ -21,11 +21,11 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CLUTTER_BEZIER_H__
#define __CLUTTER_BEZIER_H__
#include <glib.h>
#include "clutter/clutter-types.h"
#include "clutter-types.h"
G_BEGIN_DECLS
@@ -61,3 +61,5 @@ void _clutter_bezier_adjust (ClutterBezier *b,
guint _clutter_bezier_get_length (const ClutterBezier *b);
G_END_DECLS
#endif /* __CLUTTER_BEZIER_H__ */

View File

@@ -23,9 +23,8 @@
*/
/**
* ClutterBinLayout:
*
* A simple layout manager
* SECTION:clutter-bin-layout
* @short_description: A simple layout manager
*
* #ClutterBinLayout is a layout manager which implements the following
* policy:
@@ -40,23 +39,25 @@
*
* The [bin-layout example](https://git.gnome.org/browse/clutter/tree/examples/bin-layout.c?h=clutter-1.18)
* shows how to pack actors inside a #ClutterBinLayout.
*
* #ClutterBinLayout is available since Clutter 1.2
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include <math.h>
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#include "clutter/deprecated/clutter-container.h"
#include "deprecated/clutter-container.h"
#include "clutter/clutter-actor-private.h"
#include "clutter/clutter-animatable.h"
#include "clutter/clutter-bin-layout.h"
#include "clutter/clutter-child-meta.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-enum-types.h"
#include "clutter/clutter-layout-meta.h"
#include "clutter/clutter-private.h"
#include "clutter-actor-private.h"
#include "clutter-animatable.h"
#include "clutter-bin-layout.h"
#include "clutter-child-meta.h"
#include "clutter-debug.h"
#include "clutter-enum-types.h"
#include "clutter-layout-meta.h"
#include "clutter-private.h"
#define CLUTTER_TYPE_BIN_LAYER (clutter_bin_layer_get_type ())
#define CLUTTER_BIN_LAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BIN_LAYER, ClutterBinLayer))
@@ -213,13 +214,19 @@ clutter_bin_layer_class_init (ClutterBinLayerClass *klass)
gobject_class->get_property = clutter_bin_layer_get_property;
layer_props[PROP_LAYER_X_ALIGN] =
g_param_spec_enum ("x-align", NULL, NULL,
g_param_spec_enum ("x-align",
P_("Horizontal Alignment"),
P_("Horizontal alignment for the actor "
"inside the layout manager"),
CLUTTER_TYPE_BIN_ALIGNMENT,
CLUTTER_BIN_ALIGNMENT_CENTER,
CLUTTER_PARAM_READWRITE);
layer_props[PROP_LAYER_Y_ALIGN] =
g_param_spec_enum ("y-align", NULL, NULL,
g_param_spec_enum ("y-align",
P_("Vertical Alignment"),
P_("Vertical alignment for the actor "
"inside the layout manager"),
CLUTTER_TYPE_BIN_ALIGNMENT,
CLUTTER_BIN_ALIGNMENT_CENTER,
CLUTTER_PARAM_READWRITE);
@@ -612,11 +619,16 @@ clutter_bin_layout_class_init (ClutterBinLayoutClass *klass)
* The default horizontal alignment policy for actors managed
* by the #ClutterBinLayout
*
* Since: 1.2
*
* Deprecated: 1.12: Use the #ClutterActor:x-expand and the
* #ClutterActor:x-align properties on #ClutterActor instead.
*/
bin_props[PROP_X_ALIGN] =
g_param_spec_enum ("x-align", NULL, NULL,
g_param_spec_enum ("x-align",
P_("Horizontal Alignment"),
P_("Default horizontal alignment for the actors "
"inside the layout manager"),
CLUTTER_TYPE_BIN_ALIGNMENT,
CLUTTER_BIN_ALIGNMENT_CENTER,
CLUTTER_PARAM_READWRITE);
@@ -627,11 +639,16 @@ clutter_bin_layout_class_init (ClutterBinLayoutClass *klass)
* The default vertical alignment policy for actors managed
* by the #ClutterBinLayout
*
* Since: 1.2
*
* Deprecated: 1.12: Use the #ClutterActor:y-expand and the
* #ClutterActor:y-align properties on #ClutterActor instead.
*/
bin_props[PROP_Y_ALIGN] =
g_param_spec_enum ("y-align", NULL, NULL,
g_param_spec_enum ("y-align",
P_("Vertical Alignment"),
P_("Default vertical alignment for the actors "
"inside the layout manager"),
CLUTTER_TYPE_BIN_ALIGNMENT,
CLUTTER_BIN_ALIGNMENT_CENTER,
CLUTTER_PARAM_READWRITE);
@@ -667,6 +684,8 @@ clutter_bin_layout_init (ClutterBinLayout *self)
* Creates a new #ClutterBinLayout layout manager
*
* Return value: the newly created layout manager
*
* Since: 1.2
*/
ClutterLayoutManager *
clutter_bin_layout_new (ClutterBinAlignment x_align,

View File

@@ -22,13 +22,14 @@
* Emmanuele Bassi <ebassi@linux.intel.com>
*/
#pragma once
#ifndef __CLUTTER_BIN_LAYOUT_H__
#define __CLUTTER_BIN_LAYOUT_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-layout-manager.h"
#include <clutter/clutter-layout-manager.h>
G_BEGIN_DECLS
@@ -43,6 +44,14 @@ typedef struct _ClutterBinLayout ClutterBinLayout;
typedef struct _ClutterBinLayoutPrivate ClutterBinLayoutPrivate;
typedef struct _ClutterBinLayoutClass ClutterBinLayoutClass;
/**
* ClutterBinLayout:
*
* The #ClutterBinLayout structure contains only private data
* and should be accessed using the provided API
*
* Since: 1.2
*/
struct _ClutterBinLayout
{
/*< private >*/
@@ -56,6 +65,8 @@ struct _ClutterBinLayout
*
* The #ClutterBinLayoutClass structure contains only private
* data and should be accessed using the provided API
*
* Since: 1.2
*/
struct _ClutterBinLayoutClass
{
@@ -71,3 +82,5 @@ ClutterLayoutManager * clutter_bin_layout_new (ClutterBinAlignment x_align,
ClutterBinAlignment y_align);
G_END_DECLS
#endif /* __CLUTTER_BIN_LAYOUT_H__ */

View File

@@ -23,20 +23,20 @@
*/
/**
* ClutterBindConstraint:
*
* A constraint binding the position or size of an actor
* SECTION:clutter-bind-constraint
* @Title: ClutterBindConstraint
* @Short_Description: A constraint binding the position or size of an actor
*
* #ClutterBindConstraint is a [class@Constraint] that binds the
* position or the size of the [class@Actor] to which it is applied
* to the the position or the size of another [class@Actor], or
* #ClutterBindConstraint is a #ClutterConstraint that binds the
* position or the size of the #ClutterActor to which it is applied
* to the the position or the size of another #ClutterActor, or
* "source".
*
* An offset can be applied to the constraint, to avoid overlapping. The offset
* can also be animated. For instance, the following code will set up three
* actors to be bound to the same origin:
*
* ```c
* |[<!-- language="C" -->
* // source
* rect[0] = clutter_actor_new ();
* clutter_actor_set_background_color (rect[0], &red_color);
@@ -64,12 +64,12 @@
* clutter_actor_add_constraint_with_name (rect[2], "blue-x", constraint);
* constraint = clutter_bind_constraint_new (rect[0], CLUTTER_BIND_Y, 0.0);
* clutter_actor_add_constraint_with_name (rect[2], "blue-y", constraint);
* ```
* ]|
*
* The following code animates the second and third rectangles to "expand"
* them horizontally from underneath the first rectangle:
*
* ```c
* |[<!-- language="C" -->
* clutter_actor_animate (rect[1], CLUTTER_EASE_OUT_CUBIC, 250,
* "@constraints.green-x.offset", 100.0,
* "opacity", 255,
@@ -78,21 +78,23 @@
* "@constraints.blue-x.offset", 200.0,
* "opacity", 255,
* NULL);
* ```
* ]|
*
* #ClutterBindConstraint is available since Clutter 1.4
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include <math.h>
#include "clutter/clutter-bind-constraint.h"
#include "clutter-bind-constraint.h"
#include "clutter/clutter-actor-meta-private.h"
#include "clutter/clutter-actor-private.h"
#include "clutter/clutter-constraint.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-enum-types.h"
#include "clutter/clutter-private.h"
#include "clutter-actor-meta-private.h"
#include "clutter-actor-private.h"
#include "clutter-constraint.h"
#include "clutter-debug.h"
#include "clutter-enum-types.h"
#include "clutter-private.h"
#define CLUTTER_BIND_CONSTRAINT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BIND_CONSTRAINT, ClutterBindConstraintClass))
#define CLUTTER_IS_BIND_CONSTRAINT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BIND_CONSTRAINT))
@@ -390,9 +392,13 @@ clutter_bind_constraint_class_init (ClutterBindConstraintClass *klass)
*
* The #ClutterActor must not be contained inside the actor associated
* to the constraint.
*
* Since: 1.4
*/
obj_props[PROP_SOURCE] =
g_param_spec_object ("source", NULL, NULL,
g_param_spec_object ("source",
P_("Source"),
P_("The source of the binding"),
CLUTTER_TYPE_ACTOR,
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT);
@@ -400,9 +406,13 @@ clutter_bind_constraint_class_init (ClutterBindConstraintClass *klass)
* ClutterBindConstraint:coordinate:
*
* The coordinate to be bound
*
* Since: 1.4
*/
obj_props[PROP_COORDINATE] =
g_param_spec_enum ("coordinate", NULL, NULL,
g_param_spec_enum ("coordinate",
P_("Coordinate"),
P_("The coordinate to bind"),
CLUTTER_TYPE_BIND_COORDINATE,
CLUTTER_BIND_X,
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT);
@@ -411,9 +421,13 @@ clutter_bind_constraint_class_init (ClutterBindConstraintClass *klass)
* ClutterBindConstraint:offset:
*
* The offset, in pixels, to be applied to the binding
*
* Since: 1.4
*/
obj_props[PROP_OFFSET] =
g_param_spec_float ("offset", NULL, NULL,
g_param_spec_float ("offset",
P_("Offset"),
P_("The offset in pixels to apply to the binding"),
-G_MAXFLOAT, G_MAXFLOAT,
0.0f,
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT);
@@ -443,6 +457,8 @@ clutter_bind_constraint_init (ClutterBindConstraint *self)
* the given @coordinate of the position of @source
*
* Return value: the newly created #ClutterBindConstraint
*
* Since: 1.4
*/
ClutterConstraint *
clutter_bind_constraint_new (ClutterActor *source,
@@ -464,6 +480,8 @@ clutter_bind_constraint_new (ClutterActor *source,
* @source: (allow-none): a #ClutterActor, or %NULL to unset the source
*
* Sets the source #ClutterActor for the constraint
*
* Since: 1.4
*/
void
clutter_bind_constraint_set_source (ClutterBindConstraint *constraint,
@@ -529,6 +547,8 @@ clutter_bind_constraint_set_source (ClutterBindConstraint *constraint,
* Retrieves the #ClutterActor set using clutter_bind_constraint_set_source()
*
* Return value: (transfer none): a pointer to the source actor
*
* Since: 1.4
*/
ClutterActor *
clutter_bind_constraint_get_source (ClutterBindConstraint *constraint)
@@ -544,6 +564,8 @@ clutter_bind_constraint_get_source (ClutterBindConstraint *constraint)
* @coordinate: the coordinate to bind
*
* Sets the coordinate to bind in the constraint
*
* Since: 1.4
*/
void
clutter_bind_constraint_set_coordinate (ClutterBindConstraint *constraint,
@@ -569,6 +591,8 @@ clutter_bind_constraint_set_coordinate (ClutterBindConstraint *constraint,
* Retrieves the bound coordinate of the constraint
*
* Return value: the bound coordinate
*
* Since: 1.4
*/
ClutterBindCoordinate
clutter_bind_constraint_get_coordinate (ClutterBindConstraint *constraint)
@@ -585,6 +609,8 @@ clutter_bind_constraint_get_coordinate (ClutterBindConstraint *constraint)
* @offset: the offset to apply, in pixels
*
* Sets the offset to be applied to the constraint
*
* Since: 1.4
*/
void
clutter_bind_constraint_set_offset (ClutterBindConstraint *constraint,
@@ -610,6 +636,8 @@ clutter_bind_constraint_set_offset (ClutterBindConstraint *constraint,
* Retrieves the offset set using clutter_bind_constraint_set_offset()
*
* Return value: the offset, in pixels
*
* Since: 1.4
*/
gfloat
clutter_bind_constraint_get_offset (ClutterBindConstraint *bind)

View File

@@ -22,13 +22,14 @@
* Emmanuele Bassi <ebassi@linux.intel.com>
*/
#pragma once
#ifndef __CLUTTER_BIND_CONSTRAINT_H__
#define __CLUTTER_BIND_CONSTRAINT_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-constraint.h"
#include <clutter/clutter-constraint.h>
G_BEGIN_DECLS
@@ -36,6 +37,14 @@ G_BEGIN_DECLS
#define CLUTTER_BIND_CONSTRAINT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BIND_CONSTRAINT, ClutterBindConstraint))
#define CLUTTER_IS_BIND_CONSTRAINT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BIND_CONSTRAINT))
/**
* ClutterBindConstraint:
*
* #ClutterBindConstraint is an opaque structure
* whose members cannot be directly accessed
*
* Since: 1.4
*/
typedef struct _ClutterBindConstraint ClutterBindConstraint;
typedef struct _ClutterBindConstraintClass ClutterBindConstraintClass;
@@ -64,3 +73,5 @@ CLUTTER_EXPORT
gfloat clutter_bind_constraint_get_offset (ClutterBindConstraint *constraint);
G_END_DECLS
#endif /* __CLUTTER_BIND_CONSTRAINT_H__ */

View File

@@ -22,9 +22,8 @@
*/
/**
* ClutterBindingPool
*
* Pool for key bindings
* SECTION:clutter-binding-pool
* @short_description: Pool for key bindings
*
* #ClutterBindingPool is a data structure holding a set of key bindings.
* Each key binding associates a key symbol (eventually with modifiers)
@@ -39,7 +38,7 @@
* inside their class initialization function and then install actions
* like this:
*
* ```c
* |[<!-- language="C" -->
* static void
* foo_class_init (FooClass *klass)
* {
@@ -56,23 +55,23 @@
* G_CALLBACK (foo_action_move_up),
* NULL, NULL);
* }
* ```
* ]|
*
* The callback has a signature of:
*
* ```c
* |[<!-- language="C" -->
* gboolean (* callback) (GObject *instance,
* const gchar *action_name,
* guint key_val,
* ClutterModifierType modifiers,
* gpointer user_data);
* ```
* ]|
*
* The actor should then override the [signal@Actor::key-press-event] and
* use [method@BindingPool.activate] to match a [struct@Event] key event
* structure to one of the actions:
* The actor should then override the #ClutterActor::key-press-event and
* use clutter_binding_pool_activate() to match a #ClutterKeyEvent structure
* to one of the actions:
*
* ```c
* |[<!-- language="C" -->
* ClutterBindingPool *pool;
*
* // retrieve the binding pool for the type of the actor
@@ -85,21 +84,23 @@
* key_event->keyval,
* key_event->modifier_state,
* G_OBJECT (actor));
* ```
* ]|
*
* The [method@BindingPool.activate] function will return %FALSE if
* The clutter_binding_pool_activate() function will return %FALSE if
* no action for the given key binding was found, if the action was
* blocked (using [method@BindingPool.block_action]) or if the
* blocked (using clutter_binding_pool_block_action()) or if the
* key binding handler returned %FALSE.
*
* #ClutterBindingPool is available since Clutter 1.0
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-binding-pool.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-enum-types.h"
#include "clutter/clutter-marshal.h"
#include "clutter/clutter-private.h"
#include "clutter-binding-pool.h"
#include "clutter-debug.h"
#include "clutter-enum-types.h"
#include "clutter-marshal.h"
#include "clutter-private.h"
#define CLUTTER_BINDING_POOL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CLUTTER_TYPE_BINDING_POOL, ClutterBindingPoolClass))
#define CLUTTER_IS_BINDING_POOL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CLUTTER_TYPE_BINDING_POOL))
@@ -306,9 +307,13 @@ clutter_binding_pool_class_init (ClutterBindingPoolClass *klass)
* ClutterBindingPool:name:
*
* The unique name of the #ClutterBindingPool.
*
* Since: 1.0
*/
obj_props[PROP_NAME] =
g_param_spec_string ("name", NULL, NULL,
g_param_spec_string ("name",
P_("Name"),
P_("The unique name of the binding pool"),
NULL,
CLUTTER_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY);
@@ -340,6 +345,8 @@ clutter_binding_pool_init (ClutterBindingPool *pool)
*
* Return value: the newly created binding pool with the given
* name. Use g_object_unref() when done.
*
* Since: 1.0
*/
ClutterBindingPool *
clutter_binding_pool_new (const gchar *name)
@@ -375,13 +382,15 @@ clutter_binding_pool_new (const gchar *name)
* A binding pool for a class can also be retrieved using
* clutter_binding_pool_find() with the class type name:
*
* ```
* |[
* pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (instance));
* ```
* ]|
*
* Return value: (transfer none): the binding pool for the given class.
* The returned #ClutterBindingPool is owned by Clutter and should not
* be freed directly
*
* Since: 1.0
*/
ClutterBindingPool *
clutter_binding_pool_get_for_class (gpointer klass)
@@ -412,6 +421,8 @@ clutter_binding_pool_get_for_class (gpointer klass)
* Finds the #ClutterBindingPool with @name.
*
* Return value: (transfer none): a pointer to the #ClutterBindingPool, or %NULL
*
* Since: 1.0
*/
ClutterBindingPool *
clutter_binding_pool_find (const gchar *name)
@@ -454,6 +465,8 @@ clutter_binding_pool_find (const gchar *name)
*
* Actions can be blocked with clutter_binding_pool_block_action()
* and then unblocked using clutter_binding_pool_unblock_action().
*
* Since: 1.0
*/
void
clutter_binding_pool_install_action (ClutterBindingPool *pool,
@@ -522,6 +535,8 @@ clutter_binding_pool_install_action (ClutterBindingPool *pool,
*
* Actions can be blocked with clutter_binding_pool_block_action()
* and then unblocked using clutter_binding_pool_unblock_action().
*
* Since: 1.0
*/
void
clutter_binding_pool_install_closure (ClutterBindingPool *pool,
@@ -583,6 +598,8 @@ clutter_binding_pool_install_closure (ClutterBindingPool *pool,
*
* Actions can be blocked with clutter_binding_pool_block_action()
* and then unblocked using clutter_binding_pool_unblock_action().
*
* Since: 1.0
*/
void
clutter_binding_pool_override_action (ClutterBindingPool *pool,
@@ -645,6 +662,8 @@ clutter_binding_pool_override_action (ClutterBindingPool *pool,
*
* Actions can be blocked with clutter_binding_pool_block_action()
* and then unblocked using clutter_binding_pool_unblock_action().
*
* Since: 1.0
*/
void
clutter_binding_pool_override_closure (ClutterBindingPool *pool,
@@ -698,6 +717,8 @@ clutter_binding_pool_override_closure (ClutterBindingPool *pool,
* Return value: the name of the action, if found, or %NULL. The
* returned string is owned by the binding pool and should never
* be modified or freed
*
* Since: 1.0
*/
const gchar *
clutter_binding_pool_find_action (ClutterBindingPool *pool,
@@ -724,6 +745,8 @@ clutter_binding_pool_find_action (ClutterBindingPool *pool,
*
* Removes the action matching the given @key_val, @modifiers pair,
* if any exists.
*
* Since: 1.0
*/
void
clutter_binding_pool_remove_action (ClutterBindingPool *pool,
@@ -809,13 +832,13 @@ clutter_binding_entry_invoke (ClutterBindingEntry *entry,
*
* The callback has the following signature:
*
* ```
* |[
* void (* callback) (GObject *gobject,
* const gchar *action_name,
* guint key_val,
* ClutterModifierType modifiers,
* gpointer user_data);
* ```
* ]|
*
* Where the #GObject instance is @gobject and the user data
* is the one passed when installing the action with
@@ -826,6 +849,8 @@ clutter_binding_entry_invoke (ClutterBindingEntry *entry,
* will not be invoked, and this function will return %FALSE.
*
* Return value: %TRUE if an action was found and was activated
*
* Since: 1.0
*/
gboolean
clutter_binding_pool_activate (ClutterBindingPool *pool,
@@ -857,6 +882,8 @@ clutter_binding_pool_activate (ClutterBindingPool *pool,
* @action_name: an action name
*
* Blocks all the actions with name @action_name inside @pool.
*
* Since: 1.0
*/
void
clutter_binding_pool_block_action (ClutterBindingPool *pool,
@@ -886,6 +913,8 @@ clutter_binding_pool_block_action (ClutterBindingPool *pool,
* Unblocking an action does not cause the callback bound to it to
* be invoked in case clutter_binding_pool_activate() was called on
* an action previously blocked with clutter_binding_pool_block_action().
*
* Since: 1.0
*/
void
clutter_binding_pool_unblock_action (ClutterBindingPool *pool,

View File

@@ -21,15 +21,15 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CLUTTER_BINDING_POOL_H__
#define __CLUTTER_BINDING_POOL_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include <glib-object.h>
#include "clutter/clutter-event.h"
#include <clutter/clutter-event.h>
G_BEGIN_DECLS
@@ -37,6 +37,14 @@ G_BEGIN_DECLS
#define CLUTTER_BINDING_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BINDING_POOL, ClutterBindingPool))
#define CLUTTER_IS_BINDING_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BINDING_POOL))
/**
* ClutterBindingPool:
*
* Container of key bindings. The #ClutterBindingPool struct is
* private.
*
* Since: 1.0
*/
typedef struct _ClutterBindingPool ClutterBindingPool;
typedef struct _ClutterBindingPoolClass ClutterBindingPoolClass;
@@ -54,6 +62,8 @@ typedef struct _ClutterBindingPoolClass ClutterBindingPoolClass;
*
* Return value: the function should return %TRUE if the key
* binding has been handled, and return %FALSE otherwise
*
* Since: 1.0
*/
typedef gboolean (* ClutterBindingActionFunc) (GObject *gobject,
const gchar *action_name,
@@ -121,3 +131,5 @@ void clutter_binding_pool_unblock_action (ClutterBindingPool
const gchar *action_name);
G_END_DECLS
#endif /* __CLUTTER_BINDING_POOL_H__ */

View File

@@ -23,27 +23,29 @@
*/
/**
* ClutterBlurEffect:
*
* A blur effect
* SECTION:clutter-blur-effect
* @short_description: A blur effect
* @see_also: #ClutterEffect, #ClutterOffscreenEffect
*
* #ClutterBlurEffect is a sub-class of #ClutterEffect that allows blurring a
* actor and its contents.
*
* #ClutterBlurEffect is available since Clutter 1.4
*/
#define CLUTTER_BLUR_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BLUR_EFFECT, ClutterBlurEffectClass))
#define CLUTTER_IS_BLUR_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BLUR_EFFECT))
#define CLUTTER_BLUR_EFFECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BLUR_EFFECT, ClutterBlurEffectClass))
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-blur-effect.h"
#include "clutter-blur-effect.h"
#include "cogl/cogl.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-offscreen-effect.h"
#include "clutter/clutter-private.h"
#include "clutter-debug.h"
#include "clutter-offscreen-effect.h"
#include "clutter-private.h"
#define BLUR_PADDING 2
@@ -120,6 +122,29 @@ clutter_blur_effect_create_pipeline (ClutterOffscreenEffect *effect,
return cogl_object_ref (blur_effect->pipeline);
}
static gboolean
clutter_blur_effect_pre_paint (ClutterEffect *effect,
ClutterPaintNode *node,
ClutterPaintContext *paint_context)
{
ClutterEffectClass *parent_class;
if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
{
/* if we don't have support for GLSL shaders then we
* forcibly disable the ActorMeta
*/
g_warning ("Unable to use the ShaderEffect: the graphics hardware "
"or the current GL driver does not implement support "
"for the GLSL shading language.");
clutter_actor_meta_set_enabled (CLUTTER_ACTOR_META (effect), FALSE);
return FALSE;
}
parent_class = CLUTTER_EFFECT_CLASS (clutter_blur_effect_parent_class);
return parent_class->pre_paint (effect, node, paint_context);
}
static gboolean
clutter_blur_effect_modify_paint_volume (ClutterEffect *effect,
ClutterPaintVolume *volume)
@@ -165,6 +190,7 @@ clutter_blur_effect_class_init (ClutterBlurEffectClass *klass)
gobject_class->dispose = clutter_blur_effect_dispose;
effect_class->pre_paint = clutter_blur_effect_pre_paint;
effect_class->modify_paint_volume = clutter_blur_effect_modify_paint_volume;
offscreen_class = CLUTTER_OFFSCREEN_EFFECT_CLASS (klass);
@@ -207,6 +233,8 @@ clutter_blur_effect_init (ClutterBlurEffect *self)
* clutter_actor_add_effect()
*
* Return value: the newly created #ClutterBlurEffect or %NULL
*
* Since: 1.4
*/
ClutterEffect *
clutter_blur_effect_new (void)

View File

@@ -22,13 +22,14 @@
* Emmanuele Bassi <ebassi@linux.intel.com>
*/
#pragma once
#ifndef __CLUTTER_BLUR_EFFECT_H__
#define __CLUTTER_BLUR_EFFECT_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-effect.h"
#include <clutter/clutter-effect.h>
G_BEGIN_DECLS
@@ -36,6 +37,14 @@ G_BEGIN_DECLS
#define CLUTTER_BLUR_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BLUR_EFFECT, ClutterBlurEffect))
#define CLUTTER_IS_BLUR_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BLUR_EFFECT))
/**
* ClutterBlurEffect:
*
* #ClutterBlurEffect is an opaque structure
* whose members cannot be accessed directly
*
* Since: 1.4
*/
typedef struct _ClutterBlurEffect ClutterBlurEffect;
typedef struct _ClutterBlurEffectClass ClutterBlurEffectClass;
@@ -46,3 +55,5 @@ CLUTTER_EXPORT
ClutterEffect *clutter_blur_effect_new (void);
G_END_DECLS
#endif /* __CLUTTER_BLUR_EFFECT_H__ */

View File

@@ -15,11 +15,12 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef CLUTTER_BLUR_PRIVATE_H
#define CLUTTER_BLUR_PRIVATE_H
#include <glib-object.h>
#include "cogl/cogl.h"
#include <cogl/cogl.h>
G_BEGIN_DECLS
@@ -35,3 +36,5 @@ CoglTexture * clutter_blur_get_texture (ClutterBlur *blur);
void clutter_blur_free (ClutterBlur *blur);
G_END_DECLS
#endif /* CLUTTER_BLUR_PRIVATE_H */

View File

@@ -15,9 +15,9 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "clutter/clutter-blur-private.h"
#include "clutter-blur-private.h"
#include "clutter/clutter-backend.h"
#include "clutter-backend.h"
/**
* SECTION:clutter-blur

View File

@@ -26,15 +26,15 @@
*/
/**
* ClutterBoxLayout:
*
* A layout manager arranging children on a single line
* SECTION:clutter-box-layout
* @short_description: A layout manager arranging children on a single line
*
* The #ClutterBoxLayout is a #ClutterLayoutManager implementing the
* following layout policy:
*
* - all children are arranged on a single line
* - the axis used is controlled by the #ClutterBoxLayout:orientation property
* - the order of the packing is determined by the #ClutterBoxLayout:pack-start boolean property
* - each child will be allocated to its natural size or, if #ClutterActor:x-expand or
* #ClutterActor:y-expand are set, the available size
* - honours the #ClutterActor's #ClutterActor:x-align and #ClutterActor:y-align properties
@@ -44,23 +44,25 @@
*
* It is possible to control the spacing between children of a
* #ClutterBoxLayout by using clutter_box_layout_set_spacing().
*
* #ClutterBoxLayout is available since Clutter 1.2
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include <math.h>
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#include "clutter/deprecated/clutter-container.h"
#include "deprecated/clutter-container.h"
#include "clutter/clutter-box-layout.h"
#include "clutter-box-layout.h"
#include "clutter/clutter-actor-private.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-enum-types.h"
#include "clutter/clutter-layout-meta.h"
#include "clutter/clutter-private.h"
#include "clutter/clutter-types.h"
#include "clutter-actor-private.h"
#include "clutter-debug.h"
#include "clutter-enum-types.h"
#include "clutter-layout-meta.h"
#include "clutter-private.h"
#include "clutter-types.h"
struct _ClutterBoxLayoutPrivate
{
@@ -73,6 +75,7 @@ struct _ClutterBoxLayoutPrivate
ClutterOrientation orientation;
guint is_pack_start : 1;
guint is_homogeneous : 1;
};
@@ -82,6 +85,7 @@ enum
PROP_SPACING,
PROP_HOMOGENEOUS,
PROP_PACK_START,
PROP_ORIENTATION,
PROP_LAST
@@ -593,17 +597,17 @@ distribute_natural_allocation (float extra_space,
/* Distribute available space.
* This master piece of a loop was conceived by Behdad Esfahbod.
*/
for (i = n_requested_sizes - 1; extra_space > 0.0 && i >= 0; --i)
for (i = n_requested_sizes - 1; extra_space > 0 && i >= 0; --i)
{
/* Divide remaining space by number of remaining children.
* Sort order and reducing remaining space by assigned space
* ensures that space is distributed equally.
*/
float glue = (extra_space + i) / (i + 1.0);
float gap =
sizes[(spreading[i])].natural_size - sizes[(spreading[i])].minimum_size;
int glue = (extra_space + i) / (i + 1);
int gap = sizes[(spreading[i])].natural_size
- sizes[(spreading[i])].minimum_size;
float extra = MIN (glue, gap);
int extra = MIN (glue, gap);
sizes[spreading[i]].minimum_size += extra;
@@ -760,13 +764,19 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout,
{
child_allocation.x1 = box->x1;
child_allocation.x2 = MAX (1.0, box->x2);
y = box->y1;
if (priv->is_pack_start)
y = box->y2 - box->y1;
else
y = box->y1;
}
else
{
child_allocation.y1 = box->y1;
child_allocation.y2 = MAX (1.0, box->y2);
x = box->x1;
if (priv->is_pack_start)
x = box->x2 - box->x1;
else
x = box->x1;
}
i = 0;
@@ -818,7 +828,17 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout,
child_allocation.y2 = child_allocation.y1 + sizes[i].minimum_size;
}
y += child_size + priv->spacing;
if (priv->is_pack_start)
{
y -= child_size + priv->spacing;
child_allocation.y1 -= child_size;
child_allocation.y2 -= child_size;
}
else
{
y += child_size + priv->spacing;
}
}
else /* CLUTTER_ORIENTATION_HORIZONTAL */
{
@@ -833,7 +853,17 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout,
child_allocation.x2 = child_allocation.x1 + sizes[i].minimum_size;
}
x += child_size + priv->spacing;
if (priv->is_pack_start)
{
x -= child_size + priv->spacing;
child_allocation.x1 -= child_size;
child_allocation.x2 -= child_size;
}
else
{
x += child_size + priv->spacing;
}
if (is_rtl)
{
@@ -876,6 +906,10 @@ clutter_box_layout_set_property (GObject *gobject,
clutter_box_layout_set_spacing (self, g_value_get_uint (value));
break;
case PROP_PACK_START:
clutter_box_layout_set_pack_start (self, g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
break;
@@ -904,6 +938,10 @@ clutter_box_layout_get_property (GObject *gobject,
g_value_set_uint (value, priv->spacing);
break;
case PROP_PACK_START:
g_value_set_boolean (value, priv->is_pack_start);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
break;
@@ -928,9 +966,13 @@ clutter_box_layout_class_init (ClutterBoxLayoutClass *klass)
*
* The orientation of the #ClutterBoxLayout, either horizontal
* or vertical
*
* Since: 1.12
*/
obj_props[PROP_ORIENTATION] =
g_param_spec_enum ("orientation", NULL, NULL,
g_param_spec_enum ("orientation",
P_("Orientation"),
P_("The orientation of the layout"),
CLUTTER_TYPE_ORIENTATION,
CLUTTER_ORIENTATION_HORIZONTAL,
G_PARAM_READWRITE |
@@ -941,9 +983,29 @@ clutter_box_layout_class_init (ClutterBoxLayoutClass *klass)
*
* Whether the #ClutterBoxLayout should arrange its children
* homogeneously, i.e. all children get the same size
*
* Since: 1.4
*/
obj_props[PROP_HOMOGENEOUS] =
g_param_spec_boolean ("homogeneous", NULL, NULL,
g_param_spec_boolean ("homogeneous",
P_("Homogeneous"),
P_("Whether the layout should be homogeneous, "
"i.e. all children get the same size"),
FALSE,
CLUTTER_PARAM_READWRITE);
/**
* ClutterBoxLayout:pack-start:
*
* Whether the #ClutterBoxLayout should pack items at the start
* or append them at the end
*
* Since: 1.2
*/
obj_props[PROP_PACK_START] =
g_param_spec_boolean ("pack-start",
P_("Pack Start"),
P_("Whether to pack items at the start of the box"),
FALSE,
CLUTTER_PARAM_READWRITE);
@@ -951,9 +1013,13 @@ clutter_box_layout_class_init (ClutterBoxLayoutClass *klass)
* ClutterBoxLayout:spacing:
*
* The spacing between children of the #ClutterBoxLayout, in pixels
*
* Since: 1.2
*/
obj_props[PROP_SPACING] =
g_param_spec_uint ("spacing", NULL, NULL,
g_param_spec_uint ("spacing",
P_("Spacing"),
P_("Spacing between children"),
0, G_MAXUINT, 0,
CLUTTER_PARAM_READWRITE);
@@ -969,6 +1035,7 @@ clutter_box_layout_init (ClutterBoxLayout *self)
self->priv->orientation = CLUTTER_ORIENTATION_HORIZONTAL;
self->priv->is_homogeneous = FALSE;
self->priv->is_pack_start = FALSE;
self->priv->spacing = 0;
self->priv->easing_mode = CLUTTER_EASE_OUT_CUBIC;
@@ -981,6 +1048,8 @@ clutter_box_layout_init (ClutterBoxLayout *self)
* Creates a new #ClutterBoxLayout layout manager
*
* Return value: the newly created #ClutterBoxLayout
*
* Since: 1.2
*/
ClutterLayoutManager *
clutter_box_layout_new (void)
@@ -994,6 +1063,8 @@ clutter_box_layout_new (void)
* @spacing: the spacing between children of the layout, in pixels
*
* Sets the spacing between children of @layout
*
* Since: 1.2
*/
void
clutter_box_layout_set_spacing (ClutterBoxLayout *layout,
@@ -1026,6 +1097,8 @@ clutter_box_layout_set_spacing (ClutterBoxLayout *layout,
* Retrieves the spacing set using clutter_box_layout_set_spacing()
*
* Return value: the spacing between children of the #ClutterBoxLayout
*
* Since: 1.2
*/
guint
clutter_box_layout_get_spacing (ClutterBoxLayout *layout)
@@ -1041,6 +1114,8 @@ clutter_box_layout_get_spacing (ClutterBoxLayout *layout)
* @orientation: the orientation of the #ClutterBoxLayout
*
* Sets the orientation of the #ClutterBoxLayout layout manager.
*
* Since: 1.12
*/
void
clutter_box_layout_set_orientation (ClutterBoxLayout *layout,
@@ -1072,6 +1147,8 @@ clutter_box_layout_set_orientation (ClutterBoxLayout *layout,
* Retrieves the orientation of the @layout.
*
* Return value: the orientation of the layout
*
* Since: 1.12
*/
ClutterOrientation
clutter_box_layout_get_orientation (ClutterBoxLayout *layout)
@@ -1089,6 +1166,8 @@ clutter_box_layout_get_orientation (ClutterBoxLayout *layout)
*
* Sets whether the size of @layout children should be
* homogeneous
*
* Since: 1.4
*/
void
clutter_box_layout_set_homogeneous (ClutterBoxLayout *layout,
@@ -1122,6 +1201,8 @@ clutter_box_layout_set_homogeneous (ClutterBoxLayout *layout,
*
* Return value: %TRUE if the #ClutterBoxLayout is arranging its children
* homogeneously, and %FALSE otherwise
*
* Since: 1.4
*/
gboolean
clutter_box_layout_get_homogeneous (ClutterBoxLayout *layout)
@@ -1131,3 +1212,56 @@ clutter_box_layout_get_homogeneous (ClutterBoxLayout *layout)
return layout->priv->is_homogeneous;
}
/**
* clutter_box_layout_set_pack_start:
* @layout: a #ClutterBoxLayout
* @pack_start: %TRUE if the @layout should pack children at the
* beginning of the layout
*
* Sets whether children of @layout should be laid out by appending
* them or by prepending them
*
* Since: 1.2
*/
void
clutter_box_layout_set_pack_start (ClutterBoxLayout *layout,
gboolean pack_start)
{
ClutterBoxLayoutPrivate *priv;
g_return_if_fail (CLUTTER_IS_BOX_LAYOUT (layout));
priv = layout->priv;
if (priv->is_pack_start != pack_start)
{
ClutterLayoutManager *manager;
priv->is_pack_start = pack_start ? TRUE : FALSE;
manager = CLUTTER_LAYOUT_MANAGER (layout);
clutter_layout_manager_layout_changed (manager);
g_object_notify (G_OBJECT (layout), "pack-start");
}
}
/**
* clutter_box_layout_get_pack_start:
* @layout: a #ClutterBoxLayout
*
* Retrieves the value set using clutter_box_layout_set_pack_start()
*
* Return value: %TRUE if the #ClutterBoxLayout should pack children
* at the beginning of the layout, and %FALSE otherwise
*
* Since: 1.2
*/
gboolean
clutter_box_layout_get_pack_start (ClutterBoxLayout *layout)
{
g_return_val_if_fail (CLUTTER_IS_BOX_LAYOUT (layout), FALSE);
return layout->priv->is_pack_start;
}

View File

@@ -25,13 +25,14 @@
* Thomas Wood <thomas.wood@intel.com>
*/
#pragma once
#ifndef __CLUTTER_BOX_LAYOUT_H__
#define __CLUTTER_BOX_LAYOUT_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-layout-manager.h"
#include <clutter/clutter-layout-manager.h>
G_BEGIN_DECLS
@@ -46,6 +47,14 @@ typedef struct _ClutterBoxLayout ClutterBoxLayout;
typedef struct _ClutterBoxLayoutPrivate ClutterBoxLayoutPrivate;
typedef struct _ClutterBoxLayoutClass ClutterBoxLayoutClass;
/**
* ClutterBoxLayout:
*
* The #ClutterBoxLayout structure contains only private data
* and should be accessed using the provided API
*
* Since: 1.2
*/
struct _ClutterBoxLayout
{
/*< private >*/
@@ -59,6 +68,8 @@ struct _ClutterBoxLayout
*
* The #ClutterBoxLayoutClass structure contains only private
* data and should be accessed using the provided API
*
* Since: 1.2
*/
struct _ClutterBoxLayoutClass
{
@@ -88,5 +99,12 @@ void clutter_box_layout_set_homogeneous (ClutterBoxLayou
gboolean homogeneous);
CLUTTER_EXPORT
gboolean clutter_box_layout_get_homogeneous (ClutterBoxLayout *layout);
CLUTTER_EXPORT
void clutter_box_layout_set_pack_start (ClutterBoxLayout *layout,
gboolean pack_start);
CLUTTER_EXPORT
gboolean clutter_box_layout_get_pack_start (ClutterBoxLayout *layout);
G_END_DECLS
#endif /* __CLUTTER_BOX_LAYOUT_H__ */

View File

@@ -23,29 +23,32 @@
*/
/**
* ClutterBrightnessContrastEffect:
*
* Increase/decrease brightness and/or contrast of actor.
* SECTION:clutter-brightness-contrast-effect
* @short_description: Increase/decrease brightness and/or contrast of actor.
* @see_also: #ClutterEffect, #ClutterOffscreenEffect
*
* #ClutterBrightnessContrastEffect is a sub-class of #ClutterEffect that
* changes the overall brightness of a #ClutterActor.
*
* #ClutterBrightnessContrastEffect is available since Clutter 1.10
*/
#define CLUTTER_BRIGHTNESS_CONTRAST_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BRIGHTNESS_CONTRAST_EFFECT, ClutterBrightnessContrastEffectClass))
#define CLUTTER_IS_BRIGHTNESS_CONTRAST_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BRIGHTNESS_CONTRAST_EFFECT))
#define CLUTTER_BRIGHTNESS_CONTRAST_EFFECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BRIGHTNESS_CONTRAST_EFFECT, ClutterBrightnessContrastEffectClass))
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include <math.h>
#include "cogl/cogl.h"
#include "clutter-brightness-contrast-effect.h"
#include "clutter/clutter-brightness-contrast-effect.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-enum-types.h"
#include "clutter/clutter-offscreen-effect.h"
#include "clutter/clutter-private.h"
#include <cogl/cogl.h>
#include "clutter-debug.h"
#include "clutter-enum-types.h"
#include "clutter-offscreen-effect.h"
#include "clutter-private.h"
struct _ClutterBrightnessContrastEffect
{
@@ -144,6 +147,19 @@ clutter_brightness_contrast_effect_pre_paint (ClutterEffect *effect,
if (will_have_no_effect (self))
return FALSE;
if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
{
/* if we don't have support for GLSL shaders then we
* forcibly disable the ActorMeta
*/
g_warning ("Unable to use the ClutterBrightnessContrastEffect: the "
"graphics hardware or the current GL driver does not "
"implement support for the GLSL shading language. The "
"effect will be disabled.");
clutter_actor_meta_set_enabled (CLUTTER_ACTOR_META (effect), FALSE);
return FALSE;
}
parent_class =
CLUTTER_EFFECT_CLASS (clutter_brightness_contrast_effect_parent_class);
@@ -265,9 +281,13 @@ clutter_brightness_contrast_effect_class_init (ClutterBrightnessContrastEffectCl
* to indicate no change; values smaller than 127 indicate a decrease
* in brightness, and values larger than 127 indicate an increase in
* brightness.
*
* Since: 1.10
*/
obj_props[PROP_BRIGHTNESS] =
clutter_param_spec_color ("brightness", NULL, NULL,
clutter_param_spec_color ("brightness",
P_("Brightness"),
P_("The brightness change to apply"),
&no_brightness_change,
CLUTTER_PARAM_READWRITE);
@@ -281,9 +301,13 @@ clutter_brightness_contrast_effect_class_init (ClutterBrightnessContrastEffectCl
* to indicate no change; values smaller than 127 indicate a decrease
* in contrast, and values larger than 127 indicate an increase in
* contrast.
*
* Since: 1.10
*/
obj_props[PROP_CONTRAST] =
clutter_param_spec_color ("contrast", NULL, NULL,
clutter_param_spec_color ("contrast",
P_("Contrast"),
P_("The contrast change to apply"),
&no_contrast_change,
CLUTTER_PARAM_READWRITE);
@@ -409,6 +433,8 @@ clutter_brightness_contrast_effect_init (ClutterBrightnessContrastEffect *self)
* Return value: (transfer full): the newly created
* #ClutterBrightnessContrastEffect or %NULL. Use g_object_unref() when
* done.
*
* Since: 1.10
*/
ClutterEffect *
clutter_brightness_contrast_effect_new (void)
@@ -426,6 +452,8 @@ clutter_brightness_contrast_effect_new (void)
* The range for each component is [-1.0, 1.0] where 0.0 designates no change,
* values below 0.0 mean a decrease in brightness, and values above indicate
* an increase.
*
* Since: 1.10
*/
void
clutter_brightness_contrast_effect_set_brightness_full (ClutterBrightnessContrastEffect *effect,
@@ -462,6 +490,8 @@ clutter_brightness_contrast_effect_set_brightness_full (ClutterBrightnessContras
* change in brightness
*
* Retrieves the change in brightness used by @effect.
*
* Since: 1.10
*/
void
clutter_brightness_contrast_effect_get_brightness (ClutterBrightnessContrastEffect *effect,
@@ -489,6 +519,8 @@ clutter_brightness_contrast_effect_get_brightness (ClutterBrightnessContrastEffe
* The range of @brightness is [-1.0, 1.0], where 0.0 designates no change;
* a value below 0.0 indicates a decrease in brightness; and a value
* above 0.0 indicates an increase of brightness.
*
* Since: 1.10
*/
void
clutter_brightness_contrast_effect_set_brightness (ClutterBrightnessContrastEffect *effect,
@@ -510,6 +542,8 @@ clutter_brightness_contrast_effect_set_brightness (ClutterBrightnessContrastEffe
* The range for each component is [-1.0, 1.0] where 0.0 designates no change,
* values below 0.0 mean a decrease in contrast, and values above indicate
* an increase.
*
* Since: 1.10
*/
void
clutter_brightness_contrast_effect_set_contrast_full (ClutterBrightnessContrastEffect *effect,
@@ -546,6 +580,8 @@ clutter_brightness_contrast_effect_set_contrast_full (ClutterBrightnessContrastE
* change in contrast
*
* Retrieves the contrast value used by @effect.
*
* Since: 1.10
*/
void
clutter_brightness_contrast_effect_get_contrast (ClutterBrightnessContrastEffect *effect,
@@ -573,6 +609,8 @@ clutter_brightness_contrast_effect_get_contrast (ClutterBrightnessContrastEffect
* The range for @contrast is [-1.0, 1.0], where 0.0 designates no change;
* a value below 0.0 indicates a decrease in contrast; and a value above
* 0.0 indicates an increase.
*
* Since: 1.10
*/
void
clutter_brightness_contrast_effect_set_contrast (ClutterBrightnessContrastEffect *effect,

View File

@@ -22,14 +22,15 @@
* Joseph Scheuhammer <clown@alum.mit.edu>
*/
#pragma once
#ifndef __CLUTTER_BRIGHTNESS_CONTRAST_EFFECT_H__
#define __CLUTTER_BRIGHTNESS_CONTRAST_EFFECT_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-color.h"
#include "clutter/clutter-effect.h"
#include <clutter/clutter-color.h>
#include <clutter/clutter-effect.h>
G_BEGIN_DECLS
@@ -37,6 +38,14 @@ G_BEGIN_DECLS
#define CLUTTER_BRIGHTNESS_CONTRAST_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BRIGHTNESS_CONTRAST_EFFECT, ClutterBrightnessContrastEffect))
#define CLUTTER_IS_BRIGHTNESS_CONTRAST_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BRIGHTNESS_CONTRAST_EFFECT))
/**
* ClutterBrightnessContrastEffect:
*
* #ClutterBrightnessContrastEffect is an opaque structure
* whose members cannot be directly accessed
*
* Since: 1.10
*/
typedef struct _ClutterBrightnessContrastEffect ClutterBrightnessContrastEffect;
typedef struct _ClutterBrightnessContrastEffectClass ClutterBrightnessContrastEffectClass;
@@ -75,3 +84,5 @@ void clutter_brightness_contrast_effect_get_contrast
float *blue);
G_END_DECLS
#endif /* __CLUTTER_BRIGHTNESS_CONTRAST_EFFECT_H__ */

View File

@@ -1,6 +1,3 @@
/* The prefix for our gettext translation domains. */
#mesondefine GETTEXT_PACKAGE
/* Mutter version */
#mesondefine MUTTER_VERSION

View File

@@ -27,10 +27,10 @@
* Clutter provides some utility functions for using Cairo.
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-cairo.h"
#include "clutter/clutter-color.h"
#include "clutter-cairo.h"
#include "clutter-color.h"
/**
* clutter_cairo_set_source_color:
@@ -40,13 +40,15 @@
* Utility function for setting the source color of @cr using
* a #ClutterColor. This function is the equivalent of:
*
* ```c
* |[
* cairo_set_source_rgba (cr,
* color->red / 255.0,
* color->green / 255.0,
* color->blue / 255.0,
* color->alpha / 255.0);
* ```
* ]|
*
* Since: 1.0
*/
void
clutter_cairo_set_source_color (cairo_t *cr,
@@ -73,6 +75,8 @@ clutter_cairo_set_source_color (cairo_t *cr,
* @cr: a Cairo context
*
* Utility function to clear a Cairo context.
*
* Since: 1.12
*/
void
clutter_cairo_clear (cairo_t *cr)

View File

@@ -19,13 +19,14 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CLUTTER_CAIRO_H__
#define __CLUTTER_CAIRO_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-types.h"
#include <clutter/clutter-types.h>
G_BEGIN_DECLS
@@ -35,6 +36,8 @@ G_BEGIN_DECLS
* The #CoglPixelFormat to be used when uploading image data from
* and to a Cairo image surface using %CAIRO_FORMAT_ARGB32 and
* %CAIRO_FORMAT_RGB24 as #cairo_format_t.
*
* Since: 1.8
*/
/* Cairo stores the data in native byte order as ARGB but Cogl's pixel
@@ -54,3 +57,5 @@ void clutter_cairo_set_source_color (cairo_t *cr,
const ClutterColor *color);
G_END_DECLS
#endif /* __CLUTTER_CAIRO_H__ */

View File

@@ -23,9 +23,10 @@
*/
/**
* ClutterCanvas:
*
* Content for 2D painting
* SECTION:clutter-canvas
* @Title: ClutterCanvas
* @Short_Description: Content for 2D painting
* @See_Also: #ClutterContent
*
* The #ClutterCanvas class is a #ClutterContent implementation that allows
* drawing using the Cairo API on a 2D surface.
@@ -36,27 +37,30 @@
* signal when invalidated using clutter_content_invalidate().
*
* See [canvas.c](https://git.gnome.org/browse/clutter/tree/examples/canvas.c?h=clutter-1.18)
* for an example of how to use #ClutterCanvas..
* for an example of how to use #ClutterCanvas.
*
* #ClutterCanvas is available since Clutter 1.10.
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include <math.h>
#include <cogl/cogl.h>
#include <cairo-gobject.h>
#include "cogl/cogl.h"
#include "clutter/clutter-canvas.h"
#include "clutter/clutter-actor-private.h"
#include "clutter/clutter-backend.h"
#include "clutter/clutter-cairo.h"
#include "clutter/clutter-color.h"
#include "clutter/clutter-content-private.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-marshal.h"
#include "clutter/clutter-paint-node.h"
#include "clutter/clutter-paint-nodes.h"
#include "clutter/clutter-private.h"
#include "clutter/clutter-settings.h"
#include "clutter-canvas.h"
#include "clutter-actor-private.h"
#include "clutter-backend.h"
#include "clutter-cairo.h"
#include "clutter-color.h"
#include "clutter-content-private.h"
#include "clutter-debug.h"
#include "clutter-marshal.h"
#include "clutter-paint-node.h"
#include "clutter-paint-nodes.h"
#include "clutter-private.h"
#include "clutter-settings.h"
struct _ClutterCanvasPrivate
{
@@ -231,9 +235,13 @@ clutter_canvas_class_init (ClutterCanvasClass *klass)
* ClutterCanvas:width:
*
* The width of the canvas.
*
* Since: 1.10
*/
obj_props[PROP_WIDTH] =
g_param_spec_int ("width", NULL, NULL,
g_param_spec_int ("width",
P_("Width"),
P_("The width of the canvas"),
-1, G_MAXINT,
-1,
G_PARAM_READWRITE |
@@ -243,9 +251,13 @@ clutter_canvas_class_init (ClutterCanvasClass *klass)
* ClutterCanvas:height:
*
* The height of the canvas.
*
* Since: 1.10
*/
obj_props[PROP_HEIGHT] =
g_param_spec_int ("height", NULL, NULL,
g_param_spec_int ("height",
P_("Height"),
P_("The height of the canvas"),
-1, G_MAXINT,
-1,
G_PARAM_READWRITE |
@@ -257,7 +269,9 @@ clutter_canvas_class_init (ClutterCanvasClass *klass)
* The height of the canvas.
*/
obj_props[PROP_SCALE_FACTOR] =
g_param_spec_float ("scale-factor", NULL, NULL,
g_param_spec_float ("scale-factor",
P_("Scale Factor"),
P_("The Scale factor of the canvas"),
0.01f, G_MAXFLOAT,
1.0f,
G_PARAM_READWRITE |
@@ -279,6 +293,8 @@ clutter_canvas_class_init (ClutterCanvasClass *klass)
*
* Return value: %TRUE if the signal emission should stop, and
* %FALSE otherwise
*
* Since: 1.10
*/
canvas_signals[DRAW] =
g_signal_new (I_("draw"),
@@ -326,7 +342,9 @@ clutter_canvas_paint_content (ClutterContent *content,
g_clear_pointer (&priv->texture, cogl_object_unref);
if (priv->texture == NULL)
priv->texture = COGL_TEXTURE (cogl_texture_2d_new_from_bitmap (priv->buffer));
priv->texture = cogl_texture_new_from_bitmap (priv->buffer,
COGL_TEXTURE_NO_SLICING,
CLUTTER_CAIRO_FORMAT_ARGB32);
if (priv->texture == NULL)
return;
@@ -495,6 +513,8 @@ clutter_content_iface_init (ClutterContentInterface *iface)
*
* Return value: (transfer full): The newly allocated instance of
* #ClutterCanvas. Use g_object_unref() when done.
*
* Since: 1.10
*/
ClutterContent *
clutter_canvas_new (void)
@@ -557,13 +577,15 @@ clutter_canvas_invalidate_internal (ClutterCanvas *canvas,
* the size, you can use the return value of the function to conditionally
* call clutter_content_invalidate():
*
* ```c
* |[
* if (!clutter_canvas_set_size (canvas, width, height))
* clutter_content_invalidate (CLUTTER_CONTENT (canvas));
* ```
* ]|
*
* Return value: this function returns %TRUE if the size change
* caused a content invalidation, and %FALSE otherwise
*
* Since: 1.10
*/
gboolean
clutter_canvas_set_size (ClutterCanvas *canvas,

View File

@@ -22,13 +22,14 @@
* Emmanuele Bassi <ebassi@linux.intel.com>
*/
#pragma once
#ifndef __CLUTTER_CANVAS_H__
#define __CLUTTER_CANVAS_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-types.h"
#include <clutter/clutter-types.h>
G_BEGIN_DECLS
@@ -43,6 +44,15 @@ typedef struct _ClutterCanvas ClutterCanvas;
typedef struct _ClutterCanvasPrivate ClutterCanvasPrivate;
typedef struct _ClutterCanvasClass ClutterCanvasClass;
/**
* ClutterCanvas:
*
* The #ClutterCanvas structure contains
* private data and should only be accessed using the provided
* API.
*
* Since: 1.10
*/
struct _ClutterCanvas
{
/*< private >*/
@@ -57,6 +67,8 @@ struct _ClutterCanvas
*
* The #ClutterCanvasClass structure contains
* private data.
*
* Since: 1.10
*/
struct _ClutterCanvasClass
{
@@ -68,6 +80,9 @@ struct _ClutterCanvasClass
cairo_t *cr,
int width,
int height);
/*< private >*/
gpointer _padding[16];
};
CLUTTER_EXPORT
@@ -87,3 +102,5 @@ CLUTTER_EXPORT
float clutter_canvas_get_scale_factor (ClutterCanvas *canvas);
G_END_DECLS
#endif /* __CLUTTER_CANVAS_H__ */

View File

@@ -25,51 +25,24 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* ClutterChildMeta:
*
* Base interface for container specific state for child actors.
*
* A child data is meant to be used when you need to keep track
* of information about each individual child added to a container.
* SECTION:clutter-child-meta
* @short_description: Wrapper for actors inside a container
*
* In order to use it you should create your own subclass of
* #ClutterChildMeta and set the #ClutterContainerIface child_meta_type
* interface member to your subclass type, like:
* #ClutterChildMeta is a wrapper object created by #ClutterContainer
* implementations in order to store child-specific data and properties.
*
* ```c
* static void
* my_container_iface_init (ClutterContainerIface *iface)
* {
* // set the rest of the #ClutterContainer vtable
* A #ClutterChildMeta wraps a #ClutterActor inside a #ClutterContainer.
*
* container_iface->child_meta_type = MY_TYPE_CHILD_META;
* }
* ```
*
* This will automatically create a #ClutterChildMeta of type
* `MY_TYPE_CHILD_META` for every actor that is added to the container.
*
* The child data for an actor can be retrieved using the
* clutter_container_get_child_meta() function.
*
* The properties of the data and your subclass can be manipulated with
* clutter_container_child_set() and clutter_container_child_get() which
* act like g_object_set() and g_object_get().
*
* You can provide hooks for your own storage as well as control the
* instantiation by overriding the #ClutterContainerIface virtual functions
* #ClutterContainerIface.create_child_meta(), #ClutterContainerIface.destroy_child_meta(),
* and #ClutterContainerIface.get_child_meta().
* #ClutterChildMeta is available since Clutter 0.8
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-child-meta.h"
#include "clutter/clutter-container.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-private.h"
#include "clutter-child-meta.h"
#include "clutter-container.h"
#include "clutter-debug.h"
#include "clutter-private.h"
G_DEFINE_ABSTRACT_TYPE (ClutterChildMeta, clutter_child_meta, G_TYPE_OBJECT);
@@ -145,9 +118,13 @@ clutter_child_meta_class_init (ClutterChildMetaClass *klass)
* ClutterChildMeta:container:
*
* The #ClutterContainer that created this #ClutterChildMeta.
*
* Since: 0.8
*/
obj_props[PROP_CONTAINER] =
g_param_spec_object ("container", NULL, NULL,
g_param_spec_object ("container",
P_("Container"),
P_("The container that created this data"),
CLUTTER_TYPE_CONTAINER,
G_PARAM_CONSTRUCT_ONLY |
CLUTTER_PARAM_READWRITE);
@@ -156,9 +133,13 @@ clutter_child_meta_class_init (ClutterChildMetaClass *klass)
* ClutterChildMeta:actor:
*
* The #ClutterActor being wrapped by this #ClutterChildMeta
*
* Since: 0.8
*/
obj_props[PROP_ACTOR] =
g_param_spec_object ("actor", NULL, NULL,
g_param_spec_object ("actor",
P_("Actor"),
P_("The actor wrapped by this data"),
CLUTTER_TYPE_ACTOR,
G_PARAM_CONSTRUCT_ONLY |
CLUTTER_PARAM_READWRITE);
@@ -180,6 +161,8 @@ clutter_child_meta_init (ClutterChildMeta *self)
* Retrieves the container using @data
*
* Return value: (transfer none): a #ClutterContainer
*
* Since: 0.8
*/
ClutterContainer *
clutter_child_meta_get_container (ClutterChildMeta *data)
@@ -196,6 +179,8 @@ clutter_child_meta_get_container (ClutterChildMeta *data)
* Retrieves the actor wrapped by @data
*
* Return value: (transfer none): a #ClutterActor
*
* Since: 0.8
*/
ClutterActor *
clutter_child_meta_get_actor (ClutterChildMeta *data)

View File

@@ -25,15 +25,15 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CLUTTER_CHILD_META_H__
#define __CLUTTER_CHILD_META_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include <glib-object.h>
#include "clutter/clutter-types.h"
#include <clutter/clutter-types.h>
G_BEGIN_DECLS
@@ -46,6 +46,46 @@ G_BEGIN_DECLS
typedef struct _ClutterChildMetaClass ClutterChildMetaClass;
/**
* ClutterChildMeta:
* @container: the container handling this data
* @actor: the actor wrapped by this data
*
* Base interface for container specific state for child actors. A child
* data is meant to be used when you need to keep track of information
* about each individual child added to a container.
*
* In order to use it you should create your own subclass of
* #ClutterChildMeta and set the #ClutterContainerIface child_meta_type
* interface member to your subclass type, like:
*
* |[
* static void
* my_container_iface_init (ClutterContainerIface *iface)
* {
* // set the rest of the #ClutterContainer vtable
*
* container_iface->child_meta_type = MY_TYPE_CHILD_META;
* }
* ]|
*
* This will automatically create a #ClutterChildMeta of type
* `MY_TYPE_CHILD_META` for every actor that is added to the container.
*
* The child data for an actor can be retrieved using the
* clutter_container_get_child_meta() function.
*
* The properties of the data and your subclass can be manipulated with
* clutter_container_child_set() and clutter_container_child_get() which
* act like g_object_set() and g_object_get().
*
* You can provide hooks for your own storage as well as control the
* instantiation by overriding the #ClutterContainerIface virtual functions
* #ClutterContainerIface.create_child_meta(), #ClutterContainerIface.destroy_child_meta(),
* and #ClutterContainerIface.get_child_meta().
*
* Since: 0.8
*/
struct _ClutterChildMeta
{
/*< private >*/
@@ -60,6 +100,8 @@ struct _ClutterChildMeta
* ClutterChildMetaClass:
*
* The #ClutterChildMetaClass contains only private data
*
* Since: 0.8
*/
struct _ClutterChildMetaClass
{
@@ -76,3 +118,5 @@ CLUTTER_EXPORT
ClutterActor * clutter_child_meta_get_actor (ClutterChildMeta *data);
G_END_DECLS
#endif /* __CLUTTER_CHILD_META_H__ */

View File

@@ -23,39 +23,39 @@
*/
/**
* ClutterClickAction:
*
* Action for clickable actors
* SECTION:clutter-click-action
* @Title: ClutterClickAction
* @Short_Description: Action for clickable actors
*
* #ClutterClickAction is a sub-class of [class@Action] that implements
* #ClutterClickAction is a sub-class of #ClutterAction that implements
* the logic for clickable actors, by using the low level events of
* [class@Actor], such as [signal@Actor::button-press-event] and
* [signal@Actor::button-release-event], to synthesize the high level
* [signal@ClickAction::clicked] signal.
* #ClutterActor, such as #ClutterActor::button-press-event and
* #ClutterActor::button-release-event, to synthesize the high level
* #ClutterClickAction::clicked signal.
*
* To use #ClutterClickAction you just need to apply it to a [class@Actor]
* using [method@Actor.add_action] and connect to the
* [signal@ClickAction::clicked] signal:
* To use #ClutterClickAction you just need to apply it to a #ClutterActor
* using clutter_actor_add_action() and connect to the
* #ClutterClickAction::clicked signal:
*
* ```c
* |[
* ClutterAction *action = clutter_click_action_new ();
*
* clutter_actor_add_action (actor, action);
*
* g_signal_connect (action, "clicked", G_CALLBACK (on_clicked), NULL);
* ```
* ]|
*
* #ClutterClickAction also supports long press gestures: a long press is
* activated if the pointer remains pressed within a certain threshold (as
* defined by the [property@ClickAction:long-press-threshold] property) for a
* defined by the #ClutterClickAction:long-press-threshold property) for a
* minimum amount of time (as the defined by the
* [property@ClickAction:long-press-duration] property).
* The [signal@ClickAction::long-press] signal is emitted multiple times,
* using different [enum@LongPressState] values; to handle long presses
* you should connect to the [signal@ClickAction::long-press] signal and
* #ClutterClickAction:long-press-duration property).
* The #ClutterClickAction::long-press signal is emitted multiple times,
* using different #ClutterLongPressState values; to handle long presses
* you should connect to the #ClutterClickAction::long-press signal and
* handle the different states:
*
* ```c
* |[
* static gboolean
* on_long_press (ClutterClickAction *action,
* ClutterActor *actor,
@@ -64,42 +64,49 @@
* switch (state)
* {
* case CLUTTER_LONG_PRESS_QUERY:
* // return TRUE if the actor should support long press
* // gestures, and FALSE otherwise; this state will be
* // emitted on button presses
* /&ast; return TRUE if the actor should support long press
* &ast; gestures, and FALSE otherwise; this state will be
* &ast; emitted on button presses
* &ast;/
* return TRUE;
*
* case CLUTTER_LONG_PRESS_ACTIVATE:
* // this state is emitted if the minimum duration has
* // been reached without the gesture being cancelled.
* // the return value is not used
* /&ast; this state is emitted if the minimum duration has
* &ast; been reached without the gesture being cancelled.
* &ast; the return value is not used
* &ast;/
* return TRUE;
*
* case CLUTTER_LONG_PRESS_CANCEL:
* // this state is emitted if the long press was cancelled;
* // for instance, the pointer went outside the actor or the
* // allowed threshold, or the button was released before
* // the minimum duration was reached. the return value is
* // not used
* /&ast; this state is emitted if the long press was cancelled;
* &ast; for instance, the pointer went outside the actor or the
* &ast; allowed threshold, or the button was released before
* &ast; the minimum duration was reached. the return value is
* &ast; not used
* &ast;/
* return FALSE;
* }
* }
* ```
* ]|
*
* #ClutterClickAction is available since Clutter 1.4
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-click-action.h"
#include "clutter-click-action.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-enum-types.h"
#include "clutter/clutter-marshal.h"
#include "clutter/clutter-private.h"
#include "clutter-debug.h"
#include "clutter-enum-types.h"
#include "clutter-marshal.h"
#include "clutter-private.h"
struct _ClutterClickActionPrivate
{
ClutterActor *stage;
gulong event_id;
gulong capture_id;
guint long_press_id;
gint long_press_threshold;
@@ -143,6 +150,11 @@ static guint click_signals[LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE_WITH_PRIVATE (ClutterClickAction, clutter_click_action, CLUTTER_TYPE_ACTION)
/* forward declaration */
static gboolean on_captured_event (ClutterActor *stage,
ClutterEvent *event,
ClutterClickAction *action);
static inline void
click_action_set_pressed (ClutterClickAction *action,
gboolean is_pressed)
@@ -193,6 +205,8 @@ click_action_emit_long_press (gpointer data)
CLUTTER_LONG_PRESS_ACTIVATE,
&result);
g_clear_signal_handler (&priv->capture_id, priv->stage);
click_action_set_pressed (action, FALSE);
click_action_set_held (action, FALSE);
@@ -260,7 +274,7 @@ click_action_cancel_long_press (ClutterClickAction *action)
static inline gboolean
event_within_drag_threshold (ClutterClickAction *click_action,
const ClutterEvent *event)
ClutterEvent *event)
{
ClutterClickActionPrivate *priv =
clutter_click_action_get_instance_private (click_action);
@@ -276,44 +290,29 @@ event_within_drag_threshold (ClutterClickAction *click_action,
}
static gboolean
clutter_click_action_handle_event (ClutterAction *action,
const ClutterEvent *event)
on_event (ClutterActor *actor,
ClutterEvent *event,
ClutterClickAction *action)
{
ClutterClickAction *click_action = CLUTTER_CLICK_ACTION (action);
ClutterClickActionPrivate *priv =
clutter_click_action_get_instance_private (click_action);
ClutterActor *actor =
clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action));
clutter_click_action_get_instance_private (action);
gboolean has_button = TRUE;
ClutterModifierType modifier_state;
ClutterActor *target;
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (action)))
return CLUTTER_EVENT_PROPAGATE;
if (priv->press_sequence != NULL &&
clutter_event_get_event_sequence (event) != priv->press_sequence)
{
click_action_set_held (click_action, FALSE);
click_action_cancel_long_press (click_action);
return CLUTTER_EVENT_PROPAGATE;
}
switch (clutter_event_type (event))
{
case CLUTTER_TOUCH_BEGIN:
has_button = FALSE;
G_GNUC_FALLTHROUGH;
case CLUTTER_BUTTON_PRESS:
if (has_button && clutter_event_get_click_count (event) != 1)
return CLUTTER_EVENT_PROPAGATE;
if (priv->is_held)
return CLUTTER_EVENT_STOP;
target = clutter_stage_get_device_actor (CLUTTER_STAGE (clutter_actor_get_stage (actor)),
clutter_event_get_device (event),
clutter_event_get_event_sequence (event));
if (!clutter_actor_contains (actor, target))
if (!clutter_actor_contains (actor, clutter_event_get_source (event)))
return CLUTTER_EVENT_PROPAGATE;
priv->press_button = has_button ? clutter_event_get_button (event) : 0;
@@ -336,47 +335,71 @@ clutter_click_action_handle_event (ClutterAction *action,
if (priv->stage == NULL)
priv->stage = clutter_actor_get_stage (actor);
click_action_set_pressed (click_action, TRUE);
click_action_set_held (click_action, TRUE);
click_action_query_long_press (click_action);
priv->capture_id = g_signal_connect_after (priv->stage, "captured-event",
G_CALLBACK (on_captured_event),
action);
click_action_set_pressed (action, TRUE);
click_action_set_held (action, TRUE);
click_action_query_long_press (action);
break;
case CLUTTER_ENTER:
click_action_set_pressed (click_action, priv->is_held);
return CLUTTER_EVENT_PROPAGATE;
click_action_set_pressed (action, priv->is_held);
break;
case CLUTTER_LEAVE:
click_action_set_pressed (click_action, FALSE);
click_action_cancel_long_press (click_action);
return CLUTTER_EVENT_PROPAGATE;
click_action_set_pressed (action, priv->is_held);
click_action_cancel_long_press (action);
break;
default:
break;
}
return CLUTTER_EVENT_PROPAGATE;
}
static gboolean
on_captured_event (ClutterActor *stage,
ClutterEvent *event,
ClutterClickAction *action)
{
ClutterClickActionPrivate *priv =
clutter_click_action_get_instance_private (action);
ClutterActor *actor;
ClutterModifierType modifier_state;
gboolean has_button = TRUE;
actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action));
switch (clutter_event_type (event))
{
case CLUTTER_TOUCH_CANCEL:
clutter_click_action_release (click_action);
clutter_click_action_release (action);
break;
case CLUTTER_TOUCH_END:
has_button = FALSE;
G_GNUC_FALLTHROUGH;
case CLUTTER_BUTTON_RELEASE:
if (!priv->is_held)
return CLUTTER_EVENT_PROPAGATE;
return CLUTTER_EVENT_STOP;
if ((has_button && clutter_event_get_button (event) != priv->press_button) ||
(has_button && clutter_event_get_click_count (event) != 1) ||
clutter_event_get_device (event) != priv->press_device ||
clutter_event_get_event_sequence (event) != priv->press_sequence)
return CLUTTER_EVENT_PROPAGATE;
click_action_set_held (click_action, FALSE);
click_action_cancel_long_press (click_action);
click_action_set_held (action, FALSE);
click_action_cancel_long_press (action);
/* disconnect the capture */
g_clear_signal_handler (&priv->capture_id, priv->stage);
g_clear_handle_id (&priv->long_press_id, g_source_remove);
target = clutter_stage_get_device_actor (CLUTTER_STAGE (clutter_actor_get_stage (actor)),
clutter_event_get_device (event),
clutter_event_get_event_sequence (event));
if (!clutter_actor_contains (actor, target))
if (!clutter_actor_contains (actor, clutter_event_get_source (event)))
return CLUTTER_EVENT_PROPAGATE;
/* exclude any button-mask so that we can compare
@@ -395,10 +418,10 @@ clutter_click_action_handle_event (ClutterAction *action,
if (modifier_state != priv->modifier_state)
priv->modifier_state = 0;
click_action_set_pressed (click_action, FALSE);
click_action_set_pressed (action, FALSE);
if (event_within_drag_threshold (click_action, event))
g_signal_emit (click_action, click_signals[CLICKED], 0, actor);
if (event_within_drag_threshold (action, event))
g_signal_emit (action, click_signals[CLICKED], 0, actor);
break;
case CLUTTER_MOTION:
@@ -411,8 +434,8 @@ clutter_click_action_handle_event (ClutterAction *action,
if (!priv->is_held)
return CLUTTER_EVENT_PROPAGATE;
if (!event_within_drag_threshold (click_action, event))
clutter_click_action_release (click_action);
if (!event_within_drag_threshold (action, event))
clutter_click_action_release (action);
}
break;
@@ -420,20 +443,7 @@ clutter_click_action_handle_event (ClutterAction *action,
break;
}
return priv->is_held ? CLUTTER_EVENT_STOP : CLUTTER_EVENT_PROPAGATE;
}
static void
clutter_click_action_sequence_cancelled (ClutterAction *action,
ClutterInputDevice *device,
ClutterEventSequence *sequence)
{
ClutterClickAction *self = CLUTTER_CLICK_ACTION (action);
ClutterClickActionPrivate *priv =
clutter_click_action_get_instance_private (self);
if (priv->press_device == device && priv->press_sequence == sequence)
clutter_click_action_release (self);
return CLUTTER_EVENT_STOP;
}
static void
@@ -444,11 +454,35 @@ clutter_click_action_set_actor (ClutterActorMeta *meta,
ClutterClickActionPrivate *priv =
clutter_click_action_get_instance_private (action);
if (priv->event_id != 0)
{
ClutterActor *old_actor = clutter_actor_meta_get_actor (meta);
if (old_actor != NULL)
g_clear_signal_handler (&priv->event_id, old_actor);
priv->event_id = 0;
}
if (priv->capture_id != 0)
{
if (priv->stage != NULL)
g_clear_signal_handler (&priv->capture_id, priv->stage);
priv->capture_id = 0;
priv->stage = NULL;
}
g_clear_handle_id (&priv->long_press_id, g_source_remove);
click_action_set_pressed (action, FALSE);
click_action_set_held (action, FALSE);
if (actor != NULL)
priv->event_id = g_signal_connect (actor, "event",
G_CALLBACK (on_event),
action);
CLUTTER_ACTOR_META_CLASS (clutter_click_action_parent_class)->set_actor (meta, actor);
}
@@ -530,20 +564,22 @@ clutter_click_action_dispose (GObject *gobject)
ClutterClickActionPrivate *priv =
clutter_click_action_get_instance_private (CLUTTER_CLICK_ACTION (gobject));
g_clear_signal_handler (&priv->event_id,
clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (gobject)));
g_clear_signal_handler (&priv->capture_id, priv->stage);
g_clear_handle_id (&priv->long_press_id, g_source_remove);
G_OBJECT_CLASS (clutter_click_action_parent_class)->dispose (gobject);
}
static void
clutter_click_action_class_init (ClutterClickActionClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
ClutterActorMetaClass *meta_class = CLUTTER_ACTOR_META_CLASS (klass);
ClutterActionClass *action_class = CLUTTER_ACTION_CLASS (klass);
action_class->handle_event = clutter_click_action_handle_event;
action_class->sequence_cancelled = clutter_click_action_sequence_cancelled;
meta_class->set_actor = clutter_click_action_set_actor;
meta_class->set_enabled = clutter_click_action_set_enabled;
@@ -556,9 +592,13 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
* ClutterClickAction:pressed:
*
* Whether the clickable actor should be in "pressed" state
*
* Since: 1.4
*/
obj_props[PROP_PRESSED] =
g_param_spec_boolean ("pressed", NULL, NULL,
g_param_spec_boolean ("pressed",
P_("Pressed"),
P_("Whether the clickable should be in pressed state"),
FALSE,
CLUTTER_PARAM_READABLE);
@@ -566,9 +606,13 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
* ClutterClickAction:held:
*
* Whether the clickable actor has the pointer grabbed
*
* Since: 1.4
*/
obj_props[PROP_HELD] =
g_param_spec_boolean ("held", NULL, NULL,
g_param_spec_boolean ("held",
P_("Held"),
P_("Whether the clickable has a grab"),
FALSE,
CLUTTER_PARAM_READABLE);
@@ -579,10 +623,14 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
* press gesture, in milliseconds.
*
* A value of -1 will make the #ClutterClickAction use the value of
* the [property@Settings:long-press-duration] property.
* the #ClutterSettings:long-press-duration property.
*
* Since: 1.8
*/
obj_props[PROP_LONG_PRESS_DURATION] =
g_param_spec_int ("long-press-duration", NULL, NULL,
g_param_spec_int ("long-press-duration",
P_("Long Press Duration"),
P_("The minimum duration of a long press to recognize the gesture"),
-1, G_MAXINT,
-1,
CLUTTER_PARAM_READWRITE);
@@ -594,10 +642,14 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
* a long press gesture is cancelled, in pixels.
*
* A value of -1 will make the #ClutterClickAction use the value of
* the [property@Settings:dnd-drag-threshold] property.
* the #ClutterSettings:dnd-drag-threshold property.
*
* Since: 1.8
*/
obj_props[PROP_LONG_PRESS_THRESHOLD] =
g_param_spec_int ("long-press-threshold", NULL, NULL,
g_param_spec_int ("long-press-threshold",
P_("Long Press Threshold"),
P_("The maximum threshold before a long press is cancelled"),
-1, G_MAXINT,
-1,
CLUTTER_PARAM_READWRITE);
@@ -611,9 +663,11 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
* @action: the #ClutterClickAction that emitted the signal
* @actor: the #ClutterActor attached to the @action
*
* The signal is emitted when the [class@Actor] to which
* The ::clicked signal is emitted when the #ClutterActor to which
* a #ClutterClickAction has been applied should respond to a
* pointer button press and release events
*
* Since: 1.4
*/
click_signals[CLICKED] =
g_signal_new (I_("clicked"),
@@ -630,7 +684,7 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
* @actor: the #ClutterActor attached to the @action
* @state: the long press state
*
* The signal is emitted during the long press gesture
* The ::long-press signal is emitted during the long press gesture
* handling.
*
* This signal can be emitted multiple times with different states.
@@ -644,10 +698,12 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
* %CLUTTER_LONG_PRESS_CANCEL state if the long press was cancelled.
*
* It is possible to forcibly cancel a long press detection using
* [method@ClickAction.release].
* clutter_click_action_release().
*
* Return value: Only the %CLUTTER_LONG_PRESS_QUERY state uses the
* returned value of the handler; other states will ignore it
*
* Since: 1.8
*/
click_signals[LONG_PRESS] =
g_signal_new (I_("long-press"),
@@ -677,6 +733,8 @@ clutter_click_action_init (ClutterClickAction *self)
* Creates a new #ClutterClickAction instance
*
* Return value: the newly created #ClutterClickAction
*
* Since: 1.4
*/
ClutterAction *
clutter_click_action_new (void)
@@ -689,13 +747,15 @@ clutter_click_action_new (void)
* @action: a #ClutterClickAction
*
* Emulates a release of the pointer button, which ungrabs the pointer
* and unsets the [property@ClickAction:pressed] state.
* and unsets the #ClutterClickAction:pressed state.
*
* This function will also cancel the long press gesture if one was
* initiated.
*
* This function is useful to break a grab, for instance after a certain
* amount of time has passed.
*
* Since: 1.4
*/
void
clutter_click_action_release (ClutterClickAction *action)
@@ -709,6 +769,9 @@ clutter_click_action_release (ClutterClickAction *action)
if (!priv->is_held)
return;
/* disconnect the capture */
g_clear_signal_handler (&priv->capture_id, priv->stage);
click_action_cancel_long_press (action);
click_action_set_held (action, FALSE);
click_action_set_pressed (action, FALSE);
@@ -721,6 +784,8 @@ clutter_click_action_release (ClutterClickAction *action)
* Retrieves the button that was pressed.
*
* Return value: the button value
*
* Since: 1.4
*/
guint
clutter_click_action_get_button (ClutterClickAction *action)
@@ -741,6 +806,8 @@ clutter_click_action_get_button (ClutterClickAction *action)
* Retrieves the modifier state of the click action.
*
* Return value: the modifier state parameter, or 0
*
* Since: 1.6
*/
ClutterModifierType
clutter_click_action_get_state (ClutterClickAction *action)
@@ -761,6 +828,8 @@ clutter_click_action_get_state (ClutterClickAction *action)
* @press_y: (out): return location for the Y coordinate, or %NULL
*
* Retrieves the screen coordinates of the button press.
*
* Since: 1.8
*/
void
clutter_click_action_get_coords (ClutterClickAction *action,

View File

@@ -25,14 +25,15 @@
* Colin Walters <walters@verbum.org>
*/
#pragma once
#ifndef __CLUTTER_CLICK_ACTION_H__
#define __CLUTTER_CLICK_ACTION_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-action.h"
#include "clutter/clutter-event.h"
#include <clutter/clutter-action.h>
#include <clutter/clutter-event.h>
G_BEGIN_DECLS
@@ -51,6 +52,8 @@ typedef struct _ClutterClickActionPrivate ClutterClickActionPrivate;
*
* The #ClutterClickActionClass structure
* contains only private data
*
* Since: 1.4
*/
struct _ClutterClickActionClass
{
@@ -64,6 +67,15 @@ struct _ClutterClickActionClass
gboolean (* long_press) (ClutterClickAction *action,
ClutterActor *actor,
ClutterLongPressState state);
/*< private >*/
void (* _clutter_click_action1) (void);
void (* _clutter_click_action2) (void);
void (* _clutter_click_action3) (void);
void (* _clutter_click_action4) (void);
void (* _clutter_click_action5) (void);
void (* _clutter_click_action6) (void);
void (* _clutter_click_action7) (void);
};
CLUTTER_EXPORT
@@ -82,3 +94,5 @@ CLUTTER_EXPORT
void clutter_click_action_release (ClutterClickAction *action);
G_END_DECLS
#endif /* __CLUTTER_CLICK_ACTION_H__ */

View File

@@ -22,9 +22,8 @@
*/
/**
* ClutterClone:
*
* An actor that displays a clone of a source actor
* SECTION:clutter-clone
* @short_description: An actor that displays a clone of a source actor
*
* #ClutterClone is a #ClutterActor which draws with the paint
* function of another actor, scaled to fit its own allocation.
@@ -34,16 +33,18 @@
* Unlike clutter_texture_new_from_actor(), #ClutterClone does not require
* the presence of support for FBOs in the underlying GL or GLES
* implementation.
*
* #ClutterClone is available since Clutter 1.0
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-actor-private.h"
#include "clutter/clutter-clone.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-main.h"
#include "clutter/clutter-paint-volume-private.h"
#include "clutter/clutter-private.h"
#include "clutter-actor-private.h"
#include "clutter-clone.h"
#include "clutter-debug.h"
#include "clutter-main.h"
#include "clutter-paint-volume-private.h"
#include "clutter-private.h"
#include "cogl/cogl.h"
@@ -353,9 +354,13 @@ clutter_clone_class_init (ClutterCloneClass *klass)
* ClutterClone:source:
*
* This property specifies the source actor being cloned.
*
* Since: 1.0
*/
obj_props[PROP_SOURCE] =
g_param_spec_object ("source", NULL, NULL,
g_param_spec_object ("source",
P_("Source"),
P_("Specifies the actor to be cloned"),
CLUTTER_TYPE_ACTOR,
G_PARAM_CONSTRUCT |
CLUTTER_PARAM_READWRITE);
@@ -379,6 +384,8 @@ clutter_clone_init (ClutterClone *self)
* Creates a new #ClutterActor which clones @source/
*
* Return value: the newly created #ClutterClone
*
* Since: 1.0
*/
ClutterActor *
clutter_clone_new (ClutterActor *source)
@@ -429,6 +436,8 @@ clutter_clone_set_source_internal (ClutterClone *self,
* @source: (allow-none): a #ClutterActor, or %NULL
*
* Sets @source as the source actor to be cloned by @self.
*
* Since: 1.0
*/
void
clutter_clone_set_source (ClutterClone *self,
@@ -448,6 +457,8 @@ clutter_clone_set_source (ClutterClone *self,
* Retrieves the source #ClutterActor being cloned by @self.
*
* Return value: (transfer none): the actor source for the clone
*
* Since: 1.0
*/
ClutterActor *
clutter_clone_get_source (ClutterClone *self)

View File

@@ -21,13 +21,14 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CLUTTER_CLONE_H__
#define __CLUTTER_CLONE_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-actor.h"
#include <clutter/clutter-actor.h>
G_BEGIN_DECLS
@@ -42,6 +43,14 @@ typedef struct _ClutterClone ClutterClone;
typedef struct _ClutterCloneClass ClutterCloneClass;
typedef struct _ClutterClonePrivate ClutterClonePrivate;
/**
* ClutterClone:
*
* The #ClutterClone structure contains only private data
* and should be accessed using the provided API
*
* Since: 1.0
*/
struct _ClutterClone
{
/*< private >*/
@@ -54,11 +63,19 @@ struct _ClutterClone
* ClutterCloneClass:
*
* The #ClutterCloneClass structure contains only private data
*
* Since: 1.0
*/
struct _ClutterCloneClass
{
/*< private >*/
ClutterActorClass parent_class;
/* padding for future expansion */
void (*_clutter_actor_clone1) (void);
void (*_clutter_actor_clone2) (void);
void (*_clutter_actor_clone3) (void);
void (*_clutter_actor_clone4) (void);
};
CLUTTER_EXPORT
@@ -73,3 +90,5 @@ CLUTTER_EXPORT
ClutterActor * clutter_clone_get_source (ClutterClone *self);
G_END_DECLS
#endif /* __CLUTTER_CLONE_H__ */

View File

@@ -1,180 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2022 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author:
* Naveen Kumar <naveen1.kumar@intel.com>
*/
/**
* ClutterColorState:
*
* Color state of each ClutterActor
*
* The #ClutterColorState class contains the colorspace of each color
* states (e.g. sRGB colorspace).
*
* Each [class@Actor] would own such an object.
*
* A single #ClutterColorState object can be shared by multiple [class@Actor]
* or maybe a separate color state for each [class@Actor] (depending on whether
* #ClutterColorState would be statefull or stateless).
*
* #ClutterColorState, if not set during construction, it will default to sRGB
* color state
*
* The #ClutterColorState would have API to get the colorspace, whether the
* actor content is in pq or not, and things like that
*/
#include "clutter/clutter-build-config.h"
#include "clutter/clutter-color-state.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-enum-types.h"
#include "clutter/clutter-private.h"
enum
{
PROP_0,
PROP_COLORSPACE,
N_PROPS
};
static GParamSpec *obj_props[N_PROPS];
typedef struct _ClutterColorStatePrivate ClutterColorStatePrivate;
struct _ClutterColorState
{
GObject parent_instance;
};
struct _ClutterColorStatePrivate
{
ClutterColorspace colorspace;
};
G_DEFINE_TYPE_WITH_PRIVATE (ClutterColorState,
clutter_color_state,
G_TYPE_OBJECT)
ClutterColorspace
clutter_color_state_get_colorspace (ClutterColorState *color_state)
{
ClutterColorStatePrivate *priv;
g_return_val_if_fail (CLUTTER_IS_COLOR_STATE (color_state),
CLUTTER_COLORSPACE_UNKNOWN);
priv = clutter_color_state_get_instance_private (color_state);
return priv->colorspace;
}
static void
clutter_color_state_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
ClutterColorState *color_state = CLUTTER_COLOR_STATE (object);
ClutterColorStatePrivate *priv;
priv = clutter_color_state_get_instance_private (color_state);
switch (prop_id)
{
case PROP_COLORSPACE:
priv->colorspace = g_value_get_enum (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
clutter_color_state_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ClutterColorState *color_state = CLUTTER_COLOR_STATE (object);
switch (prop_id)
{
case PROP_COLORSPACE:
g_value_set_enum (value,
clutter_color_state_get_colorspace (color_state));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
clutter_color_state_class_init (ClutterColorStateClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->set_property = clutter_color_state_set_property;
gobject_class->get_property = clutter_color_state_get_property;
/**
* ClutterColorState:colorspace:
*
* Colorspace information of the each color state,
* defaults to sRGB colorspace
*/
obj_props[PROP_COLORSPACE] =
g_param_spec_enum ("colorspace", NULL, NULL,
CLUTTER_TYPE_COLORSPACE,
CLUTTER_COLORSPACE_SRGB,
CLUTTER_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_properties (gobject_class, N_PROPS, obj_props);
}
static void
clutter_color_state_init (ClutterColorState *color_state)
{
}
/**
* clutter_color_state_new:
*
* Create a new ClutterColorState object.
*
* Return value: A new ClutterColorState object.
**/
ClutterColorState*
clutter_color_state_new (ClutterColorspace colorspace)
{
return g_object_new (CLUTTER_TYPE_COLOR_STATE,
"colorspace", colorspace,
NULL);
}

View File

@@ -19,7 +19,8 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CLUTTER_COLOR_STATIC_H__
#define __CLUTTER_COLOR_STATIC_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
@@ -74,3 +75,5 @@
#define CLUTTER_COLOR_Aluminium6 (__CLUTTER_COLOR_SYM (ALUMINIUM_6))
#define CLUTTER_COLOR_Transparent (__CLUTTER_COLOR_SYM (TRANSPARENT))
#endif /* __CLUTTER_COLOR_STATIC_H__ */

View File

@@ -21,17 +21,29 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "clutter/clutter-build-config.h"
/**
* SECTION:clutter-color
* @short_description: Color management and manipulation.
*
* #ClutterColor is a simple type for representing colors in Clutter.
*
* A #ClutterColor is expressed as a 4-tuple of values ranging from
* zero to 255, one for each color channel plus one for the alpha.
*
* The alpha channel is fully opaque at 255 and fully transparent at 0.
*/
#include "clutter-build-config.h"
#include <math.h>
#include <pango/pango-attributes.h>
#include "clutter/clutter-interval.h"
#include "clutter/clutter-main.h"
#include "clutter/clutter-color.h"
#include "clutter/clutter-private.h"
#include "clutter/clutter-debug.h"
#include "clutter-interval.h"
#include "clutter-main.h"
#include "clutter-color.h"
#include "clutter-private.h"
#include "clutter-debug.h"
/* XXX - keep in sync with the ClutterStaticColor enumeration order */
static const ClutterColor static_colors[] = {
@@ -98,6 +110,8 @@ static const ClutterColor static_colors[] = {
*
* Return value: a pointer to a static color; the returned pointer
* is owned by Clutter and it should never be modified or freed
*
* Since: 1.6
*/
const ClutterColor *
clutter_color_get_static (ClutterStaticColor color)
@@ -635,6 +649,8 @@ parse_hsla (ClutterColor *color,
* be fully opaque.
*
* Return value: %TRUE if parsing succeeded, and %FALSE otherwise
*
* Since: 1.0
*/
gboolean
clutter_color_from_string (ClutterColor *color,
@@ -767,6 +783,8 @@ clutter_color_from_string (ClutterColor *color,
* respectively.
*
* Return value: (transfer full): a newly-allocated text string
*
* Since: 0.2
*/
gchar *
clutter_color_to_string (const ClutterColor *color)
@@ -785,12 +803,14 @@ clutter_color_to_string (const ClutterColor *color)
* @v1: (type Clutter.Color): a #ClutterColor
* @v2: (type Clutter.Color): a #ClutterColor
*
* Compares two `ClutterColor`s and checks if they are the same.
* Compares two #ClutterColor<!-- -->s and checks if they are the same.
*
* This function can be passed to g_hash_table_new() as the @key_equal_func
* parameter, when using `ClutterColor`s as keys in a #GHashTable.
* parameter, when using #ClutterColor<!-- -->s as keys in a #GHashTable.
*
* Return value: %TRUE if the two colors are the same.
*
* Since: 0.2
*/
gboolean
clutter_color_equal (gconstpointer v1,
@@ -820,9 +840,11 @@ clutter_color_equal (gconstpointer v1,
* Converts a #ClutterColor to a hash value.
*
* This function can be passed to g_hash_table_new() as the @hash_func
* parameter, when using `ClutterColor`s as keys in a #GHashTable.
* parameter, when using #ClutterColor<!-- -->s as keys in a #GHashTable.
*
* Return value: a hash value corresponding to the color
*
* Since: 1.0
*/
guint
clutter_color_hash (gconstpointer v)
@@ -837,8 +859,10 @@ clutter_color_hash (gconstpointer v)
* @progress: the interpolation progress
* @result: (out): return location for the interpolation
*
* Interpolates between @initial and @final `ClutterColor`s
* Interpolates between @initial and @final #ClutterColor<!-- -->s
* using @progress
*
* Since: 1.6
*/
void
clutter_color_interpolate (const ClutterColor *initial,
@@ -880,6 +904,8 @@ clutter_color_progress (const GValue *a,
* freed using clutter_color_free().
*
* Return value: (transfer full): an allocated copy of @color.
*
* Since: 0.2
*/
ClutterColor *
clutter_color_copy (const ClutterColor *color)
@@ -895,6 +921,8 @@ clutter_color_copy (const ClutterColor *color)
* @color: a #ClutterColor
*
* Frees a color structure created with clutter_color_copy().
*
* Since: 0.2
*/
void
clutter_color_free (ClutterColor *color)
@@ -914,12 +942,14 @@ clutter_color_free (ClutterColor *color)
*
* This function is the equivalent of:
*
* ```c
* |[
* clutter_color_init (clutter_color_alloc (), red, green, blue, alpha);
* ```
* ]|
*
* Return value: (transfer full): the newly allocated color.
* Use clutter_color_free() when done
*
* Since: 0.8
*/
ClutterColor *
clutter_color_new (guint8 red,
@@ -941,6 +971,8 @@ clutter_color_new (guint8 red,
*
* Return value: (transfer full): the newly allocated #ClutterColor; use
* clutter_color_free() to free its resources
*
* Since: 1.12
*/
ClutterColor *
clutter_color_alloc (void)
@@ -959,6 +991,8 @@ clutter_color_alloc (void)
* Initializes @color with the given values.
*
* Return value: (transfer none): the initialized #ClutterColor
*
* Since: 1.12
*/
ClutterColor *
clutter_color_init (ClutterColor *color,
@@ -1024,6 +1058,8 @@ G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterColor, clutter_color,
* @color: the color to set
*
* Sets @value to @color.
*
* Since: 0.8
*/
void
clutter_value_set_color (GValue *value,
@@ -1041,6 +1077,8 @@ clutter_value_set_color (GValue *value,
* Gets the #ClutterColor contained in @value.
*
* Return value: (transfer none): the color inside the passed #GValue
*
* Since: 0.8
*/
const ClutterColor *
clutter_value_get_color (const GValue *value)
@@ -1134,6 +1172,8 @@ clutter_param_color_get_type (void)
* Creates a #GParamSpec for properties using #ClutterColor.
*
* Return value: the newly created #GParamSpec
*
* Since: 0.8
*/
GParamSpec *
clutter_param_spec_color (const gchar *name,

View File

@@ -23,13 +23,14 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CLUTTER_COLOR_H__
#define __CLUTTER_COLOR_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-types.h"
#include <clutter/clutter-types.h>
G_BEGIN_DECLS
@@ -42,12 +43,7 @@ G_BEGIN_DECLS
* @blue: blue component, between 0 and 255
* @alpha: alpha component, between 0 and 255
*
* A simple type for representing colors.
*
* A #ClutterColor is expressed as a 4-tuple of values ranging from
* zero to 255, one for each color channel plus one for the alpha.
*
* The alpha channel is fully opaque at 255 and fully transparent at 0.
* Color representation.
*/
struct _ClutterColor
{
@@ -67,6 +63,8 @@ struct _ClutterColor
* @a: value for the alpha channel, between 0 and 255
*
* A macro that initializes a #ClutterColor, to be used when declaring it.
*
* Since: 1.12
*/
#define CLUTTER_COLOR_INIT(r,g,b,a) { (r), (g), (b), (a) }
@@ -153,7 +151,9 @@ void clutter_color_interpolate (const ClutterColor *initial,
* CLUTTER_VALUE_HOLDS_COLOR:
* @x: a #GValue
*
* Evaluates to %TRUE if @x holds a `ClutterColor`.
* Evaluates to %TRUE if @x holds a #ClutterColor<!-- -->.
*
* Since: 1.0
*/
#define CLUTTER_VALUE_HOLDS_COLOR(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_COLOR))
@@ -165,6 +165,8 @@ typedef struct _ClutterParamSpecColor ClutterParamSpecColor;
*
* A #GParamSpec subclass for defining properties holding
* a #ClutterColor.
*
* Since: 1.0
*/
struct _ClutterParamSpecColor
{
@@ -194,3 +196,5 @@ CLUTTER_EXPORT
const ClutterColor *clutter_color_get_static (ClutterStaticColor color);
G_END_DECLS
#endif /* __CLUTTER_COLOR_H__ */

View File

@@ -23,28 +23,30 @@
*/
/**
* ClutterColorizeEffect:
*
* A colorization effect
* SECTION:clutter-colorize-effect
* @short_description: A colorization effect
* @see_also: #ClutterEffect, #ClutterOffscreenEffect
*
* #ClutterColorizeEffect is a sub-class of #ClutterEffect that
* colorizes an actor with the given tint.
*
* #ClutterColorizeEffect is available since Clutter 1.4
*/
#define CLUTTER_COLORIZE_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_COLORIZE_EFFECT, ClutterColorizeEffectClass))
#define CLUTTER_IS_COLORIZE_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_COLORIZE_EFFECT))
#define CLUTTER_COLORIZE_EFFECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_COLORIZE_EFFECT, ClutterColorizeEffectClass))
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-colorize-effect.h"
#include "clutter-colorize-effect.h"
#include "cogl/cogl.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-enum-types.h"
#include "clutter/clutter-offscreen-effect.h"
#include "clutter/clutter-private.h"
#include "clutter-debug.h"
#include "clutter-enum-types.h"
#include "clutter-offscreen-effect.h"
#include "clutter-private.h"
struct _ClutterColorizeEffect
{
@@ -108,6 +110,29 @@ clutter_colorize_effect_create_pipeline (ClutterOffscreenEffect *effect,
return cogl_object_ref (colorize_effect->pipeline);
}
static gboolean
clutter_colorize_effect_pre_paint (ClutterEffect *effect,
ClutterPaintNode *node,
ClutterPaintContext *paint_context)
{
ClutterEffectClass *parent_class;
if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
{
/* if we don't have support for GLSL shaders then we
* forcibly disable the ActorMeta
*/
g_warning ("Unable to use the ShaderEffect: the graphics hardware "
"or the current GL driver does not implement support "
"for the GLSL shading language.");
clutter_actor_meta_set_enabled (CLUTTER_ACTOR_META (effect), FALSE);
return FALSE;
}
parent_class = CLUTTER_EFFECT_CLASS (clutter_colorize_effect_parent_class);
return parent_class->pre_paint (effect, node, paint_context);
}
static void
clutter_colorize_effect_dispose (GObject *gobject)
{
@@ -166,12 +191,15 @@ clutter_colorize_effect_get_property (GObject *gobject,
static void
clutter_colorize_effect_class_init (ClutterColorizeEffectClass *klass)
{
ClutterEffectClass *effect_class = CLUTTER_EFFECT_CLASS (klass);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
ClutterOffscreenEffectClass *offscreen_class;
offscreen_class = CLUTTER_OFFSCREEN_EFFECT_CLASS (klass);
offscreen_class->create_pipeline = clutter_colorize_effect_create_pipeline;
effect_class->pre_paint = clutter_colorize_effect_pre_paint;
gobject_class->set_property = clutter_colorize_effect_set_property;
gobject_class->get_property = clutter_colorize_effect_get_property;
gobject_class->dispose = clutter_colorize_effect_dispose;
@@ -180,9 +208,13 @@ clutter_colorize_effect_class_init (ClutterColorizeEffectClass *klass)
* ClutterColorizeEffect:tint:
*
* The tint to apply to the actor
*
* Since: 1.4
*/
obj_props[PROP_TINT] =
clutter_param_spec_color ("tint", NULL, NULL,
clutter_param_spec_color ("tint",
P_("Tint"),
P_("The tint to apply"),
&default_tint,
CLUTTER_PARAM_READWRITE);
@@ -248,6 +280,8 @@ clutter_colorize_effect_init (ClutterColorizeEffect *self)
* clutter_actor_add_effect()
*
* Return value: the newly created #ClutterColorizeEffect or %NULL
*
* Since: 1.4
*/
ClutterEffect *
clutter_colorize_effect_new (const ClutterColor *tint)
@@ -263,6 +297,8 @@ clutter_colorize_effect_new (const ClutterColor *tint)
* @tint: the color to be used
*
* Sets the tint to be used when colorizing
*
* Since: 1.4
*/
void
clutter_colorize_effect_set_tint (ClutterColorizeEffect *effect,
@@ -285,6 +321,8 @@ clutter_colorize_effect_set_tint (ClutterColorizeEffect *effect,
* @tint: (out caller-allocates): return location for the color used
*
* Retrieves the tint used by @effect
*
* Since: 1.4
*/
void
clutter_colorize_effect_get_tint (ClutterColorizeEffect *effect,

View File

@@ -22,14 +22,15 @@
* Emmanuele Bassi <ebassi@linux.intel.com>
*/
#pragma once
#ifndef __CLUTTER_COLORIZE_EFFECT_H__
#define __CLUTTER_COLORIZE_EFFECT_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-color.h"
#include "clutter/clutter-effect.h"
#include <clutter/clutter-color.h>
#include <clutter/clutter-effect.h>
G_BEGIN_DECLS
@@ -37,6 +38,14 @@ G_BEGIN_DECLS
#define CLUTTER_COLORIZE_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_COLORIZE_EFFECT, ClutterColorizeEffect))
#define CLUTTER_IS_COLORIZE_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_COLORIZE_EFFECT))
/**
* ClutterColorizeEffect:
*
* #ClutterColorizeEffect is an opaque structure
* whose members cannot be directly accessed
*
* Since: 1.4
*/
typedef struct _ClutterColorizeEffect ClutterColorizeEffect;
typedef struct _ClutterColorizeEffectClass ClutterColorizeEffectClass;
@@ -54,3 +63,5 @@ void clutter_colorize_effect_get_tint (ClutterColorizeEffect *effect,
ClutterColor *tint);
G_END_DECLS
#endif /* __CLUTTER_COLORIZE_EFFECT_H__ */

View File

@@ -19,9 +19,10 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CLUTTER_CONSTRAINT_PRIVATE_H__
#define __CLUTTER_CONSTRAINT_PRIVATE_H__
#include "clutter/clutter-constraint.h"
#include "clutter-constraint.h"
G_BEGIN_DECLS
@@ -30,3 +31,5 @@ gboolean clutter_constraint_update_allocation (ClutterConstraint *constraint,
ClutterActorBox *allocation);
G_END_DECLS
#endif /* __CLUTTER_CONSTRAINT_PRIVATE_H__ */

View File

@@ -23,9 +23,10 @@
*/
/**
* ClutterConstraint:
*
* Abstract class for constraints on position or size
* SECTION:clutter-constraint
* @Title: ClutterConstraint
* @Short_Description: Abstract class for constraints on position or size
* @See_Also: #ClutterAction
*
* #ClutterConstraint is a base abstract class for modifiers of a #ClutterActor
* position or size.
@@ -36,6 +37,8 @@
* allocation of the actor to which they are applied by overriding the
* #ClutterConstraintClass.update_allocation() virtual function.
*
* #ClutterConstraint is available since Clutter 1.4
*
* ## Using Constraints
*
* Constraints can be used with fixed layout managers, like
@@ -125,15 +128,15 @@
* can be recovered at any point using clutter_actor_meta_get_actor().
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include <string.h>
#include "clutter/clutter-constraint-private.h"
#include "clutter-constraint-private.h"
#include "clutter/clutter-actor.h"
#include "clutter/clutter-actor-meta-private.h"
#include "clutter/clutter-private.h"
#include "clutter-actor.h"
#include "clutter-actor-meta-private.h"
#include "clutter-private.h"
G_DEFINE_ABSTRACT_TYPE (ClutterConstraint,
clutter_constraint,

View File

@@ -22,13 +22,14 @@
* Emmanuele Bassi <ebassi@linux.intel.com>
*/
#pragma once
#ifndef __CLUTTER_CONSTRAINT_H__
#define __CLUTTER_CONSTRAINT_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-actor-meta.h"
#include <clutter/clutter-actor-meta.h>
G_BEGIN_DECLS
@@ -41,6 +42,14 @@ G_BEGIN_DECLS
typedef struct _ClutterConstraintClass ClutterConstraintClass;
/**
* ClutterConstraint:
*
* The #ClutterConstraint structure contains only
* private data and should be accessed using the provided API
*
* Since: 1.4
*/
struct _ClutterConstraint
{
/*< private >*/
@@ -57,6 +66,8 @@ struct _ClutterConstraint
*
* The #ClutterConstraintClass structure contains
* only private data
*
* Since: 1.4
*/
struct _ClutterConstraintClass
{
@@ -74,6 +85,15 @@ struct _ClutterConstraintClass
float for_size,
float *minimum_size,
float *natural_size);
/*< private >*/
void (* _clutter_constraint1) (void);
void (* _clutter_constraint2) (void);
void (* _clutter_constraint3) (void);
void (* _clutter_constraint4) (void);
void (* _clutter_constraint5) (void);
void (* _clutter_constraint6) (void);
void (* _clutter_constraint7) (void);
};
CLUTTER_EXPORT
@@ -113,3 +133,5 @@ CLUTTER_EXPORT
gboolean clutter_actor_has_constraints (ClutterActor *self);
G_END_DECLS
#endif /* __CLUTTER_CONSTRAINT_H__ */

View File

@@ -19,9 +19,10 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef __CLUTTER_CONTAINER_PRIVATE_H__
#define __CLUTTER_CONTAINER_PRIVATE_H__
#include "clutter/clutter-container.h"
#include <clutter/clutter-container.h>
G_BEGIN_DECLS
@@ -31,3 +32,5 @@ void _clutter_container_emit_actor_removed (ClutterContainer *container,
ClutterActor *actor);
G_END_DECLS
#endif /* __CLUTTER_CONTAINER_PRIVATE_H__ */

View File

@@ -26,23 +26,23 @@
* Author: Emmanuele Bassi <ebassi@openedhand.com>
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include <stdarg.h>
#include <glib-object.h>
#include <gobject/gvaluecollector.h>
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#include "clutter/deprecated/clutter-container.h"
#include "deprecated/clutter-container.h"
#include "clutter/clutter-actor-private.h"
#include "clutter/clutter-child-meta.h"
#include "clutter/clutter-container-private.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-main.h"
#include "clutter/clutter-marshal.h"
#include "clutter/clutter-private.h"
#include "clutter/clutter-enum-types.h"
#include "clutter-actor-private.h"
#include "clutter-child-meta.h"
#include "clutter-container-private.h"
#include "clutter-debug.h"
#include "clutter-main.h"
#include "clutter-marshal.h"
#include "clutter-private.h"
#include "clutter-enum-types.h"
#define CLUTTER_CONTAINER_WARN_NOT_IMPLEMENTED(container,vfunc) \
G_STMT_START { \
@@ -63,14 +63,20 @@
} G_STMT_END
/**
* ClutterContainer:
*
* An interface for container actors
* SECTION:clutter-container
* @short_description: An interface for container actors
*
* #ClutterContainer is an interface implemented by [class@Actor], and
* #ClutterContainer is an interface implemented by #ClutterActor, and
* it provides some common API for notifying when a child actor is added
* or removed, as well as the infrastructure for accessing child properties
* through [class@ChildMeta].
* through #ClutterChildMeta.
*
* Until Clutter 1.10, the #ClutterContainer interface was also the public
* API for implementing container actors; this part of the interface has
* been deprecated: #ClutterContainer has a default implementation which
* defers to #ClutterActor the child addition and removal, as well as the
* iteration. See the documentation of #ClutterContainerIface for the list
* of virtual functions that should be overridden.
*/
enum
@@ -113,6 +119,31 @@ container_real_remove (ClutterContainer *container,
clutter_actor_remove_child (CLUTTER_ACTOR (container), actor);
}
static void
container_real_raise (ClutterContainer *container,
ClutterActor *child,
ClutterActor *sibling)
{
ClutterActor *self = CLUTTER_ACTOR (container);
clutter_actor_set_child_above_sibling (self, child, sibling);
}
static void
container_real_lower (ClutterContainer *container,
ClutterActor *child,
ClutterActor *sibling)
{
ClutterActor *self = CLUTTER_ACTOR (container);
clutter_actor_set_child_below_sibling (self, child, sibling);
}
static void
container_real_sort_depth_order (ClutterContainer *container)
{
}
static void
clutter_container_default_init (ClutterContainerInterface *iface)
{
@@ -126,8 +157,10 @@ clutter_container_default_init (ClutterContainerInterface *iface)
* @container: the actor which received the signal
* @actor: the new child that has been added to @container
*
* The signal is emitted each time an actor
* The ::actor-added signal is emitted each time an actor
* has been added to @container.
*
* Since: 0.4
*/
container_signals[ACTOR_ADDED] =
g_signal_new (I_("actor-added"),
@@ -142,8 +175,10 @@ clutter_container_default_init (ClutterContainerInterface *iface)
* @container: the actor which received the signal
* @actor: the child that has been removed from @container
*
* The signal is emitted each time an actor
* The ::actor-removed signal is emitted each time an actor
* is removed from @container.
*
* Since: 0.4
*/
container_signals[ACTOR_REMOVED] =
g_signal_new (I_("actor-removed"),
@@ -160,9 +195,11 @@ clutter_container_default_init (ClutterContainerInterface *iface)
* @actor: the child that has had a property set
* @pspec: (type GParamSpec): the #GParamSpec of the property set
*
* The signal is emitted each time a property is
* The ::child-notify signal is emitted each time a property is
* being set through the clutter_container_child_set() and
* clutter_container_child_set_property() calls.
*
* Since: 0.8
*/
container_signals[CHILD_NOTIFY] =
g_signal_new (I_("child-notify"),
@@ -176,6 +213,9 @@ clutter_container_default_init (ClutterContainerInterface *iface)
iface->add = container_real_add;
iface->remove = container_real_remove;
iface->raise = container_real_raise;
iface->lower = container_real_lower;
iface->sort_depth_order = container_real_sort_depth_order;
iface->child_meta_type = G_TYPE_INVALID;
iface->create_child_meta = create_child_meta;
@@ -289,7 +329,7 @@ container_remove_valist (ClutterContainer *container,
* @first_actor: the first #ClutterActor to add
* @...: %NULL terminated list of actors to add
*
* Adds a list of `ClutterActor`s to @container. Each time and
* Adds a list of #ClutterActor<!-- -->s to @container. Each time and
* actor is added, the "actor-added" signal is emitted. Each actor should
* be parented to @container, which takes a reference on the actor. You
* cannot add a #ClutterActor to more than one #ClutterContainer.
@@ -298,6 +338,8 @@ container_remove_valist (ClutterContainer *container,
* deprecated virtual function. The default implementation will
* call clutter_actor_add_child().
*
* Since: 0.4
*
* Deprecated: 1.10: Use clutter_actor_add_child() instead.
*/
void
@@ -329,6 +371,8 @@ clutter_container_add (ClutterContainer *container,
* deprecated virtual function. The default implementation will
* call clutter_actor_add_child().
*
* Since: 0.4
*
* Deprecated: 1.10: Use clutter_actor_add_child() instead.
*/
void
@@ -347,7 +391,7 @@ clutter_container_add_actor (ClutterContainer *container,
* @first_actor: first #ClutterActor to remove
* @...: a %NULL-terminated list of actors to remove
*
* Removes a %NULL terminated list of `ClutterActor`s from
* Removes a %NULL terminated list of #ClutterActor<!-- -->s from
* @container. Each actor should be unparented, so if you want to keep it
* around you must hold a reference to it yourself, using g_object_ref().
* Each time an actor is removed, the "actor-removed" signal is
@@ -357,6 +401,8 @@ clutter_container_add_actor (ClutterContainer *container,
* deprecated virtual function. The default implementation will call
* clutter_actor_remove_child().
*
* Since: 0.4
*
* Deprecated: 1.10: Use clutter_actor_remove_child() instead.
*/
void
@@ -388,6 +434,8 @@ clutter_container_remove (ClutterContainer *container,
* deprecated virtual function. The default implementation will call
* clutter_actor_remove_child().
*
* Since: 0.4
*
* Deprecated: 1.10: Use clutter_actor_remove_child() instead.
*/
void
@@ -400,6 +448,202 @@ clutter_container_remove_actor (ClutterContainer *container,
container_remove_actor (container, actor);
}
/**
* clutter_container_get_children:
* @container: a #ClutterContainer
*
* Retrieves all the children of @container.
*
* Return value: (element-type Clutter.Actor) (transfer container): a list
* of #ClutterActor<!-- -->s. Use g_list_free() on the returned
* list when done.
*
* Since: 0.4
*
* Deprecated: 1.10: Use clutter_actor_get_children() instead.
*/
GList *
clutter_container_get_children (ClutterContainer *container)
{
g_return_val_if_fail (CLUTTER_IS_CONTAINER (container), NULL);
return clutter_actor_get_children (CLUTTER_ACTOR (container));
}
/**
* clutter_container_raise_child: (virtual raise)
* @container: a #ClutterContainer
* @actor: the actor to raise
* @sibling: (allow-none): the sibling to raise to, or %NULL to raise
* to the top
*
* Raises @actor to @sibling level, in the depth ordering.
*
* This function calls the #ClutterContainerIface.raise() virtual function,
* which has been deprecated. The default implementation will call
* clutter_actor_set_child_above_sibling().
*
* Since: 0.6
*
* Deprecated: 1.10: Use clutter_actor_set_child_above_sibling() instead.
*/
void
clutter_container_raise_child (ClutterContainer *container,
ClutterActor *actor,
ClutterActor *sibling)
{
ClutterContainerIface *iface;
ClutterActor *self;
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
g_return_if_fail (sibling == NULL || CLUTTER_IS_ACTOR (sibling));
if (actor == sibling)
return;
self = CLUTTER_ACTOR (container);
if (clutter_actor_get_parent (actor) != self)
{
g_warning ("Actor of type '%s' is not a child of the container "
"of type '%s'",
g_type_name (G_OBJECT_TYPE (actor)),
g_type_name (G_OBJECT_TYPE (container)));
return;
}
if (sibling != NULL &&
clutter_actor_get_parent (sibling) != self)
{
g_warning ("Actor of type '%s' is not a child of the container "
"of type '%s'",
g_type_name (G_OBJECT_TYPE (sibling)),
g_type_name (G_OBJECT_TYPE (container)));
return;
}
iface = CLUTTER_CONTAINER_GET_IFACE (container);
#ifdef CLUTTER_ENABLE_DEBUG
if (G_UNLIKELY (_clutter_diagnostic_enabled ()))
{
if (iface->raise != container_real_raise)
_clutter_diagnostic_message ("The ClutterContainer::raise() "
"virtual function has been deprecated "
"and it should not be overridden by "
"newly written code");
}
#endif /* CLUTTER_ENABLE_DEBUG */
iface->raise (container, actor, sibling);
}
/**
* clutter_container_lower_child: (virtual lower)
* @container: a #ClutterContainer
* @actor: the actor to raise
* @sibling: (allow-none): the sibling to lower to, or %NULL to lower
* to the bottom
*
* Lowers @actor to @sibling level, in the depth ordering.
*
* This function calls the #ClutterContainerIface.lower() virtual function,
* which has been deprecated. The default implementation will call
* clutter_actor_set_child_below_sibling().
*
* Since: 0.6
*
* Deprecated: 1.10: Use clutter_actor_set_child_below_sibling() instead.
*/
void
clutter_container_lower_child (ClutterContainer *container,
ClutterActor *actor,
ClutterActor *sibling)
{
ClutterContainerIface *iface;
ClutterActor *self;
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
g_return_if_fail (sibling == NULL || CLUTTER_IS_ACTOR (sibling));
if (actor == sibling)
return;
self = CLUTTER_ACTOR (container);
if (clutter_actor_get_parent (actor) != self)
{
g_warning ("Actor of type '%s' is not a child of the container "
"of type '%s'",
g_type_name (G_OBJECT_TYPE (actor)),
g_type_name (G_OBJECT_TYPE (container)));
return;
}
if (sibling != NULL&&
clutter_actor_get_parent (sibling) != self)
{
g_warning ("Actor of type '%s' is not a child of the container "
"of type '%s'",
g_type_name (G_OBJECT_TYPE (sibling)),
g_type_name (G_OBJECT_TYPE (container)));
return;
}
iface = CLUTTER_CONTAINER_GET_IFACE (container);
#ifdef CLUTTER_ENABLE_DEBUG
if (G_UNLIKELY (_clutter_diagnostic_enabled ()))
{
if (iface->lower != container_real_lower)
_clutter_diagnostic_message ("The ClutterContainer::lower() "
"virtual function has been deprecated "
"and it should not be overridden by "
"newly written code");
}
#endif /* CLUTTER_ENABLE_DEBUG */
iface->lower (container, actor, sibling);
}
/**
* clutter_container_sort_depth_order:
* @container: a #ClutterContainer
*
* Sorts a container's children using their depth. This function should not
* be normally used by applications.
*
* Since: 0.6
*
* Deprecated: 1.10: The #ClutterContainerIface.sort_depth_order() virtual
* function should not be used any more; the default implementation in
* #ClutterContainer does not do anything.
*/
void
clutter_container_sort_depth_order (ClutterContainer *container)
{
ClutterContainerIface *iface;
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
iface = CLUTTER_CONTAINER_GET_IFACE (container);
#ifdef CLUTTER_ENABLE_DEBUG
if (G_UNLIKELY (_clutter_diagnostic_enabled ()))
{
if (iface->sort_depth_order != container_real_sort_depth_order)
_clutter_diagnostic_message ("The ClutterContainer::sort_depth_order() "
"virtual function has been deprecated "
"and it should not be overridden by "
"newly written code");
}
#endif /* CLUTTER_ENABLE_DEBUG */
iface->sort_depth_order (container);
}
/**
* clutter_container_find_child_by_name:
* @container: a #ClutterContainer
@@ -410,6 +654,8 @@ clutter_container_remove_actor (ClutterContainer *container,
*
* Return value: (transfer none): The child actor with the requested name,
* or %NULL if no actor with that name was found.
*
* Since: 0.6
*/
ClutterActor *
clutter_container_find_child_by_name (ClutterContainer *container,
@@ -422,7 +668,7 @@ clutter_container_find_child_by_name (ClutterContainer *container,
g_return_val_if_fail (CLUTTER_IS_CONTAINER (container), NULL);
g_return_val_if_fail (child_name != NULL, NULL);
children = clutter_actor_get_children (CLUTTER_ACTOR (container));
children = clutter_container_get_children (container);
for (iter = children; iter; iter = g_list_next (iter))
{
@@ -518,8 +764,10 @@ destroy_child_meta (ClutterContainer *container,
* @container specific state for @actor.
*
* Return value: (transfer none): the #ClutterChildMeta for the @actor child
* of @container or %NULL if the specific actor does not exist or the
* container is not configured to provide `ClutterChildMeta`s
* of @container or %NULL if the specifiec actor does not exist or the
* container is not configured to provide #ClutterChildMeta<!-- -->s
*
* Since: 0.8
*/
ClutterChildMeta *
clutter_container_get_child_meta (ClutterContainer *container,
@@ -550,6 +798,8 @@ clutter_container_get_child_meta (ClutterContainer *container,
* #ClutterContainer::add() virtual function implementation.
*
* Applications should not call this function.
*
* Since: 1.2
*/
void
clutter_container_create_child_meta (ClutterContainer *container,
@@ -584,6 +834,8 @@ clutter_container_create_child_meta (ClutterContainer *container,
* #ClutterContainer::add() virtual function implementation.
*
* Applications should not call this function.
*
* Since: 1.2
*/
void
clutter_container_destroy_child_meta (ClutterContainer *container,
@@ -612,6 +864,8 @@ clutter_container_destroy_child_meta (ClutterContainer *container,
*
* Return value: (transfer none): The #GParamSpec for the property or %NULL
* if no such property exist.
*
* Since: 0.8
*/
GParamSpec *
clutter_container_class_find_child_property (GObjectClass *klass,
@@ -648,7 +902,9 @@ clutter_container_class_find_child_property (GObjectClass *klass,
* Returns an array of #GParamSpec for all child properties.
*
* Return value: (array length=n_properties) (transfer full): an array
* of `GParamSpec`s which should be freed after use.
* of #GParamSpec<!-- -->s which should be freed after use.
*
* Since: 0.8
*/
GParamSpec **
clutter_container_class_list_child_properties (GObjectClass *klass,
@@ -709,6 +965,8 @@ container_set_child_property (ClutterContainer *container,
* @value: the value.
*
* Sets a container-specific property on a child of @container.
*
* Since: 0.8
*/
void
clutter_container_child_set_property (ClutterContainer *container,
@@ -755,6 +1013,8 @@ clutter_container_child_set_property (ClutterContainer *container,
* pairs terminated with NULL.
*
* Sets container specific properties on the child of a container.
*
* Since: 0.8
*/
void
clutter_container_child_set (ClutterContainer *container,
@@ -848,6 +1108,8 @@ container_get_child_property (ClutterContainer *container,
* Note that clutter_container_child_set_property() is really intended for
* language bindings, clutter_container_child_set() is much more convenient
* for C programming.
*
* Since: 0.8
*/
void
clutter_container_child_get_property (ClutterContainer *container,
@@ -899,6 +1161,8 @@ clutter_container_child_get_property (ClutterContainer *container,
* In general, a copy is made of the property contents and the caller is
* responsible for freeing the memory in the appropriate manner for the type, for
* instance by calling g_free() or g_object_unref().
*
* Since: 0.8
*/
void
clutter_container_child_get (ClutterContainer *container,
@@ -969,6 +1233,8 @@ clutter_container_child_get (ClutterContainer *container,
* Calls the #ClutterContainerIface.child_notify() virtual function
* of #ClutterContainer. The default implementation will emit the
* #ClutterContainer::child-notify signal.
*
* Since: 1.6
*/
void
clutter_container_child_notify (ClutterContainer *container,

View File

@@ -24,15 +24,16 @@
* Author: Emmanuele Bassi <ebassi@openedhand.com>
*/
#pragma once
#ifndef __CLUTTER_CONTAINER_H__
#define __CLUTTER_CONTAINER_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-actor.h"
#include "clutter/clutter-child-meta.h"
#include "clutter/clutter-types.h"
#include <clutter/clutter-actor.h>
#include <clutter/clutter-child-meta.h>
#include <clutter/clutter-types.h>
G_BEGIN_DECLS
@@ -43,12 +44,28 @@ G_BEGIN_DECLS
typedef struct _ClutterContainerIface ClutterContainerIface;
/**
* ClutterContainer:
*
* #ClutterContainer is an opaque structure whose members cannot be directly
* accessed
*
* Since: 0.4
*/
/**
* ClutterContainerIface:
* @add: virtual function for adding an actor to the container. This virtual
* function is deprecated, and it should not be overridden.
* @remove: virtual function for removing an actor from the container. This
* virtual function is deprecated, and it should not be overridden.
* @raise: virtual function for raising a child. This virtual function is
* deprecated and it should not be overridden.
* @lower: virtual function for lowering a child. This virtual function is
* deprecated and it should not be overridden.
* @sort_depth_order: virtual function for sorting the children of a
* container depending on their depth. This virtual function is deprecated
* and it should not be overridden.
* @child_meta_type: The GType used for storing auxiliary information about
* each of the containers children.
* @create_child_meta: virtual function that gets called for each added
@@ -66,6 +83,8 @@ typedef struct _ClutterContainerIface ClutterContainerIface;
* Base interface for container actors. The @add and @remove
* virtual functions must be provided by any implementation; the other
* virtual functions are optional.
*
* Since: 0.4
*/
struct _ClutterContainerIface
{
@@ -78,6 +97,15 @@ struct _ClutterContainerIface
void (* remove) (ClutterContainer *container,
ClutterActor *actor);
/* child stacking */
void (* raise) (ClutterContainer *container,
ClutterActor *actor,
ClutterActor *sibling);
void (* lower) (ClutterContainer *container,
ClutterActor *actor,
ClutterActor *sibling);
void (* sort_depth_order) (ClutterContainer *container);
/* ClutterChildMeta management */
GType child_meta_type;
void (* create_child_meta) (ClutterContainer *container,
@@ -149,3 +177,5 @@ void clutter_container_child_notify (Clutter
GParamSpec *pspec);
G_END_DECLS
#endif /* __CLUTTER_CONTAINER_H__ */

View File

@@ -22,9 +22,10 @@
* Emmanuele Bassi <ebassi@linux.intel.com>
*/
#pragma once
#ifndef __CLUTTER_CONTENT_PRIVATE_H__
#define __CLUTTER_CONTENT_PRIVATE_H__
#include "clutter/clutter-content.h"
#include <clutter/clutter-content.h>
G_BEGIN_DECLS
@@ -39,3 +40,5 @@ void _clutter_content_paint_content (ClutterContent *co
ClutterPaintContext *paint_context);
G_END_DECLS
#endif /* __CLUTTER_CONTENT_PRIVATE_H__ */

View File

@@ -23,25 +23,27 @@
*/
/**
* ClutterContent:
*
* Delegate for painting the content of an actor
* SECTION:clutter-content
* @Title: ClutterContent
* @Short_Description: Delegate for painting the content of an actor
*
* #ClutterContent is an interface to implement types responsible for
* painting the content of a [class@Actor].
* painting the content of a #ClutterActor.
*
* Multiple actors can use the same #ClutterContent instance, in order
* to share the resources associated with painting the same content..
* to share the resources associated with painting the same content.
*
* #ClutterContent is available since Clutter 1.10.
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-actor-private.h"
#include "clutter/clutter-content-private.h"
#include "clutter-actor-private.h"
#include "clutter-content-private.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-marshal.h"
#include "clutter/clutter-private.h"
#include "clutter-debug.h"
#include "clutter-marshal.h"
#include "clutter-private.h"
enum
{
@@ -120,6 +122,8 @@ clutter_content_default_init (ClutterContentInterface *iface)
*
* This signal is emitted each time a #ClutterContent implementation is
* assigned to a #ClutterActor.
*
* Since: 1.10
*/
content_signals[ATTACHED] =
g_signal_new (I_("attached"),
@@ -137,6 +141,8 @@ clutter_content_default_init (ClutterContentInterface *iface)
*
* This signal is emitted each time a #ClutterContent implementation is
* removed from a #ClutterActor.
*
* Since: 1.10
*/
content_signals[DETACHED] =
g_signal_new (I_("detached"),
@@ -157,6 +163,8 @@ clutter_content_default_init (ClutterContentInterface *iface)
* This function should be called by #ClutterContent implementations when
* they change the way a the content should be painted regardless of the
* actor state.
*
* Since: 1.10
*/
void
clutter_content_invalidate (ClutterContent *content)
@@ -314,8 +322,8 @@ _clutter_content_paint_content (ClutterContent *content,
/**
* clutter_content_get_preferred_size:
* @content: a #ClutterContent
* @width: (out) (optional): return location for the natural width of the content
* @height: (out) (optional): return location for the natural height of the content
* @width: (out): return location for the natural width of the content
* @height: (out): return location for the natural height of the content
*
* Retrieves the natural size of the @content, if any.
*
@@ -325,6 +333,8 @@ _clutter_content_paint_content (ClutterContent *content,
*
* Return value: %TRUE if the content has a preferred size, and %FALSE
* otherwise
*
* Since: 1.10
*/
gboolean
clutter_content_get_preferred_size (ClutterContent *content,

View File

@@ -22,13 +22,14 @@
* Emmanuele Bassi <ebassi@linux.intel.com>
*/
#pragma once
#ifndef __CLUTTER_CONTENT_H__
#define __CLUTTER_CONTENT_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-types.h"
#include <clutter/clutter-types.h>
G_BEGIN_DECLS
@@ -52,6 +53,8 @@ G_DECLARE_INTERFACE (ClutterContent, clutter_content, CLUTTER, CONTENT, GObject)
*
* The #ClutterContentInterface structure contains only
* private data.
*
* Since: 1.10
*/
struct _ClutterContentInterface
{
@@ -88,3 +91,5 @@ CLUTTER_EXPORT
void clutter_content_invalidate_size (ClutterContent *content);
G_END_DECLS
#endif /* __CLUTTER_CONTENT_H__ */

View File

@@ -16,9 +16,9 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-damage-history.h"
#include "clutter-damage-history.h"
#define DAMAGE_HISTORY_LENGTH 0x10

View File

@@ -16,12 +16,13 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef CLUTTER_DAMAGE_HISTORY_H
#define CLUTTER_DAMAGE_HISTORY_H
#include <cairo.h>
#include <glib.h>
#include "clutter/clutter-macros.h"
#include "clutter-macros.h"
typedef struct _ClutterDamageHistory ClutterDamageHistory;
@@ -45,3 +46,5 @@ void clutter_damage_history_step (ClutterDamageHistory *history);
CLUTTER_EXPORT
const cairo_region_t * clutter_damage_history_lookup (ClutterDamageHistory *history,
int age);
#endif /* CLUTTER_DAMAGE_HISTORY_H */

View File

@@ -1,8 +1,8 @@
#pragma once
#ifndef __CLUTTER_DEBUG_H__
#define __CLUTTER_DEBUG_H__
#include <glib.h>
#include "clutter/clutter-main.h"
#include "clutter-main.h"
G_BEGIN_DECLS
@@ -15,7 +15,7 @@ G_BEGIN_DECLS
/* Try the GCC extension for valists in macros */
#define CLUTTER_NOTE(type,x,a...) G_STMT_START { \
if (G_UNLIKELY (CLUTTER_HAS_DEBUG (type))) { \
_clutter_debug_message ("[" #type "]: " x, ##a); \
_clutter_debug_message ("[" #type "]:" G_STRLOC ": " x, ##a); \
} } G_STMT_END
#else /* !__GNUC__ */
@@ -26,7 +26,7 @@ G_BEGIN_DECLS
#define CLUTTER_NOTE(type,...) G_STMT_START { \
if (G_UNLIKELY (CLUTTER_HAS_DEBUG (type))) { \
gchar *_fmt = g_strdup_printf (__VA_ARGS__); \
_clutter_debug_message ("[" #type "]: %s", _fmt); \
_clutter_debug_message ("[" #type "]:" G_STRLOC ": %s", _fmt); \
g_free (_fmt); \
} } G_STMT_END
#endif
@@ -49,3 +49,5 @@ void _clutter_debug_message (const char *format,
...) G_GNUC_PRINTF (1, 2);
G_END_DECLS
#endif /* __CLUTTER_DEBUG_H__ */

View File

@@ -26,9 +26,10 @@
*/
/**
* ClutterDeformEffect:
*
* A base class for effects deforming the geometry of an actor
* SECTION:clutter-deform-effect
* @Title: ClutterDeformEffect
* @Short_Description: A base class for effects deforming the geometry
* of an actor
*
* #ClutterDeformEffect is an abstract class providing all the plumbing
* for creating effects that result in the deformation of an actor's
@@ -38,6 +39,8 @@
* a #ClutterActor and then the Cogl vertex buffers API to submit the
* geometry to the GPU.
*
* #ClutterDeformEffect is available since Clutter 1.4
*
* ## Implementing ClutterDeformEffect
*
* Sub-classes of #ClutterDeformEffect should override the
@@ -48,17 +51,19 @@
* deformation algorithm.
*/
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "cogl/cogl.h"
#include "clutter-deform-effect.h"
#include "clutter/clutter-deform-effect.h"
#include "clutter/clutter-color.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-enum-types.h"
#include "clutter/clutter-paint-node.h"
#include "clutter/clutter-paint-nodes.h"
#include "clutter/clutter-private.h"
#include <cogl/cogl.h>
#include "clutter-color.h"
#include "clutter-debug.h"
#include "clutter-enum-types.h"
#include "clutter-offscreen-effect-private.h"
#include "clutter-paint-node.h"
#include "clutter-paint-nodes.h"
#include "clutter-private.h"
#define DEFAULT_N_TILES 32
@@ -591,9 +596,13 @@ clutter_deform_effect_class_init (ClutterDeformEffectClass *klass)
*
* The number of horizontal tiles. The bigger the number, the
* smaller the tiles
*
* Since: 1.4
*/
obj_props[PROP_X_TILES] =
g_param_spec_uint ("x-tiles", NULL, NULL,
g_param_spec_uint ("x-tiles",
P_("Horizontal Tiles"),
P_("The number of horizontal tiles"),
1, G_MAXUINT,
DEFAULT_N_TILES,
CLUTTER_PARAM_READWRITE);
@@ -603,9 +612,13 @@ clutter_deform_effect_class_init (ClutterDeformEffectClass *klass)
*
* The number of vertical tiles. The bigger the number, the
* smaller the tiles
*
* Since: 1.4
*/
obj_props[PROP_Y_TILES] =
g_param_spec_uint ("y-tiles", NULL, NULL,
g_param_spec_uint ("y-tiles",
P_("Vertical Tiles"),
P_("The number of vertical tiles"),
1, G_MAXUINT,
DEFAULT_N_TILES,
CLUTTER_PARAM_READWRITE);
@@ -617,9 +630,13 @@ clutter_deform_effect_class_init (ClutterDeformEffectClass *klass)
* to which this effect has been applied
*
* By default, no material will be used
*
* Since: 1.4
*/
obj_props[PROP_BACK_MATERIAL] =
g_param_spec_boxed ("back-material", NULL, NULL,
g_param_spec_boxed ("back-material",
P_("Back Material"),
P_("The material to be used when painting the back of the actor"),
COGL_TYPE_HANDLE,
CLUTTER_PARAM_READWRITE);
@@ -655,6 +672,8 @@ clutter_deform_effect_init (ClutterDeformEffect *self)
*
* The #ClutterDeformEffect will take a reference on the material's
* handle
*
* Since: 1.4
*/
void
clutter_deform_effect_set_back_material (ClutterDeformEffect *effect,
@@ -686,6 +705,8 @@ clutter_deform_effect_set_back_material (ClutterDeformEffect *effect,
* Return value: (transfer none): a handle for the material, or %NULL.
* The returned material is owned by the #ClutterDeformEffect and it
* should not be freed directly
*
* Since: 1.4
*/
CoglHandle
clutter_deform_effect_get_back_material (ClutterDeformEffect *effect)
@@ -706,6 +727,8 @@ clutter_deform_effect_get_back_material (ClutterDeformEffect *effect)
*
* More tiles allow a finer grained deformation at the expenses
* of computation
*
* Since: 1.4
*/
void
clutter_deform_effect_set_n_tiles (ClutterDeformEffect *effect,
@@ -759,6 +782,8 @@ clutter_deform_effect_set_n_tiles (ClutterDeformEffect *effect,
*
* Retrieves the number of horizontal and vertical tiles used to sub-divide
* the actor's geometry during the effect
*
* Since: 1.4
*/
void
clutter_deform_effect_get_n_tiles (ClutterDeformEffect *effect,
@@ -778,8 +803,10 @@ clutter_deform_effect_get_n_tiles (ClutterDeformEffect *effect,
* clutter_deform_effect_invalidate:
* @effect: a #ClutterDeformEffect
*
* Invalidates the `effect`'s vertices and, if it is associated
* Invalidates the @effect<!-- -->'s vertices and, if it is associated
* to an actor, it will queue a redraw
*
* Since: 1.4
*/
void
clutter_deform_effect_invalidate (ClutterDeformEffect *effect)

View File

@@ -22,14 +22,15 @@
* Emmanuele Bassi <ebassi@linux.intel.com>
*/
#pragma once
#ifndef __CLUTTER_DEFORM_EFFECT_H__
#define __CLUTTER_DEFORM_EFFECT_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "cogl/cogl.h"
#include "clutter/clutter-offscreen-effect.h"
#include <cogl/cogl.h>
#include <clutter/clutter-offscreen-effect.h>
G_BEGIN_DECLS
@@ -44,6 +45,14 @@ typedef struct _ClutterDeformEffect ClutterDeformEffect;
typedef struct _ClutterDeformEffectPrivate ClutterDeformEffectPrivate;
typedef struct _ClutterDeformEffectClass ClutterDeformEffectClass;
/**
* ClutterDeformEffect:
*
* The #ClutterDeformEffect structure contains
* only private data and should be accessed using the provided API
*
* Since: 1.4
*/
struct _ClutterDeformEffect
{
/*< private >*/
@@ -59,6 +68,8 @@ struct _ClutterDeformEffect
*
* The #ClutterDeformEffectClass structure contains
* only private data
*
* Since: 1.4
*/
struct _ClutterDeformEffectClass
{
@@ -70,6 +81,15 @@ struct _ClutterDeformEffectClass
gfloat width,
gfloat height,
CoglTextureVertex *vertex);
/*< private >*/
void (*_clutter_deform1) (void);
void (*_clutter_deform2) (void);
void (*_clutter_deform3) (void);
void (*_clutter_deform4) (void);
void (*_clutter_deform5) (void);
void (*_clutter_deform6) (void);
void (*_clutter_deform7) (void);
};
CLUTTER_EXPORT
@@ -93,3 +113,5 @@ CLUTTER_EXPORT
void clutter_deform_effect_invalidate (ClutterDeformEffect *effect);
G_END_DECLS
#endif /* __CLUTTER_DEFORM_EFFECT_H__ */

View File

@@ -1,8 +1,10 @@
#pragma once
#ifndef __CLUTTER_DEPRECATED_H__
#define __CLUTTER_DEPRECATED_H__
#define __CLUTTER_DEPRECATED_H_INSIDE__
#include "clutter/deprecated/clutter-container.h"
#include "deprecated/clutter-container.h"
#undef __CLUTTER_DEPRECATED_H_INSIDE__
#endif /* __CLUTTER_DEPRECATED_H__ */

View File

@@ -23,32 +23,34 @@
*/
/**
* ClutterDesaturateEffect:
*
* A desaturation effect
* SECTION:clutter-desaturate-effect
* @short_description: A desaturation effect
* @see_also: #ClutterEffect, #ClutterOffscreenEffect
*
* #ClutterDesaturateEffect is a sub-class of #ClutterEffect that
* desaturates the color of an actor and its contents. The strength
* of the desaturation effect is controllable and animatable through
* the #ClutterDesaturateEffect:factor property.
*
* #ClutterDesaturateEffect is available since Clutter 1.4
*/
#define CLUTTER_DESATURATE_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_DESATURATE_EFFECT, ClutterDesaturateEffectClass))
#define CLUTTER_IS_DESATURATE_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_DESATURATE_EFFECT))
#define CLUTTER_DESATURATE_EFFECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_DESATURATE_EFFECT, ClutterDesaturateEffectClass))
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include <math.h>
#include "clutter/clutter-desaturate-effect.h"
#include "clutter-desaturate-effect.h"
#include "cogl/cogl.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-enum-types.h"
#include "clutter/clutter-offscreen-effect.h"
#include "clutter/clutter-private.h"
#include "clutter-debug.h"
#include "clutter-enum-types.h"
#include "clutter-offscreen-effect.h"
#include "clutter-private.h"
struct _ClutterDesaturateEffect
{
@@ -119,6 +121,29 @@ clutter_desaturate_effect_create_pipeline (ClutterOffscreenEffect *effect,
return cogl_object_ref (desaturate_effect->pipeline);
}
static gboolean
clutter_desaturate_effect_pre_paint (ClutterEffect *effect,
ClutterPaintNode *node,
ClutterPaintContext *paint_context)
{
ClutterEffectClass *parent_class;
if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
{
/* if we don't have support for GLSL shaders then we
* forcibly disable the ActorMeta
*/
g_warning ("Unable to use the ShaderEffect: the graphics hardware "
"or the current GL driver does not implement support "
"for the GLSL shading language.");
clutter_actor_meta_set_enabled (CLUTTER_ACTOR_META (effect), FALSE);
return FALSE;
}
parent_class = CLUTTER_EFFECT_CLASS (clutter_desaturate_effect_parent_class);
return parent_class->pre_paint (effect, node, paint_context);
}
static void
clutter_desaturate_effect_dispose (GObject *gobject)
{
@@ -186,20 +211,27 @@ update_factor_uniform (ClutterDesaturateEffect *self)
static void
clutter_desaturate_effect_class_init (ClutterDesaturateEffectClass *klass)
{
ClutterEffectClass *effect_class = CLUTTER_EFFECT_CLASS (klass);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
ClutterOffscreenEffectClass *offscreen_class;
offscreen_class = CLUTTER_OFFSCREEN_EFFECT_CLASS (klass);
offscreen_class->create_pipeline = clutter_desaturate_effect_create_pipeline;
effect_class->pre_paint = clutter_desaturate_effect_pre_paint;
/**
* ClutterDesaturateEffect:factor:
*
* The desaturation factor, between 0.0 (no desaturation) and 1.0 (full
* desaturation).
*
* Since: 1.4
*/
obj_props[PROP_FACTOR] =
g_param_spec_double ("factor", NULL, NULL,
g_param_spec_double ("factor",
P_("Factor"),
P_("The desaturation factor"),
0.0, 1.0,
1.0,
CLUTTER_PARAM_READWRITE);
@@ -251,6 +283,8 @@ clutter_desaturate_effect_init (ClutterDesaturateEffect *self)
* clutter_actor_add_effect()
*
* Return value: the newly created #ClutterDesaturateEffect or %NULL
*
* Since: 1.4
*/
ClutterEffect *
clutter_desaturate_effect_new (gdouble factor)
@@ -269,15 +303,17 @@ clutter_desaturate_effect_new (gdouble factor)
*
* Sets the desaturation factor for @effect, with 0.0 being "do not desaturate"
* and 1.0 being "fully desaturate"
*
* Since: 1.4
*/
void
clutter_desaturate_effect_set_factor (ClutterDesaturateEffect *effect,
double factor)
gdouble factor)
{
g_return_if_fail (CLUTTER_IS_DESATURATE_EFFECT (effect));
g_return_if_fail (factor >= 0.0 && factor <= 1.0);
if (fabs (effect->factor - factor) >= 0.00001)
if (fabsf (effect->factor - factor) >= 0.00001)
{
effect->factor = factor;
update_factor_uniform (effect);
@@ -295,6 +331,8 @@ clutter_desaturate_effect_set_factor (ClutterDesaturateEffect *effect,
* Retrieves the desaturation factor of @effect
*
* Return value: the desaturation factor
*
* Since: 1.4
*/
gdouble
clutter_desaturate_effect_get_factor (ClutterDesaturateEffect *effect)

View File

@@ -22,13 +22,14 @@
* Emmanuele Bassi <ebassi@linux.intel.com>
*/
#pragma once
#ifndef __CLUTTER_DESATURATE_EFFECT_H__
#define __CLUTTER_DESATURATE_EFFECT_H__
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-effect.h"
#include <clutter/clutter-effect.h>
G_BEGIN_DECLS
@@ -36,6 +37,14 @@ G_BEGIN_DECLS
#define CLUTTER_DESATURATE_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_DESATURATE_EFFECT, ClutterDesaturateEffect))
#define CLUTTER_IS_DESATURATE_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_DESATURATE_EFFECT))
/**
* ClutterDesaturateEffect:
*
* #ClutterDesaturateEffect is an opaque structure
* whose members cannot be directly accessed
*
* Since: 1.4
*/
typedef struct _ClutterDesaturateEffect ClutterDesaturateEffect;
typedef struct _ClutterDesaturateEffectClass ClutterDesaturateEffectClass;
@@ -52,3 +61,5 @@ CLUTTER_EXPORT
gdouble clutter_desaturate_effect_get_factor (ClutterDesaturateEffect *effect);
G_END_DECLS
#endif /* __CLUTTER_DESATURATE_EFFECT_H__ */

View File

@@ -1,6 +1,6 @@
#include "clutter/clutter-build-config.h"
#include "clutter-build-config.h"
#include "clutter/clutter-easing.h"
#include "clutter-easing.h"
#include <math.h>

View File

@@ -1,6 +1,7 @@
#pragma once
#ifndef __CLUTTER_EASING_H__
#define __CLUTTER_EASING_H__
#include "clutter/clutter-types.h"
#include <clutter/clutter-types.h>
G_BEGIN_DECLS
@@ -137,3 +138,5 @@ double clutter_ease_cubic_bezier (double t,
double y_2);
G_END_DECLS
#endif /* __CLUTTER_EASING_H__ */

View File

@@ -1,6 +1,7 @@
#pragma once
#ifndef __CLUTTER_EFFECT_PRIVATE_H__
#define __CLUTTER_EFFECT_PRIVATE_H__
#include "clutter/clutter-effect.h"
#include <clutter/clutter-effect.h>
G_BEGIN_DECLS
@@ -15,3 +16,5 @@ void _clutter_effect_pick (ClutterEffect
ClutterPickContext *pick_context);
G_END_DECLS
#endif /* __CLUTTER_EFFECT_PRIVATE_H__ */

Some files were not shown because too many files have changed in this diff Show More