Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 014a5fd

Browse files
[WPE] Add gtk-doc
https://bugs.webkit.org/show_bug.cgi?id=178900 Patch by Carlos Eduardo Ramalho <[email protected]> on 2018-12-04 Reviewed by Michael Catanzaro. Add gtk-doc to WPE port. This patch tries to reuse as much code from WebKitGTK+ as possible. .: * Source/PlatformGTK.cmake: include GtkDoc.cmake instead of defining macro. * Source/PlatformWPE.cmake: Added documentation generation. * Source/cmake/GtkDoc.cmake: Added. * Source/cmake/OptionsWPE.cmake: Added ENABLE_GTKDOC build option and added pkg-config path variables. Source/WebKit: * PlatformWPE.cmake: Write variables to gtkdoc-wpe.cfg and gtkdoc-webextensions that is used by python script later. * UIProcess/API/wpe/WebKitWebContext.h: Placed sandbox functions in the same location as in the WebKitGTK+ for consistency. * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Added. * UIProcess/API/wpe/docs/wpe-docs.sgml: Added. * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h: Placed webkit_web_page_get_dom_document in the same position as in the WebKitGTK+ for consistency. * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt: Added. * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-docs.sgml: Added. Tools: * gtkdoc/generate-gtkdoc: Renamed from Tools/gtk/generate-gtkdoc. (get_gtkdoc_module_paths): Add GDK and GTK only if building for GTK. (prepare_environment_for_gtkdoc_generation): (build_gtkdoc_for_wpe): Code to generate doc for WPE. (build_gtkdoc_for_wkgtk): Code to generate doc for WebKitGTK+. Moved from main. * gtkdoc/gtkdoc.py: Renamed from Tools/gtk/gtkdoc.py. (GTKDoc.__init__): Initialized required variables according to pylint. (GTKDoc.api_missing_documentation): * wpe/install-dependencies: Add gtkdoc dependency. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@238853 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent fde8de6 commit 014a5fd

17 files changed

+1904
-48
lines changed

ChangeLog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2018-12-04 Carlos Eduardo Ramalho <[email protected]>
2+
3+
[WPE] Add gtk-doc
4+
https://bugs.webkit.org/show_bug.cgi?id=178900
5+
6+
Reviewed by Michael Catanzaro.
7+
8+
Add gtk-doc to WPE port. This patch tries to reuse as much code from
9+
WebKitGTK+ as possible.
10+
11+
* Source/PlatformGTK.cmake: include GtkDoc.cmake instead of defining macro.
12+
* Source/PlatformWPE.cmake: Added documentation generation.
13+
* Source/cmake/GtkDoc.cmake: Added.
14+
* Source/cmake/OptionsWPE.cmake: Added ENABLE_GTKDOC build option and added pkg-config path variables.
15+
116
2018-12-03 Don Olmstead <[email protected]>
217

318
[CMake] Sync feature defines

Source/PlatformGTK.cmake

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include(GtkDoc)
12
include(WebKitDist)
23

34
add_subdirectory(${WEBCORE_DIR}/platform/gtk/po)
@@ -25,18 +26,7 @@ if (ENABLE_GTKDOC)
2526
)
2627
endif ()
2728

28-
macro(ADD_GTKDOC_GENERATOR _stamp_name _extra_args)
29-
add_custom_command(
30-
OUTPUT "${CMAKE_BINARY_DIR}/${_stamp_name}"
31-
DEPENDS ${DocumentationDependencies}
32-
COMMAND ${CMAKE_COMMAND} -E env "CC=${CMAKE_C_COMPILER}" "CFLAGS=${CMAKE_C_FLAGS} -Wno-unused-parameter" ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc ${_extra_args}
33-
COMMAND touch ${_stamp_name}
34-
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
35-
VERBATIM
36-
)
37-
endmacro()
38-
39-
ADD_GTKDOC_GENERATOR("docs-build.stamp" "")
29+
ADD_GTKDOC_GENERATOR("docs-build.stamp" "--gtk")
4030
if (ENABLE_GTKDOC)
4131
add_custom_target(gtkdoc ALL DEPENDS "${CMAKE_BINARY_DIR}/docs-build.stamp")
4232
elseif (NOT ENABLED_COMPILER_SANITIZERS AND NOT CMAKE_CROSSCOMPILING AND NOT APPLE)
@@ -46,7 +36,7 @@ elseif (NOT ENABLED_COMPILER_SANITIZERS AND NOT CMAKE_CROSSCOMPILING AND NOT APP
4636
# or errors. This is useful to prevent breaking documentation inadvertently during
4737
# the course of development.
4838
if (DEVELOPER_MODE)
49-
ADD_GTKDOC_GENERATOR("docs-build-no-html.stamp" "--skip-html")
39+
ADD_GTKDOC_GENERATOR("docs-build-no-html.stamp" "--gtk;--skip-html")
5040
add_custom_target(gtkdoc-no-html ALL DEPENDS "${CMAKE_BINARY_DIR}/docs-build-no-html.stamp")
5141
endif ()
5242
endif ()

Source/PlatformWPE.cmake

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,39 @@
1+
include(GtkDoc)
12
include(WebKitDist)
23

4+
list(APPEND DocumentationDependencies
5+
WebKit
6+
"${CMAKE_SOURCE_DIR}/Source/WebKit/UIProcess/API/wpe/docs/wpe-docs.sgml"
7+
"${CMAKE_SOURCE_DIR}/Source/WebKit/WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-docs.sgml"
8+
"${CMAKE_SOURCE_DIR}/Source/WebKit/UIProcess/API/wpe/docs/wpe-${WPE_API_VERSION}-sections.txt"
9+
"${CMAKE_SOURCE_DIR}/Source/WebKit/WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-${WPE_API_VERSION}-sections.txt"
10+
)
11+
12+
if (ENABLE_GTKDOC)
13+
install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/wpe-${WPE_API_VERSION}/html/wpe-${WPE_API_VERSION}
14+
DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html"
15+
)
16+
install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/wpe-webextensions-${WPE_API_VERSION}/html/wpe-webextensions-${WPE_API_VERSION}
17+
DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html"
18+
)
19+
endif ()
20+
21+
ADD_GTKDOC_GENERATOR("docs-build.stamp" "--wpe")
22+
if (ENABLE_GTKDOC)
23+
add_custom_target(gtkdoc ALL DEPENDS "${CMAKE_BINARY_DIR}/docs-build.stamp")
24+
elseif (NOT ENABLED_COMPILER_SANITIZERS AND NOT CMAKE_CROSSCOMPILING AND NOT APPLE)
25+
add_custom_target(gtkdoc DEPENDS "${CMAKE_BINARY_DIR}/docs-build.stamp")
26+
27+
# Add a default build step which check that documentation does not have any warnings
28+
# or errors. This is useful to prevent breaking documentation inadvertently during
29+
# the course of development.
30+
if (DEVELOPER_MODE)
31+
ADD_GTKDOC_GENERATOR("docs-build-no-html.stamp" "--wpe;--skip-html")
32+
add_custom_target(gtkdoc-no-html ALL DEPENDS "${CMAKE_BINARY_DIR}/docs-build-no-html.stamp")
33+
endif ()
34+
endif ()
35+
336
if (DEVELOPER_MODE)
4-
# FIXME: This should depend on a gtkdoc target
5-
add_custom_target(Documentation)
37+
add_custom_target(Documentation DEPENDS gtkdoc)
638
WEBKIT_DECLARE_DIST_TARGETS(WPE wpewebkit ${TOOLS_DIR}/wpe/manifest.txt.in)
739
endif ()

Source/WebKit/ChangeLog

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
2018-12-04 Carlos Eduardo Ramalho <[email protected]>
2+
3+
[WPE] Add gtk-doc
4+
https://bugs.webkit.org/show_bug.cgi?id=178900
5+
6+
Reviewed by Michael Catanzaro.
7+
8+
Add gtk-doc to WPE port. This patch tries to reuse as much code from
9+
WebKitGTK+ as possible.
10+
11+
* PlatformWPE.cmake: Write variables to gtkdoc-wpe.cfg and gtkdoc-webextensions that is used by python script later.
12+
* UIProcess/API/wpe/WebKitWebContext.h: Placed sandbox functions in the same location as in the WebKitGTK+ for consistency.
13+
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Added.
14+
* UIProcess/API/wpe/docs/wpe-docs.sgml: Added.
15+
* WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h: Placed webkit_web_page_get_dom_document
16+
in the same position as in the WebKitGTK+ for consistency.
17+
* WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt: Added.
18+
* WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-docs.sgml: Added.
19+
120
2018-12-04 Carlos Garcia Campos <[email protected]>
221

322
[SOUP] Move URLSoup back to WebCore after r238771

Source/WebKit/PlatformWPE.cmake

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ file(MAKE_DIRECTORY ${FORWARDING_HEADERS_WPE_EXTENSION_DIR})
1010
file(MAKE_DIRECTORY ${FORWARDING_HEADERS_WPE_DOM_DIR})
1111

1212
configure_file(UIProcess/API/wpe/WebKitVersion.h.in ${DERIVED_SOURCES_WPE_API_DIR}/WebKitVersion.h)
13-
configure_file(wpe/wpe-webkit.pc.in ${CMAKE_BINARY_DIR}/wpe-webkit-${WPE_API_VERSION}.pc @ONLY)
14-
configure_file(wpe/wpe-web-extension.pc.in ${CMAKE_BINARY_DIR}/wpe-web-extension-${WPE_API_VERSION}.pc @ONLY)
13+
configure_file(wpe/wpe-webkit.pc.in ${WPE_PKGCONFIG_FILE} @ONLY)
14+
configure_file(wpe/wpe-web-extension.pc.in ${WPEWebExtension_PKGCONFIG_FILE} @ONLY)
1515

1616
add_definitions(-DWEBKIT2_COMPILATION)
1717

@@ -331,3 +331,42 @@ install(FILES ${WPE_API_INSTALLED_HEADERS}
331331
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/wpe-webkit-${WPE_API_VERSION}/wpe"
332332
COMPONENT "Development"
333333
)
334+
335+
file(WRITE ${CMAKE_BINARY_DIR}/gtkdoc-wpe.cfg
336+
"[wpe-${WPE_API_VERSION}]\n"
337+
"pkgconfig_file=${WPE_PKGCONFIG_FILE}\n"
338+
"decorator=WEBKIT_API|WEBKIT_DEPRECATED|WEBKIT_DEPRECATED_FOR\\(.+\\)\n"
339+
"deprecation_guard=WEBKIT_DISABLE_DEPRECATED\n"
340+
"namespace=webkit\n"
341+
"cflags=-I${CMAKE_SOURCE_DIR}/Source\n"
342+
" -I${WEBKIT_DIR}/Shared/API/glib\n"
343+
" -I${WEBKIT_DIR}/UIProcess/API/glib\n"
344+
" -I${WEBKIT_DIR}/UIProcess/API/wpe\n"
345+
" -I${FORWARDING_HEADERS_WPE_DIR}\n"
346+
"doc_dir=${WEBKIT_DIR}/UIProcess/API/wpe/docs\n"
347+
"source_dirs=${WEBKIT_DIR}/Shared/API/glib\n"
348+
" ${WEBKIT_DIR}/UIProcess/API/glib\n"
349+
" ${WEBKIT_DIR}/UIProcess/API/wpe\n"
350+
" ${DERIVED_SOURCES_WPE_API_DIR}\n"
351+
"headers=${WPE_ENUM_GENERATION_HEADERS}\n"
352+
"main_sgml_file=wpe-docs.sgml\n"
353+
)
354+
355+
file(WRITE ${CMAKE_BINARY_DIR}/gtkdoc-webextensions.cfg
356+
"[wpe-webextensions-${WPE_API_VERSION}]\n"
357+
"pkgconfig_file=${WPEWebExtension_PKGCONFIG_FILE}\n"
358+
"decorator=WEBKIT_API|WEBKIT_DEPRECATED|WEBKIT_DEPRECATED_FOR\\(.+\\)\n"
359+
"deprecation_guard=WEBKIT_DISABLE_DEPRECATED\n"
360+
"namespace=webkit_webextensions\n"
361+
"cflags=-I${CMAKE_SOURCE_DIR}/Source\n"
362+
" -I${WEBKIT_DIR}/WebProcess/InjectedBundle/API/wpe\n"
363+
" -I${WEBKIT_DIR}/WebProcess/InjectedBundle/API/wpe/DOM\n"
364+
" -I${FORWARDING_HEADERS_WPE_DIR}\n"
365+
"doc_dir=${WEBKIT_DIR}/WebProcess/InjectedBundle/API/wpe/docs\n"
366+
"source_dirs=${WEBKIT_DIR}/WebProcess/InjectedBundle/API/glib\n"
367+
" ${WEBKIT_DIR}/WebProcess/InjectedBundle/API/glib/DOM\n"
368+
" ${WEBKIT_DIR}/WebProcess/InjectedBundle/API/wpe\n"
369+
" ${WEBKIT_DIR}/WebProcess/InjectedBundle/API/wpe/DOM\n"
370+
"headers=${WPE_WEB_EXTENSION_API_INSTALLED_HEADERS}\n"
371+
"main_sgml_file=wpe-webextensions-docs.sgml\n"
372+
)

Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,13 @@ webkit_web_context_register_uri_scheme (WebKitWebContext
247247
gpointer user_data,
248248
GDestroyNotify user_data_destroy_func);
249249

250+
WEBKIT_API void
251+
webkit_web_context_set_sandbox_enabled (WebKitWebContext *context,
252+
gboolean enabled);
253+
254+
WEBKIT_API gboolean
255+
webkit_web_context_get_sandbox_enabled (WebKitWebContext *context);
256+
250257
WEBKIT_API gboolean
251258
webkit_web_context_get_spell_checking_enabled (WebKitWebContext *context);
252259

@@ -296,13 +303,6 @@ webkit_web_context_set_process_model (WebKitWebContext
296303
WEBKIT_API WebKitProcessModel
297304
webkit_web_context_get_process_model (WebKitWebContext *context);
298305

299-
WEBKIT_API void
300-
webkit_web_context_set_sandbox_enabled (WebKitWebContext *context,
301-
gboolean enabled);
302-
303-
WEBKIT_API gboolean
304-
webkit_web_context_get_sandbox_enabled (WebKitWebContext *context);
305-
306306
WEBKIT_API void
307307
webkit_web_context_initialize_notification_permissions
308308
(WebKitWebContext *context,

0 commit comments

Comments
 (0)