Add an implementation of GdkDmabufTexture.
For now, this implementation is rather minimal,
since we need a roundtrip through GL to convert
most nottrivial formats.
We need to inist on the nonuniform access beuing available and that
requires Vulkan 1.2.
Also simplifies the descriptor indexing stuff, because that's all part
of Vulkan 1.2, too.
That's a gcc warning (clang has the equivalent -Winitializer-overrides,
but that one is included in -Wall) that complains about things like:
VkOffset3D offset = { .x = pt.x, .x = pt.y, .y = 0 };
So you don't have to spend a few hours trying to understand what's going
on before realizing your copy/paste skills are substandard.
While working on deprecation cleanups, I noticed
that removing GDK_DEPRECATED_IN... from headers
does not have the effect of making the symbols
disappear, since we were forgetting to set the
default visibility to hidden.
This is implemented using a new xdg_toplevel `suspended` state, and is
meant for allowing applications to know when they can stop doing
unnecessary work and thus save power.
In the other backends, the `suspended` state is set at the same time as
`minimized` as it's the closest there is to traditional windowing
systems.
The objcopy+ld approach to fast resource building
relies on behavior that is specific to the binutils
linker, and does not work with the llvm one.
Therefore, check for ld.bfd. We still fall back
to trying with just ld, since I'm not 100% sure
if binutils unconditionally installs ld.bfd.
Fixes: #5672
We now need glib-2.76.0 or later, which removes our needs for the workarounds
that we need to build the media backends against GLib-2.74.x or earlier, so
clean up things a bit.
We are now using APIs that were introduced in 2.75.x, so let's use glib-2.76.0
here for our glib subproject.
Update the build and gobject-introspection items accordingly
Instead of injecting `-fvisibility=hidden` depending on a compiler check
ourselves, let Meson do it for us.
This also avoids us having to filter `-fvisibility=hidden` when reusing
the common compiler flags.
Fix the circular dependency by moving the generated
headers to gdk/version/, and build that directory
first.
Misc other fixes, such as putting the custom targets
as sources, not depedencies, and using the correct
major version in the generator script.
Let's poach the same script used by GLib to avoid having to add all the
version macros by hand every time we increment the GTK version.
This is a work in progress:
- need to rename the GLIB_STATIC_COMPILATION check
- circular dependency: libgtkcss depends on gdkversionmacros.h, but libgdk
depends on libgtkcss
Error out if introspection is requested,
but g-ir-scanner isn't found.
And if introspection isn't explicitly disabled
but is required for building the docs, build it.
The current definitions of the g_io_module_*() symbols do not build on
Visual Studio when building against GLib earlier than 2.75.0 due to the
way how these symbols are decorated in the GLib headers, as Visual Studio
does not allow symbols that were previously marked with 'extern' (or so)
to be marked with anything that is symantically different later.
As a result, if we are using Visual Studio and glib-2.74.x or earlier,
override _GLIB_EXTERN as appropriate in the modules/media sources before
including the GIO headers. This sadly, means that we need a
configure-time check as it would have been too late if we checked the
GLib version using G_VERSION_CHECK macro, as the GIO headers would have
been included already.
There are similar items in the print backends, but we will not attempt
to update these files as they are not meant to be built for Windows.
Put all the function checks in one place.
Remove functions we don't actually use,
and add ones that we have #ifdefs for in
in the code. Also add enough includes to
make these checks actually work.
Fixes: #5070
This issues a warning when an enum value is compared to a value that is
out of range for the enum.
We do this a lot, either when using -1 for undefined values or when
comparing array sizes to enum values like so:
enum {
ONE,
TWO,
THREE
} some_enum_value;
const char *names= { "one", "two", "three" };
g_assert (some_enum_value < G_N_ELEMENTS (names));
The way the check is written, if the build is native, then the
introspection option has no effect.
Particularly yocto project does want to disable introspection in
native builds and enable it in cross builds (both via the option),
and without this patch the former is not possible.
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Dummy dependencies are not required to execute a subproject
automatically for providing a program, nor do you need to explicitly
call subproject() to do that.
A `[provide]` section in the wrap file is enough.
Subprojects that use meson.override_dependency() do not require the
caller to provide the dependency variable name inside the subproject.
We also don't want to provide the *subproject* name, because the
subproject name can be `pango-1.50.12` instead of `pango` when using
wrap-file to download the tarball instead of using wrap-git. This
causes the pango subproject to be executed twice when using gtk as
a subproject inside gstreamer (which uses pango-1.50.12 as
a wrap-file).
All the dependencies we use can be switched in this way, but the
remaining ones need to be changed to use meson.override_dependency()
first.
The is_msvc_like change is wrong; it used a false correlation between
"compiler being used" and "dependency method" by saying that on
Windows, when building with MSVC, you will only use CMake to find png,
jpeg, tiff.
You can use pkgconfig to find these deps on Windows with MSVC -- when
the deps have been built with Autotools or Meson (with MSVC). You can
also find these deps using CMake on other platforms like macOS or
Linux.
The solution is simple: just search for both names on all platforms,
and just search for the pkgconfig name first.
This reverts commit acd9c12667.
This commit breaks the build with GLib main on all platforms,
and defining _GLIB_EXTERN arguably invades the GLib namespace.
A different fix for msvc will have to be found.
This is an experiment to see if I can keep up with
doing post-release version bumps, so git snapshots
will always have a different version from released
tarballs.
This commit also marks the beginning of the 4.10
development cycle, as 4.8 has been branched.
gi-docgen is supposed to be ran natively on the build machine, without
native: true dependency() searches for gi-docgen on the host system.
When it doesn't find it, it falls back to a subproject even if gi-docgen
is available on the build machine.
also make gtk_doc require introspection
Sysprof has a new -Dagent=true build option which allows installing a
/usr/bin/sysprof-agent program (simimlar to sysprof-cli). It provides a
P2P D-Bus API to the process which can control subprocesses. It's used by
IDE tooling to have more control across container boundaries.
However, we do not need it for GTK CI.
The GdkToplevelSize struct already has the concept of "bounds", which
means the largest size a window should reasonably have. It's practically
the equivalent of the monitor the window is intended to be mapped on,
with the "struts" (e.g. panels) cut out. It's used by GTK to use this
information to calculate a default window size that is "lagom" (swedish;
not too large, not too small).
Meson knows all private dependencies itself when passing the library as
first positional argument, no need to specify them manually. Also
simplify backend specific files by simply requiring gtk4, just like
unix-print already did.
This should fix generated gtk4-uninstalled.pc, see Meson bug report:
https://github.com/mesonbuild/meson/issues/10415
Ensure that resolution of the subproject occurs via the dependency
interface, not the "poke at subprojects manually" interface, and make
that actually work via --wrap-mode=forcefallback.
There's no need to mark it as not-required and then manually invoke
subproject(), since fallback should work correctly and it is always
needed.
However, if fallback was performed (or forced) it would error out since
get_variable() was instructed to only use pkg-config while the relevant
variable was exported by the subproject as an internal fallback
dependency.
One may be using IJG libjpeg or libjpeg-turbo to build GTK, and their
build files may or may not generate pkg-config files for us. To make
things easier, we can make use of CMake's built-in support for finding
IJG libjpeg or libjpeg-turbo.
The CMake build files for libtiff may or may not generate pkg-config
files for us, so we can use Meson's CMake support to help us find
libtiff, as CMake has built-in support for finding libtiff.
Add a variable in meson.build that covers Visual Studio-like compilers,
so that we can use it to help us find depedencies using CMake rather
than via pkg-config, where applicable.
Change the existing use case for finding libpng accordingly.
From the GCC manpage:
> Wimplicit-fallthrough=5 doesn't recognize any comments as
> fallthrough comments, only attributes disable
> the warning.
So, check for the =5 version after checking for the simple version. This
way we get -Wfallhrough with clang and -Wfallthrough -Wfallthrough=5
with GCC, which works.
This makes the hotspot of DND surfaces work when using the Vulkan and
OpenGL renderers.
This bumps the CI image used to the newly built image. This is needed to
install a new enough libwayland-client.so needed for wl_surface.offset.
This is done by adding wayland as a meson subproject, building it
on-demand if the version in the system is not new enough. As
libwayland-client.so is pulled in implicitly when linking to gtk4, the
compile step needs LD_LIBRARY_PATH set to make ld find the right library
to link to.
Without building the demos, nothing gets installed into $prefix/share/icons/hicolor. Which makes running
`gtk4-update-icon-cache` on the machine causes an error. This is easily reproducible on a Windows machine with MSVC where
there is nothing pre-installed on hicolor icon theme and that makes building gtk without the demos fails with "No such file or directory".