gtk2/gdk/meson.build

280 lines
6.5 KiB
Meson
Raw Normal View History

gdk_public_sources = files([
'gdk.c',
'gdkapplaunchcontext.c',
'gdkcairo.c',
'gdkcairocontext.c',
'gdkclipboard.c',
'gdkcontentdeserializer.c',
'gdkcontentformats.c',
'gdkcontentprovider.c',
'gdkcontentproviderimpl.c',
'gdkcontentserializer.c',
'gdkcursor.c',
'gdkdevice.c',
2016-08-23 06:21:54 +00:00
'gdkdevicepad.c',
2016-09-26 10:51:17 +00:00
'gdkdevicetool.c',
'gdkdisplay.c',
'gdkdisplaymanager.c',
'gdkdrag.c',
'gdkdrawcontext.c',
'gdkdrop.c',
'gdkevents.c',
'filetransferportal.c',
2016-09-26 10:51:17 +00:00
'gdkframeclock.c',
'gdkframeclockidle.c',
'gdkframetimings.c',
'gdkgl.c',
'gdkglcontext.c',
'gdkglobals.c',
'gdkgltexture.c',
2021-08-29 02:08:47 +00:00
'gdkhsla.c',
'gdkkeys.c',
'gdkkeyuni.c',
'gdkmemorytexture.c',
2016-09-26 10:51:17 +00:00
'gdkmonitor.c',
2018-02-16 04:32:32 +00:00
'gdkpaintable.c',
'gdkpango.c',
'gdkpixbuf-drawable.c',
'gdkpipeiostream.c',
'gdkrectangle.c',
'gdkrgba.c',
2016-09-26 10:51:17 +00:00
'gdkseat.c',
'gdkseatdefault.c',
'gdksnapshot.c',
'gdktexture.c',
'gdkvulkancontext.c',
'gdksurface.c',
gdk/surface: Replace move_to_rect() with GdkPopupLayout based API Replace the gdk_surface_move_to_rect() API with a new GdkSurface method called gdk_surface_present_popup() taking a new GdkPopupLayout object describing how they should be laid out on screen. The layout properties provided are the same as the ones used with gdk_surface_move_to_rect(), except they are now set up using GdkPopupLayout. Calling gdk_surface_present_popup() will either show the popup at the position described using the popup layout object and a new unconstrained size, or reposition it accordingly. In some situations, such as when a popup is set to autohide, presenting may immediately fail, in case the grab was not granted by the display server. After a successful present, the result of the layout can be queried using the following methods: * gdk_surface_get_position() - to get the position relative to its parent * gdk_surface_get_width() - to get the current width * gdk_surface_get_height() - to get the current height * gdk_surface_get_rect_anchor() - to get the anchor point on the anchor rectangle the popup was effectively positioned against given constraints defined by the environment and the layout rules provided via GdkPopupLayout. * gdk_surface_get_surface_anchor() - the same as the one above but for the surface anchor. A new signal replaces the old "moved-to-rect" one - "popup-layout-changed". However, it is only intended to be emitted when the layout changes implicitly by the windowing system, for example if the monitor resolution changed, or the parent window moved.
2020-02-16 11:59:24 +00:00
'gdkpopuplayout.c',
'gdkprofiler.c',
'gdkpopup.c',
'gdktoplevellayout.c',
'gdktoplevelsize.c',
'gdktoplevel.c',
'gdkdragsurface.c',
'loaders/gdkpng.c',
'loaders/gdktiff.c',
'loaders/gdkjpeg.c',
2016-08-23 06:21:54 +00:00
])
gdk_public_headers = files([
'gdk-autocleanup.h',
2016-09-26 10:51:17 +00:00
'gdk.h',
'gdkapplaunchcontext.h',
'gdkcairo.h',
'gdkcairocontext.h',
'gdkclipboard.h',
'gdkcontentdeserializer.h',
'gdkcontentformats.h',
'gdkcontentprovider.h',
'gdkcontentproviderimpl.h',
'gdkcontentserializer.h',
'gdkcursor.h',
'gdkdevice.h',
2016-08-23 06:21:54 +00:00
'gdkdevicepad.h',
2016-09-26 10:51:17 +00:00
'gdkdevicetool.h',
'gdkdisplay.h',
'gdkdisplaymanager.h',
'gdkdrag.h',
'gdkdrawcontext.h',
'gdkdrop.h',
'gdkevents.h',
2016-09-26 10:51:17 +00:00
'gdkframeclock.h',
'gdkframetimings.h',
'gdkglcontext.h',
'gdkgltexture.h',
'gdkkeys.h',
'gdkkeysyms.h',
'gdkmemorytexture.h',
2016-08-23 06:21:54 +00:00
'gdkmonitor.h',
2018-02-16 04:32:32 +00:00
'gdkpaintable.h',
'gdkpango.h',
'gdkpixbuf.h',
'gdkrectangle.h',
'gdkrgba.h',
2016-08-23 06:21:54 +00:00
'gdkseat.h',
'gdksnapshot.h',
'gdktexture.h',
'gdktypes.h',
'gdkvulkancontext.h',
'gdksurface.h',
gdk/surface: Replace move_to_rect() with GdkPopupLayout based API Replace the gdk_surface_move_to_rect() API with a new GdkSurface method called gdk_surface_present_popup() taking a new GdkPopupLayout object describing how they should be laid out on screen. The layout properties provided are the same as the ones used with gdk_surface_move_to_rect(), except they are now set up using GdkPopupLayout. Calling gdk_surface_present_popup() will either show the popup at the position described using the popup layout object and a new unconstrained size, or reposition it accordingly. In some situations, such as when a popup is set to autohide, presenting may immediately fail, in case the grab was not granted by the display server. After a successful present, the result of the layout can be queried using the following methods: * gdk_surface_get_position() - to get the position relative to its parent * gdk_surface_get_width() - to get the current width * gdk_surface_get_height() - to get the current height * gdk_surface_get_rect_anchor() - to get the anchor point on the anchor rectangle the popup was effectively positioned against given constraints defined by the environment and the layout rules provided via GdkPopupLayout. * gdk_surface_get_surface_anchor() - the same as the one above but for the surface anchor. A new signal replaces the old "moved-to-rect" one - "popup-layout-changed". However, it is only intended to be emitted when the layout changes implicitly by the windowing system, for example if the monitor resolution changed, or the parent window moved.
2020-02-16 11:59:24 +00:00
'gdkpopuplayout.h',
'gdkpopup.h',
'gdktoplevellayout.h',
'gdktoplevelsize.h',
'gdktoplevel.h',
'gdkdragsurface.h',
2016-08-23 06:21:54 +00:00
])
install_headers(gdk_public_headers, subdir: 'gtk-4.0/gdk/')
2016-08-21 14:00:37 +00:00
gdk_sources = gdk_public_sources
2016-08-23 06:21:54 +00:00
gdk_private_h_sources = files([
'gdkeventsprivate.h',
2016-08-21 14:00:37 +00:00
'gdkdevicetoolprivate.h',
2021-08-29 02:08:47 +00:00
'gdkhslaprivate.h',
2016-08-21 14:00:37 +00:00
'gdkmonitorprivate.h',
2016-09-26 10:51:17 +00:00
'gdkseatdefaultprivate.h',
'gdktoplevelsizeprivate.h',
2016-08-23 06:21:54 +00:00
])
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,
2016-08-21 14:00:37 +00:00
source_dir: '.',
c_name: '_gdk',
extra_args: '--manual-register',
)
gdk_headers = gdk_public_headers
gdk_enums = gnome.mkenums('gdkenumtypes',
sources: gdk_public_headers,
c_template: 'gdkenumtypes.c.template',
h_template: 'gdkenumtypes.h.template',
install_dir: gtk_includedir / 'gtk-4.0/gdk',
install_header: true,
)
gdkenum_h = gdk_enums[1]
2016-08-21 14:00:37 +00:00
gdk_marshalers = gnome.genmarshal('gdkmarshalers',
sources: 'gdkmarshalers.list',
prefix: '_gdk_marshal',
valist_marshallers: true,
)
2016-08-23 06:21:54 +00:00
gdkmarshal_h = gdk_marshalers[1]
2016-08-23 06:21:54 +00:00
2017-03-17 23:43:36 +00:00
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)
2017-03-17 23:43:36 +00:00
gdkconfig_cdata.set('GDK_WINDOWING_BROADWAY', broadway_enabled)
macos: prototype new GDK backend for macOS This is fairly substantial rewrite of the GDK backend for quartz and renamed to macOS to allow for a greenfield implementation. Many things have come across from the quartz implementation fairly intact such as the eventloop integration design and discovery of event windows from the NSEvent. However much has been changed to fit in with the new GDK design and how removal of child GdkWindow have been completely eliminated. Furthermore, the new GdkPopup allows for regular NSWindow to be used to provide popovers unlike the previous implementation. The object design more closely follows the ideal for a GDK backend. Views have been broken out into subclasses so that we can support multiple GSK renderer paths such as GL and Cairo (and Metal in the future). However mixed mode GL and Cairo will not be supported. Currently only the Cairo renderer has been implemented. A new frame clock implementation using CVDisplayLink provides more accurate information about when to draw drawing the next frame. Some testing will need to be done here to understand the power implications of this. This implementation has also gained edge snapping for CSD windows. Some work was also done to ensure that CSD windows have opaque regions registered with the display server. ** This is still very much a work-in-progress ** Some outstanding work that needs to be done: - Finish a GL context for macOS and alternate NSView for GL rendering (possibly using speciailized CALayer for OpenGL). - Input rework to ensure that we don't loose remapping of keys that was dropped from GDK during GTK 4 development. - Make sure input methods continue to work. - Drag-n-Drop is still very much a work in progress - High resolution input scrolling needs various work in GDK to land first before we can plumb that to NSEvent. - gtk/ has a number of things based on GDK_WINDOWING_QUARTZ that need to be updated to use the macOS backend. But this is good enough to start playing with and breaking things which is what I'd like to see.
2020-04-23 23:36:46 +00:00
gdkconfig_cdata.set('GDK_WINDOWING_MACOS', macos_enabled)
2017-03-17 23:43:36 +00:00
gdkconfig_cdata.set('GDK_RENDERING_VULKAN', have_vulkan)
2016-08-23 06:21:54 +00:00
gdkconfig = configure_file(
input: 'gdkconfig.h.meson',
output: 'gdkconfig.h',
configuration: gdkconfig_cdata,
install_dir: gtk_includedir / 'gtk-4.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)
2016-08-23 06:21:54 +00:00
gdkversionmacros = configure_file(
input: 'gdkversionmacros.h.in',
output: 'gdkversionmacros.h',
configuration: gdkversion_cdata,
install_dir: gtk_includedir / 'gtk-4.0/gdk',
)
2016-08-23 06:21:54 +00:00
gdkinc = include_directories('.')
gdkx11_inc = include_directories('x11')
gdkwayland_inc = include_directories('wayland')
2016-09-10 18:40:02 +00:00
wlinc = include_directories('.')
win32rcinc = include_directories('win32/rc')
2016-08-21 14:00:37 +00:00
gdk_gen_headers = [gdkenum_h, gdkmarshal_h, gdkconfig, gdkversionmacros]
gdk_deps = [
libm,
pixbuf_dep,
cairo_dep,
pango_dep,
fribidi_dep,
cairogobj_dep,
glib_dep,
gobject_dep,
graphene_dep,
epoxy_dep,
fontconfig_dep,
platform_gio_dep,
2017-03-17 23:43:36 +00:00
pangocairo_dep,
vulkan_dep,
png_dep,
tiff_dep,
jpeg_dep,
]
if profiler_enabled
if libsysprof_capture_dep.found()
gdk_deps += [libsysprof_capture_dep]
endif
endif
# add generated gdk sources
gdk_sources += [
gdkconfig,
gdk_enums,
gdk_marshalers,
2016-08-23 06:21:54 +00:00
gdkresources,
gdkversionmacros,
gdk_private_h_sources,
gdk_public_headers
]
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
libgdk_c_args = [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
]
gdk_backends = []
gdk_backends_gen_headers = [] # non-public generated headers
foreach backend : ['broadway', 'wayland', 'win32', 'x11', 'macos']
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
endif
endforeach
2016-08-23 06:21:54 +00:00
2018-02-27 18:42:28 +00:00
if gdk_backends.length() == 0
error('No backends enabled')
endif
2016-11-03 08:47:00 +00:00
libgdk = static_library('gdk',
sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig],
dependencies: gdk_deps + [libgtk_css_dep],
link_with: [libgtk_css],
include_directories: [confinc, gdkx11_inc, wlinc],
c_args: libgdk_c_args + common_cflags,
link_whole: gdk_backends,
)
# We don't have link_with: to internal static libs here on purpose, just
# list the dependencies and generated headers and such, for use in the
# "public" libgtk_dep used by internal executables.
libgdk_dep = declare_dependency(
2016-08-23 06:21:54 +00:00
sources: ['gdk.h', gdkconfig, gdkenum_h],
include_directories: [confinc, gdkx11_inc, wlinc],
dependencies: gdk_deps + [libgtk_css_dep],
)