Skip to content

Commit

Permalink
[WPE] Add the WebKitVersion.h header
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=191015

Reviewed by Michael Catanzaro.

Source/WebKit:

Add the WebKitVersion.h API header for the WPE port. As with other
headers providing the GLib API, we have to provide a WPE-specific
version, but the implementation file can be shared with the GTK port,
and is moved under the UIProcess/API/glib/ directory accordingly.

* PlatformWPE.cmake:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitVersion.cpp: Renamed from Source/WebKit/UIProcess/API/gtk/WebKitVersion.cpp.
* UIProcess/API/wpe/WebKitVersion.h.in: Added.
* UIProcess/API/wpe/webkit.h:

Tools:

* MiniBrowser/wpe/main.cpp:
(automationStartedCallback): Remove the FIXME and finally enable the
webkit_application_info_set_version() call.
* TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp: Remove
this FIXME as well and remove the custom WEBKIT_*_VERSION macros.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@237541 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
[email protected] committed Oct 29, 2018
1 parent f24bbd3 commit 9361882
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 10 deletions.
18 changes: 18 additions & 0 deletions Source/WebKit/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
2018-10-28 Zan Dobersek <[email protected]>

[WPE] Add the WebKitVersion.h header
https://bugs.webkit.org/show_bug.cgi?id=191015

Reviewed by Michael Catanzaro.

Add the WebKitVersion.h API header for the WPE port. As with other
headers providing the GLib API, we have to provide a WPE-specific
version, but the implementation file can be shared with the GTK port,
and is moved under the UIProcess/API/glib/ directory accordingly.

* PlatformWPE.cmake:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitVersion.cpp: Renamed from Source/WebKit/UIProcess/API/gtk/WebKitVersion.cpp.
* UIProcess/API/wpe/WebKitVersion.h.in: Added.
* UIProcess/API/wpe/webkit.h:

2018-10-26 Megan Gardner <[email protected]>

Remove Unused WebSelectionAssistant
Expand Down
1 change: 1 addition & 0 deletions Source/WebKit/PlatformWPE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ file(MAKE_DIRECTORY ${FORWARDING_HEADERS_WPE_DIR})
file(MAKE_DIRECTORY ${FORWARDING_HEADERS_WPE_EXTENSION_DIR})
file(MAKE_DIRECTORY ${FORWARDING_HEADERS_WPE_DOM_DIR})

configure_file(UIProcess/API/wpe/WebKitVersion.h.in ${DERIVED_SOURCES_WPE_API_DIR}/WebKitVersion.h)
configure_file(wpe/wpe-webkit.pc.in ${CMAKE_BINARY_DIR}/wpe-webkit-${WPE_API_VERSION}.pc @ONLY)
configure_file(wpe/wpe-web-extension.pc.in ${CMAKE_BINARY_DIR}/wpe-web-extension-${WPE_API_VERSION}.pc @ONLY)

Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/SourcesGTK.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ UIProcess/API/glib/WebKitURISchemeRequest.cpp @no-unify
UIProcess/API/glib/WebKitUserContent.cpp @no-unify
UIProcess/API/glib/WebKitUserContentManager.cpp @no-unify
UIProcess/API/glib/WebKitUserMediaPermissionRequest.cpp @no-unify
UIProcess/API/glib/WebKitVersion.cpp @no-unify
UIProcess/API/glib/WebKitWebContext.cpp @no-unify
UIProcess/API/glib/WebKitWebResource.cpp @no-unify
UIProcess/API/glib/WebKitWebView.cpp @no-unify
Expand All @@ -191,7 +192,6 @@ UIProcess/API/gtk/WebKitPrintOperation.cpp @no-unify
UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp @no-unify
UIProcess/API/gtk/WebKitScriptDialogGtk.cpp @no-unify
UIProcess/API/gtk/WebKitScriptDialogImpl.cpp @no-unify
UIProcess/API/gtk/WebKitVersion.cpp @no-unify
UIProcess/API/gtk/WebKitWebInspector.cpp @no-unify
UIProcess/API/gtk/WebKitWebViewBase.cpp @no-unify
UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp @no-unify
Expand Down
1 change: 1 addition & 0 deletions Source/WebKit/SourcesWPE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ UIProcess/API/glib/WebKitURISchemeRequest.cpp @no-unify
UIProcess/API/glib/WebKitUserContent.cpp @no-unify
UIProcess/API/glib/WebKitUserContentManager.cpp @no-unify
UIProcess/API/glib/WebKitUserMediaPermissionRequest.cpp @no-unify
UIProcess/API/glib/WebKitVersion.cpp @no-unify
UIProcess/API/glib/WebKitWebContext.cpp @no-unify
UIProcess/API/glib/WebKitWebResource.cpp @no-unify
UIProcess/API/glib/WebKitWebView.cpp @no-unify
Expand Down
84 changes: 84 additions & 0 deletions Source/WebKit/UIProcess/API/wpe/WebKitVersion.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
* Copyright (C) 2012 Igalia S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/

#if !defined(__WEBKIT_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
#error "Only <wpe/webkit.h> can be included directly."
#endif

#ifndef WebKitVersion_h
#define WebKitVersion_h

#include <wpe/WebKitDefines.h>

G_BEGIN_DECLS

/**
* WEBKIT_MAJOR_VERSION:
*
* Like webkit_get_major_version(), but from the headers used at
* application compile time, rather than from the library linked
* against at application run time.
*/
#define WEBKIT_MAJOR_VERSION (@PROJECT_VERSION_MAJOR@)

/**
* WEBKIT_MINOR_VERSION:
*
* Like webkit_get_minor_version(), but from the headers used at
* application compile time, rather than from the library linked
* against at application run time.
*/
#define WEBKIT_MINOR_VERSION (@PROJECT_VERSION_MINOR@)

/**
* WEBKIT_MICRO_VERSION:
*
* Like webkit_get_micro_version(), but from the headers used at
* application compile time, rather than from the library linked
* against at application run time.
*/
#define WEBKIT_MICRO_VERSION (@PROJECT_VERSION_MICRO@)

/**
* WEBKIT_CHECK_VERSION:
* @major: major version (e.g. 1 for version 1.2.5)
* @minor: minor version (e.g. 2 for version 1.2.5)
* @micro: micro version (e.g. 5 for version 1.2.5)
*
* Returns: %TRUE if the version of the WebKit header files
* is the same as or newer than the passed-in version.
*/
#define WEBKIT_CHECK_VERSION(major, minor, micro) \
(WEBKIT_MAJOR_VERSION > (major) || \
(WEBKIT_MAJOR_VERSION == (major) && WEBKIT_MINOR_VERSION > (minor)) || \
(WEBKIT_MAJOR_VERSION == (major) && WEBKIT_MINOR_VERSION == (minor) && \
WEBKIT_MICRO_VERSION >= (micro)))

WEBKIT_API guint
webkit_get_major_version (void);

WEBKIT_API guint
webkit_get_minor_version (void);

WEBKIT_API guint
webkit_get_micro_version (void);

G_END_DECLS

#endif
1 change: 1 addition & 0 deletions Source/WebKit/UIProcess/API/wpe/webkit.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
#include <wpe/WebKitUserContent.h>
#include <wpe/WebKitUserContentManager.h>
#include <wpe/WebKitUserMediaPermissionRequest.h>
#include <wpe/WebKitVersion.h>
#include <wpe/WebKitWebContext.h>
#include <wpe/WebKitWebResource.h>
#include <wpe/WebKitWebView.h>
Expand Down
13 changes: 13 additions & 0 deletions Tools/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
2018-10-28 Zan Dobersek <[email protected]>

[WPE] Add the WebKitVersion.h header
https://bugs.webkit.org/show_bug.cgi?id=191015

Reviewed by Michael Catanzaro.

* MiniBrowser/wpe/main.cpp:
(automationStartedCallback): Remove the FIXME and finally enable the
webkit_application_info_set_version() call.
* TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp: Remove
this FIXME as well and remove the custom WEBKIT_*_VERSION macros.

2018-10-28 Fujii Hironori <[email protected]>

[Win] Remove obsolete code for vcxproj builds in build-api-tests and build-jsc
Expand Down
3 changes: 1 addition & 2 deletions Tools/MiniBrowser/wpe/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ static WebKitWebView* createWebViewForAutomationCallback(WebKitAutomationSession
static void automationStartedCallback(WebKitWebContext*, WebKitAutomationSession* session, WebKitWebView* view)
{
auto* info = webkit_application_info_new();
// FIXME: add version info when wpe has WebKitVersion.h
// webkit_application_info_set_version(info, WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION, WEBKIT_MICRO_VERSION);
webkit_application_info_set_version(info, WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION, WEBKIT_MICRO_VERSION);
webkit_automation_session_set_application_info(session, info);
webkit_application_info_unref(info);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@
#include <wtf/UUID.h>
#include <wtf/text/StringBuilder.h>

// FIXME: WPE doesn't expose WebKitVersion yet, the numbers defined here don't really matter.
#if PLATFORM(WPE)
#define WEBKIT_MAJOR_VERSION 1
#define WEBKIT_MINOR_VERSION 2
#define WEBKIT_MICRO_VERSION 3
#endif

class AutomationTest: public Test {
public:
MAKE_GLIB_TEST_FIXTURE(AutomationTest);
Expand Down

0 comments on commit 9361882

Please sign in to comment.