Merge branch 'gtk-3-24-meson' into 'gtk-3-24'

GTK 3 meson port

See merge request GNOME/gtk!716
This commit is contained in:
Matthias Clasen
2019-04-11 16:34:47 +00:00
157 changed files with 6212 additions and 118 deletions

View File

@ -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"

View File

@ -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}

View File

@ -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

View File

@ -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

29
.gitlab-ci/test-docker-meson.sh Executable file
View File

@ -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

View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -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) \

View File

@ -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 <dependency>.
- Run the following:
meson <path_to_directory_of_this_file> --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:
<gtk_install_prefix>\bin\gtk-query-immodules-3.0.exe > <gtk_install_prefix>\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 <gtk_install_prefix>\bin\%~nf mt /manifest %f /outputresource:<gtk_install_prefix>\bin\%~nf;2
for /r %f in (*.exe.manifest) do if exist <gtk_install_prefix>\bin\%~nf mt /manifest %f /outputresource:<gtk_install_prefix>\bin\%~nf;1
for /r %f in (*.dll.manifest) do if exist <gtk_install_prefix>\lib\gtk-3.0\3.0.0\immodules\%~nf mt /manifest %f /outputresource:<gtk_install_prefix>\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
===================

View File

@ -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])

298
config.h.meson Normal file
View File

@ -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 <crt_externs.h> 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 <dev/evdev/input.h> header file. */
#mesondefine HAVE_DEV_EVDEV_INPUT_H
/* Define to 1 if you have the <dlfcn.h> 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 <ftw.h> 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 <inttypes.h> 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 <linux/input.h> header file. */
#mesondefine HAVE_LINUX_INPUT_H
/* Define to 1 if you have the <linux/memfd.h> 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 <memory.h> 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 <stdint.h> header file. */
#mesondefine HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#mesondefine HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#mesondefine HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#mesondefine HAVE_STRING_H
/* Define to 1 if you have the <sys/mman.h> header file. */
#mesondefine HAVE_SYS_MMAN_H
/* Define to 1 if you have the <sys/param.h> header file. */
#mesondefine HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/stat.h> 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 <sys/time.h> header file. */
#mesondefine HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> 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 <unistd.h> 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 <X11/extensions/XIproto.h> 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 <sys/types.h> doesn't define. */
#mesondefine gid_t
/* Define to `int' if <sys/types.h> 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

View File

@ -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

View File

@ -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

View File

@ -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

108
demos/gtk-demo/geninclude.py Executable file
View File

@ -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()

143
demos/gtk-demo/meson.build Normal file
View File

@ -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']))

View File

@ -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

View File

@ -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)

3
demos/meson.build Normal file
View File

@ -0,0 +1,3 @@
subdir('icon-browser')
subdir('widget-factory')
subdir('gtk-demo')

View File

@ -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

View File

@ -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)

View File

@ -5,4 +5,7 @@ SUBDIRS = gdk gtk libgail-util
GITIGNOREFILES = */*.1
EXTRA_DIST += \
meson.build
-include $(top_srcdir)/git.mk

View File

@ -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) && \

View File

@ -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

View File

@ -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) && \

View File

@ -44,7 +44,7 @@
<informalexample>
<para>Create a new file with the following content named <filename>example-0.c.</filename></para>
<programlisting><xi:include href="../../../../examples/window-default.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/window-default.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>
@ -153,7 +153,7 @@
<example id="gtk-getting-started-hello-world">
<title>Hello World in GTK+</title>
<para>Create a new file with the following content named example-1.c.</para>
<programlisting><xi:include href="../../../../examples/hello-world.c" parse="text">
<programlisting><xi:include href="@abs_top_srcdir@/examples/hello-world.c" parse="text">
<xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
@ -233,7 +233,7 @@
<example id="gtk-getting-started-grid-packing">
<title>Packing buttons</title>
<para>Create a new file with the following content named example-2.c.</para>
<programlisting><xi:include href="../../../../examples/grid-packing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/grid-packing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:
@ -257,9 +257,9 @@
<example>
<title>Packing buttons with GtkBuilder</title>
<para>Create a new file with the following content named example-3.c.</para>
<programlisting><xi:include href="../../../../examples/builder.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/builder.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<para>Create a new file with the following content named builder.ui.</para>
<programlisting><xi:include href="../../../../examples/builder.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/builder.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:
@ -346,7 +346,7 @@
of our application class.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application1/main.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application1/main.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>All the application logic is in the application class, which
@ -364,7 +364,7 @@
GIO <ulink url="https://developer.gnome.org/gio/2.36/GApplication.html#GApplication.description">documentation</ulink>.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application1/exampleapp.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application1/exampleapp.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Another important class that is part of the application support
@ -373,7 +373,7 @@
window.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application1/exampleappwin.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application1/exampleappwin.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>As part of the initial setup of our application, we also
@ -388,7 +388,7 @@
</informalfigure>
<informalexample>
<programlisting><xi:include href="../../../../examples/application1/exampleapp.desktop" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application1/exampleapp.desktop" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Note that <replaceable>@<!-- -->bindir@</replaceable> needs to be replaced
@ -420,7 +420,7 @@
</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application2/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application2/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>To make use of this file in our application, we revisit
@ -460,7 +460,7 @@ example_app_window_class_init (ExampleAppWindowClass *class)
</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application2/exampleapp.gresource.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application2/exampleapp.gresource.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>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.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application4/app-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application4/app-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>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:</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application5/org.gtk.exampleapp.gschema.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application5/org.gtk.exampleapp.gschema.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Before we can make use of this schema in our application,
@ -749,13 +749,13 @@ example_app_window_init (ExampleAppWindow *win)
<para>Lets start with the template.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application6/prefs.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application6/prefs.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Next comes the dialog subclass.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application6/exampleappprefs.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application6/exampleappprefs.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Now we revisit the <literal>preferences_activated(<!-- -->)</literal> function in our
@ -807,7 +807,7 @@ preferences_activated (GSimpleAction *action,
to slide out the search bar below the header bar.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application7/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application7/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>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.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application8/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application8/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>The code to populate the sidebar with buttons for the words
@ -898,7 +898,7 @@ example_app_window_init (ExampleAppWindow *win)
ui file.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application8/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application8/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>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:</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application9/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application9/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>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.</para>
<informalexample>
<programlisting><xi:include href="../../../../examples/application10/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/application10/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>A small extra bonus of using a header bar is that we get
@ -1073,7 +1073,7 @@ example_app_window_init (ExampleAppWindow *win)
<example id="gtk-getting-started-drawing">
<title>Drawing in response to input</title>
<para>Create a new file with the following content named example-4.c.</para>
<programlisting><xi:include href="../../../../examples/drawing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="@abs_top_srcdir@/examples/drawing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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')

View File

@ -20,6 +20,9 @@ LDADDS = \
$(GDK_DEP_LIBS) \
-lm
EXTRA_DIST += \
meson.build
if USE_X11
noinst_PROGRAMS = \
doc-shooter

12
docs/tools/meson.build Normal file
View File

@ -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

View File

@ -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

View File

@ -17,4 +17,7 @@ exampleapp_SOURCES = \
exampleapp.c exampleapp.h \
exampleappwin.c exampleappwin.h
EXTRA_DIST = \
meson.build
-include $(top_srcdir)/git.mk

View File

@ -0,0 +1,11 @@
app1 = executable(
'exampleapp',
'main.c',
'exampleapp.c',
'exampleapp.h',
'exampleappwin.c',
'exampleappwin.h',
dependencies: libgtk_dep
)

View File

@ -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

View File

@ -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
)

View File

@ -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

View File

@ -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
)

View File

@ -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

View File

@ -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
)

View File

@ -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

View File

@ -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
)

View File

@ -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

View File

@ -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
)

View File

@ -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

View File

@ -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
)

View File

@ -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

View File

@ -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
)

View File

@ -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

View File

@ -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
)

View File

@ -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

View File

@ -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
)

View File

@ -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

View File

@ -537,6 +537,7 @@ bloat_pad_startup (GApplication *application)
{ "win.justify::center", { "<Primary>m", NULL } },
{ "win.justify::right", { "<Primary>r", NULL } }
};
const gchar *new_accels[] = { "<Primary>n", "<Primary>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[] = { "<Primary>n", "<Primary>t", NULL };
gtk_application_set_accels_for_action (GTK_APPLICATION (application), "app.new", new_accels);
dump_accels (GTK_APPLICATION (application));

13
examples/bp/meson.build Normal file
View File

@ -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
)

60
examples/meson.build Normal file
View File

@ -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')

View File

@ -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 \

View File

@ -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

View File

@ -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('};')

78
gdk/broadway/meson.build Normal file
View File

@ -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)

20
gdk/gdkconfig.h.meson Normal file
View File

@ -0,0 +1,20 @@
#ifndef __GDKCONFIG_H__
#define __GDKCONFIG_H__
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdk.h> can be included directly."
#endif
#include <glib.h>
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__ */

View File

@ -14,7 +14,7 @@ G_BEGIN_DECLS
/*** BEGIN file-production ***/
/* enumerations from "@filename@" */
/* enumerations from "@basename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/

View File

@ -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 = '''<?xml version='1.0' encoding='UTF-8'?>
<gresources>
<gresource prefix='/org/gtk/libgdk'>
'''
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 += ' <file alias=\'glsl/{0}\'>resources/glsl/{0}</file>\n'.format(f)
xml += '''
</gresource>
</gresources>'''
if len(sys.argv) > 2:
outfile = sys.argv[2]
f = open(outfile, 'w')
f.write(xml)
f.close()
else:
print(xml)

376
gdk/meson.build Normal file
View File

@ -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)

View File

@ -72,5 +72,7 @@ libgdkquartzinclude_HEADERS = \
gdkquartzvisual.h \
gdkquartzwindow.h
EXTRA_DIST += \
meson.build
-include $(top_srcdir)/git.mk

57
gdk/quartz/meson.build Normal file
View File

@ -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])

View File

@ -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

105
gdk/wayland/meson.build Normal file
View File

@ -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, ])

View File

@ -29,7 +29,8 @@ SUBDIRS=rc
EXTRA_DIST += \
bdfcursor.c \
makefile.msc
makefile.msc \
meson.build
libgdk_win32_la_SOURCES = \
gdkcursor-win32.c \

57
gdk/win32/meson.build Normal file
View File

@ -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])

View File

@ -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 <EFBFBD> 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@"

View File

@ -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

80
gdk/x11/meson.build Normal file
View File

@ -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, ])

View File

@ -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 <gtk/gtkx.h>') > 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

114
gtk/a11y/meson.build Normal file
View File

@ -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')

View File

@ -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/')

View File

@ -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 = '''<?xml version='1.0' encoding='UTF-8'?>
<gresources>
<gresource prefix='/org/gtk/libgtk'>
'''
def get_files(subdir,extension):
return sorted(filter(lambda x: x.endswith((extension)), os.listdir(os.path.join(srcdir,subdir))))
xml += '''
<file>theme/Adwaita/gtk.css</file>
<file>theme/Adwaita/gtk-dark.css</file>
<file>theme/Adwaita/gtk-contained.css</file>
<file>theme/Adwaita/gtk-contained-dark.css</file>
'''
for f in get_files('theme/Adwaita/assets', '.png'):
xml += ' <file preprocess=\'to-pixdata\'>theme/Adwaita/assets/{0}</file>\n'.format(f)
xml += '\n'
for f in get_files('theme/Adwaita/assets', '.svg'):
xml += ' <file>theme/Adwaita/assets/{0}</file>\n'.format(f)
xml += '''
<file>theme/HighContrast/gtk.css</file>
<file alias='theme/HighContrastInverse/gtk.css'>theme/HighContrast/gtk-inverse.css</file>
<file>theme/HighContrast/gtk-contained.css</file>
<file>theme/HighContrast/gtk-contained-inverse.css</file>
'''
for f in get_files('theme/HighContrast/assets', '.png'):
xml += ' <file preprocess=\'to-pixdata\'>theme/HighContrast/assets/{0}</file>\n'.format(f)
xml += '\n'
for f in get_files('theme/HighContrast/assets', '.svg'):
xml += ' <file>theme/HighContrast/assets/{0}</file>\n'.format(f)
xml += '''
<file>theme/win32/gtk-win32-base.css</file>
<file>theme/win32/gtk.css</file>
'''
for f in get_files('cursor', '.png'):
xml += ' <file>cursor/{0}</file>\n'.format(f)
for f in get_files('gesture', '.symbolic.png'):
xml += ' <file alias=\'icons/64x64/actions/{0}\'>gesture/{0}</file>\n'.format(f)
xml += '\n'
for f in get_files('ui', '.ui'):
xml += ' <file preprocess=\'xml-stripblanks\'>ui/{0}</file>\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 += ' <file>icons/{0}/{1}/{2}</file>\n'.format(s,c,f)
for f in get_files('inspector', '.ui'):
xml += ' <file compressed=\'true\' preprocess=\'xml-stripblanks\'>inspector/{0}</file>\n'.format(f)
xml += '''
<file>inspector/logo.png</file>
<file>emoji/emoji.data</file>
</gresource>
</gresources>'''
if len(sys.argv) > 2:
outfile = sys.argv[2]
f = open(outfile, 'w')
f.write(xml)
f.close()
else:
print(xml)

21
gtk/gen-rc.py Normal file
View File

@ -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 <winuser.h>\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')

55
gtk/gentypefuncs.py Normal file
View File

@ -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()

View File

@ -21,7 +21,9 @@
#include <config.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <locale.h>
#include <errno.h>
@ -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++;

View File

@ -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 <EFBFBD> 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@"

View File

@ -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];

View File

@ -58,7 +58,7 @@ struct _GtkPixelCache {
};
GtkPixelCache *
_gtk_pixel_cache_new ()
_gtk_pixel_cache_new (void)
{
GtkPixelCache *cache;

View File

@ -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;

View File

@ -14,7 +14,7 @@ G_BEGIN_DECLS
/*** BEGIN file-production ***/
/* enumerations from "@filename@" */
/* enumerations from "@basename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/

31
gtk/inspector/meson.build Normal file
View File

@ -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',
)

1090
gtk/meson.build Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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

View File

@ -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

30
libgail-util/meson.build Normal file
View File

@ -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)

974
meson.build Normal file
View File

@ -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 <ft2build.h>
#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 <X11/XKBlib.h>')
cdata.set('HAVE_XKB', 1)
endif
if cc.has_function('XSyncQueryExtension', dependencies: xext_dep,
prefix: '''#include <X11/Xlib.h>
#include <X11/extensions/sync.h>''')
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 <X11/Xlib.h>
#include <X11/extensions/XInput2.h>''')
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 <epoxy/egl.h>
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 <windows.h>
''')
cdata.set('SIZEOF_DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY', dvot_size)
getdevprop_code = '''
#define _WIN32_WINNT 0x0600
#include <windows.h>
#include <devpropdef.h>
#include <setupapi.h>
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))

43
meson_options.txt Normal file
View File

@ -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')

View File

@ -6,4 +6,7 @@ if OS_UNIX
SUBDIRS += printbackends
endif
EXTRA_DIST += \
meson.build
-include $(top_srcdir)/git.mk

View File

@ -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

20
modules/input/meson.build Normal file
View File

@ -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

2
modules/meson.build Normal file
View File

@ -0,0 +1,2 @@
subdir('input')
subdir('printbackends')

View File

@ -20,4 +20,7 @@ endif
DIST_SUBDIRS = cloudprint cups file lpr test papi
EXTRA_DIST += \
meson.build
-include $(top_srcdir)/git.mk

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