diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe678aa2ea..20d7737e44 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v1 +image: registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v2 stages: - build @@ -7,12 +7,38 @@ cache: paths: - _ccache/ -build: +fedora-autotools: stage: build script: - - bash -x ./.gitlab-ci/test-docker.sh + - bash -x ./.gitlab-ci/test-docker-autotools.sh -msys2-mingw32: +fedora-meson: + stage: build + script: + - bash -x ./.gitlab-ci/test-docker-meson.sh + artifacts: + when: always + name: "gtk3-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}" + paths: + - "_build/meson-logs" + +msys2-mingw32-meson: + variables: + MSYSTEM: "MINGW32" + CHERE_INVOKING: "yes" + stage: build + tags: + - win32 + script: + - C:\msys64\usr\bin\pacman --noconfirm -Syyuu + - C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2-meson.sh" + artifacts: + when: always + name: "gtk3-%CI_JOB_NAME%-%CI_COMMIT_REF_NAME%" + paths: + - "_build/meson-logs" + +msys2-mingw32-autotools: when: manual variables: MSYSTEM: "MINGW32" @@ -22,4 +48,4 @@ msys2-mingw32: - win32 script: - C:\msys64\usr\bin\pacman --noconfirm -Syyuu - - C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh" + - C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2-autotools.sh" diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile index a635411ad5..c804e00be1 100644 --- a/.gitlab-ci/Dockerfile +++ b/.gitlab-ci/Dockerfile @@ -1,4 +1,4 @@ -FROM fedora:28 +FROM fedora:29 RUN dnf -y install \ adwaita-icon-theme \ @@ -10,6 +10,7 @@ RUN dnf -y install \ ccache \ colord-devel \ cups-devel \ + dbus-x11 \ fribidi-devel \ gcc \ gcc-c++ \ @@ -23,8 +24,10 @@ RUN dnf -y install \ graphene-devel \ gtk-doc \ hicolor-icon-theme \ + iso-codes \ itstool \ json-glib-devel \ + libcloudproviders-devel \ libepoxy-devel \ libmount-devel \ librsvg2 \ @@ -42,12 +45,19 @@ RUN dnf -y install \ mesa-libEGL-devel \ mesa-libwayland-egl-devel \ meson \ + ninja-build \ pango-devel \ + python3 \ + python3-pip \ + python3-wheel \ redhat-rpm-config \ + rest-devel \ + sassc \ vulkan-devel \ wayland-devel \ wayland-protocols-devel \ - xorg-x11-server-Xvfb + xorg-x11-server-Xvfb \ + && dnf clean all ARG HOST_USER_ID=5555 ENV HOST_USER_ID ${HOST_USER_ID} diff --git a/.gitlab-ci/run-docker.sh b/.gitlab-ci/run-docker.sh index bd9ddeef05..789284130f 100755 --- a/.gitlab-ci/run-docker.sh +++ b/.gitlab-ci/run-docker.sh @@ -8,7 +8,7 @@ set -e -TAG="registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v1" +TAG="registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v2" # HOST_USER_ID gets used to create a user with the same ID so that files # created in the mounted volume have the same owner diff --git a/.gitlab-ci/test-docker-autotools.sh b/.gitlab-ci/test-docker-autotools.sh new file mode 100755 index 0000000000..32d8cec1e0 --- /dev/null +++ b/.gitlab-ci/test-docker-autotools.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +mkdir -p _ccache +export CCACHE_BASEDIR="$(pwd)" +export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" + +mkdir _build +cd _build +../autogen.sh \ + --enable-cloudproviders \ + --enable-broadway-backend \ + --enable-xinerama \ + --enable-gtk-doc +make -j8 diff --git a/.gitlab-ci/test-docker-meson.sh b/.gitlab-ci/test-docker-meson.sh new file mode 100755 index 0000000000..c791f3f1ba --- /dev/null +++ b/.gitlab-ci/test-docker-meson.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -e + +mkdir -p _ccache +export CCACHE_BASEDIR="$(pwd)" +export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" + +export PATH="${HOME}/.local/bin:${PATH}" +python3 -m pip install --user meson==0.49.2 + +meson \ + -Dgtk_doc=true \ + -Dman=true \ + -Dbroadway_backend=true \ + -Dxinerama=yes \ + -Dprint_backends="file,lpr,test,cloudprint,cups" \ + _build + +cd _build +ninja + +xvfb-run -a -s "-screen 0 1024x768x24" \ + meson test \ + --timeout-multiplier 4 \ + --print-errorlogs \ + --suite=gtk+-3.0 \ + +ninja gail-libgail-util3-doc gdk3-doc gtk3-doc diff --git a/.gitlab-ci/test-docker.sh b/.gitlab-ci/test-docker.sh deleted file mode 100755 index 523582e119..0000000000 --- a/.gitlab-ci/test-docker.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -set -e - -mkdir -p _ccache -export CCACHE_BASEDIR="$(pwd)" -export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" - -./autogen.sh -make -j8 diff --git a/.gitlab-ci/test-msys2.sh b/.gitlab-ci/test-msys2-autotools.sh similarity index 99% rename from .gitlab-ci/test-msys2.sh rename to .gitlab-ci/test-msys2-autotools.sh index 393d15c685..656bac26bd 100644 --- a/.gitlab-ci/test-msys2.sh +++ b/.gitlab-ci/test-msys2-autotools.sh @@ -14,7 +14,6 @@ pacman --noconfirm -Suy # Install the required packages pacman --noconfirm -S --needed \ base-devel \ - git \ mingw-w64-$MSYS2_ARCH-toolchain \ mingw-w64-$MSYS2_ARCH-ccache \ mingw-w64-$MSYS2_ARCH-pkg-config \ diff --git a/.gitlab-ci/test-msys2-meson.sh b/.gitlab-ci/test-msys2-meson.sh new file mode 100644 index 0000000000..6116411dd5 --- /dev/null +++ b/.gitlab-ci/test-msys2-meson.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +set -e + +if [[ "$MSYSTEM" == "MINGW32" ]]; then + export MSYS2_ARCH="i686" +else + export MSYS2_ARCH="x86_64" +fi + +# Update everything +pacman --noconfirm -Suy + +# Install the required packages +pacman --noconfirm -S --needed \ + mingw-w64-$MSYS2_ARCH-toolchain \ + mingw-w64-$MSYS2_ARCH-ccache \ + mingw-w64-$MSYS2_ARCH-pkg-config \ + mingw-w64-$MSYS2_ARCH-gobject-introspection \ + mingw-w64-$MSYS2_ARCH-adwaita-icon-theme \ + mingw-w64-$MSYS2_ARCH-atk \ + mingw-w64-$MSYS2_ARCH-cairo \ + mingw-w64-$MSYS2_ARCH-gdk-pixbuf2 \ + mingw-w64-$MSYS2_ARCH-glib2 \ + mingw-w64-$MSYS2_ARCH-json-glib \ + mingw-w64-$MSYS2_ARCH-libepoxy \ + mingw-w64-$MSYS2_ARCH-pango \ + mingw-w64-$MSYS2_ARCH-shared-mime-info \ + mingw-w64-$MSYS2_ARCH-meson \ + mingw-w64-$MSYS2_ARCH-ninja \ + mingw-w64-$MSYS2_ARCH-gtk-doc \ + mingw-w64-$MSYS2_ARCH-sassc + +mkdir -p _ccache +export CCACHE_BASEDIR="$(pwd)" +export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" + +# Build +ccache --zero-stats +ccache --show-stats + +meson \ + -Dman=true \ + -Dbroadway_backend=true \ + _build + +ninja -C _build + +ccache --show-stats diff --git a/Makefile.am b/Makefile.am index e53cb6a875..e1978fc3bb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,7 +22,13 @@ EXTRA_DIST += \ sanitize-la.sh \ po/README.translators \ po/po2tbl.sed.in \ - make-pot + make-pot \ + meson_options.txt \ + meson.build \ + po/meson.build \ + po-properties/meson.build \ + build-aux/meson/post-install.py \ + config.h.meson MAINTAINERCLEANFILES = \ $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \ diff --git a/README.win32 b/README.win32 index 4c2464e3f0..2998b99d6c 100644 --- a/README.win32 +++ b/README.win32 @@ -181,6 +181,96 @@ instance the makefile.msc files might not produce identically named DLLs and import libraries as the "autoconfiscated" makefiles and libtool do. If this bothers you, you will have to fix the makefiles. +3) Using Meson (for Visual Studio and MinGW builds) +--- + +Meson can now be used to build GTK+-3.x with either MinGW or Visual Studio. +You will need the following items in addition to all the dependencies +listed above: + +- Python 3.5 or later +- Meson build system, 0.48.0 or later +- Ninja (if not using the Visual Studio project generator for + Visual Studio 2010, 2015, 2017, 2019) +- CMake (optional, used for dependency searching) +- pkg-config (optional, or some compatible tool, highly recommended) + +For all Windows builds, note that unless -Dbuiltin_immodules=no is specified, +the input modules (immodules) are built directly into the GTK DLL. + +For building with Meson using Visual Studio, do the following: + +Create an empty build directory somewhere that is on the same drive +as the source tree, and launch the Visual Studio command prompt that +matches the build configuration (Visual Studio version and architecture), +and run the following: + +- Ensure that both the installation directory of Python and its script + directory is in your PATH, as well as the Ninja, CMake and pkg-config + executables (if used). If a pkg-config compatible drop-in replacement + tool is being used, ensure that PKG_CONFIG is set to point to the + executable of that tool as well. + +- For non-GNOME dependencies (such as Cairo and Harfbuzz), where pkg-config + files or CMake files could not be properly located, set INCLUDE and LIB + to ensure that their header files and .lib files can be found respectively. + The DLLs of those dependencies should also be in the PATH during the build + as well, especially if introspection files are to be built. + +- For GNOME dependencies, the pkg-config files for those dependencies should + be searchable by pkg-config (or a compatible tool). Verify this by running + $(PKG_CONFIG) --modversion . + +- Run the following: + meson --buildtype=... --prefix=..., + where buildtype can be release, debugoptimized, debug or plain. Please + refer to the Meson documentation for more details. You may also wish to + pass in -Dbroadway_backend=true if building the Broadway GDK backend is + desired, and/or pass in -Dbuiltin_immodules=no to build the immodules as + standalone DLLs that can be loaded by GTK dynamically. For Visual Studio + 2010, 2015, 2017 and 2019 builds, you may pass in --backend=vs to generate + Visual Studio project files to be used to carry out the builds. + +If you are building with Visual Studio 2008, note the following items as well: + +- For x64 builds, the compiler may hang when building the certain files, due + to optimization issues in the compiler. If this happens, use the Windows + Task Manager and terminate all cl.exe processes, and the build will fail + with the source files that did not finish compiling due to the hang. + Look for them in build.ninja in the build directory, and change their compiler + flag "/O2" to "/O1", and the compilation and linking should proceed normally. + At this time of writing, the following files are known to cause this hang: + + gtk\gtkfilechoosernativewin32.c + gtk\gtkfilesystemmodel.c + gtk\gtktextsegment.c + gtk\gtktextbtree.c + gtk\gtkrbtree.c + testsuite\gtk\treemodel.c + testsuite\gtk\textbuffer.c + testsuite\gtk\rbtree.c + testsuite\gtk\icontheme.c + +- Upon running install (via "ninja install"), it is likely that + gtk-query-immodules-3.0.exe will fail to run as it cannot find msvcr90.dll or + msvcr90D.dll. You can ignore this if you did not specify -Dbuiltin_immodules=no + when configuring via Meson. If -Dbuiltin_immodules=no is specified, you need to + run the following after embedding the manifests as outlined in the next point: + + \bin\gtk-query-immodules-3.0.exe > \lib\gtk-3.0\3.0.0\immodules.cache + +- You will need to run the following upon completing install, from the build + directory in the Visual Studio 2008/SDK 6.0 command prompt (third line is not + needed unless -Dbuiltin_immodules=no is specified) so that the built binaries + can run: + + for /r %f in (*.dll.manifest) do if exist \bin\%~nf mt /manifest %f /outputresource:\bin\%~nf;2 + for /r %f in (*.exe.manifest) do if exist \bin\%~nf mt /manifest %f /outputresource:\bin\%~nf;1 + for /r %f in (*.dll.manifest) do if exist \lib\gtk-3.0\3.0.0\immodules\%~nf mt /manifest %f /outputresource:\lib\gtk-3.0\3.0.0\immodules\%~nf;2 + +- The more modern visual style for the print dialog is not applied for Visual + Studio 2008 builds. Any solutions to this is really appreciated. + Using GTK+ on Win32 =================== diff --git a/build-aux/meson/post-install.py b/build-aux/meson/post-install.py new file mode 100644 index 0000000000..71edc4da80 --- /dev/null +++ b/build-aux/meson/post-install.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 + +import os +import shutil +import sys +import subprocess + +if 'DESTDIR' not in os.environ: + gtk_api_version = sys.argv[1] + gtk_abi_version = sys.argv[2] + gtk_bindir = sys.argv[3] + gtk_libdir = sys.argv[4] + gtk_datadir = sys.argv[5] + gtk_query_immodules = os.path.join(gtk_bindir, 'gtk-query-immodules-' + gtk_api_version) + + gtk_moduledir = os.path.join(gtk_libdir, 'gtk-' + gtk_api_version, gtk_abi_version) + gtk_immodule_dir = os.path.join(gtk_moduledir, 'immodules') + gtk_printmodule_dir = os.path.join(gtk_moduledir, 'printbackends') + + if os.name == 'nt': + for lib in ['gdk', 'gtk', 'gailutil']: + # Make copy for MSVC-built .lib files, e.g. xxx-3.lib->xxx-3.0.lib + installed_lib = os.path.join(gtk_libdir, lib + '-' + gtk_api_version.split('.')[0] + '.lib') + installed_lib_dst = os.path.join(gtk_libdir, lib + '-' + gtk_api_version + '.lib') + if os.path.isfile(installed_lib): + shutil.copyfile(installed_lib, installed_lib_dst) + + print('Compiling GSettings schemas...') + subprocess.call(['glib-compile-schemas', + os.path.join(gtk_datadir, 'glib-2.0', 'schemas')]) + + print('Updating icon cache...') + subprocess.call(['gtk-update-icon-cache', '-q', '-t' ,'-f', + os.path.join(gtk_datadir, 'icons', 'hicolor')]) + + print('Updating module cache for input methods...') + os.makedirs(gtk_immodule_dir, exist_ok=True) + immodule_cache_file = open(os.path.join(gtk_moduledir, 'immodules.cache'), 'w') + subprocess.call([gtk_query_immodules], stdout=immodule_cache_file) + immodule_cache_file.close() + + # Untested! + print('Updating module cache for print backends...') + os.makedirs(gtk_printmodule_dir, exist_ok=True) + subprocess.call(['gio-querymodules', gtk_printmodule_dir]) diff --git a/config.h.meson b/config.h.meson new file mode 100644 index 0000000000..f90c96b7e6 --- /dev/null +++ b/config.h.meson @@ -0,0 +1,298 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#mesondefine ENABLE_NLS + +/* The prefix for our gettext translation domains. */ +#mesondefine GETTEXT_PACKAGE + +/* Disable deprecation warnings from glib */ +#mesondefine GLIB_DISABLE_DEPRECATION_WARNINGS + +/* Define to 1 if you have the `bind_textdomain_codeset' function. */ +#mesondefine HAVE_BIND_TEXTDOMAIN_CODESET + +/* Define if libcloudproviders is available */ +#mesondefine HAVE_CLOUDPROVIDERS + +/* define if we have colord */ +#mesondefine HAVE_COLORD + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_CRT_EXTERNS_H + +/* Define to 1 if CUPS 1.6 API is available */ +#mesondefine HAVE_CUPS_API_1_6 + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#mesondefine HAVE_DCGETTEXT + +/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. + */ +#mesondefine HAVE_DECL_ISINF + +/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't. + */ +#mesondefine HAVE_DECL_ISNAN + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_DEV_EVDEV_INPUT_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_DLFCN_H + +/* Define to 1 if you have the `exp2' function. */ +#mesondefine HAVE_EXP2 + +/* Define to 1 if you have the `flockfile' function. */ +#mesondefine HAVE_FLOCKFILE + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_FTW_H + +/* Define to 1 if you have the `getpagesize' function. */ +#mesondefine HAVE_GETPAGESIZE + +/* Define to 1 if you have the `getresuid' function. */ +#mesondefine HAVE_GETRESUID + +/* Define if gio-unix is available */ +#mesondefine HAVE_GIO_UNIX + +/* defines whether we have HarfBuzz */ +#mesondefine HAVE_HARFBUZZ + +/* Define to 1 if you have the `httpGetAuthString' function. */ +#mesondefine HAVE_HTTPGETAUTHSTRING + +/* Define if cups http_t authstring field is accessible */ +#mesondefine HAVE_HTTP_AUTHSTRING + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_INTTYPES_H + +/* Define to 1 if the system has the type `IPrintDialogCallback'. */ +#mesondefine HAVE_IPRINTDIALOGCALLBACK + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_LINUX_INPUT_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_LINUX_MEMFD_H + +/* Define to 1 if you have the `localtime_r' function. */ +#mesondefine HAVE_LOCALTIME_R + +/* Define to 1 if you have the `log2' function. */ +#mesondefine HAVE_LOG2 + +/* Define to 1 if you have the `lstat' function. */ +#mesondefine HAVE_LSTAT + +/* Define to 1 if you have the `mallinfo' function. */ +#mesondefine HAVE_MALLINFO + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_MEMORY_H + +/* Define to 1 if you have the `mkstemp' function. */ +#mesondefine HAVE_MKSTEMP + +/* Define to 1 if you have a working `mmap' system call. */ +#mesondefine HAVE_MMAP + +/* Define to 1 if you have the `nearbyint' function. */ +#mesondefine HAVE_NEARBYINT + +/* defines whether we have pangoft2 */ +#mesondefine HAVE_PANGOFT + +/* Define to 1 if libpapi available */ +#mesondefine HAVE_PAPI + +/* Define to 1 if you have the `posix_fallocate' function. */ +#mesondefine HAVE_POSIX_FALLOCATE + +/* Have the Xrandr extension library */ +#mesondefine HAVE_RANDR + +/* Have the Xrandr 1.5 extension library */ +#mesondefine HAVE_RANDR15 + +/* Define to 1 if you have the `rint' function. */ +#mesondefine HAVE_RINT + +/* Define to 1 if you have the `round' function. */ +#mesondefine HAVE_ROUND + +/* Define to 1 if SetupDiGetDevicePropertyW() is available */ +#mesondefine HAVE_SETUP_DI_GET_DEVICE_PROPERTY_W + +/* Define to 1 if you have the `sincos' function. */ +#mesondefine HAVE_SINCOS + +/* Define to 1 if solaris xinerama is available */ +#mesondefine HAVE_SOLARIS_XINERAMA + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_SYS_MMAN_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_SYS_STAT_H + +/* Define to 1 if sys/sysinfo.h is available */ +#mesondefine HAVE_SYS_SYSINFO_H + +/* Define to 1 if sys/systeminfo.h is available */ +#mesondefine HAVE_SYS_SYSTEMINFO_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_SYS_TYPES_H + +/* Define to 1 if you have the `trunc' function. */ +#mesondefine HAVE_TRUNC + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_UNISTD_H + +/* Have the XCOMPOSITE X extension */ +#mesondefine HAVE_XCOMPOSITE + +/* Have the Xcursor library */ +#mesondefine HAVE_XCURSOR + +/* Have the XDAMAGE X extension */ +#mesondefine HAVE_XDAMAGE + +/* Have the XFIXES X extension */ +#mesondefine HAVE_XFIXES + +/* Define to 1 if XFree Xinerama is available */ +#mesondefine HAVE_XFREE_XINERAMA + +/* Have XGenericEvent */ +#mesondefine HAVE_XGENERICEVENTS + +/* Define to 1 if xinerama is available */ +#mesondefine HAVE_XINERAMA + +/* Define to use XKB extension */ +#mesondefine HAVE_XKB + +/* Have the SYNC extension library */ +#mesondefine HAVE_XSYNC + +/* Define to 1 if you have the `_lock_file' function. */ +#mesondefine HAVE__LOCK_FILE + +/* Define if _NL_MEASUREMENT_MEASUREMENT is available */ +#mesondefine HAVE__NL_MEASUREMENT_MEASUREMENT + +/* Define if _NL_PAPER_HEIGHT is available */ +#mesondefine HAVE__NL_PAPER_HEIGHT + +/* Define if _NL_PAPER_WIDTH is available */ +#mesondefine HAVE__NL_PAPER_WIDTH + +/* Define if _NL_TIME_FIRST_WEEKDAY is available */ +#mesondefine HAVE__NL_TIME_FIRST_WEEKDAY + +/* Define to 1 if you have the `_NSGetEnviron' function. */ +#mesondefine HAVE__NSGETENVIRON + +/* Define if needed for xReply */ +#mesondefine NEED_XIPROTO_H_FOR_XREPLY + +/* Define to the address where bug reports for this package should be sent. */ +#mesondefine PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#mesondefine PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#mesondefine PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#mesondefine PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#mesondefine PACKAGE_URL + +/* Define to the version of this package. */ +#mesondefine PACKAGE_VERSION + +/* Use NSBundle functions to determine load paths for libraries, translations, + etc. */ +#mesondefine QUARTZ_RELOCATION + +/* The size of `DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY', as computed by sizeof. + */ +#mesondefine SIZEOF_DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY + +/* Define to 1 if XInput 2.0 is available */ +#mesondefine XINPUT_2 + +/* Define to 1 if XInput 2.2 is available */ +#mesondefine XINPUT_2_2 + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#mesondefine _FILE_OFFSET_BITS + +/* defines how to decorate public symbols while building */ +#mesondefine _GDK_EXTERN + +/* Define for large files, on AIX-style hosts. */ +#mesondefine _LARGE_FILES + +/* Define to 1 if on MINIX. */ +#mesondefine _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#mesondefine _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#mesondefine _POSIX_SOURCE + +/* Define to `int' if doesn't define. */ +#mesondefine gid_t + +/* Define to `int' if doesn't define. */ +#mesondefine uid_t + +#mesondefine GTK_DATADIR + +#mesondefine GTK_LIBDIR + +#mesondefine GTK_PRINT_BACKENDS + +/* Define the location where the catalogs will be installed */ +#mesondefine GTK_LOCALEDIR + +#mesondefine ISO_CODES_PREFIX diff --git a/configure.ac b/configure.ac index f700616649..5615ac7193 100644 --- a/configure.ac +++ b/configure.ac @@ -1983,6 +1983,7 @@ docs/reference/gdk/version.xml docs/reference/gtk/Makefile docs/reference/gtk/gtk3.types docs/reference/gtk/version.xml +docs/reference/gtk/getting_started.xml docs/reference/libgail-util/Makefile docs/reference/libgail-util/version.xml docs/tools/Makefile diff --git a/demos/Makefile.am b/demos/Makefile.am index 5c4873cc10..f780869ead 100644 --- a/demos/Makefile.am +++ b/demos/Makefile.am @@ -3,4 +3,7 @@ include $(top_srcdir)/Makefile.decl SUBDIRS = gtk-demo widget-factory icon-browser +EXTRA_DIST = \ + meson.build + -include $(top_srcdir)/git.mk diff --git a/demos/gtk-demo/Makefile.am b/demos/gtk-demo/Makefile.am index c8529e5bf7..cbcd9cc93c 100644 --- a/demos/gtk-demo/Makefile.am +++ b/demos/gtk-demo/Makefile.am @@ -117,7 +117,9 @@ EXTRA_DIST += \ demo.gresource.xml \ $(resource_files) \ org.gtk.Demo.gschema.xml \ - demos.h.win32 + demos.h.win32 \ + meson.build \ + geninclude.py gsettings_SCHEMAS = \ org.gtk.Demo.gschema.xml diff --git a/demos/gtk-demo/geninclude.py b/demos/gtk-demo/geninclude.py new file mode 100755 index 0000000000..57038a43b8 --- /dev/null +++ b/demos/gtk-demo/geninclude.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import sys +import re +import os +from collections import * + +out_file = sys.argv[1] +in_files = sys.argv[2:] + + +file_output = """ +typedef GtkWidget *(*GDoDemoFunc) (GtkWidget *do_widget); + +typedef struct _Demo Demo; + +struct _Demo +{ + gchar *name; + gchar *title; + gchar *filename; + GDoDemoFunc func; + Demo *children; +}; + +""" + +# Demo = namedtuple('Demo', ['name', 'title', 'file', 'func']) + +demos = [] + +for demo_file in in_files: + filename = demo_file[demo_file.rfind('/')+1:] + demo_name = filename.replace(".c", "") + with open(demo_file, 'r') as f: + title = f.readline().replace("/*", "").strip() + + + file_output += "GtkWidget *do_" + demo_name + " (GtkWidget *do_widget);\n" + # demos += Demo(name = demo_name, + # title = title, + # file = demo_file, + # func = "do_" + title) + demos.append((demo_name, title, filename, "do_" + demo_name, -1)) + +# Generate a List of "Parent names" +parents = [] +parent_ids = [] +parent_index = 0 +for demo in demos: + if "/" in demo[1]: + slash_index = demo[1].index('/') + parent_name = demo[1][:slash_index] + do_break = False + + # Check for duplicates + if not parent_name in parents: + parents.append(parent_name) + parent_ids.append(parent_index) + demos.append(("NULL", parent_name, "NULL", "NULL", parent_index)) + + parent_index = parent_index + 1 + + +# For every child with a parent, generate a list of child demos +i = 0 +for parent in parents: + id = parent_ids[i] + file_output += "\nDemo child" + str(id) + "[] = {\n" + # iterate over all demos and check if the name starts with the given parent name + for child in demos: + if child[1].startswith(parent + "/"): + title = child[1][child[1].rfind('/') + 1:] + file_output += " { \"" + child[0] + "\", \"" + title + "\", \"" + child[2] + "\", " + child[3] + ", NULL },\n" + + + file_output += " { NULL }\n};\n" + i = i + 1 + + +# Sort demos by title +demos = sorted(demos, key=lambda x: x[1]) + +file_output += "\nDemo gtk_demos[] = {\n" +for demo in demos: + # Do not generate one of these for demos with a parent demo + if "/" not in demo[1]: + child_array = "NULL" + name = demo[0]; + title = demo[1]; + file = demo[2] + if name != "NULL": + name = "\"" + name + "\"" + if title != "NULL": + title = "\"" + title + "\"" + if file != "NULL": + file = "\"" + file + "\"" + + if demo[4] != -1: + child_array = "child" + str(demo[4]) + file_output += " { " + name + ", " + title + ", " + file + ", " + demo[3] + ", " + child_array + " },\n" + +file_output += " { NULL }\n};\n" + +ofile = open(out_file, "w") +ofile.write(file_output) +ofile.close() diff --git a/demos/gtk-demo/meson.build b/demos/gtk-demo/meson.build new file mode 100644 index 0000000000..e2af42c8c4 --- /dev/null +++ b/demos/gtk-demo/meson.build @@ -0,0 +1,143 @@ + +## These should be in the order you want them to appear in the +## demo app, which means alphabetized by demo title, not filename +demos = files([ + 'application_demo.c', + 'assistant.c', + 'builder.c', + 'button_box.c', + 'changedisplay.c', + 'clipboard.c', + 'colorsel.c', + 'combobox.c', + 'css_accordion.c', + 'css_basics.c', + 'css_blendmodes.c', + 'css_multiplebgs.c', + 'css_pixbufs.c', + 'css_shadows.c', + 'cursors.c', + 'dialog.c', + 'drawingarea.c', + 'editable_cells.c', + 'entry_buffer.c', + 'entry_completion.c', + 'event_axes.c', + 'expander.c', + 'filtermodel.c', + 'foreigndrawing.c', + 'gestures.c', + 'glarea.c', + 'headerbar.c', + 'hypertext.c', + 'iconview.c', + 'iconview_edit.c', + 'images.c', + 'infobar.c', + 'links.c', + 'listbox.c', + 'flowbox.c', + 'list_store.c', + 'markup.c', + 'menus.c', + 'modelbutton.c', + 'offscreen_window.c', + 'offscreen_window2.c', + 'overlay.c', + 'overlay2.c', + 'panes.c', + 'pickers.c', + 'pixbufs.c', + 'popover.c', + 'printing.c', + 'revealer.c', + 'rotated_text.c', + 'scale.c', + 'search_entry.c', + 'search_entry2.c', + 'shortcuts.c', + 'sidebar.c', + 'sizegroup.c', + 'spinbutton.c', + 'spinner.c', + 'stack.c', + 'textmask.c', + 'textview.c', + 'textscroll.c', + 'theming_style_classes.c', + 'toolpalette.c', + 'transparent.c', + 'tree_store.c', +]) + + +gtkdemo_deps = [libgtk_dep] + +if harfbuzz_dep.found() and pangoft_dep.found() + demos += files('font_features.c') + gtkdemo_deps += [harfbuzz_dep, pangoft_dep] +endif + +if os_unix + demos += files('pagesetup.c') +endif + +gtkdemo_sources = demos + files([ + 'main.c', +]) + + +geninclude = find_program('geninclude.py') +demos_h = custom_target( + 'gtk3 demo header', + output : 'demos.h', + input : demos, + command : [geninclude, '@OUTPUT@', '@INPUT@'], +) + +gtkdemo_resources = gnome.compile_resources( + 'gtkdemo_resources', + 'demo.gresource.xml', + source_dir: '.' +) + +gtkdemo = executable( + 'gtk3-demo', + gtkdemo_sources, + demos_h, + gtkdemo_resources, + dependencies: gtkdemo_deps, + include_directories : confinc, + install: true +) + +gtkapplicationdemo = executable( + 'gtk3-demo-application', + 'application.c', + demos_h, + gtkdemo_resources, + dependencies: gtkdemo_deps, + include_directories : confinc, + install: true +) + +gtk_settings_schemas = [ + 'org.gtk.Settings.FileChooser.gschema.xml', + 'org.gtk.Settings.ColorChooser.gschema.xml', + 'org.gtk.Settings.EmojiChooser.gschema.xml', + 'org.gtk.Settings.Debug.gschema.xml', +] + +foreach s: [ '16', '22', '24', '32', '48', '256'] + icon_destdir = join_paths(gtk_datadir, 'icons', 'hicolor', '@0@x@0@'.format(s), 'apps') + icons = [join_paths('data', '@0@x@0@'.format(s), 'gtk3-demo.png'), + join_paths('data', '@0@x@0@'.format(s), 'gtk3-demo-symbolic.symbolic.png')] + install_data(icons, install_dir: icon_destdir) +endforeach + +# desktop file +install_data('gtk3-demo.desktop', install_dir: gtk_applicationsdir) + +# GSettings +install_data('org.gtk.Demo.gschema.xml', install_dir: gtk_schemasdir) +gnome.compile_schemas(depend_files: files(['org.gtk.Demo.gschema.xml'])) diff --git a/demos/icon-browser/Makefile.am b/demos/icon-browser/Makefile.am index 6de3fe7de5..d5f933bf2f 100644 --- a/demos/icon-browser/Makefile.am +++ b/demos/icon-browser/Makefile.am @@ -34,7 +34,8 @@ EXTRA_DIST = \ menus.ui \ iconbrowser.gresource.xml \ window.ui \ - icon.list + icon.list \ + meson.build # ------------------- MSVC Build Items ---------------- MSVCPROJS = gtk3-icon-browser diff --git a/demos/icon-browser/meson.build b/demos/icon-browser/meson.build new file mode 100644 index 0000000000..f241a5a7c4 --- /dev/null +++ b/demos/icon-browser/meson.build @@ -0,0 +1,24 @@ +iconbrowser_sources = [ + 'main.c', + 'iconbrowserapp.c', + 'iconbrowserwin.c', + 'iconstore.c' +] + +iconbrowser_resources = gnome.compile_resources( + 'iconbrowser_resources', + 'iconbrowser.gresource.xml', + source_dir: '.' +) + +iconbrowser = executable( + 'gtk3-icon-browser', + iconbrowser_sources, + iconbrowser_resources, + dependencies: libgtk_dep, + include_directories : confinc, + install: true +) + +# desktop file +install_data('gtk3-icon-browser.desktop', install_dir: gtk_applicationsdir) diff --git a/demos/meson.build b/demos/meson.build new file mode 100644 index 0000000000..2fdd19151d --- /dev/null +++ b/demos/meson.build @@ -0,0 +1,3 @@ + subdir('icon-browser') + subdir('widget-factory') + subdir('gtk-demo') diff --git a/demos/widget-factory/Makefile.am b/demos/widget-factory/Makefile.am index 62c156aa09..c33a6d0a95 100644 --- a/demos/widget-factory/Makefile.am +++ b/demos/widget-factory/Makefile.am @@ -66,6 +66,7 @@ EXTRA_DIST += \ help-overlay.ui \ widget-factory.gresource.xml \ data/source.svg \ - data/symbolic-source.svg + data/symbolic-source.svg \ + meson.build -include $(top_srcdir)/git.mk diff --git a/demos/widget-factory/meson.build b/demos/widget-factory/meson.build new file mode 100644 index 0000000000..2a1b980fa8 --- /dev/null +++ b/demos/widget-factory/meson.build @@ -0,0 +1,29 @@ + +widgetfactory_sources = [ + 'widget-factory.c' +] + +widgetfactory_resources = gnome.compile_resources( + 'widgetfactory_resources', + 'widget-factory.gresource.xml', + source_dir: '.' +) + +foreach s: [ '16', '22', '24', '32', '48', '256'] + icon_destdir = join_paths(gtk_datadir, 'icons', 'hicolor', '@0@x@0@'.format(s), 'apps') + icons = [join_paths('data', '@0@x@0@'.format(s), 'gtk3-widget-factory.png'), + join_paths('data', '@0@x@0@'.format(s), 'gtk3-widget-factory-symbolic.symbolic.png')] + install_data(icons, install_dir: icon_destdir) +endforeach + +widget_factory = executable( + 'gtk3-widget-factory', + widgetfactory_sources, + widgetfactory_resources, + dependencies: libgtk_dep, + include_directories : confinc, + install: true +) + +# desktop file +install_data('gtk3-widget-factory.desktop', install_dir: gtk_applicationsdir) diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am index a2f772e660..3a52c1e9a6 100644 --- a/docs/reference/Makefile.am +++ b/docs/reference/Makefile.am @@ -5,4 +5,7 @@ SUBDIRS = gdk gtk libgail-util GITIGNOREFILES = */*.1 +EXTRA_DIST += \ + meson.build + -include $(top_srcdir)/git.mk diff --git a/docs/reference/gdk/Makefile.am b/docs/reference/gdk/Makefile.am index d86a188784..77264cf210 100644 --- a/docs/reference/gdk/Makefile.am +++ b/docs/reference/gdk/Makefile.am @@ -198,7 +198,9 @@ endif include $(top_srcdir)/gtk-doc.make # Other files to distribute -EXTRA_DIST += version.xml.in +EXTRA_DIST += \ + version.xml.in \ + meson.build if ENABLE_GTK_DOC TESTS_ENVIRONMENT = cd $(srcdir) && \ diff --git a/docs/reference/gdk/meson.build b/docs/reference/gdk/meson.build new file mode 100644 index 0000000000..96a993e066 --- /dev/null +++ b/docs/reference/gdk/meson.build @@ -0,0 +1,180 @@ +private_headers = [ + 'gdkintl.h', + 'gdkmarshalers.h', + 'gdkkeysyms.h', + 'gdkinternals.h', + 'gdkprivate.h', + 'gdk-private.h', + 'gdkapplaunchcontextprivate.h', + 'gdkcursorprivate.h', + 'gdkdevicemanagerprivate.h', + 'gdkdeviceprivate.h', + 'gdkdisplaymanagerprivate.h', + 'gdkdisplayprivate.h', + 'gdkdndprivate.h', + 'gdkframeclockprivate.h', + 'gdkglcontextprivate.h', + 'gdkkeysprivate.h', + 'gdkscreenprivate.h', + 'gdkseatdefaultprivate.h', + 'gdkseatprivate.h', + 'gdkvisualprivate.h', + 'keyname-table.h', + 'win32', + 'x11', + 'quartz', + 'broadway', + 'wayland', +] + +images = [ + 'images/rotated-text.png', + 'images/X_cursor.png', + 'images/arrow.png', + 'images/based_arrow_down.png', + 'images/based_arrow_up.png', + 'images/boat.png', + 'images/bogosity.png', + 'images/bottom_left_corner.png', + 'images/bottom_right_corner.png', + 'images/bottom_side.png', + 'images/bottom_tee.png', + 'images/box_spiral.png', + 'images/center_ptr.png', + 'images/circle.png', + 'images/clock.png', + 'images/coffee_mug.png', + 'images/cross.png', + 'images/cross_reverse.png', + 'images/crosshair.png', + 'images/diamond_cross.png', + 'images/dot.png', + 'images/dotbox.png', + 'images/double_arrow.png', + 'images/draft_large.png', + 'images/draft_small.png', + 'images/draped_box.png', + 'images/exchange.png', + 'images/fleur.png', + 'images/gobbler.png', + 'images/gumby.png', + 'images/hand1.png', + 'images/hand2.png', + 'images/heart.png', + 'images/icon.png', + 'images/iron_cross.png', + 'images/left_ptr.png', + 'images/left_side.png', + 'images/left_tee.png', + 'images/leftbutton.png', + 'images/ll_angle.png', + 'images/lr_angle.png', + 'images/man.png', + 'images/middlebutton.png', + 'images/mouse.png', + 'images/pencil.png', + 'images/pirate.png', + 'images/plus.png', + 'images/question_arrow.png', + 'images/right_ptr.png', + 'images/right_side.png', + 'images/right_tee.png', + 'images/rightbutton.png', + 'images/rtl_logo.png', + 'images/sailboat.png', + 'images/sb_down_arrow.png', + 'images/sb_h_double_arrow.png', + 'images/sb_left_arrow.png', + 'images/sb_right_arrow.png', + 'images/sb_up_arrow.png', + 'images/sb_v_double_arrow.png', + 'images/shuttle.png', + 'images/sizing.png', + 'images/spider.png', + 'images/spraycan.png', + 'images/star.png', + 'images/target.png', + 'images/tcross.png', + 'images/top_left_arrow.png', + 'images/top_left_corner.png', + 'images/top_right_corner.png', + 'images/top_side.png', + 'images/top_tee.png', + 'images/trek.png', + 'images/ul_angle.png', + 'images/umbrella.png', + 'images/ur_angle.png', + 'images/watch.png', + 'images/xterm.png', + 'images/alias_cursor.png', + 'images/all_scroll_cursor.png', + 'images/cell_cursor.png', + 'images/col_resize_cursor.png', + 'images/copy_cursor.png', + 'images/crosshair_cursor.png', + 'images/default_cursor.png', + 'images/e_resize_cursor.png', + 'images/ew_resize_cursor.png', + 'images/grabbing_cursor.png', + 'images/grab_cursor.png', + 'images/hand_cursor.png', + 'images/context_menu_cursor.png', + 'images/help_cursor.png', + 'images/move_cursor.png', + 'images/ne_resize_cursor.png', + 'images/nesw_resize_cursor.png', + 'images/no_drop_cursor.png', + 'images/not_allowed_cursor.png', + 'images/n_resize_cursor.png', + 'images/ns_resize_cursor.png', + 'images/nw_resize_cursor.png', + 'images/nwse_resize_cursor.png', + 'images/pointer_cursor.png', + 'images/progress_cursor.png', + 'images/row_resize_cursor.png', + 'images/se_resize_cursor.png', + 'images/s_resize_cursor.png', + 'images/sw_resize_cursor.png', + 'images/text_cursor.png', + 'images/vertical_text_cursor.png', + 'images/wait_cursor.png', + 'images/w_resize_cursor.png', + 'images/X_cursor.png', + 'images/zoom_in_cursor.png', + 'images/zoom_out_cursor.png', +] + +src_dir = [ gdkinc ] + +if x11_enabled + src_dir += [ gdkx11_inc ] +endif + +if wayland_enabled + src_dir += [ gdkwayland_inc ] +endif + +if get_option('gtk_doc') + + configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) + + gnome.gtkdoc('gdk3', + mode: 'none', + main_xml: 'gdk-docs.sgml', + src_dir: src_dir, + dependencies: libgdk_dep, + gobject_typesfile: join_paths(meson.current_source_dir(), 'gdk3.types'), + scan_args: [ + '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT', + '--ignore-headers=' + ' '.join(private_headers), + ], + fixxref_args: [ + '--html-dir=@0@'.format(docpath), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')), + '--extra-dir=@0@'.format(cairo_docpath), + ], + html_assets: images, + install: true) +endif diff --git a/docs/reference/gtk/Makefile.am b/docs/reference/gtk/Makefile.am index abdea7fb59..4e20337d7d 100644 --- a/docs/reference/gtk/Makefile.am +++ b/docs/reference/gtk/Makefile.am @@ -287,7 +287,7 @@ content_files = \ css-overview.xml \ css-properties.xml \ drawing-model.xml \ - getting_started.xml \ + $(builddir)/getting_started.xml \ glossary.xml \ gtk3-demo-application.xml \ gtk3-demo.xml \ @@ -324,7 +324,7 @@ content_files = \ expand_content_files = \ compiling.sgml \ drawing-model.xml \ - getting_started.xml \ + $(builddir)/getting_started.xml \ glossary.xml \ input-handling.xml \ migrating-2to3.xml \ @@ -496,7 +496,7 @@ endif include $(top_srcdir)/gtk-doc.make # Other files to distribute -EXTRA_DIST += version.xml.in gtk3.types.in +EXTRA_DIST += version.xml.in gtk3.types.in getting_started.xml.in ######################################################################## @@ -543,7 +543,9 @@ endif MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES) -EXTRA_DIST += $(man_MANS) +EXTRA_DIST += \ + $(man_MANS) \ + meson.build if ENABLE_GTK_DOC TESTS_ENVIRONMENT = cd $(srcdir) && \ diff --git a/docs/reference/gtk/getting_started.xml b/docs/reference/gtk/getting_started.xml.in similarity index 92% rename from docs/reference/gtk/getting_started.xml rename to docs/reference/gtk/getting_started.xml.in index 30cd88387d..efa604c862 100644 --- a/docs/reference/gtk/getting_started.xml +++ b/docs/reference/gtk/getting_started.xml.in @@ -44,7 +44,7 @@ Create a new file with the following content named example-0.c. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT @@ -153,7 +153,7 @@ Hello World in GTK+ Create a new file with the following content named example-1.c. - + MISSING XINCLUDE CONTENT @@ -233,7 +233,7 @@ Packing buttons Create a new file with the following content named example-2.c. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT You can compile the program above with GCC using: @@ -257,9 +257,9 @@ Packing buttons with GtkBuilder Create a new file with the following content named example-3.c. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT Create a new file with the following content named builder.ui. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT You can compile the program above with GCC using: @@ -346,7 +346,7 @@ of our application class. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT All the application logic is in the application class, which @@ -364,7 +364,7 @@ GIO documentation. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT Another important class that is part of the application support @@ -373,7 +373,7 @@ window. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT As part of the initial setup of our application, we also @@ -388,7 +388,7 @@ - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT Note that @bindir@ needs to be replaced @@ -420,7 +420,7 @@ - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT To make use of this file in our application, we revisit @@ -460,7 +460,7 @@ example_app_window_class_init (ExampleAppWindowClass *class) - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT This file has to be converted into a C source file that will be @@ -598,7 +598,7 @@ example_app_window_open (ExampleAppWindow *win, in a ui file, and add it as a resource to our binary. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT To associate the app menu with the application, we have to call @@ -697,7 +697,7 @@ example_app_class_init (ExampleAppClass *class) GSettings requires a schema that describes our settings: - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT Before we can make use of this schema in our application, @@ -749,13 +749,13 @@ example_app_window_init (ExampleAppWindow *win) Lets start with the template. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT Next comes the dialog subclass. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT Now we revisit the preferences_activated() function in our @@ -807,7 +807,7 @@ preferences_activated (GSimpleAction *action, to slide out the search bar below the header bar. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT Implementing the search needs quite a few code changes that @@ -887,7 +887,7 @@ example_app_window_init (ExampleAppWindow *win) which demonstrates #GtkMenuButton, #GtkRevealer and #GtkListBox. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT The code to populate the sidebar with buttons for the words @@ -898,7 +898,7 @@ example_app_window_init (ExampleAppWindow *win) ui file. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT To connect the menuitem to the show-words setting, we use @@ -957,7 +957,7 @@ example_app_window_init (ExampleAppWindow *win) triggers the show-lines action: - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT To make this menu item do something, we create a property @@ -1017,7 +1017,7 @@ example_app_window_init (ExampleAppWindow *win) be a direct child of the window, and set its type to be titlebar. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT A small extra bonus of using a header bar is that we get @@ -1073,7 +1073,7 @@ example_app_window_init (ExampleAppWindow *win) Drawing in response to input Create a new file with the following content named example-4.c. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT You can compile the program above with GCC using: diff --git a/docs/reference/gtk/meson.build b/docs/reference/gtk/meson.build new file mode 100644 index 0000000000..a49235cb1e --- /dev/null +++ b/docs/reference/gtk/meson.build @@ -0,0 +1,535 @@ +private_headers = [ + 'inspector', + 'a11y', + 'gtkaccelgroupprivate.h', + 'gtkaccelmapprivate.h', + 'gtkadjustmentprivate.h', + 'gtkallocatedbitmaskprivate.h', + 'gtkappchooserprivate.h', + 'gtkapplicationaccelsprivate.h', + 'gtkapplicationprivate.h', + 'gtkbindingsprivate.h', + 'gtkbitmaskprivate.h', + 'gtkboxprivate.h', + 'gtkbuilderprivate.h', + 'gtkbuttonprivate.h', + 'gtkcairoblurprivate.h', + 'gtkcellareaboxcontextprivate.h', + 'gtkclipboardprivate.h', + 'gtkcolorchooserprivate.h', + 'gtkcoloreditorprivate.h', + 'gtkcolorplaneprivate.h', + 'gtkcolorscaleprivate.h', + 'gtkcolorswatchprivate.h', + 'gtkcomboboxprivate.h', + 'gtkcontainerprivate.h', + 'gtkcssanimatedstyleprivate.h', + 'gtkcssanimationprivate.h', + 'gtkcssarrayvalueprivate.h', + 'gtkcssbgsizevalueprivate.h', + 'gtkcssbordervalueprivate.h', + 'gtkcsscolorvalueprivate.h', + 'gtkcsscornervalueprivate.h', + 'gtkcsscustompropertyprivate.h', + 'gtkcsseasevalueprivate.h', + 'gtkcssenginevalueprivate.h', + 'gtkcssenumvalueprivate.h', + 'gtkcssiconthemevalueprivate.h', + 'gtkcssimagebuiltinprivate.h', + 'gtkcssimagecrossfadeprivate.h', + 'gtkcssimagegradientprivate.h', + 'gtkcssimageiconthemeprivate.h', + 'gtkcssimagelinearprivate.h', + 'gtkcssimageprivate.h', + 'gtkcssimagescaledprivate.h', + 'gtkcssimagesurfaceprivate.h', + 'gtkcssimageurlprivate.h', + 'gtkcssimagevalueprivate.h', + 'gtkcssimagewin32private.h', + 'gtkcssinheritvalueprivate.h', + 'gtkcssinitialvalueprivate.h', + 'gtkcsskeyframesprivate.h', + 'gtkcsslookupprivate.h', + 'gtkcssmatcherprivate.h', + 'gtkcssnodeprivate.h', + 'gtkcssnodedeclarationprivate.h', + 'gtkcssnumbervalueprivate.h', + 'gtkcsspathnodeprivate.h', + 'gtkcssparserprivate.h', + 'gtkcsspositionvalueprivate.h', + 'gtkcssproviderprivate.h', + 'gtkcssrepeatvalueprivate.h', + 'gtkcssrgbavalueprivate.h', + 'gtkcsssectionprivate.h', + 'gtkcssselectorprivate.h', + 'gtkcssshadowsvalueprivate.h', + 'gtkcssshadowvalueprivate.h', + 'gtkcssshorthandpropertyprivate.h', + 'gtkcssstaticstyleprivate.h', + 'gtkcssstringvalueprivate.h', + 'gtkcssstylefuncsprivate.h', + 'gtkcssstyleprivate.h', + 'gtkcssstylepropertyprivate.h', + 'gtkcsstransformvalueprivate.h', + 'gtkcsstransientnodeprivate.h', + 'gtkcsstransitionprivate.h', + 'gtkcsstypedvalueprivate.h', + 'gtkcsstypesprivate.h', + 'gtkcssunsetvalueprivate.h', + 'gtkcssvalueprivate.h', + 'gtkcsswidgetnodeprivate.h', + 'gtkdialogprivate.h', + 'gtkentryprivate.h', + 'gtkeventcontrollerprivate.h', + 'gtkfilechooserprivate.h', + 'gtkfilechooserwidgetprivate.h', + 'gtkfontchooserprivate.h', + 'gtkgesturedragprivate.h', + 'gtkgesturelongpressprivate.h', + 'gtkgesturemultipressprivate.h', + 'gtkgesturepanprivate.h', + 'gtkgestureprivate.h', + 'gtkgesturerotateprivate.h', + 'gtkgesturesingleprivate.h', + 'gtkgestureswipeprivate.h', + 'gtkgesturezoomprivate.h', + 'gtkheaderbarprivate.h', + 'gtkhslaprivate.h', + 'gtkiconhelperprivate.h', + 'gtkiconviewprivate.h', + 'gtkimageprivate.h', + 'gtkimmoduleprivate.h', + 'gtklabelprivate.h', + 'gtklockbuttonprivate.h', + 'gtkmagnifierprivate.h', + 'gtkmenubuttonprivate.h', + 'gtkmenuitemprivate.h', + 'gtkmenuprivate.h', + 'gtkmenushellprivate.h', + 'gtkmodulesprivate.h', + 'gtkmountoperationprivate.h', + 'gtkorientableprivate.h', + 'gtkpixelcacheprivate.h', + 'gtkplacessidebarprivate.h', + 'gtkplacesviewprivate.h', + 'gtkplacesviewrowprivate.h', + 'gtkpopoverprivate.h', + 'gtkprinter-private.h', + 'gtkprintoperation-private.h', + 'gtkprivate.h', + 'gtkrangeprivate.h', + 'gtkrecentchooserprivate.h', + 'gtkrenderbackgroundprivate.h', + 'gtkrenderborderprivate.h', + 'gtkrendericonprivate.h', + 'gtkrenderprivate.h', + 'gtkroundedboxprivate.h', + 'gtkscaleprivate.h', + 'gtksearchengine.h', + 'gtksearchenginemodel.h', + 'gtksearchenginequartz.h', + 'gtksearchenginesimple.h', + 'gtksearchenginetracker.h', + 'gtksearchentryprivate.h', + 'gtkselectionprivate.h', + 'gtksettingsprivate.h', + 'gtksidebarrowprivate.h', + 'gtksizegroup-private.h', + 'gtksizerequestcacheprivate.h', + 'gtksocketprivate.h', + 'gtkstyleanimationprivate.h', + 'gtkstylecascadeprivate.h', + 'gtkstylecontextprivate.h', + 'gtkstylepropertyprivate.h', + 'gtkstyleproviderprivate.h', + 'gtktextattributesprivate.h', + 'gtktextchildprivate.h', + 'gtktexthandleprivate.h', + 'gtktextiterprivate.h', + 'gtktextmarkprivate.h', + 'gtktexttagprivate.h', + 'gtktogglebuttonprivate.h', + 'gtktoolbarprivate.h', + 'gtktoolpaletteprivate.h', + 'gtktooltipprivate.h', + 'gtktooltipwindowprivate.h', + 'gtktreeprivate.h', + 'gtkwidgetprivate.h', + 'gtkwin32themeprivate.h', + 'gtkwindowprivate.h', + 'fnmatch.h', + 'gtkactionmuxer.h', + 'gtkactionobserver.h', + 'gtkactionobservable.h', + 'gtk9slice.h', + 'gtkanimationdescription.h', + 'gtkbitmaskprivateimpl.h', + 'gtkbookmarksmanager.h', + 'gtkdbusgenerated.c', + 'gtkdbusgenerated.h', + 'gtkdebug.h', + 'gtkactionhelper.h', + 'gtkdndcursors.h', + 'gtkfilechooserdefault.h', + 'gtkfilechooserembed.h', + 'gtkfilechooserentry.h', + 'gtkfilechoosersettings.h', + 'gtkfilechooserutils.h', + 'gtkfilesystem.h', + 'gtkfilesystemmodel.h', + 'gtkfilesystemunix.h', + 'gtkfilesystemwin32.h', + 'gtkfontchooserutils.h', + 'gtkiconcache.h', + 'gtkiconcachevalidator.h', + 'gtkiconthemeparser.h', + 'gtkintl.h', + 'gtkkeyhash.h', + 'gtkkineticscrolling.h', + 'gtkmarshal.h', + 'gtkmnemonichash.h', + 'gtkmenutracker.h', + 'gtkmenutrackeritem.h', + 'gtkmenusectionbox.h', + 'gtkmodelmenu.h', + 'gtkmodelmenuitem.h', + 'gtkmodifierstyle.h', + 'gtkpathbar.h', + 'gtkprintbackend.h', + 'gtkprinteroption.h', + 'gtkprinteroptionset.h', + 'gtkprinteroptionwidget.h', + 'gtkprint-win32.h', + 'gtkprintutils.h', + 'gtkprivate.h', + 'gtkprivatetypebuiltins.h', + 'gtkquery.h', + 'gtkrbtree.h', + 'gtkrecentchooserdefault.h', + 'gtkrecentchooserutils.h', + 'gtksearchengine.h', + 'gtksearchenginetracker.h', + 'gtksearchenginesimple.h', + 'gtksearchenginequartz.h', + 'gtksequence.h', + 'gtksocketprivate.h', + 'gtktextbtree.h', + 'gtktextbufferserialize.h', + 'gtktextdisplay.h', + 'gtktextlayout.h', + 'gtktextsegment.h', + 'gtktexttypes.h', + 'gtktextutil.h', + 'gtktimeline.h', + 'gtkthemes.h', + 'gtktrashmonitor.h', + 'gtktrayicon.h', + 'gtktreedatalist.h', + 'gtktreemenu.h', + 'gtktypebuiltins.h', + 'gtkxembed.h', + 'gtkwin32embed.h', + 'gtkwin32embedwidget.h', + 'gtkwindow-decorate.h', + 'xdgmime', + 'xembed.h', +] + +images = [ + 'images/aboutdialog.png', + 'images/accel-label.png', + 'images/action-bar.png', + 'images/appchooserbutton.png', + 'images/appchooserdialog.png', + 'images/assistant.png', + 'images/box-packing.png', + 'images/box-expand.png', + 'images/button.png', + 'images/check-button.png', + 'images/color-button.png', + 'images/colorchooser.png', + 'images/combo-box.png', + 'images/combo-box-entry.png', + 'images/combo-box-text.png', + 'images/entry.png', + 'images/figure-hierarchical-drawing.png', + 'images/figure-windowed-label.png', + 'images/file-button.png', + 'images/filechooser.png', + 'images/font-button.png', + 'images/fontchooser.png', + 'images/frame.png', + 'images/glarea.png', + 'images/headerbar.png', + 'images/icon-view.png', + 'images/image.png', + 'images/info-bar.png', + 'images/label.png', + 'images/levelbar.png', + 'images/link-button.png', + 'images/list-and-tree.png', + 'images/lock-button.png', + 'images/lockbutton.png', + 'images/lockbutton-locked.png', + 'images/lockbutton-unlocked.png', + 'images/lockbutton-sorry.png', + 'images/menubar.png', + 'images/menu-button.png', + 'images/messagedialog.png', + 'images/multiline-text.png', + 'images/notebook.png', + 'images/panes.png', + 'images/pagesetupdialog.png', + 'images/placessidebar.png', + 'images/popup-anchors.png', + 'images/popup-flip.png', + 'images/popup-slide.png', + 'images/printdialog.png', + 'images/progressbar.png', + 'images/radio-group.png', + 'images/recentchooserdialog.png', + 'images/scales.png', + 'images/scrollbar.png', + 'images/scrolledwindow.png', + 'images/search-bar.png', + 'images/search-entry.png', + 'images/separator.png', + 'images/sidebar.png', + 'images/spinbutton.png', + 'images/spinner.png', + 'images/stack.png', + 'images/stackswitcher.png', + 'images/statusbar.png', + 'images/toggle-button.png', + 'images/toolbar.png', + 'images/toolpalette.png', + 'images/tree-view-coordinates.png', + 'images/volumebutton.png', + 'images/window.png', + 'images/layout-btlr.png', + 'images/layout-btrl.png', + 'images/layout-lrbt.png', + 'images/layout-lrtb.png', + 'images/layout-rlbt.png', + 'images/layout-rltb.png', + 'images/layout-tblr.png', + 'images/layout-tbrl.png', + 'images/widget-hvalign.png', + 'images/window-default.png', + 'images/hello-world.png', + 'images/grid-packing.png', + 'images/drawing.png', + 'images/switch.png', + 'images/linear.png', + 'images/ease.png', + 'images/ease-in-out.png', + 'images/ease-in.png', + 'images/ease-out.png', + 'images/gradient1.png', + 'images/gradient2.png', + 'images/gradient3.png', + 'images/gradient4.png', + 'images/border1.png', + 'images/border2.png', + 'images/border3.png', + 'images/slices.png', + 'images/checks.png', + 'images/options.png', + 'images/arrows.png', + 'images/expanders.png', + 'images/background.png', + 'images/frames.png', + 'images/frame-gap.png', + 'images/sliders.png', + 'images/focus.png', + 'images/handles.png', + 'images/extensions.png', + 'images/numerableicon.png', + 'images/numerableicon2.png', + 'images/bloatpad-osx.png', + 'images/bloatpad-gnome.png', + 'images/bloatpad-xfce.png', + 'images/down-center.png', + 'images/down-end.png', + 'images/down-start.png', + 'images/left-center.png', + 'images/left-end.png', + 'images/left-start.png', + 'images/right-center.png', + 'images/right-end.png', + 'images/right-start.png', + 'images/up-center.png', + 'images/up-end.png', + 'images/up-start.png', + 'images/list-box.png', + 'images/getting-started-app1.png', + 'images/getting-started-app2.png', + 'images/getting-started-app3.png', + 'images/getting-started-app4.png', + 'images/getting-started-app6.png', + 'images/getting-started-app7.png', + 'images/getting-started-app8.png', + 'images/getting-started-app9.png', + 'images/getting-started-app10.png', + 'images/exampleapp.png', + 'images/flow-box.png', + 'images/inspector.png', + 'images/gedit-shortcuts.png', + 'images/clocks-shortcuts.png', + 'images/builder-shortcuts.png', +] + +content_files = [ + 'broadway.xml', + 'broadwayd.xml', + 'building.sgml', + 'css-overview.xml', + 'css-properties.xml', + 'gtk3-demo-application.xml', + 'gtk3-demo.xml', + 'gtk3-icon-browser.xml', + 'gtk3-widget-factory.xml', + 'gtk-builder-tool.xml', + 'gtk-encode-symbolic-svg.xml', + 'gtk-launch.xml', + 'gtk-query-immodules-3.0.xml', + 'gtk-query-settings.xml', + 'gtk-update-icon-cache.xml', + 'mir.xml', + 'osx.sgml', + 'overview.xml', + 'resources.sgml', + 'running.sgml', + 'visual_index.xml', + 'wayland.xml', + 'windows.sgml', + 'x11.sgml', +] + +expand_content_files = [ + 'compiling.sgml', + 'drawing-model.xml', + join_paths(meson.current_build_dir(), 'getting_started.xml'), + 'glossary.xml', + 'input-handling.xml', + 'migrating-2to3.xml', + 'migrating-3xtoy.xml', + 'migrating-checklist.sgml', + 'migrating-GtkGrid.xml', + 'migrating-GtkStyleContext.xml', + 'migrating-smclient-GtkApplication.xml', + 'migrating-unique-GtkApplication.xml', + 'question_index.sgml', + 'text_widget.sgml', + 'tree_widget.sgml', +] + +content_files += expand_content_files + +types_conf = configuration_data() +if os_win32 + types_conf.set('DISABLE_ON_W32', '%') +else + types_conf.set('DISABLE_ON_W32', '') +endif + +if os_darwin + types_conf.set('DISABLE_ON_QUARTZ', '%') +else + types_conf.set('DISABLE_ON_QUARTZ', '') +endif + +if x11_enabled + types_conf.set('ENABLE_ON_X11', '') +else + types_conf.set('ENABLE_ON_X11', '%') +endif + +if get_option('gtk_doc') + + configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) + configure_file(input: 'getting_started.xml.in', output: 'getting_started.xml', configuration: src_dir_conf) + + gnome.gtkdoc('gtk3', + mode: 'none', + main_xml: 'gtk-docs.sgml', + src_dir: [ + gtkinc, + ], + dependencies: libgtk_dep, + gobject_typesfile: configure_file( + input: 'gtk3.types.in', + output: 'gtk3.types', + configuration: types_conf, + ), + scan_args: [ + '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT', + '--ignore-headers=' + ' '.join(private_headers), + ], + mkdb_args: [ + '--default-includes=gtk/gtk.h', + ], + fixxref_args: [ + '--html-dir=@0@'.format(docpath), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')), + '--extra-dir=@0@'.format(cairo_docpath), + '--extra-dir=@0@'.format(gdkpixbuf_docpath), + '--extra-dir=../gdk', + ], + content_files: content_files, + expand_content_files: expand_content_files, + html_assets: images, + install: true) +endif + +xsltproc = find_program('xsltproc', required: false) +if get_option('man') and not xsltproc.found() + error('No xsltproc found, but man pages were explicitly enabled') +endif + +if get_option('man') and xsltproc.found() + xlstproc_flags = [ + '--nonet', + '--stringparam', 'man.output.quietly', '1', + '--stringparam', 'funcsynopsis.style', 'ansi', + '--stringparam', 'man.th.extra1.suppress', '1', + '--stringparam', 'man.authors.section.enabled', '0', + '--stringparam', 'man.copyright.section.enabled', '0', + ] + + man_files = [ + [ 'gtk-query-immodules-3.0', '1', ], + [ 'gtk-update-icon-cache', '1', ], + [ 'gtk-encode-symbolic-svg', '1', ], + [ 'gtk-launch', '1', ], + [ 'gtk3-demo', '1', ], + [ 'gtk3-demo-application', '1', ], + [ 'gtk3-widget-factory', '1', ], + [ 'gtk3-icon-browser', '1', ], + [ 'gtk-builder-tool', '1', ], + [ 'gtk-query-settings', '1', ], + ] + + if broadway_enabled + man_files += [[ 'broadwayd', '1', ]] + endif + + foreach man: man_files + man_name = man.get(0) + man_section = man.get(1, '1') + custom_target('@0@.@1@'.format(man_name, man_section), + input: '@0@.xml'.format(man_name), + output: '@0@.@1@'.format(man_name, man_section), + command: [ + xsltproc, + xlstproc_flags, + '-o', '@OUTPUT@', + 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl', + '@INPUT@', + ], + install: true, + install_dir: join_paths(get_option('mandir'), 'man@0@'.format(man_section))) + endforeach +endif diff --git a/docs/reference/libgail-util/Makefile.am b/docs/reference/libgail-util/Makefile.am index 263471d9b8..43f66a14e7 100644 --- a/docs/reference/libgail-util/Makefile.am +++ b/docs/reference/libgail-util/Makefile.am @@ -34,6 +34,8 @@ HTML_IMAGES = include $(top_srcdir)/gtk-doc.make # Other files to distribute -EXTRA_DIST += version.xml.in +EXTRA_DIST += \ + version.xml.in \ + meson.build -include $(top_srcdir)/git.mk diff --git a/docs/reference/libgail-util/meson.build b/docs/reference/libgail-util/meson.build new file mode 100644 index 0000000000..ce32d9f8db --- /dev/null +++ b/docs/reference/libgail-util/meson.build @@ -0,0 +1,21 @@ +if get_option('gtk_doc') + configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) + + gnome.gtkdoc('gail-libgail-util3', + mode: 'none', + main_xml: 'gail-libgail-util-docs.sgml', + src_dir: libgailutilinc, + dependencies: [libgtk_dep, libgailutil], + gobject_typesfile: join_paths(meson.current_source_dir(), 'gail-libgail-util3.types'), + scan_args: [ + '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT', + ], + fixxref_args: [ + '--html-dir=@0@'.format(docpath), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')), + '--extra-dir=../gtk', + ], + install: true) +endif diff --git a/docs/reference/meson.build b/docs/reference/meson.build new file mode 100644 index 0000000000..2e28fba4a8 --- /dev/null +++ b/docs/reference/meson.build @@ -0,0 +1,22 @@ +if get_option('gtk_doc') + glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix') + glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html') + + cairo_prefix = dependency('cairo-gobject').get_pkgconfig_variable('prefix') + cairo_docpath = join_paths(cairo_prefix, 'share', 'gtk-doc', 'html', 'cairo') + + gdkpixbuf_prefix = dependency('gdk-pixbuf-2.0').get_pkgconfig_variable('prefix') + gdkpixbuf_docpath = join_paths(gdkpixbuf_prefix, 'share', 'gtk-doc', 'html', 'gdk-pixbuf') + + docpath = join_paths(gtk_datadir, 'gtk-doc', 'html') + + version_conf = configuration_data() + version_conf.set('GTK_VERSION', meson.project_version()) + + src_dir_conf = configuration_data() + src_dir_conf.set('abs_top_srcdir', meson.source_root()) +endif + +subdir('gdk') +subdir('gtk') +subdir('libgail-util') diff --git a/docs/tools/Makefile.am b/docs/tools/Makefile.am index 6a6d70f496..bec43e3a55 100644 --- a/docs/tools/Makefile.am +++ b/docs/tools/Makefile.am @@ -20,6 +20,9 @@ LDADDS = \ $(GDK_DEP_LIBS) \ -lm +EXTRA_DIST += \ + meson.build + if USE_X11 noinst_PROGRAMS = \ doc-shooter diff --git a/docs/tools/meson.build b/docs/tools/meson.build new file mode 100644 index 0000000000..05621ee7ed --- /dev/null +++ b/docs/tools/meson.build @@ -0,0 +1,12 @@ +if x11_enabled + doc_shooter_sources = [ + 'shadow.c', + 'shooter.c', + 'widgets.c', + '../../tests/gtkgears.c', + ] + + doc_shooter = executable('doc-shooter', doc_shooter_sources, + include_directories: [ confinc, gdkinc, gtkinc, testinc, ], + dependencies: libgtk_dep) +endif diff --git a/examples/Makefile.am b/examples/Makefile.am index a455c03ac8..ed8f9a7ced 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -31,6 +31,8 @@ noinst_PROGRAMS = \ search-bar \ listbox-dnd -EXTRA_DIST = builder.ui +EXTRA_DIST = \ + builder.ui \ + meson.build -include $(top_srcdir)/git.mk diff --git a/examples/application1/Makefile.am b/examples/application1/Makefile.am index 114e204fa0..08bee3876d 100644 --- a/examples/application1/Makefile.am +++ b/examples/application1/Makefile.am @@ -17,4 +17,7 @@ exampleapp_SOURCES = \ exampleapp.c exampleapp.h \ exampleappwin.c exampleappwin.h +EXTRA_DIST = \ + meson.build + -include $(top_srcdir)/git.mk diff --git a/examples/application1/meson.build b/examples/application1/meson.build new file mode 100644 index 0000000000..ae5620f07e --- /dev/null +++ b/examples/application1/meson.build @@ -0,0 +1,11 @@ + + +app1 = executable( + 'exampleapp', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + dependencies: libgtk_dep +) diff --git a/examples/application10/Makefile.am b/examples/application10/Makefile.am index 5db103723e..c5bda45eba 100644 --- a/examples/application10/Makefile.am +++ b/examples/application10/Makefile.am @@ -41,7 +41,8 @@ EXTRA_DIST = \ prefs.ui \ gears-menu.ui \ exampleapp.gresource.xml \ - org.gtk.exampleapp.gschema.xml + org.gtk.exampleapp.gschema.xml \ + meson.build CLEANFILES = \ gschemas.compiled diff --git a/examples/application10/meson.build b/examples/application10/meson.build new file mode 100644 index 0000000000..ce842ae794 --- /dev/null +++ b/examples/application10/meson.build @@ -0,0 +1,23 @@ + +app10_resources = gnome.compile_resources( + 'exampleapp10 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app10_schemas = gnome.compile_schemas() + + +app10 = executable( + 'exampleapp10', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + 'exampleappprefs.c', + 'exampleappprefs.h', + app10_resources, + app10_schemas, + dependencies: libgtk_dep +) diff --git a/examples/application2/Makefile.am b/examples/application2/Makefile.am index 0ecba8a33f..8fc04789d8 100644 --- a/examples/application2/Makefile.am +++ b/examples/application2/Makefile.am @@ -26,6 +26,7 @@ resources.c: exampleapp.gresource.xml window.ui EXTRA_DIST = \ window.ui \ - exampleapp.gresource.xml + exampleapp.gresource.xml \ + meson.build -include $(top_srcdir)/git.mk diff --git a/examples/application2/meson.build b/examples/application2/meson.build new file mode 100644 index 0000000000..99deae6e12 --- /dev/null +++ b/examples/application2/meson.build @@ -0,0 +1,17 @@ + +app2_resources = gnome.compile_resources( + 'exampleapp2 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app2 = executable( + 'exampleapp2', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + app2_resources, + dependencies: libgtk_dep +) diff --git a/examples/application3/Makefile.am b/examples/application3/Makefile.am index 0ecba8a33f..8fc04789d8 100644 --- a/examples/application3/Makefile.am +++ b/examples/application3/Makefile.am @@ -26,6 +26,7 @@ resources.c: exampleapp.gresource.xml window.ui EXTRA_DIST = \ window.ui \ - exampleapp.gresource.xml + exampleapp.gresource.xml \ + meson.build -include $(top_srcdir)/git.mk diff --git a/examples/application3/meson.build b/examples/application3/meson.build new file mode 100644 index 0000000000..f0cec4c198 --- /dev/null +++ b/examples/application3/meson.build @@ -0,0 +1,17 @@ + +app3_resources = gnome.compile_resources( + 'exampleapp3 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app3 = executable( + 'exampleapp3', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + app3_resources, + dependencies: libgtk_dep +) diff --git a/examples/application4/Makefile.am b/examples/application4/Makefile.am index c14a3cbcf1..7bc91ba1df 100644 --- a/examples/application4/Makefile.am +++ b/examples/application4/Makefile.am @@ -27,6 +27,7 @@ resources.c: exampleapp.gresource.xml window.ui app-menu.ui EXTRA_DIST = \ window.ui \ app-menu.ui \ - exampleapp.gresource.xml + exampleapp.gresource.xml \ + meson.build -include $(top_srcdir)/git.mk diff --git a/examples/application4/meson.build b/examples/application4/meson.build new file mode 100644 index 0000000000..2ae18200b2 --- /dev/null +++ b/examples/application4/meson.build @@ -0,0 +1,17 @@ + +app4_resources = gnome.compile_resources( + 'exampleapp4 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app4 = executable( + 'exampleapp4', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + app4_resources, + dependencies: libgtk_dep +) diff --git a/examples/application5/Makefile.am b/examples/application5/Makefile.am index 2b199f97d9..b6f34e7043 100644 --- a/examples/application5/Makefile.am +++ b/examples/application5/Makefile.am @@ -38,7 +38,8 @@ EXTRA_DIST = \ window.ui \ app-menu.ui \ exampleapp.gresource.xml \ - org.gtk.exampleapp.gschema.xml + org.gtk.exampleapp.gschema.xml \ + meson.build CLEANFILES = \ gschemas.compiled diff --git a/examples/application5/meson.build b/examples/application5/meson.build new file mode 100644 index 0000000000..f0fed1ca59 --- /dev/null +++ b/examples/application5/meson.build @@ -0,0 +1,21 @@ + +app5_resources = gnome.compile_resources( + 'exampleapp5 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app5_schemas = gnome.compile_schemas() + + +app5 = executable( + 'exampleapp5', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + app5_resources, + app5_schemas, + dependencies: libgtk_dep +) diff --git a/examples/application6/Makefile.am b/examples/application6/Makefile.am index b8cff5b8fe..9cf885ed10 100644 --- a/examples/application6/Makefile.am +++ b/examples/application6/Makefile.am @@ -40,7 +40,8 @@ EXTRA_DIST = \ app-menu.ui \ prefs.ui \ exampleapp.gresource.xml \ - org.gtk.exampleapp.gschema.xml + org.gtk.exampleapp.gschema.xml \ + meson.build CLEANFILES = \ gschemas.compiled diff --git a/examples/application6/meson.build b/examples/application6/meson.build new file mode 100644 index 0000000000..2d923f35a3 --- /dev/null +++ b/examples/application6/meson.build @@ -0,0 +1,23 @@ + +app6_resources = gnome.compile_resources( + 'exampleapp6 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app6_schemas = gnome.compile_schemas() + + +app6 = executable( + 'exampleapp6', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + 'exampleappprefs.c', + 'exampleappprefs.h', + app6_resources, + app6_schemas, + dependencies: libgtk_dep +) diff --git a/examples/application7/Makefile.am b/examples/application7/Makefile.am index b8cff5b8fe..9cf885ed10 100644 --- a/examples/application7/Makefile.am +++ b/examples/application7/Makefile.am @@ -40,7 +40,8 @@ EXTRA_DIST = \ app-menu.ui \ prefs.ui \ exampleapp.gresource.xml \ - org.gtk.exampleapp.gschema.xml + org.gtk.exampleapp.gschema.xml \ + meson.build CLEANFILES = \ gschemas.compiled diff --git a/examples/application7/meson.build b/examples/application7/meson.build new file mode 100644 index 0000000000..cc32f36ad0 --- /dev/null +++ b/examples/application7/meson.build @@ -0,0 +1,23 @@ + +app7_resources = gnome.compile_resources( + 'exampleapp7 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app7_schemas = gnome.compile_schemas() + + +app7 = executable( + 'exampleapp7', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + 'exampleappprefs.c', + 'exampleappprefs.h', + app7_resources, + app7_schemas, + dependencies: libgtk_dep +) diff --git a/examples/application8/Makefile.am b/examples/application8/Makefile.am index 5db103723e..c5bda45eba 100644 --- a/examples/application8/Makefile.am +++ b/examples/application8/Makefile.am @@ -41,7 +41,8 @@ EXTRA_DIST = \ prefs.ui \ gears-menu.ui \ exampleapp.gresource.xml \ - org.gtk.exampleapp.gschema.xml + org.gtk.exampleapp.gschema.xml \ + meson.build CLEANFILES = \ gschemas.compiled diff --git a/examples/application8/meson.build b/examples/application8/meson.build new file mode 100644 index 0000000000..1192f4d688 --- /dev/null +++ b/examples/application8/meson.build @@ -0,0 +1,23 @@ + +app8_resources = gnome.compile_resources( + 'exampleapp8 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app8_schemas = gnome.compile_schemas() + + +app8 = executable( + 'exampleapp8', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + 'exampleappprefs.c', + 'exampleappprefs.h', + app8_resources, + app8_schemas, + dependencies: libgtk_dep +) diff --git a/examples/application9/Makefile.am b/examples/application9/Makefile.am index 5db103723e..c5bda45eba 100644 --- a/examples/application9/Makefile.am +++ b/examples/application9/Makefile.am @@ -41,7 +41,8 @@ EXTRA_DIST = \ prefs.ui \ gears-menu.ui \ exampleapp.gresource.xml \ - org.gtk.exampleapp.gschema.xml + org.gtk.exampleapp.gschema.xml \ + meson.build CLEANFILES = \ gschemas.compiled diff --git a/examples/application9/meson.build b/examples/application9/meson.build new file mode 100644 index 0000000000..fccee738cb --- /dev/null +++ b/examples/application9/meson.build @@ -0,0 +1,23 @@ + +app9_resources = gnome.compile_resources( + 'exampleapp9 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app9_schemas = gnome.compile_schemas() + + +app9 = executable( + 'exampleapp9', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + 'exampleappprefs.c', + 'exampleappprefs.h', + app9_resources, + app9_schemas, + dependencies: libgtk_dep +) diff --git a/examples/bp/Makefile.am b/examples/bp/Makefile.am index d521715eae..66b52b188a 100644 --- a/examples/bp/Makefile.am +++ b/examples/bp/Makefile.am @@ -27,6 +27,8 @@ bloatpad-gresources.c: $(resource_files) CLEANFILES = bloatpad-gresources.c -EXTRA_DIST = $(resource_files) +EXTRA_DIST = \ + $(resource_files) \ + meson.build -include $(top_srcdir)/git.mk diff --git a/examples/bp/bloatpad.c b/examples/bp/bloatpad.c index 13efdcb7eb..d89db89a73 100644 --- a/examples/bp/bloatpad.c +++ b/examples/bp/bloatpad.c @@ -537,6 +537,7 @@ bloat_pad_startup (GApplication *application) { "win.justify::center", { "m", NULL } }, { "win.justify::right", { "r", NULL } } }; + const gchar *new_accels[] = { "n", "t", NULL }; G_APPLICATION_CLASS (bloat_pad_parent_class) ->startup (application); @@ -604,7 +605,6 @@ bloat_pad_startup (GApplication *application) g_object_unref (item); g_object_unref (icon); - const gchar *new_accels[] = { "n", "t", NULL }; gtk_application_set_accels_for_action (GTK_APPLICATION (application), "app.new", new_accels); dump_accels (GTK_APPLICATION (application)); diff --git a/examples/bp/meson.build b/examples/bp/meson.build new file mode 100644 index 0000000000..a3f82802f5 --- /dev/null +++ b/examples/bp/meson.build @@ -0,0 +1,13 @@ + +bp_resources = gnome.compile_resources( + 'bloatpad resources', + 'bloatpad.gresources.xml', + source_dir: '.' +) + +bloatpad = executable( + 'bloatpad', + 'bloatpad.c', + bp_resources, + dependencies: libgtk_dep +) diff --git a/examples/meson.build b/examples/meson.build new file mode 100644 index 0000000000..79af2f8440 --- /dev/null +++ b/examples/meson.build @@ -0,0 +1,60 @@ +builder_example = executable( + 'builder_example', + 'builder.c', + dependencies: libgtk_dep +) + +drawing = executable( + 'drawing', + 'drawing.c', + dependencies: libgtk_dep +) + +grid_packing = executable( + 'grid-packing', + 'grid-packing.c', + dependencies: libgtk_dep +) + +hello_world = executable( + 'hello-world', + 'hello-world.c', + dependencies: libgtk_dep +) + +plugman = executable( + 'plugman', + 'plugman.c', + dependencies: libgtk_dep +) + +search_bar = executable( + 'search-bar', + 'search-bar.c', + dependencies: libgtk_dep +) + +sunny = executable( + 'sunny', + 'sunny.c', + dependencies: libgtk_dep +) + +window_default = executable( + 'window-default', + 'window-default.c', + dependencies: libgtk_dep +) + + +subdir('bp') +subdir('application1') +subdir('application2') +subdir('application3') +subdir('application4') +subdir('application5') +subdir('application6') +subdir('application7') +subdir('application8') +subdir('application9') +subdir('application10') diff --git a/gdk/Makefile.am b/gdk/Makefile.am index 689ee52057..74b9d0bbf4 100644 --- a/gdk/Makefile.am +++ b/gdk/Makefile.am @@ -31,7 +31,10 @@ EXTRA_DIST += \ makefile.msc \ gdkenumtypes.c.template \ gdkenumtypes.h.template \ - gdkversionmacros.h.in + gdkversionmacros.h.in \ + meson.build \ + gen-gdk-gresources-xml.py \ + gdkconfig.h.meson GDK_CFLAGS_DEFINES = \ -DG_LOG_USE_STRUCTURED=1 \ diff --git a/gdk/broadway/Makefile.am b/gdk/broadway/Makefile.am index e04013f46f..fd4b9d1414 100644 --- a/gdk/broadway/Makefile.am +++ b/gdk/broadway/Makefile.am @@ -108,6 +108,10 @@ EXTRA_DIST += $(broadway_built_sources) BUILT_SOURCES = $(broadway_built_sources) +EXTRA_DIST += \ + meson.build \ + gen-c-array.py + # ------------------- MSVC Build Items ---------------- MSVCPROJS = gdk3-broadway broadwayd diff --git a/gdk/broadway/gen-c-array.py b/gdk/broadway/gen-c-array.py new file mode 100644 index 0000000000..70c0dc9fca --- /dev/null +++ b/gdk/broadway/gen-c-array.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 + +import argparse +import sys + +parser = argparse.ArgumentParser() +parser.add_argument('--array-name', help='The name of the array variable') +parser.add_argument('--output', metavar='FILE', help='Output file', + type=argparse.FileType('w'), + default=sys.stdout) +parser.add_argument('input', metavar='FILE', help='The input file', + type=argparse.FileType('r'), nargs='+') + +args = parser.parse_args() + +args.output.write('static const char {}[] = {{\n'.format(args.array_name)) +for input in args.input: + for line in input: + for ch in line: + args.output.write(' 0x{:02x},\n'.format(ord(ch))) + +args.output.write('};') diff --git a/gdk/broadway/meson.build b/gdk/broadway/meson.build new file mode 100644 index 0000000000..6702280863 --- /dev/null +++ b/gdk/broadway/meson.build @@ -0,0 +1,78 @@ +gdk_broadway_sources = files( + 'gdkcursor-broadway.c', + 'gdkdevice-broadway.c', + 'gdkdevicemanager-broadway.c', + 'gdkdisplay-broadway.c', + 'gdkdnd-broadway.c', + 'gdkeventsource.c', + 'gdkglobals-broadway.c', + 'gdkkeys-broadway.c', + 'gdkmonitor-broadway.c', + 'gdkproperty-broadway.c', + 'gdkscreen-broadway.c', + 'gdkselection-broadway.c', + 'gdktestutils-broadway.c', + 'gdkvisual-broadway.c', + 'gdkwindow-broadway.c', + 'gdkbroadway-server.c', +) + +gdk_broadway_public_headers = files( + 'gdkbroadwaydisplay.h', + 'gdkbroadwaywindow.h', + 'gdkbroadwaycursor.h', + 'gdkbroadwaymonitor.h', + 'gdkbroadwayvisual.h', +) + +install_headers(gdk_broadway_public_headers, subdir: 'gtk-3.0/gdk/broadway/') +install_headers('gdkbroadway.h', subdir: 'gtk-3.0/gdk/') + +gdk_broadway_deps = [shmlib] + +gen_c_array = find_program('gen-c-array.py') + +clienthtml_h = custom_target('clienthtml.h', + input : 'client.html', + output : 'clienthtml.h', + command : [ + gen_c_array, + '--array-name=client_html', + '--output=@OUTPUT@', + '@INPUT@', + ], +) + +broadwayjs_h = custom_target('broadwayjs.h', + input : ['broadway.js', 'rawinflate.min.js'], + output : 'broadwayjs.h', + command : [ + gen_c_array, + '--array-name=broadway_js', + '--output=@OUTPUT@', + '@INPUT0@','@INPUT1@', + ], +) + +libgdk_broadway = static_library('gdk-broadway', + clienthtml_h, broadwayjs_h, + gdk_broadway_sources, gdkconfig, gdkenum_h, + include_directories: [confinc, gdkinc], + c_args: [ + '-DGDK_COMPILATION', + '-DG_LOG_DOMAIN="Gdk"', + ] + common_cflags, + link_args: common_ldflags, + dependencies: [gdk_deps, gdk_broadway_deps]) + +# gtk4-broadwayd + +broadwayd_syslib = os_win32 ? cc.find_library('ws2_32') : shmlib + +executable('broadwayd', + clienthtml_h, broadwayjs_h, + 'broadwayd.c', 'broadway-server.c', 'broadway-buffer.c', 'broadway-output.c', + include_directories: [confinc, gdkinc, include_directories('.')], + c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', ], + dependencies : [broadwayd_syslib, gdk_deps], + install : true) diff --git a/gdk/gdkconfig.h.meson b/gdk/gdkconfig.h.meson new file mode 100644 index 0000000000..14f9e8e1ae --- /dev/null +++ b/gdk/gdkconfig.h.meson @@ -0,0 +1,20 @@ +#ifndef __GDKCONFIG_H__ +#define __GDKCONFIG_H__ + +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#error "Only can be included directly." +#endif + +#include + +G_BEGIN_DECLS + + +#mesondefine GDK_WINDOWING_X11 +#mesondefine GDK_WINDOWING_BROADWAY +#mesondefine GDK_WINDOWING_WAYLAND +#mesondefine GDK_WINDOWING_WIN32 + +G_END_DECLS + +#endif /* __GDKCONFIG_H__ */ diff --git a/gdk/gdkenumtypes.h.template b/gdk/gdkenumtypes.h.template index 0bc4a71033..d6f62480bc 100644 --- a/gdk/gdkenumtypes.h.template +++ b/gdk/gdkenumtypes.h.template @@ -14,7 +14,7 @@ G_BEGIN_DECLS /*** BEGIN file-production ***/ -/* enumerations from "@filename@" */ +/* enumerations from "@basename@" */ /*** END file-production ***/ /*** BEGIN value-header ***/ diff --git a/gdk/gen-gdk-gresources-xml.py b/gdk/gen-gdk-gresources-xml.py new file mode 100644 index 0000000000..694a9159aa --- /dev/null +++ b/gdk/gen-gdk-gresources-xml.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +# +# Generate gdk.gresources.xml +# +# Usage: gen-gdk-gresources-xml SRCDIR_GDK [OUTPUT-FILE] + +import os, sys + +srcdir = sys.argv[1] + +xml = ''' + + + +''' + +def get_files(subdir,extension): + return sorted(filter(lambda x: x.endswith((extension)), os.listdir(os.path.join(srcdir,subdir)))) + +for f in get_files('resources/glsl', '.glsl'): + xml += ' resources/glsl/{0}\n'.format(f) + +xml += ''' + +''' + +if len(sys.argv) > 2: + outfile = sys.argv[2] + f = open(outfile, 'w') + f.write(xml) + f.close() +else: + print(xml) diff --git a/gdk/meson.build b/gdk/meson.build new file mode 100644 index 0000000000..9d7ded377a --- /dev/null +++ b/gdk/meson.build @@ -0,0 +1,376 @@ +deprecated_gdk_sources = files('deprecated/gdkcolor.c') +gdk_sources = files( + 'gdk-private.c', + 'gdk.c', + 'gdkapplaunchcontext.c', + 'gdkcairo.c', + 'gdkcursor.c', + 'gdkdeprecated.c', + 'gdkdevice.c', + 'gdkdevicemanager.c', + 'gdkdevicepad.c', + 'gdkdisplay.c', + 'gdkdisplaymanager.c', + 'gdkdnd.c', + 'gdkevents.c', + 'gdkframetimings.c', + 'gdkgl.c', + 'gdkglcontext.c', + 'gdkglobals.c', + 'gdkkeys.c', + 'gdkkeyuni.c', + 'gdkoffscreenwindow.c', + 'gdkframeclock.c', + 'gdkframeclockidle.c', + 'gdkpango.c', + 'gdkpixbuf-drawable.c', + 'gdkproperty.c', + 'gdkrectangle.c', + 'gdkrgba.c', + 'gdkscreen.c', + 'gdkselection.c', + 'gdkvisual.c', + 'gdkwindow.c', + 'gdkwindowimpl.c', + 'gdkseat.c', + 'gdkseatdefault.c', + 'gdkdevicetool.c', + 'gdkdrawingcontext.c', + 'gdkmonitor.c' +) + +gdk_gir_public_headers = files( + 'gdk.h', + 'gdk-autocleanup.h', + 'gdkapplaunchcontext.h', + 'gdkcairo.h', + 'gdkcursor.h', + 'gdkdevice.h', + 'gdkdevicetool.h', + 'gdkdevicemanager.h', + 'gdkdevicepad.h', + 'gdkdisplay.h', + 'gdkdisplaymanager.h', + 'gdkdnd.h', + 'gdkdrawingcontext.h', + 'gdkevents.h', + 'gdkframetimings.h', + 'gdkglcontext.h', + 'gdkkeys.h', + 'gdkkeysyms.h', + 'gdkmain.h', + 'gdkmonitor.h', + 'gdkpango.h', + 'gdkframeclock.h', + 'gdkpixbuf.h', + 'gdkprivate.h', + 'gdkproperty.h', + 'gdkrectangle.h', + 'gdkrgba.h', + 'gdkscreen.h', + 'gdkseat.h', + 'gdkselection.h', + 'gdktestutils.h', + 'gdkthreads.h', + 'gdktypes.h', + 'gdkvisual.h', + 'gdkwindow.h', +) +gdk_nogir_public_headers = [files('gdkkeysyms-compat.h')] +gdk_public_headers = gdk_gir_public_headers + gdk_nogir_public_headers +install_headers(gdk_public_headers, subdir : 'gtk-3.0/gdk') + +deprecated_h_sources = files('deprecated/gdkcolor.h') +install_headers(deprecated_h_sources, subdir : 'gtk-3.0/gdk/deprecated') + +# This variable is unused, but added just for completeness +gdk_private_headers = files( + 'gdkseatdefaultprivate.h', + 'gdkdevicetoolprivate.h', + 'gdkdrawingcontextprivate.h', + 'gdkmonitorprivate.h', + 'gdkprivate.h', +) + +gdk_wayland_sources = files( + 'wayland/gdkapplaunchcontext-wayland.c', + 'wayland/gdkcursor-wayland.c', + 'wayland/gdkdevice-wayland.c', + 'wayland/gdkdisplay-wayland.c', + 'wayland/gdkdnd-wayland.c', + 'wayland/gdkeventsource.c', + 'wayland/gdkglcontext-wayland.c', + 'wayland/gdkkeys-wayland.c', + 'wayland/gdkmonitor-wayland.c', + 'wayland/gdkscreen-wayland.c', + 'wayland/gdkselection-wayland.c', + 'wayland/gdkwindow-wayland.c', + 'wayland/wm-button-layout-translation.c', +) + +gdk_broadway_sources = files([ + 'broadway/gdkdisplay-broadway.c', + 'broadway/gdkscreen-broadway.c', + 'broadway/broadway-output.c', + 'broadway/broadway-server.c', + 'broadway/gdkbroadway-server.c', + 'broadway/gdkcursor-broadway.c', + 'broadway/gdkvisual-broadway.c', + 'broadway/gdkselection-broadway.c', + 'broadway/gdkwindow-broadway.c', + 'broadway/gdkmonitor-broadway.c', + 'broadway/gdkkeys-broadway.c', + 'broadway/gdkglobals-broadway.c', + 'broadway/gdkeventsource.c', + 'broadway/gdkdnd-broadway.c', + 'broadway/broadwayd.c', + 'broadway/gdkdevicemanager-broadway.c', + 'broadway/gdkdevice-broadway.c', + 'broadway/broadway-buffer.c', + 'broadway/gdktestutils-broadway.c', + 'broadway/gdkproperty-broadway.c' +]) + +gdk_gresource_xml = configure_file(output : 'gdk.gresource.xml', + input : 'gen-gdk-gresources-xml.py', + command : [find_program('gen-gdk-gresources-xml.py'), + meson.current_source_dir(), '@OUTPUT@']) + +gdkresources = gnome.compile_resources('gdkresources', + gdk_gresource_xml, + source_dir: '.', + c_name: '_gdk', + extra_args: '--manual-register' +) + +gdk_enums = gnome.mkenums('gdkenumtypes', + sources: gdk_public_headers, + c_template : 'gdkenumtypes.c.template', + h_template : 'gdkenumtypes.h.template', + install_dir: join_paths(gtk_includedir, 'gtk-3.0/gdk'), + install_header : true) + +gdkenum_h = gdk_enums[1] + +gdk_marshalers = gnome.genmarshal('gdkmarshalers', + sources : 'gdkmarshalers.list', + prefix : '_gdk_marshal', + valist_marshallers : true) + +gdkmarshal_h = gdk_marshalers[1] + +gdkconfig_cdata = configuration_data() +gdkconfig_cdata.set('GDK_WINDOWING_X11', x11_enabled) +gdkconfig_cdata.set('GDK_WINDOWING_WAYLAND', wayland_enabled) +gdkconfig_cdata.set('GDK_WINDOWING_WIN32', win32_enabled) +gdkconfig_cdata.set('GDK_WINDOWING_BROADWAY', broadway_enabled) + +gdkconfig = configure_file( + input : 'gdkconfig.h.meson', + output : 'gdkconfig.h', + configuration : gdkconfig_cdata, + install_dir: join_paths(gtk_includedir, 'gtk-3.0/gdk')) + + +gdkversion_cdata = configuration_data() +gdkversion_cdata.set('GTK_MAJOR_VERSION', gtk_major_version) +gdkversion_cdata.set('GTK_MINOR_VERSION', gtk_minor_version) +gdkversion_cdata.set('GTK_MICRO_VERSION', gtk_micro_version) +gdkversion_cdata.set('GTK_API_VERSION', gtk_api_version) +gdkversion_cdata.set('GTK_BINARY_VERSION', gtk_binary_version) +gdkversion_cdata.set('GTK_VERSION', meson.project_version()) +gdkversion_cdata.set('LT_CURRENT_MINUS_AGE', gtk_soversion) + +gdkversionmacros = configure_file( + input : 'gdkversionmacros.h.in', + output : 'gdkversionmacros.h', + configuration: gdkversion_cdata, + install_dir: join_paths(gtk_includedir, 'gtk-3.0/gdk')) + +gdkinc = include_directories('.') +gdkx11_inc = include_directories('x11') +gdkwayland_inc = include_directories('wayland') + +wlinc = include_directories('.') + +gdk_gen_headers = [gdkenum_h, gdkmarshal_h, gdkconfig, gdkversionmacros] + +gdk_deps = [ + libm, + pixbuf_dep, + cairo_dep, + pango_dep, + fribidi_dep, + cairogobj_dep, + glib_dep, + epoxy_dep, + fontconfig_dep, + platform_gio_dep, + pangocairo_dep +] + +if win32_enabled + gdk_deps += [cc.find_library('advapi32'), + cc.find_library('comctl32'), + cc.find_library('dwmapi'), + cc.find_library('imm32'), + cc.find_library('setupapi'), + cc.find_library('winmm')] + + gdk_rc = configure_file( + input: 'win32/rc/gdk.rc.in', + output: 'gdk.rc', + configuration: gdkversion_cdata, + ) + gdk_res = import('windows').compile_resources(gdk_rc, include_directories: include_directories('win32/rc')) + gdk_sources += gdk_res +endif + +gdk_sources = [ + # Generated + gdkconfig, + gdk_enums, + gdk_marshalers, + gdkresources, + gdkversionmacros, + # Static + gdk_sources, + deprecated_gdk_sources, +] + +if wayland_enabled or broadway_enabled + if cc.has_function('shm_open') + shmlib = [] + elif cc.has_function('shm_open', args : '-lrt') + shmlib = cc.find_library('rt') + else + shmlib = [] + endif +endif + +gdk_backends = [] +gdk_backends_gen_headers = [] # non-public generated headers +foreach backend : ['broadway', 'quartz', 'wayland', 'win32', 'x11'] + if get_variable('@0@_enabled'.format(backend)) + subdir(backend) + gdk_deps += get_variable('gdk_@0@_deps'.format(backend)) + gdk_backends += get_variable('libgdk_@0@'.format(backend)) + # Special-case this for now to work around Meson bug with get_variable() + # fallback being an empty array, or any array (#1481) + if backend == 'wayland' + gdk_backends_gen_headers += get_variable('gdk_@0@_gen_headers'.format(backend)) + endif + if backend == 'quartz' + common_cflags += ['-DGDK_WINDOWING_QUARTZ', '-xobjective-c'] + endif + endif +endforeach + +if gdk_backends.length() == 0 + error('No backends enabled') +endif + +gdk_link_args = common_ldflags + +# Somehow gdk_win32_display_manager_get_type is not being exported as it +# seems that it was optimized out by the MSVC linker. Force-export it here. +if cc.get_id() == 'msvc' + gdk_link_args += [ '-export:gdk_win32_display_manager_get_type' ] +endif + +libgdk = shared_library('gdk-3', + soversion: gtk_soversion, + sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig], + dependencies: gdk_deps, + include_directories: [confinc, gdkx11_inc, wlinc], + c_args: [ + '-DGDK_COMPILATION', + '-DG_LOG_DOMAIN="Gdk"', + ] + common_cflags, + link_whole: gdk_backends, + link_args: gdk_link_args, + darwin_versions : gtk_osxversions, + install: true) + +gdk_dep_sources = [gdkconfig, gdkenum_h] +# Introspection +if build_gir + gir_args = ['--quiet'] + + # We may build some of the dependencies as sub-projects; this means + # that we need to depend on the built introspection data, instead of + # the installed one + gdk_gir_inc = [ 'cairo-1.0', 'Gio-2.0', ] + + if pixbuf_dep.type_name() == 'internal' + gdk_gir_inc += subproject('gdk-pixbuf').get_variable('gdkpixbuf_gir').get(0) + else + gdk_gir_inc += 'GdkPixbuf-2.0' + endif + + if pango_dep.type_name() == 'internal' + gdk_gir_inc += subproject('pango').get_variable('pango_gir').get(0) + else + gdk_gir_inc += 'Pango-1.0' + endif + + gdk_gir_sources = gdk_gir_public_headers + deprecated_h_sources + gdk_gir_sources += gdk_sources + gdk_enums + [gdkconfig] + gdk_gir = gnome.generate_gir(libgdk, + sources: gdk_gir_sources, + namespace: 'Gdk', + nsversion: gtk_api_version, + identifier_prefix: 'Gdk', + symbol_prefix: 'gdk', + export_packages: 'gdk-3.0', + includes: gdk_gir_inc, + header: 'gdk/gdk.h', + install: true, + extra_args: gir_args + [ + '-DGDK_COMPILATION', + ]) + gdk_gir_dep = declare_dependency(sources: gdk_gir) + gdk_dep_sources += gdk_gir + + if x11_enabled + gdk_x11_gir = gnome.generate_gir(libgdk, + sources: gdk_x11_public_headers + gdk_x11_sources, + namespace: 'GdkX11', + nsversion: gtk_api_version, + identifier_prefix: 'Gdk', + symbol_prefix: 'gdk', + export_packages: 'gdk-x11-3.0', + includes: gdk_gir_inc + [ gdk_gir[0], 'xlib-2.0', ], + install: true, + dependencies: gdk_gir_dep, + header: 'gdk/gdkx.h', + extra_args: gir_args + [ + '-DGDK_COMPILATION', + ]) + gdk_dep_sources += gdk_x11_gir + endif + + if win32_enabled + gdk_win32_gir = gnome.generate_gir(libgdk, + sources: gdk_win32_public_headers + gdk_win32_sources, + namespace: 'GdkWin32', + nsversion: gtk_api_version, + identifier_prefix: 'Gdk', + symbol_prefix: 'gdk', + export_packages: 'gdk-win32-3.0', + includes: gdk_gir_inc + [gdk_gir[0]], + install: true, + dependencies: gdk_gir_dep, + header: 'gdk/gdkwin32.h', + extra_args: gir_args + [ + '-DGDK_COMPILATION', + ]) + gdk_dep_sources += gdk_win32_gir + endif +endif + +libgdk_dep = declare_dependency( + link_with: libgdk, + sources: gdk_dep_sources, + include_directories: [confinc, gdkx11_inc, wlinc], + dependencies: gdk_deps) diff --git a/gdk/quartz/Makefile.am b/gdk/quartz/Makefile.am index 9646f8687c..a7b12ad562 100644 --- a/gdk/quartz/Makefile.am +++ b/gdk/quartz/Makefile.am @@ -72,5 +72,7 @@ libgdkquartzinclude_HEADERS = \ gdkquartzvisual.h \ gdkquartzwindow.h +EXTRA_DIST += \ + meson.build -include $(top_srcdir)/git.mk diff --git a/gdk/quartz/meson.build b/gdk/quartz/meson.build new file mode 100644 index 0000000000..1f137d18f8 --- /dev/null +++ b/gdk/quartz/meson.build @@ -0,0 +1,57 @@ + +add_languages(['objc']) + +gdk_quartz_sources = files( + 'GdkQuartzView.c', + 'GdkQuartzNSWindow.c', + 'gdkcursor-quartz.c', + 'gdkdevice-core-quartz.c', + 'gdkdevicemanager-core-quartz.c', + 'gdkdisplay-quartz.c', + 'gdkdisplaymanager-quartz.c', + 'gdkdnd-quartz.c', + 'gdkevents-quartz.c', + 'gdkeventloop-quartz.c', + 'gdkglcontext-quartz.c', + 'gdkglobals-quartz.c', + 'gdkkeys-quartz.c', + 'gdkmonitor-quartz.c', + 'gdkproperty-quartz.c', + 'gdkscreen-quartz.c', + 'gdkselection-quartz.c', + 'gdktestutils-quartz.c', + 'gdkutils-quartz.c', + 'gdkvisual-quartz.c', + 'gdkwindow-quartz.c', +) + +gdk_quartz_public_headers = files( + 'gdkquartzcursor.h', + 'gdkquartzdevice-core.h', + 'gdkquartzdevicemanager-core.h', + 'gdkquartzdisplay.h', + 'gdkquartzdisplaymanager.h', + 'gdkquartzdnd.h', + 'gdkquartzkeys.h', + 'gdkquartzmonitor.h', + 'gdkquartzscreen.h', + 'gdkquartzutils.h', + 'gdkquartzvisual.h', + 'gdkquartzwindow.h', +) + +install_headers(gdk_quartz_public_headers, subdir: 'gtk-3.0/gdk/quartz') +install_headers('gdkquartz.h', subdir: 'gtk-3.0/gdk') + +core_graphics_dep = dependency('appleframeworks', modules : 'CoreGraphics', required : true) +appkit_dep = dependency('appleframeworks', modules : 'AppKit', required : true) +cocoa_dep = dependency('appleframeworks', modules : 'Cocoa', required : true) +carbon_dep = dependency('appleframeworks', modules : 'Carbon', required : true) + +gdk_quartz_deps = [ core_graphics_dep, appkit_dep, cocoa_dep, carbon_dep ] + +libgdk_quartz = static_library('gdk-quartz', + gdk_quartz_sources, gdkconfig, gdkenum_h, + include_directories: [confinc, gdkinc], + c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', '-xobjective-c'], + dependencies: [gdk_deps, gdk_quartz_deps]) diff --git a/gdk/wayland/Makefile.am b/gdk/wayland/Makefile.am index e3fb57f53d..956e5c92f5 100644 --- a/gdk/wayland/Makefile.am +++ b/gdk/wayland/Makefile.am @@ -107,6 +107,7 @@ endef EXTRA_DIST += \ protocol/gtk-primary-selection.xml \ protocol/gtk-shell.xml \ - protocol/server-decoration.xml + protocol/server-decoration.xml \ + meson.build -include $(top_srcdir)/git.mk diff --git a/gdk/wayland/meson.build b/gdk/wayland/meson.build new file mode 100644 index 0000000000..559e02ba3d --- /dev/null +++ b/gdk/wayland/meson.build @@ -0,0 +1,105 @@ +gdk_wayland_sources = files( + 'gdkapplaunchcontext-wayland.c', + 'gdkcursor-wayland.c', + 'gdkdevice-wayland.c', + 'gdkdisplay-wayland.c', + 'gdkdnd-wayland.c', + 'gdkeventsource.c', + 'gdkkeys-wayland.c', + 'gdkglcontext-wayland.c', + 'gdkmonitor-wayland.c', + 'gdkscreen-wayland.c', + 'gdkselection-wayland.c', + 'gdkwindow-wayland.c', + 'wm-button-layout-translation.c', +) + +gdk_wayland_public_headers = files( + 'gdkwaylanddevice.h', + 'gdkwaylanddisplay.h', + 'gdkwaylandglcontext.h', + 'gdkwaylandmonitor.h', + 'gdkwaylandselection.h', + 'gdkwaylandwindow.h', +) + +install_headers(gdk_wayland_public_headers, subdir: 'gtk-3.0/gdk/wayland') +install_headers('gdkwayland.h', subdir: 'gtk-3.0/gdk') + +gdk_wayland_deps = [ + shmlib, + xkbdep, + wlclientdep, + wlprotocolsdep, + wlcursordep, + wlegldep, +] + +# wayland protocols +proto_dir = dependency('wayland-protocols').get_pkgconfig_variable('pkgdatadir') +assert(proto_dir != '', 'Could not get pkgdatadir from wayland-protocols.pc') + +wayland_scanner = find_program('wayland-scanner') + +# Format: +# - protocol name +# - protocol stability ('private', 'stable' or 'unstable') +# - protocol version (if stability is 'unstable') +proto_sources = [ + ['gtk-shell', 'private', ], + ['gtk-primary-selection', 'private', ], + ['pointer-gestures', 'unstable', 'v1', ], + ['xdg-shell', 'unstable', 'v6', ], + ['xdg-shell', 'stable', ], + ['xdg-foreign', 'unstable', 'v1', ], + ['tablet', 'unstable', 'v2', ], + ['keyboard-shortcuts-inhibit', 'unstable', 'v1', ], + ['server-decoration', 'private' ], +] + +gdk_wayland_gen_headers = [] + +foreach p: proto_sources + proto_name = p.get(0) + proto_stability = p.get(1) + + if proto_stability == 'stable' + output_base = proto_name + input = join_paths(proto_dir, '@0@/@1@/@2@.xml'.format(proto_stability, proto_name, output_base)) + elif proto_stability == 'private' + output_base = proto_name + input = 'protocol/@0@.xml'.format(proto_name) + else + proto_version = p.get(2) + output_base = '@0@-@1@-@2@'.format(proto_name, proto_stability, proto_version) + input = join_paths(proto_dir, '@0@/@1@/@2@.xml'.format(proto_stability, proto_name, output_base)) + endif + + gdk_wayland_gen_headers += custom_target('@0@ client header'.format(output_base), + input: input, + output: '@0@-client-protocol.h'.format(output_base), + command: [ + wayland_scanner, + 'client-header', + '@INPUT@', '@OUTPUT@', + ]) + + gdk_wayland_sources += custom_target('@0@ source'.format(output_base), + input: input, + output: '@0@-protocol.c'.format(output_base), + command: [ + wayland_scanner, + 'private-code', + '@INPUT@', '@OUTPUT@', + ]) +endforeach + +libgdk_wayland = static_library('gdk-wayland', + gdk_wayland_sources, gdk_wayland_gen_headers, gdkconfig, gdkenum_h, + include_directories: [ confinc, gdkinc, ], + c_args: [ + '-DGDK_COMPILATION', + '-DG_LOG_DOMAIN="Gdk"', + ] + common_cflags, + link_args: common_ldflags, + dependencies: [ gdk_deps, gdk_wayland_deps, ]) diff --git a/gdk/win32/Makefile.am b/gdk/win32/Makefile.am index e77ec652f2..2d7e259e4d 100644 --- a/gdk/win32/Makefile.am +++ b/gdk/win32/Makefile.am @@ -29,7 +29,8 @@ SUBDIRS=rc EXTRA_DIST += \ bdfcursor.c \ - makefile.msc + makefile.msc \ + meson.build libgdk_win32_la_SOURCES = \ gdkcursor-win32.c \ diff --git a/gdk/win32/meson.build b/gdk/win32/meson.build new file mode 100644 index 0000000000..f28bd92b99 --- /dev/null +++ b/gdk/win32/meson.build @@ -0,0 +1,57 @@ +gdk_win32_sources = files( + 'gdkcursor-win32.c', + 'gdkdevicemanager-win32.c', + 'gdkdevice-virtual.c', + 'gdkdevice-win32.c', + 'gdkdevice-wintab.c', + 'gdkdisplay-win32.c', + 'gdkdisplaymanager-win32.c', + 'gdkdnd-win32.c', + 'gdkevents-win32.c', + 'gdkgeometry-win32.c', + 'gdkglcontext-win32.c', + 'gdkglobals-win32.c', + 'gdkkeys-win32.c', + 'gdkmain-win32.c', + 'gdkmonitor-win32.c', + 'gdkproperty-win32.c', + 'gdkscreen-win32.c', + 'gdkselection-win32.c', + 'gdktestutils-win32.c', + 'gdkwin32id.c', + 'gdkwin32langnotification.c', + 'gdkwindow-win32.c', +) + +gdk_win32_public_headers = files( + 'gdkwin32cursor.h', + 'gdkwin32display.h', + 'gdkwin32displaymanager.h', + 'gdkwin32dnd.h', + 'gdkwin32glcontext.h', + 'gdkwin32keys.h', + 'gdkwin32misc.h', + 'gdkwin32monitor.h', + 'gdkwin32screen.h', + 'gdkwin32window.h', +) + +GDK_WIN32_CFLAGS = ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', '-DINSIDE_GDK_WIN32'] + +if win32_has_egl + GDK_WIN32_CFLAGS += '-DGDK_WIN32_ENABLE_EGL' +endif + + +install_headers(gdk_win32_public_headers, subdir: 'gtk-3.0/gdk/win32') +install_headers('gdkwin32.h', subdir: 'gtk-3.0/gdk') + +gdk_win32_deps = [ # FIXME + pangowin32_dep +] + +libgdk_win32 = static_library('gdk-win32', + gdk_win32_sources, gdkconfig, gdkenum_h, + include_directories: [confinc, gdkinc], + c_args: GDK_WIN32_CFLAGS, + dependencies: [gdk_deps, gdk_win32_deps]) diff --git a/gdk/win32/rc/gdk.rc.in b/gdk/win32/rc/gdk.rc.in index 07ab1b4553..f9b57f5197 100644 --- a/gdk/win32/rc/gdk.rc.in +++ b/gdk/win32/rc/gdk.rc.in @@ -19,7 +19,7 @@ VS_VERSION_INFO VERSIONINFO VALUE "FileDescription", "GIMP Drawing Kit" VALUE "FileVersion", "@GTK_VERSION@.0" VALUE "InternalName", "libgdk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@" - VALUE "LegalCopyright", "Copyright © 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald. Modified by the GTK+ Team and others 1997-2011." + VALUE "LegalCopyright", "Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald. Modified by the GTK+ Team and others 1997-2011." VALUE "OriginalFilename", "libgdk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll" VALUE "ProductName", "GTK+" VALUE "ProductVersion", "@GTK_VERSION@" diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am index 6289f3ac79..32b1f24434 100644 --- a/gdk/x11/Makefile.am +++ b/gdk/x11/Makefile.am @@ -90,6 +90,7 @@ libgdkx11include_HEADERS = \ # We need to include all these C files here since the conditionals # don't seem to be correctly expanded for the dist files. EXTRA_DIST += \ - gdksettings.c + gdksettings.c \ + meson.build -include $(top_srcdir)/git.mk diff --git a/gdk/x11/meson.build b/gdk/x11/meson.build new file mode 100644 index 0000000000..754ae0a615 --- /dev/null +++ b/gdk/x11/meson.build @@ -0,0 +1,80 @@ +# Note: gdksettings.c gets included from xsettings-client.c, do not add here +gdk_x11_sources = files( + 'gdkapplaunchcontext-x11.c', + 'gdkasync.c', + 'gdkcursor-x11.c', + 'gdkdevice-core-x11.c', + 'gdkdevice-xi2.c', + 'gdkdevicemanager-core-x11.c', + 'gdkdevicemanager-x11.c', + 'gdkdevicemanager-xi2.c', + 'gdkdisplaymanager-x11.c', + 'gdkdisplay-x11.c', + 'gdkdnd-x11.c', + 'gdkeventsource.c', + 'gdkeventtranslator.c', + 'gdkgeometry-x11.c', + 'gdkglcontext-x11.c', + 'gdkkeys-x11.c', + 'gdkmain-x11.c', + 'gdkproperty-x11.c', + 'gdkscreen-x11.c', + 'gdkselection-x11.c', + 'gdktestutils-x11.c', + 'gdkvisual-x11.c', + 'gdkwindow-x11.c', + 'gdkxftdefaults.c', + 'gdkxid.c', + 'xsettings-client.c', + 'gdkmonitor-x11.c', +) + +gdk_x11_public_headers = files( + 'gdkx-autocleanups.h', + 'gdkx11applaunchcontext.h', + 'gdkx11cursor.h', + 'gdkx11device.h', + 'gdkx11device-core.h', + 'gdkx11device-xi2.h', + 'gdkx11devicemanager.h', + 'gdkx11devicemanager-core.h', + 'gdkx11devicemanager-xi2.h', + 'gdkx11display.h', + 'gdkx11displaymanager.h', + 'gdkx11dnd.h', + 'gdkx11glcontext.h', + 'gdkx11keys.h', + 'gdkx11monitor.h', + 'gdkx11property.h', + 'gdkx11screen.h', + 'gdkx11selection.h', + 'gdkx11utils.h', + 'gdkx11visual.h', + 'gdkx11window.h', +) + +install_headers(gdk_x11_public_headers, subdir: 'gtk-3.0/gdk/x11/') +install_headers('gdkx.h', subdir: 'gtk-3.0/gdk/') + +gdk_x11_deps = [ + xrender_dep, + xi_dep, + xext_dep, + x11_dep, + xcursor_dep, + xdamage_dep, + xfixes_dep, + xcomposite_dep, + xrandr_dep, + xinerama_dep, +] + +libgdk_x11 = static_library('gdk-x11', gdkmarshal_h, + gdk_x11_sources, gdkconfig, gdkenum_h, + include_directories: [ confinc, gdkinc, ], + c_args: [ + '-DGDK_COMPILATION', + '-DG_LOG_DOMAIN="Gdk"', + ] + common_cflags, + link_args: common_ldflags, + dependencies: [ gdk_deps, gdk_x11_deps, ]) diff --git a/gtk/Makefile.am b/gtk/Makefile.am index ea2dd5863c..eaca4737dc 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -1177,7 +1177,7 @@ MAINTAINERCLEANFILES = \ $(print_portal_built_sources) \ $(stamp_files) -DISTCLEANFILES = gtktypefuncs.c +DISTCLEANFILES = gtktypefuncs.inc if OS_WIN32 DISTCLEANFILES += gtk-win32.rc @@ -1442,7 +1442,7 @@ gtkprivatetypebuiltins.c: $(gtk_private_type_h_sources) gtkprivatetypebuiltins. && rm -f xgen-gptbc -gtktypefuncs.c: stamp-gtktypebuiltins.h stamp-gtkprivatetypebuiltins.h $(top_srcdir)/gtk/*.h $(top_srcdir)/gtk/a11y/*.h $(top_srcdir)/gtk/deprecated/*.h $(top_srcdir)/gdk/*.h Makefile +gtktypefuncs.inc: stamp-gtktypebuiltins.h stamp-gtkprivatetypebuiltins.h $(top_srcdir)/gtk/*.h $(top_srcdir)/gtk/a11y/*.h $(top_srcdir)/gtk/deprecated/*.h $(top_srcdir)/gdk/*.h Makefile $(AM_V_GEN) export LC_ALL=C ; \ (echo '#undef GTK_COMPILATION' && echo '#include ') > xgen-gtfsrc.c && \ echo 'G_GNUC_BEGIN_IGNORE_DEPRECATIONS' > xgen-gtf && \ @@ -1451,7 +1451,7 @@ gtktypefuncs.c: stamp-gtktypebuiltins.h stamp-gtkprivatetypebuiltins.h $(top_src sort | uniq | \ $(SED) '{ s/^/*tp++ = /; s/$$/();/; s/^.*\(gdk_x11\|gtk_plug_\|gtk_socket_\).*$$/#ifdef GDK_WINDOWING_X11\n&\n#endif/; }' >> xgen-gtf \ && cp xgen-gtf $@ && rm -f xgen-gtf -$(srcdir)/gtktestutils.c: gtktypefuncs.c +$(srcdir)/gtktestutils.c: gtktypefuncs.inc # target platform: lib_LTLIBRARIES = libgtk-3.la @@ -1776,6 +1776,16 @@ EXTRA_DIST += \ gtktypebuiltins.c.template \ gtktypebuiltins.h.template \ gtkprivatetypebuiltins.c.template \ - gtkprivatetypebuiltins.h.template + gtkprivatetypebuiltins.h.template \ + meson.build \ + gen-gtk-gresources-xml.py \ + gen-rc.py \ + gentypefuncs.py \ + a11y/meson.build \ + deprecated/meson.build \ + inspector/meson.build \ + theme/Adwaita/meson.build \ + theme/HighContrast/meson.build + -include $(top_srcdir)/git.mk diff --git a/gtk/a11y/meson.build b/gtk/a11y/meson.build new file mode 100644 index 0000000000..d0359158d0 --- /dev/null +++ b/gtk/a11y/meson.build @@ -0,0 +1,114 @@ +a11y_sources = files( + 'gtkaccessibility.c', + 'gtkaccessibilitymisc.c', + 'gtkaccessibilityutil.c', + 'gtkarrowaccessible.c', + 'gtkbooleancellaccessible.c', + 'gtkbuttonaccessible.c', + 'gtkcellaccessible.c', + 'gtkcellaccessibleparent.c', + 'gtkcheckmenuitemaccessible.c', + 'gtkcolorswatchaccessible.c', + 'gtkcomboboxaccessible.c', + 'gtkcontaineraccessible.c', + 'gtkcontainercellaccessible.c', + 'gtkentryaccessible.c', + 'gtkexpanderaccessible.c', + 'gtkflowboxaccessible.c', + 'gtkflowboxchildaccessible.c', + 'gtkframeaccessible.c', + 'gtkiconviewaccessible.c', + 'gtkimageaccessible.c', + 'gtkimagecellaccessible.c', + 'gtklabelaccessible.c', + 'gtklevelbaraccessible.c', + 'gtklinkbuttonaccessible.c', + 'gtklistboxaccessible.c', + 'gtklistboxrowaccessible.c', + 'gtklockbuttonaccessible.c', + 'gtkmenuaccessible.c', + 'gtkmenubuttonaccessible.c', + 'gtkmenushellaccessible.c', + 'gtkmenuitemaccessible.c', + 'gtknotebookaccessible.c', + 'gtknotebookpageaccessible.c', + 'gtkpanedaccessible.c', + 'gtkpopoveraccessible.c', + 'gtkprogressbaraccessible.c', + 'gtkradiobuttonaccessible.c', + 'gtkradiomenuitemaccessible.c', + 'gtkrangeaccessible.c', + 'gtkrenderercellaccessible.c', + 'gtkscaleaccessible.c', + 'gtkscalebuttonaccessible.c', + 'gtkscrolledwindowaccessible.c', + 'gtkspinbuttonaccessible.c', + 'gtkspinneraccessible.c', + 'gtkstatusbaraccessible.c', + 'gtkstackaccessible.c', + 'gtkswitchaccessible.c', + 'gtktextcellaccessible.c', + 'gtktextviewaccessible.c', + 'gtktogglebuttonaccessible.c', + 'gtktoplevelaccessible.c', + 'gtktreeviewaccessible.c', + 'gtkwidgetaccessible.c', + 'gtkwindowaccessible.c', +) + +a11y_headers = files( + 'gtk-a11y-autocleanups.h', + 'gtkarrowaccessible.h', + 'gtkbooleancellaccessible.h', + 'gtkbuttonaccessible.h', + 'gtkcellaccessible.h', + 'gtkcellaccessibleparent.h', + 'gtkcheckmenuitemaccessible.h', + 'gtkcomboboxaccessible.h', + 'gtkcontaineraccessible.h', + 'gtkcontainercellaccessible.h', + 'gtkentryaccessible.h', + 'gtkexpanderaccessible.h', + 'gtkflowboxaccessible.h', + 'gtkflowboxchildaccessible.h', + 'gtkframeaccessible.h', + 'gtkiconviewaccessible.h', + 'gtkimageaccessible.h', + 'gtkimagecellaccessible.h', + 'gtklabelaccessible.h', + 'gtklevelbaraccessible.h', + 'gtklinkbuttonaccessible.h', + 'gtklistboxaccessible.h', + 'gtklistboxrowaccessible.h', + 'gtklockbuttonaccessible.h', + 'gtkmenuaccessible.h', + 'gtkmenubuttonaccessible.h', + 'gtkmenuitemaccessible.h', + 'gtkmenushellaccessible.h', + 'gtknotebookaccessible.h', + 'gtknotebookpageaccessible.h', + 'gtkpanedaccessible.h', + 'gtkpopoveraccessible.h', + 'gtkprogressbaraccessible.h', + 'gtkradiobuttonaccessible.h', + 'gtkradiomenuitemaccessible.h', + 'gtkrangeaccessible.h', + 'gtkrenderercellaccessible.h', + 'gtkscaleaccessible.h', + 'gtkscalebuttonaccessible.h', + 'gtkscrolledwindowaccessible.h', + 'gtkspinbuttonaccessible.h', + 'gtkspinneraccessible.h', + 'gtkstatusbaraccessible.h', + 'gtkstackaccessible.h', + 'gtkswitchaccessible.h', + 'gtktextcellaccessible.h', + 'gtktextviewaccessible.h', + 'gtktogglebuttonaccessible.h', + 'gtktoplevelaccessible.h', + 'gtktreeviewaccessible.h', + 'gtkwidgetaccessible.h', + 'gtkwindowaccessible.h', +) + +install_headers(a11y_headers, subdir : 'gtk-3.0/gtk/a11y') diff --git a/gtk/deprecated/meson.build b/gtk/deprecated/meson.build new file mode 100644 index 0000000000..9dfd5f0255 --- /dev/null +++ b/gtk/deprecated/meson.build @@ -0,0 +1,87 @@ +gtk_deprecated_sources = files( + 'gtkactivatable.c', + 'gtkaction.c', + 'gtkactiongroup.c', + 'gtkalignment.c', + 'gtkarrow.c', + 'gtkcolorsel.c', + 'gtkcolorseldialog.c', + 'gtkfontsel.c', + 'gtkgradient.c', + 'gtkhandlebox.c', + 'gtkhbbox.c', + 'gtkhbox.c', + 'gtkhpaned.c', + 'gtkhscale.c', + 'gtkhscrollbar.c', + 'gtkhseparator.c', + 'gtkhsv.c', + 'gtkiconfactory.c', + 'gtkimagemenuitem.c', + 'gtkmisc.c', + 'gtknumerableicon.c', + 'gtkradioaction.c', + 'gtkrc.c', + 'gtkrecentaction.c', + 'gtkstatusicon.c', + 'gtkstock.c', + 'gtkstyle.c', + 'gtkstyleproperties.c', + 'gtksymboliccolor.c', + 'gtktable.c', + 'gtktearoffmenuitem.c', + 'gtkthemingengine.c', + 'gtktoggleaction.c', + 'gtkuimanager.c', + 'gtkvbbox.c', + 'gtkvbox.c', + 'gtkvscale.c', + 'gtkvscrollbar.c', + 'gtkvseparator.c', + 'gtkvpaned.c', +) + +gtk_deprecated_headers = files( + 'gtkactivatable.h', + 'gtkaction.h', + 'gtkactiongroup.h', + 'gtkalignment.h', + 'gtkarrow.h', + 'gtkcolorsel.h', + 'gtkcolorseldialog.h', + 'gtkfontsel.h', + 'gtkgradient.h', + 'gtkhandlebox.h', + 'gtkhbbox.h', + 'gtkhbox.h', + 'gtkhpaned.h', + 'gtkhscale.h', + 'gtkhscrollbar.h', + 'gtkhseparator.h', + 'gtkhsv.h', + 'gtkiconfactory.h', + 'gtkimagemenuitem.h', + 'gtkmisc.h', + 'gtknumerableicon.h', + 'gtkradioaction.h', + 'gtkrc.h', + 'gtkrecentaction.h', + 'gtkstatusicon.h', + 'gtkstock.h', + 'gtkstyle.h', + 'gtkstyleproperties.h', + 'gtksymboliccolor.h', + 'gtktable.h', + 'gtktearoffmenuitem.h', + 'gtkthemingengine.h', + 'gtktoggleaction.h', + 'gtkuimanager.h', + 'gtkvbbox.h', + 'gtkvbox.h', + 'gtkvscale.h', + 'gtkvscrollbar.h', + 'gtkvseparator.h', + 'gtkvpaned.h', +) + +install_headers(gtk_deprecated_headers, subdir: 'gtk-3.0/gtk/deprecated/') diff --git a/gtk/gen-gtk-gresources-xml.py b/gtk/gen-gtk-gresources-xml.py new file mode 100644 index 0000000000..720d588a4e --- /dev/null +++ b/gtk/gen-gtk-gresources-xml.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python3 +# +# Generate gtk.gresources.xml +# +# Usage: gen-gtk-gresources-xml SRCDIR_GTK [OUTPUT-FILE] + +import os, sys + +srcdir = sys.argv[1] + +xml = ''' + + +''' + +def get_files(subdir,extension): + return sorted(filter(lambda x: x.endswith((extension)), os.listdir(os.path.join(srcdir,subdir)))) + +xml += ''' + theme/Adwaita/gtk.css + theme/Adwaita/gtk-dark.css + theme/Adwaita/gtk-contained.css + theme/Adwaita/gtk-contained-dark.css +''' + +for f in get_files('theme/Adwaita/assets', '.png'): + xml += ' theme/Adwaita/assets/{0}\n'.format(f) + +xml += '\n' + +for f in get_files('theme/Adwaita/assets', '.svg'): + xml += ' theme/Adwaita/assets/{0}\n'.format(f) + +xml += ''' + theme/HighContrast/gtk.css + theme/HighContrast/gtk-inverse.css + theme/HighContrast/gtk-contained.css + theme/HighContrast/gtk-contained-inverse.css +''' + +for f in get_files('theme/HighContrast/assets', '.png'): + xml += ' theme/HighContrast/assets/{0}\n'.format(f) + +xml += '\n' + +for f in get_files('theme/HighContrast/assets', '.svg'): + xml += ' theme/HighContrast/assets/{0}\n'.format(f) + +xml += ''' + theme/win32/gtk-win32-base.css + theme/win32/gtk.css +''' + +for f in get_files('cursor', '.png'): + xml += ' cursor/{0}\n'.format(f) + +for f in get_files('gesture', '.symbolic.png'): + xml += ' gesture/{0}\n'.format(f) + +xml += '\n' + +for f in get_files('ui', '.ui'): + xml += ' ui/{0}\n'.format(f) + +xml += '\n' + +for s in ['16x16', '22x22', '24x24', '32x32', '48x48']: + for c in ['actions', 'status', 'categories']: + icons_dir = 'icons/{0}/{1}'.format(s,c) + if os.path.exists(os.path.join(srcdir,icons_dir)): + for f in get_files(icons_dir, '.png'): + xml += ' icons/{0}/{1}/{2}\n'.format(s,c,f) + +for f in get_files('inspector', '.ui'): + xml += ' inspector/{0}\n'.format(f) + +xml += ''' + inspector/logo.png + emoji/emoji.data + +''' + +if len(sys.argv) > 2: + outfile = sys.argv[2] + f = open(outfile, 'w') + f.write(xml) + f.close() +else: + print(xml) diff --git a/gtk/gen-rc.py b/gtk/gen-rc.py new file mode 100644 index 0000000000..2c24fa5f6e --- /dev/null +++ b/gtk/gen-rc.py @@ -0,0 +1,21 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- + +import sys +import os + +out_file = sys.argv[1] +in_file = sys.argv[2] +old_msvc = sys.argv[3] + +with open(out_file, 'w') as o: + if old_msvc is not None and old_msvc == "1": + o.write("#define ISOLATION_AWARE_ENABLED 1\n") + o.write('#include \n') + + with open(in_file, 'r') as f: + for line in f: + o.write(line) + + o.write('\n') + o.write('ISOLATIONAWARE_MANIFEST_RESOURCE_ID RT_MANIFEST libgtk3.manifest') \ No newline at end of file diff --git a/gtk/gentypefuncs.py b/gtk/gentypefuncs.py new file mode 100644 index 0000000000..b17b7233a1 --- /dev/null +++ b/gtk/gentypefuncs.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import sys +import re +import os + +debug = os.getenv('GTK_GENTYPEFUNCS_DEBUG') is not None + +out_file = sys.argv[1] +in_files = sys.argv[2:] + +funcs = [] + + +if debug: print ('Output file: ', out_file) + +if debug: print (len(in_files), 'input files') + +def open_file(filename, mode): + if sys.version_info[0] < 3: + return open(filename, mode=mode) + else: + return open(filename, mode=mode, encoding='utf-8') + +for filename in in_files: + if debug: print ('Input file: ', filename) + with open_file(filename, "r") as f: + for line in f: + line = line.rstrip('\n').rstrip('\r') + # print line + match = re.search(r'\bg[tds]k_[a-zA-Z0-9_]*_get_type\b', line) + if match: + func = match.group(0) + if not func in funcs: + funcs.append(func) + if debug: print ('Found ', func) + +file_output = 'G_GNUC_BEGIN_IGNORE_DEPRECATIONS\n' + +funcs = sorted(funcs) + +for f in funcs: + if f.startswith('gdk_x11') or f.startswith('gtk_socket') or f.startswith('gtk_plug'): + file_output += '#ifdef GDK_WINDOWING_X11\n' + file_output += '*tp++ = {0}();\n'.format(f) + file_output += '#endif\n' + else: + file_output += '*tp++ = {0}();\n'.format(f) + +if debug: print (len(funcs), 'functions') + +ofile = open(out_file, "w") +ofile.write(file_output) +ofile.close() diff --git a/gtk/gtk-launch.c b/gtk/gtk-launch.c index ccf1bd8d4b..87b351bf2a 100644 --- a/gtk/gtk-launch.c +++ b/gtk/gtk-launch.c @@ -21,7 +21,9 @@ #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include @@ -136,7 +138,9 @@ main (int argc, char *argv[]) info = G_APP_INFO (g_desktop_app_info_new (desktop_file_name)); g_free (desktop_file_name); #else -#warning Please add support for creating AppInfo from id for your OS + #ifndef _MSC_VER + #warning Please add support for creating AppInfo from id for your OS + #endif g_printerr (_("Creating AppInfo from id not supported on non unix operating systems")); #endif args++; diff --git a/gtk/gtk-win32.rc.body.in b/gtk/gtk-win32.rc.body.in index 4a42d5a666..3834e16efc 100644 --- a/gtk/gtk-win32.rc.body.in +++ b/gtk/gtk-win32.rc.body.in @@ -17,7 +17,7 @@ VS_VERSION_INFO VERSIONINFO VALUE "FileDescription", "GIMP Toolkit" VALUE "FileVersion", "@GTK_VERSION@.0" VALUE "InternalName", "libgtk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@" - VALUE "LegalCopyright", "Copyright © 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald. Modified by the GTK+ Team and others 1997-2011." + VALUE "LegalCopyright", "Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald. Modified by the GTK+ Team and others 1997-2011." VALUE "OriginalFilename", "libgtk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll" VALUE "ProductName", "GTK+" VALUE "ProductVersion", "@GTK_VERSION@" diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c index f4ee86982e..072b7e4e12 100644 --- a/gtk/gtkdnd-quartz.c +++ b/gtk/gtkdnd-quartz.c @@ -1588,7 +1588,7 @@ gtk_drag_source_info_destroy (GtkDragSourceInfo *info) * info->context after it has been destroyed. */ pasteboard = [NSPasteboard pasteboardWithName: NSDragPboard]; - [pasteboard declareTypes: nil owner: nil]; + [pasteboard clearContents]; [pool release]; diff --git a/gtk/gtkpixelcache.c b/gtk/gtkpixelcache.c index 07695336c1..ffed591ca5 100644 --- a/gtk/gtkpixelcache.c +++ b/gtk/gtkpixelcache.c @@ -58,7 +58,7 @@ struct _GtkPixelCache { }; GtkPixelCache * -_gtk_pixel_cache_new () +_gtk_pixel_cache_new (void) { GtkPixelCache *cache; diff --git a/gtk/gtktestutils.c b/gtk/gtktestutils.c index 7b78f739fe..5c0a362296 100644 --- a/gtk/gtktestutils.c +++ b/gtk/gtktestutils.c @@ -764,7 +764,7 @@ gtk_test_register_all_types (void) GType *tp; all_registered_types = g_new0 (GType, max_gtk_types); tp = all_registered_types; -#include "gtktypefuncs.c" +#include "gtktypefuncs.inc" n_all_registered_types = tp - all_registered_types; g_assert (n_all_registered_types + 1 < max_gtk_types); *tp = 0; diff --git a/gtk/gtktypebuiltins.h.template b/gtk/gtktypebuiltins.h.template index 6a2c32013c..3dc9f834bf 100644 --- a/gtk/gtktypebuiltins.h.template +++ b/gtk/gtktypebuiltins.h.template @@ -14,7 +14,7 @@ G_BEGIN_DECLS /*** BEGIN file-production ***/ -/* enumerations from "@filename@" */ +/* enumerations from "@basename@" */ /*** END file-production ***/ /*** BEGIN value-header ***/ diff --git a/gtk/inspector/meson.build b/gtk/inspector/meson.build new file mode 100644 index 0000000000..7ca24ae2ee --- /dev/null +++ b/gtk/inspector/meson.build @@ -0,0 +1,31 @@ +inspector_sources = files( + 'action-editor.c', + 'actions.c', + 'cellrenderergraph.c', + 'css-editor.c', + 'css-node-tree.c', + 'data-list.c', + 'general.c', + 'gestures.c', + 'graphdata.c', + 'gtkstackcombo.c', + 'gtktreemodelcssnode.c', + 'init.c', + 'inspect-button.c', + 'magnifier.c', + 'menu.c', + 'misc-info.c', + 'object-hierarchy.c', + 'object-tree.c', + 'prop-editor.c', + 'prop-list.c', + 'resource-list.c', + 'selector.c', + 'signals-list.c', + 'size-groups.c', + 'statistics.c', + 'strv-editor.c', + 'treewalk.c', + 'visual.c', + 'window.c', +) diff --git a/gtk/meson.build b/gtk/meson.build new file mode 100644 index 0000000000..01c999ebfb --- /dev/null +++ b/gtk/meson.build @@ -0,0 +1,1090 @@ +subdir('deprecated') +subdir('a11y') +subdir('inspector') + +gtk_cargs = [ + '-DGTK_COMPILATION', + '-DG_LOG_DOMAIN="Gtk"', + '-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED', + '-DGTK_BINARY_VERSION="@0@"'.format(gtk_binary_version), + '-DGTK_HOST="@0@"'.format(host_machine.system()), + '-DGTK_DATA_PREFIX="@0@"'.format(gtk_prefix), + '-DGTK_LIBDIR="@0@"'.format(gtk_libdir), + '-DGTK_LOCALEDIR="@0@"'.format(gtk_localedir), + '-DGTK_DATADIR="@0@"'.format(gtk_datadir), + '-DGTK_SYSCONFDIR="@0@"'.format(gtk_sysconfdir), +] + +# List of sources to build the library from +gtk_sources = files( + 'gtkactionmuxer.c', + 'gtkactionobserver.c', + 'gtkactionobservable.c', + 'gtkactionable.c', + 'gtkquery.c', + 'gtksearchbar.c', + 'gtksearchentry.c', + 'gtksearchengine.c', + 'gtksearchenginesimple.c', + 'gtksearchenginemodel.c', + 'fnmatch.c', + 'gtkaboutdialog.c', + 'gtkaccelgroup.c', + 'gtkaccellabel.c', + 'gtkaccelmap.c', + 'gtkaccessible.c', + 'gtkactionbar.c', + 'gtkactionhelper.c', + 'gtkadjustment.c', + 'gtkallocatedbitmask.c', + 'gtkappchooser.c', + 'gtkappchooserwidget.c', + 'gtkappchooserbutton.c', + 'gtkappchooserdialog.c', + 'gtkapplication.c', + 'gtkapplicationaccels.c', + 'gtkapplicationimpl.c', + 'gtkapplicationwindow.c', + 'gtkaspectframe.c', + 'gtkassistant.c', + 'gtkbbox.c', + 'gtkbin.c', + 'gtkbindings.c', + 'gtkbookmarksmanager.c', + 'gtkborder.c', + 'gtkbox.c', + 'gtkboxgadget.c', + 'gtkbuildable.c', + 'gtkbuilder.c', + 'gtkbuilderparser.c', + 'gtkbuilder-menus.c', + 'gtkbuiltinicon.c', + 'gtkbutton.c', + 'gtkcairoblur.c', + 'gtkcalendar.c', + 'gtkcellarea.c', + 'gtkcellareabox.c', + 'gtkcellareaboxcontext.c', + 'gtkcellareacontext.c', + 'gtkcelleditable.c', + 'gtkcelllayout.c', + 'gtkcellrenderer.c', + 'gtkcellrendereraccel.c', + 'gtkcellrenderercombo.c', + 'gtkcellrendererpixbuf.c', + 'gtkcellrendererprogress.c', + 'gtkcellrendererspin.c', + 'gtkcellrendererspinner.c', + 'gtkcellrenderertext.c', + 'gtkcellrenderertoggle.c', + 'gtkcellview.c', + 'gtkcheckbutton.c', + 'gtkcheckmenuitem.c', + 'gtkcolorbutton.c', + 'gtkcolorchooser.c', + 'gtkcolorchooserwidget.c', + 'gtkcolorchooserdialog.c', + 'gtkcoloreditor.c', + 'gtkcolorpicker.c', + 'gtkcolorpickerkwin.c', + 'gtkcolorpickerportal.c', + 'gtkcolorpickershell.c', + 'gtkcolorplane.c', + 'gtkcolorscale.c', + 'gtkcolorswatch.c', + 'gtkcolorutils.c', + 'gtkcombobox.c', + 'gtkcomboboxtext.c', + 'gtkcomposetable.c', + 'gtkcontainer.c', + 'gtkcssanimation.c', + 'gtkcssanimatedstyle.c', + 'gtkcssarrayvalue.c', + 'gtkcssbgsizevalue.c', + 'gtkcssbordervalue.c', + 'gtkcsscalcvalue.c', + 'gtkcsscolorvalue.c', + 'gtkcsscornervalue.c', + 'gtkcsscustomgadget.c', + 'gtkcsscustomproperty.c', + 'gtkcssdimensionvalue.c', + 'gtkcsseasevalue.c', + 'gtkcssenumvalue.c', + 'gtkcssenginevalue.c', + 'gtkcssgadget.c', + 'gtkcssiconthemevalue.c', + 'gtkcssimage.c', + 'gtkcssimagebuiltin.c', + 'gtkcssimagecrossfade.c', + 'gtkcssimagefallback.c', + 'gtkcssimagegradient.c', + 'gtkcssimageicontheme.c', + 'gtkcssimagelinear.c', + 'gtkcssimageradial.c', + 'gtkcssimagesurface.c', + 'gtkcssimageurl.c', + 'gtkcssimagerecolor.c', + 'gtkcssimagescaled.c', + 'gtkcssimagevalue.c', + 'gtkcssimagewin32.c', + 'gtkcssinheritvalue.c', + 'gtkcssinitialvalue.c', + 'gtkcsskeyframes.c', + 'gtkcsslookup.c', + 'gtkcssmatcher.c', + 'gtkcssnode.c', + 'gtkcssnodedeclaration.c', + 'gtkcssnodestylecache.c', + 'gtkcssnumbervalue.c', + 'gtkcsspalettevalue.c', + 'gtkcssparser.c', + 'gtkcsspathnode.c', + 'gtkcsspositionvalue.c', + 'gtkcssprovider.c', + 'gtkcssrepeatvalue.c', + 'gtkcssrgbavalue.c', + 'gtkcsssection.c', + 'gtkcssselector.c', + 'gtkcssstringvalue.c', + 'gtkcssstyle.c', + 'gtkcssstylechange.c', + 'gtkcssshadowsvalue.c', + 'gtkcssshadowvalue.c', + 'gtkcssshorthandproperty.c', + 'gtkcssshorthandpropertyimpl.c', + 'gtkcssstaticstyle.c', + 'gtkcssstylefuncs.c', + 'gtkcssstyleproperty.c', + 'gtkcssstylepropertyimpl.c', + 'gtkcsstransformvalue.c', + 'gtkcsstransientnode.c', + 'gtkcsstransition.c', + 'gtkcsstypedvalue.c', + 'gtkcssunsetvalue.c', + 'gtkcsstypes.c', + 'gtkcssvalue.c', + 'gtkcsswidgetnode.c', + 'gtkcsswin32sizevalue.c', + 'gtkdialog.c', + 'gtkdragsource.c', + 'gtkdrawingarea.c', + 'gtkeditable.c', + 'gtkemojichooser.c', + 'gtkemojicompletion.c', + 'gtkentry.c', + 'gtkentrybuffer.c', + 'gtkentrycompletion.c', + 'gtkeventbox.c', + 'gtkeventcontroller.c', + 'gtkeventcontrollerkey.c', + 'gtkeventcontrollermotion.c', + 'gtkeventcontrollerscroll.c', + 'gtkexpander.c', + 'gtkfilechooser.c', + 'gtkfilechooserbutton.c', + 'gtkfilechooserdialog.c', + 'gtkfilechooserembed.c', + 'gtkfilechooserentry.c', + 'gtkfilechoosernative.c', + 'gtkfilechoosernativeportal.c', + 'gtkfilechooserutils.c', + 'gtkfilechooserwidget.c', + 'gtkfilefilter.c', + 'gtkfilesystem.c', + 'gtkfilesystemmodel.c', + 'gtkfixed.c', + 'gtkflowbox.c', + 'gtkfontbutton.c', + 'gtkfontchooser.c', + 'gtkfontchooserdialog.c', + 'gtkfontchooserutils.c', + 'gtkfontchooserwidget.c', + 'gtkframe.c', + 'gtkgladecatalog.c', + 'gtkgesture.c', + 'gtkgesturedrag.c', + 'gtkgesturelongpress.c', + 'gtkgesturemultipress.c', + 'gtkgesturepan.c', + 'gtkgesturerotate.c', + 'gtkgesturesingle.c', + 'gtkgesturestylus.c', + 'gtkgestureswipe.c', + 'gtkgesturezoom.c', + 'gtkglarea.c', + 'gtkgrid.c', + 'gtkheaderbar.c', + 'gtkhsla.c', + 'gtkicon.c', + 'gtkiconcache.c', + 'gtkiconcachevalidator.c', + 'gtkiconhelper.c', + 'gtkicontheme.c', + 'gtkiconview.c', + 'gtkimage.c', + 'gtkimagedefinition.c', + 'gtkimcontext.c', + 'gtkimcontextsimple.c', + 'gtkimmodule.c', + 'gtkimmulticontext.c', + 'gtkinfobar.c', + 'gtkinvisible.c', + 'gtkkeyhash.c', + 'gtkkineticscrolling.c', + 'gtklabel.c', + 'gtklayout.c', + 'gtklevelbar.c', + 'gtklinkbutton.c', + 'gtklistbox.c', + 'gtkliststore.c', + 'gtklockbutton.c', + 'gtkmain.c', + 'gtkmagnifier.c', + 'gtkmenu.c', + 'gtkmenubar.c', + 'gtkmenubutton.c', + 'gtkmenuitem.c', + 'gtkmenusectionbox.c', + 'gtkmenushell.c', + 'gtkmenutracker.c', + 'gtkmenutrackeritem.c', + 'gtkmenutoolbutton.c', + 'gtkmessagedialog.c', + 'gtkmnemonichash.c', + 'gtkmodelmenuitem.c', + 'gtkmodelbutton.c', + 'gtkmodifierstyle.c', + 'gtkmodules.c', + 'gtkmountoperation.c', + 'gtknativedialog.c', + 'gtknotebook.c', + 'gtkoffscreenwindow.c', + 'gtkorientable.c', + 'gtkoverlay.c', + 'gtkpadcontroller.c', + 'gtkpagesetup.c', + 'gtkpaned.c', + 'gtkpango.c', + 'gtkpapersize.c', + 'gtkpathbar.c', + 'gtkplacessidebar.c', + 'gtkplacesview.c', + 'gtkplacesviewrow.c', + 'gtkprintcontext.c', + 'gtkprintoperation.c', + 'gtkprintoperationpreview.c', + 'gtkprintsettings.c', + 'gtkprintutils.c', + 'gtkprivate.c', + 'gtkprogressbar.c', + 'gtkprogresstracker.c', + 'gtkpixelcache.c', + 'gtkpopover.c', + 'gtkpopovermenu.c', + 'gtkradiobutton.c', + 'gtkradiomenuitem.c', + 'gtkradiotoolbutton.c', + 'gtkrange.c', + 'gtkrbtree.c', + 'gtkrecentchooserdefault.c', + 'gtkrecentchooserdialog.c', + 'gtkrecentchoosermenu.c', + 'gtkrecentchooserwidget.c', + 'gtkrecentchooserutils.c', + 'gtkrecentchooser.c', + 'gtkrecentfilter.c', + 'gtkrecentmanager.c', + 'gtkrender.c', + 'gtkrenderbackground.c', + 'gtkrenderborder.c', + 'gtkrendericon.c', + 'gtkrevealer.c', + 'gtkroundedbox.c', + 'gtkscale.c', + 'gtkscalebutton.c', + 'gtkscrollable.c', + 'gtkscrollbar.c', + 'gtkscrolledwindow.c', + 'gtkselection.c', + 'gtkseparator.c', + 'gtkseparatormenuitem.c', + 'gtkseparatortoolitem.c', + 'gtksettings.c', + 'gtkshortcutsgroup.c', + 'gtkshortcutlabel.c', + 'gtkshortcutsshortcut.c', + 'gtkshortcutssection.c', + 'gtkshortcutswindow.c', + 'gtksidebarrow.c', + 'gtksizegroup.c', + 'gtksizerequest.c', + 'gtksizerequestcache.c', + 'gtkshow.c', + 'gtkstacksidebar.c', + 'gtkspinbutton.c', + 'gtkspinner.c', + 'gtkstack.c', + 'gtkstackswitcher.c', + 'gtkstatusbar.c', + 'gtkstyleanimation.c', + 'gtkstylecascade.c', + 'gtkstylecontext.c', + 'gtkstyleproperty.c', + 'gtkstyleprovider.c', + 'gtkstyleproviderprivate.c', + 'gtkswitch.c', + 'gtktestutils.c', + 'gtktextattributes.c', + 'gtktextbtree.c', + 'gtktextbuffer.c', + 'gtktextbufferrichtext.c', + 'gtktextbufferserialize.c', + 'gtktextchild.c', + 'gtktextdisplay.c', + 'gtktexthandle.c', + 'gtktextiter.c', + 'gtktextlayout.c', + 'gtktextmark.c', + 'gtktextsegment.c', + 'gtktexttag.c', + 'gtktexttagtable.c', + 'gtktexttypes.c', + 'gtktextutil.c', + 'gtktextview.c', + 'gtktogglebutton.c', + 'gtktoggletoolbutton.c', + 'gtktoolbar.c', + 'gtktoolbutton.c', + 'gtktoolitem.c', + 'gtktoolitemgroup.c', + 'gtktoolpalette.c', + 'gtktoolshell.c', + 'gtktooltip.c', + 'gtktooltipwindow.c', + 'gtktrashmonitor.c', + 'gtktreedatalist.c', + 'gtktreednd.c', + 'gtktreemenu.c', + 'gtktreemodel.c', + 'gtktreemodelfilter.c', + 'gtktreemodelsort.c', + 'gtktreeselection.c', + 'gtktreesortable.c', + 'gtktreestore.c', + 'gtktreeview.c', + 'gtktreeviewcolumn.c', + 'gtkutils.c', + 'gtkvolumebutton.c', + 'gtkviewport.c', + 'gtkwidget.c', + 'gtkwidgetpath.c', + 'gtkwindow.c', + 'gtkwindowgroup.c', + 'gtkwin32draw.c', + 'gtkwin32theme.c', + 'gdkpixbufutils.c', + 'language-names.c', + 'script-names.c', +) + +gtk_private_type_headers = files( + 'gtkcsstypesprivate.h', + 'gtktexthandleprivate.h', +) + +gtk_gir_public_headers = files( + 'gtk.h', + 'gtk-autocleanups.h', + 'gtkx-autocleanups.h', + 'gtk-a11y.h', + 'gtkaboutdialog.h', + 'gtkaccelgroup.h', + 'gtkaccellabel.h', + 'gtkaccelmap.h', + 'gtkaccessible.h', + 'gtkactionable.h', + 'gtkactionbar.h', + 'gtkadjustment.h', + 'gtkappchooser.h', + 'gtkappchooserbutton.h', + 'gtkappchooserdialog.h', + 'gtkappchooserwidget.h', + 'gtkapplication.h', + 'gtkapplicationwindow.h', + 'gtkaspectframe.h', + 'gtkassistant.h', + 'gtkbbox.h', + 'gtkbin.h', + 'gtkbindings.h', + 'gtkborder.h', + 'gtkbox.h', + 'gtkbuilder.h', + 'gtkbuildable.h', + 'gtkbutton.h', + 'gtkcalendar.h', + 'gtkcellarea.h', + 'gtkcellareacontext.h', + 'gtkcellareabox.h', + 'gtkcelleditable.h', + 'gtkcelllayout.h', + 'gtkcellrenderer.h', + 'gtkcellrendereraccel.h', + 'gtkcellrenderercombo.h', + 'gtkcellrendererpixbuf.h', + 'gtkcellrendererprogress.h', + 'gtkcellrendererspin.h', + 'gtkcellrendererspinner.h', + 'gtkcellrenderertext.h', + 'gtkcellrenderertoggle.h', + 'gtkcellview.h', + 'gtkcheckbutton.h', + 'gtkcheckmenuitem.h', + 'gtkclipboard.h', + 'gtkcolorbutton.h', + 'gtkcolorchooser.h', + 'gtkcolorchooserwidget.h', + 'gtkcolorchooserdialog.h', + 'gtkcolorutils.h', + 'gtkcombobox.h', + 'gtkcomboboxtext.h', + 'gtkcontainer.h', + 'gtkcssprovider.h', + 'gtkcsssection.h', + 'gtkdebug.h', + 'gtkdialog.h', + 'gtkdnd.h', + 'gtkdragdest.h', + 'gtkdragsource.h', + 'gtkdrawingarea.h', + 'gtkeditable.h', + 'gtkentry.h', + 'gtkentrybuffer.h', + 'gtkentrycompletion.h', + 'gtkenums.h', + 'gtkeventbox.h', + 'gtkeventcontroller.h', + 'gtkeventcontrollerkey.h', + 'gtkeventcontrollermotion.h', + 'gtkeventcontrollerscroll.h', + 'gtkexpander.h', + 'gtkfilechooser.h', + 'gtkfilechooserbutton.h', + 'gtkfilechooserdialog.h', + 'gtkfilechoosernative.h', + 'gtkfilechooserwidget.h', + 'gtkfilefilter.h', + 'gtkfixed.h', + 'gtkflowbox.h', + 'gtkfontbutton.h', + 'gtkfontchooser.h', + 'gtkfontchooserdialog.h', + 'gtkfontchooserwidget.h', + 'gtkframe.h', + 'gtkgesture.h', + 'gtkgesturedrag.h', + 'gtkgesturelongpress.h', + 'gtkgesturemultipress.h', + 'gtkgesturepan.h', + 'gtkgesturerotate.h', + 'gtkgesturesingle.h', + 'gtkgesturestylus.h', + 'gtkgestureswipe.h', + 'gtkgesturezoom.h', + 'gtkglarea.h', + 'gtkgrid.h', + 'gtkheaderbar.h', + 'gtkicontheme.h', + 'gtkiconview.h', + 'gtkimage.h', + 'gtkimcontext.h', + 'gtkimcontextinfo.h', + 'gtkimcontextsimple.h', + 'gtkimmodule.h', + 'gtkimmulticontext.h', + 'gtkinfobar.h', + 'gtkinvisible.h', + 'gtklabel.h', + 'gtklayout.h', + 'gtklevelbar.h', + 'gtklinkbutton.h', + 'gtklistbox.h', + 'gtkliststore.h', + 'gtklockbutton.h', + 'gtkmain.h', + 'gtkmenu.h', + 'gtkmenubar.h', + 'gtkmenubutton.h', + 'gtkmenuitem.h', + 'gtkmenushell.h', + 'gtkmenutoolbutton.h', + 'gtkmessagedialog.h', + 'gtkmodelbutton.h', + 'gtkmodules.h', + 'gtkmountoperation.h', + 'gtknativedialog.h', + 'gtknotebook.h', + 'gtkoffscreenwindow.h', + 'gtkorientable.h', + 'gtkoverlay.h', + 'gtkpadcontroller.h', + 'gtkpagesetup.h', + 'gtkpaned.h', + 'gtkpapersize.h', + 'gtkplacessidebar.h', + 'gtkplug.h', + 'gtkpopover.h', + 'gtkpopovermenu.h', + 'gtkprintcontext.h', + 'gtkprintoperation.h', + 'gtkprintoperationpreview.h', + 'gtkprintsettings.h', + 'gtkprogressbar.h', + 'gtkradiobutton.h', + 'gtkradiomenuitem.h', + 'gtkradiotoolbutton.h', + 'gtkrange.h', + 'gtkrecentchooser.h', + 'gtkrecentchooserdialog.h', + 'gtkrecentchoosermenu.h', + 'gtkrecentchooserwidget.h', + 'gtkrecentfilter.h', + 'gtkrecentmanager.h', + 'gtkrender.h', + 'gtkrevealer.h', + 'gtkscale.h', + 'gtkscalebutton.h', + 'gtkscrollable.h', + 'gtkscrollbar.h', + 'gtkscrolledwindow.h', + 'gtksearchbar.h', + 'gtksearchentry.h', + 'gtkselection.h', + 'gtkseparator.h', + 'gtkseparatormenuitem.h', + 'gtkseparatortoolitem.h', + 'gtksettings.h', + 'gtkshortcutlabel.h', + 'gtkshortcutsgroup.h', + 'gtkshortcutssection.h', + 'gtkshortcutsshortcut.h', + 'gtkshortcutswindow.h', + 'gtkshow.h', + 'gtkstacksidebar.h', + 'gtksizegroup.h', + 'gtksizerequest.h', + 'gtksocket.h', + 'gtkspinbutton.h', + 'gtkspinner.h', + 'gtkstack.h', + 'gtkstackswitcher.h', + 'gtkstatusbar.h', + 'gtkstylecontext.h', + 'gtkstyleprovider.h', + 'gtkswitch.h', + 'gtktestutils.h', + 'gtktextattributes.h', + 'gtktextbuffer.h', + 'gtktextbufferrichtext.h', + 'gtktextchild.h', + 'gtktextiter.h', + 'gtktextmark.h', + 'gtktexttag.h', + 'gtktexttagtable.h', + 'gtktextview.h', + 'gtktogglebutton.h', + 'gtktoggletoolbutton.h', + 'gtktoolbar.h', + 'gtktoolbutton.h', + 'gtktoolitem.h', + 'gtktoolitemgroup.h', + 'gtktoolpalette.h', + 'gtktoolshell.h', + 'gtktooltip.h', + 'gtktreednd.h', + 'gtktreemodel.h', + 'gtktreemodelfilter.h', + 'gtktreemodelsort.h', + 'gtktreeselection.h', + 'gtktreesortable.h', + 'gtktreestore.h', + 'gtktreeview.h', + 'gtktreeviewcolumn.h', + 'gtktypes.h', + 'gtkviewport.h', + 'gtkvolumebutton.h', + 'gtkwidget.h', + 'gtkwidgetpath.h', + 'gtkwindow.h', + 'gtkwindowgroup.h', +) + +gtk_nogir_public_headers = files( + 'gtkx.h', + 'gtktextdisplay.h', +) + +# Installed headers without compatibility guarantees that are not included in gtk/gtk.h +gtk_semi_private_headers = files('gtktextlayout.h') +gtk_public_headers = gtk_gir_public_headers + gtk_nogir_public_headers +install_headers(gtk_public_headers + gtk_semi_private_headers, subdir: 'gtk-3.0/gtk') + +if os_unix + gtk_unix_print_headers = [ + 'gtkpagesetupunixdialog.h', + 'gtkprintunixdialog.h', + 'gtkprinter.h', + 'gtkprintjob.h', + 'gtkunixprint-autocleanups.h', + 'gtkunixprint.h', + ] + install_headers(gtk_unix_print_headers, subdir: 'gtk-3.0/unix-print/gtk') +endif + +gtk_unix_sources = files( + 'gtkcustompaperunixdialog.c', + 'gtkpagesetupunixdialog.c', + 'gtkprinter.c', + 'gtkprinteroption.c', + 'gtkprinteroptionset.c', + 'gtkprinteroptionwidget.c', + 'gtkprintjob.c', + 'gtkprintoperation-unix.c', + 'gtkprintoperation-portal.c', + 'gtkprintunixdialog.c', + 'gtkprintbackend.c', + 'gtksearchenginetracker.c', +) + +if os_unix + gtk_sources += gtk_unix_sources +endif + +gtk_win32_sources = files( + 'gtkprint-win32.c', + 'gtkprintoperation-win32.c', + 'gtkfilechoosernativewin32.c', + 'gtkwin32.c', +) + +if os_win32 + # FIXME these sources should not be added to generate_gir? + gtk_sources += gtk_win32_sources +endif + +gen_gtk_gresources_xml = find_program('gen-gtk-gresources-xml.py') +gtk_gresources_xml = configure_file(output: 'gtk.gresources.xml', + command: [ + gen_gtk_gresources_xml, + meson.current_source_dir(), + '@OUTPUT@' + ]) + +# Re-build the theme files if sassc is available +theme_deps = [] +sassc = find_program('sassc', required: false) +if sassc.found() + sassc_opts = [ '-a', '-M', '-t', 'compact' ] + + subdir('theme/Adwaita') + subdir('theme/HighContrast') +endif + +gtkresources = gnome.compile_resources('gtkresources', + gtk_gresources_xml, + dependencies: theme_deps, + source_dir: [ + # List in order of preference + meson.current_build_dir(), + meson.current_source_dir(), + ], + c_name: '_gtk', + extra_args: '--manual-register') + +gtk_use_x11_sources = files([ + 'gtkplug.c', + 'gtksocket.c', + 'gtkxembed.c', + 'deprecated/gtktrayicon-x11.c', + 'gtkapplication-x11.c', + 'gtkmountoperation-x11.c', +]) + +gtk_use_wayland_sources = files([ + 'gtkapplication-wayland.c' +]) + +if quartz_enabled + gtk_sources += files( + 'gtkclipboard-quartz.c', + 'gtkdnd-quartz.c', + ) +else + gtk_sources += files( + 'gtkclipboard.c', + 'gtkdnd.c', + 'gtkdragdest.c', + ) +endif + +gtk_use_wayland_or_x11_sources = files( 'gtkapplication-dbus.c') + +gtk_use_win32_sources = files( + 'gtkwin32embed.c', + 'gtkwin32embedwidget.c', + 'gtkmountoperation-stub.c', +) + +gtk_use_quartz_sources = files( + 'gtksearchenginequartz.c', + 'gtkmountoperation-stub.c', + 'gtkapplication-quartz.c', + 'gtkapplication-quartz-menu.c', + 'gtkfilechoosernativequartz.c', + 'gtkquartz.c', +) + +gtk_stub_sources = files('gtkmountoperation-stub.c') + +gtk_dbus_src = gnome.gdbus_codegen('gtkdbusgenerated', 'gtkdbusinterfaces.xml', + interface_prefix: 'org.Gtk.', + namespace: '_Gtk') + +gtkmarshalers = gnome.genmarshal('gtkmarshalers', + sources: 'gtkmarshalers.list', + prefix: '_gtk_marshal', + valist_marshallers: true) + +gtkmarshal_h = gtkmarshalers[1] + +gtktypebuiltins = gnome.mkenums('gtktypebuiltins', + sources: gtk_public_headers + gtk_deprecated_headers + a11y_headers, + c_template: 'gtktypebuiltins.c.template', + h_template: 'gtktypebuiltins.h.template', + install_dir: join_paths(gtk_includedir, 'gtk-3.0/gtk'), + install_header: true) + +gtktypebuiltins_h = gtktypebuiltins[1] + +gtkprivatetypebuiltins = gnome.mkenums('gtkprivatetypebuiltins', + sources: gtk_private_type_headers, + c_template: 'gtkprivatetypebuiltins.c.template', + h_template: 'gtkprivatetypebuiltins.h.template') + +gtkprivatetypebuiltins_h = gtkprivatetypebuiltins[1] + +# Generate gtktypefuncs.inc +typefuncs = custom_target('gtktypefuncs.inc', + depends: [ gdkenum_h ], + output: 'gtktypefuncs.inc', + input: gdk_public_headers + + gtk_public_headers + + gtk_deprecated_headers + + [ gtktypebuiltins_h, gdkenum_h ], + command: [ + find_program('gentypefuncs.py'), + '@OUTPUT@', + '@INPUT@', + ], + install: false) + + +gtkversion_cdata = configuration_data() +gtkversion_cdata.set('GTK_MAJOR_VERSION', gtk_major_version) +gtkversion_cdata.set('GTK_MINOR_VERSION', gtk_minor_version) +gtkversion_cdata.set('GTK_MICRO_VERSION', gtk_micro_version) +gtkversion_cdata.set('GTK_BINARY_AGE', gtk_binary_age) +gtkversion_cdata.set('GTK_INTERFACE_AGE', gtk_interface_age) +gtkversion_cdata.set('GTK_API_VERSION', gtk_api_version) +gtkversion_cdata.set('GTK_BINARY_VERSION', gtk_binary_version) +gtkversion_cdata.set('GTK_VERSION', meson.project_version()) +gtkversion_cdata.set('EXE_MANIFEST_ARCHITECTURE', '*') +gtkversion_cdata.set('LT_CURRENT_MINUS_AGE', gtk_soversion) + +gtkversion = configure_file(input: 'gtkversion.h.in', + output: 'gtkversion.h', + configuration: gtkversion_cdata, + install_dir: join_paths(gtk_includedir, 'gtk-3.0/gtk')) + +gtk_gen_headers = [ + gtkmarshalers, + gtkprivatetypebuiltins, + gtktypebuiltins, + gtkversion, +] + +gtk_sources += [ + gtk_dbus_src, + gtk_deprecated_sources, + inspector_sources, + a11y_sources, + gtkresources, + gtkmarshalers, + gtkprivatetypebuiltins, + gtktypebuiltins, +] + +gtk_deps = [ + gmodule_dep, + glib_dep, + gobject_dep, + platform_gio_dep, + pangocairo_dep, + pango_dep, + pangoft_dep, + harfbuzz_dep, + fribidi_dep, + cairogobj_dep, + cairo_dep, + fontconfig_dep, + pixbuf_dep, + atk_dep, + epoxy_dep, + libm, +] + +if x11_enabled + x11_data_prefix = dependency('x11').get_pkgconfig_variable('prefix') + + gtk_cargs += [ '-DX11_DATA_PREFIX="@0@"'.format(x11_data_prefix), ] + gtk_sources += gtk_use_x11_sources + gtk_deps += [ xi_dep, x11_dep, ] +endif + +if wayland_enabled + gtk_sources += gtk_use_wayland_sources +endif + +if win32_enabled + gtk_cargs += [] + gtk_sources += gtk_use_win32_sources + gtk_deps += [ giowin32_dep, pangowin32_dep ] + + gtk_rc_body = configure_file( + input: 'gtk-win32.rc.body.in', + output: 'gtk-win32.rc.body', + configuration: gtkversion_cdata, + ) + gtk_rc_manifest = configure_file( + input: 'libgtk3.manifest.in', + output: 'libgtk3.manifest', + configuration: gtkversion_cdata, + ) + + # Unfortunately, an extra directive in the .rc file is required for earlier + # Visual Studio for embedding manifests via .rc files (2010 [v16] and earlier) + # using ISOLATIONAWARE_MANIFEST_RESOURCE_ID to really work. Somehow for + # Visual Studio 2008 builds, this does not yet work. + old_msvc = false + + if cc.get_id() == 'msvc' and cc.version().split('.')[0].to_int() < 17 + old_msvc = true + endif + + gtk_rc = custom_target( + 'gtk.rc', + output: 'gtk.rc', + input: gtk_rc_body, + command: [find_program('gen-rc.py'), + '@OUTPUT@', + '@INPUT@', + old_msvc ? '1' : '' + ], + install: false, + ) + gtk_res = import('windows').compile_resources(gtk_rc) + gtk_sources += gtk_res +else + gtk_deps += [ atkbridge_dep, ] +endif + +if quartz_enabled + gtk_sources += gtk_use_quartz_sources + gtk_cargs += ['-DGDK_WINDOWING_QUARTZ', '-xobjective-c'] +endif + +# So we don't add these twice +if x11_enabled or wayland_enabled + gtk_sources += gtk_use_wayland_or_x11_sources + gtk_deps += pangoft_dep +endif + +if not (x11_enabled or win32_enabled or quartz_enabled) + gtk_sources += gtk_stub_sources +endif + +if cloudproviders_enabled + gtk_deps += cloudproviders_dep +endif + +# Unconditional. If libintl isn't found, +# the object just does nothing being in the deplist +gtk_deps += libintl_dep + +gtk_settings_schemas = [ + 'org.gtk.Settings.FileChooser.gschema.xml', + 'org.gtk.Settings.ColorChooser.gschema.xml', + 'org.gtk.Settings.EmojiChooser.gschema.xml', + 'org.gtk.Settings.Debug.gschema.xml', +] +install_data(gtk_settings_schemas, install_dir: gtk_schemasdir) +gnome.compile_schemas(depend_files: files(gtk_settings_schemas), + build_by_default: true) +gtk_schema_build_dir = meson.current_build_dir() + +# Check for more things +if cc.has_header('langinfo.h') + foreach nl_enum: [ '_NL_MEASUREMENT_MEASUREMENT', + '_NL_PAPER_HEIGHT', + '_NL_PAPER_WIDTH', + '_NL_TIME_FIRST_WEEKDAY', ] + cdata.set('HAVE_' + nl_enum, cc.has_header_symbol('langinfo.h', nl_enum) ? 1 : false) + endforeach +endif + +gtk_dep_sources = [gtkversion, gtktypebuiltins_h] + +# Static immodules +gtk_included_im_deps = [] +foreach l: immodules + name = l[0] + sources = l[1] + cond = l.get(2, true) + cflags = l.get(3, []) + + if cond and builtin_immodules + gtk_cargs += ['-DINCLUDE_IM_@0@'.format(name)] + mod = static_library('staticimmodule-@0@'.format(name), + sources + gtk_dep_sources, + dependencies: gtk_deps + [libgdk_dep] , + c_args: gtk_cargs + common_cflags + cflags, + include_directories: [confinc, gdkinc, gtkinc]) + + gtk_included_im_deps += declare_dependency(link_with: mod) + endif +endforeach + +# Library +libgtk = shared_library('gtk-3', + soversion: gtk_soversion, + sources: [typefuncs, gtk_sources, gtkmarshal_h, gtkprivatetypebuiltins_h], + c_args: gtk_cargs + common_cflags, + include_directories: [confinc, gdkinc, gtkinc], + dependencies: gtk_deps + [libgdk_dep] + gtk_included_im_deps, + link_with: libgdk, + link_args: common_ldflags, + darwin_versions : gtk_osxversions, + install: true) + +# Introspection +if build_gir + gir_args = ['--quiet'] + + gtk_introspection_sources = [ + gtk_gir_public_headers, + gtk_deprecated_headers, + gtk_sources, + a11y_headers, + a11y_sources, + gtktypebuiltins_h, + gtkversion, + ] + + gtk_gir_includes = [gdk_gir[0], 'Atk-1.0'] + gtk_gir_extra_args = gir_args + ['-DGTK_COMPILATION', + '--c-include=gtk/gtk-a11y.h'] + if x11_enabled + gtk_gir_includes += ['xlib-2.0'] + gtk_gir_extra_args += ['--c-include=gtk/gtkx.h'] + endif + + gtk_gir = gnome.generate_gir(libgtk, + sources: gtk_introspection_sources, + namespace: 'Gtk', + nsversion: gtk_api_version, + identifier_prefix: 'Gtk', + symbol_prefix: 'gtk', + export_packages: 'gtk+-3.0', + includes: gtk_gir_includes, + header: 'gtk/gtk.h', + install: true, + dependencies: gdk_gir_dep, + extra_args: gtk_gir_extra_args) + gtk_dep_sources += gtk_gir +endif + +libgtk_dep = declare_dependency(sources: gtk_dep_sources, + include_directories: [confinc, gtkinc], + dependencies: gtk_deps + [libgdk_dep], + link_with: libgtk, + link_args: common_ldflags) + +if quartz_enabled + install_data(['gtk-keys.css.mac'], + install_dir: join_paths(get_option('datadir'), 'themes/Mac/gtk-3.0'), + rename: ['gtk-keys.css']) +endif + +install_data(['gtk-keys.css.default'], + install_dir: join_paths(get_option('datadir'), 'themes/Default/gtk-3.0'), + rename: ['gtk-keys.css']) + +install_data(['gtk-keys.css.emacs'], + install_dir: join_paths(get_option('datadir'), 'themes/Emacs/gtk-3.0'), + rename: ['gtk-keys.css']) + +# Data to install +install_data('gtkbuilder.rng', + install_dir: join_paths(gtk_datadir, 'gtk-3.0')) + +install_data('gtkbuilder.loc', 'gtkbuilder.its', + install_dir: join_paths(gtk_datadir, 'gettext/its')) + +####### Utils ###### +gtk_query_settings = executable( + 'gtk-query-settings', + 'gtk-query-settings.c', + c_args: gtk_cargs, + dependencies: libgtk_dep, + install: true +) + +gtk_builder_tool = executable( + 'gtk-builder-tool', + 'gtk-builder-tool.c', + c_args: gtk_cargs, + dependencies: libgtk_dep, + install: true +) + +gtk_update_icon_cache = executable( + 'gtk-update-icon-cache', + 'updateiconcache.c', + c_args: gtk_cargs, + dependencies: libgtk_dep, + install: true +) + + gtk_query_immodules = executable( + 'gtk-query-immodules-3.0', + 'queryimmodules.c', + 'gtkutils.c', + c_args: gtk_cargs, + dependencies: libgtk_dep, + install: true +) + +gtk_encode_symbolic_svg = executable( + 'gtk-encode-symbolic-svg', + 'encodesymbolic.c', + c_args: gtk_cargs, + dependencies: libgtk_dep, + install: true +) + +gtk_launch = executable( + 'gtk-launch', + 'gtk-launch.c', + c_args: gtk_cargs, + dependencies: libgtk_dep, + install: true +) diff --git a/gtk/theme/Adwaita/meson.build b/gtk/theme/Adwaita/meson.build new file mode 100644 index 0000000000..7a799f947d --- /dev/null +++ b/gtk/theme/Adwaita/meson.build @@ -0,0 +1,30 @@ +scss_files = files([ + '_colors-public.scss', + '_colors.scss', + '_common.scss', + '_drawing.scss', +]) + +theme_variants = [ + 'dark', +] + +theme_deps += custom_target('Adwaita', + input: 'gtk-contained.scss', + output: 'gtk-contained.css', + command: [ + sassc, sassc_opts, '@INPUT@', '@OUTPUT@', + ], + depend_files: scss_files, + build_by_default: true) + +foreach variant: theme_variants + theme_deps += custom_target('Adwaita-' + variant, + input: 'gtk-contained-@0@.scss'.format(variant), + output: 'gtk-contained-@0@.css'.format(variant), + command: [ + sassc, sassc_opts, '@INPUT@', '@OUTPUT@', + ], + depend_files: scss_files, + build_by_default: true) +endforeach diff --git a/gtk/theme/HighContrast/meson.build b/gtk/theme/HighContrast/meson.build new file mode 100644 index 0000000000..f3230353ef --- /dev/null +++ b/gtk/theme/HighContrast/meson.build @@ -0,0 +1,29 @@ +scss_files = files([ + '_colors.scss', + '_common.scss', + '_drawing.scss', +]) + +theme_variants = [ + 'inverse', +] + +theme_deps += custom_target('HighContrast', + input: 'gtk-contained.scss', + output: 'gtk-contained.css', + command: [ + sassc, sassc_opts, '@INPUT@', '@OUTPUT@', + ], + depend_files: scss_files, + build_by_default: true) + +foreach variant: theme_variants + theme_deps += custom_target('HighContrast-' + variant, + input: 'gtk-contained-@0@.scss'.format(variant), + output: 'gtk-contained-@0@.css'.format(variant), + command: [ + sassc, sassc_opts, '@INPUT@', '@OUTPUT@', + ], + depend_files: scss_files, + build_by_default: true) +endforeach diff --git a/libgail-util/Makefile.am b/libgail-util/Makefile.am index 048fe33097..6e4141f802 100644 --- a/libgail-util/Makefile.am +++ b/libgail-util/Makefile.am @@ -1,6 +1,9 @@ include $(top_srcdir)/Makefile.decl -EXTRA_DIST += gailutil.def +EXTRA_DIST += \ + gailutil.def \ + meson.build + if OS_WIN32 export_symbols = -export-symbols $(srcdir)/gailutil.def gailutil.def: libgailutil-3.la diff --git a/libgail-util/meson.build b/libgail-util/meson.build new file mode 100644 index 0000000000..6cca36f208 --- /dev/null +++ b/libgail-util/meson.build @@ -0,0 +1,30 @@ +gailutil_sources = files( + 'gailmisc.c', + 'gailtextutil.c', +) + +gailutil_public_headers = files( + 'gailmisc.h', + 'gailtextutil.h', + 'gail-util.h', + ) + +install_headers(gailutil_public_headers, subdir : 'gail-3.0/libgail-util') + +gailutil_link_args = common_ldflags + +if cc.get_id() == 'msvc' + gailutil_link_args += '-def:@0@/gailutil.def'.format(meson.current_source_dir()) +endif + +libgailutil = shared_library('gailutil-3', + soversion: gtk_soversion, + sources: [gailutil_sources], + dependencies: libgtk_dep, + include_directories: [confinc, gtkinc], + c_args: [ + '-DGDK_DISABLE_DEPRECATED', + '-DGTK_DISABLE_DEPRECATED', + ] + common_cflags, + link_args: gailutil_link_args, + install: true) diff --git a/meson.build b/meson.build new file mode 100644 index 0000000000..538abb378c --- /dev/null +++ b/meson.build @@ -0,0 +1,974 @@ +project('gtk+-3.0', 'c', + version: '3.24.7', + default_options: [ + 'buildtype=debugoptimized', + 'warning_level=1' + ], + meson_version : '>= 0.48.0', + license: 'LGPLv2.1+') + +glib_major_req = 2 +glib_minor_req = 53 +glib_micro_req = 4 + +if glib_minor_req.is_odd() + glib_min_required = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req - 1) +else + glib_min_required = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req) +endif + +if glib_minor_req.is_odd() + glib_max_allowed = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req + 1) +else + glib_max_allowed = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req) +endif + +glib_req = '>= @0@.@1@.@2@'.format(glib_major_req, glib_minor_req, glib_micro_req) +pango_req = '>= 1.41.0' +fribidi_req = '>= 0.19.7' +atk_req = '>= 2.15.1' +cairo_req = '>= 1.14.0' +gdk_pixbuf_req = '>= 2.30.0' +introspection_req = '>= 1.39.0' +wayland_proto_req = '>= 1.12' +wayland_req = '>= 1.9.91' +epoxy_req = '>= 1.4' +cloudproviders_req = '>= 0.2.5' +xkbcommon_req = '>= 0.2.0' + +gnome = import('gnome') + +add_project_arguments('-DG_LOG_USE_STRUCTURED=1', language: 'c') +add_project_arguments('-DGLIB_MIN_REQUIRED_VERSION=' + glib_min_required, language: 'c') +add_project_arguments('-DGLIB_MAX_ALLOWED_VERSION=' + glib_max_allowed, language: 'c') + +# Making releases: +# 1. gtk_micro_version += 1; +# 2. gtk_interface_age += 1; +# 3. if any functions have been added, set gtk_interface_age to 0. +# 4. if backwards compatibility has been broken, we're in trouble +gtk_version = meson.project_version() +gtk_major_version = gtk_version.split('.')[0].to_int() +gtk_minor_version = gtk_version.split('.')[1].to_int() +gtk_micro_version = gtk_version.split('.')[2].to_int() +gtk_interface_age = 3 +add_project_arguments('-DGTK_VERSION="@0@"'.format(meson.project_version()), language: 'c') + +add_project_arguments('-D_GNU_SOURCE', language: 'c') + +gtk_debug_cflags = [] +buildtype = get_option('buildtype') +if buildtype.startswith('debug') + gtk_debug_cflags += '-DG_ENABLE_DEBUG' + if buildtype == 'debug' + gtk_debug_cflags += '-DG_ENABLE_CONSISTENCY_CHECKS' + endif +elif buildtype == 'release' + gtk_debug_cflags += '-DG_DISABLE_CAST_CHECKS' +endif + +add_project_arguments(gtk_debug_cflags, language: 'c') + +# Define a string for the earliest version that this release has +# backwards binary compatibility with for all interfaces a module +# might. Unless we add module-only API with lower stability +# guarantees, this should be unchanged until we break binary compat +# for GTK+. +gtk_binary_version = '3.0.0' + +gtk_binary_age = 100 * gtk_minor_version + gtk_micro_version + +cc = meson.get_compiler('c') + +if cc.get_id() == 'msvc' + vsver = 0 + mscver = cc.version().split('.')[0].to_int() + + # pre-Visual Studio 2015 (18.xx.xxxxx or earlier): just subtract 6 from major + # version of cc.version() to get the Visual Studio version + if mscver < 19 + vsver = mscver - 6 + else + # Visual Studio 2015 and later (19.xx.xxxxx or later): look at the minor version. + # If minor version < 10: Visual Studio 2015, + # 10 < minor version < 20: Visual Studio 2017, + # 20 < minor version: Visual Studio 2019 + mscsubver = cc.version().split('.')[1].to_int() + if mscsubver < 10 + vsver = 14 + elif mscsubver < 20 + vsver = 15 + else + vsver = 16 + endif + endif + + gtk_soversion = 'vs@0@'.format(vsver) +else + gtk_soversion = '0' +endif + +gtk_osxversions = [(100 * gtk_minor_version) + 1, '@0@.@1@.0'.format((100 * gtk_minor_version) + 1, gtk_micro_version)] + +gtk_api_version = '@0@.0'.format(gtk_major_version) + +x11_enabled = get_option('x11_backend') +wayland_enabled = get_option('wayland_backend') +broadway_enabled = get_option('broadway_backend') +quartz_enabled = get_option('quartz_backend') +win32_enabled = get_option('win32_backend') + +os_unix = false +os_linux = false +os_win32 = false +os_darwin = false + +# Some windowing system backends depend on the platform we're +# building for, so we need to ensure they are disabled; in other +# cases, they are the only windowing system available, so we need +# to ensure they are enabled +if host_machine.system() == 'darwin' + os_darwin = true +elif host_machine.system() == 'windows' + os_win32 = true +elif host_machine.system() == 'linux' + os_linux = true +endif +os_unix = not os_win32 + +if os_darwin + wayland_enabled = false + x11_enabled = false +else + quartz_enabled = false +endif + +if os_win32 + wayland_enabled = false + x11_enabled = false +else + win32_enabled = false +endif + +gtk_prefix = get_option('prefix') +gtk_includedir = join_paths(gtk_prefix, get_option('includedir')) +gtk_libdir = join_paths(gtk_prefix, get_option('libdir')) +gtk_datadir = join_paths(gtk_prefix, get_option('datadir')) +gtk_localedir = join_paths(gtk_prefix, get_option('localedir')) +gtk_sysconfdir = join_paths(gtk_prefix, get_option('sysconfdir')) +gtk_applicationsdir = join_paths(gtk_datadir, 'applications') +gtk_schemasdir = join_paths(gtk_datadir, 'glib-2.0/schemas') +gtk_appdatadir = join_paths(gtk_datadir, 'metainfo') + +# multipress: is mplocaledir defined somewhere? +gtk_mplocaledir = join_paths(gtk_prefix, get_option('localedir')) + +cdata = configuration_data() +cdata.set_quoted('PACKAGE_VERSION', meson.project_version()) +cdata.set_quoted('GTK_LOCALEDIR', gtk_localedir) +cdata.set_quoted('GTK_DATADIR', gtk_datadir) +cdata.set_quoted('GTK_LIBDIR', gtk_libdir) +cdata.set_quoted('GTK_SYSCONFDIR', gtk_sysconfdir) +cdata.set_quoted('GETTEXT_PACKAGE', 'gtk30') +cdata.set('GTK_MAJOR_VERSION', gtk_major_version) +cdata.set('GTK_MINOR_VERSION', gtk_minor_version) +cdata.set('GTK_MICRO_VERSION', gtk_micro_version) +cdata.set('GTK_BINARY_AGE', gtk_binary_age) +cdata.set('GTK_INTERFACE_AGE', gtk_interface_age) + +cdata.set_quoted('PACKAGE_URL', '') +cdata.set_quoted('PACKAGE_NAME', 'gtk+') +cdata.set_quoted('PACKAGE_TARNAME', 'gtk+') +cdata.set_quoted('PACKAGE_STRING', 'gtk+ @0@'.format(meson.project_version())) +cdata.set_quoted('PACKAGE_BUGREPORT', 'http://bugzilla.gnome.org/enter_bug.cgi?product=gtk%2B') + +cdata.set('ENABLE_NLS', 1) + +check_headers = [ + 'crt/externs.h', + 'dlfcn.h', + 'ftw.h', + 'inttypes.h', + 'linux/memfd.h', + 'linux/input.h', + 'dev/evdev/input.h', + 'locale.h', + 'memory.h', + 'stdint.h', + 'stdlib.h', + 'string.h', + 'strings.h', + 'sys/mman.h', + 'sys/param.h', + 'sys/stat.h', + 'sys/sysinfo.h', + 'sys/systeminfo.h', + 'sys/time.h', + 'sys/types.h', + 'unistd.h', +] + +foreach h : check_headers + if cc.has_header(h) + cdata.set('HAVE_' + h.underscorify().to_upper(), 1) + endif +endforeach + +# Maths functions might be implemented in libm +libm = cc.find_library('m', required: false) + +check_functions = [ + 'dcgettext', + 'getpagesize', + 'getresuid', + 'lstat', + 'mmap', + 'nearbyint', + 'posix_fallocate', + '_lock_file', + 'flockfile', + 'mkstemp', + 'mallinfo', + 'round', + 'rint', + 'log2', + 'exp2', + 'sincos', + 'trunc', + 'localtime_r', +] + +foreach func : check_functions + if cc.has_function(func, dependencies: libm) + cdata.set('HAVE_' + func.underscorify().to_upper(), 1) + endif +endforeach + +cdata.set('HAVE_DECL_ISINF', cc.has_header_symbol('math.h', 'isinf') ? 1 : false) +cdata.set('HAVE_DECL_ISNAN', cc.has_header_symbol('math.h', 'isnan') ? 1 : false) + +# Disable deprecation checks for all libraries we depend on on stable branches. +# This is so newer versions of those libraries don't cause more warnings with +# a stable GTK version. +# We don't ever want to turn off deprecation warnings for master however, because +# that's where we get rid of deprecated API we use. +if gtk_minor_version.is_even() + cdata.set('GLIB_DISABLE_DEPRECATION_WARNINGS', 1) +endif + +# Compiler flags +if cc.get_id() == 'msvc' + # Compiler options taken from msvc_recommended_pragmas.h + # in GLib, based on _Win32_Programming_ by Rector and Newcomer + test_cflags = [] + add_project_arguments('-FImsvc_recommended_pragmas.h', language: 'c') + add_project_arguments('-D_USE_MATH_DEFINES', language: 'c') +elif cc.get_id() == 'gcc' or cc.get_id() == 'clang' + test_cflags = [ + '-fno-strict-aliasing', + '-Wpointer-arith', + '-Wimplicit-function-declaration', + '-Wformat=2', + '-Wformat-security', + '-Wnested-externs', + '-Wold-style-definition', + '-Wundef', + '-Wunused', + '-Wcast-align', + '-Wmissing-noreturn', + '-Wmissing-format-attribute', + '-Wmissing-include-dirs', + '-Wlogical-op', + '-Wignored-qualifiers', + '-Wno-discarded-qualifiers', + '-Werror=implicit', + '-Werror=nonnull', + '-Werror=init-self', + '-Werror=main', + '-Werror=missing-braces', + '-Werror=sequence-point', + '-Werror=return-type', + '-Werror=trigraphs', + '-Werror=array-bounds', + '-Werror=write-strings', + '-Werror=address', + '-Werror=int-to-pointer-cast', + '-Werror=pointer-to-int-cast', + '-Werror=empty-body', + '-Werror=write-strings', + ] +else + test_cflags = [] +endif + +common_cflags = cc.get_supported_arguments(test_cflags) + +# Symbol visibility +if get_option('default_library') != 'static' + if os_win32 + cdata.set('DLL_EXPORT', true) + if cc.get_id() == 'msvc' + cdata.set('_GDK_EXTERN', '__declspec(dllexport) extern') + else + cdata.set('_GDK_EXTERN', '__attribute__((visibility("default"))) __declspec(dllexport) extern') + common_cflags += ['-fvisibility=hidden'] + endif + else + cdata.set('_GDK_EXTERN', '__attribute__((visibility("default"))) extern') + common_cflags += ['-fvisibility=hidden'] + endif +endif + +common_ldflags = [] + +if os_unix and not os_darwin + foreach ldflag: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ] + if cc.links('int main () { return 0; }', name: ldflag, args: ldflag) + common_ldflags += [ ldflag ] + endif + endforeach +endif + +confinc = include_directories('.') +gdkinc = include_directories('gdk') +gtkinc = include_directories('gtk') +libgailutilinc = include_directories('libgail-util') +testinc = include_directories('tests') + +# Dependencies +glib_dep = dependency('glib-2.0', version: glib_req, + fallback : ['glib', 'libglib_dep']) +gobject_dep = dependency('gobject-2.0', version: glib_req, + fallback : ['glib', 'libgobject_dep']) +if os_win32 + giowin32_dep = dependency('gio-windows-2.0', version: glib_req, required: win32_enabled, + fallback : ['glib', 'libgio_dep']) +endif +if os_unix + giounix_dep = dependency('gio-unix-2.0', version: glib_req, required: false, + fallback : ['glib', 'libgio_dep']) +endif +gmodule_dep = dependency('gmodule-2.0', version: glib_req, + fallback : ['glib', 'libgmodule_dep']) + +# Update when we can find depedencies in a declarative manner +cairo_dep = dependency('cairo', version: cairo_req, required: cc.get_id() != 'msvc') +cairogobj_dep = dependency('cairo-gobject', version: cairo_req, required: cc.get_id() != 'msvc') + +# Remove when we can find depedencies in a declarative manner +if not cairo_dep.found() and cc.get_id() == 'msvc' + if cc.has_header('cairo.h') and cc.has_header('cairo-win32.h') + cairo_dep = cc.find_library('cairo', required: false) + endif +endif + +if not cairo_dep.found() + cairo_dep = dependency('cairo', version: cairo_req, + fallback : ['cairo', 'libcairo_dep']) +endif + +# Remove when we can find depedencies in a declarative manner +if not cairogobj_dep.found() and cc.get_id() == 'msvc' + if cc.has_header('cairo-gobject.h') + cairogobj_dep = cc.find_library('cairo-gobject', required: false) + endif +endif + +if not cairogobj_dep.found() + cairogobj_dep = dependency('cairo-gobject', version: cairo_req, + fallback : ['cairo', 'libcairogobject_dep']) +endif + +pango_dep = dependency('pango', version: pango_req, + fallback : ['pango', 'libpango_dep']) +fribidi_dep = dependency('fribidi', version: fribidi_req, + fallback : ['fribidi', 'libfribidi_dep']) + +# Require PangoFT2 if on X11 or wayland +require_pangoft2 = wayland_enabled or x11_enabled +if require_pangoft2 + pangoft_dep = dependency('pangoft2', fallback : ['pango', 'libpangoft2_dep']) +else + pangoft_dep = dependency('pangoft2', required: false) +endif + +if pangoft_dep.found() + # Need at least 2.7.1 for FT_Get_Var_Design_Coordinates() + # We get the dependency itself from pango, but pango doesn't care + # about ft2 version, so an extra check is needed. + + # Update once Meson can have deps declared in a declarative manner + ft2_dep = dependency('freetype2', version: '>= 2.7.1', required: false) + + if not ft2_dep.found() and cc.get_id() == 'msvc' + if cc.has_header('ft2build.h') and cc.has_header('freetype/ftmm.h') + ft_lib = cc.find_library('freetype', required: false) + if ft_lib.found() + if cc.has_function('FT_Get_Var_Design_Coordinates', dependencies: ft_lib, + prefix: '''#include + #include FT_MULTIPLE_MASTERS_H''') + ft2_dep = ft_lib + endif + endif + endif + endif + + if not ft2_dep.found() + ft2_dep = dependency('freetype2', version: '>= 2.7.1', fallback : ['freetype2', 'freetype_dep']) + endif +endif + +if win32_enabled + # for GTK_IM_CONTEXT_IME + pangowin32_dep = dependency('pangowin32', fallback : ['pango', 'libpangowin32_dep']) +endif + +pangocairo_dep = dependency('pangocairo', version: cairo_req, + fallback : ['pango', 'libpangocairo_dep']) +pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_req, + fallback : ['gdk-pixbuf', 'gdkpixbuf_dep']) +epoxy_dep = dependency('epoxy', version: epoxy_req, + fallback: ['libepoxy', 'libepoxy_dep']) +atk_dep = dependency('atk', version: atk_req, + fallback : ['atk', 'libatk_dep']) + +# Update once Meson can have deps declared in a declarative manner or can +# find deps properly with CMake again +harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false) +xkbdep = dependency('xkbcommon', version: xkbcommon_req, required: wayland_enabled) +iso_codes_dep = dependency('iso-codes', required: false) + +fontconfig_dep = [] # only used in x11 backend +atkbridge_dep = [] # only used in x11 backend + +if os_win32 + platform_gio_dep = giowin32_dep +endif +if os_unix + platform_gio_dep = giounix_dep +endif + +# Remove once Meson is fixed to find deps properly with CMake or +# gains the ability to declare deps in a declarative manner +# Fallback for HarfBuzz +if cc.get_id() == 'msvc' and not harfbuzz_dep.found() + if cc.has_header('hb.h') + harfbuzz_dep = cc.find_library('harfbuzz', required : false) + endif +endif + +if not harfbuzz_dep.found() + harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false, + fallback: ['harfbuzz', 'libharfbuzz_dep']) +endif + +if iso_codes_dep.found() + cdata.set_quoted('ISO_CODES_PREFIX', iso_codes_dep.get_pkgconfig_variable('prefix')) +else + cdata.set_quoted('ISO_CODES_PREFIX', get_option('prefix')) +endif + +pc_gdk_extra_libs = [] + +cairo_found_type = cairo_dep.type_name() +if cairo_found_type == 'internal' + cairo_features = subproject('cairo').get_variable('built_features') +endif + +cairogobj_found_type = cairogobj_dep.type_name() + +cairo_backends = [] +foreach backend: [ ['cairo-xlib', cairo_req, x11_enabled], + ['cairo-win32', cairo_req, win32_enabled], + ['cairo-quartz', cairo_req, quartz_enabled], + ['cairo', cairo_req, broadway_enabled or wayland_enabled], ] + backend_enabled = backend.get(2) + cairo_backend_req = backend.get(1) + cairo_backend = backend.get(0) + if backend_enabled + if cairo_found_type == 'pkgconfig' + if dependency(cairo_backend, version: cairo_backend_req, required : cc.get_id() != 'msvc').found() + cairo_backends += cairo_backend + endif + elif cairo_found_type == 'internal' + foreach f: cairo_features + if f['name'] == cairo_backend + cairo_backends += cairo_backend + endif + endforeach + endif + endif +endforeach + +cairo_pkg_found = false +cairogobj_pkg_found = false + +if cairo_found_type == 'internal' or cairo_found_type == 'pkgconfig' + cairo_pkg_found = true +endif +if cairogobj_found_type == 'internal' or cairogobj_found_type == 'pkgconfig' + cairogobj_pkg_found = true +endif + +cairo_libs = [] + +cdata.set('HAVE_HARFBUZZ', harfbuzz_dep.found() ? 1 : false) +cdata.set('HAVE_PANGOFT', pangoft_dep.found() ? 1 : false) + +atk_pkgs = ['atk'] + +wayland_pkgs = [] +if wayland_enabled + wlclientdep = dependency('wayland-client', version: wayland_req) + wlprotocolsdep = dependency('wayland-protocols', version: wayland_proto_req) + wlcursordep = dependency('wayland-cursor', version: wayland_req) + wlegldep = dependency('wayland-egl') + + wayland_pkgs = [ + 'wayland-client', wayland_req, + 'wayland-protocols', wayland_proto_req, + 'xkbcommon', xkbcommon_req, + 'wayland-cursor', wayland_req, + 'wayland-egl', + ] +endif + +x11_pkgs = [] +if x11_enabled + xrandr_dep = dependency('xrandr', version: '>= 1.2.99') + xrandr15_dep = dependency('xrandr', version: '>= 1.5', required: false) + x11_dep = dependency('x11') + xrender_dep = dependency('xrender') + xi_dep = dependency('xi') + xext_dep = dependency('xext') + xcursor_dep = dependency('xcursor', required: false) + xdamage_dep = dependency('xdamage', required: false) + xfixes_dep = dependency('xfixes', required: false) + xcomposite_dep = dependency('xcomposite', required: false) + fontconfig_dep = dependency('fontconfig', fallback: ['fontconfig', 'fontconfig_dep']) + atkbridge_dep = dependency('atk-bridge-2.0', version: atk_req) + + x11_pkgs = ['fontconfig', 'x11', 'xext', 'xi', 'xrandr'] + + if xcursor_dep.found() + x11_pkgs += ['xcursor'] + endif + if xfixes_dep.found() + x11_pkgs += ['xfixes'] + endif + if xcomposite_dep.found() + x11_pkgs += ['xcomposite'] + endif + if xdamage_dep.found() + x11_pkgs += ['xdamage'] + endif + + atk_pkgs += ['atk-bridge-2.0'] + + cdata.set('HAVE_XDAMAGE', xdamage_dep.found() ? 1 : false) + cdata.set('HAVE_XCURSOR', xcursor_dep.found() ? 1 : false) + cdata.set('HAVE_XCOMPOSITE', xcomposite_dep.found() ? 1 : false) + cdata.set('HAVE_XFIXES', xfixes_dep.found() ? 1 : false) + + if cc.has_function('XkbQueryExtension', dependencies: x11_dep, + prefix : '#include ') + cdata.set('HAVE_XKB', 1) + endif + + if cc.has_function('XSyncQueryExtension', dependencies: xext_dep, + prefix: '''#include + #include ''') + cdata.set('HAVE_XSYNC', 1) + endif + + if cc.has_function('XGetEventData', dependencies: x11_dep) + cdata.set('HAVE_XGENERICEVENTS', 1) + endif + + if xi_dep.found() and cc.has_header('X11/extensions/XInput2.h', dependencies: xi_dep) + cdata.set('XINPUT_2', 1) + # Note that we also check that the XIScrollClassInfo struct is defined, + # because at least Ubuntu Oneiric seems to have XIAllowTouchEvents(), + # but not the XIScrollClassInfo struct + has_allow_touch_evens = cc.has_function('XIAllowTouchEvents', dependencies: xi_dep) + has_scroll_class_info = cc.has_member('XIScrollClassInfo', 'number', dependencies: xi_dep, + prefix: '''#include + #include ''') + if has_allow_touch_evens and has_scroll_class_info + cdata.set('XINPUT_2_2', 1) + endif + endif + + enable_xinerama = get_option('xinerama') + if enable_xinerama != 'no' + want_xinerama = enable_xinerama == 'yes' + xinerama_dep = dependency('xinerama', required: want_xinerama) + if xinerama_dep.found() and cc.has_header_symbol('X11/extensions/Xinerama.h', 'XineramaQueryExtension', dependencies: xinerama_dep) + cdata.set('HAVE_XFREE_XINERAMA', 1) + cdata.set('HAVE_XINERAMA', 1) + x11_pkgs += ['xinerama'] + endif + else + xinerama_dep = [] + endif + + cdata.set('HAVE_RANDR', xrandr_dep.found() ? 1 : false) + cdata.set('HAVE_RANDR15', xrandr15_dep.found() ? 1 : false) +endif + +if broadway_enabled + pc_gdk_extra_libs += ['-lz'] +endif + +if quartz_enabled + pc_gdk_extra_libs += ['-framework Cocoa', '-framework Carbon', '-framework CoreGraphics'] +endif + +extra_demo_ldflags = [] +if win32_enabled + pc_gdk_extra_libs += ['-lgdi32', '-limm32', '-lshell32', '-lole32'] + if cc.get_id() == 'msvc' + # Since the demo programs are now built as pure GUI programs, we + # need to pass in /entry:mainCRTStartup so that they will properly + # link on Visual Studio builds + extra_demo_ldflags = ['/entry:mainCRTStartup'] + else + pc_gdk_extra_libs += ['-Wl,-luuid'] + endif + pc_gdk_extra_libs += ['-lwinmm', '-ldwmapi', '-lsetupapi', '-lcfgmgr32'] + +# Check whether libepoxy is built with EGL support on Windows + win32_has_egl = cc.links( + ''' + #include + + int main(int argc, char *argv[]) { + return epoxy_egl_version (EGL_NO_DISPLAY); + } + ''', + dependencies : epoxy_dep, + name : 'libepoxy supports EGL on Windows' + ) + +endif + +# IMModules stuff-unfortunately we need to put items here +# as they can be built as modules or built directly into GTK +builtin_modules_opt = get_option('builtin_immodules') +if builtin_modules_opt == 'auto' + if os_win32 + # Current MSVC projects build all immodules directly into GTK by default, + # as does the mingw autotools build + message('IMModules are built into GTK for MSVC builds by default') + builtin_immodules = true + else + builtin_immodules = false + endif +elif builtin_modules_opt == 'yes' + builtin_immodules = true +else + builtin_immodules = false +endif + +proto_sources = [ + 'text-input-unstable-v3', + 'gtk-text-input', +] +proto_sources_outputs = [] + +foreach proto_name: proto_sources + if wayland_enabled + + wayland_scanner = find_program('wayland-scanner') + input_path = join_paths('modules', 'input', proto_name + '.xml') + sources = [] + sources += custom_target('@0@ client header'.format(proto_name), + input: input_path, + output: '@0@-client-protocol.h'.format(proto_name), + command: [ + wayland_scanner, + 'client-header', + '@INPUT@', '@OUTPUT@', + ]) + + sources += custom_target('@0@ source'.format(proto_name), + input: input_path, + output: '@0@-protocol.c'.format(proto_name), + command: [ + wayland_scanner, + 'private-code', + '@INPUT@', '@OUTPUT@', + ]) + proto_sources_outputs += [sources] + else + proto_sources_outputs += [[]] + endif +endforeach + +# Unfortunately it seems that we need to include the input module sources here, and build +# them in $(buildrootdir) if we are to build them included in GTK... +# Make sure the source listings are the same as in modules/input/Makefile.am +immodule_srcdir = 'modules/input/' +immodules = [ + [ 'am-et', files([ immodule_srcdir + 'imam-et.c' ]) ], + [ 'cedilla', files([ immodule_srcdir + 'imcedilla.c' ]) ], + [ 'cyrillic-translit', files([ immodule_srcdir + 'imcyrillic-translit.c' ]) ], + [ 'inuktitut', files([ immodule_srcdir + 'iminuktitut.c' ]) ], + [ 'ipa', files([ immodule_srcdir + 'imipa.c' ]) ], + [ 'multipress', files( [ immodule_srcdir + 'gtkimcontextmultipress.c', immodule_srcdir + 'immultipress.c' ]), true, + ['-DMULTIPRESS_LOCALEDIR="@0@"'.format(gtk_mplocaledir), + '-DMULTIPRESS_CONFDIR="@0@/gtk-3.0"'.format(gtk_sysconfdir)] ], + [ 'thai', files([ immodule_srcdir + 'thai-charprop.c', immodule_srcdir + 'gtkimcontextthai.c', immodule_srcdir + 'imthai.c' ]) ], + [ 'ti-er', files([ immodule_srcdir + 'imti-er.c' ]) ], + [ 'ti-et', files([ immodule_srcdir + 'imti-et.c' ]) ], + [ 'viqr', files([ immodule_srcdir + 'imviqr.c' ]) ], + [ 'broadway', files([ immodule_srcdir + 'imbroadway.c' ]), broadway_enabled ], + [ 'ime', files([ immodule_srcdir + 'gtkimcontextime.c', immodule_srcdir + 'imime.c' ]), win32_enabled ], + [ 'quartz', files([ immodule_srcdir + 'imquartz.c' ]), quartz_enabled, '-xobjective-c' ], + [ 'wayland', files([ immodule_srcdir + 'imwayland.c' ]) + proto_sources_outputs[0], wayland_enabled ], + [ 'waylandgtk', files([ immodule_srcdir + 'imwaylandgtk.c']) + proto_sources_outputs[1], wayland_enabled ], + [ 'xim', files([ immodule_srcdir + 'gtkimcontextxim.c', immodule_srcdir + 'imxim.c' ]), x11_enabled ], +] + +install_data(join_paths(immodule_srcdir, 'im-multipress.conf'), install_dir: join_paths(gtk_sysconfdir, 'gtk-3.0')) + +# Check for bind_textdomain_codeset, including -lintl if GLib brings it in by +# doing the same check as glib. We can't check that by linking to glib because +# it might be a subproject and hence not built yet. +if cc.has_function('ngettext') + libintl_dep = [] + cdata.set('HAVE_BIND_TEXTDOMAIN_CODESET', 1) +else + libintl_dep = cc.find_library('intl', required : false) + if cc.has_function('bind_textdomain_codeset', dependencies: libintl_dep) + cdata.set('HAVE_BIND_TEXTDOMAIN_CODESET', 1) + else + # Don't use subproject('proxy-libintl').get_variable('intl_dep') because that + # makes the dependency unconditional. This way, people have the option of + # either not providing the subproject or disabling it entirely with + # --wrap-mode=nodownload or nofallback. + libintl_dep = dependency('', required : false, + fallback: ['proxy-libintl', 'intl_dep']) + if libintl_dep.found() + cdata.set('HAVE_BIND_TEXTDOMAIN_CODESET', 1) + endif + endif +endif + +if os_win32 + if cc.has_header_symbol('windows.h', 'IPrintDialogCallback') + cdata.set('HAVE_IPRINTDIALOGCALLBACK', 1) + endif + + dvot_size = cc.sizeof('DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY', prefix : ''' + #define _WIN32_WINNT 0x601 + #include + ''') + cdata.set('SIZEOF_DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY', dvot_size) + + getdevprop_code = ''' + #define _WIN32_WINNT 0x0600 + #include + #include + #include + + int main(int argc, char *argv[]) { + return SetupDiGetDevicePropertyW(NULL, NULL, NULL, NULL, NULL, 0, NULL, 0); + } + ''' + result = cc.links(getdevprop_code, args: ['-lsetupapi'], name: 'has SetupDiGetDevicePropertyW') + cdata.set('HAVE_SETUP_DI_GET_DEVICE_PROPERTY_W', result ? 1 : false) +endif + +have_gio_unix = false +if os_unix + have_gio_unix = giounix_dep.found() + cdata.set('HAVE_GIO_UNIX', have_gio_unix ? 1 : false) +endif + +cloudproviders_enabled = get_option('cloudproviders') +cloudproviders_packages = [] +if cloudproviders_enabled + cloudproviders_dep = dependency('cloudproviders', version: cloudproviders_req, required: true) + if cloudproviders_dep.found() + cloudproviders_packages += ['cloudproviders', cloudproviders_req] + cdata.set('HAVE_CLOUDPROVIDERS', cloudproviders_dep.found() ? 1 : false) + else + error('Cloudproviders support not found, but was explicitly requested.') + endif +endif + +build_gir = get_option('introspection') +subdir('gdk') +subdir('gtk') +subdir('modules') +subdir('libgail-util') +if get_option('demos') + subdir('demos') +endif +if get_option('tests') + subdir('tests') + subdir('testsuite') +endif +if get_option('examples') + subdir('examples') +endif + +# config.h +configure_file(input: 'config.h.meson', + output: 'config.h', + configuration: cdata) + +# pkg-config files - bit of a mess all of this +pkgconf = configuration_data() + +pkgconf.set('prefix', get_option('prefix')) +pkgconf.set('exec_prefix', '${prefix}') +pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir'))) +pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir'))) +pkgconf.set('GTK_API_VERSION', gtk_api_version) +pkgconf.set('VERSION', meson.project_version()) +pkgconf.set('GTK_BINARY_VERSION', gtk_binary_version) +pkgconf.set('host', '@0@-@1@'.format(host_machine.cpu_family(), host_machine.system())) # FIXME + +# Requires +pango_pkgname = win32_enabled ? 'pangowin32' : 'pango' +gdk_packages = ' '.join([ pango_pkgname, pango_req, + 'pangocairo', pango_req, + 'gdk-pixbuf-2.0', gdk_pixbuf_req ]) + +cairo_packages = '' + +if cairo_pkg_found + cairo_packages += ' '.join([ ' cairo', cairo_req ]) +elif cc.get_id() == 'msvc' and cairo_dep.found() + cairo_packages += ' '.join([ ' -lcairo' ]) +endif +if cairogobj_pkg_found + cairo_packages += ' '.join([ ' cairo-gobject', cairo_req ]) +elif cc.get_id() == 'msvc' and cairogobj_dep.found() + cairo_packages += ' '.join([ ' -lcairo-gobject' ]) +endif + +gdk_packages += cairo_packages +pkgconf.set('GDK_PACKAGES', gdk_packages) + +if have_gio_unix + gio_packages = ['gio-unix-2.0', glib_req] +else + gio_packages = ['gio-2.0', glib_req] +endif + +pkgconf.set('GDK_PRIVATE_PACKAGES', + ' '.join(gio_packages + x11_pkgs + wayland_pkgs + cairo_backends + + ['epoxy', epoxy_req] + cloudproviders_packages + + ['fribidi', fribidi_req])) + +gtk_packages = ' '.join([ + atk_dep.name(), atk_req, + cairo_packages, + pixbuf_dep.name(), gdk_pixbuf_req, + 'gio-2.0', glib_req, +]) +pkgconf.set('GTK_PACKAGES', gtk_packages) + +# Requires.private +pc_gdk_extra_libs += cairo_libs + +gtk_private_packages = atk_pkgs + wayland_pkgs + ['epoxy', epoxy_req, 'fribidi', fribidi_req] +if wayland_enabled or x11_enabled + gtk_private_packages += ['pangoft2'] +endif +gtk_private_packages += gio_packages + +pkgconf.set('GTK_PRIVATE_PACKAGES', ' '.join(gtk_private_packages)) + +pkgconf.set('GDK_EXTRA_LIBS', ' '.join(pc_gdk_extra_libs)) +pkgconf.set('GSK_EXTRA_LIBS', '') +pkgconf.set('GTK_EXTRA_LIBS', '') + +pkgconf.set('GDK_EXTRA_CFLAGS', '') +pkgconf.set('GSK_EXTRA_CFLAGS', '') +pkgconf.set('GTK_EXTRA_CFLAGS', '') + +pkg_install_dir = join_paths(get_option('libdir'), 'pkgconfig') + +gtk_pcs = ['gtk+-3.0.pc'] +gdk_pcs = ['gdk-3.0.pc'] + +pkg_targets = '' +foreach backend: [ 'broadway', 'quartz', 'wayland', 'win32', 'x11', ] + if get_variable('@0@_enabled'.format(backend)) + gtk_pcs += ['gtk+-@0@-3.0.pc'.format(backend)] + gdk_pcs += ['gdk-@0@-3.0.pc'.format(backend)] + pkg_targets += ' ' + backend + endif +endforeach +pkgconf.set('GDK_BACKENDS', pkg_targets.strip()) + +configure_file(input: 'gail-3.0.pc.in', + output: 'gail-3.0.pc', + configuration: pkgconf, + install_dir: pkg_install_dir) + +foreach pkg: gdk_pcs + configure_file(input: 'gdk-3.0.pc.in', + output: pkg, + configuration: pkgconf, + install_dir: pkg_install_dir) +endforeach + +foreach pkg: gtk_pcs + configure_file(input: 'gtk+-3.0.pc.in', + output: pkg, + configuration: pkgconf, + install_dir: pkg_install_dir) +endforeach + +if os_unix + configure_file(input: 'gtk+-unix-print-3.0.pc.in', + output: 'gtk+-unix-print-3.0.pc', + configuration: pkgconf, + install_dir: pkg_install_dir) +endif + +subdir('po') +subdir('po-properties') +subdir('docs/tools') +subdir('docs/reference') + +install_data('m4macros/gtk-3.0.m4', install_dir: join_paths(get_option('datadir'), 'aclocal')) + +# Keep this in sync with post-install.py expected arguments +meson.add_install_script('build-aux/meson/post-install.py', + gtk_api_version, + gtk_binary_version, + join_paths(gtk_prefix, get_option('bindir')), + gtk_libdir, + gtk_datadir) + +summary = [ + '', + '------', + 'GTK+ @0@ (@1@)'.format(gtk_version, gtk_api_version), + '', + ' Display backends: @0@'.format(pkg_targets.strip()), + ' Print backends: @0@'.format(' '.join(print_backends)), + ' Cloud support: @0@'.format(get_option('cloudproviders')), + ' Colord support: @0@'.format(get_option('colord')), + ' Introspection: @0@'.format(get_option('introspection')), + ' Documentation: @0@'.format(get_option('gtk_doc')), + ' Man pages: @0@'.format(get_option('man')), + ' Build tests: @0@'.format(get_option('tests')), + ' Demos: @0@'.format(get_option('demos')), + ' Examples: @0@'.format(get_option('examples')), + 'Directories:', + ' prefix: @0@'.format(gtk_prefix), + ' includedir: @0@'.format(gtk_includedir), + ' libdir: @0@'.format(gtk_libdir), + ' datadir: @0@'.format(gtk_datadir), + '------', + '' +] + +message('\n'.join(summary)) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000000..5b30c29aa6 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,43 @@ +# GDK backends +option('x11_backend', type: 'boolean', value: true, + description : 'Enable the X11 gdk backend (only when building on Unix)') +option('wayland_backend', type: 'boolean', value: true, + description : 'Enable the wayland gdk backend (only when building on Unix except for macOS)') +option('broadway_backend', type: 'boolean', value: false, + description : 'Enable the broadway (HTML5) gdk backend') +option('win32_backend', type: 'boolean', value: true, + description : 'Enable the Windows gdk backend (only when building on Windows)') +option('quartz_backend', type: 'boolean', value: true, + description : 'Enable the macOS gdk backend (only when building on macOS)') + +# Optional dependencies +option('xinerama', type: 'combo', choices : ['yes', 'no', 'auto'], value : 'auto', + description : 'Enable support for the Xinerama extension') +option('cloudproviders', type: 'boolean', value: false, + description : 'Enable the cloudproviders support') + +# Print backends +option('print_backends', type : 'string', value : 'auto', + description : 'Build the specified print backends (comma-separated list, any of "cloudprint,cups,file,lpr,papi,test" or "auto")') +option('colord', type: 'combo', choices : ['yes', 'no', 'auto'], value : 'auto', + description : 'Build colord support for the CUPS printing backend') + +# Documentation and introspection +option('gtk_doc', type: 'boolean', value: 'false', + description : 'Build API reference with gtk-doc') +option('man', type: 'boolean', value: 'false', + description : 'Build man pages for installed tools') +option('introspection', type: 'boolean', value: 'true', + description : 'Build introspection data (requires gobject-introspection)') + +# Demos and binaries +option('demos', type: 'boolean', value: 'true', + description : 'Build demo programs') +option('examples', type: 'boolean', value: 'true', + description : 'Build examples') +option('tests', type: 'boolean', value: 'true', + description : 'Build tests') + +# input modules +option('builtin_immodules', type: 'combo', choices : ['yes', 'no', 'auto'], + value: 'auto', description: 'Build immodules into GTK so/DLL') diff --git a/modules/Makefile.am b/modules/Makefile.am index f8e7bb8797..b8dc2eea59 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -6,4 +6,7 @@ if OS_UNIX SUBDIRS += printbackends endif +EXTRA_DIST += \ + meson.build + -include $(top_srcdir)/git.mk diff --git a/modules/input/Makefile.am b/modules/input/Makefile.am index ce394632ee..631e580ca4 100644 --- a/modules/input/Makefile.am +++ b/modules/input/Makefile.am @@ -307,7 +307,11 @@ BUILT_SOURCES = $(protocol_built_sources) $(protocol_built_sources_gtk) EXTRA_DIST += $(protocol_built_sources) $(protocol_built_sources_gtk) endif -EXTRA_DIST += README.multipress +EXTRA_DIST += \ + README.multipress \ + meson.build \ + text-input-unstable-v3.xml \ + gtk-text-input.xml CLEANFILES = immodules.cache diff --git a/modules/input/meson.build b/modules/input/meson.build new file mode 100644 index 0000000000..09625a93c1 --- /dev/null +++ b/modules/input/meson.build @@ -0,0 +1,20 @@ + +# Note: the list of immodules is in $(srcroot)/meson.build! + +foreach l: immodules + name = l[0] + immod_sources = l[1] + cond = l.get(2, true) + cflags = l.get(3, []) + + if cond and not builtin_immodules + shared_module('im-@0@'.format(name), + immod_sources, + c_args: common_cflags + cflags, + dependencies: [ libgtk_dep ], + install_dir: '@0@/gtk-@1@/@2@/immodules/'.format(gtk_libdir, gtk_api_version, gtk_binary_version), + include_directories: [confinc, gtkinc], + install : true, + name_prefix: '') + endif +endforeach diff --git a/modules/meson.build b/modules/meson.build new file mode 100644 index 0000000000..1ae93fdaf7 --- /dev/null +++ b/modules/meson.build @@ -0,0 +1,2 @@ +subdir('input') +subdir('printbackends') diff --git a/modules/printbackends/Makefile.am b/modules/printbackends/Makefile.am index 7d6680dffb..f292fea851 100644 --- a/modules/printbackends/Makefile.am +++ b/modules/printbackends/Makefile.am @@ -20,4 +20,7 @@ endif DIST_SUBDIRS = cloudprint cups file lpr test papi +EXTRA_DIST += \ + meson.build + -include $(top_srcdir)/git.mk diff --git a/modules/printbackends/meson.build b/modules/printbackends/meson.build new file mode 100644 index 0000000000..3f4dfd13f1 --- /dev/null +++ b/modules/printbackends/meson.build @@ -0,0 +1,177 @@ +# Print backend config: 'auto' means all backends we have dependencies for, +# the specific backend names mean we should fail if dependencies are missing +all_print_backends = [ + 'cloudprint', + 'cups', + 'file', + 'lpr', + 'papi', + 'test', +] + +auto_print_backends = [] +foreach backend: all_print_backends + if backend != 'test' and os_unix + auto_print_backends += backend + endif +endforeach + +print_strict_deps = true +if get_option('print_backends') == 'auto' + enabled_print_backends = auto_print_backends + print_strict_deps = false +else + wanted_print_backends = get_option('print_backends').split(',') + enabled_print_backends = [] + foreach backend: wanted_print_backends + if backend != '' + if not all_print_backends.contains(backend) + error('print backend \'@0@\' unknown'.format(backend)) + endif + enabled_print_backends += backend + endif + endforeach +endif + +print_backends = [] + +if not enabled_print_backends.contains('file') + if os_unix + error('\'file\' print backed needs to be enabled') + endif +else + print_backends += ['file'] +endif + +if enabled_print_backends.contains('lpr') + print_backends += ['lpr'] +endif + +if enabled_print_backends.contains('test') + print_backends += ['test'] +endif + +if enabled_print_backends.contains('papi') + # TODO + if print_strict_deps + error('\'papi\' backend not supported with meson yet') + endif +endif + +if enabled_print_backends.contains('cloudprint') + rest_dep = dependency('rest-0.7', required : print_strict_deps) + json_glib_dep = dependency('json-glib-1.0', required : print_strict_deps) + if rest_dep.found() and json_glib_dep.found() + print_backends += ['cloudprint'] + else + message('\'cloudprint\' backend disabled: missing dependencies') + endif +endif + +if enabled_print_backends.contains('cups') + cups_error = '' + if cc.has_header('cups/cups.h') + cups_major_version = cc.compute_int('CUPS_VERSION_MAJOR', prefix : '#include ') + cups_minor_version = cc.compute_int('CUPS_VERSION_MINOR', prefix : '#include ') + message('Found CUPS version: @0@.@1@'.format(cups_major_version, cups_minor_version)) + if cups_major_version > 1 or cups_minor_version >= 2 + if cups_major_version > 1 or cups_minor_version >= 6 + cdata.set('HAVE_CUPS_API_1_6', 1) + endif + + if cc.compiles('#include \n http_t http; char *s = http.authstring;') + cdata.set('HAVE_HTTP_AUTHSTRING', 1, + description :'Define if cups http_t authstring field is accessible') + endif + libcups = cc.find_library('cups', required : true) + if libcups.found() and cc.has_function('httpGetAuthString', dependencies : libcups) + cdata.set('HAVE_HTTPGETAUTHSTRING', 1) + endif + else + cups_error = 'Need CUPS version >= 1.2' + endif + else + cups_error = 'Cannot find CUPS headers in default prefix.' + endif + + enable_colord = get_option('colord') + if enable_colord != 'no' + want_colord = enable_colord == 'yes' + colord_dep = dependency('colord', version: '>= 0.1.9', required: want_colord) + cdata.set('HAVE_COLORD', colord_dep.found() ? 1 : false) + else + cups_colord_dep = [] + endif + + if cups_error != '' + if print_strict_deps + error(cups_error) + else + message(cups_error) + endif + else + print_backends += ['cups'] + endif +endif + +cdata.set_quoted('GTK_PRINT_BACKENDS', ','.join(print_backends)) + +# Building + +printbackends_args = [ + '-DGTK_COMPILATION', + '-DGTK_DISABLE_DEPRECATION_WARNINGS', + '-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED', +] +printbackends_subdir = 'gtk-3.0/@0@/printbackends'.format(gtk_binary_version) +printbackends_install_dir = join_paths(get_option('libdir'), printbackends_subdir) + +if print_backends.contains('file') + shared_module('printbackend-file', + 'file/gtkprintbackendfile.c', + c_args: printbackends_args, + dependencies: libgtk_dep, + install_dir: printbackends_install_dir, + install : true) +endif + +if print_backends.contains('lpr') + shared_module('printbackend-lpr', + 'lpr/gtkprintbackendlpr.c', + c_args: printbackends_args, + dependencies: libgtk_dep, + install_dir: printbackends_install_dir, + install : true) +endif + +if print_backends.contains('test') + shared_module('printbackend-test', + 'test/gtkprintbackendtest.c', + c_args: printbackends_args, + dependencies: libgtk_dep, + install_dir: printbackends_install_dir, + install : true) +endif + +if print_backends.contains('cloudprint') + shared_module('printbackend-cloudprint', + 'cloudprint/gtkprintbackendcloudprint.c', + 'cloudprint/gtkprintercloudprint.c', + 'cloudprint/gtkcloudprintaccount.c', + c_args: printbackends_args, + dependencies: [ libgtk_dep, rest_dep, json_glib_dep ], + install_dir: printbackends_install_dir, + install : true) +endif + +if print_backends.contains('cups') + shared_module('printbackend-cups', + 'cups/gtkprintbackendcups.c', + 'cups/gtkprintercups.c', + 'cups/gtkcupsutils.c', + 'cups/gtkcupssecretsutils.c', + c_args: printbackends_args, + dependencies: [libgtk_dep, libcups, colord_dep], + install_dir: printbackends_install_dir, + install : true) +endif diff --git a/po-properties/meson.build b/po-properties/meson.build new file mode 100644 index 0000000000..4029453cea --- /dev/null +++ b/po-properties/meson.build @@ -0,0 +1,3 @@ +i18n = import('i18n') + +i18n.gettext('gtk30-properties', preset : 'glib') diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 0000000000..ed71667aa6 --- /dev/null +++ b/po/meson.build @@ -0,0 +1,3 @@ +i18n = import('i18n') + +i18n.gettext('gtk30', preset : 'glib') diff --git a/subprojects/atk.wrap b/subprojects/atk.wrap new file mode 100644 index 0000000000..8666a3a1ab --- /dev/null +++ b/subprojects/atk.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=atk +url=https://gitlab.gnome.org/GNOME/atk.git +push-url=git@gitlab.gnome.org:GNOME/atk.git +revision=master diff --git a/subprojects/cairo.wrap b/subprojects/cairo.wrap new file mode 100644 index 0000000000..26d5ade52b --- /dev/null +++ b/subprojects/cairo.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=cairo +url=https://github.com/centricular/cairo.git +push-url=git@github.com:centricular/cairo.git +revision=meson diff --git a/subprojects/expat.wrap b/subprojects/expat.wrap new file mode 100644 index 0000000000..dbe23cbc85 --- /dev/null +++ b/subprojects/expat.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = expat-2.2.5 + +source_url = https://github.com/libexpat/libexpat/releases/download/R_2_2_5/expat-2.2.5.tar.bz2 +source_filename = expat-2.2.5.tar.bz2 +source_hash = d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6 + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/expat/2.2.5/5/get_zip +patch_filename = expat-2.2.5-5-wrap.zip +patch_hash = 95e02942b13ebe237494419c0f7d56d99b8b4e0a2dc04002e055b2325c960e11 diff --git a/subprojects/fontconfig.wrap b/subprojects/fontconfig.wrap new file mode 100644 index 0000000000..083a49d6ad --- /dev/null +++ b/subprojects/fontconfig.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=fontconfig +url=https://github.com/centricular/fontconfig.git +push-url=git@github.com:centricular/fontconfig.git +revision=meson diff --git a/subprojects/freetype2.wrap b/subprojects/freetype2.wrap new file mode 100644 index 0000000000..3151539c8b --- /dev/null +++ b/subprojects/freetype2.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=freetype2 +url=https://github.com/centricular/freetype2.git +push-url=git@github.com:centricular/freetype2.git +revision=meson diff --git a/subprojects/fribidi.wrap b/subprojects/fribidi.wrap new file mode 100644 index 0000000000..8d4e4bf437 --- /dev/null +++ b/subprojects/fribidi.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=fribidi +url=https://github.com/fribidi/fribidi.git +push-url=git@github.com:fribidi/fribidi.git +revision=master diff --git a/subprojects/gdk-pixbuf.wrap b/subprojects/gdk-pixbuf.wrap new file mode 100644 index 0000000000..a0d4a40c92 --- /dev/null +++ b/subprojects/gdk-pixbuf.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=gdk-pixbuf +url=https://gitlab.gnome.org/GNOME/gdk-pixbuf.git +push-url=git@gitlab.gnome.org:GNOME/gdk-pixbuf.git +revision=master diff --git a/subprojects/glib.wrap b/subprojects/glib.wrap new file mode 100644 index 0000000000..87021ae4d9 --- /dev/null +++ b/subprojects/glib.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=glib +url=https://gitlab.gnome.org/GNOME/glib.git +push-url=git@gitlab.gnome.org:GNOME/glib.git +revision=master diff --git a/subprojects/harfbuzz.wrap b/subprojects/harfbuzz.wrap new file mode 100644 index 0000000000..cc0a89d699 --- /dev/null +++ b/subprojects/harfbuzz.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=harfbuzz +url=https://github.com/centricular/harfbuzz.git +push-url=git@github.com:centricular/harfbuzz.git +revision=meson diff --git a/subprojects/libcroco.wrap b/subprojects/libcroco.wrap new file mode 100644 index 0000000000..fb70ac0833 --- /dev/null +++ b/subprojects/libcroco.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=libcroco +url=https://gitlab.gnome.org/GNOME/libcroco.git +push-url=git@gitlab.gnome.org:GNOME/libcroco.git +revision=wip/meson diff --git a/subprojects/libepoxy.wrap b/subprojects/libepoxy.wrap new file mode 100644 index 0000000000..e8b082e7e0 --- /dev/null +++ b/subprojects/libepoxy.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=libepoxy +url=https://github.com/anholt/libepoxy.git +push-url=git@github.com:anholt/libepoxy.git +revision=meson diff --git a/subprojects/libffi.wrap b/subprojects/libffi.wrap new file mode 100644 index 0000000000..876491c7da --- /dev/null +++ b/subprojects/libffi.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=libffi +url=https://github.com/centricular/libffi.git +push-url=git@github.com:centricular/libffi.git +revision=meson diff --git a/subprojects/libpng.wrap b/subprojects/libpng.wrap new file mode 100644 index 0000000000..519b1170a2 --- /dev/null +++ b/subprojects/libpng.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = libpng-1.6.34 + +source_url = ftp://ftp-osl.osuosl.org/pub/libpng/src/libpng16/libpng-1.6.34.tar.xz +source_filename = libpng-1.6.34.tar.xz +source_hash = 2f1e960d92ce3b3abd03d06dfec9637dfbd22febf107a536b44f7a47c60659f6 + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/libpng/1.6.35/4/get_zip +patch_filename = libpng-1.6.35-4-wrap.zip +patch_hash = 0cd6ca9e8959b9c720c25d67bbf9315ec115bfc74ea4d34ea569619f4cff986f diff --git a/subprojects/librsvg.wrap b/subprojects/librsvg.wrap new file mode 100644 index 0000000000..384d2b3687 --- /dev/null +++ b/subprojects/librsvg.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=librsvg +url=https://gitlab.gnome.org/nirbheek/librsvg.git +push-url=git@gitlab.gnome.org:nirbheek/librsvg.git +revision=wip/meson-2-40 diff --git a/subprojects/libxml2.wrap b/subprojects/libxml2.wrap new file mode 100644 index 0000000000..486912dabd --- /dev/null +++ b/subprojects/libxml2.wrap @@ -0,0 +1,9 @@ +[wrap-file] +directory = libxml2-2.9.7 + +source_url = ftp://xmlsoft.org/libxml2/libxml2-2.9.7.tar.gz +source_filename = libxml2-2.9.7.tar.gz +source_hash = f63c5e7d30362ed28b38bfa1ac6313f9a80230720b7fb6c80575eeab3ff5900c +patch_url = https://wrapdb.mesonbuild.com/v1/projects/libxml2/2.9.7/5/get_zip +patch_filename = libxml2-2.9.7-5-wrap.zip +patch_hash = aed5d6719eb96da0fb3cf284d88c4af486fd6b7754aec40b2be9a5ffd9ecadab diff --git a/subprojects/pango.wrap b/subprojects/pango.wrap new file mode 100644 index 0000000000..1de4db3c14 --- /dev/null +++ b/subprojects/pango.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=pango +url=https://gitlab.gnome.org/GNOME/pango.git +push-url=git@gitlab.gnome.org:GNOME/pango.git +revision=master diff --git a/subprojects/pixman.wrap b/subprojects/pixman.wrap new file mode 100644 index 0000000000..5e9d2f4caa --- /dev/null +++ b/subprojects/pixman.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=pixman +url=https://github.com/centricular/pixman.git +push-url=git@github.com:centricular/pixman.git +revision=meson diff --git a/subprojects/proxy-libintl.wrap b/subprojects/proxy-libintl.wrap new file mode 100644 index 0000000000..b53c8f7c39 --- /dev/null +++ b/subprojects/proxy-libintl.wrap @@ -0,0 +1,4 @@ +[wrap-git] +directory=proxy-libintl +url=https://github.com/frida/proxy-libintl.git +revision=0.1 diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap new file mode 100644 index 0000000000..6aff13ff3f --- /dev/null +++ b/subprojects/zlib.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = zlib-1.2.11 + +source_url = https://zlib.net/fossils/zlib-1.2.11.tar.gz +source_filename = zlib-1.2.11.tar.gz +source_hash = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/3/get_zip +patch_filename = zlib-1.2.11-3-wrap.zip +patch_hash = f07dc491ab3d05daf00632a0591e2ae61b470615b5b73bcf9b3f061fff65cff0 diff --git a/tests/Makefile.am b/tests/Makefile.am index 7c5ca99b57..ee1e8b5064 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -573,6 +573,7 @@ EXTRA_DIST += \ mydialog.ui \ mydialog2.ui \ popover.ui \ - selectionmode.ui + selectionmode.ui \ + meson.build -include $(top_srcdir)/git.mk diff --git a/tests/animated-resizing.c b/tests/animated-resizing.c index d11d6e0dee..fbafe97c6d 100644 --- a/tests/animated-resizing.c +++ b/tests/animated-resizing.c @@ -1,9 +1,9 @@ /* -*- mode: C; c-basic-offset: 2; indent-tabs-mode: nil; -*- */ #include -#include #include +#include "gtk/fallback-c89.c" #include "frame-stats.h" #define RADIUS 64 diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 0000000000..586fe2f45e --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,156 @@ +gtk_tests = [ + # testname, optional extra sources + ['animated-resizing', ['frame-stats.c', 'variable.c']], + ['animated-revealing', ['frame-stats.c', 'variable.c']], + ['scrolling-performance', ['frame-stats.c', 'variable.c']], + ['blur-performance', ['../gtk/gtkcairoblur.c']], + ['flicker'], + ['gdkgears', ['gtkgears.c']], + ['listmodel'], + ['motion-compression'], + ['styleexamples'], + ['overlayscroll'], + ['print-editor'], + ['simple'], + ['subsurface'], + ['syncscroll'], + ['testaccel'], + ['testactionbar'], + ['testactions'], + ['testadjustsize'], + ['testanimation'], + ['testappchooserbutton'], + ['testappchooser'], + ['testassistant'], + ['testbaseline'], + ['testbbox'], + ['testbox'], + ['testboxcss'], + ['testbuttons'], + ['testcairo'], + ['testcalendar'], + ['testcellarea'], + ['testcellrenderertext'], + ['testclipboard'], + ['testcolorchooser'], + ['testcombo'], + ['testcombochange'], + ['testdialog'], + ['testdnd'], + ['testellipsise'], + ['testemblems'], + ['testentrycompletion'], + ['testentryicons'], + ['testexpand'], + ['testexpander'], + ['testfilechooserbutton'], + ['testfilechooser'], + ['testflowbox'], + ['testfontchooser'], + ['testfontoptions'], + ['testfontselection'], + ['testfontselectiondialog'], + ['testframe'], + ['testfullscreen'], + ['testgeometry'], + ['testgiconpixbuf'], + ['testglblending', ['gtkgears.c']], + ['testgmenu'], + ['testgrid'], + ['testgrouping'], + ['testgtk'], + ['testheaderbar'], + ['testheightforwidth'], + ['testicontheme'], + ['testiconview'], + ['testimage'], + ['testinput'], + ['testkineticscrolling'], + ['testlevelbar'], + ['testlist'], + ['testlockbutton'], + ['testlogout'], + ['testmenubutton'], + ['testmerge'], + ['testmountoperation'], + ['testmultidisplay'], + ['testnoscreen'], + ['testnotebookdnd'], + ['testnouiprint'], + ['testnumerableicon'], + ['testoffscreen', ['gtkoffscreenbox.c']], + ['testoffscreenwindow'], + ['testorientable'], + ['testoverlay'], + ['testoverlaystyleclass'], + ['testpopover'], + ['testpopupat'], + ['testpopup'], + ['testprint', ['testprintfileoperation.c']], + ['testrecentchooser'], + ['testrecentchoosermenu'], + ['testrevealer'], + ['testrichtext'], + ['testscale'], + ['testscrolledge'], + ['testscrolledwindow'], + ['testselection'], + ['testselectionmode'], + ['testsensitive'], + ['testspinbutton'], + ['testsplitheaders'], + ['teststack'], + ['teststatusicon'], + ['teststockbuttonmenu'], + ['testswitch'], + ['testtextview'], + ['testtitlebar'], + ['testtoolbar'], + ['testtooltips'], + ['testtoplevelembed'], + ['testtreechanging'], + ['testtreecolumns'], + ['testtreecolumnsizing'], + ['testtreednd'], + ['testtreeedit'], + ['testtreeflow'], + ['testtreefocus'], + ['testtreemenu'], + ['testtreemodel'], + ['testtreepos'], + ['testtreesort'], + ['testtreeview'], + ['testverticalcells'], + ['testvolumebutton'], + ['testwindows'], + ['testwindowsize'], + ['testxinerama'], + ['treestoretest'], + ['video-timer', ['variable.c']], +] + +# Conditionally compiled tests +if x11_enabled + gtk_tests += [ + ['testsocket', ['testsocket_common.c']], + ['testsocket_child', ['testsocket_common.c']], + ] +endif + +if os_linux + gtk_tests += [['testfontchooserdialog']] +endif + +# Pass the source dir here so programs can change into the source directory +# and find .ui files and .png files and such that they load at runtime +test_args = ['-DGTK_SRCDIR="@0@"'.format(meson.current_source_dir())] + +foreach t: gtk_tests + test_name = t.get(0) + test_srcs = ['@0@.c'.format(test_name), t.get(1, [])] + executable(test_name, test_srcs, + c_args: test_args, + dependencies: [libgtk_dep, libm]) +endforeach + +subdir('visuals') diff --git a/tests/testanimation.c b/tests/testanimation.c index 356b8827d2..8bd43a6c66 100644 --- a/tests/testanimation.c +++ b/tests/testanimation.c @@ -19,11 +19,14 @@ #include "config.h" #include #include -#include #include #include #include +#ifndef G_OS_WIN32 +# include +#endif + typedef struct _LoadContext LoadContext; struct _LoadContext diff --git a/tests/testbaseline.c b/tests/testbaseline.c index 3e6965bfaa..a9581f727a 100644 --- a/tests/testbaseline.c +++ b/tests/testbaseline.c @@ -99,12 +99,12 @@ main (int argc, for (j = 0; j < 2; j++) { - hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 5); - char *aligns_names[] = { "FILL", "BASELINE" }; GtkAlign aligns[] = { GTK_ALIGN_FILL, GTK_ALIGN_BASELINE}; + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 5); + label = gtk_label_new (aligns_names[j]); gtk_container_add (GTK_CONTAINER (hbox), label); diff --git a/tests/testspinbutton.c b/tests/testspinbutton.c index 14eafdff47..d0925335d0 100644 --- a/tests/testspinbutton.c +++ b/tests/testspinbutton.c @@ -56,12 +56,13 @@ prepare_window_for_orientation (GtkOrientation orientation) 0.0); GtkWidget *spin = gtk_spin_button_new (adj, 1.0, 0); + GtkWidget *hbox; gtk_orientable_set_orientation (GTK_ORIENTABLE (spin), orientation); gtk_widget_set_halign (GTK_WIDGET (spin), GTK_ALIGN_CENTER); g_object_bind_property (wrap_button, "active", spin, "wrap", G_BINDING_SYNC_CREATE); - GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (GTK_BOX (hbox), spin, FALSE, FALSE, 2); gtk_container_add (GTK_CONTAINER (mainbox), hbox); } diff --git a/tests/video-timer.c b/tests/video-timer.c index bc5de1e5fe..cd137eec60 100644 --- a/tests/video-timer.c +++ b/tests/video-timer.c @@ -237,11 +237,12 @@ collect_old_frames (void) for (l = past_frames; l; l = l_next) { FrameData *frame_data = l->data; + GdkFrameTimings *timings; gboolean remove = FALSE; l_next = l->next; - GdkFrameTimings *timings = gdk_frame_clock_get_timings (frame_clock, - frame_data->frame_counter); + timings = gdk_frame_clock_get_timings (frame_clock, + frame_data->frame_counter); if (timings == NULL) { remove = TRUE; diff --git a/tests/visuals/Makefile.am b/tests/visuals/Makefile.am index 8250de6df0..6ea2e4a67e 100644 --- a/tests/visuals/Makefile.am +++ b/tests/visuals/Makefile.am @@ -31,6 +31,7 @@ EXTRA_DIST = \ linked-buttons-vertical.ui \ osd-toolbars.ui \ primary-toolbar.ui \ - suggested-action-buttons.ui + suggested-action-buttons.ui \ + meson.build -include $(top_srcdir)/git.mk diff --git a/tests/visuals/meson.build b/tests/visuals/meson.build new file mode 100644 index 0000000000..3aa3f9b9f5 --- /dev/null +++ b/tests/visuals/meson.build @@ -0,0 +1,6 @@ + +visuals = executable( + 'visuals', + 'visuals.c', + dependencies: libgtk_dep, +) diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 418aa417ae..e5a0636094 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -2,5 +2,8 @@ include $(top_srcdir)/Makefile.decl SUBDIRS = gdk gtk a11y css reftests tools +EXTRA_DIST += \ + meson.build + -include $(top_srcdir)/git.mk diff --git a/testsuite/a11y/accessibility-dump.c b/testsuite/a11y/accessibility-dump.c index 67747d4c05..2986f297f6 100644 --- a/testsuite/a11y/accessibility-dump.c +++ b/testsuite/a11y/accessibility-dump.c @@ -25,6 +25,10 @@ #include #include +#ifdef G_OS_WIN32 +# include +#endif + #define DEPTH_INCREMENT 2 static char * diff --git a/testsuite/css/Makefile.am b/testsuite/css/Makefile.am index 091591a174..33c9473942 100644 --- a/testsuite/css/Makefile.am +++ b/testsuite/css/Makefile.am @@ -25,7 +25,9 @@ LDADD = \ TEST_PROGS += api test_in_files += api.test.in -EXTRA_DIST += $(test_in_files) +EXTRA_DIST += \ + $(test_in_files) \ + meson.build if BUILDOPT_INSTALL_TESTS insttestdir=$(libexecdir)/installed-tests/$(PACKAGE)/css diff --git a/testsuite/css/meson.build b/testsuite/css/meson.build new file mode 100644 index 0000000000..e90cd77c96 --- /dev/null +++ b/testsuite/css/meson.build @@ -0,0 +1,6 @@ +subdir('parser') +subdir('nodes') +subdir('style') + +test_api = executable('api', 'api.c', dependencies: libgtk_dep) +test('css/api', test_api) diff --git a/testsuite/css/nodes/Makefile.am b/testsuite/css/nodes/Makefile.am index 339c47eda0..af93ee0e60 100644 --- a/testsuite/css/nodes/Makefile.am +++ b/testsuite/css/nodes/Makefile.am @@ -57,7 +57,7 @@ test_data = \ scale.ui scale.nodes \ $(NULL) -EXTRA_DIST += $(test_in_files) $(test_data) +EXTRA_DIST += $(test_in_files) $(test_data) meson.build if BUILDOPT_INSTALL_TESTS insttestdir=$(libexecdir)/installed-tests/$(PACKAGE)/css/nodes diff --git a/testsuite/css/nodes/meson.build b/testsuite/css/nodes/meson.build new file mode 100644 index 0000000000..a7d5050abd --- /dev/null +++ b/testsuite/css/nodes/meson.build @@ -0,0 +1,3 @@ + +test_nodes = executable('test-css-nodes', 'test-css-nodes.c', dependencies: libgtk_dep) +test('css/nodes/test-nodes', test_nodes) diff --git a/testsuite/css/nodes/test-css-nodes.c b/testsuite/css/nodes/test-css-nodes.c index bb0b02cc48..334b60a11c 100644 --- a/testsuite/css/nodes/test-css-nodes.c +++ b/testsuite/css/nodes/test-css-nodes.c @@ -22,6 +22,10 @@ #include #include +#ifdef G_OS_WIN32 +# include +#endif + static char * test_get_reference_file (const char *ui_file) diff --git a/testsuite/css/parser/Makefile.am b/testsuite/css/parser/Makefile.am index bd7989117a..63cad9e1dc 100644 --- a/testsuite/css/parser/Makefile.am +++ b/testsuite/css/parser/Makefile.am @@ -474,6 +474,9 @@ test_data = \ EXTRA_DIST += $(test_in_files) $(test_data) +EXTRA_DIST += \ + meson.build + if BUILDOPT_INSTALL_TESTS insttestdir=$(libexecdir)/installed-tests/$(PACKAGE)/css/parser insttest_PROGRAMS = $(TEST_PROGS) @@ -488,7 +491,8 @@ test_files = $(test_in_files:.test.in=.test) $(test_files): %.test: %.test.in $(AM_V_GEN) sed $(substitutions) $< > $@.tmp && mv $@.tmp $@ -EXTRA_DIST += $(test_in_files) +EXTRA_DIST += \ + $(test_in_files) CLEANFILES += $(test_files) diff --git a/testsuite/css/parser/meson.build b/testsuite/css/parser/meson.build new file mode 100644 index 0000000000..fee149a7c0 --- /dev/null +++ b/testsuite/css/parser/meson.build @@ -0,0 +1,3 @@ + +test_parser = executable('test-css-parser', 'test-css-parser.c', dependencies: libgtk_dep) +test('css/parser/css-parser', test_parser) diff --git a/testsuite/css/parser/test-css-parser.c b/testsuite/css/parser/test-css-parser.c index a5bb173075..c925d89bfa 100644 --- a/testsuite/css/parser/test-css-parser.c +++ b/testsuite/css/parser/test-css-parser.c @@ -26,6 +26,10 @@ #include #include +#ifdef G_OS_WIN32 +# include +#endif + static char * test_get_reference_file (const char *css_file) { diff --git a/testsuite/css/style/Makefile.am b/testsuite/css/style/Makefile.am index bfdb22bad7..2ef0e55b61 100644 --- a/testsuite/css/style/Makefile.am +++ b/testsuite/css/style/Makefile.am @@ -51,6 +51,7 @@ EXTRA_DIST += \ $(resource_files) \ $(test_in_files) \ $(test_data) \ + meson.build \ $(NULL) if BUILDOPT_INSTALL_TESTS diff --git a/testsuite/css/style/meson.build b/testsuite/css/style/meson.build new file mode 100644 index 0000000000..db3766a5e3 --- /dev/null +++ b/testsuite/css/style/meson.build @@ -0,0 +1,14 @@ + +cssresources = gnome.compile_resources( + 'cssresources', + 'test-css-style.gresource.xml', + source_dir: '.', +) + +test_style = executable( + 'test-css-style', + 'test-css-style.c', + cssresources, + dependencies: libgtk_dep, +) +test('css/style/test-style', test_style) diff --git a/testsuite/css/style/test-css-style.c b/testsuite/css/style/test-css-style.c index 53fac070e5..0992223ac0 100644 --- a/testsuite/css/style/test-css-style.c +++ b/testsuite/css/style/test-css-style.c @@ -22,6 +22,10 @@ #include #include +#ifdef G_OS_WIN32 +# include +#endif + /* There shall be no other styles */ #define GTK_STYLE_PROVIDER_PRIORITY_FORCE G_MAXUINT diff --git a/testsuite/gdk/Makefile.am b/testsuite/gdk/Makefile.am index 73b4beb486..b052d12ef0 100644 --- a/testsuite/gdk/Makefile.am +++ b/testsuite/gdk/Makefile.am @@ -33,6 +33,9 @@ CLEANFILES = \ gdksurface.png \ $(NULL) +EXTRA_DIST += \ + meson.build + if BUILDOPT_INSTALL_TESTS insttestdir=$(libexecdir)/installed-tests/$(PACKAGE) insttest_PROGRAMS = $(TEST_PROGS) diff --git a/testsuite/gdk/meson.build b/testsuite/gdk/meson.build new file mode 100644 index 0000000000..ca84758e4f --- /dev/null +++ b/testsuite/gdk/meson.build @@ -0,0 +1,26 @@ +tests = [ + 'cairo', + 'display', + 'encoding', + 'keysyms', + 'rectangle', + 'rgba', + 'seat', + 'visual', +] + +foreach t : tests + test_exe = executable(t, '@0@.c'.format(t), + dependencies: libgtk_dep) + + test(t, test_exe, + args: [ '--tap', '-k' ], + env: [ 'GIO_USE_VOLUME_MONITOR=unix', + 'GSETTINGS_BACKEND=memory', + 'GTK_CSD=1', + 'G_ENABLE_DIAGNOSTIC=0', + 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), + 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()) + ], + suite: 'gdk') +endforeach diff --git a/testsuite/gtk/Makefile.am b/testsuite/gtk/Makefile.am index 99718b671e..859f674f79 100644 --- a/testsuite/gtk/Makefile.am +++ b/testsuite/gtk/Makefile.am @@ -265,6 +265,7 @@ EXTRA_DIST += \ file-chooser-test-dir/text.txt \ $(test_icontheme) \ $(test_ui) \ + meson.build \ $(NULL) GTK_GSETTINGS_SCHEMAS = \ diff --git a/testsuite/gtk/builder.c b/testsuite/gtk/builder.c index 339ad110b2..58d9f235cd 100644 --- a/testsuite/gtk/builder.c +++ b/testsuite/gtk/builder.c @@ -26,14 +26,14 @@ #include /* exported for GtkBuilder */ -void signal_normal (GtkWindow *window, GParamSpec *spec); -void signal_after (GtkWindow *window, GParamSpec *spec); -void signal_object (GtkButton *button, GParamSpec *spec); -void signal_object_after (GtkButton *button, GParamSpec *spec); -void signal_first (GtkButton *button, GParamSpec *spec); -void signal_second (GtkButton *button, GParamSpec *spec); -void signal_extra (GtkButton *button, GParamSpec *spec); -void signal_extra2 (GtkButton *button, GParamSpec *spec); +G_MODULE_EXPORT void signal_normal (GtkWindow *window, GParamSpec *spec); +G_MODULE_EXPORT void signal_after (GtkWindow *window, GParamSpec *spec); +G_MODULE_EXPORT void signal_object (GtkButton *button, GParamSpec *spec); +G_MODULE_EXPORT void signal_object_after (GtkButton *button, GParamSpec *spec); +G_MODULE_EXPORT void signal_first (GtkButton *button, GParamSpec *spec); +G_MODULE_EXPORT void signal_second (GtkButton *button, GParamSpec *spec); +G_MODULE_EXPORT void signal_extra (GtkButton *button, GParamSpec *spec); +G_MODULE_EXPORT void signal_extra2 (GtkButton *button, GParamSpec *spec); /* Copied from gtkiconfactory.c; keep in sync! */ struct _GtkIconSet @@ -133,7 +133,7 @@ static int after = 0; static int object = 0; static int object_after = 0; -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_normal (GtkWindow *window, GParamSpec *spec) { g_assert (GTK_IS_WINDOW (window)); @@ -143,7 +143,7 @@ signal_normal (GtkWindow *window, GParamSpec *spec) normal++; } -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_after (GtkWindow *window, GParamSpec *spec) { g_assert (GTK_IS_WINDOW (window)); @@ -153,7 +153,7 @@ signal_after (GtkWindow *window, GParamSpec *spec) after++; } -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_object (GtkButton *button, GParamSpec *spec) { g_assert (GTK_IS_BUTTON (button)); @@ -163,7 +163,7 @@ signal_object (GtkButton *button, GParamSpec *spec) object++; } -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_object_after (GtkButton *button, GParamSpec *spec) { g_assert (GTK_IS_BUTTON (button)); @@ -173,28 +173,28 @@ signal_object_after (GtkButton *button, GParamSpec *spec) object_after++; } -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_first (GtkButton *button, GParamSpec *spec) { g_assert (normal == 0); normal = 10; } -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_second (GtkButton *button, GParamSpec *spec) { g_assert (normal == 10); normal = 20; } -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_extra (GtkButton *button, GParamSpec *spec) { g_assert (normal == 20); normal = 30; } -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_extra2 (GtkButton *button, GParamSpec *spec) { g_assert (normal == 30); @@ -2619,13 +2619,13 @@ test_level_bar (void) static GObject *external_object = NULL, *external_object_swapped = NULL; -void +G_MODULE_EXPORT void on_button_clicked (GtkButton *button, GObject *data) { external_object = data; } -void +G_MODULE_EXPORT void on_button_clicked_swapped (GObject *data, GtkButton *button) { external_object_swapped = data; @@ -2844,7 +2844,7 @@ test_template () g_assert (GTK_IS_LABEL (my_gtk_grid->priv->label)); } -void +G_MODULE_EXPORT void on_cellrenderertoggle1_toggled (GtkCellRendererToggle *cell) { } diff --git a/testsuite/gtk/defaultvalue.c b/testsuite/gtk/defaultvalue.c index 0cb3073ce7..a82788b7e4 100644 --- a/testsuite/gtk/defaultvalue.c +++ b/testsuite/gtk/defaultvalue.c @@ -472,7 +472,8 @@ main (int argc, char **argv) /* g_test_build_filename must be called after gtk_test_init */ schema_dir = g_test_build_filename (G_TEST_BUILT, "", NULL); - g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); + if (g_getenv ("GTK_TEST_MESON") == NULL) + g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); /* Create one test bus for all tests, as we have a lot of very small * and quick tests. diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build new file mode 100644 index 0000000000..7cf67be39d --- /dev/null +++ b/testsuite/gtk/meson.build @@ -0,0 +1,110 @@ +gtk_tests_export_dynamic_ldflag = [] + +if cc.get_id() != 'msvc' and cc.get_id() != 'clang' + gtk_tests_export_dynamic_ldflag = ['-Wl,--export-dynamic'] +endif + +tests = [ + ['accel'], + ['accessible'], + ['action'], + ['adjustment'], + ['bitmask', ['../../gtk/gtkallocatedbitmask.c'], ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG']], + ['builder', [], [], gtk_tests_export_dynamic_ldflag], + ['builderparser'], + ['cellarea'], + ['check-icon-names'], + ['check-cursor-names'], + ['cssprovider'], + ['defaultvalue'], + ['entry'], + ['firefox-stylecontext'], + ['floating'], + ['focus'], + ['gestures'], + ['grid'], + ['gtkmenu'], + ['icontheme'], + ['keyhash', ['../../gtk/gtkkeyhash.c', gtkresources, '../../gtk/gtkprivate.c'], gtk_cargs], + ['listbox'], + ['notify'], + ['no-gtk-init'], + ['object'], + ['papersize'], + ['rbtree', ['../../gtk/gtkrbtree.c'], ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG']], + ['recentmanager'], + ['regression-tests'], + ['scrolledwindow'], + ['spinbutton'], + ['stylecontext'], + ['templates'], + ['textbuffer'], + ['textiter'], + ['treemodel', ['treemodel.c', 'liststore.c', 'treestore.c', 'filtermodel.c', + 'modelrefcount.c', 'sortmodel.c', 'gtktreemodelrefcount.c']], + ['treepath'], + ['treeview'], + ['typename'], + ['window'], + ['displayclose'], + ['revealer-size'], +] + +test_cargs = [] + +if os_unix + # tests += [['defaultvalue']] # disabled in Makefile.am as well + test_cargs += ['-DHAVE_UNIX_PRINT_WIDGETS'] +endif + +if x11_enabled + tests += [ + ['clipboard'], + ['objects-finalize', ['../../gdk/x11/gdkdisplaymanager-x11.c'], ['-DGDK_COMPILATION', '-UG_ENABLE_DEBUG']], + ] +endif + +foreach t : tests + test_name = t.get(0) + test_srcs = ['@0@.c'.format(test_name)] + t.get(1, []) + test_extra_cargs = t.get(2, []) + test_extra_ldflags = t.get(3, []) + + test_exe = executable(test_name, test_srcs, + c_args : test_cargs + test_extra_cargs, + link_args : test_extra_ldflags, + dependencies : libgtk_dep) + + test(test_name, test_exe, + args: [ '--tap', '-k' ], + env: [ 'GIO_USE_VOLUME_MONITOR=unix', + 'GSETTINGS_BACKEND=memory', + 'GTK_CSD=1', + 'G_ENABLE_DIAGNOSTIC=0', + 'GSK_RENDERER=cairo', + 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), + 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), + 'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir), + 'GTK_TEST_MESON=1', + ], + suite: 'gtk') +endforeach + +# FIXME: if objc autotestkeywords_CPPFLAGS += -DHAVE_OBJC=1 -x objective-c++ +if add_languages('cpp', required: false) + test_exe = executable('autotestkeywords', + 'autotestkeywords.cc', + c_args : test_cargs + ['-Idummy-headers'], + dependencies : libgtk_dep) + test('c++ keywords', test_exe, + args: [ '--tap', '-k' ], + env: [ 'GIO_USE_VOLUME_MONITOR=unix', + 'GSETTINGS_BACKEND=memory', + 'GTK_CSD=1', + 'G_ENABLE_DIAGNOSTIC=0', + 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), + 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), + 'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir), + ], + suite: 'gtk') +endif diff --git a/testsuite/gtk/notify.c b/testsuite/gtk/notify.c index 201a44e17b..c7e8a69387 100644 --- a/testsuite/gtk/notify.c +++ b/testsuite/gtk/notify.c @@ -713,7 +713,8 @@ main (int argc, char **argv) /* g_test_build_filename must be called after gtk_test_init */ schema_dir = g_test_build_filename (G_TEST_BUILT, "", NULL); - g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); + if (g_getenv ("GTK_TEST_MESON") == NULL) + g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); otypes = gtk_test_list_all_types (NULL); for (i = 0; otypes[i]; i++) diff --git a/testsuite/gtk/object.c b/testsuite/gtk/object.c index 6bdcd73864..b561aa9a52 100644 --- a/testsuite/gtk/object.c +++ b/testsuite/gtk/object.c @@ -336,7 +336,8 @@ main (int argc, /* g_test_build_filename must be called after gtk_test_init */ schema_dir = g_test_build_filename (G_TEST_BUILT, "", NULL); - g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); + if (g_getenv ("GTK_TEST_MESON") == NULL) + g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); /* install a property test for each widget type */ otypes = gtk_test_list_all_types (NULL); diff --git a/testsuite/gtk/objects-finalize.c b/testsuite/gtk/objects-finalize.c index 0b3a5198dc..24540e313f 100644 --- a/testsuite/gtk/objects-finalize.c +++ b/testsuite/gtk/objects-finalize.c @@ -92,7 +92,8 @@ main (int argc, char **argv) /* g_test_build_filename must be called after gtk_test_init */ schema_dir = g_test_build_filename (G_TEST_BUILT, "", NULL); - g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); + if (g_getenv ("GTK_TEST_MESON") == NULL) + g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); /* Create one test bus for all tests, as we have a lot of very small * and quick tests. diff --git a/testsuite/gtk/stylecontext.c b/testsuite/gtk/stylecontext.c index 6ae7ff9c61..83fde7c5b4 100644 --- a/testsuite/gtk/stylecontext.c +++ b/testsuite/gtk/stylecontext.c @@ -374,11 +374,12 @@ test_style_priorities_setup (PrioritiesFixture *f, gconstpointer unused) { GError *error = NULL; + GtkWidgetPath *path; f->blue_provider = gtk_css_provider_new (); f->red_provider = gtk_css_provider_new (); f->green_provider = gtk_css_provider_new (); f->context = gtk_style_context_new (); - GtkWidgetPath *path = gtk_widget_path_new (); + path = gtk_widget_path_new (); gtk_css_provider_load_from_data (f->blue_provider, "* { color: blue; }", -1, &error); g_assert_no_error (error); diff --git a/testsuite/gtk/templates.c b/testsuite/gtk/templates.c index 316dc1539d..1827c5a060 100644 --- a/testsuite/gtk/templates.c +++ b/testsuite/gtk/templates.c @@ -353,7 +353,8 @@ main (int argc, char **argv) /* g_test_build_filename must be called after gtk_test_init */ schema_dir = g_test_build_filename (G_TEST_BUILT, "", NULL); - g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); + if (g_getenv ("GTK_TEST_MESON") == NULL) + g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); /* This environment variable cooperates with gtk_widget_destroy() * to assert that all automated compoenents are properly finalized diff --git a/testsuite/meson.build b/testsuite/meson.build new file mode 100644 index 0000000000..a3507d5e06 --- /dev/null +++ b/testsuite/meson.build @@ -0,0 +1,3 @@ +subdir('gtk') +subdir('gdk') +subdir('css') diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c index 4930af8184..6400b26ecf 100644 --- a/testsuite/reftests/gtk-reftest.c +++ b/testsuite/reftests/gtk-reftest.c @@ -28,6 +28,10 @@ #include #include +#ifdef G_OS_WIN32 +# include +#endif + typedef enum { SNAPSHOT_WINDOW, SNAPSHOT_DRAW