Commit 500ca7b6 authored by zandobersek@gmail.com's avatar zandobersek@gmail.com

[GTK] Add support for the Wayland build target

https://bugs.webkit.org/show_bug.cgi?id=120627

Reviewed by Gustavo Noronha Silva.

.: 

Add support for building the GTK port with Wayland as the target. The Wayland target can be the sole target
that's enabled, or it can be enabled in parallel with the X11 target.

Each of those two targets, when enabled, checks for the corresponding GTK+ windowing dependency being present.
In the case of only the Wayland target being enabled, the accelerated compositing feature is disabled at
build-time as the feature is not yet supported under the Wayland display protocol. X11-based plugin support is
also disabled under that configuration, even if the WebKitPluginProcess is still built but is left non-operational.
GLX support is also disabled if not building the X11 target.

The Wayland target can be enabled through using the --with-target configuration option that now accepts two
additional values:
- 'wayland' - only enables the Wayland target,
- 'x11,wayland' - enables the X11 and Wayland targets that are to be built in parallel.

This makes it possible to build the GTK port of WebKit with the Wayland target, relying solely on the GTK+
dependency that only has the Wayland backend enabled, and removes linking against any X11-related library.
Note that at the moment there seem to be other dependencies that still link to X11-related libraries.
Complete functionality is not yet guaranteed, but is of course the goal.

* Source/autotools/FindDependencies.m4: Store the version of the basic GTK+ dependency that was found.
This is later used to check that the GTK+ X11 and GTK+ Wayland dependencies are of the same version. The
X11-specific dependencies are grouped into one section (apart from the XComposite and XDamage dependencies),
also checking for the GTK+ X11 dependency. If the X11 target is not enabled, the GLX dependency is disabled.
Additionally check for the GTK+ Wayland dependency if the Wayland target is enabled.
We only check for the presence and correct version of the GTK+ X11 and Wayland dependencies, if necessary.
Check for the XComposite and XDamage dependencies if the X11 target is enabled (in addition to the OpenGL
headers being present).
In case of the Wayland target being enabled while the X11 target is not, disable the accelerated compositing
feature as there's no support yet for it under the Wayland display protocol.
* Source/autotools/PrintBuildConfiguration.m4: The build configuration should now print out 'GDK targets'.
* Source/autotools/ReadCommandLineArguments.m4: The --with-target option can now take two additional values,
'wayland' and 'x11,wayland'. The first one enables only the Wayland target, while the second one enables both
X11 and Wayland targets. This makes it possible to build the GTK port with both X11 and Wayland display protocols
supported in the same build.
We must now check the outcoming with_target variable to see if the special case of building one or both of the
possible parallel targets was chosen. We define with_x11_target and with_wayland_target variables if the
with_target value applies to that case.
* Source/autotools/SetupAutoconfHeader.m4: Do not define the XP_UNIX macro on builds that enable the Wayland-only
target. It should still be defined if we're building both X11 and Wayland targets in parallel.
* Source/autotools/SetupAutomake.m4: Define TARGET_X11 and TARGET_WAYLAND Automake conditionals if the new
with_x11_target or with_wayland_target variables were set, respectively. Additionall, define the TARGET_X11_OR_WAYLAND
Automake conditional if we're building either of the two targets.

Source/WebCore: 

* GNUmakefile.list.am: Reorder the Source/WebCore/plugins/np* source files.
The X11-specific source files should only be included if the X11 target is being built. PluginPackageNone and
PluginViewNone source files must be included in non-X11-target builds. Other source files that were previously
guarded with the TARGET_X11 conditional should also be built for the Wayland target, so the new TARGET_X11_OR_WAYLAND
conditional is used. If neither of those two targets is being built we fall back to adding source files to the build
as necessary by the actual build target.
* platform/gtk/GtkVersioning.c:
(gdk_screen_get_monitor_workarea): Additionally guard bits of code that depend on the GDK_WINDOWING_X11 macro being
defined - these should only be built when building the X11 target, checked for with PLATFORM(X11).

Source/WebKit/gtk: 

* WebCoreSupport/ChromeClientGtk.cpp:
(WebKit::createBackingStore): Additionally guard the <gdk/gdkx.h> inclusion and the inclusion and use of
WidgetBackingStoreGtkX11 with PLATFORM(X11), ensuring this code is built when also building with X11 target
enabled. GDK_WINDOWING_X11 macro can be defined even if the X11 target is disabled.

Source/WebKit2: 

* GNUmakefile.list.am: Build X11-specific NetscapePluginModule and NetscapePlugin classes if building the X11 target,
fall back to the generic, empty classes otherwise.
* PluginProcess/unix/PluginProcessMainUnix.cpp:
(WebKit::PluginProcessMainUnix): Guard the NetscapePluginModule::scanPlugin() invocation with PLUGIN_ARCHITECTURE(X11),
it's at the moment specific to the X11 implementation of the Netscape plugins.
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: Guard PluginProcessProxy::scanPlugin() with PLUGIN_ARCHITECTURE(X11),
just like it's guarded in the PluginProcessProxy class declaration.
* UIProcess/cairo/BackingStoreCairo.cpp: Additionally guard <gdk/gdkx.h> and WidgetBackingStoreGtkX11 inclusion and use
with PLATFORM(X11), this code should only be built when building the X11 target.
(WebKit::createBackingStoreForGTK):
* UIProcess/gtk/WebPageProxyGtk.cpp: Guard the createPluginContainer() and windowedPluginGeometryDidChange() methods and their
helper functions and objects with PLUGIN_ARCHITECTURE(X11), just like they're guarded in the WebPageProxy class declaration.
* config.h: Only define PLUGIN_ARCHITECTURE_X11 to 1 if we're actually building the X11 target.

Tools: 

* GNUmakefile.am: Define the additional macros also if building the Wayland target.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7f9ac377
2013-09-04 Zan Dobersek <zdobersek@igalia.com>
[GTK] Add support for the Wayland build target
https://bugs.webkit.org/show_bug.cgi?id=120627
Reviewed by Gustavo Noronha Silva.
Add support for building the GTK port with Wayland as the target. The Wayland target can be the sole target
that's enabled, or it can be enabled in parallel with the X11 target.
Each of those two targets, when enabled, checks for the corresponding GTK+ windowing dependency being present.
In the case of only the Wayland target being enabled, the accelerated compositing feature is disabled at
build-time as the feature is not yet supported under the Wayland display protocol. X11-based plugin support is
also disabled under that configuration, even if the WebKitPluginProcess is still built but is left non-operational.
GLX support is also disabled if not building the X11 target.
The Wayland target can be enabled through using the --with-target configuration option that now accepts two
additional values:
- 'wayland' - only enables the Wayland target,
- 'x11,wayland' - enables the X11 and Wayland targets that are to be built in parallel.
This makes it possible to build the GTK port of WebKit with the Wayland target, relying solely on the GTK+
dependency that only has the Wayland backend enabled, and removes linking against any X11-related library.
Note that at the moment there seem to be other dependencies that still link to X11-related libraries.
Complete functionality is not yet guaranteed, but is of course the goal.
* Source/autotools/FindDependencies.m4: Store the version of the basic GTK+ dependency that was found.
This is later used to check that the GTK+ X11 and GTK+ Wayland dependencies are of the same version. The
X11-specific dependencies are grouped into one section (apart from the XComposite and XDamage dependencies),
also checking for the GTK+ X11 dependency. If the X11 target is not enabled, the GLX dependency is disabled.
Additionally check for the GTK+ Wayland dependency if the Wayland target is enabled.
We only check for the presence and correct version of the GTK+ X11 and Wayland dependencies, if necessary.
Check for the XComposite and XDamage dependencies if the X11 target is enabled (in addition to the OpenGL
headers being present).
In case of the Wayland target being enabled while the X11 target is not, disable the accelerated compositing
feature as there's no support yet for it under the Wayland display protocol.
* Source/autotools/PrintBuildConfiguration.m4: The build configuration should now print out 'GDK targets'.
* Source/autotools/ReadCommandLineArguments.m4: The --with-target option can now take two additional values,
'wayland' and 'x11,wayland'. The first one enables only the Wayland target, while the second one enables both
X11 and Wayland targets. This makes it possible to build the GTK port with both X11 and Wayland display protocols
supported in the same build.
We must now check the outcoming with_target variable to see if the special case of building one or both of the
possible parallel targets was chosen. We define with_x11_target and with_wayland_target variables if the
with_target value applies to that case.
* Source/autotools/SetupAutoconfHeader.m4: Do not define the XP_UNIX macro on builds that enable the Wayland-only
target. It should still be defined if we're building both X11 and Wayland targets in parallel.
* Source/autotools/SetupAutomake.m4: Define TARGET_X11 and TARGET_WAYLAND Automake conditionals if the new
with_x11_target or with_wayland_target variables were set, respectively. Additionall, define the TARGET_X11_OR_WAYLAND
Automake conditional if we're building either of the two targets.
2013-09-03 Patrick Gansterer <paroga@webkit.org>
[CMake] Fix detection of x86_64 platform with MSVC
......
2013-09-04 Zan Dobersek <zdobersek@igalia.com>
[GTK] Add support for the Wayland build target
https://bugs.webkit.org/show_bug.cgi?id=120627
Reviewed by Gustavo Noronha Silva.
* GNUmakefile.list.am: Reorder the Source/WebCore/plugins/np* source files.
The X11-specific source files should only be included if the X11 target is being built. PluginPackageNone and
PluginViewNone source files must be included in non-X11-target builds. Other source files that were previously
guarded with the TARGET_X11 conditional should also be built for the Wayland target, so the new TARGET_X11_OR_WAYLAND
conditional is used. If neither of those two targets is being built we fall back to adding source files to the build
as necessary by the actual build target.
* platform/gtk/GtkVersioning.c:
(gdk_screen_get_monitor_workarea): Additionally guard bits of code that depend on the GDK_WINDOWING_X11 macro being
defined - these should only be built when building the X11 target, checked for with PLATFORM(X11).
2013-09-04 Mario Sanchez Prada <mario.prada@samsung.com>
[GTK] Reimplement atk_text_get_text_*_offset for SENTENCE boundaries
......@@ -4291,9 +4291,6 @@ webcore_sources += \
Source/WebCore/page/WindowFocusAllowedIndicator.h \
Source/WebCore/page/WorkerNavigator.cpp \
Source/WebCore/page/WorkerNavigator.h \
Source/WebCore/plugins/npapi.h \
Source/WebCore/plugins/npruntime.h \
Source/WebCore/plugins/nptypes.h \
Source/WebCore/plugins/DOMMimeTypeArray.cpp \
Source/WebCore/plugins/DOMMimeTypeArray.h \
Source/WebCore/plugins/DOMMimeType.cpp \
......@@ -4302,8 +4299,6 @@ webcore_sources += \
Source/WebCore/plugins/DOMPluginArray.h \
Source/WebCore/plugins/DOMPlugin.cpp \
Source/WebCore/plugins/DOMPlugin.h \
Source/WebCore/plugins/npapi.cpp \
Source/WebCore/plugins/npfunctions.h \
Source/WebCore/plugins/PluginDatabase.cpp \
Source/WebCore/plugins/PluginDatabase.h \
Source/WebCore/plugins/PluginData.cpp \
......@@ -4321,6 +4316,11 @@ webcore_sources += \
Source/WebCore/plugins/PluginViewBase.h \
Source/WebCore/plugins/PluginView.cpp \
Source/WebCore/plugins/PluginView.h \
Source/WebCore/plugins/npapi.cpp \
Source/WebCore/plugins/npapi.h \
Source/WebCore/plugins/npfunctions.h \
Source/WebCore/plugins/npruntime.h \
Source/WebCore/plugins/nptypes.h \
Source/WebCore/rendering/AutoTableLayout.cpp \
Source/WebCore/rendering/AutoTableLayout.h \
Source/WebCore/rendering/BidiRun.cpp \
......@@ -6262,7 +6262,20 @@ webcoregtk_sources += \
Source/WebCore/plugins/gtk/xembed.h
platformgtk_sources += \
Source/WebCore/platform/gtk/WidgetBackingStoreGtkX11.h \
Source/WebCore/platform/gtk/WidgetBackingStoreGtkX11.cpp \
Source/WebCore/platform/gtk/WidgetBackingStoreGtkX11.cpp
if USE_GLX
webcoregtk_sources += \
Source/WebCore/platform/graphics/glx/GLContextGLX.cpp \
Source/WebCore/platform/graphics/glx/GLContextGLX.h
endif # END USE_GLX
else
webcore_sources += \
Source/WebCore/plugins/PluginPackageNone.cpp \
Source/WebCore/plugins/PluginViewNone.cpp
endif # END TARGET_X11
if TARGET_X11_OR_WAYLAND
platformgtk_sources += \
Source/WebCore/platform/cairo/WidgetBackingStoreCairo.h \
Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp
if USE_OPENGL
......@@ -6277,11 +6290,6 @@ webcoregtk_sources += \
Source/WebCore/platform/graphics/egl/GLContextEGL.cpp \
Source/WebCore/platform/graphics/egl/GLContextEGL.h
endif # END USE_EGL
if USE_GLX
webcoregtk_sources += \
Source/WebCore/platform/graphics/glx/GLContextGLX.cpp \
Source/WebCore/platform/graphics/glx/GLContextGLX.h
endif # END USE_GLX
else
if TARGET_WIN32
webcore_sources += \
......@@ -6310,7 +6318,7 @@ webcore_sources += \
Source/WebCore/plugins/PluginPackageNone.cpp \
Source/WebCore/plugins/PluginViewNone.cpp
endif # END TARGET_WIN32
endif # END TARGET_X11
endif # END TARGET_X11_OR_WAYLAND
if USE_GLES2
webcore_sources += \
......
......@@ -23,7 +23,7 @@
#include <gtk/gtk.h>
#ifdef GDK_WINDOWING_X11
#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
#include <X11/Xatom.h>
#include <gdk/gdkx.h>
#endif
......@@ -200,7 +200,7 @@ gdk_pixbuf_get_from_surface(cairo_surface_t * surface,
return dest;
}
#ifdef GDK_WINDOWING_X11
#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
static int getScreenCurrentDesktop(GdkScreen *screen)
{
Display *display = GDK_DISPLAY_XDISPLAY(gdk_screen_get_display(screen));
......@@ -257,13 +257,13 @@ static void getScreenWorkArea(GdkScreen *screen, GdkRectangle *area)
XFree(returnedData);
}
#endif // GDK_WINDOWING_X11
#endif // PLATFORM(X11) && defined(GDK_WINDOWING_X11)
void gdk_screen_get_monitor_workarea(GdkScreen *screen, int monitor, GdkRectangle *area)
{
gdk_screen_get_monitor_geometry(screen, monitor, area);
#ifdef GDK_WINDOWING_X11
#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
GdkRectangle workArea;
getScreenWorkArea(screen, &workArea);
gdk_rectangle_intersect(&workArea, area, area);
......
2013-09-04 Zan Dobersek <zdobersek@igalia.com>
[GTK] Add support for the Wayland build target
https://bugs.webkit.org/show_bug.cgi?id=120627
Reviewed by Gustavo Noronha Silva.
* WebCoreSupport/ChromeClientGtk.cpp:
(WebKit::createBackingStore): Additionally guard the <gdk/gdkx.h> inclusion and the inclusion and use of
WidgetBackingStoreGtkX11 with PLATFORM(X11), ensuring this code is built when also building with X11 target
enabled. GDK_WINDOWING_X11 macro can be defined even if the X11 target is disabled.
2013-09-02 Brian Holt <brian.holt@samsung.com>
[ATK] Leak: Leaks in testatk.c
......
......@@ -75,7 +75,7 @@
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>
#ifdef GDK_WINDOWING_X11
#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
#define Font XFont
#define Cursor XCursor
#define Region XRegion
......@@ -95,7 +95,7 @@
#include "HTMLMediaElement.h"
#endif
#ifdef GDK_WINDOWING_X11
#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
#include "WidgetBackingStoreGtkX11.h"
#endif
#include "WidgetBackingStoreCairo.h"
......@@ -106,7 +106,7 @@ namespace WebKit {
static PassOwnPtr<WidgetBackingStore> createBackingStore(GtkWidget* widget, const IntSize& size)
{
#ifdef GDK_WINDOWING_X11
#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get());
if (GDK_IS_X11_DISPLAY(display))
return WebCore::WidgetBackingStoreGtkX11::create(widget, size);
......
2013-09-04 Zan Dobersek <zdobersek@igalia.com>
[GTK] Add support for the Wayland build target
https://bugs.webkit.org/show_bug.cgi?id=120627
Reviewed by Gustavo Noronha Silva.
* GNUmakefile.list.am: Build X11-specific NetscapePluginModule and NetscapePlugin classes if building the X11 target,
fall back to the generic, empty classes otherwise.
* PluginProcess/unix/PluginProcessMainUnix.cpp:
(WebKit::PluginProcessMainUnix): Guard the NetscapePluginModule::scanPlugin() invocation with PLUGIN_ARCHITECTURE(X11),
it's at the moment specific to the X11 implementation of the Netscape plugins.
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: Guard PluginProcessProxy::scanPlugin() with PLUGIN_ARCHITECTURE(X11),
just like it's guarded in the PluginProcessProxy class declaration.
* UIProcess/cairo/BackingStoreCairo.cpp: Additionally guard <gdk/gdkx.h> and WidgetBackingStoreGtkX11 inclusion and use
with PLATFORM(X11), this code should only be built when building the X11 target.
(WebKit::createBackingStoreForGTK):
* UIProcess/gtk/WebPageProxyGtk.cpp: Guard the createPluginContainer() and windowedPluginGeometryDidChange() methods and their
helper functions and objects with PLUGIN_ARCHITECTURE(X11), just like they're guarded in the WebPageProxy class declaration.
* config.h: Only define PLUGIN_ARCHITECTURE_X11 to 1 if we're actually building the X11 target.
2013-09-03 Darin Adler <darin@apple.com>
REGRESSION (r154967) window resize is very choppy
......
......@@ -445,7 +445,6 @@ webkit2_sources += \
Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp \
Source/WebKit2/Shared/Plugins/Netscape/PluginInformation.cpp \
Source/WebKit2/Shared/Plugins/Netscape/PluginInformation.h \
Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp \
Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp \
Source/WebKit2/Shared/Plugins/NPIdentifierData.h \
Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp \
......@@ -1141,7 +1140,6 @@ webkit2_sources += \
Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp \
Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.h \
Source/WebKit2/WebProcess/Plugins/Netscape/unix/PluginProxyUnix.cpp \
Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp \
Source/WebKit2/WebProcess/Plugins/PluginController.h \
Source/WebKit2/WebProcess/Plugins/Plugin.cpp \
Source/WebKit2/WebProcess/Plugins/Plugin.h \
......@@ -1261,6 +1259,16 @@ webkit2_sources += \
Source/WebKit2/WebProcess/WebProcess.cpp \
Source/WebKit2/WebProcess/WebProcess.h
if TARGET_X11
webkit2_sources += \
Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp \
Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp \
else
webkit2_sources += \
Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp \
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginNone.cpp
endif # END TARGET_X11
if USE_TEXTURE_MAPPER_GL
webkit2_sources += \
Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp \
......@@ -1313,7 +1321,6 @@ webkit2_plugin_process_sources += \
Source/WebKit2/Shared/Plugins/NPVariantData.h \
Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp \
Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h \
Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp \
Source/WebKit2/Shared/ShareableBitmap.cpp \
Source/WebKit2/Shared/ShareableBitmap.h \
Source/WebKit2/Shared/WebCoreArgumentCoders.cpp \
......@@ -1347,5 +1354,14 @@ webkit2_plugin_process_sources += \
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h \
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp \
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h \
Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp \
Source/WebKit2/unix/PluginMainUnix.cpp
if TARGET_X11
webkit2_plugin_process_sources += \
Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp \
Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
else
webkit2_plugin_process_sources += \
Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp \
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginNone.cpp
endif # END TARGET_X11
......@@ -36,8 +36,10 @@
#include "WebKit2Initialize.h"
#include <WebCore/RunLoop.h>
#if PLATFORM(GTK)
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
#include <gdk/gdkx.h>
#endif
#elif PLATFORM(EFL) && HAVE_ECORE_X
#include <Ecore_X.h>
#endif
......@@ -73,7 +75,9 @@ static int webkitXError(Display* xdisplay, XErrorEvent* error)
WK_EXPORT int PluginProcessMainUnix(int argc, char* argv[])
{
#if PLUGIN_ARCHITECTURE(X11)
bool scanPlugin = !strcmp(argv[1], "-scanPlugin");
#endif
ASSERT_UNUSED(argc, argc == 3);
#if PLATFORM(GTK)
......@@ -87,12 +91,14 @@ WK_EXPORT int PluginProcessMainUnix(int argc, char* argv[])
InitializeWebKit2();
#if PLUGIN_ARCHITECTURE(X11)
if (scanPlugin) {
String pluginPath(argv[2]);
if (!NetscapePluginModule::scanPlugin(pluginPath))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
#endif
// Plugins can produce X errors that are handled by the GDK X error handler, which
// exits the process. Since we don't want to crash due to plugin bugs, we install a
......
......@@ -59,6 +59,7 @@ void PluginProcessProxy::platformInitializePluginProcess(PluginProcessCreationPa
{
}
#if PLUGIN_ARCHITECTURE(X11)
bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData& result)
{
#if PLATFORM(GTK) || PLATFORM(EFL)
......@@ -107,6 +108,7 @@ bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData&
return false;
#endif // PLATFORM(GTK) || PLATFORM(EFL)
}
#endif // PLUGIN_ARCHITECTURE(X11)
} // namespace WebKit
......
......@@ -34,7 +34,7 @@
#include <WebCore/WidgetBackingStoreCairo.h>
#include <cairo.h>
#if PLATFORM(GTK) && defined(GDK_WINDOWING_X11)
#if PLATFORM(GTK) && PLATFORM(X11) && defined(GDK_WINDOWING_X11)
#include <WebCore/WidgetBackingStoreGtkX11.h>
#include <gdk/gdkx.h>
#endif
......@@ -50,7 +50,7 @@ namespace WebKit {
#if PLATFORM(GTK)
static OwnPtr<WidgetBackingStore> createBackingStoreForGTK(GtkWidget* widget, const IntSize& size)
{
#ifdef GDK_WINDOWING_X11
#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get());
if (GDK_IS_X11_DISPLAY(display))
return WebCore::WidgetBackingStoreGtkX11::create(widget, size);
......
......@@ -71,6 +71,7 @@ void WebPageProxy::loadRecentSearches(const String&, Vector<String>&)
notImplemented();
}
#if PLUGIN_ARCHITECTURE(X11)
typedef HashMap<uint64_t, GtkWidget* > PluginWindowMap;
static PluginWindowMap& pluginWindowMap()
{
......@@ -111,6 +112,7 @@ void WebPageProxy::windowedPluginGeometryDidChange(const WebCore::IntRect& frame
webkitWebViewBaseChildMoveResize(WEBKIT_WEB_VIEW_BASE(viewWidget()), plugin, frameRect);
}
#endif // PLUGIN_ARCHITECTURE(X11)
void WebPageProxy::setInputMethodState(bool enabled)
{
......
......@@ -102,7 +102,7 @@ static const type& name() \
#ifndef PLUGIN_ARCHITECTURE_UNSUPPORTED
#if PLATFORM(MAC)
#define PLUGIN_ARCHITECTURE_MAC 1
#elif (PLATFORM(GTK) || PLATFORM(EFL)) && (OS(UNIX) && !OS(MAC_OS_X))
#elif (PLATFORM(GTK) || PLATFORM(EFL)) && (OS(UNIX) && !OS(MAC_OS_X)) && PLATFORM(X11)
#define PLUGIN_ARCHITECTURE_X11 1
#elif PLATFORM(QT)
// Qt handles this features.prf
......
......@@ -165,8 +165,18 @@ if test "$with_target" = "directfb"; then
else
PKG_CHECK_MODULES(CAIRO, cairo >= cairo_required_version)
PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED_VERSION)
GTK_ACTUAL_VERSION=`pkg-config --modversion gtk+-$GTK_API_VERSION`
fi
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
AC_SUBST(CAIRO_CFLAGS)
AC_SUBST(CAIRO_LIBS)
if test "$with_x11_target" = "yes"; then
# The GTK+ X11 target dependency should match the version of the master GTK+ dependency.
PKG_CHECK_MODULES(GTK_X11, gtk+-x11-$GTK_API_VERSION = $GTK_ACTUAL_VERSION)
if test "$with_target" = "x11" && test "$os_win32" = "no"; then
if test "$os_win32" = "no"; then
PKG_CHECK_MODULES([XT], [xt], [xt_has_pkg_config=yes], [xt_has_pkg_config=no])
# Some old versions of Xt do not provide xt.pc, so try to link against Xt
......@@ -180,12 +190,24 @@ else
AC_SUBST([XT_CFLAGS])
AC_SUBST([XT_LIBS])
fi
fi
# Check for XRender under Linux/Unix. Some linkers require explicit linkage (like GNU Gold),
# so we cannot rely on GTK+ pulling XRender.
if test "$with_x11_target" = "yes"; then
PKG_CHECK_MODULES([XRENDER], [xrender])
AC_SUBST([XRENDER_CFLAGS])
AC_SUBST([XRENDER_LIBS])
fi
elif test "enable_glx" != "no"; then
AC_MSG_WARN([X11 target support not enabled, disabling GLX support.])
enable_glx=no
fi
if test "$with_wayland_target" = "yes"; then
# The GTK+ Wayland target dependency should match the version of the master GTK+ dependency.
PKG_CHECK_MODULES(GTK_WAYLAND, gtk+-wayland-$GTK_API_VERSION = $GTK_ACTUAL_VERSION)
fi
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
AC_SUBST(CAIRO_CFLAGS)
AC_SUBST(CAIRO_LIBS)
AC_CHECK_HEADERS([GL/glx.h], [have_glx="yes"], [have_glx="no"])
AC_MSG_CHECKING([whether to enable GLX support])
......@@ -253,9 +275,9 @@ else
AC_CHECK_HEADERS([GL/gl.h], [found_opengl="yes"], [])
fi
if test "$found_opengl" = "yes"; then
PKG_CHECK_MODULES([XCOMPOSITE], [xcomposite]);
PKG_CHECK_MODULES([XDAMAGE], [xdamage]);
if test "$with_x11_target" = "yes" && test "$found_opengl" = "yes"; then
PKG_CHECK_MODULES([XCOMPOSITE], [xcomposite])
PKG_CHECK_MODULES([XDAMAGE], [xdamage])
AC_SUBST(XCOMPOSITE_CFLAGS)
AC_SUBST(XCOMPOSITE_LIBS)
AC_SUBST(XDAMAGE_CFLAGS)
......@@ -273,6 +295,11 @@ if test "$enable_webgl" != "no"; then
fi
fi
if test "$with_x11_target" != "yes" && test "$with_wayland_target" = "yes" && test "enable_accelerated_compositing" != "no"; then
AC_MSG_WARN([Accelerated compositing for Wayland is not yet implemented, disabling due to the Wayland-only target.])
enable_accelerated_compositing=no
fi
if test "$enable_accelerated_compositing" != "no"; then
if test "$found_opengl" = "yes"; then
enable_accelerated_compositing=yes
......@@ -387,14 +414,6 @@ if test "$enable_geolocation" = "yes"; then
AC_SUBST([GEOCLUE_LIBS])
fi
# Check for XRender under Linux/Unix. Some linkers require explicit linkage (like GNU Gold),
# so we cannot rely on GTK+ pulling XRender.
if test "$with_target" = "x11"; then
PKG_CHECK_MODULES([XRENDER], [xrender])
AC_SUBST([XRENDER_CFLAGS])
AC_SUBST([XRENDER_LIBS])
fi
if test "$enable_video" = "yes" || test "$enable_web_audio" = "yes"; then
PKG_CHECK_MODULES([GSTREAMER], [
gstreamer-1.0 >= gstreamer_required_version
......
......@@ -34,7 +34,7 @@ Features:
GTK+ configuration:
GTK+ version : $with_gtk
GDK target : $with_target
GDK targets : $with_target
Introspection support : $enable_introspection
Generate documentation : $enable_gtk_doc
"
......@@ -47,16 +47,33 @@ AC_MSG_RESULT([$with_gtk])
AC_MSG_CHECKING([the target windowing system])
AC_ARG_WITH(target,
AC_HELP_STRING([--with-target=@<:@x11/win32/quartz/directfb@:>@], [Select webkit target [default=x11]]),
AC_HELP_STRING([--with-target=@<:@x11/wayland/x11,wayland/win32/quartz/directfb@:>@], [Select webkit target [default=x11]]),
[
case "$with_target" in
x11|win32|quartz|directfb) ;;
*) AC_MSG_ERROR([Invalid target: must be x11, quartz, win32, or directfb.]) ;;
x11|wayland|x11,wayland|win32|quartz|directfb) ;;
*) AC_MSG_ERROR([Invalid target: must be x11, wayland, both x11 and wayland (x11,wayland), quartz, win32, or directfb.]) ;;
esac
],
[with_target="x11"])
AC_MSG_RESULT([$with_target])
# To support building for X11 and Wayland targets concurrently, the $with_target value is checked for this
# special case and two additional variables are introduced that denote specifically whether we're building
# the X11 target, the Wayland target, both of these or neither.
if test "$with_target" = "x11,wayland"; then
with_x11_target=yes
with_wayland_target=yes
elif test "$with_target" = "x11"; then
with_x11_target=yes
with_wayland_target=no
elif test "$with_target" = "wayland"; then
with_x11_target=no
with_wayland_target=yes
else
with_x11_target=no
with_wayland_target=no
fi
AC_MSG_CHECKING([whether to enable spellcheck support])
AC_ARG_ENABLE([spellcheck],
[AS_HELP_STRING([--enable-spellcheck],[enable support for spellcheck])],
......
......@@ -36,15 +36,19 @@ if test "$os_win32" = "yes"; then
AC_DEFINE([XP_WIN], [1], [ ])
AC_DEFINE([UNICODE], [1], [ ])
AC_DEFINE([_UNICODE], [1], [ ])
else
elif test "$with_x11_target" = "yes" || test "$with_wayland_target" != "yes"; then
AC_DEFINE([XP_UNIX], [1], [ ])
fi
if test "$with_target" = "x11"; then
if test "$with_x11_target" = "yes"; then
AC_DEFINE([MOZ_X11], [1], [ ])
AC_DEFINE([WTF_PLATFORM_X11], [1], [Define if target is X11])
fi
if test "$with_wayland_target" = "yes"; then
AC_DEFINE([WTF_PLATFORM_WAYLAND], [1], [Define if target is Wayland])
fi
if test "$enable_fast_malloc" = "no"; then
AC_DEFINE([WTF_SYSTEM_MALLOC], [1], [ ])
fi
......
......@@ -23,7 +23,9 @@ AM_CONDITIONAL([OS_DARWIN],[test "$os_darwin" = "yes"])
AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
# Target conditionals.
AM_CONDITIONAL([TARGET_X11], [test "$with_target" = "x11"])
AM_CONDITIONAL([TARGET_X11], [test "$with_x11_target" = "yes"])
AM_CONDITIONAL([TARGET_WAYLAND], [test "$with_wayland_target" = "yes"])
AM_CONDITIONAL([TARGET_X11_OR_WAYLAND], [test "$with_x11_target" = "yes" || test "$with_wayland_target" = "yes"])
AM_CONDITIONAL([TARGET_WIN32], [test "$with_target" = "win32"])
AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"])
AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"])
......
2013-09-04 Zan Dobersek <zdobersek@igalia.com>
[GTK] Add support for the Wayland build target
https://bugs.webkit.org/show_bug.cgi?id=120627
Reviewed by Gustavo Noronha Silva.
* GNUmakefile.am: Define the additional macros also if building the Wayland target.
2013-09-04 Andre Moreira Magalhaes <andre.magalhaes@collabora.co.uk>
[GStreamer] cannot play live streams
......
......@@ -122,7 +122,7 @@ Programs_DumpRenderTree_CPPFLAGS = \
$(platformgtk_cppflags) \
$(webcore_cppflags)
if TARGET_X11
if TARGET_X11_OR_WAYLAND
Programs_DumpRenderTree_CPPFLAGS += \
-DTEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" \
-DFONTS_CONF_DIR=\"${shell pwd}/${srcdir}/Tools/DumpRenderTree/gtk/fonts\"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment