Compare commits

..

1 Commits

Author SHA1 Message Date
Chun-wei Fan
127685ef22 laguage-names.c: Windows: Look for iso-codes dynamically
Use the internal APIs _gtk_get_localedir() and gtk_get_datadir() to look for
the XML files and translations for iso-codes, instead of using a path defined
at build time, on Windows.
2022-01-06 17:54:37 +08:00
1760 changed files with 1129369 additions and 146572 deletions

View File

@@ -4,7 +4,6 @@ AlwaysBreakAfterDefinitionReturnType: All
BreakBeforeBinaryOperators: None BreakBeforeBinaryOperators: None
BinPackParameters: false BinPackParameters: false
SpaceAfterCStyleCast: true SpaceAfterCStyleCast: true
PointerAlignment: Right
# Our column limit is actually 80, but setting that results in clang-format # 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 # making a lot of dubious hanging-indent choices; disable it and assume the
# developer will line wrap appropriately. clang-format will still check # developer will line wrap appropriately. clang-format will still check

View File

@@ -3,7 +3,6 @@ include:
file: 'flatpak/flatpak_ci_initiative.yml' file: 'flatpak/flatpak_ci_initiative.yml'
stages: stages:
- check
- build - build
- analysis - analysis
- docs - docs
@@ -22,12 +21,12 @@ stages:
# Common variables # Common variables
variables: variables:
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" COMMON_MESON_FLAGS: "-Dwerror=true -Dglib:werror=false -Dpango:werror=false -Dgtk-doc:werror=false -Dwayland-protocols:werror=false -Dsysprof:werror=false"
BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true" BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true"
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled" FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled"
MESON_TEST_TIMEOUT_MULTIPLIER: 3 MESON_TEST_TIMEOUT_MULTIPLIER: 3
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v38" FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v35"
FLATPAK_IMAGE: "quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master" FLATPAK_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master"
.only-default: .only-default:
only: only:
@@ -38,7 +37,7 @@ variables:
style-check-diff: style-check-diff:
extends: .only-default extends: .only-default
image: $FEDORA_IMAGE image: $FEDORA_IMAGE
stage: check stage: .pre
allow_failure: true allow_failure: true
script: script:
- .gitlab-ci/run-style-check-diff.sh - .gitlab-ci/run-style-check-diff.sh
@@ -59,7 +58,6 @@ style-check-diff:
- "${CI_PROJECT_DIR}/_build/report*.xml" - "${CI_PROJECT_DIR}/_build/report*.xml"
- "${CI_PROJECT_DIR}/_build/report*.html" - "${CI_PROJECT_DIR}/_build/report*.html"
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.png" - "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.png"
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.node"
- "${CI_PROJECT_DIR}/_build/testsuite/tools/output/*/*" - "${CI_PROJECT_DIR}/_build/testsuite/tools/output/*/*"
- "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*/*.png" - "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*/*.png"
- "${CI_PROJECT_DIR}/_build/testsuite/css/output/*/*.syscap" - "${CI_PROJECT_DIR}/_build/testsuite/css/output/*/*.syscap"
@@ -90,7 +88,7 @@ fedora-x86_64:
- meson compile -C _build - meson compile -C _build
- meson install -C _build - meson install -C _build
- PKG_CONFIG_PATH=${CI_PROJECT_DIR}/_install/lib64/pkgconfig:${CI_PROJECT_DIR}/_install/share/pkgconfig meson setup _build_hello examples/hello - PKG_CONFIG_PATH=${CI_PROJECT_DIR}/_install/lib64/pkgconfig:${CI_PROJECT_DIR}/_install/share/pkgconfig meson setup _build_hello examples/hello
- LD_LIBRARY_PATH=${CI_PROJECT_DIR}/_install/lib64 meson compile -C _build_hello - meson compile -C _build_hello
- .gitlab-ci/run-tests.sh _build x11 - .gitlab-ci/run-tests.sh _build x11
- .gitlab-ci/run-tests.sh _build wayland - .gitlab-ci/run-tests.sh _build wayland
- .gitlab-ci/run-tests.sh _build waylandgles - .gitlab-ci/run-tests.sh _build waylandgles
@@ -110,29 +108,6 @@ release-build:
- ninja -C _build - ninja -C _build
- .gitlab-ci/run-tests.sh _build x11 - .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: installed-tests:
extends: .build-fedora-default extends: .build-fedora-default
stage: build stage: build
@@ -181,24 +156,18 @@ msys2-mingw64:
variables: variables:
MSYSTEM: "MINGW64" MSYSTEM: "MINGW64"
CHERE_INVOKING: "yes" CHERE_INVOKING: "yes"
artifacts:
when: always
expose_as: 'Windows_DLL_MSYS2_64_bit_toolchain'
paths:
- "${CI_PROJECT_DIR}/_build/gtkdll.tar.gz"
macos: macos:
extends: .only-default extends: .only-default
only: only:
- branches@GNOME/gtk - branches@GNOME/gtk
stage: build stage: build
allow_failure: true
tags: tags:
- macos - macos
needs: [] needs: []
before_script: before_script:
- bash .gitlab-ci/show-info-osx.sh - bash .gitlab-ci/show-info-osx.sh
- pip3 install --user meson==0.60.3 - pip3 install --user meson==0.59
- pip3 install --user ninja - pip3 install --user ninja
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH - export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
- export MESON_FORCE_BACKTRACE=1 - export MESON_FORCE_BACKTRACE=1
@@ -294,18 +263,6 @@ flatpak-main:icon-browser:
variables: variables:
APPID: org.gtk.IconBrowser4 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 # Publish the demo apps to the GNOME Nightly repo
# https://wiki.gnome.org/Apps/Nightly # https://wiki.gnome.org/Apps/Nightly
# https://gitlab.gnome.org/GNOME/Initiatives/-/wikis/DevOps-with-Flatpak # https://gitlab.gnome.org/GNOME/Initiatives/-/wikis/DevOps-with-Flatpak
@@ -324,11 +281,6 @@ nightly icon-browser:
dependencies: ['flatpak-main:icon-browser'] dependencies: ['flatpak-main:icon-browser']
needs: ['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: static-scan:
image: $FEDORA_IMAGE image: $FEDORA_IMAGE
stage: analysis stage: analysis
@@ -388,7 +340,6 @@ reference:
- _reference - _reference
publish-docs: publish-docs:
image: fedora:latest
stage: publish stage: publish
needs: ['reference'] needs: ['reference']
script: script:

View File

@@ -14,9 +14,6 @@ Each Docker image has a tag composed of two parts:
See the [container registry][registry] for the available images for each See the [container registry][registry] for the available images for each
branch, as well as their available versions. branch, as well as their available versions.
Note that using `latest` as version number will overwrite the most
recently uploaded image in the registry.
### Checklist for Updating a CI image ### Checklist for Updating a CI image
- [ ] Update the `${image}.Dockerfile` file with the dependencies - [ ] Update the `${image}.Dockerfile` file with the dependencies

View File

@@ -1,4 +1,4 @@
FROM fedora:36 FROM fedora:34
RUN dnf -y install \ RUN dnf -y install \
adwaita-icon-theme \ adwaita-icon-theme \
@@ -87,6 +87,7 @@ RUN dnf -y install \
python3-wheel \ python3-wheel \
redhat-rpm-config \ redhat-rpm-config \
sassc \ sassc \
systemtap-sdt-devel \
vulkan-devel \ vulkan-devel \
wayland-devel \ wayland-devel \
wayland-protocols-devel \ wayland-protocols-devel \
@@ -94,8 +95,6 @@ RUN dnf -y install \
weston-libs \ weston-libs \
which \ which \
xorg-x11-server-Xvfb \ xorg-x11-server-Xvfb \
&& dnf install -y 'dnf-command(builddep)' \
&& dnf builddep -y wayland \
&& dnf clean all && dnf clean all
# Enable sudo for wheel users # Enable sudo for wheel users

View File

@@ -16,9 +16,10 @@ flatpak-builder \
flatpak build ${builddir} meson \ flatpak build ${builddir} meson \
--prefix=/app \ --prefix=/app \
--libdir=/app/lib \ --libdir=/app/lib \
--buildtype=debugoptimized \ --buildtype=release \
-Dx11-backend=true \ -Dx11-backend=true \
-Dwayland-backend=true \ -Dwayland-backend=true \
-Dprint-backends=file \
-Dbuild-tests=false \ -Dbuild-tests=false \
-Dbuild-examples=false \ -Dbuild-examples=false \
-Dintrospection=disabled \ -Dintrospection=disabled \

View File

@@ -185,8 +185,6 @@ ul.images li {
<li><img alt="ref" src="{{ failure.image_data.ref }}" /></li> <li><img alt="ref" src="{{ failure.image_data.ref }}" /></li>
<li><img alt="out" src="{{ failure.image_data.out }}" /></li> <li><img alt="out" src="{{ failure.image_data.out }}" /></li>
<li><img alt="diff" src="{{ failure.image_data.diff }}" /></li> <li><img alt="diff" src="{{ failure.image_data.diff }}" /></li>
<li><a href="{{ failure.image_data.refnode }}">ref node</a></li>
<li><a href="{{ failure.image_data.outnode }}">out node</a></li>
</ul> </ul>
{% endif %} {% endif %}
</li> </li>
@@ -313,8 +311,6 @@ for line in args.infile:
image_data = { image_data = {
'ref': os.path.join(args.reftest_output_dir, '{}.ref.png'.format(basename)), 'ref': os.path.join(args.reftest_output_dir, '{}.ref.png'.format(basename)),
'out': os.path.join(args.reftest_output_dir, '{}.out.png'.format(basename)), 'out': os.path.join(args.reftest_output_dir, '{}.out.png'.format(basename)),
'refnode': os.path.join(args.reftest_output_dir, '{}.ref.node'.format(basename)),
'outnode': os.path.join(args.reftest_output_dir, '{}.out.node'.format(basename)),
'diff': os.path.join(args.reftest_output_dir, '{}.diff.png'.format(basename)), 'diff': os.path.join(args.reftest_output_dir, '{}.diff.png'.format(basename)),
} }

View File

@@ -2,43 +2,25 @@
set -e set -e
ancestor_horizon=31 # days (one month) # 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.
# Recently, git is picky about directory ownership. Tell it not to worry. if [ "${CI_PROJECT_NAMESPACE}" != "GNOME" ]; then
git config --global --add safe.directory "$PWD" echo "Retrieving the current upstream repository from ${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}..."
# 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 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 fi
# Work out the newest common ancestor between the detached HEAD that this CI job # 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 # has checked out, and the upstream target branch (which will typically be
# `upstream/main` or `upstream/glib-2-62`). # `upstream/main` or `upstream/gtk-3-24`).
# `${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}` or `${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}` #
# are only defined if were running in a merge request pipeline, # `${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}` is only defined if were running in
# fall back to `${CI_DEFAULT_BRANCH}` or `${CI_COMMIT_BRANCH}` respectively # a merge request pipeline; fall back to `${CI_DEFAULT_BRANCH}` otherwise.
# 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)
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 "Couldnt 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 git diff -U0 --no-color "${newest_common_ancestor_sha}" | .gitlab-ci/clang-format-diff.py -binary "clang-format" -p1
exit_status=$? exit_status=$?
@@ -54,7 +36,7 @@ exit_status=$?
echo "" echo ""
echo "Note that clang-format output is advisory and cannot always match the" echo "Note that clang-format output is advisory and cannot always match the"
echo "GTK coding style, documented at:" echo "GTK coding style, documented at:"
echo " https://gitlab.gnome.org/GNOME/gtk/blob/main/docs/CODING-STYLE.md" echo " https://gitlab.gnome.org/GNOME/gtk/blob/main/docs/CODING-STYLE"
echo "Warnings from this tool can be ignored in favour of the documented " 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 "coding style, or in favour of matching the style of existing"
echo "surrounding code." echo "surrounding code."

View File

@@ -5,8 +5,8 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliar
@echo on @echo on
:: FIXME: make warnings fatal :: FIXME: make warnings fatal
pip3 install --upgrade --user meson==0.60.3 || goto :error pip3 install --upgrade --user meson==0.59 || goto :error
meson -Ddebug=false -Dmedia-gstreamer=disabled _build || goto :error meson -Dmedia-gstreamer=disabled _build || goto :error
ninja -C _build || goto :error ninja -C _build || goto :error
goto :EOF goto :EOF

View File

@@ -15,9 +15,9 @@ pacman --noconfirm -Suy
pacman --noconfirm -S --needed \ pacman --noconfirm -S --needed \
base-devel \ base-devel \
git \ git \
mingw-w64-$MSYS2_ARCH-cc \ mingw-w64-$MSYS2_ARCH-toolchain \
mingw-w64-$MSYS2_ARCH-ccache \ mingw-w64-$MSYS2_ARCH-ccache \
mingw-w64-$MSYS2_ARCH-pkgconf \ mingw-w64-$MSYS2_ARCH-pkg-config \
mingw-w64-$MSYS2_ARCH-gobject-introspection \ mingw-w64-$MSYS2_ARCH-gobject-introspection \
mingw-w64-$MSYS2_ARCH-meson \ mingw-w64-$MSYS2_ARCH-meson \
mingw-w64-$MSYS2_ARCH-adwaita-icon-theme \ mingw-w64-$MSYS2_ARCH-adwaita-icon-theme \
@@ -30,7 +30,7 @@ pacman --noconfirm -S --needed \
mingw-w64-$MSYS2_ARCH-libepoxy \ mingw-w64-$MSYS2_ARCH-libepoxy \
mingw-w64-$MSYS2_ARCH-pango \ mingw-w64-$MSYS2_ARCH-pango \
mingw-w64-$MSYS2_ARCH-fribidi \ mingw-w64-$MSYS2_ARCH-fribidi \
mingw-w64-$MSYS2_ARCH-gst-plugins-bad-libs \ mingw-w64-$MSYS2_ARCH-gst-plugins-bad \
mingw-w64-$MSYS2_ARCH-shared-mime-info \ mingw-w64-$MSYS2_ARCH-shared-mime-info \
mingw-w64-$MSYS2_ARCH-python-gobject mingw-w64-$MSYS2_ARCH-python-gobject
@@ -38,6 +38,25 @@ mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)" export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" 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 # Build
ccache --zero-stats ccache --zero-stats
ccache --show-stats ccache --show-stats
@@ -54,5 +73,3 @@ unset CCACHE_DISABLE
ninja -C _build ninja -C _build
ccache --show-stats ccache --show-stats
tar zcf _build/gtkdll.tar.gz _build/gtk/libgtk*.dll

529
NEWS
View File

@@ -1,530 +1,5 @@
Overview of Changes in 4.9.1, dd-mm-yyyy Overview of Changes
======================================== ===================
Note that deprecations are an early outlook
at changes that will appear in an eventual
GTK 5 release, which is still far away.
* GtkTreeView, GtkIconView, GtkComboBox and
auxiliary classes have been deprecated
* GtkEntryCompletion has been deprecated
* GtkStyleContext has been deprecated
* gtk_render_ and gtk_snapshot_render_ APIs
have been deprecated
* GtkAppChooser widgets hae been deprecated
* GtkMountOperation:
- Fix the dialog to look reasonable
- Make it work under non-X11
* GtkStringSorter:
- Support different collation methods
* Accessibility:
- Introduce GtkAccessibleRange and implement it
* Debugging:
- Unify formatting for debug output
- Make make debug options available in
non-debug builds
* Translation updates:
Abkhazian
Basque
Bulgarian
Croatian
Friulian
Georgian
German
Hungarian
Russian
Turkish
Overview of Changes in 4.8.1, 16-09-2022
========================================
* Input:
- Fix problems with input method interactions that caused
dead keys not to work
- Accept single-key compose sequences (these are used with
some keyboard layouts)
* GtkColumnView:
- Flip column order in right-to-left context
* GtkGridView:
- Fix problems with rubberbanding
* GtkFileChooser:
- Fix positioning of popovers in the places view
- Make ~ and . keyboard shortcuts work again
* gsk:
- Make glyph upload more similar to icons
* Make file transfer via portals work, this fixes file
copy/paste and dnd in flatpaks
* Translation updates:
Catalan
Chinese (China)
Chinese (Taiwan)
Latvian
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
========================================
* GtkInscription:
- A new label-like widget for use in list views
* GtkColorChooser:
- Style improvements
* GtkFontChooser:
- Improve support for OpenType features a bit
* GtkLabel:
- Allow selectable labels to be activated via mnemonic
* GtkTextView:
- Implement GetCharacterExtents for accessibility
* GtkStack:
- Fix a poblem with stack page accessibility
* GtkListView:
- Cull listitems that are out of view
- Make all our list models implement ::n-items and
::item-type properties
* Translations:
- Stop translating property nicks and blurbs
- Fix extracting translations from ui files
* Debugging:
- Support GTK_DEBUG=invert-text-dir
- Allow inspecting inspectors
- Replace GTK_USE_PORTAL with GDK_DEBUG=portals
- Improve responsiveness of the inspector
* CSS:
- Allow fractional letterspacing
* Theme:
- Improve legibility of selectable labels
* Demos:
- Improve the font features demo
- Add demos for GtkInscription
* Wayland:
- Freeze popups when hidden
- Only send smooth scroll events for tablet tools
- Make scaled cursor image have the right size
- Fix problems with the activation protocol
- Don't force the HighContrast icon theme
- Support xdg_toplevel.bounds
* X11:
- Always update the shadoe size
* Windows:
- Improve touchpad support by using DirectManipulation
- Add more directories to the builtin hicolor icon theme
* Translation updates:
Basque
Catalan
Chinese (China)
Galician
German
Lithuanian
Nepali
Occitan
Persian
Polish
Portuguese
Russian
Serbian
Spanish
Swedish
Turkish
Ukrainian
Overview of Changes in 4.7.0, 07-05-2022
========================================
* GtkTextView:
- Reduce overdraws
* GtkViewport:
- Default scroll-to-focus to TRUE
* GtkText:
- Stop blinking when we lose focus
* GtkSearchEntry:
- Make search delay configurable
* GtkPopoverMenu:
- Fix RTL positioning of buttons
* GtkLabel:
- Fix focus keynav with links
* GtkFileChooser:
- Prevent undesirable completion popups
- Fix a corner case in save mode
- Keep the portal filechooser alive long enough
* GtkCheckButton:
- Allow setting a custom child
* GtkEditableLabel:
- Make the :editing property writable
* GtkColumnView:
- Various optimizations to improve scrolling performance
* GtkTreeStore:
- Allow populating tree stores from ui files
* GtkBoxLayout:
- Avoid infinite loops
* CSS:
- Optimize reordering within the same parent
* Emoji:
- Update to CLDR v40 / Unicode 14
- Add more locales
* Input:
- Add scroll unit handling
- Handle display changes in GtkIMMultiContext
- Always populate GDK_AXIS_X/Y in event history
- Don't crash for large compose tables
* Accessibility:
- Fix a crash at start when orca is running
* Theme:
- Refresh icons
- Fix selection in vertical spin buttons
- Fix selection in editable labels
* gdk:
- Optimize pixel format conversions
- Use EGL_KHR_swap_buffers_with_damage for NVidia
* gsk:
- Handle large viewports
- Prepare texture libraries for glyphy rendering
- Don't leak big glyphs in the glyph cache
- Align offscreen rendering with th pixel grid
- Check for half-float support before using it
* Wayland:
- Use xdg-activation protocol
- Fix text caret coordinates
- Fix on-screen keyboard activation
* MacOS:
- Fix sluggish and reversed scrolling
- Improve monitor detection
- Event handling fixes
- Fix keyboard input on popovers
- Support OpenGL-based video playback
- Suport fullscreen
- Improve native filechoooser size allocation
- Use CALayer and IOSurface for rendering
- Use a per-monitor CVDisplayLink
- Fix kinetic scrolling
- Improve window placement
- Improve multi-monitor handling
- Start applications in the foreground
- Fix cursor blink time
* Windows:
- Fix preedit window placement on HiDPI
* Tools:
- gtk4-builder-tool: Don't require a display for all commands
- gtk4-builder-tool: Add a screenshot command
- gtk4-node-editor: Install this utility
* Debugging:
- inspector: Show more application data
- inspector: Allow viewing PangoAttrList properties
* Documentation:
- Use the gtk-builder-tool to generate screenshots
* Build:
- Fix cross-compilation
- Fix build on aarch64
- Fix build with gcc 12
* Translation updates
Basque
Brazilian Portuguese
British English
Catalan
Chinese (China)
Chinese (Taiwan)
Croatian
Czech
Danish
Finnish
Galician
Georgian
German
Hebrew
Hungarian
Indonesian
Italian
Kazakh
Korean
Latvian
Lithuanian
Norwegian Bokmål
Persian
Polish
Portuguese
Russian
Serbian
Slovak
Slovenian
Spanish
Swedish
Turkish
Ukrainian
Overview of Changes in 4.6.1, 11-02-2022
========================================
* GtkFontChooser:
- Stop using PangoFc api
- Fix a crash
- Use new HarfBuzz api
* GtkMenuButton:
- Update accessible description
* GtkTextView:
- Fix intra-widget dnd
* Printing:
- Fix an fd leak
* Input:
- Make sure input methods get focus-in events
- Always flush events to avoid scroll event pileup
- Support hold events
- Update keysyms from libxkbcommon
* Theme:
- Improve text selection legibility
* Introspection:
- Add missing nullable annotations everywhere
* Build:
- Make stack noexec again
- Avoid symbol leaks
- Drop unneeded script data
* Windows:
- Stop using WM_SYNCPAINT
- Relax check for GL 3.x legacy contexts
- Use native apis for language names
- Rewrite the keymap code
- Use the GL renderer by default
* Wayland:
- Fix support for the new high-contrast setting
- Avoid redundant scale changes
- Fix DND hotspot handling
- Don't always restore the saved size when floating
* MacOS:
- Various performance improvements
* Translation updates:
Brazilian Portuguese
Catalan
Chinese (China)
Galician
Hebrew
Japanese
Lithuanian
Persian
Polish
Portuguese
Russian
Slovenian
Spanish
Ukrainian
Overview of Changes in 4.6.0, 30-12-2021
========================================
* GtkProgressBar: * GtkProgressBar:
- Fix handling of "inverted" - Fix handling of "inverted"

View File

@@ -43,8 +43,7 @@
"sources" : [ "sources" : [
{ {
"type" : "git", "type" : "git",
"url" : "https://gitlab.freedesktop.org/wayland/wayland.git", "url" : "https://gitlab.freedesktop.org/wayland/wayland.git"
"branch" : "main"
} }
] ]
}, },
@@ -54,7 +53,8 @@
"builddir" : true, "builddir" : true,
"config-opts" : [ "config-opts" : [
"--libdir=/app/lib", "--libdir=/app/lib",
"-Dtests=false" "-Dtests=false",
"-Dbenchmarks=false"
], ],
"sources" : [ "sources" : [
{ {
@@ -104,8 +104,8 @@
"sources": [ "sources": [
{ {
"type": "archive", "type": "archive",
"url": "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2", "url": "https://boostorg.jfrog.io/artifactory/main/release/1.69.0/source/boost_1_69_0.tar.bz2",
"sha256": "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39" "sha256": "8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406"
} }
] ]
}, },
@@ -185,7 +185,7 @@
"builddir" : true, "builddir" : true,
"config-opts" : [ "config-opts" : [
"--libdir=/app/lib", "--libdir=/app/lib",
"-Dvulkan=disabled", "-Denable_vulkan=no",
"-Dbuildtype=debugoptimized", "-Dbuildtype=debugoptimized",
"-Dprofile=devel" "-Dprofile=devel"
], ],

View File

@@ -43,8 +43,7 @@
"sources" : [ "sources" : [
{ {
"type" : "git", "type" : "git",
"url" : "https://gitlab.freedesktop.org/wayland/wayland.git", "url" : "https://gitlab.freedesktop.org/wayland/wayland.git"
"branch" : "main"
} }
] ]
}, },
@@ -54,7 +53,8 @@
"builddir" : true, "builddir" : true,
"config-opts" : [ "config-opts" : [
"--libdir=/app/lib", "--libdir=/app/lib",
"-Dtests=false" "-Dtests=false",
"-Dbenchmarks=false"
], ],
"sources" : [ "sources" : [
{ {
@@ -114,7 +114,7 @@
"builddir" : true, "builddir" : true,
"config-opts" : [ "config-opts" : [
"--libdir=/app/lib", "--libdir=/app/lib",
"-Dvulkan=disabled", "-Denable_vulkan=no",
"-Dbuildtype=debugoptimized", "-Dbuildtype=debugoptimized",
"-Dprofile=devel" "-Dprofile=devel"
], ],

View File

@@ -43,8 +43,7 @@
"sources" : [ "sources" : [
{ {
"type" : "git", "type" : "git",
"url" : "https://gitlab.freedesktop.org/wayland/wayland.git", "url" : "https://gitlab.freedesktop.org/wayland/wayland.git"
"branch" : "main"
} }
] ]
}, },
@@ -54,7 +53,8 @@
"builddir" : true, "builddir" : true,
"config-opts" : [ "config-opts" : [
"--libdir=/app/lib", "--libdir=/app/lib",
"-Dtests=false" "-Dtests=false",
"-Dbenchmarks=false"
], ],
"sources" : [ "sources" : [
{ {
@@ -114,7 +114,7 @@
"builddir" : true, "builddir" : true,
"config-opts" : [ "config-opts" : [
"--libdir=/app/lib", "--libdir=/app/lib",
"-Dvulkan=disabled", "-Denable_vulkan=no",
"-Dbuildtype=debugoptimized", "-Dbuildtype=debugoptimized",
"-Dprofile=devel" "-Dprofile=devel"
], ],

View File

@@ -1,138 +0,0 @@
{
"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"
}
}
}

View File

@@ -0,0 +1,45 @@
#!/usr/bin/env python3
import os
import sys
import subprocess
if 'DESTDIR' not in os.environ:
gtk_api_version = sys.argv[1]
gtk_abi_version = sys.argv[2]
gtk_libdir = sys.argv[3]
gtk_datadir = sys.argv[4]
gtk_bindir = sys.argv[5]
gtk_moduledir = os.path.join(gtk_libdir, 'gtk-' + gtk_api_version, gtk_abi_version)
gtk_printmodule_dir = os.path.join(gtk_moduledir, 'printbackends')
gtk_immodule_dir = os.path.join(gtk_moduledir, 'immodules')
print('Compiling GSettings schemas...')
glib_compile_schemas = subprocess.check_output(['pkg-config',
'--variable=glib_compile_schemas',
'gio-2.0']).strip()
if not os.path.exists(glib_compile_schemas):
# pkg-config variables only available since GLib 2.62.0.
glib_compile_schemas = 'glib-compile-schemas'
subprocess.call([glib_compile_schemas,
os.path.join(gtk_datadir, 'glib-2.0', 'schemas')])
print('Updating icon cache...')
update_icon_cache = os.path.join(gtk_bindir, 'gtk4-update-icon-cache')
subprocess.call([update_icon_cache, '-q', '-t' ,'-f',
os.path.join(gtk_datadir, 'icons', 'hicolor')])
print('Updating module cache for print backends...')
os.makedirs(gtk_printmodule_dir, exist_ok=True)
gio_querymodules = subprocess.check_output(['pkg-config',
'--variable=gio_querymodules',
'gio-2.0']).strip()
if not os.path.exists(gio_querymodules):
# pkg-config variables only available since GLib 2.62.0.
gio_querymodules = 'gio-querymodules'
subprocess.call([gio_querymodules, gtk_printmodule_dir])
print('Updating module cache for input methods...')
os.makedirs(gtk_immodule_dir, exist_ok=True)
subprocess.call([gio_querymodules, gtk_immodule_dir])

View File

@@ -361,11 +361,11 @@ save_cb (GtkWidget *button,
} }
static void static void
constraint_editor_window_dispose (GObject *object) constraint_editor_window_finalize (GObject *object)
{ {
gtk_widget_dispose_template (GTK_WIDGET (object), CONSTRAINT_EDITOR_WINDOW_TYPE); //ConstraintEditorWindow *self = (ConstraintEditorWindow *)object;
G_OBJECT_CLASS (constraint_editor_window_parent_class)->dispose (object); G_OBJECT_CLASS (constraint_editor_window_parent_class)->finalize (object);
} }
static int child_counter; static int child_counter;
@@ -497,7 +497,7 @@ constraint_editor_window_class_init (ConstraintEditorWindowClass *class)
GObjectClass *object_class = G_OBJECT_CLASS (class); GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
object_class->dispose = constraint_editor_window_dispose; object_class->finalize = constraint_editor_window_finalize;
gtk_widget_class_set_template_from_resource (widget_class, gtk_widget_class_set_template_from_resource (widget_class,
"/org/gtk/gtk4/constraint-editor/constraint-editor-window.ui"); "/org/gtk/gtk4/constraint-editor/constraint-editor-window.ui");

View File

@@ -21,8 +21,6 @@
#include "constraint-editor.h" #include "constraint-editor.h"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
struct _ConstraintEditor struct _ConstraintEditor
{ {
GtkWidget parent_instance; GtkWidget parent_instance;
@@ -609,11 +607,10 @@ constraint_editor_dispose (GObject *object)
{ {
ConstraintEditor *self = (ConstraintEditor *)object; ConstraintEditor *self = (ConstraintEditor *)object;
g_clear_pointer (&self->grid, gtk_widget_unparent);
g_clear_object (&self->model); g_clear_object (&self->model);
g_clear_object (&self->constraint); g_clear_object (&self->constraint);
gtk_widget_dispose_template (GTK_WIDGET (object), CONSTRAINT_EDITOR_TYPE);
G_OBJECT_CLASS (constraint_editor_parent_class)->dispose (object); G_OBJECT_CLASS (constraint_editor_parent_class)->dispose (object);
} }

View File

@@ -21,8 +21,6 @@
#include "guide-editor.h" #include "guide-editor.h"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
struct _GuideEditor struct _GuideEditor
{ {
GtkWidget parent_instance; GtkWidget parent_instance;
@@ -296,10 +294,9 @@ guide_editor_dispose (GObject *object)
{ {
GuideEditor *self = (GuideEditor *)object; GuideEditor *self = (GuideEditor *)object;
g_clear_pointer (&self->grid, gtk_widget_unparent);
g_clear_object (&self->guide); g_clear_object (&self->guide);
gtk_widget_dispose_template (GTK_WIDGET (self), GUIDE_EDITOR_TYPE);
G_OBJECT_CLASS (guide_editor_parent_class)->dispose (object); G_OBJECT_CLASS (guide_editor_parent_class)->dispose (object);
} }

View File

@@ -504,8 +504,6 @@ demo_application_window_dispose (GObject *object)
demo_application_window_store_state (window); demo_application_window_store_state (window);
gtk_widget_dispose_template (GTK_WIDGET (window), demo_application_window_get_type ());
G_OBJECT_CLASS (demo_application_window_parent_class)->dispose (object); G_OBJECT_CLASS (demo_application_window_parent_class)->dispose (object);
} }

View File

@@ -341,13 +341,16 @@ do_clipboard (GtkWidget *do_widget)
GtkWidget *button; GtkWidget *button;
scope = gtk_builder_cscope_new (); scope = gtk_builder_cscope_new ();
gtk_builder_cscope_add_callback (scope, copy_button_clicked); gtk_builder_cscope_add_callback_symbols (GTK_BUILDER_CSCOPE (scope),
gtk_builder_cscope_add_callback (scope, paste_button_clicked); "copy_button_clicked", G_CALLBACK (copy_button_clicked),
gtk_builder_cscope_add_callback (scope, source_changed_cb); "paste_button_clicked", G_CALLBACK (paste_button_clicked),
gtk_builder_cscope_add_callback (scope, text_changed_cb); "source_changed_cb", G_CALLBACK (source_changed_cb),
gtk_builder_cscope_add_callback (scope, open_file_cb); "text_changed_cb", G_CALLBACK (text_changed_cb),
gtk_builder_cscope_add_callback (scope, on_drop); "open_file_cb", G_CALLBACK (open_file_cb),
gtk_builder_cscope_add_callback (scope, drag_prepare); "on_drop", G_CALLBACK (on_drop),
"drag_prepare", G_CALLBACK (drag_prepare),
NULL);
builder = gtk_builder_new (); builder = gtk_builder_new ();
gtk_builder_set_scope (builder, scope); gtk_builder_set_scope (builder, scope);
gtk_builder_add_from_resource (builder, "/clipboard/clipboard.ui", NULL); gtk_builder_add_from_resource (builder, "/clipboard/clipboard.ui", NULL);

View File

@@ -11,8 +11,6 @@
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
enum enum
{ {
ICON_NAME_COL, ICON_NAME_COL,

View File

@@ -1,16 +1,20 @@
/* Theming/CSS Accordion /* Theming/CSS Accordion
* *
* A simple accordion demo written using CSS transitions and multiple backgrounds * A simple accordion demo written using CSS transitions and multiple backgrounds
*
*/ */
#include <gtk/gtk.h> #include <gtk/gtk.h>
static void static void
destroy_provider (GtkWidget *window, apply_css (GtkWidget *widget, GtkStyleProvider *provider)
GtkStyleProvider *provider)
{ {
gtk_style_context_remove_provider_for_display (gtk_widget_get_display (window), provider); GtkWidget *child;
gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
for (child = gtk_widget_get_first_child (widget);
child != NULL;
child = gtk_widget_get_next_sibling (child))
apply_css (child, provider);
} }
GtkWidget * GtkWidget *
@@ -20,8 +24,8 @@ do_css_accordion (GtkWidget *do_widget)
if (!window) if (!window)
{ {
GtkWidget *container, *styled_box, *child; GtkWidget *container, *child;
GtkCssProvider *provider; GtkStyleProvider *provider;
window = gtk_window_new (); window = gtk_window_new ();
gtk_window_set_title (GTK_WINDOW (window), "CSS Accordion"); gtk_window_set_title (GTK_WINDOW (window), "CSS Accordion");
@@ -29,13 +33,10 @@ do_css_accordion (GtkWidget *do_widget)
gtk_window_set_default_size (GTK_WINDOW (window), 600, 300); gtk_window_set_default_size (GTK_WINDOW (window), 600, 300);
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window); g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
styled_box = gtk_frame_new (NULL);
gtk_window_set_child (GTK_WINDOW (window), styled_box);
gtk_widget_add_css_class (styled_box, "accordion");
container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_set_halign (container, GTK_ALIGN_CENTER); gtk_widget_set_halign (container, GTK_ALIGN_CENTER);
gtk_widget_set_valign (container, GTK_ALIGN_CENTER); gtk_widget_set_valign (container, GTK_ALIGN_CENTER);
gtk_frame_set_child (GTK_FRAME (styled_box), container); gtk_window_set_child (GTK_WINDOW (window), container);
child = gtk_button_new_with_label ("This"); child = gtk_button_new_with_label ("This");
gtk_box_append (GTK_BOX (container), child); gtk_box_append (GTK_BOX (container), child);
@@ -55,16 +56,10 @@ do_css_accordion (GtkWidget *do_widget)
child = gtk_button_new_with_label (":-)"); child = gtk_button_new_with_label (":-)");
gtk_box_append (GTK_BOX (container), child); gtk_box_append (GTK_BOX (container), child);
provider = gtk_css_provider_new (); provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
gtk_css_provider_load_from_resource (provider, "/css_accordion/css_accordion.css"); gtk_css_provider_load_from_resource (GTK_CSS_PROVIDER (provider), "/css_accordion/css_accordion.css");
gtk_style_context_add_provider_for_display (gtk_widget_get_display (window), apply_css (window, provider);
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_signal_connect (window, "destroy",
G_CALLBACK (destroy_provider), provider);
g_object_unref (provider);
} }
if (!gtk_widget_get_visible (window)) if (!gtk_widget_get_visible (window))

View File

@@ -1,13 +1,13 @@
.accordion, .accordion * { @import url("resource://css_accordion/reset.css");
all: unset;
* {
transition-property: color, background-color, border-color, background-image, padding, border-width; transition-property: color, background-color, border-color, background-image, padding, border-width;
transition-duration: 1s; transition-duration: 1s;
font: 20px Cantarell; font: 20px Cantarell;
} }
.accordion { window {
background: linear-gradient(153deg, #151515, #151515 5px, transparent 5px) 0 0, background: linear-gradient(153deg, #151515, #151515 5px, transparent 5px) 0 0,
linear-gradient(333deg, #151515, #151515 5px, transparent 5px) 10px 5px, linear-gradient(333deg, #151515, #151515 5px, transparent 5px) 10px 5px,
linear-gradient(153deg, #222, #222 5px, transparent 5px) 0 5px, linear-gradient(153deg, #222, #222 5px, transparent 5px) 0 5px,
@@ -18,7 +18,7 @@
background-size: 20px 20px; background-size: 20px 20px;
} }
.accordion button { button {
color: black; color: black;
background-color: #bbb; background-color: #bbb;
border-style: solid; border-style: solid;
@@ -28,25 +28,25 @@
padding: 12px 4px; padding: 12px 4px;
} }
.accordion button:first-child { button:first-child {
border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px;
} }
.accordion button:last-child { button:last-child {
border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0;
border-width: 2px; border-width: 2px;
} }
.accordion button:hover { button:hover {
padding: 12px 48px; padding: 12px 48px;
background-color: #4870bc; background-color: #4870bc;
} }
.accordion button *:hover { button *:hover {
color: white; color: white;
} }
.accordion button:hover:active, button:hover:active,
.accordion button:active { button:active {
background-color: #993401; background-color: #993401;
} }

View File

@@ -6,8 +6,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void static void
show_parsing_error (GtkCssProvider *provider, show_parsing_error (GtkCssProvider *provider,
GtkCssSection *section, GtkCssSection *section,

View File

@@ -6,8 +6,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void static void
show_parsing_error (GtkCssProvider *provider, show_parsing_error (GtkCssProvider *provider,
GtkCssSection *section, GtkCssSection *section,

View File

@@ -7,8 +7,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void static void
show_parsing_error (GtkCssProvider *provider, show_parsing_error (GtkCssProvider *provider,
GtkCssSection *section, GtkCssSection *section,

View File

@@ -5,8 +5,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void static void
show_parsing_error (GtkCssProvider *provider, show_parsing_error (GtkCssProvider *provider,
GtkCssSection *section, GtkCssSection *section,

View File

@@ -24,7 +24,6 @@ do_cursors (GtkWidget *do_widget)
builder = gtk_builder_new_from_resource ("/cursors/cursors.ui"); builder = gtk_builder_new_from_resource ("/cursors/cursors.ui");
window = GTK_WIDGET (gtk_builder_get_object (builder, "window")); window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
gtk_window_set_display (GTK_WINDOW (window), gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget)); gtk_widget_get_display (do_widget));
g_signal_connect (window, "destroy", g_signal_connect (window, "destroy",
@@ -35,7 +34,9 @@ do_cursors (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window)) if (!gtk_widget_get_visible (window))
gtk_widget_show (window); gtk_widget_show (window);
else else
{
gtk_window_destroy (GTK_WINDOW (window)); gtk_window_destroy (GTK_WINDOW (window));
}
return window; return window;
} }

View File

@@ -24,6 +24,7 @@
</gresource> </gresource>
<gresource prefix="/css_accordion"> <gresource prefix="/css_accordion">
<file>css_accordion.css</file> <file>css_accordion.css</file>
<file>reset.css</file>
</gresource> </gresource>
<gresource prefix="/css_basics"> <gresource prefix="/css_basics">
<file>css_basics.css</file> <file>css_basics.css</file>
@@ -328,7 +329,6 @@
<file>pickers.c</file> <file>pickers.c</file>
<file>printing.c</file> <file>printing.c</file>
<file>revealer.c</file> <file>revealer.c</file>
<file>read_more.c</file>
<file>rotated_text.c</file> <file>rotated_text.c</file>
<file>scale.c</file> <file>scale.c</file>
<file>search_entry.c</file> <file>search_entry.c</file>
@@ -375,7 +375,7 @@
<file>glarea-gles.vs.glsl</file> <file>glarea-gles.vs.glsl</file>
</gresource> </gresource>
<gresource prefix="/font_features"> <gresource prefix="/font_features">
<file>font_features.ui</file> <file>font-features.ui</file>
<file>fontplane.c</file> <file>fontplane.c</file>
</gresource> </gresource>
<gresource prefix="/spinbutton"> <gresource prefix="/spinbutton">
@@ -427,8 +427,6 @@
<file>icons/16x16/emotes/face-laugh-symbolic.symbolic.png</file> <file>icons/16x16/emotes/face-laugh-symbolic.symbolic.png</file>
<file>icons/16x16/status/battery-caution-charging-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/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>
<gresource prefix="/org/gtk/Demo4/gtk"> <gresource prefix="/org/gtk/Demo4/gtk">
<file preprocess="xml-stripblanks">help-overlay.ui</file> <file preprocess="xml-stripblanks">help-overlay.ui</file>

View File

@@ -37,8 +37,7 @@ demo3_widget_dispose (GObject *object)
Demo3Widget *self = DEMO3_WIDGET (object); Demo3Widget *self = DEMO3_WIDGET (object);
g_clear_object (&self->paintable); g_clear_object (&self->paintable);
g_clear_pointer (&self->menu, gtk_widget_unparent);
gtk_widget_dispose_template (GTK_WIDGET (self), DEMO3_TYPE_WIDGET);
G_OBJECT_CLASS (demo3_widget_parent_class)->dispose (object); G_OBJECT_CLASS (demo3_widget_parent_class)->dispose (object);
} }

View File

@@ -11,7 +11,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
G_DECLARE_FINAL_TYPE (CanvasItem, canvas_item, CANVAS, ITEM, GtkWidget) G_DECLARE_FINAL_TYPE (CanvasItem, canvas_item, CANVAS, ITEM, GtkWidget)
struct _CanvasItem { struct _CanvasItem {
@@ -25,9 +24,6 @@ struct _CanvasItem {
double delta; double delta;
GtkWidget *editor; GtkWidget *editor;
GtkStyleProvider *provider;
char *css_class;
}; };
struct _CanvasItemClass { struct _CanvasItemClass {
@@ -38,41 +34,32 @@ G_DEFINE_TYPE (CanvasItem, canvas_item, GTK_TYPE_WIDGET)
static int n_items = 0; static int n_items = 0;
static void
unstyle_item (CanvasItem *item)
{
if (item->provider)
{
gtk_style_context_remove_provider_for_display (gtk_widget_get_display (item->label), item->provider);
g_clear_object (&item->provider);
}
if (item->css_class)
{
gtk_widget_remove_css_class (item->label, item->css_class);
g_clear_pointer (&item->css_class, g_free);
}
}
static void static void
set_color (CanvasItem *item, set_color (CanvasItem *item,
GdkRGBA *color) GdkRGBA *color)
{ {
char *css; char *css;
char *str; char *str;
GtkStyleContext *context;
GtkCssProvider *provider; GtkCssProvider *provider;
const char *name; const char *old_class;
unstyle_item (item);
str = gdk_rgba_to_string (color); str = gdk_rgba_to_string (color);
name = gtk_widget_get_name (item->label); css = g_strdup_printf ("* { background: %s; }", str);
css = g_strdup_printf ("#%s { background: %s; }", name, str);
context = gtk_widget_get_style_context (item->label);
provider = g_object_get_data (G_OBJECT (context), "style-provider");
if (provider)
gtk_style_context_remove_provider (context, GTK_STYLE_PROVIDER (provider));
old_class = (const char *)g_object_get_data (G_OBJECT (item->label), "css-class");
if (old_class)
gtk_widget_remove_css_class (item->label, old_class);
provider = gtk_css_provider_new (); provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, css, -1); gtk_css_provider_load_from_data (provider, css, -1);
gtk_style_context_add_provider_for_display (gtk_widget_get_display (item->label), GTK_STYLE_PROVIDER (provider), 700); gtk_style_context_add_provider (gtk_widget_get_style_context (item->label), GTK_STYLE_PROVIDER (provider), 800);
item->provider = GTK_STYLE_PROVIDER (provider); g_object_set_data_full (G_OBJECT (context), "style-provider", provider, g_object_unref);
g_free (str); g_free (str);
g_free (css); g_free (css);
@@ -82,10 +69,21 @@ static void
set_css (CanvasItem *item, set_css (CanvasItem *item,
const char *class) const char *class)
{ {
unstyle_item (item); GtkStyleContext *context;
GtkCssProvider *provider;
const char *old_class;
context = gtk_widget_get_style_context (item->label);
provider = g_object_get_data (G_OBJECT (context), "style-provider");
if (provider)
gtk_style_context_remove_provider (context, GTK_STYLE_PROVIDER (provider));
old_class = (const char *)g_object_get_data (G_OBJECT (item->label), "css-class");
if (old_class)
gtk_widget_remove_css_class (item->label, old_class);
g_object_set_data_full (G_OBJECT (item->label), "css-class", g_strdup (class), g_free);
gtk_widget_add_css_class (item->label, class); gtk_widget_add_css_class (item->label, class);
item->css_class = g_strdup (class);
} }
static gboolean static gboolean
@@ -724,7 +722,6 @@ do_dnd (GtkWidget *do_widget)
int i; int i;
int x, y; int x, y;
GtkCssProvider *provider; GtkCssProvider *provider;
GString *css;
button = gtk_color_button_new (); button = gtk_color_button_new ();
g_object_unref (g_object_ref_sink (button)); g_object_unref (g_object_ref_sink (button));
@@ -736,18 +733,6 @@ do_dnd (GtkWidget *do_widget)
800); 800);
g_object_unref (provider); g_object_unref (provider);
css = g_string_new ("");
for (i = 0; colors[i]; i++)
g_string_append_printf (css, ".canvasitem.%s { background: %s; }\n", colors[i], colors[i]);
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, css->str, css->len);
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (provider),
800);
g_object_unref (provider);
g_string_free (css, TRUE);
window = gtk_window_new (); window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window), gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget)); gtk_widget_get_display (do_widget));

View File

@@ -14,8 +14,6 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
typedef struct typedef struct
{ {
int number; int number;

View File

@@ -8,8 +8,6 @@
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* Creates a tree model containing the completions */ /* Creates a tree model containing the completions */
static GtkTreeModel * static GtkTreeModel *
create_completion_model (void) create_completion_model (void)

View File

@@ -90,9 +90,12 @@ do_errorstates (GtkWidget *do_widget)
toplevel = GTK_WIDGET (gtk_widget_get_root (do_widget)); toplevel = GTK_WIDGET (gtk_widget_get_root (do_widget));
scope = gtk_builder_cscope_new (); scope = gtk_builder_cscope_new ();
gtk_builder_cscope_add_callback (scope, validate_more_details); gtk_builder_cscope_add_callback_symbols (GTK_BUILDER_CSCOPE (scope),
gtk_builder_cscope_add_callback (scope, mode_switch_state_set); "validate_more_details", G_CALLBACK (validate_more_details),
gtk_builder_cscope_add_callback (scope, level_scale_value_changed); "mode_switch_state_set", G_CALLBACK (mode_switch_state_set),
"level_scale_value_changed", G_CALLBACK (level_scale_value_changed),
NULL);
builder = gtk_builder_new (); builder = gtk_builder_new ();
gtk_builder_set_scope (builder, scope); gtk_builder_set_scope (builder, scope);
gtk_builder_expose_object (builder, "toplevel", G_OBJECT (toplevel)); gtk_builder_expose_object (builder, "toplevel", G_OBJECT (toplevel));

View File

@@ -9,8 +9,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <stdlib.h> #include <stdlib.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
enum { enum {
WIDTH_COLUMN, WIDTH_COLUMN,
HEIGHT_COLUMN, HEIGHT_COLUMN,

View File

@@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow" id="window">
<property name="default-width">600</property>
<property name="default-height">500</property>
<property name="title">Font Explorer</property>
<child type="titlebar">
<object class="GtkHeaderBar">
<child>
<object class="GtkButton" id="reset">
<property name="receives-default">1</property>
<property name="tooltip-text">Reset</property>
<property name="icon-name">view-refresh-symbolic</property>
<signal name="clicked" handler="font_features_reset_features" swapped="no"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<child>
<object class="GtkScrolledWindow">
<property name="hscrollbar-policy">never</property>
<child>
<object class="GtkViewport">
<child>
<object class="GtkBox">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkFontButton" id="font">
<property name="receives-default">1</property>
<property name="font">Sans 12</property>
<property name="level">family|style|size|variations|features</property>
<signal name="font-set" handler="font_features_font_changed" swapped="no"/>
</object>
</child>
<child>
<object class="GtkExpander">
<child type="label">
<object class="GtkLabel">
<property name="xalign">0</property>
<property name="label" translatable="yes">Font Features</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
</object>
</child>
<child>
<object class="GtkBox" id="feature_list">
<property name="orientation">vertical</property>
<child>
<object class="GtkComboBox" id="script_lang">
<property name="margin-top">10</property>
<signal name="changed" handler="font_features_script_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkExpander">
<child type="label">
<object class="GtkLabel" id="variations_heading">
<property name="label" translatable="yes">Font Variations</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
</object>
</child>
<child>
<object class="GtkGrid" id="variations_grid">
<property name="column-spacing">10</property>
<property name="row-spacing">10</property>
</object>
</child>
</object>
</child>
</object>
</child>
<style>
<class name="view"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="margin-start">20</property>
<property name="margin-end">20</property>
<property name="margin-top">20</property>
<property name="margin-bottom">20</property>
<property name="spacing">20</property>
<child>
<object class="GtkStack" id="stack">
<child>
<object class="GtkStackPage">
<property name="name">label</property>
<property name="child">
<object class="GtkLabel" id="label">
<property name="wrap">1</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="valign">start</property>
<property name="selectable">1</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">entry</property>
<property name="child">
<object class="GtkEntry" id="entry">
<property name="text">Grumpy wizards make toxic brew for the evil Queen and Jack. A quick movement of the enemy will jeopardize six gunboats. The job of waxing linoleum frequently peeves chintzy kids. My girl wove six dozen plaid jackets before she quit. Twelve ziggurats quickly jumped a finch box.
Разъяренный чтец эгоистично бьёт пятью жердями шустрого фехтовальщика. Наш банк вчера же выплатил Ф.Я. Эйхгольду комиссию за ценные вещи. Эх, чужак, общий съём цен шляп (юфть) вдрызг! В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!
Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός</property>
<signal name="activate" handler="font_features_stop_edit"/>
<property name="valign">start</property>
<property name="width-chars">50</property>
</object>
</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkLabel" id="settings">
<property name="wrap">1</property>
<property name="xalign">0</property>
<property name="valign">end</property>
<property name="width-chars">50</property>
<property name="max-width-chars">50</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<style>
<class name="monospace"/>
</style>
</object>
</child>
<child>
<object class="GtkBox">
<property name="spacing">10</property>
<child>
<object class="GtkLabel" id="description">
<property name="wrap">1</property>
<property name="xalign">0</property>
<property name="valign">end</property>
<property name="width-chars">50</property>
<property name="max-width-chars">50</property>
<property name="hexpand">1</property>
<style>
<class name="monospace"/>
</style>
</object>
</child>
<child>
<object class="GtkToggleButton" id="edit_toggle">
<property name="icon-name">document-edit-symbolic</property>
<property name="halign">end</property>
<property name="valign">end</property>
<signal name="toggled" handler="font_features_toggle_edit"/>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>

File diff suppressed because it is too large Load Diff

View File

@@ -1,448 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkAdjustment" id="size_adjustment">
<property name="lower">7</property>
<property name="upper">100</property>
<property name="value">14</property>
<property name="step_increment">0.5</property>
<property name="page_increment">10</property>
<signal name="value-changed" handler="basic_value_changed" object="size_entry" swapped="false"/>
</object>
<object class="GtkAdjustment" id="letterspacing_adjustment">
<property name="lower">-1024</property>
<property name="upper">8192</property>
<property name="value">0</property>
<property name="step_increment">1</property>
<property name="page_increment">512</property>
<signal name="value-changed" handler="basic_value_changed" object="letterspacing_entry" swapped="false"/>
</object>
<object class="GtkAdjustment" id="line_height_adjustment">
<property name="lower">0.75</property>
<property name="upper">2.5</property>
<property name="value">1.0</property>
<property name="step_increment">0.1</property>
<property name="page_increment">1</property>
<signal name="value-changed" handler="basic_value_changed" object="line_height_entry" swapped="false"/>
</object>
<object class="GtkWindow" id="window">
<property name="default-width">600</property>
<property name="default-height">500</property>
<property name="title">Font Explorer</property>
<child type="titlebar">
<object class="GtkHeaderBar">
<child>
<object class="GtkButton" id="reset">
<property name="receives-default">1</property>
<property name="tooltip-text">Reset</property>
<property name="icon-name">view-refresh-symbolic</property>
<signal name="clicked" handler="font_features_reset_basic" swapped="no"/>
<signal name="clicked" handler="font_features_reset_features" swapped="no"/>
<signal name="clicked" handler="font_features_reset_variations" swapped="no"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<child>
<object class="GtkScrolledWindow">
<property name="hscrollbar-policy">never</property>
<child>
<object class="GtkViewport">
<child>
<object class="GtkBox">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkFontButton" id="font">
<property name="receives-default">1</property>
<property name="font">Sans 12</property>
<property name="level">family|style</property>
<signal name="font-set" handler="font_features_font_changed" swapped="no"/>
</object>
</child>
<child>
<object class="GtkGrid">
<property name="column-spacing">10</property>
<property name="row-spacing">10</property>
<child>
<object class="GtkLabel">
<property name="label">Size</property>
<property name="xalign">0</property>
<property name="valign">baseline</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkScale" id="size_scale">
<property name="hexpand">1</property>
<property name="width-request">100</property>
<property name="valign">baseline</property>
<property name="adjustment">size_adjustment</property>
<layout>
<property name="column">1</property>
<property name="row">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkEntry" id="size_entry">
<property name="width-chars">4</property>
<property name="max-width-chars">4</property>
<property name="hexpand">0</property>
<property name="valign">baseline</property>
<signal name="activate" handler="basic_entry_activated"
object="size_adjustment" swapped="false"/>
<layout>
<property name="column">2</property>
<property name="row">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Letterspacing</property>
<property name="xalign">0</property>
<property name="valign">baseline</property>
<layout>
<property name="column">0</property>
<property name="row">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkScale">
<property name="hexpand">1</property>
<property name="width-request">100</property>
<property name="valign">baseline</property>
<property name="adjustment">letterspacing_adjustment</property>
<layout>
<property name="column">1</property>
<property name="row">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkEntry" id="letterspacing_entry">
<property name="width-chars">4</property>
<property name="max-width-chars">4</property>
<property name="hexpand">0</property>
<property name="valign">baseline</property>
<signal name="activate" handler="basic_entry_activated"
object="letterspacing_adjustment" swapped="false"/>
<layout>
<property name="column">2</property>
<property name="row">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Line Height</property>
<property name="xalign">0</property>
<property name="valign">baseline</property>
<layout>
<property name="column">0</property>
<property name="row">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkScale">
<property name="hexpand">1</property>
<property name="width-request">100</property>
<property name="valign">baseline</property>
<property name="adjustment">line_height_adjustment</property>
<layout>
<property name="column">1</property>
<property name="row">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkEntry" id="line_height_entry">
<property name="width-chars">4</property>
<property name="max-width-chars">4</property>
<property name="hexpand">0</property>
<property name="valign">baseline</property>
<signal name="activate" handler="basic_entry_activated"
object="line_height_adjustment" swapped="false"/>
<layout>
<property name="column">2</property>
<property name="row">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Foreground</property>
<property name="xalign">0</property>
<property name="valign">baseline</property>
<layout>
<property name="column">0</property>
<property name="row">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkColorButton" id="foreground">
<property name="valign">baseline</property>
<property name="rgba">black</property>
<signal name="notify::rgba" handler="color_set_cb"/>
<layout>
<property name="column">1</property>
<property name="row">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Background</property>
<property name="xalign">0</property>
<property name="valign">baseline</property>
<layout>
<property name="column">0</property>
<property name="row">4</property>
</layout>
</object>
</child>
<child>
<object class="GtkColorButton" id="background">
<property name="valign">baseline</property>
<property name="rgba">white</property>
<signal name="notify::rgba" handler="color_set_cb"/>
<layout>
<property name="column">1</property>
<property name="row">4</property>
</layout>
</object>
</child>
<child>
<object class="GtkButton">
<property name="icon-name">object-flip-vertical-symbolic</property>
<property name="halign">start</property>
<property name="valign">center</property>
<style>
<class name="circular"/>
</style>
<signal name="clicked" handler="swap_colors"/>
<layout>
<property name="column">2</property>
<property name="row">3</property>
<property name="row-span">2</property>
</layout>
</object>
</child>
</object>
</child>
<child>
<object class="GtkExpander">
<child type="label">
<object class="GtkLabel">
<property name="xalign">0</property>
<property name="label" translatable="yes">OpenType Features</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<style>
<class name="title-4"/>
</style>
</object>
</child>
<child>
<object class="GtkBox" id="feature_list">
<property name="orientation">vertical</property>
<child>
<object class="GtkDropDown" id="script_lang">
<property name="tooltip-text" translatable="yes">Language System</property>
<property name="margin-top">10</property>
<signal name="notify::selected" handler="font_features_script_changed" swapped="no"/>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkExpander">
<child type="label">
<object class="GtkLabel" id="variations_heading">
<property name="label" translatable="yes">Variation Axes</property>
<property name="xalign">0</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<style>
<class name="title-4"/>
</style>
</object>
</child>
<child>
<object class="GtkGrid" id="variations_grid">
<property name="column-spacing">10</property>
<property name="row-spacing">10</property>
</object>
</child>
</object>
</child>
</object>
</child>
<style>
<class name="view"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="margin-start">20</property>
<property name="margin-end">20</property>
<property name="margin-top">20</property>
<property name="margin-bottom">20</property>
<property name="spacing">20</property>
<child>
<object class="GtkScrolledWindow" id="swin">
<property name="hscrollbar-policy">automatic</property>
<property name="vscrollbar-policy">automatic</property>
<property name="propagate-natural-height">1</property>
<property name="vexpand">1</property>
<style>
<class name="font_features_background"/>
</style>
<child>
<object class="GtkStack" id="stack">
<child>
<object class="GtkStackPage">
<property name="name">label</property>
<property name="child">
<object class="GtkLabel" id="label">
<property name="wrap">1</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="valign">start</property>
<property name="selectable">1</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">entry</property>
<property name="child">
<object class="GtkTextView" id="entry">
<property name="buffer">
<object class="GtkTextBuffer">
<property name="text">Grumpy wizards make toxic brew for the evil Queen and Jack. A quick movement of the enemy will jeopardize six gunboats. The job of waxing linoleum frequently peeves chintzy kids. My girl wove six dozen plaid jackets before she quit. Twelve ziggurats quickly jumped a finch box.
Разъяренный чтец эгоистично бьёт пятью жердями шустрого фехтовальщика. Наш банк вчера же выплатил Ф.Я. Эйхгольду комиссию за ценные вещи. Эх, чужак, общий съём цен шляп (юфть) вдрызг! В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!
Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός</property>
</object>
</property>
<property name="valign">fill</property>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="spacing">10</property>
<child>
<object class="GtkLabel" id="settings">
<property name="wrap">1</property>
<property name="xalign">0</property>
<property name="valign">end</property>
<property name="width-chars">50</property>
<property name="max-width-chars">50</property>
<property name="hexpand">1</property>
<style>
<class name="monospace"/>
</style>
</object>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Alphabet</property>
<signal name="clicked" handler="set_text_alphabet"/>
</object>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Paragraph</property>
<signal name="clicked" handler="set_text_paragraph"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="spacing">10</property>
<child>
<object class="GtkLabel" id="description">
<property name="wrap">1</property>
<property name="wrap-mode">char</property>
<property name="xalign">0</property>
<property name="valign">end</property>
<property name="width-chars">50</property>
<property name="max-width-chars">50</property>
<property name="hexpand">1</property>
<style>
<class name="monospace"/>
</style>
</object>
</child>
<child>
<object class="GtkBox">
<style>
<class name="linked"/>
</style>
<property name="valign">end</property>
<child>
<object class="GtkToggleButton" id="plain_toggle">
<property name="label" translatable="yes">Plain</property>
<property name="active">1</property>
<property name="valign">baseline</property>
<signal name="toggled" handler="font_features_toggle_plain"/>
</object>
</child>
<child>
<object class="GtkToggleButton" id="waterfall_toggle">
<property name="label" translatable="yes">Waterfall</property>
<property name="valign">baseline</property>
<property name="group">plain_toggle</property>
<signal name="toggled" handler="font_features_toggle_plain"/>
<signal name="notify::active" handler="font_features_notify_waterfall"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkToggleButton" id="edit_toggle">
<property name="group">waterfall_toggle</property>
<property name="icon-name">document-edit-symbolic</property>
<property name="halign">end</property>
<property name="valign">end</property>
<signal name="clicked" handler="font_features_toggle_edit"/>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@@ -43,6 +43,7 @@ update_image (void)
cairo_t *cr; cairo_t *cr;
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
GdkPixbuf *pixbuf2; GdkPixbuf *pixbuf2;
const char *hint;
cairo_font_options_t *fopt; cairo_font_options_t *fopt;
cairo_hint_style_t hintstyle; cairo_hint_style_t hintstyle;
cairo_hint_metrics_t hintmetrics; cairo_hint_metrics_t hintmetrics;
@@ -57,23 +58,18 @@ update_image (void)
fopt = cairo_font_options_copy (pango_cairo_context_get_font_options (context)); fopt = cairo_font_options_copy (pango_cairo_context_get_font_options (context));
switch (gtk_drop_down_get_selected (GTK_DROP_DOWN (hinting))) hint = gtk_combo_box_get_active_id (GTK_COMBO_BOX (hinting));
{
case 0:
hintstyle = CAIRO_HINT_STYLE_NONE;
break;
case 1:
hintstyle = CAIRO_HINT_STYLE_SLIGHT;
break;
case 2:
hintstyle = CAIRO_HINT_STYLE_MEDIUM;
break;
case 3:
hintstyle = CAIRO_HINT_STYLE_FULL;
break;
default:
hintstyle = CAIRO_HINT_STYLE_DEFAULT; hintstyle = CAIRO_HINT_STYLE_DEFAULT;
break; if (hint)
{
if (strcmp (hint, "none") == 0)
hintstyle = CAIRO_HINT_STYLE_NONE;
else if (strcmp (hint, "slight") == 0)
hintstyle = CAIRO_HINT_STYLE_SLIGHT;
else if (strcmp (hint, "medium") == 0)
hintstyle = CAIRO_HINT_STYLE_MEDIUM;
else if (strcmp (hint, "full") == 0)
hintstyle = CAIRO_HINT_STYLE_FULL;
} }
cairo_font_options_set_hint_style (fopt, hintstyle); cairo_font_options_set_hint_style (fopt, hintstyle);
@@ -221,39 +217,30 @@ update_image (void)
text = " "; text = " ";
ch = g_utf8_get_char (text); ch = g_utf8_get_char (text);
str = g_string_new ("");
layout = pango_layout_new (context);
retry: str = g_string_new ("");
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
g_string_append_unichar (str, ch); g_string_append_unichar (str, ch);
g_string_append_unichar (str, 0x200c); g_string_append_unichar (str, 0x200c);
} }
layout = pango_layout_new (context);
pango_layout_set_font_description (layout, desc); pango_layout_set_font_description (layout, desc);
pango_layout_set_text (layout, str->str, -1); pango_layout_set_text (layout, str->str, -1);
g_string_free (str, TRUE);
pango_layout_get_extents (layout, &ink, &logical); pango_layout_get_extents (layout, &ink, &logical);
pango_extents_to_pixels (&logical, NULL); 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); surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, logical.width * 3 / 2, 4*logical.height);
cr = cairo_create (surface); cr = cairo_create (surface);
cairo_set_source_rgb (cr, 1, 1, 1); cairo_set_source_rgb (cr, 1, 1, 1);
cairo_paint (cr); cairo_paint (cr);
iter = pango_layout_get_iter (layout);
run = pango_layout_iter_get_run (iter);
cairo_set_source_rgb (cr, 0, 0, 0); cairo_set_source_rgb (cr, 0, 0, 0);
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
@@ -422,7 +409,7 @@ do_fontrendering (GtkWidget *do_widget)
g_signal_connect (down_button, "clicked", G_CALLBACK (scale_down), NULL); g_signal_connect (down_button, "clicked", G_CALLBACK (scale_down), NULL);
g_signal_connect (entry, "notify::text", G_CALLBACK (update_image), NULL); g_signal_connect (entry, "notify::text", G_CALLBACK (update_image), NULL);
g_signal_connect (font_button, "notify::font-desc", G_CALLBACK (update_image), NULL); g_signal_connect (font_button, "notify::font-desc", G_CALLBACK (update_image), NULL);
g_signal_connect (hinting, "notify::selected", G_CALLBACK (update_image), NULL); g_signal_connect (hinting, "notify::active", G_CALLBACK (update_image), NULL);
g_signal_connect (anti_alias, "notify::active", G_CALLBACK (update_image), NULL); g_signal_connect (anti_alias, "notify::active", G_CALLBACK (update_image), NULL);
g_signal_connect (hint_metrics, "notify::active", G_CALLBACK (update_image), NULL); g_signal_connect (hint_metrics, "notify::active", G_CALLBACK (update_image), NULL);
g_signal_connect (text_radio, "notify::active", G_CALLBACK (update_image), NULL); g_signal_connect (text_radio, "notify::active", G_CALLBACK (update_image), NULL);

View File

@@ -116,19 +116,16 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkDropDown" id="hinting"> <object class="GtkComboBoxText" id="hinting">
<property name="active">0</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="model">
<object class="GtkStringList">
<items> <items>
<item translatable="yes">None</item> <item translatable="yes" id="none">None</item>
<item translatable="yes">Slight</item> <item translatable="yes" id="slight">Slight</item>
<item translatable="yes">Medium</item> <item translatable="yes" id="medium">Medium</item>
<item translatable="yes">Full</item> <item translatable="yes" id="full">Full</item>
</items> </items>
</object> </object>
</property>
</object>
</child> </child>
<layout> <layout>
<property name="column">4</property> <property name="column">4</property>

View File

@@ -144,6 +144,7 @@ make_shader_stack (const char *name,
GtkTextBuffer *buffer; GtkTextBuffer *buffer;
GBytes *bytes; GBytes *bytes;
GtkEventController *controller; GtkEventController *controller;
GtkCssProvider *provider;
GdkPaintable *paintable; GdkPaintable *paintable;
stack = gtk_shader_stack_new (); stack = gtk_shader_stack_new ();
@@ -234,6 +235,12 @@ make_shader_stack (const char *name,
g_signal_connect (buffer, "changed", G_CALLBACK (text_changed), button); g_signal_connect (buffer, "changed", G_CALLBACK (text_changed), button);
g_object_set_data (G_OBJECT (button), "the-stack", stack); g_object_set_data (G_OBJECT (button), "the-stack", stack);
g_signal_connect (button, "clicked", G_CALLBACK (apply_text), buffer); g_signal_connect (button, "clicked", G_CALLBACK (apply_text), buffer);
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, "button.small { padding: 0; }", -1);
gtk_style_context_add_provider (gtk_widget_get_style_context (button),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref (provider);
gtk_widget_set_halign (button, GTK_ALIGN_CENTER); gtk_widget_set_halign (button, GTK_ALIGN_CENTER);
gtk_widget_set_valign (button, GTK_ALIGN_CENTER); gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_widget_add_css_class (button, "small"); gtk_widget_add_css_class (button, "small");
@@ -267,21 +274,11 @@ make_shader_stack (const char *name,
return vbox; return vbox;
} }
static void
remove_provider (gpointer data)
{
GtkStyleProvider *provider = GTK_STYLE_PROVIDER (data);
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
g_object_unref (provider);
}
static GtkWidget * static GtkWidget *
create_gltransition_window (GtkWidget *do_widget) create_gltransition_window (GtkWidget *do_widget)
{ {
GtkWidget *window, *headerbar, *scale, *outer_grid, *grid, *background; GtkWidget *window, *headerbar, *scale, *outer_grid, *grid, *background;
GdkPaintable *paintable; GdkPaintable *paintable;
GtkCssProvider *provider;
window = gtk_window_new (); window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget)); gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
@@ -336,14 +333,6 @@ create_gltransition_window (GtkWidget *do_widget)
make_shader_stack ("Kaleidoscope", "/gltransition/kaleidoscope.glsl", 3, scale), make_shader_stack ("Kaleidoscope", "/gltransition/kaleidoscope.glsl", 3, scale),
1, 1, 1, 1); 1, 1, 1, 1);
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, "button.small { padding: 0; }", -1);
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_set_data_full (G_OBJECT (window), "provider", provider, remove_provider);
return window; return window;
} }

View File

@@ -223,7 +223,6 @@ static void
destroy_gear (struct gear *g) destroy_gear (struct gear *g)
{ {
g_free (g->strips); g_free (g->strips);
g_free (g->vertices);
g_free (g); g_free (g);
} }

View File

@@ -23,7 +23,7 @@ do_headerbar (GtkWidget *do_widget)
{ {
window = gtk_window_new (); window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget)); gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Welcome to the Hotel California"); gtk_window_set_title (GTK_WINDOW (window), "Welcome to Facebook - Log in, sign up or learn more");
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window); g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400); gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
@@ -31,7 +31,6 @@ do_headerbar (GtkWidget *do_widget)
header = gtk_header_bar_new (); header = gtk_header_bar_new ();
button = gtk_button_new_from_icon_name ("mail-send-receive-symbolic"); button = gtk_button_new_from_icon_name ("mail-send-receive-symbolic");
gtk_widget_set_tooltip_text (button, "Check out");
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button); gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);

View File

@@ -100,7 +100,7 @@ show_page (GtkTextView *text_view,
theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (text_view))); theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (text_view)));
icon = gtk_icon_theme_lookup_icon (theme, icon = gtk_icon_theme_lookup_icon (theme,
"view-conceal-symbolic", "eye-not-looking-symbolic",
NULL, NULL,
16, 16,
1, 1,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -9,8 +9,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <string.h> #include <string.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static GtkWidget *window = NULL; static GtkWidget *window = NULL;
#define FOLDER_NAME "/iconview/gnome-fs-directory.png" #define FOLDER_NAME "/iconview/gnome-fs-directory.png"

View File

@@ -8,8 +8,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <string.h> #include <string.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
enum enum
{ {
COL_TEXT, COL_TEXT,

View File

@@ -18,81 +18,15 @@
#include "language-names.h" #include "language-names.h"
#ifdef G_OS_WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#else
#ifndef ISO_CODES_PREFIX #ifndef ISO_CODES_PREFIX
#define ISO_CODES_PREFIX "/usr" #define ISO_CODES_PREFIX "/usr"
#endif #endif
#define ISO_CODES_DATADIR ISO_CODES_PREFIX "/share/xml/iso-codes" #define ISO_CODES_DATADIR ISO_CODES_PREFIX "/share/xml/iso-codes"
#define ISO_CODES_LOCALESDIR ISO_CODES_PREFIX "/share/locale" #define ISO_CODES_LOCALESDIR ISO_CODES_PREFIX "/share/locale"
#endif
static GHashTable *language_map; static GHashTable *language_map;
#ifdef G_OS_WIN32
/* if we are using native Windows use native Windows API for language names */
static BOOL CALLBACK
get_win32_all_locales_scripts (LPWSTR locale_w, DWORD flags, LPARAM param)
{
wchar_t *langname_w = NULL;
wchar_t locale_abbrev_w[9];
gchar *langname, *locale_abbrev, *locale, *p;
gint i;
const LCTYPE iso639_lctypes[] = { LOCALE_SISO639LANGNAME, LOCALE_SISO639LANGNAME2 };
GHashTable *ht_scripts_langs = (GHashTable *) param;
PangoLanguage *lang;
gint langname_size, locale_abbrev_size;
langname_size = GetLocaleInfoEx (locale_w, LOCALE_SLOCALIZEDDISPLAYNAME, langname_w, 0);
if (langname_size == 0)
return FALSE;
langname_w = g_new0 (wchar_t, langname_size);
if (langname_size == 0)
return FALSE;
GetLocaleInfoEx (locale_w, LOCALE_SLOCALIZEDDISPLAYNAME, langname_w, langname_size);
langname = g_utf16_to_utf8 (langname_w, -1, NULL, NULL, NULL);
locale = g_utf16_to_utf8 (locale_w, -1, NULL, NULL, NULL);
p = strchr (locale, '-');
lang = pango_language_from_string (locale);
if (g_hash_table_lookup (ht_scripts_langs, lang) == NULL)
g_hash_table_insert (ht_scripts_langs, lang, langname);
/*
* Track 3+-letter ISO639-2/3 language codes as well (these have a max length of 9 including terminating NUL)
* ISO639-2: iso639_lctypes[0] = LOCALE_SISO639LANGNAME
* ISO639-3: iso639_lctypes[1] = LOCALE_SISO639LANGNAME2
*/
for (i = 0; i < 2; i++)
{
locale_abbrev_size = GetLocaleInfoEx (locale_w, iso639_lctypes[i], locale_abbrev_w, 0);
if (locale_abbrev_size > 0)
{
GetLocaleInfoEx (locale_w, iso639_lctypes[i], locale_abbrev_w, locale_abbrev_size);
locale_abbrev = g_utf16_to_utf8 (locale_abbrev_w, -1, NULL, NULL, NULL);
lang = pango_language_from_string (locale_abbrev);
if (g_hash_table_lookup (ht_scripts_langs, lang) == NULL)
g_hash_table_insert (ht_scripts_langs, lang, langname);
g_free (locale_abbrev);
}
}
g_free (locale);
g_free (langname_w);
return TRUE;
}
#else /* non-Windows */
static char * static char *
get_first_item_in_semicolon_list (const char *list) get_first_item_in_semicolon_list (const char *list)
{ {
@@ -276,7 +210,6 @@ languages_variant_init (const char *variant)
g_free (filename); g_free (filename);
g_free (buf); g_free (buf);
} }
#endif
static void static void
languages_init (void) languages_init (void)
@@ -285,13 +218,8 @@ languages_init (void)
return; return;
language_map = g_hash_table_new_full (NULL, NULL, NULL, g_free); language_map = g_hash_table_new_full (NULL, NULL, NULL, g_free);
#ifdef G_OS_WIN32
g_return_if_fail (EnumSystemLocalesEx (&get_win32_all_locales_scripts, LOCALE_ALL, (LPARAM) language_map, NULL));
#else
languages_variant_init ("iso_639"); languages_variant_init ("iso_639");
languages_variant_init ("iso_639_3"); languages_variant_init ("iso_639_3");
#endif
} }
const char * const char *

View File

@@ -66,9 +66,11 @@ do_links (GtkWidget *do_widget)
"as hyperlinks, which can be clicked " "as hyperlinks, which can be clicked "
"or activated via <a href=\"keynav\">keynav</a> " "or activated via <a href=\"keynav\">keynav</a> "
"and they work fine with other markup, like when " "and they work fine with other markup, like when "
"linking to <a href=\"http://www.flathub.org/\"><b>" "searching on <a href=\"http://www.google.com/\">"
"<span letter_spacing=\"1024\" underline=\"none\" color=\"pink\" background=\"darkslategray\">Flathub</span>" "<span color=\"#0266C8\">G</span><span color=\"#F90101\">o</span>"
"</b></a>."); "<span color=\"#F2B50F\">o</span><span color=\"#0266C8\">g</span>"
"<span color=\"#00933B\">l</span><span color=\"#F90101\">e</span>"
"</a>.");
gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_label_set_max_width_chars (GTK_LABEL (label), 40); gtk_label_set_max_width_chars (GTK_LABEL (label), 40);
gtk_label_set_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);

View File

@@ -7,8 +7,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static GtkWidget *window = NULL; static GtkWidget *window = NULL;
static GtkTreeModel *model = NULL; static GtkTreeModel *model = NULL;
static guint timeout = 0; static guint timeout = 0;

View File

@@ -260,13 +260,6 @@ gtk_message_row_state_flags_changed (GtkWidget *widget,
GTK_WIDGET_CLASS (gtk_message_row_parent_class)->state_flags_changed (widget, previous_state_flags); GTK_WIDGET_CLASS (gtk_message_row_parent_class)->state_flags_changed (widget, previous_state_flags);
} }
static void
gtk_message_row_dispose (GObject *obj)
{
gtk_widget_dispose_template (GTK_WIDGET (obj), GTK_TYPE_MESSAGE_ROW);
G_OBJECT_CLASS (gtk_message_row_parent_class)->dispose (obj);
}
static void static void
gtk_message_row_finalize (GObject *obj) gtk_message_row_finalize (GObject *obj)
{ {
@@ -281,7 +274,6 @@ gtk_message_row_class_init (GtkMessageRowClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = gtk_message_row_dispose;
object_class->finalize = gtk_message_row_finalize; object_class->finalize = gtk_message_row_finalize;
gtk_widget_class_set_template_from_resource (widget_class, "/listbox/listbox.ui"); gtk_widget_class_set_template_from_resource (widget_class, "/listbox/listbox.ui");

View File

@@ -42,7 +42,8 @@ do_listbox_controls (GtkWidget *do_widget)
GtkBuilder *builder; GtkBuilder *builder;
scope = gtk_builder_cscope_new (); scope = gtk_builder_cscope_new ();
gtk_builder_cscope_add_callback (scope, row_activated); gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope),
"row_activated", G_CALLBACK (row_activated));
builder = gtk_builder_new (); builder = gtk_builder_new ();
gtk_builder_set_scope (builder, scope); gtk_builder_set_scope (builder, scope);

View File

@@ -8,7 +8,6 @@
* to implement rather different interaction behavior to a typical list. * to implement rather different interaction behavior to a typical list.
*/ */
#include "config.h"
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
@@ -376,23 +375,6 @@ sweeper_game_init (SweeperGame *self)
sweeper_game_new_game (self, 8, 8, 10); 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 static void
sweeper_game_end (SweeperGame *self, sweeper_game_end (SweeperGame *self,
gboolean win) gboolean win)
@@ -401,9 +383,7 @@ sweeper_game_end (SweeperGame *self,
{ {
self->playing = FALSE; self->playing = FALSE;
g_object_notify_by_pspec (G_OBJECT (self), game_properties[GAME_PROP_PLAYING]); g_object_notify_by_pspec (G_OBJECT (self), game_properties[GAME_PROP_PLAYING]);
celebrate (win);
} }
if (self->win != win) if (self->win != win)
{ {
self->win = win; self->win = win;

View File

@@ -356,10 +356,10 @@ do_listview_settings (GtkWidget *do_widget)
g_type_ensure (SETTINGS_TYPE_KEY); g_type_ensure (SETTINGS_TYPE_KEY);
scope = gtk_builder_cscope_new (); scope = gtk_builder_cscope_new ();
gtk_builder_cscope_add_callback (scope, search_enabled); gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope), "search_enabled", (GCallback)search_enabled);
gtk_builder_cscope_add_callback (scope, search_changed); gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope), "search_changed", (GCallback)search_changed);
gtk_builder_cscope_add_callback (scope, stop_search); gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope), "stop_search", (GCallback)stop_search);
gtk_builder_cscope_add_callback (scope, item_value_changed); gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope), "item_value_changed", (GCallback)item_value_changed);
builder = gtk_builder_new (); builder = gtk_builder_new ();
gtk_builder_set_scope (builder, scope); gtk_builder_set_scope (builder, scope);
@@ -422,10 +422,6 @@ do_listview_settings (GtkWidget *do_widget)
gtk_column_view_column_set_sorter (name_column, sorter); gtk_column_view_column_set_sorter (name_column, sorter);
g_object_unref (sorter); g_object_unref (sorter);
sorter = GTK_SORTER (gtk_string_sorter_new (gtk_property_expression_new (SETTINGS_TYPE_KEY, NULL, "type")));
gtk_column_view_column_set_sorter (type_column, sorter);
g_object_unref (sorter);
g_object_unref (builder); g_object_unref (builder);
} }

View File

@@ -10,6 +10,7 @@
#include "script-names.h" #include "script-names.h"
#include "unicode-names.h" #include "unicode-names.h"
#define UCD_TYPE_ITEM (ucd_item_get_type ()) #define UCD_TYPE_ITEM (ucd_item_get_type ())
G_DECLARE_FINAL_TYPE (UcdItem, ucd_item, UCD, ITEM, GObject) G_DECLARE_FINAL_TYPE (UcdItem, ucd_item, UCD, ITEM, GObject)
@@ -337,15 +338,6 @@ create_ucd_view (GtkWidget *label)
static GtkWidget *window; static GtkWidget *window;
static void
remove_provider (gpointer data)
{
GtkStyleProvider *provider = GTK_STYLE_PROVIDER (data);
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
g_object_unref (provider);
}
GtkWidget * GtkWidget *
do_listview_ucd (GtkWidget *do_widget) do_listview_ucd (GtkWidget *do_widget)
{ {
@@ -368,7 +360,7 @@ do_listview_ucd (GtkWidget *do_widget)
gtk_widget_add_css_class (label, "enormous"); gtk_widget_add_css_class (label, "enormous");
provider = gtk_css_provider_new (); provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, "label.enormous { font-size: 80px; }", -1); gtk_css_provider_load_from_data (provider, "label.enormous { font-size: 80px; }", -1);
gtk_style_context_add_provider_for_display (gdk_display_get_default (), GTK_STYLE_PROVIDER (provider), 800); gtk_style_context_add_provider (gtk_widget_get_style_context (label), GTK_STYLE_PROVIDER (provider), 800);
gtk_widget_set_hexpand (label, TRUE); gtk_widget_set_hexpand (label, TRUE);
gtk_box_append (GTK_BOX (box), label); gtk_box_append (GTK_BOX (box), label);
@@ -378,8 +370,6 @@ do_listview_ucd (GtkWidget *do_widget)
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), listview); gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), listview);
gtk_box_prepend (GTK_BOX (box), sw); gtk_box_prepend (GTK_BOX (box), sw);
gtk_window_set_child (GTK_WINDOW (window), box); gtk_window_set_child (GTK_WINDOW (window), box);
g_object_set_data_full (G_OBJECT (window), "provider", provider, remove_provider);
} }
if (!gtk_widget_get_visible (window)) if (!gtk_widget_get_visible (window))

View File

@@ -1,5 +1,5 @@
/* Lists/Words /* Lists/Words
* #Keywords: GtkListView, GtkFilterListModel, GtkInscription * #Keywords: GtkListView, GtkFilterListModel
* *
* This demo shows filtering a long list - of words. * This demo shows filtering a long list - of words.
* *
@@ -17,9 +17,10 @@ const char *factory_text =
"<interface>\n" "<interface>\n"
" <template class='GtkListItem'>\n" " <template class='GtkListItem'>\n"
" <property name='child'>\n" " <property name='child'>\n"
" <object class='GtkInscription'>\n" " <object class='GtkLabel'>\n"
" <property name='ellipsize'>end</property>\n"
" <property name='xalign'>0</property>\n" " <property name='xalign'>0</property>\n"
" <binding name='text'>\n" " <binding name='label'>\n"
" <lookup name='string' type='GtkStringObject'>\n" " <lookup name='string' type='GtkStringObject'>\n"
" <lookup name='item'>GtkListItem</lookup>\n" " <lookup name='item'>GtkListItem</lookup>\n"
" </lookup>\n" " </lookup>\n"

View File

@@ -7,9 +7,9 @@
<lookup name="item">GtkListItem</lookup> <lookup name="item">GtkListItem</lookup>
</binding> </binding>
<property name="child"> <property name="child">
<object class="GtkInscription"> <object class="GtkLabel">
<property name="hexpand">1</property> <property name="halign">start</property>
<binding name="text"> <binding name="label">
<lookup name="title" type="GtkDemo"> <lookup name="title" type="GtkDemo">
<lookup name="item">expander</lookup> <lookup name="item">expander</lookup>
</lookup> </lookup>

View File

@@ -512,7 +512,7 @@ load_file (const char *demoname,
info_buffer = gtk_text_buffer_new (NULL); info_buffer = gtk_text_buffer_new (NULL);
gtk_text_buffer_create_tag (info_buffer, "title", gtk_text_buffer_create_tag (info_buffer, "title",
"size", 18 * 1024, "font", "Sans 18",
"pixels-below-lines", 10, "pixels-below-lines", 10,
NULL); NULL);
@@ -1040,7 +1040,7 @@ out:
g_signal_connect_swapped (G_OBJECT (demo), "destroy", G_CALLBACK (g_application_quit), app); g_signal_connect_swapped (G_OBJECT (demo), "destroy", G_CALLBACK (g_application_quit), app);
} }
else else
gtk_window_present (GTK_WINDOW (window)); gtk_widget_show (GTK_WIDGET (window));
if (autoquit) if (autoquit)
g_timeout_add_seconds (1, auto_quit, app); g_timeout_add_seconds (1, auto_quit, app);

View File

@@ -73,7 +73,6 @@ demos = files([
'peg_solitaire.c', 'peg_solitaire.c',
'pickers.c', 'pickers.c',
'printing.c', 'printing.c',
'read_more.c',
'revealer.c', 'revealer.c',
'rotated_text.c', 'rotated_text.c',
'scale.c', 'scale.c',
@@ -99,7 +98,6 @@ demos = files([
'transparent.c', 'transparent.c',
'tree_store.c', 'tree_store.c',
'video_player.c', 'video_player.c',
'font_features.c',
]) ])
gtkdemo_deps = [ libgtk_dep, ] gtkdemo_deps = [ libgtk_dep, ]
@@ -130,9 +128,14 @@ extra_demo_sources = files([
'script-names.c', 'script-names.c',
'unicode-names.c', 'unicode-names.c',
'suggestionentry.c', 'suggestionentry.c',
'language-names.c',
]) ])
if harfbuzz_dep.found() and pangoft_dep.found()
demos += files(['font_features.c'])
extra_demo_sources += files(['language-names.c'])
gtkdemo_deps += [ harfbuzz_dep, epoxy_dep ]
endif
if os_unix if os_unix
demos += files('pagesetup.c') demos += files('pagesetup.c')
endif endif
@@ -161,7 +164,7 @@ endif
ld = find_program('ld', required : false) ld = find_program('ld', required : false)
if not meson.is_cross_build() and build_machine.cpu_family() != 'arm' and build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found() if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
glib_compile_resources = find_program('glib-compile-resources') glib_compile_resources = find_program('glib-compile-resources')
# Create the resource blob # Create the resource blob
@@ -171,7 +174,6 @@ if not meson.is_cross_build() and build_machine.cpu_family() != 'arm' and build_
depfile : 'gtkdemo.gresource.d', depfile : 'gtkdemo.gresource.d',
command : [glib_compile_resources, command : [glib_compile_resources,
'--generate', '--generate',
'--internal',
'--target=@OUTPUT@', '--target=@OUTPUT@',
'--dependency-file=@DEPFILE@', '--dependency-file=@DEPFILE@',
'--sourcedir=' + meson.current_source_dir(), '--sourcedir=' + meson.current_source_dir(),
@@ -185,7 +187,6 @@ if not meson.is_cross_build() and build_machine.cpu_family() != 'arm' and build_
depfile : 'gtkdemo_resources.c.d', depfile : 'gtkdemo_resources.c.d',
command : [glib_compile_resources, command : [glib_compile_resources,
'--generate-source', '--generate-source',
'--internal',
'--target=@OUTPUT@', '--target=@OUTPUT@',
'--dependency-file=@DEPFILE@', '--dependency-file=@DEPFILE@',
'--sourcedir=' + meson.current_source_dir(), '--sourcedir=' + meson.current_source_dir(),
@@ -199,7 +200,6 @@ if not meson.is_cross_build() and build_machine.cpu_family() != 'arm' and build_
input : gtkdemo_gresource, input : gtkdemo_gresource,
output : 'gtkdemo_resources.o', output : 'gtkdemo_resources.o',
command : [ld, command : [ld,
'-z', 'noexecstack',
'-r', '-r',
'-b','binary', '-b','binary',
'@INPUT@', '@INPUT@',
@@ -210,7 +210,6 @@ if not meson.is_cross_build() and build_machine.cpu_family() != 'arm' and build_
input : gtkdemo_resources_binary, input : gtkdemo_resources_binary,
output : 'gtkdemo_resources2.o', output : 'gtkdemo_resources2.o',
command : [objcopy, command : [objcopy,
'--strip-all',
'--add-symbol','_g_binary_gtkdemo_resource_data=.data:0', '--add-symbol','_g_binary_gtkdemo_resource_data=.data:0',
'@INPUT@', '@INPUT@',
'@OUTPUT@']) '@OUTPUT@'])

View File

@@ -8,7 +8,6 @@
#include "config.h" #include "config.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
/* Create an object for the pegs that get moved around in the game. /* Create an object for the pegs that get moved around in the game.
* *
* We implement the GdkPaintable interface for them, so we can use GtkPicture * We implement the GdkPaintable interface for them, so we can use GtkPicture
@@ -120,6 +119,12 @@ solitaire_peg_new (void)
/*** Helper for finding a win ***/ /*** Helper for finding a win ***/
static void
ended (GObject *object)
{
g_object_unref (object);
}
static void static void
celebrate (gboolean win) celebrate (gboolean win)
{ {
@@ -129,12 +134,12 @@ celebrate (gboolean win)
if (win) if (win)
path = g_build_filename (GTK_DATADIR, "sounds", "freedesktop", "stereo", "complete.oga", NULL); path = g_build_filename (GTK_DATADIR, "sounds", "freedesktop", "stereo", "complete.oga", NULL);
else else
path = g_build_filename (GTK_DATADIR, "sounds", "freedesktop", "stereo", "suspend-error.oga", NULL); path = g_build_filename (GTK_DATADIR, "sounds", "freedesktop", "stereo", "dialog-error.oga", NULL);
stream = gtk_media_file_new_for_filename (path); stream = gtk_media_file_new_for_filename (path);
gtk_media_stream_set_volume (stream, 1.0); gtk_media_stream_set_volume (stream, 1.0);
gtk_media_stream_play (stream); gtk_media_stream_play (stream);
g_signal_connect (stream, "notify::ended", G_CALLBACK (g_object_unref), NULL); g_signal_connect (stream, "notify::ended", G_CALLBACK (ended), NULL);
g_free (path); g_free (path);
} }
@@ -360,15 +365,6 @@ drop_drop (GtkDropTarget *target,
return TRUE; return TRUE;
} }
static void
remove_provider (gpointer data)
{
GtkStyleProvider *provider = GTK_STYLE_PROVIDER (data);
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
g_object_unref (provider);
}
static void static void
create_board (GtkWidget *window) create_board (GtkWidget *window)
{ {
@@ -385,9 +381,6 @@ create_board (GtkWidget *window)
provider = gtk_css_provider_new (); provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, css, -1); gtk_css_provider_load_from_data (provider, css, -1);
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (provider),
800);
grid = gtk_grid_new (); grid = gtk_grid_new ();
gtk_widget_set_halign (grid, GTK_ALIGN_CENTER); gtk_widget_set_halign (grid, GTK_ALIGN_CENTER);
@@ -406,6 +399,9 @@ create_board (GtkWidget *window)
continue; continue;
image = gtk_image_new (); image = gtk_image_new ();
gtk_style_context_add_provider (gtk_widget_get_style_context (image),
GTK_STYLE_PROVIDER (provider),
800);
gtk_widget_add_css_class (image, "solitaire-field"); gtk_widget_add_css_class (image, "solitaire-field");
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE); gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
if (x != 3 || y != 3) if (x != 3 || y != 3)
@@ -449,7 +445,7 @@ create_board (GtkWidget *window)
} }
} }
g_object_set_data_full (G_OBJECT (window), "provider", provider, remove_provider); g_object_unref (provider);
} }
static void static void

View File

@@ -2,7 +2,7 @@
* #Keywords: GtkColorChooser, GtkFontChooser, GtkApplicationChooser * #Keywords: GtkColorChooser, GtkFontChooser, GtkApplicationChooser
* *
* These widgets are mainly intended for use in preference dialogs. * These widgets are mainly intended for use in preference dialogs.
* They allow to select colors, fonts and applications. * They allow to select colors, fonts, directories and applications.
* *
* This demo shows both the default appearance for these dialogs, * This demo shows both the default appearance for these dialogs,
* as well as some of the customizations that are possible. * as well as some of the customizations that are possible.
@@ -123,14 +123,8 @@ do_pickers (GtkWidget *do_widget)
gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER); gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_widget_set_hexpand (label, TRUE); gtk_widget_set_hexpand (label, TRUE);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
picker = gtk_app_chooser_button_new ("x-scheme-handler/mailto"); picker = gtk_app_chooser_button_new ("x-scheme-handler/mailto");
gtk_app_chooser_button_set_show_dialog_item (GTK_APP_CHOOSER_BUTTON (picker), TRUE); gtk_app_chooser_button_set_show_dialog_item (GTK_APP_CHOOSER_BUTTON (picker), TRUE);
G_GNUC_END_IGNORE_DEPRECATIONS
gtk_grid_attach (GTK_GRID (table), label, 0, 3, 1, 1); gtk_grid_attach (GTK_GRID (table), label, 0, 3, 1, 1);
gtk_grid_attach (GTK_GRID (table), picker, 1, 3, 1, 1); gtk_grid_attach (GTK_GRID (table), picker, 1, 3, 1, 1);
} }

View File

@@ -16,6 +16,7 @@ enum {
NUM_PROPERTIES NUM_PROPERTIES
}; };
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
static void static void
pixbuf_paintable_snapshot (GdkPaintable *paintable, pixbuf_paintable_snapshot (GdkPaintable *paintable,
GdkSnapshot *snapshot, GdkSnapshot *snapshot,
@@ -36,6 +37,7 @@ pixbuf_paintable_snapshot (GdkPaintable *paintable,
g_object_unref (texture); g_object_unref (texture);
} }
G_GNUC_END_IGNORE_DEPRECATIONS;
static int static int
pixbuf_paintable_get_intrinsic_width (GdkPaintable *paintable) pixbuf_paintable_get_intrinsic_width (GdkPaintable *paintable)

View File

@@ -1,239 +0,0 @@
/* Read More
* #Keywords: GtkInscription
*
* A simple implementation of a widget that can either
* display a lot of text or just the first few lines with a
* "Read More" button.
*/
#include <gtk/gtk.h>
#define READ_TYPE_MORE (read_more_get_type ())
G_DECLARE_FINAL_TYPE(ReadMore, read_more, READ, MORE, GtkWidget)
struct _ReadMore {
GtkWidget parent_instance;
GtkWidget *label;
GtkWidget *inscription;
GtkWidget *box;
gboolean show_more;
};
G_DEFINE_TYPE (ReadMore, read_more, GTK_TYPE_WIDGET)
static GtkSizeRequestMode
read_more_get_request_mode (GtkWidget *widget)
{
return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
}
static void
read_more_measure (GtkWidget *widget,
GtkOrientation orientation,
int for_size,
int *minimum,
int *natural,
int *minimum_baseline,
int *natural_baseline)
{
ReadMore *self = READ_MORE (widget);
int label_min, label_nat, label_min_baseline, label_nat_baseline;
int box_min, box_nat, box_min_baseline, box_nat_baseline;
int min_check;
if (self->show_more)
min_check = G_MAXINT;
else if (for_size >= 0)
gtk_widget_measure (self->box, 1 - orientation, -1, &min_check, NULL, NULL, NULL);
else
min_check = -1;
if (min_check > for_size)
{
gtk_widget_measure (self->label,
orientation,
for_size,
minimum, natural,
minimum_baseline, natural_baseline);
return;
}
else if (for_size >= 0)
gtk_widget_measure (self->label, 1 - orientation, -1, &min_check, NULL, NULL, NULL);
else
min_check = -1;
if (min_check > for_size)
{
gtk_widget_measure (self->box,
orientation,
for_size,
minimum, natural,
minimum_baseline, natural_baseline);
return;
}
gtk_widget_measure (self->label,
orientation,
for_size,
&label_min, &label_nat,
&label_min_baseline, &label_nat_baseline);
gtk_widget_measure (self->box,
orientation,
for_size,
&box_min, &box_nat,
&box_min_baseline, &box_nat_baseline);
*minimum = MIN (label_min, box_min);
*natural = MIN (label_nat, box_nat);
/* FIXME: Figure out baselines! */
}
static void
read_more_allocate (GtkWidget *widget,
int width,
int height,
int baseline)
{
ReadMore *self = READ_MORE (widget);
gboolean show_more;
if (self->show_more)
{
show_more = TRUE;
}
else
{
int needed;
/* check to see if we have enough space to show all text */
gtk_widget_measure (self->label,
GTK_ORIENTATION_VERTICAL,
width,
&needed, NULL, NULL, NULL);
show_more = needed <= height;
}
gtk_widget_set_child_visible (self->label, show_more);
gtk_widget_set_child_visible (self->box, !show_more);
if (show_more)
gtk_widget_size_allocate (self->label, &(GtkAllocation) { 0, 0, width, height }, baseline);
else
gtk_widget_size_allocate (self->box, &(GtkAllocation) { 0, 0, width, height }, baseline);
}
static void
read_more_dispose (GObject *object)
{
ReadMore *self = READ_MORE (object);
g_clear_pointer (&self->label, gtk_widget_unparent);
g_clear_pointer (&self->box, gtk_widget_unparent);
G_OBJECT_CLASS (read_more_parent_class)->dispose (object);
}
static void
read_more_class_init (ReadMoreClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
widget_class->get_request_mode = read_more_get_request_mode;
widget_class->measure = read_more_measure;
widget_class->size_allocate = read_more_allocate;
object_class->dispose = read_more_dispose;
}
static void
read_more_clicked (GtkButton *button,
ReadMore *self)
{
self->show_more = TRUE;
gtk_widget_queue_resize (GTK_WIDGET (self));
}
static void
read_more_init (ReadMore *self)
{
GtkWidget *button;
self->label = gtk_label_new (NULL);
gtk_label_set_xalign (GTK_LABEL (self->label), 0.0);
gtk_label_set_yalign (GTK_LABEL (self->label), 0.0);
gtk_label_set_wrap (GTK_LABEL (self->label), TRUE);
gtk_label_set_width_chars (GTK_LABEL (self->label), 3);
gtk_label_set_max_width_chars (GTK_LABEL (self->label), 30);
gtk_widget_set_parent (self->label, GTK_WIDGET (self));
self->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_set_vexpand (self->box, FALSE);
gtk_widget_set_parent (self->box, GTK_WIDGET (self));
self->inscription = gtk_inscription_new (NULL);
gtk_inscription_set_xalign (GTK_INSCRIPTION (self->inscription), 0.0);
gtk_inscription_set_yalign (GTK_INSCRIPTION (self->inscription), 0.0);
gtk_inscription_set_min_lines (GTK_INSCRIPTION (self->inscription), 3);
gtk_inscription_set_nat_chars (GTK_INSCRIPTION (self->inscription), 30);
gtk_widget_set_vexpand (self->inscription, TRUE);
gtk_box_append (GTK_BOX (self->box), self->inscription);
button = gtk_button_new_with_label ("Read More");
g_signal_connect (button, "clicked", G_CALLBACK (read_more_clicked), self);
gtk_box_append (GTK_BOX (self->box), button);
}
static void
read_more_set_text (ReadMore *self,
const char *text)
{
gtk_label_set_label (GTK_LABEL (self->label), text);
gtk_inscription_set_text (GTK_INSCRIPTION (self->inscription), text);
}
static GtkWidget *
read_more_new (const char *text)
{
ReadMore *self = g_object_new (READ_TYPE_MORE, NULL);
read_more_set_text (self, text);
return GTK_WIDGET (self);
}
GtkWidget *
do_read_more (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
if (!window)
{
GtkWidget *readmore;
window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Read More");
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
readmore = read_more_new (
"I'd just like to interject for a moment. What you're referring to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.\n"
"\n"
"Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called \"Linux\", and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.\n"
"\n"
"There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called \"Linux\" distributions are really distributions of GNU/Linux.");
gtk_window_set_child (GTK_WINDOW (window), readmore);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@@ -16,6 +16,24 @@
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
/* Convenience function to create a combo box holding a number of strings
*/
GtkWidget *
create_combo_box (const char **strings)
{
GtkWidget *combo_box;
const char **str;
combo_box = gtk_combo_box_text_new ();
for (str = strings; *str; str++)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), *str);
gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
return combo_box;
}
static void static void
add_row (GtkGrid *table, add_row (GtkGrid *table,
int row, int row,
@@ -23,7 +41,7 @@ add_row (GtkGrid *table,
const char *label_text, const char *label_text,
const char **options) const char **options)
{ {
GtkWidget *dropdown; GtkWidget *combo_box;
GtkWidget *label; GtkWidget *label;
label = gtk_label_new_with_mnemonic (label_text); label = gtk_label_new_with_mnemonic (label_text);
@@ -32,12 +50,12 @@ add_row (GtkGrid *table,
gtk_widget_set_hexpand (label, TRUE); gtk_widget_set_hexpand (label, TRUE);
gtk_grid_attach (table, label, 0, row, 1, 1); gtk_grid_attach (table, label, 0, row, 1, 1);
dropdown = gtk_drop_down_new_from_strings (options); combo_box = create_combo_box (options);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), dropdown); gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo_box);
gtk_widget_set_halign (dropdown, GTK_ALIGN_END); gtk_widget_set_halign (combo_box, GTK_ALIGN_END);
gtk_widget_set_valign (dropdown, GTK_ALIGN_BASELINE); gtk_widget_set_valign (combo_box, GTK_ALIGN_BASELINE);
gtk_size_group_add_widget (size_group, dropdown); gtk_size_group_add_widget (size_group, combo_box);
gtk_grid_attach (table, dropdown, 1, row, 1, 1); gtk_grid_attach (table, combo_box, 1, row, 1, 1);
} }
static void static void

View File

@@ -5,7 +5,6 @@
* small sliding puzzle game. * small sliding puzzle game.
*/ */
#include "config.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
/* Include the header for the puzzle piece */ /* Include the header for the puzzle piece */
@@ -25,30 +24,6 @@ static guint height = 3;
static guint pos_x; static guint pos_x;
static guint pos_y; 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 static gboolean
move_puzzle (GtkWidget *grid, move_puzzle (GtkWidget *grid,
int dx, int dx,
@@ -182,8 +157,6 @@ check_solved (GtkWidget *grid)
picture = gtk_grid_get_child_at (GTK_GRID (grid), pos_x, pos_y); picture = gtk_grid_get_child_at (GTK_GRID (grid), pos_x, pos_y);
gtk_picture_set_paintable (GTK_PICTURE (picture), piece); gtk_picture_set_paintable (GTK_PICTURE (picture), piece);
celebrate (TRUE);
return TRUE; return TRUE;
} }
@@ -357,7 +330,7 @@ start_puzzle (GdkPaintable *paintable)
x, y, x, y,
width, height); width, height);
picture = gtk_picture_new_for_paintable (piece); picture = gtk_picture_new_for_paintable (piece);
gtk_picture_set_content_fit (GTK_PICTURE (picture), GTK_CONTENT_FIT_FILL); gtk_picture_set_keep_aspect_ratio (GTK_PICTURE (picture), FALSE);
gtk_grid_attach (GTK_GRID (grid), gtk_grid_attach (GTK_GRID (grid),
picture, picture,
x, y, x, y,

View File

@@ -11,7 +11,6 @@
#include <stdlib.h> /* for exit() */ #include <stdlib.h> /* for exit() */
#include "paintable.h" #include "paintable.h"
static void easter_egg_callback (GtkWidget *button, gpointer data); static void easter_egg_callback (GtkWidget *button, gpointer data);
static void static void
@@ -138,7 +137,7 @@ insert_text (GtkTextView *view)
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (widget)); icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (widget));
icon = gtk_icon_theme_lookup_icon (icon_theme, icon = gtk_icon_theme_lookup_icon (icon_theme,
"drive-harddisk", "face-cool",
NULL, NULL,
32, 1, 32, 1,
gtk_widget_get_direction (widget), gtk_widget_get_direction (widget),
@@ -240,6 +239,8 @@ insert_text (GtkTextView *view)
gtk_text_buffer_insert (buffer, &iter, "The buffer can have images in it: ", -1); gtk_text_buffer_insert (buffer, &iter, "The buffer can have images in it: ", -1);
gtk_text_buffer_insert_paintable (buffer, &iter, GDK_PAINTABLE (icon)); gtk_text_buffer_insert_paintable (buffer, &iter, GDK_PAINTABLE (icon));
gtk_text_buffer_insert_paintable (buffer, &iter, GDK_PAINTABLE (icon));
gtk_text_buffer_insert_paintable (buffer, &iter, nuclear); gtk_text_buffer_insert_paintable (buffer, &iter, nuclear);
gtk_text_buffer_insert (buffer, &iter, " for example.\n\n", -1); gtk_text_buffer_insert (buffer, &iter, " for example.\n\n", -1);
@@ -430,22 +431,21 @@ attach_widgets (GtkTextView *text_view)
} }
else if (i == 1) else if (i == 1)
{ {
const char *options[] = { widget = gtk_combo_box_text_new ();
"Option 1", "Option 2", "Option 3", NULL
};
widget = gtk_drop_down_new_from_strings (options); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 1");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 2");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 3");
} }
else if (i == 2) else if (i == 2)
{ {
widget = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, NULL); widget = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, NULL);
gtk_range_set_range (GTK_RANGE (widget), 0, 100); gtk_range_set_range (GTK_RANGE (widget), 0, 100);
gtk_widget_set_size_request (widget, 100, -1); gtk_widget_set_size_request (widget, 70, -1);
} }
else if (i == 3) else if (i == 3)
{ {
widget = gtk_entry_new (); widget = gtk_entry_new ();
gtk_editable_set_width_chars (GTK_EDITABLE (widget), 10);
} }
else else
{ {

View File

@@ -10,8 +10,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* TreeItem structure */ /* TreeItem structure */
typedef struct _TreeItem TreeItem; typedef struct _TreeItem TreeItem;
struct _TreeItem struct _TreeItem

View File

@@ -409,14 +409,6 @@ icon_browser_window_init (IconBrowserWindow *win)
g_signal_connect (win->context_model, "notify::selected", G_CALLBACK (selected_name_changed), win); g_signal_connect (win->context_model, "notify::selected", G_CALLBACK (selected_name_changed), win);
} }
static void
icon_browser_window_dispose (GObject *object)
{
gtk_widget_dispose_template (GTK_WIDGET (object), ICON_BROWSER_WINDOW_TYPE);
G_OBJECT_CLASS (icon_browser_window_parent_class)->dispose (object);
}
static void static void
icon_browser_window_finalize (GObject *object) icon_browser_window_finalize (GObject *object)
{ {
@@ -432,7 +424,6 @@ icon_browser_window_class_init (IconBrowserWindowClass *class)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (class); GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->dispose = icon_browser_window_dispose;
object_class->finalize = icon_browser_window_finalize; object_class->finalize = icon_browser_window_finalize;
g_type_ensure (IB_TYPE_ICON); g_type_ensure (IB_TYPE_ICON);

View File

@@ -19,24 +19,12 @@ executable('gtk4-node-editor',
] + common_cflags, ] + common_cflags,
win_subsystem: 'windows', win_subsystem: 'windows',
link_args: extra_demo_ldflags, link_args: extra_demo_ldflags,
install: true, install: false,
) )
# icons # icons, don't install them until we decide to install gtk4-node-editor
icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor') #icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
foreach size: ['scalable', 'symbolic']
install_subdir('data/' + size, install_dir: icontheme_dir)
endforeach
# desktop file
install_data('org.gtk.gtk4.NodeEditor.desktop', install_dir: gtk_applicationsdir)
# appdata
configure_file(
input: 'org.gtk.gtk4.NodeEditor.appdata.xml.in',
output: 'org.gtk.gtk4.NodeEditor.appdata.xml',
configuration: appdata_config,
install_dir: gtk_appdatadir
)
#foreach size: ['scalable', 'symbolic']
# install_subdir('data/' + size, install_dir: icontheme_dir)
#endforeach

View File

@@ -57,7 +57,6 @@ struct _NodeEditorWindow
GtkWidget *testcase_cairo_checkbutton; GtkWidget *testcase_cairo_checkbutton;
GtkWidget *testcase_name_entry; GtkWidget *testcase_name_entry;
GtkWidget *testcase_save_button; GtkWidget *testcase_save_button;
GtkWidget *scale_scale;
GtkWidget *renderer_listbox; GtkWidget *renderer_listbox;
GListStore *renderers; GListStore *renderers;
@@ -172,7 +171,6 @@ text_changed (GtkTextBuffer *buffer,
GBytes *bytes; GBytes *bytes;
GtkTextIter iter; GtkTextIter iter;
GtkTextIter start, end; GtkTextIter start, end;
float scale;
g_array_remove_range (self->errors, 0, self->errors->len); g_array_remove_range (self->errors, 0, self->errors->len);
text = get_current_text (self->text_buffer); text = get_current_text (self->text_buffer);
@@ -183,17 +181,6 @@ text_changed (GtkTextBuffer *buffer,
/* If this is too slow, go fix the parser performance */ /* If this is too slow, go fix the parser performance */
self->node = gsk_render_node_deserialize (bytes, deserialize_error_func, self); self->node = gsk_render_node_deserialize (bytes, deserialize_error_func, self);
scale = gtk_scale_button_get_value (GTK_SCALE_BUTTON (self->scale_scale));
if (self->node && scale != 1.0)
{
GskRenderNode *node;
node = gsk_transform_node_new (self->node, gsk_transform_scale (NULL, scale, scale));
gsk_render_node_unref (self->node);
self->node = node;
}
g_bytes_unref (bytes); g_bytes_unref (bytes);
if (self->node) if (self->node)
{ {
@@ -290,14 +277,6 @@ text_changed (GtkTextBuffer *buffer,
&start, &end); &start, &end);
} }
static void
scale_changed (GObject *object,
GParamSpec *pspec,
NodeEditorWindow *self)
{
text_changed (self->text_buffer, self);
}
static gboolean static gboolean
text_view_query_tooltip_cb (GtkWidget *widget, text_view_query_tooltip_cb (GtkWidget *widget,
int x, int x,
@@ -873,14 +852,6 @@ dark_mode_cb (GtkToggleButton *button,
NULL); NULL);
} }
static void
node_editor_window_dispose (GObject *object)
{
gtk_widget_dispose_template (GTK_WIDGET (object), NODE_EDITOR_WINDOW_TYPE);
G_OBJECT_CLASS (node_editor_window_parent_class)->dispose (object);
}
static void static void
node_editor_window_finalize (GObject *object) node_editor_window_finalize (GObject *object)
{ {
@@ -975,7 +946,6 @@ node_editor_window_class_init (NodeEditorWindowClass *class)
GObjectClass *object_class = G_OBJECT_CLASS (class); GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
object_class->dispose = node_editor_window_dispose;
object_class->finalize = node_editor_window_finalize; object_class->finalize = node_editor_window_finalize;
gtk_widget_class_set_template_from_resource (widget_class, gtk_widget_class_set_template_from_resource (widget_class,
@@ -992,7 +962,6 @@ node_editor_window_class_init (NodeEditorWindowClass *class)
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_cairo_checkbutton); gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_cairo_checkbutton);
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_name_entry); gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_name_entry);
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_save_button); gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_save_button);
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, scale_scale);
gtk_widget_class_bind_template_callback (widget_class, text_view_query_tooltip_cb); gtk_widget_class_bind_template_callback (widget_class, text_view_query_tooltip_cb);
gtk_widget_class_bind_template_callback (widget_class, open_cb); gtk_widget_class_bind_template_callback (widget_class, open_cb);
@@ -1099,7 +1068,6 @@ node_editor_window_init (NodeEditorWindow *self)
self->text_buffer = gtk_text_buffer_new (self->tag_table); self->text_buffer = gtk_text_buffer_new (self->tag_table);
g_signal_connect (self->text_buffer, "changed", G_CALLBACK (text_changed), self); g_signal_connect (self->text_buffer, "changed", G_CALLBACK (text_changed), self);
g_signal_connect (self->scale_scale, "notify::value", G_CALLBACK (scale_changed), self);
gtk_text_view_set_buffer (GTK_TEXT_VIEW (self->text_view), self->text_buffer); gtk_text_view_set_buffer (GTK_TEXT_VIEW (self->text_view), self->text_buffer);
/* Default */ /* Default */

View File

@@ -157,23 +157,6 @@
<signal name="notify::active" handler="dark_mode_cb" swapped="0"/> <signal name="notify::active" handler="dark_mode_cb" swapped="0"/>
</object> </object>
</child> </child>
<child type="end">
<object class="GtkScaleButton" id="scale_scale">
<property name="focus-on-click">0</property>
<property name="valign">center</property>
<property name="adjustment">
<object class="GtkAdjustment">
<property name="lower">1</property>
<property name="value">1</property>
<property name="upper">10</property>
<property name="step-increment">0.1</property>
<property name="page-increment">0.5</property>
</object>
</property>
<property name="icons">zoom-in-symbolic</property>
<property name="tooltip-text" translatable="yes">Scale the image</property>
</object>
</child>
</object> </object>
</child> </child>
<child> <child>
@@ -216,6 +199,7 @@
<child> <child>
<object class="GtkPicture" id="picture"> <object class="GtkPicture" id="picture">
<property name="can-shrink">0</property> <property name="can-shrink">0</property>
<property name="keep-aspect-ratio">1</property>
<property name="halign">center</property> <property name="halign">center</property>
<property name="valign">center</property> <property name="valign">center</property>
<child> <child>

View File

@@ -13,8 +13,6 @@ 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. 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 # Nodes
### container ### container
@@ -137,23 +135,6 @@ 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. 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 ### inset-shadow
| property | syntax | default | printed | | property | syntax | default | printed |
@@ -305,3 +286,20 @@ representation for this texture is `url("data:image/png;base64,iVBORw0KGgoAAAANS
| transform| `<transform>` | none | non-default | | transform| `<transform>` | none | non-default |
Creates a node like `gsk_transform_node_new()` with the given properties. 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.

View File

@@ -1,40 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>org.gtk.gtk4.NodeEditor</id>
<launchable type="desktop-id">org.gtk.gtk4.NodeEditor.desktop</launchable>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LGPL-2.1-or-later</project_license>
<name>GTK Node Editor</name>
<summary>Program to edit render node files</summary>
<description>
<p>
GTK Node Editor is a simple application to show and edit
render node files.
</p>
<p>
Render node files can e.g. be created by the GTK inspector.
</p>
</description>
<screenshots>
<screenshot>
<image>https://static.gnome.org/appdata/gtk4-node-editor/gtk4-node-editor.png</image>
<caption>Node Editor</caption>
</screenshot>
</screenshots>
<kudos>
<kudo>HiDpiIcon</kudo>
<kudo>ModernToolkit</kudo>
</kudos>
<url type="homepage">https://www.gtk.org</url>
<translation type="gettext">gtk-4.0</translation>
<update_contact>matthias.clasen_at_gmail.com</update_contact>
<developer_name>Matthias Clasen and others</developer_name>
<content_rating type="oars-1.1"/>
<releases>
<release version="@BUILD_VERSION@">
<description>
<p>A new build of GTK.</p>
</description>
</release>
</releases>
</component>

View File

@@ -1,9 +0,0 @@
[Desktop Entry]
Name=Node Editor
Comment=An application that edits render nodes
Exec=gtk4-node-editor
Icon=org.gtk.gtk4.NodeEditor
Terminal=false
Type=Application
StartupNotify=true
Categories=Development;GTK;

View File

@@ -871,7 +871,7 @@ activate (GApplication *app)
update_ui (); update_ui ();
gtk_window_present (GTK_WINDOW (main_window)); gtk_widget_show (main_window);
} }
static void static void

View File

@@ -8,7 +8,7 @@ endif
ld = find_program('ld', required : false) ld = find_program('ld', required : false)
if not meson.is_cross_build() and build_machine.cpu_family() != 'arm' and build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found() if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
glib_compile_resources = find_program('glib-compile-resources') glib_compile_resources = find_program('glib-compile-resources')
# Create the resource blob # Create the resource blob
@@ -18,7 +18,6 @@ if not meson.is_cross_build() and build_machine.cpu_family() != 'arm' and build_
depfile: 'widgetfactory.gresource.d', depfile: 'widgetfactory.gresource.d',
command : [glib_compile_resources, command : [glib_compile_resources,
'--generate', '--generate',
'--internal',
'--target=@OUTPUT@', '--target=@OUTPUT@',
'--dependency-file=@DEPFILE@', '--dependency-file=@DEPFILE@',
'--sourcedir=' + meson.current_source_dir(), '--sourcedir=' + meson.current_source_dir(),
@@ -32,7 +31,6 @@ if not meson.is_cross_build() and build_machine.cpu_family() != 'arm' and build_
depfile: 'widgetfactory_resources.c.d', depfile: 'widgetfactory_resources.c.d',
command : [glib_compile_resources, command : [glib_compile_resources,
'--generate-source', '--generate-source',
'--internal',
'--target=@OUTPUT@', '--target=@OUTPUT@',
'--dependency-file=@DEPFILE@', '--dependency-file=@DEPFILE@',
'--sourcedir=' + meson.current_source_dir(), '--sourcedir=' + meson.current_source_dir(),
@@ -46,7 +44,6 @@ if not meson.is_cross_build() and build_machine.cpu_family() != 'arm' and build_
input : widgetfactory_gresource, input : widgetfactory_gresource,
output : 'widgetfactory_resources.o', output : 'widgetfactory_resources.o',
command : [ld, command : [ld,
'-z', 'noexecstack',
'-r', '-r',
'-b','binary', '-b','binary',
'@INPUT@', '@INPUT@',
@@ -57,7 +54,6 @@ if not meson.is_cross_build() and build_machine.cpu_family() != 'arm' and build_
input : widgetfactory_resources_binary, input : widgetfactory_resources_binary,
output : 'widgetfactory_resources2.o', output : 'widgetfactory_resources2.o',
command : [objcopy, command : [objcopy,
'--strip-all',
'--add-symbol','_g_binary_widgetfactory_resource_data=.data:0', '--add-symbol','_g_binary_widgetfactory_resource_data=.data:0',
'@INPUT@', '@INPUT@',
'@OUTPUT@']) '@OUTPUT@'])

View File

@@ -213,31 +213,6 @@ activate_background (GSimpleAction *action,
populate_flowbox (flowbox); 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 static void
activate_open (GSimpleAction *action, activate_open (GSimpleAction *action,
GVariant *parameter, GVariant *parameter,
@@ -664,7 +639,6 @@ on_record_button_toggled (GtkToggleButton *button,
gtk_widget_add_css_class (GTK_WIDGET (button), "destructive-action"); gtk_widget_add_css_class (GTK_WIDGET (button), "destructive-action");
} }
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void static void
on_page_combo_changed (GtkComboBox *combo, on_page_combo_changed (GtkComboBox *combo,
gpointer user_data) gpointer user_data)
@@ -706,7 +680,6 @@ on_page_combo_changed (GtkComboBox *combo,
default:; default:;
} }
} }
G_GNUC_END_IGNORE_DEPRECATIONS
static void static void
on_range_from_changed (GtkSpinButton *from) on_range_from_changed (GtkSpinButton *from)
@@ -845,7 +818,6 @@ page_changed_cb (GtkWidget *stack, GParamSpec *pspec, gpointer data)
} }
} }
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void static void
populate_model (GtkTreeStore *store) populate_model (GtkTreeStore *store)
{ {
@@ -963,7 +935,6 @@ row_separator_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
return is_sep; return is_sep;
} }
G_GNUC_END_IGNORE_DEPRECATIONS
static void static void
update_title_header (GtkListBoxRow *row, update_title_header (GtkListBoxRow *row,
@@ -1582,7 +1553,6 @@ osd_frame_pressed (GtkGestureClick *gesture,
return GDK_EVENT_STOP; return GDK_EVENT_STOP;
} }
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static gboolean static gboolean
page_combo_separator_func (GtkTreeModel *model, page_combo_separator_func (GtkTreeModel *model,
GtkTreeIter *iter, GtkTreeIter *iter,
@@ -1597,7 +1567,6 @@ page_combo_separator_func (GtkTreeModel *model,
return res; return res;
} }
G_GNUC_END_IGNORE_DEPRECATIONS
static void static void
toggle_format (GSimpleAction *action, toggle_format (GSimpleAction *action,
@@ -1850,7 +1819,6 @@ update_buttons (GtkWidget *iv, GtkIconSize size)
gtk_widget_set_sensitive (button, size != GTK_ICON_SIZE_INHERIT); gtk_widget_set_sensitive (button, size != GTK_ICON_SIZE_INHERIT);
} }
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void static void
increase_icon_size (GtkWidget *iv) increase_icon_size (GtkWidget *iv)
{ {
@@ -1901,7 +1869,6 @@ reset_icon_size (GtkWidget *iv)
gtk_widget_queue_resize (iv); gtk_widget_queue_resize (iv);
} }
G_GNUC_END_IGNORE_DEPRECATIONS
static char * static char *
scale_format_value_blank (GtkScale *scale, double value, gpointer user_data) scale_format_value_blank (GtkScale *scale, double value, gpointer user_data)
@@ -2086,7 +2053,6 @@ activate (GApplication *app)
{ "win.open", { "<Control>o", NULL } }, { "win.open", { "<Control>o", NULL } },
{ "win.record", { "<Control>r", NULL } }, { "win.record", { "<Control>r", NULL } },
{ "win.lock", { "<Control>l", NULL } }, { "win.lock", { "<Control>l", NULL } },
{ "win.fullscreen", { "F11", NULL } },
}; };
struct { struct {
const char *action_and_target; const char *action_and_target;
@@ -2114,24 +2080,26 @@ activate (GApplication *app)
builder = gtk_builder_new (); builder = gtk_builder_new ();
scope = gtk_builder_cscope_new (); scope = gtk_builder_cscope_new ();
gtk_builder_cscope_add_callback (scope, on_entry_icon_release); gtk_builder_cscope_add_callback_symbols (GTK_BUILDER_CSCOPE (scope),
gtk_builder_cscope_add_callback (scope, on_scale_button_value_changed); "on_entry_icon_release", (GCallback)on_entry_icon_release,
gtk_builder_cscope_add_callback (scope, on_record_button_toggled); "on_scale_button_value_changed", (GCallback)on_scale_button_value_changed,
gtk_builder_cscope_add_callback (scope, on_page_combo_changed); "on_record_button_toggled", (GCallback)on_record_button_toggled,
gtk_builder_cscope_add_callback (scope, on_range_from_changed); "on_page_combo_changed", (GCallback)on_page_combo_changed,
gtk_builder_cscope_add_callback (scope, on_range_to_changed); "on_range_from_changed", (GCallback)on_range_from_changed,
gtk_builder_cscope_add_callback (scope, on_picture_drag_prepare); "on_range_to_changed", (GCallback)on_range_to_changed,
gtk_builder_cscope_add_callback (scope, on_picture_drop); "on_picture_drag_prepare", (GCallback)on_picture_drag_prepare,
gtk_builder_cscope_add_callback (scope, tab_close_cb); "on_picture_drop", (GCallback)on_picture_drop,
gtk_builder_cscope_add_callback (scope, increase_icon_size); "tab_close_cb", (GCallback)tab_close_cb,
gtk_builder_cscope_add_callback (scope, decrease_icon_size); "increase_icon_size", (GCallback)increase_icon_size,
gtk_builder_cscope_add_callback (scope, osd_frame_pressed); "decrease_icon_size", (GCallback)decrease_icon_size,
gtk_builder_cscope_add_callback (scope, age_entry_changed); "reset_icon_size", (GCallback)reset_icon_size,
gtk_builder_cscope_add_callback (scope, validate_more_details); "osd_frame_pressed", (GCallback)osd_frame_pressed,
gtk_builder_cscope_add_callback (scope, mode_switch_state_set); "age_entry_changed", (GCallback)age_entry_changed,
gtk_builder_cscope_add_callback (scope, level_scale_value_changed); "validate_more_details", (GCallback)validate_more_details,
gtk_builder_cscope_add_callback (scope, transition_speed_changed); "mode_switch_state_set", (GCallback)mode_switch_state_set,
gtk_builder_cscope_add_callback (scope, reset_icon_size); "level_scale_value_changed", (GCallback)level_scale_value_changed,
"transition_speed_changed", (GCallback)transition_speed_changed,
NULL);
gtk_builder_set_scope (builder, scope); gtk_builder_set_scope (builder, scope);
g_object_unref (scope); g_object_unref (scope);
if (!gtk_builder_add_from_resource (builder, "/org/gtk/WidgetFactory4/widget-factory.ui", &error)) if (!gtk_builder_add_from_resource (builder, "/org/gtk/WidgetFactory4/widget-factory.ui", &error))
@@ -2278,12 +2246,10 @@ activate (GApplication *app)
g_object_set_data (G_OBJECT (window), "selection_flowbox", widget2); g_object_set_data (G_OBJECT (window), "selection_flowbox", widget2);
g_signal_connect_swapped (widget, "clicked", G_CALLBACK (populate_flowbox), widget2); g_signal_connect_swapped (widget, "clicked", G_CALLBACK (populate_flowbox), widget2);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
widget = (GtkWidget *)gtk_builder_get_object (builder, "charletree"); widget = (GtkWidget *)gtk_builder_get_object (builder, "charletree");
populate_model ((GtkTreeStore *)gtk_tree_view_get_model (GTK_TREE_VIEW (widget))); populate_model ((GtkTreeStore *)gtk_tree_view_get_model (GTK_TREE_VIEW (widget)));
gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (widget), row_separator_func, NULL, NULL); gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (widget), row_separator_func, NULL, NULL);
gtk_tree_view_expand_all (GTK_TREE_VIEW (widget)); gtk_tree_view_expand_all (GTK_TREE_VIEW (widget));
G_GNUC_END_IGNORE_DEPRECATIONS
widget = GTK_WIDGET (gtk_builder_get_object (builder, "munsell")); widget = GTK_WIDGET (gtk_builder_get_object (builder, "munsell"));
widget2 = GTK_WIDGET (gtk_builder_get_object (builder, "cchooser")); widget2 = GTK_WIDGET (gtk_builder_get_object (builder, "cchooser"));
@@ -2291,7 +2257,6 @@ G_GNUC_END_IGNORE_DEPRECATIONS
populate_colors (widget, widget2); populate_colors (widget, widget2);
g_signal_connect (widget2, "notify::rgba", G_CALLBACK (rgba_changed), widget); g_signal_connect (widget2, "notify::rgba", G_CALLBACK (rgba_changed), widget);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
widget = (GtkWidget *)gtk_builder_get_object (builder, "page_combo"); widget = (GtkWidget *)gtk_builder_get_object (builder, "page_combo");
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (widget), page_combo_separator_func, NULL, NULL); gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (widget), page_combo_separator_func, NULL, NULL);
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "range_from_spin"); widget2 = (GtkWidget *)gtk_builder_get_object (builder, "range_from_spin");
@@ -2302,7 +2267,6 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_object_set_data (G_OBJECT (widget), "range_to_spin", widget3); g_object_set_data (G_OBJECT (widget), "range_to_spin", widget3);
g_object_set_data (G_OBJECT (widget2), "range_to_spin", widget3); g_object_set_data (G_OBJECT (widget2), "range_to_spin", widget3);
g_object_set_data (G_OBJECT (widget), "print_button", widget4); g_object_set_data (G_OBJECT (widget), "print_button", widget4);
G_GNUC_END_IGNORE_DEPRECATIONS
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "tooltextview"); widget2 = (GtkWidget *)gtk_builder_get_object (builder, "tooltextview");
@@ -2395,7 +2359,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
model = (GMenuModel *)gtk_builder_get_object (builder, "new_style_context_menu_model"); model = (GMenuModel *)gtk_builder_get_object (builder, "new_style_context_menu_model");
set_up_context_popover (widget, model); set_up_context_popover (widget, model);
gtk_window_present (window); gtk_widget_show (GTK_WIDGET (window));
g_object_unref (builder); g_object_unref (builder);
} }
@@ -2488,7 +2452,7 @@ main (int argc, char *argv[])
{ "share", activate_action, NULL, NULL, NULL }, { "share", activate_action, NULL, NULL, NULL },
{ "labels", activate_action, NULL, NULL, NULL }, { "labels", activate_action, NULL, NULL, NULL },
{ "new", activate_action, NULL, NULL, NULL }, { "new", activate_action, NULL, NULL, NULL },
{ "open", activate_open_file, NULL, NULL, NULL }, { "open", activate_action, NULL, NULL, NULL },
{ "open-in", activate_action, NULL, NULL, NULL }, { "open-in", activate_action, NULL, NULL, NULL },
{ "open-tab", activate_action, NULL, NULL, NULL }, { "open-tab", activate_action, NULL, NULL, NULL },
{ "open-window", activate_action, NULL, NULL, NULL }, { "open-window", activate_action, NULL, NULL, NULL },

View File

@@ -111,8 +111,6 @@
<file>icons/scalable/status/weather-showers-symbolic.svg</file> <file>icons/scalable/status/weather-showers-symbolic.svg</file>
<file>icons/scalable/status/weather-snow-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>
<gresource prefix="/org/gtk/WidgetFactory4"> <gresource prefix="/org/gtk/WidgetFactory4">
<file>gtk-logo.webm</file> <file>gtk-logo.webm</file>

View File

@@ -1265,7 +1265,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="child"> <property name="child">
<object class="GtkPicture"> <object class="GtkPicture">
<property name="file">resource:///org/gtk/WidgetFactory4/sunset.jpg</property> <property name="file">resource:///org/gtk/WidgetFactory4/sunset.jpg</property>
<property name="content-fit">cover</property>
<child> <child>
<object class="GtkDragSource"> <object class="GtkDragSource">
<signal name="prepare" handler="on_picture_drag_prepare" swapped="no"/> <signal name="prepare" handler="on_picture_drag_prepare" swapped="no"/>
@@ -3345,12 +3344,10 @@ bad things might happen.</property>
<attribute name="display-hint">circular-buttons</attribute> <attribute name="display-hint">circular-buttons</attribute>
<item> <item>
<attribute name="verb-icon">printer-symbolic</attribute> <attribute name="verb-icon">printer-symbolic</attribute>
<attribute name="label" translatable="yes">Print all the things!</attribute>
<attribute name="action">win.print</attribute> <attribute name="action">win.print</attribute>
</item> </item>
<item> <item>
<attribute name="verb-icon">emblem-shared-symbolic</attribute> <attribute name="verb-icon">emblem-shared-symbolic</attribute>
<attribute name="label" translatable="yes">Share all the things!</attribute>
<attribute name="action">app.share</attribute> <attribute name="action">app.share</attribute>
</item> </item>
</section> </section>
@@ -3365,17 +3362,14 @@ bad things might happen.</property>
<attribute name="label" translatable="yes">Edit</attribute> <attribute name="label" translatable="yes">Edit</attribute>
<item> <item>
<attribute name="verb-icon">edit-cut-symbolic</attribute> <attribute name="verb-icon">edit-cut-symbolic</attribute>
<attribute name="label" translatable="yes">Cut</attribute>
<attribute name="action">app.cut</attribute> <attribute name="action">app.cut</attribute>
</item> </item>
<item> <item>
<attribute name="verb-icon">edit-copy-symbolic</attribute> <attribute name="verb-icon">edit-copy-symbolic</attribute>
<attribute name="label" translatable="yes">Copy</attribute>
<attribute name="action">app.copy</attribute> <attribute name="action">app.copy</attribute>
</item> </item>
<item> <item>
<attribute name="verb-icon">edit-paste-symbolic</attribute> <attribute name="verb-icon">edit-paste-symbolic</attribute>
<attribute name="label" translatable="yes">Paste</attribute>
<attribute name="action">app.paste</attribute> <attribute name="action">app.paste</attribute>
</item> </item>
</section> </section>

View File

@@ -5,23 +5,22 @@ repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
website_url = "https://www.gtk.org" website_url = "https://www.gtk.org"
authors = "GTK Development Team" authors = "GTK Development Team"
logo_url = "gtk-logo.svg" logo_url = "gtk-logo.svg"
license = "LGPL-2.1-or-later" license = "GPL-2.1-or-later"
description = "The GTK toolkit" description = "The GTK toolkit"
dependencies = [ "GObject-2.0" ]
devhelp = true devhelp = true
dependencies = ["Gdk-4.0"] [dependencies."GObject-2.0"]
name = "GObject"
[dependencies."Gdk-4.0"] description = "The base type system library"
name = "GDK" docs_url = "https://docs.gtk.org/gobject/"
description = "The GTK drawing kit"
docs_url = "https://docs.gtk.org/gdk/"
[theme] [theme]
name = "basic" name = "basic"
show_index_summary = true show_index_summary = true
[source-location] [source-location]
base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/main/" base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/master/"
[extra] [extra]
content_images = [ content_images = [

View File

@@ -5,22 +5,22 @@ repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
website_url = "https://www.gtk.org" website_url = "https://www.gtk.org"
authors = "GTK Development Team" authors = "GTK Development Team"
logo_url = "gtk-logo.svg" logo_url = "gtk-logo.svg"
license = "LGPL-2.1-or-later" license = "GPL-2.1-or-later"
description = "The GTK toolkit" description = "The GTK toolkit"
dependencies = ["Gdk-4.0"] dependencies = [ "GObject-2.0" ]
devhelp = true devhelp = true
[dependencies."Gdk-4.0"] [dependencies."GObject-2.0"]
name = "GDK" name = "GObject"
description = "The GTK drawing kit" description = "The base type system library"
docs_url = "https://docs.gtk.org/gdk4/" docs_url = "https://docs.gtk.org/gobject/"
[theme] [theme]
name = "basic" name = "basic"
show_index_summary = true show_index_summary = true
[source-location] [source-location]
base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/main/" base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/master/"
[extra] [extra]
content_images = [ content_images = [

View File

@@ -8,7 +8,7 @@ authors = "GTK Development Team"
logo_url = "gtk-logo.svg" logo_url = "gtk-logo.svg"
license = "LGPL-2.1-or-later" license = "LGPL-2.1-or-later"
description = "The GTK toolkit" description = "The GTK toolkit"
dependencies = ["GObject-2.0", "Gio-2.0", "cairo-1.0", "Pango-1.0", "GdkPixbuf-2.0"] dependencies = [ "GObject-2.0", "cairo-1.0", "Pango-1.0", "GdkWayland-4.0", "GdkX11-4.0" ]
devhelp = true devhelp = true
search_index = true search_index = true
@@ -17,11 +17,6 @@ search_index = true
description = "The base type system library" description = "The base type system library"
docs_url = "https://docs.gtk.org/gobject/" docs_url = "https://docs.gtk.org/gobject/"
[dependencies."Gio-2.0"]
name = "GIO"
description = "GObject Interfaces and Objects, Networking, IPC, and I/O"
docs_url = "https://docs.gtk.org/gio/"
[dependencies."cairo-1.0"] [dependencies."cairo-1.0"]
name = "Cairo" name = "Cairo"
description = "A 2D graphics library with support for multiple output devices" description = "A 2D graphics library with support for multiple output devices"
@@ -32,19 +27,12 @@ search_index = true
description = "Text shaping and rendering" description = "Text shaping and rendering"
docs_url = "https://docs.gtk.org/Pango/" docs_url = "https://docs.gtk.org/Pango/"
[dependencies."GdkPixbuf-2.0"] [dependencies."GdkWayland-4.0"]
name = "GdkPixbuf"
description = "Image data loading"
docs_url = "https://docs.gtk.org/gdk-pixbuf/"
related = ["GdkWayland-4.0", "GdkX11-4.0"]
[related."GdkWayland-4.0"]
name = "GdkWayland" name = "GdkWayland"
description = "GDK Wayland Backend" description = "GDK Wayland Backend"
docs_url = "https://docs.gtk.org/gdk4-wayland/" docs_url = "https://docs.gtk.org/gdk4-wayland/"
[related."GdkX11-4.0"] [dependencies."GdkX11-4.0"]
name = "GdkX11" name = "GdkX11"
description = "GDK X11 Backend" description = "GDK X11 Backend"
docs_url = "https://docs.gtk.org/gdk4-x11/" docs_url = "https://docs.gtk.org/gdk4-x11/"
@@ -55,7 +43,7 @@ show_index_summary = true
show_class_hierarchy = true show_class_hierarchy = true
[source-location] [source-location]
base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/main/" base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/master/"
[extra] [extra]
content_files = [ content_files = [

View File

@@ -8,16 +8,25 @@ authors = "GTK Development Team"
logo_url = "gtk-logo.svg" logo_url = "gtk-logo.svg"
license = "LGPL-2.1-or-later" license = "LGPL-2.1-or-later"
description = "The GTK toolkit" description = "The GTK toolkit"
dependencies = [ "GObject-2.0", "Graphene-1.0", "Pango-1.0", "Gdk-4.0" ]
devhelp = true devhelp = true
search_index = true search_index = true
dependencies = ["Graphene-1.0", "Gdk-4.0"] [dependencies."GObject-2.0"]
name = "GObject"
description = "The base type system library"
docs_url = "https://docs.gtk.org/gobject/"
[dependencies."Graphene-1.0"] [dependencies."Graphene-1.0"]
name = "Graphene" name = "Graphene"
description = "A thin layer of mathematical types for 3D libraries" description = "A thin layer of mathematical types for 3D libraries"
docs_url = "https://ebassi.github.io/graphene/docs/" docs_url = "https://ebassi.github.io/graphene/docs/"
[dependencies."Pango-1.0"]
name = "Pango"
description = "Text shaping and rendering"
docs_url = "https://docs.gtk.org/Pango/"
[dependencies."Gdk-4.0"] [dependencies."Gdk-4.0"]
name = "GDK" name = "GDK"
description = "The GTK windowing system abstraction" description = "The GTK windowing system abstraction"
@@ -29,7 +38,7 @@ show_index_summary = true
show_class_hierarchy = true show_class_hierarchy = true
[source-location] [source-location]
base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/main/" base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/master/"
[extra] [extra]
content_images = [ content_images = [

View File

@@ -752,7 +752,7 @@ templates, resources, application menus, settings, [class@Gtk.HeaderBar], [class
The full, buildable sources for these examples can be found in the The full, buildable sources for these examples can be found in the
`examples` directory of the GTK source distribution, or `examples` directory of the GTK source distribution, or
[online](https://gitlab.gnome.org/GNOME/gtk/blob/main/examples) in the GTK [online](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples) in the GTK
source code repository. You can build each example separately by using make source code repository. You can build each example separately by using make
with the `Makefile.example` file. For more information, see the `README` with the `Makefile.example` file. For more information, see the `README`
included in the examples directory. included in the examples directory.
@@ -972,7 +972,7 @@ example_app_window_class_init (ExampleAppWindowClass *class)
... ...
``` ```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/main/examples/application2/exampleappwin.c)) ([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application2/exampleappwin.c))
You may have noticed that we used the `_from_resource()` variant of the function You may have noticed that we used the `_from_resource()` variant of the function
that sets a template. Now we need to use that sets a template. Now we need to use
@@ -1043,7 +1043,7 @@ example_app_window_class_init (ExampleAppWindowClass *class)
... ...
``` ```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/main/examples/application3/exampleappwin.c)) ([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application3/exampleappwin.c))
Now we revisit the `example_app_window_open()` function that is called for each Now we revisit the `example_app_window_open()` function that is called for each
commandline argument, and construct a GtkTextView that we then add as a page commandline argument, and construct a GtkTextView that we then add as a page
@@ -1087,7 +1087,7 @@ example_app_window_open (ExampleAppWindow *win,
... ...
``` ```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/main/examples/application3/exampleappwin.c)) ([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application3/exampleappwin.c))
Lastly, we add a [class@Gtk.StackSwitcher] to the titlebar area in the UI file, and we Lastly, we add a [class@Gtk.StackSwitcher] to the titlebar area in the UI file, and we
tell it to display information about our stack. tell it to display information about our stack.
@@ -1188,7 +1188,7 @@ example_app_class_init (ExampleAppClass *class)
... ...
``` ```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/main/examples/application4/exampleapp.c)) ([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application4/exampleapp.c))
Our preferences menu item does not do anything yet, but the Quit menu item Our preferences menu item does not do anything yet, but the Quit menu item
is fully functional. Note that it can also be activated by the usual Ctrl-Q is fully functional. Note that it can also be activated by the usual Ctrl-Q
@@ -1258,7 +1258,7 @@ example_app_window_init (ExampleAppWindow *win)
... ...
``` ```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/main/examples/application5/exampleappwin.c)) ([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application5/exampleappwin.c))
The code to connect the font setting is a little more involved, since there The code to connect the font setting is a little more involved, since there
is no simple object property that it corresponds to, so we are not going to is no simple object property that it corresponds to, so we are not going to
@@ -1429,7 +1429,7 @@ preferences_activated (GSimpleAction *action,
... ...
``` ```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/main/examples/application6/exampleapp.c)) ([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application6/exampleapp.c))
After all this work, our application can now show a preference dialog After all this work, our application can now show a preference dialog
like this: like this:
@@ -1549,7 +1549,7 @@ example_app_window_init (ExampleAppWindow *win)
... ...
``` ```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/main/examples/application7/exampleappwin.c)) ([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application7/exampleappwin.c))
With the search bar, our application now looks like this: With the search bar, our application now looks like this:
@@ -1682,7 +1682,7 @@ example_app_window_init (ExampleAppWindow *win)
... ...
``` ```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/main/examples/application8/exampleappwin.c)) ([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application8/exampleappwin.c))
What our application looks like now: What our application looks like now:
@@ -1760,10 +1760,10 @@ example_app_window_init (ExampleAppWindow *win)
... ...
``` ```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/main/examples/application9/exampleappwin.c)) ([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application9/exampleappwin.c))
We also need a function that counts the lines of the currently active tab, We also need a function that counts the lines of the currently active tab,
and updates the `lines` label. See the [full source](https://gitlab.gnome.org/GNOME/gtk/blob/main/examples/application9/exampleappwin.c) and updates the `lines` label. See the [full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application9/exampleappwin.c)
if you are interested in the details. if you are interested in the details.
This brings our example application to this appearance: This brings our example application to this appearance:

View File

@@ -12,11 +12,10 @@ SYNOPSIS
-------- --------
| **gtk4-builder-tool** <COMMAND> [OPTIONS...] <FILE> | **gtk4-builder-tool** <COMMAND> [OPTIONS...] <FILE>
| |
| **gtk4-builder-tool** validate [OPTIONS...] <FILE> | **gtk4-builder-tool** validate <FILE>
| **gtk4-builder-tool** enumerate [OPTIONS...] <FILE> | **gtk4-builder-tool** enumerate <FILE>
| **gtk4-builder-tool** simplify [OPTIONS...] <FILE> | **gtk4-builder-tool** simplify [OPTIONS...] <FILE>
| **gtk4-builder-tool** preview [OPTIONS...] <FILE> | **gtk4-builder-tool** preview [OPTIONS...] <FILE>
| **gtk4-builder-tool** screenshot [OPTIONS...] <FILE>
DESCRIPTION DESCRIPTION
----------- -----------
@@ -33,24 +32,16 @@ Validation
The ``validate`` command validates the given UI definition file and reports The ``validate`` command validates the given UI definition file and reports
errors to ``stderr``. errors to ``stderr``.
``--deprecations``
Warn about uses of deprecated types in the UI definition file.
Enumeration Enumeration
^^^^^^^^^^^ ^^^^^^^^^^^
The ``enumerate`` command prints all the named objects that are present in the UI The ``enumerate`` command lists all the named objects that are present in the UI
definition file. definition file.
``--callbacks``
Print the names of callbacks as well.
Preview Preview
^^^^^^^ ^^^^^^^
The ``preview`` command displays the UI definition file. The ``preview`` command displays the UI dfinition file.
This command accepts options to specify the ID of the toplevel object and a CSS This command accepts options to specify the ID of the toplevel object and a CSS
file to use. file to use.
@@ -64,33 +55,6 @@ file to use.
Load style information from the given CSS file. Load style information from the given CSS file.
Screenshot
^^^^^^^^^^
The ``screenshot`` command saves a rendering of the UI definition file
as a png image or node file. The name of the file to write can be specified as
a second FILE argument.
This command accepts options to specify the ID of the toplevel object and a CSS
file to use.
``--id=ID``
The ID of the object to preview. If not specified, gtk4-builder-tool will
choose a suitable object on its own.
``--css=FILE``
Load style information from the given CSS file.
``--node``
Write a serialized node file instead of a png image.
``--force``
Overwrite an existing file.
Simplification Simplification
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^

View File

@@ -1,27 +0,0 @@
.. _gtk4-node-editor(1):
=================
gtk4-node-editor
=================
-----------------
Editor render nodes
-----------------
SYNOPSIS
--------
| **gtk4-node-editor** [OPTIONS...]
DESCRIPTION
-----------
``gtk4-node-editor`` is a utility to show and edit render node files.
Such render node files can be obtained e.g. from the GTK inspector.
OPTIONS
-------
``-h, --help``
Show the application help.

View File

@@ -8,10 +8,24 @@ authors = "GTK Development Team"
logo_url = "gtk-logo.svg" logo_url = "gtk-logo.svg"
license = "LGPL-2.1-or-later" license = "LGPL-2.1-or-later"
description = "The GTK toolkit" description = "The GTK toolkit"
dependencies = [ "GObject-2.0", "Graphene-1.0", "Pango-1.0", "Gdk-4.0", "Gsk-4.0" ]
devhelp = true devhelp = true
search_index = true search_index = true
dependencies = ["Gdk-4.0", "Gsk-4.0"] [dependencies."GObject-2.0"]
name = "GObject"
description = "The base type system library"
docs_url = "https://docs.gtk.org/gobject/"
[dependencies."Graphene-1.0"]
name = "Graphene"
description = "A thin layer of mathematical types for 3D libraries"
docs_url = "https://ebassi.github.io/graphene/docs"
[dependencies."Pango-1.0"]
name = "Pango"
description = "Text shaping and rendering"
docs_url = "https://docs.gtk.org/Pango/"
[dependencies."Gdk-4.0"] [dependencies."Gdk-4.0"]
name = "GDK" name = "GDK"
@@ -23,35 +37,13 @@ dependencies = ["Gdk-4.0", "Gsk-4.0"]
description = "The GTK rendering abstraction" description = "The GTK rendering abstraction"
docs_url = "https://docs.gtk.org/gsk4/" docs_url = "https://docs.gtk.org/gsk4/"
related = ["Pango-1.0", "Graphene-1.0", "GObject-2.0", "Gio-2.0"]
[related."GObject-2.0"]
name = "GObject"
description = "The base type system library"
docs_url = "https://docs.gtk.org/gobject/"
[related."Gio-2.0"]
name = "GIO"
description = "GObject Interfaces and Objects, Networking, IPC, and I/O"
docs_url = "https://docs.gtk.org/gio/"
[related."Graphene-1.0"]
name = "Graphene"
description = "A thin layer of mathematical types for 3D libraries"
docs_url = "https://ebassi.github.io/graphene/docs"
[related."Pango-1.0"]
name = "Pango"
description = "Text shaping and rendering"
docs_url = "https://docs.gtk.org/Pango/"
[theme] [theme]
name = "basic" name = "basic"
show_index_summary = true show_index_summary = true
show_class_hierarchy = true show_class_hierarchy = true
[source-location] [source-location]
base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/main/" base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/master/"
[extra] [extra]
# The same order will be used when generating the index # The same order will be used when generating the index

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkAboutDialog">
<property name="program-name">GTK Code Demos</property>
<property name="version">4.8.0</property>
<property name="copyright">© 1997-2022 The GTK Team</property>
<property name="comments">Program to demonstrate GTK functions</property>
<property name="logo">gtk-logo.png</property>
<property name="title">About GTK Code Demos</property>
<property name="authors">Peter Mattis
Spencer Kimball
Josh MacDonald
and many more…
</property>
</object>
</interface>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow">
<property name="decorated">0</property>
<property name="resizable">0</property>
<property name="default-width">280</property>
<property name="default-height">120</property>
<style>
<class name="nobackground"/>
</style>
<child>
<object class="GtkBox">
<style>
<class name="shadow"/>
<class name="background"/>
<class name="frame"/>
</style>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<child>
<object class="GtkTextView">
<property name="vexpand">1</property>
</object>
</child>
<child>
<object class="GtkActionBar">
<child>
<object class="GtkButton">
<property name="icon-name">object-select-symbolic</property>
</object>
</child>
<child>
<object class="GtkButton">
<property name="icon-name">call-start-symbolic</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@@ -1,43 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow">
<property name="decorated">0</property>
<property name="resizable">0</property>
<property name="default-width">280</property>
<property name="default-height">120</property>
<style>
<class name="nobackground"/>
</style>
<child>
<object class="GtkBox">
<style>
<class name="shadow"/>
<class name="background"/>
<class name="frame"/>
</style>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="halign">center</property>
<property name="valign">center</property>
<child>
<object class="GtkAppChooserButton">
<property name="content-type">text/plain</property>
<property name="halign">center</property>
<property name="valign">center</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Application Button</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkAppChooserDialog">
<property name="content-type">image/png</property>
<property name="default-width">200</property>
<property name="default-height">300</property>
</object>
</interface>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkAssistant">
<property name="resizable">0</property>
<property name="default-width">300</property>
<property name="default-height">140</property>
<property name="title">Assistant</property>
<child>
<object class="GtkAssistantPage">
<property name="title">Assistant page</property>
<property name="complete">1</property>
<property name="child">
<object class="GtkLabel">
<property name="label">Assistant</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkAssistantPage">
<property name="page-type">confirm</property>
<property name="child">
<object class="GtkLabel">
<property name="label">You sure?</property>
</object>
</property>
</object>
</child>
</object>
</interface>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow">
<property name="decorated">0</property>
<property name="resizable">0</property>
<property name="default-width">280</property>
<property name="default-height">120</property>
<style>
<class name="nobackground"/>
</style>
<child>
<object class="GtkBox">
<style>
<class name="shadow"/>
<class name="background"/>
<class name="frame"/>
</style>
<child>
<object class="GtkBox">
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<child>
<object class="GtkBox">
<property name="orientation">horizontal</property>
<property name="homogeneous">1</property>
<child>
<object class="GtkBox">
<property name="orientation">horizontal</property>
<property name="spacing">4</property>
<property name="halign">center</property>
<property name="valign">center</property>
<child>
<object class="GtkButton">
<style><class name="small-button"/></style>
<property name="valign">center</property>
</object>
</child>
<child>
<object class="GtkButton">
<style><class name="small-button"/></style>
<property name="valign">center</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">⋯</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<property name="halign">center</property>
<property name="valign">center</property>
<child>
<object class="GtkButton">
<style><class name="small-button"/></style>
<property name="halign">center</property>
</object>
</child>
<child>
<object class="GtkButton">
<style><class name="small-button"/></style>
<property name="halign">center</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">⋮</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="justify">center</property>
<property name="label">Horizontal and Vertical Boxes</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

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