Skip to content

Commit

Permalink
Landing latest changes for the 1.3 branch which notably includes HTML…
Browse files Browse the repository at this point in the history
…5 video/audio support, faster page loads, and various graphics and stability improvements among others. You should beware that Config::resources_path is now gone and the library will now load icudt67l.dat and cacert.pem from the FileSystem loader, eg. /assets/resources/icudt67l.dat. Failure to load these resources will now trigger a fatal assertion to help developers detect these issues.
  • Loading branch information
adamjs committed Jul 15, 2021
1 parent 5011dbf commit 73a67cd
Show file tree
Hide file tree
Showing 16 changed files with 104 additions and 138 deletions.
8 changes: 4 additions & 4 deletions Deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ elseif (PORT MATCHES "UltralightWin")
endif ()
endif ()

set(ULTRALIGHTCORE_REV "a4c802a6")
set(WEBCORE_REV "64ab2718")
set(ULTRALIGHT_REV "3b5156ba")
set(APPCORE_REV "722e157")
set(ULTRALIGHTCORE_REV "93e247b6")
set(WEBCORE_REV "0a3f4d43")
set(ULTRALIGHT_REV "6fefa44e")
set(APPCORE_REV "ce28bee")

set(ULTRALIGHTCORE_DIR "${CMAKE_CURRENT_BINARY_DIR}/deps/UltralightCore/")
set(WEBCORE_DIR "${CMAKE_CURRENT_BINARY_DIR}/deps/WebCore/")
Expand Down
3 changes: 2 additions & 1 deletion packager/CreateSDK.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
INSTALL(DIRECTORY "${ULTRALIGHTCORE_DIR}/bin/" DESTINATION "bin" OPTIONAL)
INSTALL(DIRECTORY "${ULTRALIGHTCORE_DIR}/lib/" DESTINATION "lib" OPTIONAL)
INSTALL(DIRECTORY "${ULTRALIGHTCORE_DIR}/include/" DESTINATION "include" OPTIONAL PATTERN "Ultralight/private" EXCLUDE)
INSTALL(DIRECTORY "${WEBCORE_DIR}/bin/" DESTINATION "bin" OPTIONAL)
INSTALL(DIRECTORY "${WEBCORE_DIR}/bin/" DESTINATION "bin" OPTIONAL PATTERN "resources" EXCLUDE)
INSTALL(DIRECTORY "${WEBCORE_DIR}/bin/resources" DESTINATION "resources" OPTIONAL)
INSTALL(DIRECTORY "${WEBCORE_DIR}/lib/" DESTINATION "lib" OPTIONAL)
INSTALL(DIRECTORY "${WEBCORE_DIR}/include/" DESTINATION "include" OPTIONAL)
INSTALL(DIRECTORY "${WEBCORE_DIR}/inspector/" DESTINATION "inspector" OPTIONAL)
Expand Down
4 changes: 4 additions & 0 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ endif ()
set(ULTRALIGHT_INCLUDE_DIR "${SDK_ROOT}/include")
set(ULTRALIGHT_BINARY_DIR "${SDK_ROOT}/bin")
set(ULTRALIGHT_INSPECTOR_DIR "${SDK_ROOT}/inspector")
set(ULTRALIGHT_RESOURCES_DIR "${SDK_ROOT}/resources")

if (CMAKE_SYSTEM_NAME MATCHES "Windows")
set(ULTRALIGHT_LIBRARY_DIR "${SDK_ROOT}/lib")
Expand Down Expand Up @@ -63,10 +64,13 @@ if (${IN_SOURCE_BUILD})
COMMAND ${CMAKE_COMMAND} -E make_directory "${SDK_ROOT}/bin"
COMMAND ${CMAKE_COMMAND} -E make_directory "${SDK_ROOT}/include"
COMMAND ${CMAKE_COMMAND} -E make_directory "${SDK_ROOT}/inspector"
COMMAND ${CMAKE_COMMAND} -E make_directory "${SDK_ROOT}/resources"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHTCORE_DIR}/bin/" "${SDK_ROOT}/bin"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHTCORE_DIR}/include/" "${SDK_ROOT}/include"
COMMAND ${CMAKE_COMMAND} -E remove_directory "${SDK_ROOT}/include/Ultralight/private"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${WEBCORE_DIR}/bin/" "${SDK_ROOT}/bin"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${WEBCORE_DIR}/bin/resources" "${SDK_ROOT}/resources"
COMMAND ${CMAKE_COMMAND} -E remove_directory "${SDK_ROOT}/bin/resources"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${WEBCORE_DIR}/include/" "${SDK_ROOT}/include"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${WEBCORE_DIR}/inspector/" "${SDK_ROOT}/inspector"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_DIR}/bin/" "${SDK_ROOT}/bin"
Expand Down
12 changes: 11 additions & 1 deletion samples/Sample 1 - Render to PNG/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,15 @@ add_executable(${APP_NAME} "main.cpp")

# Copy all binaries to target directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)

# Set the assets path to "/assets" or "/../Resources/assets" on macOS
if (APPLE)
set(ASSETS_PATH "$<TARGET_FILE_DIR:${APP_NAME}>/../Resources/assets")
else ()
set(ASSETS_PATH "$<TARGET_FILE_DIR:${APP_NAME}>/assets")
endif ()

# Copy resources to assets directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_RESOURCES_DIR}" "${ASSETS_PATH}/resources")
10 changes: 1 addition & 9 deletions samples/Sample 1 - Render to PNG/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,7 @@ class MyApp : public LoadListener,
///
/// Setup our config.
///
/// We need to tell config where our resources are so it can load our
/// bundled certificate chain to make HTTPS requests and perform text layout
/// using the ICU unicode data library.
///
/// *NOTE* Failure to load the ICU library may cause the library to crash
/// during certain text layout operations. Check the log for warnings.
///
Config config;
config.resource_path = "./resources/";

///
/// Pass our configuration to the Platform singleton so that the library
Expand All @@ -66,7 +58,7 @@ class MyApp : public LoadListener,
/// You could replace this with your own to provide your own file loader
/// (useful if you need to bundle encrypted / compressed HTML assets).
///
Platform::instance().set_file_system(GetPlatformFileSystem("."));
Platform::instance().set_file_system(GetPlatformFileSystem("./assets/"));

///
/// Register our MyApp instance as a logger so we can handle the
Expand Down
8 changes: 0 additions & 8 deletions samples/Sample 1 - Render to PNG/main_capi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ int main() {
ulConfigSetFontFamilyStandard(config, font_family);
ulDestroyString(font_family);

///
/// We need to tell config where our resources are so it can load our
/// bundled certificate chain and make HTTPS requests.
///
ULString resource_path = ulCreateString("./resources/");
ulConfigSetResourcePath(config, resource_path);
ulDestroyString(resource_path);

///
/// Make sure the GPU renderer is disabled so we can render to an offscreen
/// pixel buffer surface. (This is disabled by default, so not needed here)
Expand Down
12 changes: 11 additions & 1 deletion samples/Sample 2 - Basic App/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,15 @@ endif()

# Copy all binaries to target directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)

# Set the assets path to "/assets" or "/../Resources/assets" on macOS
if (APPLE)
set(ASSETS_PATH "$<TARGET_FILE_DIR:${APP_NAME}>/../Resources/assets")
else ()
set(ASSETS_PATH "$<TARGET_FILE_DIR:${APP_NAME}>/assets")
endif ()

# Copy resources to assets directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_RESOURCES_DIR}" "${ASSETS_PATH}/resources")
12 changes: 11 additions & 1 deletion samples/Sample 3 - Resizable App/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,15 @@ endif()

# Copy all binaries to target directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)

# Set the assets path to "/assets" or "/../Resources/assets" on macOS
if (APPLE)
set(ASSETS_PATH "$<TARGET_FILE_DIR:${APP_NAME}>/../Resources/assets")
else ()
set(ASSETS_PATH "$<TARGET_FILE_DIR:${APP_NAME}>/assets")
endif ()

# Copy resources to assets directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_RESOURCES_DIR}" "${ASSETS_PATH}/resources")
12 changes: 11 additions & 1 deletion samples/Sample 4 - JavaScript/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,15 @@ endif()

# Copy all binaries to target directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)

# Set the assets path to "/assets" or "/../Resources/assets" on macOS
if (APPLE)
set(ASSETS_PATH "$<TARGET_FILE_DIR:${APP_NAME}>/../Resources/assets")
else ()
set(ASSETS_PATH "$<TARGET_FILE_DIR:${APP_NAME}>/assets")
endif ()

# Copy resources to assets directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_RESOURCES_DIR}" "${ASSETS_PATH}/resources")
8 changes: 6 additions & 2 deletions samples/Sample 5 - File Loading/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@ endif()

# Copy all binaries to target directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)

# Set the assets path to "/assets" or "/../Resources/assets" on macOS
if (APPLE)
set(ASSETS_PATH "$<TARGET_FILE_DIR:${APP_NAME}>/../Resources/assets")
else ()
set(ASSETS_PATH "$<TARGET_FILE_DIR:${APP_NAME}>/assets")
endif ()

# Copy assets to assets path
# Copy assets to assets directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/assets/" "${ASSETS_PATH}")

# Copy resources to assets directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_RESOURCES_DIR}" "${ASSETS_PATH}/resources")
8 changes: 6 additions & 2 deletions samples/Sample 6 - Intro to C API/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@ endif()

# Copy all binaries to target directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)

# Set the assets path to "/assets" or "/../Resources/assets" on macOS
if (APPLE)
set(ASSETS_PATH "$<TARGET_FILE_DIR:${APP_NAME}>/../Resources/assets")
else ()
set(ASSETS_PATH "$<TARGET_FILE_DIR:${APP_NAME}>/assets")
endif ()

# Copy assets to assets path
# Copy assets to assets directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/assets/" "${ASSETS_PATH}")

# Copy resources to assets directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_RESOURCES_DIR}" "${ASSETS_PATH}/resources")
23 changes: 9 additions & 14 deletions samples/Sample 7 - OpenGL Integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,20 @@ endif()

# Copy all binaries to target directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)

# Set the assets path to "/assets" or "/../Resources/assets" on macOS
if (APPLE)
set(ASSETS_PATH "$<TARGET_FILE_DIR:${APP_NAME}>/../Resources/assets")
else ()
set(ASSETS_PATH "$<TARGET_FILE_DIR:${APP_NAME}>/assets")
endif ()
# Copy assets to assets path

# Copy assets to assets directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/assets/" "${ASSETS_PATH}")
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/assets/" "${ASSETS_PATH}")

if (APPLE)
# Copy resources to resources directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}/resources/" "$<TARGET_FILE_DIR:${APP_NAME}>/../Resources/resources")

# Resources directory is also copied to target directory in the "Copy all binaries" step.
# Remove this duplicate directory.
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove_directory "$<TARGET_FILE_DIR:${APP_NAME}>/resources")
endif ()

# Copy resources to assets directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_RESOURCES_DIR}" "${ASSETS_PATH}/resources")
6 changes: 0 additions & 6 deletions samples/Sample 7 - OpenGL Integration/src/Sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ Sample::Sample() {
config.scroll_timer_delay = 1.0 / (mode->refreshRate);
config.animation_timer_delay = 1.0 / (mode->refreshRate);

///
/// We need to tell config where our resources are so it can load our
/// bundled certificate chain and make HTTPS requests.
///
config.resource_path = "./resources/";

///
/// Pass our configuration to the Platform singleton so that the library
/// can use it.
Expand Down
16 changes: 5 additions & 11 deletions samples/Sample 8 - Web Browser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ endif()

# Copy all binaries to target directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}" $<TARGET_FILE_DIR:${APP_NAME}>)

# Set the assets path to "/assets" or "/../Resources/assets" on macOS
if (APPLE)
set(ASSETS_PATH "$<TARGET_FILE_DIR:${APP_NAME}>/../Resources/assets")
else ()
Expand All @@ -41,13 +42,6 @@ add_custom_command(TARGET ${APP_NAME} POST_BUILD
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_INSPECTOR_DIR}" "${ASSETS_PATH}/inspector")

if (APPLE)
# Copy resources to resources directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}/resources/" "$<TARGET_FILE_DIR:${APP_NAME}>/../Resources/resources")

# Resources directory is also copied to target directory in the "Copy all binaries" step.
# Remove this duplicate directory.
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove_directory "$<TARGET_FILE_DIR:${APP_NAME}>/resources")
endif ()
# Copy resources to assets directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_RESOURCES_DIR}" "${ASSETS_PATH}/resources")
Loading

0 comments on commit 73a67cd

Please sign in to comment.