Commit Graph

416 Commits

Author SHA1 Message Date
Matthias Clasen
17819ad4f6 filechooser: Improve "Open in File Manager"
Just relying on GAppInfo leads to suboptimal
results. Instead, call either the OpenURI portal
or the org.freedesktop.FileManager1 interface
directly, and only fall back to GAppInfo.

The wrapper code for the OpenURI portal is taken
from gio, with small adjustments.

Fixes: #5260
2022-10-19 15:01:21 -04:00
Matthias Clasen
ee8c2a235f stylecontext: Deprecate most apis
The notable exception here are the global provider apis,
which are needed in some form and don't have a replacement
yet. Move them to gtkstyleprovider.[hc], so we can wholly
deprecated gtkstylecontext.[hc].
2022-10-12 15:35:00 -04:00
Matthias Clasen
73f991a7fd Add gtk_css_style_snapshot_layout
This function renders a PangoLayout at a given
position, using text shadows and color from css.
2022-10-12 15:35:00 -04:00
Matthias Clasen
35370752d5 Deprecate gtk_render apis
These take a GtkStyleContext as argument, and we
want to get rid of GtkStyleContext eventually.
The proper drawing api these days is gtk_snapshot.
2022-10-12 15:35:00 -04:00
Matthias Clasen
5e256590db Deprecate treeviews and cell renderers
This includes

GtkCellArea
GtkCellAreaBox
GtkCellAreaContext
GtkCellEditable
GtkCellRenderer
GtkCellRendererAccel
GtkCellRendererCombo
GtkCellRendererPixbuf
GtkCellRendererProgress
GtkCellRendererSpin
GtkCellRendererSpinner
GtkCellRendererText
GtkCellRendererToggle
GtkCellView
GtkComboBox
GtkComboBoxText
GtkIconView
GtkListStore
GtkTreeModel
GtkTreeModelFilter
GtkTreeModelSort
GtkTreeStore
GtkTreeView
GtkTreeViewColumn
GtkTreeSelection
2022-10-11 17:18:21 -04:00
Matthias Clasen
d4dd0dcd79 Merge branch 'accessible_range_interface' into 'main'
Introduce GtkAccessibleRange

See merge request GNOME/gtk!5066
2022-10-05 11:33:56 +00:00
Matthias Clasen
7e9ca5b41d Deprecate GtkEntryCompletion
We want to drop cell renderers and tree models
in GTK 5. The functionality of GtkEntryCompletion
may be replaced by a new widget in GTK 5.
2022-10-03 23:23:56 -04:00
Matthias Clasen
a527a4d82e Deprecate the app chooser widgets
These are a family of pretty specialized widgets, and
are very rarely used. Instead of porting them away
from GtkTreeView and GtkComboBox, deprecate them.
2022-10-03 23:02:09 -04:00
Matthias Clasen
adfc29968a Revert "gtk: Use gnome.mkenums_simple"
This reverts commit 11829fe7d0.

The mkenums_simple function can't properly handle headers
in subdirectories currently, so go back to the template
version.
2022-10-03 22:20:07 -04:00
Lukáš Tyrychtr
a7814a0963 Introduce GtkAccessibleRange
This introduces GtkAccessibleRange, an interface which allows the accessibility backend to work with a control which can adjust a value.
2022-09-29 09:36:08 +02:00
Matthias Clasen
11829fe7d0 gtk: Use gnome.mkenums_simple
This lets us avoid template files, and works just as well.
2022-09-24 21:23:00 -04:00
Matthias Clasen
f141da6b55 gtk: Dissolve gtk-autocleanup.h
Move the autocleanup declarations into their
respective headers.
2022-09-23 23:07:43 -04:00
Simon McVittie
60a83a51c3 build: Use more conservative GResource embedding on non-x86_64
Doing clever things with objcopy is faster and seems to be reliable on
x86_64 Linux, but also doesn't work on all toolchains and architectures:
in particular, Debian has had trouble with this on arm and mips.
In a distro build environment where we are compiling all of GTK every
time, the cost of potentially unreliable builds is higher than the cost
of using slower but more conservative GResource embedding.

Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/5107
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-09-17 21:50:38 +01:00
Luca Bacci
86a38918d7 Implement GtkColorPicker for Windows
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5136
2022-09-01 19:25:07 +02:00
Marc-André Lureau
8ab57fc8ef build-sys: generate GdkWin32.gir
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-08-19 17:42:30 +04:00
Benjamin Otte
b6a8080b2f Add GtkInscription
A label alternative that renders itself into a given rectangle.

The main use case is cells in column view.

Related: #3334
2022-06-09 05:58:27 +02:00
Matthias Clasen
c0747f2c2e Add an explicit harfbuzz dependency
We are using Harfbuzz api in the file chooser,
so lets make this official.
2022-05-15 10:37:24 -04:00
Matthias Clasen
8bd77441a9 Cosmetic fixes to objcopy hack
Preserve the elf section name that we would get
without the objcopy hack. Minimizing the differences
2022-05-14 07:53:47 -04:00
Matthias Clasen
b6b2682bd6 build: Avoid objcopy on arm
The trickery we do with objcopy and ld to speed up
resource inclusion does not seem to work right on
32bit Arm, so just skip it there.

Fixes: #4757, #4748, #4752
2022-03-14 08:44:09 -04:00
Kévin Commaille
d8c79e91a2
emoji: Add more locales
Based on the locales that are at least 85% translated in Damned Lies:
https://l10n.gnome.org/releases/gnome-41/
Limited by the locales available in emojibase

Closes #4568
2022-02-22 11:28:15 +01:00
Chun-wei Fan
ee2dd1acc7 gtk/meson.build: Fix builds without PangoFT2
We aren't really using PangoFT2 for [language|script]-names.c, and are
always using items from them, so make sure they are being built.

Also always include the pangoft2 dependency in gtk_dep if it is found.
2022-01-12 17:29:28 +08:00
Matthias Clasen
70732afb95 Drop the script name data
It is not used in GTK itself, and gtk4-demo
has its own copy.
2022-01-10 10:43:05 -05:00
Simon McVittie
17c2a1cb4e build: Tell glib-compile-resources to make symbols internal where possible
Partial solution to https://gitlab.gnome.org/GNOME/gtk/-/issues/4598

Signed-off-by: Simon McVittie <smcv@debian.org>
2022-01-04 18:08:22 +00:00
Matthias Clasen
46509b6dd2 Make our stack noexec
The change to use ld and objcopy for resources
had some side-effects: it leaked a few symbols
and made our stack executable. We don't want that.

Use -z nonexecstack and --strip-all to avoid this.

Fixes: #4598
2022-01-04 07:51:56 -05:00
Emmanuele Bassi
a70988ecd5 build: Remove deprecated get_pkgconfig_variable()
Replace it with `get_variable(pkgconfig:...)`.
2021-12-24 15:55:26 +00:00
Chun-wei Fan
e2b4108377 Revert "gtk/meson.build: Fix linking on Visual Studio 2013"
We now require a Pango version that requires Visual Studio 2015 or later to
build, and non-UCRT-based (VS2013) binaries may not bode well with
UCRT-based binaries (VS2015+). Drop the support for VS2013 as a result.

This reverts commit e208e0e07886248d4d86118aa5591c9882f0ed5c.
2021-12-14 10:29:28 +08:00
Emmanuele Bassi
a1861112ee build: Don't use ld when cross-compiling
We can't guarantee anything on the target toolchain, in that case.
2021-11-04 13:41:35 +00:00
Matthias Clasen
8079f8ea3c Add depfiles back to resource generation
The recent change to faster resource generation
lost the depfiles to ensure that we regenerate
resources when any of the contents change.
Bring it back.
2021-10-03 22:23:56 -04:00
Matthias Clasen
e9828f1fcd Fix the build
I messed this up when I changed how we build resources.
2021-10-01 12:56:05 -04:00
Matthias Clasen
6339875989 Fix an oversight 2021-09-30 23:45:33 -04:00
Matthias Clasen
802ad39209 gtk: Speed up build
Avoid serializing the gresource blob into a C string
and running gcc over it. Instead, use ld to put it
directly into an .o file and add it to the build.

The build system machinations here were copied from
gobject/tests/meson.build, and should ideally be part
of the meson gnome module.
2021-09-30 23:30:48 -04:00
Matthias Clasen
1430142ad8 Revert "Add delayed loading for textures"
This reverts commit 4a89cfe2c9.
2021-09-21 23:10:53 -04:00
Matthias Clasen
4a89cfe2c9 Add delayed loading for textures
Add a private GdkPaintable implementation that
loads a texture in a thread, and does not show
anything until the texture is loaded. This avoid
blocking on image loading in the main thread.
2021-09-18 17:35:00 -04:00
James Westman
0782c8a051
gdk_rgba_parse: Support HSL colors 2021-09-10 16:56:42 -05:00
Matthias Clasen
3667c6b053 Merge branch 'wip/smcv/compose-files' into 'master'
Fix Compose handling on big-endian host architectures

Closes #4217

See merge request GNOME/gtk!3902
2021-08-30 12:52:54 +00:00
Simon McVittie
52cdf3056d compose: Generate endian-dependent compact Compose data
The GtkComposeTable cache is always in big-endian format and is
byteswapped on load for the more common little-endian CPUs, but
init_builtin_table() in GtkIMContextSimple can't byteswap the built-in
data without copying it, which is undesirable. Pregenerate both big-
and little-endian compose data, and compile the correct flavour into
each build of GTK. This fixes failure of the composetable test when
building for a big-endian architecture such as s390x and (traditional,
big-endian) powerpc.

Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/4217
Signed-off-by: Simon McVittie <smcv@debian.org>
2021-08-30 11:29:46 +01:00
Benjamin Otte
49d109c29e gtk: Add the GtkSymbolicPaintable interface 2021-08-29 04:29:53 +02:00
Kalev Lember
552a4b2c82 build: Fix detection for pre-compiled css files
The default theme changed from Adwaita to Default and this tripped up
the logic to detect if the tarball builds contain pre-built css files or
not. Fix this by looking at pre-compiled css files in themes/Default/
instead of themes/Adwaita/.
2021-08-23 16:15:48 +02:00
Matthias Clasen
d923402934 css: Add line-height property
This adds the plumbing to parse the line-height
property from CSS. Widgets are not picking it
up yet.
2021-08-22 15:15:50 -04:00
Matthias Clasen
5c4aba4b9c Merge branch 'wip/compose-parser' into 'master'
Clean up the GtkComposeTable api

See merge request GNOME/gtk!3746
2021-07-26 11:51:14 +00:00
Benjamin Otte
af0c95c11a build: Remove sassc option
Instead, ensure that sassc is made madatory on git builds (because
it is, we don't ship CSS files anymore) and not even looked for in
release builds (because do ship CSS files there).
2021-07-20 14:00:25 -04:00
Matthias Clasen
54dffa07f3 composetable: Drop GtkComposeTableCompact
All tables use the compact format now, and we generate
caches in that format too. Bump the cache version to 3
for this.

Replace the python script for generating the builtin table
by a small C program using the same code to generate the data
for the builtin table. This drops the restriction on only
generating a single character in the builtin sequences.
2021-07-13 22:03:23 -04:00
Marc-André Lureau
a009e26e95 gtk: fix GtkPasswordEntryBuffer introspection
Move the source file to public_sources list, and fix tag annotation.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-07-13 15:03:09 +04:00
Christian Hergert
d63d9b2319 joinedmenu: add helper to join menus instead of nesting
In many cases, we have an "extra-menu" property that is used to allow
applications to join menus into the native menu for the widget. Previously,
this was done by nesting that menu in a section.

Doing so increases the complexity of the rules for GtkMenuTracker as you
may want different handling from inside of the section vs toplevel
sections.

If instead we synthetically glue the menus together, we have a much more
natural joining of menus as the application developer would expect for
their menu.

This also ports GtkLabel, GtkText, GtkPasswordEntry, and GtkTextView to
use the joined menu helper.

The joined menu helper comes originally from GNOME Builder and has had
extensive use there.

Fixes #4094
2021-07-08 14:16:06 -07:00
Xavier Claessens
0fd790eb8d Meson: Only g-ir-scanner warnings fatal when buit with -Dwerror=true
Also fix deprecation warning that requires using fatal_warnings kwarg
from Meson 0.55.0.

Fixes: #4072.
2021-06-25 11:38:11 -04:00
Xavier Claessens
b18e95d6b3 meson: Fix generate_gir() dependencies
There is no need to search for gir variables into subprojects, they are
part of dependencies objects, meson will find them there.
2021-06-25 10:08:36 -04:00
Matthias Clasen
621e0a13e9 Install gtkpasswordentrybuffer.h 2021-06-08 07:49:42 -04:00
Matthias Clasen
d32c343657 Merge branch 'fix.vs2013.link' into 'master'
gtk/meson.build: Fix linking on Visual Studio 2013

See merge request GNOME/gtk!3575
2021-05-25 20:27:54 +00:00
Emmanuele Bassi
e13da35d4d Turn introspection scanner warnings into errors
We want to catch errors in our annotations or our API.
2021-05-25 19:16:37 +01:00
Chun-wei Fan
943559da67 gtk/meson.build: Fix linking on Visual Studio 2013
Visual Studio 2013's linker does not suport `/WHOLEARCHIVE:`, so just
explicitly extract the objects from the static libraries that will
form the final GTK DLL.
2021-05-24 10:30:34 +08:00