Compare commits

..

25 Commits

Author SHA1 Message Date
Matthias Clasen
825b2a4139 wip: benchmarks 2020-07-12 20:54:46 -04:00
Matthias Clasen
8a23649d40 stringlist: Reuse objects
Keep a bitset of positions where the array contains
objects, and check those for reusable objects whenever
we need a new object.

We still keep the low-bit marking of string pointers,
so we can implement g_list_model_get_item without having
to consult the bitset.

In scrolling through the words demo, this keeps the
number of live string objects at ~200.
2020-07-12 20:52:48 -04:00
Matthias Clasen
bf367b219b stringlist: Use an array
A version of GtkStringList that uses a GPtrArray
to hold the strings / objects. We avoid a second
array by marking strings using a low bit of the
pointer.
2020-06-30 23:37:21 -04:00
Matthias Clasen
77435d31fa gtk-demo: Use a progressbar in the words demo
This looks better and a bit more polished.
2020-07-01 02:47:50 +02:00
Matthias Clasen
6edb8f096f gtk-demo: No selection in the words demo
This demo is about filtering, not about selection,
so use a GtkNoSelection.
2020-07-01 02:46:05 +02:00
Matthias Clasen
c4dfee8860 gtk-demo: Cosmetic fixes for the words demo
Set a window size, and don't put newlines in titles, left align and
ellipsize the label.
2020-07-01 02:46:05 +02:00
Benjamin Otte
8ac1e77c9a demo: Make words listview load async
And add an "Open" button (why are filechooser buttons such a catastrophe
that I can't make them smaller?).
2020-07-01 02:46:05 +02:00
Benjamin Otte
65ceb6c15a stringlist: Call splice() for adding items after construction
This has the benefit of actually allowing NULL to be passed.
2020-07-01 02:46:05 +02:00
Benjamin Otte
f70d10f6ac stringlist: Remove n_additions argument from gtk_string_list_splice()
char ** arrays are null-terminated everywhere, so make sure they are in
splice(), too.

Also fix the argument to be a const char * const * like in the
constructor.
2020-07-01 02:46:05 +02:00
Benjamin Otte
0bbd083d79 stringlist: Clarify docs for gtk_string_list_get_string()
Make sure it's obvious that it behaves like g_list_model_get_item() and
returns NULL for pos >= n_items.
2020-07-01 02:46:05 +02:00
Benjamin Otte
102d2986c6 stringlist: Make one constructor call the other
Simplifies code.
2020-07-01 02:46:05 +02:00
Benjamin Otte
c74201ca87 filterlistmodel: Look at type of change
This way we can avoid refiltering most of an already filtered list when
the change becomes more strict.
2020-07-01 02:46:05 +02:00
Benjamin Otte
b09019a5b4 gtk-demo: Add incremental filtering to words demo 2020-07-01 02:46:05 +02:00
Benjamin Otte
1dd08ad8db filterlistmodel: Add gtk_filter_list_model_get_pending()
This allows tracking if the model is busy filtering.
2020-07-01 02:46:05 +02:00
Benjamin Otte
eb0704855f filterlistmodel: Add incremental filtering 2020-07-01 02:46:05 +02:00
Benjamin Otte
c4c1d4a1b3 bitset: Add gtk_bitset_new_range()
It's a common use.
2020-07-01 02:46:05 +02:00
Benjamin Otte
e6756f605e stringlist: Make property not construct-only
Massively speeds up creation of long stringlists.
2020-07-01 02:46:05 +02:00
Benjamin Otte
1f4b8e089e filterlistmodel: Rewrite with bitset data structure
Bitsets are more powerful, less memory intensive and faster than the old
GtkRbTree version.
2020-07-01 02:46:05 +02:00
Benjamin Otte
c0e08db739 bitset: Add APIs needed for a filterlistmodel 2020-06-30 00:46:56 +02:00
Benjamin Otte
1c337d350d tests: Make testlistview be a list again
The grid conversion was for testing and should never have been
committed.
2020-06-30 00:46:56 +02:00
Benjamin Otte
81e675dfbf gtk-demo: Add a listview demo for filtering strings 2020-06-30 00:36:14 +02:00
Benjamin Otte
8556221429 stringlist: Take a const char const * argument
Sucks that we need to cast a char**, but otherwise we need to cast
{"foo", "bar", "baz" } arrays.
2020-06-30 00:36:14 +02:00
Benjamin Otte
1b4109a7fd scrolledwindow: Expand by default
Use gtk_scrolled_window_set_hexpand/vexpand(FALSE) to make the scrolled
window not expand.
2020-06-30 00:36:13 +02:00
Benjamin Otte
df0786be7a stringfilter: Don't crash if the expression returns "" 2020-06-30 00:36:13 +02:00
Benjamin Otte
3f545da08d a11y: Remove double initialization of variables 2020-06-30 00:36:13 +02:00
1938 changed files with 170678 additions and 153194 deletions

View File

@@ -16,11 +16,11 @@ stages:
# Common variables # Common variables
variables: variables:
COMMON_MESON_FLAGS: "--fatal-meson-warnings -Dgtk:werror=true" COMMON_MESON_FLAGS: "--fatal-meson-warnings --werror"
BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true" BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true -Dvulkan=yes"
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled" FEATURE_FLAGS: "-Dcloudproviders=true"
MESON_TEST_TIMEOUT_MULTIPLIER: 3 MESON_TEST_TIMEOUT_MULTIPLIER: 2
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v22" FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v17"
FLATPAK_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master" FLATPAK_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master"
DOCS_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora-docs:v19" DOCS_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora-docs:v19"
@@ -68,13 +68,11 @@ style-check-diff:
fedora-x86_64: fedora-x86_64:
extends: .build-fedora-default extends: .build-fedora-default
stage: build stage: build
needs: []
variables: variables:
EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both" EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both"
script: script:
- meson subprojects update
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS} - meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
-Dsysprof=enabled -Dprofiler=true
_build _build
- ninja -C _build - ninja -C _build
- .gitlab-ci/run-tests.sh _build x11 - .gitlab-ci/run-tests.sh _build x11
@@ -84,38 +82,14 @@ fedora-x86_64:
release-build: release-build:
extends: .build-fedora-default extends: .build-fedora-default
stage: build stage: build
needs: []
variables: variables:
EXTRA_MESON_FLAGS: "--buildtype=release" EXTRA_MESON_FLAGS: "--buildtype=release"
script: script:
- meson subprojects update
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS} - meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
_build _build
- ninja -C _build - ninja -C _build
- .gitlab-ci/run-tests.sh _build x11 - .gitlab-ci/run-tests.sh _build x11
installed-tests:
extends: .build-fedora-default
stage: build
needs: []
variables:
EXTRA_MESON_FLAGS: "--prefix=/usr --libdir=/usr/lib64 -Dinstall-tests=true"
script:
- meson subprojects update
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
_build
- ninja -C _build
- sudo ninja -C _build install
- dbus-run-session xvfb-run -a -s "-screen 0 1024x768x24"
gnome-desktop-testing-runner
--report-directory=_build/installed-tests-report/failed/
--parallel=0
gtk-4.0
artifacts:
paths:
- "_build/installed-tests-report/"
.mingw-defaults: .mingw-defaults:
stage: build stage: build
tags: tags:
@@ -135,7 +109,6 @@ installed-tests:
msys2-mingw64: msys2-mingw64:
extends: .mingw-defaults extends: .mingw-defaults
needs: []
variables: variables:
MSYSTEM: "MINGW64" MSYSTEM: "MINGW64"
CHERE_INVOKING: "yes" CHERE_INVOKING: "yes"
@@ -166,44 +139,37 @@ msys2-mingw64:
flatpak-manual:demo: flatpak-manual:demo:
extends: .flatpak-manual extends: .flatpak-manual
needs: []
variables: variables:
APPID: org.gtk.Demo4 APPID: org.gtk.Demo4
flatpak-master:demo: flatpak-master:demo:
extends: .flatpak-master extends: .flatpak-master
needs: []
variables: variables:
APPID: org.gtk.Demo4 APPID: org.gtk.Demo4
flatpak-manual:widget-factory: flatpak-manual:widget-factory:
extends: .flatpak-manual extends: .flatpak-manual
needs: []
variables: variables:
APPID: org.gtk.WidgetFactory4 APPID: org.gtk.WidgetFactory4
flatpak-master:widget-factory: flatpak-master:widget-factory:
extends: .flatpak-master extends: .flatpak-master
needs: []
variables: variables:
APPID: org.gtk.WidgetFactory4 APPID: org.gtk.WidgetFactory4
flatpak-manual:icon-browser: flatpak-manual:icon-browser:
extends: .flatpak-manual extends: .flatpak-manual
needs: []
variables: variables:
APPID: org.gtk.IconBrowser4 APPID: org.gtk.IconBrowser4
flatpak-master:icon-browser: flatpak-master:icon-browser:
extends: .flatpak-master extends: .flatpak-master
needs: []
variables: variables:
APPID: org.gtk.IconBrowser4 APPID: org.gtk.IconBrowser4
static-scan: static-scan:
image: $FEDORA_IMAGE image: $FEDORA_IMAGE
stage: analysis stage: analysis
needs: []
variables: variables:
EXTRA_MESON_FLAGS: "--buildtype=debug" EXTRA_MESON_FLAGS: "--buildtype=debug"
script: script:
@@ -214,27 +180,9 @@ static-scan:
- _scan_build/meson-logs - _scan_build/meson-logs
allow_failure: true allow_failure: true
# Run tests with the address sanitizer. We need to turn off introspection,
# since it is incompatible with asan
asan-build:
image: $FEDORA_IMAGE
tags: [ asan ]
stage: analysis
needs: []
variables:
script:
- CC=clang meson --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=false _build
- ninja -C _build
- .gitlab-ci/run-tests.sh _build wayland
artifacts:
paths:
- _build/meson-logs
allow_failure: true
reference: reference:
image: $DOCS_IMAGE image: $DOCS_IMAGE
stage: docs stage: docs
needs: []
variables: variables:
EXTRA_MESON_FLAGS: "--buildtype=release" EXTRA_MESON_FLAGS: "--buildtype=release"
script: script:
@@ -250,7 +198,6 @@ reference:
pages: pages:
stage: deploy stage: deploy
needs: ['reference']
script: script:
- mv _reference/ public/ - mv _reference/ public/
artifacts: artifacts:

View File

View File

@@ -35,13 +35,4 @@ branch, as well as their available versions.
- [ ] Add the new job to `.gitlab-ci.yml` referencing the image - [ ] Add the new job to `.gitlab-ci.yml` referencing the image
- [ ] Open a merge request with your changes and let it run - [ ] Open a merge request with your changes and let it run
### Checklist for Adding a new dependency to a CI image
Our images are layered, and the base (called fedora-base) contains
all the rpm payload. Therefore, adding a new dependency is a 2-step
process:
1. [ ] Build and upload fedora-base:$version+1
1. [ ] Build and upload fedora:$version+1 based on fedora-base:version+1
[registry]: https://gitlab.gnome.org/GNOME/gtk/container_registry [registry]: https://gitlab.gnome.org/GNOME/gtk/container_registry

View File

@@ -29,7 +29,6 @@ RUN dnf -y install \
glib2-static \ glib2-static \
glibc-devel \ glibc-devel \
glibc-headers \ glibc-headers \
gnome-desktop-testing \
gobject-introspection-devel \ gobject-introspection-devel \
graphene-devel \ graphene-devel \
gstreamer1-devel \ gstreamer1-devel \
@@ -42,14 +41,12 @@ RUN dnf -y install \
itstool \ itstool \
json-glib-devel \ json-glib-devel \
lcov \ lcov \
libasan \
libattr-devel \ libattr-devel \
libepoxy-devel \ libepoxy-devel \
libffi-devel \ libffi-devel \
libmount-devel \ libmount-devel \
librsvg2 \ librsvg2 \
libselinux-devel \ libselinux-devel \
libubsan \
libXcomposite-devel \ libXcomposite-devel \
libXcursor-devel \ libXcursor-devel \
libXcursor-devel \ libXcursor-devel \
@@ -76,6 +73,7 @@ RUN dnf -y install \
python3-wheel \ python3-wheel \
redhat-rpm-config \ redhat-rpm-config \
sassc \ sassc \
sysprof-devel \
systemtap-sdt-devel \ systemtap-sdt-devel \
vulkan-devel \ vulkan-devel \
wayland-devel \ wayland-devel \

View File

@@ -1,11 +1,8 @@
FROM registry.gitlab.gnome.org/gnome/gtk/fedora-base:v21 FROM registry.gitlab.gnome.org/gnome/gtk/fedora-base:v19
# Enable sudo for wheel users
RUN sed -i -e 's/# %wheel/%wheel/' -e '0,/%wheel/{s/%wheel/# %wheel/}' /etc/sudoers
ARG HOST_USER_ID=5555 ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID} ENV HOST_USER_ID ${HOST_USER_ID}
RUN useradd -u $HOST_USER_ID -G wheel -ms /bin/bash user RUN useradd -u $HOST_USER_ID -ms /bin/bash user
USER user USER user
WORKDIR /home/user WORKDIR /home/user

View File

@@ -7,17 +7,14 @@ srcdir=$( pwd )
builddir=$1 builddir=$1
backend=$2 backend=$2
# Ignore memory leaks lower in dependencies
export LSAN_OPTIONS=suppressions=$srcdir/lsan.supp
case "${backend}" in case "${backend}" in
x11) x11)
xvfb-run -a -s "-screen 0 1024x768x24 -noreset" \ xvfb-run -a -s "-screen 0 1024x768x24" \
meson test -C ${builddir} \ meson test -C ${builddir} \
--timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
--print-errorlogs \ --print-errorlogs \
--setup=${backend} \ --setup=${backend} \
--suite=gtk \ --suite=gtk \
--no-suite=gtk:a11y \
--no-suite=gsk-compare-broadway --no-suite=gsk-compare-broadway
# Store the exit code for the CI run, but always # Store the exit code for the CI run, but always
@@ -33,10 +30,10 @@ case "${backend}" in
export WAYLAND_DISPLAY=wayland-5 export WAYLAND_DISPLAY=wayland-5
meson test -C ${builddir} \ meson test -C ${builddir} \
--timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
--print-errorlogs \ --print-errorlogs \
--setup=${backend} \ --setup=${backend} \
--suite=gtk \ --suite=gtk \
--no-suite=gtk:a11y \
--no-suite=gsk-compare-broadway --no-suite=gsk-compare-broadway
exit_code=$? exit_code=$?
@@ -51,10 +48,10 @@ case "${backend}" in
export BROADWAY_DISPLAY=:5 export BROADWAY_DISPLAY=:5
meson test -C ${builddir} \ meson test -C ${builddir} \
--timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
--print-errorlogs \ --print-errorlogs \
--setup=${backend} \ --setup=${backend} \
--suite=gtk \ --suite=gtk \
--no-suite=gtk:a11y \
--no-suite=gsk-compare-opengl --no-suite=gsk-compare-opengl
# don't let Broadway failures fail the run, for now # don't let Broadway failures fail the run, for now

View File

@@ -33,29 +33,17 @@ pacman --noconfirm -S --needed \
mingw-w64-$MSYS2_ARCH-gst-plugins-bad \ mingw-w64-$MSYS2_ARCH-gst-plugins-bad \
mingw-w64-$MSYS2_ARCH-shared-mime-info mingw-w64-$MSYS2_ARCH-shared-mime-info
# https://gitlab.gnome.org/GNOME/gtk/issues/2243
wget "https://gitlab.gnome.org/creiter/gitlab-ci-win32-runner-v2/raw/master/pango/mingw-w64-$MSYS2_ARCH-pango-git-1.44.7.90.ge48ae523-1-any.pkg.tar.zst"
pacman --noconfirm -U "mingw-w64-$MSYS2_ARCH-pango-git-1.44.7.90.ge48ae523-1-any.pkg.tar.zst"
# https://github.com/msys2/MINGW-packages/pull/6465
pacman --noconfirm -S --needed mingw-w64-$MSYS2_ARCH-brotli
mkdir -p _ccache mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)" export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
# https://gitlab.gnome.org/GNOME/gtk/-/issues/2243
# https://gitlab.gnome.org/GNOME/gtk/-/issues/3002
if ! pkg-config --atleast-version=2.65.0 glib-2.0; then
git clone https://gitlab.gnome.org/GNOME/glib.git _glib
meson setup _glib_build _glib
meson compile -C _glib_build
meson install -C _glib_build
fi
pkg-config --modversion glib-2.0
if ! pkg-config --atleast-version=1.45.4 pango; then
git clone https://gitlab.gnome.org/GNOME/pango.git _pango
meson setup _pango_build _pango
meson compile -C _pango_build
meson install -C _pango_build
fi
pkg-config --modversion pango
# Build # Build
ccache --zero-stats ccache --zero-stats
ccache --show-stats ccache --show-stats
@@ -66,9 +54,9 @@ meson \
-Dx11-backend=false \ -Dx11-backend=false \
-Dwayland-backend=false \ -Dwayland-backend=false \
-Dwin32-backend=true \ -Dwin32-backend=true \
-Dvulkan=disabled \ -Dvulkan=no \
-Dintrospection=false \ -Dintrospection=false \
-Dgtk:werror=true \ --werror \
_build _build
unset CCACHE_DISABLE unset CCACHE_DISABLE

214
NEWS
View File

@@ -1,217 +1,3 @@
Overview of Changes in GTK 3.99.1
=================================
* GtkGridLayout: Rename left-/top-attach to column/row
* Drop GtkAccelLabel - it is no longer used
* GtkTextView:
- Fix redraw issues with selections
- Make insert-emoji replace the selection
* GtkTreeView:
- Fix selection handling in cell editables
* GtkPopover:
- Allow setting popup offset
* GtkPlacesSidebar:
- Fix DND
* GtkTextview:
- Speed up gtk_text_buffer_insert_markup
* GtkFrame:
- Set GTK_OVERFLOW_HIDDEN
* GtkSpinButton:
- Fix spinning
* GtkFontChooser:
- Populate the list incrementally
* GtkButton: Simplify the button hierarchy; GtkRadioButton
is gone, GtkCheckButton and GtkToggleButton can be grouped
* list widgets:
- Change apis to make models explicitly GtkSelectionModel
- Simplify constructors
* CSS:
- Hexadecimal colors can now specify alpha
- Fix parsing of numbers in scientific notation
* Themes:
- Add and document highlevel list styles
- Drop the style class defines. Just use string literals
- Round the corners of frames
- Make circular buttons square
* GL renderer:
- Fix clipping with projective transforms
* Documentation:
- Refresh the widget gallery
- Add images for new widgets to the gallery
- Fix many cross-references
- Make sure tutorial examples are buildable
* Demos:
- Numerous crash- and bug fixes
- Improve about dialogs
- gtk4-demo: Modernize source highlighting
- gtk4-demo: Improve sidebar filtering
- gtk4-demo: Drop some outdated demos
- gtk4-demo: Polish a number of existing demos
- gtk4-demo: Add several new demos
- widget-factory: Show error states
* Tools:
- Make gtk4-builder-tool rewrite GtkBox
- Make gtk4-builder-tool rewrite radio buttons
- Rewrite the profiling support, drop support
for D-Bus profiler activation, use SYSPROF_TRACE_FD
* Printing:
- Fix build with cups < 2.3
* win32:
- Default to the GL renderer when we can
* Broadway:
- Fix handling of opaque colors
- Fix handling of debug nodes
- Prune clipped render nodes
* Wayland:
- Support newer schemas for settings
- Fix DND hotspot handling
- Disconnect on display close
* Translation updates:
Basque
Brazilian Portuguese
British English
Catalan
Chinese (China)
Croatian
Galician
German
Greek
Indonesian
Japanese
Kazakh
Korean
Lithuanian
Polish
Romanian
Slovenian
Spanish
Turkish
Ukrainian
Overview of Changes in GTK 3.99.0
=================================
* Remove the old accessibility implementation and
add the foundations for a new one that is based
on ARIA. The relevant widget api is GtkAccessible,
the backend implementations will use GtkATContext.
Currently, there is just a nascent test backend.
* Update the GTK headers to use char *, int, float and
double instead of the corresponding GLib types.
* Add GtkEditableLabel, a label that can be edited
* Add GtkBookmarkList, a list model for bookmarks
* Add GtkStringList, a list model for strings
* Add GtkBitset, and use it for representing selections
* GtkTreeView:
- Make cell editing work again
* GtkSpinButton:
- Make autosizing work again
* Printing:
- Use GtkDropDown in the print dialog
* GtkApplication
- Support opening files on OS X
* GtkFileChooser:
- Fix libcloudproviders support
- Turn GtkFileFilter into a GtkFilter
- Simplify the api
* GtkGridView, GtkListView:
- Improve scrolling behavior
- Autoscroll and autoexpand during DND
* GtkScrolledWindow:
- Make autoscrolling work again
* GtkFilterListModel:
- Add incremental filtering
- Add a boolean filter, GtkBoolFilter
* GtkSortListModel:
- Use timsort
- Add various tweaks that massively speed up sorting
- Add incremental sorting
* GtkWidget:
- Massively speed up action handling
* GtkEntry:
- Make entry completion work again
- Drop action support from GtkEntryCompletion
* Inspector:
- Improve list model support
- Add direct navigation between objects
- Show accessibility information
* GDK:
- Compress scroll events
- Keep a scroll history
- Clean up GdkDevice api
- Drop the master/slave device split
- Move axes to GdkDeviceTool
- Change monitor workarea to be per-backend API
- Improve frame clock accuracy
- Add a new macOS backend
- Add an ANGLE-based GLES renderer for Windows
* GSK:
- Use GL_ARB_framebuffer_object
* gtk-demo:
- Add incremental refill to the color grid
- Improve performance of the color grid
- Add an incrementally filtering word list
- Improve the sidebar
* Install print-editor as another demo
* Translation updates
Basque
Catalan
Chinese
Japanese
Kazakh
Lithuanian
Polish
Romanian
Spanish
Turkish
Ukrainian
Overview of Changes in GTK 3.98.5 Overview of Changes in GTK 3.98.5
================================= =================================

View File

@@ -1,7 +1,7 @@
GTK — The GTK toolkit GTK — The GTK toolkit
===================== =====================
[![Build status](https://gitlab.gnome.org/GNOME/gtk/badges/master/pipeline.svg)](https://gitlab.gnome.org/GNOME/gtk/-/commits/master) [![Build Status](https://gitlab.gnome.org/GNOME/gtk/badges/master/build.svg)](https://gitlab.gnome.org/GNOME/gtk/pipelines)
General information General information
------------------- -------------------
@@ -56,6 +56,7 @@ building for:
- [Pango](https://download.gnome.org/sources/pango) - [Pango](https://download.gnome.org/sources/pango)
- [Epoxy](https://github.com/anholt/libepoxy) - [Epoxy](https://github.com/anholt/libepoxy)
- [Graphene](https://github.com/ebassi/graphene) - [Graphene](https://github.com/ebassi/graphene)
- [ATK](https://download.gnome.org/sources/atk)
- [Xkb-common](https://github.com/xkbcommon/libxkbcommon) - [Xkb-common](https://github.com/xkbcommon/libxkbcommon)
If you are building the X11 backend, you will also need: If you are building the X11 backend, you will also need:
@@ -69,6 +70,7 @@ If you are building the X11 backend, you will also need:
- xcursor - xcursor
- xdamage - xdamage
- xcomposite - xcomposite
- [atk-bridge-2.0](https://download.gnome.org/sources/at-spi2-atk)
If you are building the Wayland backend, you will also need: If you are building the Wayland backend, you will also need:
@@ -98,7 +100,7 @@ And, finally, you can install GTK using:
$ sudo ninja install $ sudo ninja install
``` ```
Complete information about installing GTK and related libraries Complete information about installing GTK+ and related libraries
can be found in the file: can be found in the file:
``` ```
@@ -161,7 +163,3 @@ version 2.1 or, at your option, any later version, as published by the Free
Software Foundation. Software Foundation.
Please, see the [`COPYING`](./COPYING) file for further information. Please, see the [`COPYING`](./COPYING) file for further information.
GTK includes a small number of source files under the Apache license:
- A fork of the roaring bitmaps implementation in [gtk/roaring](./gtk/roaring)
- An adaptation of timsort from python in [gtk/timsort](./gtk/timsort)

View File

@@ -4,30 +4,21 @@
"runtime-version": "master", "runtime-version": "master",
"sdk": "org.gnome.Sdk", "sdk": "org.gnome.Sdk",
"command": "gtk4-demo", "command": "gtk4-demo",
"tags" : [ "tags": ["devel", "development", "nightly"],
"devel",
"development",
"nightly"
],
"desktop-file-name-prefix": "(Development) ", "desktop-file-name-prefix": "(Development) ",
"finish-args": [ "finish-args": [
"--device=dri", "--device=dri",
"--share=ipc", "--share=ipc",
"--socket=fallback-x11", "--socket=fallback-x11",
"--socket=wayland", "--socket=wayland",
"--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs.*"
"--talk-name=org.gtk.vfs.*"
], ],
"cleanup": [ "cleanup": [
"/include", "/include",
"/lib/pkgconfig", "/lib/pkgconfig", "/share/pkgconfig",
"/share/pkgconfig",
"/share/aclocal", "/share/aclocal",
"/man", "/man", "/share/man", "/share/gtk-doc",
"/share/man", "*.la", ".a",
"/share/gtk-doc",
"*.la",
".a",
"/lib/girepository-1.0", "/lib/girepository-1.0",
"/share/gir-1.0", "/share/gir-1.0",
"/share/doc" "/share/doc"
@@ -98,9 +89,7 @@
"buildsystem": "meson", "buildsystem": "meson",
"builddir": true, "builddir": true,
"config-opts": [ "config-opts": [
"--libdir=/app/lib", "--libdir=/app/lib"
"-Denable_vulkan=no",
"-Dbuildtype=debugoptimized"
], ],
"sources": [ "sources": [
{ {
@@ -109,10 +98,5 @@
} }
] ]
} }
], ]
"build-options" : {
"env" : {
"GSK_RENDERER" : "opengl"
}
}
} }

View File

@@ -4,30 +4,21 @@
"runtime-version": "master", "runtime-version": "master",
"sdk": "org.gnome.Sdk", "sdk": "org.gnome.Sdk",
"command": "gtk4-icon-browser", "command": "gtk4-icon-browser",
"tags" : [ "tags": ["devel", "development", "nightly"],
"devel",
"development",
"nightly"
],
"desktop-file-name-prefix": "(Development) ", "desktop-file-name-prefix": "(Development) ",
"finish-args": [ "finish-args": [
"--device=dri", "--device=dri",
"--share=ipc", "--share=ipc",
"--socket=fallback-x11", "--socket=fallback-x11",
"--socket=wayland", "--socket=wayland",
"--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs.*"
"--talk-name=org.gtk.vfs.*"
], ],
"cleanup": [ "cleanup": [
"/include", "/include",
"/lib/pkgconfig", "/lib/pkgconfig", "/share/pkgconfig",
"/share/pkgconfig",
"/share/aclocal", "/share/aclocal",
"/man", "/man", "/share/man", "/share/gtk-doc",
"/share/man", "*.la", ".a",
"/share/gtk-doc",
"*.la",
".a",
"/lib/girepository-1.0", "/lib/girepository-1.0",
"/share/gir-1.0", "/share/gir-1.0",
"/share/doc" "/share/doc"
@@ -98,9 +89,7 @@
"buildsystem": "meson", "buildsystem": "meson",
"builddir": true, "builddir": true,
"config-opts": [ "config-opts": [
"--libdir=/app/lib", "--libdir=/app/lib"
"-Denable_vulkan=no",
"-Dbuildtype=debugoptimized"
], ],
"sources": [ "sources": [
{ {
@@ -109,9 +98,5 @@
} }
] ]
} }
], ]
"build-options" : {
"env" : {
}
}
} }

View File

@@ -4,30 +4,21 @@
"runtime-version": "master", "runtime-version": "master",
"sdk": "org.gnome.Sdk", "sdk": "org.gnome.Sdk",
"command": "gtk4-widget-factory", "command": "gtk4-widget-factory",
"tags" : [ "tags": ["devel", "development", "nightly"],
"devel",
"development",
"nightly"
],
"desktop-file-name-prefix": "(Development) ", "desktop-file-name-prefix": "(Development) ",
"finish-args": [ "finish-args": [
"--device=dri", "--device=dri",
"--share=ipc", "--share=ipc",
"--socket=fallback-x11", "--socket=fallback-x11",
"--socket=wayland", "--socket=wayland",
"--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs.*"
"--talk-name=org.gtk.vfs.*"
], ],
"cleanup": [ "cleanup": [
"/include", "/include",
"/lib/pkgconfig", "/lib/pkgconfig", "/share/pkgconfig",
"/share/pkgconfig",
"/share/aclocal", "/share/aclocal",
"/man", "/man", "/share/man", "/share/gtk-doc",
"/share/man", "*.la", ".a",
"/share/gtk-doc",
"*.la",
".a",
"/lib/girepository-1.0", "/lib/girepository-1.0",
"/share/gir-1.0", "/share/gir-1.0",
"/share/doc" "/share/doc"
@@ -98,9 +89,7 @@
"buildsystem": "meson", "buildsystem": "meson",
"builddir": true, "builddir": true,
"config-opts": [ "config-opts": [
"--libdir=/app/lib", "--libdir=/app/lib"
"-Denable_vulkan=no",
"-Dbuildtype=debugoptimized"
], ],
"sources": [ "sources": [
{ {
@@ -109,13 +98,5 @@
} }
] ]
} }
], ]
"build-options" : {
"env" : {
"DBUS_SESSION_BUS_ADDRESS" : "''",
"GSK_RENDERER" : "opengl",
"GDK_DEBUG" : "vulkan-disable",
"G_ENABLE_DEBUG" : "true"
}
}
} }

View File

@@ -15,13 +15,7 @@ if 'DESTDIR' not in os.environ:
gtk_immodule_dir = os.path.join(gtk_moduledir, 'immodules') gtk_immodule_dir = os.path.join(gtk_moduledir, 'immodules')
print('Compiling GSettings schemas...') print('Compiling GSettings schemas...')
glib_compile_schemas = subprocess.check_output(['pkg-config', subprocess.call(['glib-compile-schemas',
'--variable=glib_compile_schemas',
'gio-2.0']).strip()
if not os.path.exists(glib_compile_schemas):
# pkg-config variables only available since GLib 2.62.0.
glib_compile_schemas = 'glib-compile-schemas'
subprocess.call([glib_compile_schemas,
os.path.join(gtk_datadir, 'glib-2.0', 'schemas')]) os.path.join(gtk_datadir, 'glib-2.0', 'schemas')])
print('Updating icon cache...') print('Updating icon cache...')
@@ -30,14 +24,8 @@ if 'DESTDIR' not in os.environ:
print('Updating module cache for print backends...') print('Updating module cache for print backends...')
os.makedirs(gtk_printmodule_dir, exist_ok=True) os.makedirs(gtk_printmodule_dir, exist_ok=True)
gio_querymodules = subprocess.check_output(['pkg-config', subprocess.call(['gio-querymodules', gtk_printmodule_dir])
'--variable=gio_querymodules',
'gio-2.0']).strip()
if not os.path.exists(gio_querymodules):
# pkg-config variables only available since GLib 2.62.0.
gio_querymodules = 'gio-querymodules'
subprocess.call([gio_querymodules, gtk_printmodule_dir])
print('Updating module cache for input methods...') print('Updating module cache for input methods...')
os.makedirs(gtk_immodule_dir, exist_ok=True) os.makedirs(gtk_immodule_dir, exist_ok=True)
subprocess.call([gio_querymodules, gtk_immodule_dir]) subprocess.call(['gio-querymodules', gtk_immodule_dir])

View File

@@ -103,7 +103,7 @@
#mesondefine HAVE_SYS_PARAM_H #mesondefine HAVE_SYS_PARAM_H
/* Have the sysprof-capture library */ /* Have the sysprof-capture library */
#mesondefine HAVE_SYSPROF #mesondefine HAVE_SYSPROF_CAPTURE
/* Define to 1 if you have the <sys/stat.h> header file. */ /* Define to 1 if you have the <sys/stat.h> header file. */
#mesondefine HAVE_SYS_STAT_H #mesondefine HAVE_SYS_STAT_H

View File

@@ -81,11 +81,11 @@ constraint_editor_application_activate (GApplication *app)
static void static void
constraint_editor_application_open (GApplication *app, constraint_editor_application_open (GApplication *app,
GFile **files, GFile **files,
int n_files, gint n_files,
const char *hint) const gchar *hint)
{ {
ConstraintEditorWindow *win; ConstraintEditorWindow *win;
int i; gint i;
for (i = 0; i < n_files; i++) for (i = 0; i < n_files; i++)
{ {

View File

@@ -193,7 +193,7 @@ constraint_editor_window_load (ConstraintEditorWindow *self,
static void static void
open_response_cb (GtkNativeDialog *dialog, open_response_cb (GtkNativeDialog *dialog,
int response, gint response,
ConstraintEditorWindow *self) ConstraintEditorWindow *self)
{ {
gtk_native_dialog_hide (dialog); gtk_native_dialog_hide (dialog);
@@ -285,7 +285,7 @@ serialize_model (GListModel *list)
static void static void
save_response_cb (GtkNativeDialog *dialog, save_response_cb (GtkNativeDialog *dialog,
int response, gint response,
ConstraintEditorWindow *self) ConstraintEditorWindow *self)
{ {
gtk_native_dialog_hide (dialog); gtk_native_dialog_hide (dialog);

View File

@@ -9,6 +9,7 @@
<property name="default-height">768</property> <property name="default-height">768</property>
<child type="titlebar"> <child type="titlebar">
<object class="GtkHeaderBar" id="header"> <object class="GtkHeaderBar" id="header">
<property name="show-title-buttons">1</property>
<child type="start"> <child type="start">
<object class="GtkButton"> <object class="GtkButton">
<property name="icon-name">document-open-symbolic</property> <property name="icon-name">document-open-symbolic</property>

View File

@@ -13,8 +13,8 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Target</property> <property name="label">Target</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -23,8 +23,8 @@
<signal name="changed" handler="update_preview" swapped="yes"/> <signal name="changed" handler="update_preview" swapped="yes"/>
<signal name="changed" handler="update_button" swapped="yes"/> <signal name="changed" handler="update_button" swapped="yes"/>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -32,8 +32,8 @@
<object class="GtkComboBoxText" id="target_attr"> <object class="GtkComboBoxText" id="target_attr">
<signal name="changed" handler="update_preview" swapped="yes"/> <signal name="changed" handler="update_preview" swapped="yes"/>
<layout> <layout>
<property name="column">2</property> <property name="left-attach">2</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -41,8 +41,8 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Relation</property> <property name="label">Relation</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">2</property> <property name="top-attach">2</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -50,8 +50,8 @@
<object class="GtkComboBoxText" id="relation"> <object class="GtkComboBoxText" id="relation">
<signal name="changed" handler="update_preview" swapped="yes"/> <signal name="changed" handler="update_preview" swapped="yes"/>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">2</property> <property name="top-attach">2</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -59,8 +59,8 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Source</property> <property name="label">Source</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">3</property> <property name="top-attach">3</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -69,8 +69,8 @@
<signal name="changed" handler="update_preview" swapped="yes"/> <signal name="changed" handler="update_preview" swapped="yes"/>
<signal name="changed" handler="update_button" swapped="yes"/> <signal name="changed" handler="update_button" swapped="yes"/>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">3</property> <property name="top-attach">3</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -79,8 +79,8 @@
<signal name="changed" handler="update_preview" swapped="yes"/> <signal name="changed" handler="update_preview" swapped="yes"/>
<signal name="changed" handler="source_attr_changed" swapped="yes"/> <signal name="changed" handler="source_attr_changed" swapped="yes"/>
<layout> <layout>
<property name="column">2</property> <property name="left-attach">2</property>
<property name="row">3</property> <property name="top-attach">3</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -88,8 +88,8 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Multiplier</property> <property name="label">Multiplier</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">4</property> <property name="top-attach">4</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -97,8 +97,8 @@
<object class="GtkEntry" id="multiplier"> <object class="GtkEntry" id="multiplier">
<signal name="changed" handler="update_preview" swapped="yes"/> <signal name="changed" handler="update_preview" swapped="yes"/>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">4</property> <property name="top-attach">4</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -106,8 +106,8 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Constant</property> <property name="label">Constant</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">5</property> <property name="top-attach">5</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -115,8 +115,8 @@
<object class="GtkEntry" id="constant"> <object class="GtkEntry" id="constant">
<signal name="changed" handler="update_preview" swapped="yes"/> <signal name="changed" handler="update_preview" swapped="yes"/>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">5</property> <property name="top-attach">5</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -124,16 +124,16 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Strength</property> <property name="label">Strength</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">6</property> <property name="top-attach">6</property>
</layout> </layout>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkComboBoxText" id="strength"> <object class="GtkComboBoxText" id="strength">
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">6</property> <property name="top-attach">6</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -141,8 +141,8 @@
<object class="GtkLabel" id="preview"> <object class="GtkLabel" id="preview">
<property name="xalign">0</property> <property name="xalign">0</property>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">7</property> <property name="top-attach">7</property>
<property name="column-span">2</property> <property name="column-span">2</property>
</layout> </layout>
<attributes> <attributes>
@@ -155,8 +155,8 @@
<property name="label">Create</property> <property name="label">Create</property>
<signal name="clicked" handler="create_constraint"/> <signal name="clicked" handler="create_constraint"/>
<layout> <layout>
<property name="column">2</property> <property name="left-attach">2</property>
<property name="row">8</property> <property name="top-attach">8</property>
</layout> </layout>
</object> </object>
</child> </child>

View File

@@ -174,25 +174,28 @@ constraint_view_init (ConstraintView *self)
manager = gtk_constraint_layout_new (); manager = gtk_constraint_layout_new ();
gtk_widget_set_layout_manager (GTK_WIDGET (self), manager); gtk_widget_set_layout_manager (GTK_WIDGET (self), manager);
guides = gtk_constraint_layout_observe_guides (GTK_CONSTRAINT_LAYOUT (manager)); all_children = gtk_widget_observe_children (GTK_WIDGET (self));
all_constraints = gtk_constraint_layout_observe_constraints (GTK_CONSTRAINT_LAYOUT (manager)); all_constraints = gtk_constraint_layout_observe_constraints (GTK_CONSTRAINT_LAYOUT (manager));
guides = gtk_constraint_layout_observe_guides (GTK_CONSTRAINT_LAYOUT (manager));
filter = gtk_custom_filter_new (omit_internal, NULL, NULL); filter = gtk_custom_filter_new (omit_internal, NULL, NULL);
constraints = (GListModel *)gtk_filter_list_model_new (all_constraints, filter); constraints = (GListModel *)gtk_filter_list_model_new (all_constraints, filter);
g_object_unref (filter);
all_children = gtk_widget_observe_children (GTK_WIDGET (self));
filter = gtk_custom_filter_new (omit_internal, NULL, NULL); filter = gtk_custom_filter_new (omit_internal, NULL, NULL);
children = (GListModel *)gtk_filter_list_model_new (all_children, filter); children = (GListModel *)gtk_filter_list_model_new (all_children, filter);
g_object_unref (filter);
list = g_list_store_new (G_TYPE_LIST_MODEL); list = g_list_store_new (G_TYPE_LIST_MODEL);
g_list_store_append (list, children); g_list_store_append (list, children);
g_list_store_append (list, guides); g_list_store_append (list, guides);
g_list_store_append (list, constraints); g_list_store_append (list, constraints);
self->model = G_LIST_MODEL (gtk_flatten_list_model_new (G_TYPE_OBJECT, G_LIST_MODEL (list)));
g_object_unref (children); g_object_unref (children);
g_object_unref (guides); g_object_unref (guides);
g_object_unref (constraints); g_object_unref (constraints);
g_object_unref (all_children);
g_object_unref (all_constraints);
g_object_unref (list);
self->model = G_LIST_MODEL (gtk_flatten_list_model_new (G_LIST_MODEL (list)));
controller = (GtkEventController *)gtk_gesture_drag_new (); controller = (GtkEventController *)gtk_gesture_drag_new ();
g_signal_connect (controller, "drag-begin", G_CALLBACK (drag_begin), self); g_signal_connect (controller, "drag-begin", G_CALLBACK (drag_begin), self);

View File

@@ -55,8 +55,8 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Name</property> <property name="label">Name</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">0</property> <property name="top-attach">0</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -64,8 +64,8 @@
<object class="GtkEntry" id="name"> <object class="GtkEntry" id="name">
<property name="max-width-chars">20</property> <property name="max-width-chars">20</property>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">0</property> <property name="top-attach">0</property>
<property name="column-span">2</property> <property name="column-span">2</property>
</layout> </layout>
</object> </object>
@@ -74,8 +74,8 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Min Size</property> <property name="label">Min Size</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -84,8 +84,8 @@
<property name="adjustment">min_width_adj</property> <property name="adjustment">min_width_adj</property>
<property name="max-width-chars">5</property> <property name="max-width-chars">5</property>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -94,8 +94,8 @@
<property name="adjustment">min_height_adj</property> <property name="adjustment">min_height_adj</property>
<property name="max-width-chars">5</property> <property name="max-width-chars">5</property>
<layout> <layout>
<property name="column">2</property> <property name="left-attach">2</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -103,8 +103,8 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Nat Size</property> <property name="label">Nat Size</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">2</property> <property name="top-attach">2</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -113,8 +113,8 @@
<property name="adjustment">nat_width_adj</property> <property name="adjustment">nat_width_adj</property>
<property name="max-width-chars">5</property> <property name="max-width-chars">5</property>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">2</property> <property name="top-attach">2</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -123,8 +123,8 @@
<property name="adjustment">nat_height_adj</property> <property name="adjustment">nat_height_adj</property>
<property name="max-width-chars">5</property> <property name="max-width-chars">5</property>
<layout> <layout>
<property name="column">2</property> <property name="left-attach">2</property>
<property name="row">2</property> <property name="top-attach">2</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -132,8 +132,8 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Max Size</property> <property name="label">Max Size</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">3</property> <property name="top-attach">3</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -142,8 +142,8 @@
<property name="adjustment">max_width_adj</property> <property name="adjustment">max_width_adj</property>
<property name="max-width-chars">5</property> <property name="max-width-chars">5</property>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">3</property> <property name="top-attach">3</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -152,8 +152,8 @@
<property name="adjustment">max_height_adj</property> <property name="adjustment">max_height_adj</property>
<property name="max-width-chars">5</property> <property name="max-width-chars">5</property>
<layout> <layout>
<property name="column">2</property> <property name="left-attach">2</property>
<property name="row">3</property> <property name="top-attach">3</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -161,16 +161,16 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Strength</property> <property name="label">Strength</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">4</property> <property name="top-attach">4</property>
</layout> </layout>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkComboBoxText" id="strength"> <object class="GtkComboBoxText" id="strength">
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">4</property> <property name="top-attach">4</property>
<property name="column-span">2</property> <property name="column-span">2</property>
</layout> </layout>
</object> </object>
@@ -180,8 +180,8 @@
<property name="label">Create</property> <property name="label">Create</property>
<signal name="clicked" handler="create_guide"/> <signal name="clicked" handler="create_guide"/>
<layout> <layout>
<property name="column">2</property> <property name="left-attach">2</property>
<property name="row">5</property> <property name="top-attach">5</property>
</layout> </layout>
</object> </object>
</child> </child>

View File

@@ -1,3 +1,4 @@
#include "config.h" #include "config.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
@@ -33,7 +34,7 @@ static void create_window (GApplication *app, const char *contents);
static void static void
show_action_dialog (GSimpleAction *action) show_action_dialog (GSimpleAction *action)
{ {
const char *name; const gchar *name;
GtkWidget *dialog; GtkWidget *dialog;
name = g_action_get_name (G_ACTION (action)); name = g_action_get_name (G_ACTION (action));
@@ -57,9 +58,9 @@ show_action_infobar (GSimpleAction *action,
gpointer data) gpointer data)
{ {
DemoApplicationWindow *window = data; DemoApplicationWindow *window = data;
char *text; gchar *text;
const char *name; const gchar *name;
const char *value; const gchar *value;
name = g_action_get_name (G_ACTION (action)); name = g_action_get_name (G_ACTION (action));
value = g_variant_get_string (parameter, NULL); value = g_variant_get_string (parameter, NULL);
@@ -91,7 +92,7 @@ activate_new (GSimpleAction *action,
static void static void
open_response_cb (GtkNativeDialog *dialog, open_response_cb (GtkNativeDialog *dialog,
int response_id, gint response_id,
gpointer user_data) gpointer user_data)
{ {
GtkFileChooserNative *native = user_data; GtkFileChooserNative *native = user_data;
@@ -184,7 +185,7 @@ activate_about (GSimpleAction *action,
{ {
GtkWidget *window = user_data; GtkWidget *window = user_data;
const char *authors[] = { const gchar *authors[] = {
"Peter Mattis", "Peter Mattis",
"Spencer Kimball", "Spencer Kimball",
"Josh MacDonald", "Josh MacDonald",
@@ -192,7 +193,7 @@ activate_about (GSimpleAction *action,
NULL NULL
}; };
const char *documentors[] = { const gchar *documentors[] = {
"Owen Taylor", "Owen Taylor",
"Tony Gale", "Tony Gale",
"Matthias Clasen <mclasen@redhat.com>", "Matthias Clasen <mclasen@redhat.com>",
@@ -243,9 +244,9 @@ static void
update_statusbar (GtkTextBuffer *buffer, update_statusbar (GtkTextBuffer *buffer,
DemoApplicationWindow *window) DemoApplicationWindow *window)
{ {
char *msg; gchar *msg;
int row, col; gint row, col;
int count; gint count;
GtkTextIter iter; GtkTextIter iter;
/* clear any previous message, underflow is allowed */ /* clear any previous message, underflow is allowed */

View File

@@ -31,8 +31,8 @@
</object> </object>
</child> </child>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">0</property> <property name="top-attach">0</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -54,8 +54,8 @@
</object> </object>
</child> </child>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -70,8 +70,8 @@
</object> </object>
</child> </child>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">2</property> <property name="top-attach">2</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -79,8 +79,8 @@
<object class="GtkStatusbar" id="status"> <object class="GtkStatusbar" id="status">
<property name="hexpand">1</property> <property name="hexpand">1</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">3</property> <property name="top-attach">3</property>
</layout> </layout>
</object> </object>
</child> </child>

View File

@@ -16,8 +16,8 @@ static GtkWidget *placeholder;
static void static void
on_name_appeared (GDBusConnection *connection, on_name_appeared (GDBusConnection *connection,
const char *name, const gchar *name,
const char *name_owner, const gchar *name_owner,
gpointer user_data) gpointer user_data)
{ {
name_seen = TRUE; name_seen = TRUE;
@@ -25,7 +25,7 @@ on_name_appeared (GDBusConnection *connection,
static void static void
on_name_vanished (GDBusConnection *connection, on_name_vanished (GDBusConnection *connection,
const char *name, const gchar *name,
gpointer user_data) gpointer user_data)
{ {
if (!name_seen) if (!name_seen)
@@ -55,7 +55,7 @@ do_application_demo (GtkWidget *toplevel)
if (placeholder == NULL) if (placeholder == NULL)
{ {
const char *command; const gchar *command;
GError *error = NULL; GError *error = NULL;
if (g_file_test ("./gtk4-demo-application" APP_EXTENSION, G_FILE_TEST_IS_EXECUTABLE)) if (g_file_test ("./gtk4-demo-application" APP_EXTENSION, G_FILE_TEST_IS_EXECUTABLE))

View File

@@ -12,7 +12,7 @@ static GtkWidget *progress_bar = NULL;
static gboolean static gboolean
apply_changes_gradually (gpointer data) apply_changes_gradually (gpointer data)
{ {
double fraction; gdouble fraction;
/* Work, work, work... */ /* Work, work, work... */
fraction = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (progress_bar)); fraction = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (progress_bar));
@@ -47,8 +47,8 @@ on_assistant_close_cancel (GtkWidget *widget, gpointer data)
static void static void
on_assistant_prepare (GtkWidget *widget, GtkWidget *page, gpointer data) on_assistant_prepare (GtkWidget *widget, GtkWidget *page, gpointer data)
{ {
int current_page, n_pages; gint current_page, n_pages;
char *title; gchar *title;
current_page = gtk_assistant_get_current_page (GTK_ASSISTANT (widget)); current_page = gtk_assistant_get_current_page (GTK_ASSISTANT (widget));
n_pages = gtk_assistant_get_n_pages (GTK_ASSISTANT (widget)); n_pages = gtk_assistant_get_n_pages (GTK_ASSISTANT (widget));
@@ -70,8 +70,8 @@ on_entry_changed (GtkWidget *widget, gpointer data)
{ {
GtkAssistant *assistant = GTK_ASSISTANT (data); GtkAssistant *assistant = GTK_ASSISTANT (data);
GtkWidget *current_page; GtkWidget *current_page;
int page_number; gint page_number;
const char *text; const gchar *text;
page_number = gtk_assistant_get_current_page (assistant); page_number = gtk_assistant_get_current_page (assistant);
current_page = gtk_assistant_get_nth_page (assistant, page_number); current_page = gtk_assistant_get_nth_page (assistant, page_number);

View File

@@ -8,10 +8,6 @@
<property name="default-height">300</property> <property name="default-height">300</property>
<child> <child>
<object class="GtkGrid"> <object class="GtkGrid">
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<property name="margin-top">12</property>
<property name="margin-bottom">12</property>
<property name="row-spacing">12</property> <property name="row-spacing">12</property>
<property name="column-spacing">12</property> <property name="column-spacing">12</property>
<child> <child>
@@ -22,8 +18,8 @@
<class name="dim-label"/> <class name="dim-label"/>
</style> </style>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">0</property> <property name="top-attach">0</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -33,8 +29,8 @@
<property name="has-frame">1</property> <property name="has-frame">1</property>
<property name="min-content-width">150</property> <property name="min-content-width">150</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -44,8 +40,8 @@
<property name="hexpand">1</property> <property name="hexpand">1</property>
<property name="stack">stack</property> <property name="stack">stack</property>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">0</property> <property name="top-attach">0</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -71,8 +67,8 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label" translatable="yes">Duck</property> <property name="label" translatable="yes">Duck</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">0</property> <property name="top-attach">0</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -80,8 +76,8 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label" translatable="yes">Background</property> <property name="label" translatable="yes">Background</property>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">0</property> <property name="top-attach">0</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -91,8 +87,8 @@
<class name="duck"/> <class name="duck"/>
</style> </style>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -102,8 +98,8 @@
<class name="gradient"/> <class name="gradient"/>
</style> </style>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -112,8 +108,8 @@
<property name="label" translatable="yes"> <property name="label" translatable="yes">
Blended picture</property> Blended picture</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">2</property> <property name="top-attach">2</property>
<property name="column-span">2</property> <property name="column-span">2</property>
</layout> </layout>
</object> </object>
@@ -125,8 +121,8 @@ Blended picture</property>
<class name="blend0"/> <class name="blend0"/>
</style> </style>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">3</property> <property name="top-attach">3</property>
<property name="column-span">2</property> <property name="column-span">2</property>
</layout> </layout>
</object> </object>
@@ -150,8 +146,8 @@ Blended picture</property>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label" translatable="yes">Red</property> <property name="label" translatable="yes">Red</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">0</property> <property name="top-attach">0</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -159,8 +155,8 @@ Blended picture</property>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label" translatable="yes">Blue</property> <property name="label" translatable="yes">Blue</property>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">0</property> <property name="top-attach">0</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -170,8 +166,8 @@ Blended picture</property>
<class name="red"/> <class name="red"/>
</style> </style>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -181,8 +177,8 @@ Blended picture</property>
<class name="blue"/> <class name="blue"/>
</style> </style>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -191,8 +187,8 @@ Blended picture</property>
<property name="label" translatable="yes"> <property name="label" translatable="yes">
Blended picture</property> Blended picture</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">2</property> <property name="top-attach">2</property>
<property name="column-span">2</property> <property name="column-span">2</property>
</layout> </layout>
</object> </object>
@@ -204,8 +200,8 @@ Blended picture</property>
<class name="blend1"/> <class name="blend1"/>
</style> </style>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">3</property> <property name="top-attach">3</property>
<property name="column-span">2</property> <property name="column-span">2</property>
</layout> </layout>
</object> </object>
@@ -232,8 +228,8 @@ Blended picture</property>
<class name="cyan"/> <class name="cyan"/>
</style> </style>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -243,8 +239,8 @@ Blended picture</property>
<class name="magenta"/> <class name="magenta"/>
</style> </style>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -254,8 +250,8 @@ Blended picture</property>
<class name="yellow"/> <class name="yellow"/>
</style> </style>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">3</property> <property name="top-attach">3</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -266,8 +262,8 @@ Blended picture</property>
<class name="blend2"/> <class name="blend2"/>
</style> </style>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">3</property> <property name="top-attach">3</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -279,8 +275,8 @@ Blended picture</property>
<class name="dim-label"/> <class name="dim-label"/>
</style> </style>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">0</property> <property name="top-attach">0</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -292,8 +288,8 @@ Blended picture</property>
<class name="dim-label"/> <class name="dim-label"/>
</style> </style>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">0</property> <property name="top-attach">0</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -305,8 +301,8 @@ Blended picture</property>
<class name="dim-label"/> <class name="dim-label"/>
</style> </style>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">2</property> <property name="top-attach">2</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -318,8 +314,8 @@ Blended picture</property>
<attribute name="weight" value="bold"></attribute> <attribute name="weight" value="bold"></attribute>
</attributes> </attributes>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">2</property> <property name="top-attach">2</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -328,8 +324,8 @@ Blended picture</property>
</object> </object>
</child> </child>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>

View File

@@ -132,10 +132,10 @@ blur_overlay_child_update_style_classes (BlurOverlay *overlay,
gboolean is_left, is_right, is_top, is_bottom; gboolean is_left, is_right, is_top, is_bottom;
gboolean has_left, has_right, has_top, has_bottom; gboolean has_left, has_right, has_top, has_bottom;
has_left = gtk_widget_has_css_class (child, "left"); has_left = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_LEFT);
has_right = gtk_widget_has_css_class (child, "right"); has_right = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_RIGHT);
has_top = gtk_widget_has_css_class (child, "top"); has_top = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_TOP);
has_bottom = gtk_widget_has_css_class (child, "bottom"); has_bottom = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_BOTTOM);
is_left = is_right = is_top = is_bottom = FALSE; is_left = is_right = is_top = is_bottom = FALSE;
@@ -158,24 +158,24 @@ blur_overlay_child_update_style_classes (BlurOverlay *overlay,
is_bottom = (child_allocation->y + child_allocation->height == height); is_bottom = (child_allocation->y + child_allocation->height == height);
if (has_left && !is_left) if (has_left && !is_left)
gtk_widget_remove_css_class (child, "left"); gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_LEFT);
else if (!has_left && is_left) else if (!has_left && is_left)
gtk_widget_add_css_class (child, "left"); gtk_widget_add_css_class (child, GTK_STYLE_CLASS_LEFT);
if (has_right && !is_right) if (has_right && !is_right)
gtk_widget_remove_css_class (child, "right"); gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_RIGHT);
else if (!has_right && is_right) else if (!has_right && is_right)
gtk_widget_add_css_class (child, "right"); gtk_widget_add_css_class (child, GTK_STYLE_CLASS_RIGHT);
if (has_top && !is_top) if (has_top && !is_top)
gtk_widget_remove_css_class (child, "top"); gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_TOP);
else if (!has_top && is_top) else if (!has_top && is_top)
gtk_widget_add_css_class (child, "top"); gtk_widget_add_css_class (child, GTK_STYLE_CLASS_TOP);
if (has_bottom && !is_bottom) if (has_bottom && !is_bottom)
gtk_widget_remove_css_class (child, "bottom"); gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_BOTTOM);
else if (!has_bottom && is_bottom) else if (!has_bottom && is_bottom)
gtk_widget_add_css_class (child, "bottom"); gtk_widget_add_css_class (child, GTK_STYLE_CLASS_BOTTOM);
} }
static void static void

View File

@@ -21,38 +21,15 @@ about_activate (GSimpleAction *action,
gpointer user_data) gpointer user_data)
{ {
GtkWidget *window = user_data; GtkWidget *window = user_data;
GtkBuilder *builder;
GtkWidget *about_dlg; GtkWidget *about_dlg;
about_dlg = GTK_WIDGET (g_object_get_data (G_OBJECT (window), "about")); builder = g_object_get_data (G_OBJECT (window), "builder");
gtk_window_present (GTK_WINDOW (about_dlg)); about_dlg = GTK_WIDGET (gtk_builder_get_object (builder, "aboutdialog1"));
} gtk_window_set_transient_for (GTK_WINDOW (about_dlg), GTK_WINDOW (window));
gtk_window_set_hide_on_close (GTK_WINDOW (about_dlg), TRUE);
static void g_signal_connect (about_dlg, "response", G_CALLBACK (gtk_widget_hide), NULL);
remove_timeout (gpointer data) gtk_widget_show (about_dlg);
{
guint id = GPOINTER_TO_UINT (data);
g_source_remove (id);
}
static gboolean
pop_status (gpointer data)
{
gtk_statusbar_pop (GTK_STATUSBAR (data), 0);
g_object_set_data (G_OBJECT (data), "timeout", NULL);
return G_SOURCE_REMOVE;
}
static void
status_message (GtkStatusbar *status,
const char *text)
{
guint id;
gtk_statusbar_push (GTK_STATUSBAR (status), 0, text);
id = g_timeout_add (5000, pop_status, status);
g_object_set_data_full (G_OBJECT (status), "timeout", GUINT_TO_POINTER (id), remove_timeout);
} }
static void static void
@@ -60,10 +37,7 @@ help_activate (GSimpleAction *action,
GVariant *parameter, GVariant *parameter,
gpointer user_data) gpointer user_data)
{ {
GtkWidget *status; g_print ("Help not available\n");
status = GTK_WIDGET (g_object_get_data (G_OBJECT (user_data), "status"));
status_message (GTK_STATUSBAR (status), "Help not available");
} }
static void static void
@@ -71,13 +45,7 @@ not_implemented (GSimpleAction *action,
GVariant *parameter, GVariant *parameter,
gpointer user_data) gpointer user_data)
{ {
GtkWidget *status; g_print ("Action “%s” not implemented\n", g_action_get_name (G_ACTION (action)));
char *text;
text = g_strdup_printf ("Action “%s” not implemented", g_action_get_name (G_ACTION (action)));
status = GTK_WIDGET (g_object_get_data (G_OBJECT (user_data), "status"));
status_message (GTK_STATUSBAR (status), text);
g_free (text);
} }
static GActionEntry win_entries[] = { static GActionEntry win_entries[] = {
@@ -102,8 +70,6 @@ do_builder (GtkWidget *do_widget)
if (!window) if (!window)
{ {
GtkBuilder *builder; GtkBuilder *builder;
GtkWidget *about;
GtkWidget *status;
builder = gtk_builder_new_from_resource ("/builder/demo.ui"); builder = gtk_builder_new_from_resource ("/builder/demo.ui");
@@ -117,16 +83,6 @@ do_builder (GtkWidget *do_widget)
window); window);
gtk_widget_insert_action_group (window, "win", actions); gtk_widget_insert_action_group (window, "win", actions);
about = GTK_WIDGET (gtk_builder_get_object (builder, "aboutdialog1"));
gtk_window_set_transient_for (GTK_WINDOW (about), GTK_WINDOW (window));
gtk_window_set_hide_on_close (GTK_WINDOW (about), TRUE);
g_signal_connect (about, "response", G_CALLBACK (gtk_widget_hide), NULL);
g_object_set_data_full (G_OBJECT (window), "about",
about, (GDestroyNotify)gtk_window_destroy);
status = GTK_WIDGET (gtk_builder_get_object (builder, "statusbar1"));
g_object_set_data (G_OBJECT (window), "status", status);
g_object_unref (builder); g_object_unref (builder);
} }

View File

@@ -38,7 +38,7 @@ create_icon_store (void)
GtkTreeIter iter; GtkTreeIter iter;
GtkListStore *store; GtkListStore *store;
int i; gint i;
store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING); store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
@@ -77,7 +77,7 @@ set_sensitive (GtkCellLayout *cell_layout,
gpointer data) gpointer data)
{ {
GtkTreePath *path; GtkTreePath *path;
int *indices; gint *indices;
gboolean sensitive; gboolean sensitive;
path = gtk_tree_model_get_path (tree_model, iter); path = gtk_tree_model_get_path (tree_model, iter);
@@ -175,7 +175,7 @@ create_capital_store (void)
GtkTreeIter iter, iter2; GtkTreeIter iter, iter2;
GtkTreeStore *store; GtkTreeStore *store;
int i; gint i;
store = gtk_tree_store_new (1, G_TYPE_STRING); store = gtk_tree_store_new (1, G_TYPE_STRING);

View File

@@ -254,11 +254,15 @@ do_constraints (GtkWidget *do_widget)
if (!window) if (!window)
{ {
GtkWidget *box, *grid; GtkWidget *header, *box, *grid, *button;
window = gtk_window_new (); window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget)); gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Constraints"); gtk_window_set_title (GTK_WINDOW (window), "Constraints");
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), FALSE);
gtk_window_set_titlebar (GTK_WINDOW (window), header);
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window); g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
@@ -268,6 +272,12 @@ do_constraints (GtkWidget *do_widget)
gtk_widget_set_hexpand (grid, TRUE); gtk_widget_set_hexpand (grid, TRUE);
gtk_widget_set_vexpand (grid, TRUE); gtk_widget_set_vexpand (grid, TRUE);
gtk_box_append (GTK_BOX (box), grid); gtk_box_append (GTK_BOX (box), grid);
button = gtk_button_new_with_label ("Close");
gtk_box_append (GTK_BOX (box), button);
gtk_widget_set_hexpand (grid, TRUE);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_window_destroy), window);
} }
if (!gtk_widget_get_visible (window)) if (!gtk_widget_get_visible (window))

View File

@@ -210,11 +210,15 @@ do_constraints2 (GtkWidget *do_widget)
if (!window) if (!window)
{ {
GtkWidget *box, *grid; GtkWidget *header, *box, *grid, *button;
window = gtk_window_new (); window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget)); gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Constraints"); gtk_window_set_title (GTK_WINDOW (window), "Constraints");
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), FALSE);
gtk_window_set_titlebar (GTK_WINDOW (window), header);
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window); g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
@@ -224,6 +228,12 @@ do_constraints2 (GtkWidget *do_widget)
gtk_widget_set_hexpand (grid, TRUE); gtk_widget_set_hexpand (grid, TRUE);
gtk_widget_set_vexpand (grid, TRUE); gtk_widget_set_vexpand (grid, TRUE);
gtk_box_append (GTK_BOX (box), grid); gtk_box_append (GTK_BOX (box), grid);
button = gtk_button_new_with_label ("Close");
gtk_box_append (GTK_BOX (box), button);
gtk_widget_set_hexpand (grid, TRUE);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_window_destroy), window);
} }
if (!gtk_widget_get_visible (window)) if (!gtk_widget_get_visible (window))

View File

@@ -130,11 +130,15 @@ do_constraints3 (GtkWidget *do_widget)
if (!window) if (!window)
{ {
GtkWidget *box, *grid; GtkWidget *header, *box, *grid, *button;
window = gtk_window_new (); window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget)); gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Constraints"); gtk_window_set_title (GTK_WINDOW (window), "Constraints");
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), FALSE);
gtk_window_set_titlebar (GTK_WINDOW (window), header);
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window); g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
@@ -144,6 +148,12 @@ do_constraints3 (GtkWidget *do_widget)
gtk_widget_set_hexpand (grid, TRUE); gtk_widget_set_hexpand (grid, TRUE);
gtk_widget_set_vexpand (grid, TRUE); gtk_widget_set_vexpand (grid, TRUE);
gtk_box_append (GTK_BOX (box), grid); gtk_box_append (GTK_BOX (box), grid);
button = gtk_button_new_with_label ("Close");
gtk_box_append (GTK_BOX (box), button);
gtk_widget_set_hexpand (grid, TRUE);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_window_destroy), window);
} }
if (!gtk_widget_get_visible (window)) if (!gtk_widget_get_visible (window))

View File

@@ -15,10 +15,6 @@
border: 1px solid; border: 1px solid;
} }
window {
background-color: white;
}
/* Make sure selections are visible */ /* Make sure selections are visible */
selection { selection {
background-color: darkGreen; background-color: darkGreen;

View File

@@ -38,14 +38,14 @@ struct {
#pragma GCC diagnostic ignored "-Wformat-nonliteral" #pragma GCC diagnostic ignored "-Wformat-nonliteral"
static void static void
update_css_for_blend_mode (GtkCssProvider *provider, update_css_for_blend_mode (GtkCssProvider *provider,
const char *blend_mode) const gchar *blend_mode)
{ {
GBytes *bytes; GBytes *bytes;
char *css; gchar *css;
bytes = g_resources_lookup_data ("/css_blendmodes/css_blendmodes.css", 0, NULL); bytes = g_resources_lookup_data ("/css_blendmodes/css_blendmodes.css", 0, NULL);
css = g_strdup_printf ((char *) g_bytes_get_data (bytes, NULL), css = g_strdup_printf ((gchar*) g_bytes_get_data (bytes, NULL),
blend_mode, blend_mode,
blend_mode, blend_mode,
blend_mode); blend_mode);
@@ -62,7 +62,7 @@ row_activated (GtkListBox *listbox,
GtkListBoxRow *row, GtkListBoxRow *row,
GtkCssProvider *provider) GtkCssProvider *provider)
{ {
const char *blend_mode; const gchar *blend_mode;
blend_mode = blend_modes[gtk_list_box_row_get_index (row)].id; blend_mode = blend_modes[gtk_list_box_row_get_index (row)].id;
@@ -75,7 +75,7 @@ setup_listbox (GtkBuilder *builder,
{ {
GtkWidget *normal_row; GtkWidget *normal_row;
GtkWidget *listbox; GtkWidget *listbox;
int i; gint i;
normal_row = NULL; normal_row = NULL;
listbox = gtk_list_box_new (); listbox = gtk_list_box_new ();

View File

@@ -46,19 +46,19 @@
} }
@keyframes size-the-image { @keyframes size-the-image {
0% { background-size: 96px, 12px, 96px, 12px, 96px, 12px, 96px, 12px, auto; } 0% { background-size: 96px, 12px, 96px, 12px, 96px, 12px, 96px, 12px, auto }
100% { background-size: 12px, 96px, 12px, 96px, 12px, 96px, 12px, 96px, auto; } 100% { background-size: 12px, 96px, 12px, 96px, 12px, 96px, 12px, 96px, auto }
} }
window { window {
background-image: url("resource://css_pixbufs/images/apple-red.png"), background-image: url("resource://css_pixbufs/apple-red.png"),
url("resource://css_pixbufs/images/gnome-applets.png"), url("resource://css_pixbufs/gnome-applets.png"),
url("resource://css_pixbufs/images/gnome-calendar.png"), url("resource://css_pixbufs/gnome-calendar.png"),
url("resource://css_pixbufs/images/gnome-foot.png"), url("resource://css_pixbufs/gnome-foot.png"),
url("resource://css_pixbufs/images/gnome-gmush.png"), url("resource://css_pixbufs/gnome-gmush.png"),
url("resource://css_pixbufs/images/gnome-gimp.png"), url("resource://css_pixbufs/gnome-gimp.png"),
url("resource://css_pixbufs/images/gnome-gsame.png"), url("resource://css_pixbufs/gnome-gsame.png"),
url("resource://css_pixbufs/images/gnu-keys.png"), url("resource://css_pixbufs/gnu-keys.png"),
url("resource://css_pixbufs/background.jpg"); url("resource://css_pixbufs/background.jpg");
background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%; background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%;
background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat; background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat;

View File

@@ -106,7 +106,6 @@ do_css_shadows (GtkWidget *do_widget)
child = create_toolbar (); child = create_toolbar ();
gtk_paned_set_start_child (GTK_PANED (paned), child); gtk_paned_set_start_child (GTK_PANED (paned), child);
gtk_paned_set_resize_start_child (GTK_PANED (paned), FALSE);
text = gtk_text_buffer_new (NULL); text = gtk_text_buffer_new (NULL);
gtk_text_buffer_create_tag (text, gtk_text_buffer_create_tag (text,

View File

@@ -4,7 +4,7 @@
<property name="name">default</property> <property name="name">default</property>
</object> </object>
<object class="GdkCursor" id="default_cursor_image"> <object class="GdkCursor" id="default_cursor_image">
<property name="texture">resource:///cursors/images/default_cursor.png</property> <property name="texture">resource:///cursors/default_cursor.png</property>
<property name="hotspot-x">5</property> <property name="hotspot-x">5</property>
<property name="hotspot-y">5</property> <property name="hotspot-y">5</property>
</object> </object>
@@ -13,7 +13,7 @@
<property name="fallback">default_cursor_image</property> <property name="fallback">default_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="default_cursor_image_fallback"> <object class="GdkCursor" id="default_cursor_image_fallback">
<property name="texture">resource:///cursors/images/default_cursor.png</property> <property name="texture">resource:///cursors/default_cursor.png</property>
<property name="hotspot-x">5</property> <property name="hotspot-x">5</property>
<property name="hotspot-y">5</property> <property name="hotspot-y">5</property>
<property name="fallback">default_cursor</property> <property name="fallback">default_cursor</property>
@@ -22,21 +22,21 @@
<property name="name">none</property> <property name="name">none</property>
</object> </object>
<object class="GdkCursor" id="none_cursor_image"> <object class="GdkCursor" id="none_cursor_image">
<property name="texture">resource:///cursors/images/none_cursor.png</property> <property name="texture">resource:///cursors/none_cursor.png</property>
</object> </object>
<object class="GdkCursor" id="none_cursor_fallback"> <object class="GdkCursor" id="none_cursor_fallback">
<property name="name">none</property> <property name="name">none</property>
<property name="fallback">none_cursor_image</property> <property name="fallback">none_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="none_cursor_image_fallback"> <object class="GdkCursor" id="none_cursor_image_fallback">
<property name="texture">resource:///cursors/images/none_cursor.png</property> <property name="texture">resource:///cursors/none_cursor.png</property>
<property name="fallback">none_cursor</property> <property name="fallback">none_cursor</property>
</object> </object>
<object class="GdkCursor" id="gtk-logo_cursor"> <object class="GdkCursor" id="gtk-logo_cursor">
<property name="name">gtk-logo</property> <property name="name">gtk-logo</property>
</object> </object>
<object class="GdkCursor" id="gtk-logo_cursor_image"> <object class="GdkCursor" id="gtk-logo_cursor_image">
<property name="texture">resource:///cursors/images/gtk_logo_cursor.png</property> <property name="texture">resource:///cursors/gtk_logo_cursor.png</property>
<property name="hotspot-x">18</property> <property name="hotspot-x">18</property>
<property name="hotspot-y">2</property> <property name="hotspot-y">2</property>
</object> </object>
@@ -45,7 +45,7 @@
<property name="fallback">gtk-logo_cursor_image</property> <property name="fallback">gtk-logo_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="gtk-logo_cursor_image_fallback"> <object class="GdkCursor" id="gtk-logo_cursor_image_fallback">
<property name="texture">resource:///cursors/images/gtk_logo_cursor.png</property> <property name="texture">resource:///cursors/gtk_logo_cursor.png</property>
<property name="hotspot-x">18</property> <property name="hotspot-x">18</property>
<property name="hotspot-y">2</property> <property name="hotspot-y">2</property>
<property name="fallback">gtk-logo_cursor</property> <property name="fallback">gtk-logo_cursor</property>
@@ -54,7 +54,7 @@
<property name="name">context-menu</property> <property name="name">context-menu</property>
</object> </object>
<object class="GdkCursor" id="context-menu_cursor_image"> <object class="GdkCursor" id="context-menu_cursor_image">
<property name="texture">resource:///cursors/images/context_menu_cursor.png</property> <property name="texture">resource:///cursors/context_menu_cursor.png</property>
<property name="hotspot-x">5</property> <property name="hotspot-x">5</property>
<property name="hotspot-y">5</property> <property name="hotspot-y">5</property>
</object> </object>
@@ -63,7 +63,7 @@
<property name="fallback">context-menu_cursor_image</property> <property name="fallback">context-menu_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="context-menu_cursor_image_fallback"> <object class="GdkCursor" id="context-menu_cursor_image_fallback">
<property name="texture">resource:///cursors/images/context_menu_cursor.png</property> <property name="texture">resource:///cursors/context_menu_cursor.png</property>
<property name="hotspot-x">5</property> <property name="hotspot-x">5</property>
<property name="hotspot-y">5</property> <property name="hotspot-y">5</property>
<property name="fallback">context-menu_cursor</property> <property name="fallback">context-menu_cursor</property>
@@ -72,7 +72,7 @@
<property name="name">help</property> <property name="name">help</property>
</object> </object>
<object class="GdkCursor" id="help_cursor_image"> <object class="GdkCursor" id="help_cursor_image">
<property name="texture">resource:///cursors/images/help_cursor.png</property> <property name="texture">resource:///cursors/help_cursor.png</property>
<property name="hotspot-x">16</property> <property name="hotspot-x">16</property>
<property name="hotspot-y">27</property> <property name="hotspot-y">27</property>
</object> </object>
@@ -81,7 +81,7 @@
<property name="fallback">help_cursor_image</property> <property name="fallback">help_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="help_cursor_image_fallback"> <object class="GdkCursor" id="help_cursor_image_fallback">
<property name="texture">resource:///cursors/images/help_cursor.png</property> <property name="texture">resource:///cursors/help_cursor.png</property>
<property name="hotspot-x">16</property> <property name="hotspot-x">16</property>
<property name="hotspot-y">27</property> <property name="hotspot-y">27</property>
<property name="fallback">help_cursor</property> <property name="fallback">help_cursor</property>
@@ -90,7 +90,7 @@
<property name="name">pointer</property> <property name="name">pointer</property>
</object> </object>
<object class="GdkCursor" id="pointer_cursor_image"> <object class="GdkCursor" id="pointer_cursor_image">
<property name="texture">resource:///cursors/images/pointer_cursor.png</property> <property name="texture">resource:///cursors/pointer_cursor.png</property>
<property name="hotspot-x">14</property> <property name="hotspot-x">14</property>
<property name="hotspot-y">9</property> <property name="hotspot-y">9</property>
</object> </object>
@@ -99,7 +99,7 @@
<property name="fallback">pointer_cursor_image</property> <property name="fallback">pointer_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="pointer_cursor_image_fallback"> <object class="GdkCursor" id="pointer_cursor_image_fallback">
<property name="texture">resource:///cursors/images/pointer_cursor.png</property> <property name="texture">resource:///cursors/pointer_cursor.png</property>
<property name="hotspot-x">14</property> <property name="hotspot-x">14</property>
<property name="hotspot-y">9</property> <property name="hotspot-y">9</property>
<property name="fallback">pointer_cursor</property> <property name="fallback">pointer_cursor</property>
@@ -108,7 +108,7 @@
<property name="name">progress</property> <property name="name">progress</property>
</object> </object>
<object class="GdkCursor" id="progress_cursor_image"> <object class="GdkCursor" id="progress_cursor_image">
<property name="texture">resource:///cursors/images/progress_cursor.png</property> <property name="texture">resource:///cursors/progress_cursor.png</property>
<property name="hotspot-x">5</property> <property name="hotspot-x">5</property>
<property name="hotspot-y">4</property> <property name="hotspot-y">4</property>
</object> </object>
@@ -117,7 +117,7 @@
<property name="fallback">progress_cursor_image</property> <property name="fallback">progress_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="progress_cursor_image_fallback"> <object class="GdkCursor" id="progress_cursor_image_fallback">
<property name="texture">resource:///cursors/images/progress_cursor.png</property> <property name="texture">resource:///cursors/progress_cursor.png</property>
<property name="hotspot-x">5</property> <property name="hotspot-x">5</property>
<property name="hotspot-y">4</property> <property name="hotspot-y">4</property>
<property name="fallback">progress_cursor</property> <property name="fallback">progress_cursor</property>
@@ -126,7 +126,7 @@
<property name="name">wait</property> <property name="name">wait</property>
</object> </object>
<object class="GdkCursor" id="wait_cursor_image"> <object class="GdkCursor" id="wait_cursor_image">
<property name="texture">resource:///cursors/images/wait_cursor.png</property> <property name="texture">resource:///cursors/wait_cursor.png</property>
<property name="hotspot-x">11</property> <property name="hotspot-x">11</property>
<property name="hotspot-y">11</property> <property name="hotspot-y">11</property>
</object> </object>
@@ -135,7 +135,7 @@
<property name="fallback">wait_cursor_image</property> <property name="fallback">wait_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="wait_cursor_image_fallback"> <object class="GdkCursor" id="wait_cursor_image_fallback">
<property name="texture">resource:///cursors/images/wait_cursor.png</property> <property name="texture">resource:///cursors/wait_cursor.png</property>
<property name="hotspot-x">11</property> <property name="hotspot-x">11</property>
<property name="hotspot-y">11</property> <property name="hotspot-y">11</property>
<property name="fallback">wait_cursor</property> <property name="fallback">wait_cursor</property>
@@ -144,7 +144,7 @@
<property name="name">cell</property> <property name="name">cell</property>
</object> </object>
<object class="GdkCursor" id="cell_cursor_image"> <object class="GdkCursor" id="cell_cursor_image">
<property name="texture">resource:///cursors/images/cell_cursor.png</property> <property name="texture">resource:///cursors/cell_cursor.png</property>
<property name="hotspot-x">15</property> <property name="hotspot-x">15</property>
<property name="hotspot-y">15</property> <property name="hotspot-y">15</property>
</object> </object>
@@ -153,7 +153,7 @@
<property name="fallback">cell_cursor_image</property> <property name="fallback">cell_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="cell_cursor_image_fallback"> <object class="GdkCursor" id="cell_cursor_image_fallback">
<property name="texture">resource:///cursors/images/cell_cursor.png</property> <property name="texture">resource:///cursors/cell_cursor.png</property>
<property name="hotspot-x">15</property> <property name="hotspot-x">15</property>
<property name="hotspot-y">15</property> <property name="hotspot-y">15</property>
<property name="fallback">cell_cursor</property> <property name="fallback">cell_cursor</property>
@@ -162,7 +162,7 @@
<property name="name">crosshair</property> <property name="name">crosshair</property>
</object> </object>
<object class="GdkCursor" id="crosshair_cursor_image"> <object class="GdkCursor" id="crosshair_cursor_image">
<property name="texture">resource:///cursors/images/crosshair_cursor.png</property> <property name="texture">resource:///cursors/crosshair_cursor.png</property>
<property name="hotspot-x">15</property> <property name="hotspot-x">15</property>
<property name="hotspot-y">15</property> <property name="hotspot-y">15</property>
</object> </object>
@@ -171,7 +171,7 @@
<property name="fallback">crosshair_cursor_image</property> <property name="fallback">crosshair_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="crosshair_cursor_image_fallback"> <object class="GdkCursor" id="crosshair_cursor_image_fallback">
<property name="texture">resource:///cursors/images/crosshair_cursor.png</property> <property name="texture">resource:///cursors/crosshair_cursor.png</property>
<property name="hotspot-x">15</property> <property name="hotspot-x">15</property>
<property name="hotspot-y">15</property> <property name="hotspot-y">15</property>
<property name="fallback">crosshair_cursor</property> <property name="fallback">crosshair_cursor</property>
@@ -180,7 +180,7 @@
<property name="name">text</property> <property name="name">text</property>
</object> </object>
<object class="GdkCursor" id="text_cursor_image"> <object class="GdkCursor" id="text_cursor_image">
<property name="texture">resource:///cursors/images/text_cursor.png</property> <property name="texture">resource:///cursors/text_cursor.png</property>
<property name="hotspot-x">14</property> <property name="hotspot-x">14</property>
<property name="hotspot-y">15</property> <property name="hotspot-y">15</property>
</object> </object>
@@ -189,7 +189,7 @@
<property name="fallback">text_cursor_image</property> <property name="fallback">text_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="text_cursor_image_fallback"> <object class="GdkCursor" id="text_cursor_image_fallback">
<property name="texture">resource:///cursors/images/text_cursor.png</property> <property name="texture">resource:///cursors/text_cursor.png</property>
<property name="hotspot-x">14</property> <property name="hotspot-x">14</property>
<property name="hotspot-y">15</property> <property name="hotspot-y">15</property>
<property name="fallback">text_cursor</property> <property name="fallback">text_cursor</property>
@@ -198,7 +198,7 @@
<property name="name">vertical-text</property> <property name="name">vertical-text</property>
</object> </object>
<object class="GdkCursor" id="vertical-text_cursor_image"> <object class="GdkCursor" id="vertical-text_cursor_image">
<property name="texture">resource:///cursors/images/vertical_text_cursor.png</property> <property name="texture">resource:///cursors/vertical_text_cursor.png</property>
<property name="hotspot-x">16</property> <property name="hotspot-x">16</property>
<property name="hotspot-y">15</property> <property name="hotspot-y">15</property>
</object> </object>
@@ -207,7 +207,7 @@
<property name="fallback">vertical-text_cursor_image</property> <property name="fallback">vertical-text_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="vertical-text_cursor_image_fallback"> <object class="GdkCursor" id="vertical-text_cursor_image_fallback">
<property name="texture">resource:///cursors/images/vertical_text_cursor.png</property> <property name="texture">resource:///cursors/vertical_text_cursor.png</property>
<property name="hotspot-x">16</property> <property name="hotspot-x">16</property>
<property name="hotspot-y">15</property> <property name="hotspot-y">15</property>
<property name="fallback">vertical-text_cursor</property> <property name="fallback">vertical-text_cursor</property>
@@ -216,7 +216,7 @@
<property name="name">alias</property> <property name="name">alias</property>
</object> </object>
<object class="GdkCursor" id="alias_cursor_image"> <object class="GdkCursor" id="alias_cursor_image">
<property name="texture">resource:///cursors/images/alias_cursor.png</property> <property name="texture">resource:///cursors/alias_cursor.png</property>
<property name="hotspot-x">12</property> <property name="hotspot-x">12</property>
<property name="hotspot-y">11</property> <property name="hotspot-y">11</property>
</object> </object>
@@ -225,7 +225,7 @@
<property name="fallback">alias_cursor_image</property> <property name="fallback">alias_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="alias_cursor_image_fallback"> <object class="GdkCursor" id="alias_cursor_image_fallback">
<property name="texture">resource:///cursors/images/alias_cursor.png</property> <property name="texture">resource:///cursors/alias_cursor.png</property>
<property name="hotspot-x">12</property> <property name="hotspot-x">12</property>
<property name="hotspot-y">11</property> <property name="hotspot-y">11</property>
<property name="fallback">alias_cursor</property> <property name="fallback">alias_cursor</property>
@@ -234,7 +234,7 @@
<property name="name">copy</property> <property name="name">copy</property>
</object> </object>
<object class="GdkCursor" id="copy_cursor_image"> <object class="GdkCursor" id="copy_cursor_image">
<property name="texture">resource:///cursors/images/copy_cursor.png</property> <property name="texture">resource:///cursors/copy_cursor.png</property>
<property name="hotspot-x">12</property> <property name="hotspot-x">12</property>
<property name="hotspot-y">11</property> <property name="hotspot-y">11</property>
</object> </object>
@@ -243,7 +243,7 @@
<property name="fallback">copy_cursor_image</property> <property name="fallback">copy_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="copy_cursor_image_fallback"> <object class="GdkCursor" id="copy_cursor_image_fallback">
<property name="texture">resource:///cursors/images/copy_cursor.png</property> <property name="texture">resource:///cursors/copy_cursor.png</property>
<property name="hotspot-x">12</property> <property name="hotspot-x">12</property>
<property name="hotspot-y">11</property> <property name="hotspot-y">11</property>
<property name="fallback">copy_cursor</property> <property name="fallback">copy_cursor</property>
@@ -252,7 +252,7 @@
<property name="name">move</property> <property name="name">move</property>
</object> </object>
<object class="GdkCursor" id="move_cursor_image"> <object class="GdkCursor" id="move_cursor_image">
<property name="texture">resource:///cursors/images/move_cursor.png</property> <property name="texture">resource:///cursors/move_cursor.png</property>
<property name="hotspot-x">12</property> <property name="hotspot-x">12</property>
<property name="hotspot-y">11</property> <property name="hotspot-y">11</property>
</object> </object>
@@ -261,7 +261,7 @@
<property name="fallback">move_cursor_image</property> <property name="fallback">move_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="move_cursor_image_fallback"> <object class="GdkCursor" id="move_cursor_image_fallback">
<property name="texture">resource:///cursors/images/move_cursor.png</property> <property name="texture">resource:///cursors/move_cursor.png</property>
<property name="hotspot-x">12</property> <property name="hotspot-x">12</property>
<property name="hotspot-y">11</property> <property name="hotspot-y">11</property>
<property name="fallback">move_cursor</property> <property name="fallback">move_cursor</property>
@@ -270,7 +270,7 @@
<property name="name">no-drop</property> <property name="name">no-drop</property>
</object> </object>
<object class="GdkCursor" id="no-drop_cursor_image"> <object class="GdkCursor" id="no-drop_cursor_image">
<property name="texture">resource:///cursors/images/no_drop_cursor.png</property> <property name="texture">resource:///cursors/no_drop_cursor.png</property>
<property name="hotspot-x">12</property> <property name="hotspot-x">12</property>
<property name="hotspot-y">11</property> <property name="hotspot-y">11</property>
</object> </object>
@@ -279,7 +279,7 @@
<property name="fallback">no-drop_cursor_image</property> <property name="fallback">no-drop_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="no-drop_cursor_image_fallback"> <object class="GdkCursor" id="no-drop_cursor_image_fallback">
<property name="texture">resource:///cursors/images/no_drop_cursor.png</property> <property name="texture">resource:///cursors/no_drop_cursor.png</property>
<property name="hotspot-x">12</property> <property name="hotspot-x">12</property>
<property name="hotspot-y">11</property> <property name="hotspot-y">11</property>
<property name="fallback">no-drop_cursor</property> <property name="fallback">no-drop_cursor</property>
@@ -288,7 +288,7 @@
<property name="name">not-allowed</property> <property name="name">not-allowed</property>
</object> </object>
<object class="GdkCursor" id="not-allowed_cursor_image"> <object class="GdkCursor" id="not-allowed_cursor_image">
<property name="texture">resource:///cursors/images/not_allowed_cursor.png</property> <property name="texture">resource:///cursors/not_allowed_cursor.png</property>
<property name="hotspot-x">12</property> <property name="hotspot-x">12</property>
<property name="hotspot-y">11</property> <property name="hotspot-y">11</property>
</object> </object>
@@ -297,7 +297,7 @@
<property name="fallback">not-allowed_cursor_image</property> <property name="fallback">not-allowed_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="not-allowed_cursor_image_fallback"> <object class="GdkCursor" id="not-allowed_cursor_image_fallback">
<property name="texture">resource:///cursors/images/not_allowed_cursor.png</property> <property name="texture">resource:///cursors/not_allowed_cursor.png</property>
<property name="hotspot-x">12</property> <property name="hotspot-x">12</property>
<property name="hotspot-y">11</property> <property name="hotspot-y">11</property>
<property name="fallback">not-allowed_cursor</property> <property name="fallback">not-allowed_cursor</property>
@@ -306,7 +306,7 @@
<property name="name">grab</property> <property name="name">grab</property>
</object> </object>
<object class="GdkCursor" id="grab_cursor_image"> <object class="GdkCursor" id="grab_cursor_image">
<property name="texture">resource:///cursors/images/grab_cursor.png</property> <property name="texture">resource:///cursors/grab_cursor.png</property>
<property name="hotspot-x">10</property> <property name="hotspot-x">10</property>
<property name="hotspot-y">6</property> <property name="hotspot-y">6</property>
</object> </object>
@@ -315,7 +315,7 @@
<property name="fallback">grab_cursor_image</property> <property name="fallback">grab_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="grab_cursor_image_fallback"> <object class="GdkCursor" id="grab_cursor_image_fallback">
<property name="texture">resource:///cursors/images/grab_cursor.png</property> <property name="texture">resource:///cursors/grab_cursor.png</property>
<property name="hotspot-x">10</property> <property name="hotspot-x">10</property>
<property name="hotspot-y">6</property> <property name="hotspot-y">6</property>
<property name="fallback">grab_cursor</property> <property name="fallback">grab_cursor</property>
@@ -324,7 +324,7 @@
<property name="name">grabbing</property> <property name="name">grabbing</property>
</object> </object>
<object class="GdkCursor" id="grabbing_cursor_image"> <object class="GdkCursor" id="grabbing_cursor_image">
<property name="texture">resource:///cursors/images/grabbing_cursor.png</property> <property name="texture">resource:///cursors/grabbing_cursor.png</property>
<property name="hotspot-x">15</property> <property name="hotspot-x">15</property>
<property name="hotspot-y">14</property> <property name="hotspot-y">14</property>
</object> </object>
@@ -333,7 +333,7 @@
<property name="fallback">grabbing_cursor_image</property> <property name="fallback">grabbing_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="grabbing_cursor_image_fallback"> <object class="GdkCursor" id="grabbing_cursor_image_fallback">
<property name="texture">resource:///cursors/images/grabbing_cursor.png</property> <property name="texture">resource:///cursors/grabbing_cursor.png</property>
<property name="hotspot-x">15</property> <property name="hotspot-x">15</property>
<property name="hotspot-y">14</property> <property name="hotspot-y">14</property>
<property name="fallback">grabbing_cursor</property> <property name="fallback">grabbing_cursor</property>
@@ -342,7 +342,7 @@
<property name="name">all-scroll</property> <property name="name">all-scroll</property>
</object> </object>
<object class="GdkCursor" id="all-scroll_cursor_image"> <object class="GdkCursor" id="all-scroll_cursor_image">
<property name="texture">resource:///cursors/images/all_scroll_cursor.png</property> <property name="texture">resource:///cursors/all_scroll_cursor.png</property>
<property name="hotspot-x">15</property> <property name="hotspot-x">15</property>
<property name="hotspot-y">15</property> <property name="hotspot-y">15</property>
</object> </object>
@@ -351,7 +351,7 @@
<property name="fallback">all-scroll_cursor_image</property> <property name="fallback">all-scroll_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="all-scroll_cursor_image_fallback"> <object class="GdkCursor" id="all-scroll_cursor_image_fallback">
<property name="texture">resource:///cursors/images/all_scroll_cursor.png</property> <property name="texture">resource:///cursors/all_scroll_cursor.png</property>
<property name="hotspot-x">15</property> <property name="hotspot-x">15</property>
<property name="hotspot-y">15</property> <property name="hotspot-y">15</property>
<property name="fallback">all-scroll_cursor</property> <property name="fallback">all-scroll_cursor</property>
@@ -360,7 +360,7 @@
<property name="name">col-resize</property> <property name="name">col-resize</property>
</object> </object>
<object class="GdkCursor" id="col-resize_cursor_image"> <object class="GdkCursor" id="col-resize_cursor_image">
<property name="texture">resource:///cursors/images/col_resize_cursor.png</property> <property name="texture">resource:///cursors/col_resize_cursor.png</property>
<property name="hotspot-x">16</property> <property name="hotspot-x">16</property>
<property name="hotspot-y">15</property> <property name="hotspot-y">15</property>
</object> </object>
@@ -369,7 +369,7 @@
<property name="fallback">col-resize_cursor_image</property> <property name="fallback">col-resize_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="col-resize_cursor_image_fallback"> <object class="GdkCursor" id="col-resize_cursor_image_fallback">
<property name="texture">resource:///cursors/images/col_resize_cursor.png</property> <property name="texture">resource:///cursors/col_resize_cursor.png</property>
<property name="hotspot-x">16</property> <property name="hotspot-x">16</property>
<property name="hotspot-y">15</property> <property name="hotspot-y">15</property>
<property name="fallback">col-resize_cursor</property> <property name="fallback">col-resize_cursor</property>
@@ -378,7 +378,7 @@
<property name="name">row-resize</property> <property name="name">row-resize</property>
</object> </object>
<object class="GdkCursor" id="row-resize_cursor_image"> <object class="GdkCursor" id="row-resize_cursor_image">
<property name="texture">resource:///cursors/images/row_resize_cursor.png</property> <property name="texture">resource:///cursors/row_resize_cursor.png</property>
<property name="hotspot-x">15</property> <property name="hotspot-x">15</property>
<property name="hotspot-y">17</property> <property name="hotspot-y">17</property>
</object> </object>
@@ -387,7 +387,7 @@
<property name="fallback">row-resize_cursor_image</property> <property name="fallback">row-resize_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="row-resize_cursor_image_fallback"> <object class="GdkCursor" id="row-resize_cursor_image_fallback">
<property name="texture">resource:///cursors/images/row_resize_cursor.png</property> <property name="texture">resource:///cursors/row_resize_cursor.png</property>
<property name="hotspot-x">15</property> <property name="hotspot-x">15</property>
<property name="hotspot-y">17</property> <property name="hotspot-y">17</property>
<property name="fallback">row-resize_cursor</property> <property name="fallback">row-resize_cursor</property>
@@ -396,7 +396,7 @@
<property name="name">n-resize</property> <property name="name">n-resize</property>
</object> </object>
<object class="GdkCursor" id="n-resize_cursor_image"> <object class="GdkCursor" id="n-resize_cursor_image">
<property name="texture">resource:///cursors/images/n_resize_cursor.png</property> <property name="texture">resource:///cursors/n_resize_cursor.png</property>
<property name="hotspot-x">17</property> <property name="hotspot-x">17</property>
<property name="hotspot-y">7</property> <property name="hotspot-y">7</property>
</object> </object>
@@ -405,7 +405,7 @@
<property name="fallback">n-resize_cursor_image</property> <property name="fallback">n-resize_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="n-resize_cursor_image_fallback"> <object class="GdkCursor" id="n-resize_cursor_image_fallback">
<property name="texture">resource:///cursors/images/n_resize_cursor.png</property> <property name="texture">resource:///cursors/n_resize_cursor.png</property>
<property name="hotspot-x">17</property> <property name="hotspot-x">17</property>
<property name="hotspot-y">7</property> <property name="hotspot-y">7</property>
<property name="fallback">n-resize_cursor</property> <property name="fallback">n-resize_cursor</property>
@@ -414,7 +414,7 @@
<property name="name">e-resize</property> <property name="name">e-resize</property>
</object> </object>
<object class="GdkCursor" id="e-resize_cursor_image"> <object class="GdkCursor" id="e-resize_cursor_image">
<property name="texture">resource:///cursors/images/e_resize_cursor.png</property> <property name="texture">resource:///cursors/e_resize_cursor.png</property>
<property name="hotspot-x">25</property> <property name="hotspot-x">25</property>
<property name="hotspot-y">17</property> <property name="hotspot-y">17</property>
</object> </object>
@@ -423,7 +423,7 @@
<property name="fallback">e-resize_cursor_image</property> <property name="fallback">e-resize_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="e-resize_cursor_image_fallback"> <object class="GdkCursor" id="e-resize_cursor_image_fallback">
<property name="texture">resource:///cursors/images/e_resize_cursor.png</property> <property name="texture">resource:///cursors/e_resize_cursor.png</property>
<property name="hotspot-x">25</property> <property name="hotspot-x">25</property>
<property name="hotspot-y">17</property> <property name="hotspot-y">17</property>
<property name="fallback">e-resize_cursor</property> <property name="fallback">e-resize_cursor</property>
@@ -432,7 +432,7 @@
<property name="name">s-resize</property> <property name="name">s-resize</property>
</object> </object>
<object class="GdkCursor" id="s-resize_cursor_image"> <object class="GdkCursor" id="s-resize_cursor_image">
<property name="texture">resource:///cursors/images/s_resize_cursor.png</property> <property name="texture">resource:///cursors/s_resize_cursor.png</property>
<property name="hotspot-x">17</property> <property name="hotspot-x">17</property>
<property name="hotspot-y">23</property> <property name="hotspot-y">23</property>
</object> </object>
@@ -441,7 +441,7 @@
<property name="fallback">s-resize_cursor_image</property> <property name="fallback">s-resize_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="s-resize_cursor_image_fallback"> <object class="GdkCursor" id="s-resize_cursor_image_fallback">
<property name="texture">resource:///cursors/images/s_resize_cursor.png</property> <property name="texture">resource:///cursors/s_resize_cursor.png</property>
<property name="hotspot-x">17</property> <property name="hotspot-x">17</property>
<property name="hotspot-y">23</property> <property name="hotspot-y">23</property>
<property name="fallback">s-resize_cursor</property> <property name="fallback">s-resize_cursor</property>
@@ -450,7 +450,7 @@
<property name="name">w-resize</property> <property name="name">w-resize</property>
</object> </object>
<object class="GdkCursor" id="w-resize_cursor_image"> <object class="GdkCursor" id="w-resize_cursor_image">
<property name="texture">resource:///cursors/images/w_resize_cursor.png</property> <property name="texture">resource:///cursors/w_resize_cursor.png</property>
<property name="hotspot-x">8</property> <property name="hotspot-x">8</property>
<property name="hotspot-y">17</property> <property name="hotspot-y">17</property>
</object> </object>
@@ -459,7 +459,7 @@
<property name="fallback">w-resize_cursor_image</property> <property name="fallback">w-resize_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="w-resize_cursor_image_fallback"> <object class="GdkCursor" id="w-resize_cursor_image_fallback">
<property name="texture">resource:///cursors/images/w_resize_cursor.png</property> <property name="texture">resource:///cursors/w_resize_cursor.png</property>
<property name="hotspot-x">8</property> <property name="hotspot-x">8</property>
<property name="hotspot-y">17</property> <property name="hotspot-y">17</property>
<property name="fallback">w-resize_cursor</property> <property name="fallback">w-resize_cursor</property>
@@ -468,7 +468,7 @@
<property name="name">ne-resize</property> <property name="name">ne-resize</property>
</object> </object>
<object class="GdkCursor" id="ne-resize_cursor_image"> <object class="GdkCursor" id="ne-resize_cursor_image">
<property name="texture">resource:///cursors/images/ne_resize_cursor.png</property> <property name="texture">resource:///cursors/ne_resize_cursor.png</property>
<property name="hotspot-x">20</property> <property name="hotspot-x">20</property>
<property name="hotspot-y">13</property> <property name="hotspot-y">13</property>
</object> </object>
@@ -477,7 +477,7 @@
<property name="fallback">ne-resize_cursor_image</property> <property name="fallback">ne-resize_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="ne-resize_cursor_image_fallback"> <object class="GdkCursor" id="ne-resize_cursor_image_fallback">
<property name="texture">resource:///cursors/images/ne_resize_cursor.png</property> <property name="texture">resource:///cursors/ne_resize_cursor.png</property>
<property name="hotspot-x">20</property> <property name="hotspot-x">20</property>
<property name="hotspot-y">13</property> <property name="hotspot-y">13</property>
<property name="fallback">ne-resize_cursor</property> <property name="fallback">ne-resize_cursor</property>
@@ -486,7 +486,7 @@
<property name="name">nw-resize</property> <property name="name">nw-resize</property>
</object> </object>
<object class="GdkCursor" id="nw-resize_cursor_image"> <object class="GdkCursor" id="nw-resize_cursor_image">
<property name="texture">resource:///cursors/images/nw_resize_cursor.png</property> <property name="texture">resource:///cursors/nw_resize_cursor.png</property>
<property name="hotspot-x">13</property> <property name="hotspot-x">13</property>
<property name="hotspot-y">13</property> <property name="hotspot-y">13</property>
</object> </object>
@@ -495,7 +495,7 @@
<property name="fallback">nw-resize_cursor_image</property> <property name="fallback">nw-resize_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="nw-resize_cursor_image_fallback"> <object class="GdkCursor" id="nw-resize_cursor_image_fallback">
<property name="texture">resource:///cursors/images/nw_resize_cursor.png</property> <property name="texture">resource:///cursors/nw_resize_cursor.png</property>
<property name="hotspot-x">13</property> <property name="hotspot-x">13</property>
<property name="hotspot-y">13</property> <property name="hotspot-y">13</property>
<property name="fallback">nw-resize_cursor</property> <property name="fallback">nw-resize_cursor</property>
@@ -504,7 +504,7 @@
<property name="name">se-resize</property> <property name="name">se-resize</property>
</object> </object>
<object class="GdkCursor" id="se-resize_cursor_image"> <object class="GdkCursor" id="se-resize_cursor_image">
<property name="texture">resource:///cursors/images/se_resize_cursor.png</property> <property name="texture">resource:///cursors/se_resize_cursor.png</property>
<property name="hotspot-x">19</property> <property name="hotspot-x">19</property>
<property name="hotspot-y">19</property> <property name="hotspot-y">19</property>
</object> </object>
@@ -513,7 +513,7 @@
<property name="fallback">se-resize_cursor_image</property> <property name="fallback">se-resize_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="se-resize_cursor_image_fallback"> <object class="GdkCursor" id="se-resize_cursor_image_fallback">
<property name="texture">resource:///cursors/images/se_resize_cursor.png</property> <property name="texture">resource:///cursors/se_resize_cursor.png</property>
<property name="hotspot-x">19</property> <property name="hotspot-x">19</property>
<property name="hotspot-y">19</property> <property name="hotspot-y">19</property>
<property name="fallback">se-resize_cursor</property> <property name="fallback">se-resize_cursor</property>
@@ -522,7 +522,7 @@
<property name="name">sw-resize</property> <property name="name">sw-resize</property>
</object> </object>
<object class="GdkCursor" id="sw-resize_cursor_image"> <object class="GdkCursor" id="sw-resize_cursor_image">
<property name="texture">resource:///cursors/images/sw_resize_cursor.png</property> <property name="texture">resource:///cursors/sw_resize_cursor.png</property>
<property name="hotspot-x">13</property> <property name="hotspot-x">13</property>
<property name="hotspot-y">19</property> <property name="hotspot-y">19</property>
</object> </object>
@@ -531,7 +531,7 @@
<property name="fallback">sw-resize_cursor_image</property> <property name="fallback">sw-resize_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="sw-resize_cursor_image_fallback"> <object class="GdkCursor" id="sw-resize_cursor_image_fallback">
<property name="texture">resource:///cursors/images/sw_resize_cursor.png</property> <property name="texture">resource:///cursors/sw_resize_cursor.png</property>
<property name="hotspot-x">13</property> <property name="hotspot-x">13</property>
<property name="hotspot-y">19</property> <property name="hotspot-y">19</property>
<property name="fallback">sw-resize_cursor</property> <property name="fallback">sw-resize_cursor</property>
@@ -540,7 +540,7 @@
<property name="name">ew-resize</property> <property name="name">ew-resize</property>
</object> </object>
<object class="GdkCursor" id="ew-resize_cursor_image"> <object class="GdkCursor" id="ew-resize_cursor_image">
<property name="texture">resource:///cursors/images/ew_resize_cursor.png</property> <property name="texture">resource:///cursors/ew_resize_cursor.png</property>
<property name="hotspot-x">16</property> <property name="hotspot-x">16</property>
<property name="hotspot-y">15</property> <property name="hotspot-y">15</property>
</object> </object>
@@ -549,7 +549,7 @@
<property name="fallback">ew-resize_cursor_image</property> <property name="fallback">ew-resize_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="ew-resize_cursor_image_fallback"> <object class="GdkCursor" id="ew-resize_cursor_image_fallback">
<property name="texture">resource:///cursors/images/ew_resize_cursor.png</property> <property name="texture">resource:///cursors/ew_resize_cursor.png</property>
<property name="hotspot-x">16</property> <property name="hotspot-x">16</property>
<property name="hotspot-y">15</property> <property name="hotspot-y">15</property>
<property name="fallback">ew-resize_cursor</property> <property name="fallback">ew-resize_cursor</property>
@@ -558,7 +558,7 @@
<property name="name">ns-resize</property> <property name="name">ns-resize</property>
</object> </object>
<object class="GdkCursor" id="ns-resize_cursor_image"> <object class="GdkCursor" id="ns-resize_cursor_image">
<property name="texture">resource:///cursors/images/ns_resize_cursor.png</property> <property name="texture">resource:///cursors/ns_resize_cursor.png</property>
<property name="hotspot-x">15</property> <property name="hotspot-x">15</property>
<property name="hotspot-y">17</property> <property name="hotspot-y">17</property>
</object> </object>
@@ -567,7 +567,7 @@
<property name="fallback">ns-resize_cursor_image</property> <property name="fallback">ns-resize_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="ns-resize_cursor_image_fallback"> <object class="GdkCursor" id="ns-resize_cursor_image_fallback">
<property name="texture">resource:///cursors/images/ns_resize_cursor.png</property> <property name="texture">resource:///cursors/ns_resize_cursor.png</property>
<property name="hotspot-x">15</property> <property name="hotspot-x">15</property>
<property name="hotspot-y">17</property> <property name="hotspot-y">17</property>
<property name="fallback">ns-resize_cursor</property> <property name="fallback">ns-resize_cursor</property>
@@ -576,7 +576,7 @@
<property name="name">nesw-resize</property> <property name="name">nesw-resize</property>
</object> </object>
<object class="GdkCursor" id="nesw-resize_cursor_image"> <object class="GdkCursor" id="nesw-resize_cursor_image">
<property name="texture">resource:///cursors/images/nesw_resize_cursor.png</property> <property name="texture">resource:///cursors/nesw_resize_cursor.png</property>
<property name="hotspot-x">14</property> <property name="hotspot-x">14</property>
<property name="hotspot-y">14</property> <property name="hotspot-y">14</property>
</object> </object>
@@ -585,7 +585,7 @@
<property name="fallback">nesw-resize_cursor_image</property> <property name="fallback">nesw-resize_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="nesw-resize_cursor_image_fallback"> <object class="GdkCursor" id="nesw-resize_cursor_image_fallback">
<property name="texture">resource:///cursors/images/nesw_resize_cursor.png</property> <property name="texture">resource:///cursors/nesw_resize_cursor.png</property>
<property name="hotspot-x">14</property> <property name="hotspot-x">14</property>
<property name="hotspot-y">14</property> <property name="hotspot-y">14</property>
<property name="fallback">nesw-resize_cursor</property> <property name="fallback">nesw-resize_cursor</property>
@@ -594,7 +594,7 @@
<property name="name">nwse-resize</property> <property name="name">nwse-resize</property>
</object> </object>
<object class="GdkCursor" id="nwse-resize_cursor_image"> <object class="GdkCursor" id="nwse-resize_cursor_image">
<property name="texture">resource:///cursors/images/nwse_resize_cursor.png</property> <property name="texture">resource:///cursors/nwse_resize_cursor.png</property>
<property name="hotspot-x">14</property> <property name="hotspot-x">14</property>
<property name="hotspot-y">14</property> <property name="hotspot-y">14</property>
</object> </object>
@@ -603,7 +603,7 @@
<property name="fallback">nwse-resize_cursor_image</property> <property name="fallback">nwse-resize_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="nwse-resize_cursor_image_fallback"> <object class="GdkCursor" id="nwse-resize_cursor_image_fallback">
<property name="texture">resource:///cursors/images/nwse_resize_cursor.png</property> <property name="texture">resource:///cursors/nwse_resize_cursor.png</property>
<property name="hotspot-x">14</property> <property name="hotspot-x">14</property>
<property name="hotspot-y">14</property> <property name="hotspot-y">14</property>
<property name="fallback">nwse-resize_cursor</property> <property name="fallback">nwse-resize_cursor</property>
@@ -612,7 +612,7 @@
<property name="name">zoom-in</property> <property name="name">zoom-in</property>
</object> </object>
<object class="GdkCursor" id="zoom-in_cursor_image"> <object class="GdkCursor" id="zoom-in_cursor_image">
<property name="texture">resource:///cursors/images/zoom_in_cursor.png</property> <property name="texture">resource:///cursors/zoom_in_cursor.png</property>
<property name="hotspot-x">14</property> <property name="hotspot-x">14</property>
<property name="hotspot-y">13</property> <property name="hotspot-y">13</property>
</object> </object>
@@ -621,7 +621,7 @@
<property name="fallback">zoom-in_cursor_image</property> <property name="fallback">zoom-in_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="zoom-in_cursor_image_fallback"> <object class="GdkCursor" id="zoom-in_cursor_image_fallback">
<property name="texture">resource:///cursors/images/zoom_in_cursor.png</property> <property name="texture">resource:///cursors/zoom_in_cursor.png</property>
<property name="hotspot-x">14</property> <property name="hotspot-x">14</property>
<property name="hotspot-y">13</property> <property name="hotspot-y">13</property>
<property name="fallback">zoom-in_cursor</property> <property name="fallback">zoom-in_cursor</property>
@@ -630,7 +630,7 @@
<property name="name">zoom-out</property> <property name="name">zoom-out</property>
</object> </object>
<object class="GdkCursor" id="zoom-out_cursor_image"> <object class="GdkCursor" id="zoom-out_cursor_image">
<property name="texture">resource:///cursors/images/zoom_out_cursor.png</property> <property name="texture">resource:///cursors/zoom_out_cursor.png</property>
<property name="hotspot-x">14</property> <property name="hotspot-x">14</property>
<property name="hotspot-y">13</property> <property name="hotspot-y">13</property>
</object> </object>
@@ -639,7 +639,7 @@
<property name="fallback">zoom-out_cursor_image</property> <property name="fallback">zoom-out_cursor_image</property>
</object> </object>
<object class="GdkCursor" id="zoom-out_cursor_image_fallback"> <object class="GdkCursor" id="zoom-out_cursor_image_fallback">
<property name="texture">resource:///cursors/images/zoom_out_cursor.png</property> <property name="texture">resource:///cursors/zoom_out_cursor.png</property>
<property name="hotspot-x">14</property> <property name="hotspot-x">14</property>
<property name="hotspot-y">13</property> <property name="hotspot-y">13</property>
<property name="fallback">zoom-out_cursor</property> <property name="fallback">zoom-out_cursor</property>
@@ -682,7 +682,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/default_cursor.png</property> <property name="paintable">resource:///cursors/default_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -742,7 +742,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/none_cursor.png</property> <property name="paintable">resource:///cursors/none_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -802,7 +802,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/gtk_logo_cursor.png</property> <property name="paintable">resource:///cursors/gtk_logo_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -875,7 +875,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/context_menu_cursor.png</property> <property name="paintable">resource:///cursors/context_menu_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -935,7 +935,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/help_cursor.png</property> <property name="paintable">resource:///cursors/help_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -995,7 +995,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/pointer_cursor.png</property> <property name="paintable">resource:///cursors/pointer_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1055,7 +1055,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/progress_cursor.png</property> <property name="paintable">resource:///cursors/progress_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1115,7 +1115,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/wait_cursor.png</property> <property name="paintable">resource:///cursors/wait_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1188,7 +1188,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/cell_cursor.png</property> <property name="paintable">resource:///cursors/cell_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1248,7 +1248,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/crosshair_cursor.png</property> <property name="paintable">resource:///cursors/crosshair_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1308,7 +1308,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/text_cursor.png</property> <property name="paintable">resource:///cursors/text_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1368,7 +1368,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/vertical_text_cursor.png</property> <property name="paintable">resource:///cursors/vertical_text_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1441,7 +1441,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/alias_cursor.png</property> <property name="paintable">resource:///cursors/alias_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1501,7 +1501,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/copy_cursor.png</property> <property name="paintable">resource:///cursors/copy_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1561,7 +1561,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/move_cursor.png</property> <property name="paintable">resource:///cursors/move_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1621,7 +1621,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/no_drop_cursor.png</property> <property name="paintable">resource:///cursors/no_drop_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1681,7 +1681,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/not_allowed_cursor.png</property> <property name="paintable">resource:///cursors/not_allowed_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1741,7 +1741,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/grab_cursor.png</property> <property name="paintable">resource:///cursors/grab_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1801,7 +1801,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/grabbing_cursor.png</property> <property name="paintable">resource:///cursors/grabbing_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1874,7 +1874,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/all_scroll_cursor.png</property> <property name="paintable">resource:///cursors/all_scroll_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1934,7 +1934,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/col_resize_cursor.png</property> <property name="paintable">resource:///cursors/col_resize_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -1994,7 +1994,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/row_resize_cursor.png</property> <property name="paintable">resource:///cursors/row_resize_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -2054,7 +2054,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/n_resize_cursor.png</property> <property name="paintable">resource:///cursors/n_resize_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -2114,7 +2114,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/e_resize_cursor.png</property> <property name="paintable">resource:///cursors/e_resize_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -2174,7 +2174,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/s_resize_cursor.png</property> <property name="paintable">resource:///cursors/s_resize_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -2234,7 +2234,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/w_resize_cursor.png</property> <property name="paintable">resource:///cursors/w_resize_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -2294,7 +2294,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/ne_resize_cursor.png</property> <property name="paintable">resource:///cursors/ne_resize_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -2354,7 +2354,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/nw_resize_cursor.png</property> <property name="paintable">resource:///cursors/nw_resize_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -2414,7 +2414,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/sw_resize_cursor.png</property> <property name="paintable">resource:///cursors/sw_resize_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -2474,7 +2474,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/se_resize_cursor.png</property> <property name="paintable">resource:///cursors/se_resize_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -2534,7 +2534,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/ew_resize_cursor.png</property> <property name="paintable">resource:///cursors/ew_resize_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -2594,7 +2594,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/ns_resize_cursor.png</property> <property name="paintable">resource:///cursors/ns_resize_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -2654,7 +2654,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/nesw_resize_cursor.png</property> <property name="paintable">resource:///cursors/nesw_resize_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -2714,7 +2714,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/nwse_resize_cursor.png</property> <property name="paintable">resource:///cursors/nwse_resize_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -2787,7 +2787,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/zoom_in_cursor.png</property> <property name="paintable">resource:///cursors/zoom_in_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>
@@ -2847,7 +2847,7 @@
<property name="spacing">10</property> <property name="spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="paintable">resource:///cursors/images/zoom_out_cursor.png</property> <property name="paintable">resource:///cursors/zoom_out_cursor.png</property>
</object> </object>
</child> </child>
<child> <child>

View File

@@ -51,8 +51,6 @@
<file>cssview.css</file> <file>cssview.css</file>
<file>reset.css</file> <file>reset.css</file>
<file>background.jpg</file> <file>background.jpg</file>
</gresource>
<gresource prefix="/css_pixbufs/images">
<file>apple-red.png</file> <file>apple-red.png</file>
<file>gnome-applets.png</file> <file>gnome-applets.png</file>
<file>gnome-calendar.png</file> <file>gnome-calendar.png</file>
@@ -69,8 +67,6 @@
</gresource> </gresource>
<gresource prefix="/cursors"> <gresource prefix="/cursors">
<file>cursors.ui</file> <file>cursors.ui</file>
</gresource>
<gresource prefix="/cursors/images">
<file>alias_cursor.png</file> <file>alias_cursor.png</file>
<file>all_scroll_cursor.png</file> <file>all_scroll_cursor.png</file>
<file>cell_cursor.png</file> <file>cell_cursor.png</file>
@@ -128,24 +124,6 @@
<file>gnome-fs-directory.png</file> <file>gnome-fs-directory.png</file>
<file>gnome-fs-regular.png</file> <file>gnome-fs-regular.png</file>
</gresource> </gresource>
<gresource prefix="/layoutmanager">
<file>demolayout.h</file>
<file>demolayout.c</file>
<file>demowidget.h</file>
<file>demowidget.c</file>
<file>demochild.h</file>
<file>demochild.c</file>
</gresource>
<gresource prefix="/layoutmanager2">
<file>demo2layout.h</file>
<file>demo2layout.c</file>
<file>demo2widget.h</file>
<file>demo2widget.c</file>
<file>four_point_transform.h</file>
<file>four_point_transform.c</file>
<file>singular_value_decomposition.h</file>
<file>singular_value_decomposition.c</file>
</gresource>
<gresource prefix="/listview_filebrowser"> <gresource prefix="/listview_filebrowser">
<file>listview_filebrowser.ui</file> <file>listview_filebrowser.ui</file>
<file>listview_filebrowser.css</file> <file>listview_filebrowser.css</file>
@@ -162,7 +140,6 @@
</gresource> </gresource>
<gresource prefix="/listview_colors"> <gresource prefix="/listview_colors">
<file compressed="true">color.names.txt</file> <file compressed="true">color.names.txt</file>
<file>listview_colors.css</file>
</gresource> </gresource>
<gresource prefix="/shortcuts"> <gresource prefix="/shortcuts">
<file>shortcuts.ui</file> <file>shortcuts.ui</file>
@@ -187,6 +164,17 @@
<file>floppybuddy.gif</file> <file>floppybuddy.gif</file>
<file>gtk-logo.webm</file> <file>gtk-logo.webm</file>
</gresource> </gresource>
<gresource prefix="/pixbufs">
<file>apple-red.png</file>
<file>background.jpg</file>
<file>gnome-applets.png</file>
<file>gnome-calendar.png</file>
<file>gnome-foot.png</file>
<file>gnome-gmush.png</file>
<file>gnome-gimp.png</file>
<file>gnome-gsame.png</file>
<file>gnu-keys.png</file>
</gresource>
<gresource prefix="/sources"> <gresource prefix="/sources">
<file>application_demo.c</file> <file>application_demo.c</file>
<file>assistant.c</file> <file>assistant.c</file>
@@ -228,11 +216,8 @@
<file>iconview_edit.c</file> <file>iconview_edit.c</file>
<file>images.c</file> <file>images.c</file>
<file>infobar.c</file> <file>infobar.c</file>
<file>layoutmanager.c</file>
<file>layoutmanager2.c</file>
<file>links.c</file> <file>links.c</file>
<file>listbox.c</file> <file>listbox.c</file>
<file>listbox2.c</file>
<file>listview_applauncher.c</file> <file>listview_applauncher.c</file>
<file>listview_colors.c</file> <file>listview_colors.c</file>
<file>listview_clocks.c</file> <file>listview_clocks.c</file>
@@ -243,6 +228,7 @@
<file>listview_words.c</file> <file>listview_words.c</file>
<file>list_store.c</file> <file>list_store.c</file>
<file>markup.c</file> <file>markup.c</file>
<file>modelbutton.c</file>
<file>overlay.c</file> <file>overlay.c</file>
<file>overlay2.c</file> <file>overlay2.c</file>
<file>paint.c</file> <file>paint.c</file>
@@ -254,6 +240,7 @@
<file>password_entry.c</file> <file>password_entry.c</file>
<file>peg_solitaire.c</file> <file>peg_solitaire.c</file>
<file>pickers.c</file> <file>pickers.c</file>
<file>pixbufs.c</file>
<file>printing.c</file> <file>printing.c</file>
<file>revealer.c</file> <file>revealer.c</file>
<file>rotated_text.c</file> <file>rotated_text.c</file>
@@ -291,9 +278,6 @@
<file>messages.txt</file> <file>messages.txt</file>
<file>apple-red.png</file> <file>apple-red.png</file>
</gresource> </gresource>
<gresource prefix="/listbox2">
<file>listbox2.ui</file>
</gresource>
<gresource prefix="/glarea"> <gresource prefix="/glarea">
<file>glarea-gl.fs.glsl</file> <file>glarea-gl.fs.glsl</file>
<file>glarea-gl.vs.glsl</file> <file>glarea-gl.vs.glsl</file>
@@ -325,6 +309,9 @@
<gresource prefix="/scale"> <gresource prefix="/scale">
<file>scale.ui</file> <file>scale.ui</file>
</gresource> </gresource>
<gresource prefix="/modelbutton">
<file>modelbutton.ui</file>
</gresource>
<gresource prefix="/tagged_entry"> <gresource prefix="/tagged_entry">
<file>demotaggedentry.c</file> <file>demotaggedentry.c</file>
<file>demotaggedentry.h</file> <file>demotaggedentry.h</file>

View File

@@ -95,6 +95,9 @@
<property name="program-name" translatable="yes">Builder demo</property> <property name="program-name" translatable="yes">Builder demo</property>
<property name="logo-icon-name" translatable="yes">gtk3-demo</property> <property name="logo-icon-name" translatable="yes">gtk3-demo</property>
<property name="modal">True</property> <property name="modal">True</property>
<accessibility>
<relation target="window1" type="subwindow-of"/>
</accessibility>
</object> </object>
<object class="GtkWindow" id="window1"> <object class="GtkWindow" id="window1">
<property name="default-height">250</property> <property name="default-height">250</property>
@@ -110,6 +113,11 @@
</child> </child>
<child> <child>
<object class="GtkBox" id="toolbar1"> <object class="GtkBox" id="toolbar1">
<child internal-child="accessible">
<object class="AtkObject" id="a11y-toolbar">
<property name="AtkObject::accessible-name">The toolbar</property>
</object>
</child>
<child> <child>
<object class="GtkButton"> <object class="GtkButton">
<property name="label" translatable="yes">New</property> <property name="label" translatable="yes">New</property>
@@ -166,6 +174,14 @@
<object class="GtkTreeView" id="treeview1"> <object class="GtkTreeView" id="treeview1">
<property name="model">liststore1</property> <property name="model">liststore1</property>
<property name="tooltip-column">3</property> <property name="tooltip-column">3</property>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-treeview">
<property name="AtkObject::accessible-name">Name list</property>
<property name="AtkObject::accessible-description">
A list of person with name, surname and age columns
</property>
</object>
</child>
<child> <child>
<object class="GtkTreeViewColumn" id="column1"> <object class="GtkTreeViewColumn" id="column1">
<property name="title">Name</property> <property name="title">Name</property>

View File

@@ -1,204 +0,0 @@
#include "demo2layout.h"
#include "four_point_transform.h"
struct _Demo2Layout
{
GtkLayoutManager parent_instance;
float position;
float offset;
};
struct _Demo2LayoutClass
{
GtkLayoutManagerClass parent_class;
};
G_DEFINE_TYPE (Demo2Layout, demo2_layout, GTK_TYPE_LAYOUT_MANAGER)
static void
demo2_layout_measure (GtkLayoutManager *layout_manager,
GtkWidget *widget,
GtkOrientation orientation,
int for_size,
int *minimum,
int *natural,
int *minimum_baseline,
int *natural_baseline)
{
GtkWidget *child;
int minimum_size = 0;
int natural_size = 0;
for (child = gtk_widget_get_first_child (widget);
child != NULL;
child = gtk_widget_get_next_sibling (child))
{
int child_min = 0, child_nat = 0;
if (!gtk_widget_should_layout (child))
continue;
gtk_widget_measure (child, orientation, -1,
&child_min, &child_nat,
NULL, NULL);
minimum_size = MAX (minimum_size, child_min);
natural_size = MAX (natural_size, child_nat);
}
*minimum = minimum_size;
*natural = 3 * natural_size;
}
#define RADIANS(angle) ((angle)*M_PI/180.0);
/* Spherical coordinates */
#define SX(r,t,p) ((r) * sin (t) * cos (p))
#define SZ(r,t,p) ((r) * sin (t) * sin (p))
#define SY(r,t,p) ((r) * cos (t))
static double
map_offset (double x)
{
x = fmod (x, 180.0);
if (x < 0.0)
x += 180.0;
return x;
}
static void
demo2_layout_allocate (GtkLayoutManager *layout_manager,
GtkWidget *widget,
int width,
int height,
int baseline)
{
GtkWidget *child;
GtkRequisition child_req;
int i, j, k;
float x0, y0;
float w, h;
graphene_point3d_t p1, p2, p3, p4;
graphene_point3d_t q1, q2, q3, q4;
double t_1, t_2, p_1, p_2;
double r;
graphene_matrix_t m;
GskTransform *transform;
double position = DEMO2_LAYOUT (layout_manager)->position;
double offset = DEMO2_LAYOUT (layout_manager)->offset;
/* for simplicity, assume all children are the same size */
gtk_widget_get_preferred_size (gtk_widget_get_first_child (widget), &child_req, NULL);
w = child_req.width;
h = child_req.height;
r = 300;
x0 = y0 = 300;
for (child = gtk_widget_get_first_child (widget), i = 0;
child != NULL;
child = gtk_widget_get_next_sibling (child), i++)
{
j = i / 36;
k = i % 36;
gtk_widget_set_child_visible (child, FALSE);
graphene_point3d_init (&p1, w, h, 1.);
graphene_point3d_init (&p2, w, 0., 1.);
graphene_point3d_init (&p3, 0., 0., 1.);
graphene_point3d_init (&p4, 0., h, 1.);
t_1 = RADIANS (map_offset (offset + 10 * j));
t_2 = RADIANS (map_offset (offset + 10 * (j + 1)));
p_1 = RADIANS (position + 10 * k);
p_2 = RADIANS (position + 10 * (k + 1));
if (t_2 < t_1)
continue;
if (SZ (r, t_1, p_1) > 0 ||
SZ (r, t_2, p_1) > 0 ||
SZ (r, t_1, p_2) > 0 ||
SZ (r, t_2, p_2) > 0)
continue;
gtk_widget_set_child_visible (child, TRUE);
graphene_point3d_init (&q1, x0 + SX (r, t_1, p_1), y0 + SY (r, t_1, p_1), SZ (r, t_1, p_1));
graphene_point3d_init (&q2, x0 + SX (r, t_2, p_1), y0 + SY (r, t_2, p_1), SZ (r, t_2, p_1));
graphene_point3d_init (&q3, x0 + SX (r, t_2, p_2), y0 + SY (r, t_2, p_2), SZ (r, t_2, p_2));
graphene_point3d_init (&q4, x0 + SX (r, t_1, p_2), y0 + SY (r, t_1, p_2), SZ (r, t_1, p_2));
/* Get a matrix that moves p1 -> q1, p2 -> q2, ... */
perspective_3d (&p1, &p2, &p3, &p4,
&q1, &q2, &q3, &q4,
&m);
transform = gsk_transform_matrix (NULL, &m);
/* Since our matrix was built for transforming points with z = 1,
* prepend a translation to the z = 1 plane.
*/
transform = gsk_transform_translate_3d (transform,
&GRAPHENE_POINT3D_INIT (0, 0, 1));
gtk_widget_allocate (child, w, h, -1, transform);
}
}
static GtkSizeRequestMode
demo2_layout_get_request_mode (GtkLayoutManager *layout_manager,
GtkWidget *widget)
{
return GTK_SIZE_REQUEST_CONSTANT_SIZE;
}
static void
demo2_layout_class_init (Demo2LayoutClass *klass)
{
GtkLayoutManagerClass *layout_class = GTK_LAYOUT_MANAGER_CLASS (klass);
layout_class->get_request_mode = demo2_layout_get_request_mode;
layout_class->measure = demo2_layout_measure;
layout_class->allocate = demo2_layout_allocate;
}
static void
demo2_layout_init (Demo2Layout *self)
{
}
GtkLayoutManager *
demo2_layout_new (void)
{
return g_object_new (DEMO2_TYPE_LAYOUT, NULL);
}
void
demo2_layout_set_position (Demo2Layout *layout,
float position)
{
layout->position = position;
}
float
demo2_layout_get_position (Demo2Layout *layout)
{
return layout->position;
}
void
demo2_layout_set_offset (Demo2Layout *layout,
float offset)
{
layout->offset = offset;
}
float
demo2_layout_get_offset (Demo2Layout *layout)
{
return layout->offset;
}

View File

@@ -1,16 +0,0 @@
#pragma once
#include <gtk/gtk.h>
#define DEMO2_TYPE_LAYOUT (demo2_layout_get_type ())
G_DECLARE_FINAL_TYPE (Demo2Layout, demo2_layout, DEMO2, LAYOUT, GtkLayoutManager)
GtkLayoutManager * demo2_layout_new (void);
void demo2_layout_set_position (Demo2Layout *layout,
float position);
float demo2_layout_get_position (Demo2Layout *layout);
void demo2_layout_set_offset (Demo2Layout *layout,
float offset);
float demo2_layout_get_offset (Demo2Layout *layout);

View File

@@ -1,172 +0,0 @@
#include "demo2widget.h"
#include "demo2layout.h"
struct _Demo2Widget
{
GtkWidget parent_instance;
gint64 start_time;
gint64 end_time;
float start_position;
float end_position;
float start_offset;
float end_offset;
gboolean animating;
};
struct _Demo2WidgetClass
{
GtkWidgetClass parent_class;
};
G_DEFINE_TYPE (Demo2Widget, demo2_widget, GTK_TYPE_WIDGET)
static void
demo2_widget_init (Demo2Widget *self)
{
gtk_widget_set_focusable (GTK_WIDGET (self), TRUE);
}
static void
demo2_widget_dispose (GObject *object)
{
GtkWidget *child;
while ((child = gtk_widget_get_first_child (GTK_WIDGET (object))))
gtk_widget_unparent (child);
G_OBJECT_CLASS (demo2_widget_parent_class)->dispose (object);
}
/* From clutter-easing.c, based on Robert Penner's
* infamous easing equations, MIT license.
*/
static double
ease_out_cubic (double t)
{
double p = t - 1;
return p * p * p + 1;
}
static gboolean
update_position (GtkWidget *widget,
GdkFrameClock *clock,
gpointer data)
{
Demo2Widget *self = DEMO2_WIDGET (widget);
Demo2Layout *layout = DEMO2_LAYOUT (gtk_widget_get_layout_manager (widget));
gint64 now;
double t;
now = gdk_frame_clock_get_frame_time (clock);
if (now >= self->end_time)
{
self->animating = FALSE;
return G_SOURCE_REMOVE;
}
t = (now - self->start_time) / (double) (self->end_time - self->start_time);
t = ease_out_cubic (t);
demo2_layout_set_position (layout, self->start_position + t * (self->end_position - self->start_position));
demo2_layout_set_offset (layout, self->start_offset + t * (self->end_offset - self->start_offset));
gtk_widget_queue_allocate (widget);
return G_SOURCE_CONTINUE;
}
static void
rotate_sphere (GtkWidget *widget,
const char *action,
GVariant *parameters)
{
Demo2Widget *self = DEMO2_WIDGET (widget);
Demo2Layout *layout = DEMO2_LAYOUT (gtk_widget_get_layout_manager (widget));
GtkOrientation orientation;
int direction;
g_variant_get (parameters, "(ii)", &orientation, &direction);
self->end_position = self->start_position = demo2_layout_get_position (layout);
self->end_offset = self->start_offset = demo2_layout_get_offset (layout);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
self->end_position += 10 * direction;
else
self->end_offset += 10 * direction;
self->start_time = g_get_monotonic_time ();
self->end_time = self->start_time + 0.5 * G_TIME_SPAN_SECOND;
if (!self->animating)
{
gtk_widget_add_tick_callback (widget, update_position, NULL, NULL);
self->animating = TRUE;
}
}
static void
demo2_widget_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot)
{
GtkWidget *child;
for (child = gtk_widget_get_first_child (widget);
child != NULL;
child = gtk_widget_get_next_sibling (child))
{
/* our layout manager sets this for children that are out of view */
if (!gtk_widget_get_child_visible (child))
continue;
gtk_widget_snapshot_child (widget, child, snapshot);
}
}
static void
demo2_widget_class_init (Demo2WidgetClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
object_class->dispose = demo2_widget_dispose;
widget_class->snapshot = demo2_widget_snapshot;
gtk_widget_class_install_action (widget_class, "rotate", "(ii)", rotate_sphere);
gtk_widget_class_add_binding_action (widget_class,
GDK_KEY_Left, 0,
"rotate",
"(ii)", GTK_ORIENTATION_HORIZONTAL, -1);
gtk_widget_class_add_binding_action (widget_class,
GDK_KEY_Right, 0,
"rotate",
"(ii)", GTK_ORIENTATION_HORIZONTAL, 1);
gtk_widget_class_add_binding_action (widget_class,
GDK_KEY_Up, 0,
"rotate",
"(ii)", GTK_ORIENTATION_VERTICAL, 1);
gtk_widget_class_add_binding_action (widget_class,
GDK_KEY_Down, 0,
"rotate",
"(ii)", GTK_ORIENTATION_VERTICAL, -1);
/* here is where we use our custom layout manager */
gtk_widget_class_set_layout_manager_type (widget_class, DEMO2_TYPE_LAYOUT);
}
GtkWidget *
demo2_widget_new (void)
{
return g_object_new (DEMO2_TYPE_WIDGET, NULL);
}
void
demo2_widget_add_child (Demo2Widget *self,
GtkWidget *child)
{
gtk_widget_set_parent (child, GTK_WIDGET (self));
}

View File

@@ -1,11 +0,0 @@
#pragma once
#include <gtk/gtk.h>
#define DEMO2_TYPE_WIDGET (demo2_widget_get_type ())
G_DECLARE_FINAL_TYPE (Demo2Widget, demo2_widget, DEMO2, WIDGET, GtkWidget)
GtkWidget * demo2_widget_new (void);
void demo2_widget_add_child (Demo2Widget *self,
GtkWidget *child);

View File

@@ -1,72 +0,0 @@
#include "demochild.h"
/* This is a trivial child widget just for demo purposes.
* It draws a 32x32 square in fixed color.
*/
struct _DemoChild
{
GtkWidget parent_instance;
GdkRGBA color;
};
struct _DemoChildClass
{
GtkWidgetClass parent_class;
};
G_DEFINE_TYPE (DemoChild, demo_child, GTK_TYPE_WIDGET)
static void
demo_child_init (DemoChild *self)
{
}
static void
demo_child_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot)
{
DemoChild *self = DEMO_CHILD (widget);
int width, height;
width = gtk_widget_get_width (widget);
height = gtk_widget_get_height (widget);
gtk_snapshot_append_color (snapshot, &self->color,
&GRAPHENE_RECT_INIT(0, 0, width, height));
}
static void
demo_child_measure (GtkWidget *widget,
GtkOrientation orientation,
int for_size,
int *minimum,
int *natural,
int *minimum_baseline,
int *natural_baseline)
{
*minimum = *natural = 32;
}
static void
demo_child_class_init (DemoChildClass *class)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
widget_class->snapshot = demo_child_snapshot;
widget_class->measure = demo_child_measure;
}
GtkWidget *
demo_child_new (const char *color)
{
DemoChild *self;
self = g_object_new (DEMO_TYPE_CHILD,
"tooltip-text", color,
NULL);
gdk_rgba_parse (&self->color, color);
return GTK_WIDGET (self);
}

View File

@@ -1,8 +0,0 @@
#pragma once
#include <gtk/gtk.h>
#define DEMO_TYPE_CHILD (demo_child_get_type ())
G_DECLARE_FINAL_TYPE (DemoChild, demo_child, DEMO, CHILD, GtkWidget)
GtkWidget * demo_child_new (const char *color);

View File

@@ -17,7 +17,7 @@ G_DEFINE_TYPE(DemoImage, demo_image, GTK_TYPE_WIDGET)
static GdkPaintable * static GdkPaintable *
get_image_paintable (GtkImage *image) get_image_paintable (GtkImage *image)
{ {
const char *icon_name; const gchar *icon_name;
GtkIconTheme *icon_theme; GtkIconTheme *icon_theme;
GtkIconPaintable *icon; GtkIconPaintable *icon;

View File

@@ -1,189 +0,0 @@
#include "demolayout.h"
struct _DemoLayout
{
GtkLayoutManager parent_instance;
float position;
int pos[16];
};
struct _DemoLayoutClass
{
GtkLayoutManagerClass parent_class;
};
G_DEFINE_TYPE (DemoLayout, demo_layout, GTK_TYPE_LAYOUT_MANAGER)
static void
demo_layout_measure (GtkLayoutManager *layout_manager,
GtkWidget *widget,
GtkOrientation orientation,
int for_size,
int *minimum,
int *natural,
int *minimum_baseline,
int *natural_baseline)
{
GtkWidget *child;
int minimum_size = 0;
int natural_size = 0;
for (child = gtk_widget_get_first_child (widget);
child != NULL;
child = gtk_widget_get_next_sibling (child))
{
int child_min = 0, child_nat = 0;
if (!gtk_widget_should_layout (child))
continue;
gtk_widget_measure (child, orientation, -1,
&child_min, &child_nat,
NULL, NULL);
minimum_size = MAX (minimum_size, child_min);
natural_size = MAX (natural_size, child_nat);
}
/* A back-of-a-napkin calculation to reserve enough
* space for arranging 16 children in a circle.
*/
*minimum = 16 * minimum_size / G_PI + minimum_size;
*natural = 16 * natural_size / G_PI + natural_size;
}
static void
demo_layout_allocate (GtkLayoutManager *layout_manager,
GtkWidget *widget,
int width,
int height,
int baseline)
{
DemoLayout *self = DEMO_LAYOUT (layout_manager);
GtkWidget *child;
int i;
int child_width = 0;
int child_height = 0;
int x0, y0;
float r;
float t;
t = self->position;
for (child = gtk_widget_get_first_child (widget);
child != NULL;
child = gtk_widget_get_next_sibling (child))
{
GtkRequisition child_req;
if (!gtk_widget_should_layout (child))
continue;
gtk_widget_get_preferred_size (child, &child_req, NULL);
child_width = MAX (child_width, child_req.width);
child_height = MAX (child_height, child_req.height);
}
/* the center of our layout */
x0 = (width / 2);
y0 = (height / 2);
/* the radius for our circle of children */
r = 8 * child_width / G_PI;
for (child = gtk_widget_get_first_child (widget), i = 0;
child != NULL;
child = gtk_widget_get_next_sibling (child), i++)
{
GtkRequisition child_req;
float a = self->pos[i] * G_PI / 8;
int gx, gy;
int cx, cy;
int x, y;
if (!gtk_widget_should_layout (child))
continue;
gtk_widget_get_preferred_size (child, &child_req, NULL);
/* The grid position of child. */
gx = x0 + (i % 4 - 2) * child_width;
gy = y0 + (i / 4 - 2) * child_height;
/* The circle position of child. Note that we
* are adjusting the position by half the child size
* to place the center of child on a centered circle.
* This assumes that the children don't use align flags
* or uneven margins that would shift the center.
*/
cx = x0 + sin (a) * r - child_req.width / 2;
cy = y0 + cos (a) * r - child_req.height / 2;
/* we interpolate between the two layouts according to
* the position value that has been set on the layout.
*/
x = t * cx + (1 - t) * gx;
y = t * cy + (1 - t) * gy;
gtk_widget_size_allocate (child,
&(const GtkAllocation){ x, y, child_width, child_height},
-1);
}
}
static GtkSizeRequestMode
demo_layout_get_request_mode (GtkLayoutManager *layout_manager,
GtkWidget *widget)
{
return GTK_SIZE_REQUEST_CONSTANT_SIZE;
}
static void
demo_layout_class_init (DemoLayoutClass *klass)
{
GtkLayoutManagerClass *layout_class = GTK_LAYOUT_MANAGER_CLASS (klass);
layout_class->get_request_mode = demo_layout_get_request_mode;
layout_class->measure = demo_layout_measure;
layout_class->allocate = demo_layout_allocate;
}
static void
demo_layout_init (DemoLayout *self)
{
int i;
for (i = 0; i < 16; i++)
self->pos[i] = i;
}
GtkLayoutManager *
demo_layout_new (void)
{
return g_object_new (DEMO_TYPE_LAYOUT, NULL);
}
void
demo_layout_set_position (DemoLayout *layout,
float position)
{
layout->position = position;
}
/* Shuffle the circle positions of the children.
* Should be called when we are in the grid layout.
*/
void
demo_layout_shuffle (DemoLayout *layout)
{
int i, j, tmp;
for (i = 0; i < 16; i++)
{
j = g_random_int_range (0, i + 1);
tmp = layout->pos[i];
layout->pos[i] = layout->pos[j];
layout->pos[j] = tmp;
}
}

View File

@@ -1,13 +0,0 @@
#pragma once
#include <gtk/gtk.h>
#define DEMO_TYPE_LAYOUT (demo_layout_get_type ())
G_DECLARE_FINAL_TYPE (DemoLayout, demo_layout, DEMO, LAYOUT, GtkLayoutManager)
GtkLayoutManager * demo_layout_new (void);
void demo_layout_set_position (DemoLayout *layout,
float position);
void demo_layout_shuffle (DemoLayout *layout);

View File

@@ -23,12 +23,14 @@
#include "demotaggedentry.h" #include "demotaggedentry.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gtk/gtk-a11y.h>
struct _DemoTaggedEntry struct _DemoTaggedEntry
{ {
GtkWidget parent_instance; GtkWidget parent_instance;
GtkWidget *text; GtkWidget *box;
GtkWidget *entry;
}; };
struct _DemoTaggedEntryClass struct _DemoTaggedEntryClass
@@ -44,10 +46,15 @@ G_DEFINE_TYPE_WITH_CODE (DemoTaggedEntry, demo_tagged_entry, GTK_TYPE_WIDGET,
static void static void
demo_tagged_entry_init (DemoTaggedEntry *entry) demo_tagged_entry_init (DemoTaggedEntry *entry)
{ {
entry->text = gtk_text_new (); entry->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_set_hexpand (entry->text, TRUE); gtk_widget_set_parent (entry->box, GTK_WIDGET (entry));
gtk_widget_set_vexpand (entry->text, TRUE);
gtk_widget_set_parent (entry->text, GTK_WIDGET (entry)); entry->entry = gtk_text_new ();
gtk_widget_set_hexpand (entry->entry, TRUE);
gtk_widget_set_vexpand (entry->entry, TRUE);
gtk_widget_set_hexpand (entry->box, FALSE);
gtk_widget_set_vexpand (entry->box, FALSE);
gtk_box_append (GTK_BOX (entry->box), entry->entry);
gtk_editable_init_delegate (GTK_EDITABLE (entry)); gtk_editable_init_delegate (GTK_EDITABLE (entry));
} }
@@ -55,15 +62,12 @@ static void
demo_tagged_entry_dispose (GObject *object) demo_tagged_entry_dispose (GObject *object)
{ {
DemoTaggedEntry *entry = DEMO_TAGGED_ENTRY (object); DemoTaggedEntry *entry = DEMO_TAGGED_ENTRY (object);
GtkWidget *child;
if (entry->text) if (entry->entry)
gtk_editable_finish_delegate (GTK_EDITABLE (entry)); gtk_editable_finish_delegate (GTK_EDITABLE (entry));
while ((child = gtk_widget_get_first_child (GTK_WIDGET (entry)))) g_clear_pointer (&entry->entry, gtk_widget_unparent);
gtk_widget_unparent (child); g_clear_pointer (&entry->box, gtk_widget_unparent);
entry->text = NULL;
G_OBJECT_CLASS (demo_tagged_entry_parent_class)->dispose (object); G_OBJECT_CLASS (demo_tagged_entry_parent_class)->dispose (object);
} }
@@ -97,7 +101,7 @@ demo_tagged_entry_grab_focus (GtkWidget *widget)
{ {
DemoTaggedEntry *entry = DEMO_TAGGED_ENTRY (widget); DemoTaggedEntry *entry = DEMO_TAGGED_ENTRY (widget);
return gtk_widget_grab_focus (entry->text); return gtk_widget_grab_focus (entry->entry);
} }
static void static void
@@ -114,14 +118,15 @@ demo_tagged_entry_class_init (DemoTaggedEntryClass *klass)
gtk_editable_install_properties (object_class, 1); gtk_editable_install_properties (object_class, 1);
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BOX_LAYOUT); gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_ENTRY_ACCESSIBLE);
gtk_widget_class_set_css_name (widget_class, "entry"); gtk_widget_class_set_css_name (widget_class, "entry");
} }
static GtkEditable * static GtkEditable *
demo_tagged_entry_get_delegate (GtkEditable *editable) demo_tagged_entry_get_delegate (GtkEditable *editable)
{ {
return GTK_EDITABLE (DEMO_TAGGED_ENTRY (editable)->text); return GTK_EDITABLE (DEMO_TAGGED_ENTRY (editable)->entry);
} }
static void static void
@@ -142,7 +147,7 @@ demo_tagged_entry_add_tag (DemoTaggedEntry *entry,
{ {
g_return_if_fail (DEMO_IS_TAGGED_ENTRY (entry)); g_return_if_fail (DEMO_IS_TAGGED_ENTRY (entry));
gtk_widget_set_parent (tag, GTK_WIDGET (entry)); gtk_box_append (GTK_BOX (entry->box), tag);
} }
void void
@@ -152,7 +157,10 @@ demo_tagged_entry_insert_tag_after (DemoTaggedEntry *entry,
{ {
g_return_if_fail (DEMO_IS_TAGGED_ENTRY (entry)); g_return_if_fail (DEMO_IS_TAGGED_ENTRY (entry));
gtk_widget_insert_after (tag, GTK_WIDGET (entry), sibling); if (sibling == NULL)
gtk_box_append (GTK_BOX (entry->box), tag);
else
gtk_box_insert_child_after (GTK_BOX (entry->box), tag, sibling);
} }
void void
@@ -161,7 +169,7 @@ demo_tagged_entry_remove_tag (DemoTaggedEntry *entry,
{ {
g_return_if_fail (DEMO_IS_TAGGED_ENTRY (entry)); g_return_if_fail (DEMO_IS_TAGGED_ENTRY (entry));
gtk_widget_unparent (tag); gtk_box_remove (GTK_BOX (entry->box), tag);
} }
struct _DemoTaggedEntryTag struct _DemoTaggedEntryTag

View File

@@ -1,121 +0,0 @@
#include "demowidget.h"
#include "demolayout.h"
/* parent widget */
struct _DemoWidget
{
GtkWidget parent_instance;
gboolean backward; /* whether we go 0 -> 1 or 1 -> 0 */
gint64 start_time; /* time the transition started */
guint tick_id; /* our tick cb */
};
struct _DemoWidgetClass
{
GtkWidgetClass parent_class;
};
G_DEFINE_TYPE (DemoWidget, demo_widget, GTK_TYPE_WIDGET)
/* The widget is controlling the transition by calling
* demo_layout_set_position() in a tick callback.
*
* We take half a second to go from one layout to the other.
*/
#define DURATION (0.5 * G_TIME_SPAN_SECOND)
static gboolean
transition (GtkWidget *widget,
GdkFrameClock *frame_clock,
gpointer data)
{
DemoWidget *self = DEMO_WIDGET (widget);
DemoLayout *demo_layout = DEMO_LAYOUT (gtk_widget_get_layout_manager (widget));
gint64 now = g_get_monotonic_time ();
gtk_widget_queue_allocate (widget);
if (self->backward)
demo_layout_set_position (demo_layout, 1.0 - (now - self->start_time) / DURATION);
else
demo_layout_set_position (demo_layout, (now - self->start_time) / DURATION);
if (now - self->start_time >= DURATION)
{
self->backward = !self->backward;
demo_layout_set_position (demo_layout, self->backward ? 1.0 : 0.0);
/* keep things interesting by shuffling the positions */
if (!self->backward)
demo_layout_shuffle (demo_layout);
self->tick_id = 0;
return G_SOURCE_REMOVE;
}
return G_SOURCE_CONTINUE;
}
static void
clicked (GtkGestureClick *gesture,
guint n_press,
double x,
double y,
gpointer data)
{
DemoWidget *self = data;
if (self->tick_id != 0)
return;
self->start_time = g_get_monotonic_time ();
self->tick_id = gtk_widget_add_tick_callback (GTK_WIDGET (self), transition, NULL, NULL);
}
static void
demo_widget_init (DemoWidget *self)
{
GtkGesture *gesture;
gesture = gtk_gesture_click_new ();
g_signal_connect (gesture, "pressed", G_CALLBACK (clicked), self);
gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (gesture));
}
static void
demo_widget_dispose (GObject *object)
{
GtkWidget *child;
while ((child = gtk_widget_get_first_child (GTK_WIDGET (object))))
gtk_widget_unparent (child);
G_OBJECT_CLASS (demo_widget_parent_class)->dispose (object);
}
static void
demo_widget_class_init (DemoWidgetClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
object_class->dispose = demo_widget_dispose;
/* here is where we use our custom layout manager */
gtk_widget_class_set_layout_manager_type (widget_class, DEMO_TYPE_LAYOUT);
}
GtkWidget *
demo_widget_new (void)
{
return g_object_new (DEMO_TYPE_WIDGET, NULL);
}
void
demo_widget_add_child (DemoWidget *self,
GtkWidget *child)
{
gtk_widget_set_parent (child, GTK_WIDGET (self));
}

View File

@@ -1,11 +0,0 @@
#pragma once
#include <gtk/gtk.h>
#define DEMO_TYPE_WIDGET (demo_widget_get_type ())
G_DECLARE_FINAL_TYPE (DemoWidget, demo_widget, DEMO, WIDGET, GtkWidget)
GtkWidget * demo_widget_new (void);
void demo_widget_add_child (DemoWidget *self,
GtkWidget *child);

View File

@@ -16,7 +16,7 @@ message_dialog_clicked (GtkButton *button,
gpointer user_data) gpointer user_data)
{ {
GtkWidget *dialog; GtkWidget *dialog;
static int i = 1; static gint i = 1;
dialog = gtk_message_dialog_new (GTK_WINDOW (window), dialog = gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,

View File

@@ -153,30 +153,6 @@ click_done (GtkGesture *gesture)
gtk_widget_insert_after (item, canvas, last_child); gtk_widget_insert_after (item, canvas, last_child);
} }
static gboolean
theme_is_dark (void)
{
GtkSettings *settings;
char *theme;
gboolean prefer_dark;
gboolean dark;
settings = gtk_settings_get_default ();
g_object_get (settings,
"gtk-theme-name", &theme,
"gtk-application-prefer-dark-theme", &prefer_dark,
NULL);
if ((strcmp (theme, "Adwaita") == 0 && prefer_dark) || strcmp (theme, "HighContrastInverse") == 0)
dark = TRUE;
else
dark = FALSE;
g_free (theme);
return dark;
}
static void static void
canvas_item_init (CanvasItem *item) canvas_item_init (CanvasItem *item)
{ {
@@ -204,11 +180,7 @@ canvas_item_init (CanvasItem *item)
gtk_widget_set_name (item->label, id); gtk_widget_set_name (item->label, id);
g_free (id); g_free (id);
if (theme_is_dark ())
gdk_rgba_parse (&rgba, "blue");
else
gdk_rgba_parse (&rgba, "yellow"); gdk_rgba_parse (&rgba, "yellow");
set_color (item, &rgba); set_color (item, &rgba);
item->angle = 0; item->angle = 0;
@@ -566,6 +538,7 @@ canvas_new (void)
canvas = gtk_fixed_new (); canvas = gtk_fixed_new ();
gtk_widget_set_hexpand (canvas, TRUE); gtk_widget_set_hexpand (canvas, TRUE);
gtk_widget_set_vexpand (canvas, TRUE); gtk_widget_set_vexpand (canvas, TRUE);
gtk_widget_add_css_class (canvas, "frame");
source = gtk_drag_source_new (); source = gtk_drag_source_new ();
gtk_drag_source_set_actions (source, GDK_ACTION_MOVE); gtk_drag_source_set_actions (source, GDK_ACTION_MOVE);
@@ -624,83 +597,6 @@ css_button_new (const char *class)
return button; return button;
} }
typedef struct
{
GtkWidget parent_instance;
GdkRGBA color;
} ColorSwatch;
typedef struct
{
GtkWidgetClass parent_class;
} ColorSwatchClass;
G_DEFINE_TYPE (ColorSwatch, color_swatch, GTK_TYPE_WIDGET)
static GdkContentProvider *
color_swatch_drag_prepare (GtkDragSource *source,
double x,
double y,
ColorSwatch *swatch)
{
return gdk_content_provider_new_typed (GDK_TYPE_RGBA, &swatch->color);
}
static void
color_swatch_init (ColorSwatch *swatch)
{
GtkDragSource *source = gtk_drag_source_new ();
g_signal_connect (source, "prepare", G_CALLBACK (color_swatch_drag_prepare), swatch);
gtk_widget_add_controller (GTK_WIDGET (swatch), GTK_EVENT_CONTROLLER (source));
}
static void
color_swatch_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot)
{
ColorSwatch *swatch = (ColorSwatch *)widget;
float w = gtk_widget_get_width (widget);
float h = gtk_widget_get_height (widget);
gtk_snapshot_append_color (snapshot, &swatch->color,
&GRAPHENE_RECT_INIT(0, 0, w, h));
}
void
color_swatch_measure (GtkWidget *widget,
GtkOrientation orientation,
int for_size,
int *minimum_size,
int *natural_size,
int *minimum_baseline,
int *natural_baseline)
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
*minimum_size = *natural_size = 48;
else
*minimum_size = *natural_size = 32;
}
static void
color_swatch_class_init (ColorSwatchClass *class)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
widget_class->snapshot = color_swatch_snapshot;
widget_class->measure = color_swatch_measure;
gtk_widget_class_set_css_name (widget_class, "colorswatch");
}
static GtkWidget *
color_swatch_new (const char *color)
{
ColorSwatch *swatch = g_object_new (color_swatch_get_type (), NULL);
gdk_rgba_parse (&swatch->color, color);
return GTK_WIDGET (swatch);
}
static GtkWidget *window = NULL; static GtkWidget *window = NULL;
GtkWidget * GtkWidget *
@@ -763,8 +659,6 @@ do_dnd (GtkWidget *do_widget)
y += 100; y += 100;
} }
gtk_box_append (GTK_BOX (box), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL));
sw = gtk_scrolled_window_new (); sw = gtk_scrolled_window_new ();
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC,
@@ -776,7 +670,18 @@ do_dnd (GtkWidget *do_widget)
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), box3); gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), box3);
for (i = 0; colors[i]; i++) for (i = 0; colors[i]; i++)
gtk_box_append (GTK_BOX (box3), color_swatch_new (colors[i])); {
GdkRGBA rgba;
GtkWidget *swatch;
gdk_rgba_parse (&rgba, colors[i]);
swatch = g_object_new (g_type_from_name ("GtkColorSwatch"),
"rgba", &rgba,
"selectable", FALSE,
NULL);
gtk_box_append (GTK_BOX (box3), swatch);
}
gtk_box_append (GTK_BOX (box3), css_button_new ("rainbow1")); gtk_box_append (GTK_BOX (box3), css_button_new ("rainbow1"));
gtk_box_append (GTK_BOX (box3), css_button_new ("rainbow2")); gtk_box_append (GTK_BOX (box3), css_button_new ("rainbow2"));

View File

@@ -64,8 +64,8 @@ scribble_draw (GtkDrawingArea *da,
/* Draw a rectangle on the screen */ /* Draw a rectangle on the screen */
static void static void
draw_brush (GtkWidget *widget, draw_brush (GtkWidget *widget,
double x, gdouble x,
double y) gdouble y)
{ {
GdkRectangle update_rect; GdkRectangle update_rect;
cairo_t *cr; cairo_t *cr;

View File

@@ -92,7 +92,7 @@ strings_setup_item_full (GtkSignalListItemFactory *factory,
gtk_label_set_xalign (GTK_LABEL (title), 0.0); gtk_label_set_xalign (GTK_LABEL (title), 0.0);
description = gtk_label_new (""); description = gtk_label_new ("");
gtk_label_set_xalign (GTK_LABEL (description), 0.0); gtk_label_set_xalign (GTK_LABEL (description), 0.0);
gtk_widget_add_css_class (description, "dim-label"); gtk_style_context_add_class (gtk_widget_get_style_context (description), "dim-label");
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
@@ -254,7 +254,7 @@ do_dropdown (GtkWidget *do_widget)
gtk_widget_set_margin_bottom (box, 10); gtk_widget_set_margin_bottom (box, 10);
gtk_window_set_child (GTK_WINDOW (window), box); gtk_window_set_child (GTK_WINDOW (window), box);
button = gtk_drop_down_new (NULL, NULL); button = gtk_drop_down_new ();
model = G_LIST_MODEL (pango_cairo_font_map_get_default ()); model = G_LIST_MODEL (pango_cairo_font_map_get_default ());
gtk_drop_down_set_model (GTK_DROP_DOWN (button), model); gtk_drop_down_set_model (GTK_DROP_DOWN (button), model);

View File

@@ -16,9 +16,9 @@
typedef struct typedef struct
{ {
int number; gint number;
char *product; gchar *product;
int yummy; gint yummy;
} }
Item; Item;
@@ -74,7 +74,7 @@ add_items (void)
static GtkTreeModel * static GtkTreeModel *
create_items_model (void) create_items_model (void)
{ {
int i = 0; gint i = 0;
GtkListStore *model; GtkListStore *model;
GtkTreeIter iter; GtkTreeIter iter;
@@ -109,7 +109,7 @@ static GtkTreeModel *
create_numbers_model (void) create_numbers_model (void)
{ {
#define N_NUMBERS 10 #define N_NUMBERS 10
int i = 0; gint i = 0;
GtkListStore *model; GtkListStore *model;
GtkTreeIter iter; GtkTreeIter iter;
@@ -192,7 +192,7 @@ remove_item (GtkWidget *widget, gpointer data)
if (gtk_tree_selection_get_selected (selection, NULL, &iter)) if (gtk_tree_selection_get_selected (selection, NULL, &iter))
{ {
int i; gint i;
GtkTreePath *path; GtkTreePath *path;
path = gtk_tree_model_get_path (model, &iter); path = gtk_tree_model_get_path (model, &iter);
@@ -211,7 +211,7 @@ separator_row (GtkTreeModel *model,
gpointer data) gpointer data)
{ {
GtkTreePath *path; GtkTreePath *path;
int idx; gint idx;
path = gtk_tree_model_get_path (model, iter); path = gtk_tree_model_get_path (model, iter);
idx = gtk_tree_path_get_indices (path)[0]; idx = gtk_tree_path_get_indices (path)[0];
@@ -224,7 +224,7 @@ separator_row (GtkTreeModel *model,
static void static void
editing_started (GtkCellRenderer *cell, editing_started (GtkCellRenderer *cell,
GtkCellEditable *editable, GtkCellEditable *editable,
const char *path, const gchar *path,
gpointer data) gpointer data)
{ {
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (editable), gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (editable),
@@ -233,15 +233,15 @@ editing_started (GtkCellRenderer *cell,
static void static void
cell_edited (GtkCellRendererText *cell, cell_edited (GtkCellRendererText *cell,
const char *path_string, const gchar *path_string,
const char *new_text, const gchar *new_text,
gpointer data) gpointer data)
{ {
GtkTreeModel *model = (GtkTreeModel *)data; GtkTreeModel *model = (GtkTreeModel *)data;
GtkTreePath *path = gtk_tree_path_new_from_string (path_string); GtkTreePath *path = gtk_tree_path_new_from_string (path_string);
GtkTreeIter iter; GtkTreeIter iter;
int column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), "column")); gint column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), "column"));
gtk_tree_model_get_iter (model, &iter, path); gtk_tree_model_get_iter (model, &iter, path);
@@ -249,7 +249,7 @@ cell_edited (GtkCellRendererText *cell,
{ {
case COLUMN_ITEM_NUMBER: case COLUMN_ITEM_NUMBER:
{ {
int i; gint i;
i = gtk_tree_path_get_indices (path)[0]; i = gtk_tree_path_get_indices (path)[0];
g_array_index (articles, Item, i).number = atoi (new_text); g_array_index (articles, Item, i).number = atoi (new_text);
@@ -261,8 +261,8 @@ cell_edited (GtkCellRendererText *cell,
case COLUMN_ITEM_PRODUCT: case COLUMN_ITEM_PRODUCT:
{ {
int i; gint i;
char *old_text; gchar *old_text;
gtk_tree_model_get (model, &iter, column, &old_text, -1); gtk_tree_model_get (model, &iter, column, &old_text, -1);
g_free (old_text); g_free (old_text);

View File

@@ -13,7 +13,7 @@
static GtkWidget *window = NULL; static GtkWidget *window = NULL;
static void static void
response_cb (GtkDialog *dialog, int response_id) response_cb (GtkDialog *dialog, gint response_id)
{ {
gtk_window_destroy (GTK_WINDOW (window)); gtk_window_destroy (GTK_WINDOW (window));
window = NULL; window = NULL;
@@ -35,10 +35,6 @@ do_expander (GtkWidget *do_widget)
GtkWidget *sw; GtkWidget *sw;
GtkWidget *tv; GtkWidget *tv;
GtkTextBuffer *buffer; GtkTextBuffer *buffer;
GtkTextIter start;
GtkTextIter end;
GtkTextTag *tag;
GdkPaintable *paintable;
if (!window) if (!window)
{ {
@@ -68,25 +64,12 @@ do_expander (GtkWidget *do_widget)
GTK_POLICY_NEVER, GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC); GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_propagate_natural_height (GTK_SCROLLED_WINDOW (sw), TRUE); gtk_scrolled_window_set_propagate_natural_height (GTK_SCROLLED_WINDOW (sw), TRUE);
gtk_widget_set_vexpand (sw, TRUE);
tv = gtk_text_view_new (); tv = gtk_text_view_new ();
g_object_set (tv,
"left-margin", 10,
"right-margin", 10,
"top-margin", 10,
"bottom-margin", 10,
NULL);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tv)); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tv));
gtk_text_view_set_editable (GTK_TEXT_VIEW (tv), FALSE); gtk_text_view_set_editable (GTK_TEXT_VIEW (tv), FALSE);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (tv), FALSE);
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (tv), GTK_WRAP_WORD); gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (tv), GTK_WRAP_WORD);
gtk_text_view_set_pixels_above_lines (GTK_TEXT_VIEW (tv), 2); gtk_text_buffer_set_text (GTK_TEXT_BUFFER (buffer),
gtk_text_view_set_pixels_below_lines (GTK_TEXT_VIEW (tv), 2);
gtk_text_buffer_set_text (buffer,
"Finally, the full story with all details. " "Finally, the full story with all details. "
"And all the inside information, including " "And all the inside information, including "
"error codes, etc etc. Pages of information, " "error codes, etc etc. Pages of information, "
@@ -94,22 +77,7 @@ do_expander (GtkWidget *do_widget)
"or even resize the window - it works !\n" "or even resize the window - it works !\n"
"A second paragraph will contain even more " "A second paragraph will contain even more "
"innuendo, just to make you scroll down or " "innuendo, just to make you scroll down or "
"resize the window.\n" "resize the window. Do it already !", -1);
"Do it already!\n", -1);
gtk_text_buffer_get_end_iter (buffer, &start);
paintable = GDK_PAINTABLE (gdk_texture_new_from_resource ("/cursors/images/gtk_logo_cursor.png"));
gtk_text_buffer_insert_paintable (buffer, &start, paintable);
g_object_unref (paintable);
gtk_text_iter_backward_char (&start);
gtk_text_buffer_get_end_iter (buffer, &end);
tag = gtk_text_buffer_create_tag (buffer, NULL,
"pixels-above-lines", 200,
"justification", GTK_JUSTIFY_RIGHT,
NULL);
gtk_text_buffer_apply_tag (buffer, tag, &start, &end);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tv); gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tv);
gtk_expander_set_child (GTK_EXPANDER (expander), sw); gtk_expander_set_child (GTK_EXPANDER (expander), sw);
gtk_box_append (GTK_BOX (area), expander); gtk_box_append (GTK_BOX (area), expander);

View File

@@ -22,8 +22,8 @@ format_number (GtkTreeViewColumn *col,
GtkTreeIter *iter, GtkTreeIter *iter,
gpointer data) gpointer data)
{ {
int num; gint num;
char *text; gchar *text;
gtk_tree_model_get (model, iter, GPOINTER_TO_INT (data), &num, -1); gtk_tree_model_get (model, iter, GPOINTER_TO_INT (data), &num, -1);
text = g_strdup_printf ("%d", num); text = g_strdup_printf ("%d", num);
@@ -35,11 +35,11 @@ static void
filter_modify_func (GtkTreeModel *model, filter_modify_func (GtkTreeModel *model,
GtkTreeIter *iter, GtkTreeIter *iter,
GValue *value, GValue *value,
int column, gint column,
gpointer data) gpointer data)
{ {
GtkTreeModelFilter *filter_model = GTK_TREE_MODEL_FILTER (model); GtkTreeModelFilter *filter_model = GTK_TREE_MODEL_FILTER (model);
int width, height; gint width, height;
GtkTreeModel *child_model; GtkTreeModel *child_model;
GtkTreeIter child_iter; GtkTreeIter child_iter;
@@ -75,7 +75,7 @@ visible_func (GtkTreeModel *model,
GtkTreeIter *iter, GtkTreeIter *iter,
gpointer data) gpointer data)
{ {
int width; gint width;
gtk_tree_model_get (model, iter, gtk_tree_model_get (model, iter,
WIDTH_COLUMN, &width, WIDTH_COLUMN, &width,

View File

@@ -45,9 +45,12 @@
<attributes> <attributes>
<attribute name="weight" value="bold"></attribute> <attribute name="weight" value="bold"></attribute>
</attributes> </attributes>
<accessibility>
<relation type="label-for" target="treeview1"/>
</accessibility>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">0</property> <property name="top-attach">0</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -80,9 +83,12 @@
</child> </child>
</object> </object>
</child> </child>
<accessibility>
<relation type="labelled-by" target="label1"/>
</accessibility>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -127,9 +133,12 @@
</child> </child>
</object> </object>
</child> </child>
<accessibility>
<relation type="labelled-by" target="label2"/>
</accessibility>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -140,9 +149,12 @@
<attributes> <attributes>
<attribute name="weight" value="bold"></attribute> <attribute name="weight" value="bold"></attribute>
</attributes> </attributes>
<accessibility>
<relation type="label-for" target="treeview2"/>
</accessibility>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">0</property> <property name="top-attach">0</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -153,9 +165,12 @@
<attributes> <attributes>
<attribute name="weight" value="bold"></attribute> <attribute name="weight" value="bold"></attribute>
</attributes> </attributes>
<accessibility>
<relation type="label-for" target="treeview3"/>
</accessibility>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">2</property> <property name="top-attach">2</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -182,9 +197,12 @@
</child> </child>
</object> </object>
</child> </child>
<accessibility>
<relation type="labelled-by" target="label3"/>
</accessibility>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">3</property> <property name="top-attach">3</property>
</layout> </layout>
</object> </object>
</child> </child>

View File

@@ -209,7 +209,7 @@ set_widget_type (GtkFishbowl *fishbowl,
widget_types[selected_widget_type].name); widget_types[selected_widget_type].name);
} }
G_MODULE_EXPORT void void
fishbowl_next_button_clicked_cb (GtkButton *source, fishbowl_next_button_clicked_cb (GtkButton *source,
gpointer user_data) gpointer user_data)
{ {
@@ -224,7 +224,7 @@ fishbowl_next_button_clicked_cb (GtkButton *source,
set_widget_type (fishbowl, new_index); set_widget_type (fishbowl, new_index);
} }
G_MODULE_EXPORT void void
fishbowl_prev_button_clicked_cb (GtkButton *source, fishbowl_prev_button_clicked_cb (GtkButton *source,
gpointer user_data) gpointer user_data)
{ {
@@ -239,7 +239,7 @@ fishbowl_prev_button_clicked_cb (GtkButton *source,
set_widget_type (fishbowl, new_index); set_widget_type (fishbowl, new_index);
} }
G_MODULE_EXPORT void void
fishbowl_changes_toggled_cb (GtkToggleButton *button, fishbowl_changes_toggled_cb (GtkToggleButton *button,
gpointer user_data) gpointer user_data)
{ {
@@ -249,7 +249,7 @@ fishbowl_changes_toggled_cb (GtkToggleButton *button,
gtk_button_set_icon_name (GTK_BUTTON (button), "changes-allow"); gtk_button_set_icon_name (GTK_BUTTON (button), "changes-allow");
} }
G_MODULE_EXPORT char * char *
format_header_cb (GObject *object, format_header_cb (GObject *object,
guint count, guint count,
double fps) double fps)

View File

@@ -6,6 +6,7 @@
<property name="default-height">400</property> <property name="default-height">400</property>
<child type="titlebar"> <child type="titlebar">
<object class="GtkHeaderBar" id=""> <object class="GtkHeaderBar" id="">
<property name="show-title-buttons">1</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<style> <style>

View File

@@ -29,7 +29,7 @@ draw_color (GtkDrawingArea *drawingarea,
} }
static GtkWidget * static GtkWidget *
color_swatch_new (const char *color) color_swatch_new (const gchar *color)
{ {
GtkWidget *button, *area; GtkWidget *button, *area;
@@ -48,7 +48,7 @@ do_flowbox (GtkWidget *do_widget)
{ {
static GtkWidget *window = NULL; static GtkWidget *window = NULL;
GtkWidget *scrolled, *flowbox; GtkWidget *scrolled, *flowbox;
const char *colors[] = { const gchar *colors[] = {
"AliceBlue", "AliceBlue",
"AntiqueWhite", "AntiqueWhite",
"AntiqueWhite1", "AntiqueWhite1",
@@ -716,7 +716,7 @@ do_flowbox (GtkWidget *do_widget)
"YellowGreen", "YellowGreen",
NULL NULL
}; };
int i; gint i;
if (!window) if (!window)
{ {

View File

@@ -7,6 +7,7 @@
<property name="title">Font Explorer</property> <property name="title">Font Explorer</property>
<child type="titlebar"> <child type="titlebar">
<object class="GtkHeaderBar"> <object class="GtkHeaderBar">
<property name="show-title-buttons">1</property>
<child> <child>
<object class="GtkButton" id="reset"> <object class="GtkButton" id="reset">
<property name="receives-default">1</property> <property name="receives-default">1</property>

View File

@@ -130,10 +130,6 @@ static const char *
get_feature_display_name (unsigned int tag) get_feature_display_name (unsigned int tag)
{ {
int i; int i;
static char buf[5] = { 0, };
if (tag == MAKE_TAG ('x', 'x', 'x', 'x'))
return _("Default");
for (i = 0; i < G_N_ELEMENTS (open_type_layout_features); i++) for (i = 0; i < G_N_ELEMENTS (open_type_layout_features); i++)
{ {
@@ -141,10 +137,7 @@ get_feature_display_name (unsigned int tag)
return g_dpgettext2 (NULL, "OpenType layout", open_type_layout_features[i].name); return g_dpgettext2 (NULL, "OpenType layout", open_type_layout_features[i].name);
} }
hb_tag_to_string (tag, buf); return NULL;
g_warning ("unknown OpenType layout feature tag: %s", buf);
return buf;
} }
static void update_display (void); static void update_display (void);
@@ -158,38 +151,26 @@ set_inconsistent (GtkCheckButton *button,
} }
static void static void
feat_pressed (GtkGestureClick *gesture, feat_clicked (GtkWidget *feat,
int n_press, gpointer data)
double x,
double y,
GtkWidget *feat)
{ {
const guint button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture)); g_signal_handlers_block_by_func (feat, feat_clicked, NULL);
if (button == GDK_BUTTON_PRIMARY)
{
g_signal_handlers_block_by_func (feat, feat_pressed, NULL);
if (gtk_check_button_get_inconsistent (GTK_CHECK_BUTTON (feat))) if (gtk_check_button_get_inconsistent (GTK_CHECK_BUTTON (feat)))
{ {
set_inconsistent (GTK_CHECK_BUTTON (feat), FALSE); set_inconsistent (GTK_CHECK_BUTTON (feat), FALSE);
gtk_check_button_set_active (GTK_CHECK_BUTTON (feat), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (feat), TRUE);
}
else if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (feat)))
{
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (feat), FALSE);
}
else
{
set_inconsistent (GTK_CHECK_BUTTON (feat), TRUE);
} }
g_signal_handlers_unblock_by_func (feat, feat_pressed, NULL); g_signal_handlers_unblock_by_func (feat, feat_clicked, NULL);
}
else if (button == GDK_BUTTON_SECONDARY)
{
gboolean inconsistent = gtk_check_button_get_inconsistent (GTK_CHECK_BUTTON (feat));
set_inconsistent (GTK_CHECK_BUTTON (feat), !inconsistent);
}
}
static void
feat_toggled_cb (GtkCheckButton *check_button,
gpointer data)
{
set_inconsistent (check_button, FALSE);
} }
static void static void
@@ -220,7 +201,6 @@ add_check_group (GtkWidget *box,
unsigned int tag; unsigned int tag;
GtkWidget *feat; GtkWidget *feat;
FeatureItem *item; FeatureItem *item;
GtkGesture *gesture;
tag = hb_tag_from_string (tags[i], -1); tag = hb_tag_from_string (tags[i], -1);
@@ -229,12 +209,7 @@ add_check_group (GtkWidget *box,
g_signal_connect (feat, "notify::active", G_CALLBACK (update_display), NULL); g_signal_connect (feat, "notify::active", G_CALLBACK (update_display), NULL);
g_signal_connect (feat, "notify::inconsistent", G_CALLBACK (update_display), NULL); g_signal_connect (feat, "notify::inconsistent", G_CALLBACK (update_display), NULL);
g_signal_connect (feat, "toggled", G_CALLBACK (feat_toggled_cb), NULL); g_signal_connect (feat, "clicked", G_CALLBACK (feat_clicked), NULL);
gesture = gtk_gesture_click_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
g_signal_connect (gesture, "pressed", G_CALLBACK (feat_pressed), feat);
gtk_widget_add_controller (feat, GTK_EVENT_CONTROLLER (gesture));
gtk_box_append (GTK_BOX (group), feat); gtk_box_append (GTK_BOX (group), feat);
@@ -285,11 +260,10 @@ add_radio_group (GtkWidget *box,
tag = hb_tag_from_string (tags[i], -1); tag = hb_tag_from_string (tags[i], -1);
name = get_feature_display_name (tag); name = get_feature_display_name (tag);
feat = gtk_check_button_new_with_label (name ? name : _("Default")); feat = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (group_button),
name ? name : _("Default"));
if (group_button == NULL) if (group_button == NULL)
group_button = feat; group_button = feat;
else
gtk_check_button_set_group (GTK_CHECK_BUTTON (feat), GTK_CHECK_BUTTON (group_button));
g_signal_connect (feat, "notify::active", G_CALLBACK (update_display), NULL); g_signal_connect (feat, "notify::active", G_CALLBACK (update_display), NULL);
g_object_set_data (G_OBJECT (feat), "default", group_button); g_object_set_data (G_OBJECT (feat), "default", group_button);
@@ -321,7 +295,7 @@ update_display (void)
GList *l; GList *l;
PangoAttrList *attrs; PangoAttrList *attrs;
PangoAttribute *attr; PangoAttribute *attr;
int ins, bound; gint ins, bound;
guint start, end; guint start, end;
PangoLanguage *lang; PangoLanguage *lang;
char *font_desc; char *font_desc;
@@ -362,11 +336,9 @@ update_display (void)
if (!gtk_widget_is_sensitive (item->feat)) if (!gtk_widget_is_sensitive (item->feat))
continue; continue;
if (GTK_IS_CHECK_BUTTON (item->feat)) if (GTK_IS_RADIO_BUTTON (item->feat))
{ {
if (g_object_get_data (G_OBJECT (item->feat), "default")) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (item->feat)) &&
{
if (gtk_check_button_get_active (GTK_CHECK_BUTTON (item->feat)) &&
strcmp (item->name, "xxxx") != 0) strcmp (item->name, "xxxx") != 0)
{ {
if (has_feature) if (has_feature)
@@ -376,7 +348,7 @@ update_display (void)
has_feature = TRUE; has_feature = TRUE;
} }
} }
else else if (GTK_IS_CHECK_BUTTON (item->feat))
{ {
if (gtk_check_button_get_inconsistent (GTK_CHECK_BUTTON (item->feat))) if (gtk_check_button_get_inconsistent (GTK_CHECK_BUTTON (item->feat)))
continue; continue;
@@ -384,14 +356,13 @@ update_display (void)
if (has_feature) if (has_feature)
g_string_append (s, ", "); g_string_append (s, ", ");
g_string_append (s, item->name); g_string_append (s, item->name);
if (gtk_check_button_get_active (GTK_CHECK_BUTTON (item->feat))) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (item->feat)))
g_string_append (s, " 1"); g_string_append (s, " 1");
else else
g_string_append (s, " 0"); g_string_append (s, " 0");
has_feature = TRUE; has_feature = TRUE;
} }
} }
}
features = g_string_free (s, FALSE); features = g_string_free (s, FALSE);
@@ -508,7 +479,7 @@ update_script_combo (void)
{ {
GtkListStore *store; GtkListStore *store;
hb_font_t *hb_font; hb_font_t *hb_font;
int i, j, k; gint i, j, k;
PangoFont *pango_font; PangoFont *pango_font;
GHashTable *tags; GHashTable *tags;
GHashTableIter iter; GHashTableIter iter;
@@ -622,7 +593,7 @@ update_script_combo (void)
static void static void
update_features (void) update_features (void)
{ {
int i, j; gint i, j;
GtkTreeModel *model; GtkTreeModel *model;
GtkTreeIter iter; GtkTreeIter iter;
guint script_index, lang_index; guint script_index, lang_index;
@@ -636,7 +607,7 @@ update_features (void)
gtk_widget_hide (item->feat); gtk_widget_hide (item->feat);
gtk_widget_hide (gtk_widget_get_parent (item->feat)); gtk_widget_hide (gtk_widget_get_parent (item->feat));
if (strcmp (item->name, "xxxx") == 0) if (strcmp (item->name, "xxxx") == 0)
gtk_check_button_set_active (GTK_CHECK_BUTTON (item->feat), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item->feat), TRUE);
} }
/* set feature presence checks from the font features */ /* set feature presence checks from the font features */
@@ -690,16 +661,13 @@ update_features (void)
{ {
gtk_widget_show (item->feat); gtk_widget_show (item->feat);
gtk_widget_show (gtk_widget_get_parent (item->feat)); gtk_widget_show (gtk_widget_get_parent (item->feat));
if (GTK_IS_CHECK_BUTTON (item->feat)) if (GTK_IS_RADIO_BUTTON (item->feat))
{ {
GtkWidget *def = GTK_WIDGET (g_object_get_data (G_OBJECT (item->feat), "default")); GtkWidget *def = GTK_WIDGET (g_object_get_data (G_OBJECT (item->feat), "default"));
if (def)
{
gtk_widget_show (def); gtk_widget_show (def);
gtk_widget_show (gtk_widget_get_parent (def));
gtk_check_button_set_active (GTK_CHECK_BUTTON (def), TRUE);
} }
else else if (GTK_IS_CHECK_BUTTON (item->feat))
{
set_inconsistent (GTK_CHECK_BUTTON (item->feat), TRUE); set_inconsistent (GTK_CHECK_BUTTON (item->feat), TRUE);
} }
} }
@@ -722,14 +690,14 @@ update_features (void)
p = strstr (feat, buf); p = strstr (feat, buf);
if (p) if (p)
{ {
if (GTK_IS_CHECK_BUTTON (item->feat) && g_object_get_data (G_OBJECT (item->feat), "default")) if (GTK_IS_RADIO_BUTTON (item->feat))
{ {
gtk_check_button_set_active (GTK_CHECK_BUTTON (item->feat), p[6] == '1'); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item->feat), p[6] == '1');
} }
else if (GTK_IS_CHECK_BUTTON (item->feat)) else if (GTK_IS_CHECK_BUTTON (item->feat))
{ {
set_inconsistent (GTK_CHECK_BUTTON (item->feat), FALSE); set_inconsistent (GTK_CHECK_BUTTON (item->feat), FALSE);
gtk_check_button_set_active (GTK_CHECK_BUTTON (item->feat), p[6] == '1'); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item->feat), p[6] == '1');
} }
} }
} }
@@ -760,8 +728,8 @@ static void
entry_activated (GtkEntry *entry, entry_activated (GtkEntry *entry,
GtkAdjustment *adjustment) GtkAdjustment *adjustment)
{ {
double value; gdouble value;
char *err = NULL; gchar *err = NULL;
value = g_strtod (gtk_editable_get_text (GTK_EDITABLE (entry)), &err); value = g_strtod (gtk_editable_get_text (GTK_EDITABLE (entry)), &err);
if (err != NULL) if (err != NULL)
@@ -971,7 +939,7 @@ instance_changed (GtkComboBox *combo)
{ {
Axis *axis; Axis *axis;
Axis akey; Axis akey;
double value; gdouble value;
value = coords[ai[i].axis_index]; value = coords[ai[i].axis_index];
@@ -1166,15 +1134,15 @@ font_features_reset_features (void)
{ {
FeatureItem *item = l->data; FeatureItem *item = l->data;
if (GTK_IS_CHECK_BUTTON (item->feat)) if (GTK_IS_RADIO_BUTTON (item->feat))
{ {
if (strcmp (item->name, "xxxx") == 0) if (strcmp (item->name, "xxxx") == 0)
gtk_check_button_set_active (GTK_CHECK_BUTTON (item->feat), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item->feat), TRUE);
else
{
gtk_check_button_set_active (GTK_CHECK_BUTTON (item->feat), FALSE);
set_inconsistent (GTK_CHECK_BUTTON (item->feat), TRUE);
} }
else if (GTK_IS_CHECK_BUTTON (item->feat))
{
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item->feat), FALSE);
set_inconsistent (GTK_CHECK_BUTTON (item->feat), TRUE);
} }
} }
} }
@@ -1317,7 +1285,8 @@ do_font_features (GtkWidget *do_widget)
"palt", "palt",
"twid", "twid",
"qwid", NULL }); "qwid", NULL });
add_check_group (feature_list, _("Alternative Stylistic Sets"), (const char *[]){ "ss01", add_check_group (feature_list, _("Alternative Stylistic Sets"), (const char *[]){ "ss00",
"ss01",
"ss02", "ss02",
"ss03", "ss03",
"ss04", "ss04",

View File

@@ -1,458 +0,0 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include <gtk/gtk.h>
#include <glib/gstdio.h>
#ifdef HAVE_GIO_UNIX
#include <gio/gunixoutputstream.h>
#include <fcntl.h>
#endif
/* This is the guts of gtk_text_buffer_insert_markup,
* copied here so we can make an incremental version.
*/
static void
insert_tags_for_attributes (GtkTextBuffer *buffer,
PangoAttrIterator *iter,
GtkTextIter *start,
GtkTextIter *end)
{
GtkTextTagTable *table;
PangoAttribute *attr;
GtkTextTag *tag;
char name[256];
table = gtk_text_buffer_get_tag_table (buffer);
#define STRING_ATTR(pango_attr_name, attr_name) \
attr = pango_attr_iterator_get (iter, pango_attr_name); \
if (attr) \
{ \
const char *string = ((PangoAttrString*)attr)->value; \
g_snprintf (name, 256, #attr_name "=%s", string); \
tag = gtk_text_tag_table_lookup (table, name); \
if (!tag) \
{ \
tag = gtk_text_tag_new (name); \
g_object_set (tag, #attr_name, string, NULL); \
gtk_text_tag_table_add (table, tag); \
g_object_unref (tag); \
} \
gtk_text_buffer_apply_tag (buffer, tag, start, end); \
}
#define INT_ATTR(pango_attr_name, attr_name) \
attr = pango_attr_iterator_get (iter, pango_attr_name); \
if (attr) \
{ \
int value = ((PangoAttrInt*)attr)->value; \
g_snprintf (name, 256, #attr_name "=%d", value); \
tag = gtk_text_tag_table_lookup (table, name); \
if (!tag) \
{ \
tag = gtk_text_tag_new (name); \
g_object_set (tag, #attr_name, value, NULL); \
gtk_text_tag_table_add (table, tag); \
g_object_unref (tag); \
} \
gtk_text_buffer_apply_tag (buffer, tag, start, end); \
}
#define FLOAT_ATTR(pango_attr_name, attr_name) \
attr = pango_attr_iterator_get (iter, pango_attr_name); \
if (attr) \
{ \
float value = ((PangoAttrFloat*)attr)->value; \
g_snprintf (name, 256, #attr_name "=%g", value); \
tag = gtk_text_tag_table_lookup (table, name); \
if (!tag) \
{ \
tag = gtk_text_tag_new (name); \
g_object_set (tag, #attr_name, value, NULL); \
gtk_text_tag_table_add (table, tag); \
g_object_unref (tag); \
} \
gtk_text_buffer_apply_tag (buffer, tag, start, end); \
}
#define RGBA_ATTR(pango_attr_name, attr_name) \
attr = pango_attr_iterator_get (iter, pango_attr_name); \
if (attr) \
{ \
PangoColor *color; \
GdkRGBA rgba; \
color = &((PangoAttrColor*)attr)->color; \
rgba.red = color->red / 65535.; \
rgba.green = color->green / 65535.; \
rgba.blue = color->blue / 65535.; \
rgba.alpha = 1.; \
char *str = gdk_rgba_to_string (&rgba); \
g_snprintf (name, 256, #attr_name "=%s", str); \
g_free (str); \
tag = gtk_text_tag_table_lookup (table, name); \
if (!tag) \
{ \
tag = gtk_text_tag_new (name); \
g_object_set (tag, #attr_name, &rgba, NULL); \
gtk_text_tag_table_add (table, tag); \
g_object_unref (tag); \
} \
gtk_text_buffer_apply_tag (buffer, tag, start, end); \
}
attr = pango_attr_iterator_get (iter, PANGO_ATTR_LANGUAGE);
if (attr)
{
const char *language = pango_language_to_string (((PangoAttrLanguage*)attr)->value);
g_snprintf (name, 256, "language=%s", language);
tag = gtk_text_tag_table_lookup (table, name);
if (!tag)
{
tag = gtk_text_tag_new (name);
g_object_set (tag, "language", language, NULL);
gtk_text_tag_table_add (table, tag);
g_object_unref (tag);
}
gtk_text_buffer_apply_tag (buffer, tag, start, end);
}
STRING_ATTR (PANGO_ATTR_FAMILY, family)
INT_ATTR (PANGO_ATTR_STYLE, style)
INT_ATTR (PANGO_ATTR_WEIGHT, weight)
INT_ATTR (PANGO_ATTR_VARIANT, variant)
INT_ATTR (PANGO_ATTR_STRETCH, stretch)
INT_ATTR (PANGO_ATTR_SIZE, size)
attr = pango_attr_iterator_get (iter, PANGO_ATTR_FONT_DESC);
if (attr)
{
PangoFontDescription *desc = ((PangoAttrFontDesc*)attr)->desc;
char *str = pango_font_description_to_string (desc);
g_snprintf (name, 256, "font-desc=%s", str);
g_free (str);
tag = gtk_text_tag_table_lookup (table, name);
if (!tag)
{
tag = gtk_text_tag_new (name);
g_object_set (tag, "font-desc", desc, NULL);
gtk_text_tag_table_add (table, tag);
g_object_unref (tag);
}
gtk_text_buffer_apply_tag (buffer, tag, start, end);
}
RGBA_ATTR (PANGO_ATTR_FOREGROUND, foreground_rgba)
RGBA_ATTR (PANGO_ATTR_BACKGROUND, background_rgba)
INT_ATTR (PANGO_ATTR_UNDERLINE, underline)
RGBA_ATTR (PANGO_ATTR_UNDERLINE_COLOR, underline_rgba)
INT_ATTR (PANGO_ATTR_OVERLINE, overline)
RGBA_ATTR (PANGO_ATTR_OVERLINE_COLOR, overline_rgba)
INT_ATTR (PANGO_ATTR_STRIKETHROUGH, strikethrough)
RGBA_ATTR (PANGO_ATTR_STRIKETHROUGH_COLOR, strikethrough_rgba)
INT_ATTR (PANGO_ATTR_RISE, rise)
FLOAT_ATTR (PANGO_ATTR_SCALE, scale)
INT_ATTR (PANGO_ATTR_FALLBACK, fallback)
INT_ATTR (PANGO_ATTR_LETTER_SPACING, letter_spacing)
STRING_ATTR (PANGO_ATTR_FONT_FEATURES, font_features)
INT_ATTR (PANGO_ATTR_ALLOW_BREAKS, allow_breaks)
INT_ATTR (PANGO_ATTR_SHOW, show_spaces)
INT_ATTR (PANGO_ATTR_INSERT_HYPHENS, insert_hyphens)
}
typedef struct
{
GMarkupParseContext *parser;
char *markup;
gsize pos;
gsize len;
GtkTextBuffer *buffer;
GtkTextIter iter;
GtkTextMark *mark;
PangoAttrList *attributes;
char *text;
PangoAttrIterator *attr;
} MarkupData;
static void
free_markup_data (MarkupData *mdata)
{
g_free (mdata->markup);
g_clear_pointer (&mdata->parser, g_markup_parse_context_free);
gtk_text_buffer_delete_mark (mdata->buffer, mdata->mark);
g_clear_pointer (&mdata->attr, pango_attr_iterator_destroy);
g_clear_pointer (&mdata->attributes, pango_attr_list_unref);
g_free (mdata->text);
g_object_unref (mdata->buffer);
g_free (mdata);
}
static gboolean
insert_markup_idle (gpointer data)
{
MarkupData *mdata = data;
gint64 begin;
begin = g_get_monotonic_time ();
do
{
int start, end;
int start_offset;
GtkTextIter start_iter;
if (g_get_monotonic_time () - begin > G_TIME_SPAN_MILLISECOND)
{
g_idle_add (insert_markup_idle, data);
return G_SOURCE_REMOVE;
}
pango_attr_iterator_range (mdata->attr, &start, &end);
if (end == G_MAXINT) /* last chunk */
end = start - 1; /* resulting in -1 to be passed to _insert */
start_offset = gtk_text_iter_get_offset (&mdata->iter);
gtk_text_buffer_insert (mdata->buffer, &mdata->iter, mdata->text + start, end - start);
gtk_text_buffer_get_iter_at_offset (mdata->buffer, &start_iter, start_offset);
insert_tags_for_attributes (mdata->buffer, mdata->attr, &start_iter, &mdata->iter);
gtk_text_buffer_get_iter_at_mark (mdata->buffer, &mdata->iter, mdata->mark);
}
while (pango_attr_iterator_next (mdata->attr));
free_markup_data (mdata);
return G_SOURCE_REMOVE;
}
static gboolean
parse_markup_idle (gpointer data)
{
MarkupData *mdata = data;
gint64 begin;
GError *error = NULL;
begin = g_get_monotonic_time ();
do {
if (g_get_monotonic_time () - begin > G_TIME_SPAN_MILLISECOND)
{
g_idle_add (parse_markup_idle, data);
return G_SOURCE_REMOVE;
}
if (!g_markup_parse_context_parse (mdata->parser,
mdata->markup + mdata->pos,
MIN (4096, mdata->len - mdata->pos),
&error))
{
g_warning ("Invalid markup string: %s", error->message);
g_error_free (error);
free_markup_data (mdata);
return G_SOURCE_REMOVE;
}
mdata->pos += 4096;
} while (mdata->pos < mdata->len);
if (!pango_markup_parser_finish (mdata->parser,
&mdata->attributes,
&mdata->text,
NULL,
&error))
{
g_warning ("Invalid markup string: %s", error->message);
g_error_free (error);
free_markup_data (mdata);
return G_SOURCE_REMOVE;
}
if (!mdata->attributes)
{
gtk_text_buffer_insert (mdata->buffer, &mdata->iter, mdata->text, -1);
free_markup_data (mdata);
return G_SOURCE_REMOVE;
}
mdata->attr = pango_attr_list_get_iterator (mdata->attributes);
insert_markup_idle (data);
return G_SOURCE_REMOVE;
}
/* Takes a ref on @buffer while it is operating,
* and consumes @markup.
*/
static void
insert_markup (GtkTextBuffer *buffer,
GtkTextIter *iter,
char *markup,
int len)
{
MarkupData *data;
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
data = g_new0 (MarkupData, 1);
data->buffer = g_object_ref (buffer);
data->iter = *iter;
data->markup = markup;
data->len = len;
data->parser = pango_markup_parser_new (0);
data->pos = 0;
/* create mark with right gravity */
data->mark = gtk_text_buffer_create_mark (buffer, NULL, iter, FALSE);
parse_markup_idle (data);
}
static void
fontify_finish (GObject *source,
GAsyncResult *result,
gpointer data)
{
GSubprocess *subprocess = G_SUBPROCESS (source);
GtkTextBuffer *buffer = data;
GBytes *stdout_buf = NULL;
GBytes *stderr_buf = NULL;
GError *error = NULL;
if (!g_subprocess_communicate_finish (subprocess,
result,
&stdout_buf,
&stderr_buf,
&error))
{
g_clear_pointer (&stdout_buf, g_bytes_unref);
g_clear_pointer (&stderr_buf, g_bytes_unref);
g_warning ("%s", error->message);
g_clear_error (&error);
g_object_unref (subprocess);
g_object_unref (buffer);
return;
}
if (g_subprocess_get_exit_status (subprocess) != 0)
{
if (stderr_buf)
g_warning ("%s", (char *)g_bytes_get_data (stderr_buf, NULL));
g_clear_pointer (&stderr_buf, g_bytes_unref);
}
g_object_unref (subprocess);
g_clear_pointer (&stderr_buf, g_bytes_unref);
if (stdout_buf)
{
char *markup;
gsize len;
char *p;
GtkTextIter start;
gtk_text_buffer_set_text (buffer, "", 0);
/* highlight puts a span with font and size around its output,
* which we don't want.
*/
markup = g_bytes_unref_to_data (stdout_buf, &len);
for (p = markup + strlen ("<span "); *p != '>'; p++) *p = ' ';
gtk_text_buffer_get_start_iter (buffer, &start);
insert_markup (buffer, &start, markup, len);
}
g_object_unref (buffer);
}
void
fontify (const char *format,
GtkTextBuffer *source_buffer)
{
GSubprocess *subprocess;
char *format_arg;
GtkSettings *settings;
char *theme;
gboolean prefer_dark;
const char *style_arg;
const char *text;
GtkTextIter start, end;
GBytes *bytes;
GError *error = NULL;
settings = gtk_settings_get_default ();
g_object_get (settings,
"gtk-theme-name", &theme,
"gtk-application-prefer-dark-theme", &prefer_dark,
NULL);
if (prefer_dark || strcmp (theme, "HighContrastInverse") == 0)
style_arg = "--style=edit-vim-dark";
else
style_arg = "--style=edit-kwrite";
g_free (theme);
format_arg = g_strconcat ("--syntax=", format, NULL);
subprocess = g_subprocess_new (G_SUBPROCESS_FLAGS_STDIN_PIPE |
G_SUBPROCESS_FLAGS_STDOUT_PIPE |
G_SUBPROCESS_FLAGS_STDERR_PIPE,
&error,
"highlight",
format_arg,
"--out-format=pango",
style_arg,
NULL);
g_free (format_arg);
if (!subprocess)
{
if (g_error_matches (error, G_SPAWN_ERROR, G_SPAWN_ERROR_NOENT))
{
static gboolean warned = FALSE;
if (!warned)
{
warned = TRUE;
g_message ("For syntax highlighting, install the “highlight” program");
}
}
else
g_warning ("%s", error->message);
g_clear_error (&error);
return;
}
gtk_text_buffer_get_bounds (source_buffer, &start, &end);
text = gtk_text_buffer_get_text (source_buffer, &start, &end, TRUE);
bytes = g_bytes_new_static (text, strlen (text));
#ifdef HAVE_GIO_UNIX
/* Work around https://gitlab.gnome.org/GNOME/glib/-/issues/2182 */
if (G_IS_UNIX_OUTPUT_STREAM (g_subprocess_get_stdin_pipe (subprocess)))
{
GOutputStream *stdin_pipe = g_subprocess_get_stdin_pipe (subprocess);
int fd = g_unix_output_stream_get_fd (G_UNIX_OUTPUT_STREAM (stdin_pipe));
fcntl (fd, F_SETFL, O_NONBLOCK);
}
#endif
g_subprocess_communicate_async (subprocess,
bytes,
NULL,
fontify_finish,
g_object_ref (source_buffer));
}

View File

@@ -1,6 +0,0 @@
#pragma once
#include <gtk/gtk.h>
void fontify (const char *format,
GtkTextBuffer *buffer);

View File

@@ -36,11 +36,11 @@ adjustment_get_normalized_value (GtkAdjustment *adj)
static void static void
val_to_xy (GtkFontPlane *plane, val_to_xy (GtkFontPlane *plane,
int *x, gint *x,
int *y) gint *y)
{ {
double u, v; gdouble u, v;
int width, height; gint width, height;
width = gtk_widget_get_allocated_width (GTK_WIDGET (plane)); width = gtk_widget_get_allocated_width (GTK_WIDGET (plane));
height = gtk_widget_get_allocated_height (GTK_WIDGET (plane)); height = gtk_widget_get_allocated_height (GTK_WIDGET (plane));
@@ -57,8 +57,8 @@ plane_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot) GtkSnapshot *snapshot)
{ {
GtkFontPlane *plane = GTK_FONT_PLANE (widget); GtkFontPlane *plane = GTK_FONT_PLANE (widget);
int x, y; gint x, y;
int width, height; gint width, height;
cairo_t *cr; cairo_t *cr;
val_to_xy (plane, &x, &y); val_to_xy (plane, &x, &y);
@@ -125,11 +125,11 @@ adjustment_set_normalized_value (GtkAdjustment *adj,
static void static void
update_value (GtkFontPlane *plane, update_value (GtkFontPlane *plane,
int x, gint x,
int y) gint y)
{ {
GtkWidget *widget = GTK_WIDGET (plane); GtkWidget *widget = GTK_WIDGET (plane);
double u, v; gdouble u, v;
u = CLAMP (x * (1.0 / gtk_widget_get_allocated_width (widget)), 0, 1); u = CLAMP (x * (1.0 / gtk_widget_get_allocated_width (widget)), 0, 1);
v = CLAMP (1 - y * (1.0 / gtk_widget_get_allocated_height (widget)), 0, 1); v = CLAMP (1 - y * (1.0 / gtk_widget_get_allocated_height (widget)), 0, 1);
@@ -142,8 +142,8 @@ update_value (GtkFontPlane *plane,
static void static void
plane_drag_gesture_begin (GtkGestureDrag *gesture, plane_drag_gesture_begin (GtkGestureDrag *gesture,
double start_x, gdouble start_x,
double start_y, gdouble start_y,
GtkFontPlane *plane) GtkFontPlane *plane)
{ {
guint button; guint button;
@@ -164,11 +164,11 @@ plane_drag_gesture_begin (GtkGestureDrag *gesture,
static void static void
plane_drag_gesture_update (GtkGestureDrag *gesture, plane_drag_gesture_update (GtkGestureDrag *gesture,
double offset_x, gdouble offset_x,
double offset_y, gdouble offset_y,
GtkFontPlane *plane) GtkFontPlane *plane)
{ {
double start_x, start_y; gdouble start_x, start_y;
gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (gesture), gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (gesture),
&start_x, &start_y); &start_x, &start_y);
@@ -177,8 +177,8 @@ plane_drag_gesture_update (GtkGestureDrag *gesture,
static void static void
plane_drag_gesture_end (GtkGestureDrag *gesture, plane_drag_gesture_end (GtkGestureDrag *gesture,
double offset_x, gdouble offset_x,
double offset_y, gdouble offset_y,
GtkFontPlane *plane) GtkFontPlane *plane)
{ {
set_cross_cursor (GTK_WIDGET (plane), FALSE); set_cross_cursor (GTK_WIDGET (plane), FALSE);

View File

@@ -19,7 +19,13 @@ static GtkWidget *show_extents = NULL;
static PangoContext *context; static PangoContext *context;
static int scale = 9; static int scale = 10;
static void
on_destroy (gpointer data)
{
window = NULL;
}
static void static void
update_image (void) update_image (void)
@@ -59,7 +65,7 @@ update_image (void)
hintstyle = CAIRO_HINT_STYLE_DEFAULT; hintstyle = CAIRO_HINT_STYLE_DEFAULT;
cairo_font_options_set_hint_style (fopt, hintstyle); cairo_font_options_set_hint_style (fopt, hintstyle);
if (gtk_check_button_get_active (GTK_CHECK_BUTTON (hint_metrics))) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (hint_metrics)))
hintmetrics = CAIRO_HINT_METRICS_ON; hintmetrics = CAIRO_HINT_METRICS_ON;
else else
hintmetrics = CAIRO_HINT_METRICS_OFF; hintmetrics = CAIRO_HINT_METRICS_OFF;
@@ -107,7 +113,7 @@ update_image (void)
cr = cairo_create (surface); cr = cairo_create (surface);
cairo_set_line_width (cr, 1); cairo_set_line_width (cr, 1);
if (gtk_check_button_get_active (GTK_CHECK_BUTTON (show_grid))) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (show_grid)))
{ {
int i; int i;
cairo_set_source_rgba (cr, 0.2, 0, 0, 0.2); cairo_set_source_rgba (cr, 0.2, 0, 0, 0.2);
@@ -125,7 +131,7 @@ update_image (void)
} }
} }
if (gtk_check_button_get_active (GTK_CHECK_BUTTON (show_extents))) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (show_extents)))
{ {
cairo_set_source_rgba (cr, 0, 0, 1, 1); cairo_set_source_rgba (cr, 0, 0, 1, 1);
@@ -245,7 +251,9 @@ do_fontrendering (GtkWidget *do_widget)
window = GTK_WIDGET (gtk_builder_get_object (builder, "window")); window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
gtk_window_set_display (GTK_WINDOW (window), gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget)); gtk_widget_get_display (do_widget));
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window); g_signal_connect (window, "destroy",
G_CALLBACK (on_destroy), NULL);
g_object_set_data_full (G_OBJECT (window), "builder", builder, g_object_unref);
font_button = GTK_WIDGET (gtk_builder_get_object (builder, "font_button")); font_button = GTK_WIDGET (gtk_builder_get_object (builder, "font_button"));
up_button = GTK_WIDGET (gtk_builder_get_object (builder, "up_button")); up_button = GTK_WIDGET (gtk_builder_get_object (builder, "up_button"));
down_button = GTK_WIDGET (gtk_builder_get_object (builder, "down_button")); down_button = GTK_WIDGET (gtk_builder_get_object (builder, "down_button"));
@@ -268,8 +276,6 @@ do_fontrendering (GtkWidget *do_widget)
g_signal_connect (show_extents, "notify::active", G_CALLBACK (update_image), NULL); g_signal_connect (show_extents, "notify::active", G_CALLBACK (update_image), NULL);
update_image (); update_image ();
g_object_unref (builder);
} }
if (!gtk_widget_get_visible (window)) if (!gtk_widget_get_visible (window))

View File

@@ -6,41 +6,12 @@
<property name="page-increment">4</property> <property name="page-increment">4</property>
</object> </object>
<object class="GtkWindow" id="window"> <object class="GtkWindow" id="window">
<property name="default-width">1080</property> <property name="default-width">600</property>
<property name="default-height">430</property> <property name="default-height">300</property>
<child type="titlebar"> <property name="title">Font rendering</property>
<object class="GtkHeaderBar">
<child type="title">
<object class="GtkBox">
<property name="halign">center</property>
<property name="valign">center</property>
<style>
<class name="linked"/>
</style>
<child>
<object class="GtkToggleButton" id="text_radio">
<property name="label">Text</property>
<property name="active">1</property>
</object>
</child>
<child>
<object class="GtkToggleButton" id="grid_radio">
<property name="label">Grid</property>
<property name="group">text_radio</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<child> <child>
<object class="GtkGrid"> <object class="GtkGrid">
<property name="halign">center</property>
<property name="margin-top">10</property> <property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="row-spacing">10</property> <property name="row-spacing">10</property>
<property name="column-spacing">10</property> <property name="column-spacing">10</property>
<child> <child>
@@ -51,16 +22,13 @@
<style> <style>
<class name="dim-label"/> <class name="dim-label"/>
</style> </style>
<layout>
<property name="column">1</property>
</layout>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkEntry" id="entry"> <object class="GtkEntry" id="entry">
<property name="text">Fonts render</property> <property name="text">Fonts render</property>
<layout> <layout>
<property name="column">2</property> <property name="left-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -73,16 +41,16 @@
<class name="dim-label"/> <class name="dim-label"/>
</style> </style>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">0</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkFontButton" id="font_button"> <object class="GtkFontButton" id="font_button">
<layout> <layout>
<property name="column">2</property> <property name="left-attach">1</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -94,7 +62,7 @@
<class name="dim-label"/> <class name="dim-label"/>
</style> </style>
<layout> <layout>
<property name="column">3</property> <property name="left-attach">2</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -109,36 +77,57 @@
<item translatable="yes" id="full">Full</item> <item translatable="yes" id="full">Full</item>
</items> </items>
<layout> <layout>
<property name="column">4</property> <property name="left-attach">3</property>
</layout> </layout>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="hint_metrics"> <object class="GtkCheckButton" id="hint_metrics">
<child>
<object class="GtkLabel">
<property name="label">Hint Metrics</property> <property name="label">Hint Metrics</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<layout> <layout>
<property name="column">4</property> <property name="left-attach">3</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="show_extents"> <object class="GtkCheckButton" id="show_extents">
<property name="label">Show Extents</property>
<property name="active">1</property> <property name="active">1</property>
<child>
<object class="GtkLabel">
<property name="label">Show Extents</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<layout> <layout>
<property name="column">5</property> <property name="left-attach">4</property>
<property name="row">0</property> <property name="top-attach">0</property>
</layout> </layout>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="show_grid"> <object class="GtkCheckButton" id="show_grid">
<property name="active">1</property> <property name="active">1</property>
<child>
<object class="GtkLabel">
<property name="label">Show Grid</property> <property name="label">Show Grid</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<layout> <layout>
<property name="column">5</property> <property name="left-attach">4</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -149,8 +138,8 @@
<class name="circular"/> <class name="circular"/>
</style> </style>
<layout> <layout>
<property name="column">6</property> <property name="left-attach">5</property>
<property name="row">0</property> <property name="top-attach">0</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -161,8 +150,8 @@
<class name="circular"/> <class name="circular"/>
</style> </style>
<layout> <layout>
<property name="column">6</property> <property name="left-attach">5</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -170,18 +159,41 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="hexpand">1</property> <property name="hexpand">1</property>
<layout> <layout>
<property name="column">7</property> <property name="left-attach">6</property>
</layout> </layout>
</object> </object>
</child> </child>
<child>
<object class="GtkBox">
<property name="halign">center</property>
<property name="valign">center</property>
<style>
<class name="linked"/>
</style>
<child>
<object class="GtkRadioButton" id="text_radio">
<property name="draw-indicator">0</property>
<property name="label">Text</property>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkSeparator"/> <object class="GtkRadioButton" id="grid_radio">
<property name="draw-indicator">0</property>
<property name="label">Grid</property>
<property name="group">text_radio</property>
</object>
</child>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
<property name="column-span">7</property>
</layout>
</object>
</child> </child>
<child> <child>
<object class="GtkScrolledWindow"> <object class="GtkScrolledWindow">
<property name="propagate-natural-height">1</property> <property name="propagate-natural-height">1</property>
<property name="has-frame">1</property>
<property name="hexpand">1</property> <property name="hexpand">1</property>
<property name="vexpand">1</property> <property name="vexpand">1</property>
<child> <child>
@@ -191,6 +203,11 @@
<property name="can-shrink">0</property> <property name="can-shrink">0</property>
</object> </object>
</child> </child>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
<property name="column-span">7</property>
</layout>
</object> </object>
</child> </child>
</object> </object>

View File

@@ -1,94 +0,0 @@
#include "four_point_transform.h"
#include "singular_value_decomposition.h"
/* Make a 4x4 matrix that maps
* e1 -> p1
* e2 -> p3
* e3 -> p3
* (1,1,1,0) -> p4
*/
static void
unit_to (graphene_point3d_t *p1,
graphene_point3d_t *p2,
graphene_point3d_t *p3,
graphene_point3d_t *p4,
graphene_matrix_t *m)
{
graphene_vec3_t v1, v2, v3, v4;
graphene_vec4_t vv1, vv2, vv3, vv4, p;
graphene_matrix_t u, s;
float v[16] = { 0., };
double A[16];
double U[16];
double S[4];
double V[16];
double B[4];
double x[4];
int i, j;
graphene_point3d_to_vec3 (p1, &v1);
graphene_point3d_to_vec3 (p2, &v2);
graphene_point3d_to_vec3 (p3, &v3);
graphene_point3d_to_vec3 (p4, &v4);
graphene_vec4_init_from_vec3 (&vv1, &v1, 1.);
graphene_vec4_init_from_vec3 (&vv2, &v2, 1.);
graphene_vec4_init_from_vec3 (&vv3, &v3, 1.);
graphene_vec4_init_from_vec3 (&vv4, &v4, 1.);
graphene_vec4_init (&p, 0., 0., 0., 1.);
graphene_matrix_init_from_vec4 (&u, &vv1, &vv2, &vv3, &p);
/* solve x * u = vv4 */
for (i = 0; i < 4; i++)
for (j = 0; j < 4; j++)
A[j * 4 + i] = graphene_matrix_get_value (&u, i, j);
B[0] = graphene_vec4_get_x (&vv4);
B[1] = graphene_vec4_get_y (&vv4);
B[2] = graphene_vec4_get_z (&vv4);
B[3] = graphene_vec4_get_w (&vv4);
singular_value_decomposition (A, 4, 4, U, S, V);
singular_value_decomposition_solve (U, S, V, 4, 4, B, x);
v[ 0] = x[0];
v[ 5] = x[1];
v[10] = x[2];
v[15] = 1;
graphene_matrix_init_from_float (&s, (const float *)&v);
graphene_matrix_multiply (&s, &u, m);
}
/* Compute a 4x4 matrix m that maps
* p1 -> q1
* p2 -> q2
* p3 -> q3
* p4 -> q4
*
* This is not in general possible, because projective
* transforms preserve coplanarity. But in the cases we
* care about here, both sets of points are always coplanar.
*/
void
perspective_3d (graphene_point3d_t *p1,
graphene_point3d_t *p2,
graphene_point3d_t *p3,
graphene_point3d_t *p4,
graphene_point3d_t *q1,
graphene_point3d_t *q2,
graphene_point3d_t *q3,
graphene_point3d_t *q4,
graphene_matrix_t *m)
{
graphene_matrix_t a, a_inv, b;
unit_to (p1, p2, p3, p4, &a);
unit_to (q1, q2, q3, q4, &b);
graphene_matrix_inverse (&a, &a_inv);
graphene_matrix_multiply (&a_inv, &b, m);
}

View File

@@ -1,13 +0,0 @@
#pragma once
#include <graphene.h>
void perspective_3d (graphene_point3d_t *p1,
graphene_point3d_t *p2,
graphene_point3d_t *p3,
graphene_point3d_t *p4,
graphene_point3d_t *q1,
graphene_point3d_t *q2,
graphene_point3d_t *q3,
graphene_point3d_t *q4,
graphene_matrix_t *m);

View File

@@ -9,8 +9,8 @@
static GtkGesture *rotate = NULL; static GtkGesture *rotate = NULL;
static GtkGesture *zoom = NULL; static GtkGesture *zoom = NULL;
static double swipe_x = 0; static gdouble swipe_x = 0;
static double swipe_y = 0; static gdouble swipe_y = 0;
static gboolean long_pressed = FALSE; static gboolean long_pressed = FALSE;
static gboolean static gboolean
@@ -26,8 +26,8 @@ touchpad_swipe_gesture_begin (GtkGesture *gesture,
static void static void
swipe_gesture_swept (GtkGestureSwipe *gesture, swipe_gesture_swept (GtkGestureSwipe *gesture,
double velocity_x, gdouble velocity_x,
double velocity_y, gdouble velocity_y,
GtkWidget *widget) GtkWidget *widget)
{ {
swipe_x = velocity_x / 10; swipe_x = velocity_x / 10;
@@ -37,8 +37,8 @@ swipe_gesture_swept (GtkGestureSwipe *gesture,
static void static void
long_press_gesture_pressed (GtkGestureLongPress *gesture, long_press_gesture_pressed (GtkGestureLongPress *gesture,
double x, gdouble x,
double y, gdouble y,
GtkWidget *widget) GtkWidget *widget)
{ {
long_pressed = TRUE; long_pressed = TRUE;
@@ -56,8 +56,8 @@ long_press_gesture_end (GtkGesture *gesture,
static void static void
rotation_angle_changed (GtkGestureRotate *gesture, rotation_angle_changed (GtkGestureRotate *gesture,
double angle, gdouble angle,
double delta, gdouble delta,
GtkWidget *widget) GtkWidget *widget)
{ {
gtk_widget_queue_draw (widget); gtk_widget_queue_draw (widget);
@@ -65,7 +65,7 @@ rotation_angle_changed (GtkGestureRotate *gesture,
static void static void
zoom_scale_changed (GtkGestureZoom *gesture, zoom_scale_changed (GtkGestureZoom *gesture,
double scale, gdouble scale,
GtkWidget *widget) GtkWidget *widget)
{ {
gtk_widget_queue_draw (widget); gtk_widget_queue_draw (widget);
@@ -93,8 +93,8 @@ drawing_area_draw (GtkDrawingArea *area,
{ {
cairo_pattern_t *pat; cairo_pattern_t *pat;
cairo_matrix_t matrix; cairo_matrix_t matrix;
double angle, scale; gdouble angle, scale;
double x_center, y_center; gdouble x_center, y_center;
gtk_gesture_get_bounding_box_center (GTK_GESTURE (zoom), &x_center, &y_center); gtk_gesture_get_bounding_box_center (GTK_GESTURE (zoom), &x_center, &y_center);

View File

@@ -1,7 +1,7 @@
precision highp float; precision highp float;
void main() { void main() {
float lerpVal = gl_FragCoord.y / 500.0; float lerpVal = gl_FragCoord.y / 500.0f;
gl_FragColor = mix(vec4(1.0, 0.85, 0.35, 1.0), vec4(0.2, 0.2, 0.2, 1.0), lerpVal); gl_FragColor = mix(vec4(1.0f, 0.85f, 0.35f, 1.0f), vec4(0.2f, 0.2f, 0.2f, 1.0f), lerpVal);
} }

View File

@@ -98,7 +98,7 @@ gtk_fishbowl_measure (GtkWidget *widget,
GHashTableIter iter; GHashTableIter iter;
gpointer key, value; gpointer key, value;
GtkFishbowlChild *child; GtkFishbowlChild *child;
int child_min, child_nat; gint child_min, child_nat;
*minimum = 0; *minimum = 0;
*natural = 0; *natural = 0;

View File

@@ -305,7 +305,7 @@ create_gear (GLfloat inner_radius,
/* Create the 7 points (only x,y coords) used to draw a tooth */ /* Create the 7 points (only x,y coords) used to draw a tooth */
struct point p[7]; struct point p[7];
/* Calculate needed sin/cos for various angles */ /* Calculate needed sin/cos for varius angles */
sincos(i * 2.0 * G_PI / teeth + da * 0, &s[0], &c[0]); sincos(i * 2.0 * G_PI / teeth + da * 0, &s[0], &c[0]);
sincos(i * 2.0 * M_PI / teeth + da * 1, &s[1], &c[1]); sincos(i * 2.0 * M_PI / teeth + da * 1, &s[1], &c[1]);
sincos(i * 2.0 * M_PI / teeth + da * 2, &s[2], &c[2]); sincos(i * 2.0 * M_PI / teeth + da * 2, &s[2], &c[2]);
@@ -800,7 +800,7 @@ gtk_gears_realize (GtkWidget *widget)
priv->LightSourcePosition_location = glGetUniformLocation(program, "LightSourcePosition"); priv->LightSourcePosition_location = glGetUniformLocation(program, "LightSourcePosition");
priv->MaterialColor_location = glGetUniformLocation(program, "MaterialColor"); priv->MaterialColor_location = glGetUniformLocation(program, "MaterialColor");
/* Set the LightSourcePosition uniform which is constant throughout the program */ /* Set the LightSourcePosition uniform which is constant throught the program */
glUniform4fv(priv->LightSourcePosition_location, 1, priv->LightSourcePosition); glUniform4fv(priv->LightSourcePosition_location, 1, priv->LightSourcePosition);
/* make the gears */ /* make the gears */

View File

@@ -30,6 +30,7 @@ do_headerbar (GtkWidget *do_widget)
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400); gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
header = gtk_header_bar_new (); header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
button = gtk_button_new (); button = gtk_button_new ();
icon = g_themed_icon_new ("mail-send-receive-symbolic"); icon = g_themed_icon_new ("mail-send-receive-symbolic");

View File

@@ -18,7 +18,7 @@ static void
insert_link (GtkTextBuffer *buffer, insert_link (GtkTextBuffer *buffer,
GtkTextIter *iter, GtkTextIter *iter,
const char *text, const char *text,
int page) gint page)
{ {
GtkTextTag *tag; GtkTextTag *tag;
@@ -35,7 +35,7 @@ insert_link (GtkTextBuffer *buffer,
*/ */
static void static void
show_page (GtkTextBuffer *buffer, show_page (GtkTextBuffer *buffer,
int page) gint page)
{ {
GtkTextIter iter; GtkTextIter iter;
@@ -91,7 +91,7 @@ follow_if_link (GtkWidget *text_view,
for (tagp = tags; tagp != NULL; tagp = tagp->next) for (tagp = tags; tagp != NULL; tagp = tagp->next)
{ {
GtkTextTag *tag = tagp->data; GtkTextTag *tag = tagp->data;
int page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page")); gint page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page"));
if (page != 0) if (page != 0)
{ {
@@ -134,14 +134,14 @@ key_pressed (GtkEventController *controller,
} }
static void set_cursor_if_appropriate (GtkTextView *text_view, static void set_cursor_if_appropriate (GtkTextView *text_view,
int x, gint x,
int y); gint y);
static void static void
released_cb (GtkGestureClick *gesture, released_cb (GtkGestureClick *gesture,
guint n_press, guint n_press,
double x, gdouble x,
double y, gdouble y,
GtkWidget *text_view) GtkWidget *text_view)
{ {
GtkTextIter start, end, iter; GtkTextIter start, end, iter;
@@ -168,8 +168,8 @@ released_cb (GtkGestureClick *gesture,
static void static void
motion_cb (GtkEventControllerMotion *controller, motion_cb (GtkEventControllerMotion *controller,
double x, gdouble x,
double y, gdouble y,
GtkTextView *text_view) GtkTextView *text_view)
{ {
set_cursor_if_appropriate (text_view, x, y); set_cursor_if_appropriate (text_view, x, y);
@@ -183,8 +183,8 @@ static gboolean hovering_over_link = FALSE;
*/ */
static void static void
set_cursor_if_appropriate (GtkTextView *text_view, set_cursor_if_appropriate (GtkTextView *text_view,
int x, gint x,
int y) gint y)
{ {
GSList *tags = NULL, *tagp = NULL; GSList *tags = NULL, *tagp = NULL;
GtkTextIter iter; GtkTextIter iter;
@@ -196,7 +196,7 @@ set_cursor_if_appropriate (GtkTextView *text_view,
for (tagp = tags; tagp != NULL; tagp = tagp->next) for (tagp = tags; tagp != NULL; tagp = tagp->next)
{ {
GtkTextTag *tag = tagp->data; GtkTextTag *tag = tagp->data;
int page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page")); gint page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page"));
if (page != 0) if (page != 0)
{ {

View File

@@ -75,10 +75,10 @@ populate_icons (void)
static char *content; static char *content;
static gsize content_len; static gsize content_len;
extern void fontify (const char *format, GtkTextBuffer *buffer); extern void fontify (GtkTextBuffer *buffer);
static void static void
populate_text (gboolean highlight) populate_text (gboolean hilight)
{ {
GtkWidget *textview; GtkWidget *textview;
GtkTextBuffer *buffer; GtkTextBuffer *buffer;
@@ -94,8 +94,8 @@ populate_text (gboolean highlight)
buffer = gtk_text_buffer_new (NULL); buffer = gtk_text_buffer_new (NULL);
gtk_text_buffer_set_text (buffer, content, (int)content_len); gtk_text_buffer_set_text (buffer, content, (int)content_len);
if (highlight) if (hilight)
fontify ("c", buffer); fontify (buffer);
textview = gtk_text_view_new (); textview = gtk_text_view_new ();
gtk_text_view_set_buffer (GTK_TEXT_VIEW (textview), buffer); gtk_text_view_set_buffer (GTK_TEXT_VIEW (textview), buffer);
@@ -153,20 +153,14 @@ populate_list (void)
} }
extern GtkWidget *create_color_grid (void); extern GtkWidget *create_color_grid (void);
extern GListModel *gtk_color_list_new (guint size);
static void static void
populate_grid (void) populate_grid (void)
{ {
GtkWidget *list; GtkWidget *list;
GtkNoSelection *selection;
list = create_color_grid (); list = create_color_grid ();
selection = gtk_no_selection_new (gtk_color_list_new (2097152));
gtk_grid_view_set_model (GTK_GRID_VIEW (list), GTK_SELECTION_MODEL (selection));
g_object_unref (selection);
hincrement = 0; hincrement = 0;
vincrement = 5; vincrement = 5;
@@ -226,7 +220,7 @@ set_widget_type (int type)
tick_cb = gtk_widget_add_tick_callback (window, scroll_cb, NULL, NULL); tick_cb = gtk_widget_add_tick_callback (window, scroll_cb, NULL, NULL);
} }
G_MODULE_EXPORT void void
iconscroll_next_clicked_cb (GtkButton *source, iconscroll_next_clicked_cb (GtkButton *source,
gpointer user_data) gpointer user_data)
{ {
@@ -241,7 +235,7 @@ iconscroll_next_clicked_cb (GtkButton *source,
set_widget_type (new_index); set_widget_type (new_index);
} }
G_MODULE_EXPORT void void
iconscroll_prev_clicked_cb (GtkButton *source, iconscroll_prev_clicked_cb (GtkButton *source,
gpointer user_data) gpointer user_data)
{ {
@@ -255,7 +249,7 @@ iconscroll_prev_clicked_cb (GtkButton *source,
set_widget_type (new_index); set_widget_type (new_index);
} }
G_MODULE_EXPORT GtkWidget * GtkWidget *
do_iconscroll (GtkWidget *do_widget) do_iconscroll (GtkWidget *do_widget)
{ {
if (!window) if (!window)

View File

@@ -6,6 +6,7 @@
<property name="default-height">500</property> <property name="default-height">500</property>
<child type="titlebar"> <child type="titlebar">
<object class="GtkHeaderBar"> <object class="GtkHeaderBar">
<property name="show-title-buttons">1</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<style> <style>

View File

@@ -25,7 +25,7 @@ enum
static GdkPixbuf *file_pixbuf, *folder_pixbuf; static GdkPixbuf *file_pixbuf, *folder_pixbuf;
char *parent; gchar *parent;
GtkWidget *up_button; GtkWidget *up_button;
/* Loads the images for the demo and returns whether the operation succeeded */ /* Loads the images for the demo and returns whether the operation succeeded */
@@ -47,7 +47,7 @@ static void
fill_store (GtkListStore *store) fill_store (GtkListStore *store)
{ {
GDir *dir; GDir *dir;
const char *name; const gchar *name;
GtkTreeIter iter; GtkTreeIter iter;
/* First clear the store */ /* First clear the store */
@@ -62,7 +62,7 @@ fill_store (GtkListStore *store)
name = g_dir_read_name (dir); name = g_dir_read_name (dir);
while (name != NULL) while (name != NULL)
{ {
char *path, *display_name; gchar *path, *display_name;
gboolean is_dir; gboolean is_dir;
/* We ignore hidden files that start with a '.' */ /* We ignore hidden files that start with a '.' */
@@ -90,14 +90,14 @@ fill_store (GtkListStore *store)
g_dir_close (dir); g_dir_close (dir);
} }
static int static gint
sort_func (GtkTreeModel *model, sort_func (GtkTreeModel *model,
GtkTreeIter *a, GtkTreeIter *a,
GtkTreeIter *b, GtkTreeIter *b,
gpointer user_data) gpointer user_data)
{ {
gboolean is_dir_a, is_dir_b; gboolean is_dir_a, is_dir_b;
char *name_a, *name_b; gchar *name_a, *name_b;
int ret; int ret;
/* We need this function because we want to sort /* We need this function because we want to sort
@@ -158,7 +158,7 @@ item_activated (GtkIconView *icon_view,
gpointer user_data) gpointer user_data)
{ {
GtkListStore *store; GtkListStore *store;
char *path; gchar *path;
GtkTreeIter iter; GtkTreeIter iter;
gboolean is_dir; gboolean is_dir;
@@ -192,7 +192,7 @@ up_clicked (GtkButton *item,
gpointer user_data) gpointer user_data)
{ {
GtkListStore *store; GtkListStore *store;
char *dir_name; gchar *dir_name;
store = GTK_LIST_STORE (user_data); store = GTK_LIST_STORE (user_data);

View File

@@ -19,8 +19,8 @@ static void
fill_store (GtkListStore *store) fill_store (GtkListStore *store)
{ {
GtkTreeIter iter; GtkTreeIter iter;
const char *text[] = { "Red", "Green", "Blue", "Yellow" }; const gchar *text[] = { "Red", "Green", "Blue", "Yellow" };
int i; gint i;
/* First clear the store */ /* First clear the store */
gtk_list_store_clear (store); gtk_list_store_clear (store);
@@ -49,7 +49,7 @@ set_cell_color (GtkCellLayout *cell_layout,
GtkTreeIter *iter, GtkTreeIter *iter,
gpointer data) gpointer data)
{ {
char *text; gchar *text;
GdkRGBA color; GdkRGBA color;
guint32 pixel = 0; guint32 pixel = 0;
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
@@ -60,10 +60,10 @@ set_cell_color (GtkCellLayout *cell_layout,
if (gdk_rgba_parse (&color, text)) if (gdk_rgba_parse (&color, text))
pixel = pixel =
((int)(color.red * 255)) << 24 | ((gint)(color.red * 255)) << 24 |
((int)(color.green * 255)) << 16 | ((gint)(color.green * 255)) << 16 |
((int)(color.blue * 255)) << 8 | ((gint)(color.blue * 255)) << 8 |
((int)(color.alpha * 255)); ((gint)(color.alpha * 255));
g_free (text); g_free (text);
@@ -77,8 +77,8 @@ set_cell_color (GtkCellLayout *cell_layout,
static void static void
edited (GtkCellRendererText *cell, edited (GtkCellRendererText *cell,
char *path_string, gchar *path_string,
char *text, gchar *text,
gpointer data) gpointer data)
{ {
GtkTreeModel *model; GtkTreeModel *model;

View File

@@ -43,10 +43,10 @@ progressive_prepared_callback (GdkPixbufLoader *loader,
static void static void
progressive_updated_callback (GdkPixbufLoader *loader, progressive_updated_callback (GdkPixbufLoader *loader,
int x, gint x,
int y, gint y,
int width, gint width,
int height, gint height,
gpointer data) gpointer data)
{ {
GtkWidget *picture; GtkWidget *picture;
@@ -58,7 +58,7 @@ progressive_updated_callback (GdkPixbufLoader *loader,
gtk_picture_set_pixbuf (GTK_PICTURE (picture), pixbuf); gtk_picture_set_pixbuf (GTK_PICTURE (picture), pixbuf);
} }
static int static gint
progressive_timeout (gpointer data) progressive_timeout (gpointer data)
{ {
GtkWidget *picture; GtkWidget *picture;
@@ -240,11 +240,11 @@ progressive_timeout (gpointer data)
pixbuf_loader = gdk_pixbuf_loader_new (); pixbuf_loader = gdk_pixbuf_loader_new ();
g_signal_connect_object (pixbuf_loader, "area-prepared", g_signal_connect (pixbuf_loader, "area-prepared",
G_CALLBACK (progressive_prepared_callback), picture, 0); G_CALLBACK (progressive_prepared_callback), picture);
g_signal_connect_object (pixbuf_loader, "area-updated", g_signal_connect (pixbuf_loader, "area-updated",
G_CALLBACK (progressive_updated_callback), picture, 0); G_CALLBACK (progressive_updated_callback), picture);
} }
/* leave timeout installed */ /* leave timeout installed */
@@ -261,16 +261,14 @@ start_progressive_loading (GtkWidget *picture)
* The timeout simply simulates a slow data source by inserting * The timeout simply simulates a slow data source by inserting
* pauses in the reading process. * pauses in the reading process.
*/ */
load_timeout = g_timeout_add (1500, progressive_timeout, picture); load_timeout = g_timeout_add (150, progressive_timeout, picture);
g_source_set_name_by_id (load_timeout, "[gtk] progressive_timeout"); g_source_set_name_by_id (load_timeout, "[gtk] progressive_timeout");
} }
static void static void
cleanup_callback (gpointer data, cleanup_callback (GObject *object,
GObject *former_object) gpointer data)
{ {
*(gpointer**)data = NULL;
if (load_timeout) if (load_timeout)
{ {
g_source_remove (load_timeout); g_source_remove (load_timeout);
@@ -329,7 +327,10 @@ do_images (GtkWidget *do_widget)
gtk_window_set_display (GTK_WINDOW (window), gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget)); gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Images"); gtk_window_set_title (GTK_WINDOW (window), "Images");
g_object_weak_ref (G_OBJECT (window), cleanup_callback, &window); g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
g_signal_connect (window, "destroy",
G_CALLBACK (cleanup_callback), NULL);
base_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); base_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_widget_set_margin_start (base_vbox, 16); gtk_widget_set_margin_start (base_vbox, 16);

View File

@@ -8,7 +8,7 @@
static void static void
on_bar_response (GtkInfoBar *info_bar, on_bar_response (GtkInfoBar *info_bar,
int response_id, gint response_id,
gpointer user_data) gpointer user_data)
{ {
GtkWidget *dialog; GtkWidget *dialog;

View File

@@ -1,62 +0,0 @@
/* Layout Manager/Transition
*
* This demo shows a simple example of a custom layout manager
* and a widget using it. The layout manager places the children
* of the widget in a grid or a circle.
*
* The widget is animating the transition between the two layouts.
*
* Click to start the transition.
*/
#include <gtk/gtk.h>
#include "demowidget.h"
#include "demochild.h"
GtkWidget *
do_layoutmanager (GtkWidget *parent)
{
static GtkWidget *window = NULL;
if (!window)
{
GtkWidget *widget;
GtkWidget *child;
const char *color[] = {
"red", "orange", "yellow", "green",
"blue", "grey", "magenta", "lime",
"yellow", "firebrick", "aqua", "purple",
"tomato", "pink", "thistle", "maroon"
};
int i;
window = gtk_window_new ();
gtk_window_set_title (GTK_WINDOW (window), "Layout Manager—Transition");
gtk_window_set_default_size (GTK_WINDOW (window), 600, 600);
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
widget = demo_widget_new ();
for (i = 0; i < 16; i++)
{
child = demo_child_new (color[i]);
gtk_widget_set_margin_start (child, 4);
gtk_widget_set_margin_end (child, 4);
gtk_widget_set_margin_top (child, 4);
gtk_widget_set_margin_bottom (child, 4);
demo_widget_add_child (DEMO_WIDGET (widget), child);
}
gtk_window_set_child (GTK_WINDOW (window), widget);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@@ -1,198 +0,0 @@
/* Layout Manager/Transformation
*
* This demo shows how to use transforms in a nontrivial
* way with a custom layout manager. The layout manager places
* icons on a sphere that can be rotated using arrow keys.
*/
#include <gtk/gtk.h>
#include "demo2widget.h"
#include "demo2layout.h"
#include "demochild.h"
GtkWidget *
do_layoutmanager2 (GtkWidget *parent)
{
static GtkWidget *window = NULL;
if (!window)
{
GtkWidget *widget;
GtkWidget *child;
const char *name[] = {
"action-unavailable-symbolic",
"address-book-new-symbolic",
"application-exit-symbolic",
"appointment-new-symbolic",
"bookmark-new-symbolic",
"call-start-symbolic",
"call-stop-symbolic",
"camera-switch-symbolic",
"chat-message-new-symbolic",
"color-select-symbolic",
"contact-new-symbolic",
"document-edit-symbolic",
"document-new-symbolic",
"document-open-recent-symbolic",
"document-open-symbolic",
"document-page-setup-symbolic",
"document-print-preview-symbolic",
"document-print-symbolic",
"document-properties-symbolic",
"document-revert-symbolic-rtl",
"document-revert-symbolic",
"document-save-as-symbolic",
"document-save-symbolic",
"document-send-symbolic",
"edit-clear-all-symbolic",
"edit-clear-symbolic-rtl",
"edit-clear-symbolic",
"edit-copy-symbolic",
"edit-cut-symbolic",
"edit-delete-symbolic",
"edit-find-replace-symbolic",
"edit-find-symbolic",
"edit-paste-symbolic",
"edit-redo-symbolic-rtl",
"edit-redo-symbolic",
"edit-select-all-symbolic",
"edit-select-symbolic",
"edit-undo-symbolic-rtl",
"edit-undo-symbolic",
"error-correct-symbolic",
"find-location-symbolic",
"folder-new-symbolic",
"font-select-symbolic",
"format-indent-less-symbolic-rtl",
"format-indent-less-symbolic",
"format-indent-more-symbolic-rtl",
"format-indent-more-symbolic",
"format-justify-center-symbolic",
"format-justify-fill-symbolic",
"format-justify-left-symbolic",
"format-justify-right-symbolic",
"format-text-bold-symbolic",
"format-text-direction-symbolic-rtl",
"format-text-direction-symbolic",
"format-text-italic-symbolic",
"format-text-strikethrough-symbolic",
"format-text-underline-symbolic",
"go-bottom-symbolic",
"go-down-symbolic",
"go-first-symbolic-rtl",
"go-first-symbolic",
"go-home-symbolic",
"go-jump-symbolic-rtl",
"go-jump-symbolic",
"go-last-symbolic-rtl",
"go-last-symbolic",
"go-next-symbolic-rtl",
"go-next-symbolic",
"go-previous-symbolic-rtl",
"go-previous-symbolic",
"go-top-symbolic",
"go-up-symbolic",
"help-about-symbolic",
"insert-image-symbolic",
"insert-link-symbolic",
"insert-object-symbolic",
"insert-text-symbolic",
"list-add-symbolic",
"list-remove-all-symbolic",
"list-remove-symbolic",
"mail-forward-symbolic",
"mail-mark-important-symbolic",
"mail-mark-junk-symbolic",
"mail-mark-notjunk-symbolic",
"mail-message-new-symbolic",
"mail-reply-all-symbolic",
"mail-reply-sender-symbolic",
"mail-send-receive-symbolic",
"mail-send-symbolic",
"mark-location-symbolic",
"media-eject-symbolic",
"media-playback-pause-symbolic",
"media-playback-start-symbolic",
"media-playback-stop-symbolic",
"media-record-symbolic",
"media-seek-backward-symbolic",
"media-seek-forward-symbolic",
"media-skip-backward-symbolic",
"media-skip-forward-symbolic",
"media-view-subtitles-symbolic",
"object-flip-horizontal-symbolic",
"object-flip-vertical-symbolic",
"object-rotate-left-symbolic",
"object-rotate-right-symbolic",
"object-select-symbolic",
"open-menu-symbolic",
"process-stop-symbolic",
"send-to-symbolic",
"sidebar-hide-symbolic",
"sidebar-show-symbolic",
"star-new-symbolic",
"system-log-out-symbolic",
"system-reboot-symbolic",
"system-run-symbolic",
"system-search-symbolic",
"system-shutdown-symbolic",
"system-switch-user-symbolic",
"tab-new-symbolic",
"tools-check-spelling-symbolic",
"value-decrease-symbolic",
"value-increase-symbolic",
"view-app-grid-symbolic",
"view-conceal-symbolic",
"view-continuous-symbolic",
"view-dual-symbolic",
"view-fullscreen-symbolic",
"view-grid-symbolic",
"view-list-bullet-symbolic",
"view-list-ordered-symbolic",
"view-list-symbolic",
"view-mirror-symbolic",
"view-more-horizontal-symbolic",
"view-more-symbolic",
"view-paged-symbolic",
"view-pin-symbolic",
"view-refresh-symbolic",
"view-restore-symbolic",
"view-reveal-symbolic",
"view-sort-ascending-symbolic",
"view-sort-descending-symbolic",
"zoom-fit-best-symbolic",
"zoom-in-symbolic",
"zoom-original-symbolic",
"zoom-out-symbolic",
};
int i;
window = gtk_window_new ();
gtk_window_set_title (GTK_WINDOW (window), "Layout Manager—Transformation");
gtk_window_set_default_size (GTK_WINDOW (window), 600, 620);
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
widget = demo2_widget_new ();
for (i = 0; i < 18 * 36; i++)
{
child = gtk_image_new_from_icon_name (name[i % G_N_ELEMENTS (name)]);
gtk_widget_set_margin_start (child, 4);
gtk_widget_set_margin_end (child, 4);
gtk_widget_set_margin_top (child, 4);
gtk_widget_set_margin_bottom (child, 4);
demo2_widget_add_child (DEMO2_WIDGET (widget), child);
}
gtk_window_set_child (GTK_WINDOW (window), widget);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@@ -9,7 +9,7 @@
static void static void
response_cb (GtkWidget *dialog, response_cb (GtkWidget *dialog,
int response_id, gint response_id,
gpointer data) gpointer data)
{ {
gtk_window_destroy (GTK_WINDOW (dialog)); gtk_window_destroy (GTK_WINDOW (dialog));
@@ -17,7 +17,7 @@ response_cb (GtkWidget *dialog,
static gboolean static gboolean
activate_link (GtkWidget *label, activate_link (GtkWidget *label,
const char *uri, const gchar *uri,
gpointer data) gpointer data)
{ {
if (g_strcmp0 (uri, "keynav") == 0) if (g_strcmp0 (uri, "keynav") == 0)

View File

@@ -47,7 +47,7 @@ static Bug bugs[] =
{ FALSE, 56925, "Normal", "Gtkcalender size" }, { FALSE, 56925, "Normal", "Gtkcalender size" },
{ FALSE, 56221, "Normal", "Selectable label needs right-click copy menu" }, { FALSE, 56221, "Normal", "Selectable label needs right-click copy menu" },
{ TRUE, 50939, "Normal", "Add shift clicking to GtkTextView" }, { TRUE, 50939, "Normal", "Add shift clicking to GtkTextView" },
{ FALSE, 6112, "Enhancement","netscape-like collapsible toolbars" }, { FALSE, 6112, "Enhancement","netscape-like collapsable toolbars" },
{ FALSE, 1, "Normal", "First bug :=)" }, { FALSE, 1, "Normal", "First bug :=)" },
}; };
@@ -81,7 +81,7 @@ spinner_timeout (gpointer data)
static GtkTreeModel * static GtkTreeModel *
create_model (void) create_model (void)
{ {
int i = 0; gint i = 0;
GtkListStore *store; GtkListStore *store;
GtkTreeIter iter; GtkTreeIter iter;

View File

@@ -1,4 +1,4 @@
/* List Box/Complex list /* List Box
* *
* GtkListBox allows lists with complicated layouts, using * GtkListBox allows lists with complicated layouts, using
* regular widgets supporting sorting and filtering. * regular widgets supporting sorting and filtering.

View File

@@ -26,8 +26,8 @@
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="icon-name">image-missing</property> <property name="icon-name">image-missing</property>
<layout> <layout>
<property name="column">0</property> <property name="left-attach">0</property>
<property name="row">0</property> <property name="top-attach">0</property>
<property name="row-span">5</property> <property name="row-span">5</property>
</layout> </layout>
</object> </object>
@@ -71,8 +71,8 @@
</object> </object>
</child> </child>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">0</property> <property name="top-attach">0</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -84,9 +84,12 @@
<property name="yalign">0</property> <property name="yalign">0</property>
<property name="label" translatable="0">Message</property> <property name="label" translatable="0">Message</property>
<property name="wrap">1</property> <property name="wrap">1</property>
<accessibility>
<role type="static"/>
</accessibility>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">1</property> <property name="top-attach">1</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -111,8 +114,8 @@
</object> </object>
</child> </child>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">2</property> <property name="top-attach">2</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -165,8 +168,8 @@
</object> </object>
</child> </child>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">3</property> <property name="top-attach">3</property>
</layout> </layout>
</object> </object>
</child> </child>
@@ -180,6 +183,8 @@
<property name="margin-top">2</property> <property name="margin-top">2</property>
<property name="margin-bottom">2</property> <property name="margin-bottom">2</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<child>
<object class="GtkFrame" id="frame1">
<child> <child>
<object class="GtkLabel" id="n_reshares_label"> <object class="GtkLabel" id="n_reshares_label">
<property name="label" translatable="0">&lt;b&gt;2&lt;/b&gt; <property name="label" translatable="0">&lt;b&gt;2&lt;/b&gt;
@@ -187,6 +192,11 @@ Reshares</property>
<property name="use-markup">1</property> <property name="use-markup">1</property>
</object> </object>
</child> </child>
<child type="label_item"/>
</object>
</child>
<child>
<object class="GtkFrame" id="frame2">
<child> <child>
<object class="GtkLabel" id="n_favorites_label"> <object class="GtkLabel" id="n_favorites_label">
<property name="label" translatable="0">&lt;b&gt;2&lt;/b&gt; <property name="label" translatable="0">&lt;b&gt;2&lt;/b&gt;
@@ -194,6 +204,9 @@ FAVORITES</property>
<property name="use-markup">1</property> <property name="use-markup">1</property>
</object> </object>
</child> </child>
<child type="label_item"/>
</object>
</child>
</object> </object>
</child> </child>
<child> <child>
@@ -221,8 +234,8 @@ FAVORITES</property>
</object> </object>
</child> </child>
<layout> <layout>
<property name="column">1</property> <property name="left-attach">1</property>
<property name="row">4</property> <property name="top-attach">4</property>
</layout> </layout>
</object> </object>
</child> </child>

View File

@@ -1,71 +0,0 @@
/* List Box/Controls
*
* GtkListBox is well-suited for creating “button strips” — lists of
* controls for use in preference dialogs or settings panels. To create
* this style of list, use the .rich-list style class.
*/
#include <gtk/gtk.h>
static GtkWidget *window;
static GtkWidget *switch_widget;
static GtkWidget *check;
static GtkWidget *image;
static void
row_activated (GtkListBox *list,
GtkListBoxRow *row)
{
if (gtk_widget_is_ancestor (switch_widget, GTK_WIDGET (row)))
{
gtk_switch_set_active (GTK_SWITCH (switch_widget),
!gtk_switch_get_active (GTK_SWITCH (switch_widget)));
}
else if (gtk_widget_is_ancestor (check, GTK_WIDGET (row)))
{
gtk_check_button_set_active (GTK_CHECK_BUTTON (check),
!gtk_check_button_get_active (GTK_CHECK_BUTTON (check)));
}
else if (gtk_widget_is_ancestor (image, GTK_WIDGET (row)))
{
gtk_widget_set_opacity (image,
1.0 - gtk_widget_get_opacity (image));
}
}
GtkWidget *
do_listbox2 (GtkWidget *do_widget)
{
if (!window)
{
GtkBuilderScope *scope;
GtkBuilder *builder;
scope = gtk_builder_cscope_new ();
gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope),
"row_activated", G_CALLBACK (row_activated));
builder = gtk_builder_new ();
gtk_builder_set_scope (builder, scope);
gtk_builder_add_from_resource (builder, "/listbox2/listbox2.ui", NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
switch_widget = GTK_WIDGET (gtk_builder_get_object (builder, "switch"));
check = GTK_WIDGET (gtk_builder_get_object (builder, "check"));
image = GTK_WIDGET (gtk_builder_get_object (builder, "image"));
g_object_unref (builder);
g_object_unref (scope);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@@ -1,298 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow" id="window">
<property name="title" translatable="yes">List Box — Controls</property>
<property name="default-height">400</property>
<child>
<object class="GtkScrolledWindow">
<property name="hscrollbar-policy">never</property>
<property name="min-content-height">200</property>
<property name="hexpand">0</property>
<property name="vexpand">1</property>
<child>
<object class="GtkViewport">
<property name="scroll-to-focus">1</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="margin-start">60</property>
<property name="margin-end">60</property>
<property name="margin-top">30</property>
<property name="margin-bottom">30</property>
<child>
<object class="GtkLabel">
<property name="label">Group 1</property>
<property name="xalign">0</property>
<property name="margin-bottom">10</property>
<style>
<class name="title-2"/>
</style>
</object>
</child>
<child>
<object class="GtkFrame">
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<property name="show-separators">1</property>
<signal name="row-activated" handler="row_activated"/>
<style>
<class name="rich-list"/>
</style>
<child>
<object class="GtkListBoxRow">
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="switch_label">
<property name="label" translatable="yes">Switch</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkSwitch" id="switch">
<property name="halign">end</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="check_label">
<property name="label" translatable="yes">Check</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkCheckButton" id="check">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="active">1</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="image_label">
<property name="label" translatable="yes">Click here!</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="image">
<property name="icon-name">object-select-symbolic</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="opacity">0</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="margin-top">30</property>
<property name="margin-bottom">10</property>
<property name="label">Group 2</property>
<property name="xalign">0</property>
<style>
<class name="title-2"/>
</style>
</object>
</child>
<child>
<object class="GtkFrame">
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<property name="show-separators">1</property>
<style>
<class name="rich-list"/>
</style>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="scale_label">
<property name="label" translatable="yes">Scale</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">0</property>
<property name="width-request">150</property>
<property name="adjustment">
<object class="GtkAdjustment">
<property name="upper">100</property>
<property name="value">50</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="spin_label">
<property name="label" translatable="yes">Spinbutton</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkSpinButton">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="adjustment">
<object class="GtkAdjustment">
<property name="upper">100</property>
<property name="value">50</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="dropdown_label">
<property name="label" translatable="yes">Dropdown</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkDropDown">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="model">
<object class="GtkStringList">
<items>
<item>Choice 1</item>
<item>Choice 2</item>
<item>Choice 3</item>
<item>Choice 4</item>
</items>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="entry_label">
<property name="label" translatable="yes">Entry</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkEntry">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="placeholder-text">Type here…</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
<object class="GtkSizeGroup">
<property name="mode">horizontal</property>
<widgets>
<widget name="switch_label"/>
<widget name="check_label"/>
<widget name="image_label"/>
<widget name="scale_label"/>
<widget name="spin_label"/>
<widget name="dropdown_label"/>
<widget name="entry_label"/>
</widgets>
</object>
</interface>

View File

@@ -104,7 +104,7 @@ activate_cb (GtkListView *list,
GdkAppLaunchContext *context; GdkAppLaunchContext *context;
GError *error = NULL; GError *error = NULL;
app_info = g_list_model_get_item (G_LIST_MODEL (gtk_list_view_get_model (list)), position); app_info = g_list_model_get_item (gtk_list_view_get_model (list), position);
/* Prepare the context for launching the application and launch it. This /* Prepare the context for launching the application and launch it. This
* code is explained in detail in the documentation for #GdkAppLaunchContext * code is explained in detail in the documentation for #GdkAppLaunchContext
@@ -166,6 +166,14 @@ do_listview_applauncher (GtkWidget *do_widget)
g_signal_connect (factory, "setup", G_CALLBACK (setup_listitem_cb), NULL); g_signal_connect (factory, "setup", G_CALLBACK (setup_listitem_cb), NULL);
g_signal_connect (factory, "bind", G_CALLBACK (bind_listitem_cb), NULL); g_signal_connect (factory, "bind", G_CALLBACK (bind_listitem_cb), NULL);
/* Create the list widget here.
*/
list = gtk_list_view_new_with_factory (factory);
/* We connect the activate signal here. It's the function we defined
* above for launching the selected application.
*/
g_signal_connect (list, "activate", G_CALLBACK (activate_cb), NULL);
/* And of course we need to set the data model. Here we call the function /* And of course we need to set the data model. Here we call the function
* we wrote above that gives us the list of applications. Then we set * we wrote above that gives us the list of applications. Then we set
* it on the list widget. * it on the list widget.
@@ -173,15 +181,8 @@ do_listview_applauncher (GtkWidget *do_widget)
* to create as many listitems as it needs to show itself to the user. * to create as many listitems as it needs to show itself to the user.
*/ */
model = create_application_list (); model = create_application_list ();
gtk_list_view_set_model (GTK_LIST_VIEW (list), model);
/* Create the list widget here. g_object_unref (model);
*/
list = gtk_list_view_new (GTK_SELECTION_MODEL (gtk_single_selection_new (model)), factory);
/* We connect the activate signal here. It's the function we defined
* above for launching the selected application.
*/
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 * because otherwise they might get too large or they might not

View File

@@ -101,7 +101,7 @@ gtk_clock_snapshot (GdkPaintable *paintable,
(GdkRGBA [4]) { BLACK, BLACK, BLACK, BLACK }); (GdkRGBA [4]) { BLACK, BLACK, BLACK, BLACK });
/* Next, draw the hour hand. /* Next, draw the hour hand.
* We do this using transforms again: Instead of computing where the angle * We do this using tranforms again: Instead of computing where the angle
* points to, we just rotate everything and then draw the hand as if it * points to, we just rotate everything and then draw the hand as if it
* was :00. We don't even need to care about am/pm here because rotations * was :00. We don't even need to care about am/pm here because rotations
* just work. * just work.
@@ -462,7 +462,8 @@ do_listview_clocks (GtkWidget *do_widget)
{ {
GtkWidget *gridview, *sw; GtkWidget *gridview, *sw;
GtkListItemFactory *factory; GtkListItemFactory *factory;
GtkSelectionModel *model; GListModel *model;
GtkNoSelection *selection;
/* This is the normal window setup code every demo does */ /* This is the normal window setup code every demo does */
window = gtk_window_new (); window = gtk_window_new ();
@@ -484,12 +485,16 @@ do_listview_clocks (GtkWidget *do_widget)
factory = gtk_signal_list_item_factory_new (); factory = gtk_signal_list_item_factory_new ();
g_signal_connect (factory, "setup", G_CALLBACK (setup_listitem_cb), NULL); g_signal_connect (factory, "setup", G_CALLBACK (setup_listitem_cb), NULL);
model = GTK_SELECTION_MODEL (gtk_no_selection_new (create_clocks_model ())); gridview = gtk_grid_view_new_with_factory (factory);
gridview = gtk_grid_view_new (model, factory);
gtk_scrollable_set_hscroll_policy (GTK_SCROLLABLE (gridview), GTK_SCROLL_NATURAL); gtk_scrollable_set_hscroll_policy (GTK_SCROLLABLE (gridview), GTK_SCROLL_NATURAL);
gtk_scrollable_set_vscroll_policy (GTK_SCROLLABLE (gridview), GTK_SCROLL_NATURAL); gtk_scrollable_set_vscroll_policy (GTK_SCROLLABLE (gridview), GTK_SCROLL_NATURAL);
model = create_clocks_model ();
selection = gtk_no_selection_new (model);
gtk_grid_view_set_model (GTK_GRID_VIEW (gridview), G_LIST_MODEL (selection));
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), gridview); gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), gridview);
g_object_unref (selection);
g_object_unref (model);
} }
if (!gtk_widget_get_visible (window)) if (!gtk_widget_get_visible (window))

View File

@@ -79,7 +79,7 @@ gtk_color_paintable_init (GdkPaintableInterface *iface)
/* /*
* Finally, we define the type. The important part is adding the paintable * Finally, we define the type. The important part is adding the paintable
* interface, so GTK knows that this object can indeed be drawn. * interface, so GTK knows that this object can indeed be drawm.
*/ */
G_DEFINE_TYPE_WITH_CODE (GtkColor, gtk_color, G_TYPE_OBJECT, G_DEFINE_TYPE_WITH_CODE (GtkColor, gtk_color, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GDK_TYPE_PAINTABLE, G_IMPLEMENT_INTERFACE (GDK_TYPE_PAINTABLE,
@@ -89,14 +89,14 @@ static GParamSpec *color_properties[N_COLOR_PROPS] = { NULL, };
static void static void
rgb_to_hsv (GdkRGBA *rgba, rgb_to_hsv (GdkRGBA *rgba,
double *h_out, gdouble *h_out,
double *s_out, gdouble *s_out,
double *v_out) gdouble *v_out)
{ {
double red, green, blue; gdouble red, green, blue;
double h, s, v; gdouble h, s, v;
double min, max; gdouble min, max;
double delta; gdouble delta;
red = rgba->red; red = rgba->red;
green = rgba->green; green = rgba->green;
@@ -226,7 +226,7 @@ gtk_color_set_property (GObject *object,
break; break;
case PROP_COLOR: case PROP_COLOR:
self->color = *(GdkRGBA *) g_value_get_boxed (value); self->color = *(GdkRGBA *) g_value_dup_boxed (value);
rgb_to_hsv (&self->color, &h, &s, &v); rgb_to_hsv (&self->color, &h, &s, &v);
self->h = round (360 * h); self->h = round (360 * h);
self->s = round (100 * s); self->s = round (100 * s);
@@ -523,7 +523,7 @@ gtk_color_list_init (GtkColorList *self)
g_bytes_unref (data); g_bytes_unref (data);
} }
GListModel * static GListModel *
gtk_color_list_new (guint size) gtk_color_list_new (guint size)
{ {
return g_object_new (GTK_TYPE_COLOR_LIST, return g_object_new (GTK_TYPE_COLOR_LIST,
@@ -627,23 +627,6 @@ setup_listitem_cb (GtkListItemFactory *factory,
gtk_expression_unref (color_expression); gtk_expression_unref (color_expression);
} }
static void
setup_selection_listitem_cb (GtkListItemFactory *factory,
GtkListItem *list_item)
{
GtkWidget *picture;
GtkExpression *color_expression, *expression;
expression = gtk_constant_expression_new (GTK_TYPE_LIST_ITEM, list_item);
color_expression = gtk_property_expression_new (GTK_TYPE_LIST_ITEM, expression, "item");
picture = gtk_picture_new ();
gtk_widget_set_size_request (picture, 8, 8);
gtk_expression_bind (color_expression, picture, "paintable", NULL);
gtk_list_item_set_child (list_item, picture);
}
static void static void
set_title (gpointer item, set_title (gpointer item,
const char *title) const char *title)
@@ -662,8 +645,9 @@ create_color_grid (void)
{ {
GtkWidget *gridview; GtkWidget *gridview;
GtkListItemFactory *factory; GtkListItemFactory *factory;
GListModel *model, *selection;
gridview = gtk_grid_view_new (NULL, NULL); gridview = gtk_grid_view_new ();
gtk_scrollable_set_hscroll_policy (GTK_SCROLLABLE (gridview), GTK_SCROLL_NATURAL); gtk_scrollable_set_hscroll_policy (GTK_SCROLLABLE (gridview), GTK_SCROLL_NATURAL);
gtk_scrollable_set_vscroll_policy (GTK_SCROLLABLE (gridview), GTK_SCROLL_NATURAL); gtk_scrollable_set_vscroll_policy (GTK_SCROLLABLE (gridview), GTK_SCROLL_NATURAL);
@@ -675,6 +659,13 @@ create_color_grid (void)
gtk_grid_view_set_max_columns (GTK_GRID_VIEW (gridview), 24); gtk_grid_view_set_max_columns (GTK_GRID_VIEW (gridview), 24);
gtk_grid_view_set_enable_rubberband (GTK_GRID_VIEW (gridview), TRUE); gtk_grid_view_set_enable_rubberband (GTK_GRID_VIEW (gridview), TRUE);
model = G_LIST_MODEL (gtk_sort_list_model_new (gtk_color_list_new (0), NULL));
selection = G_LIST_MODEL (gtk_multi_selection_new (model));
gtk_grid_view_set_model (GTK_GRID_VIEW (gridview), selection);
g_object_unref (selection);
g_object_unref (model);
return gridview; return gridview;
} }
@@ -786,63 +777,6 @@ bind_number_item (GtkSignalListItemFactory *factory,
g_free (string); g_free (string);
} }
static void
update_selection_count (GListModel *model,
guint position,
guint removed,
guint added,
gpointer data)
{
char *text;
text = g_strdup_printf ("%u", g_list_model_get_n_items (model));
gtk_label_set_label (GTK_LABEL (data), text);
g_free (text);
}
static void
update_selection_average (GListModel *model,
guint position,
guint removed,
guint added,
gpointer data)
{
guint n = g_list_model_get_n_items (model);
GdkRGBA c = { 0, 0, 0, 1 };
guint i;
GtkColor *color;
for (i = 0; i < n; i++)
{
color = g_list_model_get_item (model, i);
c.red += color->color.red;
c.green += color->color.green;
c.blue += color->color.blue;
g_object_unref (color);
}
color = gtk_color_new ("", c.red / n, c.green / n, c.blue / n);
gtk_picture_set_paintable (GTK_PICTURE (data), GDK_PAINTABLE (color));
g_object_unref (color);
}
static void
update_progress_cb (GtkSortListModel *model,
GParamSpec *pspec,
GtkProgressBar *progress)
{
guint total;
guint pending;
total = g_list_model_get_n_items (G_LIST_MODEL (model));
total = MAX (total, 1); /* avoid div by 0 below */
pending = gtk_sort_list_model_get_pending (model);
gtk_widget_set_visible (GTK_WIDGET (progress), pending != 0);
gtk_progress_bar_set_fraction (progress, (total - pending) / (double) total);
}
static GtkWidget *window = NULL; static GtkWidget *window = NULL;
GtkWidget * GtkWidget *
@@ -850,11 +784,10 @@ do_listview_colors (GtkWidget *do_widget)
{ {
if (window == NULL) if (window == NULL)
{ {
GtkMultiSelection *selection; GtkWidget *header, *gridview, *sw, *box, *dropdown;
GtkSortListModel *sort_model;
GtkWidget *header, *overlay, *gridview, *sw, *box, *dropdown;
GtkListItemFactory *factory; GtkListItemFactory *factory;
GListStore *factories; GListStore *factories;
GListModel *model;
GtkSorter *sorter; GtkSorter *sorter;
GtkSorter *multi_sorter; GtkSorter *multi_sorter;
GListStore *sorters; GListStore *sorters;
@@ -864,31 +797,11 @@ do_listview_colors (GtkWidget *do_widget)
PangoAttrList *attrs; PangoAttrList *attrs;
char *string; char *string;
guint len; guint len;
GtkWidget *selection_view;
GListModel *selection_filter;
GtkSelectionModel *no_selection;
GtkWidget *grid;
GtkWidget *selection_size_label;
GtkWidget *selection_average_picture;
GtkWidget *selection_info_toggle;
GtkWidget *selection_info_revealer;
GtkWidget *progress;
GtkCssProvider *provider;
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (provider, "/listview_colors/listview_colors.css");
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (provider),
800);
g_object_unref (provider);
sort_model = gtk_sort_list_model_new (gtk_color_list_new (0), NULL);
gtk_sort_list_model_set_incremental (sort_model, TRUE);
selection = gtk_multi_selection_new (G_LIST_MODEL (sort_model));
window = gtk_window_new (); window = gtk_window_new ();
gtk_window_set_title (GTK_WINDOW (window), "Colors"); gtk_window_set_title (GTK_WINDOW (window), "Colors");
header = gtk_header_bar_new (); header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
gtk_window_set_titlebar (GTK_WINDOW (window), header); gtk_window_set_titlebar (GTK_WINDOW (window), header);
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400); gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
@@ -896,95 +809,18 @@ do_listview_colors (GtkWidget *do_widget)
gtk_widget_get_display (do_widget)); gtk_widget_get_display (do_widget));
g_object_add_weak_pointer (G_OBJECT (window), (gpointer*)&window); g_object_add_weak_pointer (G_OBJECT (window), (gpointer*)&window);
overlay = gtk_overlay_new ();
gtk_window_set_child (GTK_WINDOW (window), overlay);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_overlay_set_child (GTK_OVERLAY (overlay), box);
progress = gtk_progress_bar_new ();
gtk_widget_set_hexpand (progress, TRUE);
gtk_widget_set_valign (progress, GTK_ALIGN_START);
g_signal_connect (sort_model, "notify::pending", G_CALLBACK (update_progress_cb), progress);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), progress);
selection_info_revealer = gtk_revealer_new ();
gtk_box_append (GTK_BOX (box), selection_info_revealer);
grid = gtk_grid_new ();
gtk_revealer_set_child (GTK_REVEALER (selection_info_revealer), grid);
gtk_widget_set_margin_start (grid, 10);
gtk_widget_set_margin_end (grid, 10);
gtk_widget_set_margin_top (grid, 10);
gtk_widget_set_margin_bottom (grid, 10);
gtk_grid_set_row_spacing (GTK_GRID (grid), 10);
gtk_grid_set_column_spacing (GTK_GRID (grid), 10);
label = gtk_label_new ("Selection");
gtk_widget_set_hexpand (label, TRUE);
gtk_widget_add_css_class (label, "title-3");
gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 5, 1);
gtk_grid_attach (GTK_GRID (grid), gtk_label_new ("Size:"), 0, 2, 1, 1);
selection_size_label = gtk_label_new ("0");
gtk_grid_attach (GTK_GRID (grid), selection_size_label, 1, 2, 1, 1);
gtk_grid_attach (GTK_GRID (grid), gtk_label_new ("Average:"), 2, 2, 1, 1);
selection_average_picture = gtk_picture_new ();
gtk_widget_set_size_request (selection_average_picture, 32, 32);
gtk_grid_attach (GTK_GRID (grid), selection_average_picture, 3, 2, 1, 1);
label = gtk_label_new ("");
gtk_widget_set_hexpand (label, TRUE);
gtk_grid_attach (GTK_GRID (grid), label, 4, 2, 1, 1);
sw = gtk_scrolled_window_new (); sw = gtk_scrolled_window_new ();
gtk_widget_set_hexpand (sw, TRUE); gtk_window_set_child (GTK_WINDOW (window), sw);
gtk_grid_attach (GTK_GRID (grid), sw, 0, 1, 5, 1);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
factory = gtk_signal_list_item_factory_new ();
g_signal_connect (factory, "setup", G_CALLBACK (setup_selection_listitem_cb), NULL);
selection_view = gtk_grid_view_new (NULL, factory);
gtk_widget_add_css_class (selection_view, "compact");
gtk_grid_view_set_max_columns (GTK_GRID_VIEW (selection_view), 200);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), selection_view);
sw = gtk_scrolled_window_new ();
gtk_box_append (GTK_BOX (box), sw);
gridview = create_color_grid (); gridview = create_color_grid ();
gtk_grid_view_set_model (GTK_GRID_VIEW (gridview), GTK_SELECTION_MODEL (selection));
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), gridview); gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), gridview);
gtk_widget_set_hexpand (sw, TRUE); model = gtk_grid_view_get_model (GTK_GRID_VIEW (gridview));
gtk_widget_set_vexpand (sw, TRUE); g_object_get (model, "model", &model, NULL);
selection_filter = G_LIST_MODEL (gtk_selection_filter_model_new (GTK_SELECTION_MODEL (selection)));
g_signal_connect (selection_filter, "items-changed", G_CALLBACK (update_selection_count), selection_size_label);
g_signal_connect (selection_filter, "items-changed", G_CALLBACK (update_selection_average), selection_average_picture);
no_selection = GTK_SELECTION_MODEL (gtk_no_selection_new (selection_filter));
gtk_grid_view_set_model (GTK_GRID_VIEW (selection_view), no_selection);
g_object_unref (no_selection);
selection_info_toggle = gtk_toggle_button_new ();
gtk_button_set_icon_name (GTK_BUTTON (selection_info_toggle), "emblem-important-symbolic");
gtk_widget_set_tooltip_text (selection_info_toggle, "Show selection info");
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), selection_info_toggle);
g_object_bind_property (selection_info_toggle, "active",
selection_info_revealer, "reveal-child",
G_BINDING_DEFAULT);
button = gtk_button_new_with_mnemonic ("_Refill"); button = gtk_button_new_with_mnemonic ("_Refill");
g_signal_connect (button, "clicked", g_signal_connect (button, "clicked",
G_CALLBACK (refill), G_CALLBACK (refill),
gtk_sort_list_model_get_model (sort_model)); gtk_sort_list_model_get_model (GTK_SORT_LIST_MODEL (model)));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), button); gtk_header_bar_pack_start (GTK_HEADER_BAR (header), button);
@@ -999,13 +835,15 @@ do_listview_colors (GtkWidget *do_widget)
gtk_label_set_width_chars (GTK_LABEL (label), len + 2); gtk_label_set_width_chars (GTK_LABEL (label), len + 2);
gtk_label_set_xalign (GTK_LABEL (label), 1); gtk_label_set_xalign (GTK_LABEL (label), 1);
g_signal_connect (selection, "items-changed", G_CALLBACK (items_changed_cb), label); g_signal_connect (gtk_grid_view_get_model (GTK_GRID_VIEW (gridview)),
"items-changed", G_CALLBACK (items_changed_cb), label);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), label); gtk_header_bar_pack_start (GTK_HEADER_BAR (header), label);
dropdown = gtk_drop_down_new_from_strings ((const char * const[]) { "8", "64", "512", "4096", "32768", "262144", "2097152", "16777216", NULL }); dropdown = gtk_drop_down_new ();
gtk_drop_down_set_from_strings (GTK_DROP_DOWN (dropdown), (const char *[]) { "8", "64", "512", "4096", "32768", "262144", "2097152", "16777216", NULL });
g_signal_connect (dropdown, "notify::selected", g_signal_connect (dropdown, "notify::selected",
G_CALLBACK (limit_changed_cb), G_CALLBACK (limit_changed_cb),
gtk_sort_list_model_get_model (sort_model)); gtk_sort_list_model_get_model (GTK_SORT_LIST_MODEL (model)));
g_signal_connect (dropdown, "notify::selected", g_signal_connect (dropdown, "notify::selected",
G_CALLBACK (limit_changed_cb2), G_CALLBACK (limit_changed_cb2),
label); label);
@@ -1080,19 +918,24 @@ do_listview_colors (GtkWidget *do_widget)
g_list_store_append (sorters, multi_sorter); g_list_store_append (sorters, multi_sorter);
g_object_unref (multi_sorter); g_object_unref (multi_sorter);
expression = gtk_cclosure_expression_new (G_TYPE_STRING, dropdown = gtk_drop_down_new ();
NULL,
0, NULL,
(GCallback)get_title,
NULL, NULL);
dropdown = gtk_drop_down_new (G_LIST_MODEL (sorters), expression);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_append (GTK_BOX (box), gtk_label_new ("Sort by:")); gtk_box_append (GTK_BOX (box), gtk_label_new ("Sort by:"));
gtk_box_append (GTK_BOX (box), dropdown); gtk_box_append (GTK_BOX (box), dropdown);
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), box); gtk_header_bar_pack_end (GTK_HEADER_BAR (header), box);
g_object_bind_property (dropdown, "selected-item", sort_model, "sorter", G_BINDING_SYNC_CREATE); expression = gtk_cclosure_expression_new (G_TYPE_STRING,
NULL,
0, NULL,
(GCallback)get_title,
NULL, NULL);
gtk_drop_down_set_expression (GTK_DROP_DOWN (dropdown), expression);
gtk_expression_unref (expression);
gtk_drop_down_set_model (GTK_DROP_DOWN (dropdown), G_LIST_MODEL (sorters));
g_object_unref (sorters);
g_object_bind_property (dropdown, "selected-item", model, "sorter", G_BINDING_SYNC_CREATE);
factories = g_list_store_new (GTK_TYPE_LIST_ITEM_FACTORY); factories = g_list_store_new (GTK_TYPE_LIST_ITEM_FACTORY);
@@ -1106,20 +949,25 @@ do_listview_colors (GtkWidget *do_widget)
set_title (factory, "Everything"); set_title (factory, "Everything");
g_list_store_append (factories, factory); g_list_store_append (factories, factory);
expression = gtk_cclosure_expression_new (G_TYPE_STRING, dropdown = gtk_drop_down_new ();
NULL,
0, NULL,
(GCallback)get_title,
NULL, NULL);
dropdown = gtk_drop_down_new (G_LIST_MODEL (factories), expression);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_append (GTK_BOX (box), gtk_label_new ("Show:")); gtk_box_append (GTK_BOX (box), gtk_label_new ("Show:"));
gtk_box_append (GTK_BOX (box), dropdown); gtk_box_append (GTK_BOX (box), dropdown);
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), box); gtk_header_bar_pack_end (GTK_HEADER_BAR (header), box);
g_object_bind_property (dropdown, "selected-item", gridview, "factory", G_BINDING_SYNC_CREATE); expression = gtk_cclosure_expression_new (G_TYPE_STRING,
NULL,
0, NULL,
(GCallback)get_title,
NULL, NULL);
gtk_drop_down_set_expression (GTK_DROP_DOWN (dropdown), expression);
gtk_expression_unref (expression);
g_object_unref (selection); gtk_drop_down_set_model (GTK_DROP_DOWN (dropdown), G_LIST_MODEL (factories));
g_object_unref (factories);
g_object_bind_property (dropdown, "selected-item", gridview, "factory", G_BINDING_SYNC_CREATE);
g_object_unref (model);
} }
if (!gtk_widget_get_visible (window)) if (!gtk_widget_get_visible (window))

View File

@@ -1,3 +0,0 @@
.view.compact > child {
padding: 1px;
}

View File

@@ -225,7 +225,7 @@ filebrowser_view_activated_cb (GtkGridView *view,
{ {
GFileInfo *info; GFileInfo *info;
info = g_list_model_get_item (G_LIST_MODEL (gtk_grid_view_get_model (view)), pos); info = g_list_model_get_item (gtk_grid_view_get_model (view), pos);
if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY)
gtk_directory_list_set_file (list, G_FILE (g_file_info_get_attribute_object (info, "standard::file"))); gtk_directory_list_set_file (list, G_FILE (g_file_info_get_attribute_object (info, "standard::file")));

View File

@@ -1,11 +1,11 @@
listview.viewswitcher { list.viewswitcher {
border: 1px solid gray; border: 1px solid gray;
} }
listview.viewswitcher > row { list.viewswitcher > row {
padding: 5px; padding: 5px;
} }
listview.viewswitcher row:selected { list.viewswitcher row:selected {
background: gray; background: gray;
} }

View File

@@ -165,19 +165,16 @@
</object> </object>
</child> </child>
</object> </object>
<object class="GtkSingleSelection" id="selection_model">
<property name="model">
<object class="GtkDirectoryList" id="dirlist"> <object class="GtkDirectoryList" id="dirlist">
<property name="attributes">standard::name,standard::display-name,standard::icon,standard::size,standard::content-type</property> <property name="attributes">standard::name,standard::display-name,standard::icon,standard::size,standard::content-type</property>
</object> </object>
</property>
</object>
<object class="GtkWindow" id="window"> <object class="GtkWindow" id="window">
<property name="title" translatable="yes">File browser</property> <property name="title" translatable="yes">File browser</property>
<property name="default-width">600</property> <property name="default-width">600</property>
<property name="default-height">400</property> <property name="default-height">400</property>
<child type="titlebar"> <child type="titlebar">
<object class="GtkHeaderBar" id=""> <object class="GtkHeaderBar" id="">
<property name="show-title-buttons">1</property>
<child> <child>
<object class="GtkButton"> <object class="GtkButton">
<property name="icon-name">go-up-symbolic</property> <property name="icon-name">go-up-symbolic</property>
@@ -231,7 +228,7 @@
<property name="can-focus">1</property> <property name="can-focus">1</property>
<child> <child>
<object class="GtkGridView" id="view"> <object class="GtkGridView" id="view">
<property name="model">selection_model</property> <property name="model">dirlist</property>
<property name="max-columns">15</property> <property name="max-columns">15</property>
<binding name="factory"> <binding name="factory">
<lookup name="factory" type="FileBrowserView"> <lookup name="factory" type="FileBrowserView">

View File

@@ -6,6 +6,7 @@
<property name="title" translatable="yes">Minesweeper</property> <property name="title" translatable="yes">Minesweeper</property>
<child type="titlebar"> <child type="titlebar">
<object class="GtkHeaderBar" id=""> <object class="GtkHeaderBar" id="">
<property name="show-title-buttons">1</property>
<child> <child>
<object class="GtkButton"> <object class="GtkButton">
<property name="label">New Game</property> <property name="label">New Game</property>

View File

@@ -5,10 +5,6 @@
* It demonstrates how to implement support for trees with GtkListView. * It demonstrates how to implement support for trees with GtkListView.
* It also shows how to set up sorting and filtering for columns in a * It also shows how to set up sorting and filtering for columns in a
* GtkColumnView. * GtkColumnView.
*
* It also demonstrates different styles of list. The tree on the left
* uses the ­.navigation-sidebar style class, the list on the right uses
* the ­.data-table style class.
*/ */
#include <gtk/gtk.h> #include <gtk/gtk.h>
@@ -218,6 +214,8 @@ transform_settings_to_keys (GBinding *binding,
GtkSortListModel *sort_model; GtkSortListModel *sort_model;
GtkFilterListModel *filter_model; GtkFilterListModel *filter_model;
GtkFilter *filter; GtkFilter *filter;
GtkNoSelection *selection_model;
GtkExpression *expression;
char **keys; char **keys;
guint i; guint i;
@@ -245,13 +243,24 @@ transform_settings_to_keys (GBinding *binding,
g_object_unref (settings); g_object_unref (settings);
sort_model = gtk_sort_list_model_new (G_LIST_MODEL (store), sort_model = gtk_sort_list_model_new (G_LIST_MODEL (store),
g_object_ref (gtk_column_view_get_sorter (GTK_COLUMN_VIEW (data)))); gtk_column_view_get_sorter (GTK_COLUMN_VIEW (data)));
g_object_unref (store);
filter = gtk_string_filter_new (gtk_property_expression_new (SETTINGS_TYPE_KEY, NULL, "name")); expression = gtk_property_expression_new (SETTINGS_TYPE_KEY, NULL, "name");
g_set_object (&current_filter, filter); filter = gtk_string_filter_new ();
gtk_string_filter_set_expression (GTK_STRING_FILTER (filter), expression);
filter_model = gtk_filter_list_model_new (G_LIST_MODEL (sort_model), filter); filter_model = gtk_filter_list_model_new (G_LIST_MODEL (sort_model), filter);
gtk_expression_unref (expression);
g_object_unref (sort_model);
g_value_take_object (to_value, gtk_no_selection_new (G_LIST_MODEL (filter_model))); g_set_object (&current_filter, filter);
g_object_unref (filter);
selection_model = gtk_no_selection_new (G_LIST_MODEL (filter_model));
g_object_unref (filter_model);
g_value_take_object (to_value, selection_model);
return TRUE; return TRUE;
} }
@@ -362,8 +371,6 @@ do_listview_settings (GtkWidget *do_widget)
builder = gtk_builder_new (); builder = gtk_builder_new ();
gtk_builder_set_scope (builder, scope); gtk_builder_set_scope (builder, scope);
g_object_unref (scope);
gtk_builder_add_from_resource (builder, "/listview_settings/listview_settings.ui", NULL); gtk_builder_add_from_resource (builder, "/listview_settings/listview_settings.ui", NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window")); window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
@@ -400,8 +407,8 @@ do_listview_settings (GtkWidget *do_widget)
g_object_unref (actions); g_object_unref (actions);
model = create_settings_model (NULL, NULL); model = create_settings_model (NULL, NULL);
treemodel = gtk_tree_list_model_new (model, treemodel = gtk_tree_list_model_new (FALSE,
FALSE, model,
TRUE, TRUE,
create_settings_model, create_settings_model,
NULL, NULL,
@@ -413,8 +420,10 @@ do_listview_settings (GtkWidget *do_widget)
transform_settings_to_keys, transform_settings_to_keys,
NULL, NULL,
columnview, NULL); columnview, NULL);
gtk_list_view_set_model (GTK_LIST_VIEW (listview), GTK_SELECTION_MODEL (selection)); gtk_list_view_set_model (GTK_LIST_VIEW (listview), G_LIST_MODEL (selection));
g_object_unref (selection); g_object_unref (selection);
g_object_unref (treemodel);
g_object_unref (model);
name_column = GTK_COLUMN_VIEW_COLUMN (gtk_builder_get_object (builder, "name_column")); name_column = GTK_COLUMN_VIEW_COLUMN (gtk_builder_get_object (builder, "name_column"));
sorter = gtk_string_sorter_new (gtk_property_expression_new (SETTINGS_TYPE_KEY, NULL, "name")); sorter = gtk_string_sorter_new (gtk_property_expression_new (SETTINGS_TYPE_KEY, NULL, "name"));

View File

@@ -6,6 +6,7 @@
<property name="default-height">480</property> <property name="default-height">480</property>
<child type="titlebar"> <child type="titlebar">
<object class="GtkHeaderBar"> <object class="GtkHeaderBar">
<property name="show-title-buttons">1</property>
<child type="end"> <child type="end">
<object class="GtkToggleButton" id="search_button"> <object class="GtkToggleButton" id="search_button">
<property name="icon-name">system-search-symbolic</property> <property name="icon-name">system-search-symbolic</property>
@@ -20,9 +21,6 @@
<object class="GtkScrolledWindow"> <object class="GtkScrolledWindow">
<child> <child>
<object class="GtkListView" id="listview"> <object class="GtkListView" id="listview">
<style>
<class name="navigation-sidebar"/>
</style>
<property name="factory"> <property name="factory">
<object class="GtkBuilderListItemFactory"> <object class="GtkBuilderListItemFactory">
<property name="bytes"><![CDATA[ <property name="bytes"><![CDATA[
@@ -76,9 +74,6 @@
<property name="vexpand">1</property> <property name="vexpand">1</property>
<child> <child>
<object class="GtkColumnView" id="columnview"> <object class="GtkColumnView" id="columnview">
<style>
<class name="data-table"/>
</style>
<child> <child>
<object class="GtkColumnViewColumn" id="name_column"> <object class="GtkColumnViewColumn" id="name_column">
<property name="title">Name</property> <property name="title">Name</property>

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