Compare commits
134 Commits
content_fo
...
cherry-pic
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ad550f341 | ||
|
|
c1816408c0 | ||
|
|
5699e5ba71 | ||
|
|
5356202ba3 | ||
|
|
15a574976e | ||
|
|
f9c7b68853 | ||
|
|
741603c838 | ||
|
|
5ab6eca84d | ||
|
|
024151fe2c | ||
|
|
d5bfcdc218 | ||
|
|
90bd5a04fd | ||
|
|
16da71f1ce | ||
|
|
807537dd5d | ||
|
|
b3fa74d1ac | ||
|
|
dcb620e103 | ||
|
|
c573732ef1 | ||
|
|
69e72341a2 | ||
|
|
2a0a55ae97 | ||
|
|
6df3296211 | ||
|
|
a00d3b107e | ||
|
|
4ffcc9aa26 | ||
|
|
e7fdb43499 | ||
|
|
03be0994ad | ||
|
|
073c40c738 | ||
|
|
b3d6202833 | ||
|
|
bf09dc47fd | ||
|
|
4e031a9542 | ||
|
|
8d263eed02 | ||
|
|
5047f79218 | ||
|
|
54885d14bf | ||
|
|
c231ce6a9f | ||
|
|
c12f1ebebb | ||
|
|
6c1f404e5a | ||
|
|
caa5fd0584 | ||
|
|
d883b0a383 | ||
|
|
ffcbc44c7f | ||
|
|
633d59fff9 | ||
|
|
939a254e28 | ||
|
|
06a0265efa | ||
|
|
f639fda994 | ||
|
|
26805edcff | ||
|
|
d5db409c44 | ||
|
|
b6a4ffef36 | ||
|
|
ba44668478 | ||
|
|
2f921ab667 | ||
|
|
d9784df92e | ||
|
|
6a5f93ff95 | ||
|
|
7578a18cd6 | ||
|
|
a5895b5995 | ||
|
|
37582c6bf9 | ||
|
|
84f02c633c | ||
|
|
fdb2776577 | ||
|
|
94539d469c | ||
|
|
f6a2d8148b | ||
|
|
35e3eaf8cb | ||
|
|
2bc7b64004 | ||
|
|
2df07f0564 | ||
|
|
2d747cca3c | ||
|
|
f795a75d2b | ||
|
|
8748d9511b | ||
|
|
0fe3a26122 | ||
|
|
9145365331 | ||
|
|
84295147fd | ||
|
|
7ec50b1dd3 | ||
|
|
a5b4c2bb48 | ||
|
|
d26a3c28d0 | ||
|
|
e75df3dcd3 | ||
|
|
db5eef5a81 | ||
|
|
0b0d7d3877 | ||
|
|
10b302ac29 | ||
|
|
f1bfbeba45 | ||
|
|
ca405f1060 | ||
|
|
4baec1ef22 | ||
|
|
d35e069436 | ||
|
|
6a95ca6995 | ||
|
|
268c174506 | ||
|
|
7e3493b15e | ||
|
|
be65bab5f6 | ||
|
|
c04139405a | ||
|
|
5fc008024b | ||
|
|
f6bec2edf2 | ||
|
|
c1e68f6044 | ||
|
|
549e5a8e3a | ||
|
|
5783d8af91 | ||
|
|
1926d91e1d | ||
|
|
0441101786 | ||
|
|
eb8fce3645 | ||
|
|
016294ba6e | ||
|
|
b9ce81b912 | ||
|
|
a9d0563085 | ||
|
|
e6bab9b64c | ||
|
|
513aa20f76 | ||
|
|
83b38e55c0 | ||
|
|
22b23a6d19 | ||
|
|
908f5dc142 | ||
|
|
7ef493ec88 | ||
|
|
6edfd29df0 | ||
|
|
eabbc0ef30 | ||
|
|
bfcd5f4881 | ||
|
|
201fc28a67 | ||
|
|
0026f74dbe | ||
|
|
d116ba348f | ||
|
|
06c0012dd4 | ||
|
|
7b84ffd378 | ||
|
|
cc5d2f24e8 | ||
|
|
c06462aec0 | ||
|
|
a4aaab2e5b | ||
|
|
fe237c4030 | ||
|
|
ff8f32bf10 | ||
|
|
8a8edde78d | ||
|
|
3852512446 | ||
|
|
c926f9491a | ||
|
|
03176fe23c | ||
|
|
d0cb76fff4 | ||
|
|
d76e106382 | ||
|
|
f7ab0b19c7 | ||
|
|
b50df28e38 | ||
|
|
f97d32e253 | ||
|
|
b7a0744324 | ||
|
|
3ef8ff2a43 | ||
|
|
b4844e2ace | ||
|
|
610f5ce75c | ||
|
|
3c4c7896fc | ||
|
|
686752a852 | ||
|
|
8bb1b8da57 | ||
|
|
1b81af591d | ||
|
|
88a8287c1d | ||
|
|
8cc2dbe6f8 | ||
|
|
aec29503bf | ||
|
|
1506a41448 | ||
|
|
63622923f0 | ||
|
|
59c87b8387 | ||
|
|
fdf71e13c4 | ||
|
|
5d49dabade |
@@ -24,8 +24,9 @@ variables:
|
||||
BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true"
|
||||
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled"
|
||||
MESON_TEST_TIMEOUT_MULTIPLIER: 3
|
||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v32"
|
||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v31"
|
||||
FLATPAK_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master"
|
||||
DOCS_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v31"
|
||||
|
||||
.only-default:
|
||||
only:
|
||||
@@ -59,7 +60,6 @@ style-check-diff:
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.png"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*/*.png"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/css/output/*/*.syscap"
|
||||
- "${CI_PROJECT_DIR}/_build_hello/meson-logs"
|
||||
cache:
|
||||
key: "$CI_JOB_NAME"
|
||||
paths:
|
||||
@@ -77,16 +77,10 @@ fedora-x86_64:
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both"
|
||||
script:
|
||||
- .gitlab-ci/show-info-linux.sh
|
||||
- meson subprojects update
|
||||
- mkdir _install
|
||||
- meson --prefix=${CI_PROJECT_DIR}/_install
|
||||
${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
|
||||
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
|
||||
_build
|
||||
- meson compile -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
|
||||
- meson compile -C _build_hello
|
||||
- ninja -C _build
|
||||
- .gitlab-ci/run-tests.sh _build x11
|
||||
- .gitlab-ci/run-tests.sh _build wayland
|
||||
- .gitlab-ci/run-tests.sh _build broadway
|
||||
@@ -98,7 +92,6 @@ release-build:
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=release"
|
||||
script:
|
||||
- .gitlab-ci/show-info-linux.sh
|
||||
- meson subprojects update
|
||||
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
|
||||
_build
|
||||
@@ -113,7 +106,6 @@ installed-tests:
|
||||
EXTRA_MESON_FLAGS: "--prefix=/usr --libdir=/usr/lib64 -Dinstall-tests=true"
|
||||
G_TEST_ACCESSIBLE: 1
|
||||
script:
|
||||
- .gitlab-ci/show-info-linux.sh
|
||||
- meson subprojects update
|
||||
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
|
||||
_build
|
||||
@@ -163,16 +155,13 @@ macos:
|
||||
- macos
|
||||
needs: []
|
||||
before_script:
|
||||
- bash .gitlab-ci/show-info-osx.sh
|
||||
- bash .gitlab-ci/show-execution-environment.sh
|
||||
- pip3 install --user meson==0.56
|
||||
- pip3 install --user ninja
|
||||
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
|
||||
- export MESON_FORCE_BACKTRACE=1
|
||||
script:
|
||||
- meson -Dx11-backend=false
|
||||
-Dbroadway-backend=true
|
||||
-Dmacos-backend=true
|
||||
-Dmedia-gstreamer=disabled
|
||||
-Dintrospection=disabled
|
||||
-Dcpp_std=c++11
|
||||
-Dpixman:tests=disabled
|
||||
@@ -183,22 +172,6 @@ macos:
|
||||
paths:
|
||||
- "${CI_PROJECT_DIR}/_build/meson-logs"
|
||||
|
||||
vs2017-x64:
|
||||
extends: .only-default
|
||||
# TODO: Uncomment this when ready to merge.
|
||||
#only:
|
||||
# - branches@GNOME/gtk
|
||||
stage: build
|
||||
tags:
|
||||
- win32-ps
|
||||
needs: []
|
||||
script:
|
||||
- .gitlab-ci/test-msvc.bat
|
||||
artifacts:
|
||||
when: always
|
||||
paths:
|
||||
- "${CI_PROJECT_DIR}/_build/meson-logs"
|
||||
|
||||
.flatpak-defaults:
|
||||
image: $FLATPAK_IMAGE
|
||||
stage: flatpak
|
||||
@@ -310,7 +283,7 @@ asan-build:
|
||||
allow_failure: true
|
||||
|
||||
reference:
|
||||
image: $FEDORA_IMAGE
|
||||
image: $DOCS_IMAGE
|
||||
stage: docs
|
||||
needs: []
|
||||
variables:
|
||||
|
||||
89
.gitlab-ci/fedora-base.Dockerfile
Normal file
89
.gitlab-ci/fedora-base.Dockerfile
Normal file
@@ -0,0 +1,89 @@
|
||||
FROM fedora:33
|
||||
|
||||
RUN dnf -y install \
|
||||
adwaita-icon-theme \
|
||||
atk-devel \
|
||||
at-spi2-atk-devel \
|
||||
avahi-gobject-devel \
|
||||
cairo-devel \
|
||||
cairo-gobject-devel \
|
||||
ccache \
|
||||
clang \
|
||||
clang-analyzer \
|
||||
colord-devel \
|
||||
cups-devel \
|
||||
dbus-daemon \
|
||||
dbus-x11 \
|
||||
dejavu-sans-mono-fonts \
|
||||
desktop-file-utils \
|
||||
diffutils \
|
||||
elfutils-libelf-devel \
|
||||
fribidi-devel \
|
||||
gcc \
|
||||
gcc-c++ \
|
||||
gdk-pixbuf2-devel \
|
||||
gdk-pixbuf2-modules \
|
||||
gettext \
|
||||
git \
|
||||
glib2-devel \
|
||||
glib2-static \
|
||||
glibc-devel \
|
||||
glibc-headers \
|
||||
gnome-desktop-testing \
|
||||
gobject-introspection-devel \
|
||||
graphene-devel \
|
||||
gstreamer1-devel \
|
||||
gstreamer1-plugins-good \
|
||||
gstreamer1-plugins-bad-free-devel \
|
||||
gstreamer1-plugins-base-devel \
|
||||
gtk-doc \
|
||||
hicolor-icon-theme \
|
||||
iso-codes \
|
||||
itstool \
|
||||
json-glib-devel \
|
||||
lcov \
|
||||
libasan \
|
||||
libattr-devel \
|
||||
libcloudproviders-devel \
|
||||
libepoxy-devel \
|
||||
libffi-devel \
|
||||
libmount-devel \
|
||||
librsvg2 \
|
||||
libselinux-devel \
|
||||
libubsan \
|
||||
libXcomposite-devel \
|
||||
libXcursor-devel \
|
||||
libXcursor-devel \
|
||||
libXdamage-devel \
|
||||
libXfixes-devel \
|
||||
libXi-devel \
|
||||
libXinerama-devel \
|
||||
libxkbcommon-devel \
|
||||
libXrandr-devel \
|
||||
libXrender-devel \
|
||||
libXtst-devel \
|
||||
libxslt \
|
||||
mesa-dri-drivers \
|
||||
mesa-libEGL-devel \
|
||||
mesa-libGLES-devel \
|
||||
meson \
|
||||
ninja-build \
|
||||
pango-devel \
|
||||
pcre-devel \
|
||||
pcre-static \
|
||||
python3 \
|
||||
python3-jinja2 \
|
||||
python3-pip \
|
||||
python3-pygments \
|
||||
python3-wheel \
|
||||
redhat-rpm-config \
|
||||
sassc \
|
||||
systemtap-sdt-devel \
|
||||
vulkan-devel \
|
||||
wayland-devel \
|
||||
wayland-protocols-devel \
|
||||
weston \
|
||||
weston-libs \
|
||||
which \
|
||||
xorg-x11-server-Xvfb \
|
||||
&& dnf clean all
|
||||
18
.gitlab-ci/fedora-docs.Dockerfile
Normal file
18
.gitlab-ci/fedora-docs.Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM registry.gitlab.gnome.org/gnome/gtk/fedora-base:v28
|
||||
|
||||
RUN dnf -y install \
|
||||
graphviz \
|
||||
python3-jinja2 \
|
||||
python3-markdown \
|
||||
python3-pygments \
|
||||
python3-toml \
|
||||
python3-typogrify
|
||||
|
||||
ARG HOST_USER_ID=5555
|
||||
ENV HOST_USER_ID ${HOST_USER_ID}
|
||||
RUN useradd -u $HOST_USER_ID -ms /bin/bash user
|
||||
|
||||
USER user
|
||||
WORKDIR /home/user
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
@@ -1,97 +1,4 @@
|
||||
FROM fedora:34
|
||||
|
||||
RUN dnf -y install \
|
||||
adwaita-icon-theme \
|
||||
atk-devel \
|
||||
at-spi2-atk-devel \
|
||||
avahi-gobject-devel \
|
||||
cairo-devel \
|
||||
cairo-gobject-devel \
|
||||
ccache \
|
||||
clang \
|
||||
clang-analyzer \
|
||||
clang-tools-extra \
|
||||
colord-devel \
|
||||
cups-devel \
|
||||
dbus-daemon \
|
||||
dbus-x11 \
|
||||
dejavu-sans-mono-fonts \
|
||||
desktop-file-utils \
|
||||
diffutils \
|
||||
elfutils-libelf-devel \
|
||||
fribidi-devel \
|
||||
gcc \
|
||||
gcc-c++ \
|
||||
gdk-pixbuf2-devel \
|
||||
gdk-pixbuf2-modules \
|
||||
gettext \
|
||||
git \
|
||||
glib2-devel \
|
||||
glib2-static \
|
||||
glibc-devel \
|
||||
glibc-headers \
|
||||
gnome-desktop-testing \
|
||||
gobject-introspection-devel \
|
||||
graphene-devel \
|
||||
graphviz \
|
||||
gstreamer1-devel \
|
||||
gstreamer1-plugins-good \
|
||||
gstreamer1-plugins-bad-free-devel \
|
||||
gstreamer1-plugins-base-devel \
|
||||
hicolor-icon-theme \
|
||||
iso-codes \
|
||||
itstool \
|
||||
json-glib-devel \
|
||||
lcov \
|
||||
libasan \
|
||||
libattr-devel \
|
||||
libcloudproviders-devel \
|
||||
libepoxy-devel \
|
||||
libffi-devel \
|
||||
libmount-devel \
|
||||
librsvg2 \
|
||||
libselinux-devel \
|
||||
libubsan \
|
||||
libXcomposite-devel \
|
||||
libXcursor-devel \
|
||||
libXcursor-devel \
|
||||
libXdamage-devel \
|
||||
libXfixes-devel \
|
||||
libXi-devel \
|
||||
libXinerama-devel \
|
||||
libxkbcommon-devel \
|
||||
libXrandr-devel \
|
||||
libXrender-devel \
|
||||
libXtst-devel \
|
||||
libxslt \
|
||||
mesa-dri-drivers \
|
||||
mesa-libEGL-devel \
|
||||
mesa-libGLES-devel \
|
||||
meson \
|
||||
ninja-build \
|
||||
pango-devel \
|
||||
pcre-devel \
|
||||
pcre-static \
|
||||
python3 \
|
||||
python3-gobject \
|
||||
python3-jinja2 \
|
||||
python3-markdown \
|
||||
python3-pip \
|
||||
python3-pygments \
|
||||
python3-toml \
|
||||
python3-typogrify \
|
||||
python3-wheel \
|
||||
redhat-rpm-config \
|
||||
sassc \
|
||||
systemtap-sdt-devel \
|
||||
vulkan-devel \
|
||||
wayland-devel \
|
||||
wayland-protocols-devel \
|
||||
weston \
|
||||
weston-libs \
|
||||
which \
|
||||
xorg-x11-server-Xvfb \
|
||||
&& dnf clean all
|
||||
FROM registry.gitlab.gnome.org/gnome/gtk/fedora-base:v28
|
||||
|
||||
# Enable sudo for wheel users
|
||||
RUN sed -i -e 's/# %wheel/%wheel/' -e '0,/%wheel/{s/%wheel/# %wheel/}' /etc/sudoers
|
||||
|
||||
@@ -24,7 +24,6 @@ flatpak build ${builddir} meson \
|
||||
-Dbuild-examples=false \
|
||||
-Dintrospection=disabled \
|
||||
-Ddemos=true \
|
||||
-Dprofile=devel \
|
||||
_flatpak_build
|
||||
|
||||
flatpak build ${builddir} ninja -C _flatpak_build install
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
. /etc/os-release
|
||||
|
||||
echo $PRETTY_NAME
|
||||
@@ -15,7 +15,7 @@ meson \
|
||||
-Dx11-backend=true \
|
||||
-Dwayland-backend=true \
|
||||
-Dbroadway-backend=true \
|
||||
-Dvulkan=enabled \
|
||||
-Dvulkan=yes \
|
||||
-Dprofiler=true \
|
||||
--werror \
|
||||
${EXTRA_MESON_FLAGS:-} \
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
@echo on
|
||||
:: vcvarsall.bat sets various env vars like PATH, INCLUDE, LIB, LIBPATH for the
|
||||
:: specified build architecture
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
|
||||
@echo on
|
||||
|
||||
:: FIXME: make warnings fatal
|
||||
pip3 install --upgrade --user meson==0.56.2 || goto :error
|
||||
meson -Dmedia-gstreamer=disabled _build || goto :error
|
||||
ninja -C _build || goto :error
|
||||
|
||||
goto :EOF
|
||||
:error
|
||||
exit /b 1
|
||||
241
NEWS
241
NEWS
@@ -1,214 +1,4 @@
|
||||
Overview of Changes in 4.3.2
|
||||
============================
|
||||
|
||||
* GtkToggleButton:
|
||||
- Fix the actionable implementation
|
||||
|
||||
* GtkCheckButton:
|
||||
- Fix the actionable implementation
|
||||
- Cancel activation on when the pointer leaves
|
||||
|
||||
* GtkMenuButton:
|
||||
- Make activatable again
|
||||
- Add a way to have an icon + arrow
|
||||
|
||||
* GtkColorButton:
|
||||
- Make activatable again
|
||||
|
||||
* GtkFontButton:
|
||||
- Make activatable again
|
||||
|
||||
* GtkAppChooserButton:
|
||||
- Make activatable again
|
||||
|
||||
* GtkColumnView:
|
||||
- Fix double activation
|
||||
|
||||
* GtkLabel:
|
||||
- Fix mnemonics without markup
|
||||
|
||||
* GtkTreeView:
|
||||
- Clip header buttons
|
||||
|
||||
* GtkTextView:
|
||||
- Add api to get the RTL and LTR contexts
|
||||
- Fix some errors in text history grouping
|
||||
|
||||
* GtkText:
|
||||
- Don't show placeholder text on top of entry text
|
||||
- Add api to compute the cursor extents
|
||||
- Fix y coordinates for text selection
|
||||
|
||||
* GtkFileChooser:
|
||||
- Don't show Trash in the side bar
|
||||
|
||||
* GtkPopoverMenu:
|
||||
- Add scrollbars to long menus
|
||||
|
||||
* GtkActionMuxer:
|
||||
- Fix propagation of accel changes
|
||||
|
||||
* Introspection:
|
||||
- Annotate all filename arguments
|
||||
- Rename GtkMediaStream apis to avoid name collisions
|
||||
- Rename GtkDropTarget properties to avoid name collisions
|
||||
- Make GtkPasswordEntryBuffer introspectable
|
||||
|
||||
* Printing:
|
||||
- Remove the Google Cloud Print backend
|
||||
|
||||
* Theme:
|
||||
- Sync included icons with the Adwaita icon theme
|
||||
|
||||
* GSK:
|
||||
- Avoid overflowing the vertex counter
|
||||
- Handle negative scales correctly in the ngl renderer
|
||||
|
||||
* GDK:
|
||||
- Cleanup and simplify OpenGL setup code
|
||||
- Add a GdkDisplay::init_gl vfunc and gdk_display_prepare_gl() api
|
||||
- Require EGL 1.4
|
||||
- Fix EGL + NVidia
|
||||
|
||||
* Build:
|
||||
- Enable gstreamer by default
|
||||
- Disable Vulkan by default
|
||||
- Remove the sassc option
|
||||
- Remove options and checks for X11 extensions
|
||||
|
||||
* X11:
|
||||
- Stop using XComposite
|
||||
- Remove the Visual cache
|
||||
|
||||
* Wayland:
|
||||
- Fix some DND corner cases
|
||||
- Work with version 2 of pointer-gestures-v1
|
||||
- Look for cursor themes in $HOME/.icons
|
||||
|
||||
* Windows:
|
||||
- Fix SIGILL on x64 due to popcnt
|
||||
- Fix popup placement
|
||||
- Fix drag icon placement
|
||||
- Clean up HiDPI and WGL support
|
||||
- Default to WGL
|
||||
|
||||
* MacOs:
|
||||
- Fix input method support
|
||||
- Register known clipboard types for drop targets
|
||||
- Add initial DND support
|
||||
|
||||
* Translation updates:
|
||||
Brazilian Portuguese
|
||||
Portuguese
|
||||
Romanian
|
||||
Turkish
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in 4.3.1
|
||||
============================
|
||||
|
||||
* GtkEmojiChooser:
|
||||
- Update data from CLDR 39
|
||||
- Load Emoji data for both language and territory
|
||||
|
||||
* GtkCalendar:
|
||||
- Fix an off-by-one error in day numbers
|
||||
|
||||
* GtkListView:
|
||||
- Add .activatable style class to activatable items
|
||||
|
||||
* GtkCheckButton:
|
||||
- Don't allow unchecking grouped radio buttons
|
||||
|
||||
*GtkToggleButton:
|
||||
- Fix mnemonic activation propagation
|
||||
|
||||
* GtkLabel:
|
||||
- Make mnemonics work even when invisible
|
||||
- Fix mnemonic activation propagation
|
||||
|
||||
* GtkMenuButton:
|
||||
- Add a property to mark primary menus and make F10 work
|
||||
|
||||
* GtkApplication:
|
||||
- Fix initial screensaver state async
|
||||
|
||||
* GtkEntry:
|
||||
- Apply xalign to placeholder text (as it was in GTK 3)
|
||||
|
||||
* GtkSpinButton:
|
||||
- Fix swipe gestures
|
||||
|
||||
* GtkStackSwitcher:
|
||||
- Implement GtkOrientable (as it was in GTK 3)
|
||||
- Fix a use-after-free problem with drag timeouts
|
||||
|
||||
* GtkFileChooser:
|
||||
- Add support for (case-insensitive) suffix matches in GtkFileFilter
|
||||
|
||||
* GtkPasswordEntry:
|
||||
- Make GtkPasswordEntryBuffer public, to make it easier
|
||||
to write your own password entry widget
|
||||
|
||||
* Input:
|
||||
- Fix interference between various obscure XKB features
|
||||
(e.g. overlays) and Compose sequences
|
||||
|
||||
* Action support:
|
||||
- Fix submenu-action handling
|
||||
|
||||
* Theme:
|
||||
- Update icons from the Adwaita icon theme
|
||||
- Fix icon names for GtkSwitch
|
||||
- Fix switch-off icon
|
||||
|
||||
* GSK:
|
||||
- Improve transformed offscreen rendering
|
||||
- Add padding between cached glyphs
|
||||
|
||||
* Wayland:
|
||||
- Fix monitor sizes in the presence of transforms
|
||||
- Add a getter for the EGLDisplay
|
||||
- Fix click-drag-release sequences for popovers
|
||||
|
||||
* X11:
|
||||
- Support EGL for X11. Fall back to GLX if EGL isn't available
|
||||
- Always fall back to GLX on NVidia
|
||||
- Add a getter for the EGLDisplay
|
||||
|
||||
* Broadway:
|
||||
- Add a setter for display scale
|
||||
|
||||
* Windows:
|
||||
- Add a getter for the EGLDisplay
|
||||
- Make GL work for media playback
|
||||
|
||||
* MacOS:
|
||||
- Fix menubar appearance
|
||||
|
||||
* Tools:
|
||||
- gtk4-builder-tool: Replace can-focus with focusable in 3-to-4 conversion
|
||||
|
||||
* Introspection:
|
||||
- Add missing annotations in a few places (e.g. gtk_free_view_row_activated)
|
||||
|
||||
* Build:
|
||||
- Only build one source file with -mf16c
|
||||
- Fix devel styling for ci flatpak builds
|
||||
- Generate appdata for demo flatpaks
|
||||
|
||||
* Docs:
|
||||
- Numerous fixes and additions
|
||||
|
||||
* Translation updates:
|
||||
Friulian
|
||||
Nepali
|
||||
Norwegian Bokmål
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in 4.3.0
|
||||
Overview of Changes in 4.2.1
|
||||
============================
|
||||
|
||||
* GtkVideo:
|
||||
@@ -224,12 +14,8 @@ Overview of Changes in 4.3.0
|
||||
- Fix initial font selection
|
||||
|
||||
* Text widgets:
|
||||
- Replace squiggly error underlines by dotted lines
|
||||
- Support translucent selections
|
||||
|
||||
* GtkTextView:
|
||||
- Various improvements to rendering performance
|
||||
|
||||
* GtkScrolledWindow:
|
||||
- Stop using scroll cursors
|
||||
|
||||
@@ -246,12 +32,6 @@ Overview of Changes in 4.3.0
|
||||
- Allow repeated selection extension for MULTIPLE
|
||||
|
||||
* Themes:
|
||||
- Reorganize and rename included themes. The theme is now
|
||||
called Default, with dark, hc and hc-dark variants.
|
||||
Visually, the themes are unchanged.
|
||||
- The theme variants are also available as standalone
|
||||
themes called Default-dark, etc.
|
||||
- The theme named Adwaita is moving to libadwaita
|
||||
- Fix resize border sizing
|
||||
- Fix solid-csd window decorations
|
||||
|
||||
@@ -273,10 +53,6 @@ Overview of Changes in 4.3.0
|
||||
- Fix offscreen rendering with transforms
|
||||
- Fix downscaled textures
|
||||
- Avoid huge intermediate textures
|
||||
- Use fp16 for colors
|
||||
- Optimize handling of underlines in text
|
||||
- Fix corner cases of shadow rendering
|
||||
- Reorganize shader resources
|
||||
- Make shadow rendering match across renderers
|
||||
|
||||
* Accessibility:
|
||||
@@ -285,7 +61,6 @@ Overview of Changes in 4.3.0
|
||||
* Wayland:
|
||||
- Improve font settings fallback
|
||||
- Avoid unintentional rendering freezes with popovers
|
||||
- Support the xdg_activation_v1 protocol
|
||||
|
||||
* X11:
|
||||
- Don't beep on untrusted displays
|
||||
@@ -294,24 +69,10 @@ Overview of Changes in 4.3.0
|
||||
* Windows:
|
||||
- Fix using GL rendering with Mesa drivers
|
||||
|
||||
* Tools:
|
||||
- Add support for copy/paste in gtk4-node-editor
|
||||
- Make syntax highlighting work in the gtk4-demo flatpak
|
||||
|
||||
* Inspector:
|
||||
- Enable the inspector by default, in all cases
|
||||
- Show keyboard layouts
|
||||
- Improve monitor information
|
||||
|
||||
* Translation updates:
|
||||
Catalan
|
||||
Chinese (Taiwan)
|
||||
Dutch
|
||||
Nepali
|
||||
Polish
|
||||
Swedish
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in 4.2.0
|
||||
============================
|
||||
|
||||
11
README.md
11
README.md
@@ -36,13 +36,6 @@ Nightly documentation can be found at
|
||||
- Gdk: https://gnome.pages.gitlab.gnome.org/gtk/gdk4/
|
||||
- Gsk: https://gnome.pages.gitlab.gnome.org/gtk/gsk4/
|
||||
|
||||
Nightly flatpaks of our demos can be installed from the
|
||||
[GNOME Nightly](https://wiki.gnome.org/Apps/Nightly) repository:
|
||||
- `flatpak remote-add --if-not-exists gnome-nightly https://nightly.gnome.org/gnome-nightly.flatpakrepo`
|
||||
- `flatpak install gnome-nightly org.gtk.Demo4`
|
||||
- `flatpak install gnome-nightly org.gtk.WidgetFactory4`
|
||||
- `flatpak install gnome-nightly org.gtk.IconBrowser4`
|
||||
|
||||
Building and installing
|
||||
-----------------------
|
||||
|
||||
@@ -157,8 +150,8 @@ Release notes
|
||||
The release notes for GTK are part of the migration guide in the API
|
||||
reference. See:
|
||||
|
||||
- [3.x release notes](https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html)
|
||||
- [4.x release notes](https://docs.gtk.org/gtk4/migrating-3to4.html)
|
||||
- [3.x release notes](https://developer.gnome.org/gtk3/unstable/gtk-migrating-2-to-3.html)
|
||||
- [4.x release notes](https://developer.gnome.org/gtk4/unstable/gtk-migrating-3-to-4.html)
|
||||
|
||||
Licensing terms
|
||||
---------------
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
diff -ur lua-5.1.4/src/Makefile lua-5.1.4-new/src/Makefile
|
||||
--- lua-5.1.4/src/Makefile 2008-01-19 20:37:58.000000000 +0100
|
||||
+++ lua-5.1.4-new/src/Makefile 2012-02-23 18:26:43.000000000 +0100
|
||||
@@ -23,6 +23,7 @@
|
||||
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
|
||||
|
||||
LUA_A= liblua.a
|
||||
+LUA_SO= liblua.so
|
||||
CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
|
||||
lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \
|
||||
lundump.o lvm.o lzio.o
|
||||
@@ -36,7 +37,7 @@
|
||||
LUAC_O= luac.o print.o
|
||||
|
||||
ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
|
||||
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
|
||||
+ALL_T= $(LUA_A) $(LUA_SO) $(LUA_T) $(LUAC_T)
|
||||
ALL_A= $(LUA_A)
|
||||
|
||||
default: $(PLAT)
|
||||
@@ -51,6 +52,11 @@
|
||||
$(AR) $@ $?
|
||||
$(RANLIB) $@
|
||||
|
||||
+$(LUA_SO): $(CORE_O) $(LIB_O)
|
||||
+ $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)
|
||||
+ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
|
||||
+ ln -sf $(LUA_SO).$(R) $(LUA_SO)
|
||||
+
|
||||
$(LUA_T): $(LUA_O) $(LUA_A)
|
||||
$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
|
||||
|
||||
--- lua-5.1.4/Makefile 2008-08-12 02:40:48.000000000 +0200
|
||||
+++ lua-5.1.4-new/Makefile 2012-02-23 19:06:32.000000000 +0100
|
||||
@@ -53,7 +53,7 @@
|
||||
all: $(PLAT)
|
||||
|
||||
$(PLATS) clean:
|
||||
- cd src && $(MAKE) $@
|
||||
+ cd src && $(MAKE) $@ V=$(V) R=$(R)
|
||||
|
||||
test: dummy
|
||||
src/lua test/hello.lua
|
||||
@@ -93,77 +93,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "boost",
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"./bootstrap.sh --prefix=/app --with-libraries=date_time,filesystem,iostreams,locale,regex,system,thread,python,program_options,test,serialization",
|
||||
"./b2 --build-type=minimal link=shared -j $FLATPAK_BUILDER_N_JOBS",
|
||||
"./b2 --build-type=minimal link=shared install"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://boostorg.jfrog.io/artifactory/main/release/1.69.0/source/boost_1_69_0.tar.bz2",
|
||||
"sha256": "8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "lua-5.1",
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"make -j $FLATPAK_BUILDER_N_JOBS CFLAGS=\"$CFLAGS -fPIC -DLUA_USE_LINUX\" linux",
|
||||
"make INSTALL_TOP=$FLATPAK_DEST TO_LIB='liblua.a liblua.so.5.1.5' install",
|
||||
"ln -sf liblua.so.5.1.5 $FLATPAK_DEST/lib/liblua.so",
|
||||
"ln -sf liblua.so.5.1.5 $FLATPAK_DEST/lib/liblua.so.5.1",
|
||||
"install -Dm0644 etc/lua.pc $FLATPAK_DEST/lib/pkgconfig/lua.pc",
|
||||
"ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua51.pc",
|
||||
"ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua5.1.pc",
|
||||
"ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua-5.1.pc"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://www.lua.org/ftp/lua-5.1.5.tar.gz",
|
||||
"sha256": "2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333"
|
||||
},
|
||||
{
|
||||
"type": "patch",
|
||||
"path": "lua-5.1.5-so.patch"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"commands": [
|
||||
"sed -i \"s|/usr/local|$FLATPAK_DEST|\" etc/lua.pc src/luaconf.h"
|
||||
]
|
||||
}
|
||||
],
|
||||
"cleanup": [
|
||||
"*.a",
|
||||
"/bin",
|
||||
"/include",
|
||||
"/lib/pkgconfig",
|
||||
"/man"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "highlight",
|
||||
"buildsystem" : "simple",
|
||||
"builddir" : true,
|
||||
"build-commands" : [
|
||||
"sed -i -e 's#^PREFIX = /usr#PREFIX = /app#' makefile",
|
||||
"make",
|
||||
"make install"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "archive",
|
||||
"url" : "http://www.andre-simon.de/zip/highlight-4.0.tar.bz2",
|
||||
"sha256" : "f40dcba26e011a2c67df874f4d9b0238c2c6b065163ce8de3d8371b9dfce864d"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "gtk",
|
||||
"buildsystem" : "meson",
|
||||
|
||||
@@ -8,10 +8,10 @@ from pathlib import PurePath
|
||||
|
||||
|
||||
stylesheets = [
|
||||
'gtk/theme/Default/Default-light.css',
|
||||
'gtk/theme/Default/Default-dark.css',
|
||||
'gtk/theme/Default/Default-hc.css',
|
||||
'gtk/theme/Default/Default-hc-dark.css',
|
||||
'gtk/theme/Adwaita/Adwaita.css',
|
||||
'gtk/theme/Adwaita/Adwaita-dark.css',
|
||||
'gtk/theme/HighContrast/HighContrast.css',
|
||||
'gtk/theme/HighContrast/HighContrast-dark.css',
|
||||
]
|
||||
|
||||
references = [
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
repodir = sys.argv[1]
|
||||
profile = sys.argv[2]
|
||||
|
||||
sys.stdout.write("/* This file is auto-generated. Do not edit. */\n")
|
||||
sys.stdout.write("#pragma once\n")
|
||||
sys.stdout.write("\n")
|
||||
sys.stdout.write(f"#define PROFILE \"{profile}\"\n")
|
||||
|
||||
short_sha = os.environ.get('CI_COMMIT_SHORT_SHA')
|
||||
if short_sha is None:
|
||||
cmd = ["git", "-C", repodir, "rev-parse", "--short", "HEAD"]
|
||||
try:
|
||||
with subprocess.Popen(cmd, stdout=subprocess.PIPE) as p:
|
||||
short_sha = p.stdout.read().decode('utf-8').rstrip("\n")
|
||||
except FileNotFoundError:
|
||||
short_sha = ''
|
||||
if profile != 'default':
|
||||
short_sha = 'devel'
|
||||
|
||||
sys.stdout.write(f"#define VCS_TAG \"{short_sha}\"\n")
|
||||
@@ -124,6 +124,9 @@
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#mesondefine HAVE_UNISTD_H
|
||||
|
||||
/* Have the XCOMPOSITE X extension */
|
||||
#mesondefine HAVE_XCOMPOSITE
|
||||
|
||||
/* Have the Xcursor library */
|
||||
#mesondefine HAVE_XCURSOR
|
||||
|
||||
@@ -279,8 +282,3 @@
|
||||
|
||||
/* Define if tracker3 is available */
|
||||
#mesondefine HAVE_TRACKER3
|
||||
|
||||
#mesondefine HAVE_F16C
|
||||
|
||||
/* Does the OS support GDesktopAppInfo? */
|
||||
#mesondefine HAVE_DESKTOPAPPINFO
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">go-previous-symbolic</property>
|
||||
<property name="icon-name">pan-start-symbolic</property>
|
||||
<signal name="clicked" handler="fishbowl_prev_button_clicked_cb" object="bowl" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">go-next-symbolic</property>
|
||||
<property name="icon-name">pan-end-symbolic</property>
|
||||
<signal name="clicked" handler="fishbowl_next_button_clicked_cb" object="bowl" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
@@ -10,8 +10,12 @@
|
||||
<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"/>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">view-refresh-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -1136,7 +1136,7 @@ done:
|
||||
g_free (design_coords);
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
void
|
||||
font_features_font_changed (void)
|
||||
{
|
||||
update_script_combo ();
|
||||
@@ -1144,14 +1144,14 @@ font_features_font_changed (void)
|
||||
update_font_variations ();
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
void
|
||||
font_features_script_changed (void)
|
||||
{
|
||||
update_features ();
|
||||
update_display ();
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
void
|
||||
font_features_reset_features (void)
|
||||
{
|
||||
GList *l;
|
||||
@@ -1197,7 +1197,7 @@ switch_to_label (void)
|
||||
update_display ();
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
void
|
||||
font_features_toggle_edit (void)
|
||||
{
|
||||
if (strcmp (gtk_stack_get_visible_child_name (GTK_STACK (stack)), "label") == 0)
|
||||
@@ -1206,7 +1206,7 @@ font_features_toggle_edit (void)
|
||||
switch_to_label ();
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
void
|
||||
font_features_stop_edit (void)
|
||||
{
|
||||
g_signal_emit_by_name (edit_toggle, "clicked");
|
||||
|
||||
@@ -23,10 +23,13 @@
|
||||
#include "gskshaderpaintable.h"
|
||||
|
||||
/**
|
||||
* GskShaderPaintable:
|
||||
* SECTION:gskshaderpaintable
|
||||
* @Short_description: Drawing with shaders
|
||||
* @Title: GskShaderPaintable
|
||||
* @see_also: #GdkPaintable
|
||||
*
|
||||
* `GskShaderPaintable` is an implementation of the `GdkPaintable` interface
|
||||
* that uses a `GskGLShader` to create pixels.
|
||||
* GskShaderPaintable is an implementation of the #GdkPaintable interface
|
||||
* that uses a #GskGLShader to create pixels.
|
||||
*
|
||||
* You can set the uniform data that the shader needs for rendering
|
||||
* using gsk_shader_paintable_set_args(). This function can
|
||||
@@ -35,7 +38,7 @@
|
||||
*
|
||||
* Commonly, time is passed to shaders as a float uniform containing
|
||||
* the elapsed time in seconds. The convenience API
|
||||
* gsk_shader_paintable_update_time() can be called from a `GtkTickCallback`
|
||||
* gsk_shader_paintable_update_time() can be called from a #GtkTickCallback
|
||||
* to update the time based on the frame time of the frame clock.
|
||||
*/
|
||||
|
||||
@@ -183,7 +186,7 @@ gsk_shader_paintable_init (GskShaderPaintable *self)
|
||||
* pixels. The shader must not require input textures.
|
||||
* If @data is %NULL, all uniform values are set to zero.
|
||||
*
|
||||
* Returns: (transfer full): a new `GskShaderPaintable`
|
||||
* Returns: (transfer full): a new #GskShaderPaintable
|
||||
*/
|
||||
GdkPaintable *
|
||||
gsk_shader_paintable_new (GskGLShader *shader,
|
||||
@@ -212,8 +215,8 @@ gsk_shader_paintable_new (GskGLShader *shader,
|
||||
|
||||
/**
|
||||
* gsk_shader_paintable_set_shader:
|
||||
* @self: a `GskShaderPaintable`
|
||||
* @shader: the `GskGLShader` to use
|
||||
* @self: a #GskShaderPaintable
|
||||
* @shader: the #GskGLShader to use
|
||||
*
|
||||
* Sets the shader that the paintable will use
|
||||
* to create pixels. The shader must not require
|
||||
@@ -238,11 +241,11 @@ gsk_shader_paintable_set_shader (GskShaderPaintable *self,
|
||||
|
||||
/**
|
||||
* gsk_shader_paintable_get_shader:
|
||||
* @self: a `GskShaderPaintable`
|
||||
* @self: a #GskShaderPaintable
|
||||
*
|
||||
* Returns the shader that the paintable is using.
|
||||
*
|
||||
* Returns: (transfer none): the `GskGLShader` that is used
|
||||
* Returns: (transfer none): the #GskGLShader that is used
|
||||
*/
|
||||
GskGLShader *
|
||||
gsk_shader_paintable_get_shader (GskShaderPaintable *self)
|
||||
@@ -254,12 +257,12 @@ gsk_shader_paintable_get_shader (GskShaderPaintable *self)
|
||||
|
||||
/**
|
||||
* gsk_shader_paintable_set_args:
|
||||
* @self: a `GskShaderPaintable`
|
||||
* @self: a #GskShaderPaintable
|
||||
* @data: Data block with uniform data for the shader
|
||||
*
|
||||
* Sets the uniform data that will be passed to the
|
||||
* shader when rendering. The @data will typically
|
||||
* be produced by a `GskUniformDataBuilder`.
|
||||
* be produced by a #GskUniformDataBuilder.
|
||||
*
|
||||
* Note that the @data should be considered immutable
|
||||
* after it has been passed to this function.
|
||||
@@ -281,7 +284,7 @@ gsk_shader_paintable_set_args (GskShaderPaintable *self,
|
||||
|
||||
/**
|
||||
* gsk_shader_paintable_get_args:
|
||||
* @self: a `GskShaderPaintable`
|
||||
* @self: a #GskShaderPaintable
|
||||
*
|
||||
* Returns the uniform data set with
|
||||
* gsk_shader_paintable_get_args().
|
||||
@@ -298,9 +301,9 @@ gsk_shader_paintable_get_args (GskShaderPaintable *self)
|
||||
|
||||
/**
|
||||
* gsk_shader_paintable_update_time:
|
||||
* @self: a `GskShaderPaintable`
|
||||
* @self: a #GskShaderPaintable
|
||||
* @time_idx: the index of the uniform for time in seconds as float
|
||||
* @frame_time: the current frame time, as returned by `GdkFrameClock`
|
||||
* @frame_time: the current frame time, as returned by #GdkFrameClock
|
||||
*
|
||||
* This function is a convenience wrapper for
|
||||
* gsk_shader_paintable_set_args() that leaves all
|
||||
@@ -308,7 +311,7 @@ gsk_shader_paintable_get_args (GskShaderPaintable *self)
|
||||
* index @time_idx, which will be set to the elapsed time
|
||||
* in seconds, since the first call to this function.
|
||||
*
|
||||
* This function is usually called from a `GtkTickCallback`.
|
||||
* This function is usually called from a #GtkTickCallback.
|
||||
*/
|
||||
void
|
||||
gsk_shader_paintable_update_time (GskShaderPaintable *self,
|
||||
|
||||
@@ -74,9 +74,9 @@ gtk_fishbowl_init (GtkFishbowl *fishbowl)
|
||||
/**
|
||||
* gtk_fishbowl_new:
|
||||
*
|
||||
* Creates a new `GtkFishbowl`.
|
||||
* Creates a new #GtkFishbowl.
|
||||
*
|
||||
* Returns: a new `GtkFishbowl`.
|
||||
* Returns: a new #GtkFishbowl.
|
||||
*/
|
||||
GtkWidget*
|
||||
gtk_fishbowl_new (void)
|
||||
|
||||
@@ -163,8 +163,8 @@ drag_update_cb (GtkGestureDrag *drag,
|
||||
|
||||
static void
|
||||
drag_end_cb (GtkGestureDrag *drag,
|
||||
double dx,
|
||||
double dy,
|
||||
gdouble dx,
|
||||
gdouble dy,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkShadertoy *shadertoy = GTK_SHADERTOY (user_data);
|
||||
|
||||
@@ -18,6 +18,8 @@ do_headerbar (GtkWidget *do_widget)
|
||||
GtkWidget *header;
|
||||
GtkWidget *button;
|
||||
GtkWidget *box;
|
||||
GtkWidget *image;
|
||||
GIcon *icon;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
@@ -30,14 +32,20 @@ do_headerbar (GtkWidget *do_widget)
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
|
||||
button = gtk_button_new_from_icon_name ("mail-send-receive-symbolic");
|
||||
button = gtk_button_new ();
|
||||
icon = g_themed_icon_new ("mail-send-receive-symbolic");
|
||||
image = gtk_image_new_from_gicon (icon);
|
||||
g_object_unref (icon);
|
||||
gtk_button_set_child (GTK_BUTTON (button), image);
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_widget_add_css_class (box, "linked");
|
||||
button = gtk_button_new_from_icon_name ("go-previous-symbolic");
|
||||
button = gtk_button_new ();
|
||||
gtk_button_set_child (GTK_BUTTON (button), gtk_image_new_from_icon_name ("pan-start-symbolic"));
|
||||
gtk_box_append (GTK_BOX (box), button);
|
||||
button = gtk_button_new_from_icon_name ("go-next-symbolic");
|
||||
button = gtk_button_new ();
|
||||
gtk_button_set_child (GTK_BUTTON (button), gtk_image_new_from_icon_name ("pan-end-symbolic"));
|
||||
gtk_box_append (GTK_BOX (box), button);
|
||||
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), box);
|
||||
|
||||
@@ -116,25 +116,20 @@ populate_emoji_text (void)
|
||||
GtkWidget *textview;
|
||||
GtkTextBuffer *buffer;
|
||||
GString *s;
|
||||
GtkTextIter iter;
|
||||
|
||||
s = g_string_sized_new (500 * 30 * 4);
|
||||
s = g_string_sized_new (1000 * 30 * 4);
|
||||
|
||||
for (int i = 0; i < 500; i++)
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
if (i % 2)
|
||||
g_string_append (s, "<span underline=\"single\" underline_color=\"red\">x</span>");
|
||||
g_string_append (s, "x");
|
||||
for (int j = 0; j < 30; j++)
|
||||
{
|
||||
g_string_append (s, "💓");
|
||||
g_string_append (s, "<span underline=\"single\" underline_color=\"red\">x</span>");
|
||||
}
|
||||
g_string_append (s, "💓x");
|
||||
g_string_append (s, "\n");
|
||||
}
|
||||
|
||||
buffer = gtk_text_buffer_new (NULL);
|
||||
gtk_text_buffer_get_start_iter (buffer, &iter);
|
||||
gtk_text_buffer_insert_markup (buffer, &iter, s->str, s->len);
|
||||
gtk_text_buffer_set_text (buffer, s->str, s->len);
|
||||
|
||||
g_string_free (s, TRUE);
|
||||
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">go-previous-symbolic</property>
|
||||
<property name="icon-name">pan-start-symbolic</property>
|
||||
<signal name="clicked" handler="iconscroll_prev_clicked_cb"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">go-next-symbolic</property>
|
||||
<property name="icon-name">pan-end-symbolic</property>
|
||||
<signal name="clicked" handler="iconscroll_next_clicked_cb"/>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/* This is the function that creates the GListModel that we need.
|
||||
* GTK list widgets need a GListModel to display, as models support change
|
||||
/* This is the function that creates the #GListModel that we need.
|
||||
* GTK list widgets need a #GListModel to display, as models support change
|
||||
* notifications.
|
||||
* Unfortunately various older APIs do not provide list models, so we create
|
||||
* our own.
|
||||
@@ -20,10 +20,10 @@ create_application_list (void)
|
||||
GListStore *store;
|
||||
GList *apps, *l;
|
||||
|
||||
/* We use a GListStore here, which is a simple array-like list implementation
|
||||
/* We use a #GListStore here, which is a simple array-like list implementation
|
||||
* for manual management.
|
||||
* List models need to know what type of data they provide, so we need to
|
||||
* provide the type here. As we want to do a list of applications, GAppInfo
|
||||
* provide the type here. As we want to do a list of applications, #GAppInfo
|
||||
* is the object we provide.
|
||||
*/
|
||||
store = g_list_store_new (G_TYPE_APP_INFO);
|
||||
@@ -39,7 +39,7 @@ create_application_list (void)
|
||||
}
|
||||
|
||||
/* This is the function we use for setting up new listitems to display.
|
||||
* We add just an GtkImage and a GtkLabel here to display the application's
|
||||
* We add just an #GtkImage and a #GtkLabel here to display the application's
|
||||
* icon and name, as this is just a simple demo.
|
||||
*/
|
||||
static void
|
||||
@@ -61,8 +61,8 @@ setup_listitem_cb (GtkListItemFactory *factory,
|
||||
|
||||
/* Here we need to prepare the listitem for displaying its item. We get the
|
||||
* listitem already set up from the previous function, so we can reuse the
|
||||
* GtkImage widget we set up above.
|
||||
* We get the item - which we know is a GAppInfo because it comes out of
|
||||
* #GtkImage widget we set up above.
|
||||
* We get the item - which we know is a #GAppInfo because it comes out of
|
||||
* the model we set up above, grab its icon and display it.
|
||||
*/
|
||||
static void
|
||||
@@ -85,7 +85,7 @@ bind_listitem_cb (GtkListItemFactory *factory,
|
||||
* the listitem, but this is simple code, so the default implementations are
|
||||
* enough. If we had connected signals, this step would have been necessary.
|
||||
*
|
||||
* The GtkSignalListItemFactory documentation contains more information about
|
||||
* The #GtkSignalListItemFactory documentation contains more information about
|
||||
* this step.
|
||||
*/
|
||||
|
||||
@@ -108,8 +108,8 @@ activate_cb (GtkListView *list,
|
||||
app_info = g_list_model_get_item (G_LIST_MODEL (gtk_list_view_get_model (list)), position);
|
||||
|
||||
/* Prepare the context for launching the application and launch it. This
|
||||
* code is explained in detail in the documentation for GdkAppLaunchContext
|
||||
* and GAppInfo.
|
||||
* code is explained in detail in the documentation for #GdkAppLaunchContext
|
||||
* and #GAppInfo.
|
||||
*/
|
||||
context = gdk_display_get_app_launch_context (gtk_widget_get_display (GTK_WIDGET (list)));
|
||||
if (!g_app_info_launch (app_info,
|
||||
@@ -155,13 +155,13 @@ do_listview_applauncher (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Application Launcher");
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *) &window);
|
||||
|
||||
/* The GtkListitemFactory is what is used to create GtkListItems
|
||||
/* The #GtkListitemFactory is what is used to create #GtkListItems
|
||||
* to display the data from the model. So it is absolutely necessary
|
||||
* to create one.
|
||||
* We will use a GtkSignalListItemFactory because it is the simplest
|
||||
* We will use a #GtkSignalListItemFactory because it is the simplest
|
||||
* one to use. Different ones are available for different use cases.
|
||||
* The most powerful one is GtkBuilderListItemFactory which uses
|
||||
* GtkBuilder .ui files, so it requires little code.
|
||||
* The most powerful one is #GtkBuilderListItemFactory which uses
|
||||
* #GtkBuilder .ui files, so it requires little code.
|
||||
*/
|
||||
factory = gtk_signal_list_item_factory_new ();
|
||||
g_signal_connect (factory, "setup", G_CALLBACK (setup_listitem_cb), NULL);
|
||||
@@ -184,7 +184,7 @@ do_listview_applauncher (GtkWidget *do_widget)
|
||||
*/
|
||||
g_signal_connect (list, "activate", G_CALLBACK (activate_cb), NULL);
|
||||
|
||||
/* List widgets should always be contained in a GtkScrolledWindow,
|
||||
/* List widgets should always be contained in a #GtkScrolledWindow,
|
||||
* because otherwise they might get too large or they might not
|
||||
* be scrollable.
|
||||
*/
|
||||
|
||||
@@ -34,7 +34,6 @@ enum {
|
||||
};
|
||||
|
||||
#define FILE_BROWSER_TYPE_VIEW (file_browser_view_get_type ())
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE (FileBrowserView, file_browser_view, FILE_BROWSER, VIEW, GObject);
|
||||
|
||||
G_DEFINE_TYPE (FileBrowserView, file_browser_view, G_TYPE_OBJECT);
|
||||
@@ -160,7 +159,7 @@ static void file_browser_view_init (FileBrowserView *self)
|
||||
{
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT char *
|
||||
char *
|
||||
filebrowser_get_display_name (GObject *object,
|
||||
GFileInfo *info)
|
||||
{
|
||||
@@ -170,7 +169,7 @@ filebrowser_get_display_name (GObject *object,
|
||||
return g_strdup (g_file_info_get_attribute_string (info, "standard::display-name"));
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT char *
|
||||
char *
|
||||
filebrowser_get_content_type (GObject *object,
|
||||
GFileInfo *info)
|
||||
{
|
||||
@@ -180,7 +179,7 @@ filebrowser_get_content_type (GObject *object,
|
||||
return g_strdup (g_file_info_get_attribute_string (info, "standard::content-type"));
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT char *
|
||||
char *
|
||||
filebrowser_get_size (GObject *object,
|
||||
GFileInfo *info)
|
||||
{
|
||||
@@ -190,7 +189,7 @@ filebrowser_get_size (GObject *object,
|
||||
return g_format_size (g_file_info_get_attribute_uint64 (info, "standard::size"));
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT GIcon *
|
||||
GIcon *
|
||||
filebrowser_get_icon (GObject *object,
|
||||
GFileInfo *info)
|
||||
{
|
||||
@@ -207,7 +206,7 @@ filebrowser_get_icon (GObject *object,
|
||||
return icon;
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
void
|
||||
filebrowser_up_clicked_cb (GtkButton *button,
|
||||
GtkDirectoryList *list)
|
||||
{
|
||||
@@ -220,7 +219,7 @@ filebrowser_up_clicked_cb (GtkButton *button,
|
||||
gtk_directory_list_set_file (list, file);
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
void
|
||||
filebrowser_view_activated_cb (GtkGridView *view,
|
||||
guint pos,
|
||||
GtkDirectoryList *list)
|
||||
|
||||
@@ -751,6 +751,7 @@ demo_filter_by_name (gpointer item,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkTreeListRow *row = item;
|
||||
GtkFilterListModel *model = user_data;
|
||||
GListModel *children;
|
||||
GtkDemo *demo;
|
||||
guint i, n;
|
||||
@@ -761,7 +762,7 @@ demo_filter_by_name (gpointer item,
|
||||
return TRUE;
|
||||
|
||||
g_assert (GTK_IS_TREE_LIST_ROW (row));
|
||||
g_assert (GTK_IS_FILTER_LIST_MODEL (user_data));
|
||||
g_assert (GTK_IS_FILTER_LIST_MODEL (model));
|
||||
|
||||
/* Show a row if itself of any parent matches */
|
||||
for (parent = row; parent; parent = gtk_tree_list_row_get_parent (parent))
|
||||
|
||||
@@ -21,10 +21,8 @@ do_menu (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *box;
|
||||
GtkWidget *sw;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *scale;
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Menu");
|
||||
@@ -33,23 +31,11 @@ do_menu (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_window_set_child (GTK_WINDOW (window), box);
|
||||
|
||||
sw = gtk_scrolled_window_new ();
|
||||
gtk_widget_set_vexpand (sw, TRUE);
|
||||
gtk_box_append (GTK_BOX (box), sw);
|
||||
gtk_window_set_child (GTK_WINDOW (window), sw);
|
||||
|
||||
widget = demo3_widget_new ("/transparent/portland-rose.jpg");
|
||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), widget);
|
||||
|
||||
scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0.01, 10.0, 0.1);
|
||||
gtk_range_set_value (GTK_RANGE (scale), 1.0);
|
||||
gtk_box_append (GTK_BOX (box), scale);
|
||||
|
||||
g_object_bind_property (gtk_range_get_adjustment (GTK_RANGE (scale)), "value",
|
||||
widget, "scale",
|
||||
G_BINDING_BIDIRECTIONAL);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
||||
@@ -205,9 +205,4 @@ install_data('org.gtk.Demo4.gschema.xml', install_dir: gtk_schemasdir)
|
||||
gnome.compile_schemas()
|
||||
|
||||
# appdata
|
||||
configure_file(
|
||||
input: 'org.gtk.Demo4.appdata.xml.in',
|
||||
output: 'org.gtk.Demo4.appdata.xml',
|
||||
configuration: appdata_config,
|
||||
install_dir: gtk_appdatadir
|
||||
)
|
||||
install_data('org.gtk.Demo4.appdata.xml', install_dir: gtk_appdatadir)
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>org.gtk.Demo4</id>
|
||||
<launchable type="desktop-id">org.gtk.Demo4.desktop</launchable>
|
||||
<id>org.gtk.Demo4.desktop</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>LGPL-2.1-or-later</project_license>
|
||||
<project_license>LGPL-2.0+</project_license>
|
||||
<name>GTK Demo</name>
|
||||
<summary>Program to demonstrate GTK functions</summary>
|
||||
<description>
|
||||
@@ -31,11 +30,15 @@
|
||||
<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@" date="@BUILD_DATE@">
|
||||
<release version="3.99.0" date="2020-07-30">
|
||||
<description>
|
||||
<p>A new build of GTK.</p>
|
||||
<p>A new developers snapshot towards GTK 4.0.</p>
|
||||
</description>
|
||||
</release>
|
||||
<release version="3.94.0" date="2018-06-25">
|
||||
<description>
|
||||
<p>A new developers snapshot towards GTK 4.0.</p>
|
||||
</description>
|
||||
</release>
|
||||
</releases>
|
||||
@@ -150,7 +150,7 @@ gtk_nuclear_media_stream_step (gpointer data)
|
||||
* call our pause function to pause the stream.
|
||||
*/
|
||||
if (nuclear->progress >= DURATION)
|
||||
gtk_media_stream_stream_ended (GTK_MEDIA_STREAM (nuclear));
|
||||
gtk_media_stream_ended (GTK_MEDIA_STREAM (nuclear));
|
||||
|
||||
/* The timeout function is removed by the pause function,
|
||||
* so we can just always return this value.
|
||||
@@ -267,11 +267,11 @@ gtk_nuclear_media_stream_init (GtkNuclearMediaStream *nuclear)
|
||||
* However, media streams need to tell GTK once they are initialized,
|
||||
* so we do that here.
|
||||
*/
|
||||
gtk_media_stream_stream_prepared (GTK_MEDIA_STREAM (nuclear),
|
||||
FALSE,
|
||||
TRUE,
|
||||
TRUE,
|
||||
DURATION);
|
||||
gtk_media_stream_prepared (GTK_MEDIA_STREAM (nuclear),
|
||||
FALSE,
|
||||
TRUE,
|
||||
TRUE,
|
||||
DURATION);
|
||||
}
|
||||
|
||||
/* And finally, we add the simple constructor we declared in the header. */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Peg Solitaire
|
||||
* #Keywords: GtkGridView, game
|
||||
*
|
||||
* This demo demonstrates how to use drag-and-drop to implement peg solitaire.
|
||||
* This demo demonstrates how to use drag'n'drop to implement peg solitaire.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -98,7 +98,7 @@ solitaire_peg_init (SolitairePeg *peg)
|
||||
|
||||
/* Add a little setter for the peg's position.
|
||||
* We want to track those so that we can check for legal moves
|
||||
* during drag-and-drop operations.
|
||||
* during drag'n'drop operations.
|
||||
*/
|
||||
static void
|
||||
solitaire_peg_set_position (SolitairePeg *peg,
|
||||
|
||||
@@ -25,43 +25,43 @@ show_shortcuts (GtkWidget *window,
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
void
|
||||
shortcuts_builder_shortcuts (GtkWidget *window)
|
||||
{
|
||||
show_shortcuts (window, "shortcuts-builder", NULL);
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
void
|
||||
shortcuts_gedit_shortcuts (GtkWidget *window)
|
||||
{
|
||||
show_shortcuts (window, "shortcuts-gedit", NULL);
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
void
|
||||
shortcuts_clocks_shortcuts (GtkWidget *window)
|
||||
{
|
||||
show_shortcuts (window, "shortcuts-clocks", NULL);
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
void
|
||||
shortcuts_clocks_shortcuts_stopwatch (GtkWidget *window)
|
||||
{
|
||||
show_shortcuts (window, "shortcuts-clocks", "stopwatch");
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
void
|
||||
shortcuts_boxes_shortcuts (GtkWidget *window)
|
||||
{
|
||||
show_shortcuts (window, "shortcuts-boxes", NULL);
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
void
|
||||
shortcuts_boxes_shortcuts_wizard (GtkWidget *window)
|
||||
{
|
||||
show_shortcuts (window, "shortcuts-boxes", "wizard");
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
void
|
||||
shortcuts_boxes_shortcuts_display (GtkWidget *window)
|
||||
{
|
||||
show_shortcuts (window, "shortcuts-boxes", "display");
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
#include <glib.h>
|
||||
#include <assert.h>
|
||||
|
||||
/* See Golub and Reinsch,
|
||||
* "Handbook for Automatic Computation vol II - Linear Algebra",
|
||||
@@ -40,9 +39,6 @@ householder_reduction (double *A,
|
||||
double *pu, *pui, *pv, *pvi;
|
||||
double half_norm_squared;
|
||||
|
||||
assert (nrows >= 2);
|
||||
assert (ncols >= 2);
|
||||
|
||||
memcpy (U, A, sizeof (double) * nrows * ncols);
|
||||
|
||||
diagonal[0] = 0.0;
|
||||
@@ -209,9 +205,6 @@ givens_reduction (int nrows,
|
||||
int rotation_test;
|
||||
int iteration_count;
|
||||
|
||||
assert (nrows >= 2);
|
||||
assert (ncols >= 2);
|
||||
|
||||
for (i = 0, x = 0.0; i < ncols; i++)
|
||||
{
|
||||
y = fabs (diagonal[i]) + fabs (superdiagonal[i]);
|
||||
@@ -349,9 +342,6 @@ sort_singular_values (int nrows,
|
||||
double temp;
|
||||
double *p1, *p2;
|
||||
|
||||
assert (nrows >= 2);
|
||||
assert (ncols >= 2);
|
||||
|
||||
for (i = 0; i < ncols - 1; i++)
|
||||
{
|
||||
max_index = i;
|
||||
@@ -443,12 +433,9 @@ singular_value_decomposition_solve (double *U,
|
||||
double d;
|
||||
double tolerance;
|
||||
|
||||
assert (nrows >= 2);
|
||||
assert (ncols >= 2);
|
||||
|
||||
tolerance = DBL_EPSILON * S[0] * (double) ncols;
|
||||
|
||||
for (i = 0, pv = V; i < ncols; i++, pv += ncols)
|
||||
for ( i = 0, pv = V; i < ncols; i++, pv += ncols)
|
||||
{
|
||||
x[i] = 0.0;
|
||||
for (j = 0; j < ncols; j++)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
G_MODULE_EXPORT int
|
||||
int
|
||||
spinbutton_hex_spin_input (GtkSpinButton *spin_button,
|
||||
double *new_val)
|
||||
{
|
||||
@@ -29,7 +29,7 @@ spinbutton_hex_spin_input (GtkSpinButton *spin_button,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT int
|
||||
int
|
||||
spinbutton_hex_spin_output (GtkSpinButton *spin_button)
|
||||
{
|
||||
GtkAdjustment *adjustment;
|
||||
@@ -49,7 +49,7 @@ spinbutton_hex_spin_output (GtkSpinButton *spin_button)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT int
|
||||
int
|
||||
spinbutton_time_spin_input (GtkSpinButton *spin_button,
|
||||
double *new_val)
|
||||
{
|
||||
@@ -88,7 +88,7 @@ spinbutton_time_spin_input (GtkSpinButton *spin_button,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT int
|
||||
int
|
||||
spinbutton_time_spin_output (GtkSpinButton *spin_button)
|
||||
{
|
||||
GtkAdjustment *adjustment;
|
||||
@@ -122,7 +122,7 @@ static const char *month[12] = {
|
||||
"December"
|
||||
};
|
||||
|
||||
G_MODULE_EXPORT int
|
||||
int
|
||||
spinbutton_month_spin_input (GtkSpinButton *spin_button,
|
||||
double *new_val)
|
||||
{
|
||||
@@ -151,7 +151,7 @@ spinbutton_month_spin_input (GtkSpinButton *spin_button,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT int
|
||||
int
|
||||
spinbutton_month_spin_output (GtkSpinButton *spin_button)
|
||||
{
|
||||
GtkAdjustment *adjustment;
|
||||
|
||||
@@ -32,10 +32,5 @@ endforeach
|
||||
install_data('org.gtk.IconBrowser4.desktop', install_dir: gtk_applicationsdir)
|
||||
|
||||
# appdata
|
||||
configure_file(
|
||||
input: 'org.gtk.IconBrowser4.appdata.xml.in',
|
||||
output: 'org.gtk.IconBrowser4.appdata.xml',
|
||||
configuration: appdata_config,
|
||||
install_dir: gtk_appdatadir
|
||||
)
|
||||
install_data('org.gtk.IconBrowser4.appdata.xml', install_dir: gtk_appdatadir)
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>org.gtk.IconBrowser4</id>
|
||||
<launchable type="desktop-id">org.gtk.IconBrowser4.desktop</launchable>
|
||||
<id>org.gtk.IconBrowser4.desktop</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>LGPL-2.1-or-later</project_license>
|
||||
<project_license>LGPL-2.0+</project_license>
|
||||
<name>GTK Icon Browser</name>
|
||||
<summary>Program to browse themed icons</summary>
|
||||
<description>
|
||||
@@ -30,11 +29,15 @@
|
||||
<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@" date="@BUILD_DATE@">
|
||||
<release version="3.99.0" date="2020-07-30">
|
||||
<description>
|
||||
<p>A new build of GTK.</p>
|
||||
<p>A new developers snapshot towards GTK 4.0.</p>
|
||||
</description>
|
||||
</release>
|
||||
<release version="3.94.0" date="2018-06-25">
|
||||
<description>
|
||||
<p>A new developers snapshot towards GTK 4.0.</p>
|
||||
</description>
|
||||
</release>
|
||||
</releases>
|
||||
@@ -1,31 +1,19 @@
|
||||
gen_demo_header = find_program('../build-aux/meson/gen-demo-header.py')
|
||||
demo_profile = get_option('profile')
|
||||
demo_conf = configuration_data()
|
||||
demo_conf.set_quoted('PROFILE', get_option('profile'))
|
||||
demo_conf.set_quoted('VCS_TAG', '@VCS_TAG@')
|
||||
|
||||
demo_conf_h = declare_dependency(
|
||||
sources: custom_target('demo-header',
|
||||
command: [gen_demo_header, meson.source_root(), demo_profile],
|
||||
capture: true,
|
||||
output: 'demo_conf.h',
|
||||
build_by_default: true,
|
||||
build_always_stale: true,
|
||||
)
|
||||
sources: vcs_tag(
|
||||
command: [ 'git', 'rev-parse', '--short', 'HEAD' ],
|
||||
fallback: get_option('profile') != 'default' ? 'devel' : '',
|
||||
input: configure_file(
|
||||
output: 'demo_conf.h.in',
|
||||
configuration: demo_conf
|
||||
),
|
||||
output: 'demo_conf.h'
|
||||
)
|
||||
)
|
||||
|
||||
# appdata
|
||||
today = 'unknown'
|
||||
date = find_program('date',
|
||||
required: false)
|
||||
if date.found()
|
||||
r = run_command(date, '-I')
|
||||
if r.returncode() == 0
|
||||
today = r.stdout().strip()
|
||||
endif
|
||||
endif
|
||||
|
||||
appdata_config = configuration_data()
|
||||
appdata_config.set('BUILD_VERSION', meson.project_version())
|
||||
appdata_config.set('BUILD_DATE', today)
|
||||
|
||||
subdir('constraint-editor')
|
||||
subdir('gtk-demo')
|
||||
subdir('icon-browser')
|
||||
|
||||
@@ -635,24 +635,6 @@ export_image_cb (GtkWidget *button,
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
clip_image_cb (GtkWidget *button,
|
||||
NodeEditorWindow *self)
|
||||
{
|
||||
GdkTexture *texture;
|
||||
GdkClipboard *clipboard;
|
||||
|
||||
texture = create_texture (self);
|
||||
if (texture == NULL)
|
||||
return;
|
||||
|
||||
clipboard = gtk_widget_get_clipboard (GTK_WIDGET (self));
|
||||
|
||||
gdk_clipboard_set_texture (clipboard, texture);
|
||||
|
||||
g_object_unref (texture);
|
||||
}
|
||||
|
||||
static void
|
||||
testcase_name_entry_changed_cb (GtkWidget *button,
|
||||
GParamSpec *pspec,
|
||||
@@ -844,7 +826,6 @@ node_editor_window_class_init (NodeEditorWindowClass *class)
|
||||
gtk_widget_class_bind_template_callback (widget_class, open_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, save_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, export_image_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, clip_image_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, testcase_save_clicked_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, testcase_name_entry_changed_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, dark_mode_cb);
|
||||
|
||||
@@ -102,7 +102,6 @@
|
||||
<object class="GtkHeaderBar" id="header">
|
||||
<child type="start">
|
||||
<object class="GtkButton">
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="icon-name">document-open-symbolic</property>
|
||||
<property name="tooltip-text">Open node file</property>
|
||||
<signal name="clicked" handler="open_cb"/>
|
||||
@@ -110,7 +109,6 @@
|
||||
</child>
|
||||
<child type="start">
|
||||
<object class="GtkButton">
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="icon-name">document-save-symbolic</property>
|
||||
<property name="tooltip-text">Save to node file</property>
|
||||
<signal name="clicked" handler="save_cb"/>
|
||||
@@ -118,30 +116,24 @@
|
||||
</child>
|
||||
<child type="start">
|
||||
<object class="GtkButton">
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="icon-name">insert-image-symbolic</property>
|
||||
<property name="tooltip-text">Export to image</property>
|
||||
<signal name="clicked" handler="export_image_cb"/>
|
||||
</object>
|
||||
</child>
|
||||
<child type="start">
|
||||
<object class="GtkButton">
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="icon-name">edit-copy-symbolic</property>
|
||||
<property name="tooltip-text">Copy image to clipboard</property>
|
||||
<signal name="clicked" handler="clip_image_cb"/>
|
||||
<object class="GtkSeparator">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="start">
|
||||
<object class="GtkMenuButton">
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="label">Save Testcase</property>
|
||||
<property name="popover">testcase_popover</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton" id="gear_menu_button">
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="menu-model">gear_menu</property>
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
@@ -149,7 +141,6 @@
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkToggleButton" id="dark_bg_button">
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="has-frame">0</property>
|
||||
<property name="icon-name">display-brightness-symbolic</property>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>org.gtk.PrintEditor4</id>
|
||||
<launchable type="desktop-id">org.gtk.PrintEditor4.desktop</launchable>
|
||||
<id>org.gtk.PrintEditor4.desktop</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>LGPL-2.1-or-later</project_license>
|
||||
<project_license>LGPL-2.0+</project_license>
|
||||
<name>GTK Print Editor</name>
|
||||
<summary>Program to demonstrate GTK printing</summary>
|
||||
<description>
|
||||
@@ -25,7 +24,6 @@
|
||||
<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="3.99.0" date="2020-07-30">
|
||||
<description>
|
||||
|
||||
@@ -159,7 +159,7 @@ save_file (GFile *save_filename)
|
||||
|
||||
error = NULL;
|
||||
g_file_replace_contents (save_filename,
|
||||
text, strlen (text),
|
||||
text, -1,
|
||||
NULL, FALSE,
|
||||
G_FILE_CREATE_NONE,
|
||||
NULL,
|
||||
@@ -721,6 +721,7 @@ static const char ui_info[] =
|
||||
" <item>"
|
||||
" <attribute name='label'>_New</attribute>"
|
||||
" <attribute name='action'>app.new</attribute>"
|
||||
" <attribute name='accel'><Primary>n</attribute>"
|
||||
" </item>"
|
||||
" <item>"
|
||||
" <attribute name='label'>_Open</attribute>"
|
||||
@@ -729,10 +730,12 @@ static const char ui_info[] =
|
||||
" <item>"
|
||||
" <attribute name='label'>_Save</attribute>"
|
||||
" <attribute name='action'>app.save</attribute>"
|
||||
" <attribute name='accel'><Primary>s</attribute>"
|
||||
" </item>"
|
||||
" <item>"
|
||||
" <attribute name='label'>Save _As...</attribute>"
|
||||
" <attribute name='action'>app.save-as</attribute>"
|
||||
" <attribute name='accel'><Primary>s</attribute>"
|
||||
" </item>"
|
||||
" </section>"
|
||||
" <section>"
|
||||
@@ -753,6 +756,7 @@ static const char ui_info[] =
|
||||
" <item>"
|
||||
" <attribute name='label'>_Quit</attribute>"
|
||||
" <attribute name='action'>app.quit</attribute>"
|
||||
" <attribute name='accel'><Primary>q</attribute>"
|
||||
" </item>"
|
||||
" </section>"
|
||||
" </submenu>"
|
||||
@@ -762,6 +766,7 @@ static const char ui_info[] =
|
||||
" <item>"
|
||||
" <attribute name='label'>_About Print Editor</attribute>"
|
||||
" <attribute name='action'>app.about</attribute>"
|
||||
" <attribute name='accel'><Primary>a</attribute>"
|
||||
" </item>"
|
||||
" </section>"
|
||||
" </submenu>"
|
||||
@@ -789,15 +794,6 @@ startup (GApplication *app)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GMenuModel *menubar;
|
||||
struct {
|
||||
const char *action_and_target;
|
||||
const char *accelerators[2];
|
||||
} accels[] = {
|
||||
{ "app.new", { "<Control>n", NULL } },
|
||||
{ "app.quit", { "<Control>q", NULL } },
|
||||
{ "app.save", { "<Control>s", NULL } },
|
||||
{ "app.about", { "<Control>a", NULL } },
|
||||
};
|
||||
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_add_from_string (builder, ui_info, -1, NULL);
|
||||
@@ -806,9 +802,6 @@ startup (GApplication *app)
|
||||
|
||||
gtk_application_set_menubar (GTK_APPLICATION (app), menubar);
|
||||
|
||||
for (int i = 0; i < G_N_ELEMENTS (accels); i++)
|
||||
gtk_application_set_accels_for_action (GTK_APPLICATION (app), accels[i].action_and_target, accels[i].accelerators);
|
||||
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,9 +26,4 @@ foreach size: ['scalable', 'symbolic']
|
||||
endforeach
|
||||
|
||||
# appdata
|
||||
configure_file(
|
||||
input: 'org.gtk.WidgetFactory4.appdata.xml.in',
|
||||
output: 'org.gtk.WidgetFactory4.appdata.xml',
|
||||
configuration: appdata_config,
|
||||
install_dir: gtk_appdatadir
|
||||
)
|
||||
install_data('org.gtk.WidgetFactory4.appdata.xml', install_dir: gtk_appdatadir)
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>org.gtk.WidgetFactory4</id>
|
||||
<launchable type="desktop-id">org.gtk.WidgetFactory4.desktop</launchable>
|
||||
<id>org.gtk.WidgetFactory4.desktop</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>LGPL-2.1-or-later</project_license>
|
||||
<project_license>LGPL-2.0+</project_license>
|
||||
<name>GTK Widget Factory</name>
|
||||
<summary>Program to demonstrate GTK functions</summary>
|
||||
<description>
|
||||
@@ -32,11 +31,15 @@
|
||||
<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@" date="@BUILD_DATE@">
|
||||
<release version="3.99.0" date="2020-07-30">
|
||||
<description>
|
||||
<p>A new build of GTK.</p>
|
||||
<p>A new developers snapshot towards GTK 4.0.</p>
|
||||
</description>
|
||||
</release>
|
||||
<release version="3.94.0" date="2018-06-25">
|
||||
<description>
|
||||
<p>A new developers snapshot towards GTK 4.0.</p>
|
||||
</description>
|
||||
</release>
|
||||
</releases>
|
||||
@@ -50,19 +50,32 @@ change_theme_state (GSimpleAction *action,
|
||||
GtkSettings *settings = gtk_settings_get_default ();
|
||||
const char *s;
|
||||
const char *theme;
|
||||
gboolean prefer_dark = FALSE;
|
||||
|
||||
g_simple_action_set_state (action, state);
|
||||
|
||||
s = g_variant_get_string (state, NULL);
|
||||
|
||||
if (strcmp (s, "default") == 0)
|
||||
theme = "Default";
|
||||
else if (strcmp (s, "dark") == 0)
|
||||
theme = "Default-dark";
|
||||
else if (strcmp (s, "hc") == 0)
|
||||
theme = "Default-hc";
|
||||
else if (strcmp (s, "hc-dark") == 0)
|
||||
theme = "Default-hc-dark";
|
||||
if (strcmp (s, "adwaita") == 0)
|
||||
{
|
||||
theme = "Adwaita";
|
||||
prefer_dark = FALSE;
|
||||
}
|
||||
else if (strcmp (s, "adwaita-dark") == 0)
|
||||
{
|
||||
theme = "Adwaita";
|
||||
prefer_dark = TRUE;
|
||||
}
|
||||
else if (strcmp (s, "highcontrast") == 0)
|
||||
{
|
||||
theme = "HighContrast";
|
||||
prefer_dark = FALSE;
|
||||
}
|
||||
else if (strcmp (s, "highcontrast-inverse") == 0)
|
||||
{
|
||||
theme = "HighContrastInverse";
|
||||
prefer_dark = FALSE;
|
||||
}
|
||||
else if (strcmp (s, "current") == 0)
|
||||
{
|
||||
gtk_settings_reset_property (settings, "gtk-theme-name");
|
||||
@@ -74,7 +87,7 @@ change_theme_state (GSimpleAction *action,
|
||||
|
||||
g_object_set (G_OBJECT (settings),
|
||||
"gtk-theme-name", theme,
|
||||
"gtk-application-prefer-dark-theme", FALSE,
|
||||
"gtk-application-prefer-dark-theme", prefer_dark,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -1873,7 +1886,6 @@ set_up_context_popover (GtkWidget *widget,
|
||||
gtk_widget_set_parent (popover, widget);
|
||||
gtk_popover_set_has_arrow (GTK_POPOVER (popover), FALSE);
|
||||
gesture = gtk_gesture_click_new ();
|
||||
gtk_event_controller_set_name (GTK_EVENT_CONTROLLER (gesture), "widget-factory-context-click");
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
|
||||
g_signal_connect (gesture, "pressed", G_CALLBACK (clicked_cb), popover);
|
||||
gtk_widget_add_controller (widget, GTK_EVENT_CONTROLLER (gesture));
|
||||
@@ -1997,7 +2009,6 @@ activate (GApplication *app)
|
||||
const char *accelerators[2];
|
||||
} accels[] = {
|
||||
{ "app.about", { "F1", NULL } },
|
||||
{ "app.shortcuts", { "<Control>question", NULL } },
|
||||
{ "app.quit", { "<Control>q", NULL } },
|
||||
{ "app.open-in", { "<Control>n", NULL } },
|
||||
{ "win.dark", { "<Control>d", NULL } },
|
||||
|
||||
@@ -15,24 +15,24 @@
|
||||
<attribute name="target">current</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Default</attribute>
|
||||
<attribute name="label" translatable="yes">Adwaita</attribute>
|
||||
<attribute name="action">win.theme</attribute>
|
||||
<attribute name="target">default</attribute>
|
||||
<attribute name="target">adwaita</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Dark</attribute>
|
||||
<attribute name="label" translatable="yes">Adwaita dark</attribute>
|
||||
<attribute name="action">win.theme</attribute>
|
||||
<attribute name="target">dark</attribute>
|
||||
<attribute name="target">adwaita-dark</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Highcontrast</attribute>
|
||||
<attribute name="label" translatable="yes">High contrast</attribute>
|
||||
<attribute name="action">win.theme</attribute>
|
||||
<attribute name="target">hc</attribute>
|
||||
<attribute name="target">highcontrast</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Highcontrast inverse</attribute>
|
||||
<attribute name="label" translatable="yes">High contrast inverse</attribute>
|
||||
<attribute name="action">win.theme</attribute>
|
||||
<attribute name="target">hc-dark</attribute>
|
||||
<attribute name="target">highcontrast-inverse</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
@@ -2606,12 +2606,12 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">go-previous-symbolic</property>
|
||||
<property name="icon-name">pan-start-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">go-next-symbolic</property>
|
||||
<property name="icon-name">pan-end-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -2902,7 +2902,7 @@ bad things might happen.</property>
|
||||
|
||||
<action-widgets>
|
||||
<action-widget response="cancel">cancel_info_dialog</action-widget>
|
||||
<action-widget response="ok" default="true">doit_info_dialog</action-widget>
|
||||
<action-widget response="ok">doit_info_dialog</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
<object class="GtkDialog" id="action_dialog">
|
||||
|
||||
@@ -5,7 +5,7 @@ repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
|
||||
website_url = "https://www.gtk.org"
|
||||
authors = "GTK Development Team"
|
||||
logo_url = "gtk-logo.svg"
|
||||
license = "LGPL-2.1-or-later"
|
||||
license = "GPL-2.1-or-later"
|
||||
description = "The GTK toolkit"
|
||||
dependencies = [ "GObject-2.0", "cairo-1.0", "Pango-1.0", "GdkWayland-4.0", "GdkX11-4.0" ]
|
||||
devhelp = true
|
||||
|
||||
@@ -3,7 +3,7 @@ Title: Key Values
|
||||
## Functions for manipulating keyboard codes
|
||||
|
||||
Key values are the codes which are sent whenever a key is pressed or released.
|
||||
They are included in the data contained in a key press or release `GdkEvent`.
|
||||
They are included in the data contained in a key press or release #GdkEvent.
|
||||
The complete list of key values can be found in the `gdk/gdkkeysyms.h` header
|
||||
file.
|
||||
|
||||
@@ -28,8 +28,8 @@ At the lowest level, physical keys on the keyboard are represented by
|
||||
numeric keycodes, and GDK knows how to translate these keycodes into
|
||||
key values according to the configured keyboard layout and the current
|
||||
state of the keyboard. In the GDK api, the mapping from keycodes to key
|
||||
values is available via [method@Gdk.Display.map_keycode], and the reverse
|
||||
mapping is available via [method@Gdk.Display.map_keyval]. The results of
|
||||
values is available via [`method@Gdk.Display.map_keycode`], and the reverse
|
||||
mapping is available via [`method@Gdk.Display.map_keyval`]. The results of
|
||||
these functions are returned in [struct@Gdk.KeymapKey] structures.
|
||||
|
||||
You can think of a [struct@Gdk.KeymapKey] as a representation of a symbol
|
||||
@@ -45,7 +45,7 @@ information:
|
||||
or the “!” symbol. The letter keys are considered to have a lowercase
|
||||
letter at level 0, and an uppercase letter at level 1, though normally
|
||||
only the uppercase letter is printed on the key
|
||||
1. third, the [struct@Gdk.KeymapKey] contains a group; groups are not used on
|
||||
1. third, the #GdkKeymapKey contains a group; groups are not used on
|
||||
standard US keyboards, but are used in many other countries. On a
|
||||
keyboard with groups, there can be 3 or 4 symbols printed on a single
|
||||
key. The group indicates movement in a horizontal direction. Usually
|
||||
|
||||
@@ -13,7 +13,6 @@ if get_option('gtk_doc')
|
||||
gidocgen,
|
||||
'generate',
|
||||
'--quiet',
|
||||
'--fatal-warnings',
|
||||
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
|
||||
'--config=@INPUT0@',
|
||||
'--output-dir=@OUTPUT@',
|
||||
@@ -35,7 +34,6 @@ if get_option('gtk_doc')
|
||||
gidocgen,
|
||||
'generate',
|
||||
'--quiet',
|
||||
'--fatal-warnings',
|
||||
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
|
||||
'--config=@INPUT0@',
|
||||
'--output-dir=@OUTPUT@',
|
||||
@@ -59,7 +57,6 @@ if get_option('gtk_doc')
|
||||
gidocgen,
|
||||
'generate',
|
||||
'--quiet',
|
||||
'--fatal-warnings',
|
||||
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
|
||||
'--config=@INPUT0@',
|
||||
'--output-dir=@OUTPUT@',
|
||||
|
||||
@@ -5,7 +5,7 @@ repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
|
||||
website_url = "https://www.gtk.org"
|
||||
authors = "GTK Development Team"
|
||||
logo_url = "gtk-logo.svg"
|
||||
license = "LGPL-2.1-or-later"
|
||||
license = "GPL-2.1-or-later"
|
||||
description = "The GTK toolkit"
|
||||
dependencies = [ "GObject-2.0", "Graphene-1.0", "Pango-1.0", "Gdk-4.0" ]
|
||||
devhelp = true
|
||||
|
||||
@@ -8,7 +8,6 @@ if get_option('gtk_doc')
|
||||
gidocgen,
|
||||
'generate',
|
||||
'--quiet',
|
||||
'--fatal-warnings',
|
||||
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
|
||||
'--config=@INPUT0@',
|
||||
'--output-dir=@OUTPUT@',
|
||||
|
||||
@@ -76,16 +76,12 @@ and in some cases a number as arguments.
|
||||
|
||||
`lighter(Color)`
|
||||
: produces a brigher variant of Color
|
||||
|
||||
`darker(Color)`
|
||||
: produces a darker variant of Color
|
||||
|
||||
`shade(Color, Number)`
|
||||
: changes the lightness of Color. The number ranges from 0 for black to 2 for white.
|
||||
|
||||
`alpha(Color, Number)`
|
||||
: replaces the alpha value of color with number (between 0 and 1)
|
||||
|
||||
`mix(Color1, Color2, Number)`
|
||||
: interpolates between the two colors
|
||||
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
Title: Drag-and-Drop in GTK
|
||||
|
||||
Drag-and-Drop (DND) is a user interaction pattern where users drag a UI element
|
||||
from one place to another, either inside a single application or between
|
||||
different application windows.
|
||||
|
||||
When the element is 'dropped', data is transferred from the source to the
|
||||
destination, according to the drag action that is negotiated between both
|
||||
sides. Most commonly, that is a _copy_, but it can also be a _move_ or a
|
||||
_link_, depending on the kind of data and how the drag operation has been
|
||||
set up.
|
||||
|
||||
This chapter gives an overview over how Drag-and-Drop is handled with event
|
||||
controllers in GTK.
|
||||
|
||||
## Drag sources
|
||||
|
||||
To make data available via DND, you create a [class@Gtk.DragSource]. Drag sources
|
||||
are event controllers, which initiate a Drag-and-Drop operation when the user clicks
|
||||
and drags the widget.
|
||||
|
||||
A drag source can be set up ahead of time, with the desired drag action(s) and the data
|
||||
to be transferred. But it is also possible to provide the data when a drag operation
|
||||
is about to begin, by connecting to the [signal@Gtk.DragSource::prepare] signal.
|
||||
|
||||
The GtkDragSource emits the [signal@Gtk.DragSource::drag-begin] signal when the DND
|
||||
operation starts, and the [signal@Gtk.DragSource::drag-end] signal when it is done.
|
||||
But it is not normally necessary to handle these signals. One case in which a ::drag-end
|
||||
handler is necessary is to implement `GDK_ACTION_MOVE`.
|
||||
|
||||
## Drop targets
|
||||
|
||||
To receive data via DND, you create a [class@Gtk.DropTarget], and tell it what kind of
|
||||
data to accept. You need to connect to the [signal@Gtk.DropTarget::drop] signal to receive
|
||||
the data when a DND operation occurs.
|
||||
|
||||
While a DND operation is ongoing, GTK provides updates when the pointer moves over
|
||||
the widget to which the drop target is associated. The [signal@Gtk.DropTarget::enter],
|
||||
[signal@Gtk.DropTarget::leave] and [signal@Gtk.DropTarget::motion] signals get emitted
|
||||
for this purpose.
|
||||
|
||||
GtkDropTarget provides a simple API, and only provides the data when it has been completely
|
||||
transferred. If you need to handle the data transfer yourself (for example to provide progress
|
||||
information during the transfer), you can use the more complicated [class@Gtk.DropTargetAsync].
|
||||
|
||||
## Other considerations
|
||||
|
||||
It is sometimes necessary to update the UI of the destination while a DND operation is ongoing,
|
||||
say to scroll or expand a view, or to switch pages. Typically, such UI changes are triggered
|
||||
by hovering over the widget in question.
|
||||
|
||||
[class@Gtk.DropControllerMotion] is an event controller that can help with implementing such
|
||||
behaviors. It is very similar to [class@Gtk.EventControllerMotion], but provides events during
|
||||
a DND operation.
|
||||
@@ -106,7 +106,7 @@ The call to [ctor@Gtk.ApplicationWindow.new] will create a new
|
||||
window will have a frame, a title bar, and window controls depending on the
|
||||
platform.
|
||||
|
||||
A window title is set using [method@Gtk.Window.set_title]. This function
|
||||
A window title is set using [`method@Gtk.Window.set_title`]. This function
|
||||
takes a `GtkWindow` pointer and a string as input. As our `window` pointer
|
||||
is a `GtkWidget` pointer, we need to cast it to `GtkWindow`; instead of
|
||||
casting `window` via a typical C cast like `(GtkWindow*)`, `window` can be
|
||||
@@ -115,7 +115,7 @@ pointer is an instance of the `GtkWindow` class, before casting, and emit a
|
||||
warning if the check fails. More information about this convention can be
|
||||
found [here](https://developer.gnome.org/gobject/stable/gtype-conventions.html).
|
||||
|
||||
Finally the window size is set using [method@Gtk.Window.set_default_size]
|
||||
Finally the window size is set using [`method@Gtk.Window.set_default_size`]
|
||||
and the window is then shown by GTK via [method@Gtk.Widget.show].
|
||||
|
||||
When you close the window, by (for example) pressing the X button, the
|
||||
@@ -161,19 +161,19 @@ activate (GtkApplication *app,
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *button;
|
||||
GtkWidget *box;
|
||||
|
||||
window = gtk_application_window_new (app);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Window");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
|
||||
|
||||
button = gtk_button_new_with_label ("Hello World");
|
||||
gtk_widget_set_halign (button, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_window_set_child (GTK_WINDOW (window), box);
|
||||
|
||||
button = gtk_button_new_with_label ("Hello World");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window);
|
||||
|
||||
gtk_window_set_child (GTK_WINDOW (window), button);
|
||||
gtk_box_append (GTK_BOX (box), button);
|
||||
|
||||
gtk_widget_show (window);
|
||||
}
|
||||
@@ -212,10 +212,10 @@ The `GtkBox` widget is created with [ctor@Gtk.Box.new], which takes a
|
||||
this box will contain can either be laid out horizontally or vertically.
|
||||
This does not matter in this particular case, as we are dealing with only
|
||||
one button. After initializing box with the newly created `GtkBox`, the code
|
||||
adds the box widget to the window widget using [method@Gtk.Window.set_child].
|
||||
adds the box widget to the window widget using [`method@Gtk.Window.set_child`].
|
||||
|
||||
Next the `button` variable is initialized in similar manner.
|
||||
[ctor@Gtk.Button.new_with_label] is called which returns a
|
||||
[`ctor@Gtk.Button.new_with_label`] is called which returns a
|
||||
[class@Gtk.Button] to be stored in `button`. Afterwards `button` is added to
|
||||
our `box`.
|
||||
|
||||
@@ -353,7 +353,7 @@ draw function.
|
||||
The contents of a widget often need to be partially or fully redrawn, e.g.
|
||||
when another window is moved and uncovers part of the widget, or when the
|
||||
window containing it is resized. It is also possible to explicitly cause a
|
||||
widget to be redrawn, by calling [method@Gtk.Widget.queue_draw]. GTK takes
|
||||
widget to be redrawn, by calling [`method@Gtk.Widget.queue_draw`]. GTK takes
|
||||
care of most of the details by providing a ready-to-use cairo context to the
|
||||
draw function.
|
||||
|
||||
@@ -690,16 +690,16 @@ gcc $( pkg-config --cflags gtk4 ) -o example-3 example-3.c $( pkg-config --libs
|
||||
|
||||
Note that `GtkBuilder` can also be used to construct objects that are
|
||||
not widgets, such as tree models, adjustments, etc. That is the reason
|
||||
the method we use here is called [method@Gtk.Builder.get_object] and returns
|
||||
the method we use here is called [`method@Gtk.Builder.get_object`] and returns
|
||||
a `GObject` instead of a `GtkWidget`.
|
||||
|
||||
Normally, you would pass a full path to [method@Gtk.Builder.add_from_file] to
|
||||
Normally, you would pass a full path to [`method@Gtk.Builder.add_from_file`] to
|
||||
make the execution of your program independent of the current directory.
|
||||
A common location to install UI descriptions and similar data is
|
||||
`/usr/share/appname`.
|
||||
|
||||
It is also possible to embed the UI description in the source code as a
|
||||
string and use [method@Gtk.Builder.add_from_string] to load it. But keeping the
|
||||
string and use [`method@Gtk.Builder.add_from_string`] to load it. But keeping the
|
||||
UI description in a separate file has several advantages: It is then possible
|
||||
to make minor adjustments to the UI without recompiling your program, and,
|
||||
more importantly, graphical UI editors such as [Glade](http://glade.gnome.org)
|
||||
@@ -985,7 +985,7 @@ glib-compile-resources exampleapp.gresource.xml --target=resources.c --generate-
|
||||
```
|
||||
|
||||
The gnome module of the [Meson build system](https://mesonbuild.com)
|
||||
provides the [gnome.compile_resources()](https://mesonbuild.com/Gnome-module.html#gnomecompile_resources)
|
||||
provides the [`gnome.compile_resources()`](https://mesonbuild.com/Gnome-module.html#gnomecompile_resources)
|
||||
method for this task.
|
||||
|
||||
Our application now looks like this:
|
||||
@@ -1081,7 +1081,7 @@ tell it to display information about our stack.
|
||||
|
||||
The stack switcher gets all its information it needs to display tabs from
|
||||
the stack that it belongs to. Here, we are passing the label to show for
|
||||
each file as the last argument to the [method@Gtk.Stack.add_titled]
|
||||
each file as the last argument to the [`method@Gtk.Stack.add_titled`]
|
||||
function.
|
||||
|
||||
Our application is beginning to take shape:
|
||||
@@ -1221,7 +1221,7 @@ Before we can make use of this schema in our application, we need to compile
|
||||
it into the binary form that GSettings expects. GIO provides
|
||||
[macros](https://developer.gnome.org/gio/2.36/ch31s06.html) to do this in
|
||||
autotools-based projects, and the gnome module of the Meson build system
|
||||
provides the [gnome.compile_schemas()](https://mesonbuild.com/Gnome-module.html#gnomecompile_schemas)
|
||||
provides the [`gnome.compile_schemas()`](https://mesonbuild.com/Gnome-module.html#gnomecompile_schemas)
|
||||
method for this task.
|
||||
|
||||
Next, we need to connect our settings to the widgets that they are supposed
|
||||
|
||||
@@ -46,8 +46,7 @@ display, unless specified otherwise.
|
||||
<para>
|
||||
<command>gtk4-launch</command> takes at least one argument, the name of
|
||||
the application to launch. The name should match application desktop file name,
|
||||
as residing in the applications subdirectories of the XDG data directories, with
|
||||
or without the '.desktop' suffix.
|
||||
as residing in /usr/share/application, with or without the '.desktop' suffix.
|
||||
</para>
|
||||
<para>
|
||||
If called with more than one argument, the rest of them besides the application
|
||||
@@ -72,14 +71,4 @@ application.
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1><title>Environment</title>
|
||||
<para>Some environment variables affect the behavior of <command>gtk4-launch</command>.</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><option>XDG_DATA_HOME</option>, <option>XDG_DATA_DIRS</option></term>
|
||||
<listitem><para>The environment variables specifying the XDG dta directories.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
@@ -5,7 +5,7 @@ repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
|
||||
website_url = "https://www.gtk.org"
|
||||
authors = "GTK Development Team"
|
||||
logo_url = "gtk-logo.svg"
|
||||
license = "LGPL-2.1-or-later"
|
||||
license = "GPL-2.1-or-later"
|
||||
description = "The GTK toolkit"
|
||||
dependencies = [ "GObject-2.0", "Graphene-1.0", "Pango-1.0", "Gdk-4.0", "Gsk-4.0" ]
|
||||
devhelp = true
|
||||
@@ -57,7 +57,6 @@ content_files = [
|
||||
"initialization.md",
|
||||
"actions.md",
|
||||
"input-handling.md",
|
||||
"drag-and-drop.md",
|
||||
"drawing-model.md",
|
||||
"css-overview.md",
|
||||
"css-properties.md",
|
||||
|
||||
@@ -7,7 +7,7 @@ Title: Initialization
|
||||
Before using GTK, you need to initialize it using [func@Gtk.init]; this
|
||||
connects to the windowing system, sets up the locale and performs other
|
||||
initialization tasks. [func@Gtk.init] exits the application if errors occur;
|
||||
to avoid this, you can use [func@Gtk.init_check], which allows you to recover
|
||||
to avoid this, you can use [`func@Gtk.init_check`], which allows you to recover
|
||||
from a failed GTK initialization; for instance, you might start up your
|
||||
application in text mode instead.
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ if get_option('gtk_doc')
|
||||
gidocgen,
|
||||
'generate',
|
||||
'--quiet',
|
||||
'--fatal-warnings',
|
||||
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
|
||||
'--config=@INPUT0@',
|
||||
'--output-dir=@OUTPUT@',
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -33,13 +33,13 @@ the question you have, this list is a good place to start.
|
||||
|
||||
4. How does memory management work in GTK? Should I free data returned from functions?
|
||||
|
||||
See the documentation for `GObject` and `GInitiallyUnowned`. For `GObject` note
|
||||
specifically `g_object_ref()` and `g_object_unref()`. `GInitiallyUnowned` is a
|
||||
subclass of `GObject` so the same points apply, except that it has a "floating"
|
||||
See the documentation for #GObject and #GInitiallyUnowned. For #GObject note
|
||||
specifically g_object_ref() and g_object_unref(). #GInitiallyUnowned is a
|
||||
subclass of #GObject so the same points apply, except that it has a "floating"
|
||||
state (explained in its documentation).
|
||||
|
||||
For strings returned from functions, they will be declared "const" if they should
|
||||
not be freed. Non-const strings should be freed with `g_free()`. Arrays follow the
|
||||
not be freed. Non-const strings should be freed with g_free(). Arrays follow the
|
||||
same rule. If you find an undocumented exception to the rules, please
|
||||
[file a bug report.](https://gitlab.gnome.org/GNOME/gtk/issues/new).
|
||||
|
||||
@@ -47,7 +47,7 @@ the question you have, this list is a good place to start.
|
||||
documentation can provide useful hints for memory handling semantics as well.
|
||||
|
||||
5. Why does my program leak memory, if I destroy a widget immediately
|
||||
after creating it?
|
||||
after creating it ?
|
||||
|
||||
If `GtkFoo` isn't a toplevel window, then
|
||||
|
||||
@@ -60,7 +60,7 @@ the question you have, this list is a good place to start.
|
||||
want standard reference counting, not floating reference counting.
|
||||
|
||||
To get this, you must acquire a reference to the widget and drop the
|
||||
floating reference (_ref and sink_ in `GObject` parlance) after creating it:
|
||||
floating reference (_ref and sink_ in GObject parlance) after creating it:
|
||||
|
||||
foo = gtk_foo_new ();
|
||||
g_object_ref_sink (foo);
|
||||
@@ -72,12 +72,12 @@ the question you have, this list is a good place to start.
|
||||
6. How do I use GTK with threads?
|
||||
|
||||
GTK requires that all GTK API calls are made from the same thread in which
|
||||
the `GtkApplication` was created, or `gtk_init()` was called (the _main thread_).
|
||||
the #GtkApplication was created, or gtk_init() was called (the _main thread_).
|
||||
|
||||
If you want to take advantage of multi-threading in a GTK application,
|
||||
it is usually best to send long-running tasks to worker threads, and feed
|
||||
the results back to the main thread using `g_idle_add()` or `GAsyncQueue`. GIO
|
||||
offers useful tools for such an approach such as `GTask`.
|
||||
the results back to the main thread using g_idle_add() or #GAsyncQueue. GIO
|
||||
offers useful tools for such an approach such as #GTask.
|
||||
|
||||
7. How do I internationalize a GTK program?
|
||||
|
||||
@@ -239,7 +239,7 @@ the question you have, this list is a good place to start.
|
||||
|
||||
gdk_surface_set_events (gdk_surface,
|
||||
(GdkEventMask) GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
|
||||
|
||||
|
||||
There are very few functions that require this cast, however.
|
||||
|
||||
10. How do I use GTK with other non-C languages?
|
||||
@@ -250,14 +250,14 @@ the question you have, this list is a good place to start.
|
||||
11. How do I load an image or animation from a file?
|
||||
|
||||
To load an image file straight into a display widget, use
|
||||
[ctor@Gtk.Image.new_from_file]. To load an image for another purpose, use
|
||||
[ctor@Gdk.Texture.new_from_file]. To load a video from a file, use
|
||||
[ctor@Gtk.MediaFile.new_for_file].
|
||||
gtk_image_new_from_file(). To load an image for another purpose, use
|
||||
gdk_texture_new_from_file(). To load a video from a file, use
|
||||
gtk_media_file_new_for_file().
|
||||
|
||||
12. How do I draw text?
|
||||
|
||||
To draw a piece of text onto a cairo surface, use a Pango layout and
|
||||
[func@PangoCairo.show_layout].
|
||||
pango_cairo_show_layout().
|
||||
|
||||
layout = gtk_widget_create_pango_layout (widget, text);
|
||||
fontdesc = pango_font_description_from_string ("Luxi Mono 12");
|
||||
@@ -265,17 +265,17 @@ the question you have, this list is a good place to start.
|
||||
pango_cairo_show_layout (cr, layout);
|
||||
pango_font_description_free (fontdesc);
|
||||
g_object_unref (layout);
|
||||
|
||||
|
||||
See also the [Cairo Rendering](https://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html)
|
||||
section of the [Pango documentation](https://developer.gnome.org/pango/stable/).
|
||||
|
||||
To draw a piece of text in a widget [vfunc@Gtk.Widget.snapshot] implementation,
|
||||
use [method@Gtk.Snapshot.append_layout].
|
||||
To draw a piece of text in a widget snapshot() implementation, use
|
||||
gtk_snapshot_append_layout().
|
||||
|
||||
13. How do I measure the size of a piece of text?
|
||||
|
||||
To obtain the size of a piece of text, use a Pango layout and
|
||||
[method@Pango.Layout.get_pixel_size], using code like the following:
|
||||
pango_layout_get_pixel_size(), using code like the following:
|
||||
|
||||
layout = gtk_widget_create_pango_layout (widget, text);
|
||||
fontdesc = pango_font_description_from_string ("Luxi Mono 12");
|
||||
@@ -294,7 +294,7 @@ the question you have, this list is a good place to start.
|
||||
compiler to optimize the call away if it appears that the value is not
|
||||
being used.
|
||||
|
||||
GLib provides the `g_type_ensure()` function to work around this problem.
|
||||
GLib provides the g_type_ensure() function to work around this problem.
|
||||
|
||||
g_type_ensure (GTK_TYPE_BLAH);
|
||||
|
||||
@@ -311,34 +311,34 @@ the question you have, this list is a good place to start.
|
||||
and the required formatting flexibility.
|
||||
|
||||
If you want to display a large amount of data in a uniform way, your best
|
||||
option is a [class@Gtk.TreeView] widget. See the [tree widget overview](#TreeWidget).
|
||||
option is a #GtkTreeView widget. See the [tree widget overview](#TreeWidget).
|
||||
A list is just a tree with no branches, so the treeview widget is used for
|
||||
lists as well.
|
||||
|
||||
If you want to display a small amount of items, but need flexible formatting
|
||||
and widgetry inside the list, then you probably want to use a [class@Gtk.ListBox],
|
||||
and widgetry inside the list, then you probably want to use a #GtkListBox,
|
||||
which uses regular widgets for display.
|
||||
|
||||
17. ...for multi-line text display or editing?
|
||||
|
||||
See the [text widget overview](#TextWidget) -- you should use the
|
||||
[class@Gtk.TextView] widget.
|
||||
#GtkTextView widget.
|
||||
|
||||
If you only have a small amount of text, [class@Gtk.Label] may also be appropriate
|
||||
of course. It can be made selectable with [method@Gtk.Label.set_selectable]. For a
|
||||
single-line text entry, see [class@Gtk.Entry].
|
||||
If you only have a small amount of text, #GtkLabel may also be appropriate
|
||||
of course. It can be made selectable with gtk_label_set_selectable(). For a
|
||||
single-line text entry, see #GtkEntry.
|
||||
|
||||
18. ...to display an image or animation?
|
||||
|
||||
GTK has two widgets that are dedicated to displaying images. [class@Gtk.Image], for
|
||||
small, fixed-size icons and [class@Gtk.Picture] for content images.
|
||||
GTK has two widgets that are dedicated to displaying images. #GtkImage, for
|
||||
small, fixed-size icons and #GtkPicture for content images.
|
||||
|
||||
Both can display images in just about any format GTK understands.
|
||||
You can also use [class@Gtk.DrawingArea] if you need to do something more complex,
|
||||
You can also use #GtkDrawingArea if you need to do something more complex,
|
||||
such as draw text or graphics over the top of the image.
|
||||
|
||||
Both [class@Gtk.Image] and [class@Gtk.Picture] can display animations and videos as well.
|
||||
To show an webm file, load it with the [class@Gtk.MediaFile] API and then use
|
||||
Both GtkImage and GtkPicture can display animations and videos as well.
|
||||
To show an webm file, load it with the GtkMediaFile API and then use
|
||||
it as a paintable:
|
||||
|
||||
mediafile = gtk_media_file_new_for_filename ("example.webm");
|
||||
@@ -347,10 +347,8 @@ the question you have, this list is a good place to start.
|
||||
19. ...for presenting a set of mutually-exclusive choices, where Windows
|
||||
would use a combo box?
|
||||
|
||||
With GTK, a [class@Gtk.ComboBox] is the recommended widget to use for this use case.
|
||||
If you need an editable text entry, use the [property@Gtk.ComboBox:has-entry] property.
|
||||
|
||||
A newer alternative is [class@Gtk.DropDown].
|
||||
With GTK, a #GtkComboBox is the recommended widget to use for this use case.
|
||||
If you need an editable text entry, use the #GtkComboBox:has-entry property.
|
||||
|
||||
## Questions about GtkWidget
|
||||
|
||||
@@ -359,8 +357,8 @@ the question you have, this list is a good place to start.
|
||||
The background color of a widget is determined by the CSS style that applies
|
||||
to it. To change that, you can set style classes on the widget, and provide
|
||||
custom CSS to change the appearance. Such CSS can be loaded with
|
||||
[method@Gtk.CssProvider.load_from_file] and its variants.
|
||||
See [method@Gtk.StyleContext.add_provider].
|
||||
gtk_css_provider_load_from_file() and its variants.
|
||||
See gtk_style_context_add_provider().
|
||||
|
||||
21. How do I change the font of a widget?
|
||||
|
||||
@@ -370,7 +368,7 @@ the question you have, this list is a good place to start.
|
||||
gtk_label_set_markup (label, "<big>big tex</big>");
|
||||
|
||||
This is preferred for many apps because it's a relative size to the
|
||||
user's chosen font size. See `g_markup_escape_text()` if you are
|
||||
user's chosen font size. See g_markup_escape_text() if you are
|
||||
constructing such strings on the fly.
|
||||
|
||||
You can also change the font of a widget by putting
|
||||
@@ -379,24 +377,24 @@ the question you have, this list is a good place to start.
|
||||
font: Sans 30;
|
||||
}
|
||||
|
||||
in a CSS file, loading it with [method@Gtk.CssProvider.load_from_file], and
|
||||
adding the provider with [func@Gtk.StyleContext.add_provider_for_display].
|
||||
in a CSS file, loading it with gtk_css_provider_load_from_file(), and
|
||||
adding the provider with gtk_style_context_add_provider_for_display().
|
||||
To associate this style information with your widget, set a style class
|
||||
on the widget using [method@Gtk.Widget.add_css_class]. The advantage
|
||||
on its #GtkStyleContext using gtk_style_context_add_class(). The advantage
|
||||
of this approach is that users can then override the font you have chosen.
|
||||
See the `GtkStyleContext` documentation for more discussion.
|
||||
See the #GtkStyleContext documentation for more discussion.
|
||||
|
||||
22. How do I disable/ghost/desensitize a widget?
|
||||
|
||||
In GTK a disabled widget is termed _insensitive_.
|
||||
See [method@Gtk.Widget.set_sensitive].
|
||||
See gtk_widget_set_sensitive().
|
||||
|
||||
## GtkTextView questions
|
||||
|
||||
23. How do I get the contents of the entire text widget as a string?
|
||||
|
||||
See [method@Gtk.TextBuffer.get_bounds] and [method@Gtk.TextBuffer.get_text]
|
||||
or [method@Gtk.TextIter.get_text].
|
||||
See gtk_text_buffer_get_bounds() and gtk_text_buffer_get_text()
|
||||
or gtk_text_iter_get_text().
|
||||
|
||||
GtkTextIter start, end;
|
||||
GtkTextBuffer *buffer;
|
||||
@@ -407,10 +405,10 @@ the question you have, this list is a good place to start.
|
||||
text = gtk_text_iter_get_text (&start, &end);
|
||||
/* use text */
|
||||
g_free (text);
|
||||
|
||||
|
||||
24. How do I make a text widget display its complete contents in a specific font?
|
||||
|
||||
If you use [method@Gtk.TextBuffer.insert_with_tags] with appropriate tags to
|
||||
If you use gtk_text_buffer_insert_with_tags() with appropriate tags to
|
||||
select the font, the inserted text will have the desired appearance, but
|
||||
text typed in by the user before or after the tagged block will appear in
|
||||
the default style.
|
||||
@@ -423,40 +421,40 @@ the question you have, this list is a good place to start.
|
||||
*before*, keeping the mark at the end.
|
||||
|
||||
To ensure that the end of the buffer remains visible, use
|
||||
[method@Gtk.TextView.scroll_to_mark] to scroll to the mark after
|
||||
gtk_text_view_scroll_to_mark() to scroll to the mark after
|
||||
inserting new text.
|
||||
|
||||
The gtk4-demo application contains an example of this technique.
|
||||
The gtk-demo application contains an example of this technique.
|
||||
|
||||
## GtkTreeView questions
|
||||
|
||||
26. How do I associate some data with a row in the tree?
|
||||
|
||||
Remember that the [class@Gtk.TreeModel] columns don't necessarily have to be
|
||||
Remember that the #GtkTreeModel columns don't necessarily have to be
|
||||
displayed. So you can put non-user-visible data in your model just
|
||||
like any other data, and retrieve it with [method@Gtk.TreeModel.get].
|
||||
See the [tree widget overview](#TreeWidget).
|
||||
like any other data, and retrieve it with gtk_tree_model_get().
|
||||
See the [tree widget overview](#TreeWidget).
|
||||
|
||||
27. How do I put an image and some text in the same column?
|
||||
|
||||
You can pack more than one [class@Gtk.CellRenderer] into a single [class@Gtk.TreeViewColumn]
|
||||
using [method@Gtk.TreeViewColumn.pack_start] or [method@Gtk.TreeViewColumn.pack_end].
|
||||
So pack both a [class@Gtk.CellRendererPixbuf] and a [class@Gtk.CellRendererText] into the
|
||||
You can pack more than one #GtkCellRenderer into a single #GtkTreeViewColumn
|
||||
using gtk_tree_view_column_pack_start() or gtk_tree_view_column_pack_end().
|
||||
So pack both a #GtkCellRendererPixbuf and a #GtkCellRendererText into the
|
||||
column.
|
||||
|
||||
28. I can set data easily on my [class@Gtk.TreeStore] or [class@Gtk.ListStore] models using
|
||||
[method@Gtk.ListStore.set] and [method@Gtk.TreeStore.set], but can't read it back?
|
||||
28. I can set data easily on my #GtkTreeStore or #GtkListStore models using
|
||||
gtk_list_store_set() and gtk_tree_store_set(), but can't read it back?
|
||||
|
||||
Both the [class@Gtk.TreeStore] and the [class@Gtk.ListStore] implement the [class@Gtk.TreeModel]
|
||||
Both the #GtkTreeStore and the #GtkListStore implement the #GtkTreeModel
|
||||
interface. As a consequence, you can use any function this interface
|
||||
implements. The easiest way to read a set of data back is to use
|
||||
[method@Gtk.TreeModel.get].
|
||||
gtk_tree_model_get().
|
||||
|
||||
29. How do I change the way that numbers are formatted by `GtkTreeView`?
|
||||
29. How do I change the way that numbers are formatted by #GtkTreeView?
|
||||
|
||||
Use [method@Gtk.TreeView.insert_column_with_data_func] or
|
||||
[method@Gtk.TreeViewColumn.set_cell_data_func] and do the conversion
|
||||
from number to string yourself (with, say, `g_strdup_printf()`).
|
||||
Use gtk_tree_view_insert_column_with_data_func() or
|
||||
gtk_tree_view_column_set_cell_data_func() and do the conversion
|
||||
from number to string yourself (with, say, g_strdup_printf()).
|
||||
|
||||
The following example demonstrates this:
|
||||
|
||||
@@ -529,29 +527,29 @@ the question you have, this list is a good place to start.
|
||||
30. How do I hide the expander arrows in my tree view?
|
||||
|
||||
Set the expander-column property of the tree view to a hidden column.
|
||||
See [method@Gtk.TreeView.set_expander_column] and [method@Gtk.TreeViewColumn.set_visible].
|
||||
See gtk_tree_view_set_expander_column() and gtk_tree_view_column_set_visible().
|
||||
|
||||
## Using cairo with GTK
|
||||
|
||||
31. How do I use cairo to draw in GTK applications?
|
||||
|
||||
Use [method@Gtk.Snapshot.append_cairo] in your [vfunc@Gtk.Widget.snapshot] vfunc
|
||||
Use gtk_snapshot_append_cairo() in your #GtkWidgetClass.snapshot() vfunc
|
||||
to obtain a cairo context and draw with that.
|
||||
|
||||
|
||||
32. Can I improve the performance of my application by using another backend
|
||||
of cairo (such as GL)?
|
||||
|
||||
No. Most drawing in GTK is not done via cairo anymore (but instead
|
||||
by the GL or Vulkan renderers of GSK).
|
||||
|
||||
If you use cairo for drawing your own widgets, [method@Gtk.Snapshot.append_cairo]
|
||||
If you use cairo for drawing your own widgets, gtk_snapshot_append_cairo()
|
||||
will choose the most appropriate surface type for you.
|
||||
|
||||
If you are interested in using GL for your own drawing, see [class@Gtk.GLArea].
|
||||
If you are interested in using GL for your own drawing, see #GtkGLArea.
|
||||
|
||||
33. Can I use cairo to draw on a `GdkPixbuf`?
|
||||
33. Can I use cairo to draw on a #GdkPixbuf?
|
||||
|
||||
No. The cairo image surface does not support the pixel format used by `GdkPixbuf`.
|
||||
No. The cairo image surface does not support the pixel format used by GdkPixbuf.
|
||||
|
||||
If you need to get cairo drawing into a format that can be displayed efficiently
|
||||
by GTK, you may want to use an image surface and [ctor@Gdk.MemoryTexture.new].
|
||||
by GTK, you may want to use an image surface and gdk_memory_texture_new().
|
||||
|
||||
@@ -22,26 +22,20 @@ are only available when GTK has been configured with `-Ddebug=true`.
|
||||
`builder`
|
||||
: GtkBuilder support
|
||||
|
||||
`builder-objects`
|
||||
: Unused GtkBuilder objects
|
||||
|
||||
`geometry`
|
||||
: Size allocation
|
||||
|
||||
`icontheme`
|
||||
: Icon themes
|
||||
|
||||
`iconfallback`
|
||||
: Information about icon fallback
|
||||
|
||||
`keybindings`
|
||||
: Keyboard shortcuts
|
||||
: Keybindings
|
||||
|
||||
`modules`
|
||||
: Modules and extensions
|
||||
: Loading of modules
|
||||
|
||||
`printing`
|
||||
: Printing
|
||||
: Printing support
|
||||
|
||||
`size-request`
|
||||
: Size requests
|
||||
@@ -52,15 +46,6 @@ are only available when GTK has been configured with `-Ddebug=true`.
|
||||
`tree`
|
||||
: Tree widget internals
|
||||
|
||||
`constraints`
|
||||
: Constraints and the constraint solver
|
||||
|
||||
`layout`
|
||||
: Layout managers
|
||||
|
||||
`acccessibility`
|
||||
: Accessibility state changs
|
||||
|
||||
A number of keys are influencing behavior instead of just logging:
|
||||
|
||||
`interactive`
|
||||
@@ -72,6 +57,15 @@ A number of keys are influencing behavior instead of just logging:
|
||||
`touchscreen`
|
||||
: Pretend the pointer is a touchscreen device
|
||||
|
||||
`updates`
|
||||
: Visual feedback about window updates
|
||||
|
||||
`resize`
|
||||
: Highlight resizing widgets
|
||||
|
||||
`layout`
|
||||
: Show layout borders
|
||||
|
||||
`snapshot`
|
||||
: Include debug render nodes in the generated snapshots
|
||||
|
||||
@@ -330,14 +324,8 @@ using and the GDK backend supports them:
|
||||
`cairo`
|
||||
: Selects the fallback Cairo renderer
|
||||
|
||||
`opengl`
|
||||
: Selects the default OpenGL renderer
|
||||
|
||||
`gl`
|
||||
: Selects the "gl" OpenGL renderer
|
||||
|
||||
`ngl`
|
||||
: Selects the "ngl" OpenGL renderer
|
||||
: Selects the default OpenGL renderer
|
||||
|
||||
`vulkan`
|
||||
: Selects the Vulkan renderer
|
||||
|
||||
@@ -8,7 +8,7 @@ an application's user interface elements. Assistive technology (AT)
|
||||
applications, like Orca, convey this information to users with disabilities,
|
||||
or reduced abilities, to help them use the application.
|
||||
|
||||
Standard GTK controls implement the `GtkAccessible` interface and are thus
|
||||
Standard GTK controls implement the #GtkAccessible interface and are thus
|
||||
accessible to ATs by default. This means that if you use GTK controls such
|
||||
as `GtkButton`, `GtkEntry`, or `GtkListView`, you only need to supply
|
||||
application-specific details when the defaults values are incomplete. You
|
||||
@@ -103,39 +103,39 @@ for instance:
|
||||
|
||||
- a toggle button will change its %GTK_ACCESSIBLE_STATE_CHECKED state every
|
||||
time it is toggled, either by the user or programmatically
|
||||
- setting the mnemonic widget on a `GtkLabel` will update the
|
||||
- setting the mnemonic widget on a #GtkLabel will update the
|
||||
%GTK_ACCESSIBLE_RELATION_LABELLED_BY relation on the widget with a
|
||||
reference to the label
|
||||
- changing the `GtkAdjustment` instance on a `GtkScrollbar` will change the
|
||||
- changing the #GtkAdjustment instance on a #GtkScrollbar will change the
|
||||
%GTK_ACCESSIBLE_PROPERTY_VALUE_MAX, %GTK_ACCESSIBLE_PROPERTY_VALUE_MIN,
|
||||
and %GTK_ACCESSIBLE_PROPERTY_VALUE_NOW properties with the upper, lower,
|
||||
and value properties of the `GtkAdjustment`
|
||||
and value properties of the #GtkAdjustment
|
||||
|
||||
See the [WAI-ARIA](https://www.w3.org/WAI/PF/aria/appendices#quickref) list
|
||||
of attributes for additional information.
|
||||
|
||||
#### List of accessible states
|
||||
|
||||
Each state name is part of the `GtkAccessibleState` enumeration.
|
||||
Each state name is part of the #GtkAccessibleState enumeration.
|
||||
|
||||
| State name | ARIA attribute | Value type | Notes |
|
||||
|------------|----------------|------------|-------|
|
||||
| %GTK_ACCESSIBLE_STATE_BUSY | “aria-busy” | boolean |
|
||||
| %GTK_ACCESSIBLE_STATE_CHECKED | “aria-checked” | `GtkAccessibleTristate` | Indicates the current state of a [class@Gtk.CheckButton] |
|
||||
| %GTK_ACCESSIBLE_STATE_CHECKED | “aria-checked” | #GtkAccessibleTristate | Indicates the current state of a [class@Gtk.CheckButton] |
|
||||
| %GTK_ACCESSIBLE_STATE_DISABLED | “aria-disabled” | boolean | Corresponds to the [property@Gtk.Widget:sensitive] property on [class@Gtk.Widget] |
|
||||
| %GTK_ACCESSIBLE_STATE_EXPANDED | “aria-expanded” | boolean or undefined | Corresponds to the [property@Gtk.Expander:expanded] property on [class@Gtk.Expander] |
|
||||
| %GTK_ACCESSIBLE_STATE_HIDDEN | “aria-hidden” | boolean | Corresponds to the [property@Gtk.Widget:visible] property on [class@Gtk.Widget] |
|
||||
| %GTK_ACCESSIBLE_STATE_INVALID | “aria-invalid” | `GtkAccessibleInvalidState` | Set when a widget is showing an error |
|
||||
| %GTK_ACCESSIBLE_STATE_PRESSED | “aria-pressed” | `GtkAccessibleTristate` | Indicates the current state of a [class@Gtk.ToggleButton] |
|
||||
| %GTK_ACCESSIBLE_STATE_INVALID | “aria-invalid” | #GtkAccessibleInvalidState | Set when a widget is showing an error |
|
||||
| %GTK_ACCESSIBLE_STATE_PRESSED | “aria-pressed” | #GtkAccessibleTristate | Indicates the current state of a [class@Gtk.ToggleButton] |
|
||||
| %GTK_ACCESSIBLE_STATE_SELECTED | “aria-selected” | boolean or undefined | Set when a widget is selected |
|
||||
|
||||
#### List of accessible properties
|
||||
|
||||
Each property name is part of the `GtkAccessibleProperty` enumeration.
|
||||
Each property name is part of the #GtkAccessibleProperty enumeration.
|
||||
|
||||
| State name | ARIA attribute | Value type |
|
||||
|------------|----------------|------------|
|
||||
| %GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE | “aria-autocomplete” | `GtkAccessibleAutocomplete` |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE | “aria-autocomplete” | #GtkAccessibleAutocomplete |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_DESCRIPTION | “aria-description” | translatable string |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_HAS_POPUP | “aria-haspopup” | boolean |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS | “aria-keyshortcuts” | string |
|
||||
@@ -144,12 +144,12 @@ Each property name is part of the `GtkAccessibleProperty` enumeration.
|
||||
| %GTK_ACCESSIBLE_PROPERTY_MODAL | “aria-modal” | boolean |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_MULTI_LINE | “aria-multiline” | boolean |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE | “aria-multiselectable” | boolean |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_ORIENTATION | “aria-orientation” | `GtkOrientation` |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_ORIENTATION | “aria-orientation” | #GtkOrientation |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER | “aria-placeholder” | translatable string |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_READ_ONLY | “aria-readonly” | boolean |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_REQUIRED | “aria-required” | boolean |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION | “aria-roledescription” | translatable string |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_SORT | “aria-sort” | `GtkAccessibleSort` |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_SORT | “aria-sort” | #GtkAccessibleSort |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_VALUE_MAX | “aria-valuemax” | double |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_VALUE_MIN | “aria-valuemin” | double |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_VALUE_NOW | “aria-valuenow” | double |
|
||||
@@ -157,22 +157,22 @@ Each property name is part of the `GtkAccessibleProperty` enumeration.
|
||||
|
||||
#### List of accessible relations
|
||||
|
||||
Each relation name is part of the `GtkAccessibleRelation` enumeration.
|
||||
Each relation name is part of the #GtkAccessibleRelation enumeration.
|
||||
|
||||
| State name | ARIA attribute | Value type |
|
||||
|------------|----------------|------------|
|
||||
| %GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT | “aria-activedescendant” | `GtkAccessible` |
|
||||
| %GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT | “aria-activedescendant” | #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_COL_COUNT | “aria-colcount” | integer |
|
||||
| %GTK_ACCESSIBLE_RELATION_COL_INDEX | “aria-colindex” | integer |
|
||||
| %GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT | “aria-colindextext” | translatable string |
|
||||
| %GTK_ACCESSIBLE_RELATION_COL_SPAN | “aria-colspan” | integer |
|
||||
| %GTK_ACCESSIBLE_RELATION_CONTROLS | “aria-controls” | a list of `GtkAccessible` |
|
||||
| %GTK_ACCESSIBLE_RELATION_DESCRIBED_BY | “aria-describedby” | a list of `GtkAccessible` |
|
||||
| %GTK_ACCESSIBLE_RELATION_DETAILS | “aria-details” | a list of `GtkAccessible` |
|
||||
| %GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE | “aria-errormessage” | `GtkAccessible` |
|
||||
| %GTK_ACCESSIBLE_RELATION_FLOW_TO | “aria-flowto” | a list of `GtkAccessible` |
|
||||
| %GTK_ACCESSIBLE_RELATION_LABELLED_BY | “aria-labelledby” | a list of `GtkAccessible` |
|
||||
| %GTK_ACCESSIBLE_RELATION_OWNS | “aria-owns” | a list of `GtkAccessible` |
|
||||
| %GTK_ACCESSIBLE_RELATION_CONTROLS | “aria-controls” | a list of #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_DESCRIBED_BY | “aria-describedby” | a list of #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_DETAILS | “aria-details” | a list of #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE | “aria-errormessage” | #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_FLOW_TO | “aria-flowto” | a list of #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_LABELLED_BY | “aria-labelledby” | a list of #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_OWNS | “aria-owns” | a list of #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_POS_IN_SET | “aria-posinset” | integer |
|
||||
| %GTK_ACCESSIBLE_RELATION_ROW_COUNT | “aria-rowcount” | integer |
|
||||
| %GTK_ACCESSIBLE_RELATION_ROW_INDEX | “aria-rowindex” | integer |
|
||||
@@ -219,11 +219,11 @@ be used as part of the application's test suite to avoid regressions.
|
||||
|
||||
## Implementations
|
||||
|
||||
Each UI control implements the `GtkAccessible` interface to allow widget and
|
||||
Each UI control implements the #GtkAccessible interface to allow widget and
|
||||
application developers to specify the roles, state, and relations between UI
|
||||
controls. This API is purely descriptive.
|
||||
|
||||
Each `GtkAccessible` implementation must provide a `GtkATContext` instance,
|
||||
Each `GtkAccessible` implementation must provide a #GtkATContext instance,
|
||||
which acts as a proxy to the specific platform's accessibility API:
|
||||
|
||||
* AT-SPI on Linux/BSD
|
||||
@@ -256,7 +256,7 @@ is a promise that the widget being created will provide the same keyboard
|
||||
interactions expected for a button. An accessible role of a button will not
|
||||
turn automatically any widget into a `GtkButton`; but if your widget behaves
|
||||
like a button, using the %GTK_ACCESSIBLE_ROLE_BUTTON will allow any
|
||||
assistive technology to handle it like they would a `GtkButton`.
|
||||
assistive technology to handle it like they would a #GtkButton.
|
||||
|
||||
### Attributes can both hide and enhance
|
||||
|
||||
@@ -308,7 +308,7 @@ interface.
|
||||
|
||||
A "presentation" role should not be confused with the
|
||||
%GTK_ACCESSIBLE_STATE_HIDDEN state; the "hidden" state is transient, and is
|
||||
typically controlled by showing and hiding a widget using the `GtkWidget`
|
||||
typically controlled by showing and hiding a widget using the #GtkWidget
|
||||
API.
|
||||
|
||||
## Design patterns and custom widgets
|
||||
@@ -322,7 +322,7 @@ as well.
|
||||
A button is a widget that enables users to trigger an action. While it is
|
||||
recommended you use `GtkButton` for anything that looks and behaves like a
|
||||
button, it is possible to apply a button behavior to UI elements like images
|
||||
by using a `GtkGestureClick` gesture. When doing so, you should:
|
||||
by using a #GtkGestureClick gesture. When doing so, you should:
|
||||
|
||||
- Give your widget the role %GTK_ACCESSIBLE_ROLE_BUTTON
|
||||
- Install an action with no parameters, which will activate the widget
|
||||
@@ -336,7 +336,7 @@ in the same way as a `GtkSpinButton` or `GtkSearchEntry`.
|
||||
|
||||
### Tab-based UI
|
||||
|
||||
If you make a tab-based interface, you should consider using `GtkStack`
|
||||
If you make a tab-based interface, you should consider using #GtkStack
|
||||
as the core, and just make a custom tab widget to control the active
|
||||
stack page. When doing so, the following extra steps will ensure that
|
||||
your tabs are accessible in the same way as `GtkStackSwitcher` or `GtkNotebook`:
|
||||
@@ -344,7 +344,7 @@ your tabs are accessible in the same way as `GtkStackSwitcher` or `GtkNotebook`:
|
||||
- Give your tab container the role %GTK_ACCESSIBLE_ROLE_TAB_LIST
|
||||
- Give your tab widgets the role %GTK_ACCESSIBLE_ROLE_TAB
|
||||
- Set up the %GTK_ACCESSIBLE_RELATION_CONTROLS relation between each
|
||||
tab and the `GtkStackPage` object for its page
|
||||
tab and the #GtkStackPage object for its page
|
||||
- Set the %GTK_ACCESSIBLE_PROPERTY_SELECTED property on each tab, with
|
||||
the active tab getting the value %TRUE, all others %FALSE
|
||||
|
||||
@@ -357,7 +357,7 @@ or add a `activate-tab` action on each tab.
|
||||
### Value controls
|
||||
|
||||
A value control (ie a widget that controls a one-dimensional quantity
|
||||
that can be represented by a `GtkAdjustment`) can be represented to
|
||||
that can be represented by a #GtkAdjustment) can be represented to
|
||||
accessible technologies by setting the %GTK_ACCESSIBLE_PROPERTY_VALUE_MIN,
|
||||
%GTK_ACCESSIBLE_PROPERTY_VALUE_MAX, and %GTK_ACCESSIBLE_PROPERTY_VALUE_NOW
|
||||
properties.
|
||||
|
||||
@@ -24,25 +24,25 @@ you should be aware of what they refer to. These are often generic terms that
|
||||
have a specific meaning in this context.
|
||||
|
||||
**_Views_** or **_list widgets_** are the widgets that hold and manage the lists.
|
||||
Examples of these widgets would be `GtkListView` or `GtkGridView`.
|
||||
Examples of these widgets would be #GtkListView or #GtkGridView.
|
||||
|
||||
Views display data from a **_model_**. A model is a `GListModel` and models can
|
||||
Views display data from a **_model_**. A model is a #GListModel and models can
|
||||
be provided in 3 ways or combinations thereof:
|
||||
|
||||
* Many list models implementations already exist. There are models that provide
|
||||
specific data, like `GtkDirectoryList`. And there are models like `GListStore`
|
||||
specific data, like #GtkDirectoryList. And there are models like #GListStore
|
||||
that allow building lists manually.
|
||||
|
||||
* Wrapping list models like `GtkFilterListModel` or `GtkSortListModel`
|
||||
* Wrapping list models like #GtkFilterListModel or #GtkSortListModel
|
||||
modify, adapt or combine other models.
|
||||
|
||||
* Last but not least, developers are encouraged to create their own `GListModel`
|
||||
* Last but not least, developers are encouraged to create their own #GListModel
|
||||
implementations. The interface is kept deliberately small to make this easy.
|
||||
|
||||
The same model can be used in multiple different views and wrapped with
|
||||
multiple different models at once.
|
||||
|
||||
The elements in a model are called **_items_**. All items are `GObjects`.
|
||||
The elements in a model are called **_items_**. All items are #GObjects.
|
||||
|
||||
Every item in a model has a **_position_** which is the unsigned integer that
|
||||
describes where in the model the item is located. The first item in a model is
|
||||
@@ -56,11 +56,11 @@ with models. Oftentimes some things are really hard to do one way but very easy
|
||||
the other way.
|
||||
|
||||
The other important part of a view is a **_factory_**. Each factory is
|
||||
a `GtkListItemFactory` implementation that takes care of mapping the items
|
||||
a #GtkListItemFactory implementation that takes care of mapping the items
|
||||
of the model to widgets that can be shown in the view.
|
||||
|
||||
The way factories do this is by creating a **_listitem_** for each item that
|
||||
is currently in use. Listitems are always `GtkListItem` objects. They are only
|
||||
is currently in use. Listitems are always #GtkListItem objects. They are only
|
||||
ever created by GTK and provide information about what item they are meant
|
||||
to display.
|
||||
|
||||
@@ -71,28 +71,28 @@ for the data displayed, the programming language and development environment
|
||||
is an important task that can simplify setting up the view tremendously.
|
||||
|
||||
Views support selections via a **_selection model_**. A selection model is an
|
||||
implementation of the `GtkSelectionModel` interface on top of the `GListModel`
|
||||
implementation of the #GtkSelectionModel interface on top of the #GListModel
|
||||
interface that allows marking each item in a model as either selected or not
|
||||
selected. Just like regular models, this can be implemented either by
|
||||
implementing `GtkSelectionModel` directly or by wrapping a model with one of
|
||||
the GTK models provided for this purposes, such as `GtkNoSelection`
|
||||
or `GtkSingleSelection`.
|
||||
implementing #GtkSelectionModel directly or by wrapping a model with one of
|
||||
the GTK models provided for this purposes, such as #GtkNoSelection
|
||||
or #GtkSingleSelection.
|
||||
|
||||
The behavior of selection models - ie which items they allow selecting and
|
||||
what effect this has on other items - is completely up to the selection model.
|
||||
As such, single-selections, multi-selections or sharing selection state between
|
||||
different selection models and/or views is possible. The selection state of an
|
||||
item is exposed in the listitem via the `GtkListItem:selected` property.
|
||||
item is exposed in the listitem via the #GtkListItem:selected property.
|
||||
|
||||
Views and listitems also support activation. Activation means that double
|
||||
clicking or pressing enter while inside a focused row will cause the view
|
||||
to emit and activation signal such as `GtkListView::activate`. This provides
|
||||
to emit and activation signal such as #GtkListView::activate. This provides
|
||||
an easy way to set up lists, but can also be turned off on listitems if undesired.
|
||||
|
||||
Both selections and activation are supported among other things via widget
|
||||
[actions](#actions-overview). This allows developers to add widgets to their
|
||||
lists that cause selections to change or to trigger activation via
|
||||
the `GtkActionable` interface. For a list of all supported actions see the
|
||||
the #GtkActionable interface. For a list of all supported actions see the
|
||||
relevant documentation.
|
||||
|
||||
## Behind the scenes
|
||||
@@ -114,8 +114,8 @@ new position at any time causing any state to be lost.
|
||||
|
||||
Another important requirement for views is that they need to know which items
|
||||
are not visible so they can be recycled. Views achieve that by implementing
|
||||
the `GtkScrollable` interface and expecting to be placed directly into
|
||||
a `GtkScrolledWindow`.
|
||||
the #GtkScrollable interface and expecting to be placed directly into
|
||||
a #GtkScrolledWindow.
|
||||
|
||||
Of course, if you are only using models with few items, this is not important
|
||||
and you can treat views like any other widget. But if you use large lists and
|
||||
@@ -128,8 +128,8 @@ tradeoffs of those and experiment with them.
|
||||
|
||||
GTK offers a wide variety of wrapping models which change or supplement an
|
||||
existing model (or models) in some way. But when it comes to storing your
|
||||
actual data, there are only a few ready-made choices available: `GListStore`
|
||||
and `GtkStringList`.
|
||||
actual data, there are only a few ready-made choices available: #GListStore
|
||||
and #GtkStringList.
|
||||
|
||||
GListStore is backed by a balanced tree and has performance characteristics
|
||||
that are expected for that data structure. It works reasonably well for dataset
|
||||
@@ -143,7 +143,7 @@ place where you would otherwise use `char*[]` and works best if the dataset
|
||||
is not very dynamic.
|
||||
|
||||
If these models don't fit your use case or scalability requirements, you
|
||||
should make a custom `GListModel`. It is a small interface and not very hard
|
||||
should make a custom #GListModel. It is a small interface and not very hard
|
||||
to implement.
|
||||
|
||||
For asymptotic performance comparisons between tree- and array-based
|
||||
@@ -152,23 +152,23 @@ implementations, see this
|
||||
|
||||
## Displaying trees
|
||||
|
||||
While `GtkTreeView` provided built-in support for trees, the list widgets, and
|
||||
in particular `GListModel` do not. This was a design choice because the common
|
||||
While #GtkTreeView provided built-in support for trees, the list widgets, and
|
||||
in particular #GListModel do not. This was a design choice because the common
|
||||
use case is displaying lists and not trees and it greatly simplifies the API
|
||||
interface provided.
|
||||
|
||||
However, GTK provides functionality to make trees look and behave like lists
|
||||
for the people who still want to display lists. This is achieved by using
|
||||
the `GtkTreeListModel` model to flatten a tree into a list. The `GtkTreeExpander`
|
||||
the #GtkTreeListModel model to flatten a tree into a list. The #GtkTreeExpander
|
||||
widget can then be used inside a listitem to allow users to expand and collapse
|
||||
rows and provide a similar experience to `GtkTreeView`.
|
||||
rows and provide a similar experience to #GtkTreeView.
|
||||
|
||||
Developers should refer to those objects' API reference for more discussion
|
||||
on the topic.
|
||||
|
||||
## List styles
|
||||
|
||||
One of the advantages of the new list widgets over `GtkTreeViews` and cell
|
||||
One of the advantages of the new list widgets over #GtkTreeViews and cell
|
||||
renderers is that they are fully themable using GTK CSS. This provides a
|
||||
lot of flexibility. The themes that ship with GTK provide a few predefined
|
||||
list styles that can be used in many situations:
|
||||
@@ -192,7 +192,7 @@ style class.
|
||||
|
||||
## Comparison to GtkTreeView
|
||||
|
||||
Developers familiar with `GtkTreeView` may wonder how this way of doing lists
|
||||
Developers familiar with #GtkTreeView may wonder how this way of doing lists
|
||||
compares to the way they know. This section will try to outline the similarities
|
||||
and differences between the two.
|
||||
|
||||
@@ -200,26 +200,26 @@ This new approach tries to provide roughly the same functionality as the old
|
||||
approach but often uses a very different approach to achieve these goals.
|
||||
|
||||
The main difference and one of the primary reasons for this new development is
|
||||
that items can be displayed using regular widgets and `GtkCellRenderer` is no
|
||||
that items can be displayed using regular widgets and #GtkCellRenderer is no
|
||||
longer necessary. This allows all benefits that widgets provide, such as complex
|
||||
layout and animating widgets and not only makes cell renderers obsolete, but
|
||||
also `GtkCellArea`.
|
||||
also #GtkCellArea.
|
||||
|
||||
The other big difference is the massive change to the data model. `GtkTreeModel`
|
||||
was a rather complex interface for a tree data structure and `GListModel` was
|
||||
The other big difference is the massive change to the data model. #GtkTreeModel
|
||||
was a rather complex interface for a tree data structure and #GListModel was
|
||||
deliberately designed to be a simple data structure for lists only. (See
|
||||
[above](#displaying-trees)) for how to still do trees with this new model.)
|
||||
Another big change is that the new model allows for bulk changes via
|
||||
the `GListModel:items-changed` signal while `GtkTreeModel` only allows a single
|
||||
the #GListModel:items-changed signal while #GtkTreeModel only allows a single
|
||||
item to change at once. The goal here is of course to encourage implementation
|
||||
of custom list models.
|
||||
|
||||
Another consequence of the new model is that it is now easily possible to
|
||||
refer to the contents of a row in the model directly by keeping the item,
|
||||
while `GtkTreeRowReference` was a very slow mechanism to achieve the same.
|
||||
while #GtkTreeRowReference was a very slow mechanism to achieve the same.
|
||||
And because the items are real objects, developers can make them emit change
|
||||
signals causing listitems and their children to update, which wasn't possible
|
||||
with `GtkTreeModel`.
|
||||
with #GtkTreeModel.
|
||||
|
||||
The selection handling is also different. While selections used to be managed
|
||||
via custom code in each widget, selection state is now meant to be managed by
|
||||
@@ -229,24 +229,24 @@ specialized requirements.
|
||||
Finally here's a quick list of equivalent functionality to look for when
|
||||
transitioning code for easy lookup:
|
||||
|
||||
| Old | New |
|
||||
| -------------------- | ------------------------------------ |
|
||||
| `GtkTreeModel` | `GListModel` |
|
||||
| `GtkTreePath` | `guint` position, `GtkTreeListRow` |
|
||||
| `GtkTreeIter` | `guint` position |
|
||||
| `GtkTreeRowReference`| `GObject` item |
|
||||
| `GtkListStore` | `GListStore` |
|
||||
| `GtkTreeStore` | `GtkTreeListModel`, `GtkTreeExpander`|
|
||||
| `GtkTreeSelection` | `GtkSelectionModel` |
|
||||
| `GtkTreeViewColumn` | `GtkColumnView` |
|
||||
| `GtkTreeView` | `GtkListView`, `GtkColumnView` |
|
||||
| `GtkCellView` | `GtkListItemWidget` |
|
||||
| `GtkComboBox` | `GtkDropDown` |
|
||||
| `GtkIconView` | `GtkGridView` |
|
||||
| `GtkTreeSortable` | `GtkColumnView` |
|
||||
| `GtkTreeModelSort` | `GtkSortListModel` |
|
||||
| `GtkTreeModelFilter` | `GtkFilterListModel` |
|
||||
| `GtkCellLayout` | `GtkListItemFactory` |
|
||||
| `GtkCellArea` | `GtkWidget` |
|
||||
| `GtkCellRenderer` | `GtkWidget` |
|
||||
| Old | New |
|
||||
| ------------------- | ----------------------------------- |
|
||||
| #GtkTreeModel | #GListModel |
|
||||
| #GtkTreePath | #guint position, #GtkTreeListRow |
|
||||
| #GtkTreeIter | #guint position |
|
||||
| #GtkTreeRowReference | #GObject item |
|
||||
| #GtkListStore | #GListStore |
|
||||
| #GtkTreeStore | #GtkTreeListModel, #GtkTreeExpander |
|
||||
| #GtkTreeSelection | #GtkSelectionModel |
|
||||
| #GtkTreeViewColumn | #GtkColumnView |
|
||||
| #GtkTreeView | #GtkListView, #GtkColumnView |
|
||||
| #GtkCellView | #GtkListItemWidget |
|
||||
| #GtkComboBox | #GtkDropDown |
|
||||
| #GtkIconView | #GtkGridView |
|
||||
| #GtkTreeSortable | #GtkColumnView |
|
||||
| #GtkTreeModelSort | #GtkSortListModel |
|
||||
| #GtkTreeModelFilter | #GtkFilterListModel |
|
||||
| #GtkCellLayout | #GtkListItemFactory |
|
||||
| #GtkCellArea | #GtkWidget |
|
||||
| #GtkCellRenderer | #GtkWidget |
|
||||
|
||||
|
||||
@@ -2,15 +2,15 @@ Title: Text Widget Overview
|
||||
Slug: gtk-textview
|
||||
|
||||
GTK has an extremely powerful framework for multiline text editing. The
|
||||
primary objects involved in the process are `GtkTextBuffer`, which represents the
|
||||
text being edited, and `GtkTextView`, a widget which can display a `GtkTextBuffer`.
|
||||
primary objects involved in the process are #GtkTextBuffer, which represents the
|
||||
text being edited, and #GtkTextView, a widget which can display a #GtkTextBuffer.
|
||||
Each buffer can be displayed by any number of views.
|
||||
|
||||
One of the important things to remember about text in GTK is that it's in
|
||||
the UTF-8 encoding. This means that one character can be encoded as multiple
|
||||
bytes. Character counts are usually referred to as _offsets_, while byte
|
||||
counts are called _indexes_. If you confuse these two, things will work fine
|
||||
with ASCII, but as soon as your buffer contains multibyte characters, bad
|
||||
with ASCII, but as soon as your buffer contains multibyte characters, bad
|
||||
things will happen.
|
||||
|
||||
Text in a buffer can be marked with _tags_. A tag is an attribute that can
|
||||
@@ -19,10 +19,10 @@ and make the text inside the tag bold. However, the tag concept is more
|
||||
general than that; tags don't have to affect appearance. They can instead
|
||||
affect the behavior of mouse and key presses, "lock" a range of text so the
|
||||
user can't edit it, or countless other things. A tag is represented by a
|
||||
`GtkTextTag` object. One `GtkTextTag` can be applied to any number of text
|
||||
#GtkTextTag object. One #GtkTextTag can be applied to any number of text
|
||||
ranges in any number of buffers.
|
||||
|
||||
Each tag is stored in a `GtkTextTagTable`. A tag table defines a set of
|
||||
Each tag is stored in a #GtkTextTagTable. A tag table defines a set of
|
||||
tags that can be used together. Each buffer has one tag table associated with
|
||||
it; only tags from that tag table can be used with the buffer. A single tag
|
||||
table can be shared between multiple buffers, however.
|
||||
@@ -32,36 +32,36 @@ your tag that makes things bold "bold"), but they can also be anonymous (which
|
||||
is convenient if you're creating tags on-the-fly).
|
||||
|
||||
Most text manipulation is accomplished with _iterators_, represented by a
|
||||
`GtkTextIter`. An iterator represents a position between two characters in
|
||||
the text buffer. `GtkTextIter` is a struct designed to be allocated on the
|
||||
#GtkTextIter. An iterator represents a position between two characters in
|
||||
the text buffer. #GtkTextIter is a struct designed to be allocated on the
|
||||
stack; it's guaranteed to be copiable by value and never contain any
|
||||
heap-allocated data. Iterators are not valid indefinitely; whenever the
|
||||
buffer is modified in a way that affects the number of characters in the
|
||||
buffer, all outstanding iterators become invalid. (Note that deleting 5
|
||||
characters and then reinserting 5 still invalidates iterators, though you
|
||||
end up with the same number of characters you pass through a state with a
|
||||
characters and then reinserting 5 still invalidates iterators, though you
|
||||
end up with the same number of characters you pass through a state with a
|
||||
different number).
|
||||
|
||||
Because of this, iterators can't be used to preserve positions across buffer
|
||||
modifications. To preserve a position, the `GtkTextMark` object is ideal. You
|
||||
can think of a mark as an invisible cursor or insertion point; it floats in
|
||||
the buffer, saving a position. If the text surrounding the mark is deleted,
|
||||
the mark remains in the position the text once occupied; if text is inserted
|
||||
at the mark, the mark ends up either to the left or to the right of the new
|
||||
modifications. To preserve a position, the #GtkTextMark object is ideal. You
|
||||
can think of a mark as an invisible cursor or insertion point; it floats in
|
||||
the buffer, saving a position. If the text surrounding the mark is deleted,
|
||||
the mark remains in the position the text once occupied; if text is inserted
|
||||
at the mark, the mark ends up either to the left or to the right of the new
|
||||
text, depending on its _gravity_. The standard text cursor in left-to-right
|
||||
languages is a mark with right gravity, because it stays to the right of
|
||||
inserted text.
|
||||
|
||||
Like tags, marks can be either named or anonymous. There are two marks
|
||||
built-in to `GtkTextBuffer`; these are named "insert" and "selection_bound"
|
||||
built-in to #GtkTextBuffer; these are named "insert" and "selection_bound"
|
||||
and refer to the insertion point and the boundary of the selection which
|
||||
is not the insertion point, respectively. If no text is selected, these
|
||||
two marks will be in the same position. You can manipulate what is selected
|
||||
and where the cursor appears by moving these marks around.
|
||||
|
||||
If you want to place the cursor in response to a user action, be sure to use
|
||||
gtk_text_buffer_place_cursor(), which moves both at once without causing a
|
||||
temporary selection (moving one then the other temporarily selects the range in
|
||||
gtk_text_buffer_place_cursor(), which moves both at once without causing a
|
||||
temporary selection (moving one then the other temporarily selects the range in
|
||||
between the old and new positions).
|
||||
|
||||
Text buffers always contain at least one line, but may be empty (that
|
||||
@@ -69,7 +69,7 @@ is, buffers can contain zero characters). The last line in the text
|
||||
buffer never ends in a line separator (such as newline); the other
|
||||
lines in the buffer always end in a line separator. Line separators
|
||||
count as characters when computing character counts and character
|
||||
offsets. Note that some Unicode line separators are represented with
|
||||
offsets. Note that some Unicode line separators are represented with
|
||||
multiple bytes in UTF-8, and the two-character sequence "\r\n" is also
|
||||
considered a line separator.
|
||||
|
||||
@@ -83,7 +83,7 @@ gtk_text_buffer_end_irreversible_action().
|
||||
|
||||
## Simple Example
|
||||
|
||||
The simplest usage of `GtkTextView` might look like this:
|
||||
The simplest usage of #GtkTextView might look like this:
|
||||
|
||||
``` {.c}
|
||||
GtkWidget *view;
|
||||
@@ -101,17 +101,17 @@ gtk_text_buffer_set_text (buffer, "Hello, this is some text", -1);
|
||||
*/
|
||||
```
|
||||
|
||||
In many cases it's also convenient to first create the buffer with
|
||||
gtk_text_buffer_new(), then create a widget for that buffer with
|
||||
gtk_text_view_new_with_buffer(). Or you can change the buffer the widget
|
||||
In many cases it's also convenient to first create the buffer with
|
||||
gtk_text_buffer_new(), then create a widget for that buffer with
|
||||
gtk_text_view_new_with_buffer(). Or you can change the buffer the widget
|
||||
displays after the widget is created with gtk_text_view_set_buffer().
|
||||
|
||||
## Example of Changing Text Attributes
|
||||
|
||||
The way to affect text attributes in `GtkTextView` is to
|
||||
The way to affect text attributes in #GtkTextView is to
|
||||
apply tags that change the attributes for a region of text.
|
||||
For text features that come from the theme — such as font and
|
||||
foreground color — use CSS to override their default values.
|
||||
For text features that come from the theme — such as font and
|
||||
foreground color -- use CSS to override their default values.
|
||||
|
||||
```
|
||||
GtkWidget *view;
|
||||
@@ -148,11 +148,11 @@ gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 30);
|
||||
/* Use a tag to change the color for just one part of the widget */
|
||||
tag = gtk_text_buffer_create_tag (buffer, "blue_foreground",
|
||||
"foreground", "blue",
|
||||
NULL);
|
||||
NULL);
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &start, 7);
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &end, 12);
|
||||
gtk_text_buffer_apply_tag (buffer, tag, &start, &end);
|
||||
```
|
||||
|
||||
The `gtk4-demo` application that comes with
|
||||
GTK contains more example code for `GtkTextView`.
|
||||
GTK contains more example code for #GtkTextView.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Title: Tree and List Widget Overview
|
||||
Slug: gtk-treeview
|
||||
|
||||
To create a tree or list in GTK, use the `GtkTreeModel` interface in
|
||||
conjunction with the `GtkTreeView` widget. This widget is designed around
|
||||
To create a tree or list in GTK, use the #GtkTreeModel interface in
|
||||
conjunction with the #GtkTreeView widget. This widget is designed around
|
||||
a _Model/View/Controller_ design and consists of four major parts:
|
||||
|
||||
- The tree view widget (GtkTreeView)
|
||||
@@ -25,9 +25,9 @@ it be rendered as a checkbox?
|
||||
|
||||
## Creating a model
|
||||
|
||||
GTK provides two simple models that can be used: the `GtkListStore`
|
||||
and the `GtkTreeStore`. `GtkListStore` is used to model list widgets,
|
||||
while the `GtkTreeStore` models trees. It is possible to develop a new
|
||||
GTK provides two simple models that can be used: the #GtkListStore
|
||||
and the #GtkTreeStore. GtkListStore is used to model list widgets,
|
||||
while the GtkTreeStore models trees. It is possible to develop a new
|
||||
type of model, but the existing models should be satisfactory for all
|
||||
but the most specialized of situations. Creating the model is quite
|
||||
|
||||
@@ -59,7 +59,7 @@ GtkTreeStore *store = gtk_tree_store_new (N_COLUMNS, /* Total number of co
|
||||
|
||||
Adding data to the model is done using gtk_tree_store_set() or
|
||||
gtk_list_store_set(), depending upon which sort of model was
|
||||
created. To do this, a `GtkTreeIter` must be acquired. The iterator
|
||||
created. To do this, a #GtkTreeIter must be acquired. The iterator
|
||||
points to the location where data will be added.
|
||||
|
||||
Once an iterator has been acquired, gtk_tree_store_set() is used to
|
||||
@@ -119,8 +119,8 @@ gtk_tree_store_set (store, &iter2,
|
||||
|
||||
While there are several different models to choose from, there is
|
||||
only one view widget to deal with. It works with either the list
|
||||
or the tree store. Setting up a `GtkTreeView` is not a difficult
|
||||
matter. It needs a `GtkTreeModel` to know where to retrieve its data
|
||||
or the tree store. Setting up a #GtkTreeView is not a difficult
|
||||
matter. It needs a #GtkTreeModel to know where to retrieve its data
|
||||
from.
|
||||
|
||||
``` {.c}
|
||||
@@ -131,16 +131,16 @@ tree = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
|
||||
|
||||
## Columns and cell renderers
|
||||
|
||||
Once the `GtkTreeView` widget has a model, it will need to know how
|
||||
Once the #GtkTreeView widget has a model, it will need to know how
|
||||
to display the model. It does this with columns and cell renderers.
|
||||
|
||||
Cell renderers are used to draw the data in the tree model in a
|
||||
way. There are a number of cell renderers that come with GTK,
|
||||
including the `GtkCellRendererText`, `GtkCellRendererPixbuf` and
|
||||
the `GtkCellRendererToggle`. It is relatively easy to write a
|
||||
including the #GtkCellRendererText, #GtkCellRendererPixbuf and
|
||||
the #GtkCellRendererToggle. It is relatively easy to write a
|
||||
custom renderer.
|
||||
|
||||
A `GtkTreeViewColumn` is the object that `GtkTreeView` uses to organize
|
||||
A #GtkTreeViewColumn is the object that GtkTreeView uses to organize
|
||||
the vertical columns in the tree view. It needs to know the name of
|
||||
the column to label for the user, what type of cell renderer to use,
|
||||
and which piece of data to retrieve from the model for a given row.
|
||||
@@ -166,7 +166,7 @@ created and columns are added to it.
|
||||
Most applications will need to not only deal with displaying data,
|
||||
but also receiving input events from users. To do this, simply get
|
||||
a reference to a selection object and connect to the
|
||||
`GtkTreeSelection::changed` signal.
|
||||
#GtkTreeSelection::changed signal.
|
||||
|
||||
``` {.c}
|
||||
/* Prototype for selection handler callback */
|
||||
@@ -205,11 +205,11 @@ tree_selection_changed_cb (GtkTreeSelection *selection, gpointer data)
|
||||
|
||||
## Simple Example
|
||||
|
||||
Here is a simple example of using a `GtkTreeView` widget in context
|
||||
Here is a simple example of using a #GtkTreeView widget in context
|
||||
of the other widgets. It simply creates a simple model and view,
|
||||
and puts them together. Note that the model is never populated
|
||||
with data — that is left as an exercise for the reader.
|
||||
More information can be found on this in the `GtkTreeModel` section.
|
||||
with data — that is left as an exercise for the reader.
|
||||
More information can be found on this in the #GtkTreeModel section.
|
||||
|
||||
``` {.c}
|
||||
enum
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
Title: Widget Gallery
|
||||
|
||||
<style>p { display: flex; flex-flow: row wrap; }</style>
|
||||
|
||||
## Display widgets
|
||||
|
||||
[](class.Label.html)
|
||||
|
||||
@@ -18,8 +18,3 @@ or wayland-1.
|
||||
### XDG_RUNTIME_DIR
|
||||
|
||||
Used to locate the Wayland socket to use.
|
||||
|
||||
## Wayland-specific APIs
|
||||
|
||||
See the [documentation](https://docs.gtk.org/gdk4-wayland/) for
|
||||
Wayland-specific GDK APIs.
|
||||
|
||||
@@ -25,11 +25,6 @@ high-dpi displays. Normally, GDK will pick up a suitable scale factor
|
||||
for each monitor from the display system. This environment variable
|
||||
allows to override that.
|
||||
|
||||
## X11-specific APIs
|
||||
|
||||
See the [documentation](https://docs.gtk.org/gdk4-x11/) for
|
||||
X11-specific GDK APIs.
|
||||
|
||||
## Understanding the X11 architecture
|
||||
|
||||
People coming from a Windows or MacOS background often find certain
|
||||
|
||||
@@ -197,17 +197,6 @@ text_buffer_changed_cb (GtkTextBuffer *buffer,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
fullscreen_changed (GObject *object,
|
||||
GParamSpec *pspec,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (gtk_window_is_fullscreen (GTK_WINDOW (object)))
|
||||
gtk_button_set_icon_name (GTK_BUTTON (user_data), "view-restore-symbolic");
|
||||
else
|
||||
gtk_button_set_icon_name (GTK_BUTTON (user_data), "view-fullscreen-symbolic");
|
||||
}
|
||||
|
||||
static GActionEntry win_entries[] = {
|
||||
{ "copy", window_copy, NULL, NULL, NULL },
|
||||
{ "paste", window_paste, NULL, NULL, NULL },
|
||||
@@ -225,18 +214,17 @@ new_window (GApplication *app,
|
||||
GtkWidget *window, *grid, *scrolled, *view;
|
||||
GtkWidget *toolbar;
|
||||
GtkWidget *button;
|
||||
GtkWidget *sw, *box, *label;
|
||||
|
||||
window = gtk_application_window_new (GTK_APPLICATION (app));
|
||||
gtk_window_set_default_size ((GtkWindow*)window, 640, 480);
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (window), win_entries, G_N_ELEMENTS (win_entries), window);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Bloatpad");
|
||||
gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (window), TRUE);
|
||||
|
||||
grid = gtk_grid_new ();
|
||||
gtk_window_set_child (GTK_WINDOW (window), grid);
|
||||
|
||||
toolbar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_widget_add_css_class (toolbar, "toolbar");
|
||||
button = gtk_toggle_button_new ();
|
||||
gtk_button_set_icon_name (GTK_BUTTON (button), "format-justify-left");
|
||||
gtk_actionable_set_detailed_action_name (GTK_ACTIONABLE (button), "win.justify::left");
|
||||
@@ -252,18 +240,21 @@ new_window (GApplication *app,
|
||||
gtk_actionable_set_detailed_action_name (GTK_ACTIONABLE (button), "win.justify::right");
|
||||
gtk_box_append (GTK_BOX (toolbar), button);
|
||||
|
||||
button = gtk_toggle_button_new ();
|
||||
gtk_button_set_icon_name (GTK_BUTTON (button), "view-fullscreen-symbolic");
|
||||
gtk_actionable_set_action_name (GTK_ACTIONABLE (button), "win.fullscreen");
|
||||
gtk_box_append (GTK_BOX (toolbar), button);
|
||||
g_signal_connect (window, "notify::fullscreened", G_CALLBACK (fullscreen_changed), button);
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
||||
gtk_widget_set_halign (box, GTK_ALIGN_END);
|
||||
label = gtk_label_new ("Fullscreen:");
|
||||
gtk_box_append (GTK_BOX (box), label);
|
||||
sw = gtk_switch_new ();
|
||||
gtk_widget_set_valign (sw, GTK_ALIGN_CENTER);
|
||||
gtk_actionable_set_action_name (GTK_ACTIONABLE (sw), "win.fullscreen");
|
||||
gtk_box_append (GTK_BOX (box), sw);
|
||||
gtk_box_append (GTK_BOX (toolbar), box);
|
||||
|
||||
gtk_grid_attach (GTK_GRID (grid), toolbar, 0, 0, 1, 1);
|
||||
|
||||
scrolled = gtk_scrolled_window_new ();
|
||||
gtk_widget_set_hexpand (scrolled, TRUE);
|
||||
gtk_widget_set_vexpand (scrolled, TRUE);
|
||||
gtk_scrolled_window_set_has_frame (GTK_SCROLLED_WINDOW (scrolled), TRUE);
|
||||
view = gtk_text_view_new ();
|
||||
|
||||
g_object_set_data ((GObject*)window, "bloatpad-text", view);
|
||||
@@ -353,7 +344,6 @@ static void
|
||||
combo_changed (GtkComboBox *combo,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkDialog *dialog = user_data;
|
||||
GtkEntry *entry = g_object_get_data (user_data, "entry");
|
||||
const char *action;
|
||||
char **accels;
|
||||
@@ -369,17 +359,6 @@ combo_changed (GtkComboBox *combo,
|
||||
g_strfreev (accels);
|
||||
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), str);
|
||||
gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_APPLY, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
entry_changed (GtkEntry *entry,
|
||||
GParamSpec *pspec,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkDialog *dialog = user_data;
|
||||
|
||||
gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_APPLY, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -393,7 +372,7 @@ response (GtkDialog *dialog,
|
||||
const char *str;
|
||||
char **accels;
|
||||
|
||||
if (response_id == GTK_RESPONSE_CANCEL)
|
||||
if (response_id == GTK_RESPONSE_CLOSE)
|
||||
{
|
||||
gtk_window_destroy (GTK_WINDOW (dialog));
|
||||
return;
|
||||
@@ -409,8 +388,6 @@ response (GtkDialog *dialog,
|
||||
|
||||
gtk_application_set_accels_for_action (gtk_window_get_application (user_data), action, (const char **) accels);
|
||||
g_strfreev (accels);
|
||||
|
||||
gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_APPLY, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -425,41 +402,22 @@ edit_accels (GSimpleAction *action,
|
||||
GtkWidget *dialog;
|
||||
int i;
|
||||
|
||||
dialog = gtk_dialog_new_with_buttons ("Accelerators",
|
||||
NULL,
|
||||
GTK_DIALOG_USE_HEADER_BAR,
|
||||
"Close", GTK_RESPONSE_CANCEL,
|
||||
"Set", GTK_RESPONSE_APPLY,
|
||||
NULL);
|
||||
|
||||
dialog = gtk_dialog_new ();
|
||||
gtk_window_set_application (GTK_WINDOW (dialog), app);
|
||||
actions = gtk_application_list_action_descriptions (app);
|
||||
|
||||
combo = gtk_combo_box_text_new ();
|
||||
g_object_set (gtk_dialog_get_content_area (GTK_DIALOG (dialog)),
|
||||
"margin-top", 10,
|
||||
"margin-bottom", 10,
|
||||
"margin-start", 10,
|
||||
"margin-end", 10,
|
||||
"spacing", 10,
|
||||
NULL);
|
||||
|
||||
gtk_box_append (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), combo);
|
||||
for (i = 0; actions[i]; i++)
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), actions[i], actions[i]);
|
||||
g_signal_connect (combo, "changed", G_CALLBACK (combo_changed), dialog);
|
||||
|
||||
entry = gtk_entry_new ();
|
||||
gtk_widget_set_hexpand (entry, TRUE);
|
||||
g_signal_connect (entry, "notify::text", G_CALLBACK (entry_changed), dialog);
|
||||
|
||||
gtk_box_append (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), entry);
|
||||
gtk_dialog_add_button (GTK_DIALOG (dialog), "Close", GTK_RESPONSE_CLOSE);
|
||||
gtk_dialog_add_button (GTK_DIALOG (dialog), "Set", GTK_RESPONSE_APPLY);
|
||||
g_signal_connect (dialog, "response", G_CALLBACK (response), dialog);
|
||||
g_object_set_data (G_OBJECT (dialog), "combo", combo);
|
||||
g_object_set_data (G_OBJECT (dialog), "entry", entry);
|
||||
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
@@ -578,7 +536,7 @@ bloat_pad_startup (GApplication *application)
|
||||
|
||||
menu = gtk_application_get_menu_by_id (GTK_APPLICATION (application), "icon-menu");
|
||||
|
||||
file = g_file_new_for_uri ("resource:///org/gtk/libgtk/icons/16x16/actions/insert-image.png");
|
||||
file = g_file_new_for_uri ("resource:///org/gtk/libgtk/icons/16x16/actions/gtk-select-color.png");
|
||||
icon = g_file_icon_new (file);
|
||||
item = g_menu_item_new ("File Icon", NULL);
|
||||
g_menu_item_set_icon (item, icon);
|
||||
@@ -594,7 +552,7 @@ bloat_pad_startup (GApplication *application)
|
||||
g_object_unref (item);
|
||||
g_object_unref (icon);
|
||||
|
||||
bytes = g_resources_lookup_data ("/org/gtk/libgtk/icons/16x16/actions/media-eject.png", 0, NULL);
|
||||
bytes = g_resources_lookup_data ("/org/gtk/libgtk/icons/16x16/actions/gtk-select-font.png", 0, NULL);
|
||||
icon = g_bytes_icon_new (bytes);
|
||||
item = g_menu_item_new ("Bytes Icon", NULL);
|
||||
g_menu_item_set_icon (item, icon);
|
||||
@@ -603,19 +561,19 @@ bloat_pad_startup (GApplication *application)
|
||||
g_object_unref (icon);
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
icon = G_ICON (gdk_pixbuf_new_from_resource ("/org/gtk/libgtk/icons/16x16/actions/folder-new.png", NULL));
|
||||
icon = G_ICON (gdk_pixbuf_new_from_resource ("/org/gtk/libgtk/icons/16x16/actions/gtk-preferences.png", NULL));
|
||||
item = g_menu_item_new ("Pixbuf", NULL);
|
||||
g_menu_item_set_icon (item, icon);
|
||||
g_menu_append_item (menu, item);
|
||||
g_object_unref (item);
|
||||
g_object_unref (icon);
|
||||
|
||||
file = g_file_new_for_uri ("resource:///org/gtk/libgtk/icons/16x16/actions/bookmark-new.png");
|
||||
file = g_file_new_for_uri ("resource:///org/gtk/libgtk/icons/16x16/actions/gtk-page-setup.png");
|
||||
icon = g_file_icon_new (file);
|
||||
emblem = g_emblem_new (icon);
|
||||
g_object_unref (icon);
|
||||
g_object_unref (file);
|
||||
file = g_file_new_for_uri ("resource:///org/gtk/libgtk/icons/16x16/actions/dialog-warning.png");
|
||||
file = g_file_new_for_uri ("resource:///org/gtk/libgtk/icons/16x16/actions/gtk-orientation-reverse-portrait.png");
|
||||
icon2 = g_file_icon_new (file);
|
||||
icon = g_emblemed_icon_new (icon2, emblem);
|
||||
item = g_menu_item_new ("Emblemed Icon", NULL);
|
||||
|
||||
@@ -4,10 +4,5 @@
|
||||
<gresource prefix="/org/gtk/bloatpad">
|
||||
<file preprocess="xml-stripblanks">gtk/menus.ui</file>
|
||||
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
|
||||
<file>icons/16x16/actions/format-justify-center-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/format-justify-left-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/format-justify-right-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/view-fullscreen-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/view-restore-symbolic.symbolic.png</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 119 B |
Binary file not shown.
|
Before Width: | Height: | Size: 115 B |
Binary file not shown.
|
Before Width: | Height: | Size: 117 B |
Binary file not shown.
|
Before Width: | Height: | Size: 207 B |
Binary file not shown.
|
Before Width: | Height: | Size: 204 B |
@@ -132,6 +132,7 @@ activate (GtkApplication *app,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *drawing_area;
|
||||
GtkGesture *drag;
|
||||
GtkGesture *press;
|
||||
@@ -141,11 +142,14 @@ activate (GtkApplication *app,
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_window_set_child (GTK_WINDOW (window), frame);
|
||||
|
||||
drawing_area = gtk_drawing_area_new ();
|
||||
/* set a minimum size */
|
||||
gtk_widget_set_size_request (drawing_area, 100, 100);
|
||||
|
||||
gtk_window_set_child (GTK_WINDOW (window), drawing_area);
|
||||
gtk_frame_set_child (GTK_FRAME (frame), drawing_area);
|
||||
|
||||
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (drawing_area), draw_cb, NULL, NULL);
|
||||
|
||||
|
||||
@@ -13,19 +13,19 @@ activate (GtkApplication *app,
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *button;
|
||||
GtkWidget *box;
|
||||
|
||||
window = gtk_application_window_new (app);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Window");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
|
||||
|
||||
button = gtk_button_new_with_label ("Hello World");
|
||||
gtk_widget_set_halign (button, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_window_set_child (GTK_WINDOW (window), box);
|
||||
|
||||
button = gtk_button_new_with_label ("Hello World");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window);
|
||||
|
||||
gtk_window_set_child (GTK_WINDOW (window), button);
|
||||
gtk_box_append (GTK_BOX (box), button);
|
||||
|
||||
gtk_widget_show (window);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
project('hello', 'c',
|
||||
version: '4.3.0',
|
||||
meson_version: '>= 0.50.0',
|
||||
)
|
||||
|
||||
executable('hello',
|
||||
[ 'hello-world.c' ],
|
||||
dependencies: [ dependency('gtk4') ],
|
||||
install: false
|
||||
)
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/usr/bin/env -S GI_TYPELIB_PATH=${PWD}/build/gtk:${GI_TYPELIB_PATH} LD_PRELOAD=${LD_PRELOAD}:${PWD}/build/gtk/libgtk-4.so gjs
|
||||
|
||||
imports.gi.versions['Gtk'] = '4.0';
|
||||
|
||||
const GObject = imports.gi.GObject;
|
||||
const Gtk = imports.gi.Gtk;
|
||||
|
||||
const DemoWidget = GObject.registerClass({
|
||||
GTypeName: 'DemoWidget',
|
||||
}, class DemoWidget extends Gtk.Widget {
|
||||
|
||||
_init(params = {}) {
|
||||
super._init(params);
|
||||
|
||||
let layout_manager = new Gtk.GridLayout ();
|
||||
this.set_layout_manager (layout_manager);
|
||||
this.label1 = new Gtk.Label({ label: "Red",
|
||||
hexpand: true,
|
||||
vexpand: true });
|
||||
this.label1.set_parent (this);
|
||||
let child1 = layout_manager.get_layout_child (this.label1);
|
||||
child1.set_row (0);
|
||||
child1.set_column (0);
|
||||
|
||||
this.label2 = new Gtk.Label({ label: "Green",
|
||||
hexpand: true,
|
||||
vexpand: true });
|
||||
this.label2.set_parent (this);
|
||||
let child2 = layout_manager.get_layout_child (this.label2);
|
||||
child2.set_row (0);
|
||||
child2.set_column (1);
|
||||
}
|
||||
});
|
||||
|
||||
// Create a new application
|
||||
let app = new Gtk.Application({ application_id: 'org.gtk.exampleapp' });
|
||||
|
||||
// When the application is launched…
|
||||
app.connect('activate', () => {
|
||||
// … create a new window …
|
||||
let win = new Gtk.ApplicationWindow({ application: app });
|
||||
// … with a button in it …
|
||||
let widget = new DemoWidget();
|
||||
win.set_child(widget);
|
||||
win.present();
|
||||
});
|
||||
|
||||
// Run the application
|
||||
app.run([]);
|
||||
|
||||
@@ -2,6 +2,7 @@ examples = [
|
||||
'builder',
|
||||
'drawing',
|
||||
'grid-packing',
|
||||
'hello-world',
|
||||
'plugman',
|
||||
'search-bar',
|
||||
'sunny',
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
#!/usr/bin/env -S GI_TYPELIB_PATH=${PWD}/build/gtk:${GI_TYPELIB_PATH} LD_PRELOAD=${LD_PRELOAD}:${PWD}/build/gtk/libgtk-4.so python3
|
||||
|
||||
import gi
|
||||
|
||||
gi.require_version('Gdk', '4.0')
|
||||
gi.require_version('Gtk', '4.0')
|
||||
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Graphene
|
||||
|
||||
|
||||
class DemoWidget(Gtk.Widget):
|
||||
|
||||
__gtype_name__ = "DemoWidget"
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
def do_measure(self, orientation, for_size: int):
|
||||
# We need some space to draw
|
||||
return 100, 200, -1, -1
|
||||
|
||||
def do_snapshot(self, snapshot):
|
||||
# Draw four color squares
|
||||
color = Gdk.RGBA()
|
||||
rect = Graphene.Rect.alloc()
|
||||
|
||||
width = self.get_width() / 2
|
||||
height = self.get_height() / 2
|
||||
|
||||
Gdk.RGBA.parse(color, "red")
|
||||
rect.init(0, 0, width, height)
|
||||
snapshot.append_color(color, rect)
|
||||
|
||||
Gdk.RGBA.parse(color, "green")
|
||||
rect.init(width, 0, width, height)
|
||||
snapshot.append_color(color, rect)
|
||||
|
||||
Gdk.RGBA.parse(color, "yellow")
|
||||
rect.init(0, height, width, height)
|
||||
snapshot.append_color(color, rect)
|
||||
|
||||
Gdk.RGBA.parse(color, "blue")
|
||||
rect.init(width, height, width, height)
|
||||
snapshot.append_color(color, rect)
|
||||
|
||||
def on_activate(app):
|
||||
# Create a new window
|
||||
win = Gtk.ApplicationWindow(application=app)
|
||||
win.set_title("Squares")
|
||||
icon = DemoWidget()
|
||||
win.set_child(icon)
|
||||
win.present()
|
||||
|
||||
# Create a new application
|
||||
app = Gtk.Application(application_id='org.gtk.exampleapp')
|
||||
app.connect('activate', on_activate)
|
||||
|
||||
# Run the application
|
||||
app.run(None)
|
||||
@@ -12,7 +12,7 @@ new_window (GApplication *app,
|
||||
gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (window), TRUE);
|
||||
gtk_window_set_default_size ((GtkWindow*)window, 640, 480);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Sunny");
|
||||
gtk_window_set_icon_name (GTK_WINDOW (window), "weather-clear-symbolic");
|
||||
gtk_window_set_icon_name (GTK_WINDOW (window), "sunny");
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), header);
|
||||
@@ -78,7 +78,7 @@ show_about (GSimpleAction *action,
|
||||
gtk_show_about_dialog (NULL,
|
||||
"program-name", "Sunny",
|
||||
"title", "About Sunny",
|
||||
"logo-icon-name", "weather-clear-symbolic",
|
||||
"logo-icon-name", "sunny",
|
||||
"comments", "A cheap Bloatpad clone.",
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -48,12 +48,6 @@ void gdk_broadway_display_show_keyboard (GdkBroadwayDis
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_broadway_display_hide_keyboard (GdkBroadwayDisplay *display);
|
||||
|
||||
GDK_AVAILABLE_IN_4_4
|
||||
int gdk_broadway_display_get_surface_scale (GdkDisplay *display);
|
||||
GDK_AVAILABLE_IN_4_4
|
||||
void gdk_broadway_display_set_surface_scale (GdkDisplay *display,
|
||||
int scale);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_BROADWAY_DISPLAY_H__ */
|
||||
|
||||
@@ -94,12 +94,10 @@ _gdk_broadway_display_size_changed (GdkDisplay *display,
|
||||
|
||||
if (msg->width == current_size.width &&
|
||||
msg->height == current_size.height &&
|
||||
(msg->scale == broadway_display->scale_factor ||
|
||||
broadway_display->fixed_scale))
|
||||
msg->scale == broadway_display->scale_factor)
|
||||
return;
|
||||
|
||||
if (!broadway_display->fixed_scale)
|
||||
broadway_display->scale_factor = msg->scale;
|
||||
broadway_display->scale_factor = msg->scale;
|
||||
|
||||
gdk_monitor_set_geometry (monitor, &(GdkRectangle) { 0, 0, msg->width, msg->height });
|
||||
gdk_monitor_set_scale_factor (monitor, msg->scale);
|
||||
@@ -114,8 +112,7 @@ _gdk_broadway_display_size_changed (GdkDisplay *display,
|
||||
gdk_broadway_surface_move_resize (GDK_SURFACE (toplevel),
|
||||
0, 0,
|
||||
msg->width, msg->height);
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
||||
static GdkDevice *
|
||||
create_core_pointer (GdkDisplay *display)
|
||||
@@ -330,60 +327,6 @@ gdk_broadway_display_hide_keyboard (GdkBroadwayDisplay *display)
|
||||
_gdk_broadway_server_set_show_keyboard (display->server, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_broadway_display_set_surface_scale:
|
||||
* @display: (type GdkBroadwayDisplay): the display
|
||||
* @scale: The new scale value, as an integer >= 1
|
||||
*
|
||||
* Forces a specific window scale for all windows on this display,
|
||||
* instead of using the default or user configured scale. This
|
||||
* is can be used to disable scaling support by setting @scale to
|
||||
* 1, or to programmatically set the window scale.
|
||||
*
|
||||
* Once the scale is set by this call it will not change in
|
||||
* response to later user configuration changes.
|
||||
*
|
||||
* Since: 4.4
|
||||
*/
|
||||
void
|
||||
gdk_broadway_display_set_surface_scale (GdkDisplay *display,
|
||||
int scale)
|
||||
{
|
||||
GdkBroadwayDisplay *self;
|
||||
|
||||
g_return_if_fail (GDK_IS_BROADWAY_DISPLAY (display));
|
||||
g_return_if_fail (scale > 0);
|
||||
|
||||
self = GDK_BROADWAY_DISPLAY (display);
|
||||
|
||||
self->scale_factor = scale;
|
||||
self->fixed_scale = TRUE;
|
||||
gdk_monitor_set_scale_factor (self->monitor, scale);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_broadway_display_get_surface_scale:
|
||||
* @display: (type GdkBroadwayDisplay): the display
|
||||
*
|
||||
* Gets the surface scale that was previously set by the client or
|
||||
* gdk_broadway_display_set_surface_scale().
|
||||
*
|
||||
* Returns: the scale for surfaces
|
||||
*
|
||||
* Since: 4.4
|
||||
*/
|
||||
int
|
||||
gdk_broadway_display_get_surface_scale (GdkDisplay *display)
|
||||
{
|
||||
GdkBroadwayDisplay *self;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_BROADWAY_DISPLAY (display), 1);
|
||||
|
||||
self = GDK_BROADWAY_DISPLAY (display);
|
||||
|
||||
return self->scale_factor;
|
||||
}
|
||||
|
||||
static GListModel *
|
||||
gdk_broadway_display_get_monitors (GdkDisplay *display)
|
||||
{
|
||||
|
||||
@@ -57,7 +57,6 @@ struct _GdkBroadwayDisplay
|
||||
GListStore *monitors;
|
||||
GdkMonitor *monitor;
|
||||
int scale_factor;
|
||||
gboolean fixed_scale;
|
||||
|
||||
GHashTable *texture_cache;
|
||||
|
||||
|
||||
17
gdk/gdk.c
17
gdk/gdk.c
@@ -50,7 +50,7 @@
|
||||
/**
|
||||
* GDK_WINDOWING_X11:
|
||||
*
|
||||
* The `GDK_WINDOWING_X11` macro is defined if the X11 backend
|
||||
* The #GDK_WINDOWING_X11 macro is defined if the X11 backend
|
||||
* is supported.
|
||||
*
|
||||
* Use this macro to guard code that is specific to the X11 backend.
|
||||
@@ -59,7 +59,7 @@
|
||||
/**
|
||||
* GDK_WINDOWING_WIN32:
|
||||
*
|
||||
* The `GDK_WINDOWING_WIN32` macro is defined if the Win32 backend
|
||||
* The #GDK_WINDOWING_WIN32 macro is defined if the Win32 backend
|
||||
* is supported.
|
||||
*
|
||||
* Use this macro to guard code that is specific to the Win32 backend.
|
||||
@@ -68,7 +68,7 @@
|
||||
/**
|
||||
* GDK_WINDOWING_MACOS:
|
||||
*
|
||||
* The `GDK_WINDOWING_MACOS` macro is defined if the MacOS backend
|
||||
* The #GDK_WINDOWING_MACOS macro is defined if the MacOS backend
|
||||
* is supported.
|
||||
*
|
||||
* Use this macro to guard code that is specific to the MacOS backend.
|
||||
@@ -77,7 +77,7 @@
|
||||
/**
|
||||
* GDK_WINDOWING_WAYLAND:
|
||||
*
|
||||
* The `GDK_WINDOWING_WAYLAND` macro is defined if the Wayland backend
|
||||
* The #GDK_WINDOWING_WAYLAND macro is defined if the Wayland backend
|
||||
* is supported.
|
||||
*
|
||||
* Use this macro to guard code that is specific to the Wayland backend.
|
||||
@@ -87,7 +87,6 @@
|
||||
* GDK_DISABLE_DEPRECATION_WARNINGS:
|
||||
*
|
||||
* A macro that should be defined before including the gdk.h header.
|
||||
*
|
||||
* If it is defined, no compiler warnings will be produced for uses
|
||||
* of deprecated GDK APIs.
|
||||
*/
|
||||
@@ -127,9 +126,6 @@ static const GdkDebugKey gdk_debug_keys[] = {
|
||||
{ "gl-legacy", GDK_DEBUG_GL_LEGACY, "Use a legacy OpenGL context" },
|
||||
{ "gl-gles", GDK_DEBUG_GL_GLES, "Use a GLES OpenGL context" },
|
||||
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL" },
|
||||
{ "gl-egl", GDK_DEBUG_GL_EGL, "Use EGL on X11 or Windows" },
|
||||
{ "gl-glx", GDK_DEBUG_GL_GLX, "Use GLX on X11" },
|
||||
{ "gl-wgl", GDK_DEBUG_GL_WGL, "Use WGL on Windows" },
|
||||
{ "vulkan-disable", GDK_DEBUG_VULKAN_DISABLE, "Disable Vulkan support" },
|
||||
{ "vulkan-validate", GDK_DEBUG_VULKAN_VALIDATE, "Load the Vulkan validation layer" },
|
||||
{ "default-settings",GDK_DEBUG_DEFAULT_SETTINGS, "Force default values for xsettings" },
|
||||
@@ -332,13 +328,14 @@ gdk_display_open_default (void)
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gdk_get_startup_notification_id:
|
||||
*
|
||||
* gdk_get_startup_notification_id
|
||||
*
|
||||
* Returns the original value of the DESKTOP_STARTUP_ID environment
|
||||
* variable if it was defined and valid, or %NULL otherwise.
|
||||
*
|
||||
* Returns: (nullable) (transfer none): the original value of the
|
||||
* DESKTOP_STARTUP_ID environment variable
|
||||
* DESKTOP_STARTUP_ID environment variable, or %NULL.
|
||||
*/
|
||||
const char *
|
||||
gdk_get_startup_notification_id (void)
|
||||
|
||||
@@ -237,7 +237,7 @@ gdk_app_launch_context_set_timestamp (GdkAppLaunchContext *context,
|
||||
/**
|
||||
* gdk_app_launch_context_set_icon:
|
||||
* @context: a `GdkAppLaunchContext`
|
||||
* @icon: (nullable): a `GIcon`
|
||||
* @icon: (allow-none): a #GIcon, or %NULL
|
||||
*
|
||||
* Sets the icon for applications that are launched with this
|
||||
* context.
|
||||
@@ -267,12 +267,12 @@ gdk_app_launch_context_set_icon (GdkAppLaunchContext *context,
|
||||
/**
|
||||
* gdk_app_launch_context_set_icon_name:
|
||||
* @context: a `GdkAppLaunchContext`
|
||||
* @icon_name: (nullable): an icon name
|
||||
* @icon_name: (allow-none): an icon name, or %NULL
|
||||
*
|
||||
* Sets the icon for applications that are launched with this context.
|
||||
*
|
||||
* The @icon_name will be interpreted in the same way as the Icon field
|
||||
* in desktop files. See also [method@Gdk.AppLaunchContext.set_icon].
|
||||
* in desktop files. See also [method@Gdk.AppLaunchContext.set_icon()].
|
||||
*
|
||||
* If both @icon and @icon_name are set, the @icon_name takes priority.
|
||||
* If neither @icon or @icon_name is set, the icon is taken from either
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
/**
|
||||
* gdk_cairo_set_source_rgba:
|
||||
* @cr: a cairo context
|
||||
* @rgba: a `GdkRGBA`
|
||||
* @rgba: a #GdkRGBA
|
||||
*
|
||||
* Sets the specified `GdkRGBA` as the source color of @cr.
|
||||
* Sets the specified #GdkRGBA as the source color of @cr.
|
||||
*/
|
||||
void
|
||||
gdk_cairo_set_source_rgba (cairo_t *cr,
|
||||
@@ -47,7 +47,7 @@ gdk_cairo_set_source_rgba (cairo_t *cr,
|
||||
/**
|
||||
* gdk_cairo_rectangle:
|
||||
* @cr: a cairo context
|
||||
* @rectangle: a `GdkRectangle`
|
||||
* @rectangle: a #GdkRectangle
|
||||
*
|
||||
* Adds the given rectangle to the current path of @cr.
|
||||
*/
|
||||
@@ -66,7 +66,7 @@ gdk_cairo_rectangle (cairo_t *cr,
|
||||
/**
|
||||
* gdk_cairo_region:
|
||||
* @cr: a cairo context
|
||||
* @region: a `cairo_region_t`
|
||||
* @region: a #cairo_region_t
|
||||
*
|
||||
* Adds the given region to the current path of @cr.
|
||||
*/
|
||||
@@ -185,7 +185,7 @@ gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
|
||||
/**
|
||||
* gdk_cairo_set_source_pixbuf:
|
||||
* @cr: a cairo context
|
||||
* @pixbuf: a `GdkPixbuf`
|
||||
* @pixbuf: a #GdkPixbuf
|
||||
* @pixbuf_x: X coordinate of location to place upper left corner of @pixbuf
|
||||
* @pixbuf_y: Y coordinate of location to place upper left corner of @pixbuf
|
||||
*
|
||||
@@ -232,7 +232,7 @@ gdk_cairo_set_source_pixbuf (cairo_t *cr,
|
||||
* You must explicitly check the return value of you want to handle
|
||||
* that case.
|
||||
*
|
||||
* Returns: %TRUE if the extents fit in a `GdkRectangle`, %FALSE if not
|
||||
* Returns: %TRUE if the extents fit in a #GdkRectangle, %FALSE if not
|
||||
*/
|
||||
gboolean
|
||||
_gdk_cairo_surface_extents (cairo_surface_t *surface,
|
||||
@@ -287,7 +287,7 @@ _gdk_cairo_surface_extents (cairo_surface_t *surface,
|
||||
* This function takes into account device offsets that might be
|
||||
* set with cairo_surface_set_device_offset().
|
||||
*
|
||||
* Returns: (transfer full): A `cairo_region_t`
|
||||
* Returns: A `cairo_region_t`; must be freed with cairo_region_destroy()
|
||||
*/
|
||||
cairo_region_t *
|
||||
gdk_cairo_region_create_from_surface (cairo_surface_t *surface)
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
* draw context.
|
||||
*
|
||||
* `GdkCairoContext`s are created for a surface using
|
||||
* [method@Gdk.Surface.create_cairo_context], and the context
|
||||
* can then be used to draw on that surface.
|
||||
* [method@Gdk.Surface.create_cairo_context], and the context can then be used
|
||||
* to draw on that surface.
|
||||
*/
|
||||
|
||||
typedef struct _GdkCairoContextPrivate GdkCairoContextPrivate;
|
||||
@@ -59,7 +59,7 @@ gdk_cairo_context_init (GdkCairoContext *self)
|
||||
|
||||
/**
|
||||
* gdk_cairo_context_cairo_create:
|
||||
* @self: a `GdkCairoContext` that is currently drawing
|
||||
* @self: a #GdkCairoContext that is currently drawing
|
||||
*
|
||||
* Retrieves a Cairo context to be used to draw on the `GdkSurface`
|
||||
* of @context.
|
||||
@@ -70,8 +70,9 @@ gdk_cairo_context_init (GdkCairoContext *self)
|
||||
* The returned context is guaranteed to be valid until
|
||||
* [method@Gdk.DrawContext.end_frame] is called.
|
||||
*
|
||||
* Returns: (transfer full) (nullable): a Cairo context
|
||||
* to draw on `GdkSurface
|
||||
* Returns: (transfer full) (nullable): a Cairo context to be used
|
||||
* to draw the contents of the `GdkSurface`. %NULL is returned
|
||||
* when @context is not drawing.
|
||||
*/
|
||||
cairo_t *
|
||||
gdk_cairo_context_cairo_create (GdkCairoContext *self)
|
||||
|
||||
@@ -504,8 +504,8 @@ gdk_clipboard_is_local (GdkClipboard *clipboard)
|
||||
* If the @clipboard is empty or its contents are not owned by the
|
||||
* current process, %NULL will be returned.
|
||||
*
|
||||
* Returns: (transfer none) (nullable): The content of a clipboard
|
||||
* if the clipboard does not maintain any content
|
||||
* Returns: (transfer none) (nullable): The content of a clipboard or %NULL
|
||||
* if the clipboard does not maintain any content.
|
||||
*/
|
||||
GdkContentProvider *
|
||||
gdk_clipboard_get_content (GdkClipboard *clipboard)
|
||||
@@ -520,8 +520,8 @@ gdk_clipboard_get_content (GdkClipboard *clipboard)
|
||||
/**
|
||||
* gdk_clipboard_store_async:
|
||||
* @clipboard: a `GdkClipboard`
|
||||
* @io_priority: the I/O priority of the request
|
||||
* @cancellable: (nullable): optional `GCancellable` object
|
||||
* @io_priority: the I/O priority of the request.
|
||||
* @cancellable: (nullable): optional `GCancellable` object, %NULL to ignore.
|
||||
* @callback: (scope async): callback to call when the request is satisfied
|
||||
* @user_data: (closure): the data to pass to callback function
|
||||
*
|
||||
@@ -574,7 +574,7 @@ gdk_clipboard_store_async (GdkClipboard *clipboard,
|
||||
* gdk_clipboard_store_finish:
|
||||
* @clipboard: a `GdkClipboard`
|
||||
* @result: a `GAsyncResult`
|
||||
* @error: a `GError` location to store the error occurring
|
||||
* @error: a `GError` location to store the error occurring, or %NULL to ignore.
|
||||
*
|
||||
* Finishes an asynchronous clipboard store.
|
||||
*
|
||||
@@ -637,7 +637,7 @@ gdk_clipboard_read_internal (GdkClipboard *clipboard,
|
||||
* @clipboard: a `GdkClipboard`
|
||||
* @mime_types: a %NULL-terminated array of mime types to choose from
|
||||
* @io_priority: the I/O priority of the request
|
||||
* @cancellable: (nullable): optional `GCancellable` object
|
||||
* @cancellable: (nullable): optional `GCancellable` object, %NULL to ignore.
|
||||
* @callback: (scope async): callback to call when the request is satisfied
|
||||
* @user_data: (closure): the data to pass to callback function
|
||||
*
|
||||
@@ -676,15 +676,15 @@ gdk_clipboard_read_async (GdkClipboard *clipboard,
|
||||
* gdk_clipboard_read_finish:
|
||||
* @clipboard: a `GdkClipboard`
|
||||
* @result: a `GAsyncResult`
|
||||
* @out_mime_type: (out) (optional) (transfer none): location to store
|
||||
* the chosen mime type
|
||||
* @error: a `GError` location to store the error occurring
|
||||
* @out_mime_type: (out) (allow-none) (transfer none): pointer to store
|
||||
* the chosen mime type in or %NULL
|
||||
* @error: a `GError` location to store the error occurring, or %NULL to ignore.
|
||||
*
|
||||
* Finishes an asynchronous clipboard read.
|
||||
*
|
||||
* See [method@Gdk.Clipboard.read_async].
|
||||
*
|
||||
* Returns: (transfer full) (nullable): a `GInputStream`
|
||||
* Returns: (transfer full) (nullable): a `GInputStream` or %NULL on error.
|
||||
*/
|
||||
GInputStream *
|
||||
gdk_clipboard_read_finish (GdkClipboard *clipboard,
|
||||
@@ -833,7 +833,7 @@ gdk_clipboard_read_value_internal (GdkClipboard *clipboard,
|
||||
* @clipboard: a `GdkClipboard`
|
||||
* @type: a `GType` to read
|
||||
* @io_priority: the I/O priority of the request
|
||||
* @cancellable: (nullable): optional `GCancellable` object
|
||||
* @cancellable: (nullable): optional #GCancellable object, %NULL to ignore.
|
||||
* @callback: (scope async): callback to call when the request is satisfied
|
||||
* @user_data: (closure): the data to pass to callback function
|
||||
*
|
||||
@@ -872,7 +872,7 @@ gdk_clipboard_read_value_async (GdkClipboard *clipboard,
|
||||
* gdk_clipboard_read_value_finish:
|
||||
* @clipboard: a `GdkClipboard`
|
||||
* @result: a `GAsyncResult`
|
||||
* @error: a GError` location to store the error occurring
|
||||
* @error: a GError` location to store the error occurring, or %NULL to ignore
|
||||
*
|
||||
* Finishes an asynchronous clipboard read.
|
||||
*
|
||||
@@ -931,13 +931,13 @@ gdk_clipboard_read_texture_async (GdkClipboard *clipboard,
|
||||
* gdk_clipboard_read_texture_finish:
|
||||
* @clipboard: a `GdkClipboard`
|
||||
* @result: a `GAsyncResult`
|
||||
* @error: a `GError` location to store the error occurring
|
||||
* @error: a `GError` location to store the error occurring, or %NULL to ignore
|
||||
*
|
||||
* Finishes an asynchronous clipboard read.
|
||||
*
|
||||
* See [method@Gdk.Clipboard.read_texture_async].
|
||||
*
|
||||
* Returns: (transfer full) (nullable): a new `GdkTexture`
|
||||
* Returns: (transfer full) (nullable): a new `GdkTexture` or %NULL on error
|
||||
*/
|
||||
GdkTexture *
|
||||
gdk_clipboard_read_texture_finish (GdkClipboard *clipboard,
|
||||
@@ -960,7 +960,7 @@ gdk_clipboard_read_texture_finish (GdkClipboard *clipboard,
|
||||
/**
|
||||
* gdk_clipboard_read_text_async:
|
||||
* @clipboard: a `GdkClipboard`
|
||||
* @cancellable: (nullable): optional `GCancellable` object
|
||||
* @cancellable: (nullable): optional `GCancellable` object, %NULL to ignore
|
||||
* @callback: (scope async): callback to call when the request is satisfied
|
||||
* @user_data: (closure): the data to pass to callback function
|
||||
*
|
||||
@@ -996,13 +996,13 @@ gdk_clipboard_read_text_async (GdkClipboard *clipboard,
|
||||
* gdk_clipboard_read_text_finish:
|
||||
* @clipboard: a `GdkClipboard`
|
||||
* @result: a `GAsyncResult`
|
||||
* @error: a `GError` location to store the error occurring
|
||||
* @error: a `GError` location to store the error occurring, or %NULL to ignore
|
||||
*
|
||||
* Finishes an asynchronous clipboard read.
|
||||
*
|
||||
* See [method@Gdk.Clipboard.read_text_async].
|
||||
*
|
||||
* Returns: (transfer full) (nullable): a new string
|
||||
* Returns: (transfer full) (nullable): a new string or %NULL on error
|
||||
*/
|
||||
char *
|
||||
gdk_clipboard_read_text_finish (GdkClipboard *clipboard,
|
||||
@@ -1194,8 +1194,8 @@ gdk_clipboard_claim_remote (GdkClipboard *clipboard,
|
||||
/**
|
||||
* gdk_clipboard_set_content:
|
||||
* @clipboard: a `GdkClipboard`
|
||||
* @provider: (transfer none) (nullable): the new contents of @clipboard
|
||||
* or %NULL to clear the clipboard
|
||||
* @provider: (transfer none) (allow-none): the new contents of @clipboard or
|
||||
* %NULL to clear the clipboard
|
||||
*
|
||||
* Sets a new content provider on @clipboard.
|
||||
*
|
||||
|
||||
@@ -190,9 +190,9 @@ gdk_content_deserializer_get_mime_type (GdkContentDeserializer *deserializer)
|
||||
* gdk_content_deserializer_get_gtype:
|
||||
* @deserializer: a `GdkContentDeserializer`
|
||||
*
|
||||
* Gets the `GType` to create an instance of.
|
||||
* Gets the GType to create an instance of.
|
||||
*
|
||||
* Returns: the `GType` for the current operation
|
||||
* Returns: the GType for the current operation
|
||||
*/
|
||||
GType
|
||||
gdk_content_deserializer_get_gtype (GdkContentDeserializer *deserializer)
|
||||
@@ -224,7 +224,7 @@ gdk_content_deserializer_get_value (GdkContentDeserializer *deserializer)
|
||||
*
|
||||
* Gets the input stream for the current operation.
|
||||
*
|
||||
* This is the stream that was passed to [func@Gdk.content_deserialize_async].
|
||||
* This is the stream that was passed to [func@content_deserialize_async].
|
||||
*
|
||||
* Returns: (transfer none): the input stream for the current operation
|
||||
*/
|
||||
@@ -242,7 +242,7 @@ gdk_content_deserializer_get_input_stream (GdkContentDeserializer *deserializer)
|
||||
*
|
||||
* Gets the I/O priority for the current operation.
|
||||
*
|
||||
* This is the priority that was passed to [func@Gdk.content_deserialize_async].
|
||||
* This is the priority that was passed to [funccontent_deserialize_async].
|
||||
*
|
||||
* Returns: the I/O priority for the current operation
|
||||
*/
|
||||
@@ -260,7 +260,7 @@ gdk_content_deserializer_get_priority (GdkContentDeserializer *deserializer)
|
||||
*
|
||||
* Gets the cancellable for the current operation.
|
||||
*
|
||||
* This is the `GCancellable` that was passed to [func@Gdk.content_deserialize_async].
|
||||
* This is the `GCancellable` that was passed to [func@content_deserialize_async].
|
||||
*
|
||||
* Returns: (transfer none): the cancellable for the current operation
|
||||
*/
|
||||
@@ -364,7 +364,7 @@ gdk_content_deserializer_return_success (GdkContentDeserializer *deserializer)
|
||||
/**
|
||||
* gdk_content_deserializer_return_error:
|
||||
* @deserializer: a `GdkContentDeserializer`
|
||||
* @error: (transfer full): a `GError`
|
||||
* @error: a `GError`
|
||||
*
|
||||
* Indicate that the deserialization has ended with an error.
|
||||
*
|
||||
@@ -539,7 +539,7 @@ deserialize_not_found (GdkContentDeserializer *deserializer)
|
||||
* indicate a higher priority.
|
||||
*
|
||||
* When the operation is finished, @callback will be called. You must then
|
||||
* call [func@Gdk.content_deserialize_finish] to get the result of the operation.
|
||||
* call [func@content_deserialize_finish] to get the result of the operation.
|
||||
*/
|
||||
void
|
||||
gdk_content_deserialize_async (GInputStream *stream,
|
||||
|
||||
@@ -36,7 +36,7 @@ typedef struct _GdkContentDeserializer GdkContentDeserializer;
|
||||
|
||||
/**
|
||||
* GdkContentDeserializeFunc:
|
||||
* @deserializer: a `GdkContentDeserializer`
|
||||
* @deserializer: a #GdkContentDeserializer
|
||||
*
|
||||
* The type of a function that can be registered with gdk_content_register_deserializer().
|
||||
*
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
*
|
||||
* `GdkContentFormats` is an immutable struct. After creation, you cannot change
|
||||
* the types it represents. Instead, new `GdkContentFormats` have to be created.
|
||||
* The [struct@Gdk.ContentFormatsBuilder] structure is meant to help in this
|
||||
* The [struct@Gdk.ContentFormatsBuilder]` structure is meant to help in this
|
||||
* endeavor.
|
||||
*/
|
||||
|
||||
@@ -84,8 +84,8 @@ G_DEFINE_BOXED_TYPE (GdkContentFormats, gdk_content_formats,
|
||||
* If @string is not a valid mime type, %NULL is returned instead.
|
||||
* See RFC 2048 for the syntax if mime types.
|
||||
*
|
||||
* Returns: (nullable): An interned string for the canonicalized
|
||||
* mime type or %NULL if the string wasn't a valid mime type
|
||||
* Returns: An interned string for the canonicalized mime type
|
||||
* or %NULL if the string wasn't a valid mime type
|
||||
*/
|
||||
const char *
|
||||
gdk_intern_mime_type (const char *string)
|
||||
@@ -125,7 +125,7 @@ gdk_content_formats_new_take (GType * gtypes,
|
||||
|
||||
/**
|
||||
* gdk_content_formats_new:
|
||||
* @mime_types: (array length=n_mime_types) (nullable): Pointer to an
|
||||
* @mime_types: (array length=n_mime_types) (allow-none): Pointer to an
|
||||
* array of mime types
|
||||
* @n_mime_types: number of entries in @mime_types.
|
||||
*
|
||||
@@ -133,7 +133,7 @@ gdk_content_formats_new_take (GType * gtypes,
|
||||
*
|
||||
* The mime types must be valid and different from each other or the
|
||||
* behavior of the return value is undefined. If you cannot guarantee
|
||||
* this, use [struct@Gdk.ContentFormatsBuilder] instead.
|
||||
* this, use `GdkContentFormatsBuilder` instead.
|
||||
*
|
||||
* Returns: (transfer full): the new `GdkContentFormats`.
|
||||
*/
|
||||
@@ -384,7 +384,7 @@ gdk_content_formats_match_gtype (const GdkContentFormats *first,
|
||||
*
|
||||
* If no matching mime type is found, %NULL is returned.
|
||||
*
|
||||
* Returns: (nullable): The first common mime type or %NULL if none
|
||||
* Returns: (nullable): The first common mime type or %NULL if none.
|
||||
*/
|
||||
const char *
|
||||
gdk_content_formats_match_mime_type (const GdkContentFormats *first,
|
||||
@@ -411,7 +411,7 @@ gdk_content_formats_match_mime_type (const GdkContentFormats *first,
|
||||
*
|
||||
* Checks if a given `GType` is part of the given @formats.
|
||||
*
|
||||
* Returns: %TRUE if the `GType` was found
|
||||
* Returns: %TRUE if the #GType was found
|
||||
*/
|
||||
gboolean
|
||||
gdk_content_formats_contain_gtype (const GdkContentFormats *formats,
|
||||
@@ -454,15 +454,16 @@ gdk_content_formats_contain_mime_type (const GdkContentFormats *formats,
|
||||
* gdk_content_formats_get_gtypes:
|
||||
* @formats: a `GdkContentFormats`
|
||||
* @n_gtypes: (out) (optional): optional pointer to take the
|
||||
* number of `GType`s contained in the return value
|
||||
* number of #GTypes contained in the return value
|
||||
*
|
||||
* Gets the `GType`s included in @formats.
|
||||
* Gets the `GTypes` included in @formats.
|
||||
*
|
||||
* Note that @formats may not contain any `GType`s, in particular when
|
||||
* Note that @formats may not contain any #GTypes, in particular when
|
||||
* they are empty. In that case %NULL will be returned.
|
||||
*
|
||||
* Returns: (transfer none) (nullable) (array length=n_gtypes zero-terminated=1):
|
||||
* %G_TYPE_INVALID-terminated array of types included in @formats
|
||||
* %G_TYPE_INVALID-terminated array of types included in @formats or
|
||||
* %NULL if none.
|
||||
*/
|
||||
const GType *
|
||||
gdk_content_formats_get_gtypes (const GdkContentFormats *formats,
|
||||
@@ -480,16 +481,16 @@ gdk_content_formats_get_gtypes (const GdkContentFormats *formats,
|
||||
* gdk_content_formats_get_mime_types:
|
||||
* @formats: a `GdkContentFormats`
|
||||
* @n_mime_types: (out) (optional): optional pointer to take the
|
||||
* number of mime types contained in the return value
|
||||
* number of mime types contained in the return value
|
||||
*
|
||||
* Gets the mime types included in @formats.
|
||||
*
|
||||
* Note that @formats may not contain any mime types, in particular
|
||||
* when they are empty. In that case %NULL will be returned.
|
||||
*
|
||||
* Returns: (transfer none) (nullable) (array length=n_mime_types zero-terminated=1):
|
||||
* %NULL-terminated array of interned strings of mime types included
|
||||
* in @formats
|
||||
* Returns: (transfer none) (nullable) (array length=n_mime_types zero-terminated=1): %NULL-terminated array of
|
||||
* interned strings of mime types included in @formats or %NULL
|
||||
* if none.
|
||||
*/
|
||||
const char * const *
|
||||
gdk_content_formats_get_mime_types (const GdkContentFormats *formats,
|
||||
|
||||
@@ -218,7 +218,7 @@ gdk_content_provider_init (GdkContentProvider *provider)
|
||||
|
||||
/**
|
||||
* gdk_content_provider_ref_formats: (attributes org.gtk.Method.get_property=formats)
|
||||
* @provider: a `GdkContentProvider`
|
||||
* @provider: a #GdkContentProvider
|
||||
*
|
||||
* Gets the formats that the provider can provide its current contents in.
|
||||
*
|
||||
@@ -234,7 +234,7 @@ gdk_content_provider_ref_formats (GdkContentProvider *provider)
|
||||
|
||||
/**
|
||||
* gdk_content_provider_ref_storable_formats: (attributes org.gtk.Method.get_property=storable-formats)
|
||||
* @provider: a `GdkContentProvider`
|
||||
* @provider: a #GdkContentProvider
|
||||
*
|
||||
* Gets the formats that the provider suggests other applications to store
|
||||
* the data in.
|
||||
@@ -288,7 +288,7 @@ gdk_content_provider_content_changed (GdkContentProvider *provider)
|
||||
*
|
||||
* The given mime type does not need to be listed in the formats returned by
|
||||
* [method@Gdk.ContentProvider.ref_formats]. However, if the given `GType` is
|
||||
* not supported, `G_IO_ERROR_NOT_SUPPORTED` will be reported.
|
||||
* not supported, #G_IO_ERROR_NOT_SUPPORTED will be reported.
|
||||
*
|
||||
* The given @stream will not be closed.
|
||||
*/
|
||||
@@ -319,14 +319,14 @@ gdk_content_provider_write_mime_type_async (GdkContentProvider *provider,
|
||||
* gdk_content_provider_write_mime_type_finish:
|
||||
* @provider: a `GdkContentProvider`
|
||||
* @result: a `GAsyncResult`
|
||||
* @error: a `GError` location to store the error occurring
|
||||
* @error: a `GError` location to store the error occurring, or %NULL to ignore
|
||||
*
|
||||
* Finishes an asynchronous write operation.
|
||||
*
|
||||
* See [method@Gdk.ContentProvider.write_mime_type_async].
|
||||
*
|
||||
* Returns: %TRUE if the operation was completed successfully. Otherwise
|
||||
* @error will be set to describe the failure.
|
||||
* @error will be set to describe the failure.
|
||||
*/
|
||||
gboolean
|
||||
gdk_content_provider_write_mime_type_finish (GdkContentProvider *provider,
|
||||
@@ -343,7 +343,7 @@ gdk_content_provider_write_mime_type_finish (GdkContentProvider *provider,
|
||||
* gdk_content_provider_get_value:
|
||||
* @provider: a `GdkContentProvider`
|
||||
* @value: the `GValue` to fill
|
||||
* @error: a `GError` location to store the error occurring
|
||||
* @error: a `GError` location to store the error occurring, or %NULL to ignore
|
||||
*
|
||||
* Gets the contents of @provider stored in @value.
|
||||
*
|
||||
@@ -351,10 +351,10 @@ gdk_content_provider_write_mime_type_finish (GdkContentProvider *provider,
|
||||
* provided in. This given `GType` does not need to be listed in the formats
|
||||
* returned by [method@Gdk.ContentProvider.ref_formats]. However, if the
|
||||
* given `GType` is not supported, this operation can fail and
|
||||
* `G_IO_ERROR_NOT_SUPPORTED` will be reported.
|
||||
* #G_IO_ERROR_NOT_SUPPORTED will be reported.
|
||||
*
|
||||
* Returns: %TRUE if the value was set successfully. Otherwise
|
||||
* @error will be set to describe the failure.
|
||||
* @error will be set to describe the failure.
|
||||
*/
|
||||
gboolean
|
||||
gdk_content_provider_get_value (GdkContentProvider *provider,
|
||||
|
||||
@@ -45,9 +45,9 @@ struct _GdkContentProvider
|
||||
|
||||
/**
|
||||
* GdkContentProviderClass:
|
||||
* @content_changed: Signal class closure for `GdkContentProvider::content-changed`
|
||||
* @content_changed: Signal class closure for #GdkContentProvider::content-changed
|
||||
*
|
||||
* Class structure for `GdkContentProvider`.
|
||||
* Class structure for #GdkContentProvider.
|
||||
*/
|
||||
struct _GdkContentProviderClass
|
||||
{
|
||||
|
||||
@@ -394,7 +394,7 @@ gdk_content_provider_union_init (GdkContentProviderUnion *self)
|
||||
/**
|
||||
* gdk_content_provider_new_union:
|
||||
* @providers: (nullable) (array length=n_providers) (transfer full):
|
||||
* The `GdkContentProvider`s to present the union of
|
||||
* The #GdkContentProviders to present the union of
|
||||
* @n_providers: the number of providers
|
||||
*
|
||||
* Creates a content provider that represents all the given @providers.
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
*
|
||||
* GTK provides serializers and deserializers for common data types
|
||||
* such as text, colors, images or file lists. To register your own
|
||||
* serialization functions, use [func@Gdk.content_register_serializer].
|
||||
* serialization functions, use [func@content_register_serializer].
|
||||
*
|
||||
* Also see [class@Gdk.ContentDeserializer].
|
||||
*/
|
||||
@@ -264,7 +264,7 @@ gdk_content_serializer_get_priority (GdkContentSerializer *serializer)
|
||||
*
|
||||
* Gets the cancellable for the current operation.
|
||||
*
|
||||
* This is the `GCancellable` that was passed to [func@content_serialize_async].
|
||||
* This is the `GCancellable` that was passed to [content_serialize_async].
|
||||
*
|
||||
* Returns: (transfer none): the cancellable for the current operation
|
||||
*/
|
||||
@@ -368,7 +368,7 @@ gdk_content_serializer_return_success (GdkContentSerializer *serializer)
|
||||
/**
|
||||
* gdk_content_serializer_return_error:
|
||||
* @serializer: a `GdkContentSerializer`
|
||||
* @error: (transfer full): a `GError`
|
||||
* @error: a `GError`
|
||||
*
|
||||
* Indicate that the serialization has ended with an error.
|
||||
*
|
||||
@@ -533,7 +533,7 @@ serialize_not_found (GdkContentSerializer *serializer)
|
||||
* @mime_type: the mime type to serialize to
|
||||
* @value: the content to serialize
|
||||
* @io_priority: the I/O priority of the operation
|
||||
* @cancellable: (nullable): optional `GCancellable` object
|
||||
* @cancellable: (nullable): optional #GCancellable object
|
||||
* @callback: (scope async): callback to call when the operation is done
|
||||
* @user_data: (closure): data to pass to the callback function
|
||||
*
|
||||
@@ -543,7 +543,7 @@ serialize_not_found (GdkContentSerializer *serializer)
|
||||
* indicate a higher priority.
|
||||
*
|
||||
* When the operation is finished, @callback will be called. You must then
|
||||
* call [func@Gdk.content_serialize_finish] to get the result of the operation.
|
||||
* call [func@content_serialize_finish] to get the result of the operation.
|
||||
*/
|
||||
void
|
||||
gdk_content_serialize_async (GOutputStream *stream,
|
||||
|
||||
@@ -36,7 +36,7 @@ typedef struct _GdkContentSerializer GdkContentSerializer;
|
||||
|
||||
/**
|
||||
* GdkContentSerializeFunc:
|
||||
* @serializer: a `GdkContentSerializer`
|
||||
* @serializer: a #GdkContentSerializer
|
||||
*
|
||||
* The type of a function that can be registered with gdk_content_register_serializer().
|
||||
*
|
||||
|
||||
@@ -298,8 +298,8 @@ gdk_cursor_equal (gconstpointer a,
|
||||
/**
|
||||
* gdk_cursor_new_from_name:
|
||||
* @name: the name of the cursor
|
||||
* @fallback: (nullable): %NULL or the `GdkCursor` to fall back to when
|
||||
* this one cannot be supported
|
||||
* @fallback: (allow-none): %NULL or the `GdkCursor` to fall back to when
|
||||
* this one cannot be supported
|
||||
*
|
||||
* Creates a new cursor by looking up @name in the current cursor
|
||||
* theme.
|
||||
@@ -340,8 +340,8 @@ gdk_cursor_new_from_name (const char *name,
|
||||
* @texture: the texture providing the pixel data
|
||||
* @hotspot_x: the horizontal offset of the “hotspot” of the cursor
|
||||
* @hotspot_y: the vertical offset of the “hotspot” of the cursor
|
||||
* @fallback: (nullable): the `GdkCursor` to fall back to when
|
||||
* this one cannot be supported
|
||||
* @fallback: (allow-none): %NULL or the `GdkCursor` to fall back to when
|
||||
* this one cannot be supported
|
||||
*
|
||||
* Creates a new cursor from a `GdkTexture`.
|
||||
*
|
||||
@@ -379,7 +379,7 @@ gdk_cursor_new_from_texture (GdkTexture *texture,
|
||||
* it is used on does not support textured cursors.
|
||||
*
|
||||
* Returns: (transfer none) (nullable): the fallback of the cursor or %NULL
|
||||
* to use the default cursor as fallback
|
||||
* to use the default cursor as fallback.
|
||||
*/
|
||||
GdkCursor *
|
||||
gdk_cursor_get_fallback (GdkCursor *cursor)
|
||||
@@ -410,7 +410,7 @@ gdk_cursor_get_name (GdkCursor *cursor)
|
||||
|
||||
/**
|
||||
* gdk_cursor_get_texture:
|
||||
* @cursor: a `GdkCursor`
|
||||
* @cursor: a #GdkCursor.
|
||||
*
|
||||
* Returns the texture for the cursor.
|
||||
*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user