Commit Graph

362 Commits

Author SHA1 Message Date
Emmanuele Bassi
51bc6ce2e4 build: Disable subproject Cairo tests
There's really no point in running them.
2021-01-29 16:31:10 +00:00
Matthias Clasen
ac0f524722 build: Redo the tools build
Move the tools directory to be toplevel, and instead of
recompiling sources twice, link them with the our new
static libgtk.a.
2021-01-28 12:27:07 -05:00
Matthias Clasen
e6f0103940 Merge branch 'version-bump' into 'master'
Version bump

See merge request GNOME/gtk!3093
2021-01-19 04:48:26 +00:00
Matthias Clasen
ee43a6a603 Bump version to 4.1
master is now open for 4.2 API additions.

Includes an update for the one test we have that
has the version number in its expected output.
2021-01-18 23:09:44 -05:00
Matthias Clasen
1edbc1f1f9 Merge branch 'wip/jtojnar/fix-pc-vulcan' into 'master'
build: Use Meson’s module for building .pc files

Closes #3517

See merge request GNOME/gtk!3005
2021-01-19 04:04:34 +00:00
Matthias Clasen
146b4c93ba 4.0.2 2021-01-18 22:23:57 -05:00
Matthias Clasen
13ef82fc4d dist: Add a dist script to generate css
When I added the sassc option, I failed to ensure that
the theme css is included in the tarballs. This is required
to make tarball builds with -Dsassc=disabled work.
2021-01-12 08:42:18 -05:00
Matthias Clasen
60835227a1 4.0.1 2021-01-09 01:30:13 -05:00
Matthias Clasen
77feb51b9c Pass coretext=enabled to harfbuzz
When we use harfbuzz as a subproject on OS X,
we (or rather, pango) need coretext support.
2021-01-03 21:34:04 -05:00
Matthias Clasen
d55f938f7c printing: cairo-pdf is needed
The print backends need cairos pdf support, which is
contingent on zlib, so enable that when using cairo
as a subproject, as we do in ci for MacOS.
2021-01-03 21:34:04 -05:00
Matthias Clasen
45bb4dc80c ci: Add a macos build
Most of this is cribbed from glib.

We don't use COMMON_MESON_FLAGS here, since disabling
-Werror one subproject at a time is too painful for
all the promoted sub-sub-projects. This needs a better
solution in meson.

Since this is a full rebuild of the entire stack, limit
this to master and merge requests.
2021-01-03 21:34:04 -05:00
Jan Tojnar
7d5826ccf7
build: Fix vulkan reference in pc file
A mistake in string concatenation caused the vulcan dependency to be omitted.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3517
2020-12-27 06:42:29 +01:00
Jan Tojnar
2c9f2325e2
build: Use Meson’s module for building .pc files
Using the module will prevent trivial bugs caused by incorrect string concatenation.

This is just a literal translation. In the future we might rely on Meson auto-detecting fields from library declaration.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3517
2020-12-27 06:27:59 +01:00
Emmanuele Bassi
fa35e3b874 Pass the bindir to the post-install script 2020-12-20 16:33:25 +00:00
Emmanuele Bassi
2da8d9b0ac Do not build gdk-pixbuf's man page
When using it as a sub-project. We don't really need them.
2020-12-17 20:50:16 +00:00
Matthias Clasen
591c2f0595 4.0 2020-12-16 12:12:58 -05:00
Emmanuele Bassi
618186723a build: Remove unused backend_immodules variable
We don't have input method modules any more.
2020-12-15 11:20:19 +00:00
Emmanuele Bassi
a5986f0dcd build: Use get_supported_link_arguments()
Instead of hand-coding it ourselves, let Meson deal with linker
arguments discovery.
2020-12-15 11:19:39 +00:00
Emmanuele Bassi
2457f3d54c build: Bump up the SONAME for GTK4
We released all the 3.9x development snapshots using:

  libgtk-4.0.so.0.xxxx.y

which means that the 4.0.0 release of GTK will have a lower SONAME than
the snapshots. To avoid that, bump the SONAME to 1.xxxx.y.

Fixes: #3392
2020-12-09 12:19:50 +00:00
Emmanuele Bassi
1cc207af32 build: Tie interface age to the development cycle
We don't want to increase the interface age manually, because we're
going to end up forgetting about it.

Instead, we should tie it to the rest of the version:

 - in stable (even minor) cycles, we don't add new API; the interface
   age is the same as the micro version
 - in unstable (odd minor) cycles, every new release might have new API,
   or updates to newly added API; keep the interface age to 0

This removes one more manual thing to change during release, and keeps
us honest with our promise not to add symbols during stable cycles.
2020-12-09 12:19:50 +00:00
Matthias Clasen
398a74d871 3.99.5 2020-12-08 10:58:40 -05:00
Emmanuele Bassi
803b147483 Disable deprecation warnings from GLib
We don't want to test the latest changes in GLib in our own build.
2020-11-23 13:04:11 +00:00
Emmanuele Bassi
de7833b6a0 Use the right GLib macros for version checking
There's a typo in the name, and we never noticed.
2020-11-23 12:06:22 +00:00
Matthias Clasen
3eaae748d3 3.99.4 2020-11-04 21:46:10 -05:00
Xavier Claessens
6ae9f7e7c3 meson: Simplify xinerama dependency check 2020-10-17 09:54:47 -04:00
Xavier Claessens
efbbfb6547 meson: Simplify how cairo dependencies are checked
There is no reason to fallback to find_library for cairo and still rely
on pkg-config for all other dependencies, and just when using MSVC. When
building and pkg-config is not working it is preferable to fallback to a
subproject just like for all other dependencies.

Also add cairo.wrap now that meson support has been merged upstream.
2020-10-17 09:54:47 -04:00
Matthias Clasen
1021e12121 3.99.3 2020-10-15 23:03:03 -04:00
Xavier Claessens
fe89fd2317 meson: Fix error when epoxy is a subproject on Windows
epoxy_dep cannot be used in a configure time check when it comes from a
subproject. Use variables set in pc file instead.

This requires https://github.com/anholt/libepoxy/pull/231.
2020-10-15 08:01:16 -04:00
Timm Bäder
ef7c5747c4 build: Only add -Wcast-align for gcc
Either we or clang needs to get its shit together about this warning.
But using it during development with clang just makes actually usable
warnings get lost in a flood of -Wcast-align warnings.
2020-10-14 15:06:12 -04:00
Christian Hergert
fb02c99868 macos: port gtk to GDK_WINDOWING_MACOS
For the various uses of GDK_WINDOWING_QUARTZ, we need to use
alternatives from GDK_WINDOWING_MACOS.

Some minor loss of functionality is here, such as icons sent with
application menus. That can certainly be added back at a future
point.
2020-10-14 15:06:12 -04:00
Matthias Clasen
2d927d0ee0 build: Require sysprof 3.38.0
We use sysprof_collector_request_counters, which
was introduced in sysprof 3.38.0.
2020-10-14 15:05:46 -04:00
Matthias Clasen
ffb51b6888 Require gtk-doc 1.33
We'll hopefully get a gtk-doc release out with that
version number soon.
2020-10-01 15:09:26 -04:00
Matthias Clasen
21c8bc2b47 build: Require meson 0.54 2020-09-30 15:26:20 -04:00
Xavier Claessens
fd1e8afe9d meson: Change introspection option to yielding feature
Yielding option means that if pango is built as a subproject, it will
take the value of that option from the parent project (e.g. gst-build).
For that to work it must be of the same type, which is "feature" instead
of "boolean" in all GStreamer modules.
2020-09-30 15:11:27 -04:00
Matthias Clasen
218b905a88 3.99.2 2020-09-29 14:44:31 -04:00
Matthias Clasen
6b9622f0da Try one more time to fix win32 ci 2020-09-19 08:13:35 -04:00
Matthias Clasen
69d5dc7c9a fontchooser: Determine sample text intelligently
Look at the languages supported by a font, and pick
a suitable sample text from the pango list of sample
texts. We can only implement this on platforms using
fontconfig, since it relies on pangofc apis.

This bumps the pango dependency to 1.47.1.
2020-09-18 23:04:39 -04:00
Timm Bäder
40ee7186bf build: Unify two if statements
They both check glib_minor_req.is_odd()
2020-09-15 05:21:53 +02:00
Emmanuele Bassi
107e49002d Check for mlock()
We use it in the secure memory allocator, if it's available.
2020-09-08 23:50:12 +01:00
Matthias Clasen
f70e37a341 Merge branch 'release-script' into 'master'
Release script

See merge request GNOME/gtk!2530
2020-09-04 15:30:35 +00:00
Matthias Clasen
a8eae7afaa build: Move the gtk-doc dep to the toplevel
We want to include the gtk-doc subproject in release
tarballs, using --include-subprojects, but that only
works if we've actually built the subproject. And
enabling gtk-doc for dist builds is problematic -
it tends to break meson dist.

So declare the gtk-doc dependency independent of
-Dgtk_doc, and use --force-fallback-for for it.
2020-09-04 09:57:14 -04:00
Emmanuele Bassi
1896d7f463 build: Make sysprof truly optional
We are falling back to the sysprof subproject even if sysprof support
has been explicitly disabled.

Fixes: #3118
2020-09-04 12:02:15 +01:00
Nirbheek Chauhan
b25871438d meson: Fix Vulkan dependency checking
The dependency block was completely wrong. It was:

1. Not searching for the lib manually when -Dvulkan=enabled (default).
   The else block was only hit when -Dvulkan=auto.
2. Unconditionally searching for the vulkan library in the else block
   when -Dvulkan=disabled

The manual searching is also not required because Meson has a custom
'vulkan' dependency class that already supports Windows, and is more
correct than the code here. Specifically, the current code does not
support picking up the Vulkan SDK from a custom path.

Fixes #3108
2020-09-04 11:50:50 +05:30
Matthias Clasen
1a131a04d3 3.99.1 2020-09-03 14:20:06 -04:00
Matthias Clasen
c4d350c260 build: Start using meson feature options
Use feature options for things that are optional features,
update the docs.

Visible changes here is that the 'print-backends' option
got renamed to 'print' to go better with 'media', and the
'tracker3' option got renamed to 'tracker'.

For options that have been changed into features, the
syntax now is -Dfeature=enabled or -Dfeature=disabled
or -Dfeature=auto.
2020-08-23 16:45:15 -04:00
Matthias Clasen
e915a1aa7f Rename the profiler option
We don't support any profilers other than sysprof,
so name the option accordingly. While we are at it,
change it to a meson feature option, so
-Dprofiler=true becomes -Dsysprof=enabled
2020-08-21 18:51:48 -04:00
Matthias Clasen
81e88c1d9e Alterative sysprof build support
Don't link libgtk against libsysprof. We only
need that for the test-performance binary.
2020-08-21 18:28:29 -04:00
Christian Hergert
5a5b30681e testsuite: use SysprofProfiler for profiling
Instead of using sysprof-cli to profile subprocesses, this uses
libsysprof's SysprofProfiler directly so that we can avoid an indirect
subprocess as well as disabling the polkit nag.

To do this, we have to link against libsysprof instead of
libsysprof-capture. This is limited to the -Dbuild-tests=true and
-Dprofiler=true case.
2020-08-21 13:51:52 -07:00
Matthias Clasen
d4e069a629 Port tracing to the sysprof collector api
Use the new sysprof collector api to do tracing.
2020-08-21 10:55:01 -04:00
Matthias Clasen
15325fe546 Bump the pango dependency
Require pango 1.45.5, so we can use pango_color_parse_with_alpha.
2020-08-02 23:30:33 -04:00
Matthias Clasen
e0d1aac8a5 Bump the glib dependency
Some of the new apis we want to use to avoid
deprecations were only introduced in 2.65.
2020-07-31 13:07:31 -04:00
Matthias Clasen
554954d126 3.99.0 2020-07-30 22:16:31 -04:00
Chun-wei Fan
12a23162b3 build: Check for EGL support in libepoxy on Windows
...EGL support needs to be explicitly enabled during the build of
libepoxy on Windows as it is not enabled by default on Windows.

With this, we can add an EGL renderer for Windows that make use of
Google's libANGLE, which is a library that translates OpenGL/ES calls
to Direct3D 9/11, which will provide better hardware compatibility
on Windows and would act as one of the foundations to resolve issue #105.
2020-07-30 14:26:33 +08:00
Christian Hergert
459af3acab build: bump to sysprof 4 ABI
Sysprof has moved to a new ABI which removes GLib from the capture library
so that GLib itself can link against sysprof-capture.

This bumps the library ABI so we can keep things coordinated between all
the new tracing layers in the stack.
2020-07-28 11:22:33 -07:00
Christian Hergert
0243736003 macos: support ARM/PowerPC time conversion for DisplayLink times
When converting DisplayLink frame presentation times, we need to take into
account the arch-specific types. This tracks changes in GNOME/GLib!1566 so
that precision is not lost.
2020-07-27 12:49:57 -07:00
Emmanuele Bassi
c63087a563 Remove ATK
To build a better world sometimes means having to tear the old one down.
        -- Alexander Pierce, "Captain America: The Winter Soldier"

ATK served us well for nearly 20 years, but the world has changed, and
GTK has changed with it. Now ATK is mostly a hindrance towards improving
the accessibility stack:

 - it maps to a very specific implementation, AT-SPI, which is Linux and
   Unix specific
 - it requires implementing the same functionality in three different
   layers of the stack: AT-SPI, ATK, and GTK
 - only GTK uses it; every other Linux and Unix toolkit and application
   talks to AT-SPI directly, including assistive technologies

Sadly, we cannot incrementally port GTK to a new accessibility stack;
since ATK insulates us entirely from the underlying implementation, we
cannot replace it piecemeal. Instead, we're going to remove everything
and then incrementally build on a clean slate:

 - add an "accessible" interface, implemented by GTK objects directly,
   which describe the accessible role and state changes for every UI
   element
 - add an "assistive technology context" to proxy a native accessibility
   API, and assign it to every widget
 - implement the AT context depending on the platform

For more information, see: https://gitlab.gnome.org/GNOME/gtk/-/issues/2833
2020-07-26 20:31:14 +01:00
Christian Hergert
9dbf99d91a macos: prototype new GDK backend for macOS
This is fairly substantial rewrite of the GDK backend for quartz and
renamed to macOS to allow for a greenfield implementation.

Many things have come across from the quartz implementation fairly
intact such as the eventloop integration design and discovery of
event windows from the NSEvent.

However much has been changed to fit in with the new GDK design and
how removal of child GdkWindow have been completely eliminated.
Furthermore, the new GdkPopup allows for regular NSWindow to be used
to provide popovers unlike the previous implementation.

The object design more closely follows the ideal for a GDK backend.

Views have been broken out into subclasses so that we can support
multiple GSK renderer paths such as GL and Cairo (and Metal in the
future). However mixed mode GL and Cairo will not be supported. Currently
only the Cairo renderer has been implemented.

A new frame clock implementation using CVDisplayLink provides more
accurate information about when to draw drawing the next frame. Some
testing will need to be done here to understand the power implications
of this.

This implementation has also gained edge snapping for CSD windows. Some
work was also done to ensure that CSD windows have opaque regions
registered with the display server.

     ** This is still very much a work-in-progress **

Some outstanding work that needs to be done:

 - Finish a GL context for macOS and alternate NSView for GL rendering
   (possibly using speciailized CALayer for OpenGL).
 - Input rework to ensure that we don't loose remapping of keys that was
   dropped from GDK during GTK 4 development.
 - Make sure input methods continue to work.
 - Drag-n-Drop is still very much a work in progress
 - High resolution input scrolling needs various work in GDK to land
   first before we can plumb that to NSEvent.
 - gtk/ has a number of things based on GDK_WINDOWING_QUARTZ that need
   to be updated to use the macOS backend.

But this is good enough to start playing with and breaking things which
is what I'd like to see.
2020-07-21 14:45:12 -07:00
Christian Hergert
add47bebc6 build: add ATK fallback subproject wrapper
Very similar to the other fallbacks we use.
2020-07-21 14:45:12 -07:00
Christian Hergert
514b62223d build: squash various warnings with Clang
Otherwise we have really chatty builds that make it difficult to catch
new issues when compiling.
2020-07-21 14:45:12 -07:00
Christian Hergert
7884ab6161 build: fix linking support on macOS with Clang
This was preventing any sort of building on macOS, even though the quartz
backend is currently non-functional. Fixing this is a pre-requisite to
getting a new macOS backend compiling.
2020-07-21 14:45:12 -07:00
Emmanuele Bassi
0c023bb5bb Clarify document
We don't use the branch name to determine whether we should enable or
disable deprecation warnings coming from our dependencies.
2020-06-18 17:36:44 +01:00
Emmanuele Bassi
c5481a125e Add libcloudproviders as a fallback subproject
We require a new version of libcloudproviders so that we can enable it
in our CI pipeline.
2020-06-17 14:06:20 -04:00
Matthias Clasen
2abb5b6419 3.98.5 2020-06-06 16:03:38 -04:00
Matthias Clasen
34841c3a5f Merge branch 'master.msvc' into 'master'
Fix latest GTK master on Visual Studio

See merge request GNOME/gtk!2028
2020-06-05 18:31:08 +00:00
Ray Strode
10f2b11fda x11: Add back support for the damage extension
commit 14bf58ec5d dropped support
for using the DAMAGE extension since there was no code that
needed it.

We're going to need it again, however, to address an NVidia
vendor driver issue.

This commit does the plumbing to add it back.
2020-06-05 10:01:13 -04:00
Chun-wei Fan
acd9c12667 modules: Fix build on Visual Studio
Visual Studio does not allow decorating functions with '__declspec (dllexport)'
if a prototype exists and is not decorated with '__declspec (dllexport)' as
well, so we cannot just decorate g_io_module_[load|unload|query] in the various
module sources with G_MODULE_EXPORT because the prototypes of these functions
have been marked with _GLIB_EXTERN, which equates to 'extern' unless overridden

Fix this by overriding _GLIB_EXTERN with the appropriate visibility flag, as we
have used to define _GDK_EXTERN.  Unfortunately, we can't just use _GDK_EXTERN
G_MODULE_EXPORT as they may have not been defined yet for our use

Do this across the board for all modules, even if they are not buildable on
Visual Studio nor Windows, for consistency's sake.
2020-06-05 11:16:45 +08:00
Christoph Reiter
2d5cf2b4c4 Drop fallback-c89.c
We require a C compiler supporting C99 now. The main purpose of
these fallbacks was for MSVC. From what I can see this is now all supported
by MSVC 2015+ anyway.

The only other change this includes is to replace isnanf() with the
(type infering) C99 isnan() macro, because MSVC doesn't provide isnanf().
2020-05-31 17:09:23 +02:00
Matthias Clasen
1eda9884a0 Add GtkNumericSorter
This sorter compares numbers obtained from items
by evaluating an expression.
2020-05-30 19:26:44 -04:00
Matthias Clasen
5235a4c48a Fix inconsistencies in our pango deps
We were applying the pango version requirements inconsistently,
leading to different pango variables being taking from system
pango vs the subproject at times. Thankfully, meson detects
this and complains, so we can fix it.
2020-05-30 11:13:55 -04:00
Matthias Clasen
b482b7d8af Bump the pango dependency
We soon want to rely on the list model apis in
pango 1.45. This commit also fixes a mixup where
using pango as a submodule would break the build
when pangoft2 is required.
2020-05-30 15:47:56 +02:00
Matthias Clasen
821a458393 Revert "Bump the pango dependency"
This reverts commit 98df0be43d.

It broke the win32 build.
2020-05-30 08:55:21 -04:00
Matthias Clasen
a39d708859 meson: Cosmetics
Treat the display backend list like other lists in the summary.
2020-05-29 15:40:34 -04:00
Matthias Clasen
98df0be43d Bump the pango dependency
We soon want to rely on the list model apis in
pango 1.45. This commit also fixes a mixup where
using pango as a submodule would break the build
when pangoft2 is required.
2020-05-29 10:53:39 -04:00
Carlos Garnacho
98f376a19e gtksearchengine: Add tracker3 search engine
Make this dependency optional at build time, and prefer it over
the old tracker <= 2.x implementation.
2020-05-19 22:05:07 +02:00
Matthias Clasen
15f7d2a27d 3.98.4 2020-05-18 16:38:11 -04:00
Benjamin Otte
14bf58ec5d x11: Remove XDamage dependency
It's not used.
2020-05-17 02:14:58 +02:00
Jan Tojnar
6d9db8610e
build: clean up .pc generation
Path concatenation is much nicer than the unwieldy format method.
Since paths returned by get_option are relative to prefix, they will be joined as before.

As a bonus, this fixes weird platforms like NixOS that actually pass absolute includedir under a different prefix.
2020-04-29 07:42:53 +02:00
Matthias Clasen
af7537ac79 3.98.3 2020-04-21 00:32:23 -04:00
Timm Bäder
dda7a850da meson: Use summary()
Instead of doing our own. Bumps the dependency to 0.53 though.
2020-04-17 15:21:00 +02:00
Timm Bäder
b8ef164c2b meson: Trivial formattting 2020-04-17 15:21:00 +02:00
Matthias Clasen
6870159c1d build: Prepare library versioning
Set version and soversion separately for the library.
When we do the 4.0 release, we will set:

gtk_soversion = '1'
gtk_library_version = '1.0.0'

See https://gitlab.gnome.org/GNOME/gtk/-/issues/1963
2020-04-14 09:15:31 -04:00
Jonas Ådahl
5425edff82 wayland: Move popups with xdg_popup.reposition
The third version of xdg-shell introduces support for explicit popup
repositioning. If available, make use of this to implement popup
repositioning.

Note that this does *NOT* include atomic parent-child state
synchronization. For that,
https://gitlab.freedesktop.org/wayland/wayland-protocols/issues/13 will
be needed.

This currently uses my own fork of wayland-protocols which adds meson
support, so that we can use it as a subproject. Eventually when
wayland-protocols' meson support lands upstream, we should change it to
point there.

Silence some meson warnings while at it to make CI happy.

This also bumps the glib requirement, since g_warning_once() is used.
2020-04-08 23:32:47 +02:00
Matthias Clasen
baeae71d12 Merge branch 'cross-postinstall' into 'master'
meson: Don't execute post-install.py if cross compiling

See merge request GNOME/gtk!1636
2020-04-06 23:59:33 +00:00
Martin Storsjö
531766fe64 meson: Don't execute post-install.py if cross compiling 2020-04-05 22:57:22 +03:00
Nirbheek Chauhan
eaef24c527 meson: Fix check for builtype arguments
`get_option('buildtype')` will return `'custom'` for most combinations
of `-Doptimization` and `-Ddebug`, but those two will always be set
correctly if only `-Dbuildtype` is set. So we should look at those
options directly.

For the two-way mapping between `buildtype` and `optimization`
+ `debug`, see this table:
https://mesonbuild.com/Builtin-options.html#build-type-options
2020-04-03 18:41:55 +05:30
Simon McVittie
9df7f0197d supp: Use a single suppressions file for lib, lib64 and multiarch
In addition to the traditional library directory lib and the 64-bit
multilib directory lib64, this will cover Debian-style multiarch
(lib/x86_64-linux-gnu etc.), Arch Linux 32-bit (lib32), x32 and
various others.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-04-02 09:18:55 +01:00
Matthias Clasen
9f93464ea4 3.98.2 2020-03-31 21:09:30 -04:00
Chun-wei Fan
2f64651a3f meson.build: Fix Visual Studio builds
We need to make the C++ language available before we can access the C++
compiler object...
2020-03-31 12:00:26 +08:00
Matthias Clasen
92b50c5e2a 3.98.1 2020-03-21 21:44:23 -04:00
Matthias Clasen
72f06abd13 Require pango 1.44.4
This lets use use the insert-hyphen attribute
unconditionally.
2020-03-21 00:39:17 -04:00
Timm Bäder
73d8f6a090 build: Add -Wno-typedef-redefinition to build
Clang otherwise complains about this
2020-03-12 08:32:34 +01:00
Benjamin Otte
e356d59a92 build: Add -Wnull-dereference
Sprinkle various g_assert() around the code where gcc cannot figure out
on its own that a variable is not NULL and too much refactoring would be
needed to make it do that.

Also fix usage of g_assert_nonnull(x) to use g_assert(x) because the
first is not marked as G_GNUC_NORETURN because of course GTester
supports not aborting on aborts.
2020-03-05 08:14:37 +01:00
Benjamin Otte
f6b11a5158 build: Add more useful warning flags
I found those on the interwebs and decided they are useful.
2020-03-05 07:56:28 +01:00
Philip Chimento
e123853b8b build: Install Valgrind suppressions files
This is so that other programs linking to GTK can use GTK's suppressions
files when performing their own Valgrind analysis.

Closes: #138
2020-02-23 15:00:37 -08:00
Matthias Clasen
37a9d0620d 3.98.0 2020-02-10 15:32:19 -05:00
Chun-wei Fan
f8d3845b1a meson/MSVC builds: Use -utf-8 where available
This avoids the build from erroring out on C4819 (Unicode handling issue in
Visual Studio compiler), notably when running on Chinese, Japanese and
Korean locales.

Also apply -D_USE_MATH_DEFINES, -FImsvc_recommended_pragmas.h and -utf-8 to
the C++ compiler options as well.
2020-02-03 17:55:09 +08:00
Matthias Clasen
4e58541d52 Make wayland load cursors on demand
Copy just enough of libwayland-cursor to make our own
loading. This lets us drop the dependency on libwayland-cursor,
and changes the startup cost for cursor theme loading
from 25ms to 0.1ms.

At the same time, simplify the handling of scaled cursors -
instead of creating an array of theme objects, just make a
single theme object provide all scaled cursor sizes.
2020-01-24 17:27:45 -05:00
Chun-wei Fan
a9b1d4a389 build: Check for sincosf()
sincosf() is really a GCC-specific function that may more may not be
supported on non-GCC compilers, so we want to check for it, otherwise we
use a fallback implementation, not unlike the one in
demos/gtk-demo/gtkgears.c.
2020-01-08 17:15:29 +08:00
Emmanuele Bassi
3c11c57755 Bump up the required version of Meson
Match the one we're testing on our CI infrastructure.
2019-11-16 18:40:23 +00:00
Matthias Clasen
fa8ce17e1e build: We no longer need freetype 2019-11-01 13:01:54 -04:00
Matthias Clasen
41c52e955d Bump the pango dependency
This lets us avoid freetype uses, and simplifies
some other things as well.
2019-11-01 13:01:54 -04:00
Olivier Fourdan
060a9f072c Bump wayland-protocols requirements
The `name` and `description` events were added to `xdg-output` protocol
in version 2 which is part of wayland-protocols 1.14.

In xdg-output-v1 version 3, the `xdg-output.done` event was deprecated
and the `xdg-output.description` event was made mutable, but that
doesn't change the actual events so we do not actually need to require
that version of xdg-output from wayland-protocols 1.18.

Update the wayland-protocols requirement to the bare minimum version,
which is 1.14.

https://gitlab.gnome.org/GNOME/gtk/issues/2057
2019-07-29 12:03:07 +02:00
Matthias Clasen
4eaf860e86 meson: Rename documentation option to gtk_doc
This name is what most of the stack is using.
Lets follow along, even though it is (imo)
uglier.
2019-07-01 20:16:37 -04:00
Emmanuele Bassi
23e4d05383 build: Do not use add_global_flags()
It's almost always not what you want.
2019-06-24 15:00:21 +01:00
Benjamin Otte
22e0785802 build: Make script interpreter optional
Running the tests needs it though, so it's only optional without tests.
2019-05-30 18:34:51 +02:00
Benjamin Otte
1e0c0c0ba7 rendernodeparser: Parse cairo script
Use cairo-script-interpreter to parse the scripts that generate cairo
nodes.

This requires libcairoscriptinterpreter.so to work properly, but if
it isn't found we disable this (unimportant for normal functioning)
code and just emits a parser warning.
The testsuite requires it however or it will fail.

A new test is included that tests all of this.
2019-05-30 15:32:36 +02:00
Christian Hergert
3a0beeadc5 profiler: port GdkProfiler to sysprof-3
This uses the new sysprof-3 ABI to implement the capture writer. It also
uses the statically linked libsysprof-capture-3.a that is provided with
Sysprof for the capture writing to ensure that we do not leak any symbols
nor depend on any additional libraries.

The GTK_TRACE_FD can be used to pass a FD for tracing into Gtk. Sysprof
uses this when the Gtk instrument is selected for recording.
2019-05-29 19:02:30 -07:00
Christoph Reiter
758830e7c3 meson: allow building man pages without the documentation
The 'documentation' option also guarded the man page build. Instead
if skipping the whole docs subdir skip the specific gtkdoc calls, so that the
man page build still works.

This brings it in line with the gtk3 meson build.
2019-05-25 18:33:01 +02:00
Carlos Garnacho
f3250172a4 gdk/x11: Make XInput2 a mandatory build time dependency for x11
XInput2 is more than a decade old already, and the input improvements
there (and in every other backend really) make it untenable to have
support for X11 core input events dragging things behind.
2019-05-15 01:05:20 +02:00
Matthias Clasen
b01cf6be65 3.96 2019-05-07 03:27:04 +00:00
Emmanuele Bassi
f6594ff073 Update the version of Graphene
We're going to use newly added API soon.
2019-04-29 02:26:31 +02:00
Jonas Ådahl
477ad2505b widget: Add surface relative transform changed callback
Added two new private GtkWidget API:

 * gtk_widget_add_surface_transform_changed_callback()
 * gtk_widget_remove_surface_transform_changed_callback()

The intention is to let the user know when a widget transform relative
to the surface changes. It works by calculating the surface relative
transform during allocation, and notifying the callbacks if it changed
since last time. Each widget adds itself as a listener to its parent
widget, thus will be triggered if a parents surface relative transform
changes.
2019-04-24 14:26:24 +02:00
Benjamin Otte
dff9a5a195 build: Add new gcc error flags
These flags check for code that we don't want to write, so turn them
into error flags.

Variable length arrays should be replaced by malloc() - or explicit
alloca() calls if you know what you're doing.

Implicit fallthrough should be replaced by explicit fallthrough with the
usage of G_GNU_FALLTHROUGH.

This work inspired by Kees Cook's LCA2019 talk:
https://www.youtube.com/watch?v=FY9SbqTO5GQ
http://outflux.net/slides/2019/lca/danger.pdf
2019-04-15 14:40:25 +02:00
Benjamin Otte
0791924bf7 Convert fallthrough comments to G_GNUC_FALLTHROUGH
This way it's very obvious that fallthrough is indeed what we want.

Also bump the glib requirement to 2.59 which introduced
G_GNUC_FALLTHROUGH.
2019-04-15 14:40:25 +02:00
Benjamin Otte
a938c14d11 build: Add gtk-css static library
This library is meant to be the new CSS library that gets used from GDK,
GSK and GTK for string printing and parsing.

As a first step, move GtkCssProviderError into it.

While doing so, split it into GtkCssParserError (for critical problems)
and GtkCssParserWarning (for non-critical problems).
2019-04-12 19:34:28 +02:00
Chun-wei Fan
88086ea91a meson: Only use HarfBuzz fallback when needed
The current Meson releases have broken CMake support, meaning that it is
likely that HarfBuzz could not be located for Visual Studio builds
unless one handcrafts pkg-config files for it, which is both tedious and
error-prone.

Instead, use the existing mechanism for looking for the HarfBuzz headers
and libraries on Visual Studio first when it could not be found via
dependency(), and then use the fallback if it still could not be found.
2019-04-12 18:16:12 +08:00
Matthias Clasen
bcac81eed9 Merge branch 'wip/ebassi/align-test' into 'master'
Remove aligned allocation checks

See merge request GNOME/gtk!596
2019-03-29 22:50:10 +00:00
Benjamin Otte
1944ffe351 Revert "Bump meson req to 0.50"
This reverts commit f0845d98a2.

The commit breaks CI. CI has more power than meson telling things.
2019-03-29 10:19:41 +01:00
Chun-wei Fan
6b08227110 meson.build: Pull in fallback for PangoFT2 only when needed
On some systems PangoFT2 is optional, so we only use the fallback when
it is being required.
2019-03-29 16:50:35 +08:00
Matthias Clasen
f0845d98a2 Bump meson req to 0.50
meson told me to.
2019-03-28 17:35:50 -04:00
Benjamin Otte
979e9bec27 testsuite: Add a transforms test
In particular, check that to_matrix() and to_2d(), to_affine() and
to_translate() return the same values.

This also requires a recent Graphene version or the tests will fail.
2019-03-04 23:41:27 +01:00
Emmanuele Bassi
fad21d8dda Remove aligned allocation checks
The tests were added when we thought we had to align memory allocations
for structures including a Graphene type in their members. Graphene
added alignment annotations for its types, and we never really used the
symbols we set after testing for allocations being aligned out of the
box with malloc(), and for aligned allocators.
2019-03-04 13:51:49 +00:00
Chun-wei Fan
8d987be673 Merge branch 'wip/fanc999/meson.msvc' into 'master'
GTK+ 4: Improve Windows/Visual Studio build experience

See merge request GNOME/gtk!185
2019-02-23 02:13:35 +00:00
Emmanuele Bassi
b56c0fb596 Rename project files
Meson and DOAP are the last holdovers for the old "gtk+" name.
2019-02-06 10:42:50 +01:00
Matthias Clasen
1aeeefdccb Merge branch 'drop-the-plus' into 'master'
Rename some references to GTK+

See merge request GNOME/gtk!553
2019-02-05 08:29:39 +00:00
Matthias Clasen
dbd360262c Add an explicit fribidi dep
We will use fribidi api to determine text direction.
2019-02-04 18:28:31 -05:00
Matthias Clasen
d080be3e50 Rename some references to GTK+
We are dropping the plus.
2019-02-04 11:58:09 -05:00
Benjamin Otte
359bc7695c build: Reintroduce warning flags from autotools
Some of the flags got lost in the meson transition or were demoted from
error flags to warning flags.
This commit reintroduces them.

It also includes fixes for the code that had warnings with those flags.
The big one being -Wshadow.
2019-01-22 04:33:12 +01:00
Benjamin Otte
7723749e00 meson.build: Order warning flags alphabetically
... and remove the duplicate we already had.
2019-01-22 04:33:11 +01:00
Emmanuele Bassi
e458ea2f3d build: Avoid a Meson deprecation warning
Using an empty `configuration_data` object to copy a configuration file
is deprecated since Meson 0.47 (released July 2018); the equivalent
behaviour is available by using `copy: true`.
2019-01-08 14:46:46 +00:00
Chun-wei Fan
3fa28ffd92 build: Make post-install script a Python script
The existing post-install shell script will most likely not work on
Visual Studio builds as there is normally no shell interpreter installed
on the system where the build is done, but the build is normally done in
a standard Windows cmd.exe console.

Instead, use a Python script so that it will work on the platforms that
Python supports.
2018-12-06 17:07:33 +08:00
Nirbheek Chauhan
b98f5a0823 meson: Always fetch pangoft2_dep from the pango subproject
This ensures that we will use pangoft2 if it is available, and not if
it is not available.

See: https://gitlab.gnome.org/GNOME/pango/merge_requests/6
2018-10-12 13:08:48 +05:30
Nirbheek Chauhan
00c29e1fbe meson: Use proxy-libintl subproject when needed and available
Such as on Windows with MSVC.
2018-10-12 13:08:48 +05:30
Nirbheek Chauhan
de3e5be235 meson: Add a fallback for the harfbuzz dependency
This meson port is not upstream yet, so a wrap file is not included.
Upstream has expressed interest but the port hasn't been tested on all
platforms yet. Will be added when it gets upstreamed.

Link to WIP port: https://github.com/centricular/harfbuzz
2018-10-12 13:08:48 +05:30
Nirbheek Chauhan
b343abfa51 meson: Support graphene as a fallback dependency
Don't assume graphene_dep is always a pkg-config dependency.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/1197
2018-07-23 20:17:04 +05:30
Matthias Clasen
faba0f0145 Bump version to 3.94.0 2018-06-25 19:55:04 -04:00
Руслан Ижбулатов
bd2e3f5b9b Add aligned allocator support to meson
* A bunch of new variables for config.h.meson
* A check for aligned allocation being necessary at all
  (graphene must use GCC vector instructions or SSE2)
* A check for C malloc() being aligned at 16-byte boundaries
* A check for a few special aligned allocator functions being
  present and not being built-ins (posix_memalign is a builtin
  in GCC, even on platforms where there is no posix_memalign
  system function)
* Added -mstackrealign flag on Windows, since otherwise
  stack variables may become unaligned when the stack briefly
  passes through OS code (such as in various callbacks and
  handlers)
2018-06-09 13:52:42 +00:00
Matthias Clasen
45db4a5550 Merge branch 'wip/xdg-shell' into 'master'
xdg shell (stable)

See merge request GNOME/gtk!35
2018-05-04 00:43:01 +00:00
Ting-Wei Lan
7fed0b74ed wayland: Use dev/evdev/input.h on FreeBSD
The header linux/input.h used by GDK is specific to Linux. It is
possible to get a few Linux headers on FreeBSD by installing v4l_compat,
but it is usually better to use the one shipped with FreeBSD.

We prefer dev/evdev/input.h to linux/input.h here, so it will always use
dev/evdev/input.h on FreeBSD regardless of v4l_compat.

https://svnweb.freebsd.org/changeset/ports/465644
2018-05-01 22:28:57 +08:00
Jonas Ådahl
a40923b03a wayland: Add support for xdg-shell stable
This commit adds support the stable version of the xdg-shell protocol.
Support for the last version of the unstable series is left intact, but
will not receive new features.

The stable version is prioritized above the older version.

https://bugzilla.gnome.org/show_bug.cgi?id=791939
2018-05-01 13:36:38 +02:00
Ting-Wei Lan
ff1dd5009c build: Use cc.links to check linker arguments
Instead of hard-coding linker flags for a specific operating system and
a specific compiler, we can should cc.links to test them, so they can be
used on more operating systems and compilers.
2018-04-22 21:57:10 +08:00
Ting-Wei Lan
f922109a9c build: Make the default setting work on non-Linux Unix-like systems
All of the four platform-dependent backends are enabled by default. It
is usually a good default because it requires users to explicitly choose
backends they want to use. Rules in meson.build also automatically
disable unavailable backends for macOS, Windows, Linux, so users on
these 3 major platforms don't have to manually disable things when
running meson commands.

However, meson.build doesn't do the same thing for other Unix-like
systems, which is acceptable but not ideal. To make it easier to build
GTK+ on these systems, the Linux case, which enables X11 and Wayland and
disables Win32 and Quartz, is made the default for all operating systems
that are not Windows or macOS.

This commit also changes most 'host_machine.system()' calls to os_*
variables, which are easier to read and less likely to be used wrongly.
2018-04-22 21:57:10 +08:00
Timm Bäder
f483fd539e build: Fix copy/paste error 2018-04-21 19:24:25 +02:00
Matthias Clasen
651e7aa6a1 Spruce up config summary
Show all the options. Nothing to hide.
2018-04-15 22:03:38 -04:00
Timm Bäder
b48422d423 build: Print summary last 2018-04-14 11:47:02 +02:00
Emmanuele Bassi
a2a99d27c9 Simplify the Wayland code generation
Instead of going through an ancillary script to strip away the
`WL_EXPORT` annotation from the generated code, we should bump up the
required version of Wayland, and use the `private-code` argument for
wayland-scanner, which does the right thing for us.
2018-04-11 15:06:43 +01:00
Benjamin Otte
144637bff1 build: Switch order of subdirectories
After fixing this once already in 5970dac167 the order was messed up
again in d50708b024.
2018-04-05 14:56:38 +02:00
Chun-wei Fan
19ce520c2d build: Fix linking demos on Visual Studio
The demos are now built as GUI programs, which will require the presence
of WinMain() on Visual Studio builds, unless we specify the entry point.

Pass the /entry:mainCRTStartup linker flag on Visual Studio builds for
the demo programs so that they can link properly.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2018-04-02 19:11:50 +08:00
Руслан Ижбулатов
9e76a6055a W32: Link GTK to pangowin32
Needed for pango_win32_font_logfont() from gtkimcontextime.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2018-04-01 10:35:02 +00:00
Emmanuele Bassi
d50708b024 Add an option for building examples
Examples are not like demos; the latter are installed, and provide a
Flatpak manifest for CI pipelines and GNOME Builder. We should not be
using a single configure time option to gate building both.
2018-03-29 11:37:30 +01:00