Compare commits
397 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b5808192f6 | |||
| 848000b419 | |||
| 2937d83e79 | |||
| b9b2ac2ce3 | |||
| ad041fc5d4 | |||
| 952f85c12d | |||
| 72d6241c84 | |||
| aac3f1860f | |||
| 6be27682a8 | |||
| 8931169e00 | |||
| 72785c68d6 | |||
| 5c831d030a | |||
| f17a924e7b | |||
| 2e542d8cae | |||
| 511a4ec475 | |||
| b76a2e44ba | |||
| d28b94f0cb | |||
| c4766b2747 | |||
| 98bdf67468 | |||
| dca57bebb7 | |||
| de9a5f94c2 | |||
| 659a129f81 | |||
| 0c8bdf2ac2 | |||
| 3d2dcb437c | |||
| 22de54a9dc | |||
| 4b5ed886ce | |||
| 821dd26934 | |||
| d6597098f1 | |||
| 4c1bc93f6f | |||
| ef9b844c7f | |||
| 681ec04b85 | |||
| 7dd3289837 | |||
| 7e54a7e5a5 | |||
| f050a9e889 | |||
| ae2964c7c6 | |||
| 54daad3878 | |||
| d7817e6fc6 | |||
| de94f3d97f | |||
| 066884aed1 | |||
| e7501185cd | |||
| a08277adcd | |||
| e8e69a1208 | |||
| e16414b3ac | |||
| 2e42786091 | |||
| b756aa0764 | |||
| 9654fd451f | |||
| 7d564ecdc9 | |||
| d850dfd245 | |||
| a6d5757627 | |||
| ad8a3e5b45 | |||
| 5b78fe2721 | |||
| 7c0a395ff9 | |||
| 41f26975a9 | |||
| 085374198f | |||
| 586675c902 | |||
| 1679fc8675 | |||
| 9cc1dcf2a4 | |||
| cc57692345 | |||
| a0db8a24c2 | |||
| e4be073f0a | |||
| 4ffefec469 | |||
| db2432b5db | |||
| 7d29b456b8 | |||
| 8fbb647daa | |||
| c28b8297ee | |||
| 4eb0dd7264 | |||
| b3d6972803 | |||
| 0eab3c3940 | |||
| 4cbfb69f74 | |||
| 4603e7bb18 | |||
| 8d504cae44 | |||
| 0f35ece2af | |||
| 204cac7ebf | |||
| 06a51b6ca6 | |||
| 853bfcb130 | |||
| 6a1f5c0af5 | |||
| 91e6f8e4b9 | |||
| bce90df49d | |||
| 58953671fe | |||
| df527758b1 | |||
| 3cd55fdf35 | |||
| 25783573c6 | |||
| 041a186272 | |||
| f5488bb4b2 | |||
| 86a38918d7 | |||
| 88f38f598b | |||
| 4aee6edbbd | |||
| adcec93b02 | |||
| 79ff151624 | |||
| 27f32b7f9b | |||
| 1771f75c6c | |||
| 979c418e46 | |||
| 28f63259ab | |||
| 105a2262dc | |||
| 3615619f41 | |||
| 0782bfa52b | |||
| ccd5565f75 | |||
| e502155dfa | |||
| 9261b0079d | |||
| 4638f942b8 | |||
| 982b4ff3b2 | |||
| 46483bebcd | |||
| e077a6bffe | |||
| 66dc193aeb | |||
| 39439aa838 | |||
| 018bd0a927 | |||
| 975ab6e7cf | |||
| 53c8975739 | |||
| 09176fc1b3 | |||
| 0f2582ff02 | |||
| a217be14f9 | |||
| e7b332c532 | |||
| 13382937d1 | |||
| c364f1ee12 | |||
| dd8c899737 | |||
| d69fdaa04d | |||
| 16eced7bf1 | |||
| 1276e8868d | |||
| 7539fb4ced | |||
| f24efd175e | |||
| df40efd50d | |||
| db5868d89b | |||
| 32796cad10 | |||
| b6a965a67c | |||
| 6136f3ab95 | |||
| d3e79633e1 | |||
| b362098f63 | |||
| 35583c8d36 | |||
| 581bfd20e4 | |||
| c5bbdfb7b1 | |||
| bcccb46b7c | |||
| 916328da2b | |||
| 6ca0d616d4 | |||
| 137af44f81 | |||
| 0441fd3678 | |||
| 3abc3425cb | |||
| 2017f3debe | |||
| 4b08570727 | |||
| 1042ca7e52 | |||
| 52e3ed13e2 | |||
| fb7257a1f5 | |||
| 83bf193218 | |||
| f1c1c979c2 | |||
| 6cfb6e0c9c | |||
| ef831235fe | |||
| 5286e9405d | |||
| c11ea42644 | |||
| d7c04145ee | |||
| 0d7a0132bb | |||
| cad32636ce | |||
| d125fcd35a | |||
| 88503bcc3b | |||
| e68925a932 | |||
| a6418d5028 | |||
| 04ebec0fa7 | |||
| aa0f564aa1 | |||
| 3cbf6c9d6e | |||
| a75de5fb90 | |||
| 1b66373a5d | |||
| 8786ac844c | |||
| 180dd5fb7f | |||
| a53650d9da | |||
| 0d4d52d322 | |||
| 896155fab7 | |||
| 727ec4cf7d | |||
| a52ee9ee22 | |||
| 94a9859391 | |||
| d1755337a2 | |||
| 092c166f54 | |||
| 13f8eeb3ee | |||
| 36768471e5 | |||
| 3cfe04aa74 | |||
| 4965a3ea4b | |||
| adc8a27f7a | |||
| 37d4dfb6b5 | |||
| d887af0748 | |||
| 803ba1da4f | |||
| 78eaad614a | |||
| 749425808d | |||
| 5e299cd3d2 | |||
| 8ab57fc8ef | |||
| 3a8e45963f | |||
| ff16446b0b | |||
| 82bcebe3de | |||
| a790764a7a | |||
| 248e33e3c9 | |||
| 44931aa8f8 | |||
| fb83adef25 | |||
| 08de13e9d2 | |||
| f66ffde68d | |||
| 52ac71b972 | |||
| 27eaca8b79 | |||
| 63dce34396 | |||
| 3585da6b7f | |||
| 9e29739e66 | |||
| 82395e73ad | |||
| 0237713c3a | |||
| 7e0e8365bd | |||
| fbd11fc595 | |||
| bebaac64e1 | |||
| 1d232a725f | |||
| fb4312738d | |||
| 918dd66dca | |||
| 6ceacee0f9 | |||
| f1e81d176c | |||
| 8d18b2b92d | |||
| 4a04e468fd | |||
| f8d1912098 | |||
| 0bd15b44f2 | |||
| e4fb6933d2 | |||
| 33cf8f9404 | |||
| 1640390839 | |||
| b01f28b9e2 | |||
| 62192cba6e | |||
| 586826d34c | |||
| c7a55faf37 | |||
| e81db46578 | |||
| e036eebde8 | |||
| dfa45c0da2 | |||
| 6692c7e9c4 | |||
| 671f33a7b8 | |||
| 0fee50d1a5 | |||
| 97d3363360 | |||
| 6eb3548192 | |||
| e5a47b5592 | |||
| 6c3119bc33 | |||
| 7900032f30 | |||
| a020cf7534 | |||
| 59f6c50df8 | |||
| bbd6fdaa04 | |||
| 6a7136d5fb | |||
| 95860d4989 | |||
| 37a561eb53 | |||
| ed0a2a203c | |||
| fc3aca8223 | |||
| 6ebb38e12e | |||
| 51ca454eef | |||
| fb100d719f | |||
| cf1974f6b1 | |||
| 3f4a0aa1f3 | |||
| 0cc2d5559b | |||
| b4ade026f1 | |||
| 102ca838b8 | |||
| 378ae4fbc1 | |||
| 00f079d705 | |||
| 54465adff2 | |||
| 29580d4252 | |||
| 25c3616a79 | |||
| 120399cc92 | |||
| 86e5ad85b7 | |||
| 04ad5e8936 | |||
| 9691a11076 | |||
| fef3ab0b62 | |||
| 493660a296 | |||
| 73f634435a | |||
| b17bba4af2 | |||
| ba1a084899 | |||
| 0e5a97ae58 | |||
| 7a306fe32f | |||
| ac7009d56c | |||
| c68247f63b | |||
| 668a2c0f3e | |||
| c435c7e764 | |||
| 4d36a4ebd7 | |||
| 703fc51d8e | |||
| fb008578b4 | |||
| adba0b972e | |||
| c77b98d716 | |||
| 8eda182f24 | |||
| 15e0c175a3 | |||
| bc953eebdd | |||
| 6238f97cb6 | |||
| 023924bca9 | |||
| af6432aa67 | |||
| 6c37158bbc | |||
| d030c92d63 | |||
| efe100df9e | |||
| a07ee709d2 | |||
| 60b77736b5 | |||
| 83ff85d227 | |||
| f7b3a214f3 | |||
| c1053096bd | |||
| f2b85fa1c7 | |||
| a48942bf39 | |||
| c1d6160bd4 | |||
| dbab69c453 | |||
| 09f0c96b9b | |||
| 641a589734 | |||
| 9bce70ed8d | |||
| d00d1334ce | |||
| fbe124ca54 | |||
| f680b86130 | |||
| dbc4e18bf8 | |||
| 924da0e84b | |||
| 38f14303d8 | |||
| b896b73e5e | |||
| 81a65690f8 | |||
| 33f7d96e8f | |||
| dcd549aebe | |||
| 8a4aee583c | |||
| ea21923932 | |||
| 5ca266f137 | |||
| b9f374c0c6 | |||
| a32b9d8b51 | |||
| c92b27f41b | |||
| 06bec5fb45 | |||
| e0be85ccca | |||
| 0c052c9a37 | |||
| a7bbc25851 | |||
| d6fab1408a | |||
| e14b84ff67 | |||
| aba2d994e6 | |||
| 57c032e6cc | |||
| f3fc8f5b35 | |||
| ba909cf901 | |||
| 1e9a36ffa8 | |||
| c6f357e447 | |||
| 2bcae546b3 | |||
| 291696607a | |||
| 87ba99f66b | |||
| fc20268cb8 | |||
| 64a959dad9 | |||
| 111929593a | |||
| 23bd7c1c05 | |||
| f99880a74a | |||
| 61bf5ac009 | |||
| ef07d1556b | |||
| dd5d1030b5 | |||
| f480ff2e4d | |||
| 9c919ffa46 | |||
| 2b131f09a8 | |||
| b165028e86 | |||
| 6e379181d9 | |||
| edf8c9e501 | |||
| f95f992d32 | |||
| 95cf34ab4c | |||
| 0cebf6d9c5 | |||
| de6b8da6c4 | |||
| 03f24bb5cf | |||
| 6ef3968227 | |||
| eb1a2268bb | |||
| 64193ae706 | |||
| 4682eb214a | |||
| 5a34b7ecc6 | |||
| eb0b98d5f2 | |||
| 89db59a40d | |||
| 9209fd65a5 | |||
| 7dd874cec8 | |||
| 4a5d15535e | |||
| c9a48736d6 | |||
| 8376f5c9fa | |||
| 1d94c75a78 | |||
| d840e082e6 | |||
| 2ed954d307 | |||
| 7b815768e0 | |||
| d89297b152 | |||
| ff038428d8 | |||
| 7321eb881a | |||
| 648e423cc5 | |||
| 09da4db81f | |||
| 16fd2608fd | |||
| c9c48d78bf | |||
| 50a8cbc0da | |||
| 188cb49b44 | |||
| 6da65b25b6 | |||
| 405cfc8f1f | |||
| 9daf83a1da | |||
| f7811f5dc3 | |||
| 25ec58be3c | |||
| 61a843e824 | |||
| 14cb208ec2 | |||
| c642649311 | |||
| 882c805b53 | |||
| 9cc7dbe9c9 | |||
| 3eac4ef5c9 | |||
| f1faa71d6d | |||
| a08bc46936 | |||
| c6a56b52dc | |||
| 63c61340ac | |||
| 09f99ffb27 | |||
| 3cc3a73d97 | |||
| d8a73cbd03 | |||
| 624f5ba0ec | |||
| ac81ed3adb | |||
| 5064a8eac0 | |||
| a4c6517d06 | |||
| 7ebc5454f4 | |||
| 35e6a2fdb8 | |||
| 69336fa5f1 | |||
| 2cbb955e49 | |||
| 42042e6811 | |||
| f8f669b895 | |||
| 7df347d9a5 | |||
| 7ed8a6ae3c | |||
| ff84b96480 | |||
| 64347f2c79 | |||
| 1af7cde1a8 |
@@ -4,6 +4,7 @@ AlwaysBreakAfterDefinitionReturnType: All
|
||||
BreakBeforeBinaryOperators: None
|
||||
BinPackParameters: false
|
||||
SpaceAfterCStyleCast: true
|
||||
PointerAlignment: Right
|
||||
# Our column limit is actually 80, but setting that results in clang-format
|
||||
# making a lot of dubious hanging-indent choices; disable it and assume the
|
||||
# developer will line wrap appropriately. clang-format will still check
|
||||
|
||||
+44
-3
@@ -3,6 +3,7 @@ include:
|
||||
file: 'flatpak/flatpak_ci_initiative.yml'
|
||||
|
||||
stages:
|
||||
- check
|
||||
- build
|
||||
- analysis
|
||||
- docs
|
||||
@@ -21,12 +22,12 @@ stages:
|
||||
|
||||
# Common variables
|
||||
variables:
|
||||
COMMON_MESON_FLAGS: "-Dwerror=true -Dglib:werror=false -Dpango:werror=false -Dgtk-doc:werror=false -Dwayland-protocols:werror=false -Dsysprof:werror=false"
|
||||
COMMON_MESON_FLAGS: "-Dwerror=true -Dglib:werror=false -Dpango:werror=false -Dgtk-doc:werror=false -Dwayland-protocols:werror=false -Dsysprof:werror=false -Dwayland:werror=false"
|
||||
BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true"
|
||||
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled"
|
||||
MESON_TEST_TIMEOUT_MULTIPLIER: 3
|
||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v38"
|
||||
FLATPAK_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master"
|
||||
FLATPAK_IMAGE: "quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master"
|
||||
|
||||
.only-default:
|
||||
only:
|
||||
@@ -37,7 +38,7 @@ variables:
|
||||
style-check-diff:
|
||||
extends: .only-default
|
||||
image: $FEDORA_IMAGE
|
||||
stage: .pre
|
||||
stage: check
|
||||
allow_failure: true
|
||||
script:
|
||||
- .gitlab-ci/run-style-check-diff.sh
|
||||
@@ -109,6 +110,29 @@ release-build:
|
||||
- ninja -C _build
|
||||
- .gitlab-ci/run-tests.sh _build x11
|
||||
|
||||
fedora-mingw64:
|
||||
extends: .build-fedora-default
|
||||
stage: build
|
||||
needs: []
|
||||
before_script:
|
||||
- sudo dnf install -y
|
||||
mingw64-filesystem
|
||||
mingw64-gcc
|
||||
mingw64-binutils
|
||||
mingw64-cairo
|
||||
mingw64-gdk-pixbuf
|
||||
mingw64-gstreamer1-plugins-bad-free
|
||||
mingw64-glib2
|
||||
mingw64-libepoxy
|
||||
mingw64-pango
|
||||
# mingw64-graphene (rawhide)
|
||||
script:
|
||||
- .gitlab-ci/show-info-linux.sh
|
||||
- meson subprojects update
|
||||
- mkdir _build && cd _build
|
||||
- mingw64-meson -Dintrospection=disabled -Dgraphene:introspection=disabled
|
||||
- ninja
|
||||
|
||||
installed-tests:
|
||||
extends: .build-fedora-default
|
||||
stage: build
|
||||
@@ -269,6 +293,18 @@ flatpak-main:icon-browser:
|
||||
variables:
|
||||
APPID: org.gtk.IconBrowser4
|
||||
|
||||
flatpak-manual:node-editor:
|
||||
extends: .flatpak-manual
|
||||
needs: []
|
||||
variables:
|
||||
APPID: org.gtk.gtk4.NodeEditor
|
||||
|
||||
flatpak-main:node-editor:
|
||||
extends: .flatpak-main
|
||||
needs: []
|
||||
variables:
|
||||
APPID: org.gtk.gtk4.NodeEditor
|
||||
|
||||
# Publish the demo apps to the GNOME Nightly repo
|
||||
# https://wiki.gnome.org/Apps/Nightly
|
||||
# https://gitlab.gnome.org/GNOME/Initiatives/-/wikis/DevOps-with-Flatpak
|
||||
@@ -287,6 +323,11 @@ nightly icon-browser:
|
||||
dependencies: ['flatpak-main:icon-browser']
|
||||
needs: ['flatpak-main:icon-browser']
|
||||
|
||||
nightly node-editor:
|
||||
extends: '.publish_nightly'
|
||||
dependencies: ['flatpak-main:node-editor']
|
||||
needs: ['flatpak-main:node-editor']
|
||||
|
||||
static-scan:
|
||||
image: $FEDORA_IMAGE
|
||||
stage: analysis
|
||||
|
||||
@@ -16,7 +16,7 @@ flatpak-builder \
|
||||
flatpak build ${builddir} meson \
|
||||
--prefix=/app \
|
||||
--libdir=/app/lib \
|
||||
--buildtype=release \
|
||||
--buildtype=debugoptimized \
|
||||
-Dx11-backend=true \
|
||||
-Dwayland-backend=true \
|
||||
-Dbuild-tests=false \
|
||||
|
||||
@@ -2,25 +2,43 @@
|
||||
|
||||
set -e
|
||||
|
||||
# We need to add a new remote for the upstream main, since this script could
|
||||
# be running in a personal fork of the repository which has out of date branches.
|
||||
if [ "${CI_PROJECT_NAMESPACE}" != "GNOME" ]; then
|
||||
echo "Retrieving the current upstream repository from ${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}..."
|
||||
ancestor_horizon=31 # days (one month)
|
||||
|
||||
# Recently, git is picky about directory ownership. Tell it not to worry.
|
||||
git config --global --add safe.directory "$PWD"
|
||||
|
||||
# We need to add a new remote for the upstream target branch, since this script
|
||||
# could be running in a personal fork of the repository which has out of date
|
||||
# branches.
|
||||
#
|
||||
# Limit the fetch to a certain date horizon to limit the amount of data we get.
|
||||
# If the branch was forked from origin/main before this horizon, it should
|
||||
# probably be rebased.
|
||||
if ! git ls-remote --exit-code upstream >/dev/null 2>&1 ; then
|
||||
git remote add upstream https://gitlab.gnome.org/GNOME/gtk.git
|
||||
git fetch upstream
|
||||
ORIGIN="upstream"
|
||||
else
|
||||
echo "Reusing the existing repository on ${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}"
|
||||
ORIGIN="origin"
|
||||
fi
|
||||
|
||||
# Work out the newest common ancestor between the detached HEAD that this CI job
|
||||
# has checked out, and the upstream target branch (which will typically be
|
||||
# `upstream/main` or `upstream/gtk-3-24`).
|
||||
#
|
||||
# `${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}` is only defined if we’re running in
|
||||
# a merge request pipeline; fall back to `${CI_DEFAULT_BRANCH}` otherwise.
|
||||
newest_common_ancestor_sha=$(diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent "${ORIGIN}/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_DEFAULT_BRANCH}}") <(git rev-list --first-parent HEAD) | head -1)
|
||||
# `upstream/main` or `upstream/glib-2-62`).
|
||||
# `${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}` or `${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}`
|
||||
# are only defined if we’re running in a merge request pipeline,
|
||||
# fall back to `${CI_DEFAULT_BRANCH}` or `${CI_COMMIT_BRANCH}` respectively
|
||||
# otherwise.
|
||||
|
||||
source_branch="${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-${CI_COMMIT_BRANCH}}"
|
||||
target_branch="${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_DEFAULT_BRANCH}}"
|
||||
git fetch --shallow-since="$(date --date="${ancestor_horizon} days ago" +%Y-%m-%d)" origin "${source_branch}"
|
||||
git fetch --shallow-since="$(date --date="${ancestor_horizon} days ago" +%Y-%m-%d)" upstream "${target_branch}"
|
||||
|
||||
newest_common_ancestor_sha=$(git merge-base upstream/${target_branch} origin/${source_branch})
|
||||
if [ -z "${newest_common_ancestor_sha}" ]; then
|
||||
echo "Couldn’t find common ancestor with upstream main branch. This typically"
|
||||
echo "happens if you branched from main a long time ago. Please update"
|
||||
echo "your clone, rebase, and re-push your branch."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git diff -U0 --no-color "${newest_common_ancestor_sha}" | .gitlab-ci/clang-format-diff.py -binary "clang-format" -p1
|
||||
exit_status=$?
|
||||
|
||||
@@ -36,7 +54,7 @@ exit_status=$?
|
||||
echo ""
|
||||
echo "Note that clang-format output is advisory and cannot always match the"
|
||||
echo "GTK coding style, documented at:"
|
||||
echo " https://gitlab.gnome.org/GNOME/gtk/blob/main/docs/CODING-STYLE"
|
||||
echo " https://gitlab.gnome.org/GNOME/gtk/blob/main/docs/CODING-STYLE.md"
|
||||
echo "Warnings from this tool can be ignored in favour of the documented "
|
||||
echo "coding style, or in favour of matching the style of existing"
|
||||
echo "surrounding code."
|
||||
|
||||
@@ -38,25 +38,6 @@ mkdir -p _ccache
|
||||
export CCACHE_BASEDIR="$(pwd)"
|
||||
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
|
||||
|
||||
# https://gitlab.gnome.org/GNOME/gtk/-/issues/2243
|
||||
# https://gitlab.gnome.org/GNOME/gtk/-/issues/3002
|
||||
|
||||
if ! pkg-config --atleast-version=2.66.0 glib-2.0; then
|
||||
git clone https://gitlab.gnome.org/GNOME/glib.git _glib
|
||||
meson setup _glib_build _glib
|
||||
meson compile -C _glib_build
|
||||
meson install -C _glib_build
|
||||
fi
|
||||
pkg-config --modversion glib-2.0
|
||||
|
||||
if ! pkg-config --atleast-version=1.50.0 pango; then
|
||||
git clone https://gitlab.gnome.org/GNOME/pango.git _pango
|
||||
meson setup _pango_build _pango
|
||||
meson compile -C _pango_build
|
||||
meson install -C _pango_build
|
||||
fi
|
||||
pkg-config --modversion pango
|
||||
|
||||
# Build
|
||||
ccache --zero-stats
|
||||
ccache --show-stats
|
||||
|
||||
@@ -1,3 +1,151 @@
|
||||
Overview of Changes in 4.8.0, 06-09-2022
|
||||
========================================
|
||||
|
||||
* GtkTreeView:
|
||||
- Fix a problem with scrolling animations
|
||||
- Fix some event handling problems
|
||||
- Drop unreachable code
|
||||
|
||||
* GtkText:
|
||||
- Respect the no-emoji input hint fully
|
||||
|
||||
* GtkEmojiChooser:
|
||||
- Fix arrow key navigation
|
||||
|
||||
* GtkFontChooser:
|
||||
- Improve the handling of OpenType font features
|
||||
|
||||
* GtkTreeListModel:
|
||||
- Fix handling of collapsed child nodes
|
||||
|
||||
* GtkInscription:
|
||||
- Fix accessible name
|
||||
|
||||
* Theme:
|
||||
- Fix placeholder text in HighContrast
|
||||
|
||||
* Increase the memory limit for the jpeg loader to 300M
|
||||
|
||||
* Miscellaneous memory leak fixes
|
||||
|
||||
* Wayland:
|
||||
- Refator handling of text protocol client updates
|
||||
|
||||
* Windows:
|
||||
- Support high-resolution scroll wheel events
|
||||
- Generate GdkWin32.gir
|
||||
- Implement color picking
|
||||
|
||||
* Translation updates
|
||||
Abkhazian
|
||||
Basque
|
||||
Brazilian Portuguese
|
||||
Bulgarian
|
||||
Catalan
|
||||
Chinese (China)
|
||||
Croatian
|
||||
Czech
|
||||
Danish
|
||||
Dutch
|
||||
Galician
|
||||
Georgian
|
||||
German
|
||||
Hungarian
|
||||
Icelandic
|
||||
Indonesian
|
||||
Korean
|
||||
Latvian
|
||||
Lithuanian
|
||||
Persian
|
||||
Polish
|
||||
Portuguese
|
||||
Russian
|
||||
Serbian
|
||||
Spanish
|
||||
Swedish
|
||||
Turkish
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in 4.7.2, 10-08-2022
|
||||
========================================
|
||||
|
||||
* GtkTextView:
|
||||
- Fix child positioning with gutters
|
||||
|
||||
* GtkText:
|
||||
- Update placeholder visibility when necessary
|
||||
|
||||
* GtkPicture:
|
||||
- Add a content-fit property
|
||||
|
||||
* GtkPopover:
|
||||
- Fix a size allocation problem with the arrow
|
||||
|
||||
* GtkTreeView:
|
||||
- Fix a problem with DND
|
||||
|
||||
* GtkTreePopover:
|
||||
- Support scrolling
|
||||
|
||||
* GtkGridView:
|
||||
- Fix issues with rubberband selection
|
||||
|
||||
* GtkLabel:
|
||||
- Add a tabs property
|
||||
|
||||
* GtkSnapshot:
|
||||
- Make GtkSnapshot work from bindings
|
||||
|
||||
* GtkScrolledWindow:
|
||||
- Scroll at a reasonable speed
|
||||
|
||||
* GtkPaned:
|
||||
- Avoid an infinite loop
|
||||
|
||||
* GtkWindow:
|
||||
- Improve generation and handling of crossing events
|
||||
|
||||
* CSS:
|
||||
- Fix handling of certain transform values
|
||||
|
||||
* Media support:
|
||||
- Add audio support to the ffmpeg backend
|
||||
- Avoid oom with pathological jpeg images
|
||||
|
||||
* GDK:
|
||||
- Fix handling of touchpad hold events
|
||||
- Add support for hi-resolution scroll events
|
||||
|
||||
* X11:
|
||||
- Fix preferred action for DND
|
||||
|
||||
* Windows:
|
||||
- Fix DND
|
||||
|
||||
* List models:
|
||||
- Fix items-changed emission
|
||||
- Add more list model tests
|
||||
|
||||
* Demos:
|
||||
- Add a winning sound to game demos
|
||||
- Make app icons work uninstalled
|
||||
|
||||
* Translation updates:
|
||||
Abkhazian
|
||||
Basque
|
||||
Catalan
|
||||
Georgian
|
||||
German
|
||||
Indonesian
|
||||
Occitan
|
||||
Persian
|
||||
Portuguese
|
||||
Russian
|
||||
Spanish
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in 4.7.1, 12-07-2022
|
||||
========================================
|
||||
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
{
|
||||
"app-id" : "org.gtk.gtk4.NodeEditor",
|
||||
"runtime" : "org.gnome.Platform",
|
||||
"runtime-version" : "master",
|
||||
"sdk" : "org.gnome.Sdk",
|
||||
"command" : "gtk4-node-editor",
|
||||
"tags" : [
|
||||
"devel",
|
||||
"development",
|
||||
"nightly"
|
||||
],
|
||||
"desktop-file-name-prefix" : "(Development) ",
|
||||
"finish-args" : [
|
||||
"--device=dri",
|
||||
"--share=ipc",
|
||||
"--socket=fallback-x11",
|
||||
"--socket=wayland",
|
||||
"--talk-name=org.gtk.vfs",
|
||||
"--talk-name=org.gtk.vfs.*"
|
||||
],
|
||||
"cleanup" : [
|
||||
"/include",
|
||||
"/lib/pkgconfig",
|
||||
"/share/pkgconfig",
|
||||
"/share/aclocal",
|
||||
"/man",
|
||||
"/share/man",
|
||||
"/share/gtk-doc",
|
||||
"*.la",
|
||||
".a",
|
||||
"/lib/girepository-1.0",
|
||||
"/share/gir-1.0",
|
||||
"/share/doc"
|
||||
],
|
||||
"modules" : [
|
||||
{
|
||||
"name" : "wayland",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts" : [
|
||||
"-Ddocumentation=false"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://gitlab.freedesktop.org/wayland/wayland.git",
|
||||
"branch" : "main"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "graphene",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts" : [
|
||||
"--libdir=/app/lib",
|
||||
"-Dtests=false"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://github.com/ebassi/graphene.git"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "libsass",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts" : [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://github.com/lazka/libsass.git",
|
||||
"branch" : "meson"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "sassc",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts" : [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://github.com/lazka/sassc.git",
|
||||
"branch" : "meson"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "pango",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts" : [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://gitlab.gnome.org/GNOME/pango.git",
|
||||
"branch" : "main"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "gtk",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts" : [
|
||||
"--libdir=/app/lib",
|
||||
"-Dvulkan=disabled",
|
||||
"-Dbuildtype=debugoptimized",
|
||||
"-Dprofile=devel"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://gitlab.gnome.org/GNOME/gtk.git",
|
||||
"branch" : "main"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"build-options" : {
|
||||
"env" : {
|
||||
"DBUS_SESSION_BUS_ADDRESS" : "''",
|
||||
"GSK_RENDERER" : "opengl",
|
||||
"GDK_DEBUG" : "vulkan-disable",
|
||||
"G_ENABLE_DEBUG" : "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -428,6 +428,8 @@
|
||||
<file>icons/16x16/emotes/face-laugh-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/status/battery-caution-charging-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/categories/applications-other.png</file>
|
||||
<file>icons/48x48/status/starred.png</file>
|
||||
<file alias="icons/scalable/apps/org.gtk.Demo4.svg">data/scalable/apps/org.gtk.Demo4.svg</file>
|
||||
</gresource>
|
||||
<gresource prefix="/org/gtk/Demo4/gtk">
|
||||
<file preprocess="xml-stripblanks">help-overlay.ui</file>
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
--- demos/gtk-demo/font_features.c
|
||||
+++ demos/gtk-demo/font_features.c
|
||||
@@ -434,7 +434,7 @@ static void
|
||||
update_display (void)
|
||||
{
|
||||
GString *s;
|
||||
- const char *text;
|
||||
+ char *text;
|
||||
gboolean has_feature;
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel *model;
|
||||
@@ -452,8 +452,12 @@ update_display (void)
|
||||
gboolean do_waterfall;
|
||||
GString *waterfall;
|
||||
char *palette;
|
||||
+ GtkTextBuffer *buffer;
|
||||
+ GtkTextIter start_iter, end_iter;
|
||||
|
||||
- text = gtk_editable_get_text (GTK_EDITABLE (demo->the_entry));
|
||||
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (demo->the_entry));
|
||||
+ gtk_text_buffer_get_bounds (buffer, &start_iter, &end_iter);
|
||||
+ text = gtk_text_buffer_get_text (buffer, &start_iter, &end_iter, FALSE);
|
||||
text_len = strlen (text);
|
||||
|
||||
do_waterfall = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (demo->waterfall_toggle));
|
||||
@@ -631,6 +635,8 @@ update_display (void)
|
||||
pango2_font_description_free (desc);
|
||||
g_free (features);
|
||||
pango2_attr_list_unref (attrs);
|
||||
+
|
||||
+ g_free (text);
|
||||
}
|
||||
|
||||
static Pango2Font *
|
||||
@@ -1603,8 +1609,12 @@ font_features_toggle_edit (void)
|
||||
{
|
||||
if (strcmp (gtk_stack_get_visible_child_name (GTK_STACK (demo->stack)), "entry") != 0)
|
||||
{
|
||||
+ GtkTextBuffer *buffer;
|
||||
+ GtkTextIter start, end;
|
||||
g_free (demo->text);
|
||||
- demo->text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (demo->the_entry)));
|
||||
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (demo->the_entry));
|
||||
+ gtk_text_buffer_get_bounds (buffer, &start, &end);
|
||||
+ demo->text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
|
||||
gtk_stack_set_visible_child_name (GTK_STACK (demo->stack), "entry");
|
||||
gtk_widget_grab_focus (demo->the_entry);
|
||||
gtk_adjustment_set_value (gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (demo->swin)), 0);
|
||||
@@ -1632,7 +1642,7 @@ entry_key_press (GtkEventController *controller,
|
||||
{
|
||||
if (keyval == GDK_KEY_Escape)
|
||||
{
|
||||
- gtk_editable_set_text (GTK_EDITABLE (entry), demo->text);
|
||||
+ gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (demo->the_entry)), demo->text, -1);
|
||||
return GDK_EVENT_STOP;
|
||||
}
|
||||
|
||||
@@ -1701,7 +1711,6 @@ do_font_features (GtkWidget *do_widget)
|
||||
basic_value_changed (demo->line_height_adjustment, demo->line_height_entry);
|
||||
|
||||
controller = gtk_event_controller_key_new ();
|
||||
- g_object_set_data_full (G_OBJECT (demo->the_entry), "controller", g_object_ref (controller), g_object_unref);
|
||||
g_signal_connect (controller, "key-pressed", G_CALLBACK (entry_key_press), demo->the_entry);
|
||||
gtk_widget_add_controller (demo->the_entry, controller);
|
||||
|
||||
@@ -217,30 +217,39 @@ update_image (void)
|
||||
text = " ";
|
||||
|
||||
ch = g_utf8_get_char (text);
|
||||
|
||||
str = g_string_new ("");
|
||||
layout = pango_layout_new (context);
|
||||
|
||||
retry:
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
g_string_append_unichar (str, ch);
|
||||
g_string_append_unichar (str, 0x200c);
|
||||
}
|
||||
|
||||
layout = pango_layout_new (context);
|
||||
pango_layout_set_font_description (layout, desc);
|
||||
pango_layout_set_text (layout, str->str, -1);
|
||||
g_string_free (str, TRUE);
|
||||
pango_layout_get_extents (layout, &ink, &logical);
|
||||
pango_extents_to_pixels (&logical, NULL);
|
||||
|
||||
iter = pango_layout_get_iter (layout);
|
||||
run = pango_layout_iter_get_run (iter);
|
||||
|
||||
if (run->glyphs->num_glyphs < 8)
|
||||
{
|
||||
/* not a good char to use */
|
||||
g_string_truncate (str, 0);
|
||||
ch = 'a';
|
||||
goto retry;
|
||||
}
|
||||
|
||||
g_string_free (str, TRUE);
|
||||
|
||||
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, logical.width * 3 / 2, 4*logical.height);
|
||||
cr = cairo_create (surface);
|
||||
cairo_set_source_rgb (cr, 1, 1, 1);
|
||||
cairo_paint (cr);
|
||||
|
||||
iter = pango_layout_get_iter (layout);
|
||||
run = pango_layout_iter_get_run (iter);
|
||||
|
||||
cairo_set_source_rgb (cr, 0, 0, 0);
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
|
||||
@@ -223,6 +223,7 @@ static void
|
||||
destroy_gear (struct gear *g)
|
||||
{
|
||||
g_free (g->strips);
|
||||
g_free (g->vertices);
|
||||
g_free (g);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
@@ -8,6 +8,7 @@
|
||||
* to implement rather different interaction behavior to a typical list.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
@@ -375,6 +376,23 @@ sweeper_game_init (SweeperGame *self)
|
||||
sweeper_game_new_game (self, 8, 8, 10);
|
||||
}
|
||||
|
||||
static void
|
||||
celebrate (gboolean win)
|
||||
{
|
||||
char *path;
|
||||
GtkMediaStream *stream;
|
||||
|
||||
if (win)
|
||||
path = g_build_filename (GTK_DATADIR, "sounds", "freedesktop", "stereo", "complete.oga", NULL);
|
||||
else
|
||||
path = g_build_filename (GTK_DATADIR, "sounds", "freedesktop", "stereo", "suspend-error.oga", NULL);
|
||||
stream = gtk_media_file_new_for_filename (path);
|
||||
gtk_media_stream_set_volume (stream, 1.0);
|
||||
gtk_media_stream_play (stream);
|
||||
g_signal_connect (stream, "notify::ended", G_CALLBACK (g_object_unref), NULL);
|
||||
g_free (path);
|
||||
}
|
||||
|
||||
static void
|
||||
sweeper_game_end (SweeperGame *self,
|
||||
gboolean win)
|
||||
@@ -383,7 +401,9 @@ sweeper_game_end (SweeperGame *self,
|
||||
{
|
||||
self->playing = FALSE;
|
||||
g_object_notify_by_pspec (G_OBJECT (self), game_properties[GAME_PROP_PLAYING]);
|
||||
celebrate (win);
|
||||
}
|
||||
|
||||
if (self->win != win)
|
||||
{
|
||||
self->win = win;
|
||||
|
||||
@@ -119,12 +119,6 @@ solitaire_peg_new (void)
|
||||
|
||||
/*** Helper for finding a win ***/
|
||||
|
||||
static void
|
||||
ended (GObject *object)
|
||||
{
|
||||
g_object_unref (object);
|
||||
}
|
||||
|
||||
static void
|
||||
celebrate (gboolean win)
|
||||
{
|
||||
@@ -134,12 +128,12 @@ celebrate (gboolean win)
|
||||
if (win)
|
||||
path = g_build_filename (GTK_DATADIR, "sounds", "freedesktop", "stereo", "complete.oga", NULL);
|
||||
else
|
||||
path = g_build_filename (GTK_DATADIR, "sounds", "freedesktop", "stereo", "dialog-error.oga", NULL);
|
||||
path = g_build_filename (GTK_DATADIR, "sounds", "freedesktop", "stereo", "suspend-error.oga", NULL);
|
||||
stream = gtk_media_file_new_for_filename (path);
|
||||
gtk_media_stream_set_volume (stream, 1.0);
|
||||
gtk_media_stream_play (stream);
|
||||
|
||||
g_signal_connect (stream, "notify::ended", G_CALLBACK (ended), NULL);
|
||||
g_signal_connect (stream, "notify::ended", G_CALLBACK (g_object_unref), NULL);
|
||||
g_free (path);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* small sliding puzzle game.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/* Include the header for the puzzle piece */
|
||||
@@ -24,6 +25,30 @@ static guint height = 3;
|
||||
static guint pos_x;
|
||||
static guint pos_y;
|
||||
|
||||
static void
|
||||
ended (GObject *object)
|
||||
{
|
||||
g_object_unref (object);
|
||||
}
|
||||
|
||||
static void
|
||||
celebrate (gboolean win)
|
||||
{
|
||||
char *path;
|
||||
GtkMediaStream *stream;
|
||||
|
||||
if (win)
|
||||
path = g_build_filename (GTK_DATADIR, "sounds", "freedesktop", "stereo", "complete.oga", NULL);
|
||||
else
|
||||
path = g_build_filename (GTK_DATADIR, "sounds", "freedesktop", "stereo", "suspend-error.oga", NULL);
|
||||
stream = gtk_media_file_new_for_filename (path);
|
||||
gtk_media_stream_set_volume (stream, 1.0);
|
||||
gtk_media_stream_play (stream);
|
||||
|
||||
g_signal_connect (stream, "notify::ended", G_CALLBACK (ended), NULL);
|
||||
g_free (path);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
move_puzzle (GtkWidget *grid,
|
||||
int dx,
|
||||
@@ -157,6 +182,8 @@ check_solved (GtkWidget *grid)
|
||||
picture = gtk_grid_get_child_at (GTK_GRID (grid), pos_x, pos_y);
|
||||
gtk_picture_set_paintable (GTK_PICTURE (picture), piece);
|
||||
|
||||
celebrate (TRUE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -330,7 +357,7 @@ start_puzzle (GdkPaintable *paintable)
|
||||
x, y,
|
||||
width, height);
|
||||
picture = gtk_picture_new_for_paintable (piece);
|
||||
gtk_picture_set_keep_aspect_ratio (GTK_PICTURE (picture), FALSE);
|
||||
gtk_picture_set_content_fit (GTK_PICTURE (picture), GTK_CONTENT_FIT_FILL);
|
||||
gtk_grid_attach (GTK_GRID (grid),
|
||||
picture,
|
||||
x, y,
|
||||
|
||||
@@ -216,7 +216,6 @@
|
||||
<child>
|
||||
<object class="GtkPicture" id="picture">
|
||||
<property name="can-shrink">0</property>
|
||||
<property name="keep-aspect-ratio">1</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<child>
|
||||
|
||||
@@ -13,6 +13,8 @@ Each node has its own `<node-name>` and supports a custom set of properties, eac
|
||||
|
||||
When serializing and the value of a property equals the default value, this value will not be serialized. Serialization aims to produce an output as small as possible.
|
||||
|
||||
To embed newlines in strings, use \A. To break a long string into multiple lines, escape the newline with a \.
|
||||
|
||||
# Nodes
|
||||
|
||||
### container
|
||||
@@ -135,6 +137,23 @@ Creates a node like `gsk_cross_fade_node_new()` with the given properties.
|
||||
|
||||
Creates a node like `gsk_debug_node_new()` with the given properties.
|
||||
|
||||
### glshader
|
||||
|
||||
| property | syntax | default | printed |
|
||||
| ---------- | ------------------ | ---------------------- | ----------- |
|
||||
| bounds | `<rect>` | 50 | always |
|
||||
| sourcecode | `<string>` | "" | always |
|
||||
| args | `<uniform values>` | none | non-default |
|
||||
| child1 | `<node>` | none | non-default |
|
||||
| child2 | `<node>` | none | non-default |
|
||||
| child3 | `<node>` | none | non-default |
|
||||
| child4 | `<node>` | none | non-default |
|
||||
|
||||
Creates a GLShader node. The `sourcecode` must be a GLSL fragment shader.
|
||||
The `args` must match the uniforms of simple types declared in that shader,
|
||||
in order and comma-separated. The `child` properties must match the sampler
|
||||
uniforms in the shader.
|
||||
|
||||
### inset-shadow
|
||||
|
||||
| property | syntax | default | printed |
|
||||
@@ -286,20 +305,3 @@ representation for this texture is `url("data:image/png;base64,iVBORw0KGgoAAAANS
|
||||
| transform| `<transform>` | none | non-default |
|
||||
|
||||
Creates a node like `gsk_transform_node_new()` with the given properties.
|
||||
|
||||
### glshader
|
||||
|
||||
| property | syntax | default | printed |
|
||||
| ---------- | ------------------ | ---------------------- | ----------- |
|
||||
| bounds | `<rect>` | 50 | always |
|
||||
| sourcecode | `<string>` | "" | always |
|
||||
| args | `<uniform values>` | none | non-default |
|
||||
| child1 | `<node>` | none | non-default |
|
||||
| child2 | `<node>` | none | non-default |
|
||||
| child3 | `<node>` | none | non-default |
|
||||
| child4 | `<node>` | none | non-default |
|
||||
|
||||
Creates a GLShader node. The `sourcecode` must be a GLSL fragment shader.
|
||||
The `args` must match the uniforms of simple types declared in that shader,
|
||||
in order and comma-separated. The `child` properties must match the sampler
|
||||
uniforms in the shader.
|
||||
|
||||
@@ -213,6 +213,31 @@ activate_background (GSimpleAction *action,
|
||||
populate_flowbox (flowbox);
|
||||
}
|
||||
|
||||
static void
|
||||
file_chooser_response (GtkNativeDialog *self,
|
||||
int response)
|
||||
{
|
||||
gtk_native_dialog_destroy (self);
|
||||
}
|
||||
|
||||
static void
|
||||
activate_open_file (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkFileChooserNative *chooser;
|
||||
|
||||
chooser = gtk_file_chooser_native_new ("Open file",
|
||||
NULL,
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
"Open",
|
||||
"Cancel");
|
||||
|
||||
g_signal_connect (chooser, "response", G_CALLBACK (file_chooser_response), NULL);
|
||||
|
||||
gtk_native_dialog_show (GTK_NATIVE_DIALOG (chooser));
|
||||
}
|
||||
|
||||
static void
|
||||
activate_open (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
@@ -2451,7 +2476,7 @@ main (int argc, char *argv[])
|
||||
{ "share", activate_action, NULL, NULL, NULL },
|
||||
{ "labels", activate_action, NULL, NULL, NULL },
|
||||
{ "new", activate_action, NULL, NULL, NULL },
|
||||
{ "open", activate_action, NULL, NULL, NULL },
|
||||
{ "open", activate_open_file, NULL, NULL, NULL },
|
||||
{ "open-in", activate_action, NULL, NULL, NULL },
|
||||
{ "open-tab", activate_action, NULL, NULL, NULL },
|
||||
{ "open-window", activate_action, NULL, NULL, NULL },
|
||||
|
||||
@@ -111,6 +111,8 @@
|
||||
<file>icons/scalable/status/weather-showers-symbolic.svg</file>
|
||||
<file>icons/scalable/status/weather-snow-symbolic.svg</file>
|
||||
|
||||
<file alias='icons/scalable/apps/org.gtk.WidgetFactory4.svg'>data/scalable/apps/org.gtk.WidgetFactory4.svg</file>
|
||||
|
||||
</gresource>
|
||||
<gresource prefix="/org/gtk/WidgetFactory4">
|
||||
<file>gtk-logo.webm</file>
|
||||
|
||||
@@ -1265,6 +1265,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<property name="child">
|
||||
<object class="GtkPicture">
|
||||
<property name="file">resource:///org/gtk/WidgetFactory4/sunset.jpg</property>
|
||||
<property name="content-fit">cover</property>
|
||||
<child>
|
||||
<object class="GtkDragSource">
|
||||
<signal name="prepare" handler="on_picture_drag_prepare" swapped="no"/>
|
||||
|
||||
@@ -339,6 +339,20 @@ using and the GDK backend supports them:
|
||||
`vulkan`
|
||||
: Selects the Vulkan renderer
|
||||
|
||||
Note that on Windows, if one is running Nahimic 3 on a system with
|
||||
nVidia graphics, one needs to stop the "Nahimic service" or insert
|
||||
the GTK application into the Nahimic blacklist, as noted in
|
||||
https://www.nvidia.com/en-us/geforce/forums/game-ready-drivers/13/297952/nahimic-and-nvidia-drivers-conflict/2334568/, or use the cairo renderer (at the cost of being unable to use
|
||||
OpenGL features), or use GDK_DEBUG=gl-gles if you know that GLES
|
||||
support is enabled for the build.
|
||||
|
||||
This is a known issue, as the above link indicates, and affects quite
|
||||
a number of applications--sadly, since this issue lies within the
|
||||
nVidia graphics driver and/or the Nahimic 3 code, we are not able
|
||||
to rememdy this on the GTK side; the best bet before trying the above
|
||||
workarounds is to try to update your graphics drivers and Nahimic
|
||||
installation.
|
||||
|
||||
### `GTK_CSD`
|
||||
|
||||
The default value of this environment variable is `1`. If changed
|
||||
|
||||
@@ -47,6 +47,10 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if !GLIB_CHECK_VERSION (2, 67, 3)
|
||||
# define g_memdup2(mem,size) g_memdup((mem), (size))
|
||||
#endif
|
||||
|
||||
/* Forward declarations */
|
||||
static void gdk_broadway_surface_finalize (GObject *object);
|
||||
|
||||
|
||||
+27
-17
@@ -97,7 +97,7 @@ add_files (GDBusProxy *proxy,
|
||||
AddFileData *afd)
|
||||
{
|
||||
GUnixFDList *fd_list;
|
||||
GVariantBuilder fds;
|
||||
GVariantBuilder fds, options;
|
||||
int i;
|
||||
char *key;
|
||||
|
||||
@@ -146,9 +146,10 @@ add_files (GDBusProxy *proxy,
|
||||
|
||||
key = (char *)g_object_get_data (G_OBJECT (afd->task), "key");
|
||||
|
||||
g_variant_builder_init (&options, G_VARIANT_TYPE_VARDICT);
|
||||
g_dbus_proxy_call_with_unix_fd_list (proxy,
|
||||
"AddFiles",
|
||||
g_variant_new ("(sah)", key, &fds),
|
||||
g_variant_new ("(saha{sv})", key, &fds, &options),
|
||||
0, -1,
|
||||
fd_list,
|
||||
NULL,
|
||||
@@ -480,20 +481,8 @@ connection_closed (GDBusConnection *connection,
|
||||
}
|
||||
|
||||
static void
|
||||
got_proxy (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer data)
|
||||
finish_registration (void)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
file_transfer_proxy = g_dbus_proxy_new_for_bus_finish (result, &error);
|
||||
if (!file_transfer_proxy)
|
||||
{
|
||||
g_message ("Failed to get file transfer portal: %s", error->message);
|
||||
g_clear_error (&error);
|
||||
return;
|
||||
}
|
||||
|
||||
gdk_content_register_serializer (G_TYPE_FILE,
|
||||
"application/vnd.portal.files",
|
||||
portal_file_serializer,
|
||||
@@ -523,6 +512,21 @@ got_proxy (GObject *source,
|
||||
"closed", G_CALLBACK (connection_closed), NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
proxy_has_owner (GDBusProxy *proxy)
|
||||
{
|
||||
char *owner;
|
||||
|
||||
owner = g_dbus_proxy_get_name_owner (proxy);
|
||||
if (owner)
|
||||
{
|
||||
g_free (owner);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
file_transfer_portal_register (void)
|
||||
{
|
||||
@@ -531,7 +535,8 @@ file_transfer_portal_register (void)
|
||||
if (!called)
|
||||
{
|
||||
called = TRUE;
|
||||
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
|
||||
|
||||
file_transfer_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
|
||||
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES
|
||||
| G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS
|
||||
| G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
|
||||
@@ -540,8 +545,13 @@ file_transfer_portal_register (void)
|
||||
"/org/freedesktop/portal/documents",
|
||||
"org.freedesktop.portal.FileTransfer",
|
||||
NULL,
|
||||
got_proxy,
|
||||
NULL);
|
||||
|
||||
if (file_transfer_proxy && !proxy_has_owner (file_transfer_proxy))
|
||||
g_clear_object (&file_transfer_proxy);
|
||||
|
||||
if (file_transfer_proxy)
|
||||
finish_registration ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,4 +59,8 @@ void gdk_source_set_static_name_by_id (guint tag,
|
||||
#define g_source_set_static_name(source, name) g_source_set_name ((source), (name))
|
||||
#endif
|
||||
|
||||
#ifndef I_
|
||||
#define I_(string) g_intern_static_string (string)
|
||||
#endif
|
||||
|
||||
#endif /* __GDK__PRIVATE_H__ */
|
||||
|
||||
+2
-1
@@ -29,6 +29,7 @@
|
||||
#include "gdkintl.h"
|
||||
#include "gdkpipeiostreamprivate.h"
|
||||
#include "gdktexture.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include <gobject/gvaluecollector.h>
|
||||
|
||||
@@ -408,7 +409,7 @@ gdk_clipboard_class_init (GdkClipboardClass *class)
|
||||
* Emitted when the clipboard changes ownership.
|
||||
*/
|
||||
signals[CHANGED] =
|
||||
g_signal_new ("changed",
|
||||
g_signal_new (I_("changed"),
|
||||
G_TYPE_FROM_CLASS (class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkClipboardClass, changed),
|
||||
|
||||
@@ -407,8 +407,6 @@ gdk_content_register_deserializer (const char *mime_type,
|
||||
g_return_if_fail (mime_type != NULL);
|
||||
g_return_if_fail (deserialize != NULL);
|
||||
|
||||
init ();
|
||||
|
||||
deserializer = g_slice_new0 (Deserializer);
|
||||
|
||||
deserializer->mime_type = g_intern_string (mime_type);
|
||||
|
||||
+50
-4
@@ -184,7 +184,7 @@ gdk_content_formats_new_for_gtype (GType type)
|
||||
* @string: the string to parse
|
||||
*
|
||||
* Parses the given @string into `GdkContentFormats` and
|
||||
* returns the formats.
|
||||
* returns the formats.
|
||||
*
|
||||
* Strings printed via [method@Gdk.ContentFormats.to_string]
|
||||
* can be read in again successfully using this function.
|
||||
@@ -540,7 +540,7 @@ gdk_content_formats_get_gtypes (const GdkContentFormats *formats,
|
||||
|
||||
if (n_gtypes)
|
||||
*n_gtypes = formats->n_gtypes;
|
||||
|
||||
|
||||
return formats->gtypes;
|
||||
}
|
||||
|
||||
@@ -567,7 +567,7 @@ gdk_content_formats_get_mime_types (const GdkContentFormats *formats,
|
||||
|
||||
if (n_mime_types)
|
||||
*n_mime_types = formats->n_mime_types;
|
||||
|
||||
|
||||
return formats->mime_types;
|
||||
}
|
||||
|
||||
@@ -663,7 +663,7 @@ gdk_content_formats_builder_unref (GdkContentFormatsBuilder *builder)
|
||||
|
||||
if (builder->ref_count > 0)
|
||||
return;
|
||||
|
||||
|
||||
gdk_content_formats_builder_clear (builder);
|
||||
g_slice_free (GdkContentFormatsBuilder, builder);
|
||||
}
|
||||
@@ -862,4 +862,50 @@ gdk_file_list_get_files (GdkFileList *file_list)
|
||||
return g_slist_copy ((GSList *) file_list);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_file_list_new_from_list:
|
||||
* @files: (element-type GFile): a list of files
|
||||
*
|
||||
* Creates a new files list container from a singly linked list of
|
||||
* `GFile` instances.
|
||||
*
|
||||
* This function is meant to be used by language bindings
|
||||
*
|
||||
* Returns: (transfer full): the newly created files list
|
||||
*
|
||||
* Since: 4.8
|
||||
*/
|
||||
GdkFileList *
|
||||
gdk_file_list_new_from_list (GSList *files)
|
||||
{
|
||||
return gdk_file_list_copy (files);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_file_list_new_from_array:
|
||||
* @files: (array length=n_files): the files to add to the list
|
||||
* @n_files: the number of files in the array
|
||||
*
|
||||
* Creates a new `GdkFileList` for the given array of files.
|
||||
*
|
||||
* This function is meant to be used by language bindings.
|
||||
*
|
||||
* Returns: (transfer full): the newly create files list
|
||||
*
|
||||
* Since: 4.8
|
||||
*/
|
||||
GdkFileList *
|
||||
gdk_file_list_new_from_array (GFile **files,
|
||||
gsize n_files)
|
||||
{
|
||||
if (files == NULL || n_files == 0)
|
||||
return NULL;
|
||||
|
||||
GSList *res = NULL;
|
||||
for (gssize i = n_files - 1; i >= 0; i--)
|
||||
res = g_slist_prepend (res, g_object_ref (files[i]));
|
||||
|
||||
return (GdkFileList *) res;
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
@@ -122,6 +122,11 @@ typedef struct _GdkFileList GdkFileList;
|
||||
|
||||
GDK_AVAILABLE_IN_4_6
|
||||
GSList * gdk_file_list_get_files (GdkFileList *file_list);
|
||||
GDK_AVAILABLE_IN_4_8
|
||||
GdkFileList * gdk_file_list_new_from_list (GSList *files);
|
||||
GDK_AVAILABLE_IN_4_8
|
||||
GdkFileList * gdk_file_list_new_from_array (GFile **files,
|
||||
gsize n_files);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "gdkclipboard.h"
|
||||
#include "gdkcontentformats.h"
|
||||
#include "gdkintl.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
/**
|
||||
* GdkContentProvider:
|
||||
@@ -197,7 +198,7 @@ gdk_content_provider_class_init (GdkContentProviderClass *class)
|
||||
* Emitted whenever the content provided by this provider has changed.
|
||||
*/
|
||||
signals[CONTENT_CHANGED] =
|
||||
g_signal_new ("content-changed",
|
||||
g_signal_new (I_("content-changed"),
|
||||
G_TYPE_FROM_CLASS (class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GdkContentProviderClass, content_changed),
|
||||
|
||||
@@ -413,8 +413,6 @@ gdk_content_register_serializer (GType type,
|
||||
g_return_if_fail (mime_type != NULL);
|
||||
g_return_if_fail (serialize != NULL);
|
||||
|
||||
init ();
|
||||
|
||||
serializer = g_slice_new0 (Serializer);
|
||||
|
||||
serializer->mime_type = g_intern_string (mime_type);
|
||||
|
||||
@@ -2368,10 +2368,75 @@ gdk_scroll_event_new_discrete (GdkSurface *surface,
|
||||
GdkScrollDirection direction)
|
||||
{
|
||||
GdkScrollEvent *self = gdk_event_alloc (GDK_SCROLL, surface, device, time);
|
||||
double delta_x = 0, delta_y = 0;
|
||||
|
||||
switch (direction)
|
||||
{
|
||||
case GDK_SCROLL_UP:
|
||||
delta_y = -1;
|
||||
break;
|
||||
case GDK_SCROLL_DOWN:
|
||||
delta_y = 1;
|
||||
break;
|
||||
case GDK_SCROLL_LEFT:
|
||||
delta_x = -1;
|
||||
break;
|
||||
case GDK_SCROLL_RIGHT:
|
||||
delta_x = 1;
|
||||
break;
|
||||
case GDK_SCROLL_SMOOTH:
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
|
||||
self->tool = tool != NULL ? g_object_ref (tool) : NULL;
|
||||
self->state = state;
|
||||
self->direction = direction;
|
||||
self->delta_x = delta_x;
|
||||
self->delta_y = delta_y;
|
||||
self->unit = GDK_SCROLL_UNIT_WHEEL;
|
||||
|
||||
return (GdkEvent *) self;
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gtk_scroll_event_new_value120:
|
||||
* @surface: the `GdkSurface` of the event
|
||||
* @device: the `GdkDevice` of the event
|
||||
* @tool: (nullable): the tool that generated to event
|
||||
* @time: the event serial
|
||||
* @state: Flags to indicate the state of modifier keys and mouse buttons
|
||||
* in events.
|
||||
* @direction: scroll direction.
|
||||
* @delta_x: delta on the X axis in the 120.0 scale
|
||||
* @delta_x: delta on the Y axis in the 120.0 scale
|
||||
*
|
||||
* Creates a new discrete GdkScrollEvent for high resolution mouse wheels.
|
||||
*
|
||||
* Both axes send data in fractions of 120 where each multiple of 120
|
||||
* amounts to one logical scroll event. Fractions of 120 indicate a wheel
|
||||
* movement less than one detent.
|
||||
*
|
||||
* Returns: the newly created scroll event
|
||||
*/
|
||||
GdkEvent *
|
||||
gdk_scroll_event_new_value120 (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDeviceTool *tool,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GdkScrollDirection direction,
|
||||
double delta_x,
|
||||
double delta_y)
|
||||
{
|
||||
GdkScrollEvent *self = gdk_event_alloc (GDK_SCROLL, surface, device, time);
|
||||
|
||||
self->tool = tool != NULL ? g_object_ref (tool) : NULL;
|
||||
self->state = state;
|
||||
self->direction = direction;
|
||||
self->delta_x = delta_x / 120.0;
|
||||
self->delta_y = delta_y / 120.0;
|
||||
self->unit = GDK_SCROLL_UNIT_WHEEL;
|
||||
|
||||
return (GdkEvent *) self;
|
||||
@@ -2611,6 +2676,7 @@ gdk_touchpad_event_new_pinch (GdkSurface *surface,
|
||||
|
||||
GdkEvent *
|
||||
gdk_touchpad_event_new_hold (GdkSurface *surface,
|
||||
GdkEventSequence *sequence,
|
||||
GdkDevice *device,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
@@ -2623,6 +2689,7 @@ gdk_touchpad_event_new_hold (GdkSurface *surface,
|
||||
|
||||
self->state = state;
|
||||
self->phase = phase;
|
||||
self->sequence = sequence;
|
||||
self->x = x;
|
||||
self->y = y;
|
||||
self->n_fingers = n_fingers;
|
||||
|
||||
@@ -495,6 +495,15 @@ GdkEvent * gdk_scroll_event_new_discrete (GdkSurface *surface,
|
||||
GdkModifierType state,
|
||||
GdkScrollDirection direction);
|
||||
|
||||
GdkEvent * gdk_scroll_event_new_value120 (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDeviceTool *tool,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GdkScrollDirection direction,
|
||||
double delta_x,
|
||||
double delta_y);
|
||||
|
||||
GdkEvent * gdk_touch_event_new (GdkEventType type,
|
||||
GdkEventSequence *sequence,
|
||||
GdkSurface *surface,
|
||||
@@ -533,6 +542,7 @@ GdkEvent * gdk_touchpad_event_new_pinch (GdkSurface *surface,
|
||||
double angle_delta);
|
||||
|
||||
GdkEvent * gdk_touchpad_event_new_hold (GdkSurface *surface,
|
||||
GdkEventSequence *sequence,
|
||||
GdkDevice *device,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ typedef struct _GdkFrameClockClass GdkFrameClockClass;
|
||||
* @GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS: corresponds to GdkFrameClock::flush-events. Should not be handled by applications.
|
||||
* @GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT: corresponds to GdkFrameClock::before-paint. Should not be handled by applications.
|
||||
* @GDK_FRAME_CLOCK_PHASE_UPDATE: corresponds to GdkFrameClock::update.
|
||||
* @GDK_FRAME_CLOCK_PHASE_LAYOUT: corresponds to GdkFrameClock::layout. Should not be handled by applicatiosn.
|
||||
* @GDK_FRAME_CLOCK_PHASE_LAYOUT: corresponds to GdkFrameClock::layout. Should not be handled by applications.
|
||||
* @GDK_FRAME_CLOCK_PHASE_PAINT: corresponds to GdkFrameClock::paint.
|
||||
* @GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS: corresponds to GdkFrameClock::resume-events. Should not be handled by applications.
|
||||
* @GDK_FRAME_CLOCK_PHASE_AFTER_PAINT: corresponds to GdkFrameClock::after-paint. Should not be handled by applications.
|
||||
|
||||
@@ -199,22 +199,6 @@ gdk_keymap_init (GdkKeymap *keymap)
|
||||
keymap->cache = g_hash_table_new (g_direct_hash, g_direct_equal);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gdk_keymap_get_display:
|
||||
* @keymap: a `GdkKeymap`
|
||||
*
|
||||
* Retrieves the `GdkDisplay` associated to the @keymap.
|
||||
*
|
||||
* Returns: (transfer none): a `GdkDisplay`
|
||||
*/
|
||||
GdkDisplay *
|
||||
gdk_keymap_get_display (GdkKeymap *keymap)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_KEYMAP (keymap), NULL);
|
||||
|
||||
return keymap->display;
|
||||
}
|
||||
|
||||
/* Other key-handling stuff
|
||||
*/
|
||||
|
||||
|
||||
@@ -89,8 +89,6 @@ struct _GdkKeymap
|
||||
|
||||
GType gdk_keymap_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GdkDisplay * gdk_keymap_get_display (GdkKeymap *keymap);
|
||||
|
||||
guint gdk_keymap_lookup_key (GdkKeymap *keymap,
|
||||
const GdkKeymapKey *key);
|
||||
gboolean gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
|
||||
|
||||
+3
-2
@@ -22,6 +22,7 @@
|
||||
#include "gdkpaintable.h"
|
||||
|
||||
#include "gdksnapshotprivate.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
/* HACK: So we don't need to include any (not-yet-created) GSK or GTK headers */
|
||||
void gtk_snapshot_push_debug (GdkSnapshot *snapshot,
|
||||
@@ -170,7 +171,7 @@ gdk_paintable_default_init (GdkPaintableInterface *iface)
|
||||
* the icon theme for an icon changing.
|
||||
*/
|
||||
signals[INVALIDATE_CONTENTS] =
|
||||
g_signal_new ("invalidate-contents",
|
||||
g_signal_new (I_("invalidate-contents"),
|
||||
GDK_TYPE_PAINTABLE,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
@@ -194,7 +195,7 @@ gdk_paintable_default_init (GdkPaintableInterface *iface)
|
||||
* the contents of a toplevel surface being resized.
|
||||
*/
|
||||
signals[INVALIDATE_SIZE] =
|
||||
g_signal_new ("invalidate-size",
|
||||
g_signal_new (I_("invalidate-size"),
|
||||
GDK_TYPE_PAINTABLE,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
|
||||
@@ -75,6 +75,8 @@ gdk_io_pipe_unref (GdkIOPipe *pipe)
|
||||
|
||||
g_cond_clear (&pipe->cond);
|
||||
g_mutex_clear (&pipe->mutex);
|
||||
|
||||
g_slice_free (GdkIOPipe, pipe);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+2
-1
@@ -24,6 +24,7 @@
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkenumtypes.h"
|
||||
#include "gdkintl.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include <graphene-gobject.h>
|
||||
#include <math.h>
|
||||
@@ -247,7 +248,7 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
||||
* will result in an arbitrary size being used as a result.
|
||||
*/
|
||||
signals[COMPUTE_SIZE] =
|
||||
g_signal_new ("compute-size",
|
||||
g_signal_new (I_("compute-size"),
|
||||
GDK_TYPE_TOPLEVEL,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
|
||||
@@ -161,6 +161,8 @@ gdk_load_jpeg (GBytes *input_bytes,
|
||||
|
||||
jpeg_create_decompress (&info);
|
||||
|
||||
info.mem->max_memory_to_use = 300 * 1024 * 1024;
|
||||
|
||||
jpeg_mem_src (&info,
|
||||
g_bytes_get_data (input_bytes, NULL),
|
||||
g_bytes_get_size (input_bytes));
|
||||
@@ -272,6 +274,7 @@ gdk_save_jpeg (GdkTexture *texture)
|
||||
|
||||
info.err = jpeg_std_error (&err);
|
||||
jpeg_create_compress (&info);
|
||||
|
||||
info.image_width = width;
|
||||
info.image_height = height;
|
||||
info.input_components = 3;
|
||||
@@ -280,6 +283,8 @@ gdk_save_jpeg (GdkTexture *texture)
|
||||
jpeg_set_defaults (&info);
|
||||
jpeg_set_quality (&info, 75, TRUE);
|
||||
|
||||
info.mem->max_memory_to_use = 300 * 1024 * 1024;
|
||||
|
||||
jpeg_mem_dest (&info, &data, &size);
|
||||
|
||||
memtex = gdk_memory_texture_from_texture (texture,
|
||||
|
||||
@@ -184,7 +184,8 @@ gdk_load_png (GBytes *bytes,
|
||||
if (color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
png_set_palette_to_rgb (png);
|
||||
|
||||
if (color_type == PNG_COLOR_TYPE_GRAY)
|
||||
if (color_type == PNG_COLOR_TYPE_GRAY ||
|
||||
color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||
png_set_expand_gray_1_2_4_to_8 (png);
|
||||
|
||||
if (png_get_valid (png, info, PNG_INFO_tRNS))
|
||||
|
||||
@@ -215,7 +215,7 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
|
||||
cairo_surface_t *surface;
|
||||
struct wl_buffer *buffer;
|
||||
|
||||
texture = gdk_cursor_get_texture (cursor);
|
||||
texture = g_object_ref (gdk_cursor_get_texture (cursor));
|
||||
|
||||
from_texture:
|
||||
surface = g_hash_table_lookup (display->cursor_surface_cache, cursor);
|
||||
@@ -245,6 +245,8 @@ from_texture:
|
||||
buffer = _gdk_wayland_shm_surface_get_wl_buffer (surface);
|
||||
wl_buffer_add_listener (buffer, &buffer_listener, surface);
|
||||
|
||||
g_object_unref (texture);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ struct _GdkWaylandPointerFrameData
|
||||
|
||||
/* Specific to the scroll event */
|
||||
double delta_x, delta_y;
|
||||
int32_t discrete_x, discrete_y;
|
||||
int32_t value120_x, value120_y;
|
||||
gint8 is_scroll_stop;
|
||||
enum wl_pointer_axis_source source;
|
||||
};
|
||||
@@ -1383,20 +1383,54 @@ static GdkDevice * get_scroll_device (GdkWaylandSeat *seat,
|
||||
|
||||
static void
|
||||
flush_discrete_scroll_event (GdkWaylandSeat *seat,
|
||||
GdkScrollDirection direction)
|
||||
gint value120_x,
|
||||
gint value120_y)
|
||||
{
|
||||
GdkEvent *event;
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkEvent *event = NULL;
|
||||
GdkDevice *source;
|
||||
GdkScrollDirection direction;
|
||||
|
||||
if (value120_x > 0)
|
||||
direction = GDK_SCROLL_LEFT;
|
||||
else if (value120_x < 0)
|
||||
direction = GDK_SCROLL_RIGHT;
|
||||
else if (value120_y > 0)
|
||||
direction = GDK_SCROLL_DOWN;
|
||||
else
|
||||
direction = GDK_SCROLL_UP;
|
||||
|
||||
source = get_scroll_device (seat, seat->pointer_info.frame.source);
|
||||
event = gdk_scroll_event_new_discrete (seat->pointer_info.focus,
|
||||
source,
|
||||
NULL,
|
||||
seat->pointer_info.time,
|
||||
device_get_modifiers (seat->logical_pointer),
|
||||
direction);
|
||||
|
||||
_gdk_wayland_display_deliver_event (seat->display, event);
|
||||
if (display_wayland->seat_version >= WL_POINTER_AXIS_VALUE120_SINCE_VERSION)
|
||||
{
|
||||
event = gdk_scroll_event_new_value120 (seat->pointer_info.focus,
|
||||
source,
|
||||
NULL,
|
||||
seat->pointer_info.time,
|
||||
device_get_modifiers (seat->logical_pointer),
|
||||
direction,
|
||||
value120_x,
|
||||
value120_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
gint discrete_x = value120_x / 120;
|
||||
gint discrete_y = value120_y / 120;
|
||||
|
||||
if (discrete_x != 0 || discrete_y != 0)
|
||||
{
|
||||
event = gdk_scroll_event_new_discrete (seat->pointer_info.focus,
|
||||
source,
|
||||
NULL,
|
||||
seat->pointer_info.time,
|
||||
device_get_modifiers (seat->logical_pointer),
|
||||
direction);
|
||||
}
|
||||
}
|
||||
|
||||
if (event)
|
||||
_gdk_wayland_display_deliver_event (seat->display, event);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1427,22 +1461,13 @@ flush_scroll_event (GdkWaylandSeat *seat,
|
||||
{
|
||||
gboolean is_stop = FALSE;
|
||||
|
||||
if (pointer_frame->discrete_x || pointer_frame->discrete_y)
|
||||
if (pointer_frame->value120_x || pointer_frame->value120_y)
|
||||
{
|
||||
GdkScrollDirection direction;
|
||||
|
||||
if (pointer_frame->discrete_x > 0)
|
||||
direction = GDK_SCROLL_LEFT;
|
||||
else if (pointer_frame->discrete_x < 0)
|
||||
direction = GDK_SCROLL_RIGHT;
|
||||
else if (pointer_frame->discrete_y > 0)
|
||||
direction = GDK_SCROLL_DOWN;
|
||||
else
|
||||
direction = GDK_SCROLL_UP;
|
||||
|
||||
flush_discrete_scroll_event (seat, direction);
|
||||
pointer_frame->discrete_x = 0;
|
||||
pointer_frame->discrete_y = 0;
|
||||
flush_discrete_scroll_event (seat,
|
||||
pointer_frame->value120_x,
|
||||
pointer_frame->value120_y);
|
||||
pointer_frame->value120_x = 0;
|
||||
pointer_frame->value120_y = 0;
|
||||
}
|
||||
else if (pointer_frame->is_scroll_stop ||
|
||||
pointer_frame->delta_x != 0 ||
|
||||
@@ -1462,8 +1487,8 @@ flush_scroll_event (GdkWaylandSeat *seat,
|
||||
is_stop);
|
||||
}
|
||||
|
||||
pointer_frame->discrete_x = 0;
|
||||
pointer_frame->discrete_y = 0;
|
||||
pointer_frame->value120_x = 0;
|
||||
pointer_frame->value120_y = 0;
|
||||
pointer_frame->delta_x = 0;
|
||||
pointer_frame->delta_y = 0;
|
||||
pointer_frame->is_scroll_stop = FALSE;
|
||||
@@ -1514,8 +1539,6 @@ pointer_handle_enter (void *data,
|
||||
if (!GDK_IS_SURFACE (wl_surface_get_user_data (surface)))
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (display_wayland, serial);
|
||||
|
||||
seat->pointer_info.focus = wl_surface_get_user_data (surface);
|
||||
g_object_ref (seat->pointer_info.focus);
|
||||
|
||||
@@ -1557,16 +1580,9 @@ pointer_handle_leave (void *data,
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkDeviceGrabInfo *grab;
|
||||
|
||||
if (!surface)
|
||||
return;
|
||||
|
||||
if (!GDK_IS_SURFACE (wl_surface_get_user_data (surface)))
|
||||
return;
|
||||
|
||||
if (!seat->pointer_info.focus)
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (display_wayland, serial);
|
||||
grab = _gdk_display_get_last_device_grab (seat->display,
|
||||
seat->logical_pointer);
|
||||
|
||||
@@ -1666,8 +1682,6 @@ pointer_handle_button (void *data,
|
||||
if (!seat->pointer_info.focus)
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
switch (button)
|
||||
{
|
||||
case BTN_LEFT:
|
||||
@@ -1873,10 +1887,10 @@ pointer_handle_axis_discrete (void *data,
|
||||
switch (axis)
|
||||
{
|
||||
case WL_POINTER_AXIS_VERTICAL_SCROLL:
|
||||
pointer_frame->discrete_y = value;
|
||||
pointer_frame->value120_y = value * 120;
|
||||
break;
|
||||
case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
|
||||
pointer_frame->discrete_x = value;
|
||||
pointer_frame->value120_x = value * 120;
|
||||
break;
|
||||
default:
|
||||
g_return_if_reached ();
|
||||
@@ -1887,6 +1901,35 @@ pointer_handle_axis_discrete (void *data,
|
||||
get_axis_name (axis), value, seat));
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_handle_axis_value120 (void *data,
|
||||
struct wl_pointer *pointer,
|
||||
uint32_t axis,
|
||||
int32_t value)
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkWaylandPointerFrameData *pointer_frame = &seat->pointer_info.frame;
|
||||
|
||||
if (!seat->pointer_info.focus)
|
||||
return;
|
||||
|
||||
switch (axis)
|
||||
{
|
||||
case WL_POINTER_AXIS_VERTICAL_SCROLL:
|
||||
pointer_frame->value120_y = value;
|
||||
break;
|
||||
case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
|
||||
pointer_frame->value120_x = value;
|
||||
break;
|
||||
default:
|
||||
g_return_if_reached ();
|
||||
}
|
||||
|
||||
GDK_SEAT_NOTE (seat, EVENTS,
|
||||
g_message ("value120 scroll, axis %s, value %d, seat %p",
|
||||
get_axis_name (axis), value, seat));
|
||||
}
|
||||
|
||||
static int
|
||||
get_active_layout (GdkKeymap *keymap)
|
||||
{
|
||||
@@ -1986,7 +2029,6 @@ keyboard_handle_enter (void *data,
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkEvent *event;
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
|
||||
if (!surface)
|
||||
return;
|
||||
@@ -1994,8 +2036,6 @@ keyboard_handle_enter (void *data,
|
||||
if (!GDK_IS_SURFACE (wl_surface_get_user_data (surface)))
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
seat->keyboard_focus = wl_surface_get_user_data (surface);
|
||||
g_object_ref (seat->keyboard_focus);
|
||||
seat->repeat_key = 0;
|
||||
@@ -2021,7 +2061,6 @@ keyboard_handle_leave (void *data,
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkEvent *event;
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
|
||||
if (!seat->keyboard_focus)
|
||||
return;
|
||||
@@ -2032,8 +2071,6 @@ keyboard_handle_leave (void *data,
|
||||
*/
|
||||
stop_key_repeat (seat);
|
||||
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
event = gdk_focus_event_new (seat->keyboard_focus,
|
||||
seat->logical_keyboard,
|
||||
FALSE);
|
||||
@@ -2272,7 +2309,6 @@ keyboard_handle_key (void *data,
|
||||
uint32_t state_w)
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
|
||||
if (!seat->keyboard_focus)
|
||||
return;
|
||||
@@ -2280,7 +2316,6 @@ keyboard_handle_key (void *data,
|
||||
seat->keyboard_time = time;
|
||||
seat->keyboard_key_serial = serial;
|
||||
seat->repeat_count = 0;
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
deliver_key_event (data, time, key + 8, state_w, FALSE);
|
||||
|
||||
}
|
||||
@@ -2470,12 +2505,9 @@ touch_handle_down (void *data,
|
||||
wl_fixed_t y)
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkWaylandTouchData *touch;
|
||||
GdkEvent *event;
|
||||
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
if (!wl_surface)
|
||||
return;
|
||||
|
||||
@@ -2519,12 +2551,9 @@ touch_handle_up (void *data,
|
||||
int32_t id)
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkWaylandTouchData *touch;
|
||||
GdkEvent *event;
|
||||
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
touch = gdk_wayland_seat_get_touch (seat, id);
|
||||
if (!touch)
|
||||
return;
|
||||
@@ -2704,9 +2733,6 @@ gesture_swipe_begin (void *data,
|
||||
uint32_t fingers)
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
emit_gesture_swipe_event (seat,
|
||||
GDK_TOUCHPAD_GESTURE_PHASE_BEGIN,
|
||||
@@ -2739,11 +2765,8 @@ gesture_swipe_end (void *data,
|
||||
int32_t cancelled)
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkTouchpadGesturePhase phase;
|
||||
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
phase = (cancelled) ?
|
||||
GDK_TOUCHPAD_GESTURE_PHASE_CANCEL :
|
||||
GDK_TOUCHPAD_GESTURE_PHASE_END;
|
||||
@@ -2806,9 +2829,7 @@ gesture_pinch_begin (void *data,
|
||||
uint32_t fingers)
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
emit_gesture_pinch_event (seat,
|
||||
GDK_TOUCHPAD_GESTURE_PHASE_BEGIN,
|
||||
time, fingers, 0, 0, 1, 0);
|
||||
@@ -2843,11 +2864,8 @@ gesture_pinch_end (void *data,
|
||||
int32_t cancelled)
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkTouchpadGesturePhase phase;
|
||||
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
phase = (cancelled) ?
|
||||
GDK_TOUCHPAD_GESTURE_PHASE_CANCEL :
|
||||
GDK_TOUCHPAD_GESTURE_PHASE_END;
|
||||
@@ -2870,7 +2888,11 @@ emit_gesture_hold_event (GdkWaylandSeat *seat,
|
||||
|
||||
seat->pointer_info.time = _time;
|
||||
|
||||
if (phase == GDK_TOUCHPAD_GESTURE_PHASE_BEGIN)
|
||||
seat->pointer_info.touchpad_event_sequence++;
|
||||
|
||||
event = gdk_touchpad_event_new_hold (seat->pointer_info.focus,
|
||||
GDK_SLOT_TO_EVENT_SEQUENCE (seat->pointer_info.touchpad_event_sequence),
|
||||
seat->logical_pointer,
|
||||
_time,
|
||||
device_get_modifiers (seat->logical_pointer),
|
||||
@@ -2901,9 +2923,6 @@ gesture_hold_begin (void *data,
|
||||
uint32_t fingers)
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
emit_gesture_hold_event (seat,
|
||||
GDK_TOUCHPAD_GESTURE_PHASE_BEGIN,
|
||||
@@ -2919,11 +2938,8 @@ gesture_hold_end (void *data,
|
||||
int32_t cancelled)
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkTouchpadGesturePhase phase;
|
||||
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
phase = (cancelled) ?
|
||||
GDK_TOUCHPAD_GESTURE_PHASE_CANCEL :
|
||||
GDK_TOUCHPAD_GESTURE_PHASE_END;
|
||||
@@ -3108,6 +3124,7 @@ static const struct wl_pointer_listener pointer_listener = {
|
||||
pointer_handle_axis_source,
|
||||
pointer_handle_axis_stop,
|
||||
pointer_handle_axis_discrete,
|
||||
pointer_handle_axis_value120,
|
||||
};
|
||||
|
||||
static const struct wl_keyboard_listener keyboard_listener = {
|
||||
@@ -3630,8 +3647,6 @@ tablet_tool_handle_proximity_in (void *data,
|
||||
{
|
||||
GdkWaylandTabletToolData *tool = data;
|
||||
GdkWaylandTabletData *tablet = zwp_tablet_v2_get_user_data (wp_tablet);
|
||||
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkSurface *surface;
|
||||
GdkEvent *event;
|
||||
|
||||
@@ -3648,7 +3663,6 @@ tablet_tool_handle_proximity_in (void *data,
|
||||
tool->current_tablet = tablet;
|
||||
tablet->current_tool = tool;
|
||||
|
||||
_gdk_wayland_display_update_serial (display_wayland, serial);
|
||||
tablet->pointer_info.enter_serial = serial;
|
||||
|
||||
tablet->pointer_info.focus = g_object_ref (surface);
|
||||
@@ -3669,9 +3683,9 @@ tablet_tool_handle_proximity_in (void *data,
|
||||
gdk_wayland_surface_get_wl_output (surface));
|
||||
pointer_surface_update_scale (tablet->logical_device);
|
||||
|
||||
GDK_SEAT_NOTE (seat, EVENTS,
|
||||
GDK_SEAT_NOTE (tablet->seat, EVENTS,
|
||||
g_message ("proximity in, seat %p surface %p tool %d",
|
||||
seat, tablet->pointer_info.focus,
|
||||
tablet->seat, tablet->pointer_info.focus,
|
||||
gdk_device_tool_get_tool_type (tool->tool)));
|
||||
}
|
||||
|
||||
@@ -3748,13 +3762,10 @@ tablet_tool_handle_down (void *data,
|
||||
{
|
||||
GdkWaylandTabletToolData *tool = data;
|
||||
GdkWaylandTabletData *tablet = tool->current_tablet;
|
||||
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tool->seat);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
|
||||
if (!tablet || !tablet->pointer_info.focus)
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (display_wayland, serial);
|
||||
tablet->pointer_info.press_serial = serial;
|
||||
|
||||
tablet_create_button_event_frame (tablet, GDK_BUTTON_PRESS, GDK_BUTTON_PRIMARY);
|
||||
@@ -5305,15 +5316,13 @@ gdk_wayland_device_set_selection (GdkDevice *gdk_device,
|
||||
struct wl_data_source *source)
|
||||
{
|
||||
GdkWaylandSeat *seat;
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
guint32 serial;
|
||||
|
||||
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
|
||||
|
||||
seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (gdk_device));
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
|
||||
wl_data_device_set_selection (seat->data_device, source,
|
||||
_gdk_wayland_display_get_serial (display_wayland));
|
||||
serial = _gdk_wayland_seat_get_implicit_grab_serial (GDK_SEAT (seat), NULL);
|
||||
wl_data_device_set_selection (seat->data_device, source, serial);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -145,10 +145,6 @@ zxdg_shell_v6_ping (void *data,
|
||||
struct zxdg_shell_v6 *xdg_shell,
|
||||
uint32_t serial)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = data;
|
||||
|
||||
_gdk_wayland_display_update_serial (display_wayland, serial);
|
||||
|
||||
GDK_DISPLAY_NOTE (GDK_DISPLAY (data), EVENTS,
|
||||
g_message ("ping, shell %p, serial %u\n", xdg_shell, serial));
|
||||
|
||||
@@ -236,7 +232,7 @@ _gdk_wayland_display_add_seat (GdkWaylandDisplay *display_wayland,
|
||||
{
|
||||
struct wl_seat *seat;
|
||||
|
||||
display_wayland->seat_version = MIN (version, 7);
|
||||
display_wayland->seat_version = MIN (version, 8);
|
||||
seat = wl_registry_bind (display_wayland->wl_registry,
|
||||
id, &wl_seat_interface,
|
||||
display_wayland->seat_version);
|
||||
@@ -1124,19 +1120,6 @@ _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *display_wayland)
|
||||
|
||||
}
|
||||
|
||||
guint32
|
||||
_gdk_wayland_display_get_serial (GdkWaylandDisplay *display_wayland)
|
||||
{
|
||||
return display_wayland->serial;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_display_update_serial (GdkWaylandDisplay *display_wayland,
|
||||
guint32 serial)
|
||||
{
|
||||
display_wayland->serial = serial;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_wayland_display_get_wl_display: (skip)
|
||||
* @display: (type GdkWaylandDisplay): a `GdkDisplay`
|
||||
@@ -2466,9 +2449,6 @@ output_handle_geometry (void *data,
|
||||
|
||||
if (should_update_monitor (monitor) || !monitor_has_xdg_output (monitor))
|
||||
apply_monitor_change (monitor);
|
||||
|
||||
if (should_update_monitor (monitor))
|
||||
update_scale (GDK_MONITOR (monitor)->display);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -84,9 +84,6 @@ struct _GdkWaylandDisplay
|
||||
/* Startup notification */
|
||||
char *startup_notification_id;
|
||||
|
||||
/* Most recent serial */
|
||||
guint32 serial;
|
||||
|
||||
uint32_t xdg_wm_base_id;
|
||||
int xdg_wm_base_version;
|
||||
uint32_t zxdg_shell_v6_id;
|
||||
|
||||
@@ -393,8 +393,8 @@ _gdk_wayland_surface_drag_begin (GdkSurface *surface,
|
||||
wl_data_device_start_drag (gdk_wayland_device_get_data_device (device),
|
||||
drag_wayland->data_source,
|
||||
gdk_wayland_surface_get_wl_surface (surface),
|
||||
drag_wayland->dnd_wl_surface,
|
||||
_gdk_wayland_display_get_serial (display_wayland));
|
||||
drag_wayland->dnd_wl_surface,
|
||||
_gdk_wayland_seat_get_implicit_grab_serial (seat, NULL));
|
||||
|
||||
cursor = gdk_drag_get_cursor (drag, gdk_drag_get_selected_action (drag));
|
||||
gdk_drag_set_cursor (drag, cursor);
|
||||
|
||||
@@ -263,6 +263,8 @@ gdk_wayland_primary_claim (GdkClipboard *clipboard,
|
||||
GdkWaylandDisplay *wdisplay = GDK_WAYLAND_DISPLAY (gdk_clipboard_get_display (clipboard));
|
||||
const char * const *mime_types;
|
||||
gsize i, n_mime_types;
|
||||
GdkSeat *seat;
|
||||
guint32 serial;
|
||||
|
||||
gdk_wayland_primary_discard_offer (cb);
|
||||
gdk_wayland_primary_discard_source (cb);
|
||||
@@ -276,9 +278,11 @@ gdk_wayland_primary_claim (GdkClipboard *clipboard,
|
||||
zwp_primary_selection_source_v1_offer (cb->source, mime_types[i]);
|
||||
}
|
||||
|
||||
seat = gdk_display_get_default_seat (GDK_DISPLAY (wdisplay));
|
||||
serial = _gdk_wayland_seat_get_implicit_grab_serial (seat, NULL);
|
||||
zwp_primary_selection_device_v1_set_selection (cb->primary_data_device,
|
||||
cb->source,
|
||||
_gdk_wayland_display_get_serial (wdisplay));
|
||||
serial);
|
||||
}
|
||||
|
||||
return GDK_CLIPBOARD_CLASS (gdk_wayland_primary_parent_class)->claim (clipboard, formats, local, content);
|
||||
|
||||
@@ -170,10 +170,6 @@ GdkMonitor *gdk_wayland_display_get_monitor_for_output (GdkDisplay *displa
|
||||
void _gdk_wayland_surface_set_grab_seat (GdkSurface *surface,
|
||||
GdkSeat *seat);
|
||||
|
||||
guint32 _gdk_wayland_display_get_serial (GdkWaylandDisplay *display_wayland);
|
||||
void _gdk_wayland_display_update_serial (GdkWaylandDisplay *display_wayland,
|
||||
guint32 serial);
|
||||
|
||||
cairo_surface_t * _gdk_wayland_display_create_shm_surface (GdkWaylandDisplay *display,
|
||||
int width,
|
||||
int height,
|
||||
|
||||
@@ -105,7 +105,7 @@ gdk_device_win32_query_state (GdkDevice *device,
|
||||
hwndc = ChildWindowFromPoint (hwnd, point);
|
||||
|
||||
if (hwndc && hwndc != hwnd)
|
||||
*child_window = gdk_win32_handle_table_lookup (hwndc);
|
||||
*child_window = gdk_win32_handle_table_lookup_ (hwndc);
|
||||
else
|
||||
*child_window = NULL; /* Direct child unknown to gdk */
|
||||
}
|
||||
@@ -183,7 +183,7 @@ _gdk_device_win32_surface_at_position (GdkDevice *device,
|
||||
if (!PtInRect (&rect, client_pt))
|
||||
hwnd = NULL;
|
||||
|
||||
window = gdk_win32_handle_table_lookup (hwnd);
|
||||
window = gdk_win32_handle_table_lookup_ (hwnd);
|
||||
|
||||
if (window && (win_x || win_y))
|
||||
{
|
||||
|
||||
@@ -96,7 +96,7 @@ gdk_device_winpointer_query_state (GdkDevice *device,
|
||||
hwndc = ChildWindowFromPoint (hwnd, point);
|
||||
|
||||
if (hwndc && hwndc != hwnd)
|
||||
*child_window = gdk_win32_handle_table_lookup (hwndc);
|
||||
*child_window = gdk_win32_handle_table_lookup_ (hwndc);
|
||||
else
|
||||
*child_window = NULL; /* Direct child unknown to gdk */
|
||||
}
|
||||
@@ -160,7 +160,7 @@ gdk_device_winpointer_surface_at_position (GdkDevice *device,
|
||||
if (!PtInRect (&rect, client_pt))
|
||||
hwnd = NULL;
|
||||
|
||||
surface = gdk_win32_handle_table_lookup (hwnd);
|
||||
surface = gdk_win32_handle_table_lookup_ (hwnd);
|
||||
|
||||
if (surface && (win_x || win_y))
|
||||
{
|
||||
|
||||
@@ -104,7 +104,7 @@ gdk_device_wintab_query_state (GdkDevice *device,
|
||||
hwndc = ChildWindowFromPoint (hwnd, point);
|
||||
|
||||
if (hwndc && hwndc != hwnd)
|
||||
*child_window = gdk_win32_handle_table_lookup (hwndc);
|
||||
*child_window = gdk_win32_handle_table_lookup_ (hwndc);
|
||||
else
|
||||
*child_window = NULL; /* Direct child unknown to gdk */
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ static int debug_indent = 0;
|
||||
/**
|
||||
* gdk_win32_display_add_filter:
|
||||
* @display: a `GdkWin32Display`
|
||||
* @function: filter callback
|
||||
* @data: data to pass to filter callback
|
||||
* @function: (scope notified): filter callback
|
||||
* @data: (closure): data to pass to filter callback
|
||||
*
|
||||
* Adds an event filter to @window, allowing you to intercept messages
|
||||
* before they reach GDK. This is a low-level operation and makes it
|
||||
@@ -136,8 +136,8 @@ _gdk_win32_message_filter_unref (GdkWin32Display *display,
|
||||
/**
|
||||
* gdk_win32_display_remove_filter:
|
||||
* @display: A `GdkWin32Display`
|
||||
* @function: previously-added filter function
|
||||
* @data: user data for previously-added filter function
|
||||
* @function: (scope notified): previously-added filter function
|
||||
* @data: (closure): user data for previously-added filter function
|
||||
*
|
||||
* Remove a filter previously added with gdk_win32_display_add_filter().
|
||||
*/
|
||||
@@ -1247,6 +1247,8 @@ gdk_win32_display_init_gl (GdkDisplay *display,
|
||||
* Retrieves the EGL display connection object for the given GDK display.
|
||||
*
|
||||
* Returns: (nullable): the EGL display
|
||||
*
|
||||
* Since: 4.4
|
||||
*/
|
||||
gpointer
|
||||
gdk_win32_display_get_egl_display (GdkDisplay *display)
|
||||
|
||||
+23
-11
@@ -142,8 +142,6 @@ struct _drop_target_context
|
||||
static void
|
||||
gdk_win32_drop_init (GdkWin32Drop *drop)
|
||||
{
|
||||
drop->droptarget_w32format_contentformat_map = g_array_new (FALSE, FALSE, sizeof (GdkWin32ContentFormatPair));
|
||||
|
||||
GDK_NOTE (DND, g_print ("gdk_win32_drop_init %p\n", drop));
|
||||
}
|
||||
|
||||
@@ -414,9 +412,13 @@ set_source_actions_helper (GdkDrop *drop,
|
||||
DWORD grfKeyState)
|
||||
{
|
||||
GdkDragAction user_action;
|
||||
GdkWin32Drop *drop_win32;
|
||||
|
||||
user_action = get_user_action (grfKeyState);
|
||||
|
||||
drop_win32 = GDK_WIN32_DROP (drop);
|
||||
drop_win32->actions = actions;
|
||||
|
||||
if (user_action != 0)
|
||||
gdk_drop_set_actions (drop, user_action);
|
||||
else
|
||||
@@ -471,6 +473,7 @@ idroptarget_dragenter (LPDROPTARGET This,
|
||||
GdkDragAction source_actions;
|
||||
GdkDragAction dest_actions;
|
||||
GdkContentFormats *formats;
|
||||
GArray *droptarget_w32format_contentformat_map;
|
||||
|
||||
GDK_NOTE (DND, g_print ("idroptarget_dragenter %p @ %ld : %ld"
|
||||
" for dest window 0x%p"
|
||||
@@ -491,7 +494,8 @@ idroptarget_dragenter (LPDROPTARGET This,
|
||||
|
||||
display = gdk_surface_get_display (ctx->surface);
|
||||
|
||||
formats = query_object_formats (pDataObj, NULL);
|
||||
droptarget_w32format_contentformat_map = g_array_new (FALSE, FALSE, sizeof (GdkWin32ContentFormatPair));
|
||||
formats = query_object_formats (pDataObj, droptarget_w32format_contentformat_map);
|
||||
drop = gdk_drop_new (display,
|
||||
gdk_seat_get_pointer (gdk_display_get_default_seat (display)),
|
||||
drag,
|
||||
@@ -499,7 +503,7 @@ idroptarget_dragenter (LPDROPTARGET This,
|
||||
ctx->surface,
|
||||
GDK_DRAG_PROTO_OLE2);
|
||||
drop_win32 = GDK_WIN32_DROP (drop);
|
||||
g_array_set_size (drop_win32->droptarget_w32format_contentformat_map, 0);
|
||||
drop_win32->droptarget_w32format_contentformat_map = droptarget_w32format_contentformat_map;
|
||||
gdk_content_formats_unref (formats);
|
||||
|
||||
ctx->drop = drop;
|
||||
@@ -520,7 +524,7 @@ idroptarget_dragenter (LPDROPTARGET This,
|
||||
drop_win32->last_key_state = grfKeyState;
|
||||
drop_win32->last_x = pt_x;
|
||||
drop_win32->last_y = pt_y;
|
||||
dest_actions = filter_actions (drop_win32->actions, source_actions);
|
||||
dest_actions = filter_actions (gdk_drop_get_actions (drop), source_actions);
|
||||
*pdwEffect_and_dwOKEffects = drop_effect_for_actions (dest_actions);
|
||||
|
||||
GDK_NOTE (DND, g_print ("idroptarget_dragenter returns S_OK with actions %s"
|
||||
@@ -554,9 +558,7 @@ idroptarget_dragover (LPDROPTARGET This,
|
||||
GdkDragAction source_actions;
|
||||
GdkDragAction dest_actions;
|
||||
|
||||
source_actions = set_source_actions_helper (ctx->drop,
|
||||
actions_for_drop_effects (*pdwEffect_and_dwOKEffects),
|
||||
grfKeyState);
|
||||
source_actions = actions_for_drop_effects (*pdwEffect_and_dwOKEffects);
|
||||
|
||||
GDK_NOTE (DND, g_print ("idroptarget_dragover %p @ %d : %d"
|
||||
" (raw %ld : %ld)"
|
||||
@@ -569,7 +571,8 @@ idroptarget_dragover (LPDROPTARGET This,
|
||||
|
||||
if (pt_x != drop_win32->last_x ||
|
||||
pt_y != drop_win32->last_y ||
|
||||
grfKeyState != drop_win32->last_key_state)
|
||||
grfKeyState != drop_win32->last_key_state ||
|
||||
source_actions != drop_win32->actions)
|
||||
{
|
||||
double x = 0.0;
|
||||
double y = 0.0;
|
||||
@@ -578,13 +581,15 @@ idroptarget_dragover (LPDROPTARGET This,
|
||||
x /= drop_win32->scale;
|
||||
y /= drop_win32->scale;
|
||||
|
||||
set_source_actions_helper (ctx->drop, source_actions, grfKeyState);
|
||||
|
||||
gdk_drop_emit_motion_event (ctx->drop, TRUE, x, y, GDK_CURRENT_TIME);
|
||||
drop_win32->last_key_state = grfKeyState;
|
||||
drop_win32->last_x = pt_x;
|
||||
drop_win32->last_y = pt_y;
|
||||
}
|
||||
|
||||
dest_actions = filter_actions (drop_win32->actions, source_actions);
|
||||
dest_actions = filter_actions (gdk_drop_get_actions (ctx->drop), source_actions);
|
||||
*pdwEffect_and_dwOKEffects = drop_effect_for_actions (dest_actions);
|
||||
|
||||
GDK_NOTE (DND, g_print ("idroptarget_dragover returns S_OK with actions %s"
|
||||
@@ -645,8 +650,12 @@ idroptarget_drop (LPDROPTARGET This,
|
||||
x /= drop_win32->scale;
|
||||
y /= drop_win32->scale;
|
||||
|
||||
gdk_drop_emit_motion_event (ctx->drop, TRUE, x, y, GDK_CURRENT_TIME);
|
||||
|
||||
gdk_drop_emit_drop_event (ctx->drop, TRUE, x, y, GDK_CURRENT_TIME);
|
||||
|
||||
gdk_drop_emit_leave_event (ctx->drop, TRUE, GDK_CURRENT_TIME);
|
||||
|
||||
while (!drop_win32->drop_finished)
|
||||
g_main_context_iteration (NULL, FALSE);
|
||||
|
||||
@@ -824,7 +833,10 @@ gdk_win32_drop_status (GdkDrop *drop,
|
||||
_gdk_win32_drag_action_to_string (gdk_drop_get_actions (drop)),
|
||||
_gdk_win32_drag_action_to_string (preferred)));
|
||||
|
||||
drop_win32->actions = actions;
|
||||
if (preferred != 0)
|
||||
actions = preferred;
|
||||
|
||||
gdk_drop_set_actions (drop, drop_win32->actions & actions);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+50
-33
@@ -388,7 +388,7 @@ low_level_keyboard_proc (int code,
|
||||
if (kbd_focus_owner == NULL)
|
||||
break;
|
||||
|
||||
gdk_kbd_focus_owner = gdk_win32_handle_table_lookup (kbd_focus_owner);
|
||||
gdk_kbd_focus_owner = gdk_win32_handle_table_lookup_ (kbd_focus_owner);
|
||||
|
||||
if (gdk_kbd_focus_owner == NULL)
|
||||
break;
|
||||
@@ -618,7 +618,7 @@ find_window_for_mouse_event (GdkSurface* reported_window,
|
||||
ScreenToClient (hwnd, &client_pt);
|
||||
GetClientRect (hwnd, &rect);
|
||||
if (PtInRect (&rect, client_pt))
|
||||
event_surface = gdk_win32_handle_table_lookup (hwnd);
|
||||
event_surface = gdk_win32_handle_table_lookup_ (hwnd);
|
||||
}
|
||||
if (event_surface == NULL)
|
||||
event_surface = grab->surface;
|
||||
@@ -1433,35 +1433,42 @@ handle_nchittest (HWND hwnd,
|
||||
gint16 screen_y,
|
||||
int *ret_valp)
|
||||
{
|
||||
RECT rect;
|
||||
GdkWin32Surface *impl;
|
||||
RECT client_rect;
|
||||
POINT client_pt;
|
||||
|
||||
if (window == NULL || window->input_region == NULL)
|
||||
if (window == NULL)
|
||||
return FALSE;
|
||||
|
||||
/* If the window has decorations, DefWindowProc() will take
|
||||
* care of NCHITTEST.
|
||||
*/
|
||||
if (!_gdk_win32_surface_lacks_wm_decorations (window))
|
||||
/* If the window has no particular input pass-through region,
|
||||
* then we can simply let DefWindowProc() handle the message */
|
||||
if (window->input_region == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (!GetWindowRect (hwnd, &rect))
|
||||
if (!GetClientRect (hwnd, &client_rect))
|
||||
return FALSE;
|
||||
|
||||
client_pt.x = screen_x;
|
||||
client_pt.y = screen_y;
|
||||
if (!ScreenToClient (hwnd, &client_pt))
|
||||
return FALSE;
|
||||
|
||||
/* Check whether the point lies within the client area */
|
||||
if (!PtInRect (&client_rect, client_pt))
|
||||
return FALSE;
|
||||
|
||||
impl = GDK_WIN32_SURFACE (window);
|
||||
rect.left = screen_x - rect.left;
|
||||
rect.top = screen_y - rect.top;
|
||||
|
||||
/* If it's inside the rect, return FALSE and let DefWindowProc() handle it */
|
||||
/* If the point lies inside the input region, return HTCLIENT,
|
||||
* otherwise return HTTRANSPARENT. */
|
||||
if (cairo_region_contains_point (window->input_region,
|
||||
rect.left / impl->surface_scale,
|
||||
rect.top / impl->surface_scale))
|
||||
return FALSE;
|
||||
client_pt.x / impl->surface_scale,
|
||||
client_pt.y / impl->surface_scale))
|
||||
*ret_valp = HTCLIENT;
|
||||
else
|
||||
*ret_valp = HTTRANSPARENT;
|
||||
|
||||
/* Otherwise override DefWindowProc() and tell WM that the point is not
|
||||
* within the window
|
||||
*/
|
||||
*ret_valp = HTNOWHERE;
|
||||
/* We handled the message, no need to call DefWindowProc() */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1775,7 +1782,7 @@ gdk_event_translate (MSG *msg,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
window = gdk_win32_handle_table_lookup (msg->hwnd);
|
||||
window = gdk_win32_handle_table_lookup_ (msg->hwnd);
|
||||
|
||||
if (window == NULL)
|
||||
{
|
||||
@@ -2290,7 +2297,7 @@ gdk_event_translate (MSG *msg,
|
||||
ScreenToClient (hwnd, &client_pt);
|
||||
GetClientRect (hwnd, &rect);
|
||||
if (PtInRect (&rect, client_pt))
|
||||
new_window = gdk_win32_handle_table_lookup (hwnd);
|
||||
new_window = gdk_win32_handle_table_lookup_ (hwnd);
|
||||
}
|
||||
|
||||
synthesize_crossing_events (display,
|
||||
@@ -2431,7 +2438,7 @@ gdk_event_translate (MSG *msg,
|
||||
ScreenToClient (hwnd, &client_pt);
|
||||
GetClientRect (hwnd, &rect);
|
||||
if (PtInRect (&rect, client_pt))
|
||||
new_window = gdk_win32_handle_table_lookup (hwnd);
|
||||
new_window = gdk_win32_handle_table_lookup_ (hwnd);
|
||||
}
|
||||
|
||||
if (!ignore_leave)
|
||||
@@ -2669,6 +2676,7 @@ gdk_event_translate (MSG *msg,
|
||||
{
|
||||
int16_t scroll_x = 0;
|
||||
int16_t scroll_y = 0;
|
||||
GdkScrollDirection direction;
|
||||
|
||||
char classname[64];
|
||||
|
||||
@@ -2708,7 +2716,7 @@ gdk_event_translate (MSG *msg,
|
||||
|
||||
msg->hwnd = hwnd;
|
||||
|
||||
g_set_object (&window, gdk_win32_handle_table_lookup (hwnd));
|
||||
g_set_object (&window, gdk_win32_handle_table_lookup_ (hwnd));
|
||||
if (!window)
|
||||
break;
|
||||
|
||||
@@ -2720,15 +2728,24 @@ gdk_event_translate (MSG *msg,
|
||||
_gdk_device_virtual_set_active (_gdk_device_manager->core_pointer,
|
||||
_gdk_device_manager->system_pointer);
|
||||
|
||||
event = gdk_scroll_event_new (window,
|
||||
device_manager_win32->core_pointer,
|
||||
NULL,
|
||||
_gdk_win32_get_next_tick (msg->time),
|
||||
build_pointer_event_state (msg),
|
||||
(double) scroll_x / (double) WHEEL_DELTA,
|
||||
(double) -scroll_y / (double) WHEEL_DELTA,
|
||||
FALSE,
|
||||
GDK_SCROLL_UNIT_WHEEL);
|
||||
direction = 0;
|
||||
if (msg->message == WM_MOUSEWHEEL)
|
||||
direction = (((short) HIWORD (msg->wParam)) > 0)
|
||||
? GDK_SCROLL_UP
|
||||
: GDK_SCROLL_DOWN;
|
||||
else if (msg->message == WM_MOUSEHWHEEL)
|
||||
direction = (((short) HIWORD (msg->wParam)) > 0)
|
||||
? GDK_SCROLL_RIGHT
|
||||
: GDK_SCROLL_LEFT;
|
||||
|
||||
event = gdk_scroll_event_new_value120 (window,
|
||||
device_manager_win32->core_pointer,
|
||||
NULL,
|
||||
_gdk_win32_get_next_tick (msg->time),
|
||||
build_pointer_event_state (msg),
|
||||
direction,
|
||||
(double) scroll_x,
|
||||
(double) -scroll_y);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
|
||||
@@ -3229,7 +3246,7 @@ gdk_event_translate (MSG *msg,
|
||||
{
|
||||
if (msg->lParam != 0)
|
||||
{
|
||||
GdkSurface *other_surface = gdk_win32_handle_table_lookup ((HWND) msg->lParam);
|
||||
GdkSurface *other_surface = gdk_win32_handle_table_lookup_ ((HWND) msg->lParam);
|
||||
if (other_surface != NULL &&
|
||||
(GDK_IS_POPUP (other_surface) || GDK_IS_DRAG_SURFACE (other_surface)))
|
||||
{
|
||||
|
||||
@@ -441,4 +441,12 @@ typedef enum _GdkWin32ProcessorCheckType
|
||||
|
||||
gboolean _gdk_win32_check_processor (GdkWin32ProcessorCheckType check_type);
|
||||
|
||||
GdkPixbuf *gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon,
|
||||
double *x_hot,
|
||||
double *y_hot);
|
||||
HICON gdk_win32_pixbuf_to_hicon_libgtk_only (GdkPixbuf *pixbuf);
|
||||
void gdk_win32_set_modal_dialog_libgtk_only (HWND window);
|
||||
|
||||
gpointer gdk_win32_handle_table_lookup_ (HWND handle);
|
||||
|
||||
#endif /* __GDK_PRIVATE_WIN32_H__ */
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkprivate-win32.h"
|
||||
#include "gdkdisplay-win32.h"
|
||||
#include "gdkwin32.h"
|
||||
|
||||
static char *
|
||||
@@ -162,6 +163,25 @@ _gdk_win32_get_setting (const char *name,
|
||||
g_value_set_int (value, 1);
|
||||
return TRUE;
|
||||
}
|
||||
else if (strcmp ("gtk-xft-dpi", name) == 0)
|
||||
{
|
||||
GdkWin32Display *display = GDK_WIN32_DISPLAY (_gdk_display);
|
||||
|
||||
if (display->dpi_aware_type == PROCESS_SYSTEM_DPI_AWARE &&
|
||||
!display->has_fixed_scale)
|
||||
{
|
||||
int dpi = GetDeviceCaps (GetDC (NULL), LOGPIXELSX);
|
||||
if (dpi >= 96)
|
||||
{
|
||||
int xft_dpi = 1024 * dpi / display->surface_scale;
|
||||
g_value_set_int (value, xft_dpi);
|
||||
GDK_NOTE(MISC, g_print ("gdk_screen_get_setting(\"%s\") : %d\n", name, xft_dpi));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
else if (strcmp ("gtk-xft-hintstyle", name) == 0)
|
||||
{
|
||||
g_value_set_static_string (value, "hintfull");
|
||||
|
||||
@@ -1180,6 +1180,11 @@ gdk_win32_surface_layout_popup (GdkSurface *surface,
|
||||
|
||||
monitor = gdk_surface_get_layout_monitor (surface, layout,
|
||||
gdk_win32_monitor_get_workarea);
|
||||
if (!monitor)
|
||||
{
|
||||
GdkDisplay *display = gdk_surface_get_display (surface);
|
||||
monitor = gdk_win32_display_get_primary_monitor (display);
|
||||
}
|
||||
gdk_win32_monitor_get_workarea (monitor, &bounds);
|
||||
|
||||
gdk_popup_layout_get_shadow_width (layout,
|
||||
@@ -1305,19 +1310,27 @@ gdk_win32_surface_raise (GdkSurface *window)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_win32_surface_set_urgency_hint:
|
||||
* @surface: (type GdkWin32Surface): a native `GdkSurface`.
|
||||
* @urgent: if %TRUE, flashes both the window and the taskbar button
|
||||
* continuously.
|
||||
*
|
||||
* Flashes the specified @surface.
|
||||
*/
|
||||
void
|
||||
gdk_win32_surface_set_urgency_hint (GdkSurface *window,
|
||||
gdk_win32_surface_set_urgency_hint (GdkSurface *surface,
|
||||
gboolean urgent)
|
||||
{
|
||||
FLASHWINFO flashwinfo;
|
||||
|
||||
g_return_if_fail (GDK_IS_SURFACE (window));
|
||||
g_return_if_fail (GDK_IS_WIN32_SURFACE (surface));
|
||||
|
||||
if (GDK_SURFACE_DESTROYED (window))
|
||||
if (GDK_SURFACE_DESTROYED (surface))
|
||||
return;
|
||||
|
||||
flashwinfo.cbSize = sizeof (flashwinfo);
|
||||
flashwinfo.hwnd = GDK_SURFACE_HWND (window);
|
||||
flashwinfo.hwnd = GDK_SURFACE_HWND (surface);
|
||||
if (urgent)
|
||||
flashwinfo.dwFlags = FLASHW_ALL | FLASHW_TIMER;
|
||||
else
|
||||
@@ -4233,19 +4246,34 @@ gdk_win32_surface_focus (GdkSurface *window,
|
||||
SetFocus (GDK_SURFACE_HWND (window));
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_win32_surface_lookup_for_display:
|
||||
* @display: a %GdkDisplay
|
||||
* @anid: a HWND window handle
|
||||
*
|
||||
* Returns: (nullable): the %GdkSurface associated with the given @anid, or %NULL.
|
||||
*/
|
||||
GdkSurface *
|
||||
gdk_win32_surface_lookup_for_display (GdkDisplay *display,
|
||||
HWND anid)
|
||||
{
|
||||
g_return_val_if_fail (display == gdk_display_get_default (), NULL);
|
||||
|
||||
return (GdkSurface*) gdk_win32_handle_table_lookup (anid);
|
||||
return (GdkSurface*) gdk_win32_handle_table_lookup_ (anid);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_win32_surface_is_win32:
|
||||
* @surface: a `GdkSurface`
|
||||
*
|
||||
* Returns: %TRUE if the @surface is a win32 implemented surface.
|
||||
*
|
||||
* Deprecated: 4.8: Use `GDK_IS_WIN32_SURFACE` instead.
|
||||
*/
|
||||
gboolean
|
||||
gdk_win32_surface_is_win32 (GdkSurface *window)
|
||||
gdk_win32_surface_is_win32 (GdkSurface *surface)
|
||||
{
|
||||
return GDK_IS_WIN32_SURFACE (window);
|
||||
return GDK_IS_WIN32_SURFACE (surface);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -4279,11 +4307,19 @@ gdk_win32_surface_show_window_menu (GdkSurface *surface,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_win32_surface_get_impl_hwnd:
|
||||
* @surface: a `GdkSurface`
|
||||
*
|
||||
* Returns: the associated @surface HWND handle.
|
||||
*
|
||||
* Deprecated: 4.8: Use gdk_win32_surface_get_handle() instead.
|
||||
*/
|
||||
HWND
|
||||
gdk_win32_surface_get_impl_hwnd (GdkSurface *window)
|
||||
gdk_win32_surface_get_impl_hwnd (GdkSurface *surface)
|
||||
{
|
||||
if (GDK_IS_WIN32_SURFACE (window))
|
||||
return GDK_SURFACE_HWND (window);
|
||||
if (GDK_IS_WIN32_SURFACE (surface))
|
||||
return GDK_SURFACE_HWND (surface);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -4449,9 +4485,8 @@ static void
|
||||
gdk_win32_surface_set_input_region (GdkSurface *window,
|
||||
cairo_region_t *input_region)
|
||||
{
|
||||
/* Partial input shape support is implemented by handling the
|
||||
* NC_NCHITTEST message
|
||||
*/
|
||||
/* Input region support is implemented by handling the
|
||||
* WM_NCHITTEST message. */
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -4614,16 +4649,20 @@ gdk_win32_surface_class_init (GdkWin32SurfaceClass *klass)
|
||||
impl_class->compute_size = _gdk_win32_surface_compute_size;
|
||||
}
|
||||
|
||||
HGDIOBJ
|
||||
gdk_win32_surface_get_handle (GdkSurface *window)
|
||||
/**
|
||||
* gdk_win32_surface_get_handle:
|
||||
* @surface: (type GdkWin32Surface): a native `GdkSurface`.
|
||||
*
|
||||
* Returns the HWND handle belonging to @surface.
|
||||
*
|
||||
* Returns: the associated HWND handle.
|
||||
*/
|
||||
HWND
|
||||
gdk_win32_surface_get_handle (GdkSurface *surface)
|
||||
{
|
||||
if (!GDK_IS_WIN32_SURFACE (window))
|
||||
{
|
||||
g_warning (G_STRLOC " window is not a native Win32 window");
|
||||
return NULL;
|
||||
}
|
||||
g_return_val_if_fail (GDK_IS_WIN32_SURFACE (surface), NULL);
|
||||
|
||||
return GDK_SURFACE_HWND (window);
|
||||
return GDK_SURFACE_HWND (surface);
|
||||
}
|
||||
|
||||
#define LAST_PROP 1
|
||||
|
||||
@@ -70,7 +70,7 @@ gdk_win32_handle_table_remove (HANDLE handle)
|
||||
}
|
||||
|
||||
gpointer
|
||||
gdk_win32_handle_table_lookup (HWND handle)
|
||||
gdk_win32_handle_table_lookup_ (HWND handle)
|
||||
{
|
||||
gpointer data = NULL;
|
||||
|
||||
@@ -79,3 +79,9 @@ gdk_win32_handle_table_lookup (HWND handle)
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
gpointer
|
||||
gdk_win32_handle_table_lookup (HWND handle)
|
||||
{
|
||||
return gdk_win32_handle_table_lookup_ (handle);
|
||||
}
|
||||
|
||||
@@ -61,12 +61,6 @@ typedef struct _GdkWin32KeymapClass GdkWin32KeymapClass;
|
||||
|
||||
GType gdk_win32_keymap_get_type (void);
|
||||
|
||||
GdkWin32KeymapMatch gdk_win32_keymap_check_compose (GdkWin32Keymap *keymap,
|
||||
guint16 *compose_buffer,
|
||||
gsize compose_buffer_len,
|
||||
guint16 *output,
|
||||
gsize *output_len);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WIN32_KEYMAP_H__ */
|
||||
|
||||
@@ -68,37 +68,22 @@ G_BEGIN_DECLS
|
||||
#define XBUTTON2 2
|
||||
#endif
|
||||
|
||||
/* Return true if the GdkSurface is a win32 implemented window */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_win32_surface_is_win32 (GdkSurface *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
HWND gdk_win32_surface_get_impl_hwnd (GdkSurface *window);
|
||||
GDK_DEPRECATED_IN_4_8_FOR(GDK_IS_WIN32_SURFACE)
|
||||
gboolean gdk_win32_surface_is_win32 (GdkSurface *surface);
|
||||
GDK_DEPRECATED_IN_4_8_FOR(gdk_win32_surface_get_handle)
|
||||
HWND gdk_win32_surface_get_impl_hwnd (GdkSurface *surface);
|
||||
|
||||
/* Return the Gdk* for a particular HANDLE */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_4_8
|
||||
gpointer gdk_win32_handle_table_lookup (HWND handle);
|
||||
|
||||
/* Translate from window to Windows handle */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
HGDIOBJ gdk_win32_surface_get_handle (GdkSurface *window);
|
||||
HWND gdk_win32_surface_get_handle (GdkSurface *surface);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkSurface * gdk_win32_surface_lookup_for_display (GdkDisplay *display,
|
||||
HWND anid);
|
||||
|
||||
#if defined (INSIDE_GDK_WIN32) || defined (GTK_COMPILATION) || defined (GTK_COMPILATION)
|
||||
|
||||
/* For internal GTK use only */
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkPixbuf *gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon,
|
||||
double *x_hot,
|
||||
double *y_hot);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
HICON gdk_win32_pixbuf_to_hicon_libgtk_only (GdkPixbuf *pixbuf);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_win32_set_modal_dialog_libgtk_only (HWND window);
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WIN32_MISC_H__ */
|
||||
|
||||
+16
-13
@@ -1,6 +1,19 @@
|
||||
gdk_win32_sources = files([
|
||||
'gdkcairocontext-win32.c',
|
||||
gdk_win32_public_sources = files([
|
||||
'gdkcursor-win32.c',
|
||||
'gdkdisplay-win32.c',
|
||||
'gdkdisplaymanager-win32.c',
|
||||
'gdkdrag-win32.c',
|
||||
'gdkglcontext-win32.c',
|
||||
'gdkglcontext-win32-wgl.c',
|
||||
'gdkwin32id.c',
|
||||
'gdksurface-win32.c',
|
||||
'gdkevents-win32.c',
|
||||
'gdkmonitor-win32.c',
|
||||
'gdkscreen-win32.c',
|
||||
])
|
||||
|
||||
gdk_win32_sources = gdk_win32_public_sources + files([
|
||||
'gdkcairocontext-win32.c',
|
||||
'gdkclipboard-win32.c',
|
||||
'gdkclipdrop-win32.c',
|
||||
'gdkdevicemanager-win32.c',
|
||||
@@ -8,13 +21,7 @@ gdk_win32_sources = files([
|
||||
'gdkdevice-win32.c',
|
||||
'gdkdevice-winpointer.c',
|
||||
'gdkdevice-wintab.c',
|
||||
'gdkdisplay-win32.c',
|
||||
'gdkdisplaymanager-win32.c',
|
||||
'gdkdrag-win32.c',
|
||||
'gdkdrop-win32.c',
|
||||
'gdkevents-win32.c',
|
||||
'gdkglcontext-win32.c',
|
||||
'gdkglcontext-win32-wgl.c',
|
||||
'gdkglobals-win32.c',
|
||||
'gdkhdataoutputstream-win32.c',
|
||||
'gdkinput-dmanipulation.c',
|
||||
@@ -24,14 +31,11 @@ gdk_win32_sources = files([
|
||||
'gdkkeys-win32-impl-wow64.c',
|
||||
'gdkwin32langnotification.c',
|
||||
'gdkmain-win32.c',
|
||||
'gdkmonitor-win32.c',
|
||||
'gdkproperty-win32.c',
|
||||
'gdkscreen-win32.c',
|
||||
'gdkvulkancontext-win32.c',
|
||||
'gdkwin32cursor.h',
|
||||
'gdkwin32display.h',
|
||||
'gdkwin32id.c',
|
||||
'gdksurface-win32.c',
|
||||
'gdkwin32keys.h',
|
||||
])
|
||||
|
||||
gdk_win32_public_headers = files([
|
||||
@@ -40,7 +44,6 @@ gdk_win32_public_headers = files([
|
||||
'gdkwin32displaymanager.h',
|
||||
'gdkwin32dnd.h',
|
||||
'gdkwin32glcontext.h',
|
||||
'gdkwin32keys.h',
|
||||
'gdkwin32misc.h',
|
||||
'gdkwin32monitor.h',
|
||||
'gdkwin32screen.h',
|
||||
|
||||
@@ -358,10 +358,10 @@ gdk_x11_clipboard_request_targets_got_stream (GObject *source,
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
else if (!g_str_equal (type, "ATOM") || format != 32)
|
||||
else if (g_strcmp0 (type, "ATOM") != 0 || format != 32)
|
||||
{
|
||||
GDK_DISPLAY_NOTE (display, CLIPBOARD, g_printerr ("%s: Wrong reply type to TARGETS: type %s != ATOM or format %d != 32\n",
|
||||
cb->selection, type, format));
|
||||
cb->selection, type ? type : "NULL", format));
|
||||
g_input_stream_close (stream, NULL, NULL);
|
||||
g_object_unref (stream);
|
||||
g_object_unref (cb);
|
||||
|
||||
@@ -1729,6 +1729,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
&xev->valuators, &delta_x, &delta_y))
|
||||
{
|
||||
GdkModifierType state;
|
||||
GdkScrollDirection direction;
|
||||
|
||||
GDK_DISPLAY_NOTE (display, EVENTS,
|
||||
g_message ("smooth scroll: \n\tdevice: %u\n\tsource device: %u\n\twindow %ld\n\tdeltas: %f %f",
|
||||
@@ -1737,21 +1738,19 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
|
||||
state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
|
||||
|
||||
if (delta_x > 0)
|
||||
direction = GDK_SCROLL_RIGHT;
|
||||
else if (delta_x < 0)
|
||||
direction = GDK_SCROLL_LEFT;
|
||||
else if (delta_y > 0)
|
||||
direction = GDK_SCROLL_DOWN;
|
||||
else
|
||||
direction = GDK_SCROLL_UP;
|
||||
|
||||
if (gdk_device_get_source (source_device) != GDK_SOURCE_TOUCHPAD &&
|
||||
((delta_x == 0.0 && ABS (delta_y) == 1.0) ||
|
||||
(ABS (delta_x) == 1.0 && delta_y == 0.0)))
|
||||
{
|
||||
GdkScrollDirection direction;
|
||||
|
||||
if (delta_x > 0)
|
||||
direction = GDK_SCROLL_RIGHT;
|
||||
else if (delta_x < 0)
|
||||
direction = GDK_SCROLL_LEFT;
|
||||
else if (delta_y > 0)
|
||||
direction = GDK_SCROLL_DOWN;
|
||||
else
|
||||
direction = GDK_SCROLL_UP;
|
||||
|
||||
event = gdk_scroll_event_new_discrete (surface,
|
||||
device,
|
||||
NULL,
|
||||
@@ -1759,6 +1758,17 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
state,
|
||||
direction);
|
||||
}
|
||||
else if (gdk_device_get_source (source_device) == GDK_SOURCE_MOUSE)
|
||||
{
|
||||
event = gdk_scroll_event_new_value120 (surface,
|
||||
device,
|
||||
NULL,
|
||||
xev->time,
|
||||
state,
|
||||
direction,
|
||||
delta_x * 120.0,
|
||||
delta_y * 120.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
event = gdk_scroll_event_new (surface,
|
||||
|
||||
+12
-16
@@ -361,9 +361,9 @@ gdk_x11_drop_update_actions (GdkX11Drop *drop_x11)
|
||||
if (!drop_x11->xdnd_have_actions)
|
||||
actions = drop_x11->suggested_action;
|
||||
else if (drop_x11->suggested_action & GDK_ACTION_ASK)
|
||||
actions = drop_x11->xdnd_actions & GDK_ACTION_ALL;
|
||||
actions = drop_x11->xdnd_actions | GDK_ACTION_ASK;
|
||||
else
|
||||
actions = drop_x11->suggested_action;
|
||||
actions = drop_x11->xdnd_actions & GDK_ACTION_ALL;
|
||||
|
||||
gdk_drop_set_actions (GDK_DROP (drop_x11), actions);
|
||||
}
|
||||
@@ -769,22 +769,18 @@ gdk_x11_drop_status (GdkDrop *drop,
|
||||
|
||||
possible_actions = actions & gdk_drop_get_actions (drop);
|
||||
|
||||
if (drop_x11->suggested_action != 0)
|
||||
if (preferred & possible_actions)
|
||||
suggested_action = preferred;
|
||||
else if (drop_x11->suggested_action & possible_actions)
|
||||
suggested_action = drop_x11->suggested_action;
|
||||
else if (possible_actions & GDK_ACTION_COPY)
|
||||
suggested_action = GDK_ACTION_COPY;
|
||||
else if (possible_actions & GDK_ACTION_MOVE)
|
||||
suggested_action = GDK_ACTION_MOVE;
|
||||
else if (possible_actions & GDK_ACTION_ASK)
|
||||
suggested_action = GDK_ACTION_ASK;
|
||||
else
|
||||
suggested_action = preferred & possible_actions;
|
||||
|
||||
if (suggested_action == 0 && possible_actions != 0)
|
||||
{
|
||||
if (possible_actions & GDK_ACTION_COPY)
|
||||
suggested_action = GDK_ACTION_COPY;
|
||||
else if (possible_actions & GDK_ACTION_MOVE)
|
||||
suggested_action = GDK_ACTION_MOVE;
|
||||
else if (possible_actions & GDK_ACTION_ASK)
|
||||
suggested_action = GDK_ACTION_ASK;
|
||||
else
|
||||
suggested_action = 0;
|
||||
}
|
||||
suggested_action = 0;
|
||||
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "XdndStatus");
|
||||
|
||||
@@ -176,7 +176,12 @@ gsk_gl_driver_shader_weak_cb (gpointer data,
|
||||
g_assert (GSK_IS_GL_DRIVER (self));
|
||||
|
||||
if (self->shader_cache != NULL)
|
||||
g_hash_table_remove (self->shader_cache, where_object_was);
|
||||
{
|
||||
if (self->command_queue != NULL)
|
||||
gsk_gl_command_queue_make_current (self->command_queue);
|
||||
|
||||
g_hash_table_remove (self->shader_cache, where_object_was);
|
||||
}
|
||||
}
|
||||
|
||||
G_GNUC_NULL_TERMINATED static inline GBytes *
|
||||
|
||||
+74
-12
@@ -241,8 +241,8 @@ static void
|
||||
gsk_gl_glyph_library_upload_glyph (GskGLGlyphLibrary *self,
|
||||
const GskGLGlyphKey *key,
|
||||
const GskGLGlyphValue *value,
|
||||
int x,
|
||||
int y,
|
||||
int packed_x,
|
||||
int packed_y,
|
||||
int width,
|
||||
int height,
|
||||
int uwidth,
|
||||
@@ -275,19 +275,16 @@ gsk_gl_glyph_library_upload_glyph (GskGLGlyphLibrary *self,
|
||||
|
||||
g_assert (texture_id > 0);
|
||||
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, stride / 4);
|
||||
glBindTexture (GL_TEXTURE_2D, texture_id);
|
||||
|
||||
if G_UNLIKELY (gdk_gl_context_get_use_es (gdk_gl_context_get_current ()))
|
||||
{
|
||||
pixel_data = free_data = g_malloc (width * height * 4);
|
||||
gdk_memory_convert (pixel_data,
|
||||
width * 4,
|
||||
gdk_memory_convert (pixel_data, width * 4,
|
||||
GDK_MEMORY_R8G8B8A8_PREMULTIPLIED,
|
||||
cairo_image_surface_get_data (surface),
|
||||
width * 4,
|
||||
stride,
|
||||
GDK_MEMORY_DEFAULT,
|
||||
width, height);
|
||||
stride = width * 4;
|
||||
gl_format = GL_RGBA;
|
||||
gl_type = GL_UNSIGNED_BYTE;
|
||||
}
|
||||
@@ -298,9 +295,74 @@ gsk_gl_glyph_library_upload_glyph (GskGLGlyphLibrary *self,
|
||||
gl_type = GL_UNSIGNED_INT_8_8_8_8_REV;
|
||||
}
|
||||
|
||||
glTexSubImage2D (GL_TEXTURE_2D, 0, x, y, width, height,
|
||||
gl_format, gl_type, pixel_data);
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, stride / 4);
|
||||
glBindTexture (GL_TEXTURE_2D, texture_id);
|
||||
|
||||
glTexSubImage2D (GL_TEXTURE_2D, 0,
|
||||
packed_x + 1, packed_y + 1,
|
||||
width, height,
|
||||
gl_format, gl_type,
|
||||
pixel_data);
|
||||
|
||||
/* Padding top */
|
||||
glTexSubImage2D (GL_TEXTURE_2D, 0,
|
||||
packed_x + 1, packed_y,
|
||||
width, 1,
|
||||
gl_format, gl_type,
|
||||
pixel_data);
|
||||
/* Padding left */
|
||||
glTexSubImage2D (GL_TEXTURE_2D, 0,
|
||||
packed_x, packed_y + 1,
|
||||
1, height,
|
||||
gl_format, gl_type,
|
||||
pixel_data);
|
||||
/* Padding top left */
|
||||
glTexSubImage2D (GL_TEXTURE_2D, 0,
|
||||
packed_x, packed_y,
|
||||
1, 1,
|
||||
gl_format, gl_type,
|
||||
pixel_data);
|
||||
/* Padding right */
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, width);
|
||||
glPixelStorei (GL_UNPACK_SKIP_PIXELS, width - 1);
|
||||
glTexSubImage2D (GL_TEXTURE_2D, 0,
|
||||
packed_x + width + 1, packed_y + 1,
|
||||
1, height,
|
||||
gl_format, gl_type,
|
||||
pixel_data);
|
||||
/* Padding top right */
|
||||
glTexSubImage2D (GL_TEXTURE_2D, 0,
|
||||
packed_x + width + 1, packed_y,
|
||||
1, 1,
|
||||
gl_format, gl_type,
|
||||
pixel_data);
|
||||
/* Padding bottom */
|
||||
glPixelStorei (GL_UNPACK_SKIP_PIXELS, 0);
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
|
||||
glPixelStorei (GL_UNPACK_SKIP_ROWS, height - 1);
|
||||
glTexSubImage2D (GL_TEXTURE_2D, 0,
|
||||
packed_x + 1, packed_y + 1 + height,
|
||||
width, 1,
|
||||
gl_format, gl_type,
|
||||
pixel_data);
|
||||
/* Padding bottom left */
|
||||
glTexSubImage2D (GL_TEXTURE_2D, 0,
|
||||
packed_x, packed_y + 1 + height,
|
||||
1, 1,
|
||||
gl_format, gl_type,
|
||||
pixel_data);
|
||||
/* Padding bottom right */
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, width);
|
||||
glPixelStorei (GL_UNPACK_SKIP_PIXELS, width - 1);
|
||||
glTexSubImage2D (GL_TEXTURE_2D, 0,
|
||||
packed_x + 1 + width, packed_y + 1 + height,
|
||||
1, 1,
|
||||
gl_format, gl_type,
|
||||
pixel_data);
|
||||
/* Reset this */
|
||||
glPixelStorei (GL_UNPACK_SKIP_PIXELS, 0);
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
|
||||
glPixelStorei (GL_UNPACK_SKIP_ROWS, 0);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
g_free (free_data);
|
||||
@@ -359,8 +421,8 @@ gsk_gl_glyph_library_add (GskGLGlyphLibrary *self,
|
||||
gsk_gl_glyph_library_upload_glyph (self,
|
||||
key,
|
||||
value,
|
||||
packed_x + 1,
|
||||
packed_y + 1,
|
||||
packed_x,
|
||||
packed_y,
|
||||
width,
|
||||
height,
|
||||
ink_rect.width,
|
||||
|
||||
@@ -162,6 +162,7 @@ uniform_type_from_glsl (const char *str)
|
||||
return GSK_GL_UNIFORM_TYPE_NONE;
|
||||
}
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
static const char *
|
||||
uniform_type_name (GskGLUniformType type)
|
||||
{
|
||||
@@ -194,6 +195,7 @@ uniform_type_name (GskGLUniformType type)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
uniform_type_size (GskGLUniformType type)
|
||||
@@ -397,6 +399,7 @@ gsk_gl_shader_constructed (GObject *object)
|
||||
|
||||
shader->n_textures = max_texture_seen;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (GSK_DEBUG_CHECK(SHADERS))
|
||||
{
|
||||
GString *s;
|
||||
@@ -414,6 +417,7 @@ gsk_gl_shader_constructed (GObject *object)
|
||||
s->str);
|
||||
g_string_free (s, TRUE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#define SPACE_RE "[ \\t]+" // Don't use \s, we don't want to match newlines
|
||||
@@ -631,6 +635,7 @@ gsk_gl_shader_get_uniform_name (GskGLShader *shader,
|
||||
int idx)
|
||||
{
|
||||
g_return_val_if_fail (GSK_IS_GL_SHADER (shader), NULL);
|
||||
g_return_val_if_fail (0 <= idx && idx < shader->uniforms->len, NULL);
|
||||
|
||||
return g_array_index (shader->uniforms, GskGLUniform, idx).name;
|
||||
}
|
||||
@@ -675,6 +680,7 @@ gsk_gl_shader_get_uniform_type (GskGLShader *shader,
|
||||
int idx)
|
||||
{
|
||||
g_return_val_if_fail (GSK_IS_GL_SHADER (shader), 0);
|
||||
g_return_val_if_fail (0 <= idx && idx < shader->uniforms->len, 0);
|
||||
|
||||
return g_array_index (shader->uniforms, GskGLUniform, idx).type;
|
||||
}
|
||||
@@ -693,6 +699,7 @@ gsk_gl_shader_get_uniform_offset (GskGLShader *shader,
|
||||
int idx)
|
||||
{
|
||||
g_return_val_if_fail (GSK_IS_GL_SHADER (shader), 0);
|
||||
g_return_val_if_fail (0 <= idx && idx < shader->uniforms->len, 0);
|
||||
|
||||
return g_array_index (shader->uniforms, GskGLUniform, idx).offset;
|
||||
}
|
||||
|
||||
@@ -15,23 +15,3 @@ gsk_ensure_resources (void)
|
||||
|
||||
g_once (®ister_resources_once, register_resources, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
pango_glyph_string_num_glyphs (PangoGlyphString *glyphs)
|
||||
{
|
||||
int i, count;
|
||||
|
||||
count = 0;
|
||||
for (i = 0; i < glyphs->num_glyphs; i++)
|
||||
{
|
||||
PangoGlyphInfo *gi = &glyphs->glyphs[i];
|
||||
if (gi->glyph != PANGO_GLYPH_EMPTY)
|
||||
{
|
||||
if (!(gi->glyph & PANGO_GLYPH_UNKNOWN_FLAG))
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ G_BEGIN_DECLS
|
||||
|
||||
void gsk_ensure_resources (void);
|
||||
|
||||
int pango_glyph_string_num_glyphs (PangoGlyphString *glyphs) G_GNUC_PURE;
|
||||
|
||||
typedef struct _GskVulkanRender GskVulkanRender;
|
||||
typedef struct _GskVulkanRenderPass GskVulkanRenderPass;
|
||||
|
||||
|
||||
@@ -3752,7 +3752,7 @@ gsk_rounded_clip_node_diff (GskRenderNode *node1,
|
||||
* Creates a `GskRenderNode` that will clip the @child to the area
|
||||
* given by @clip.
|
||||
*
|
||||
* Returns: (transfer none) (type GskRoundedClipNode): A new `GskRenderNode`
|
||||
* Returns: (transfer full) (type GskRoundedClipNode): A new `GskRenderNode`
|
||||
*/
|
||||
GskRenderNode *
|
||||
gsk_rounded_clip_node_new (GskRenderNode *child,
|
||||
|
||||
+22
-22
@@ -982,7 +982,7 @@ parse_color_node (GtkCssParser *parser)
|
||||
{ "color", parse_color, NULL, &color },
|
||||
};
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
|
||||
return gsk_color_node_new (&color, &bounds);
|
||||
}
|
||||
@@ -1003,7 +1003,7 @@ parse_linear_gradient_node_internal (GtkCssParser *parser,
|
||||
};
|
||||
GskRenderNode *result;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
if (stops == NULL)
|
||||
{
|
||||
GskColorStop from = { 0.0, GDK_RGBA("AAFF00") };
|
||||
@@ -1058,7 +1058,7 @@ parse_radial_gradient_node_internal (GtkCssParser *parser,
|
||||
};
|
||||
GskRenderNode *result;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
if (stops == NULL)
|
||||
{
|
||||
GskColorStop from = { 0.0, GDK_RGBA("AAFF00") };
|
||||
@@ -1108,7 +1108,7 @@ parse_conic_gradient_node (GtkCssParser *parser)
|
||||
};
|
||||
GskRenderNode *result;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
if (stops == NULL)
|
||||
{
|
||||
GskColorStop from = { 0.0, GDK_RGBA("AAFF00") };
|
||||
@@ -1142,7 +1142,7 @@ parse_inset_shadow_node (GtkCssParser *parser)
|
||||
{ "blur", parse_double, NULL, &blur }
|
||||
};
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
|
||||
return gsk_inset_shadow_node_new (&outline, &color, dx, dy, spread, blur);
|
||||
}
|
||||
@@ -1325,7 +1325,7 @@ parse_glshader_node (GtkCssParser *parser)
|
||||
GBytes *args = NULL;
|
||||
int len, i;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
|
||||
for (len = 0; len < 4; len++)
|
||||
{
|
||||
@@ -1362,7 +1362,7 @@ parse_border_node (GtkCssParser *parser)
|
||||
{ "colors", parse_colors4, NULL, &colors }
|
||||
};
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
|
||||
return gsk_border_node_new (&outline, widths, colors);
|
||||
}
|
||||
@@ -1378,7 +1378,7 @@ parse_texture_node (GtkCssParser *parser)
|
||||
};
|
||||
GskRenderNode *node;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
|
||||
if (texture == NULL)
|
||||
texture = create_default_texture ();
|
||||
@@ -1402,7 +1402,7 @@ parse_cairo_node (GtkCssParser *parser)
|
||||
};
|
||||
GskRenderNode *node;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
|
||||
node = gsk_cairo_node_new (&bounds);
|
||||
|
||||
@@ -1447,7 +1447,7 @@ parse_outset_shadow_node (GtkCssParser *parser)
|
||||
{ "blur", parse_double, NULL, &blur }
|
||||
};
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
|
||||
return gsk_outset_shadow_node_new (&outline, &color, dx, dy, spread, blur);
|
||||
}
|
||||
@@ -1463,7 +1463,7 @@ parse_transform_node (GtkCssParser *parser)
|
||||
};
|
||||
GskRenderNode *result;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
if (child == NULL)
|
||||
child = create_default_render_node ();
|
||||
|
||||
@@ -1490,7 +1490,7 @@ parse_opacity_node (GtkCssParser *parser)
|
||||
};
|
||||
GskRenderNode *result;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
if (child == NULL)
|
||||
child = create_default_render_node ();
|
||||
|
||||
@@ -1517,7 +1517,7 @@ parse_color_matrix_node (GtkCssParser *parser)
|
||||
|
||||
graphene_vec4_init (&offset, 0, 0, 0, 0);
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
if (child == NULL)
|
||||
child = create_default_render_node ();
|
||||
|
||||
@@ -1544,7 +1544,7 @@ parse_cross_fade_node (GtkCssParser *parser)
|
||||
};
|
||||
GskRenderNode *result;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
if (start == NULL)
|
||||
start = gsk_color_node_new (&GDK_RGBA("AAFF00"), &GRAPHENE_RECT_INIT (0, 0, 50, 50));
|
||||
if (end == NULL)
|
||||
@@ -1571,7 +1571,7 @@ parse_blend_node (GtkCssParser *parser)
|
||||
};
|
||||
GskRenderNode *result;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
if (bottom == NULL)
|
||||
bottom = gsk_color_node_new (&GDK_RGBA("AAFF00"), &GRAPHENE_RECT_INIT (0, 0, 50, 50));
|
||||
if (top == NULL)
|
||||
@@ -1599,7 +1599,7 @@ parse_repeat_node (GtkCssParser *parser)
|
||||
GskRenderNode *result;
|
||||
guint parse_result;
|
||||
|
||||
parse_result = parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_result = parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
if (child == NULL)
|
||||
child = create_default_render_node ();
|
||||
|
||||
@@ -1663,7 +1663,7 @@ parse_text_node (GtkCssParser *parser)
|
||||
};
|
||||
GskRenderNode *result;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
|
||||
if (font == NULL)
|
||||
{
|
||||
@@ -1721,7 +1721,7 @@ parse_blur_node (GtkCssParser *parser)
|
||||
};
|
||||
GskRenderNode *result;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
if (child == NULL)
|
||||
child = create_default_render_node ();
|
||||
|
||||
@@ -1743,7 +1743,7 @@ parse_clip_node (GtkCssParser *parser)
|
||||
};
|
||||
GskRenderNode *result;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
if (child == NULL)
|
||||
child = create_default_render_node ();
|
||||
|
||||
@@ -1768,7 +1768,7 @@ parse_rounded_clip_node (GtkCssParser *parser)
|
||||
};
|
||||
GskRenderNode *result;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
if (child == NULL)
|
||||
child = create_default_render_node ();
|
||||
|
||||
@@ -1790,7 +1790,7 @@ parse_shadow_node (GtkCssParser *parser)
|
||||
};
|
||||
GskRenderNode *result;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
if (child == NULL)
|
||||
child = create_default_render_node ();
|
||||
|
||||
@@ -1819,7 +1819,7 @@ parse_debug_node (GtkCssParser *parser)
|
||||
};
|
||||
GskRenderNode *result;
|
||||
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
|
||||
parse_declarations (parser, declarations, G_N_ELEMENTS (declarations));
|
||||
if (child == NULL)
|
||||
child = create_default_render_node ();
|
||||
|
||||
|
||||
@@ -285,6 +285,14 @@
|
||||
...
|
||||
fun:g_intern_static_string
|
||||
}
|
||||
{
|
||||
glib GQuark
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: definite
|
||||
fun:malloc
|
||||
...
|
||||
fun:g_intern_string
|
||||
}
|
||||
|
||||
# Threads
|
||||
{
|
||||
|
||||
+43
-26
@@ -953,22 +953,30 @@ gtk_at_spi_context_state_change (GtkATContext *ctx,
|
||||
{
|
||||
value = gtk_accessible_attribute_set_get_value (states, GTK_ACCESSIBLE_STATE_CHECKED);
|
||||
|
||||
switch (gtk_tristate_accessible_value_get (value))
|
||||
if (value->value_class->type == GTK_ACCESSIBLE_VALUE_TYPE_TRISTATE)
|
||||
{
|
||||
switch (gtk_tristate_accessible_value_get (value))
|
||||
{
|
||||
case GTK_ACCESSIBLE_TRISTATE_TRUE:
|
||||
emit_state_changed (self, "checked", TRUE);
|
||||
emit_state_changed (self, "indeterminate", FALSE);
|
||||
break;
|
||||
case GTK_ACCESSIBLE_TRISTATE_MIXED:
|
||||
emit_state_changed (self, "checked", FALSE);
|
||||
emit_state_changed (self, "indeterminate", TRUE);
|
||||
break;
|
||||
case GTK_ACCESSIBLE_TRISTATE_FALSE:
|
||||
emit_state_changed (self, "checked", FALSE);
|
||||
emit_state_changed (self, "indeterminate", FALSE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
case GTK_ACCESSIBLE_TRISTATE_TRUE:
|
||||
emit_state_changed (self, "checked", TRUE);
|
||||
emit_state_changed (self, "indeterminate", FALSE);
|
||||
break;
|
||||
case GTK_ACCESSIBLE_TRISTATE_MIXED:
|
||||
emit_state_changed (self, "checked", FALSE);
|
||||
emit_state_changed (self, "indeterminate", TRUE);
|
||||
break;
|
||||
case GTK_ACCESSIBLE_TRISTATE_FALSE:
|
||||
emit_state_changed (self, "checked", FALSE);
|
||||
emit_state_changed (self, "indeterminate", FALSE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1011,22 +1019,31 @@ gtk_at_spi_context_state_change (GtkATContext *ctx,
|
||||
if (changed_states & GTK_ACCESSIBLE_STATE_CHANGE_PRESSED)
|
||||
{
|
||||
value = gtk_accessible_attribute_set_get_value (states, GTK_ACCESSIBLE_STATE_PRESSED);
|
||||
switch (gtk_tristate_accessible_value_get (value))
|
||||
|
||||
if (value->value_class->type == GTK_ACCESSIBLE_VALUE_TYPE_TRISTATE)
|
||||
{
|
||||
switch (gtk_tristate_accessible_value_get (value))
|
||||
{
|
||||
case GTK_ACCESSIBLE_TRISTATE_TRUE:
|
||||
emit_state_changed (self, "pressed", TRUE);
|
||||
emit_state_changed (self, "indeterminate", FALSE);
|
||||
break;
|
||||
case GTK_ACCESSIBLE_TRISTATE_MIXED:
|
||||
emit_state_changed (self, "pressed", FALSE);
|
||||
emit_state_changed (self, "indeterminate", TRUE);
|
||||
break;
|
||||
case GTK_ACCESSIBLE_TRISTATE_FALSE:
|
||||
emit_state_changed (self, "pressed", FALSE);
|
||||
emit_state_changed (self, "indeterminate", FALSE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
case GTK_ACCESSIBLE_TRISTATE_TRUE:
|
||||
emit_state_changed (self, "pressed", TRUE);
|
||||
emit_state_changed (self, "indeterminate", FALSE);
|
||||
break;
|
||||
case GTK_ACCESSIBLE_TRISTATE_MIXED:
|
||||
emit_state_changed (self, "pressed", FALSE);
|
||||
emit_state_changed (self, "indeterminate", TRUE);
|
||||
break;
|
||||
case GTK_ACCESSIBLE_TRISTATE_FALSE:
|
||||
emit_state_changed (self, "pressed", FALSE);
|
||||
emit_state_changed (self, "indeterminate", FALSE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-124
@@ -18,130 +18,7 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "gtkatspipangoprivate.h"
|
||||
|
||||
const char *
|
||||
pango_style_to_string (PangoStyle style)
|
||||
{
|
||||
switch (style)
|
||||
{
|
||||
case PANGO_STYLE_NORMAL:
|
||||
return "normal";
|
||||
case PANGO_STYLE_OBLIQUE:
|
||||
return "oblique";
|
||||
case PANGO_STYLE_ITALIC:
|
||||
return "italic";
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
pango_variant_to_string (PangoVariant variant)
|
||||
{
|
||||
switch (variant)
|
||||
{
|
||||
case PANGO_VARIANT_NORMAL:
|
||||
return "normal";
|
||||
case PANGO_VARIANT_SMALL_CAPS:
|
||||
return "small_caps";
|
||||
case PANGO_VARIANT_ALL_SMALL_CAPS:
|
||||
return "all_small_caps";
|
||||
case PANGO_VARIANT_PETITE_CAPS:
|
||||
return "petite_caps";
|
||||
case PANGO_VARIANT_ALL_PETITE_CAPS:
|
||||
return "all_petite_caps";
|
||||
case PANGO_VARIANT_UNICASE:
|
||||
return "unicase";
|
||||
case PANGO_VARIANT_TITLE_CAPS:
|
||||
return "title_caps";
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
pango_stretch_to_string (PangoStretch stretch)
|
||||
{
|
||||
switch (stretch)
|
||||
{
|
||||
case PANGO_STRETCH_ULTRA_CONDENSED:
|
||||
return "ultra_condensed";
|
||||
case PANGO_STRETCH_EXTRA_CONDENSED:
|
||||
return "extra_condensed";
|
||||
case PANGO_STRETCH_CONDENSED:
|
||||
return "condensed";
|
||||
case PANGO_STRETCH_SEMI_CONDENSED:
|
||||
return "semi_condensed";
|
||||
case PANGO_STRETCH_NORMAL:
|
||||
return "normal";
|
||||
case PANGO_STRETCH_SEMI_EXPANDED:
|
||||
return "semi_expanded";
|
||||
case PANGO_STRETCH_EXPANDED:
|
||||
return "expanded";
|
||||
case PANGO_STRETCH_EXTRA_EXPANDED:
|
||||
return "extra_expanded";
|
||||
case PANGO_STRETCH_ULTRA_EXPANDED:
|
||||
return "ultra_expanded";
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
pango_underline_to_string (PangoUnderline value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case PANGO_UNDERLINE_NONE:
|
||||
return "none";
|
||||
case PANGO_UNDERLINE_SINGLE:
|
||||
case PANGO_UNDERLINE_SINGLE_LINE:
|
||||
return "single";
|
||||
case PANGO_UNDERLINE_DOUBLE:
|
||||
case PANGO_UNDERLINE_DOUBLE_LINE:
|
||||
return "double";
|
||||
case PANGO_UNDERLINE_LOW:
|
||||
return "low";
|
||||
case PANGO_UNDERLINE_ERROR:
|
||||
case PANGO_UNDERLINE_ERROR_LINE:
|
||||
return "error";
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
pango_wrap_mode_to_string (PangoWrapMode mode)
|
||||
{
|
||||
/* Keep these in sync with gtk_wrap_mode_to_string() */
|
||||
switch (mode)
|
||||
{
|
||||
case PANGO_WRAP_WORD:
|
||||
return "word";
|
||||
case PANGO_WRAP_CHAR:
|
||||
return "char";
|
||||
case PANGO_WRAP_WORD_CHAR:
|
||||
return "word-char";
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
pango_align_to_string (PangoAlignment align)
|
||||
{
|
||||
switch (align)
|
||||
{
|
||||
case PANGO_ALIGN_LEFT:
|
||||
return "left";
|
||||
case PANGO_ALIGN_CENTER:
|
||||
return "center";
|
||||
case PANGO_ALIGN_RIGHT:
|
||||
return "right";
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
#include "gtkpango.h"
|
||||
|
||||
void
|
||||
gtk_pango_get_font_attributes (PangoFontDescription *font,
|
||||
|
||||
@@ -22,12 +22,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
const char *pango_wrap_mode_to_string (PangoWrapMode mode);
|
||||
const char *pango_underline_to_string (PangoUnderline underline);
|
||||
const char *pango_stretch_to_string (PangoStretch stretch);
|
||||
const char *pango_style_to_string (PangoStyle style);
|
||||
const char *pango_variant_to_string (PangoVariant variant);
|
||||
|
||||
void gtk_pango_get_font_attributes (PangoFontDescription *font,
|
||||
GVariantBuilder *builder);
|
||||
void gtk_pango_get_default_attributes (PangoLayout *layout,
|
||||
|
||||
@@ -106,6 +106,7 @@ gtk_at_spi_root_dispose (GObject *gobject)
|
||||
|
||||
g_clear_object (&self->cache);
|
||||
g_clear_object (&self->connection);
|
||||
g_clear_pointer (&self->queued_contexts, g_list_free);
|
||||
|
||||
G_OBJECT_CLASS (gtk_at_spi_root_parent_class)->dispose (gobject);
|
||||
}
|
||||
@@ -517,7 +518,8 @@ on_registration_reply (GObject *gobject,
|
||||
/* Drain the list of queued GtkAtSpiContexts, and add them to the cache */
|
||||
if (self->queued_contexts != NULL)
|
||||
{
|
||||
for (GList *l = g_list_reverse (self->queued_contexts); l != NULL; l = l->next)
|
||||
self->queued_contexts = g_list_reverse (self->queued_contexts);
|
||||
for (GList *l = self->queued_contexts; l != NULL; l = l->next)
|
||||
{
|
||||
if (data->register_func != NULL)
|
||||
data->register_func (self, l->data);
|
||||
|
||||
@@ -864,7 +864,7 @@ notebook_handle_method (GDBusConnection *connection,
|
||||
|
||||
for (child = gtk_widget_get_first_child (widget);
|
||||
child;
|
||||
child = gtk_widget_get_next_sibling (widget))
|
||||
child = gtk_widget_get_next_sibling (child))
|
||||
{
|
||||
/* skip actions */
|
||||
if (gtk_accessible_get_accessible_role (GTK_ACCESSIBLE (child)) != GTK_ACCESSIBLE_ROLE_TAB)
|
||||
|
||||
@@ -32,13 +32,15 @@
|
||||
#include "gtkatcontextprivate.h"
|
||||
#include "gtkdebug.h"
|
||||
#include "gtkeditable.h"
|
||||
#include "gtkentryprivate.h"
|
||||
#include "gtkinscriptionprivate.h"
|
||||
#include "gtklabelprivate.h"
|
||||
#include "gtkentryprivate.h"
|
||||
#include "gtksearchentryprivate.h"
|
||||
#include "gtkpango.h"
|
||||
#include "gtkpasswordentryprivate.h"
|
||||
#include "gtksearchentryprivate.h"
|
||||
#include "gtkspinbuttonprivate.h"
|
||||
#include "gtktextview.h"
|
||||
#include "gtktextbufferprivate.h"
|
||||
#include "gtktextviewprivate.h"
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
|
||||
@@ -19,62 +19,9 @@
|
||||
#include "config.h"
|
||||
#include "gtkatspitextbufferprivate.h"
|
||||
#include "gtkatspipangoprivate.h"
|
||||
#include "gtktextbufferprivate.h"
|
||||
#include "gtktextviewprivate.h"
|
||||
|
||||
static const char *
|
||||
gtk_justification_to_string (GtkJustification just)
|
||||
{
|
||||
switch (just)
|
||||
{
|
||||
case GTK_JUSTIFY_LEFT:
|
||||
return "left";
|
||||
case GTK_JUSTIFY_RIGHT:
|
||||
return "right";
|
||||
case GTK_JUSTIFY_CENTER:
|
||||
return "center";
|
||||
case GTK_JUSTIFY_FILL:
|
||||
return "fill";
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
gtk_text_direction_to_string (GtkTextDirection direction)
|
||||
{
|
||||
switch (direction)
|
||||
{
|
||||
case GTK_TEXT_DIR_NONE:
|
||||
return "none";
|
||||
case GTK_TEXT_DIR_LTR:
|
||||
return "ltr";
|
||||
case GTK_TEXT_DIR_RTL:
|
||||
return "rtl";
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
gtk_wrap_mode_to_string (GtkWrapMode wrap_mode)
|
||||
{
|
||||
/* Keep these in sync with pango_wrap_mode_to_string(); note that
|
||||
* here we have an extra case for NONE.
|
||||
*/
|
||||
switch (wrap_mode)
|
||||
{
|
||||
case GTK_WRAP_NONE:
|
||||
return "none";
|
||||
case GTK_WRAP_CHAR:
|
||||
return "char";
|
||||
case GTK_WRAP_WORD:
|
||||
return "word";
|
||||
case GTK_WRAP_WORD_CHAR:
|
||||
return "word-char";
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
#include "gtkpango.h"
|
||||
|
||||
void
|
||||
gtk_text_view_add_default_attributes (GtkTextView *view,
|
||||
@@ -161,504 +108,6 @@ gtk_text_view_add_default_attributes (GtkTextView *view,
|
||||
gtk_text_attributes_unref (text_attrs);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_text_buffer_get_run_attributes (GtkTextBuffer *buffer,
|
||||
GVariantBuilder *builder,
|
||||
int offset,
|
||||
int *start_offset,
|
||||
int *end_offset)
|
||||
{
|
||||
GtkTextIter iter;
|
||||
GSList *tags, *temp_tags;
|
||||
double scale = 1;
|
||||
gboolean val_set = FALSE;
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &iter, offset);
|
||||
|
||||
gtk_text_iter_forward_to_tag_toggle (&iter, NULL);
|
||||
*end_offset = gtk_text_iter_get_offset (&iter);
|
||||
|
||||
gtk_text_iter_backward_to_tag_toggle (&iter, NULL);
|
||||
*start_offset = gtk_text_iter_get_offset (&iter);
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &iter, offset);
|
||||
|
||||
tags = gtk_text_iter_get_tags (&iter);
|
||||
tags = g_slist_reverse (tags);
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
PangoStyle style;
|
||||
|
||||
g_object_get (tag,
|
||||
"style-set", &val_set,
|
||||
"style", &style,
|
||||
NULL);
|
||||
if (val_set)
|
||||
g_variant_builder_add (builder, "{ss}", "style", pango_style_to_string (style));
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
PangoVariant variant;
|
||||
|
||||
g_object_get (tag,
|
||||
"variant-set", &val_set,
|
||||
"variant", &variant,
|
||||
NULL);
|
||||
if (val_set)
|
||||
g_variant_builder_add (builder, "{ss}", "variant", pango_variant_to_string (variant));
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
PangoStretch stretch;
|
||||
|
||||
g_object_get (tag,
|
||||
"stretch-set", &val_set,
|
||||
"stretch", &stretch,
|
||||
NULL);
|
||||
if (val_set)
|
||||
g_variant_builder_add (builder, "{ss}", "stretch", pango_stretch_to_string (stretch));
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
GtkJustification justification;
|
||||
|
||||
g_object_get (tag,
|
||||
"justification-set", &val_set,
|
||||
"justification", &justification,
|
||||
NULL);
|
||||
if (val_set)
|
||||
g_variant_builder_add (builder, "{ss}", "justification", gtk_justification_to_string (justification));
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
GtkTextDirection direction;
|
||||
|
||||
g_object_get (tag, "direction", &direction, NULL);
|
||||
if (direction != GTK_TEXT_DIR_NONE)
|
||||
{
|
||||
val_set = TRUE;
|
||||
g_variant_builder_add (builder, "{ss}", "direction", gtk_text_direction_to_string (direction));
|
||||
}
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
GtkWrapMode wrap_mode;
|
||||
|
||||
g_object_get (tag,
|
||||
"wrap-mode-set", &val_set,
|
||||
"wrap-mode", &wrap_mode,
|
||||
NULL);
|
||||
if (val_set)
|
||||
g_variant_builder_add (builder, "{ss}", "wrap-mode", gtk_wrap_mode_to_string (wrap_mode));
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
|
||||
g_object_get (tag, "foreground-set", &val_set, NULL);
|
||||
if (val_set)
|
||||
{
|
||||
GdkRGBA *rgba;
|
||||
char *value;
|
||||
|
||||
g_object_get (tag, "foreground", &rgba, NULL);
|
||||
value = g_strdup_printf ("%u,%u,%u",
|
||||
(guint) rgba->red * 65535,
|
||||
(guint) rgba->green * 65535,
|
||||
(guint) rgba->blue * 65535);
|
||||
gdk_rgba_free (rgba);
|
||||
g_variant_builder_add (builder, "{ss}", "fg-color", value);
|
||||
g_free (value);
|
||||
}
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
|
||||
g_object_get (tag, "background-set", &val_set, NULL);
|
||||
if (val_set)
|
||||
{
|
||||
GdkRGBA *rgba;
|
||||
char *value;
|
||||
|
||||
g_object_get (tag, "background-rgba", &rgba, NULL);
|
||||
value = g_strdup_printf ("%u,%u,%u",
|
||||
(guint) rgba->red * 65535,
|
||||
(guint) rgba->green * 65535,
|
||||
(guint) rgba->blue * 65535);
|
||||
gdk_rgba_free (rgba);
|
||||
g_variant_builder_add (builder, "{ss}", "bg-color", value);
|
||||
g_free (value);
|
||||
}
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
|
||||
g_object_get (tag, "family-set", &val_set, NULL);
|
||||
|
||||
if (val_set)
|
||||
{
|
||||
char *value;
|
||||
g_object_get (tag, "family", &value, NULL);
|
||||
g_variant_builder_add (builder, "{ss}", "family-name", value);
|
||||
g_free (value);
|
||||
}
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
|
||||
g_object_get (tag, "language-set", &val_set, NULL);
|
||||
|
||||
if (val_set)
|
||||
{
|
||||
char *value;
|
||||
g_object_get (tag, "language", &value, NULL);
|
||||
g_variant_builder_add (builder, "{ss}", "language", value);
|
||||
g_free (value);
|
||||
}
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
int weight;
|
||||
|
||||
g_object_get (tag,
|
||||
"weight-set", &val_set,
|
||||
"weight", &weight,
|
||||
NULL);
|
||||
|
||||
if (val_set)
|
||||
{
|
||||
char *value;
|
||||
value = g_strdup_printf ("%d", weight);
|
||||
g_variant_builder_add (builder, "{ss}", "weight", value);
|
||||
g_free (value);
|
||||
}
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
/* scale is special as the effective value is the product
|
||||
* of all specified values
|
||||
*/
|
||||
temp_tags = tags;
|
||||
while (temp_tags)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
gboolean scale_set;
|
||||
|
||||
g_object_get (tag, "scale-set", &scale_set, NULL);
|
||||
if (scale_set)
|
||||
{
|
||||
double font_scale;
|
||||
g_object_get (tag, "scale", &font_scale, NULL);
|
||||
val_set = TRUE;
|
||||
scale *= font_scale;
|
||||
}
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
if (val_set)
|
||||
{
|
||||
char *value = g_strdup_printf ("%g", scale);
|
||||
g_variant_builder_add (builder, "{ss}", "scale", value);
|
||||
g_free (value);
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
int size;
|
||||
|
||||
g_object_get (tag,
|
||||
"size-set", &val_set,
|
||||
"size", &size,
|
||||
NULL);
|
||||
if (val_set)
|
||||
{
|
||||
char *value = g_strdup_printf ("%i", size);
|
||||
g_variant_builder_add (builder, "{ss}", "size", value);
|
||||
g_free (value);
|
||||
}
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
gboolean strikethrough;
|
||||
|
||||
g_object_get (tag,
|
||||
"strikethrough-set", &val_set,
|
||||
"strikethrough", &strikethrough,
|
||||
NULL);
|
||||
if (val_set)
|
||||
g_variant_builder_add (builder, "{ss}", "strikethrough", strikethrough ? "true" : "false");
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
PangoUnderline underline;
|
||||
|
||||
g_object_get (tag,
|
||||
"underline-set", &val_set,
|
||||
"underline", &underline,
|
||||
NULL);
|
||||
if (val_set)
|
||||
g_variant_builder_add (builder, "{ss}", "underline",
|
||||
pango_underline_to_string (underline));
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
int rise;
|
||||
|
||||
g_object_get (tag,
|
||||
"rise-set", &val_set,
|
||||
"rise", &rise,
|
||||
NULL);
|
||||
if (val_set)
|
||||
{
|
||||
char *value = g_strdup_printf ("%i", rise);
|
||||
g_variant_builder_add (builder, "{ss}", "rise", value);
|
||||
g_free (value);
|
||||
}
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
gboolean bg_full_height;
|
||||
|
||||
g_object_get (tag,
|
||||
"background-full-height-set", &val_set,
|
||||
"background-full-height", &bg_full_height,
|
||||
NULL);
|
||||
if (val_set)
|
||||
g_variant_builder_add (builder, "{ss}", "bg-full-height", bg_full_height ? "true" : "false");
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
int pixels;
|
||||
|
||||
g_object_get (tag,
|
||||
"pixels-inside-wrap-set", &val_set,
|
||||
"pixels-inside-wrap", &pixels,
|
||||
NULL);
|
||||
if (val_set)
|
||||
{
|
||||
char *value = g_strdup_printf ("%i", pixels);
|
||||
g_variant_builder_add (builder, "{ss}", "pixels-inside-wrap", value);
|
||||
g_free (value);
|
||||
}
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
int pixels;
|
||||
|
||||
g_object_get (tag,
|
||||
"pixels-below-lines-set", &val_set,
|
||||
"pixels-below-lines", &pixels,
|
||||
NULL);
|
||||
if (val_set)
|
||||
{
|
||||
char *value = g_strdup_printf ("%i", pixels);
|
||||
g_variant_builder_add (builder, "{ss}", "pixels-below-lines", value);
|
||||
g_free (value);
|
||||
}
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
int pixels;
|
||||
|
||||
g_object_get (tag,
|
||||
"pixels-above-lines-set", &val_set,
|
||||
"pixels-above-lines", &pixels,
|
||||
NULL);
|
||||
if (val_set)
|
||||
{
|
||||
char *value = g_strdup_printf ("%i", pixels);
|
||||
g_variant_builder_add (builder, "{ss}", "pixels-above-lines", value);
|
||||
g_free (value);
|
||||
}
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
gboolean editable;
|
||||
|
||||
g_object_get (tag,
|
||||
"editable-set", &val_set,
|
||||
"editable", &editable,
|
||||
NULL);
|
||||
if (val_set)
|
||||
g_variant_builder_add (builder, "{ss}", "editable", editable ? "true" : "false");
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
gboolean invisible;
|
||||
|
||||
g_object_get (tag,
|
||||
"invisible-set", &val_set,
|
||||
"invisible", &invisible,
|
||||
NULL);
|
||||
if (val_set)
|
||||
g_variant_builder_add (builder, "{ss}", "invisible", invisible ? "true" : "false");
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
int indent;
|
||||
|
||||
g_object_get (tag,
|
||||
"indent-set", &val_set,
|
||||
"indent", &indent,
|
||||
NULL);
|
||||
if (val_set)
|
||||
{
|
||||
char *value = g_strdup_printf ("%i", indent);
|
||||
g_variant_builder_add (builder, "{ss}", "indent", value);
|
||||
g_free (value);
|
||||
}
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
int margin;
|
||||
|
||||
g_object_get (tag,
|
||||
"right-margin-set", &val_set,
|
||||
"right-margin", &margin,
|
||||
NULL);
|
||||
if (val_set)
|
||||
{
|
||||
char *value = g_strdup_printf ("%i", margin);
|
||||
g_variant_builder_add (builder, "{ss}", "right-margin", value);
|
||||
g_free (value);
|
||||
}
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
temp_tags = tags;
|
||||
while (temp_tags && !val_set)
|
||||
{
|
||||
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
|
||||
int margin;
|
||||
|
||||
g_object_get (tag,
|
||||
"left-margin-set", &val_set,
|
||||
"left-margin", &margin,
|
||||
NULL);
|
||||
if (val_set)
|
||||
{
|
||||
char *value = g_strdup_printf ("%i", margin);
|
||||
g_variant_builder_add (builder, "{ss}", "left-margin", value);
|
||||
g_free (value);
|
||||
}
|
||||
temp_tags = temp_tags->next;
|
||||
}
|
||||
val_set = FALSE;
|
||||
|
||||
g_slist_free (tags);
|
||||
}
|
||||
|
||||
char *
|
||||
gtk_text_view_get_text_before (GtkTextView *view,
|
||||
int offset,
|
||||
|
||||
@@ -25,11 +25,6 @@ G_BEGIN_DECLS
|
||||
|
||||
void gtk_text_view_add_default_attributes (GtkTextView *view,
|
||||
GVariantBuilder *builder);
|
||||
void gtk_text_buffer_get_run_attributes (GtkTextBuffer *buffer,
|
||||
GVariantBuilder *builder,
|
||||
int offset,
|
||||
int *start_offset,
|
||||
int *end_offset);
|
||||
|
||||
char *gtk_text_view_get_text_before (GtkTextView *view,
|
||||
int offset,
|
||||
|
||||
Binary file not shown.
@@ -2,8 +2,8 @@
|
||||
#define __GTK_COMPOSE_DATA__
|
||||
|
||||
#define MAX_SEQ_LEN 5
|
||||
#define N_INDEX_SIZE 30
|
||||
#define DATA_SIZE 16477
|
||||
#define N_CHARS 1241
|
||||
#define N_INDEX_SIZE 39
|
||||
#define DATA_SIZE 15777
|
||||
#define N_CHARS 1321
|
||||
|
||||
#endif
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+12
-1
@@ -152,13 +152,24 @@ gtk_css_data_url_parse (const char *url,
|
||||
gsize read;
|
||||
gsize written;
|
||||
gpointer data;
|
||||
GError *local_error = NULL;
|
||||
|
||||
data = g_convert_with_fallback (bdata, bsize,
|
||||
"UTF-8", charset,
|
||||
(char *) "*",
|
||||
&read, &written, NULL);
|
||||
&read, &written, &local_error);
|
||||
g_free (bdata);
|
||||
|
||||
if (local_error)
|
||||
{
|
||||
g_propagate_error (error, local_error);
|
||||
g_free (charset);
|
||||
g_free (data);
|
||||
g_free (mimetype);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
bdata = data;
|
||||
bsize = written;
|
||||
}
|
||||
|
||||
+17
-4
@@ -1353,8 +1353,8 @@ gtk_builder_add_objects_from_file (GtkBuilder *builder,
|
||||
* Main private entry point for building composite components
|
||||
* from template XML.
|
||||
*
|
||||
* This is exported purely to let `gtk-builder-tool` validate
|
||||
* templates, applications have no need to call this function.
|
||||
* Most likely you do not need to call this function in applications as
|
||||
* templates are handled by `GtkWidget`.
|
||||
*
|
||||
* Returns: A positive value on success, 0 if an error occurred
|
||||
*/
|
||||
@@ -1367,6 +1367,7 @@ gtk_builder_extend_with_template (GtkBuilder *builder,
|
||||
GError **error)
|
||||
{
|
||||
GtkBuilderPrivate *priv = gtk_builder_get_instance_private (builder);
|
||||
const char *name;
|
||||
GError *tmp_error;
|
||||
char *filename;
|
||||
|
||||
@@ -1384,8 +1385,15 @@ gtk_builder_extend_with_template (GtkBuilder *builder,
|
||||
priv->resource_prefix = NULL;
|
||||
priv->template_type = template_type;
|
||||
|
||||
filename = g_strconcat ("<", g_type_name (template_type), " template>", NULL);
|
||||
gtk_builder_expose_object (builder, g_type_name (template_type), object);
|
||||
/* We specifically allow this function to be called multiple times with
|
||||
* the same @template_type as that is used in applications like Builder
|
||||
* to implement UI merging.
|
||||
*/
|
||||
name = g_type_name (template_type);
|
||||
if (gtk_builder_get_object (builder, name) != object)
|
||||
gtk_builder_expose_object (builder, name, object);
|
||||
|
||||
filename = g_strconcat ("<", name, " template>", NULL);
|
||||
_gtk_builder_parser_parse_buffer (builder, filename,
|
||||
buffer, length,
|
||||
NULL,
|
||||
@@ -1772,6 +1780,11 @@ gtk_builder_get_translation_domain (GtkBuilder *builder)
|
||||
*
|
||||
* Add @object to the @builder object pool so it can be
|
||||
* referenced just like any other object built by builder.
|
||||
*
|
||||
* Only a single object may be added using @name. However,
|
||||
* it is not an error to expose the same object under multiple
|
||||
* names. `gtk_builder_get_object()` may be used to determine
|
||||
* if an object has already been added with @name.
|
||||
*/
|
||||
void
|
||||
gtk_builder_expose_object (GtkBuilder *builder,
|
||||
|
||||
+13
-2
@@ -21,6 +21,11 @@
|
||||
#include "gtkcolorpickerportalprivate.h"
|
||||
#include "gtkcolorpickershellprivate.h"
|
||||
#include "gtkcolorpickerkwinprivate.h"
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include "gtkcolorpickerwin32private.h"
|
||||
#endif
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
|
||||
@@ -51,13 +56,19 @@ gtk_color_picker_pick_finish (GtkColorPicker *picker,
|
||||
GtkColorPicker *
|
||||
gtk_color_picker_new (void)
|
||||
{
|
||||
GtkColorPicker *picker;
|
||||
GtkColorPicker *picker = NULL;
|
||||
|
||||
picker = gtk_color_picker_portal_new ();
|
||||
#if defined (G_OS_UNIX)
|
||||
if (!picker)
|
||||
picker = gtk_color_picker_portal_new ();
|
||||
if (!picker)
|
||||
picker = gtk_color_picker_shell_new ();
|
||||
if (!picker)
|
||||
picker = gtk_color_picker_kwin_new ();
|
||||
#elif defined (G_OS_WIN32)
|
||||
if (!picker)
|
||||
picker = gtk_color_picker_win32_new ();
|
||||
#endif
|
||||
|
||||
if (!picker)
|
||||
g_debug ("No suitable GtkColorPicker implementation");
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2022 the GTK team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkcolorpickerwin32private.h"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
GList *pickers;
|
||||
HHOOK hook;
|
||||
|
||||
static void remove_hook (void);
|
||||
|
||||
extern IMAGE_DOS_HEADER __ImageBase;
|
||||
#define this_hmodule ((HMODULE)&__ImageBase)
|
||||
|
||||
struct _GtkColorPickerWin32
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
GTask *task;
|
||||
POINT point;
|
||||
};
|
||||
|
||||
struct _GtkColorPickerWin32Class
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
static GInitableIface *initable_parent_iface;
|
||||
static void gtk_color_picker_win32_initable_iface_init (GInitableIface *iface);
|
||||
static void gtk_color_picker_win32_iface_init (GtkColorPickerInterface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkColorPickerWin32, gtk_color_picker_win32, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, gtk_color_picker_win32_initable_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_COLOR_PICKER, gtk_color_picker_win32_iface_init))
|
||||
|
||||
static gboolean
|
||||
gtk_color_picker_win32_initable_init (GInitable *initable,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_win32_initable_iface_init (GInitableIface *iface)
|
||||
{
|
||||
initable_parent_iface = g_type_interface_peek_parent (iface);
|
||||
iface->init = gtk_color_picker_win32_initable_init;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_win32_init (GtkColorPickerWin32 *picker)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_win32_class_init (GtkColorPickerWin32Class *class)
|
||||
{
|
||||
}
|
||||
|
||||
GtkColorPicker *
|
||||
gtk_color_picker_win32_new (void)
|
||||
{
|
||||
return GTK_COLOR_PICKER (g_initable_new (GTK_TYPE_COLOR_PICKER_WIN32, NULL, NULL, NULL));
|
||||
}
|
||||
|
||||
static void
|
||||
on_task_completed (GObject *object,
|
||||
GParamSpec *pspec,
|
||||
gpointer user_data)
|
||||
{
|
||||
gpointer source = g_task_get_source_object (G_TASK (object));
|
||||
GtkColorPickerWin32 *picker = GTK_COLOR_PICKER_WIN32 (source);
|
||||
|
||||
g_clear_object (&picker->task);
|
||||
}
|
||||
|
||||
static void
|
||||
pick_color (GTask *task,
|
||||
gpointer source_object,
|
||||
gpointer task_data,
|
||||
GCancellable *cancellable)
|
||||
{
|
||||
GtkColorPickerWin32 *picker = GTK_COLOR_PICKER_WIN32 (source_object);
|
||||
GdkRGBA rgba = (GdkRGBA) { 1.0, 1.0, 1.0, 1.0 };
|
||||
HDC hdc = GetDC(HWND_DESKTOP);
|
||||
|
||||
if (hdc)
|
||||
{
|
||||
COLORREF color = GetPixel(hdc, picker->point.x, picker->point.y);
|
||||
|
||||
rgba = (GdkRGBA){
|
||||
(double) GetRValue (color) / 255.0,
|
||||
(double) GetGValue (color) / 255.0,
|
||||
(double) GetBValue (color) / 255.0,
|
||||
1.0,
|
||||
};
|
||||
|
||||
ReleaseDC (HWND_DESKTOP, hdc);
|
||||
}
|
||||
|
||||
g_task_return_pointer (task,
|
||||
gdk_rgba_copy (&rgba),
|
||||
(GDestroyNotify) gdk_rgba_free);
|
||||
}
|
||||
|
||||
static void
|
||||
picked (GtkColorPickerWin32 *picker)
|
||||
{
|
||||
g_task_run_in_thread (picker->task, pick_color);
|
||||
}
|
||||
|
||||
static LRESULT CALLBACK
|
||||
mouse_proc (int nCode,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
if (nCode == HC_ACTION)
|
||||
{
|
||||
MSLLHOOKSTRUCT *info = (MSLLHOOKSTRUCT*) lParam;
|
||||
|
||||
switch (wParam)
|
||||
{
|
||||
case WM_LBUTTONDOWN:
|
||||
case WM_MBUTTONDOWN:
|
||||
case WM_RBUTTONDOWN:
|
||||
case WM_XBUTTONDOWN:
|
||||
{
|
||||
GtkColorPickerWin32 *picker = GTK_COLOR_PICKER_WIN32 (pickers->data);
|
||||
|
||||
if (!pickers)
|
||||
break;
|
||||
|
||||
/* A low-level mouse hook always receives screen points in
|
||||
* per-monitor DPI aware screen coordinates, regardless of
|
||||
* the DPI awareness setting of the application. */
|
||||
picker->point = info->pt;
|
||||
|
||||
picked (picker);
|
||||
|
||||
pickers = g_list_delete_link (pickers, pickers);
|
||||
|
||||
/* It's safe to remove a hook from within its callback */
|
||||
if (!pickers)
|
||||
remove_hook ();
|
||||
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return CallNextHookEx(NULL, nCode, wParam, lParam);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ensure_mouse_hook (void)
|
||||
{
|
||||
if (!hook)
|
||||
{
|
||||
hook = SetWindowsHookEx (WH_MOUSE_LL, mouse_proc, this_hmodule, 0);
|
||||
if (!hook)
|
||||
{
|
||||
g_warning ("SetWindowsHookEx failed with error code "
|
||||
"%"G_GUINT32_FORMAT, (unsigned) GetLastError ());
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
remove_hook (void)
|
||||
{
|
||||
if (hook)
|
||||
{
|
||||
UnhookWindowsHookEx (hook);
|
||||
hook = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_win32_pick (GtkColorPicker *cp,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkColorPickerWin32 *picker = GTK_COLOR_PICKER_WIN32 (cp);
|
||||
|
||||
if (picker->task)
|
||||
return;
|
||||
|
||||
picker->task = g_task_new (picker, NULL, callback, user_data);
|
||||
g_task_set_name (picker->task, "GtkColorPicker");
|
||||
g_signal_connect (picker->task, "notify::completed",
|
||||
G_CALLBACK (on_task_completed),
|
||||
NULL);
|
||||
|
||||
if (!ensure_mouse_hook ())
|
||||
{
|
||||
g_task_return_new_error (picker->task,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_FAILED,
|
||||
"Cannot capture the mouse pointer");
|
||||
return;
|
||||
}
|
||||
|
||||
pickers = g_list_prepend (pickers, cp);
|
||||
}
|
||||
|
||||
static GdkRGBA *
|
||||
gtk_color_picker_win32_pick_finish (GtkColorPicker *cp,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (g_task_is_valid (res, cp), NULL);
|
||||
|
||||
return g_task_propagate_pointer (G_TASK (res), error);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_picker_win32_iface_init (GtkColorPickerInterface *iface)
|
||||
{
|
||||
iface->pick = gtk_color_picker_win32_pick;
|
||||
iface->pick_finish = gtk_color_picker_win32_pick_finish;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2022 the GTK team
|
||||
* All rights reserved.
|
||||
*
|
||||
* This Library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_COLOR_PICKER_WIN32_H__
|
||||
#define __GTK_COLOR_PICKER_WIN32_H__
|
||||
|
||||
|
||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkcolorpickerprivate.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
#define GTK_TYPE_COLOR_PICKER_WIN32 gtk_color_picker_win32_get_type ()
|
||||
G_DECLARE_FINAL_TYPE (GtkColorPickerWin32, gtk_color_picker_win32, GTK, COLOR_PICKER_WIN32, GObject)
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkColorPicker * gtk_color_picker_win32_new (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_COLOR_PICKER_WIN32_H__ */
|
||||
+15
-4
@@ -376,17 +376,24 @@ static int
|
||||
gtk_column_view_allocate_columns (GtkColumnView *self,
|
||||
int width)
|
||||
{
|
||||
gboolean rtl;
|
||||
guint i, n;
|
||||
int x;
|
||||
int total_width, x;
|
||||
GtkRequestedSize *sizes;
|
||||
|
||||
rtl = gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_RTL;
|
||||
|
||||
n = g_list_model_get_n_items (G_LIST_MODEL (self->columns));
|
||||
|
||||
sizes = g_newa (GtkRequestedSize, n);
|
||||
|
||||
gtk_column_view_distribute_width (self, width, sizes);
|
||||
|
||||
x = 0;
|
||||
total_width = 0;
|
||||
for (i = 0; i < n; i++)
|
||||
total_width += sizes[i].minimum_size;
|
||||
|
||||
x = rtl ? total_width : 0;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
GtkColumnViewColumn *column;
|
||||
@@ -397,17 +404,21 @@ gtk_column_view_allocate_columns (GtkColumnView *self,
|
||||
{
|
||||
col_size = sizes[i].minimum_size;
|
||||
|
||||
if (rtl)
|
||||
x -= col_size;
|
||||
|
||||
gtk_column_view_column_allocate (column, x, col_size);
|
||||
if (self->in_column_reorder && i == self->drag_pos)
|
||||
gtk_column_view_column_set_header_position (column, self->drag_x);
|
||||
|
||||
x += col_size;
|
||||
if (!rtl)
|
||||
x += col_size;
|
||||
}
|
||||
|
||||
g_object_unref (column);
|
||||
}
|
||||
|
||||
return x;
|
||||
return total_width;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+22
-30
@@ -28,7 +28,7 @@
|
||||
|
||||
|
||||
#define GTK_COMPOSE_TABLE_MAGIC "GtkComposeTable"
|
||||
#define GTK_COMPOSE_TABLE_VERSION (3)
|
||||
#define GTK_COMPOSE_TABLE_VERSION (4)
|
||||
|
||||
extern const GtkComposeTable builtin_compose_table;
|
||||
|
||||
@@ -504,12 +504,6 @@ parser_remove_duplicates (GtkComposeParser *parser)
|
||||
goto next;
|
||||
}
|
||||
|
||||
if (sequence[1] == 0)
|
||||
{
|
||||
remove_sequence = TRUE;
|
||||
goto next;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_COMPOSE_LEN + 1; i++)
|
||||
keysyms[i] = 0;
|
||||
|
||||
@@ -907,7 +901,7 @@ parser_get_compose_table (GtkComposeParser *parser)
|
||||
(GCompareDataFunc) sequence_compare,
|
||||
NULL);
|
||||
|
||||
index_rowstride = max_compose_len + 1;
|
||||
index_rowstride = max_compose_len + 2;
|
||||
data = g_new0 (guint16, n_first * index_rowstride + size);
|
||||
|
||||
char_data = g_string_new ("");
|
||||
@@ -923,7 +917,7 @@ parser_get_compose_table (GtkComposeParser *parser)
|
||||
char *value = g_hash_table_lookup (parser->sequences, sequence);
|
||||
int len = sequence_length (sequence);
|
||||
|
||||
g_assert (2 <= len && len <= max_compose_len);
|
||||
g_assert (1 <= len && len <= max_compose_len);
|
||||
|
||||
/* Encode the value. If the value is a single
|
||||
* character with a value smaller than 1 << 15,
|
||||
@@ -979,10 +973,10 @@ parser_get_compose_table (GtkComposeParser *parser)
|
||||
|
||||
rest_pos += len;
|
||||
|
||||
for (i = len; i <= max_compose_len; i++)
|
||||
for (i = len + 1; i < index_rowstride; i++)
|
||||
data[first_pos + i] = rest_pos;
|
||||
|
||||
for (i = 1; i < max_compose_len; i++)
|
||||
for (i = 1; i + 1 < index_rowstride; i++)
|
||||
g_assert (data[first_pos + i] <= data[first_pos + i + 1]);
|
||||
}
|
||||
|
||||
@@ -1275,7 +1269,7 @@ gtk_compose_table_check (const GtkComposeTable *table,
|
||||
gboolean *compose_match,
|
||||
GString *output)
|
||||
{
|
||||
int row_stride;
|
||||
int len;
|
||||
guint16 *seq_index;
|
||||
guint16 *seq;
|
||||
int i;
|
||||
@@ -1297,7 +1291,7 @@ gtk_compose_table_check (const GtkComposeTable *table,
|
||||
seq_index = bsearch (compose_buffer,
|
||||
table->data,
|
||||
table->n_index_size,
|
||||
sizeof (guint16) * (table->max_seq_len + 1),
|
||||
sizeof (guint16) * (table->max_seq_len + 2),
|
||||
compare_seq_index);
|
||||
|
||||
if (!seq_index)
|
||||
@@ -1312,21 +1306,21 @@ gtk_compose_table_check (const GtkComposeTable *table,
|
||||
|
||||
for (i = n_compose - 1; i < table->max_seq_len; i++)
|
||||
{
|
||||
row_stride = i + 1;
|
||||
len = i + 1;
|
||||
|
||||
if (seq_index[i + 1] - seq_index[i] > 0)
|
||||
if (seq_index[len + 1] - seq_index[len] > 0)
|
||||
{
|
||||
seq = bsearch (compose_buffer + 1,
|
||||
table->data + seq_index[i],
|
||||
(seq_index[i + 1] - seq_index[i]) / row_stride,
|
||||
sizeof (guint16) * row_stride,
|
||||
table->data + seq_index[len],
|
||||
(seq_index[len + 1] - seq_index[len]) / len,
|
||||
sizeof (guint16) * len,
|
||||
compare_seq);
|
||||
|
||||
if (seq)
|
||||
{
|
||||
if (i == n_compose - 1)
|
||||
{
|
||||
value = seq[row_stride - 1];
|
||||
value = seq[len - 1];
|
||||
|
||||
if ((value & (1 << 15)) != 0)
|
||||
g_string_append (output, &table->char_data[value & ~(1 << 15)]);
|
||||
@@ -1367,7 +1361,7 @@ gtk_compose_table_get_prefix (const GtkComposeTable *table,
|
||||
int n_compose,
|
||||
int *prefix)
|
||||
{
|
||||
int index_stride = table->max_seq_len + 1;
|
||||
int index_stride = table->max_seq_len + 2;
|
||||
int p = 0;
|
||||
|
||||
for (int idx = 0; idx < table->n_index_size; idx++)
|
||||
@@ -1378,9 +1372,9 @@ gtk_compose_table_get_prefix (const GtkComposeTable *table,
|
||||
{
|
||||
p = 1;
|
||||
|
||||
for (int i = 1; i < table->max_seq_len; i++)
|
||||
for (int i = 1; i < table->max_seq_len + 1; i++)
|
||||
{
|
||||
int len = i + 1;
|
||||
int len = i;
|
||||
|
||||
for (int j = seq_index[i]; j < seq_index[i + 1]; j += len)
|
||||
{
|
||||
@@ -1407,20 +1401,20 @@ gtk_compose_table_foreach (const GtkComposeTable *table,
|
||||
GtkComposeSequenceCallback callback,
|
||||
gpointer data)
|
||||
{
|
||||
int index_stride = table->max_seq_len + 1;
|
||||
int index_stride = table->max_seq_len + 2;
|
||||
gunichar *sequence;
|
||||
int seqno;
|
||||
|
||||
sequence = g_new0 (gunichar, table->max_seq_len + 1);
|
||||
sequence = g_newa (gunichar, table->max_seq_len + 1);
|
||||
|
||||
seqno = 0;
|
||||
for (int idx = 0; idx < table->n_index_size; idx++)
|
||||
{
|
||||
const guint16 *seq_index = table->data + (idx * index_stride);
|
||||
|
||||
for (int i = 1; i < table->max_seq_len; i++)
|
||||
for (int i = 1; i <= table->max_seq_len; i++)
|
||||
{
|
||||
int len = i + 1;
|
||||
int len = i;
|
||||
|
||||
g_assert (seq_index[i] <= seq_index[i + 1]);
|
||||
g_assert (seq_index[i + 1] <= table->data_size);
|
||||
@@ -1433,8 +1427,8 @@ gtk_compose_table_foreach (const GtkComposeTable *table,
|
||||
char *value;
|
||||
|
||||
sequence[0] = seq_index[0];
|
||||
for (int k = 0; k < len - 1; k++)
|
||||
sequence[k + 1] = (gunichar) table->data[j + k];
|
||||
for (int k = 1; k < len; k++)
|
||||
sequence[k] = (gunichar) table->data[j + k - 1];
|
||||
sequence[len] = 0;
|
||||
|
||||
encoded_value = table->data[j + len - 1];
|
||||
@@ -1456,8 +1450,6 @@ gtk_compose_table_foreach (const GtkComposeTable *table,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_free (sequence);
|
||||
}
|
||||
|
||||
/* Checks if a keysym is a dead key.
|
||||
|
||||
@@ -40,7 +40,7 @@ typedef struct _GtkComposeTableCompact GtkComposeTableCompact;
|
||||
*
|
||||
* The values are encoded as follows:
|
||||
*
|
||||
* If the value is a single Unicode character smaler than 0x8000,
|
||||
* If the value is a single Unicode character smaller than 0x8000,
|
||||
* then we place it directly. Otherwise, we put the UTF8-encoded
|
||||
* value in the char_data array, and use offset | 0x8000 as the
|
||||
* encoded value.
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
typedef enum {
|
||||
COLOR_TYPE_LITERAL,
|
||||
COLOR_TYPE_NAME,
|
||||
COLOR_TYPE_SHADE,
|
||||
COLOR_TYPE_ALPHA,
|
||||
COLOR_TYPE_MIX,
|
||||
@@ -69,9 +68,6 @@ gtk_css_value_color_free (GtkCssValue *color)
|
||||
|
||||
switch (color->type)
|
||||
{
|
||||
case COLOR_TYPE_NAME:
|
||||
g_free (color->sym_col.name);
|
||||
break;
|
||||
case COLOR_TYPE_SHADE:
|
||||
_gtk_css_value_unref (color->sym_col.shade.color);
|
||||
break;
|
||||
@@ -187,8 +183,6 @@ gtk_css_value_color_equal (const GtkCssValue *value1,
|
||||
{
|
||||
case COLOR_TYPE_LITERAL:
|
||||
return gdk_rgba_equal (&value1->sym_col.rgba, &value2->sym_col.rgba);
|
||||
case COLOR_TYPE_NAME:
|
||||
return g_str_equal (value1->sym_col.name, value2->sym_col.name);
|
||||
case COLOR_TYPE_SHADE:
|
||||
return value1->sym_col.shade.factor == value2->sym_col.shade.factor &&
|
||||
_gtk_css_value_equal (value1->sym_col.shade.color,
|
||||
@@ -233,10 +227,6 @@ gtk_css_value_color_print (const GtkCssValue *value,
|
||||
g_free (s);
|
||||
}
|
||||
break;
|
||||
case COLOR_TYPE_NAME:
|
||||
g_string_append (string, "@");
|
||||
g_string_append (string, value->sym_col.name);
|
||||
break;
|
||||
case COLOR_TYPE_SHADE:
|
||||
{
|
||||
char factor[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
@@ -359,26 +349,7 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
{
|
||||
case COLOR_TYPE_LITERAL:
|
||||
return _gtk_css_value_ref (color);
|
||||
case COLOR_TYPE_NAME:
|
||||
{
|
||||
GtkCssValue *named;
|
||||
GSList cycle = { color, cycle_list };
|
||||
|
||||
/* If color exists in cycle_list, we're currently resolving it.
|
||||
* So we've detected a cycle. */
|
||||
if (g_slist_find (cycle_list, color))
|
||||
return NULL;
|
||||
|
||||
named = gtk_style_provider_get_color (provider, color->sym_col.name);
|
||||
if (named == NULL)
|
||||
return NULL;
|
||||
|
||||
value = _gtk_css_color_value_resolve (named, provider, current, &cycle);
|
||||
if (value == NULL)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
break;
|
||||
case COLOR_TYPE_SHADE:
|
||||
{
|
||||
const GdkRGBA *c;
|
||||
@@ -529,7 +500,6 @@ _gtk_css_color_value_new_name (const char *name)
|
||||
gtk_internal_return_val_if_fail (name != NULL, NULL);
|
||||
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value->type = COLOR_TYPE_NAME;
|
||||
value->sym_col.name = g_strdup (name);
|
||||
|
||||
return value;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
static GtkCssValue * gtk_css_calc_value_new (guint n_terms);
|
||||
static GtkCssValue * gtk_css_calc_value_new_sum (GtkCssValue *a,
|
||||
GtkCssValue *b);
|
||||
static gsize gtk_css_value_calc_get_size (gsize n_terms);
|
||||
|
||||
enum {
|
||||
TYPE_CALC = 0,
|
||||
@@ -78,9 +79,13 @@ gtk_css_value_number_free (GtkCssValue *number)
|
||||
|
||||
for (guint i = 0; i < n_terms; i++)
|
||||
_gtk_css_value_unref (number->calc.terms[i]);
|
||||
}
|
||||
|
||||
g_slice_free (GtkCssValue, number);
|
||||
g_slice_free1 (gtk_css_value_calc_get_size (n_terms), number);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_slice_free (GtkCssValue, number);
|
||||
}
|
||||
}
|
||||
|
||||
static double
|
||||
|
||||
@@ -127,7 +127,6 @@ struct _GtkCssProviderPrivate
|
||||
{
|
||||
GScanner *scanner;
|
||||
|
||||
GHashTable *symbolic_colors;
|
||||
GHashTable *keyframes;
|
||||
|
||||
GArray *rulesets;
|
||||
@@ -395,9 +394,6 @@ gtk_css_provider_init (GtkCssProvider *css_provider)
|
||||
|
||||
priv->rulesets = g_array_new (FALSE, FALSE, sizeof (GtkCssRuleset));
|
||||
|
||||
priv->symbolic_colors = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
(GDestroyNotify) g_free,
|
||||
(GDestroyNotify) _gtk_css_value_unref);
|
||||
priv->keyframes = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
(GDestroyNotify) g_free,
|
||||
(GDestroyNotify) _gtk_css_keyframes_unref);
|
||||
@@ -440,16 +436,6 @@ verify_tree_match_results (GtkCssProvider *provider,
|
||||
#endif
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_style_provider_get_color (GtkStyleProvider *provider,
|
||||
const char *name)
|
||||
{
|
||||
GtkCssProvider *css_provider = GTK_CSS_PROVIDER (provider);
|
||||
GtkCssProviderPrivate *priv = gtk_css_provider_get_instance_private (css_provider);
|
||||
|
||||
return g_hash_table_lookup (priv->symbolic_colors, name);
|
||||
}
|
||||
|
||||
static GtkCssKeyframes *
|
||||
gtk_css_style_provider_get_keyframes (GtkStyleProvider *provider,
|
||||
const char *name)
|
||||
@@ -515,7 +501,6 @@ gtk_css_style_provider_lookup (GtkStyleProvider *provider,
|
||||
static void
|
||||
gtk_css_style_provider_iface_init (GtkStyleProviderInterface *iface)
|
||||
{
|
||||
iface->get_color = gtk_css_style_provider_get_color;
|
||||
iface->get_keyframes = gtk_css_style_provider_get_keyframes;
|
||||
iface->lookup = gtk_css_style_provider_lookup;
|
||||
iface->emit_error = gtk_css_style_provider_emit_error;
|
||||
@@ -534,7 +519,6 @@ gtk_css_provider_finalize (GObject *object)
|
||||
g_array_free (priv->rulesets, TRUE);
|
||||
_gtk_css_selector_tree_free (priv->tree);
|
||||
|
||||
g_hash_table_destroy (priv->symbolic_colors);
|
||||
g_hash_table_destroy (priv->keyframes);
|
||||
|
||||
if (priv->resource)
|
||||
@@ -607,7 +591,6 @@ gtk_css_provider_reset (GtkCssProvider *css_provider)
|
||||
priv->path = NULL;
|
||||
}
|
||||
|
||||
g_hash_table_remove_all (priv->symbolic_colors);
|
||||
g_hash_table_remove_all (priv->keyframes);
|
||||
|
||||
for (i = 0; i < priv->rulesets->len; i++)
|
||||
@@ -688,41 +671,6 @@ parse_import (GtkCssScanner *scanner)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_color_definition (GtkCssScanner *scanner)
|
||||
{
|
||||
GtkCssProviderPrivate *priv = gtk_css_provider_get_instance_private (scanner->provider);
|
||||
GtkCssValue *color;
|
||||
char *name;
|
||||
|
||||
if (!gtk_css_parser_try_at_keyword (scanner->parser, "define-color"))
|
||||
return FALSE;
|
||||
|
||||
name = gtk_css_parser_consume_ident (scanner->parser);
|
||||
if (name == NULL)
|
||||
return TRUE;
|
||||
|
||||
color = _gtk_css_color_value_parse (scanner->parser);
|
||||
if (color == NULL)
|
||||
{
|
||||
g_free (name);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!gtk_css_parser_has_token (scanner->parser, GTK_CSS_TOKEN_EOF))
|
||||
{
|
||||
g_free (name);
|
||||
_gtk_css_value_unref (color);
|
||||
gtk_css_parser_error_syntax (scanner->parser,
|
||||
"Missing semicolon at end of color definition");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
g_hash_table_insert (priv->symbolic_colors, name, color);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
parse_keyframes (GtkCssScanner *scanner)
|
||||
{
|
||||
@@ -761,7 +709,6 @@ parse_at_keyword (GtkCssScanner *scanner)
|
||||
gtk_css_parser_start_semicolon_block (scanner->parser, GTK_CSS_TOKEN_OPEN_CURLY);
|
||||
|
||||
if (!parse_import (scanner) &&
|
||||
!parse_color_definition (scanner) &&
|
||||
!parse_keyframes (scanner))
|
||||
{
|
||||
gtk_css_parser_error_syntax (scanner->parser, "Unknown @ rule");
|
||||
@@ -1458,31 +1405,6 @@ gtk_css_ruleset_print (const GtkCssRuleset *ruleset,
|
||||
g_string_append (str, "}\n");
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_provider_print_colors (GHashTable *colors,
|
||||
GString *str)
|
||||
{
|
||||
GList *keys, *walk;
|
||||
|
||||
keys = g_hash_table_get_keys (colors);
|
||||
/* so the output is identical for identical styles */
|
||||
keys = g_list_sort (keys, (GCompareFunc) strcmp);
|
||||
|
||||
for (walk = keys; walk; walk = walk->next)
|
||||
{
|
||||
const char *name = walk->data;
|
||||
GtkCssValue *color = g_hash_table_lookup (colors, (gpointer) name);
|
||||
|
||||
g_string_append (str, "@define-color ");
|
||||
g_string_append (str, name);
|
||||
g_string_append (str, " ");
|
||||
_gtk_css_value_print (color, str);
|
||||
g_string_append (str, ";\n");
|
||||
}
|
||||
|
||||
g_list_free (keys);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_provider_print_keyframes (GHashTable *keyframes,
|
||||
GString *str)
|
||||
@@ -1535,7 +1457,6 @@ gtk_css_provider_to_string (GtkCssProvider *provider)
|
||||
|
||||
str = g_string_new ("");
|
||||
|
||||
gtk_css_provider_print_colors (priv->symbolic_colors, str);
|
||||
gtk_css_provider_print_keyframes (priv->keyframes, str);
|
||||
|
||||
for (i = 0; i < priv->rulesets->len; i++)
|
||||
|
||||
@@ -287,6 +287,7 @@ gtk_css_transform_compute (GtkCssTransform *dest,
|
||||
switch (src->type)
|
||||
{
|
||||
case GTK_CSS_TRANSFORM_MATRIX:
|
||||
memcpy (dest, src, sizeof (GtkCssTransform));
|
||||
return TRUE;
|
||||
case GTK_CSS_TRANSFORM_TRANSLATE:
|
||||
dest->translate.x = _gtk_css_value_compute (src->translate.x, property_id, provider, style, parent_style);
|
||||
|
||||
+16
-16
@@ -208,6 +208,21 @@ gtk_drop_target_end_drop (GtkDropTarget *self)
|
||||
g_object_thaw_notify (G_OBJECT (self));
|
||||
}
|
||||
|
||||
static GdkDragAction
|
||||
make_action_unique (GdkDragAction actions)
|
||||
{
|
||||
if (actions & GDK_ACTION_COPY)
|
||||
return GDK_ACTION_COPY;
|
||||
|
||||
if (actions & GDK_ACTION_MOVE)
|
||||
return GDK_ACTION_MOVE;
|
||||
|
||||
if (actions & GDK_ACTION_LINK)
|
||||
return GDK_ACTION_LINK;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_drop_target_do_drop (GtkDropTarget *self)
|
||||
{
|
||||
@@ -219,7 +234,7 @@ gtk_drop_target_do_drop (GtkDropTarget *self)
|
||||
g_signal_emit (self, signals[DROP], 0, &self->value, self->coords.x, self->coords.y, &success);
|
||||
|
||||
if (success)
|
||||
gdk_drop_finish (self->drop, gdk_drop_get_actions (self->drop));
|
||||
gdk_drop_finish (self->drop, make_action_unique (self->actions & gdk_drop_get_actions (self->drop)));
|
||||
else
|
||||
gdk_drop_finish (self->drop, 0);
|
||||
|
||||
@@ -348,21 +363,6 @@ gtk_drop_target_accept (GtkDropTarget *self,
|
||||
return gdk_content_formats_match_gtype (self->formats, gdk_drop_get_formats (drop)) != G_TYPE_INVALID;
|
||||
}
|
||||
|
||||
static GdkDragAction
|
||||
make_action_unique (GdkDragAction actions)
|
||||
{
|
||||
if (actions & GDK_ACTION_COPY)
|
||||
return GDK_ACTION_COPY;
|
||||
|
||||
if (actions & GDK_ACTION_MOVE)
|
||||
return GDK_ACTION_MOVE;
|
||||
|
||||
if (actions & GDK_ACTION_LINK)
|
||||
return GDK_ACTION_LINK;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static GdkDragAction
|
||||
gtk_drop_target_enter (GtkDropTarget *self,
|
||||
double x,
|
||||
|
||||
+110
-52
@@ -1042,6 +1042,34 @@ gtk_emoji_chooser_show (GtkWidget *widget)
|
||||
gtk_editable_set_text (GTK_EDITABLE (chooser->search_entry), "");
|
||||
}
|
||||
|
||||
static EmojiSection *
|
||||
find_section (GtkEmojiChooser *chooser,
|
||||
GtkWidget *box)
|
||||
{
|
||||
if (box == chooser->recent.box)
|
||||
return &chooser->recent;
|
||||
else if (box == chooser->people.box)
|
||||
return &chooser->people;
|
||||
else if (box == chooser->body.box)
|
||||
return &chooser->body;
|
||||
else if (box == chooser->nature.box)
|
||||
return &chooser->nature;
|
||||
else if (box == chooser->food.box)
|
||||
return &chooser->food;
|
||||
else if (box == chooser->travel.box)
|
||||
return &chooser->travel;
|
||||
else if (box == chooser->activities.box)
|
||||
return &chooser->activities;
|
||||
else if (box == chooser->objects.box)
|
||||
return &chooser->objects;
|
||||
else if (box == chooser->symbols.box)
|
||||
return &chooser->symbols;
|
||||
else if (box == chooser->flags.box)
|
||||
return &chooser->flags;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static EmojiSection *
|
||||
find_next_section (GtkEmojiChooser *chooser,
|
||||
GtkWidget *box,
|
||||
@@ -1113,81 +1141,111 @@ keynav_failed (GtkWidget *box,
|
||||
GtkWidget *focus;
|
||||
GtkWidget *child;
|
||||
GtkWidget *sibling;
|
||||
GtkAllocation alloc;
|
||||
int i;
|
||||
int column;
|
||||
int n_columns = 7;
|
||||
int child_x;
|
||||
|
||||
focus = gtk_root_get_focus (gtk_widget_get_root (box));
|
||||
if (focus == NULL)
|
||||
return FALSE;
|
||||
|
||||
/* determine the number of columns */
|
||||
child_x = -1;
|
||||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
GtkAllocation alloc;
|
||||
|
||||
gtk_widget_get_allocation (GTK_WIDGET (gtk_flow_box_get_child_at_index (GTK_FLOW_BOX (box), i)),
|
||||
&alloc);
|
||||
if (alloc.x > child_x)
|
||||
child_x = alloc.x;
|
||||
else
|
||||
{
|
||||
n_columns = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
n_columns = MAX (n_columns, 1);
|
||||
|
||||
child = gtk_widget_get_ancestor (focus, GTK_TYPE_EMOJI_CHOOSER_CHILD);
|
||||
|
||||
i = 0;
|
||||
column = 0;
|
||||
child_x = G_MAXINT;
|
||||
for (sibling = gtk_widget_get_first_child (box);
|
||||
sibling != child;
|
||||
sibling;
|
||||
sibling = gtk_widget_get_next_sibling (sibling))
|
||||
i++;
|
||||
{
|
||||
if (!gtk_widget_get_child_visible (sibling))
|
||||
continue;
|
||||
|
||||
column = i % n_columns;
|
||||
gtk_widget_get_allocation (sibling, &alloc);
|
||||
|
||||
if (alloc.x < child_x)
|
||||
column = 0;
|
||||
else
|
||||
column++;
|
||||
|
||||
child_x = alloc.x;
|
||||
|
||||
if (sibling == child)
|
||||
break;
|
||||
}
|
||||
|
||||
if (direction == GTK_DIR_DOWN)
|
||||
{
|
||||
next = find_next_section (chooser, box, TRUE);
|
||||
if (next == NULL)
|
||||
return FALSE;
|
||||
|
||||
i = 0;
|
||||
for (sibling = gtk_widget_get_first_child (next->box);
|
||||
sibling;
|
||||
sibling = gtk_widget_get_next_sibling (sibling), i++)
|
||||
{
|
||||
next = find_section (chooser, box);
|
||||
while (TRUE)
|
||||
{
|
||||
if (i == column)
|
||||
next = find_next_section (chooser, next->box, TRUE);
|
||||
if (next == NULL)
|
||||
return FALSE;
|
||||
|
||||
i = 0;
|
||||
child_x = G_MAXINT;
|
||||
for (sibling = gtk_widget_get_first_child (next->box);
|
||||
sibling;
|
||||
sibling = gtk_widget_get_next_sibling (sibling))
|
||||
{
|
||||
gtk_widget_grab_focus (sibling);
|
||||
return TRUE;
|
||||
if (!gtk_widget_get_child_visible (sibling))
|
||||
continue;
|
||||
|
||||
gtk_widget_get_allocation (sibling, &alloc);
|
||||
|
||||
if (alloc.x < child_x)
|
||||
i = 0;
|
||||
else
|
||||
i++;
|
||||
|
||||
child_x = alloc.x;
|
||||
|
||||
if (i == column)
|
||||
{
|
||||
gtk_widget_grab_focus (sibling);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (direction == GTK_DIR_UP)
|
||||
{
|
||||
next = find_next_section (chooser, box, FALSE);
|
||||
if (next == NULL)
|
||||
return FALSE;
|
||||
next = find_section (chooser, box);
|
||||
while (TRUE)
|
||||
{
|
||||
next = find_next_section (chooser, next->box, FALSE);
|
||||
if (next == NULL)
|
||||
return FALSE;
|
||||
|
||||
i = 0;
|
||||
child = NULL;
|
||||
for (sibling = gtk_widget_get_first_child (next->box);
|
||||
sibling;
|
||||
sibling = gtk_widget_get_next_sibling (sibling), i++)
|
||||
{
|
||||
if ((i % n_columns) == column)
|
||||
child = sibling;
|
||||
}
|
||||
if (child)
|
||||
{
|
||||
gtk_widget_grab_focus (child);
|
||||
return TRUE;
|
||||
i = 0;
|
||||
child_x = G_MAXINT;
|
||||
child = NULL;
|
||||
for (sibling = gtk_widget_get_first_child (next->box);
|
||||
sibling;
|
||||
sibling = gtk_widget_get_next_sibling (sibling))
|
||||
{
|
||||
if (!gtk_widget_get_child_visible (sibling))
|
||||
continue;
|
||||
|
||||
gtk_widget_get_allocation (sibling, &alloc);
|
||||
|
||||
if (alloc.x < child_x)
|
||||
i = 0;
|
||||
else
|
||||
i++;
|
||||
|
||||
child_x = alloc.x;
|
||||
|
||||
if (i == column)
|
||||
child = sibling;
|
||||
}
|
||||
|
||||
if (child)
|
||||
{
|
||||
gtk_widget_grab_focus (child);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2050,12 +2050,12 @@ connect_completion_signals (GtkEntryCompletion *completion)
|
||||
GtkEntryBuffer *buffer = gtk_text_get_buffer (text);
|
||||
|
||||
controller = completion->entry_key_controller = gtk_event_controller_key_new ();
|
||||
gtk_event_controller_set_name (controller, "gtk-entry-completion");
|
||||
gtk_event_controller_set_static_name (controller, "gtk-entry-completion");
|
||||
g_signal_connect (controller, "key-pressed",
|
||||
G_CALLBACK (gtk_entry_completion_key_pressed), completion);
|
||||
gtk_widget_add_controller (GTK_WIDGET (text), controller);
|
||||
controller = completion->entry_focus_controller = gtk_event_controller_focus_new ();
|
||||
gtk_event_controller_set_name (controller, "gtk-entry-completion");
|
||||
gtk_event_controller_set_static_name (controller, "gtk-entry-completion");
|
||||
g_signal_connect_swapped (controller, "leave", G_CALLBACK (text_focus_out), completion);
|
||||
gtk_widget_add_controller (GTK_WIDGET (text), controller);
|
||||
|
||||
|
||||
@@ -110,6 +110,35 @@ typedef enum
|
||||
GTK_BASELINE_POSITION_BOTTOM
|
||||
} GtkBaselinePosition;
|
||||
|
||||
/**
|
||||
* GtkContentFit:
|
||||
* @GTK_CONTENT_FIT_FILL: Make the content fill the entire allocation,
|
||||
* without taking its aspect ratio in consideration. The resulting
|
||||
* content will appear as stretched if its aspect ratio is different
|
||||
* from the allocation aspect ratio.
|
||||
* @GTK_CONTENT_FIT_CONTAIN: Scale the content to fit the allocation,
|
||||
* while taking its aspect ratio in consideration. The resulting
|
||||
* content will appear as letterboxed if its aspect ratio is different
|
||||
* from the allocation aspect ratio.
|
||||
* @GTK_CONTENT_FIT_COVER: Cover the entire allocation, while taking
|
||||
* the content aspect ratio in consideration. The resulting content
|
||||
* will appear as clipped if its aspect ratio is different from the
|
||||
* allocation aspect ratio.
|
||||
* @GTK_CONTENT_FIT_SCALE_DOWN: The content is scaled down to fit the
|
||||
* allocation, if needed, otherwise its original size is used.
|
||||
*
|
||||
* Controls how a content should be made to fit inside an allocation.
|
||||
*
|
||||
* Since: 4.8
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GTK_CONTENT_FIT_FILL,
|
||||
GTK_CONTENT_FIT_CONTAIN,
|
||||
GTK_CONTENT_FIT_COVER,
|
||||
GTK_CONTENT_FIT_SCALE_DOWN,
|
||||
} GtkContentFit;
|
||||
|
||||
/**
|
||||
* GtkDeleteType:
|
||||
* @GTK_DELETE_CHARS: Delete characters.
|
||||
|
||||
@@ -66,6 +66,7 @@ struct _GtkEventControllerPrivate
|
||||
char *name;
|
||||
GtkWidget *target;
|
||||
GdkEvent *event;
|
||||
unsigned int name_is_static : 1;
|
||||
};
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GtkEventController, gtk_event_controller, G_TYPE_OBJECT)
|
||||
@@ -173,8 +174,9 @@ gtk_event_controller_finalize (GObject *object)
|
||||
{
|
||||
GtkEventController *self = GTK_EVENT_CONTROLLER (object);
|
||||
GtkEventControllerPrivate *priv = gtk_event_controller_get_instance_private (self);
|
||||
|
||||
g_free (priv->name);
|
||||
|
||||
if (!priv->name_is_static)
|
||||
g_free (priv->name);
|
||||
|
||||
G_OBJECT_CLASS (gtk_event_controller_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -571,8 +573,33 @@ gtk_event_controller_set_name (GtkEventController *controller,
|
||||
|
||||
g_return_if_fail (GTK_IS_EVENT_CONTROLLER (controller));
|
||||
|
||||
g_free (priv->name);
|
||||
if (!priv->name_is_static)
|
||||
g_free (priv->name);
|
||||
priv->name = g_strdup (name);
|
||||
priv->name_is_static = FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_event_controller_set_static_name:
|
||||
* @controller: a `GtkEventController`
|
||||
* @name: (nullable): a name for @controller, must be a static string
|
||||
*
|
||||
* Sets a name on the controller that can be used for debugging.
|
||||
*
|
||||
* Since: 4.8
|
||||
*/
|
||||
void
|
||||
gtk_event_controller_set_static_name (GtkEventController *controller,
|
||||
const char *name)
|
||||
{
|
||||
GtkEventControllerPrivate *priv = gtk_event_controller_get_instance_private (controller);
|
||||
|
||||
g_return_if_fail (GTK_IS_EVENT_CONTROLLER (controller));
|
||||
|
||||
if (!priv->name_is_static)
|
||||
g_free (priv->name);
|
||||
priv->name = (char *)name;
|
||||
priv->name_is_static = TRUE;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user